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>
16 #include <sys/types.h>
19 #include "gtxobjects.h"
20 #include "gtxwindows.h"
21 #include "gtxcurseswin.h"
23 #include "gtxkeymap.h"
30 gtx_InputServer(void *param
)
32 struct gwin
*awin
= (struct gwin
*) param
;
36 struct gtx_frame
*tframe
;
38 WOP_DISPLAY(awin
); /* start off with a clean display */
40 /* get a character from the generic window */
41 tframe
= awin
->w_frame
;
42 code
= WOP_WAIT(awin
);
44 printf("***WAIT FAILURE %d****\n", code
);
47 tc
= WOP_GETCHAR(awin
);
48 tframe
->flags
&= ~GTXFRAME_NEWDISPLAY
; /* OK to clear now */
50 break; /* EOF or some such */
51 /* otherwise, process the character and go get a new one */
52 gtxframe_ClearMessageLine(tframe
);
53 tframe
->flags
&= ~(GTXFRAME_RECURSIVEEND
| GTXFRAME_RECURSIVEERR
);
54 keymap_ProcessKey(tframe
->keystate
, tc
, awin
);
55 tframe
= awin
->w_frame
; /* in case command changed it */
56 if (tframe
->flags
& GTXFRAME_RECURSIVEEND
) {
57 tframe
->flags
&= ~GTXFRAME_RECURSIVEEND
;
60 tframe
->flags
&= ~GTXFRAME_RECURSIVEEND
;
61 WOP_DISPLAY(awin
); /* eventually calls gtxframe_Display */
67 gtx_Init(int astartInput
,
68 int atype
) /* type of window to create */
71 struct onode_initparams oi_params
; /* object init params */
72 struct gwin_initparams wi_params
; /* window initialization params */
76 /* setup the main window structure */
77 wi_params
.i_type
= GATOR_WIN_CURSES
;
80 wi_params
.i_width
= 80;
81 wi_params
.i_height
= 200;
82 wi_params
.i_debug
= 0; /* or 1 if we want debugging done */
85 * Set up the basic onode initialization parameters, throwing in
86 * the graphics-specific stuff.
88 oi_params
.i_debug
= 0; /* or 1 if we want debugging */
89 oi_params
.i_gwparams
= &wi_params
;
91 code
= gator_objects_init(&oi_params
);
95 /* if we start input thread */
96 IOMGR_Initialize(); /* input thread uses it */
99 LWP_CreateProcess(gtx_InputServer
, 8192, LWP_NORMAL_PRIORITY
,
100 (void *)0, "gx-listener", &junk
);
102 twin
= &gator_basegwin
;