1 /* xscreensaver, Copyright (c) 1991-2014 Jamie Zawinski <jwz@jwz.org>
3 * Permission to use, copy, modify, distribute, and sell this software and its
4 * documentation for any purpose is hereby granted without fee, provided that
5 * the above copyright notice appear in all copies and that both that
6 * copyright notice and this permission notice appear in supporting
7 * documentation. No representations are made about the suitability of this
8 * software for any purpose. It is provided "as is" without express or
14 But it's a bunch of function definitions that bear some resemblance to
15 Xlib and that do Cocoa-ish things that bear some resemblance to the
16 things that Xlib might have done.
22 extern void jwxyz_abort(const char *fmt, ...) __dead2;
23 #define abort() jwxyz_abort("abort in %s:%d", __FUNCTION__, __LINE__)
27 typedef void * XPointer;
28 typedef unsigned long Time;
29 typedef unsigned int KeySym;
30 typedef unsigned int KeyCode;
31 typedef unsigned int VisualID;
33 typedef struct jwxyz_Display Display;
34 typedef struct jwxyz_Screen Screen;
35 typedef struct jwxyz_Visual Visual;
36 typedef struct jwxyz_Drawable * Drawable;
37 typedef struct jwxyz_Colormap * Colormap;
38 typedef struct jwxyz_GC * GC;
39 typedef struct jwxyz_XColor XColor;
40 typedef struct jwxyz_XGCValues XGCValues;
41 typedef struct jwxyz_XPoint XPoint;
42 typedef struct jwxyz_XSegment XSegment;
43 typedef struct jwxyz_XRectangle XRectangle;
44 typedef struct jwxyz_XArc XArc;
45 typedef struct jwxyz_XWindowAttributes XWindowAttributes;
46 typedef struct jwxyz_XrmOptionDescRec XrmOptionDescRec;
47 typedef struct jwxyz_XrmDatabase * XrmDatabase;
48 typedef struct jwxyz_XImage XImage;
49 typedef struct jwxyz_XFontStruct XFontStruct;
50 typedef struct jwxyz_Font * Font;
51 typedef struct jwxyz_XFontSet * XFontSet;
52 typedef struct jwxyz_XCharStruct XCharStruct;
53 typedef struct jwxyz_XComposeStatus XComposeStatus;
54 typedef struct jwxyz_XPixmapFormatValues XPixmapFormatValues;
55 typedef struct jwxyz_XChar2b XChar2b;
57 typedef union jwxyz_XEvent XEvent;
58 typedef struct jwxyz_XAnyEvent XAnyEvent;
59 typedef struct jwxyz_XKeyEvent XKeyEvent;
60 typedef struct jwxyz_XMotionEvent XMotionEvent;
61 typedef struct jwxyz_XButtonEvent XButtonEvent;
62 typedef XKeyEvent XKeyPressedEvent;
63 typedef XKeyEvent XKeyReleasedEvent;
64 typedef XMotionEvent XPointerMovedEvent;
65 typedef XButtonEvent XButtonPressedEvent;
66 typedef XButtonEvent XButtonReleasedEvent;
69 /* Not technically Xlib... */
70 typedef struct jwxyz_GLXContext * GLXContext;
71 typedef struct jwxyz_XtAppContext * XtAppContext;
72 typedef struct jwxyz_XtIntervalId * XtIntervalId;
73 typedef struct jwxyz_XtInputId * XtInputId;
74 typedef void * XtPointer;
75 typedef unsigned long XtInputMask;
76 #define XtInputReadMask (1L<<0)
77 #define XtInputWriteMask (1L<<1)
78 #define XtInputExceptMask (1L<<2)
81 #define XtIMAlternateInput 4
83 #define XtIMAll (XtIMXEvent | XtIMTimer | XtIMAlternateInput | XtIMSignal)
91 #define Window Drawable
92 #define Pixmap Drawable
94 #define XrmoptionNoArg 0
95 #define XrmoptionSepArg 1
97 #define CoordModeOrigin 0
98 #define CoordModePrevious 1
101 #define LineOnOffDash 1
102 #define LineDoubleDash 2
107 #define CapProjecting 3
115 #define FillStippled 2
116 #define FillOpaqueStippled 3
118 #define EvenOddRule 0
119 #define WindingRule 1
134 #define StaticColor 2
135 #define PseudoColor 3
137 #define DirectColor 5
143 #define DoGreen (1<<1)
144 #define DoBlue (1<<2)
146 #define GCFunction (1L<<0)
147 #define GCPlaneMask (1L<<1)
148 #define GCForeground (1L<<2)
149 #define GCBackground (1L<<3)
150 #define GCLineWidth (1L<<4)
151 #define GCLineStyle (1L<<5)
152 #define GCCapStyle (1L<<6)
153 #define GCJoinStyle (1L<<7)
154 #define GCFillStyle (1L<<8)
155 #define GCFillRule (1L<<9)
156 #define GCTile (1L<<10)
157 #define GCStipple (1L<<11)
158 #define GCTileStipXOrigin (1L<<12)
159 #define GCTileStipYOrigin (1L<<13)
160 #define GCFont (1L<<14)
161 #define GCSubwindowMode (1L<<15)
162 #define GCGraphicsExposures (1L<<16)
163 #define GCClipXOrigin (1L<<17)
164 #define GCClipYOrigin (1L<<18)
165 #define GCClipMask (1L<<19)
166 #define GCDashOffset (1L<<20)
167 #define GCDashList (1L<<21)
168 #define GCArcMode (1L<<22)
172 #define ButtonPress 4
173 #define ButtonRelease 5
174 #define MotionNotify 6
176 #define GraphicsExpose 13
178 #define VisibilityNotify 15
180 #define ClipByChildren 0
181 #define IncludeInferiors 1
183 #define KeyPressMask (1L<<0)
184 #define KeyReleaseMask (1L<<1)
185 #define ButtonPressMask (1L<<2)
186 #define ButtonReleaseMask (1L<<3)
187 #define PointerMotionMask (1L<<6)
195 #define ShiftMask (1<<0)
196 #define LockMask (1<<1)
197 #define ControlMask (1<<2)
198 #define Mod1Mask (1<<3)
199 #define Mod2Mask (1<<4)
200 #define Mod3Mask (1<<5)
201 #define Mod4Mask (1<<6)
202 #define Mod5Mask (1<<7)
203 #define Button1Mask (1<<8)
204 #define Button2Mask (1<<9)
205 #define Button3Mask (1<<10)
206 #define Button4Mask (1<<11)
207 #define Button5Mask (1<<12)
209 #define XK_Shift_L 0xFFE1
210 #define XK_Shift_R 0xFFE2
211 #define XK_Control_L 0xFFE3
212 #define XK_Control_R 0xFFE4
213 #define XK_Caps_Lock 0xFFE5
214 #define XK_Shift_Lock 0xFFE6
215 #define XK_Meta_L 0xFFE7
216 #define XK_Meta_R 0xFFE8
217 #define XK_Alt_L 0xFFE9
218 #define XK_Alt_R 0xFFEA
219 #define XK_Super_L 0xFFEB
220 #define XK_Super_R 0xFFEC
221 #define XK_Hyper_L 0xFFED
222 #define XK_Hyper_R 0xFFEE
224 #define XK_Home 0xFF50
225 #define XK_Left 0xFF51
227 #define XK_Right 0xFF53
228 #define XK_Down 0xFF54
229 #define XK_Prior 0xFF55
230 #define XK_Page_Up 0xFF55
231 #define XK_Next 0xFF56
232 #define XK_Page_Down 0xFF56
233 #define XK_End 0xFF57
234 #define XK_Begin 0xFF58
236 #define GXclear 0x0 /* 0 */
237 #define GXand 0x1 /* src AND dst */
238 // #define GXandReverse 0x2 /* src AND NOT dst */
239 #define GXcopy 0x3 /* src */
240 // #define GXandInverted 0x4 /* NOT src AND dst */
241 // #define GXnoop 0x5 /* dst */
242 #define GXxor 0x6 /* src XOR dst */
243 #define GXor 0x7 /* src OR dst */
244 // #define GXnor 0x8 /* NOT src AND NOT dst */
245 // #define GXequiv 0x9 /* NOT src XOR dst */
246 // #define GXinvert 0xa /* NOT dst */
247 // #define GXorReverse 0xb /* src OR NOT dst */
248 // #define GXcopyInverted 0xc /* NOT src */
249 // #define GXorInverted 0xd /* NOT src OR dst */
250 // #define GXnand 0xe /* NOT src OR NOT dst */
251 #define GXset 0xf /* 1 */
253 #define DefaultScreen(dpy) (0)
254 #define BlackPixelOfScreen(s) (0xFF000000)
255 #define WhitePixelOfScreen(s) (0xFFFFFFFF)
256 #define BlackPixel(dpy,n) BlackPixelOfScreen(0)
257 #define WhitePixel(dpy,n) WhitePixelOfScreen(0)
258 #define CellsOfScreen(s) (0x00FFFFFF)
259 #define XFree(x) free(x)
260 #define BitmapPad(dpy) (8)
261 #define BitmapBitOrder(dpy) (MSBFirst)
262 #define ImageByteOrder(dpy) (MSBFirst)
263 #define DisplayOfScreen XDisplayOfScreen
264 #define DefaultScreenOfDisplay XDefaultScreenOfDisplay
265 #define ScreenOfDisplay(dpy,n) DefaultScreenOfDisplay(dpy)
266 #define DefaultVisualOfScreen XDefaultVisualOfScreen
267 #define DefaultColormapOfScreen(s) (0)
268 #define RootWindow XRootWindow
269 #define RootWindowOfScreen(s) RootWindow(DisplayOfScreen(s),0)
270 #define DisplayWidth XDisplayWidth
271 #define DisplayHeight XDisplayHeight
272 #define XMaxRequestSize(dpy) (65535)
274 #define ScreenCount(dpy) jwxyz_ScreenCount(dpy)
275 extern int jwxyz_ScreenCount(Display *);
277 extern Display *jwxyz_make_display (void *nsview, void *cgc);
278 extern void jwxyz_free_display (Display *);
279 extern void *jwxyz_window_view (Window);
280 extern void jwxyz_window_resized (Display *, Window,
283 extern void jwxyz_mouse_moved (Display *, Window, int x, int y);
284 extern void jwxyz_flush_context (Display *);
286 extern Window XRootWindow (Display *, int screen);
287 extern Screen *XDefaultScreenOfDisplay (Display *);
288 extern Visual *XDefaultVisualOfScreen (Screen *);
289 extern Display *XDisplayOfScreen (Screen *);
290 extern int XDisplayNumberOfScreen (Screen *);
291 extern int XScreenNumberOfScreen (Screen *);
292 extern int XDisplayWidth (Display *, int);
293 extern int XDisplayHeight (Display *, int);
295 extern int XDrawPoint (Display *, Drawable, GC, int x, int y);
296 extern int XDrawPoints (Display *, Drawable, GC, XPoint *, int n, int mode);
297 extern int XDrawSegments (Display *, Drawable, GC, XSegment *, int n);
299 extern GC XCreateGC (Display *, Drawable, unsigned long mask, XGCValues *);
300 extern int XChangeGC (Display *, GC, unsigned long mask, XGCValues *);
301 extern int XFreeGC (Display *, GC);
303 extern int XClearWindow (Display *, Window);
304 extern int XClearArea (Display *, Window, int x, int y, int w, int h,Bool exp);
305 extern int XSetWindowBackground (Display *, Window, unsigned long);
306 extern Status XGetWindowAttributes (Display *, Window, XWindowAttributes *);
307 extern Status XGetGeometry (Display *, Drawable, Window *root_ret,
308 int *x_ret, int *y_ret,
309 unsigned int *w_ret, unsigned int *h_ret,
310 unsigned int *bw_ret, unsigned int *depth_ret);
311 extern Status XAllocColor (Display *, Colormap, XColor *);
312 extern Status XAllocColorCells (Display *, Colormap, Bool contig,
313 unsigned long *pmret, unsigned int npl,
314 unsigned long *pxret, unsigned int npx);
315 extern int XStoreColors (Display *, Colormap, XColor *, int n);
316 extern int XStoreColor (Display *, Colormap, XColor *);
317 extern Status XParseColor(Display *, Colormap, const char *spec, XColor *ret);
318 extern Status XAllocNamedColor (Display *, Colormap, char *name,
319 XColor *screen_ret, XColor *exact_ret);
320 extern int XQueryColor (Display *, Colormap, XColor *);
321 extern int XQueryColors(Display *, Colormap colormap, XColor *, int ncolors);
323 extern int XSetForeground (Display *, GC, unsigned long);
324 extern int XSetBackground (Display *, GC, unsigned long);
325 extern int XSetFunction (Display *, GC, int);
326 extern int XSetSubwindowMode (Display *, GC, int);
327 extern int XSetLineAttributes (Display *, GC, unsigned int line_width,
328 int line_style, int cap_style, int join_style);
329 extern int XSetClipMask (Display *, GC, Pixmap);
330 extern int XSetClipOrigin (Display *, GC, int x, int y);
331 extern int jwxyz_XSetAlphaAllowed (Display *, GC, Bool);
332 extern int jwxyz_XSetAntiAliasing (Display *, GC, Bool);
334 extern int XFlush (Display *);
335 extern int XSync (Display *, Bool);
336 extern int XFreeColors (Display *, Colormap, unsigned long *px, int n,
337 unsigned long planes);
338 extern int XFillPolygon (Display *, Drawable, GC,
339 XPoint * points, int npoints, int shape, int mode);
340 extern int XCopyArea (Display *, Drawable src, Drawable dest, GC,
341 int src_x, int src_y,
342 unsigned int width, unsigned int height,
343 int dest_x, int dest_y);
344 extern int XCopyPlane (Display *, Drawable, Drawable, GC,
345 int src_x, int src_y,
346 unsigned width, int height,
347 int dest_x, int dest_y,
348 unsigned long plane);
350 extern int XDrawLine (Display *, Drawable, GC, int x1, int y1, int x2, int y2);
351 extern int XDrawLines (Display *, Drawable, GC, XPoint *, int n, int mode);
352 extern int XDrawArc (Display *, Drawable, GC, int x, int y,
353 unsigned int width, unsigned int height,
354 int angle1, int angle2);
355 extern int XFillArc (Display *, Drawable, GC, int x, int y,
356 unsigned int width, unsigned int height,
357 int angle1, int angle2);
358 extern int XDrawArcs (Display *, Drawable, GC, XArc *arcs, int narcs);
359 extern int XFillArcs (Display *, Drawable, GC, XArc *arcs, int narcs);
360 extern int XDrawRectangle (Display *, Drawable, GC, int x, int y,
361 unsigned int width, unsigned int height);
362 extern int XFillRectangle (Display *, Drawable, GC, int x, int y,
363 unsigned int width, unsigned int height);
364 extern int XFillRectangles (Display *, Drawable, GC, XRectangle *, int n);
366 extern int XDrawString (Display *, Drawable, GC, int x, int y, const char *,
368 extern int XDrawImageString (Display *, Drawable, GC, int x, int y,
369 const char *, int len);
370 extern int XDrawString16 (Display *, Drawable, GC, int x, int y,
371 const XChar2b *, int len);
373 extern Bool XQueryPointer (Display *, Window, Window *root_ret,
375 int *root_x_ret, int *root_y_ret,
376 int *win_x_ret, int *win_y_ret,
377 unsigned int *mask_ret);
378 extern int XLookupString (XKeyEvent *, char *ret, int size, KeySym *ks_ret,
380 extern KeySym XKeycodeToKeysym (Display *, KeyCode, int index);
382 extern Status XInitImage (XImage *);
383 extern XImage *XCreateImage (Display *, Visual *, unsigned int depth,
384 int format, int offset, char *data,
385 unsigned int width, unsigned int height,
386 int bitmap_pad, int bytes_per_line);
387 extern XImage *XSubImage (XImage *, int x, int y,
388 unsigned int w, unsigned int h);
390 extern unsigned long XGetPixel (XImage *, int x, int y);
391 extern int XPutPixel (XImage *, int x, int y, unsigned long);
392 extern int XDestroyImage (XImage *);
393 extern int XPutImage (Display *, Drawable, GC, XImage *,
394 int src_x, int src_y, int dest_x, int dest_y,
395 unsigned int w, unsigned int h);
396 extern XImage *XGetImage (Display *, Drawable, int x, int y,
397 unsigned int w, unsigned int h,
398 unsigned long pm, int fmt);
399 extern Pixmap XCreatePixmapFromBitmapData (Display *, Drawable,
401 unsigned int w, unsigned int h,
405 extern XPixmapFormatValues *XListPixmapFormats (Display *, int *count_ret);
407 extern void jwxyz_draw_NSImage_or_CGImage (Display *, Drawable,
408 Bool nsimg_p, void *NSImage_arg,
409 XRectangle *geom_ret,
412 extern int XSetGraphicsExposures (Display *, GC, Bool);
413 extern Bool XTranslateCoordinates (Display *, Window src_w, Window dest_w,
414 int src_x, int src_y,
415 int *dest_x_ret, int *dest_y_ret,
418 extern Font XLoadFont (Display *, const char *);
419 extern XFontStruct * XQueryFont (Display *, Font);
420 extern XFontStruct * XLoadQueryFont (Display *, const char *);
421 extern int XFreeFontInfo (char **names, XFontStruct *info, int n);
422 extern int XFreeFont (Display *, XFontStruct *);
423 extern int XUnloadFont (Display *, Font);
424 extern int XTextExtents (XFontStruct *, const char *, int length,
425 int *dir_ret, int *ascent_ret, int *descent_ret,
426 XCharStruct *overall_ret);
427 extern int XTextExtents16 (XFontStruct *, const XChar2b *, int length,
428 int *dir_ret, int *ascent_ret, int *descent_ret,
429 XCharStruct *overall_ret);
430 extern int XTextWidth (XFontStruct *, const char *, int length);
431 extern int XSetFont (Display *, GC, Font);
433 extern XFontSet XCreateFontSet (Display *, char *name,
434 char ***missing_charset_list_return,
435 int *missing_charset_count_return,
436 char **def_string_return);
437 extern void XFreeFontSet (Display *, XFontSet);
438 extern void XFreeStringList (char **);
439 extern int Xutf8TextExtents (XFontSet, const char *, int num_bytes,
440 XRectangle *overall_ink_return,
441 XRectangle *overall_logical_return);
442 extern void Xutf8DrawString (Display *, Drawable, XFontSet, GC,
443 int x, int y, const char *, int num_bytes);
445 extern Pixmap XCreatePixmap (Display *, Drawable,
446 unsigned int width, unsigned int height,
448 extern int XFreePixmap (Display *, Pixmap);
451 extern XtAppContext XtDisplayToApplicationContext (Display *);
452 typedef void (*XtTimerCallbackProc) (XtPointer closure, XtIntervalId *);
453 typedef void (*XtInputCallbackProc) (XtPointer closure, int *fd, XtInputId *);
454 extern XtIntervalId XtAppAddTimeOut (XtAppContext, unsigned long usecs,
455 XtTimerCallbackProc, XtPointer closure);
456 extern void XtRemoveTimeOut (XtIntervalId);
457 extern XtInputId XtAppAddInput (XtAppContext, int fd, XtPointer flags,
458 XtInputCallbackProc, XtPointer closure);
459 extern void XtRemoveInput (XtInputId);
460 extern XtInputMask XtAppPending (XtAppContext);
461 extern void XtAppProcessEvent (XtAppContext, XtInputMask);
462 extern struct jwxyz_sources_data *display_sources_data (Display *);
464 // Some GLX stuff that also doesn't technically belong here...
465 // from XScreenSaverGLView.m
466 extern void glXSwapBuffers (Display *, Window);
467 extern void glXMakeCurrent (Display *, Window, GLXContext);
469 // also declared in utils/visual.h
470 extern int has_writable_cells (Screen *, Visual *);
471 extern int visual_depth (Screen *, Visual *);
472 extern int visual_cells (Screen *, Visual *);
473 extern int visual_class (Screen *, Visual *);
474 extern int get_bits_per_pixel (Display *, int);
475 extern int screen_number (Screen *);
477 // also declared in utils/grabclient.h
478 extern Bool use_subwindow_mode_p (Screen *, Window);
481 struct jwxyz_Visual {
482 VisualID visualid; /* visual id of this visual */
483 int class; /* class of screen (monochrome, etc.) */
484 unsigned long red_mask, green_mask, blue_mask; /* mask values */
485 int bits_per_rgb; /* log base 2 of distinct color values */
486 // int map_entries; /* color map entries */
489 struct jwxyz_XGCValues {
490 int function; /* logical operation */
492 unsigned long plane_mask;/* plane mask */
494 unsigned long foreground;/* foreground pixel */
495 unsigned long background;/* background pixel */
496 int line_width; /* line width */
498 int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */
500 int cap_style; /* CapNotLast, CapButt, CapRound, CapProjecting */
501 int join_style; /* JoinMiter, JoinRound, JoinBevel */
503 int fill_style; /* FillSolid, FillTiled,
504 FillStippled, FillOpaeueStippled */
506 int fill_rule; /* EvenOddRule, WindingRule */
508 int arc_mode; /* ArcChord, ArcPieSlice */
509 Pixmap tile; /* tile pixmap for tiling operations */
510 Pixmap stipple; /* stipple 1 plane pixmap for stipping */
511 int ts_x_origin; /* offset for tile or stipple operations */
514 Font font; /* default text font for text operations */
515 int subwindow_mode; /* ClipByChildren, IncludeInferiors */
517 Bool graphics_exposures;/* boolean, should exposures be generated */
519 int clip_x_origin; /* origin for clipping */
521 Pixmap clip_mask; /* bitmap clipping; other calls for rects */
523 int dash_offset; /* patterned/dashed line information */
527 Bool alpha_allowed_p; /* jwxyz extension: whether pixel values may have
528 a non-opaque alpha component. */
529 Bool antialias_p; /* jwxyz extension: whether Quartz should draw
530 with antialiasing. */
533 struct jwxyz_XWindowAttributes {
534 int x, y; /* location of window */
535 int width, height; /* width and height of window */
536 int border_width; /* border width of window */
537 int depth; /* depth of window */
538 Visual *visual; /* the associated visual structure */
540 Window root; /* root of screen containing window */
541 int class; /* InputOutput, InputOnly*/
542 int bit_gravity; /* one of bit gravity values */
543 int win_gravity; /* one of the window gravity values */
544 int backing_store; /* NotUseful, WhenMapped, Always */
545 unsigned long backing_planes;/* planes to be preserved if possible */
546 unsigned long backing_pixel;/* value to be used when restoring planes */
547 Bool save_under; /* boolean, should bits under be saved? */
549 Colormap colormap; /* color map to be associated with window */
551 Bool map_installed; /* boolean, is color map currently installed*/
552 int map_state; /* IsUnmapped, IsUnviewable, IsViewable */
553 long all_event_masks; /* set of events all people have interest in*/
554 long your_event_mask; /* my event mask */
555 long do_not_propagate_mask; /* set of events that should not propagate */
556 Bool override_redirect; /* boolean value for override-redirect */
558 Screen *screen; /* back pointer to correct screen */
561 struct jwxyz_XColor {
563 unsigned short red, green, blue;
564 char flags; /* do_red, do_green, do_blue */
568 struct jwxyz_XPoint {
572 struct jwxyz_XSegment {
573 short x1, y1, x2, y2;
576 struct jwxyz_XRectangle {
578 unsigned short width, height;
583 unsigned short width, height;
584 short angle1, angle2;
588 struct jwxyz_XrmOptionDescRec {
595 struct jwxyz_XAnyEvent {
598 unsigned long serial;
605 struct jwxyz_XKeyEvent {
608 unsigned long serial;
619 unsigned int keycode;
625 struct jwxyz_XButtonEvent {
628 unsigned long serial;
647 struct jwxyz_XMotionEvent {
650 unsigned long serial;
673 XButtonEvent xbutton;
674 XMotionEvent xmotion;
677 struct jwxyz_XImage {
678 int width, height; /* size of image */
679 int xoffset; /* number of pixels offset in X direction */
680 int format; /* XYBitmap, XYPixmap, ZPixmap */
681 char *data; /* pointer to image data */
682 int byte_order; /* data byte order, LSBFirst, MSBFirst */
683 int bitmap_unit; /* quant. of scanline 8, 16, 32 */
684 int bitmap_bit_order; /* LSBFirst, MSBFirst */
685 int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */
686 int depth; /* depth of image */
687 int bytes_per_line; /* accelarator to next line */
688 int bits_per_pixel; /* bits per pixel (ZPixmap) */
689 unsigned long red_mask; /* bits in z arrangment */
690 unsigned long green_mask;
691 unsigned long blue_mask;
692 // XPointer obdata; /* hook for the object routines to hang on */
693 struct funcs { /* image manipulation routines */
695 XImage *(*create_image)(
696 Display* /* display */,
697 Visual* /* visual */,
698 unsigned int /* depth */,
702 unsigned int /* width */,
703 unsigned int /* height */,
704 int /* bitmap_pad */,
705 int /* bytes_per_line */);
706 int (*destroy_image) (XImage *);
708 unsigned long (*get_pixel) (XImage *, int, int);
709 int (*put_pixel) (XImage *, int, int, unsigned long);
711 XImage *(*sub_image) (XImage *, int, int, unsigned int, unsigned int);
712 int (*add_pixel) (XImage *, long);
717 struct jwxyz_XCharStruct {
718 short lbearing; /* origin to left edge of ink */
719 short rbearing; /* origin to right edge of ink */
720 short width; /* advance to next char's origin */
721 short ascent; /* baseline to top edge of ink */
722 short descent; /* baseline to bottom edge of ink */
724 unsigned short attributes; /* per char flags (not predefined) */
728 struct jwxyz_XFontStruct {
730 XExtData *ext_data; /* hook for extension to hang data */
732 Font fid; /* Font id for this font */
734 unsigned direction; /* hint about direction the font is painted */
736 unsigned min_char_or_byte2; /* first character */
737 unsigned max_char_or_byte2; /* last character */
739 unsigned min_byte1; /* first row that exists */
740 unsigned max_byte1; /* last row that exists */
741 Bool all_chars_exist; /* flag if all characters have non-zero size*/
743 unsigned default_char; /* char to print for undefined character */
745 int n_properties; /* how many properties there are */
746 XFontProp *properties; /* pointer to array of additional properties*/
748 XCharStruct min_bounds; /* minimum bounds over all existing char*/
749 XCharStruct max_bounds; /* maximum bounds over all existing char*/
750 XCharStruct *per_char; /* first_char to last_char information */
751 int ascent; /* log. extent above baseline for spacing */
752 int descent; /* log. descent below baseline for spacing */
755 struct jwxyz_XComposeStatus {
759 struct jwxyz_XPixmapFormatValues {
765 struct jwxyz_XChar2b {
770 #endif /* __JWXYZ_H__ */