00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifdef SOQT
00053 # include <Inventor/Qt/SoQt.h>
00054 #elif defined(SOWX)
00055 # include <Inventor/Wx/SoXt2SoWx.h>
00056 # include <Inventor/Wx/SoWx.h>
00057 #elif defined(_WIN32)
00058 # include <Inventor/Win/SoXt2SoWin.h>
00059 # include <Inventor/Win/SoWin.h>
00060 #else
00061
00062 #ifndef _SO_XT_
00063 #define _SO_XT_
00064
00065 #include <SbTypes.h>
00066 #include <Xm/Xm.h>
00067 #include <Inventor/SbBasic.h>
00068 #include <Inventor/SbLinear.h>
00069 #include <Inventor/Xt/SoXtDef.h>
00070 #include <Inventor/Xt/SoXtLocalisation.h>
00071 #include <Inventor/Xt/SoInventorXtLibName.h>
00072
00073 #include <Inventor/SoModule.h>
00074 SO_MODULE_HEADER(SoInventorXt, __INVENTORXTDLL)
00075
00076 class SbPList;
00077 class SoXtEventHandler;
00078 class SoAction;
00079
00102 class SoXt {
00103
00104 public:
00112 static SoWidget init(const char *appName,
00113 const char *className = "Inventor");
00114
00121 static void init(SoWidget topLevelWidget);
00122
00123 #if 1
00124
00125
00126
00127 SoDEPRECATED
00128 static SoWidget threadInit(const char *appName,
00129 const char *className = "Inventor");
00130 SoDEPRECATED
00132 static void threadInit(SoWidget topLevelWidget);
00133 #endif
00138 static bool isInitialized();
00139
00199 static void finish();
00200
00205 static void mainLoop();
00206
00211 static void nextEvent(XtAppContext appContext, XEvent *event)
00212 { XtAppNextEvent(appContext, event); }
00213
00218 static Boolean dispatchEvent(XEvent *event);
00219
00223 static XtAppContext getAppContext();
00224
00228 static Display *getDisplay();
00229
00233 static SoWidget getTopLevelWidget();
00234
00235
00236
00237
00238
00243 static void show(SoWidget widget);
00244
00249 static void hide(SoWidget widget);
00250
00259 static XmString encodeString(char *s);
00260
00269 static char *decodeString(XmString xs);
00270
00274 static void setWidgetSize(SoWidget w, const SbVec2s &size);
00275
00279 static SbVec2s getWidgetSize(SoWidget w);
00280
00286 static SoWidget getShellWidget(SoWidget w);
00287
00293 static void createSimpleErrorDialog(SoWidget widget, char *dialogTitle,
00294 char *errorStr1, char *errorStr2 = NULL);
00295
00302 static void getPopupArgs(Display *d, int scr, ArgList args, int *n);
00303
00312 static void registerColormapLoad(SoWidget widget, SoWidget shell);
00313
00320 static void addColormapToShell(SoWidget widget, SoWidget shell);
00321
00326 static void removeColormapFromShell(SoWidget widget, SoWidget shell);
00327
00328 private:
00329
00330
00331
00332 static void addExtensionEventHandler(SoWidget w,
00333 int extensionEventType,
00334 XtEventHandler proc,
00335 XtPointer clientData);
00336 static void removeExtensionEventHandler(SoWidget w,
00337 int extensionEventType,
00338 XtEventHandler proc,
00339 XtPointer clientData);
00340
00341
00342
00343
00344
00345 static SoWidget getwidget( unsigned int whatisit );
00346
00347
00348 static void canExit(SbBool ce);
00349
00350 static void setEventHandler();
00351
00352 static SoXtEventHandler *eventHandler;
00353
00354 private:
00355 static void getExtensionEventHandler(
00356 XEvent *event,
00357 SoWidget &w,
00358 XtEventHandler &proc,
00359 XtPointer &clientData);
00360
00361 private:
00366 static void activeLoop();
00367
00368 static SoWidget mainWidget;
00369 static bool m_internalApp;
00370 static SbBool m_canExit;
00371
00372 static SbPList *handlerList;
00373
00374
00375
00376 static SoWidget label[155];
00377
00378 static void localisationlabel(SoWidget parent);
00379
00380
00381
00382 static void setupInventorGLDisplay();
00383
00384 static int s_initRefCount;
00385 static const char *s_versionString;
00386 };
00387
00388 #endif
00389
00390 #endif // SOQT
00391
00392