]> git.ipfire.org Git - thirdparty/newt.git/blob - newt_pr.h
1) got scrollbars working w/ gridded text widgets
[thirdparty/newt.git] / newt_pr.h
1 #ifndef H_NEWT_PR
2 #define H_NEWT_PR
3
4 #define COLORSET_ROOT NEWT_COLORSET_ROOT
5 #define COLORSET_BORDER NEWT_COLORSET_BORDER
6 #define COLORSET_WINDOW NEWT_COLORSET_WINDOW
7 #define COLORSET_SHADOW NEWT_COLORSET_SHADOW
8 #define COLORSET_TITLE NEWT_COLORSET_TITLE
9 #define COLORSET_BUTTON NEWT_COLORSET_BUTTON
10 #define COLORSET_ACTBUTTON NEWT_COLORSET_ACTBUTTON
11 #define COLORSET_CHECKBOX NEWT_COLORSET_CHECKBOX
12 #define COLORSET_ACTCHECKBOX NEWT_COLORSET_ACTCHECKBOX
13 #define COLORSET_ENTRY NEWT_COLORSET_ENTRY
14 #define COLORSET_LABEL NEWT_COLORSET_LABEL
15 #define COLORSET_LISTBOX NEWT_COLORSET_LISTBOX
16 #define COLORSET_ACTLISTBOX NEWT_COLORSET_ACTLISTBOX
17 #define COLORSET_TEXTBOX NEWT_COLORSET_TEXTBOX
18 #define COLORSET_ACTTEXTBOX NEWT_COLORSET_ACTTEXTBOX
19
20 int newtSetFlags(int oldFlags, int newFlags, enum newtFlagsSense sense);
21
22 void newtGotorc(int row, int col);
23 void newtGetrc(int * row, int * col);
24 void newtDrawBox(int left, int top, int width, int height, int shadow);
25 void newtClearBox(int left, int top, int width, int height);
26
27 int newtGetKey(void);
28
29 struct newtComponent_struct {
30 /* common data */
31 int height, width;
32 int top, left;
33 int takesFocus;
34 int isMapped;
35
36 struct componentOps * ops;
37
38 newtCallback callback;
39 void * callbackData;
40
41 void * data;
42 } ;
43
44 enum eventResultTypes { ER_IGNORED, ER_SWALLOWED, ER_EXITFORM, ER_SETFOCUS,
45 ER_NEXTCOMP };
46 struct eventResult {
47 enum eventResultTypes result;
48 union {
49 newtComponent focus;
50 } u;
51 };
52
53 enum eventTypes { EV_FOCUS, EV_UNFOCUS, EV_KEYPRESS };
54 enum eventSequence { EV_EARLY, EV_NORMAL, EV_LATE };
55
56 struct event {
57 enum eventTypes event;
58 enum eventSequence when;
59 union {
60 int key;
61 } u;
62 } ;
63
64 struct componentOps {
65 void (* draw)(newtComponent c);
66 struct eventResult (* event)(newtComponent c, struct event ev);
67 void (* destroy)(newtComponent c);
68 void (* place)(newtComponent c, int newLeft, int newTop);
69 void (* mapped)(newtComponent c, int isMapped);
70 } ;
71
72 void newtDefaultPlaceHandler(newtComponent c, int newLeft, int newTop);
73 void newtDefaultMappedHandler(newtComponent c, int isMapped);
74 struct eventResult newtDefaultEventHandler(newtComponent c,
75 struct event ev);
76
77 #endif /* H_NEWT_PR */