~ubuntu-branches/ubuntu/oneiric/soqt/oneiric

« back to all changes in this revision

Viewing changes to build/msvc8/src/Inventor/Qt/SoQt.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2009-03-01 11:41:00 UTC
  • mfrom: (1.1.4 upstream) (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090301114100-f4zz3n1oasa52fgk
Tags: 1.4.2~svn20090224-2
* Upload upstream SVN head version containing fixes to build with Coin 3
  (Closes: #515729, #515736, #515742).  Upstream indicated to me that
  SVN is stable enough to release.

* control: Update Standards-Version to 3.8.0; no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**************************************************************************\
2
 
 *
3
 
 *  This file is part of the Coin 3D visualization library.
4
 
 *  Copyright (C) 1998-2005 by Systems in Motion.  All rights reserved.
5
 
 *
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.
11
 
 *
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.
16
 
 *
17
 
 *  See <URL:http://www.coin3d.org/> for more information.
18
 
 *
19
 
 *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
20
 
 *  <URL:http://www.sim.no/>.
21
 
 *
22
 
\**************************************************************************/
23
 
 
24
 
// src/Inventor/Qt/SoQt.h.  Generated from SoGui.h.in by configure.
25
 
 
26
 
#ifndef SOQT_H
27
 
#define SOQT_H
28
 
 
29
 
#include <Inventor/Qt/SoQtBasic.h>
30
 
 
31
 
// FIXME: use configure defines for the header files.
32
 
// 20020613 mortene.
33
 
 
34
 
#ifdef __COIN_SOQT__
35
 
#include <qobject.h>
36
 
#endif // __COIN_SOQT__
37
 
#ifdef __COIN_SOXT__
38
 
#include <X11/Intrinsic.h>
39
 
#include <Xm/Xm.h>
40
 
#endif // __COIN_SOXT__
41
 
#ifdef __COIN_SOGTK__
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
44
 
// systems.
45
 
#include <stdlib.h>
46
 
#include <gtk/gtk.h>
47
 
class SoGtkComponent;
48
 
class SbPList;
49
 
#endif // __COIN_SOGTK__
50
 
#ifdef __COIN_SOWIN__
51
 
#include <windows.h>
52
 
#endif // __COIN_SOWIN__
53
 
 
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>
59
 
 
60
 
// *************************************************************************
61
 
 
62
 
class SOQT_DLL_API SoQt
63
 
{
64
 
 
65
 
public:
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);
70
 
 
71
 
  static void mainLoop(void);
72
 
  static void exitMainLoop(void);
73
 
  static void done(void);
74
 
 
75
 
  static QWidget * getTopLevelWidget(void);
76
 
  static QWidget * getShellWidget(const QWidget * w);
77
 
 
78
 
  static void show(QWidget * const widget);
79
 
  static void hide(QWidget * const widget);
80
 
 
81
 
  static void setWidgetSize(QWidget * const widget, const SbVec2s size);
82
 
  static SbVec2s getWidgetSize(const QWidget * widget);
83
 
 
84
 
  static void createSimpleErrorDialog(QWidget * widget,
85
 
                                      const char * title,
86
 
                                      const char * string1,
87
 
                                      const char * string2 = NULL);
88
 
 
89
 
  static void getVersionInfo(int * major = NULL,
90
 
                             int * minor = NULL,
91
 
                             int * micro = NULL);
92
 
  static const char * getVersionString(void);
93
 
 
94
 
  enum FatalErrors {
95
 
    UNSPECIFIED_ERROR = 0,
96
 
    NO_OPENGL_CANVAS,
97
 
    INTERNAL_ASSERT
98
 
  };
99
 
  typedef void FatalErrorCB(const SbString errmsg, SoQt::FatalErrors errcode,
100
 
                            void * userdata);
101
 
  static FatalErrorCB * setFatalErrorHandler(SoQt::FatalErrorCB * cb,
102
 
                                             void * userdata);
103
 
 
104
 
  static SbBool isDebugLibrary(void);
105
 
  static SbBool isCompatible(unsigned int major, unsigned int minor);
106
 
 
107
 
  enum ABIType { DLL, LIB, UNKNOWN };
108
 
  static ABIType getABIType(void);
109
 
 
110
 
private:
111
 
  // Since the class consists solely of static functions, hide the
112
 
  // default constructor and the destructor so nobody can instantiate
113
 
  // it.
114
 
  SoQt(void);
115
 
  virtual ~SoQt();
116
 
 
117
 
  friend class SoGuiP;
118
 
  friend class SoQtP;
119
 
 
120
 
 
121
 
  // FIXME!: audit and remove as much as possible of the remaining
122
 
  // toolkit specific parts below. 20020117 mortene.
123
 
 
124
 
#ifdef __COIN_SOXT__
125
 
public:
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);
134
 
 
135
 
  static void registerColormapLoad(Widget widget, Widget shell);
136
 
  static void addColormapToShell(Widget widget, Widget shell);
137
 
  static void removeColormapFromShell(Widget widget, Widget shell);
138
 
 
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);
145
 
 
146
 
protected:
147
 
  static void getExtensionEventHandler(XEvent * event, Widget & widget,
148
 
                                       XtEventHandler & proc,
149
 
                                       XtPointer & clientData);
150
 
#endif // __COIN_SOXT__
151
 
 
152
 
#ifdef __COIN_SOGTK__
153
 
public:
154
 
  friend class SoGtkComponent;
155
 
  enum SoGtkComponentAction { CREATION, DESTRUCTION, CHANGE };
156
 
  typedef void SoGtkComponentActionCallback(SoGtkComponent *, SoGtk::SoGtkComponentAction, void *);
157
 
 
158
 
  static void addComponentActionCallback(SoGtkComponentActionCallback *, void *);
159
 
  static void removeComponentActionCallback(SoGtkComponentActionCallback *, void *);
160
 
 
161
 
  static int getComponents(SbPList & components);
162
 
 
163
 
protected:
164
 
  static void invokeComponentActionCallbacks(SoGtkComponent * component,
165
 
                                             SoGtkComponentAction action);
166
 
 
167
 
  static gint componentCreation(SoGtkComponent * component);
168
 
  static gint componentDestruction(SoGtkComponent * component);
169
 
  static gint componentChange(SoGtkComponent * component);
170
 
 
171
 
private:
172
 
  static gint timerSensorCB(gpointer data);
173
 
  static gint idleSensorCB(gpointer data);
174
 
  static gint delaySensorCB(gpointer data);
175
 
 
176
 
  static GtkWidget * mainWidget;
177
 
  static SbPList * components;
178
 
  static SbPList * component_callbacks;
179
 
#endif // __COIN_SOGTK__
180
 
};
181
 
 
182
 
// *************************************************************************
183
 
 
184
 
#endif // ! SOQT_H