static void buttonDraw(newtComponent c);
static void buttonDestroy(newtComponent co);
-static struct eventResult buttonEvent(struct newtComponent * c,
+static struct eventResult buttonEvent(newtComponent c,
struct event ev);
static struct componentOps buttonOps = {
SLsmg_write_char(' ');
}
-static struct eventResult buttonEvent(struct newtComponent * co,
+static struct eventResult buttonEvent(newtComponent co,
struct event ev) {
struct eventResult er;
static void cbDraw(newtComponent c);
static void cbDestroy(newtComponent co);
-struct eventResult cbEvent(struct newtComponent * co, struct event ev);
+struct eventResult cbEvent(newtComponent co, struct event ev);
static struct componentOps cbOps = {
cbDraw,
free(co);
}
-struct eventResult cbEvent(struct newtComponent * co, struct event ev) {
+struct eventResult cbEvent(newtComponent co, struct event ev) {
struct checkbox * cb = co->data;
struct eventResult er;
char * cur;
static void entryDraw(newtComponent co);
static void entryDestroy(newtComponent co);
-static struct eventResult entryEvent(struct newtComponent * co,
+static struct eventResult entryEvent(newtComponent co,
struct event ev);
-static struct eventResult entryHandleKey(struct newtComponent * co, int key);
+static struct eventResult entryHandleKey(newtComponent co, int key);
static struct componentOps entryOps = {
entryDraw,
free(co);
}
-static struct eventResult entryEvent(struct newtComponent * co,
+static struct eventResult entryEvent(newtComponent co,
struct event ev) {
struct entry * en = co->data;
struct eventResult er;
return er;
}
-static struct eventResult entryHandleKey(struct newtComponent * co, int key) {
+static struct eventResult entryHandleKey(newtComponent co, int key) {
struct entry * en = co->data;
struct eventResult er;
char * chptr, * insPoint;
select(0, &set, &set, &set, &tv);
}
-struct eventResult newtDefaultEventHandler(struct newtComponent * c,
+struct eventResult newtDefaultEventHandler(newtComponent c,
struct event ev) {
struct eventResult er;
#ifndef H_NEWT
#define H_NEWT
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define NEWT_COLORSET_ROOT 2
#define NEWT_COLORSET_BORDER 3
#define NEWT_COLORSET_WINDOW 4
char * disabledEntryFg, * disabledEntryBg;
};
-typedef struct newtComponent * newtComponent;
+typedef struct newtComponent_struct * newtComponent;
extern struct newtColors newtDefaultColorPalette;
#define NEWT_KEY_F11 NEWT_KEY_EXTRA_BASE + 111
#define NEWT_KEY_F12 NEWT_KEY_EXTRA_BASE + 112
+#ifdef __cplusplus
+} /* End of extern "C" { */
+#endif
+
#endif /* H_NEWT */
int newtGetKey(void);
-struct newtComponent {
+struct newtComponent_struct {
/* common data */
int height, width;
int top, left;
} ;
struct componentOps {
- void (* draw)(struct newtComponent * c);
- struct eventResult (* event)(struct newtComponent * c, struct event ev);
- void (* destroy)(struct newtComponent * c);
+ void (* draw)(newtComponent c);
+ struct eventResult (* event)(newtComponent c, struct event ev);
+ void (* destroy)(newtComponent c);
} ;
-struct eventResult newtDefaultEventHandler(struct newtComponent * c,
+struct eventResult newtDefaultEventHandler(newtComponent c,
struct event ev);
#endif /* H_NEWT_PR */
static void addLine(newtComponent co, const char * s, int len);
static void textboxDraw(newtComponent co);
static void addShortLine(newtComponent co, const char * s, int len);
-static struct eventResult textboxEvent(struct newtComponent * c,
+static struct eventResult textboxEvent(newtComponent c,
struct event ev);
static void textboxDestroy(newtComponent co);
}
}
-static struct eventResult textboxEvent(struct newtComponent * co,
+static struct eventResult textboxEvent(newtComponent co,
struct event ev) {
struct textbox * tb = co->data;
struct eventResult er;