Usermode/AxWin4 - Screen dimensions acquisition, speedup, window render
[tpg/acess2.git] / Usermode / Applications / axwin4_src / Server / include / CCompositor.hpp
1 /*
2  * Acess2 GUI v4
3  * - By John Hodge (thePowersGang) 
4  *
5  * CCompositor.hpp
6  * - Window Compositor
7  */
8 #ifndef _CCOMPOSITOR_H_
9 #define _CCOMPOSITOR_H_
10
11 #include <string>
12 #include <list>
13 #include <vector>
14 #include "CRect.hpp"
15 #include "CWindow.hpp"
16
17 namespace AxWin {
18
19 class CClient;
20 class CVideo;
21
22 struct TWindowID
23 {
24         uint16_t        Client;
25         uint16_t        Window;
26 };
27
28 enum eMouseButton
29 {
30         MOUSEBTN_MAIN,  // Left
31         MOUSEBTN_SECONDARY,     // Right
32         MOUSEBTN_MIDDLE,        // Scroll wheel
33         MOUSEBTN_BTN4,
34         MOUSEBTN_BTN5,
35 };
36
37 class CCompositor
38 {
39         CVideo& m_video;
40         ::std::list<CRect>      m_damageRects;
41         ::std::list<CWindow*>   m_windows;
42
43         ::std::vector<TWindowID>        m_windowIDBuffer;       // One 32-bit value per pixel
44         
45 public:
46         CCompositor(CVideo& video);
47
48         CWindow* CreateWindow(CClient& client, const ::std::string& name);
49
50         void    ShowWindow(CWindow* window);
51         void    HideWindow(CWindow* window);
52
53         bool    GetScreenDims(unsigned int ScrenID, unsigned int *Width, unsigned int *Height);
54
55         void    Redraw();
56         void    DamageArea(const CRect& rect);
57         void    BlitFromSurface(const CSurface& dest, const CRect& src_rect);
58         
59         void    MouseMove(unsigned int Cursor, unsigned int X, unsigned int Y, int dX, int dY);
60         void    MouseButton(unsigned int Cursor, unsigned int X, unsigned int Y, eMouseButton Button, bool Press);
61         
62         void    KeyState(unsigned int KeyboardID, uint32_t KeySym, bool Press, uint32_t Codepoint);
63 };
64
65
66 };
67
68 #endif
69

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