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 <afs/param.h>
19 #include <afsconfig.h>
23 /* On DUX "IN" is a variable in curses.h, so this can be a bit of a problem */
28 #include "gtxwindows.h" /*Interface for this module*/
29 #include "gtxcurseswin.h" /*Interface for the curses module*/
30 #include "gtxdumbwin.h" /*Interface for the dumb terminal module*/
31 #include "gtxX11win.h" /*Interface for the X11 module*/
33 static char mn[] = "gator_windows"; /*Module name*/
34 struct gwinbaseops gwinbops; /*Base window operation fn array*/
35 struct gwin gator_basegwin; /*Base gator window*/
37 /*--------------------------------------------------------------------------------
41 * Initialize the gator window package.
44 * struct gwin_initparams *params : Ptr to initialization params.
48 * Error value otherwise.
51 * *** MUST BE THE FIRST ROUTINE CALLED FROM
55 * Sets up the chosen lower-level graphics package, as well
56 * as the base operation array (gwinbops). Also sets up the
58 *--------------------------------------------------------------------------------*/
61 struct gwin_initparams *params;
65 static char rn[] = "gw_init"; /*Routine name*/
66 register int code; /*Return code*/
67 int gwin_debug; /*Is debugging turned on?*/
70 * Remember our debugging level.
72 gwin_debug = params->i_debug;
74 fprintf(stderr, "[%s:%s] Window debugging turned on\n", mn, rn);
77 * What we do/call depends on the type of lower-level graphics
78 * package we'll be using.
80 switch (params->i_type) {
81 case GATOR_WIN_DUMB: /*Dumb terminal*/
83 fprintf(stderr, "[%s:%s] Initializing for the dumb terminal package\n", mn, rn);
84 gwinbops = gator_dumb_gwinbops;
85 code = gator_dumbgwin_init(gwin_debug);
87 fprintf(stderr, "[%s:%s] Error in dumb terminal initialization routine, gator_dumbgwin_init(): %d\n", mn, rn, code);
92 case GATOR_WIN_CURSES: /*Curses*/
94 fprintf(stderr, "[%s:%s] Initializing for the curses package\n", mn, rn);
95 gwinbops = gator_curses_gwinbops;
96 code = gator_cursesgwin_init(gwin_debug);
98 fprintf(stderr, "[%s:%s] Error in curses initialization routine, gator_cursesgwin_init(): %d\n", mn, rn, code);
103 case GATOR_WIN_X11: /*X11*/
105 fprintf(stderr, "[%s:%s] Initializing for the X11 package\n", mn, rn);
106 gwinbops = gator_X11_gwinbops;
107 code = gator_X11gwin_init(params);
109 fprintf(stderr, "[%s:%s] Error in X11 initialization routine, gator_X11gwin_init(): %d\n", mn, rn, code);
115 fprintf(stderr, "[%s:%s] Illegal choice of graphics system: %d\n",
116 mn, rn, params->i_type);
117 fprintf(stderr, "\tLegal choices are:\n");
118 fprintf(stderr, "\t\t%d: Dumb terminal\n", GATOR_WIN_DUMB);
119 fprintf(stderr, "\t\t%d: Curses\n", GATOR_WIN_CURSES);
120 fprintf(stderr, "\t\t%d: X11\n", GATOR_WIN_X11);
122 } /*end switch (params->i_type)*/
125 * Finally, return the good news.