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
10 #include <afsconfig.h>
11 #include <afs/param.h>
17 #include "gtxobjects.h"
18 #include "gtxwindows.h"
19 #include "gtxcurseswin.h"
21 #include "gtxkeymap.h"
28 gtx_InputServer(void *param
)
30 struct gwin
*awin
= (struct gwin
*) param
;
34 struct gtx_frame
*tframe
;
36 WOP_DISPLAY(awin
); /* start off with a clean display */
38 /* get a character from the generic window */
39 tframe
= awin
->w_frame
;
40 code
= WOP_WAIT(awin
);
42 printf("***WAIT FAILURE %d****\n", code
);
45 tc
= WOP_GETCHAR(awin
);
46 tframe
->flags
&= ~GTXFRAME_NEWDISPLAY
; /* OK to clear now */
48 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 */
65 gtx_Init(int astartInput
,
66 int atype
) /* type of window to create */
69 struct onode_initparams oi_params
; /* object init params */
70 struct gwin_initparams wi_params
; /* window initialization params */
74 /* setup the main window structure */
75 wi_params
.i_type
= GATOR_WIN_CURSES
;
78 wi_params
.i_width
= 80;
79 wi_params
.i_height
= 200;
80 wi_params
.i_debug
= 0; /* or 1 if we want debugging done */
83 * Set up the basic onode initialization parameters, throwing in
84 * the graphics-specific stuff.
86 oi_params
.i_debug
= 0; /* or 1 if we want debugging */
87 oi_params
.i_gwparams
= &wi_params
;
89 code
= gator_objects_init(&oi_params
);
93 /* if we start input thread */
94 IOMGR_Initialize(); /* input thread uses it */
96 code
= LWP_CreateProcess(gtx_InputServer
, 8192, LWP_NORMAL_PRIORITY
,
97 NULL
, "gx-listener", &junk
);
103 twin
= &gator_basegwin
;