Usermode/AxWin3 - Cleaned up focus code a little, added IPC focus call
[tpg/acess2.git] / Usermode / include / 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 typedef struct sAxWin3_Window   *tHWND;
12 typedef unsigned int    tAxWin3_Colour; // TODO: Actual 32-bit
13
14 typedef void    (*tAxWin3_MessageCallback)(int SourceTID, int Length);
15
16 typedef int     (*tAxWin3_WindowMessageHandler)(tHWND Window, int Message, int Length, void *Data);
17
18 // --- Connection management
19 extern void     AxWin3_Connect(const char *ServerDesc);
20 extern tAxWin3_MessageCallback  AxWin3_SetMessageCallback(tAxWin3_MessageCallback Callback);
21 extern void     AxWin3_MainLoop(void);
22
23 // --- Non-Window based functions
24 extern int      AxWin3_GetDisplayCount(void);
25 extern int      AxWin3_GetDisplayDims(int Display, int *X, int *Y, int *Width, int *Height);
26
27 // --- Window creation/deletion
28 /**
29  * \brief Create a new window (with the required client structures)
30  * \param Parent        Parent window handle
31  * \param Renderer      Symbolic name of the renderer to use
32  * \param RendererArg   Argument to pass to the renderer's initialisation
33  * \param DataBytes     Number of bytes to allocate for the caller's use
34  * \param MessageHandler        Function to call when a message arrives for the window
35  * \return New window handle
36  * \note Usually wrapped by renderer-specific functions
37  */
38 extern tHWND    AxWin3_CreateWindow(
39         tHWND Parent,
40         const char *Renderer, int RendererArg,
41         int DataBytes,
42         tAxWin3_WindowMessageHandler MessageHandler
43         );
44 /**
45  * \brief Destroy a window
46  * \param Window        Handle to a window to destroy
47  */
48 extern void     AxWin3_DestroyWindow(tHWND Window);
49
50 // --- Core window management functions
51 extern void     AxWin3_SendMessage(tHWND Window, tHWND Dest, int Message, int Length, void *Data);
52 extern void     AxWin3_FocusWindow(tHWND Window);
53 extern void     AxWin3_ShowWindow(tHWND Window, int bShow);
54 extern void     AxWin3_SetWindowPos(tHWND Window, short X, short Y, short W, short H);
55 extern void     AxWin3_MoveWindow(tHWND Window, short X, short Y);
56 extern void     AxWin3_ResizeWindow(tHWND Window, short W, short H);
57
58 #endif
59

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