11 typedef void* XtPointer
;
12 typedef short Dimension
;
13 typedef short Position
;
14 typedef HBITMAP Pixmap
;
15 typedef struct __WinWidget
*Widget
;
16 typedef Widget
*WidgetList
;
27 typedef struct __GC
*GC
;
29 typedef void* Colormap
;
30 typedef int XtIntervalId
;
31 typedef HCURSOR Cursor
;
32 typedef void* caddr_t
;
33 typedef void(*XtCallbackProc
)();
34 typedef void(*XtEventHandler
)();
35 typedef void(*XtTimerCallbackProc
)();
36 typedef void* XtAppContext
;
37 typedef struct __XrmValue
*XrmValuePtr
;
67 } XMotionEvent
, XPointerMovedEvent
;
68 typedef void* XCrossingEvent
;
78 } XClientMessageEvent
;
84 XPointerMovedEvent pointer_moved
;
85 XCrossingEvent crossing
;
86 XClientMessageEvent xclient
;
88 typedef unsigned int KeySym
;
93 typedef struct __CharStruct
*XCharStruct
;
97 int foreground
, background
;
101 HBITMAP fill_stipple
;
112 Boolean graphics_exposures
;
115 typedef struct __GC XGCValues
;
117 typedef void XWMHints
;
119 typedef unsigned int Cardinal
;
120 #define XtOffset(p_type,field) \
121 ((Cardinal) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
123 #define GCForeground 0x01
124 #define GCBackground 0x02
126 #define GCFunction 0x08
127 #define GCGraphicsExposures 0x10
129 #define GXcopy R2_COPYPEN
130 #define GXxor R2_XORPEN
133 #define PointerMotionMask 0x0001
134 #define ButtonMotionMask 0x0002
135 #define Button1MotionMask 0x0004
136 #define Button2MotionMask 0x0008
137 #define EnterWindowMask 0x0010
138 #define LeaveWindowMask 0x0020
139 #define ButtonPressMask 0x0040
140 #define KeyPressMask 0x0080
141 #define NoEventMask 0x0000
143 #define ButtonPress 0x01
144 #define ButtonRelease 0x02
145 #define KeyPress 0x03
146 #define KeyRelease 0x04
147 #define ClientMessage 0x05
148 #define MotionNotify 0x06
152 #define CoordModeOrigin 0
155 #define Mod1Mask 0x0001
156 #define Mod2Mask 0x0002
157 #define LockMask 0x0004
158 #define ShiftMask 0x0008
159 #define ControlMask 0x0010
160 #define Mod5Mask 0x0080
161 #define Button1 0x0100
162 #define Button2 0x0200
163 #define Button3 0x0800
164 #define Button4 0x1000
165 #define Button5 0x2000
166 #define Button1Mask Button1
167 #define Button2Mask Button2
168 #define Button3Mask Button3
169 #define Button4Mask Button4
170 #define Button5Mask Button5
172 #define LineSolid PS_SOLID
173 #define LineOnOffDash PS_DASH
174 #define CapRound PS_ENDCAP_ROUND
175 #define CapButt PS_ENDCAP_FLAT
176 #define CapProjecting PS_ENDCAP_SQUARE
177 #define JoinBevel PS_JOIN_BEVEL
178 #define JoinMiter PS_JOIN_MITER
180 #define FillStippled 1
181 #define FillOpaqueStippled 2
191 #define XtNlabelLocation 8
192 #define XtNborderWidth 9
194 #define XtNrelease 11
196 #define XtNxResizable 13
197 #define XtNyResizable 14
198 #define XtNxRefWidget 15
199 #define XtNyRefWidget 16
200 #define XtNyAddHeight 17
201 #define XtNyAttachBottom 18
202 #define XtNxAttachRight 19
203 #define XtNyAddHeight 17
204 #define XtNyAttachBottom 18
205 #define XtNxAttachRight 19
206 #define XtNyAddHeight 17
207 #define XtNyAttachBottom 18
208 #define XtNxAttachRight 19
209 #define XtNxAddWidth 20
210 #define XtNforeground 21
212 #define XtNsetMark 23
213 #define XtNbackground 24
214 #define XtNborderColor 25
215 #define XtNrectColor 26
217 #define XtNlabelType 28
218 #define XtNrectStipple 29
219 #define XtNattachTo 30
220 #define XtNsensitive 31
221 #define XtNxOffset 32
222 #define XtNyOffset 33
224 #define XtNinsertPosition 35
225 #define XtNgravity 36
228 #define XtNexecute 39
230 #define XtNkeyDown 41
231 #define XtNcolormap 42
239 #define WestGravity 0
241 #define XwAutoScrollHorizontal 0
243 #define XwworkSpaceWidgetClass 0x01
244 #define XwtoggleWidgetClass 0x02
245 #define XwmenubuttonWidgetClass 0x03
246 #define XwformWidgetClass 0x04
247 #define XwmenuButtonWidgetClass 0x05
248 #define XwbulletinWidgetClass 0x06
249 #define XwcascadeWidgetClass 0x07
250 #define XwpopupmgrWidgetClass 0x08
251 #define XwstaticTextWidgetClass 0x09
252 #define XwpushButtonWidgetClass 0x0A
253 #define XwtextEditWidgetClass 0x0B
255 #define XC_xterm IDC_IBEAM
256 #define XC_watch IDC_WAIT
258 #define XtWindow(x) WinWindow(x)
259 #define XtAppAddTimeOut(app,delay,proc,data) WinAddTimeOut(delay,proc,data)
260 #define XtRemoveTimeOut(ID) WinRemoveTimeOut(ID)
261 #define XWarpPointer(dpy,flag,win,x1,y1,x2,y2,x3,y3) WinWarpPointer(win,x3,y3)
262 /*#define XCheckWindowEvent(dpy,win,mask,evt) WinCheckWindowEvent(win,mask,evt)*/
263 #define XCheckWindowEvent(dpy,win,mask,evt) False
264 #define XtDispatchEvent(evt)
265 #define XtSetArg(arg,t,d) (arg.type = t, arg.data = (void*)(d))
266 #define XtGetValues(win,args,n) WinGetValues(win,args,n)
267 #define XtSetValues(win,args,n) WinSetValues(win,args,n)
268 #define XCreatePixmap(dpy,win,w,h,depth) WinCreatePixmap(win,w,h)
269 #define XFreePixmap(dpy,w) WinFreePixmap(w)
270 #define XCreateImage(dpy,visual,depth,flag,offset,data,w,h,pad,bpl) WinCreateImage(w,h)
271 #define XDestroyImage(img) WinDestroyImage(img)
272 #define XSetLineAttributes(dpy,gc,w,style,cap,join) WinSetLineAttributes(gc,w,style,cap,join)
273 #define XCreateGC(dpy,win,mask,gc) WinCreateGC(win,mask,gc)
274 #define XFreeGC(gc) WinFreeGC(gc)
275 #define XtParent(w) WinParent(w)
276 #define XtNameToWidget(parent,name) WinNameToWindow(parent,name)
277 #define XtCreateManagedWidget(name,cls,parent,args,n) WinCreateWidget(name,cls,parent,args,n,1)
278 #define XtCreateWidget(name,cls,parent,args,n) WinCreateWidget(name,cls,parent,args,n,0)
279 #define DefaultRootWindow(dpy) GetDesktopWindow()
280 #define DefaultColormap(dpy,screen) NULL
281 #define DefaultScreen(dpy) 0
282 #define XFreeColormap(dpy,cmap)
283 #define XtDisplay(x) GetDesktopWindow()
284 #define XtCreatePopupShell(name,cls,btn,args,n) WinCreatePopup(name,args,n)
285 #define XtPopup(w,flag) WinPopup(w)
286 #define XKeysymToString(ks) WinKeyToString(ks)
287 #define XChangeProperty(dpy,win,prop,type,format,mode,data,len)
288 #define XCreateBitmapFromData(dpy,win,bits,w,h) WinCreateBitmapFromData(win,bits,w,h)
289 #define XCreatePixmapCursor(dpy,src,mask,fg,bg,xhot,yhot) WinCreateCursor(src,mask,xhot,yhot)
290 #define XCreateFontCursor(dpy,type) WinCreateStandardCursor(type)
291 #define XtOpenApplication(app,name,dummy,n,Argc,Argv,argfb,cls,arglist,narg) WinCreateTopLevel(name,Argc,Argv)
292 #define XDefineCursor(dpy,w,cur) WinSetCursor(w,cur)
293 #define XtMalloc malloc
294 #define BlackPixel(dpy,screen) RGB(0,0,0)
295 #define WhitePixel(dpy,screen) RGB(255,255,255)
296 #define XBell(dpy,len) MessageBeep(-1)
297 #define XSync(dpy,flag) WinDebug("Should sync\n")
298 #define XFlush(dpy) WinDebug("Should flush\n")
299 #define XSendEvent(dpy,win,prop,mask,evt) WinDebug("Should send an event\n")
300 #define DisplayWidth(dpy,screen) WinDesktopWidth()
301 #define DisplayHeight(dpy,screen) WinDesktopHeight()
302 #define XGetPixel(img,x,y) WinGetPixel(img,x,y)
303 #define XPutPixel(img,x,y,c) WinPutPixel(img,x,y,c)
304 #define XDrawArc(dpy,win,gc,x,y,w,h,a1,a2) WinDrawArc(win,gc,x,y,w,h,a1,a2)
305 #define XDrawLine(dpy,win,gc,x1,y1,x2,y2) WinDrawLine(win,gc,x1,y1,x2,y2)
306 #define XDrawLines(dpy,win,gc,pl,n,dummy) WinDrawLines(win,gc,pl,n)
307 #define XFillPolygon(dpy,win,gc,pl,n,x1,x2) WinFillPolygon(win,gc,pl,n)
308 #define XClearArea(dpy,win,x,y,w,h,dummy) WinClearArea(win,x,y,w,h)
309 #define XFillRectangle(dpy,win,gc,x,y,w,h) WinFillRectangle(win,gc,x,y,w,h)
310 /*#define XSetLineAttributes(dpy,gc,w,s,c,j) WinSetLineAttributes(gc,w,s,c,j)*/
311 #define XDrawPoint(dpy,win,gc,x,y) WinDrawPoint(win,gc,x,y)
312 #define XSetForeground(dpy,gc,c) WinSetForeground(gc,c)
313 #define XSetFunction(dpy,gc,z) WinSetFunction(gc,z)
314 #define XSetBackground(dpy,gc,c) WinSetBackground(gc,c)
315 #define XCopyArea(dpy,win1,win2,gc,x,y,w,h,offx,offy) WinCopyArea(win1,win2,gc,x,y,w,h,offx,offy)
316 #define XTextWidth(font,str,len) WinTextWidth(font,str,len)
317 #define XtNumber(arr) ((int) (sizeof(arr) / sizeof(arr[0])))
318 #define XSetFillStyle(dpy,gc,fs) WinSetFillStyle(gc,fs)
319 #define XSetDashes(dpy,gc,offset,dash,n) WinSetDashes(gc,offset,dash,n)
320 #define XSetStipple(dpy,gc,stipple) WinSetStipple(gc,stipple)
321 #define XQueryPointer(dpy,win,rr,cr,rx,ry,x,y,m) WinQueryPointer(win,x,y)
322 #define XDrawRectangle(dpy,win,gc,x,y,w,h) WinDrawRectangle(win,gc,x,y,w,h)
323 #define XtManageChild(win) WinManageChild(win)
324 #define XtUnmanageChild(win) WinUnmanageChild(win)
325 #define XRecolorCursor(dpy,cur,fg,bg)
326 #define XDrawString(dpy,win,gc,x,y,str,len) WinDrawString(win,gc,x,y,str,len)
327 #define XTextExtents(font,str,len,dum1,w,h,dum2) WinTextExtents(font,str,len,w,h)
328 #define XDisplayString(dpy) "unknown:0.0"
329 #define XQueryColors(dpy,cmap,cl,n) WinQueryColors(cl,n)
330 #define XLookupColor(dpy,cmap,cname,exact,color) WinLookupColor(cname,color)
331 #define XtAppMainLoop(app) WinAppMainLoop()
332 #define XtIsRealized(w) True
333 #define XPutImage(dpy,win,gc,img,srcx,srcy,destx,desty,w,h) WinPutImage(win,gc,img,srcx,srcy,destx,desty,w,h)
334 #define XFreeColorMap(dpy,cmap)
335 #define XtDestroyWidget(w) DeleteObject(w)
336 #define XtTranslateCoords(win,x,y,rx,ry) WinTranslateCoords(win,x,y,rx,ry)
337 #define XStringToKeysym(str) WinStringToKey(str)
338 #define XInternAtom(dpy,str,flag) AddAtom(str)
339 #define XSetClipMask(dpy,gc,pix) WinSetClipMask(gc,pix)
340 #define XSetClipOrigin(dpy,gc,x,y)
341 #define XtAddEventHandler(win,mask,flag,proc,data) WinAddEventHandler(win,mask,proc,data)
342 #define XtRemoveEventHandler(win,mask,flag,proc,data) WinRemoveEventHandler(win,mask,proc,data)
343 #define XtAddCallback(win,mask,proc,data) WinAddCallback(win,mask,proc,data)
344 #define XtRemoveCallback(win,mask,proc,data) WinRemoveCallback(win,mask,proc,data)
345 #define XtRemoveAllCallbacks(win,event)
346 #define XwTextCopyBuffer(win) WinGetText(win)
347 #define XwTextClearBuffer(win) WinClearText(win)
348 #define XLookupString(event,str,size,keyptr,flag) WinLookupString(event,keyptr)
349 #define XwPostPopup(shell,menu,button,dx,dy) WinPostPopup(menu,button,dx,dy)
350 #define XtOverrideTranslations(win,table,def)
352 void WinWarpPointer(HWND w
, int x
, int y
);
353 int WinAddTimeOut(int delay
, void(*proc
)(), void* data
);
354 void WinRemoveTimeOut(int ID
);
355 int WinCheckWindowEvent(HWND w
, int mask
, XEvent
*event
);
356 void WinGetValues(Widget win
, Arg
*args
, int n
);
357 void WinSetValues(Widget win
, Arg
*args
, int n
);
358 HBITMAP
WinCreatePixmap(HWND w
, int width
, int height
);
359 XImage
* WinCreateImage(int width
, int height
);
360 void WinSetLineAttributes(GC gc
, int width
, int style
, int cap
, int join
);
361 GC
WinCreateGC(HWND w
, int mask
, XGCValues
*values
);
362 void WinFreeGC(GC gc
);
363 Widget
WinParent(Widget w
);
364 Widget
WinNameToWindow(Widget parent
, const char *name
);
365 Widget
WinCreateWidget(const char *name
, int cls
, Widget parent
, Arg
*args
, int n
, int show
);
366 Widget
WinCreatePopup(const char *name
, Arg
*args
, int n
);
367 void WinPopup(Widget w
);
368 char* WinKeyToString(int ks
);
369 HCURSOR
WinCreateCursor(HBITMAP src
, HBITMAP mask
, int xhot
, int yhot
);
370 HBITMAP
WinCreateBitmapFromData(HWND w
, char *data
, int width
, int height
);
371 HCURSOR
WinCreateStandardCursor(char *type
);
372 HWND
WinCreateTopLevel(const char *name
, int *argc
, char **argv
);
373 void WinSetCursor(HWND w
, HCURSOR cur
);
374 void WinFreePixmap(Pixmap w
);
375 int WinDesktopWidth(void);
376 int WinDesktopHeight(void);
377 int WinGetPixel(XImage
*img
, int x
, int y
);
378 void WinPutPixel(XImage
*img
, int x
, int y
, int c
);
379 void WinDrawArc(HWND win
, GC gc
, int x
, int y
, int w
, int h
, int a1
, int a2
);
380 void WinDrawLines(HWND win
, GC gc
, XPoint
* pathlist
, int number
);
381 void WinFillPolygon(HWND win
, GC gc
, XPoint
* pathlist
, int number
);
382 void WinClearArea(HWND win
, int x
, int y
, int w
, int h
);
383 void WinFillRectangle(HWND win
, GC gc
, int x
, int y
, int w
, int h
);
384 void WinSetForeground(GC gc
, int rgb
);
385 int WinTextWidth(XFontStruct
*f
, char *s
, int len
);
386 void WinSetFillStyle(GC gc
, int style
);
387 void WinSetStipple(GC gc
, Pixmap pattern
);
388 void WinSetFunction(GC gc
, int op
);
389 void WinDrawLine(HWND win
, GC gc
, int x1
, int y1
, int x2
, int y2
);
390 void WinDrawPoint(HWND win
, GC gc
, int x
, int y
);
391 void WinSetBackground(GC gc
, int rgb
);
392 void WinCopyArea(Pixmap buf
, HWND win
, GC gc
, int x
, int y
, int w
, int h
, int offx
, int offy
);
393 void WinSetDashes(GC gc
, int offset
, char *dash
, int n
);
394 void WinQueryPointer(HWND w
, int *x
, int *y
);
395 void WinDrawRectangle(HWND w
, GC gc
, int x
, int y
, int width
, int height
);
396 void WinDrawString(HWND win
, GC gc
, int x
, int y
, const char *str
, int len
);
397 void WinTextExtents(XFontStruct
*fs
, char *str
, int len
, int *width
, int *height
);
398 void WinQueryColors(XColor
*cl
, int n
);
399 void WinAppMainLoop(void);
400 void WinPutImage(HWND win
, GC gc
, XImage
*img
, int srcx
, int srcy
, int destx
, int desty
, int width
, int height
);
401 void WinTranslateCoords(Widget win
, short x
, short y
, short *rx
, short *ry
);
402 int WinStringToKey(const char *str
);
403 void WinAddEventHandler(Widget win
, int event
, void(*proc
)(), void *data
);
404 void WinRemoveEventHandler(Widget win
, int event
, void(*proc
)(), void *data
);
405 void WinAddCallback(Widget win
, int event
, void(*proc
)(), void *data
);
406 int WinFindCallback(Widget win
, int event
, void(**proc
)(), void **data
);
407 void WinRemoveCallback(Widget win
, int event
, void(*proc
)(), void *data
);
408 void WinRemoveAllCallbacks(Widget win
, int event
);
409 char* WinGetText(Widget win
);
410 void WinClearText(Widget win
);
411 int WinNamedColor(const char *cname
);
412 int WinLookupColor(const char *cname
, XColor
*color
);
413 char* WinColorName(int c
);
414 HWND
WinWindow(Widget w
);
415 void WinManageChild(Widget w
);
416 void WinUnmanageChild(Widget w
);
417 void WinLookupString(XKeyEvent
*event
, KeySym
*key
);
418 void WinPostPopup(Widget menu
, Widget button
, int dx
, int dy
);
419 const char* WinBuiltinsDir(void);
420 Widget
WinGetMenu(const char *name
);
421 const char* WinName(Widget w
);
422 int WinIsPopupMenu(Widget w
);
427 #define XK_Control_L (VKMOD|VK_CONTROL)
428 #define XK_Control_R (VKMOD|VK_CONTROL)
429 #define XK_Alt_L (VKMOD|VK_MENU)
430 #define XK_Alt_R (VKMOD|VK_MENU)
431 #define XK_Shift_L (VKMOD|VK_SHIFT)
432 #define XK_Shift_R (VKMOD|VK_SHIFT)
433 #define XK_Caps_Lock (VKMOD|VK_CAPITAL)
434 #define XK_Num_Lock (VKMOD|VK_NUMLOCK)
488 #define XK_Home (VKMOD|VK_HOME)
489 #define XK_Delete (VKMOD|VK_DELETE)
490 #define XK_Escape (VKMOD|VK_ESCAPE)
491 #define XK_F19 (VKMOD|VK_F19)
492 #define XK_Right (VKMOD|VK_RIGHT)
493 #define XK_Left (VKMOD|VK_LEFT)
494 #define XK_Down (VKMOD|VK_DOWN)
495 #define XK_Up (VKMOD|VK_UP)
496 #define XK_Insert (VKMOD|VK_INSERT)
497 #define XK_End (VKMOD|VK_END)
498 #define XK_Return (VKMOD|VK_RETURN)
499 #define XK_BackSpace (VKMOD|VK_BACK)
500 #define XK_Undo (VKMOD|VK_F6)
501 #define XK_Redo (VKMOD|VK_F7)
502 #define XK_Tab (VKMOD|VK_TAB)
503 #define XK_percent '%'
504 #define XK_period '.'
506 #define XK_greater '>'
508 #define XK_question '?'
510 #define XK_underscore '_'
515 #define XK_backslash '\\'
526 #define XK_KP_1 (KPMOD|XK_1)
527 #define XK_KP_2 (KPMOD|XK_2)
528 #define XK_KP_3 (KPMOD|XK_3)
529 #define XK_KP_4 (KPMOD|XK_4)
530 #define XK_KP_5 (KPMOD|XK_5)
531 #define XK_KP_6 (KPMOD|XK_6)
532 #define XK_KP_7 (KPMOD|XK_7)
533 #define XK_KP_8 (KPMOD|XK_8)
534 #define XK_KP_9 (KPMOD|XK_9)
535 #define XK_KP_0 (KPMOD|XK_0)
536 #define XK_KP_Enter (KPMOD|VKMOD|VK_RETURN)
537 #define XK_KP_Add (KPMOD|XK_plus)
538 #define XK_KP_Subtract (KPMOD|XK_minus)
539 #define XK_KP_End (KPMOD|VKMOD|VK_END)
540 #define XK_KP_Home (KPMOD|VKMOD|VK_HOME)
541 #define XK_KP_Up (KPMOD|VKMOD|VK_UP)
542 #define XK_KP_Down (KPMOD|VKMOD|VK_DOWN)
543 #define XK_KP_Right (KPMOD|VKMOD|VK_RIGHT)
544 #define XK_KP_Left (KPMOD|VKMOD|VK_LEFT)
545 #define XK_KP_Next (KPMOD|VKMOD|VK_NEXT)
546 #define XK_KP_Prior (KPMOD|VKMOD|VK_PRIOR)
547 #define XK_KP_Begin (KPMOD|VKMOD|VK_CLEAR)
558 DIR* opendir(const char*);
559 struct direct
* readdir(DIR*);
562 #define snprintf _snprintf
563 #define vsnprintf _vsnprintf
564 #define va_copy(a,b) a=b
566 #define strdup _strdup
567 #define unlink _unlink
568 #define putenv _putenv
569 #define fdopen _fdopen
571 #define usleep(x) if (x < 1000) WinDebug("Cannot sleep less than 1us\n"); else Sleep(x/1000);
574 extern void win32_comscript();
575 #ifdef USE_WIN32_DOTNET
576 extern void win32_comdotnet();
582 extern void win32_fire_event(int event_type
);
585 extern void win32_new_window(Widget
, void*, void*);