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 "gtxdumbwin.h" /*Interface definition*/
17 #include <stdio.h> /*Standard I/O package*/
20 extern int errno; /*System error number*/
22 int dumb_debug; /*Is debugging turned on?*/
23 static char mn[] = "gator_dumbwindows"; /*Module name*/
26 * Version of standard operations for a dumb window.
28 struct gwinops dumb_gwinops = {
31 gator_dumbgwin_destroy,
32 gator_dumbgwin_display,
33 gator_dumbgwin_drawline,
34 gator_dumbgwin_drawrectangle,
35 gator_dumbgwin_drawchar,
36 gator_dumbgwin_drawstring,
37 gator_dumbgwin_invert,
38 gator_dumbgwin_getchar,
39 gator_dumbgwin_getdimensions,
43 struct gwinbaseops gator_dumb_gwinbops = {
44 gator_dumbgwin_create,
45 gator_dumbgwin_cleanup
49 * Macros to map pixel positions to row & column positions.
50 * (Note: for now, they are the identity function!!)
52 #define GATOR_MAP_X_TO_COL(w, x) (x)
53 #define GATOR_MAP_Y_TO_LINE(w, y) (y)
55 /*------------------------------------------------------------------------
59 * Initialize the dumb window package.
62 * int adebug: Is debugging turned on?
66 * Error value otherwise.
69 * Nothing interesting.
73 *------------------------------------------------------------------------*/
75 int gator_dumbgwin_init(adebug)
78 { /*gator_dumbgwin_init*/
80 static char rn[] = "gator_dumbgwin_init"; /*Routine name*/
83 * Remember if we'll be doing debugging, init dumb and clear the
89 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
92 * We always return success here.
96 } /*gator_dumbgwin_init*/
98 /*------------------------------------------------------------------------
99 * gator_dumbgwin_create
102 * Create a dumb window.
105 * struct gator_dumbgwin_params *params : Ptr to creation parameters.
108 * Ptr to the created dumb window if successful,
109 * Null ptr otherwise.
112 * Nothing interesting.
116 *------------------------------------------------------------------------*/
118 struct gwin *gator_dumbgwin_create(params)
119 struct gator_dumbgwin_params *params;
121 { /*gator_dumbgwin_create*/
123 static char rn[] = "gator_dumbgwin_create"; /*Routine name*/
126 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
129 * Return failure here, fill this routine in at some point.
131 return((struct gwin *)0);
133 } /*gator_dumbgwin_create*/
135 /*------------------------------------------------------------------------
136 * gator_dumbgwin_cleanup
139 * Create a dumb window.
142 * struct gwin *gwp : Ptr to base window.
146 * Error value otherwise.
149 * Nothing interesting.
153 *------------------------------------------------------------------------*/
155 int gator_dumbgwin_cleanup(gwp)
158 { /*gator_dumbgwin_cleanup*/
160 static char rn[] = "gator_dumbgwin_cleanup"; /*Routine name*/
163 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
166 * Return success here, fill this routine in at some point.
170 } /*gator_dumbgwin_cleanup*/
172 /*------------------------------------------------------------------------
176 * Draw a box around the given dumb window.
179 * struct gwin *gwp : Ptr to the dumb window to draw
184 * Error value otherwise.
187 * Nothing interesting.
191 *------------------------------------------------------------------------*/
193 int gator_dumbgwin_box(gwp)
196 { /*gator_dumbgwin_box*/
198 static char rn[] = "gator_dumbgwin_box"; /*Routine name*/
201 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
204 * Return success here, fill in the routine at some point.
208 } /*gator_dumbgwin_box*/
210 /*------------------------------------------------------------------------
211 * gator_dumbgwin_clear
214 * Clear out the given dumb window.
217 * struct gwin *gwp : Ptr to the dumb window to clear out.
221 * Error value otherwise.
224 * Nothing interesting.
228 *------------------------------------------------------------------------*/
230 int gator_dumbgwin_clear(gwp)
233 { /*gator_dumbgwin_clear*/
235 static char rn[] = "gator_dumbgwin_clear"; /*Routine name*/
238 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
241 * Return success, fill in this routine at some point.
245 } /*gator_dumbgwin_clear*/
247 /*------------------------------------------------------------------------
248 * gator_dumbgwin_destroy
251 * Destroy the given dumb window.
254 * struct gwin *gwp : Ptr to the dumb window to destroy.
258 * Error value otherwise.
261 * Nothing interesting.
265 *------------------------------------------------------------------------*/
267 int gator_dumbgwin_destroy(gwp)
270 { /*gator_dumbgwin_destroy*/
272 static char rn[] = "gator_dumbgwin_destroy"; /*Routine name*/
275 fprintf(stderr, "[%s:%s] Called", mn, rn);
279 } /*gator_dumbgwin_destroy*/
281 /*------------------------------------------------------------------------
282 * gator_dumbgwin_display
285 * Display/redraw the given dumb window.
288 * struct gwin *gwp : Ptr to the dumb window to draw.
292 * Error value otherwise.
295 * Nothing interesting.
299 *------------------------------------------------------------------------*/
301 int gator_dumbgwin_display(gwp)
304 { /*gator_dumbgwin_display*/
306 static char rn[] = "gator_dumbgwin_display"; /*Routine name*/
309 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
312 * Return success, fill in this routine at some point.
316 } /*gator_dumbgwin_display*/
318 /*------------------------------------------------------------------------
319 * gator_dumbgwin_drawline
322 * Draw a line between two points in the given dumb
326 * struct gwin *gwp : Ptr to the dumb window in which
327 * the line is to be drawn.
328 * struct gwin_lineparams *params : Ptr to other params.
332 * Error value otherwise.
335 * Nothing interesting.
339 *------------------------------------------------------------------------*/
341 int gator_dumbgwin_drawline(gwp, params)
343 struct gwin_lineparams *params;
345 { /*gator_dumbgwin_drawline*/
347 static char rn[] = "gator_dumbgwin_drawline"; /*Routine name*/
350 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
353 * Return success, fill in this routine at some point.
357 } /*gator_dumbgwin_drawline*/
359 /*------------------------------------------------------------------------
360 * gator_dumbgwin_drawrectangle
363 * Draw a rectangle in the given dumb window.
366 * struct gwin *gwp : Ptr to the dumb window in which
367 * the rectangle is to be drawn.
368 * struct gwin_rectparams *params : Ptr to other params.
372 * Error value otherwise.
375 * Nothing interesting.
379 *------------------------------------------------------------------------*/
381 int gator_dumbgwin_drawrectangle(gwp, params)
383 struct gwin_rectparams *params;
385 { /*gator_dumbgwin_drawrectangle*/
387 static char rn[] = "gator_dumbgwin_drawrectangle"; /*Routine name*/
390 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
393 * Return success, fill in this routine at some point.
397 } /*gator_dumbgwin_drawrectangle*/
399 /*------------------------------------------------------------------------
400 * gator_dumbgwin_drawchar
403 * Draw a character in the given dumb window.
406 * struct gwin *gwp : Ptr to the dumb window in which
407 * the character is to be drawn.
408 * struct gwin_charparams *params : Ptr to other params.
412 * Error value otherwise.
415 * Nothing interesting.
419 *------------------------------------------------------------------------*/
421 int gator_dumbgwin_drawchar(gwp, params)
423 struct gwin_charparams *params;
425 { /*gator_dumbgwin_drawchar*/
427 static char rn[] = "gator_dumbgwin_drawchar"; /*Routine name*/
430 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
433 * Return success, fill in this routine at some point.
437 } /*gator_dumbgwin_drawchar*/
439 /*------------------------------------------------------------------------
440 * gator_dumbgwin_drawstring
443 * Draw a string in the given dumb window.
446 * struct gwin *gwp : Ptr to the dumb window in which
447 * the string is to be drawn.
448 * struct gwin_strparams *params : Ptr to other params.
452 * Error value otherwise.
455 * Nothing interesting.
459 *------------------------------------------------------------------------*/
461 int gator_dumbgwin_drawstring(gwp, params)
463 struct gwin_strparams *params;
465 { /*gator_dumbgwin_drawstring*/
467 static char rn[] = "gator_dumbgwin_drawstring"; /*Routine name*/
470 fprintf(stderr, "[%s:%s] Called\n", mn, rn);
473 * Return success, fill in this routine at some point.
477 } /*gator_dumbgwin_drawstring*/
479 /*------------------------------------------------------------------------
480 * gator_dumbgwin_invert
483 * Invert a region in the given dumb window.
486 * struct gwin *gwp : Ptr to the dumb window in which
487 * the inverted region lies.
488 * struct gwin_invparams *params : Ptr to other params.
492 * Error value otherwise.
495 * Nothing interesting.
499 *------------------------------------------------------------------------*/
501 int gator_dumbgwin_invert(gwp, params)
503 struct gwin_invparams *params;
505 { /*gator_dumbgwin_invert*/
507 static char rn[] = "gator_dumbgwin_invert"; /*Routine name*/
510 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
513 * Return success, fill in this routine at some point.
517 } /*gator_dumbgwin_invert*/
519 /*------------------------------------------------------------------------
520 * gator_dumbgwin_getchar
523 * Pick up a character from the given window.
526 * struct gwin *gwp : Ptr to the dumb window to listen to.
529 * Value of the character read,
533 * Nothing interesting.
537 *------------------------------------------------------------------------*/
539 int gator_dumbgwin_getchar(gwp)
542 { /*gator_dumbgwin_getchar*/
544 static char rn[] = "gator_dumbgwin_getchar"; /*Routine name*/
547 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
551 } /*gator_dumbgwin_getchar*/
553 /*------------------------------------------------------------------------
554 * gator_dumbgwin_getdimensions
557 * Get the window's X,Y dimensions.
560 * struct gwin *gwp : Ptr to the dumb window to examine.
561 * struct gwin_sizeparams *aparms : Ptr to size params to set.
568 * Nothing interesting.
572 *------------------------------------------------------------------------*/
574 int gator_dumbgwin_getdimensions(gwp, aparms)
576 struct gwin_sizeparams *aparms;
578 {/*gator_dumbgwin_getdimensions*/
580 static char rn[] = "gator_dumbgwin_getdimensions"; /*Routine name*/
583 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
587 } /*gator_dumbgwin_getdimensions*/
589 /*------------------------------------------------------------------------
590 * gator_dumbgwin_wait
593 * Wait until input is available.
596 * struct gwin *gwp : Ptr to the dumb window to wait on.
603 * Nothing interesting.
607 *------------------------------------------------------------------------*/
609 int gator_dumbgwin_wait(gwp)
612 { /*gator_dumbgwin_wait*/
614 static char rn[] = "gator_dumbgwin_wait"; /*Routine name*/
617 fprintf(stderr, "[%s:%s] This routine is currently a no-op\n", mn, rn);
621 } /*gator_dumbgwin_wait*/