2 * Acess2 GUIv4 (AxWin4)
3 * - By John Hodge (thePowersGang)
6 * - Client library interface header
8 #ifndef _LIBAXWIN4_AXWIN4_AXWIN_H_
9 #define _LIBAXWIN4_AXWIN4_AXWIN_H_
17 #include <acess/sys.h>
19 typedef struct sAxWin4_Window tAxWin4_Window;
21 // - Abstractions of core IPC methods
22 extern bool AxWin4_Connect(const char *URI);
24 extern bool AxWin4_WaitEventQueue(uint64_t Timeout);
25 extern bool AxWin4_WaitEventQueueSelect(int nFDs, fd_set *rfds, fd_set *wfds, fd_set *efds, uint64_t Timeout);
27 extern void AxWin4_GetScreenDimensions(unsigned int ScreenIndex, unsigned int *Width, unsigned int *Height);
29 extern tAxWin4_Window *AxWin4_CreateWindow(const char *Name);
30 extern void AxWin4_DestroyWindow(tAxWin4_Window *Window);
33 typedef int tAxWin4_KeyCallback(tAxWin4_Window* Winow, unsigned int Key, const char *Translated);
34 extern void AxWin4_SetCallback_Key(tAxWin4_Window* Window, tAxWin4_KeyCallback* cb);
35 typedef int tAxWin4_MouseBtnCallback(tAxWin4_Window* Winow, unsigned int Mouse, unsigned int X, unsigned int Y, unsigned int Button, bool IsPress);
36 extern void AxWin4_SetCallback_MouseBtn(tAxWin4_Window* Window, tAxWin4_MouseBtnCallback* cb);
37 typedef int tAxWin4_MouseMoveCallback(tAxWin4_Window* Winow, unsigned int Mouse, unsigned int X, unsigned int Y);
39 extern void AxWin4_ShowWindow(tAxWin4_Window *Window, bool Shown);
40 extern void AxWin4_SetWindowFlags(tAxWin4_Window *Window, unsigned int NewFlags);
41 extern void AxWin4_SetTitle(tAxWin4_Window *Window, const char *Title);
42 extern void AxWin4_MoveWindow(tAxWin4_Window *Window, int X, int Y);
43 extern void AxWin4_ResizeWindow(tAxWin4_Window *Window, unsigned int W, unsigned int H);
45 extern void AxWin4_DamageRect(tAxWin4_Window *Window, unsigned int X, unsigned int Y, unsigned int W, unsigned int H);
46 extern void* AxWin4_GetWindowBuffer(tAxWin4_Window *Window);
49 * \brief Set the render clipping region. Any attempts to render outside this area will silently fail
50 * \param Window Target window
52 * \note Allows clipping other render functions to avoid excessive redraws
53 * \note Cleared when \a AxWin4_DamageRect is called, or when called with a zero width or height
55 extern void AxWin4_SetRenderClip(tAxWin4_Window *Window, int X, int Y, unsigned int W, unsigned int H);
58 * \brief Draw a user-supplied bitmap to the window
59 * \param Data Bitmap data in the same format as the window's back buffer
62 extern void AxWin4_DrawBitmap(tAxWin4_Window *Window, int X, int Y, unsigned int W, unsigned int H, void *Data);
64 * \brief Draw a "control" to the window
65 * \param Window Target window
66 * \param X Destination X
67 * \param Y Destination Y
68 * \param W Control width
69 * \param H Control height
70 * \param ControlID Specifies which control to use. Can be a global or application-registered (See eAxWin4_GlobalControls)
71 * \param Frame Control frame number. Used to specify a variant of the control (e.g. hovered/pressed)
73 * Controls are server-side bitmaps that can be arbitarily scaled to fit a region.
75 extern void AxWin4_DrawControl(tAxWin4_Window *Window, int X, int Y, unsigned int W, unsigned int H, uint16_t ControlID, unsigned int Frame);
77 extern void AxWin4_FillRect(tAxWin4_Window *Window, int X, int Y, unsigned int W, unsigned int H, uint32_t Colour);
79 extern void AxWin4_DrawText(tAxWin4_Window *Window, int X, int Y, unsigned int W, unsigned int H, uint16_t FontID, const char *String);
81 #include "definitions.h"