1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0032308: Configuration - make Xlib dependency optional

MACOSX_USE_GLX has been renamed to HAVE_XLIB and now configurable on Linux target.

Xw_Window.hxx now export class on non-Linux platforms.
OpenGl_Window now creates an off-screen EGL surface also in case of
window-less desktop setup (e.g. with disabled Xlib on Linux).

Draw_Window - code has been cleaned up.
Class definition has been unified across platforms when possible.
Unusued constructors have been removed.
Internal header files (MainWindow.h, init.h, etc.) have been renamed to .pxx
to avoid their unexpected distribution in "inc".
This commit is contained in:
kgv
2021-04-16 16:12:16 +03:00
committed by bugmaster
parent e8e157df45
commit b69e576af0
48 changed files with 2288 additions and 3044 deletions

View File

@@ -44,11 +44,13 @@
#include <stdio.h>
#ifdef _WIN32
#include <WNT_Window.hxx>
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
#include <Cocoa_Window.hxx>
#include <WNT_Window.hxx>
#elif defined(HAVE_XLIB)
#include <Xw_Window.hxx>
#elif defined(__APPLE__)
#include <Cocoa_Window.hxx>
#else
#include <Xw_Window.hxx>
#endif
// =======================================================================
@@ -106,13 +108,15 @@ void View_Widget::Init()
#ifdef _WIN32
Aspect_Handle aWindowHandle = (Aspect_Handle)winId();
Handle(Aspect_Window) aWnd = new WNT_Window (aWindowHandle);
#elif defined (__APPLE__) && !defined (MACOSX_USE_GLX)
#elif defined (HAVE_XLIB)
Aspect_Drawable aWindowHandle = (Aspect_Drawable )winId();
Handle(Aspect_DisplayConnection) aDispConnection = myViewer->GetContext()->CurrentViewer()->Driver()->GetDisplayConnection();
Handle(Aspect_Window) aWnd = new Xw_Window (aDispConnection, aWindowHandle);
#elif defined (__APPLE__)
NSView* aViewHandle = (NSView*)winId();
Handle(Aspect_Window) aWnd = new Cocoa_Window (aViewHandle);
#else
Window aWindowHandle = (Window)winId();
Handle(Aspect_DisplayConnection) aDispConnection = myViewer->GetContext()->CurrentViewer()->Driver()->GetDisplayConnection();
Handle(Aspect_Window) aWnd = new Xw_Window (aDispConnection, aWindowHandle);
//
#endif
myViewer->SetWindow (aWnd);