1 #ifndef SOQT_COMPONENT_H
2 #define SOQT_COMPONENT_H
29 #include <Inventor/SbLinear.h>
30 #include <Inventor/Qt/SoQtObject.h>
34 #endif // __COIN_SOQT__
36 #include <X11/Intrinsic.h>
37 #endif // __COIN_SOXT__
40 #endif // __COIN_SOGTK__
43 #endif // __COIN_SOWIN__
49 typedef void SoQtComponentCB(
void * user,
SoQtComponent * component);
50 typedef void SoQtComponentVisibilityCB(
void * user, SbBool visible);
60 virtual void show(
void);
61 virtual void hide(
void);
63 virtual void setComponentCursor(
const SoQtCursor & cursor);
64 static void setWidgetCursor(QWidget * w,
const SoQtCursor & cursor);
66 SbBool isFullScreen(
void)
const;
67 SbBool setFullScreen(
const SbBool onoff);
69 SbBool isVisible(
void);
70 SbBool isTopLevelShell(
void)
const;
72 QWidget * getWidget(
void)
const;
73 QWidget * getBaseWidget(
void)
const;
74 QWidget * getShellWidget(
void)
const;
75 QWidget * getParentWidget(
void)
const;
77 void setSize(
const SbVec2s size);
78 SbVec2s getSize(
void)
const;
80 void setTitle(
const char *
const title);
81 const char * getTitle(
void)
const;
82 void setIconTitle(
const char *
const title);
83 const char * getIconTitle(
void)
const;
85 const char * getWidgetName(
void)
const;
86 const char * getClassName(
void)
const;
88 void setWindowCloseCallback(SoQtComponentCB *
const func,
89 void *
const user = NULL);
92 static void initClasses(
void);
96 const char *
const name = NULL,
97 const SbBool embed = TRUE);
99 virtual void afterRealizeHook(
void);
105 #ifndef __COIN_SOQT__
107 #endif // __COIN_SOQT__
109 void setClassName(
const char *
const name);
110 void setBaseWidget(QWidget * widget);
112 void registerWidget(QWidget * widget);
113 void unregisterWidget(QWidget * widget);
115 virtual const char * getDefaultWidgetName(
void)
const;
116 virtual const char * getDefaultTitle(
void)
const;
117 virtual const char * getDefaultIconTitle(
void)
const;
119 virtual void sizeChanged(
const SbVec2s & size);
121 void addVisibilityChangeCallback(SoQtComponentVisibilityCB *
const func,
122 void *
const user = NULL);
123 void removeVisibilityChangeCallback(SoQtComponentVisibilityCB *
const func,
124 void *
const user = NULL);
127 class SoQtComponentP * pimpl;
128 friend class SoGuiComponentP;
129 friend class SoQtComponentP;
136 Display * getDisplay(
void);
137 void fitSize(
const SbVec2s size);
140 void addWindowCloseCallback(SoXtComponentCB * callback,
void * closure = NULL);
141 void removeWindowCloseCallback(SoXtComponentCB * callback,
void * closure = NULL);
146 void invokeVisibilityChangeCallbacks(
const SbBool enable)
const;
147 void invokeWindowCloseCallbacks(
void)
const;
148 virtual void windowCloseAction(
void);
152 static void event_handler(Widget, XtPointer, XEvent *, Boolean *);
153 #endif // __COIN_SOXT__
155 #ifdef __COIN_SOGTK__
157 virtual SbBool eventFilter(GtkWidget *
object, GdkEvent * event);
159 static gint eventHandler(GtkWidget *
object, GdkEvent * event, gpointer closure);
160 #endif // __COIN_SOGTK__
165 #endif // ! SOQT_COMPONENT_H