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 windows interface.
16 *--------------------------------------------------------------------------------*/
18 #include <afsconfig.h>
19 #include <afs/param.h>
23 #include "gtxwindows.h" /*Interface for this module */
24 #include "gtxcurseswin.h" /*Interface for the curses module */
25 #include "gtxdumbwin.h" /*Interface for the dumb terminal module */
26 #include "gtxX11win.h" /*Interface for the X11 module */
28 static char mn[] = "gator_windows"; /*Module name */
29 struct gwinbaseops gwinbops; /*Base window operation fn array */
30 struct gwin gator_basegwin; /*Base gator window */
32 /*--------------------------------------------------------------------------------
36 * Initialize the gator window package.
39 * struct gwin_initparams *params : Ptr to initialization params.
43 * Error value otherwise.
46 * *** MUST BE THE FIRST ROUTINE CALLED FROM
50 * Sets up the chosen lower-level graphics package, as well
51 * as the base operation array (gwinbops). Also sets up the
53 *--------------------------------------------------------------------------------*/
56 gw_init(struct gwin_initparams *params)
59 static char rn[] = "gw_init"; /*Routine name */
60 int code; /*Return code */
61 int gwin_debug; /*Is debugging turned on? */
64 * Remember our debugging level.
66 gwin_debug = params->i_debug;
68 fprintf(stderr, "[%s:%s] Window debugging turned on\n", mn, rn);
71 * What we do/call depends on the type of lower-level graphics
72 * package we'll be using.
74 switch (params->i_type) {
75 case GATOR_WIN_DUMB: /*Dumb terminal */
78 "[%s:%s] Initializing for the dumb terminal package\n",
80 gwinbops = gator_dumb_gwinbops;
81 code = gator_dumbgwin_init(gwin_debug);
84 "[%s:%s] Error in dumb terminal initialization routine, gator_dumbgwin_init(): %d\n",
90 case GATOR_WIN_CURSES: /*Curses */
92 fprintf(stderr, "[%s:%s] Initializing for the curses package\n",
94 gwinbops = gator_curses_gwinbops;
95 code = gator_cursesgwin_init(gwin_debug);
98 "[%s:%s] Error in curses initialization routine, gator_cursesgwin_init(): %d\n",
104 case GATOR_WIN_X11: /*X11 */
106 fprintf(stderr, "[%s:%s] Initializing for the X11 package\n", mn,
108 gwinbops = gator_X11_gwinbops;
109 code = gator_X11gwin_init(gwin_debug);
112 "[%s:%s] Error in X11 initialization routine, gator_X11gwin_init(): %d\n",
119 fprintf(stderr, "[%s:%s] Illegal choice of graphics system: %d\n", mn,
121 fprintf(stderr, "\tLegal choices are:\n");
122 fprintf(stderr, "\t\t%d: Dumb terminal\n", GATOR_WIN_DUMB);
123 fprintf(stderr, "\t\t%d: Curses\n", GATOR_WIN_CURSES);
124 fprintf(stderr, "\t\t%d: X11\n", GATOR_WIN_X11);
126 } /*end switch (params->i_type) */
129 * Finally, return the good news.