Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 109 lines (99 sloc) 3.982 kb
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
1 /* gui.h */
2 /* Copyright 1995 by Steve Kirkendall */
3
4
5 /* generic pointer to GUI-specific window information */
6 typedef void GUIWIN;
7
8 /* structs of this type are used to describe each available GUI */
9 typedef struct gui_s
10 {
11 char *name;
12 char *desc;
13 BOOLEAN exonly;
14 BOOLEAN newblank;
15 BOOLEAN minimizeclr;
16 BOOLEAN scrolllast;
17 BOOLEAN shiftrows;
18 int movecost;
19 int nopts;
20 OPTDESC *optdescs;
21 int (*test) P_((void));
22 int (*init) P_((int argc, char **argv));
23 void (*usage) P_((void));
24 void (*loop) P_((void));
25 BOOLEAN (*poll) P_((BOOLEAN reset));
26 void (*term) P_((void));
27 BOOLEAN (*creategw) P_((char *name, char *attributes));
28 void (*destroygw) P_((GUIWIN *gw, BOOLEAN force));
29 BOOLEAN (*focusgw) P_((GUIWIN *gw));
30 void (*retitle) P_((GUIWIN *gw, char *name));
31 void (*reset) P_((void));
32 void (*flush) P_((void));
33 void (*moveto) P_((GUIWIN *gw, int column, int row));
34 void (*draw) P_((GUIWIN *gw, _char_ font, CHAR *text, int len));
35 BOOLEAN (*shift) P_((GUIWIN *gw, int qty, int rows));
36 BOOLEAN (*scroll) P_((GUIWIN *gw, int qty, BOOLEAN notlast));
37 BOOLEAN (*clrtoeol) P_((GUIWIN *gw));
38 void (*textline) P_((GUIWIN *gw, CHAR *text, int len));
39 void (*beep) P_((GUIWIN *gw));
40 BOOLEAN (*msg) P_((GUIWIN *gw, MSGIMP imp, CHAR *text, int len));
41 void (*scrollbar) P_((GUIWIN *gw, long top, long bottom, long nlines));
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
42 BOOLEAN (*status) P_((GUIWIN *gw, CHAR *cmd, long line, long column, _CHAR_ learn, char *mode));
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
43 int (*keylabel) P_((CHAR *given, int givenlen, CHAR **label, CHAR **raw));
44 BOOLEAN (*clipopen) P_((BOOLEAN forwrite));
45 int (*clipwrite) P_((CHAR *text, int len));
46 int (*clipread) P_((CHAR *text, int len));
47 void (*clipclose) P_((void));
48 BOOLEAN (*color) P_((GUIWIN *gw, _char_ font, CHAR *fg, CHAR *bg));
49 BOOLEAN (*guicmd) P_((GUIWIN *gw, char *extra));
50 BOOLEAN (*tabcmd) P_((GUIWIN *gw, _CHAR_ key2, long count));
51 void (*save) P_((BUFFER buf, GUIWIN *gw));
52 int (*wildcard) P_((char *names, char *buf, int bufsize, BOOLEAN single));
53 BOOLEAN (*prgopen) P_((char *command, BOOLEAN willwrite, BOOLEAN willread));
54 int (*prgclose) P_((void));
55 RESULT (*stop) P_((BOOLEAN alwaysfork));
56 } GUI;
57
58
59
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
60 #if defined(GUI_TERMCAP) || defined(GUI_OPEN) || defined(GUI_VIO)
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
61 /* The "termcap" and "open" user interfaces use the following OS-dependent
62 * functions. These functions must be defined in "osXXXX/tcaphelp.c" if
63 * you're going to use "termcap" or "open".
64 */
65 BEGIN_EXTERNC
66 extern void ttyinit P_((void));
67 extern void ttyraw P_((char *erasekey));
68 extern void ttynormal P_((void));
69 extern void ttysuspend P_((void));
70 extern void ttyresume P_((BOOLEAN sendstr));
71 extern int ttyread P_((char *buf, int len, int timeout));
72 extern void ttywrite P_((char *buf, int len));
73 extern char *ttytermtype P_((void));
74 extern BOOLEAN ttysize P_((int *linesptr, int *colsptr));
75 extern BOOLEAN ttypoll P_((BOOLEAN reset));
76 extern RESULT ttystop P_((void));
77 extern GUIWIN *ttywindow P_((int ttyrow, int ttycol, int *winrow, int *wincol));
78 END_EXTERNC
79
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
80 /* These can be used for accessing the values of the tty options. */
81 extern struct ttygoptvals_s
82 {
83 OPTVAL term; /* string - terminal type */
84 OPTVAL ttyrows; /* number - rows of screen */
85 OPTVAL ttycolumns; /* number - columns of screen */
86 OPTVAL ttyunderline; /* boolean - whether colors and underline mix */
87 } ttygoptvals;
88 #define o_term ttygoptvals.term.value.string
89 #define o_ttyrows ttygoptvals.ttyrows.value.number
90 #define o_ttycolumns ttygoptvals.ttycolumns.value.number
91 #define o_ttyunderline ttygoptvals.ttyunderline.value.boolean
92
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
93 # ifdef NEED_SPEED_T
94 # include <termcap.h>
95 # else
96 extern char PC;
97 extern short ospeed; /* might be "speed_t" instead of "short" */
98 BEGIN_EXTERNC
99 extern int tgetent P_((char *, char *));
100 extern int tgetflag P_((char *));
101 extern int tgetnum P_((char *));
102 extern char *tgoto P_((char *, int, int));
103 extern char *tgetstr P_((char*, char**));
104 extern void tputs P_((char *, int, int (*)(int)));
105 END_EXTERNC
106 # endif /* !_POSIX_SOURCE */
107
108 #endif /* defined(GUI_TERMCAP) */
Something went wrong with that request. Please try again.