Usermode/AxWin4 - Send mouse/keyboard events to client
[tpg/acess2.git] / Usermode / Applications / axwin4_src / Server / include / CCompositor.hpp
index 48b17c6..fe24303 100644 (file)
@@ -8,6 +8,7 @@
 #ifndef _CCOMPOSITOR_H_
 #define _CCOMPOSITOR_H_
 
+#include <string>
 #include <list>
 #include <vector>
 #include "CRect.hpp"
@@ -18,11 +19,6 @@ namespace AxWin {
 class CClient;
 class CVideo;
 
-struct TWindowID
-{
-       uint16_t        Client;
-       uint16_t        Window;
-};
 
 enum eMouseButton
 {
@@ -33,28 +29,51 @@ enum eMouseButton
        MOUSEBTN_BTN5,
 };
 
+class CWindowIDBuffer
+{
+       struct TWindowID
+       {
+               uint16_t        Client;
+               uint16_t        Window;
+       };
+       unsigned int    m_w;
+       ::std::vector<TWindowID>        m_buf;
+public:
+       CWindowIDBuffer(unsigned int W, unsigned int H);
+       
+       void set(unsigned int X, unsigned int Y, unsigned int W, unsigned int H, CWindow* win);
+       CWindow* get(unsigned int X, unsigned int Y);
+};
+
 class CCompositor
 {
        CVideo& m_video;
        ::std::list<CRect>      m_damageRects;
        ::std::list<CWindow*>   m_windows;
+       CWindow*        m_focussed_window;
 
-       ::std::vector<TWindowID>        m_windowIDBuffer;       // One 32-bit value per pixel
-       //::std::vector<CPixel>         m_frameBuffer;  // Local copy of the framebuffer (needed?)
+       CWindowIDBuffer m_windowIDBuffer;       // One 32-bit value per pixel
        
 public:
        CCompositor(CVideo& video);
 
-       CWindow* CreateWindow(CClient& client);
+       CWindow* CreateWindow(CClient& client, const ::std::string& name);
+
+       void    ShowWindow(CWindow* window);
+       void    HideWindow(CWindow* window);
+
+       bool    GetScreenDims(unsigned int ScrenID, unsigned int *Width, unsigned int *Height);
 
        void    Redraw();
        void    DamageArea(const CRect& rect);
        void    BlitFromSurface(const CSurface& dest, const CRect& src_rect);
        
-       void    MouseMove(unsigned int CursorID,  unsigned int X, unsigned int Y,  int dX, int dY);
-       void    MouseButton(unsigned int CursorID,  unsigned int X, unsigned int Y,  eMouseButton Button, bool Press);
+       void    MouseMove(unsigned int Cursor, unsigned int X, unsigned int Y, int dX, int dY);
+       void    MouseButton(unsigned int Cursor, unsigned int X, unsigned int Y, eMouseButton Button, bool Press);
        
        void    KeyState(unsigned int KeyboardID, uint32_t KeySym, bool Press, uint32_t Codepoint);
+public:
+       CWindow*        getWindowForCoord(unsigned int X, unsigned int Y);
 };
 
 

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