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 <afsconfig.h>
17 #include <afs/param.h>
20 #include "gtxdumbwin.h" /*Interface definition */
21 #include <stdio.h> /*Standard I/O package */
24 int dumb_debug
; /*Is debugging turned on? */
25 static char mn
[] = "gator_dumbwindows"; /*Module name */
28 * Version of standard operations for a dumb window.
30 struct gwinops dumb_gwinops
= {
33 gator_dumbgwin_destroy
,
34 gator_dumbgwin_display
,
35 gator_dumbgwin_drawline
,
36 gator_dumbgwin_drawrectangle
,
37 gator_dumbgwin_drawchar
,
38 gator_dumbgwin_drawstring
,
39 gator_dumbgwin_invert
,
40 gator_dumbgwin_getchar
,
41 gator_dumbgwin_getdimensions
,
45 struct gwinbaseops gator_dumb_gwinbops
= {
46 gator_dumbgwin_create
,
47 gator_dumbgwin_cleanup
51 * Macros to map pixel positions to row & column positions.
52 * (Note: for now, they are the identity function!!)
54 #define GATOR_MAP_X_TO_COL(w, x) (x)
55 #define GATOR_MAP_Y_TO_LINE(w, y) (y)
57 /*------------------------------------------------------------------------
61 * Initialize the dumb window package.
64 * int adebug: Is debugging turned on?
68 * Error value otherwise.
71 * Nothing interesting.
75 *------------------------------------------------------------------------*/
78 gator_dumbgwin_init(int adebug
)
79 { /*gator_dumbgwin_init */
81 static char rn
[] = "gator_dumbgwin_init"; /*Routine name */
84 * Remember if we'll be doing debugging, init dumb and clear the
90 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
93 * We always return success here.
97 } /*gator_dumbgwin_init */
99 /*------------------------------------------------------------------------
100 * gator_dumbgwin_create
103 * Create a dumb window.
106 * struct gator_dumbgwin_params *params : Ptr to creation parameters.
109 * Ptr to the created dumb window if successful,
110 * Null ptr otherwise.
113 * Nothing interesting.
117 *------------------------------------------------------------------------*/
120 gator_dumbgwin_create(void *rock
)
121 { /*gator_dumbgwin_create */
123 static char rn
[] = "gator_dumbgwin_create"; /*Routine name */
125 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
128 * Return failure here, fill this routine in at some point.
132 } /*gator_dumbgwin_create */
134 /*------------------------------------------------------------------------
135 * gator_dumbgwin_cleanup
138 * Create a dumb window.
141 * struct gwin *gwp : Ptr to base window.
145 * Error value otherwise.
148 * Nothing interesting.
152 *------------------------------------------------------------------------*/
155 gator_dumbgwin_cleanup(struct gwin
*gwp
)
156 { /*gator_dumbgwin_cleanup */
158 static char rn
[] = "gator_dumbgwin_cleanup"; /*Routine name */
161 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
164 * Return success here, fill this routine in at some point.
168 } /*gator_dumbgwin_cleanup */
170 /*------------------------------------------------------------------------
174 * Draw a box around the given dumb window.
177 * struct gwin *gwp : Ptr to the dumb window to draw
182 * Error value otherwise.
185 * Nothing interesting.
189 *------------------------------------------------------------------------*/
192 gator_dumbgwin_box(struct gwin
*gwp
)
193 { /*gator_dumbgwin_box */
195 static char rn
[] = "gator_dumbgwin_box"; /*Routine name */
198 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
201 * Return success here, fill in the routine at some point.
205 } /*gator_dumbgwin_box */
207 /*------------------------------------------------------------------------
208 * gator_dumbgwin_clear
211 * Clear out the given dumb window.
214 * struct gwin *gwp : Ptr to the dumb window to clear out.
218 * Error value otherwise.
221 * Nothing interesting.
225 *------------------------------------------------------------------------*/
228 gator_dumbgwin_clear(struct gwin
*gwp
)
229 { /*gator_dumbgwin_clear */
231 static char rn
[] = "gator_dumbgwin_clear"; /*Routine name */
234 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
237 * Return success, fill in this routine at some point.
241 } /*gator_dumbgwin_clear */
243 /*------------------------------------------------------------------------
244 * gator_dumbgwin_destroy
247 * Destroy the given dumb window.
250 * struct gwin *gwp : Ptr to the dumb window to destroy.
254 * Error value otherwise.
257 * Nothing interesting.
261 *------------------------------------------------------------------------*/
264 gator_dumbgwin_destroy(struct gwin
*gwp
)
265 { /*gator_dumbgwin_destroy */
267 static char rn
[] = "gator_dumbgwin_destroy"; /*Routine name */
270 fprintf(stderr
, "[%s:%s] Called", mn
, rn
);
274 } /*gator_dumbgwin_destroy */
276 /*------------------------------------------------------------------------
277 * gator_dumbgwin_display
280 * Display/redraw the given dumb window.
283 * struct gwin *gwp : Ptr to the dumb window to draw.
287 * Error value otherwise.
290 * Nothing interesting.
294 *------------------------------------------------------------------------*/
297 gator_dumbgwin_display(struct gwin
*gwp
)
298 { /*gator_dumbgwin_display */
300 static char rn
[] = "gator_dumbgwin_display"; /*Routine name */
303 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
306 * Return success, fill in this routine at some point.
310 } /*gator_dumbgwin_display */
312 /*------------------------------------------------------------------------
313 * gator_dumbgwin_drawline
316 * Draw a line between two points in the given dumb
320 * struct gwin *gwp : Ptr to the dumb window in which
321 * the line is to be drawn.
322 * struct gwin_lineparams *params : Ptr to other params.
326 * Error value otherwise.
329 * Nothing interesting.
333 *------------------------------------------------------------------------*/
336 gator_dumbgwin_drawline(struct gwin
*gwp
, struct gwin_lineparams
*params
)
337 { /*gator_dumbgwin_drawline */
339 static char rn
[] = "gator_dumbgwin_drawline"; /*Routine name */
342 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
346 * Return success, fill in this routine at some point.
350 } /*gator_dumbgwin_drawline */
352 /*------------------------------------------------------------------------
353 * gator_dumbgwin_drawrectangle
356 * Draw a rectangle in the given dumb window.
359 * struct gwin *gwp : Ptr to the dumb window in which
360 * the rectangle is to be drawn.
361 * struct gwin_rectparams *params : Ptr to other params.
365 * Error value otherwise.
368 * Nothing interesting.
372 *------------------------------------------------------------------------*/
375 gator_dumbgwin_drawrectangle(struct gwin
*gwp
, struct gwin_rectparams
*params
)
376 { /*gator_dumbgwin_drawrectangle */
378 static char rn
[] = "gator_dumbgwin_drawrectangle"; /*Routine name */
381 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
385 * Return success, fill in this routine at some point.
389 } /*gator_dumbgwin_drawrectangle */
391 /*------------------------------------------------------------------------
392 * gator_dumbgwin_drawchar
395 * Draw a character in the given dumb window.
398 * struct gwin *gwp : Ptr to the dumb window in which
399 * the character is to be drawn.
400 * struct gwin_charparams *params : Ptr to other params.
404 * Error value otherwise.
407 * Nothing interesting.
411 *------------------------------------------------------------------------*/
414 gator_dumbgwin_drawchar(struct gwin
*gwp
, struct gwin_charparams
*params
)
415 { /*gator_dumbgwin_drawchar */
417 static char rn
[] = "gator_dumbgwin_drawchar"; /*Routine name */
420 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
423 * Return success, fill in this routine at some point.
427 } /*gator_dumbgwin_drawchar */
429 /*------------------------------------------------------------------------
430 * gator_dumbgwin_drawstring
433 * Draw a string in the given dumb window.
436 * struct gwin *gwp : Ptr to the dumb window in which
437 * the string is to be drawn.
438 * struct gwin_strparams *params : Ptr to other params.
442 * Error value otherwise.
445 * Nothing interesting.
449 *------------------------------------------------------------------------*/
452 gator_dumbgwin_drawstring(struct gwin
*gwp
, struct gwin_strparams
*params
)
453 { /*gator_dumbgwin_drawstring */
455 static char rn
[] = "gator_dumbgwin_drawstring"; /*Routine name */
458 fprintf(stderr
, "[%s:%s] Called\n", mn
, rn
);
461 * Return success, fill in this routine at some point.
465 } /*gator_dumbgwin_drawstring */
467 /*------------------------------------------------------------------------
468 * gator_dumbgwin_invert
471 * Invert a region in the given dumb window.
474 * struct gwin *gwp : Ptr to the dumb window in which
475 * the inverted region lies.
476 * struct gwin_invparams *params : Ptr to other params.
480 * Error value otherwise.
483 * Nothing interesting.
487 *------------------------------------------------------------------------*/
490 gator_dumbgwin_invert(struct gwin
*gwp
, struct gwin_invparams
*params
)
491 { /*gator_dumbgwin_invert */
493 static char rn
[] = "gator_dumbgwin_invert"; /*Routine name */
496 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
500 * Return success, fill in this routine at some point.
504 } /*gator_dumbgwin_invert */
506 /*------------------------------------------------------------------------
507 * gator_dumbgwin_getchar
510 * Pick up a character from the given window.
513 * struct gwin *gwp : Ptr to the dumb window to listen to.
516 * Value of the character read,
520 * Nothing interesting.
524 *------------------------------------------------------------------------*/
527 gator_dumbgwin_getchar(struct gwin
*gwp
)
528 { /*gator_dumbgwin_getchar */
530 static char rn
[] = "gator_dumbgwin_getchar"; /*Routine name */
533 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
538 } /*gator_dumbgwin_getchar */
540 /*------------------------------------------------------------------------
541 * gator_dumbgwin_getdimensions
544 * Get the window's X,Y dimensions.
547 * struct gwin *gwp : Ptr to the dumb window to examine.
548 * struct gwin_sizeparams *aparms : Ptr to size params to set.
555 * Nothing interesting.
559 *------------------------------------------------------------------------*/
562 gator_dumbgwin_getdimensions(struct gwin
*gwp
, struct gwin_sizeparams
*aparms
)
563 { /*gator_dumbgwin_getdimensions */
565 static char rn
[] = "gator_dumbgwin_getdimensions"; /*Routine name */
568 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
573 } /*gator_dumbgwin_getdimensions */
575 /*------------------------------------------------------------------------
576 * gator_dumbgwin_wait
579 * Wait until input is available.
582 * struct gwin *gwp : Ptr to the dumb window to wait on.
589 * Nothing interesting.
593 *------------------------------------------------------------------------*/
596 gator_dumbgwin_wait(struct gwin
*gwp
)
597 { /*gator_dumbgwin_wait */
599 static char rn
[] = "gator_dumbgwin_wait"; /*Routine name */
602 fprintf(stderr
, "[%s:%s] This routine is currently a no-op\n", mn
,
607 } /*gator_dumbgwin_wait */