Usermode/AxWin3 - Cleaned up focus code a little, added IPC focus call
[tpg/acess2.git] / Usermode / Applications / axwin3_src / WM / include / wm.h
1 /*
2  * Acess2 Window Manager v3 (axwin3)
3  * - By John Hodge (thePowersGang)
4  *
5  * include/wm.h
6  * - Window management functions
7  */
8 #ifndef _WM_H_
9 #define _WM_H_
10
11 #include "image.h"
12
13 // === CONSTANTS ===
14 /**
15  * \brief Window Flags
16  * \{
17  */
18 //! Render the window
19 #define WINFLAG_SHOW            0x00000001
20 //! Window isn't contained within the parent/owner
21 #define WINFLAG_NONNESTED       0x00000002
22 //! Window contents are valid
23 #define WINFLAG_CLEAN           0x00000040
24 //! All child windows are un-changed
25 #define WINFLAG_CHILDCLEAN      0x00000080
26
27 #define WINFLAG_RENDER_MASK     0x00FFFF00
28 #define WINFLAG_USR_MASK        0xFF000000
29 /**
30  * \}
31  */
32
33 // === TYPES ===
34 typedef struct sWindow  tWindow;
35 typedef struct sWMRenderer      tWMRenderer;
36 typedef uint32_t        tColour;
37 typedef struct sFont    tFont;
38 typedef struct sIPC_Client      tIPC_Client;
39
40 // === FUNCTIONS ===
41 // --- Management
42 extern tWindow  *WM_CreateWindow(tWindow *Parent, tIPC_Client *Client, uint32_t ID, int Flags, const char *Renderer);
43 extern void     WM_Invalidate(tWindow *Window);
44 extern void     WM_FocusWindow(tWindow *Destination);
45 extern void     WM_RaiseWindow(tWindow *Window);
46 extern void     WM_ShowWindow(tWindow *Window, int bShow);
47 extern int      WM_ResizeWindow(tWindow *Window, int W, int H);
48 extern int      WM_MoveWindow(tWindow *Window, int X, int Y);
49 extern int      WM_SendMessage(tWindow *Source, tWindow *Dest, int MessageID, int Length, void *Data);
50 // --- Rendering
51 extern void     WM_Render_FillRect(tWindow *Window, int X, int Y, int W, int H, tColour Colour);
52 extern void     WM_Render_DrawRect(tWindow *Window, int X, int Y, int W, int H, tColour Colour);
53 extern int      WM_Render_DrawText(tWindow *Window, int X, int Y, int W, int H, tFont *Font, tColour Colour, const char *Text);
54 extern void     WM_Render_GetTextDims(tFont *Font, const char *Text, int *W, int *H);
55 extern void     WM_Render_DrawImage(tWindow *Window, int X, int Y, int W, int H, tImage *Image);
56 // NOTE: Should really be elsewhere
57 extern tColour  Video_AlphaBlend(tColour _orig, tColour _new, uint8_t _alpha);
58 #endif
59

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