0a23ad76d0036552c745134b69e6074daa583455
[tpg/acess2.git] / Usermode / Libraries / libaxwin4.so_src / include_exp / axwin4 / axwin.h
1 /*
2  * Acess2 GUIv4 (AxWin4)
3  * - By John Hodge (thePowersGang)
4  *
5  * axwin4/axwin.h
6  * - Client library interface header
7  */
8 #ifndef _LIBAXWIN4_AXWIN4_AXWIN_H_
9 #define _LIBAXWIN4_AXWIN4_AXWIN_H_
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 #include <stdint.h>
16 #include <stdbool.h>
17 #include <acess/sys.h>
18
19 typedef struct sAxWin4_Window   tAxWin4_Window;
20
21 // - Abstractions of core IPC methods
22 extern bool     AxWin4_Connect(const char *URI);
23
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);
26
27 extern void     AxWin4_GetScreenDimensions(unsigned int ScreenIndex, unsigned int *Width, unsigned int *Height);
28
29 extern tAxWin4_Window   *AxWin4_CreateWindow(const char *Name);
30 extern void     AxWin4_DestroyWindow(tAxWin4_Window *Window);
31 extern void     AxWin4_ShowWindow(tAxWin4_Window *Window, bool Shown);
32 extern void     AxWin4_SetWindowFlags(tAxWin4_Window *Window, unsigned int NewFlags);
33 extern void     AxWin4_SetTitle(tAxWin4_Window *Window, const char *Title);
34 extern void     AxWin4_MoveWindow(tAxWin4_Window *Window, int X, int Y);
35 extern void     AxWin4_ResizeWindow(tAxWin4_Window *Window, unsigned int W, unsigned int H);
36
37 extern void     AxWin4_DamageRect(tAxWin4_Window *Window, unsigned int X, unsigned int Y, unsigned int W, unsigned int H);
38 extern void*    AxWin4_GetWindowBuffer(tAxWin4_Window *Window);
39
40 /**
41  * \brief Set the render clipping region. Any attempts to render outside this area will silently fail
42  * \param Window        Target window
43  *
44  * \note Allows clipping other render functions to avoid excessive redraws
45  * \note Cleared when \a AxWin4_DamageRect is called, or when called with a zero width or height
46  */
47 extern void     AxWin4_SetRenderClip(tAxWin4_Window *Window, int X, int Y, unsigned int W, unsigned int H);
48
49 /**
50  * \brief Draw a user-supplied bitmap to the window
51  * \param Data  Bitmap data in the same format as the window's back buffer
52  * \note VERY SLOW
53  */
54 extern void     AxWin4_DrawBitmap(tAxWin4_Window *Window, int X, int Y, unsigned int W, unsigned int H, void *Data);
55 /**
56  * \brief Draw a "control" to the window
57  * \param Window        Target window
58  * \param X     Destination X
59  * \param Y     Destination Y
60  * \param W     Control width
61  * \param H     Control height
62  * \param ControlID     Specifies which control to use. Can be a global or application-registered (See eAxWin4_GlobalControls)
63  * \param Frame Control frame number. Used to specify a variant of the control (e.g. hovered/pressed)
64  *
65  * Controls are server-side bitmaps that can be arbitarily scaled to fit a region.
66  */
67 extern void     AxWin4_DrawControl(tAxWin4_Window *Window, int X, int Y, unsigned int W, unsigned int H, uint16_t ControlID, unsigned int Frame);
68
69 extern void     AxWin4_DrawText(tAxWin4_Window *Window, int X, int Y, unsigned int W, unsigned int H, uint16_t FontID, const char *String);
70
71 #include "definitions.h"
72
73 #ifdef __cplusplus
74 }
75 #endif
76
77 #endif
78

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