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>
22 #include "gtxX11win.h" /*Interface definition */
23 #include <stdio.h> /*Standard I/O package */
26 extern int errno
; /*System error number */
28 int X11_debug
; /*Is debugging turned on? */
29 static char mn
[] = "gator_X11windows"; /*Module name */
32 * Version of standard operations for a X11 window.
34 struct gwinops X11_gwinops
= {
37 gator_X11gwin_destroy
,
38 gator_X11gwin_display
,
39 gator_X11gwin_drawline
,
40 gator_X11gwin_drawrectangle
,
41 gator_X11gwin_drawchar
,
42 gator_X11gwin_drawstring
,
44 gator_X11gwin_getchar
,
45 gator_X11gwin_getdimensions
,
49 struct gwinbaseops gator_X11_gwinbops
= {
55 * Macros to map pixel positions to row & column positions.
56 * (Note: for now, they are the identity function!!)
58 #define GATOR_MAP_X_TO_COL(w, x) (x)
59 #define GATOR_MAP_Y_TO_LINE(w, y) (y)
61 /*------------------------------------------------------------------------
65 * Initialize the X11 window package.
68 * int adebug: Is debugging turned on?
72 * Error value otherwise.
75 * Nothing interesting.
79 *------------------------------------------------------------------------*/
82 gator_X11gwin_init(int adebug
)
83 { /*gator_X11gwin_init */
85 static char rn
[] = "gator_X11gwin_init"; /*Routine name */
88 * Remember if we'll be doing debugging, init X11 and clear the
94 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
97 * We return success, fill this routine it at some point.
101 } /*gator_X11gwin_init */
103 /*------------------------------------------------------------------------
104 * gator_X11gwin_create
107 * Create a X11 window.
110 * struct gator_X11gwin_params *params : Ptr to creation parameters.
113 * Ptr to the created X11 window if successful,
114 * Null ptr otherwise.
117 * Nothing interesting.
121 *------------------------------------------------------------------------*/
124 gator_X11gwin_create(void *rock
)
125 { /*gator_X11gwin_create */
127 static char rn
[] = "gator_X11gwin_create"; /*Routine name */
130 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
134 } /*gator_X11gwin_create */
136 /*------------------------------------------------------------------------
137 * gator_X11gwin_cleanup
140 * Create a X11 window.
143 * struct gwin *gwp : Ptr to base window.
147 * Error value otherwise.
150 * Nothing interesting.
154 *------------------------------------------------------------------------*/
157 gator_X11gwin_cleanup(struct gwin
*gwp
)
158 { /*gator_X11gwin_cleanup */
160 static char rn
[] = "gator_X11gwin_cleanup"; /*Routine name */
163 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
167 } /*gator_X11gwin_cleanup */
169 /*------------------------------------------------------------------------
173 * Draw a box around the given X11 window.
176 * struct gwin *gwp : Ptr to the X11 window to draw
181 * Error value otherwise.
184 * Nothing interesting.
188 *------------------------------------------------------------------------*/
191 gator_X11gwin_box(struct gwin
*gwp
)
192 { /*gator_X11gwin_box */
194 static char rn
[] = "gator_X11gwin_box"; /*Routine name */
197 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
201 } /*gator_X11gwin_box */
203 /*------------------------------------------------------------------------
204 * gator_X11gwin_clear
207 * Clear out the given X11 window.
210 * struct gwin *gwp : Ptr to the X11 window to clear out.
214 * Error value otherwise.
217 * Nothing interesting.
221 *------------------------------------------------------------------------*/
224 gator_X11gwin_clear(struct gwin
*gwp
)
225 { /*gator_X11gwin_clear */
227 static char rn
[] = "gator_X11gwin_clear"; /*Routine name */
230 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
234 } /*gator_X11gwin_clear */
236 /*------------------------------------------------------------------------
237 * gator_X11gwin_destroy
240 * Destroy the given X11 window.
243 * struct gwin *gwp : Ptr to the X11 window to destroy.
247 * Error value otherwise.
250 * Nothing interesting.
254 *------------------------------------------------------------------------*/
257 gator_X11gwin_destroy(struct gwin
*gwp
)
258 { /*gator_X11gwin_destroy */
260 static char rn
[] = "gator_X11gwin_destroy"; /*Routine name */
263 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
267 } /*gator_X11gwin_destroy */
269 /*------------------------------------------------------------------------
270 * gator_X11gwin_display
273 * Display/redraw the given X11 window.
276 * struct gwin *gwp : Ptr to the X11 window to draw.
280 * Error value otherwise.
283 * Nothing interesting.
287 *------------------------------------------------------------------------*/
290 gator_X11gwin_display(struct gwin
*gwp
)
291 { /*gator_X11gwin_display */
293 static char rn
[] = "gator_X11gwin_display"; /*Routine name */
296 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
300 } /*gator_X11gwin_display */
302 /*------------------------------------------------------------------------
303 * gator_X11gwin_drawline
306 * Draw a line between two points in the given X11
310 * struct gwin *gwp : Ptr to the X11 window in which
311 * the line is to be drawn.
312 * struct gwin_lineparams *params : Ptr to other params.
316 * Error value otherwise.
319 * Nothing interesting.
323 *------------------------------------------------------------------------*/
326 gator_X11gwin_drawline(struct gwin
*gwp
, struct gwin_lineparams
*params
)
327 { /*gator_X11gwin_drawline */
329 static char rn
[] = "gator_X11gwin_drawline"; /*Routine name */
332 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
337 } /*gator_X11gwin_drawline */
339 /*------------------------------------------------------------------------
340 * gator_X11gwin_drawrectangle
343 * Draw a rectangle in the given X11 window.
346 * struct gwin *gwp : Ptr to the X11 window in which
347 * the rectangle is to be drawn.
348 * struct gwin_rectparams *params : Ptr to other params.
352 * Error value otherwise.
355 * Nothing interesting.
359 *------------------------------------------------------------------------*/
362 gator_X11gwin_drawrectangle(struct gwin
*gwp
, struct gwin_rectparams
*params
)
363 { /*gator_X11gwin_drawrectangle */
365 static char rn
[] = "gator_X11gwin_drawrectangle"; /*Routine name */
368 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
373 } /*gator_X11gwin_drawrectangle */
375 /*------------------------------------------------------------------------
376 * gator_X11gwin_drawchar
379 * Draw a character in the given X11 window.
382 * struct gwin *gwp : Ptr to the X11 window in which
383 * the character is to be drawn.
384 * struct gwin_charparams *params : Ptr to other params.
388 * Error value otherwise.
391 * Nothing interesting.
395 *------------------------------------------------------------------------*/
398 gator_X11gwin_drawchar(struct gwin
*gwp
, struct gwin_charparams
*params
)
399 { /*gator_X11gwin_drawchar */
401 static char rn
[] = "gator_X11gwin_drawchar"; /*Routine name */
404 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
408 } /*gator_X11gwin_drawchar */
410 /*------------------------------------------------------------------------
411 * gator_X11gwin_drawstring
414 * Draw a string in the given X11 window.
417 * struct gwin *gwp : Ptr to the X11 window in which
418 * the string is to be drawn.
419 * struct gwin_strparams *params : Ptr to other params.
423 * Error value otherwise.
426 * Nothing interesting.
430 *------------------------------------------------------------------------*/
433 gator_X11gwin_drawstring(struct gwin
*gwp
, struct gwin_strparams
*params
)
434 { /*gator_X11gwin_drawstring */
436 static char rn
[] = "gator_X11gwin_drawstring"; /*Routine name */
439 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
443 } /*gator_X11gwin_drawstring */
445 /*------------------------------------------------------------------------
446 * gator_X11gwin_invert
449 * Invert a region in the given X11 window.
452 * struct gwin *gwp : Ptr to the X11 window in which
453 * the inverted region lies.
454 * struct gwin_invparams *params : Ptr to other params.
458 * Error value otherwise.
461 * Nothing interesting.
465 *------------------------------------------------------------------------*/
468 gator_X11gwin_invert(struct gwin
*gwp
, struct gwin_invparams
*params
)
469 { /*gator_X11gwin_invert */
471 static char rn
[] = "gator_X11gwin_invert"; /*Routine name */
474 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
479 } /*gator_X11gwin_invert */
481 /*------------------------------------------------------------------------
482 * gator_X11gwin_getchar
485 * Pick up a character from the given window.
488 * struct gwin *gwp : Ptr to the X11 window to listen to.
491 * Value of the character read,
495 * Nothing interesting.
499 *------------------------------------------------------------------------*/
502 gator_X11gwin_getchar(struct gwin
*gwp
)
503 { /*gator_X11gwin_getchar */
505 static char rn
[] = "gator_X11gwin_getchar"; /*Routine name */
508 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
513 } /*gator_X11gwin_getchar */
515 /*------------------------------------------------------------------------
516 * gator_X11gwin_getdimensions
519 * Get the window's X,Y dimensions.
522 * struct gwin *gwp : Ptr to the X11 window to examine.
523 * struct gwin_sizeparams *aparms : Ptr to size params to set.
530 * Nothing interesting.
534 *------------------------------------------------------------------------*/
537 gator_X11gwin_getdimensions(struct gwin
*gwp
, struct gwin_sizeparams
*aparms
)
538 { /*gator_X11gwin_getdimensions */
540 static char rn
[] = "gator_X11gwin_getdimensions"; /*Routine name */
543 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
548 } /*gator_X11gwin_getdimensions */
550 /*------------------------------------------------------------------------
554 * Wait until input is available.
557 * struct gwin *gwp : Ptr to the X11 window to wait on.
564 * Nothing interesting.
568 *------------------------------------------------------------------------*/
571 gator_X11gwin_wait(struct gwin
*gwp
)
572 { /*gator_X11gwin_wait */
574 static char rn
[] = "gator_X11gwin_wait"; /*Routine name */
577 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
582 } /*gator_X11gwin_wait */