2 * Acess2 GUI Version 3 (AxWin3)
3 * - By John Hodge (thePowersGang)
8 #ifndef _AXWIN3_AXWIN_H_
9 #define _AXWIN3_AXWIN_H_
11 #include <stddef.h> // size_t
16 typedef struct sAxWin3_Window *tHWND;
17 typedef unsigned int tAxWin3_Colour; // TODO: Actual 32-bit
19 typedef void (*tAxWin3_MessageCallback)(int SourceTID, int Length);
20 typedef void (*tAxWin3_HotkeyCallback)(void);
22 typedef int (*tAxWin3_WindowMessageHandler)(tHWND Window, int Message, int Length, void *Data);
24 // --- Connection management
25 extern void AxWin3_Connect(const char *ServerDesc);
26 extern tAxWin3_MessageCallback AxWin3_SetMessageCallback(tAxWin3_MessageCallback Callback);
27 extern void AxWin3_MainLoop(void);
29 // --- Non-Window based functions
30 extern int AxWin3_GetDisplayCount(void);
31 extern int AxWin3_GetDisplayDims(int Display, int *X, int *Y, int *Width, int *Height);
33 // --- Window creation/deletion
35 * \brief Create a new window (with the required client structures)
36 * \param Parent Parent window handle
37 * \param Renderer Symbolic name of the renderer to use
38 * \param RendererArg Argument to pass to the renderer's initialisation
39 * \param DataBytes Number of bytes to allocate for the caller's use
40 * \param MessageHandler Function to call when a message arrives for the window
41 * \return New window handle
42 * \note Usually wrapped by renderer-specific functions
44 extern tHWND AxWin3_CreateWindow(
46 const char *Renderer, int RendererArg,
48 tAxWin3_WindowMessageHandler MessageHandler
51 * \brief Destroy a window
52 * \param Window Handle to a window to destroy
54 extern void AxWin3_DestroyWindow(tHWND Window);
55 extern int AxWin3_RegisterAction(tHWND Window, const char *Action, tAxWin3_HotkeyCallback cb);
57 // --- Core window management functions
58 extern void AxWin3_SendMessage(tHWND Window, tHWND Dest, int Message, int Length, void *Data);
59 extern void *AxWin3_WaitMessage(tHWND Window, int MessageID, size_t *Length);
60 extern void AxWin3_SetWindowTitle(tHWND Window, const char *Title);
61 extern void AxWin3_FocusWindow(tHWND Window);
62 extern void AxWin3_ShowWindow(tHWND Window, int bShow);
63 extern void AxWin3_DecorateWindow(tHWND Window, int bDecorate);
64 extern void AxWin3_SetWindowPos(tHWND Window, short X, short Y, short W, short H);
65 extern void AxWin3_MoveWindow(tHWND Window, short X, short Y);
66 extern void AxWin3_ResizeWindow(tHWND Window, short W, short H);