00001 #ifndef XWRAP_H_HEADER_INCLUDED
00002 #define XWRAP_H_HEADER_INCLUDED
00003
00004 #if !defined(X_DISPLAY_MISSING)
00005 # include <X11/Xlib.h>
00006 # include <X11/Xutil.h>
00007 # include <X11/Xmd.h>
00008 # include <X11/Xatom.h>
00009 # include <X11/Xproto.h>
00010 # include <X11/Xresource.h>
00011
00012 #else
00013
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017
00018 # define Display void
00019 # ifndef Bool
00020 # define Bool int
00021 # endif
00022 # ifndef True
00023 # define True 1
00024 # endif
00025 # ifndef False
00026 # define False 0
00027 # endif
00028
00029 #ifdef HAVE_STDINT_H
00030 # include <stdint.h>
00031 # ifndef CARD32
00032 # define CARD32 uint32_t
00033 # endif
00034 # ifndef CARD16
00035 # define CARD16 uint16_t
00036 # endif
00037 # ifndef CARD8
00038 # define CARD8 uint8_t
00039 # endif
00040 #endif
00041
00042 # ifndef CARD32
00043 # define CARD32 unsigned int
00044 # endif
00045 # ifndef CARD16
00046 # define CARD16 unsigned short
00047 # endif
00048 # ifndef CARD8
00049 # define CARD8 unsigned char
00050 # endif
00051
00052 # ifndef XID
00053 # define XID XID
00054 typedef CARD32 XID;
00055 # endif
00056
00057 # ifndef Drawable
00058 # define Drawable Drawable
00059 typedef XID Drawable;
00060 # endif
00061 # ifndef Atom
00062 # define Atom Atom
00063 typedef XID Atom;
00064 # endif
00065 # ifndef Window
00066 # define Window Window
00067 typedef XID Window;
00068 # endif
00069 # ifndef Pixmap
00070 # define Pixmap Pixmap
00071 typedef XID Pixmap;
00072 # endif
00073 # ifndef Font
00074 # define Font Font
00075 typedef XID Font;
00076 # endif
00077 # ifndef Colormap
00078 # define Colormap Colormap
00079 typedef XID Colormap;
00080 # endif
00081 # ifndef Cursor
00082 # define Cursor Cursor
00083 typedef XID Cursor;
00084 # endif
00085 # ifndef VisualID
00086 # define VisualID VisualID
00087 typedef XID VisualID;
00088 # endif
00089
00090 # ifndef GC
00091 # define GC GC
00092 typedef void* GC;
00093 # endif
00094
00095 # ifndef None
00096 # define None 0
00097 # endif
00098
00099 typedef struct {
00100 int function;
00101 unsigned long plane_mask;
00102 unsigned long foreground;
00103 unsigned long background;
00104 int line_width;
00105 int line_style;
00106 int cap_style;
00107
00108 int join_style;
00109 int fill_style;
00110
00111 int fill_rule;
00112 int arc_mode;
00113 Pixmap tile;
00114 Pixmap stipple;
00115 int ts_x_origin;
00116 int ts_y_origin;
00117 Font font;
00118 int subwindow_mode;
00119 Bool graphics_exposures;
00120 int clip_x_origin;
00121 int clip_y_origin;
00122 Pixmap clip_mask;
00123 int dash_offset;
00124 char dashes;
00125 } XGCValues;
00126
00127 typedef struct {
00128 unsigned char *value;
00129 Atom encoding;
00130 int format;
00131 unsigned long nitems;
00132 } XTextProperty;
00133
00134 typedef struct {
00135 void *ext_data;
00136 XID visualid;
00137 # if defined(__cplusplus) || defined(c_plusplus)
00138 int c_class;
00139 # else
00140 int class;
00141 # endif
00142 unsigned long red_mask, green_mask, blue_mask;
00143 int bits_per_rgb;
00144 int map_entries;
00145 } Visual;
00146
00147 typedef struct {
00148 Visual *visual;
00149 VisualID visualid;
00150 int screen;
00151 int depth;
00152 # if defined(__cplusplus) || defined(c_plusplus)
00153 int c_class;
00154 # else
00155 int class;
00156 # endif
00157 unsigned long red_mask;
00158 unsigned long green_mask;
00159 unsigned long blue_mask;
00160 int colormap_size;
00161 int bits_per_rgb;
00162 } XVisualInfo;
00163
00164 typedef struct _XImage {
00165 int width, height;
00166 int xoffset;
00167 int format;
00168 char *data;
00169 int byte_order;
00170 int bitmap_unit;
00171 int bitmap_bit_order;
00172 int bitmap_pad;
00173 int depth;
00174 int bytes_per_line;
00175 int bits_per_pixel;
00176 unsigned long red_mask;
00177 unsigned long green_mask;
00178 unsigned long blue_mask;
00179 void *obdata;
00180 struct funcs {
00181 # if NeedFunctionPrototypes
00182 struct _XImage *(*create_image)(
00183 void* ,
00184 void* ,
00185 unsigned int ,
00186 int ,
00187 int ,
00188 char* ,
00189 unsigned int ,
00190 unsigned int ,
00191 int ,
00192 int );
00193 int (*destroy_image) (struct _XImage *);
00194 unsigned long (*get_pixel) (struct _XImage *, int, int);
00195 int (*put_pixel) (struct _XImage *, int, int, unsigned long);
00196 struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
00197 int (*add_pixel) (struct _XImage *, long);
00198 # else
00199 struct _XImage *(*create_image)();
00200 int (*destroy_image)();
00201 unsigned long (*get_pixel)();
00202 int (*put_pixel)();
00203 struct _XImage *(*sub_image)();
00204 int (*add_pixel)();
00205 # endif
00206 } f;
00207 } XImage;
00208
00209 typedef struct {
00210 Pixmap background_pixmap;
00211 unsigned long background_pixel;
00212 Pixmap border_pixmap;
00213 unsigned long border_pixel;
00214 int bit_gravity;
00215 int win_gravity;
00216 int backing_store;
00217 unsigned long backing_planes;
00218 unsigned long backing_pixel;
00219 Bool save_under;
00220 long event_mask;
00221 long do_not_propagate_mask;
00222 Bool override_redirect;
00223 Colormap colormap;
00224 Cursor cursor;
00225 } XSetWindowAttributes;
00226
00227 typedef struct {
00228 unsigned long pixel;
00229 unsigned short red, green, blue;
00230 char flags;
00231 char pad;
00232 } XColor;
00233
00234 int XParseGeometry ( char *string,int *x,int *y,
00235 unsigned int *width,
00236 unsigned int *height);
00237
00238
00239 # define NoValue 0x0000
00240 # define XValue 0x0001
00241 # define YValue 0x0002
00242 # define WidthValue 0x0004
00243 # define HeightValue 0x0008
00244 # define AllValues 0x000F
00245 # define XNegative 0x0010
00246 # define YNegative 0x0020
00247
00248 # ifdef __cplusplus
00249 }
00250 # endif
00251
00252 #endif
00253
00254 # ifdef __cplusplus
00255 extern "C" {
00256 # endif
00257
00258 # if defined(ASIM_AFTERBASE_H_HEADER_INCLUDED)
00259
00260 int asim_get_drawable_size (Drawable d, unsigned int *ret_w, unsigned int *ret_h);
00261 # define get_drawable_size(d,w,h) asim_get_drawable_size((d),(w),(h))
00262
00263 # else
00264
00265 int grab_server();
00266 int ungrab_server();
00267 Bool is_server_grabbed();
00268
00269
00270 Bool get_drawable_size (Drawable d, unsigned int *ret_w, unsigned int *ret_h);
00271 Drawable validate_drawable (Drawable d, unsigned int *pwidth, unsigned int *pheight);
00272 void backtrace_window ( const char *file, int line, Window w );
00273
00274 Window get_parent_window( Window w );
00275 Window get_topmost_parent( Window w, Window *desktop_w );
00276
00277 # endif
00278
00279 # ifdef __cplusplus
00280 }
00281 # endif
00282
00283 #endif