5 char * rootFg
, * rootBg
;
6 char * borderFg
, * borderBg
;
7 char * windowFg
, * windowBg
;
8 char * shadowFg
, * shadowBg
;
9 char * titleFg
, * titleBg
;
10 char * buttonFg
, * buttonBg
;
11 char * actButtonFg
, * actButtonBg
;
12 char * checkboxFg
, * checkboxBg
;
13 char * actCheckboxFg
, * actCheckboxBg
;
14 char * entryFg
, * entryBg
;
15 char * labelFg
, * labelBg
;
16 char * listboxFg
, * listboxBg
;
17 char * actListboxFg
, * actListboxBg
;
18 char * textboxFg
, * textboxBg
;
19 char * actTextboxFg
, * actTextboxBg
;
22 extern struct newtColors newtDefaultColorPalette
;
25 int newtFinished(void);
27 void newtWaitForKey(void);
28 void newtClearKeyBuffer(void);
29 void newtDelay(int usecs
);
30 /* top, left are *not* counting the border */
31 int newtOpenWindow(int left
, int top
, int width
, int height
,
33 void newtPopWindow(void);
34 void newtSetColors(struct newtColors colors
);
35 void newtRefresh(void);
39 typedef struct newtComponent
* newtComponent
;
41 newtComponent
newtButton(int left
, int top
, char * text
);
42 newtComponent
newtCheckbox(int left
, int top
, char * text
, char defValue
,
43 char * seq
, char * result
);
44 newtComponent
newtRadiobutton(int left
, int top
, char * text
, int isDefault
,
45 newtComponent prevButton
);
46 newtComponent
newtListitem(int left
, int top
, char * text
, int isDefault
,
47 newtComponent prevItem
);
49 newtComponent
newtLabel(int left
, int top
, char * text
);
50 newtComponent
newtVerticalScrollbar(int left
, int top
, int height
,
51 int normalColorset
, int thumbColorset
);
52 void newtScrollbarSet(newtComponent co
, int where
, int total
);
54 newtComponent
newtListbox(int left
, int top
, int height
, int flags
);
55 void newtListboxAddEntry(newtComponent co
, char * text
);
57 #define NEWT_TEXTBOX_WRAP (1 << 0)
58 #define NEWT_TEXTBOX_SCROLL (1 << 1)
60 newtComponent
newtTextbox(int left
, int top
, int with
, int height
, int flags
);
61 void newtTextboxSetText(newtComponent co
, const char * text
);
63 newtComponent
newtForm(newtComponent vertBar
);
64 void newtFormAddComponent(newtComponent form
, newtComponent co
);
65 void newtFormAddComponents(newtComponent form
, ...);
66 void newtFormSetHeight(newtComponent co
, int height
);
67 newtComponent
newtRunForm(newtComponent form
);
69 #define NEWT_ENTRY_SCROLL (1 << 0)
70 #define NEWT_ENTRY_HIDDEN (1 << 1)
72 newtComponent
newtEntry(int left
, int top
, char * initialValue
, int width
,
73 char ** resultPtr
, int flags
);
76 /* this also destroys all of the components (including other forms) on the
78 void newtFormDestroy(newtComponent form
);
82 #define NEWT_KEY_TAB '\t'
83 #define NEWT_KEY_ENTER '\r'
84 #define NEWT_KEY_RETURN NEWT_KEY_ENTER
86 #define NEWT_KEY_EXTRA_BASE 0x8000
87 #define NEWT_KEY_UP NEWT_KEY_EXTRA_BASE + 1
88 #define NEWT_KEY_DOWN NEWT_KEY_EXTRA_BASE + 2
89 #define NEWT_KEY_LEFT NEWT_KEY_EXTRA_BASE + 4
90 #define NEWT_KEY_RIGHT NEWT_KEY_EXTRA_BASE + 5
91 #define NEWT_KEY_BKSPC NEWT_KEY_EXTRA_BASE + 6
92 #define NEWT_KEY_DELETE NEWT_KEY_EXTRA_BASE + 7
93 #define NEWT_KEY_HOME NEWT_KEY_EXTRA_BASE + 8
94 #define NEWT_KEY_END NEWT_KEY_EXTRA_BASE + 9
95 #define NEWT_KEY_UNTAB NEWT_KEY_EXTRA_BASE + 10