Usermode/AxWin3 - Added window invalidation, sub-windows render now
[tpg/acess2.git] / Usermode / include / axwin3 / widget.h
1 /*
2  * Acess2 GUI Version 3 (AxWin3)
3  * - By John Hodge (thePowersGang)
4  *
5  * widget.h
6  * - Server-side widget library
7  */
8 #ifndef _AXWIN3_WIDGET_H_
9 #define _AXWIN3_WIDGET_H_
10
11 #include "axwin.h"
12
13 typedef struct sAxWin3_Widget   tAxWin3_Widget;
14
15 typedef int     (*tAxWin3_Widget_Callback)(tAxWin3_Widget Widget, int EventType, unsigned long EventArg);
16
17 extern tHWND    AxWin3_Widget_CreateWindow(tHWND Parent, int W, int H, int RootEleFlags);
18 extern void     AxWin3_Widget_DestroyWindow(tHWND Window);
19 extern tAxWin3_Widget   *AxWin3_Widget_GetRoot(tHWND Window);
20
21 extern tAxWin3_Widget   *AxWin3_Widget_AddWidget(tAxWin3_Widget *Parent, int Type, int Flags, const char *DebugName);
22 extern void     AxWin3_Widget_DelWidget(tAxWin3_Widget *Widget);
23
24 extern void     AxWin3_Widget_SetSize(tAxWin3_Widget *Widget, int Size);
25 extern void     AxWin3_Widget_SetText(tAxWin3_Widget *Widget, const char *Text);
26 extern void     AxWin3_Widget_SetColour(tAxWin3_Widget *Widget, int Index, tAxWin3_Colour Colour);
27
28 enum eElementTypes
29 {
30         ELETYPE_NONE,
31
32         ELETYPE_WINDOW, //!< Window root element
33         
34         ELETYPE_BOX,    //!< Content box (invisible in itself)
35         ELETYPE_TABBAR, //!< Tab Bar
36         ELETYPE_TOOLBAR,        //!< Tool Bar
37         
38         ELETYPE_BUTTON, //!< Push Button
39         
40         ELETYPE_TEXT,   //!< Text
41         ELETYPE_IMAGE,  //!< Image
42         
43         ELETYPE_SPACER, //!< Visual Spacer (horizontal / vertical rule)
44         
45         MAX_ELETYPES    = 0x100
46 };
47
48 enum eElementFlags
49 {
50         /**
51          * \brief Rendered
52          * 
53          * If set, the element will be ignored in calculating sizes and
54          * rendering.
55          */
56         ELEFLAG_NORENDER    = 0x001,
57         /**
58          * \brief Element visibility
59          * 
60          * If set, the element is not drawn (but still is used for size calculations)
61          */
62         ELEFLAG_INVISIBLE   = 0x002,
63         
64         /**
65          * \brief Position an element absulutely (ignored in size calcs)
66          */
67         ELEFLAG_ABSOLUTEPOS = 0x004,
68         
69         /**
70          * \brief Fixed size element
71          */
72         ELEFLAG_FIXEDSIZE   = 0x008,
73         
74         /**
75          * \brief Element "orientation"
76          * 
77          * Vertical means that the children of this element are stacked,
78          * otherwise they list horizontally
79          */
80         ELEFLAG_VERTICAL    = 0x010,//  ELEFLAG_HORIZONTAL  = 0x000,
81         /**
82          * \brief Action for text that overflows
83          */
84         ELEFLAG_WRAP        = 0x020,//  ELEFLAG_NOWRAP      = 0x000,
85         /**
86          * \brief Cross size action
87          * 
88          * If this flag is set, the element will only be as large (across
89          * its parent) as is needed to encase the contents of the element.
90          * Otherwise, the element will expand to fill all avaliable space.
91          */
92         ELEFLAG_NOEXPAND    = 0x040,
93         
94         /**
95          * \brief With (length) size action
96          * If this flag is set, the element will only be as large as
97          * is required along it's parent
98          */
99         ELEFLAG_NOSTRETCH   = 0x080,
100         
101         /**
102          * \brief Center alignment
103          */
104         ELEFLAG_ALIGN_CENTER= 0x100,
105         /**
106          * \brief Right/Bottom alignment
107          * 
108          * If set, the element aligns to the end of avaliable space (instead
109          * of the beginning)
110          */
111         ELEFLAG_ALIGN_END       = 0x200
112 };
113
114
115 #endif
116

UCC git Repository :: git.ucc.asn.au