#ifndef _WM_H_
#define _WM_H_
-typedef struct sElement
+#include <axwin2/axwin.h>
+
+typedef struct sAxWin_Element tElement;
+
+struct sAxWin_Element
{
int Type;
- struct sElement *Parent;
- struct sElement *FirstChild;
- struct sElement *LastChild;
- struct sElement *NextSibling;
-
+ tElement *Parent;
+ tElement *FirstChild;
+ tElement *LastChild;
+ tElement *NextSibling;
- short CachedX;
- short CachedY;
- short CachedW;
- short CachedH;
+ short PaddingL, PaddingR;
+ short PaddingT, PaddingB;
+ short GapSize;
- short Size; // Size attribute
+ short FixedWith; // Fixed Long Size attribute (height)
+ short FixedCross; // Fixed Cross Size attribute (width)
char *Text;
+
+ // -- Attributes maitained by the element code
+ // Not touched by the user
+ short MinWith; // Minimum long size
+ short MinCross; // Minimum cross size
void *Data;
uint32_t Flags;
-} tElement;
+
+ // -- Render Cache
+ short CachedX, CachedY;
+ short CachedW, CachedH;
+
+ char DebugName[];
+};
typedef struct sTab
{
int Type; // Should be zero, allows a tab to be the parent of an element
- struct sElement *Parent;
- struct sElement *FirstChild;
- struct sElement *LastChild;
+ tElement *Parent;
+ tElement *FirstChild;
+ tElement *LastChild;
+ struct sTab *NextTab;
char *Name;
char Name[];
} tApplication;
-// === CONSTANTS ===
-enum eElementFlags
-{
- ELEFLAG_VISIBLE = 0x001, ELEFLAG_INVISIBLE = 0x000,
- ELEFLAG_VERTICAL = 0x002, ELEFLAG_HORIZONTAL = 0x000,
- ELEFLAG_WRAP = 0x004, ELEFLAG_NOWRAP = 0x000,
-};
-/**
- */
-enum eElementTypes
-{
- ELETYPE_NONE,
-
- ELETYPE_BOX, //!< Content box
- ELETYPE_TABBAR, //!< Tab Bar
- ELETYPE_TOOLBAR, //!< Tool Bar
-
- ELETYPE_BUTTON, //!< Push Button
- ELETYPE_TEXT, //!< Text
-
- ELETYPE_SPACER, //!< Visual Spacer
- ELETYPE_GAP, //!< Alignment Gap
-
- NUM_ELETYPES
-};
-
-// === FUNCTIONS ===
-/**
- * \brief Create a new element as a child of \a Parent
- */
-extern tElement *WM_CreateElement(tElement *Parent, int Type, int Flags);
-extern void WM_SetFlags(tElement *Element, int Flags);
-extern void WM_SetSize(tElement *Element, int Size);
-extern void WM_SetText(tElement *Element, char *Text);
-
#endif