ClanLib  2.3.7
gui_window_manager.h
Go to the documentation of this file.
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2011 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 
33 
34 #pragma once
35 
36 #include "api_gui.h"
37 #include "gui_component.h"
38 #include "../Core/Signals/signal_v1.h"
39 #include "../Core/Signals/signal_v2.h"
40 #include "../Core/Signals/signal_v3.h"
41 #include <vector>
42 
43 class CL_GraphicContext;
44 class CL_InputEvent;
45 class CL_InputState;
46 class CL_Cursor;
47 class CL_DisplayWindow;
48 class CL_GUITopLevelWindow;
50 class CL_GUIWindowManager_Impl;
51 
56 {
59 
60 public:
63 
66 
69 
72 
75 
78 
82 };
83 
88 {
91 
92 public:
94  {
96  cl_wm_type_texture
97  };
99 
102 public:
103 
106 
111 
114 
116 
118 
121 public:
122 
126  bool is_null() const;
127 
129  CL_GUIWindowManagerProvider *get_provider() const;
130 
134  CL_WindowManagerType get_window_manager_type() const;
135 
139 public:
140 
144  void set_site(CL_GUIWindowManagerSite *site);
145  void create_window(
146  CL_GUITopLevelWindow *handle,
147  CL_GUITopLevelWindow *owner,
148  CL_GUIComponent *component,
149  CL_GUITopLevelDescription description);
150 
154  void destroy_window(CL_GUITopLevelWindow *handle);
155 
160  void enable_window(CL_GUITopLevelWindow *handle, bool enable);
161 
167  bool has_focus(CL_GUITopLevelWindow *handle) const;
168 
174  void set_visible(CL_GUITopLevelWindow *handle, bool visible, bool activate_root_win);
175 
181  void set_geometry(CL_GUITopLevelWindow *handle, const CL_Rect &geometry, bool client_area);
182 
189  CL_Rect get_geometry(CL_GUITopLevelWindow *handle, bool client_area) const;
190 
198  CL_Point screen_to_window(CL_GUITopLevelWindow *handle, const CL_Point &screen_point, bool client_area) const;
199 
207  CL_Point window_to_screen(CL_GUITopLevelWindow *handle, const CL_Point &window_point, bool client_area) const;
208 
214  CL_GraphicContext& get_gc(CL_GUITopLevelWindow *handle) const;
215 
221  CL_InputContext& get_ic(CL_GUITopLevelWindow *handle) const;
222 
229  CL_GraphicContext begin_paint(CL_GUITopLevelWindow *handle, const CL_Rect &update_region);
230 
236  void set_cliprect(CL_GUITopLevelWindow *handle, CL_GraphicContext &gc, const CL_Rect &rect);
237 
242  void reset_cliprect(CL_GUITopLevelWindow *handle, CL_GraphicContext &gc);
243 
249  void push_cliprect(CL_GUITopLevelWindow *handle, CL_GraphicContext &gc, const CL_Rect &rect);
250 
255  void pop_cliprect(CL_GUITopLevelWindow *handle, CL_GraphicContext &gc);
256 
261  void end_paint(CL_GUITopLevelWindow *handle, const CL_Rect &update_region);
262 
267  void request_repaint(CL_GUITopLevelWindow *handle, const CL_Rect &update_region);
268 
272  void bring_to_front(CL_GUITopLevelWindow *handle);
273 
279  bool is_minimized(CL_GUITopLevelWindow *handle) const;
280 
286  bool is_maximized(CL_GUITopLevelWindow *handle) const;
287 
289  void process_message();
290 
295  void capture_mouse(CL_GUITopLevelWindow *handle, bool state);
296 
302  CL_DisplayWindow get_display_window(CL_GUITopLevelWindow *handle) const;
303 
308  void set_cursor(CL_GUITopLevelWindow *handle, const CL_Cursor &cursor);
309 
314  void set_cursor(CL_GUITopLevelWindow *handle, enum CL_StandardCursor type);
315 
319  void update();
320 
322  void setup_painting();
323 
325  void complete_painting();
326 
330 
331 private:
332  CL_SharedPtr<CL_GUIWindowManager_Impl> impl;
334 };
335