3 * \author John Hodge (thePowersGang)
4 * \brief AxWin Core functions
6 #ifndef _AXWIN2_AXWIN_H
7 #define _AXWIN2_AXWIN_H
12 #include <axwin2/messages.h>
15 typedef struct sAxWin_Element tAxWin_Element;
16 //typedef struct sAxWin_Message tAxWin_Message;
17 typedef int tAxWin_MessageCallback(tAxWin_Message *);
20 extern int AxWin_Register(const char *ApplicationName, tAxWin_MessageCallback *DefaultHandler);
21 extern tAxWin_Element *AxWin_CreateTab(const char *TabTitle);
22 extern tAxWin_Element *AxWin_AddMenuItem(tAxWin_Element *Parent, const char *Label, int Message);
24 extern int AxWin_MessageLoop(void);
25 extern int AxWin_SendMessage(tAxWin_Message *Message);
26 extern tAxWin_Message *AxWin_WaitForMessage(void);
27 extern int AxWin_HandleMessage(tAxWin_Message *Message);
29 // === Window Control ===
31 extern tAxWin_Element *AxWin_CreateElement(tAxWin_Element *Parent, int ElementType, int Flags, const char *DebugName);
32 extern void AxWin_SetFlags(tAxWin_Element *Element, int Flags);
33 extern void AxWin_SetText(tAxWin_Element *Element, const char *Text);
34 extern void AxWin_SetSize(tAxWin_Element *Element, int Size);
35 extern void AxWin_DeleteElement(tAxWin_Element *Element);
43 * If set, the element will be ignored in calculating sizes and
46 ELEFLAG_NORENDER = 0x001,
48 * \brief Element visibility
50 * If set, the element is not drawn (but still is used for size calculations)
52 ELEFLAG_INVISIBLE = 0x002,
55 * \brief Position an element absulutely (ignored in size calcs)
57 ELEFLAG_ABSOLUTEPOS = 0x004,
60 * \brief Fixed size element
62 ELEFLAG_FIXEDSIZE = 0x008,
65 * \brief Element "orientation"
67 * Vertical means that the children of this element are stacked,
68 * otherwise they list horizontally
70 ELEFLAG_VERTICAL = 0x010,// ELEFLAG_HORIZONTAL = 0x000,
72 * \brief Action for text that overflows
74 ELEFLAG_WRAP = 0x020,// ELEFLAG_NOWRAP = 0x000,
76 * \brief Cross size action
78 * If this flag is set, the element will only be as large (across
79 * its parent) as is needed to encase the contents of the element.
80 * Otherwise, the element will expand to fill all avaliable space.
82 ELEFLAG_NOEXPAND = 0x040,
85 * \brief With (length) size action
86 * If this flag is set, the element will only be as large as
87 * is required along it's parent
89 ELEFLAG_NOSTRETCH = 0x080,
92 * \brief Center alignment
94 ELEFLAG_ALIGN_CENTER= 0x100,
96 * \brief Right/Bottom alignment
98 * If set, the element aligns to the end of avaliable space (instead
101 ELEFLAG_ALIGN_END = 0x200
110 ELETYPE_BOX, //!< Content box (invisible in itself)
111 ELETYPE_TABBAR, //!< Tab Bar
112 ELETYPE_TOOLBAR, //!< Tool Bar
114 ELETYPE_BUTTON, //!< Push Button
116 ELETYPE_TEXT, //!< Text
117 ELETYPE_IMAGE, //!< Image
119 ELETYPE_SPACER, //!< Visual Spacer (horizontal / vertical rule)