X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin2_src%2FWM%2Fwm.h;h=9ce35443b0b6523fdb8f9b8a533a71389aaffba7;hb=43992cf707ec82f8ffd3a1500ad5952640335a6d;hp=38dc1ac5f90f011f521fa0a3952a9d016da6707e;hpb=fae1f1d96fc1e923aabc87d11ed0dfcf4d17a36b;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin2_src/WM/wm.h b/Usermode/Applications/axwin2_src/WM/wm.h index 38dc1ac5..9ce35443 100644 --- a/Usermode/Applications/axwin2_src/WM/wm.h +++ b/Usermode/Applications/axwin2_src/WM/wm.h @@ -2,36 +2,51 @@ #ifndef _WM_H_ #define _WM_H_ -typedef struct sElement +#include + +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; @@ -48,39 +63,4 @@ typedef struct sApplication 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