X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin2_src%2FWM%2Fwm.c;h=b07322359dc71cdb441c6bfe093d32ebcd46d14c;hb=e02f66c7125bf18f77c6c53587238cbd49da2c89;hp=dc1de6a22fd1a35b2eaef949f5a3dffb7664cf0c;hpb=b43ed8d15c86ff9b7f5abc9f47e1385503dcdf35;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin2_src/WM/wm.c b/Usermode/Applications/axwin2_src/WM/wm.c index dc1de6a2..b0732235 100644 --- a/Usermode/Applications/axwin2_src/WM/wm.c +++ b/Usermode/Applications/axwin2_src/WM/wm.c @@ -28,7 +28,13 @@ void AxWin_SetText(tElement *Element, const char *Text); tElement gWM_RootElement = { .DebugName = "ROOT" }; +tWindow *gWM_WindowFirst; +tWindow *gWM_WindowLast; tApplication *gWM_Applications; + int giWM_MaxAreaX = 0; + int giWM_MaxAreaY = 0; + int giWM_MaxAreaW = -1; + int giWM_MaxAreaH = -1; // --- Element type flags struct { @@ -125,14 +131,28 @@ tApplication *AxWin_GetClient(tIPC_Type *Method, void *Ident) return NULL; } -tElement *AxWin_CreateWindow(tApplication *App, const char *Name) +tElement *AxWin_CreateAppWindow(tApplication *App, const char *Name) { tElement *ret; - - // TODO: Implement _CreateTab + tWindow *win; + + win = calloc(1, sizeof(tWindow) + 1); + if(!win) return NULL; + + ret = &win->RootElement; + ret->Type = ELETYPE_WINDOW; + ret->Data = win; + ret->Parent = &App->MetaElement; + + // Add to parent list + if(ret->Parent->LastChild) + ret->Parent->LastChild->NextSibling = ret; + ret->Parent->LastChild = ret; + if(!ret->Parent->FirstChild) + ret->Parent->FirstChild = ret; - ret = AxWin_CreateElement(&App->MetaElement, ELETYPE_WINDOW, 0, NULL); ret->Text = strdup(Name); + return ret; }