29 #include <Inventor/Qt/SoQtBasic.h>
36 #if QT_VERSION >= 0x040000
37 #include <QtCore/QObject>
42 #endif // __COIN_SOQT__
44 #include <X11/Intrinsic.h>
46 #endif // __COIN_SOXT__
55 #endif // __COIN_SOGTK__
58 #endif // __COIN_SOWIN__
60 #include <Inventor/SbBasic.h>
61 #include <Inventor/SbLinear.h>
62 #include <Inventor/SbString.h>
63 #include <Inventor/SoDB.h>
64 #include <Inventor/errors/SoDebugError.h>
72 static QWidget * init(
const char * appname,
const char * classname =
"SoQt");
73 static QWidget * init(
int & argc,
char ** argv,
74 const char * appname,
const char * classname =
"SoQt");
75 static void init(QWidget * toplevelwidget);
77 static void mainLoop(
void);
78 static void exitMainLoop(
void);
79 static void done(
void);
81 static QWidget * getTopLevelWidget(
void);
82 static QWidget * getShellWidget(
const QWidget * w);
84 static void show(QWidget *
const widget);
85 static void hide(QWidget *
const widget);
87 static void setWidgetSize(QWidget *
const widget,
const SbVec2s size);
88 static SbVec2s getWidgetSize(
const QWidget * widget);
90 static void createSimpleErrorDialog(QWidget * widget,
93 const char * string2 = NULL);
95 static void getVersionInfo(
int * major = NULL,
98 static const char * getVersionString(
void);
99 static const char * getVersionToolkitString(
void);
102 UNSPECIFIED_ERROR = 0,
111 static SbBool isDebugLibrary(
void);
112 static SbBool isCompatible(
unsigned int major,
unsigned int minor);
115 static ABIType getABIType(
void);
117 static void lockGL(
void);
118 static void unlockGL(
void);
136 static void nextEvent(XtAppContext, XEvent *);
137 static Boolean dispatchEvent(XEvent * event);
138 static XtAppContext getAppContext(
void);
139 static Display * getDisplay(
void);
140 static XmString encodeString(
const char *
const str);
141 static char * decodeString(XmString xstring);
142 static void getPopupArgs(Display * display,
int screen,
143 ArgList args,
int * n);
145 static void registerColormapLoad(Widget widget, Widget shell);
146 static void addColormapToShell(Widget widget, Widget shell);
147 static void removeColormapFromShell(Widget widget, Widget shell);
149 static void addExtensionEventHandler(Widget widget,
150 int eventType, XtEventHandler proc,
151 XtPointer clientData);
152 static void removeExtensionEventHandler(Widget widget,
153 int eventType, XtEventHandler proc,
154 XtPointer clientData);
157 static void getExtensionEventHandler(XEvent * event, Widget & widget,
158 XtEventHandler & proc,
159 XtPointer & clientData);
160 #endif // __COIN_SOXT__
162 #ifdef __COIN_SOGTK__
164 friend class SoGtkComponent;
165 enum SoGtkComponentAction { CREATION, DESTRUCTION, CHANGE };
166 typedef void SoGtkComponentActionCallback(SoGtkComponent *, SoGtk::SoGtkComponentAction,
void *);
168 static void addComponentActionCallback(SoGtkComponentActionCallback *,
void *);
169 static void removeComponentActionCallback(SoGtkComponentActionCallback *,
void *);
171 static int getComponents(SbPList & components);
174 static void invokeComponentActionCallbacks(SoGtkComponent * component,
175 SoGtkComponentAction action);
177 static gint componentCreation(SoGtkComponent * component);
178 static gint componentDestruction(SoGtkComponent * component);
179 static gint componentChange(SoGtkComponent * component);
182 static gint timerSensorCB(gpointer data);
183 static gint idleSensorCB(gpointer data);
184 static gint delaySensorCB(gpointer data);
186 static GtkWidget * mainWidget;
187 static SbPList * components;
188 static SbPList * component_callbacks;
189 #endif // __COIN_SOGTK__
197 #define SOQT_ENTER_GL_SECTION() do { SoQt::lockGL(); } while(FALSE)
198 #define SOQT_LEAVE_GL_SECTION() do { SoQt::unlockGL(); } while(FALSE)