|
|
1.1 root 1: /*
2: * HEADER file for windows library
3: *
4: * Copyright (c) 1990-93 by Udo Munk
5: */
6:
7: /* ------------------------------------------------------------------------ */
8:
9: /*
10: * Define additional control codes for terminals where
11: * used function keys are missing
12: */
13: #define W_KEY_REFR 0x0c /* CNTL-L: refresh */
14: #define W_KEY_NPAGE 0x0e /* CNTL-N: next page */
15: #define W_KEY_PPAGE 0x10 /* CNTL-P: previous page */
16: #define W_KEY_HOME 0x01 /* CNTL-A: begin of list/field */
17: #define W_KEY_LL 0x05 /* CNTL-E: end of list/field */
18: #define W_KEY_DC 0x04 /* CNTL-D: remove character under cursor */
19: #define W_KEY_DL 0x15 /* CNTL-U: remove the whole input */
20: #define W_KEY_IC 0x09 /* CNTL-I: insert character/line */
21:
22: #define W_KEY_TAB 0x09 /* CNTL-I: TAB, go to next field */
23: #define W_KEY_BTAB 0x02 /* CNTL-B: back-TAB, go to previous field */
24:
25: /* ------------------------------------------------------------------------ */
26:
27: /*
28: * return values of the library functions
29: */
30: #define WIN_OK 0 /* function executed */
31: #define WIN_ABORT 94 /* function aborted */
32: #define WIN_PREVFIE 95 /* dialog: previous field */
33: #define WIN_NEXTFIE 96 /* dialog: next field */
34: #define WIN_PREVMEN 97 /* pulldown menu: left */
35: #define WIN_NEXTMEN 98 /* pulldown menu: right */
36: #define WIN_ERR 99 /* error in function */
37:
38: /* ------------------------------------------------------------------------ */
39:
40: /*
41: * list of curses windows
42: */
43: typedef struct w_list {
44: WINDOW *w_w; /* pointer to curses window */
45: struct w_list *w_next; /* pointer to next entry of the list */
46: } W_LIST;
47:
48: /* ------------------------------------------------------------------------ */
49:
50: /*
51: * structure of one entry in pulldown menus
52: */
53: struct menu {
54: char *m_text; /* text of this menu line */
55: int m_opt; /* number of character to select this entry */
56: };
57:
58: /* ------------------------------------------------------------------------ */
59:
60: #define MAXGRP 4 /* max number of groups in button box */
61: #define MAXBUT 3 /* max number of buttons in one group */
62:
63: /*
64: * structure of one button
65: */
66: struct button {
67: char *b_text; /* label of the button */
68: int b_val; /* value of the button */
69: };
70:
71: /*
72: * structure of a group of buttons
73: */
74: struct bgroup {
75: char *g_text; /* title of the group */
76: int g_anz; /* number of buttons in the group */
77: struct button *g_ptr[MAXBUT];/* pointers to the button structs */
78: };
79:
80: /*
81: * structure of a button box
82: */
83: struct bbox {
84: char *b_text; /* title of the box */
85: int b_anz; /* number of groups in the box */
86: struct bgroup *b_ptr[MAXGRP];/* pointers to the group structs */
87: };
88:
89: /* ------------------------------------------------------------------------ */
90:
91: #define MAXELM 2 /* max number of elements per dialog */
92:
93: #define FIELD 1 /* type of element: input field */
94:
95: /*
96: * structure of a element
97: */
98: struct delem {
99: char e_typ; /* typ of element */
100: char *e_text; /* label of element */
101: int e_len; /* size of input field */
102: char *e_data; /* pointer to memory for input */
103: };
104:
105: /*
106: * structure of a dialog
107: */
108: struct dial {
109: char *d_text; /* title of the dialog */
110: int d_anz; /* number of elements */
111: struct delem *d_ptr[MAXELM];/* pointers to the elements */
112: };
113:
114: /* ------------------------------------------------------------------------ */
115:
116: /*
117: * structure of a scrollbar
118: */
119: typedef struct scrollbar {
120: WINDOW *sc_window; /* curses window for scrollbar */
121: int sc_size; /* high of the scrollbar */
122: int sc_position; /* position of the slider */
123: } SCROLLBAR;
124:
125: /* ------------------------------------------------------------------------ */
126:
127: /*
128: * structure of a list box
129: */
130: typedef struct listbox {
131: char *l_text; /* title of the box */
132: int l_rows; /* no. of rows of the list */
133: int l_cols; /* no. of columns of the list */
134: int l_vbar; /* flag: list with vertical scroll bar? */
135: WINDOW *wb; /* window for the whole box */
136: WINDOW *wl; /* window for the list */
137: SCROLLBAR *bar; /* scrollbar for list */
138: } LISTBOX;
139:
140: /* ------------------------------------------------------------------------ */
141:
142: #define PFKLABLEN 6 /* size of a function key label */
143:
144: /*
145: * structure of a function key
146: */
147: struct pfkey {
148: char label[PFKLABLEN+1];/* label of the function key */
149: char *cmd; /* configurated command */
150: };
151:
152: /* ------------------------------------------------------------------------ */
153:
154: /*
155: * import graphics character set
156: */
157: extern chtype ul_corner, ur_corner, ll_corner, lr_corner;
158: extern chtype r_tee, l_tee, b_tee, t_tee;
159: extern chtype h_line, v_line;
160: extern chtype u_arrow, d_arrow, checkboard, fullboard;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.