1 /* Public Domain Curses */
3 /* $Id: pdcx11.h,v 1.64 2008/07/14 04:24:52 wmcbrine Exp $ */
15 #include <sys/types.h>
16 #include <sys/socket.h>
20 #ifdef HAVE_SYS_SELECT_H
21 # include <sys/select.h> /* AIX needs this for FD_ZERO etc macros */
26 #ifdef TIME_WITH_SYS_TIME
27 # include <sys/time.h>
30 # ifdef HAVE_SYS_TIME_H
31 # include <sys/time.h>
37 #include <Intrinsic.h>
38 #include <StringDefs.h>
42 # include <Xaw3d/Box.h>
43 # include <Xaw3d/Scrollbar.h>
44 #elif defined(USE_NEXTAW)
45 # include <neXtaw/Box.h>
46 # include <neXtaw/Scrollbar.h>
49 # include <Xaw/Scrollbar.h>
51 #include "x11/ScrollBox.h"
53 #include "Xmu/StdSel.h"
54 #include "Xmu/Atoms.h"
59 #define XCURSCR_Y_SIZE (XCursesLINES * XCursesCOLS * sizeof(chtype))
60 #define XCURSCR_FLAG_SIZE (XCursesLINES * sizeof(int))
61 #define XCURSCR_START_SIZE (XCursesLINES * sizeof(int))
62 #define XCURSCR_LENGTH_SIZE (XCursesLINES * sizeof(int))
63 #define XCURSCR_ATRTAB_SIZE (PDC_COLOR_PAIRS * 2 * sizeof(short))
64 #define XCURSCR_SIZE (XCURSCR_FLAG_SIZE + XCURSCR_START_SIZE + \
65 XCURSCR_LENGTH_SIZE + XCURSCR_Y_SIZE + XCURSCR_ATRTAB_SIZE + \
68 #define XCURSCR_Y_OFF(y) ((y) * XCursesCOLS * sizeof(chtype))
69 #define XCURSCR_FLAG_OFF (XCURSCR_Y_OFF(0) + XCURSCR_Y_SIZE)
70 #define XCURSCR_START_OFF (XCURSCR_FLAG_OFF + XCURSCR_FLAG_SIZE)
71 #define XCURSCR_LENGTH_OFF (XCURSCR_START_OFF + XCURSCR_START_SIZE)
72 #define XCURSCR_ATRTAB_OFF (XCURSCR_LENGTH_OFF + XCURSCR_LENGTH_SIZE)
73 #define XCURSCR_XCOLOR_OFF (XCURSCR_ATRTAB_OFF + XCURSCR_ATRTAB_SIZE)
91 Pixel colorBoldYellow
;
93 Pixel colorBoldMagenta
;
96 Pixel pointerForeColor
;
97 Pixel pointerBackColor
;
98 XFontStruct
*normalFont
;
99 XFontStruct
*italicFont
;
110 int doubleClickPeriod
;
116 extern XCursesAppData xc_app_data
;
118 #define XCURSESSHMMIN xc_app_data.shmmin
120 #define XCLOGMSG (XCursesProcess ? " X" : "CURSES")
122 void XC_get_line_lock(int);
123 void XC_release_line_lock(int);
125 int PDC_display_cursor(int, int, int, int, int);
127 void XCursesExitCursesProcess(int, char *);
128 int XCursesInstruct(int);
129 int XCursesInstructAndWait(int);
130 int XCursesInitscr(int, char **);
132 int XC_write_socket(int, const void *, int);
133 int XC_read_socket(int, void *, int);
134 int XC_write_display_socket_int(int);
136 int XCursesSetupX(int argc
, char *argv
[]);
137 RETSIGTYPE
XCursesSigwinchHandler(int signo
);
140 # define FD_SET_CAST int *
142 # define FD_SET_CAST fd_set *
145 extern fd_set xc_readfds
;
147 extern unsigned char *Xcurscr
;
148 extern int XCursesProcess
;
150 extern int shmid_Xcurscr
;
152 extern int shmkey_Xcurscr
;
153 extern int xc_otherpid
;
154 extern int XCursesLINES
;
155 extern int XCursesCOLS
;
156 extern int xc_display_sock
;
157 extern int xc_key_sock
;
158 extern int xc_display_sockets
[2];
159 extern int xc_key_sockets
[2];
160 extern int xc_exit_sock
;
162 typedef RETSIGTYPE (*signal_handler
)();
164 signal_handler
XCursesSetSignal(int, signal_handler
);
167 void XC_say(const char *msg
);
168 # define XC_LOG(x) XC_say x
174 # define MOUSE_LOG(x) printf x
176 # define MOUSE_LOG(x)
181 CURSES_CLEAR_SELECTION
, CURSES_DISPLAY_CURSOR
, CURSES_SET_SELECTION
,
182 CURSES_GET_SELECTION
, CURSES_TITLE
, CURSES_REFRESH_SCROLLBAR
,
183 CURSES_RESIZE
, CURSES_BELL
, CURSES_CONTINUE
, CURSES_CURSOR
,
184 CURSES_CHILD
, CURSES_REFRESH
, CURSES_GET_COLOR
, CURSES_SET_COLOR
,
188 extern short *xc_atrtab
;