77db620a991d9b6802d05a957ff9709200315afb
[tpg/acess2.git] / Usermode / Libraries / libaxwin2.so_src / include_exp / axwin2 / axwin.h
1 /**
2  * \file axwin2/axwin.h
3  * \author John Hodge (thePowersGang)
4  * \brief AxWin Core functions
5  */
6 #ifndef _AXWIN2_AXWIN_H
7 #define _AXWIN2_AXWIN_H
8
9 #include <stdlib.h>
10 #include <stdint.h>
11
12 #include <axwin2/messages.h>
13
14 // === Core Types ===
15 typedef struct sAxWin_Element   tAxWin_Element;
16 typedef int     tAxWin_MessageCallback(tAxWin_Message *);
17
18 // === Functions ===
19 extern int      AxWin_Register(const char *ApplicationName, tAxWin_MessageCallback *DefaultHandler);
20 extern tAxWin_Element   *AxWin_CreateWindow(const char *TabTitle);
21 extern tAxWin_Element   *AxWin_AddMenuItem(tAxWin_Element *Parent, const char *Label, int Message);
22
23 extern int      AxWin_MessageLoop(void);
24 extern int      AxWin_SendMessage(tAxWin_Message *Message);
25 extern tAxWin_Message   *AxWin_WaitForMessage(void);
26 extern int      AxWin_HandleMessage(tAxWin_Message *Message);
27
28 // === Window Control ===
29
30 extern tAxWin_Element   *AxWin_CreateElement(tAxWin_Element *Parent, int ElementType, int Flags, const char *DebugName);
31 extern void     AxWin_SetFlags(tAxWin_Element *Element, int Flags);
32 extern void     AxWin_SetText(tAxWin_Element *Element, const char *Text);
33 extern void     AxWin_SetSize(tAxWin_Element *Element, int Size);
34 extern void     AxWin_DeleteElement(tAxWin_Element *Element);
35
36 // === CONSTANTS ===
37 enum eElementFlags
38 {
39         /**
40          * \brief Rendered
41          * 
42          * If set, the element will be ignored in calculating sizes and
43          * rendering.
44          */
45         ELEFLAG_NORENDER    = 0x001,
46         /**
47          * \brief Element visibility
48          * 
49          * If set, the element is not drawn (but still is used for size calculations)
50          */
51         ELEFLAG_INVISIBLE   = 0x002,
52         
53         /**
54          * \brief Position an element absulutely (ignored in size calcs)
55          */
56         ELEFLAG_ABSOLUTEPOS = 0x004,
57         
58         /**
59          * \brief Fixed size element
60          */
61         ELEFLAG_FIXEDSIZE   = 0x008,
62         
63         /**
64          * \brief Element "orientation"
65          * 
66          * Vertical means that the children of this element are stacked,
67          * otherwise they list horizontally
68          */
69         ELEFLAG_VERTICAL    = 0x010,//  ELEFLAG_HORIZONTAL  = 0x000,
70         /**
71          * \brief Action for text that overflows
72          */
73         ELEFLAG_WRAP        = 0x020,//  ELEFLAG_NOWRAP      = 0x000,
74         /**
75          * \brief Cross size action
76          * 
77          * If this flag is set, the element will only be as large (across
78          * its parent) as is needed to encase the contents of the element.
79          * Otherwise, the element will expand to fill all avaliable space.
80          */
81         ELEFLAG_NOEXPAND    = 0x040,
82         
83         /**
84          * \brief With (length) size action
85          * If this flag is set, the element will only be as large as
86          * is required along it's parent
87          */
88         ELEFLAG_NOSTRETCH   = 0x080,
89         
90         /**
91          * \brief Center alignment
92          */
93         ELEFLAG_ALIGN_CENTER= 0x100,
94         /**
95          * \brief Right/Bottom alignment
96          * 
97          * If set, the element aligns to the end of avaliable space (instead
98          * of the beginning)
99          */
100         ELEFLAG_ALIGN_END       = 0x200
101 };
102
103 #define ELEFLAG_WINDOW_MAXIMISED        0x10000
104
105 /**
106  */
107 enum eElementTypes
108 {
109         ELETYPE_NONE,
110
111         ELETYPE_WINDOW, //!< Window root element
112         
113         ELETYPE_BOX,    //!< Content box (invisible in itself)
114         ELETYPE_TABBAR, //!< Tab Bar
115         ELETYPE_TOOLBAR,        //!< Tool Bar
116         
117         ELETYPE_BUTTON, //!< Push Button
118         
119         ELETYPE_TEXT,   //!< Text
120         ELETYPE_IMAGE,  //!< Image
121         
122         ELETYPE_SPACER, //!< Visual Spacer (horizontal / vertical rule)
123         
124         MAX_ELETYPES    = 0x100
125 };
126
127 #endif

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