Merge branch 'master' of github.com:thepowersgang/acess2
[tpg/acess2.git] / Usermode / Applications / axwin2_src / WM / wm.c
index dc1de6a..b073223 100644 (file)
@@ -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;
 }
 

UCC git Repository :: git.ucc.asn.au