AxWin2 - Cleaned out messy code
[tpg/acess2.git] / Usermode / Applications / axwin2_src / WM / common.h
index ff60f8c..a515bdc 100644 (file)
@@ -8,18 +8,28 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
+#include <acess/sys.h> // _SysDebug
+
+// === TYPES ===
+typedef struct sIPC_Type       tIPC_Type;
+typedef struct sFont   tFont;
+
+struct sIPC_Type
+{
+        int    (*GetIdentSize)(void *Ident);
+        int    (*CompareIdent)(void *Ident1, void *Ident2);
+       void    (*SendMessage)(void *Ident, size_t, void *Data);
+};
 
 #include "wm.h"
 #include "image.h"
 //#include "font.h"
 
-typedef struct sFont   tFont;
-
 // === MACROS ===
 static inline uint32_t Video_AlphaBlend(uint32_t _orig, uint32_t _new, uint8_t _alpha)
 {
-        int    ao,ro,go,bo;
-        int    an,rn,gn,bn;
+       uint16_t        ao,ro,go,bo;
+       uint16_t        an,rn,gn,bn;
        if( _alpha == 0 )       return _orig;
        if( _alpha == 255 )     return _new;
        
@@ -54,8 +64,8 @@ static inline uint32_t Video_AlphaBlend(uint32_t _orig, uint32_t _new, uint8_t _
 }
 
 // === GLOBALS ===
-extern char    *gsTerminalDevice;
-extern char    *gsMouseDevice;
+extern const char      *gsTerminalDevice;
+extern const char      *gsMouseDevice;
 
 extern int     giScreenWidth;
 extern int     giScreenHeight;
@@ -66,12 +76,31 @@ extern int  giMouseFD;
 
 // === Functions ===
 extern void    memset32(void *ptr, uint32_t val, size_t count);
+// --- Initialisation ---
+extern void    ParseCommandline(int argc, char *argv[]);
+// --- Messages / IPC ---
+extern void    IPC_Init(void);
+extern void    IPC_FillSelect(int *nfds, fd_set *set);
+extern void    IPC_HandleSelect(fd_set *set);
+// --- Input ---
+extern void    Input_FillSelect(int *nfds, fd_set *set);
+extern void    Input_HandleSelect(fd_set *set);
+// --- Local WM ---
+extern tApplication    *AxWin_RegisterClient(tIPC_Type *Method, void *Ident, const char *Name);
+extern void    AxWin_DeregisterClient(tApplication *App);
+extern tApplication    *AxWin_GetClient(tIPC_Type *Method, void *Ident);
 // --- Video ---
+extern void    Video_Setup(void);
 extern void    Video_Update(void);
 extern void    Video_FillRect(short X, short Y, short W, short H, uint32_t Color);
 extern void    Video_DrawRect(short X, short Y, short W, short H, uint32_t Color);
 extern int     Video_DrawText(short X, short Y, short W, short H, tFont *Font, uint32_t Color, char *Text);
-extern void Video_DrawImage(short X, short Y, short W, short H, tImage *Image);
-// --- Debug Hack ---
-extern void    _SysDebug(const char *Format, ...);
+extern void    Video_DrawImage(short X, short Y, short W, short H, tImage *Image);
+// --- Interface ---
+extern void    Interface_Init(void);
+extern void    Interface_Update(void);
+extern void    Interface_Render(void);
+// --- Decorator ---
+extern void    Decorator_RenderWidget(tElement *Element);
+
 #endif

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