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
12 * Implementation of the gator dumb window facility.
14 *------------------------------------------------------------------------*/
16 #include <afs/param.h>
17 #include <afsconfig.h>
21 #include "gtxdumbwin.h" /*Interface definition*/
22 #include <stdio.h> /*Standard I/O package*/
25 extern int errno; /*System error number*/
27 int dumb_debug; /*Is debugging turned on?*/
28 static char mn[] = "gator_dumbwindows"; /*Module name*/
31 * Version of standard operations for a dumb window.
33 struct gwinops dumb_gwinops = {
36 gator_dumbgwin_destroy,
37 gator_dumbgwin_display,
38 gator_dumbgwin_drawline,
39 gator_dumbgwin_drawrectangle,
40 gator_dumbgwin_drawchar,
41 gator_dumbgwin_drawstring,
42 gator_dumbgwin_invert,
43 gator_dumbgwin_getchar,
44 gator_dumbgwin_getdimensions,
48 struct gwinbaseops gator_dumb_gwinbops = {
49 gator_dumbgwin_create,
50 gator_dumbgwin_cleanup
54 * Macros to map pixel positions to row & column positions.
55 * (Note: for now, they are the identity function!!)
57 #define GATOR_MAP_X_TO_COL(w, x) (x)
58 #define GATOR_MAP_Y_TO_LINE(w, y) (y)
60 /*------------------------------------------------------------------------
64 * Initialize the dumb window package.
67 * int adebug: Is debugging turned on?
71 * Error value otherwise.
74 * Nothing interesting.
78 *------------------------------------------------------------------------*/
80 int gator_dumbgwin_init(adebug)
83 { /*gator_dumbgwin_init*/
85 static char rn[] = "gator_dumbgwin_init"; /*Routine name*/
88 * Remember if we'll be doing debugging, init dumb and clear the
94 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
97 * We always return success here.
101 } /*gator_dumbgwin_init*/
103 /*------------------------------------------------------------------------
104 * gator_dumbgwin_create
107 * Create a dumb window.
110 * struct gator_dumbgwin_params *params : Ptr to creation parameters.
113 * Ptr to the created dumb window if successful,
114 * Null ptr otherwise.
117 * Nothing interesting.
121 *------------------------------------------------------------------------*/
123 struct gwin *gator_dumbgwin_create(params)
124 struct gator_dumbgwin_params *params;
126 { /*gator_dumbgwin_create*/
128 static char rn[] = "gator_dumbgwin_create"; /*Routine name*/
131 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
134 * Return failure here, fill this routine in at some point.
136 return((struct gwin *)0);
138 } /*gator_dumbgwin_create*/
140 /*------------------------------------------------------------------------
141 * gator_dumbgwin_cleanup
144 * Create a dumb window.
147 * struct gwin *gwp : Ptr to base window.
151 * Error value otherwise.
154 * Nothing interesting.
158 *------------------------------------------------------------------------*/
160 int gator_dumbgwin_cleanup(gwp)
163 { /*gator_dumbgwin_cleanup*/
165 static char rn[] = "gator_dumbgwin_cleanup"; /*Routine name*/
168 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
171 * Return success here, fill this routine in at some point.
175 } /*gator_dumbgwin_cleanup*/
177 /*------------------------------------------------------------------------
181 * Draw a box around the given dumb window.
184 * struct gwin *gwp : Ptr to the dumb window to draw
189 * Error value otherwise.
192 * Nothing interesting.
196 *------------------------------------------------------------------------*/
198 int gator_dumbgwin_box(gwp)
201 { /*gator_dumbgwin_box*/
203 static char rn[] = "gator_dumbgwin_box"; /*Routine name*/
206 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
209 * Return success here, fill in the routine at some point.
213 } /*gator_dumbgwin_box*/
215 /*------------------------------------------------------------------------
216 * gator_dumbgwin_clear
219 * Clear out the given dumb window.
222 * struct gwin *gwp : Ptr to the dumb window to clear out.
226 * Error value otherwise.
229 * Nothing interesting.
233 *------------------------------------------------------------------------*/
235 int gator_dumbgwin_clear(gwp)
238 { /*gator_dumbgwin_clear*/
240 static char rn[] = "gator_dumbgwin_clear"; /*Routine name*/
243 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
246 * Return success, fill in this routine at some point.
250 } /*gator_dumbgwin_clear*/
252 /*------------------------------------------------------------------------
253 * gator_dumbgwin_destroy
256 * Destroy the given dumb window.
259 * struct gwin *gwp : Ptr to the dumb window to destroy.
263 * Error value otherwise.
266 * Nothing interesting.
270 *------------------------------------------------------------------------*/
272 int gator_dumbgwin_destroy(gwp)
275 { /*gator_dumbgwin_destroy*/
277 static char rn[] = "gator_dumbgwin_destroy"; /*Routine name*/
280 fprintf(stderr, "[%s:%s] Called", mn, rn);
284 } /*gator_dumbgwin_destroy*/
286 /*------------------------------------------------------------------------
287 * gator_dumbgwin_display
290 * Display/redraw the given dumb window.
293 * struct gwin *gwp : Ptr to the dumb window to draw.
297 * Error value otherwise.
300 * Nothing interesting.
304 *------------------------------------------------------------------------*/
306 int gator_dumbgwin_display(gwp)
309 { /*gator_dumbgwin_display*/
311 static char rn[] = "gator_dumbgwin_display"; /*Routine name*/
314 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
317 * Return success, fill in this routine at some point.
321 } /*gator_dumbgwin_display*/
323 /*------------------------------------------------------------------------
324 * gator_dumbgwin_drawline
327 * Draw a line between two points in the given dumb
331 * struct gwin *gwp : Ptr to the dumb window in which
332 * the line is to be drawn.
333 * struct gwin_lineparams *params : Ptr to other params.
337 * Error value otherwise.
340 * Nothing interesting.
344 *------------------------------------------------------------------------*/
346 int gator_dumbgwin_drawline(gwp, params)
348 struct gwin_lineparams *params;
350 { /*gator_dumbgwin_drawline*/
352 static char rn[] = "gator_dumbgwin_drawline"; /*Routine name*/
355 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
358 * Return success, fill in this routine at some point.
362 } /*gator_dumbgwin_drawline*/
364 /*------------------------------------------------------------------------
365 * gator_dumbgwin_drawrectangle
368 * Draw a rectangle in the given dumb window.
371 * struct gwin *gwp : Ptr to the dumb window in which
372 * the rectangle is to be drawn.
373 * struct gwin_rectparams *params : Ptr to other params.
377 * Error value otherwise.
380 * Nothing interesting.
384 *------------------------------------------------------------------------*/
386 int gator_dumbgwin_drawrectangle(gwp, params)
388 struct gwin_rectparams *params;
390 { /*gator_dumbgwin_drawrectangle*/
392 static char rn[] = "gator_dumbgwin_drawrectangle"; /*Routine name*/
395 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
398 * Return success, fill in this routine at some point.
402 } /*gator_dumbgwin_drawrectangle*/
404 /*------------------------------------------------------------------------
405 * gator_dumbgwin_drawchar
408 * Draw a character in the given dumb window.
411 * struct gwin *gwp : Ptr to the dumb window in which
412 * the character is to be drawn.
413 * struct gwin_charparams *params : Ptr to other params.
417 * Error value otherwise.
420 * Nothing interesting.
424 *------------------------------------------------------------------------*/
426 int gator_dumbgwin_drawchar(gwp, params)
428 struct gwin_charparams *params;
430 { /*gator_dumbgwin_drawchar*/
432 static char rn[] = "gator_dumbgwin_drawchar"; /*Routine name*/
435 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
438 * Return success, fill in this routine at some point.
442 } /*gator_dumbgwin_drawchar*/
444 /*------------------------------------------------------------------------
445 * gator_dumbgwin_drawstring
448 * Draw a string in the given dumb window.
451 * struct gwin *gwp : Ptr to the dumb window in which
452 * the string is to be drawn.
453 * struct gwin_strparams *params : Ptr to other params.
457 * Error value otherwise.
460 * Nothing interesting.
464 *------------------------------------------------------------------------*/
466 int gator_dumbgwin_drawstring(gwp, params)
468 struct gwin_strparams *params;
470 { /*gator_dumbgwin_drawstring*/
472 static char rn[] = "gator_dumbgwin_drawstring"; /*Routine name*/
475 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
478 * Return success, fill in this routine at some point.
482 } /*gator_dumbgwin_drawstring*/
484 /*------------------------------------------------------------------------
485 * gator_dumbgwin_invert
488 * Invert a region in the given dumb window.
491 * struct gwin *gwp : Ptr to the dumb window in which
492 * the inverted region lies.
493 * struct gwin_invparams *params : Ptr to other params.
497 * Error value otherwise.
500 * Nothing interesting.
504 *------------------------------------------------------------------------*/
506 int gator_dumbgwin_invert(gwp, params)
508 struct gwin_invparams *params;
510 { /*gator_dumbgwin_invert*/
512 static char rn[] = "gator_dumbgwin_invert"; /*Routine name*/
515 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
518 * Return success, fill in this routine at some point.
522 } /*gator_dumbgwin_invert*/
524 /*------------------------------------------------------------------------
525 * gator_dumbgwin_getchar
528 * Pick up a character from the given window.
531 * struct gwin *gwp : Ptr to the dumb window to listen to.
534 * Value of the character read,
538 * Nothing interesting.
542 *------------------------------------------------------------------------*/
544 int gator_dumbgwin_getchar(gwp)
547 { /*gator_dumbgwin_getchar*/
549 static char rn[] = "gator_dumbgwin_getchar"; /*Routine name*/
552 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
556 } /*gator_dumbgwin_getchar*/
558 /*------------------------------------------------------------------------
559 * gator_dumbgwin_getdimensions
562 * Get the window's X,Y dimensions.
565 * struct gwin *gwp : Ptr to the dumb window to examine.
566 * struct gwin_sizeparams *aparms : Ptr to size params to set.
573 * Nothing interesting.
577 *------------------------------------------------------------------------*/
579 int gator_dumbgwin_getdimensions(gwp, aparms)
581 struct gwin_sizeparams *aparms;
583 {/*gator_dumbgwin_getdimensions*/
585 static char rn[] = "gator_dumbgwin_getdimensions"; /*Routine name*/
588 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
592 } /*gator_dumbgwin_getdimensions*/
594 /*------------------------------------------------------------------------
595 * gator_dumbgwin_wait
598 * Wait until input is available.
601 * struct gwin *gwp : Ptr to the dumb window to wait on.
608 * Nothing interesting.
612 *------------------------------------------------------------------------*/
614 int gator_dumbgwin_wait(gwp)
617 { /*gator_dumbgwin_wait*/
619 static char rn[] = "gator_dumbgwin_wait"; /*Routine name*/
622 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
626 } /*gator_dumbgwin_wait*/