gui_window_manager.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2013 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Magnus Norddahl
27 ** Harry Storbacka
28 ** Mark Page
29 */
30 
31 
32 #pragma once
33 
34 #include "api_gui.h"
35 #include "gui_component.h"
36 #include "../Core/Signals/signal_v1.h"
37 #include "../Core/Signals/signal_v2.h"
38 #include "../Core/Signals/signal_v3.h"
39 #include <vector>
40 
41 namespace clan
42 {
45 
46 class Canvas;
47 class InputEvent;
48 class Cursor;
49 class DisplayWindow;
50 class GUITopLevelWindow;
51 class GUIWindowManagerProvider;
52 class GUIWindowManager_Impl;
53 
55 class CL_API_DISPLAY GUIWindowManagerSite
56 {
59 
60 public:
63 
66 
69 
72 
75 
78 
82 };
83 
85 class CL_API_GUI GUIWindowManager
86 {
89 
90 public:
92  {
94  cl_wm_type_texture
95  };
97 
100 public:
101 
104 
109 
112 
113  ~GUIWindowManager();
114 
116 
119 public:
120 
124  bool is_null() const;
125 
127  GUIWindowManagerProvider *get_provider() const;
128 
132  WindowManagerType get_window_manager_type() const;
133 
137 public:
138 
142  void set_site(GUIWindowManagerSite *site);
143  void create_window(
144  GUITopLevelWindow *handle,
145  GUITopLevelWindow *owner,
146  GUIComponent *component,
147  GUITopLevelDescription description);
148 
152  void destroy_window(GUITopLevelWindow *handle);
153 
158  void enable_window(GUITopLevelWindow *handle, bool enable);
159 
165  bool has_focus(GUITopLevelWindow *handle) const;
166 
172  void set_visible(GUITopLevelWindow *handle, bool visible, bool activate_root_win);
173 
179  void set_geometry(GUITopLevelWindow *handle, const Rect &geometry, bool client_area);
180 
187  Rect get_geometry(GUITopLevelWindow *handle, bool client_area) const;
188 
196  Point screen_to_window(GUITopLevelWindow *handle, const Point &screen_point, bool client_area) const;
197 
205  Point window_to_screen(GUITopLevelWindow *handle, const Point &window_point, bool client_area) const;
206 
212  Canvas& get_canvas(GUITopLevelWindow *handle) const;
213 
219  InputContext get_ic(GUITopLevelWindow *handle) const;
220 
227  Canvas begin_paint(GUITopLevelWindow *handle, const Rect &update_region);
228 
234  void set_cliprect(GUITopLevelWindow *handle, Canvas &canvas, const Rect &rect);
235 
240  void reset_cliprect(GUITopLevelWindow *handle, Canvas &canvas);
241 
247  void push_cliprect(GUITopLevelWindow *handle, Canvas &canvas, const Rect &rect);
248 
253  void pop_cliprect(GUITopLevelWindow *handle, Canvas &canvas);
254 
259  void end_paint(Canvas &canvas, GUITopLevelWindow *handle, const Rect &update_region);
260 
265  void request_repaint(GUITopLevelWindow *handle, const Rect &update_region);
266 
270  void bring_to_front(GUITopLevelWindow *handle);
271 
277  bool is_minimized(GUITopLevelWindow *handle) const;
278 
284  bool is_maximized(GUITopLevelWindow *handle) const;
285 
287  void process_message();
288 
293  void capture_mouse(GUITopLevelWindow *handle, bool state);
294 
300  DisplayWindow get_display_window(GUITopLevelWindow *handle) const;
301 
306  void set_cursor(GUITopLevelWindow *handle, const Cursor &cursor);
307 
312  void set_cursor(GUITopLevelWindow *handle, enum StandardCursor type);
313 
317  void update();
318 
322 
323 private:
324  std::shared_ptr<GUIWindowManager_Impl> impl;
326 };
327 
328 }
329 
Callback_v2< GUITopLevelWindow *, const InputEvent & > * func_input_received
Pointer to close notification callback function.
Definition: gui_window_manager.h:80
WindowManagerType
Definition: gui_window_manager.h:91
StandardCursor
Standard Cursor.
Definition: display_window.h:67
2D Graphics Canvas
Definition: canvas.h:70
Callback_v1< GUITopLevelWindow * > * func_focus_lost
Pointer to focus lost notification callback function.
Definition: gui_window_manager.h:62
Mouse cursor class.
Definition: cursor.h:48
GUI window manager site.
Definition: gui_window_manager.h:55
Definition: gui_window_manager.h:93
Callback_v1< GUITopLevelWindow * > * func_focus_gained
Pointer to focus gained notification callback function.
Definition: gui_window_manager.h:65
GUI base component class.
Definition: gui_component.h:81
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:453
GUI window manager interface.
Definition: gui_window_manager_provider.h:50
GUI window manager interface.
Definition: gui_window_manager.h:85
Callback_v2.
Definition: callback_v2.h:156
Callback_v1< GUITopLevelWindow * > * func_close
Pointer to close notification callback function.
Definition: gui_window_manager.h:74
2D (x,y) point structure - Integer
Definition: point.h:63
InputContext.
Definition: input_context.h:45
Callback_v2< GUITopLevelWindow *, const Size & > * func_resize
Pointer to focus gained notification callback function.
Definition: gui_window_manager.h:68
Display window description class.
Definition: display_window_description.h:53
Top-level window class.
Definition: display_window.h:85
Callback_v2< GUITopLevelWindow *, const Rect & > * func_paint
Pointer to paint notification callback function.
Definition: gui_window_manager.h:71
Callback_v1< GUITopLevelWindow * > * func_destroy
Pointer to destroy notification callback function.
Definition: gui_window_manager.h:77