-
+/*
+ * Acess2 Window Manager (AxWin2)
+ */
#ifndef _WM_H_
#define _WM_H_
-typedef struct sElement
+#include <axwin2/axwin.h>
+#include "common.h"
+
+typedef struct sAxWin_Element tElement;
+typedef struct sTab tTab;
+typedef struct sApplication tApplication;
+
+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;
+
+ // User modifiable attributes
+ short PaddingL, PaddingR;
+ short PaddingT, PaddingB;
+ short GapSize;
- short CachedX;
- short CachedY;
- short CachedW;
- short CachedH;
+ uint32_t Flags;
- short Size; // Size attribute
+ short FixedWith; // Fixed Long Size attribute (height)
+ short FixedCross; // Fixed Cross Size attribute (width)
char *Text;
- void *Data;
- uint32_t Flags;
-} tElement;
-
-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;
+ // -- Attributes maitained by the element code
+ // Not touched by the user
+ short MinWith; // Minimum long size
+ short MinCross; // Minimum cross size
+ void *Data;
- char *Name;
+ // -- Render Cache
+ short CachedX, CachedY;
+ short CachedW, CachedH;
- tElement *RootElement;
-} tTab;
+ char DebugName[];
+};
-typedef struct sApplication
+struct sApplication
{
- pid_t PID;
-
- int nTabs;
- tTab *Tabs;
-
- char Name[];
-} tApplication;
+ tApplication *Next;
-// === 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,
+ void *Ident;
+ tMessages_Handle_Callback *SendMessage;
- 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
-};
+ char *Name;
+ tElement MetaElement;
-// === 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