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 int tAxWin_MessageCallback(tAxWin_Message *);
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);
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);
28 // === Window Control ===
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);
42 * If set, the element will be ignored in calculating sizes and
45 ELEFLAG_NORENDER = 0x001,
47 * \brief Element visibility
49 * If set, the element is not drawn (but still is used for size calculations)
51 ELEFLAG_INVISIBLE = 0x002,
54 * \brief Position an element absulutely (ignored in size calcs)
56 ELEFLAG_ABSOLUTEPOS = 0x004,
59 * \brief Fixed size element
61 ELEFLAG_FIXEDSIZE = 0x008,
64 * \brief Element "orientation"
66 * Vertical means that the children of this element are stacked,
67 * otherwise they list horizontally
69 ELEFLAG_VERTICAL = 0x010,// ELEFLAG_HORIZONTAL = 0x000,
71 * \brief Action for text that overflows
73 ELEFLAG_WRAP = 0x020,// ELEFLAG_NOWRAP = 0x000,
75 * \brief Cross size action
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.
81 ELEFLAG_NOEXPAND = 0x040,
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
88 ELEFLAG_NOSTRETCH = 0x080,
91 * \brief Center alignment
93 ELEFLAG_ALIGN_CENTER= 0x100,
95 * \brief Right/Bottom alignment
97 * If set, the element aligns to the end of avaliable space (instead
100 ELEFLAG_ALIGN_END = 0x200
103 #define ELEFLAG_WINDOW_MAXIMISED 0x10000
111 ELETYPE_WINDOW, //!< Window root element
113 ELETYPE_BOX, //!< Content box (invisible in itself)
114 ELETYPE_TABBAR, //!< Tab Bar
115 ELETYPE_TOOLBAR, //!< Tool Bar
117 ELETYPE_BUTTON, //!< Push Button
119 ELETYPE_TEXT, //!< Text
120 ELETYPE_IMAGE, //!< Image
122 ELETYPE_SPACER, //!< Visual Spacer (horizontal / vertical rule)