use the -newos toolchain even if -elf is present.
[newos.git] / apps / window_server / WindowManager.h
blobd8ec86f4943c96a7d22cf560b8d160c77848bfcb
1 #ifndef _WINDOW_MANAGER_H
2 #define _WINDOW_MANAGER_H
4 #include <win/Rect.h>
6 class Renderer;
7 class Window;
9 const int kMaxWindows = 255;
11 class WindowManager {
12 public:
14 WindowManager(Renderer *screenRenderer);
15 ~WindowManager();
17 int WaitForExit();
19 private:
21 Window* CreateWindow(Window *parent, const Rect &rect, int eventPort, window_flags flags);
22 void DestroyWindow(Window *window);
23 Window* LookupWindow(int id);
24 Window* WindowAtPoint(int x, int y);
26 int RequestorPort() const;
27 static int StartDispatchThread(void *windowManager);
28 void DispatchThread();
29 void ReadServicePort(void*, int);
30 int ReadInt32();
31 short ReadInt16();
32 char ReadInt8();
33 void Respond(port_id, void *, int);
35 static int StartInputThread(void *_wm);
36 void InputThread();
38 void ProcessMouseEvent(const Event &event);
39 void SetCursorPos(int x, int y);
40 void LockCursor();
41 void UnlockCursor();
43 void InvalidateMouseBoundries();
45 void ProcessKeyboardEvent(const Event &event);
47 Window *fWindowArray[kMaxWindows];
48 int fNextWindowID;
50 port_id fServicePort;
51 char *fReceiveBuffer;
52 int fReceiveBufferSize;
53 int fReceiveBufferPos;
54 sem_id fCursorLock;
56 Rect fMouseBoundries;
57 Window *fCurrentMouseFocus;
58 bool fMouseFocusLocked;
59 bool fInFocusLockedWindow;
61 Renderer *fScreenRenderer;
65 #endif