Usermode/AxWin3 - Workign on interface lib, adding basic UI app
authorJohn Hodge <[email protected]>
Wed, 2 Nov 2011 13:27:15 +0000 (21:27 +0800)
committerJohn Hodge <[email protected]>
Wed, 2 Nov 2011 13:27:15 +0000 (21:27 +0800)
Usermode/Applications/axwin3_src/Interface/Makefile [new file with mode: 0644]
Usermode/Applications/axwin3_src/Interface/main.c [new file with mode: 0644]
Usermode/Libraries/libaxwin3.so_src/include/ipc.h
Usermode/Libraries/libaxwin3.so_src/main.c
Usermode/Libraries/libaxwin3.so_src/msg.c
Usermode/include/axwin3/axwin.h

diff --git a/Usermode/Applications/axwin3_src/Interface/Makefile b/Usermode/Applications/axwin3_src/Interface/Makefile
new file mode 100644 (file)
index 0000000..d96cc5e
--- /dev/null
@@ -0,0 +1,14 @@
+# Project: Acess2 GUI v3 Interface
+
+-include ../../Makefile.cfg
+
+CPPFLAGS += -I include/
+
+DIR := Apps/AxWin/3.0
+BIN := AxWinUI
+OBJ := main.o
+
+LDFLAGS += -laxwin3
+
+-include ../../Makefile.tpl
+
diff --git a/Usermode/Applications/axwin3_src/Interface/main.c b/Usermode/Applications/axwin3_src/Interface/main.c
new file mode 100644 (file)
index 0000000..f56cd69
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Acess2 GUI v3 User Interface
+ * - By John Hodge (thePowersGang)
+ *
+ * main.c
+ * - Interface core
+ */
+#include <stdlib.h>
+#include <axwin3/axwin.h>
+
+// === GLOBALS ===
+tHWND  gSidebar;
+
+// === CODE ===
+int main(int argc, char *argv[])
+{
+       // Connect to AxWin3 Server
+       AxWin3_Connect(NULL);
+       
+       // Create sidebar
+       // TODO: Use the widget library instead
+       gSidebar = AxWin3_CreateWindow(NULL, "widget", 0, 0, NULL);
+       
+       // Idle loop
+       AxWin3_MainLoop();
+       
+       return 0;
+}
+
index a2533ea..231ee48 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef _IPCMESSAGES_H_
 #define _IPCMESSAGES_H_
 
+#include <stdint.h>
+
 typedef struct sAxWin_IPCMessage       tAxWin_IPCMessage;
 typedef struct sIPCMsg_Return  tIPCMsg_Return;
 typedef struct sIPCMsg_CreateWin       tIPCMsg_CreateWin;
@@ -52,6 +54,7 @@ enum eAxWin_IPCMessageTypes
 
 extern tAxWin_IPCMessage       *AxWin3_int_AllocateIPCMessage(tHWND Window, int Message, int Flags, int ExtraBytes);
 extern void    AxWin3_int_SendIPCMessage(tAxWin_IPCMessage *Msg);
+extern tAxWin_IPCMessage       *AxWin3_int_GetIPCMessage(void);
 
 #endif
 
index 0ee81ce..47e3f33 100644 (file)
@@ -6,6 +6,7 @@
  * - Entrypoint and setup
  */
 #include <axwin3/axwin.h>
+#include "include/ipc.h"
 
 // === CODE ===
 int SoMain(void *Base, int argc, const char *argv[], const char **envp)
@@ -14,3 +15,16 @@ int SoMain(void *Base, int argc, const char *argv[], const char **envp)
        return 0;
 }
 
+void AxWin3_MainLoop(void)
+{
+       tAxWin_IPCMessage       *msg;
+        int    bExit = 0;      
+
+       while(!bExit)
+       {
+               msg = AxWin3_int_GetIPCMessage();
+               
+               // TODO: Handle message
+       }
+}
+
index 5871331..cce977b 100644 (file)
@@ -10,6 +10,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include "include/ipc.h"
+#include "include/internal.h"
 
 // === CONSTANTS ===
 enum eConnectionType
@@ -73,7 +74,10 @@ tAxWin_IPCMessage *AxWin3_int_AllocateIPCMessage(tHWND Window, int Message, int
        ret = malloc( sizeof(tAxWin_IPCMessage) + ExtraBytes );
        ret->Flags = Flags;
        ret->ID = Message;
-       ret->Window = Window;
+       if(Window)
+               ret->Window = Window->ServerID;
+       else
+               ret->Window = -1;
        ret->Size = ExtraBytes;
        return ret;
 }
index 2c85243..af5c242 100644 (file)
@@ -16,6 +16,7 @@ typedef int   (*tAxWin3_WindowMessageHandler)(tHWND Window, int Length, void *Data
 
 extern void    AxWin3_Connect(const char *ServerDesc);
 extern tAxWin3_MessageCallback AxWin3_SetMessageCallback(tAxWin3_MessageCallback Callback);
+extern void    AxWin3_MainLoop(void);
 
 extern tHWND   AxWin3_CreateWindow(tHWND Parent, const char *Renderer, int Flags, int DataBytes, void **DataPtr);
 extern void    AxWin3_DestroyWindow(tHWND Window);

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