1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
|
#ifndef __XLOCK_XAPI_H__
#define __XLOCK_XAPI_H__
/*-
* @(#)Xapi.h 4.00 98/04/16 xlockmore
*
* Xapi.h - X API interface for WIN32 (windows 95/NT) platforms
*
* Copyright (c) 1998 by Petey Leinonen.
*
* See xlock.c for copying information.
*
* Revision History:
*
* 16-Apr-98: Initially written. Based off code written by myself for
* an older version of xlockmore for win95/NT
*
*/
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
/*-
* includes
*/
#include <windows.h>
extern HWND hwnd; /* window handle */
extern HDC hdc; /* device context */
extern int cred, cgreen, cblue; /* color reference of the pen */
extern unsigned char *red, *green, *blue; /* holds a list of colors */
extern int colorcount; /* number of colors used */
unsigned int randommode; /* number of mode to index */
extern RECT rc; /* coords of the screen */
/*-
* defines
*/
/* -------------------------------------------------------------------- */
/*****************************************************************
* ERROR CODES
*****************************************************************/
#define Success 0 /* everything's okay */
#define BadRequest 1 /* bad request code */
#define BadValue 2 /* int parameter out of range */
#define BadWindow 3 /* parameter not a Window */
#define BadPixmap 4 /* parameter not a Pixmap */
#define BadAtom 5 /* parameter not an Atom */
#define BadCursor 6 /* parameter not a Cursor */
#define BadFont 7 /* parameter not a Font */
#define BadMatch 8 /* parameter mismatch */
#define BadDrawable 9 /* parameter not a Pixmap or Window */
#define BadAccess 10 /* depending on context:
- key/button already grabbed
- attempt to free an illegal
cmap entry
- attempt to store into a read-only
color map entry.
- attempt to modify the access control
list from other than the local host.
*/
#define BadAlloc 11 /* insufficient resources */
#define BadColor 12 /* no such colormap */
#define BadGC 13 /* parameter not a GC */
#define BadIDChoice 14 /* choice not in range or already used */
#define BadName 15 /* font or color name doesn't exist */
#define BadLength 16 /* Request length incorrect */
#define BadImplementation 17 /* server is defective */
/* window attributes */
#define InputOutput 1
#define InputOnly 2
#define IsUnmapped 0
#define IsUnviewable 1
#define IsViewable 2
/* redefined functions */
#define XWhitePixelOfScreen WhitePixelOfScreen
/* define False/True */
#define False (0)
#define True (!False)
#define None (0L)
#define CurrentTime (0L)
#define DoRed (0x1)
#define DoGreen (0x2)
#define DoBlue (0x4)
#define XYBitmap (0x01)
#define XYPixmap (0x02)
#define ZPixmap (0x04)
#define LSBFirst (0x00)
#define MSBFirst (0x01)
#define AllocNone (0x00)
#define AllocAll (0x01)
#define BitmapSuccess (0)
#define BitmapOpenFailed (1)
#define BitmapFileInvalid (2)
#define BitmapNoMemory (3)
#define StaticGray (0)
#define GrayScale (1)
#define StaticColor (2)
#define PseudoColor (3)
#define TrueColor (4)
#define DirectColor (5)
/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
state in various key-, mouse-, and button-related events. */
#define ShiftMask (1<<0)
#define LockMask (1<<1)
#define ControlMask (1<<2)
#define Mod1Mask (1<<3)
#define Mod2Mask (1<<4)
#define Mod3Mask (1<<5)
#define Mod4Mask (1<<6)
#define Mod5Mask (1<<7)
/* button masks. Used in same manner as Key masks above. Not to be confused
with button names below. */
#define Button1Mask (1<<8)
#define Button2Mask (1<<9)
#define Button3Mask (1<<10)
#define Button4Mask (1<<11)
#define Button5Mask (1<<12)
#define VisualNoMask (0x0)
#define VisualIDMask (0x1)
#define VisualScreenMask (0x2)
#define VisualDepthMask (0x4)
#define VisualClassMask (0x8)
#define VisualRedMaskMask (0x10)
#define VisualGreenMaskMask (0x20)
#define VisualBlueMaskMask (0x40)
#define VisualColormapMaskMask (0x80)
#define VisualBitsPerRGBMask (0x100)
#define VisualAllMask (0x1FF)
#define GrabModeSync (0)
#define GrabModeAsync (1)
#define GrabSuccess (0)
#define AlreadyGrabbed (1)
#define GrabInvalidTime (2)
#define GrabNotViewable (3)
#define GrabFrozen (4)
#define NoEventMask 0L
#define KeyPressMask (1L<<0)
#define KeyReleaseMask (1L<<1)
#define ButtonPressMask (1L<<2)
#define ButtonReleaseMask (1L<<3)
#define EnterWindowMask (1L<<4)
#define LeaveWindowMask (1L<<5)
#define PointerMotionMask (1L<<6)
#define PointerMotionHintMask (1L<<7)
#define Button1MotionMask (1L<<8)
#define Button2MotionMask (1L<<9)
#define Button3MotionMask (1L<<10)
#define Button4MotionMask (1L<<11)
#define Button5MotionMask (1L<<12)
#define ButtonMotionMask (1L<<13)
#define KeymapStateMask (1L<<14)
#define ExposureMask (1L<<15)
#define VisibilityChangeMask (1L<<16)
#define StructureNotifyMask (1L<<17)
#define ResizeRedirectMask (1L<<18)
#define SubstructureNotifyMask (1L<<19)
#define SubstructureRedirectMask (1L<<20)
#define FocusChangeMask (1L<<21)
#define PropertyChangeMask (1L<<22)
#define ColormapChangeMask (1L<<23)
#define OwnerGrabButtonMask (1L<<24)
#define KeyPress 2
#define KeyRelease 3
#define ButtonPress 4
#define ButtonRelease 5
#define MotionNotify 6
#define EnterNotify 7
#define LeaveNotify 8
#define FocusIn 9
#define FocusOut 10
#define KeymapNotify 11
#define Expose 12
#define GraphicsExpose 13
#define NoExpose 14
#define VisibilityNotify 15
#define CreateNotify 16
#define DestroyNotify 17
#define UnmapNotify 18
#define MapNotify 19
#define MapRequest 20
#define ReparentNotify 21
#define ConfigureNotify 22
#define ConfigureRequest 23
#define GravityNotify 24
#define ResizeRequest 25
#define CirculateNotify 26
#define CirculateRequest 27
#define PropertyNotify 28
#define SelectionClear 29
#define SelectionRequest 30
#define SelectionNotify 31
#define ColormapNotify 32
#define ClientMessage 33
#define MappingNotify 34
#define LASTEvent 35
#define VisibilityUnobscured (0)
#define VisibilityPartiallyObscured (1)
#define VisibilityFullyObscured (2)
#define XC_left_ptr (68)
#define Button1 (1)
#define Button2 (2)
#define Button3 (3)
#define Button4 (4)
#define Button5 (5)
#define SIGHUP (0)
#define SIGQUIT (1)
#define SIGBUS (2)
#define CoordModeOrigin (0)
#define CoordModePrevious (1)
#define Complex (0)
#define Nonconvex (1)
#define Convex (2)
#define LineSolid (0)
#define LineOnOffDash (1)
#define LineDoubleDash (2)
#define CapNotLast (0)
#define CapButt (1)
#define CapRound (2)
#define CapProjecting (3)
#define JoinMiter (0)
#define JoinRound (1)
#define JoinBevel (2)
#define GCFunction (1L<<0)
#define GCPlaneMask (1L<<1)
#define GCForeground (1L<<2)
#define GCBackground (1L<<3)
#define GCLineWidth (1L<<4)
#define GCLineStyle (1L<<5)
#define GCCapStyle (1L<<6)
#define GCJoinStyle (1L<<7)
#define GCFillStyle (1L<<8)
#define GCFillRule (1L<<9)
#define GCTile (1L<<10)
#define GCStipple (1L<<11)
#define GCTileStipXOrigin (1L<<12)
#define GCTileStipYOrigin (1L<<13)
#define GCFont (1L<<14)
#define GCSubwindowMode (1L<<15)
#define GCGraphicsExposures (1L<<16)
#define GCClipXOrigin (1L<<17)
#define GCClipYOrigin (1L<<18)
#define GCClipMask (1L<<19)
#define GCDashOffset (1L<<20)
#define GCDashList (1L<<21)
#define GCArcMode (1L<<22)
#define FillSolid (0)
#define FillTiled (1)
#define FillStippled (2)
#define FillOpaqueStippled (3)
#define GXclear (0x0)
#define GXand (0x1)
#define GXandReverse (0x2)
#define GXcopy (0x3)
#define GXandInverted (0x4)
#define GXnoop (0x5)
#define GXxor (0x6)
#define GXor (0x7)
#define GXnor (0x8)
#define GXequiv (0x9)
#define GXinvert (0xa)
#define GXorReverse (0xb)
#define GXcopyInverted (0xc)
#define GXorInverted (0xd)
#define GXnand (0xe)
#define GXset (0xf)
/* fillRule */
#define EvenOddRule 0
#define WindingRule 1
/*-
* types
*/
/* -------------------------------------------------------------------- */
/* simple */
/* XPointer type: not needed for WIN32 */
typedef void* XPointer;
/* XID type */
typedef unsigned long XID;
/* Atom type: not needed for WIN32*/
typedef unsigned long Atom;
/* Bool type */
typedef int Bool;
/* Colormap type: not needed for WIN32 */
typedef XID Colormap;
/* Cursor type: not needed for WIN32 */
typedef XID Cursor;
/* Display type: not needed for WIN32 */
typedef int Display;
/* Drawable type, can be bitmap or window */
typedef int Drawable;
/* Font type: not needed for WIN32 */
typedef XID Font;
/* GC type: really a HDC */
typedef int GC;
/* GContext type: not needed for WIN32 */
typedef XID GContext;
/* Keysym type: not needed for WIN32 */
typedef XID KeySym;
/* Pixel type, from <X11/Intrinsic.h> */
typedef unsigned long Pixel;
/* Pixmap type, implemented a bitmap handler for WIN32 */
typedef int Pixmap;
/* Screen type: not needed for WIN32 */
typedef int Screen;
/* Status type: not needed for WIN32 */
typedef int Status;
/* Time type: not needed for WIN32 */
typedef unsigned long Time;
/* VisualID type: not needed for WIN32 */
typedef unsigned long VisualID;
/* Window type: really a HWND but typecasting to int,
* this is because a Window is also a Drawable.
* We don't use this anyway */
typedef int Window;
/* XExtData type: used below */
typedef char XExtData;
/* XrmQuark, XrmQuarkList: not needed */
typedef int XrmQuark, *XrmQuarkList;
/* complex */
/* Visual type: not needed for WIN32 */
typedef struct {
XExtData *ext_data;
VisualID visualid;
#if defined(__cplusplus) || defined(c_plusplus)
int c_class;
#else
int class;
#endif
unsigned long red_mask;
unsigned long green_mask;
unsigned long blue_mask;
int bits_per_rgb;
int map_entries;
} Visual;
/* XAnyEvent type: not needed for WIN32 */
typedef struct {
int type;
unsigned long serial;
Bool send_event;
Display *display;
Window window;
} XAnyEvent;
/* XArc */
typedef struct {
short x,y;
unsigned short width, height;
short angle1, angle2;
} XArc;
/* XCharStruct type: not needed for WIN32 */
typedef struct {
short lbearing;
short rbearing;
short width;
short ascent;
short descent;
unsigned short attributes;
} XCharStruct;
/* XClassHint type: not needed for WIN32 */
typedef struct {
char *res_name;
char *res_class;
} XClassHint;
/* XComposeStatus type: not needed for WIN32 */
typedef struct {
XPointer compose_ptr;
int chars_matched;
} XComposeStatus;
/* XKeyEvent type: */
typedef struct {
int type;
unsigned long serial;
Bool send_event;
Display *display;
Window window;
Window root;
Window subwindow;
Time time;
int x, y;
int x_root, y_root;
unsigned int state;
unsigned int keycode;
Bool same_screen;
} XKeyEvent;
/* XButtonEvent type: */
typedef struct {
int type;
unsigned long serial;
Bool send_event;
Display *display;
Window window;
Window root;
Window subwindow;
Time time;
int x, y;
int x_root, y_root;
unsigned int state;
unsigned int button;
Bool same_screen;
} XButtonEvent;
/* XMotionEvent type */
typedef struct {
int type;
unsigned long serial;
Bool send_event;
Display *display;
Window window;
Window root;
Window subwindow;
Time time;
int x, y;
int x_root, y_root;
unsigned int state;
char is_hint;
Bool same_screen;
} XMotionEvent;
/* XExposeEvent */
typedef struct {
int type;
unsigned long serial;
Bool send_event;
Display *display;
Window window;
int x, y;
int width, height;
int count;
} XExposeEvent;
/* XVisibilityEvent type */
typedef struct {
int type;
unsigned long serial;
Bool send_event;
Display *display;
Window window;
int state;
} XVisibilityEvent;
/* XConfigureEvent type */
typedef struct {
int type;
unsigned long serial;
Bool send_event;
Display *display;
Window event;
Window window;
int x, y;
int width, height;
int border_width;
Window above;
Bool override_redirect;
} XConfigureEvent;
/* XEvent type: not needed for WIN32 */
typedef union _XEvent {
int type;
XAnyEvent xany;
XKeyEvent xkey;
XButtonEvent xbutton;
XMotionEvent xmotion;
// XCrossingEvent xcrossing;
// XFocusChangeEvent xfocus;
XExposeEvent xexpose;
// XGraphicsExposeEvent xgraphicsexpose;
// XNoExposeEvent xnoexpose;
XVisibilityEvent xvisibility;
// XCreateWindowEvent xcreatewindow;
// XDestroyWindowEvent xdestroywindow;
// XUnmapEvent xunmap;
// XMapEvent xmap;
// XMapRequestEvent xmaprequest;
// XReparentEvent xreparent;
XConfigureEvent xconfigure;
// XGravityEvent xgravity;
// XResizeRequestEvent xresizerequest;
// XConfigureRequestEvent xconfigurerequest;
// XCirculateEvent xcirculate;
// XCirculateRequestEvent xcirculaterequest;
// XPropertyEvent xproperty;
// XSelectionClearEvent xselectionclear;
// XSelectionRequestEvent xselectionrequest;
// XSelectionEvent xselection;
// XColormapEvent xcolormap;
// XClientMessageEvent xclient;
// XMappingEvent xmapping;
// XErrorEvent xerror;
// XKeymapEvent xkeymap;
long pad[24];
} XEvent;
/* XFontProp type: not needed for WIN32 */
typedef struct {
Atom name;
unsigned long card32;
} XFontProp;
/* XFontStruct type: not needed for WIN32 */
typedef struct {
XExtData *ext_data;
Font fid;
unsigned direction;
unsigned min_char_or_byte2;
unsigned max_char_or_byte2;
unsigned min_byte1;
unsigned max_byte1;
Bool all_chars_exist;
unsigned default_char;
int n_properties;
XFontProp *properties;
XCharStruct min_bounds;
XCharStruct max_bounds;
XCharStruct *per_char;
int ascent;
int descent;
} XFontStruct;
/* XColor type */
typedef struct {
unsigned long pixel;
unsigned short red, green, blue;
char flags;
char pad;
} XColor;
/* XGCValues type */
typedef struct {
int function;
unsigned long plane_mask;
unsigned long foreground;
unsigned long background;
int line_width;
int line_style;
int cap_style;
int join_style;
int fill_style;
int fill_rule;
int arc_mode;
Pixmap tile;
Pixmap stipple;
int ts_x_origin;
int ts_y_origin;
Font font;
int subwindow_mode;
Bool graphics_exposures;
int clip_x_origin;
int clip_y_origin;
Pixmap clip_mask;
int dash_offset;
char dashes;
} XGCValues;
/* XHostAddress type: not needed for WIN32 */
typedef struct {
int family;
int length;
char *address;
} XHostAddress;
/* XImage type */
typedef struct {
int width, height;
int xoffset;
int format;
char *data;
int byte_order;
int bitmap_unit;
int bitmap_bit_order;
int bitmap_pad;
int depth;
int bytes_per_line;
} XImage;
/* XPoint type */
typedef struct {
int x, y;
} XPoint;
/* XRectangle type */
typedef struct {
short x,y;
unsigned short width, height;
} XRectangle;
/* XrmBinding & XrmBindingList types: not needed for WIN32 */
typedef enum {
XrmBindTightly,
XrmBindLoosely
} XrmBinding, *XrmBindingList;
/* XrmDatabase type: not needed for WIN32 */
typedef char** XrmDatabase;
/* XrmOptionKind type: used by XrmOptionDescRec */
typedef enum {
XrmoptionNoArg,
XrmoptionIsArg,
XrmoptionStickyArg,
XrmoptionSepArg,
XrmoptionResArg,
XrmoptionSkipArg,
XrmoptionSkipLine,
XrmoptionSkipNArgs
} XrmOptionKind;
/* XrmOptionDescRec type: not needed for WIN32 */
typedef struct {
char *option;
char *specifier;
XrmOptionKind argKind;
XPointer value;
} XrmOptionDescRec, *XrmOptionDescList;
/* XrmValue type: not needed for WIN32 */
typedef struct {
unsigned int size;
XPointer addr;
} XrmValue, *XrmValuePtr;
/* XSegment type */
typedef struct {
short x1, y1, x2, y2;
} XSegment;
/* XTextProperty type: not needed for WIN32 */
typedef struct {
unsigned char *value;
Atom encoding;
int format;
unsigned long nitems;
} XTextProperty;
/* XVisualInfo type: not needed for WIN32 */
typedef struct {
Visual *visual;
VisualID visualid;
int screen;
int depth;
#if defined(__cplusplus) || defined(c_plusplus)
int c_class;
#else
int class;
#endif
unsigned long red_mask;
unsigned long green_mask;
unsigned long blue_mask;
int colormap_size;
int bits_per_rgb;
} XVisualInfo;
/* XWindowAttributes type: not needed for WIN32 */
typedef struct {
int x, y;
int width, height;
int border_width;
int depth;
Visual *visual;
Window root;
int class;
int bit_gravity;
int win_gravity;
int backing_store;
unsigned long backing_planes;
unsigned long backing_pixels;
Bool save_under;
Colormap colormap;
Bool map_installed;
int map_state;
long all_events_masks;
long your_event_mask;
long do_not_propogate_mask;
Bool override_redirect;
Screen *screen;
} XWindowAttributes;
/* XWindowChanges type: not needed for WIN32 */
typedef struct {
int x, y;
int width, height;
int border_width;
Window sibling;
int stack_mode;
} XWindowChanges;
/* caddr_t type: char address type */
typedef char *caddr_t;
/* -------------------------------------------------------------------- */
/*-
* prototypes
*/
int nice(int level);
void sleep(int sec);
int sigmask(int signum);
unsigned long BlackPixel(Display *display, int screen_number);
int BlackPixelOfScreen(Screen *screen);
int CellsOfScreen(Screen *screen);
Colormap DefaultColormap(Display *display, int screen_number);
Colormap DefaultColormapOfScreen(Screen *screen);
Visual *DefaultVisual(Display *display, int screen_number);
int DisplayPlanes(Display *display, int screen_number);
char *DisplayString(Display *display);
Window RootWindow(Display *display, int screen_number);
int ScreenCount(Display *display);
Screen *ScreenOfDisplay(Display *display, int screen_number);
unsigned long WhitePixel(Display *display, int screen_number);
int WhitePixelOfScreen(Screen *screen);
void XAddHosts(Display *display, XHostAddress *hosts, int num_hosts);
Status XAllocColor(Display *display, Colormap colormap,
XColor *screen_in_out);
Status XAllocColorCells(Display *display, Colormap colormap,
Bool contig, unsigned long plane_masks_return[],
unsigned int nplanes, unsigned long pixels_return[],
unsigned int npixels);
Status XAllocNamedColor(Display *display, Colormap colormap,
char *color_name, XColor *screen_def_return,
XColor *exact_def_return);
void XBell(Display *display, int percent);
void XChangeGC(Display *display, GC gc, unsigned long valuemask,
XGCValues *values);
Bool XCheckMaskEvent(Display *display, long event_mask,
XEvent *event_return);
void XClearArea(Display *display, Window w, int x, int y,
unsigned int width, unsigned int height, Bool exposures);
void XClearWindow(Display *display, Window w);
void XCloseDisplay(Display *display);
void XConfigureWindow(Display *display, Window w,
unsigned int value_mask,
XWindowChanges *values);
int XCopyArea(Display *display, Drawable src, Drawable dest, GC gc,
int src_x, int src_y, unsigned int width, unsigned height,
int dest_x, int dest_y);
int XCopyPlane(Display *display, Drawable src, Drawable dest, GC gc,
int src_x, int src_y, unsigned width, int height, int dest_x,
int dest_y, unsigned long plane);
Colormap XCopyColormapAndFree(Display *display, Colormap colormap);
Pixmap XCreateBitmapFromData(Display *display, Drawable drawable,
char *data, unsigned int width,
unsigned int height);
Colormap XCreateColormap(Display *display, Window w,
Visual *visual, int alloc);
Cursor XCreateFontCursor(Display *display, unsigned int shape);
GC XCreateGC(Display *display, Drawable drawable,
unsigned long valuemask, XGCValues *values);
XImage *XCreateImage(Display *display, Visual *visual,
unsigned int depth, int format, int offset,
char *data, unsigned int width,
unsigned int height, int bitmap_pad,
int bytes_per_line);
Pixmap XCreatePixmap(Display *display, Drawable d, unsigned int width,
unsigned int height, unsigned int depth);
Cursor XCreatePixmapCursor(Display *display,
Pixmap source, Pixmap mask,
XColor *foreground_color, XColor *background_color,
unsigned int x_hot, unsigned int y_hot);
Pixmap XCreatePixmapFromBitmapData(Display *display, Drawable drawable,
char *data, unsigned int width, unsigned int height,
unsigned long fg, unsigned long bg, unsigned int depth);
void XDefineCursor(Display *display, Window window, Cursor cursor);
void XDestroyImage(XImage *ximage);
void XDisableAccessControl(Display *display);
void XDrawArc(Display *display, Drawable d, GC gc, int x, int y,
unsigned int width, unsigned int height,
int angle1, int angle2);
void XDrawImageString(Display *display, Drawable d, GC gc,
int x, int y, char *string, int length);
void XDrawLine(Display *display, Drawable d, GC gc,
int x1, int y1, int x2, int y2);
void XDrawLines(Display *display, Drawable d, GC gc,
XPoint *points, int npoints, int mode);
void XDrawPoint(Display *display, Drawable d, GC gc, int x, int y);
void XDrawPoints(Display *display, Drawable d, GC gc,
XPoint *pts, int numpts, int mode);
void XDrawRectangle(Display *display, Drawable d, GC gc, int x, int y,
unsigned int width, unsigned int height);
void XDrawSegments(Display *display, Drawable d, GC gc,
XSegment *segs, int numsegs);
void XDrawString(Display *display, Drawable d, GC gc, int x, int y,
char *string, int length);
void XEnableAccessControl(Display *display);
void XFillArc(Display *display, Drawable d, GC gc, int x, int y,
unsigned int width, unsigned int height,
int angle1, int angle2);
void XFillArcs(Display *display, Drawable d, GC gc,
XArc *arcs, int narcs);
void XFillPolygon(Display *display, Drawable d, GC gc, XPoint *points,
int npoints, int shape, int mode);
void XFillRectangle(Display *display, Drawable d, GC gc, int x, int y,
unsigned int width, unsigned int height);
void XFillRectangles(Display *display, Drawable d, GC gc,
XRectangle *rectangles, int nrectangles);
void XFlush(Display *display);
void XFree(void *data);
void XFreeColormap(Display *display, Colormap colormap);
void XFreeColors(Display *display, Colormap colormap,
unsigned long pixels[], int npixels,
unsigned long planes);
void XFreeCursor(Display *display, Cursor cursor);
int XFreeFont(Display *display, XFontStruct *font_struct);
int XFreeFontInfo(char** names, XFontStruct* free_info, int actual_count);
void XFreeGC(Display *display, GC gc);
void XFreePixmap(Display *display, Pixmap pixmap);
GContext XGContextFromGC(GC gc);
XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask,
XVisualInfo *vinfo_template,
int *nitems_return);
Status XGetWindowAttributes(Display *display, Window w,
XWindowAttributes *window_attr_return);
int XGrabKeyboard(Display *display, Window grab_window,
Bool owner_events, int pointer_mode,
int keyboard_mode, Time time);
int XGrabPointer(Display *display, Window grab_window, Bool owner_events,
unsigned int event_mask, int pointer_mode,
int keyboard_mode, Window confine_to, Cursor cursor,
Time time);
void XGrabServer(Display *display);
void XInstallColormap(Display *display, Colormap colormap);
XHostAddress *XListHosts(Display *display, int *nhosts_return,
Bool *state_return);
XFontStruct *XLoadQueryFont(Display *display, char *name);
int XLookupString(XKeyEvent *event_struct, char *buffer_return,
int bytes_buffer, KeySym *keysym_return,
XComposeStatus *status_in_out);
void XMapWindow(Display *display, Window w);
void XNextEvent(Display *display, XEvent *event_return);
Display *XOpenDisplay(char *display_name);
Status XParseColor(Display *display, Colormap colormap,
char *spec, XColor *exact_def_return);
int XPending(Display *display);
void XPutBackEvent(Display *display, XEvent *event);
void XPutImage(Display *display, Drawable d, GC gc, XImage *image, int src_x,
int src_y, int dest_x, int dest_y, unsigned int width,
unsigned int height);
int XPutPixel(XImage *ximage, int x, int y, unsigned long pixel);
void XQueryColor(Display *display, Colormap colormap, XColor *def_in_out);
XFontStruct *XQueryFont(Display* display, XID font_ID);
Bool XQueryPointer(Display *display, Window w, Window *root_return,
Window *child_return, int *root_x_return, int *root_y_return,
int *win_x_return, int *win_y_return,
unsigned int *mask_return);
Status XQueryTree(Display *display, Window w, Window *root_return,
Window *parent_return, Window **children_return,
unsigned int *nchildren_return);
void XRaiseWindow(Display *display, Window w);
int XReadBitmapFile(Display *display, Drawable d, char *filename,
unsigned int *width_return, unsigned int *height_return,
Pixmap *bitmap_return, int *x_hot_return, int *y_hot_return);
void XRemoveHosts(Display *display, XHostAddress *hosts, int num_hosts);
char *XResourceManagerString(Display *display);
void XrmDestroyDatabase(XrmDatabase database);
XrmDatabase XrmGetFileDatabase(char *filename);
Bool XrmGetResource(XrmDatabase database, char *str_name,
char *str_class, char **str_type_return,
XrmValue *value_return);
XrmDatabase XrmGetStringDatabase(char *data);
void XrmInitialize(void);
void XrmMergeDatabases(XrmDatabase source_db, XrmDatabase *target_db);
void XrmParseCommand(XrmDatabase *database, XrmOptionDescList table,
int table_count, char *name, int *argc_in_out,
char **argv_in_out);
void XSetBackground(Display *display, GC gc, unsigned long background);
void XSetFillRule(Display *display, GC gc, int fill_rule);
void XSetFillStyle(Display *display, GC gc, int fill_style);
void XSetFont(Display *display, GC gc, Font font);
void XSetForeground(Display *display, GC gc, unsigned long foreground);
void XSetFunction(Display *display, GC gc, int function);
int XSetGraphicsExposures(Display *display, GC gc, Bool graphics_exposures);
void XSetLineAttributes(Display *display, GC gc,
unsigned int line_width, int line_style,
int cap_style, int join_style);
void XSetScreenSaver(Display *display, int timeout, int interval,
int prefer_blanking, int allow_exposures);
void XSetStipple(Display *display, GC gc, Pixmap stipple);
void XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin);
void XSetWindowColormap(Display *display, Window w, Colormap colormap);
void XSetWMName(Display *display, Window w, XTextProperty *text_prop);
Status XStringListToTextProperty(char **list, int count,
XTextProperty *text_prop_return);
void XStoreColors(Display *display, Colormap colormap, XColor color[],
int ncolors);
void XSync(Display *display, Bool discard);
int XTextWidth(XFontStruct *font_struct, char *string, int count);
Bool XTranslateCoordinates(Display* display, Window src_w, Window dest_w,
int src_x, int src_y,
int* dest_x_return, int* dest_y_return,
Window* child_return);
void XUngrabKeyboard(Display *display, Time time);
void XUngrabPointer(Display *display, Time time);
void XUngrabServer(Display *display);
void XUnmapWindow(Display *display, Window w);
/* -------------------------------------------------------------------- */
#endif /* WIN32 */
#endif /* __XLOCK_XAPI_H__ */
|