Usermode/AxWin3 - Updated clientside IPC code to allow select() usage by client
[tpg/acess2.git] / Usermode / Libraries / libaxwin3.so_src / include_exp / axwin3 / axwin.h
1 /*
2  * Acess2 GUI Version 3 (AxWin3)
3  * - By John Hodge (thePowersGang)
4  *
5  * axwin.h
6  * - Core API Header
7  */
8 #ifndef _AXWIN3_AXWIN_H_
9 #define _AXWIN3_AXWIN_H_
10
11 #include <stddef.h>     // size_t
12 #include <unistd.h>
13
14 // === CONSTANTS ===
15
16 // === TYPES ===
17 typedef struct sAxWin3_Window   *tHWND;
18 typedef unsigned int    tAxWin3_Colour; // TODO: Actual 32-bit
19
20 typedef void    (*tAxWin3_MessageCallback)(int SourceTID, int Length);
21 typedef void    (*tAxWin3_HotkeyCallback)(void);
22
23 typedef int     (*tAxWin3_WindowMessageHandler)(tHWND Window, int Message, int Length, void *Data);
24
25 // --- Connection management
26 extern void     AxWin3_Connect(const char *ServerDesc);
27 extern tAxWin3_MessageCallback  AxWin3_SetMessageCallback(tAxWin3_MessageCallback Callback);
28 extern void     AxWin3_MainLoop(void);
29 extern void     AxWin3_MessageSelect(int nFD, fd_set *FDs);
30
31 // --- Non-Window based functions
32 extern int      AxWin3_GetDisplayCount(void);
33 extern int      AxWin3_GetDisplayDims(int Display, int *X, int *Y, int *Width, int *Height);
34
35 // --- Window creation/deletion
36 /**
37  * \brief Create a new window (with the required client structures)
38  * \param Parent        Parent window handle
39  * \param Renderer      Symbolic name of the renderer to use
40  * \param RendererArg   Argument to pass to the renderer's initialisation
41  * \param DataBytes     Number of bytes to allocate for the caller's use
42  * \param MessageHandler        Function to call when a message arrives for the window
43  * \return New window handle
44  * \note Usually wrapped by renderer-specific functions
45  */
46 extern tHWND    AxWin3_CreateWindow(
47         tHWND Parent,
48         const char *Renderer, int RendererArg,
49         int DataBytes,
50         tAxWin3_WindowMessageHandler MessageHandler
51         );
52 /**
53  * \brief Destroy a window
54  * \param Window        Handle to a window to destroy
55  */
56 extern void     AxWin3_DestroyWindow(tHWND Window);
57 extern int      AxWin3_RegisterAction(tHWND Window, const char *Action, tAxWin3_HotkeyCallback cb);
58
59 // --- Core window management functions
60 extern void     AxWin3_SendMessage(tHWND Window, tHWND Dest, int Message, int Length, void *Data);
61 extern void     *AxWin3_WaitMessage(tHWND Window, int MessageID, size_t *Length);
62 extern void     AxWin3_SetWindowTitle(tHWND Window, const char *Title);
63 extern void     AxWin3_FocusWindow(tHWND Window);
64 extern void     AxWin3_ShowWindow(tHWND Window, int bShow);
65 extern void     AxWin3_DecorateWindow(tHWND Window, int bDecorate);
66 extern void     AxWin3_SetWindowPos(tHWND Window, short X, short Y, short W, short H);
67 extern void     AxWin3_MoveWindow(tHWND Window, short X, short Y);
68 extern void     AxWin3_ResizeWindow(tHWND Window, short W, short H);
69
70 #endif
71

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