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 *);
18 //typedef int tAxWin_MessageCallback(void *Source, int Message, int Length, void *Data);
21 extern int AxWin_Register(const char *ApplicationName, tAxWin_MessageCallback *DefaultHandler);
22 extern tAxWin_Element *AxWin_CreateTab(const char *TabTitle);
23 extern tAxWin_Element *AxWin_AddMenuItem(tAxWin_Element *Parent, const char *Label, int Message);
25 extern int AxWin_MessageLoop(void);
26 extern int AxWin_SendMessage(tAxWin_Message *Message);
27 extern tAxWin_Message *AxWin_WaitForMessage(void);
28 extern int AxWin_HandleMessage(tAxWin_Message *Message);
30 // === Window Control ===
32 extern tAxWin_Element *AxWin_CreateElement(tAxWin_Element *Parent, int ElementType, int Flags, const char *DebugName);
33 extern void AxWin_SetFlags(tAxWin_Element *Element, int Flags);
34 extern void AxWin_SetText(tAxWin_Element *Element, const char *Text);
35 extern void AxWin_SetSize(tAxWin_Element *Element, int Size);
36 extern void AxWin_DeleteElement(tAxWin_Element *Element);
44 * If set, the element will be ignored in calculating sizes and
47 ELEFLAG_NORENDER = 0x001,
49 * \brief Element visibility
51 * If set, the element is not drawn (but still is used for size calculations)
53 ELEFLAG_INVISIBLE = 0x002,
56 * \brief Position an element absulutely (ignored in size calcs)
58 ELEFLAG_ABSOLUTEPOS = 0x004,
61 * \brief Fixed size element
63 ELEFLAG_FIXEDSIZE = 0x008,
66 * \brief Element "orientation"
68 * Vertical means that the children of this element are stacked,
69 * otherwise they list horizontally
71 ELEFLAG_VERTICAL = 0x010,// ELEFLAG_HORIZONTAL = 0x000,
73 * \brief Action for text that overflows
75 ELEFLAG_WRAP = 0x020,// ELEFLAG_NOWRAP = 0x000,
77 * \brief Cross size action
79 * If this flag is set, the element will only be as large (across
80 * its parent) as is needed to encase the contents of the element.
81 * Otherwise, the element will expand to fill all avaliable space.
83 ELEFLAG_NOEXPAND = 0x040,
86 * \brief With (length) size action
87 * If this flag is set, the element will only be as large as
88 * is required along it's parent
90 ELEFLAG_NOSTRETCH = 0x080,
93 * \brief Center alignment
95 ELEFLAG_ALIGN_CENTER= 0x100,
97 * \brief Right/Bottom alignment
99 * If set, the element aligns to the end of avaliable space (instead
102 ELEFLAG_ALIGN_END = 0x200
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)