+tApplication *AxWin_RegisterClient(tIPC_Type *Method, void *Ident, const char *Name)
+{
+ int identlen = Method->GetIdentSize(Ident);
+ // Structure, empty string, Name, Ident
+ tApplication *ret = calloc( 1, sizeof(tApplication) + 1 + strlen(Name) + 1 + identlen );
+
+ // DebugName is empty
+
+ // Name/Title
+ ret->Name = &ret->MetaElement.DebugName[1];
+ strcpy(ret->Name, Name);
+ // Ident
+ ret->Ident = ret->Name + strlen(Name) + 1;
+ memcpy(ret->Ident, Ident, identlen);
+ // IPC Type
+ ret->IPCType = Method;
+
+ // Element index
+ ret->MaxElementIndex = DEFAULT_ELEMENTS_PER_APP;
+ ret->EleIndex = calloc( 1, ret->MaxElementIndex * sizeof(*ret->EleIndex) );
+
+ // Add to global list
+ ret->Next = gWM_Applications;
+ gWM_Applications = ret;
+
+ // TODO: Inform listeners of the new application
+
+ return ret;
+}
+
+void AxWin_DeregisterClient(tApplication *App)
+{
+ // TODO: Complete implementing DeregisterClient
+ tElement *win, *next;
+
+ for( win = App->MetaElement.FirstChild; win; win = next )
+ {
+ next = win->NextSibling;
+ AxWin_DeleteElement(win);
+ }
+
+ // TODO: Inform listeners of deleted application
+
+ // Remove from list
+ {
+ tApplication *app, *prev = NULL;
+ for( app = gWM_Applications; app; app = app->Next )
+ {
+ if( app == App ) break;
+ prev = app;
+ }
+
+ if( app )
+ {
+ if(prev)
+ prev->Next = App->Next;
+ else
+ gWM_Applications = App->Next;
+ }
+ }
+
+ free(App);
+}
+
+/**
+ * \brief Get an application handle from a client identifier
+ */
+tApplication *AxWin_GetClient(tIPC_Type *Method, void *Ident)
+{
+ // TODO: Faster and smarter technique
+ tApplication *app;
+ for( app = gWM_Applications; app; app = app->Next )
+ {
+ if( app->IPCType != Method ) continue;
+ if( Method->CompareIdent( app->Ident, Ident ) != 0 ) continue;
+ return app;
+ }
+ return NULL;
+}
+
+tElement *AxWin_CreateAppWindow(tApplication *App, const char *Name)