1 typedef unsigned int Color;
2 typedef struct gimage {
6 typedef struct gpoint {
12 typedef struct gwindow *GWindow;
13 typedef struct gdisplay GDisplay;
14 typedef struct gwindow_attrs {
17 void (*init) (GDisplay *);
18 void (*term) (GDisplay *);
20 typedef struct gpswindow {
22 typedef struct gpsdisplay {
23 struct displayfuncs *funcs;
25 extern void _GPSDraw_Image(GWindow, GImage *, GRect * src, int x, int y);
26 extern void _GPSDraw_TileImage(GWindow, GImage *, GRect * src, int x, int y);
27 extern void _GPSDraw_ImageMagnified(GWindow, GImage *, GRect * src, int x,
28 int y, int width, int height);
29 extern void *_GPSDraw_LoadFontMetrics(GDisplay * gdisp, void *fd);
30 extern struct font_data *_GPSDraw_ScaleFont(GDisplay * gdisp,
33 extern struct font_data *_GPSDraw_StylizeFont(GDisplay * gdisp,
36 static GImage *_PSDraw_CopyScreenToImage(GWindow w, GRect * rect)
39 static void _PSDraw_Pixmap(GWindow _w, GWindow _pixmap, GRect * src, int x,
43 static void _PSDraw_TilePixmap(GWindow _w, GWindow _pixmap, GRect * src, int x,
47 static void PSMyArc(GPSWindow ps, double cx, double cy, double radx,
48 double rady, double sa, double ta)
53 temp = ((int)((sa + 90) / 90)) * 90;
54 PSDoArc(ps, cx, cy, radx, rady, sa, ea < temp ? ea : temp);
58 static void PSDrawElipse(GPSWindow ps, GRect * rct, char *command)
60 float cx, cy, radx, rady;
62 PSMyArc(ps, cx, cy, radx, rady, 0, 360);
64 static void PSDrawDrawCircle(GWindow w, GRect * rct, Color col)
67 static void PSDrawFillCircle(GWindow w, GRect * rct, Color col)
69 GPSWindow ps = (GPSWindow) w;
70 PSDrawElipse(ps, rct, "fill");
72 static void PSDrawDrawArc(GWindow w, GRect * rct, int sa, int ta, Color col)
75 static void PSDrawDrawPoly(GWindow w, GPoint * pt, short cnt, Color col)
78 static void _GPSDraw_Text1(GWindow gw, struct font_data *fd, int x, int y,
79 char *txt, int cnt, FontMods * mods, Color col)
82 static void _GPSDraw_Text2(GWindow gw, struct font_data *fd, int x, int y,
83 GChar2b * txt, int cnt, FontMods * mods, Color col)
86 static int GPSPrinterEndJob(GWindow w, int cancel)
89 static struct displayfuncs psfuncs = {
90 PSDrawDrawCircle, PSDrawFillCircle, PSDrawDrawArc, PSDrawDrawPoly,
91 _GPSDraw_Image, _GPSDraw_TileImage, _GPSDraw_ImageMagnified,
92 _PSDraw_CopyScreenToImage, _PSDraw_Pixmap, _PSDraw_TilePixmap,
93 _GPSDraw_ScaleFont, _GPSDraw_StylizeFont, _GPSDraw_LoadFontMetrics,
94 _GPSDraw_Text1, _GPSDraw_Text2, GPSPrinterEndJob
96 GDisplay *_GPSDraw_CreateDisplay()
99 gdisp->funcs = &psfuncs;