Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / gtx / gtxframe.h
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
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
8 */
9
10 #ifndef __GTX_FRAME_INCL_
11 #define __GTX_FRAME_INCL_ 1
12 struct gtxframe_dlist {
13 struct gtxframe_dlist *next;
14 char *data;
15 };
16
17 struct gtxframe_menu {
18 struct gtxframe_menu *next;
19 char *name;
20 char *cmdString;
21 };
22
23 struct gtx_frame {
24 struct keymap_map *keymap; /*Map for handling keystrokes */
25 struct keymap_map *savemap; /* Map saved during recursive edit */
26 struct keymap_state *keystate; /*Associated key state */
27 struct gtxframe_dlist *display; /*Display list */
28 struct gtxframe_menu *menus; /* Menu list */
29 char *messageLine; /* message line */
30 char *promptLine; /* prompt for a response */
31 char *defaultLine; /* default response */
32 struct gwin *window; /* window we're currently showing on */
33 int flags;
34 };
35
36 #define GTXFRAME_NEWDISPLAY 1 /* just did a display string this command */
37 #define GTXFRAME_RECURSIVEEND 2 /* end recursive edit */
38 #define GTXFRAME_RECURSIVEERR 4 /* recursive edit failed due to error */
39
40 extern int gtxframe_SetFrame(struct gwin *awin, struct gtx_frame *aframe);
41 extern struct gtx_frame *gtxframe_GetFrame(struct gwin *);
42 extern int gtxframe_AddMenu(struct gtx_frame *aframe, char *alabel,
43 char *astring);
44 extern int gtxframe_DeleteMenu(struct gtx_frame *aframe, char *alabel);
45 extern int gtxframe_ClearMenus(struct gtx_frame *aframe);
46 extern int gtxframe_AskForString(struct gtx_frame *aframe, char *aprompt,
47 char *adefault, char *aresult,
48 int aresultSize);
49 extern int gtxframe_DisplayString(struct gtx_frame *, char *);
50 extern int gtxframe_ClearMessageLine(struct gtx_frame *aframe);
51 extern struct gtx_frame *gtxframe_Create(void);
52 extern int gtxframe_Delete(struct gtx_frame *aframe);
53 extern int gtxframe_Display(struct gtx_frame *aframe, struct gwin *awm);
54 extern int gtxframe_AddToList(struct gtx_frame *aframe, struct onode *aobj);
55 extern int gtxframe_RemoveFromList(struct gtx_frame *aframe,
56 struct onode *aobj);
57 extern int gtxframe_ClearList(struct gtx_frame *aframe);
58
59 /*
60 * The gtxframe_ExitCmd() routine, normally bound to ^C, allows a caller
61 * to cleanly exit from its gtx environment, returning the terminal or
62 * window to its normal state. If a non-zero exit value is desired, then
63 * the caller should place it in gtxframe_exitValue.
64 */
65 extern int gtxframe_ExitCmd(void *, void *);
66 extern int gtxframe_exitValue;
67
68 #endif /* __GTX_FRAME_INCL_ */