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>
23 #include "gtxX11win.h" /*Interface definition */
25 int X11_debug
; /*Is debugging turned on? */
26 static char mn
[] = "gator_X11windows"; /*Module name */
29 * Version of standard operations for a X11 window.
31 struct gwinops X11_gwinops
= {
34 gator_X11gwin_destroy
,
35 gator_X11gwin_display
,
36 gator_X11gwin_drawline
,
37 gator_X11gwin_drawrectangle
,
38 gator_X11gwin_drawchar
,
39 gator_X11gwin_drawstring
,
41 gator_X11gwin_getchar
,
42 gator_X11gwin_getdimensions
,
46 struct gwinbaseops gator_X11_gwinbops
= {
52 * Macros to map pixel positions to row & column positions.
53 * (Note: for now, they are the identity function!!)
55 #define GATOR_MAP_X_TO_COL(w, x) (x)
56 #define GATOR_MAP_Y_TO_LINE(w, y) (y)
58 /*------------------------------------------------------------------------
62 * Initialize the X11 window package.
65 * int adebug: Is debugging turned on?
69 * Error value otherwise.
72 * Nothing interesting.
76 *------------------------------------------------------------------------*/
79 gator_X11gwin_init(int adebug
)
80 { /*gator_X11gwin_init */
82 static char rn
[] = "gator_X11gwin_init"; /*Routine name */
85 * Remember if we'll be doing debugging, init X11 and clear the
91 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
94 * We return success, fill this routine it at some point.
98 } /*gator_X11gwin_init */
100 /*------------------------------------------------------------------------
101 * gator_X11gwin_create
104 * Create a X11 window.
107 * struct gator_X11gwin_params *params : Ptr to creation parameters.
110 * Ptr to the created X11 window if successful,
111 * Null ptr otherwise.
114 * Nothing interesting.
118 *------------------------------------------------------------------------*/
121 gator_X11gwin_create(void *rock
)
122 { /*gator_X11gwin_create */
124 static char rn
[] = "gator_X11gwin_create"; /*Routine name */
127 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
131 } /*gator_X11gwin_create */
133 /*------------------------------------------------------------------------
134 * gator_X11gwin_cleanup
137 * Create a X11 window.
140 * struct gwin *gwp : Ptr to base window.
144 * Error value otherwise.
147 * Nothing interesting.
151 *------------------------------------------------------------------------*/
154 gator_X11gwin_cleanup(struct gwin
*gwp
)
155 { /*gator_X11gwin_cleanup */
157 static char rn
[] = "gator_X11gwin_cleanup"; /*Routine name */
160 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
164 } /*gator_X11gwin_cleanup */
166 /*------------------------------------------------------------------------
170 * Draw a box around the given X11 window.
173 * struct gwin *gwp : Ptr to the X11 window to draw
178 * Error value otherwise.
181 * Nothing interesting.
185 *------------------------------------------------------------------------*/
188 gator_X11gwin_box(struct gwin
*gwp
)
189 { /*gator_X11gwin_box */
191 static char rn
[] = "gator_X11gwin_box"; /*Routine name */
194 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
198 } /*gator_X11gwin_box */
200 /*------------------------------------------------------------------------
201 * gator_X11gwin_clear
204 * Clear out the given X11 window.
207 * struct gwin *gwp : Ptr to the X11 window to clear out.
211 * Error value otherwise.
214 * Nothing interesting.
218 *------------------------------------------------------------------------*/
221 gator_X11gwin_clear(struct gwin
*gwp
)
222 { /*gator_X11gwin_clear */
224 static char rn
[] = "gator_X11gwin_clear"; /*Routine name */
227 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
231 } /*gator_X11gwin_clear */
233 /*------------------------------------------------------------------------
234 * gator_X11gwin_destroy
237 * Destroy the given X11 window.
240 * struct gwin *gwp : Ptr to the X11 window to destroy.
244 * Error value otherwise.
247 * Nothing interesting.
251 *------------------------------------------------------------------------*/
254 gator_X11gwin_destroy(struct gwin
*gwp
)
255 { /*gator_X11gwin_destroy */
257 static char rn
[] = "gator_X11gwin_destroy"; /*Routine name */
260 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
264 } /*gator_X11gwin_destroy */
266 /*------------------------------------------------------------------------
267 * gator_X11gwin_display
270 * Display/redraw the given X11 window.
273 * struct gwin *gwp : Ptr to the X11 window to draw.
277 * Error value otherwise.
280 * Nothing interesting.
284 *------------------------------------------------------------------------*/
287 gator_X11gwin_display(struct gwin
*gwp
)
288 { /*gator_X11gwin_display */
290 static char rn
[] = "gator_X11gwin_display"; /*Routine name */
293 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
297 } /*gator_X11gwin_display */
299 /*------------------------------------------------------------------------
300 * gator_X11gwin_drawline
303 * Draw a line between two points in the given X11
307 * struct gwin *gwp : Ptr to the X11 window in which
308 * the line is to be drawn.
309 * struct gwin_lineparams *params : Ptr to other params.
313 * Error value otherwise.
316 * Nothing interesting.
320 *------------------------------------------------------------------------*/
323 gator_X11gwin_drawline(struct gwin
*gwp
, struct gwin_lineparams
*params
)
324 { /*gator_X11gwin_drawline */
326 static char rn
[] = "gator_X11gwin_drawline"; /*Routine name */
329 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
334 } /*gator_X11gwin_drawline */
336 /*------------------------------------------------------------------------
337 * gator_X11gwin_drawrectangle
340 * Draw a rectangle in the given X11 window.
343 * struct gwin *gwp : Ptr to the X11 window in which
344 * the rectangle is to be drawn.
345 * struct gwin_rectparams *params : Ptr to other params.
349 * Error value otherwise.
352 * Nothing interesting.
356 *------------------------------------------------------------------------*/
359 gator_X11gwin_drawrectangle(struct gwin
*gwp
, struct gwin_rectparams
*params
)
360 { /*gator_X11gwin_drawrectangle */
362 static char rn
[] = "gator_X11gwin_drawrectangle"; /*Routine name */
365 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
370 } /*gator_X11gwin_drawrectangle */
372 /*------------------------------------------------------------------------
373 * gator_X11gwin_drawchar
376 * Draw a character in the given X11 window.
379 * struct gwin *gwp : Ptr to the X11 window in which
380 * the character is to be drawn.
381 * struct gwin_charparams *params : Ptr to other params.
385 * Error value otherwise.
388 * Nothing interesting.
392 *------------------------------------------------------------------------*/
395 gator_X11gwin_drawchar(struct gwin
*gwp
, struct gwin_charparams
*params
)
396 { /*gator_X11gwin_drawchar */
398 static char rn
[] = "gator_X11gwin_drawchar"; /*Routine name */
401 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
405 } /*gator_X11gwin_drawchar */
407 /*------------------------------------------------------------------------
408 * gator_X11gwin_drawstring
411 * Draw a string in the given X11 window.
414 * struct gwin *gwp : Ptr to the X11 window in which
415 * the string is to be drawn.
416 * struct gwin_strparams *params : Ptr to other params.
420 * Error value otherwise.
423 * Nothing interesting.
427 *------------------------------------------------------------------------*/
430 gator_X11gwin_drawstring(struct gwin
*gwp
, struct gwin_strparams
*params
)
431 { /*gator_X11gwin_drawstring */
433 static char rn
[] = "gator_X11gwin_drawstring"; /*Routine name */
436 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
440 } /*gator_X11gwin_drawstring */
442 /*------------------------------------------------------------------------
443 * gator_X11gwin_invert
446 * Invert a region in the given X11 window.
449 * struct gwin *gwp : Ptr to the X11 window in which
450 * the inverted region lies.
451 * struct gwin_invparams *params : Ptr to other params.
455 * Error value otherwise.
458 * Nothing interesting.
462 *------------------------------------------------------------------------*/
465 gator_X11gwin_invert(struct gwin
*gwp
, struct gwin_invparams
*params
)
466 { /*gator_X11gwin_invert */
468 static char rn
[] = "gator_X11gwin_invert"; /*Routine name */
471 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
476 } /*gator_X11gwin_invert */
478 /*------------------------------------------------------------------------
479 * gator_X11gwin_getchar
482 * Pick up a character from the given window.
485 * struct gwin *gwp : Ptr to the X11 window to listen to.
488 * Value of the character read,
492 * Nothing interesting.
496 *------------------------------------------------------------------------*/
499 gator_X11gwin_getchar(struct gwin
*gwp
)
500 { /*gator_X11gwin_getchar */
502 static char rn
[] = "gator_X11gwin_getchar"; /*Routine name */
505 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
510 } /*gator_X11gwin_getchar */
512 /*------------------------------------------------------------------------
513 * gator_X11gwin_getdimensions
516 * Get the window's X,Y dimensions.
519 * struct gwin *gwp : Ptr to the X11 window to examine.
520 * struct gwin_sizeparams *aparms : Ptr to size params to set.
527 * Nothing interesting.
531 *------------------------------------------------------------------------*/
534 gator_X11gwin_getdimensions(struct gwin
*gwp
, struct gwin_sizeparams
*aparms
)
535 { /*gator_X11gwin_getdimensions */
537 static char rn
[] = "gator_X11gwin_getdimensions"; /*Routine name */
540 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
545 } /*gator_X11gwin_getdimensions */
547 /*------------------------------------------------------------------------
551 * Wait until input is available.
554 * struct gwin *gwp : Ptr to the X11 window to wait on.
561 * Nothing interesting.
565 *------------------------------------------------------------------------*/
568 gator_X11gwin_wait(struct gwin
*gwp
)
569 { /*gator_X11gwin_wait */
571 static char rn
[] = "gator_X11gwin_wait"; /*Routine name */
574 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
579 } /*gator_X11gwin_wait */