[Git]Ignore work files.
[synaesthesia.git] / xlib.h
blobe1e813e4ed7a4ea708671d70d74f37855da206a4
1 /*
2 * XaoS, a fast portable realtime fractal zoomer
3 * Copyright (C) 1996,1997 by
5 * Jan Hubicka (hubicka@paru.cas.cz)
6 * Thomas Marsh (tmarsh@austin.ibm.com)
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef XAOS_X11_H
23 #define XAOS_X11_H
25 #include <X11/Xlib.h>
26 #include <X11/Xutil.h>
27 #include <X11/keysym.h>
28 #include <X11/keysymdef.h>
29 //#include "config.h"
30 //#define MITSHM
32 #ifdef MITSHM
33 #include <sys/types.h>
34 #include <sys/ipc.h>
35 #include <sys/shm.h>
36 #include <X11/extensions/XShm.h>
37 #endif /* MITSHM */
39 typedef struct {
40 int n;
41 XColor c[256];
42 } xcol_t;
44 typedef struct {
45 int privatecolormap;
46 int usedefault;
47 int nomitshm;
48 } xlibparam;
50 typedef struct {
51 Colormap colormap;
52 Colormap defaultcolormap;
53 int fixedcolormap;
54 int privatecolormap;
55 xlibparam *params;
56 Display *display;
57 Window parent_window;
58 Window window;
59 unsigned int width, height;
60 unsigned int border_width;
61 unsigned long background;
62 int depth;
63 unsigned int classX;
64 Visual *visual;
65 unsigned long valuemask;
66 XSetWindowAttributes *attributes;
67 unsigned long attr_mask;
68 XSizeHints sizehints;
69 int screen;
70 char *window_name;
71 int status;
72 GC gc;
73 XGCValues xgcvalues;
74 xcol_t xcolor;
75 Pixmap pixmap;
76 XFontStruct *font_struct;
77 int screen_changed;
78 int lastx, lasty;
79 int mouse_x, mouse_y;
80 unsigned int mouse_buttons;
81 int current;
82 XImage *image[2];
83 #ifdef MITSHM
84 XShmSegmentInfo xshminfo[2];
85 int SharedMemOption;
86 int SharedMemFlag;
87 #endif /* MITSHM */
88 unsigned long pixels[256];
89 char *vbuffs[2];
90 char *data[2];
91 char *vbuff;
92 char *back;
93 int truecolor;
94 int linewidth;
96 Cursor cursor;
97 } xdisplay;
99 extern int alloc_shm_image(xdisplay * d);
100 extern void free_shm_image(xdisplay * d);
101 extern int alloc_image(xdisplay * d);
102 extern void free_image(xdisplay * d);
103 extern int xupdate_size(xdisplay * d);
104 extern void xflip_buffers(xdisplay * d);
105 extern xdisplay *xalloc_display(char *n, int x, int y, int width,int height, xlibparam * p);
106 extern void xfree_display(xdisplay * d);
107 extern void xsetcolor(xdisplay * d, int col);
108 extern int xsetfont(xdisplay * d, char *font_name);
109 extern int xalloc_color(xdisplay * d, int r, int g, int b, int readwrite);
110 extern void xfree_colors(xdisplay * d);
111 extern void xline(xdisplay * d, int x1, int y1, int x2, int y2);
112 extern void xmoveto(xdisplay * d, int x, int y);
113 extern void xlineto(xdisplay * d, int x, int y);
114 extern void xrect(xdisplay * d, int x1, int y1, int x2, int y2);
115 extern void xfillrect(xdisplay * d, int x1, int y1, int x2, int y2);
116 extern void xarc(xdisplay * d, int x, int y, unsigned int w,
117 unsigned int h, int a1, int a2);
118 extern void xfillarc(xdisplay * d, int x, int y, unsigned int w,
119 unsigned int h, int a1, int a2);
120 extern void xpoint(xdisplay * d, int x, int y);
121 extern void xflush(xdisplay * d);
122 extern void xclear_screen(xdisplay * d);
123 extern void xrotate_palette(xdisplay * d, int direction, unsigned char c[3][256], int ncolors);
124 extern void draw_screen(xdisplay * d);
125 extern void xouttext(xdisplay * d, char *string);
126 extern void xresize(xdisplay * d, XEvent * ev);
127 extern void xsize_set(xdisplay *d, int width, int height);
128 extern int xsize_update(xdisplay *d,int *width,int *height);
129 extern int xmouse_x(xdisplay * d);
130 extern int xmouse_y(xdisplay * d);
131 extern void xmouse_update(xdisplay * d);
132 extern char xkeyboard_query(xdisplay * d);
133 extern unsigned int xmouse_buttons(xdisplay * d);
135 #endif /* XAOS_X11_H */