Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoWinDef.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2021 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24#ifndef _SO_WIN_DEF_
25#define _SO_WIN_DEF_
26
27#include <Inventor/SbBasic.h>
28
29#ifdef _WIN32
31# include <windows.h>
32#endif
33// Redefine X data types in _WIN32 terms
34#define ArgList PLONG
35
36#define Boolean BOOLEAN
37
38#define WBOOL int
39
40#define Colormap UINT
41
42#define Cursor Hcursor
43
44#define WindowPtr HWND
45
46// Stuff for SoWinMouse/Keyboard -- NOTYET: make constants match X
47#define EventMask UINT
48#define ButtonPressMask 0x01
49#define ButtonReleaseMask 0x02
50#define PointerMotionMask 0x04
51#define ButtonMotionMask 0x08
52#define KeyPressMask 0x10
53#define KeyReleaseMask 0x20
54
55#define GLXContext HGLRC
56
57#define KeySym UINT
58
59//#if defined(_AFX)
60//#define Widget PVOID
61//#define Window PVOID
62//#define Hinst PVOID
63//#define Hwnd PVOID
64//#define Hdc PVOID
65//#define Hcursor PVOID
66//#define Hmenu PVOID
67//#define Hrsrc PVOID
68//#else
69
70#ifndef Widget
71#define SoWidget HWND
72
73// Defined for compatibility purpose
74// We disbale this when internally compiling OivSuite
75#ifndef LIBRARYBUILD
76# define Widget HWND
77#endif
78
79#endif
80
81#define Window HWND
82#define Hinst HINSTANCE
83#define Hwnd HWND
84#define Hdc HDC
85#define Hcursor HCURSOR
86#define Hmenu HMENU
87#define Hrsrc HRSRC
88//#endif
89
90#define Pixmap HBITMAP
91
92#define Atom ULONG
93#define Time time_t
94
95#define XColor UINT
96
97// Event types
98#define XEvent MSG
99#ifndef XAnyEvent
100# define XAnyEvent MSG
101#endif
102#define XButtonEvent MSG
103#define XKeyEvent MSG
104#define XMotionEvent MSG
105#define XMouseWheelEvent MSG
106
107// Key codes (basically the same but with different names)
108#define XK_ESCAPE VK_ESCAPE
109#define XK_HOME VK_HOME
110#define XK_LEFT VK_LEFT
111#define XK_UP VK_UP
112#define XK_RIGHT VK_RIGHT
113#define XK_DOWN VK_DOWN
114#define XK_s 83
115
116// Redefine Xt and Motif data types in _WIN32 terms
117#define XmString char*
118
119#define XtAppContext UINT
120
121#define XtEventHandler FARPROC
122
123#define XtIntervalId UINT
124
125#define XtPointer PVOID
126
127#define XmAnyCallbackStruct void
128
129#define XtWorkProcId UINT
130
131// XVisualInfo corresponds to PIXELFORMATDESCRIPTOR rather than
132// "pixel format" because under Windows, pixel formats are per
133// drawable rather than per display (like visuals under X). In
134// other words, under Windows we can't get the description of a
135// pixel format unless we have a valid device context and that
136// is often inconvenient.
137//
138// Note that PIXELFORMATDESCRIPTOR also takes the place of GLX's
139// "attribList" (which it is conceptually closer to). --mmh
140
141#define XVisualInfo PIXELFORMATDESCRIPTOR
142
143
145// Functions to implement SoWin on Win32
146//
147// Supplying these dummy functions is less ugly than ifdef'ing
148// the SoWin code in dozens of places.
149
151
152 extern UINT *XtDisplay( SoWidget w );
153
154 extern UINT XtScreen( SoWidget w ) ;
155
157
159
161
163
165
167
168
170// Miscellaneous SGI functions not found in _WIN32
171
172#include "tchar.h"
173
174#undef strdup
175#define strdup _tcsdup
176
177#ifdef _WIN32
179#endif //_WIN32
180#endif //_SO_WIN_DEF_
181
182
char Boolean
Definition SoQtDef.h:119
struct _XtAppStruct * XtAppContext
Definition SoQtDef.h:122
#define Window
Definition SoWinDef.h:81
Window RootWindowOfScreen(UINT s)
Boolean XtIsRealized(SoWidget w)
UINT XtScreen(SoWidget w)
Boolean XtIsShell(SoWidget w)
Window XtWindow(SoWidget w)
SoWidget XtWindowToWidget(UINT *d, Window w)
UINT * XtDisplay(SoWidget w)
SoWidget XtParent(SoWidget w)
#define SoWidget
Definition SoWinDef.h:71
XtAppContext XtWidgetToApplicationContext(SoWidget w)
unsigned int UINT
Definition port.h:357