00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 #ifndef SO_WX
00025 #define SO_WX
00026 
00028 
00029 
00030 
00032 
00033 #ifndef SOWX
00034   #define SOWX
00035 #endif
00036 
00037 
00038 #include <wx/wxprec.h>
00039 
00040 
00041 #ifdef __BORLANDC__
00042 #pragma hdrstop
00043 #endif
00044 
00045 #if defined(_WIN32)
00046 #  include <SoVersion.h>
00047 #  if defined(_DEBUG)
00048 #    define __INVWXDLL "InventorWxD.dll"
00049 #    define __INVWXLIB "InventorWxD.lib"
00050 #  else
00051 #    define __INVWXDLL "InventorWx.dll"
00052 #    define __INVWXLIB "InventorWx.lib"
00053 #  endif
00054 #  ifndef InventorWx_EXPORTS
00055 #    ifndef OIV_DISABLE_AUTOLINK
00056 #      pragma comment(lib,__INVWXLIB)
00057 #    endif
00058 #  endif
00059 #else
00060 #    define __INVWXDLL "libInventorWx"
00061 #endif
00062 
00063 
00064 #ifndef WX_PRECOMP
00065 #include <wx/wx.h>
00066 #endif
00067 
00068 #include <Inventor/SbLinear.h>
00069 #include <Inventor/Wx/SoWxDef.h>
00070 #include <Inventor/helpers/SbGlContextHelper.h>
00071 
00072 #if !defined(_WIN32) && !defined(APPLE)
00073 #include <X11/Xlib.h> 
00074 #endif
00075 
00076 #include <Inventor/SoModule.h>
00077 SO_MODULE_HEADER(SoInventorWx, __INVWXDLL)
00078 
00079 class SoWxSensorHandler;
00080 class SbPList;
00081 class SoAction;
00082 
00102 class  SoWx
00103 {
00104     
00105 public:
00106 
00114   static void init( wxApp* app, wxFrame* topLevelWidget );
00115 
00120     static wxWindow* init( const char* appName, const char* className = NULL );
00121 
00126   static void threadInit( wxApp* app, wxFrame* topLevelWidget  );
00127 
00131   static bool isInitialized();
00132 
00138   static void show( wxWindow* widget );
00139 
00145   static void hide( wxWindow* widget );
00146 
00150   static void mainLoop();
00151 
00155   static SbGlContextHelper::Display getDisplay();
00156 
00161   static wxFrame* getTopLevelWidget();
00162 
00166   static void setWidgetSize( wxWindow* widget, const SbVec2s& size );
00167 
00171   static SbVec2s getWidgetSize( wxWindow* widget );
00172 
00178   static void createSimpleErrorDialog( wxWindow* widget, char *dialogTitle, 
00179                                        char *errorStr1, char *errorStr2 = NULL );
00180 
00189   static void finish();
00190 
00191  private:
00192   
00193 
00194   static wxFrame* m_mainWidget;
00195 
00196   static wxApp* m_wxApplication;
00197   static wxApp* getWxApp() { return m_wxApplication; }
00198  
00199 private:
00200 
00201  static SoWxSensorHandler* m_sensorHandler;
00202 
00203 private:
00204   static void constructorCommon();
00205     static int m_wxInitCount;
00206   static int s_initRefCount;
00207   static const char *s_versionString;
00208 };
00209 
00210 #endif // SO_WX
00211 
00212 
00213