aboutsummaryrefslogtreecommitdiff
path: root/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@secunet.com>2011-07-07 15:41:53 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-08-04 08:10:41 +0200
commit3b77b723ca209199c8a224702812441e2196d452 (patch)
treecbf3be2c724139ec80a33dbf8e002b7871ef9307 /payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h
parent1ac19e28eed4f6c53a4f295eb55500c65fc80f8d (diff)
libpayload: Add PDCurses and ncurses' libform/libmenu
PDCurses provides an alternative implementation of the curses library standard in addition to tinycurses. Where tinycurses is really tiny, PDCurses is more complete and provides virtually unlimited windows and the full API. The PDCurses code is brought in "vanilla", with all local changes residing in curses/pdcurses-backend/ In addition to a curses library, this change also provides libpanel (as part of the PDCurses code), and libform and libmenu which were derived from ncurses-5.9. As they rely on ncurses internals (and PDCurses is not ncurses), more changes were required for these libraries to work. The build system is extended to install the right set of header files depending on the selected curses implementation. Change-Id: I9e5b920f94b6510da01da2f656196a993170d1c5 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/106 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marcj303@gmail.com>
Diffstat (limited to 'payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h')
-rw-r--r--payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h188
1 files changed, 188 insertions, 0 deletions
diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h
new file mode 100644
index 0000000000..0b66c8809e
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h
@@ -0,0 +1,188 @@
+/* Public Domain Curses */
+
+/* $Id: pdcx11.h,v 1.64 2008/07/14 04:24:52 wmcbrine Exp $ */
+
+#include <curspriv.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <signal.h>
+#include <ctype.h>
+#include <pwd.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h> /* AIX needs this for FD_ZERO etc macros */
+#endif
+#include <sys/ipc.h>
+#include <sys/shm.h>
+
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#include <Intrinsic.h>
+#include <StringDefs.h>
+#include <Shell.h>
+
+#ifdef USE_XAW3D
+# include <Xaw3d/Box.h>
+# include <Xaw3d/Scrollbar.h>
+#elif defined(USE_NEXTAW)
+# include <neXtaw/Box.h>
+# include <neXtaw/Scrollbar.h>
+#else
+# include <Xaw/Box.h>
+# include <Xaw/Scrollbar.h>
+#endif
+#include "x11/ScrollBox.h"
+
+#include "Xmu/StdSel.h"
+#include "Xmu/Atoms.h"
+
+#include <keysym.h>
+#include <Xatom.h>
+
+#define XCURSCR_Y_SIZE (XCursesLINES * XCursesCOLS * sizeof(chtype))
+#define XCURSCR_FLAG_SIZE (XCursesLINES * sizeof(int))
+#define XCURSCR_START_SIZE (XCursesLINES * sizeof(int))
+#define XCURSCR_LENGTH_SIZE (XCursesLINES * sizeof(int))
+#define XCURSCR_ATRTAB_SIZE (PDC_COLOR_PAIRS * 2 * sizeof(short))
+#define XCURSCR_SIZE (XCURSCR_FLAG_SIZE + XCURSCR_START_SIZE + \
+ XCURSCR_LENGTH_SIZE + XCURSCR_Y_SIZE + XCURSCR_ATRTAB_SIZE + \
+ sizeof(XColor))
+
+#define XCURSCR_Y_OFF(y) ((y) * XCursesCOLS * sizeof(chtype))
+#define XCURSCR_FLAG_OFF (XCURSCR_Y_OFF(0) + XCURSCR_Y_SIZE)
+#define XCURSCR_START_OFF (XCURSCR_FLAG_OFF + XCURSCR_FLAG_SIZE)
+#define XCURSCR_LENGTH_OFF (XCURSCR_START_OFF + XCURSCR_START_SIZE)
+#define XCURSCR_ATRTAB_OFF (XCURSCR_LENGTH_OFF + XCURSCR_LENGTH_SIZE)
+#define XCURSCR_XCOLOR_OFF (XCURSCR_ATRTAB_OFF + XCURSCR_ATRTAB_SIZE)
+
+typedef struct
+{
+ int lines;
+ int cols;
+ Pixel cursorColor;
+ Pixel colorBlack;
+ Pixel colorRed;
+ Pixel colorGreen;
+ Pixel colorYellow;
+ Pixel colorBlue;
+ Pixel colorMagenta;
+ Pixel colorCyan;
+ Pixel colorWhite;
+ Pixel colorBoldBlack;
+ Pixel colorBoldRed;
+ Pixel colorBoldGreen;
+ Pixel colorBoldYellow;
+ Pixel colorBoldBlue;
+ Pixel colorBoldMagenta;
+ Pixel colorBoldCyan;
+ Pixel colorBoldWhite;
+ Pixel pointerForeColor;
+ Pixel pointerBackColor;
+ XFontStruct *normalFont;
+ XFontStruct *italicFont;
+ char *bitmap;
+#ifdef HAVE_XPM_H
+ char *pixmap;
+#endif
+ char *composeKey;
+ Cursor pointer;
+ int shmmin;
+ int borderWidth;
+ int borderColor;
+ int clickPeriod;
+ int doubleClickPeriod;
+ int scrollbarWidth;
+ int cursorBlinkRate;
+ char *textCursor;
+} XCursesAppData;
+
+extern XCursesAppData xc_app_data;
+
+#define XCURSESSHMMIN xc_app_data.shmmin
+
+#define XCLOGMSG (XCursesProcess ? " X" : "CURSES")
+
+void XC_get_line_lock(int);
+void XC_release_line_lock(int);
+
+int PDC_display_cursor(int, int, int, int, int);
+
+void XCursesExitCursesProcess(int, char *);
+int XCursesInstruct(int);
+int XCursesInstructAndWait(int);
+int XCursesInitscr(int, char **);
+
+int XC_write_socket(int, const void *, int);
+int XC_read_socket(int, void *, int);
+int XC_write_display_socket_int(int);
+
+int XCursesSetupX(int argc, char *argv[]);
+RETSIGTYPE XCursesSigwinchHandler(int signo);
+
+#ifdef _HPUX_SOURCE
+# define FD_SET_CAST int *
+#else
+# define FD_SET_CAST fd_set *
+#endif
+
+extern fd_set xc_readfds;
+
+extern unsigned char *Xcurscr;
+extern int XCursesProcess;
+extern int shmidSP;
+extern int shmid_Xcurscr;
+extern int shmkeySP;
+extern int shmkey_Xcurscr;
+extern int xc_otherpid;
+extern int XCursesLINES;
+extern int XCursesCOLS;
+extern int xc_display_sock;
+extern int xc_key_sock;
+extern int xc_display_sockets[2];
+extern int xc_key_sockets[2];
+extern int xc_exit_sock;
+
+typedef RETSIGTYPE (*signal_handler)();
+
+signal_handler XCursesSetSignal(int, signal_handler);
+
+#ifdef PDCDEBUG
+void XC_say(const char *msg);
+# define XC_LOG(x) XC_say x
+#else
+# define XC_LOG(x)
+#endif
+
+#ifdef MOUSE_DEBUG
+# define MOUSE_LOG(x) printf x
+#else
+# define MOUSE_LOG(x)
+#endif
+
+enum
+{
+ CURSES_CLEAR_SELECTION, CURSES_DISPLAY_CURSOR, CURSES_SET_SELECTION,
+ CURSES_GET_SELECTION, CURSES_TITLE, CURSES_REFRESH_SCROLLBAR,
+ CURSES_RESIZE, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR,
+ CURSES_CHILD, CURSES_REFRESH, CURSES_GET_COLOR, CURSES_SET_COLOR,
+ CURSES_EXIT
+};
+
+extern short *xc_atrtab;