Usermode/AxWin3 - Implementing WM IPC calls in lib
authorJohn Hodge <[email protected]>
Tue, 1 Nov 2011 01:05:37 +0000 (09:05 +0800)
committerJohn Hodge <[email protected]>
Tue, 1 Nov 2011 01:05:37 +0000 (09:05 +0800)
Usermode/Libraries/Makefile.cfg
Usermode/Libraries/libaxwin3.so_src/Makefile
Usermode/Libraries/libaxwin3.so_src/include/ipc.h
Usermode/Libraries/libaxwin3.so_src/wm.c [new file with mode: 0644]

index 9463028..c3b2466 100644 (file)
@@ -8,4 +8,4 @@ MAKEDEP  = $(CC) -M
 ASFLAGS  += -D ARCHDIR=$(ARCHDIR) -D __ASSEMBLER__=1
 CPPFLAGS := -I$(ACESSDIR)/Usermode/include/ -DARCHDIR=$(ARCHDIR) -DARCHDIR_is_$(ARCHDIR)=1
 CFLAGS   := -g -Wall -fPIC -fno-builtin -fno-stack-protector $(CPPFLAGS)
-LDFLAGS  := -g -nostdlib -shared -I/Acess/Libs/ld-acess.so -e SoMain -x -L$(OUTPUTDIR)Libs/ -Wl,--no-undefined
+LDFLAGS  := -g -nostdlib -shared -I/Acess/Libs/ld-acess.so -lld-acess -e SoMain -x -L$(OUTPUTDIR)Libs/ --no-undefined
index 9a7a79e..8a910ab 100644 (file)
@@ -7,7 +7,7 @@ CPPFLAGS +=
 CFLAGS   += -Wall
 LDFLAGS  += -lc -soname libaxwin3.so
 
-OBJ = main.o msg.o r_widget.o
+OBJ = main.o msg.o wm.o r_widget.o
 BIN = libaxwin3.so
 
 include ../Makefile.tpl
index d9d7ee8..d8df229 100644 (file)
@@ -10,6 +10,7 @@
 
 typedef struct sAxWin_IPCMessage       tAxWin_IPCMessage;
 typedef struct sIPCMsg_Return  tIPCMsg_Return;
+typedef struct sIPCMsg_CreateWin       sIPCMsg_CreateWin;
 
 /**
  * \name Flags for IPC Messages
@@ -17,6 +18,9 @@ typedef struct sIPCMsg_Return tIPCMsg_Return;
  */
 //! Request a return value
 #define IPCMSG_FLAG_RETURN     0x01
+/**
+ * \}
+ */
 
 struct sAxWin_IPCMessage
 {
@@ -32,10 +36,18 @@ struct sIPCMsg_Return
        uint32_t        Value;
 };
 
+struct sIPCMsg_CreateWin
+{
+       uint32_t        NewWinID;
+       uint32_t        Flags;
+       char    Renderer[];
+};
+
 enum eAxWin_IPCMessageTypes
 {
        IPCMSG_PING,    //!< 
        IPCMSG_SENDMSG, //!< Send a message to another window
+       IPCMSG_CREATEWIN,       //!< Create a window
 };
 
 #endif
diff --git a/Usermode/Libraries/libaxwin3.so_src/wm.c b/Usermode/Libraries/libaxwin3.so_src/wm.c
new file mode 100644 (file)
index 0000000..8764cd9
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * AxWin3 Interface Library
+ * - By John Hodge (thePowersGang)
+ *
+ * wm.c
+ * - Core window management functions
+ */
+#include <axwin3/axwin.h>
+#include <stdlib.h>
+
+// === CODE ===
+tHWND AxWin3_CreateWindow(tHWND Parent, const char *Renderer, int Flags)
+{
+        int    dataSize = sizeof(tIPCMsg_CreateWin) + strlen(Renderer) + 1;
+       tAxWin_IPCMessage       *msg;
+       tIPCMsg_CreateWin       *create_win;
+
+       msg = alloca( sizeof(tAxWin_IPCMessage) + dataSize );
+       create_win = msg->Data;
+       
+       msg->ID = IPCMSG_CREATEWIN;
+       msg->Flags = 0;
+       msg->Window = Parent;   // TODO: Validation
+       msg->Size = dataSize;
+
+       create_win->NewWinID = AxWin3_int_AllocateWindowID();
+       create_win->Flags = Flags;
+       strcpy(create_win->Renderer, Renderer);
+
+       return NULL;
+}
+
+void AxWin3_DestroyWindow(tHWND Window)
+{
+}

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