2 * Acess GUI (AxWin) Version 2
3 * By John Hodge (thePowersGang)
11 #include <acess/sys.h> // _SysDebug
13 typedef void tMessages_Handle_Callback(void*, size_t, void*);
14 typedef struct sFont tFont;
21 static inline uint32_t Video_AlphaBlend(uint32_t _orig, uint32_t _new, uint8_t _alpha)
25 if( _alpha == 0 ) return _orig;
26 if( _alpha == 255 ) return _new;
28 ao = (_orig >> 24) & 0xFF;
29 ro = (_orig >> 16) & 0xFF;
30 go = (_orig >> 8) & 0xFF;
31 bo = (_orig >> 0) & 0xFF;
33 an = (_new >> 24) & 0xFF;
34 rn = (_new >> 16) & 0xFF;
35 gn = (_new >> 8) & 0xFF;
36 bn = (_new >> 0) & 0xFF;
38 if( _alpha == 0x80 ) {
45 ao = ao*(255-_alpha) + an*_alpha;
46 ro = ro*(255-_alpha) + rn*_alpha;
47 go = go*(255-_alpha) + gn*_alpha;
48 bo = bo*(255-_alpha) + bn*_alpha;
55 return (ao << 24) | (ro << 16) | (go << 8) | bo;
59 extern const char *gsTerminalDevice;
60 extern const char *gsMouseDevice;
62 extern int giScreenWidth;
63 extern int giScreenHeight;
64 extern uint32_t *gpScreenBuffer;
66 extern int giTerminalFD;
70 extern void memset32(void *ptr, uint32_t val, size_t count);
71 // --- Initialisation ---
72 extern void ParseCommandline(int argc, char *argv[]);
73 extern void IPC_Init(void);
74 extern void IPC_FillSelect(int *nfds, fd_set *set);
75 extern void IPC_HandleSelect(fd_set *set);
76 extern void Input_FillSelect(int *nfds, fd_set *set);
77 extern void Input_HandleSelect(fd_set *set);
79 extern tApplication *AxWin_RegisterClient(int IdentLen, void *Ident, tMessages_Handle_Callback *Cb, const char *Name);
80 extern void AxWin_DeregisterClient(tApplication *App);
82 extern void Video_Setup(void);
83 extern void Video_Update(void);
84 extern void Video_FillRect(short X, short Y, short W, short H, uint32_t Color);
85 extern void Video_DrawRect(short X, short Y, short W, short H, uint32_t Color);
86 extern int Video_DrawText(short X, short Y, short W, short H, tFont *Font, uint32_t Color, char *Text);
87 extern void Video_DrawImage(short X, short Y, short W, short H, tImage *Image);
89 extern void Interface_Init(void);
90 extern void Interface_Update(void);
91 extern void Interface_Render(void);
93 extern void Decorator_RenderWidget(tElement *Element);