1
/**************************************************************************\
3
* This file is part of the Coin 3D visualization library.
4
* Copyright (C) 1998-2005 by Systems in Motion. All rights reserved.
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* ("GPL") version 2 as published by the Free Software Foundation.
9
* See the file LICENSE.GPL at the root directory of this source
10
* distribution for additional information about the GNU GPL.
12
* For using Coin with software that can not be combined with the GNU
13
* GPL, and for taking advantage of the additional benefits of our
14
* support services, please contact Systems in Motion about acquiring
15
* a Coin Professional Edition License.
17
* See <URL:http://www.coin3d.org/> for more information.
19
* Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
20
* <URL:http://www.sim.no/>.
22
\**************************************************************************/
24
// src/Inventor/Qt/SoQt.h. Generated from SoGui.h.in by configure.
29
#include <Inventor/Qt/SoQtBasic.h>
31
// FIXME: use configure defines for the header files.
36
#endif // __COIN_SOQT__
38
#include <X11/Intrinsic.h>
40
#endif // __COIN_SOXT__
42
// Fetch stdlib.h, so NULL is defined before glib.h is (indirectly)
43
// included. Otherwise we get a compile error with KCC on some
49
#endif // __COIN_SOGTK__
52
#endif // __COIN_SOWIN__
54
#include <Inventor/SbBasic.h>
55
#include <Inventor/SbLinear.h>
56
#include <Inventor/SbString.h>
57
#include <Inventor/SoDB.h>
58
#include <Inventor/errors/SoDebugError.h>
60
// *************************************************************************
62
class SOQT_DLL_API SoQt
66
static QWidget * init(const char * appname, const char * classname = "SoQt");
67
static QWidget * init(int & argc, char ** argv,
68
const char * appname, const char * classname = "SoQt");
69
static void init(QWidget * toplevelwidget);
71
static void mainLoop(void);
72
static void exitMainLoop(void);
73
static void done(void);
75
static QWidget * getTopLevelWidget(void);
76
static QWidget * getShellWidget(const QWidget * w);
78
static void show(QWidget * const widget);
79
static void hide(QWidget * const widget);
81
static void setWidgetSize(QWidget * const widget, const SbVec2s size);
82
static SbVec2s getWidgetSize(const QWidget * widget);
84
static void createSimpleErrorDialog(QWidget * widget,
87
const char * string2 = NULL);
89
static void getVersionInfo(int * major = NULL,
92
static const char * getVersionString(void);
95
UNSPECIFIED_ERROR = 0,
99
typedef void FatalErrorCB(const SbString errmsg, SoQt::FatalErrors errcode,
101
static FatalErrorCB * setFatalErrorHandler(SoQt::FatalErrorCB * cb,
104
static SbBool isDebugLibrary(void);
105
static SbBool isCompatible(unsigned int major, unsigned int minor);
107
enum ABIType { DLL, LIB, UNKNOWN };
108
static ABIType getABIType(void);
111
// Since the class consists solely of static functions, hide the
112
// default constructor and the destructor so nobody can instantiate
121
// FIXME!: audit and remove as much as possible of the remaining
122
// toolkit specific parts below. 20020117 mortene.
126
static void nextEvent(XtAppContext, XEvent *);
127
static Boolean dispatchEvent(XEvent * event);
128
static XtAppContext getAppContext(void);
129
static Display * getDisplay(void);
130
static XmString encodeString(const char * const str);
131
static char * decodeString(XmString xstring);
132
static void getPopupArgs(Display * display, int screen,
133
ArgList args, int * n);
135
static void registerColormapLoad(Widget widget, Widget shell);
136
static void addColormapToShell(Widget widget, Widget shell);
137
static void removeColormapFromShell(Widget widget, Widget shell);
139
static void addExtensionEventHandler(Widget widget,
140
int eventType, XtEventHandler proc,
141
XtPointer clientData);
142
static void removeExtensionEventHandler(Widget widget,
143
int eventType, XtEventHandler proc,
144
XtPointer clientData);
147
static void getExtensionEventHandler(XEvent * event, Widget & widget,
148
XtEventHandler & proc,
149
XtPointer & clientData);
150
#endif // __COIN_SOXT__
152
#ifdef __COIN_SOGTK__
154
friend class SoGtkComponent;
155
enum SoGtkComponentAction { CREATION, DESTRUCTION, CHANGE };
156
typedef void SoGtkComponentActionCallback(SoGtkComponent *, SoGtk::SoGtkComponentAction, void *);
158
static void addComponentActionCallback(SoGtkComponentActionCallback *, void *);
159
static void removeComponentActionCallback(SoGtkComponentActionCallback *, void *);
161
static int getComponents(SbPList & components);
164
static void invokeComponentActionCallbacks(SoGtkComponent * component,
165
SoGtkComponentAction action);
167
static gint componentCreation(SoGtkComponent * component);
168
static gint componentDestruction(SoGtkComponent * component);
169
static gint componentChange(SoGtkComponent * component);
172
static gint timerSensorCB(gpointer data);
173
static gint idleSensorCB(gpointer data);
174
static gint delaySensorCB(gpointer data);
176
static GtkWidget * mainWidget;
177
static SbPList * components;
178
static SbPList * component_callbacks;
179
#endif // __COIN_SOGTK__
182
// *************************************************************************