2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
14 * Implementation of the gator X11 window facility.
16 *------------------------------------------------------------------------*/
18 #include <afsconfig.h>
19 #include <afs/param.h>
24 #include "gtxX11win.h" /*Interface definition */
25 #include <stdio.h> /*Standard I/O package */
28 extern int errno; /*System error number */
30 int X11_debug; /*Is debugging turned on? */
31 static char mn[] = "gator_X11windows"; /*Module name */
34 * Version of standard operations for a X11 window.
36 struct gwinops X11_gwinops = {
39 gator_X11gwin_destroy,
40 gator_X11gwin_display,
41 gator_X11gwin_drawline,
42 gator_X11gwin_drawrectangle,
43 gator_X11gwin_drawchar,
44 gator_X11gwin_drawstring,
46 gator_X11gwin_getchar,
47 gator_X11gwin_getdimensions,
51 struct gwinbaseops gator_X11_gwinbops = {
57 * Macros to map pixel positions to row & column positions.
58 * (Note: for now, they are the identity function!!)
60 #define GATOR_MAP_X_TO_COL(w, x) (x)
61 #define GATOR_MAP_Y_TO_LINE(w, y) (y)
63 /*------------------------------------------------------------------------
67 * Initialize the X11 window package.
70 * int adebug: Is debugging turned on?
74 * Error value otherwise.
77 * Nothing interesting.
81 *------------------------------------------------------------------------*/
84 gator_X11gwin_init(int adebug)
85 { /*gator_X11gwin_init */
87 static char rn[] = "gator_X11gwin_init"; /*Routine name */
90 * Remember if we'll be doing debugging, init X11 and clear the
96 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
99 * We return success, fill this routine it at some point.
103 } /*gator_X11gwin_init */
105 /*------------------------------------------------------------------------
106 * gator_X11gwin_create
109 * Create a X11 window.
112 * struct gator_X11gwin_params *params : Ptr to creation parameters.
115 * Ptr to the created X11 window if successful,
116 * Null ptr otherwise.
119 * Nothing interesting.
123 *------------------------------------------------------------------------*/
126 gator_X11gwin_create(struct gator_X11gwin_params *params)
127 { /*gator_X11gwin_create */
129 static char rn[] = "gator_X11gwin_create"; /*Routine name */
132 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
136 } /*gator_X11gwin_create */
138 /*------------------------------------------------------------------------
139 * gator_X11gwin_cleanup
142 * Create a X11 window.
145 * struct gwin *gwp : Ptr to base window.
149 * Error value otherwise.
152 * Nothing interesting.
156 *------------------------------------------------------------------------*/
159 gator_X11gwin_cleanup(struct gwin *gwp)
160 { /*gator_X11gwin_cleanup */
162 static char rn[] = "gator_X11gwin_cleanup"; /*Routine name */
165 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
169 } /*gator_X11gwin_cleanup */
171 /*------------------------------------------------------------------------
175 * Draw a box around the given X11 window.
178 * struct gwin *gwp : Ptr to the X11 window to draw
183 * Error value otherwise.
186 * Nothing interesting.
190 *------------------------------------------------------------------------*/
193 gator_X11gwin_box(struct gwin *gwp)
194 { /*gator_X11gwin_box */
196 static char rn[] = "gator_X11gwin_box"; /*Routine name */
199 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
203 } /*gator_X11gwin_box */
205 /*------------------------------------------------------------------------
206 * gator_X11gwin_clear
209 * Clear out the given X11 window.
212 * struct gwin *gwp : Ptr to the X11 window to clear out.
216 * Error value otherwise.
219 * Nothing interesting.
223 *------------------------------------------------------------------------*/
226 gator_X11gwin_clear(struct gwin *gwp)
227 { /*gator_X11gwin_clear */
229 static char rn[] = "gator_X11gwin_clear"; /*Routine name */
232 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
236 } /*gator_X11gwin_clear */
238 /*------------------------------------------------------------------------
239 * gator_X11gwin_destroy
242 * Destroy the given X11 window.
245 * struct gwin *gwp : Ptr to the X11 window to destroy.
249 * Error value otherwise.
252 * Nothing interesting.
256 *------------------------------------------------------------------------*/
259 gator_X11gwin_destroy(struct gwin *gwp)
260 { /*gator_X11gwin_destroy */
262 static char rn[] = "gator_X11gwin_destroy"; /*Routine name */
265 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
269 } /*gator_X11gwin_destroy */
271 /*------------------------------------------------------------------------
272 * gator_X11gwin_display
275 * Display/redraw the given X11 window.
278 * struct gwin *gwp : Ptr to the X11 window to draw.
282 * Error value otherwise.
285 * Nothing interesting.
289 *------------------------------------------------------------------------*/
292 gator_X11gwin_display(struct gwin *gwp)
293 { /*gator_X11gwin_display */
295 static char rn[] = "gator_X11gwin_display"; /*Routine name */
298 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
302 } /*gator_X11gwin_display */
304 /*------------------------------------------------------------------------
305 * gator_X11gwin_drawline
308 * Draw a line between two points in the given X11
312 * struct gwin *gwp : Ptr to the X11 window in which
313 * the line is to be drawn.
314 * struct gwin_lineparams *params : Ptr to other params.
318 * Error value otherwise.
321 * Nothing interesting.
325 *------------------------------------------------------------------------*/
328 gator_X11gwin_drawline(struct gwin *gwp, struct gwin_lineparams *params)
329 { /*gator_X11gwin_drawline */
331 static char rn[] = "gator_X11gwin_drawline"; /*Routine name */
334 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
339 } /*gator_X11gwin_drawline */
341 /*------------------------------------------------------------------------
342 * gator_X11gwin_drawrectangle
345 * Draw a rectangle in the given X11 window.
348 * struct gwin *gwp : Ptr to the X11 window in which
349 * the rectangle is to be drawn.
350 * struct gwin_rectparams *params : Ptr to other params.
354 * Error value otherwise.
357 * Nothing interesting.
361 *------------------------------------------------------------------------*/
364 gator_X11gwin_drawrectangle(struct gwin *gwp, struct gwin_rectparams *params)
365 { /*gator_X11gwin_drawrectangle */
367 static char rn[] = "gator_X11gwin_drawrectangle"; /*Routine name */
370 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
375 } /*gator_X11gwin_drawrectangle */
377 /*------------------------------------------------------------------------
378 * gator_X11gwin_drawchar
381 * Draw a character in the given X11 window.
384 * struct gwin *gwp : Ptr to the X11 window in which
385 * the character is to be drawn.
386 * struct gwin_charparams *params : Ptr to other params.
390 * Error value otherwise.
393 * Nothing interesting.
397 *------------------------------------------------------------------------*/
400 gator_X11gwin_drawchar(struct gwin *gwp, struct gwin_charparams *params)
401 { /*gator_X11gwin_drawchar */
403 static char rn[] = "gator_X11gwin_drawchar"; /*Routine name */
406 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
410 } /*gator_X11gwin_drawchar */
412 /*------------------------------------------------------------------------
413 * gator_X11gwin_drawstring
416 * Draw a string in the given X11 window.
419 * struct gwin *gwp : Ptr to the X11 window in which
420 * the string is to be drawn.
421 * struct gwin_strparams *params : Ptr to other params.
425 * Error value otherwise.
428 * Nothing interesting.
432 *------------------------------------------------------------------------*/
435 gator_X11gwin_drawstring(struct gwin *gwp, struct gwin_strparams *params)
436 { /*gator_X11gwin_drawstring */
438 static char rn[] = "gator_X11gwin_drawstring"; /*Routine name */
441 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
445 } /*gator_X11gwin_drawstring */
447 /*------------------------------------------------------------------------
448 * gator_X11gwin_invert
451 * Invert a region in the given X11 window.
454 * struct gwin *gwp : Ptr to the X11 window in which
455 * the inverted region lies.
456 * struct gwin_invparams *params : Ptr to other params.
460 * Error value otherwise.
463 * Nothing interesting.
467 *------------------------------------------------------------------------*/
470 gator_X11gwin_invert(struct gwin *gwp, struct gwin_invparams *params)
471 { /*gator_X11gwin_invert */
473 static char rn[] = "gator_X11gwin_invert"; /*Routine name */
476 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
481 } /*gator_X11gwin_invert */
483 /*------------------------------------------------------------------------
484 * gator_X11gwin_getchar
487 * Pick up a character from the given window.
490 * struct gwin *gwp : Ptr to the X11 window to listen to.
493 * Value of the character read,
497 * Nothing interesting.
501 *------------------------------------------------------------------------*/
504 gator_X11gwin_getchar(struct gwin *gwp)
505 { /*gator_X11gwin_getchar */
507 static char rn[] = "gator_X11gwin_getchar"; /*Routine name */
510 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
515 } /*gator_X11gwin_getchar */
517 /*------------------------------------------------------------------------
518 * gator_X11gwin_getdimensions
521 * Get the window's X,Y dimensions.
524 * struct gwin *gwp : Ptr to the X11 window to examine.
525 * struct gwin_sizeparams *aparms : Ptr to size params to set.
532 * Nothing interesting.
536 *------------------------------------------------------------------------*/
539 gator_X11gwin_getdimensions(struct gwin *gwp, struct gwin_sizeparams *aparms)
540 { /*gator_X11gwin_getdimensions */
542 static char rn[] = "gator_X11gwin_getdimensions"; /*Routine name */
545 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
550 } /*gator_X11gwin_getdimensions */
552 /*------------------------------------------------------------------------
556 * Wait until input is available.
559 * struct gwin *gwp : Ptr to the X11 window to wait on.
566 * Nothing interesting.
570 *------------------------------------------------------------------------*/
573 gator_X11gwin_wait(struct gwin *gwp)
574 { /*gator_X11gwin_wait */
576 static char rn[] = "gator_X11gwin_wait"; /*Routine name */
579 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
584 } /*gator_X11gwin_wait */