2 * Acess GUI (AxWin) Version 2
3 * By John Hodge (thePowersGang)
11 #include <acess/sys.h> // _SysDebug
14 typedef struct sIPC_Type tIPC_Type;
15 typedef struct sFont tFont;
19 int (*GetIdentSize)(void *Ident);
20 int (*CompareIdent)(void *Ident1, void *Ident2);
21 void (*SendMessage)(void *Ident, size_t, void *Data);
29 static inline uint32_t Video_AlphaBlend(uint32_t _orig, uint32_t _new, uint8_t _alpha)
33 if( _alpha == 0 ) return _orig;
34 if( _alpha == 255 ) return _new;
36 ao = (_orig >> 24) & 0xFF;
37 ro = (_orig >> 16) & 0xFF;
38 go = (_orig >> 8) & 0xFF;
39 bo = (_orig >> 0) & 0xFF;
41 an = (_new >> 24) & 0xFF;
42 rn = (_new >> 16) & 0xFF;
43 gn = (_new >> 8) & 0xFF;
44 bn = (_new >> 0) & 0xFF;
46 if( _alpha == 0x80 ) {
53 ao = ao*(255-_alpha) + an*_alpha;
54 ro = ro*(255-_alpha) + rn*_alpha;
55 go = go*(255-_alpha) + gn*_alpha;
56 bo = bo*(255-_alpha) + bn*_alpha;
63 return (ao << 24) | (ro << 16) | (go << 8) | bo;
67 extern const char *gsTerminalDevice;
68 extern const char *gsMouseDevice;
70 extern int giScreenWidth;
71 extern int giScreenHeight;
72 extern uint32_t *gpScreenBuffer;
74 extern int giTerminalFD;
78 extern void memset32(void *ptr, uint32_t val, size_t count);
79 // --- Initialisation ---
80 extern void ParseCommandline(int argc, char *argv[]);
81 // --- Messages / IPC ---
82 extern void IPC_Init(void);
83 extern void IPC_FillSelect(int *nfds, fd_set *set);
84 extern void IPC_HandleSelect(fd_set *set);
86 extern void Input_FillSelect(int *nfds, fd_set *set);
87 extern void Input_HandleSelect(fd_set *set);
89 extern tApplication *AxWin_RegisterClient(tIPC_Type *Method, void *Ident, const char *Name);
90 extern void AxWin_DeregisterClient(tApplication *App);
91 extern tApplication *AxWin_GetClient(tIPC_Type *Method, void *Ident);
92 extern tElement *AxWin_CreateAppWindow(tApplication *App, const char *Name);
94 extern void Video_Setup(void);
95 extern void Video_SetCursorPos(short X, short Y);
96 extern void Video_Update(void);
97 extern void Video_FillRect(short X, short Y, short W, short H, uint32_t Color);
98 extern void Video_DrawRect(short X, short Y, short W, short H, uint32_t Color);
99 extern int Video_DrawText(short X, short Y, short W, short H, tFont *Font, uint32_t Color, char *Text);
100 extern void Video_DrawImage(short X, short Y, short W, short H, tImage *Image);
102 extern void Interface_Init(void);
103 extern void Interface_Update(void);
104 extern void Interface_Render(void);
106 extern void Decorator_RenderWidget(tElement *Element);