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