ca9b40fd7cf2b2e1be856a7fbb659bef8765f67a
[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_SetFlags(tAxWin3_Widget *Widget, int FlagSet, int FlagMask);
25 extern void     AxWin3_Widget_SetSize(tAxWin3_Widget *Widget, int Size);
26 extern void     AxWin3_Widget_SetText(tAxWin3_Widget *Widget, const char *Text);
27 extern void     AxWin3_Widget_SetColour(tAxWin3_Widget *Widget, int Index, tAxWin3_Colour Colour);
28
29 enum eElementTypes
30 {
31         ELETYPE_NONE,
32
33         ELETYPE_BOX,    //!< Content box (invisible in itself)
34         ELETYPE_TEXT,   //!< Text
35         ELETYPE_IMAGE,  //!< Image
36         ELETYPE_BUTTON, //!< Push Button
37         ELETYPE_SPACER, //!< Visual Spacer (horizontal / vertical rule)
38
39         ELETYPE_TABBAR, //!< Tab Bar
40         ELETYPE_TOOLBAR,        //!< Tool Bar
41         
42         NUM_ELETYPES
43 };
44
45 enum eElementFlags
46 {
47         /**
48          * \brief Rendered
49          * 
50          * If set, the element will be ignored in calculating sizes and
51          * rendering.
52          */
53         ELEFLAG_NORENDER    = 0x001,
54         /**
55          * \brief Element visibility
56          * 
57          * If set, the element is not drawn (but still is used for size calculations)
58          */
59         ELEFLAG_INVISIBLE   = 0x002,
60         
61         /**
62          * \brief Position an element absulutely (ignored in size calcs)
63          */
64         ELEFLAG_ABSOLUTEPOS = 0x004,
65         
66         /**
67          * \brief Fixed size element
68          */
69         ELEFLAG_FIXEDSIZE   = 0x008,
70         
71         /**
72          * \brief Element "orientation"
73          * 
74          * Vertical means that the children of this element are stacked,
75          * otherwise they list horizontally
76          */
77         ELEFLAG_VERTICAL    = 0x010,//  ELEFLAG_HORIZONTAL  = 0x000,
78         /**
79          * \brief Action for text that overflows
80          */
81         ELEFLAG_WRAP        = 0x020,//  ELEFLAG_NOWRAP      = 0x000,
82         /**
83          * \brief Cross size action
84          * 
85          * If this flag is set, the element will only be as large (across
86          * its parent) as is needed to encase the contents of the element.
87          * Otherwise, the element will expand to fill all avaliable space.
88          */
89         ELEFLAG_NOEXPAND    = 0x040,
90         
91         /**
92          * \brief With (length) size action
93          * If this flag is set, the element will only be as large as
94          * is required along it's parent
95          */
96         ELEFLAG_NOSTRETCH   = 0x080,
97         
98         /**
99          * \brief Center alignment
100          */
101         ELEFLAG_ALIGN_CENTER= 0x100,
102         /**
103          * \brief Right/Bottom alignment
104          * 
105          * If set, the element aligns to the end of avaliable space (instead
106          * of the beginning)
107          */
108         ELEFLAG_ALIGN_END       = 0x200
109 };
110
111
112 #endif
113

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