Added a screen resolution check in preparation for handling retinal
[xcircuit.git] / xcwin32.h
blob1724481fbcc77b0fd04275a385e0b789455e5ef6
1 #ifndef __XCWIN32_H__
2 #define __XCWIN32_H__
4 #include <windows.h>
5 #include <commctrl.h>
7 typedef int Boolean;
8 typedef Boolean Bool;
9 #define True 1
10 #define False 0
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;
17 typedef HWND Window;
18 typedef int Pixel;
19 typedef struct {
20 int pixel;
21 int red, green, blue;
22 int flags;
23 } XColor;
24 #define DoRed 0x1
25 #define DoGreen 0x2
26 #define DoBlue 0x4
27 typedef struct __GC *GC;
28 typedef void Display;
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;
38 typedef struct {
39 short x, y;
40 } XPoint;
41 typedef struct {
42 short width, height;
43 char *data;
44 int bits_per_pixel;
45 int bytes_per_line;
46 HBITMAP handle;
47 } XImage;
48 typedef struct {
49 int ascent, descent;
50 HFONT fid;
51 } XFontStruct;
52 typedef struct {
53 int type;
54 int x, y;
55 int button;
56 int state;
57 } XButtonEvent;
58 typedef struct {
59 int type;
60 int x, y;
61 int keycode;
62 int state;
63 } XKeyEvent;
64 typedef struct {
65 int type;
66 int x, y;
67 } XMotionEvent, XPointerMovedEvent;
68 typedef void* XCrossingEvent;
69 typedef struct {
70 int type;
71 int message_type;
72 Display* display;
73 int format;
74 HWND window;
75 union {
76 long l[5];
77 } data;
78 } XClientMessageEvent;
79 typedef union {
80 int type;
81 XButtonEvent button;
82 XKeyEvent key;
83 XMotionEvent motion;
84 XPointerMovedEvent pointer_moved;
85 XCrossingEvent crossing;
86 XClientMessageEvent xclient;
87 } XEvent;
88 typedef unsigned int KeySym;
89 typedef struct {
90 int type;
91 void *data;
92 } Arg;
93 typedef struct __CharStruct *XCharStruct;
95 struct __GC {
96 /* colors */
97 int foreground, background;
98 int function;
99 /* fill */
100 int fill_style;
101 HBITMAP fill_stipple;
102 /* line */
103 int line_width;
104 int line_style;
105 int line_cap;
106 int line_join;
107 int line_dash_len;
108 char *line_dash;
109 /* font */
110 HFONT font;
111 /* misc */
112 Boolean graphics_exposures;
113 HBITMAP clipMask;
115 typedef struct __GC XGCValues;
116 typedef ATOM Atom;
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
125 #define GCFont 0x04
126 #define GCFunction 0x08
127 #define GCGraphicsExposures 0x10
129 #define GXcopy R2_COPYPEN
130 #define GXxor R2_XORPEN
132 /* TODO */
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
150 #define None 0
151 #define Nonconvex 0
152 #define CoordModeOrigin 0
153 #define NoSymbol 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
179 #define FillSolid 0
180 #define FillStippled 1
181 #define FillOpaqueStippled 2
183 #define XtNwidth 0
184 #define XtNheight 1
185 #define XtNx 2
186 #define XtNy 3
187 #define XtNfont 4
188 #define XtNexpose 5
189 #define XtNset 6
190 #define XtNsquare 7
191 #define XtNlabelLocation 8
192 #define XtNborderWidth 9
193 #define XtNselect 10
194 #define XtNrelease 11
195 #define XtNlabel 12
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
211 #define XtNstring 22
212 #define XtNsetMark 23
213 #define XtNbackground 24
214 #define XtNborderColor 25
215 #define XtNrectColor 26
216 #define XtNresize 27
217 #define XtNlabelType 28
218 #define XtNrectStipple 29
219 #define XtNattachTo 30
220 #define XtNsensitive 31
221 #define XtNxOffset 32
222 #define XtNyOffset 33
223 #define XtNlayout 34
224 #define XtNinsertPosition 35
225 #define XtNgravity 36
226 #define XtNscroll 37
227 #define XtNwrap 38
228 #define XtNexecute 39
229 #define XtNkeyUp 40
230 #define XtNkeyDown 41
231 #define XtNcolormap 42
232 #define XtNstrip 43
234 #define XwLEFT 0
235 #define XwRECT 1
236 #define XwIMAGE 2
237 #define XwIGNORE 3
239 #define WestGravity 0
240 #define XwWrapOff 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);
424 #define KPMOD 0x1000
425 #define VKMOD 0x2000
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)
436 #define XK_a 'a'
437 #define XK_b 'b'
438 #define XK_c 'c'
439 #define XK_d 'd'
440 #define XK_e 'e'
441 #define XK_f 'f'
442 #define XK_g 'g'
443 #define XK_h 'h'
444 #define XK_i 'i'
445 #define XK_j 'j'
446 #define XK_k 'k'
447 #define XK_l 'l'
448 #define XK_m 'm'
449 #define XK_n 'n'
450 #define XK_o 'o'
451 #define XK_p 'p'
452 #define XK_q 'q'
453 #define XK_r 'r'
454 #define XK_s 's'
455 #define XK_t 't'
456 #define XK_u 'u'
457 #define XK_v 'v'
458 #define XK_w 'w'
459 #define XK_x 'x'
460 #define XK_y 'y'
461 #define XK_z 'z'
462 #define XK_A 'A'
463 #define XK_B 'B'
464 #define XK_C 'C'
465 #define XK_D 'D'
466 #define XK_E 'E'
467 #define XK_F 'F'
468 #define XK_G 'G'
469 #define XK_H 'H'
470 #define XK_I 'I'
471 #define XK_J 'J'
472 #define XK_K 'K'
473 #define XK_L 'L'
474 #define XK_M 'M'
475 #define XK_N 'N'
476 #define XK_O 'O'
477 #define XK_P 'P'
478 #define XK_Q 'Q'
479 #define XK_R 'R'
480 #define XK_S 'S'
481 #define XK_T 'T'
482 #define XK_U 'U'
483 #define XK_V 'V'
484 #define XK_W 'W'
485 #define XK_X 'X'
486 #define XK_Y 'Y'
487 #define XK_Z 'Z'
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 '.'
505 #define XK_bar '|'
506 #define XK_greater '>'
507 #define XK_less '<'
508 #define XK_question '?'
509 #define XK_colon ':'
510 #define XK_underscore '_'
511 #define XK_space ' '
512 #define XK_plus '+'
513 #define XK_minus '-'
514 #define XK_slash '/'
515 #define XK_backslash '\\'
516 #define XK_1 '1'
517 #define XK_2 '2'
518 #define XK_3 '3'
519 #define XK_4 '4'
520 #define XK_5 '5'
521 #define XK_6 '6'
522 #define XK_7 '7'
523 #define XK_8 '8'
524 #define XK_9 '9'
525 #define XK_0 '0'
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)
549 struct direct {
550 char *d_name;
552 typedef struct {
553 HANDLE hnd;
554 WIN32_FIND_DATA fd;
555 int dirty;
556 struct direct d;
557 } DIR;
558 DIR* opendir(const char*);
559 struct direct* readdir(DIR*);
560 void closedir(DIR*);
562 #define snprintf _snprintf
563 #define vsnprintf _vsnprintf
564 #define va_copy(a,b) a=b
565 #define pipe _pipe
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);
573 #ifdef USE_WIN32_COM
574 extern void win32_comscript();
575 #ifdef USE_WIN32_DOTNET
576 extern void win32_comdotnet();
577 #endif
578 enum win32_events {
579 ModifiedChanged,
580 ZoomChanged
582 extern void win32_fire_event(int event_type);
583 #endif
585 extern void win32_new_window(Widget, void*, void*);
587 #endif