]>
Commit | Line | Data |
---|---|---|
45516216 | 1 | typedef int int32; |
2 | typedef unsigned int uint32; | |
3 | typedef short int16; | |
4 | typedef unsigned char uint8; | |
5 | typedef unsigned short unichar_t; | |
6 | enum charset { | |
7 | em_none = | |
8 | -1, | |
9 | em_symbol, em_zapfding, em_user, em_adobestandard = | |
10 | em_user | |
11 | }; | |
12 | typedef uint32 Color; | |
13 | typedef struct gimage { | |
14 | } GImage; | |
15 | typedef struct grect { | |
16 | } GRect; | |
17 | typedef struct gpoint { | |
18 | } GPoint; | |
19 | typedef struct { | |
20 | } FontRequest; | |
21 | typedef struct { | |
22 | } FontMods; | |
23 | enum gic_style { | |
24 | gic_overspot = 2, gic_root = 1, gic_hidden = 0, gic_orlesser = | |
25 | 4, gic_type = 3 | |
26 | }; | |
27 | typedef struct ginput_context GIC; | |
28 | enum selnames { | |
29 | sn_primary, sn_clipboard, sn_drag_and_drop, sn_max | |
30 | }; | |
31 | typedef struct gwindow *GWindow; | |
32 | typedef struct gdisplay GDisplay; | |
33 | typedef struct gtimer GTimer; | |
34 | typedef struct gevent { | |
35 | enum event_type { | |
36 | et_noevent = | |
37 | -1, et_char, et_charup, et_mousemove, et_mousedown, | |
38 | et_mouseup, et_crossing, et_focus, et_expose, et_visibility, | |
39 | et_resize, et_timer, et_close, et_create, et_map, | |
40 | et_destroy, et_selclear, et_drag, et_dragout, et_drop, | |
41 | et_lastnativeevent = et_drop, et_controlevent, et_user | |
42 | } type; | |
43 | } GEvent; | |
44 | typedef enum cursor_types { | |
45 | ct_default, ct_pointer, ct_backpointer, ct_hand, ct_question, ct_cross, | |
46 | ct_4way, ct_text, ct_watch, ct_draganddrop, ct_invisible, ct_user, | |
47 | ct_user2 | |
48 | } GCursor; | |
49 | typedef struct gwindow_attrs { | |
50 | } GWindowAttrs; | |
51 | typedef struct gprinter_attrs { | |
52 | } GPrinterAttrs; | |
53 | enum gzoom_flags { | |
54 | gzf_pos = 1, gzf_size = 2 | |
55 | }; | |
56 | typedef struct { | |
57 | } GChar2b; | |
58 | struct displayfuncs { | |
59 | void (*init) (GDisplay *); | |
60 | void (*term) (GDisplay *); | |
61 | void *(*nativeDisplay) (GDisplay *); | |
62 | void (*setDefaultIcon) (GWindow); | |
63 | GWindow(*createTopWindow) (GDisplay *, GRect * pos, | |
64 | int (*eh) (GWindow, GEvent *), | |
65 | void *user_data, GWindowAttrs *); | |
66 | GWindow(*createSubWindow) (GWindow, GRect * pos, | |
67 | int (*eh) (GWindow, GEvent *), | |
68 | void *user_data, GWindowAttrs *); | |
69 | GWindow(*createPixmap) (GDisplay *, unsigned short width, unsigned short height); | |
70 | GWindow(*createBitmap) (GDisplay *, unsigned short width, unsigned short height, | |
71 | uint8 * data); | |
72 | GCursor(*createCursor) (GWindow src, GWindow mask, Color fg, Color bg, | |
73 | int16 x, int16 y); | |
74 | void (*destroyWindow) (GWindow); | |
75 | void (*destroyCursor) (GDisplay *, GCursor); | |
76 | int (*nativeWindowExists) (GDisplay *, void *native_window); | |
77 | void (*setZoom) (GWindow, GRect * size, enum gzoom_flags flags); | |
78 | void (*setWindowBorder) (GWindow, int width, Color); | |
79 | int (*setDither) (GDisplay *, int); | |
80 | void (*reparentWindow) (GWindow, GWindow, int, int); | |
81 | void (*setVisible) (GWindow, int); | |
82 | void (*move) (GWindow, int32, int32); | |
83 | void (*trueMove) (GWindow, int32, int32); | |
84 | void (*resize) (GWindow, int32, int32); | |
85 | void (*moveResize) (GWindow, int32, int32, int32, int32); | |
86 | void (*raise) (GWindow); | |
87 | void (*raiseAbove) (GWindow, GWindow); | |
88 | int (*isAbove) (GWindow, GWindow); | |
89 | void (*lower) (GWindow); | |
90 | void (*setWindowTitles) (GWindow, const unichar_t * title, | |
91 | const unichar_t * icontitle); | |
92 | void (*setWindowTitles8) (GWindow, const char *title, | |
93 | const char *icontitle); | |
94 | unichar_t *(*getWindowTitle) (GWindow); | |
95 | char *(*getWindowTitle8) (GWindow); | |
96 | void (*getPointerPos) (GWindow, GEvent *); | |
97 | void (*setCursor) (GWindow, GCursor); | |
98 | GCursor(*getCursor) (GWindow); | |
99 | GWindow(*getRedirectWindow) (GDisplay * gd); | |
100 | void (*translateCoordinates) (GWindow from, GWindow to, GPoint * pt); | |
101 | void (*beep) (GDisplay *); | |
102 | void (*flush) (GDisplay *); | |
103 | void (*pushClip) (GWindow, GRect * rct, GRect * old); | |
104 | void (*popClip) (GWindow, GRect * old); | |
105 | void (*eventLoop) (GDisplay *); | |
106 | void (*postEvent) (GEvent * e); | |
107 | void (*postDragEvent) (GWindow w, GEvent * mouse, enum event_type et); | |
108 | int (*requestDeviceEvents) (GWindow w, int devcnt, | |
109 | void *de); | |
110 | GTimer *(*requestTimer) (GWindow w, int32 time_from_now, | |
111 | int32 frequency, void *userdata); | |
112 | void (*cancelTimer) (GTimer * timer); | |
113 | int (*endJob) (GWindow w, int cancel); | |
114 | }; | |
115 | typedef struct gpswindow { | |
116 | } *GPSWindow; | |
117 | typedef struct gpsdisplay { | |
118 | struct displayfuncs *funcs; | |
119 | } GPSDisplay; | |
120 | extern void _GPSDraw_Image(GWindow, GImage *, GRect * src, int32 x, int32 y); | |
121 | extern void _GPSDraw_TileImage(GWindow, GImage *, GRect * src, int32 x, | |
122 | int32 y); | |
123 | extern void _GPSDraw_ImageMagnified(GWindow, GImage *, GRect * src, int32 x, | |
124 | int32 y, int32 width, int32 height); | |
125 | extern void *_GPSDraw_LoadFontMetrics(GDisplay * gdisp, | |
126 | void *fd); | |
127 | extern struct font_data *_GPSDraw_ScaleFont(GDisplay * gdisp, | |
128 | struct font_data *fd, | |
129 | FontRequest * rq); | |
130 | extern struct font_data *_GPSDraw_StylizeFont(GDisplay * gdisp, | |
131 | struct font_data *fd, | |
132 | FontRequest * rq); | |
133 | static void PSDrawInit(GDisplay * gdisp) | |
134 | { | |
135 | } | |
136 | static void PSDrawTerm(GDisplay * gdisp) | |
137 | { | |
138 | } | |
139 | static void *PSDrawNativeDisplay(GDisplay * gdisp) | |
140 | { | |
141 | } | |
142 | static void PSDrawSetDefaultIcon(GWindow icon) | |
143 | { | |
144 | } | |
145 | static GWindow PSDrawCreateSubWindow(GWindow w, GRect * pos, | |
146 | int (*eh) (GWindow, GEvent *), | |
147 | void *user_data, GWindowAttrs * wattrs) | |
148 | { | |
149 | } | |
150 | static GWindow PSDrawCreatePixmap(GDisplay * gdisp, unsigned short width, unsigned short height) | |
151 | { | |
152 | } | |
153 | static GWindow PSDrawCreateBitmap(GDisplay * gdisp, unsigned short width, unsigned short height, | |
154 | uint8 * data) | |
155 | { | |
156 | } | |
157 | static GCursor PSDrawCreateCursor(GWindow src, GWindow mask, Color fg, Color bg, | |
158 | int16 x, int16 y) | |
159 | { | |
160 | } | |
161 | static void PSSetZoom(GWindow w, GRect * r, enum gzoom_flags flags) | |
162 | { | |
163 | } | |
164 | static void PSDestroyCursor(GDisplay * gdisp, GCursor ct) | |
165 | { | |
166 | } | |
167 | static int PSNativeWindowExists(GDisplay * gdisp, void *native) | |
168 | { | |
169 | } | |
170 | static void PSSetWindowBorder(GWindow w, int width, Color col) | |
171 | { | |
172 | } | |
173 | static int PSSetDither(GDisplay * gdisp, int dither) | |
174 | { | |
175 | } | |
176 | static void PSDrawReparentWindow(GWindow child, GWindow newparent, int x, int y) | |
177 | { | |
178 | } | |
179 | static void PSDrawSetVisible(GWindow w, int vis) | |
180 | { | |
181 | } | |
182 | static void PSDrawMove(GWindow w, int32 x, int32 y) | |
183 | { | |
184 | } | |
185 | static void PSDrawResize(GWindow w, int32 width, int32 height) | |
186 | { | |
187 | } | |
188 | static void PSDrawMoveResize(GWindow w, int32 x, int32 y, int32 width, | |
189 | int32 height) | |
190 | { | |
191 | } | |
192 | static void PSDrawRaise(GWindow w) | |
193 | { | |
194 | } | |
195 | static void PSDrawRaiseAbove(GWindow w, GWindow below) | |
196 | { | |
197 | } | |
198 | static int PSDrawIsAbove(GWindow w, GWindow below) | |
199 | { | |
200 | } | |
201 | static void PSDrawLower(GWindow w) | |
202 | { | |
203 | } | |
204 | static void PSDrawSetWindowTitles(GWindow w, const unichar_t * title, | |
205 | const unichar_t * icontit) | |
206 | { | |
207 | } | |
208 | static void PSDrawSetWindowTitles8(GWindow w, const char *title, | |
209 | const char *icontit) | |
210 | { | |
211 | } | |
212 | static void PSDrawGetPointerPosition(GWindow w, GEvent * ret) | |
213 | { | |
214 | } | |
215 | static void PSDrawSetCursor(GWindow w, GCursor ct) | |
216 | { | |
217 | } | |
218 | static GCursor PSDrawGetCursor(GWindow w) | |
219 | { | |
220 | } | |
221 | static GWindow PSDrawGetRedirectWindow(GDisplay * gd) | |
222 | { | |
223 | } | |
224 | static unichar_t *PSDrawGetWindowTitle(GWindow w) | |
225 | { | |
226 | } | |
227 | static char *PSDrawGetWindowTitle8(GWindow w) | |
228 | { | |
229 | } | |
230 | static void PSDrawTranslateCoordinates(GWindow _from, GWindow _to, GPoint * pt) | |
231 | { | |
232 | } | |
233 | static void PSDrawScroll(GWindow w, GRect * rect, int32 hor, int32 vert) | |
234 | { | |
235 | } | |
236 | static void PSDrawBeep(GDisplay * gdisp) | |
237 | { | |
238 | } | |
239 | static void PSDrawFlush(GDisplay * gdisp) | |
240 | { | |
241 | } | |
242 | static GIC *PSDrawCreateInputContext(GWindow w, enum gic_style def_style) | |
243 | { | |
244 | } | |
245 | static void PSDrawSetGIC(GWindow w, GIC * gic, int x, int y) | |
246 | { | |
247 | } | |
248 | static void PSDrawPointerUngrab(GDisplay * gdisp) | |
249 | { | |
250 | } | |
251 | static void PSDrawPointerGrab(GWindow w) | |
252 | { | |
253 | } | |
254 | static void PSDrawGrabSelection(GWindow w, enum selnames sel) | |
255 | { | |
256 | } | |
257 | static void PSDrawAddSelectionType(GWindow w, enum selnames sel, char *type, | |
258 | void *data, int32 len, int32 unitsize, | |
259 | void *(*gendata) (void *, int32 * len), | |
260 | void (*freedata) (void *)) | |
261 | { | |
262 | } | |
263 | static void *PSDrawRequestSelection(GWindow w, enum selnames sn, char *typename, | |
264 | int32 * len) | |
265 | { | |
266 | } | |
267 | static int PSDrawSelectionHasType(GWindow w, enum selnames sn, char *typename) | |
268 | { | |
269 | } | |
270 | static void PSDrawRequestExpose(GWindow gw, GRect * rect, int doclear) | |
271 | { | |
272 | } | |
273 | static GTimer *PSDrawRequestTimer(GWindow w, int32 time_from_now, | |
274 | int32 frequency, void *userdata) | |
275 | { | |
276 | } | |
277 | static void PSDrawCancelTimer(GTimer * timer) | |
278 | { | |
279 | } | |
280 | static void PSDrawSyncThread(GDisplay * gdisp, void (*func) (void *), | |
281 | void *data) | |
282 | { | |
283 | } | |
284 | static void PSDrawForceUpdate(GWindow gw) | |
285 | { | |
286 | } | |
287 | static void PSDrawSync(GDisplay * gdisp) | |
288 | { | |
289 | } | |
290 | static void PSDrawSkipMouseMoveEvents(GWindow gw, GEvent * last) | |
291 | { | |
292 | } | |
293 | static void PSDrawProcessPendingEvents(GDisplay * gdisp) | |
294 | { | |
295 | } | |
296 | static void PSDrawProcessWindowEvents(GWindow gw) | |
297 | { | |
298 | } | |
299 | static void PSDrawEventLoop(GDisplay * gd) | |
300 | { | |
301 | } | |
302 | static void PSDrawPostEvent(GEvent * e) | |
303 | { | |
304 | } | |
305 | static void PSDrawPostDragEvent(GWindow w, GEvent * mouse, enum event_type et) | |
306 | { | |
307 | } | |
308 | static int PSDrawRequestDeviceEvents(GWindow w, int devcnt, | |
309 | void *de) | |
310 | { | |
311 | } | |
312 | static GImage *_PSDraw_CopyScreenToImage(GWindow w, GRect * rect) | |
313 | { | |
314 | } | |
315 | static void _PSDraw_Pixmap(GWindow _w, GWindow _pixmap, GRect * src, int32 x, | |
316 | int32 y) | |
317 | { | |
318 | } | |
319 | static void _PSDraw_TilePixmap(GWindow _w, GWindow _pixmap, GRect * src, | |
320 | int32 x, int32 y) | |
321 | { | |
322 | } | |
323 | static void PSMyArc(GPSWindow ps, double cx, double cy, double radx, | |
324 | double rady, double sa, double ta) | |
325 | { | |
326 | double ea, temp; | |
327 | ea = sa + ta; | |
328 | while (sa < ea) { | |
329 | temp = ((int)((sa + 90) / 90)) * 90; | |
330 | PSDoArc(ps, cx, cy, radx, rady, sa, ea < temp ? ea : temp); | |
331 | sa = temp; | |
332 | } | |
333 | } | |
334 | static void PSDrawElipse(GPSWindow ps, GRect * rct, char *command) | |
335 | { | |
336 | float cx, cy, radx, rady; | |
337 | if (radx != rady) | |
338 | PSMyArc(ps, cx, cy, radx, rady, 0, 360); | |
339 | } | |
340 | static void PSDrawPushClip(GWindow w, GRect * rct, GRect * old) | |
341 | { | |
342 | } | |
343 | static void PSDrawPopClip(GWindow w, GRect * old) | |
344 | { | |
345 | } | |
346 | static void PSDrawDrawLine(GWindow w, int32 x, int32 y, int32 xend, int32 yend, | |
347 | Color col) | |
348 | { | |
349 | } | |
350 | static void PSDrawDrawArrowLine(GWindow w, int32 x, int32 y, int32 xend, | |
351 | int32 yend, int16 arrows, Color col) | |
352 | { | |
353 | } | |
354 | static void PSDrawDrawRect(GWindow w, GRect * rct, Color col) | |
355 | { | |
356 | } | |
357 | static void PSDrawFillRect(GWindow w, GRect * rct, Color col) | |
358 | { | |
359 | } | |
360 | static void PSDrawClear(GWindow w, GRect * rect) | |
361 | { | |
362 | } | |
363 | static void PSDrawDrawCircle(GWindow w, GRect * rct, Color col) | |
364 | { | |
365 | } | |
366 | static void PSDrawFillCircle(GWindow w, GRect * rct, Color col) | |
367 | { | |
368 | GPSWindow ps = (GPSWindow) w; | |
369 | PSDrawElipse(ps, rct, "fill"); | |
370 | } | |
371 | static void PSDrawDrawArc(GWindow w, GRect * rct, int32 sa, int32 ta, Color col) | |
372 | { | |
373 | } | |
374 | static void PSDrawDrawPoly(GWindow w, GPoint * pt, int16 cnt, Color col) | |
375 | { | |
376 | } | |
377 | static void PSDrawFillPoly(GWindow w, GPoint * pt, int16 cnt, Color col) | |
378 | { | |
379 | } | |
380 | static void _GPSDraw_Text1(GWindow gw, struct font_data *fd, int32 x, int32 y, | |
381 | char *txt, int32 cnt, FontMods * mods, Color col) | |
382 | { | |
383 | } | |
384 | static void _GPSDraw_Text2(GWindow gw, struct font_data *fd, int32 x, int32 y, | |
385 | GChar2b * txt, int32 cnt, FontMods * mods, Color col) | |
386 | { | |
387 | } | |
388 | static GWindow GPSPrinterStartJob(GDisplay * gd, void *user_data, | |
389 | GPrinterAttrs * attrs) | |
390 | { | |
391 | } | |
392 | static void GPSPrinterNextPage(GWindow w) | |
393 | { | |
394 | } | |
395 | static int GPSPrinterEndJob(GWindow w, int cancel) | |
396 | { | |
397 | } | |
398 | static GWindow PSDrawCreateTopWindow(GDisplay * gdisp, GRect * pos, | |
399 | int (*eh) (GWindow, GEvent *), | |
400 | void *user_data, GWindowAttrs * wattrs) | |
401 | { | |
402 | } | |
403 | static void PSDrawDestroyWindow(GWindow w) | |
404 | { | |
405 | } | |
406 | static | |
407 | struct displayfuncs | |
408 | psfuncs = { | |
409 | PSDrawDrawCircle, PSDrawFillCircle, PSDrawDrawArc, PSDrawDrawPoly, | |
410 | _GPSDraw_Image, _GPSDraw_TileImage, | |
411 | _GPSDraw_ImageMagnified, _PSDraw_CopyScreenToImage, _PSDraw_Pixmap, | |
412 | _PSDraw_TilePixmap, _GPSDraw_ScaleFont, _GPSDraw_StylizeFont, | |
413 | _GPSDraw_LoadFontMetrics, _GPSDraw_Text1, _GPSDraw_Text2, | |
414 | GPSPrinterEndJob | |
415 | }; | |
416 | GDisplay *_GPSDraw_CreateDisplay() | |
417 | { | |
418 | GPSDisplay *gdisp; | |
419 | gdisp->funcs = &psfuncs; | |
420 | } |