Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / gtx / X11windows.c
blob419655d00de4d80889142308d020f35959cf296c
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
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
8 */
11 * gator_X11windows.c
13 * Description:
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 */
25 #if !defined(NeXT)
26 extern int errno; /*System error number */
27 #endif /* NeXT */
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 = {
35 gator_X11gwin_box,
36 gator_X11gwin_clear,
37 gator_X11gwin_destroy,
38 gator_X11gwin_display,
39 gator_X11gwin_drawline,
40 gator_X11gwin_drawrectangle,
41 gator_X11gwin_drawchar,
42 gator_X11gwin_drawstring,
43 gator_X11gwin_invert,
44 gator_X11gwin_getchar,
45 gator_X11gwin_getdimensions,
46 gator_X11gwin_wait,
49 struct gwinbaseops gator_X11_gwinbops = {
50 gator_X11gwin_create,
51 gator_X11gwin_cleanup
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 /*------------------------------------------------------------------------
62 * gator_X11gwin_init
64 * Description:
65 * Initialize the X11 window package.
67 * Arguments:
68 * int adebug: Is debugging turned on?
70 * Returns:
71 * 0 on success,
72 * Error value otherwise.
74 * Environment:
75 * Nothing interesting.
77 * Side Effects:
78 * As advertised.
79 *------------------------------------------------------------------------*/
81 int
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
89 * standard screen.
91 X11_debug = adebug;
93 if (X11_debug)
94 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
97 * We return success, fill this routine it at some point.
99 return (0);
101 } /*gator_X11gwin_init */
103 /*------------------------------------------------------------------------
104 * gator_X11gwin_create
106 * Description:
107 * Create a X11 window.
109 * Arguments:
110 * struct gator_X11gwin_params *params : Ptr to creation parameters.
112 * Returns:
113 * Ptr to the created X11 window if successful,
114 * Null ptr otherwise.
116 * Environment:
117 * Nothing interesting.
119 * Side Effects:
120 * As advertised.
121 *------------------------------------------------------------------------*/
123 struct gwin *
124 gator_X11gwin_create(void *rock)
125 { /*gator_X11gwin_create */
127 static char rn[] = "gator_X11gwin_create"; /*Routine name */
129 if (X11_debug)
130 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
132 return (NULL);
134 } /*gator_X11gwin_create */
136 /*------------------------------------------------------------------------
137 * gator_X11gwin_cleanup
139 * Description:
140 * Create a X11 window.
142 * Arguments:
143 * struct gwin *gwp : Ptr to base window.
145 * Returns:
146 * 0 on success,
147 * Error value otherwise.
149 * Environment:
150 * Nothing interesting.
152 * Side Effects:
153 * As advertised.
154 *------------------------------------------------------------------------*/
157 gator_X11gwin_cleanup(struct gwin *gwp)
158 { /*gator_X11gwin_cleanup */
160 static char rn[] = "gator_X11gwin_cleanup"; /*Routine name */
162 if (X11_debug)
163 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
165 return (0);
167 } /*gator_X11gwin_cleanup */
169 /*------------------------------------------------------------------------
170 * gator_X11gwin_box
172 * Description:
173 * Draw a box around the given X11 window.
175 * Arguments:
176 * struct gwin *gwp : Ptr to the X11 window to draw
177 * a box around.
179 * Returns:
180 * 0 on success,
181 * Error value otherwise.
183 * Environment:
184 * Nothing interesting.
186 * Side Effects:
187 * As advertised.
188 *------------------------------------------------------------------------*/
191 gator_X11gwin_box(struct gwin *gwp)
192 { /*gator_X11gwin_box */
194 static char rn[] = "gator_X11gwin_box"; /*Routine name */
196 if (X11_debug)
197 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
199 return (0);
201 } /*gator_X11gwin_box */
203 /*------------------------------------------------------------------------
204 * gator_X11gwin_clear
206 * Description:
207 * Clear out the given X11 window.
209 * Arguments:
210 * struct gwin *gwp : Ptr to the X11 window to clear out.
212 * Returns:
213 * 0 on success,
214 * Error value otherwise.
216 * Environment:
217 * Nothing interesting.
219 * Side Effects:
220 * As advertised.
221 *------------------------------------------------------------------------*/
224 gator_X11gwin_clear(struct gwin *gwp)
225 { /*gator_X11gwin_clear */
227 static char rn[] = "gator_X11gwin_clear"; /*Routine name */
229 if (X11_debug)
230 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
232 return (0);
234 } /*gator_X11gwin_clear */
236 /*------------------------------------------------------------------------
237 * gator_X11gwin_destroy
239 * Description:
240 * Destroy the given X11 window.
242 * Arguments:
243 * struct gwin *gwp : Ptr to the X11 window to destroy.
245 * Returns:
246 * 0 on success,
247 * Error value otherwise.
249 * Environment:
250 * Nothing interesting.
252 * Side Effects:
253 * As advertised.
254 *------------------------------------------------------------------------*/
257 gator_X11gwin_destroy(struct gwin *gwp)
258 { /*gator_X11gwin_destroy */
260 static char rn[] = "gator_X11gwin_destroy"; /*Routine name */
262 if (X11_debug)
263 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
265 return (0);
267 } /*gator_X11gwin_destroy */
269 /*------------------------------------------------------------------------
270 * gator_X11gwin_display
272 * Description:
273 * Display/redraw the given X11 window.
275 * Arguments:
276 * struct gwin *gwp : Ptr to the X11 window to draw.
278 * Returns:
279 * 0 on success,
280 * Error value otherwise.
282 * Environment:
283 * Nothing interesting.
285 * Side Effects:
286 * As advertised.
287 *------------------------------------------------------------------------*/
290 gator_X11gwin_display(struct gwin *gwp)
291 { /*gator_X11gwin_display */
293 static char rn[] = "gator_X11gwin_display"; /*Routine name */
295 if (X11_debug)
296 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
298 return (0);
300 } /*gator_X11gwin_display */
302 /*------------------------------------------------------------------------
303 * gator_X11gwin_drawline
305 * Description:
306 * Draw a line between two points in the given X11
307 * window.
309 * Arguments:
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.
314 * Returns:
315 * 0 on success,
316 * Error value otherwise.
318 * Environment:
319 * Nothing interesting.
321 * Side Effects:
322 * As advertised.
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 */
331 if (X11_debug)
332 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
333 rn);
335 return (0);
337 } /*gator_X11gwin_drawline */
339 /*------------------------------------------------------------------------
340 * gator_X11gwin_drawrectangle
342 * Description:
343 * Draw a rectangle in the given X11 window.
345 * Arguments:
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.
350 * Returns:
351 * 0 on success,
352 * Error value otherwise.
354 * Environment:
355 * Nothing interesting.
357 * Side Effects:
358 * As advertised.
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 */
367 if (X11_debug)
368 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
369 rn);
371 return (0);
373 } /*gator_X11gwin_drawrectangle */
375 /*------------------------------------------------------------------------
376 * gator_X11gwin_drawchar
378 * Description:
379 * Draw a character in the given X11 window.
381 * Arguments:
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.
386 * Returns:
387 * 0 on success,
388 * Error value otherwise.
390 * Environment:
391 * Nothing interesting.
393 * Side Effects:
394 * As advertised.
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 */
403 if (X11_debug)
404 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
406 return (0);
408 } /*gator_X11gwin_drawchar */
410 /*------------------------------------------------------------------------
411 * gator_X11gwin_drawstring
413 * Description:
414 * Draw a string in the given X11 window.
416 * Arguments:
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.
421 * Returns:
422 * 0 on success,
423 * Error value otherwise.
425 * Environment:
426 * Nothing interesting.
428 * Side Effects:
429 * As advertised.
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 */
438 if (X11_debug)
439 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
441 return (0);
443 } /*gator_X11gwin_drawstring */
445 /*------------------------------------------------------------------------
446 * gator_X11gwin_invert
448 * Description:
449 * Invert a region in the given X11 window.
451 * Arguments:
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.
456 * Returns:
457 * 0 on success,
458 * Error value otherwise.
460 * Environment:
461 * Nothing interesting.
463 * Side Effects:
464 * As advertised.
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 */
473 if (X11_debug)
474 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
475 rn);
477 return (0);
479 } /*gator_X11gwin_invert */
481 /*------------------------------------------------------------------------
482 * gator_X11gwin_getchar
484 * Description:
485 * Pick up a character from the given window.
487 * Arguments:
488 * struct gwin *gwp : Ptr to the X11 window to listen to.
490 * Returns:
491 * Value of the character read,
492 * -1 otherwise.
494 * Environment:
495 * Nothing interesting.
497 * Side Effects:
498 * As advertised.
499 *------------------------------------------------------------------------*/
502 gator_X11gwin_getchar(struct gwin *gwp)
503 { /*gator_X11gwin_getchar */
505 static char rn[] = "gator_X11gwin_getchar"; /*Routine name */
507 if (X11_debug)
508 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
509 rn);
511 return (-1);
513 } /*gator_X11gwin_getchar */
515 /*------------------------------------------------------------------------
516 * gator_X11gwin_getdimensions
518 * Description:
519 * Get the window's X,Y dimensions.
521 * Arguments:
522 * struct gwin *gwp : Ptr to the X11 window to examine.
523 * struct gwin_sizeparams *aparms : Ptr to size params to set.
525 * Returns:
526 * 0 if successful,
527 * -1 otherwise.
529 * Environment:
530 * Nothing interesting.
532 * Side Effects:
533 * As advertised.
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 */
542 if (X11_debug)
543 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
544 rn);
546 return (-1);
548 } /*gator_X11gwin_getdimensions */
550 /*------------------------------------------------------------------------
551 * gator_X11gwin_wait
553 * Description:
554 * Wait until input is available.
556 * Arguments:
557 * struct gwin *gwp : Ptr to the X11 window to wait on.
559 * Returns:
560 * 0 if successful,
561 * -1 otherwise.
563 * Environment:
564 * Nothing interesting.
566 * Side Effects:
567 * As advertised.
568 *------------------------------------------------------------------------*/
571 gator_X11gwin_wait(struct gwin *gwp)
572 { /*gator_X11gwin_wait */
574 static char rn[] = "gator_X11gwin_wait"; /*Routine name */
576 if (X11_debug)
577 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn,
578 rn);
580 return (-1);
582 } /*gator_X11gwin_wait */