1 /* $Id: Xz88dk.h,v 1.2 2016-06-11 13:37:14 dom Exp $ */
2 
3 #ifndef _XZ88DK_H_
4 #define _XZ88DK_H_
5 
6 #include <sys/compiler.h>
7 #include <X11/Xlib.h>
8 //#include <graphics.h>
9 //#include <games.h>
10 
11 
12 //#include <stdio.h>
13 
14 
15 extern int _x_proportional;
16 extern int _y_proportional;
17 extern char *_xchar_proportional;
18 extern int _X_int1;
19 extern int _X_int2;
20 extern int _X_int3;
21 
22 extern int _x_must_expose;
23 
24 
25 /* Base X objects */
26 
27 extern struct _XDisplay __LIB__ *XOpenDisplay(char *display_name);
28 extern void __LIB__ XCloseDisplay(struct _XDisplay *display);
29 
30 extern int __LIB__ DefaultScreen(struct _XDisplay *display);
31 
32 extern int __LIB__ RootWindow(struct _XDisplay *display,int screen) __smallc;
33 
34 extern Window __LIB__ XCreateSimpleWindow(struct _XDisplay *display, Window rootwindow, int x, int y, int width, int height, int border_width, int forecolor, int backcolor) __smallc;
35 extern int __LIB__ XDestroyWindow(struct _XDisplay *display, Window win) __smallc;
36 
37 extern GC __LIB__ *XCreateGC(struct _XDisplay *display, Window win, int valuemask, XGCValues *vals) __smallc;
38 extern void __LIB__ XFreeGC(struct _XDisplay *display, struct _XGC *gc) __smallc;
39 
40 /* Base X objects properties */
41 extern char __LIB__ *XDisplayName(char *display_name);
42 extern int __LIB__ DisplayWidth(struct _XDisplay *display,int screen) __smallc;
43 extern int __LIB__ DisplayHeight(struct _XDisplay *display,int screen) __smallc;
44 extern int __LIB__ DefaultDepth(struct _XDisplay *display,int screen) __smallc;
45 extern int __LIB__ BlackPixel(struct _XDisplay *display, int screen) __smallc;
46 extern int __LIB__ WhitePixel(struct _XDisplay *display, int screen) __smallc;
47 
48 extern void __LIB__ XMapWindow(struct _XDisplay *display, Window win) __smallc;
49 
50 extern void __LIB__ XSetForeground(struct _XDisplay *display, struct _XGC *gc, int color) __smallc;
51 extern void __LIB__ XSetLineAttributes(struct _XDisplay *display, struct _XGC *gc, int line_width, int line_style, int cap_style, int join_style) __smallc;
52 extern void __LIB__ XSetDashes(struct _XDisplay *display, struct _XGC *gc, int dash_offset, char dash_list[], int list_length) __smallc;
53 extern void __LIB__ XSetStandardProperties(struct _XDisplay *display, Window win, char *window_name, char *icon_name, char *icon_pixmap, char **argv, int argc, int *size_hints) __smallc;
54 
55 
56 /* Events */
57 
58 extern void __LIB__ XSelectInput(struct _XDisplay *display, Window win, int event_mask) __smallc;
59 extern void __LIB__ XNextEvent(struct _XDisplay *display, int *event) __smallc;
60 extern Bool __LIB__ XCheckWindowEvent(struct _XDisplay *display, Window win, int event_mask, int event) __smallc;
61 extern int __LIB__ XCheckTypedEvent(struct _XDisplay *display, int type, XEvent *event_return) __smallc;
62 extern int __LIB__ XFlush(struct _XDisplay *display);
63 
64 
65 /* Text handling */
66 
67 extern int __LIB__ XTextWidth(struct _XFontStruct *font_struct, char *string, int count) __smallc;
68 extern struct _XFontStruct __LIB__ *XLoadQueryFont(struct _XDisplay *display, char *fontname) __smallc;
69 extern void __LIB__ XDrawString(struct _XDisplay *display, Window win, struct _XGC *gc, int x, int y, char *text, int textlen) __smallc;
70 
71 extern void  __LIB__ XUnloadFont(struct _XDisplay *display, Font font) __smallc;
72 extern void  __LIB__ XSetFont(struct _XDisplay *display, struct _XGC *gc, Font font) __smallc;
73 
74 
75 /* Pictures handling */
76 
77 extern Pixmap __LIB__ XCreateBitmapFromData(struct _XDisplay *display, Window win, char *bits, int width, int height) __smallc;
78 
79 
80 /* Graphics drawing functions */
81 
82 // It could even work, but the window positioning offset !
83 //#define XDrawRectangle drawb
84 extern void __LIB__ XDrawRectangle(struct _XDisplay *display, Window win, struct _XGC *gc, int x, int y, int width, int height) __smallc;
85 extern void __LIB__ XDrawPoint(struct _XDisplay *display, Window win, struct _XGC *gc, int x, int y) __smallc;
86 extern void __LIB__ XDrawLine(struct _XDisplay *display, Window win, struct _XGC *gc, int x1, int y1, int x2, int y2) __smallc;
87 extern void __LIB__ XClearWindow(struct _XDisplay *display, Window win, struct _XGC *gc, int x, int y, int width, int height, Bool Exposures) __smallc;
88 
89 
90 /*  Internal declarations  */
91 
92 extern char __LIB__ *_xfindchar(char c, char *font) __smallc;
93 extern void __LIB__ _xfputc (char c, char *font, Bool bold) __smallc;
94 
95 
96 
97 /*  Internal structures  */
98 
99 struct _XWIN {
100 	int	x;
101 	int	y;
102 	int	width;		// Drawable area width
103 	int	height;		// Drawable area height
104 	int	a_x;		// area x pos
105 	int	a_y;		// area y pos
106 	int	full_width;
107 	int	full_height;
108 	char	*title;
109         char    *icon;
110         char    *background;
111 };
112 
113 
114 
115 
116 #endif /* _XZ88DK_H_ */
117