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
11 #include <afsconfig.h>
12 #include <afs/param.h>
17 #include <sys/types.h>
21 #include "gtxobjects.h"
22 #include "gtxwindows.h"
23 #include "gtxcurseswin.h"
25 #include "gtxkeymap.h"
32 register struct gwin *awin; {
35 register struct gtx_frame *tframe;
37 WOP_DISPLAY(awin); /* start off with a clean display */
39 /* get a character from the generic window */
40 tframe = awin->w_frame;
41 code = WOP_WAIT(awin);
43 printf("***WAIT FAILURE %d****\n", code);
46 tc = WOP_GETCHAR(awin);
47 tframe->flags &= ~GTXFRAME_NEWDISPLAY; /* OK to clear now */
48 if (tc < 0) break; /* EOF or some such */
49 /* otherwise, process the character and go get a new one */
50 gtxframe_ClearMessageLine(tframe);
51 tframe->flags &= ~(GTXFRAME_RECURSIVEEND | GTXFRAME_RECURSIVEERR);
52 keymap_ProcessKey(tframe->keystate, tc, awin);
53 tframe = awin->w_frame; /* in case command changed it */
54 if (tframe->flags & GTXFRAME_RECURSIVEEND) {
55 tframe->flags &= ~GTXFRAME_RECURSIVEEND;
58 tframe->flags &= ~GTXFRAME_RECURSIVEEND;
59 WOP_DISPLAY(awin); /* eventually calls gtxframe_Display */
63 struct gwin *gtx_Init(astartInput, atype)
64 int atype; /* type of window to create */
67 struct onode_initparams oi_params; /* object init params*/
68 struct gwin_initparams wi_params; /* window initialization params*/
69 register struct gwin *twin;
72 /* setup the main window structure */
73 wi_params.i_type = GATOR_WIN_CURSES;
76 wi_params.i_width = 80;
77 wi_params.i_height = 200;
78 wi_params.i_debug = 0; /* or 1 if we want debugging done */
81 * Set up the basic onode initialization parameters, throwing in
82 * the graphics-specific stuff.
84 oi_params.i_debug = 0; /* or 1 if we want debugging */
85 oi_params.i_gwparams = &wi_params;
87 code = gator_objects_init(&oi_params);
88 if (code) return NULL;
90 /* if we start input thread */
91 IOMGR_Initialize(); /* input thread uses it */
93 code = LWP_CreateProcess(gtx_InputServer, 8192, LWP_NORMAL_PRIORITY,
94 0, "gx-listener", &junk);
96 twin = &gator_basegwin;