xwrap.h

Go to the documentation of this file.
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;           /* logical operation */
00101         unsigned long plane_mask;/* plane mask */
00102         unsigned long foreground;/* foreground pixel */
00103         unsigned long background;/* background pixel */
00104         int line_width;         /* line width */
00105         int line_style;         /* LineSolid, LineOnOffDash, LineDoubleDash */
00106         int cap_style;          /* CapNotLast, CapButt,
00107                                    CapRound, CapProjecting */
00108         int join_style;         /* JoinMiter, JoinRound, JoinBevel */
00109         int fill_style;         /* FillSolid, FillTiled,
00110                                    FillStippled, FillOpaeueStippled */
00111         int fill_rule;          /* EvenOddRule, WindingRule */
00112         int arc_mode;           /* ArcChord, ArcPieSlice */
00113         Pixmap tile;            /* tile pixmap for tiling operations */
00114         Pixmap stipple;         /* stipple 1 plane pixmap for stipping */
00115         int ts_x_origin;        /* offset for tile or stipple operations */
00116         int ts_y_origin;
00117         Font font;              /* default text font for text operations */
00118         int subwindow_mode;     /* ClipByChildren, IncludeInferiors */
00119         Bool graphics_exposures;/* boolean, should exposures be generated */
00120         int clip_x_origin;      /* origin for clipping */
00121         int clip_y_origin;
00122         Pixmap clip_mask;       /* bitmap clipping; other calls for rects */
00123         int dash_offset;        /* patterned/dashed line information */
00124         char dashes;
00125 } XGCValues;
00126 
00127 typedef struct {
00128     unsigned char *value;               /* same as Property routines */
00129     Atom encoding;                      /* prop type */
00130     int format;                         /* prop data format: 8, 16, or 32 */
00131     unsigned long nitems;               /* number of data items in value */
00132 } XTextProperty;
00133 
00134 typedef struct {
00135         void *ext_data; /* hook for extension to hang data */
00136         XID visualid;   /* visual id of this visual */
00137 # if defined(__cplusplus) || defined(c_plusplus)
00138         int c_class;            /* C++ class of screen (monochrome, etc.) */
00139 # else
00140         int class;              /* class of screen (monochrome, etc.) */
00141 # endif
00142         unsigned long red_mask, green_mask, blue_mask;  /* mask values */
00143         int bits_per_rgb;       /* log base 2 of distinct color values */
00144         int map_entries;        /* color 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;                                  /* C++ */
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;          /* size of image */
00166     int xoffset;                /* number of pixels offset in X direction */
00167     int format;                 /* XYBitmap, XYPixmap, ZPixmap */
00168     char *data;                 /* pointer to image data */
00169     int byte_order;             /* data byte order, LSBFirst, MSBFirst */
00170     int bitmap_unit;            /* quant. of scanline 8, 16, 32 */
00171     int bitmap_bit_order;       /* LSBFirst, MSBFirst */
00172     int bitmap_pad;             /* 8, 16, 32 either XY or ZPixmap */
00173     int depth;                  /* depth of image */
00174     int bytes_per_line;         /* accelarator to next line */
00175     int bits_per_pixel;         /* bits per pixel (ZPixmap) */
00176     unsigned long red_mask;     /* bits in z arrangment */
00177     unsigned long green_mask;
00178     unsigned long blue_mask;
00179     void *obdata;               /* hook for the object routines to hang on */
00180     struct funcs {              /* image manipulation routines */
00181 # if NeedFunctionPrototypes
00182         struct _XImage *(*create_image)(
00183                 void* /* display */,
00184                 void*           /* visual */,
00185                 unsigned int    /* depth */,
00186                 int             /* format */,
00187                 int             /* offset */,
00188                 char*           /* data */,
00189                 unsigned int    /* width */,
00190                 unsigned int    /* height */,
00191                 int             /* bitmap_pad */,
00192                 int             /* bytes_per_line */);
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;   /* background or None or ParentRelative */
00211     unsigned long background_pixel;     /* background pixel */
00212     Pixmap border_pixmap;       /* border of the window */
00213     unsigned long border_pixel; /* border pixel value */
00214     int bit_gravity;            /* one of bit gravity values */
00215     int win_gravity;            /* one of the window gravity values */
00216     int backing_store;          /* NotUseful, WhenMapped, Always */
00217     unsigned long backing_planes;/* planes to be preseved if possible */
00218     unsigned long backing_pixel;/* value to use in restoring planes */
00219     Bool save_under;            /* should bits under be saved? (popups) */
00220     long event_mask;            /* set of events that should be saved */
00221     long do_not_propagate_mask; /* set of events that should not propagate */
00222     Bool override_redirect;     /* boolean value for override-redirect */
00223     Colormap colormap;          /* color map to be associated with window */
00224     Cursor cursor;              /* cursor to be displayed (or None) */
00225 } XSetWindowAttributes;
00226 
00227 typedef struct {
00228         unsigned long pixel;
00229         unsigned short red, green, blue;
00230         char flags;  /* do_red, do_green, do_blue */
00231         char pad;
00232 } XColor;
00233 
00234 int XParseGeometry (  char *string,int *x,int *y,
00235                       unsigned int *width,    /* RETURN */
00236                                           unsigned int *height);    /* RETURN */
00237 
00238 /* needed by above function : */
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                         /* X_DISPLAY_MISSING */
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

Generated on Tue Jul 5 14:13:33 2011 for ROOT_528-00b_version by  doxygen 1.5.1