typedef int int32; typedef unsigned int uint32; typedef short int16; typedef unsigned char uint8; typedef unsigned short unichar_t; enum charset { em_none = -1, em_symbol, em_zapfding, em_user, em_adobestandard = em_user }; typedef uint32 Color; typedef struct gimage { } GImage; typedef struct grect { } GRect; typedef struct gpoint { } GPoint; typedef struct { } FontRequest; typedef struct { } FontMods; enum gic_style { gic_overspot = 2, gic_root = 1, gic_hidden = 0, gic_orlesser = 4, gic_type = 3 }; typedef struct ginput_context GIC; enum selnames { sn_primary, sn_clipboard, sn_drag_and_drop, sn_max }; typedef struct gwindow *GWindow; typedef struct gdisplay GDisplay; typedef struct gtimer GTimer; typedef struct gevent { enum event_type { et_noevent = -1, et_char, et_charup, et_mousemove, et_mousedown, et_mouseup, et_crossing, et_focus, et_expose, et_visibility, et_resize, et_timer, et_close, et_create, et_map, et_destroy, et_selclear, et_drag, et_dragout, et_drop, et_lastnativeevent = et_drop, et_controlevent, et_user } type; } GEvent; typedef enum cursor_types { ct_default, ct_pointer, ct_backpointer, ct_hand, ct_question, ct_cross, ct_4way, ct_text, ct_watch, ct_draganddrop, ct_invisible, ct_user, ct_user2 } GCursor; typedef struct gwindow_attrs { } GWindowAttrs; typedef struct gprinter_attrs { } GPrinterAttrs; enum gzoom_flags { gzf_pos = 1, gzf_size = 2 }; typedef struct { } GChar2b; struct displayfuncs { void (*init) (GDisplay *); void (*term) (GDisplay *); void *(*nativeDisplay) (GDisplay *); void (*setDefaultIcon) (GWindow); GWindow(*createTopWindow) (GDisplay *, GRect * pos, int (*eh) (GWindow, GEvent *), void *user_data, GWindowAttrs *); GWindow(*createSubWindow) (GWindow, GRect * pos, int (*eh) (GWindow, GEvent *), void *user_data, GWindowAttrs *); GWindow(*createPixmap) (GDisplay *, unsigned short width, unsigned short height); GWindow(*createBitmap) (GDisplay *, unsigned short width, unsigned short height, uint8 * data); GCursor(*createCursor) (GWindow src, GWindow mask, Color fg, Color bg, int16 x, int16 y); void (*destroyWindow) (GWindow); void (*destroyCursor) (GDisplay *, GCursor); int (*nativeWindowExists) (GDisplay *, void *native_window); void (*setZoom) (GWindow, GRect * size, enum gzoom_flags flags); void (*setWindowBorder) (GWindow, int width, Color); int (*setDither) (GDisplay *, int); void (*reparentWindow) (GWindow, GWindow, int, int); void (*setVisible) (GWindow, int); void (*move) (GWindow, int32, int32); void (*trueMove) (GWindow, int32, int32); void (*resize) (GWindow, int32, int32); void (*moveResize) (GWindow, int32, int32, int32, int32); void (*raise) (GWindow); void (*raiseAbove) (GWindow, GWindow); int (*isAbove) (GWindow, GWindow); void (*lower) (GWindow); void (*setWindowTitles) (GWindow, const unichar_t * title, const unichar_t * icontitle); void (*setWindowTitles8) (GWindow, const char *title, const char *icontitle); unichar_t *(*getWindowTitle) (GWindow); char *(*getWindowTitle8) (GWindow); void (*getPointerPos) (GWindow, GEvent *); void (*setCursor) (GWindow, GCursor); GCursor(*getCursor) (GWindow); GWindow(*getRedirectWindow) (GDisplay * gd); void (*translateCoordinates) (GWindow from, GWindow to, GPoint * pt); void (*beep) (GDisplay *); void (*flush) (GDisplay *); void (*pushClip) (GWindow, GRect * rct, GRect * old); void (*popClip) (GWindow, GRect * old); void (*eventLoop) (GDisplay *); void (*postEvent) (GEvent * e); void (*postDragEvent) (GWindow w, GEvent * mouse, enum event_type et); int (*requestDeviceEvents) (GWindow w, int devcnt, void *de); GTimer *(*requestTimer) (GWindow w, int32 time_from_now, int32 frequency, void *userdata); void (*cancelTimer) (GTimer * timer); int (*endJob) (GWindow w, int cancel); }; typedef struct gpswindow { } *GPSWindow; typedef struct gpsdisplay { struct displayfuncs *funcs; } GPSDisplay; extern void _GPSDraw_Image(GWindow, GImage *, GRect * src, int32 x, int32 y); extern void _GPSDraw_TileImage(GWindow, GImage *, GRect * src, int32 x, int32 y); extern void _GPSDraw_ImageMagnified(GWindow, GImage *, GRect * src, int32 x, int32 y, int32 width, int32 height); extern void *_GPSDraw_LoadFontMetrics(GDisplay * gdisp, void *fd); extern struct font_data *_GPSDraw_ScaleFont(GDisplay * gdisp, struct font_data *fd, FontRequest * rq); extern struct font_data *_GPSDraw_StylizeFont(GDisplay * gdisp, struct font_data *fd, FontRequest * rq); static void PSDrawInit(GDisplay * gdisp) { } static void PSDrawTerm(GDisplay * gdisp) { } static void *PSDrawNativeDisplay(GDisplay * gdisp) { } static void PSDrawSetDefaultIcon(GWindow icon) { } static GWindow PSDrawCreateSubWindow(GWindow w, GRect * pos, int (*eh) (GWindow, GEvent *), void *user_data, GWindowAttrs * wattrs) { } static GWindow PSDrawCreatePixmap(GDisplay * gdisp, unsigned short width, unsigned short height) { } static GWindow PSDrawCreateBitmap(GDisplay * gdisp, unsigned short width, unsigned short height, uint8 * data) { } static GCursor PSDrawCreateCursor(GWindow src, GWindow mask, Color fg, Color bg, int16 x, int16 y) { } static void PSSetZoom(GWindow w, GRect * r, enum gzoom_flags flags) { } static void PSDestroyCursor(GDisplay * gdisp, GCursor ct) { } static int PSNativeWindowExists(GDisplay * gdisp, void *native) { } static void PSSetWindowBorder(GWindow w, int width, Color col) { } static int PSSetDither(GDisplay * gdisp, int dither) { } static void PSDrawReparentWindow(GWindow child, GWindow newparent, int x, int y) { } static void PSDrawSetVisible(GWindow w, int vis) { } static void PSDrawMove(GWindow w, int32 x, int32 y) { } static void PSDrawResize(GWindow w, int32 width, int32 height) { } static void PSDrawMoveResize(GWindow w, int32 x, int32 y, int32 width, int32 height) { } static void PSDrawRaise(GWindow w) { } static void PSDrawRaiseAbove(GWindow w, GWindow below) { } static int PSDrawIsAbove(GWindow w, GWindow below) { } static void PSDrawLower(GWindow w) { } static void PSDrawSetWindowTitles(GWindow w, const unichar_t * title, const unichar_t * icontit) { } static void PSDrawSetWindowTitles8(GWindow w, const char *title, const char *icontit) { } static void PSDrawGetPointerPosition(GWindow w, GEvent * ret) { } static void PSDrawSetCursor(GWindow w, GCursor ct) { } static GCursor PSDrawGetCursor(GWindow w) { } static GWindow PSDrawGetRedirectWindow(GDisplay * gd) { } static unichar_t *PSDrawGetWindowTitle(GWindow w) { } static char *PSDrawGetWindowTitle8(GWindow w) { } static void PSDrawTranslateCoordinates(GWindow _from, GWindow _to, GPoint * pt) { } static void PSDrawScroll(GWindow w, GRect * rect, int32 hor, int32 vert) { } static void PSDrawBeep(GDisplay * gdisp) { } static void PSDrawFlush(GDisplay * gdisp) { } static GIC *PSDrawCreateInputContext(GWindow w, enum gic_style def_style) { } static void PSDrawSetGIC(GWindow w, GIC * gic, int x, int y) { } static void PSDrawPointerUngrab(GDisplay * gdisp) { } static void PSDrawPointerGrab(GWindow w) { } static void PSDrawGrabSelection(GWindow w, enum selnames sel) { } static void PSDrawAddSelectionType(GWindow w, enum selnames sel, char *type, void *data, int32 len, int32 unitsize, void *(*gendata) (void *, int32 * len), void (*freedata) (void *)) { } static void *PSDrawRequestSelection(GWindow w, enum selnames sn, char *typename, int32 * len) { } static int PSDrawSelectionHasType(GWindow w, enum selnames sn, char *typename) { } static void PSDrawRequestExpose(GWindow gw, GRect * rect, int doclear) { } static GTimer *PSDrawRequestTimer(GWindow w, int32 time_from_now, int32 frequency, void *userdata) { } static void PSDrawCancelTimer(GTimer * timer) { } static void PSDrawSyncThread(GDisplay * gdisp, void (*func) (void *), void *data) { } static void PSDrawForceUpdate(GWindow gw) { } static void PSDrawSync(GDisplay * gdisp) { } static void PSDrawSkipMouseMoveEvents(GWindow gw, GEvent * last) { } static void PSDrawProcessPendingEvents(GDisplay * gdisp) { } static void PSDrawProcessWindowEvents(GWindow gw) { } static void PSDrawEventLoop(GDisplay * gd) { } static void PSDrawPostEvent(GEvent * e) { } static void PSDrawPostDragEvent(GWindow w, GEvent * mouse, enum event_type et) { } static int PSDrawRequestDeviceEvents(GWindow w, int devcnt, void *de) { } static GImage *_PSDraw_CopyScreenToImage(GWindow w, GRect * rect) { } static void _PSDraw_Pixmap(GWindow _w, GWindow _pixmap, GRect * src, int32 x, int32 y) { } static void _PSDraw_TilePixmap(GWindow _w, GWindow _pixmap, GRect * src, int32 x, int32 y) { } static void PSMyArc(GPSWindow ps, double cx, double cy, double radx, double rady, double sa, double ta) { double ea, temp; ea = sa + ta; while (sa < ea) { temp = ((int)((sa + 90) / 90)) * 90; PSDoArc(ps, cx, cy, radx, rady, sa, ea < temp ? ea : temp); sa = temp; } } static void PSDrawElipse(GPSWindow ps, GRect * rct, char *command) { float cx, cy, radx, rady; if (radx != rady) PSMyArc(ps, cx, cy, radx, rady, 0, 360); } static void PSDrawPushClip(GWindow w, GRect * rct, GRect * old) { } static void PSDrawPopClip(GWindow w, GRect * old) { } static void PSDrawDrawLine(GWindow w, int32 x, int32 y, int32 xend, int32 yend, Color col) { } static void PSDrawDrawArrowLine(GWindow w, int32 x, int32 y, int32 xend, int32 yend, int16 arrows, Color col) { } static void PSDrawDrawRect(GWindow w, GRect * rct, Color col) { } static void PSDrawFillRect(GWindow w, GRect * rct, Color col) { } static void PSDrawClear(GWindow w, GRect * rect) { } static void PSDrawDrawCircle(GWindow w, GRect * rct, Color col) { } static void PSDrawFillCircle(GWindow w, GRect * rct, Color col) { GPSWindow ps = (GPSWindow) w; PSDrawElipse(ps, rct, "fill"); } static void PSDrawDrawArc(GWindow w, GRect * rct, int32 sa, int32 ta, Color col) { } static void PSDrawDrawPoly(GWindow w, GPoint * pt, int16 cnt, Color col) { } static void PSDrawFillPoly(GWindow w, GPoint * pt, int16 cnt, Color col) { } static void _GPSDraw_Text1(GWindow gw, struct font_data *fd, int32 x, int32 y, char *txt, int32 cnt, FontMods * mods, Color col) { } static void _GPSDraw_Text2(GWindow gw, struct font_data *fd, int32 x, int32 y, GChar2b * txt, int32 cnt, FontMods * mods, Color col) { } static GWindow GPSPrinterStartJob(GDisplay * gd, void *user_data, GPrinterAttrs * attrs) { } static void GPSPrinterNextPage(GWindow w) { } static int GPSPrinterEndJob(GWindow w, int cancel) { } static GWindow PSDrawCreateTopWindow(GDisplay * gdisp, GRect * pos, int (*eh) (GWindow, GEvent *), void *user_data, GWindowAttrs * wattrs) { } static void PSDrawDestroyWindow(GWindow w) { } static struct displayfuncs psfuncs = { PSDrawDrawCircle, PSDrawFillCircle, PSDrawDrawArc, PSDrawDrawPoly, _GPSDraw_Image, _GPSDraw_TileImage, _GPSDraw_ImageMagnified, _PSDraw_CopyScreenToImage, _PSDraw_Pixmap, _PSDraw_TilePixmap, _GPSDraw_ScaleFont, _GPSDraw_StylizeFont, _GPSDraw_LoadFontMetrics, _GPSDraw_Text1, _GPSDraw_Text2, GPSPrinterEndJob }; GDisplay *_GPSDraw_CreateDisplay() { GPSDisplay *gdisp; gdisp->funcs = &psfuncs; }