X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=OSX%2Fjwxyz.h;h=0d7ebe8b18e302ecb974946db05e156a96e0a968;hb=d5186197bc394e10a4402f7f6d23fbb14103bc50;hp=58d17fe497f3b5035d084c07c41380bd60d49c46;hpb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;p=xscreensaver diff --git a/OSX/jwxyz.h b/OSX/jwxyz.h index 58d17fe4..0d7ebe8b 100644 --- a/OSX/jwxyz.h +++ b/OSX/jwxyz.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1991-2012 Jamie Zawinski +/* xscreensaver, Copyright (c) 1991-2014 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -19,6 +19,9 @@ #ifndef __JWXYZ_H__ #define __JWXYZ_H__ +extern void jwxyz_abort(const char *fmt, ...) __dead2; +#define abort() jwxyz_abort("abort in %s:%d", __FUNCTION__, __LINE__) + typedef int Bool; typedef int Status; typedef void * XPointer; @@ -45,9 +48,11 @@ typedef struct jwxyz_XrmDatabase * XrmDatabase; typedef struct jwxyz_XImage XImage; typedef struct jwxyz_XFontStruct XFontStruct; typedef struct jwxyz_Font * Font; +typedef struct jwxyz_XFontSet * XFontSet; typedef struct jwxyz_XCharStruct XCharStruct; typedef struct jwxyz_XComposeStatus XComposeStatus; typedef struct jwxyz_XPixmapFormatValues XPixmapFormatValues; +typedef struct jwxyz_XChar2b XChar2b; typedef union jwxyz_XEvent XEvent; typedef struct jwxyz_XAnyEvent XAnyEvent; @@ -266,6 +271,9 @@ typedef unsigned long XtInputMask; #define DisplayHeight XDisplayHeight #define XMaxRequestSize(dpy) (65535) +#define ScreenCount(dpy) jwxyz_ScreenCount(dpy) +extern int jwxyz_ScreenCount(Display *); + extern Display *jwxyz_make_display (void *nsview, void *cgc); extern void jwxyz_free_display (Display *); extern void *jwxyz_window_view (Window); @@ -273,6 +281,7 @@ extern void jwxyz_window_resized (Display *, Window, int, int, int, int, void *cgc); extern void jwxyz_mouse_moved (Display *, Window, int x, int y); +extern void jwxyz_flush_context (Display *); extern Window XRootWindow (Display *, int screen); extern Screen *XDefaultScreenOfDisplay (Display *); @@ -358,6 +367,8 @@ extern int XDrawString (Display *, Drawable, GC, int x, int y, const char *, int len); extern int XDrawImageString (Display *, Drawable, GC, int x, int y, const char *, int len); +extern int XDrawString16 (Display *, Drawable, GC, int x, int y, + const XChar2b *, int len); extern Bool XQueryPointer (Display *, Window, Window *root_ret, Window *child_ret, @@ -413,9 +424,24 @@ extern int XUnloadFont (Display *, Font); extern int XTextExtents (XFontStruct *, const char *, int length, int *dir_ret, int *ascent_ret, int *descent_ret, XCharStruct *overall_ret); +extern int XTextExtents16 (XFontStruct *, const XChar2b *, int length, + int *dir_ret, int *ascent_ret, int *descent_ret, + XCharStruct *overall_ret); extern int XTextWidth (XFontStruct *, const char *, int length); extern int XSetFont (Display *, GC, Font); +extern XFontSet XCreateFontSet (Display *, char *name, + char ***missing_charset_list_return, + int *missing_charset_count_return, + char **def_string_return); +extern void XFreeFontSet (Display *, XFontSet); +extern void XFreeStringList (char **); +extern int Xutf8TextExtents (XFontSet, const char *, int num_bytes, + XRectangle *overall_ink_return, + XRectangle *overall_logical_return); +extern void Xutf8DrawString (Display *, Drawable, XFontSet, GC, + int x, int y, const char *, int num_bytes); + extern Pixmap XCreatePixmap (Display *, Drawable, unsigned int width, unsigned int height, unsigned int depth); @@ -445,10 +471,13 @@ extern int has_writable_cells (Screen *, Visual *); extern int visual_depth (Screen *, Visual *); extern int visual_cells (Screen *, Visual *); extern int visual_class (Screen *, Visual *); +extern int get_bits_per_pixel (Display *, int); +extern int screen_number (Screen *); // also declared in utils/grabclient.h extern Bool use_subwindow_mode_p (Screen *, Window); + struct jwxyz_Visual { VisualID visualid; /* visual id of this visual */ int class; /* class of screen (monochrome, etc.) */ @@ -686,11 +715,11 @@ struct jwxyz_XImage { }; struct jwxyz_XCharStruct { - short lbearing; /* origin to left edge of raster */ - short rbearing; /* origin to right edge of raster */ + short lbearing; /* origin to left edge of ink */ + short rbearing; /* origin to right edge of ink */ short width; /* advance to next char's origin */ - short ascent; /* baseline to top edge of raster */ - short descent; /* baseline to bottom edge of raster */ + short ascent; /* baseline to top edge of ink */ + short descent; /* baseline to bottom edge of ink */ #if 0 unsigned short attributes; /* per char flags (not predefined) */ #endif @@ -733,4 +762,9 @@ struct jwxyz_XPixmapFormatValues { int scanline_pad; }; +struct jwxyz_XChar2b { + unsigned char byte1; + unsigned char byte2; +}; + #endif /* __JWXYZ_H__ */