gui_window_manager.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2009 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 **    Harry Storbacka
00028 **    Mark Page
00029 */
00030 
00033 
00034 #pragma once
00035 
00036 #include "api_gui.h"
00037 #include "gui_component.h"
00038 #include "../Core/Signals/signal_v1.h"
00039 #include "../Core/Signals/signal_v2.h"
00040 #include "../Core/Signals/signal_v3.h"
00041 #include <vector>
00042 
00043 class CL_GraphicContext;
00044 class CL_InputEvent;
00045 class CL_InputState;
00046 class CL_Cursor;
00047 class CL_DisplayWindow;
00048 class CL_GUITopLevelWindow;
00049 class CL_GUIWindowManagerProvider;
00050 class CL_GUIWindowManager_Impl;
00051 
00055 class CL_API_DISPLAY CL_GUIWindowManagerSite
00056 {
00059 
00060 public:
00062         CL_Callback_v1<CL_GUITopLevelWindow *> *func_focus_lost;
00063 
00065         CL_Callback_v1<CL_GUITopLevelWindow *> *func_focus_gained;
00066 
00068         CL_Callback_v2<CL_GUITopLevelWindow *, const CL_Size &> *func_resize;
00069 
00071         CL_Callback_v2<CL_GUITopLevelWindow *, const CL_Rect &> *func_paint;
00072 
00074         CL_Callback_v1<CL_GUITopLevelWindow *> *func_close;
00075 
00077         CL_Callback_v3<CL_GUITopLevelWindow *, const CL_InputEvent &, const CL_InputState &> *func_input_received;
00079 };
00080 
00084 class CL_API_GUI CL_GUIWindowManager
00085 {
00088 
00089 public:
00090         enum CL_WindowManagerType
00091         {
00092                 cl_wm_type_system,
00093                 cl_wm_type_texture
00094         };
00096 
00099 public:
00103         CL_GUIWindowManager(CL_GUIWindowManagerProvider *provider);
00104 
00108         CL_GUIWindowManager(const CL_GUIWindowManager &copy);
00109 
00110         ~CL_GUIWindowManager();
00111 
00113 
00116 public:
00117 
00121         bool is_null();
00122 
00124         CL_GUIWindowManagerProvider *get_provider() const;
00125 
00129         CL_WindowManagerType get_window_manager_type() const;
00130 
00134 public:
00135 
00139         void set_site(CL_GUIWindowManagerSite *site);
00140         void create_window(
00141                 CL_GUITopLevelWindow *handle,
00142                 CL_GUITopLevelWindow *owner,
00143                 CL_GUITopLevelDescription description);
00144 
00148         void destroy_window(CL_GUITopLevelWindow *handle);
00149 
00154         void enable_window(CL_GUITopLevelWindow *handle, bool enable);
00155 
00161         bool has_focus(CL_GUITopLevelWindow *handle) const;
00162 
00168         void set_visible(CL_GUITopLevelWindow *handle, bool visible, bool activate_root_win);
00169 
00175         void set_geometry(CL_GUITopLevelWindow *handle, const CL_Rect &geometry, bool client_area);
00176 
00183         CL_Rect get_geometry(CL_GUITopLevelWindow *handle, bool client_area) const;
00184 
00192         CL_Point screen_to_window(CL_GUITopLevelWindow *handle, const CL_Point &screen_point, bool client_area) const;
00193 
00201         CL_Point window_to_screen(CL_GUITopLevelWindow *handle, const CL_Point &window_point, bool client_area) const;
00202 
00208         CL_GraphicContext& get_gc(CL_GUITopLevelWindow *handle) const;
00209 
00215         CL_InputContext& get_ic(CL_GUITopLevelWindow *handle) const;
00216 
00223         CL_GraphicContext begin_paint(CL_GUITopLevelWindow *handle, const CL_Rect &update_region);
00224 
00230         void set_cliprect(CL_GUITopLevelWindow *handle, CL_GraphicContext &gc, const CL_Rect &rect);
00231 
00236         void reset_cliprect(CL_GUITopLevelWindow *handle, CL_GraphicContext &gc);
00237 
00242         void push_cliprect(CL_GUITopLevelWindow *handle, CL_GraphicContext &gc, const CL_Rect &rect);
00243 
00248         void pop_cliprect(CL_GUITopLevelWindow *handle, CL_GraphicContext &gc);
00249 
00254         void end_paint(CL_GUITopLevelWindow *handle, const CL_Rect &update_region);
00255 
00260         void request_repaint(CL_GUITopLevelWindow *handle, const CL_Rect &update_region);
00261 
00265         void bring_to_front(CL_GUITopLevelWindow *handle);
00266 
00272         bool is_minimized(CL_GUITopLevelWindow *handle) const;
00273 
00279         bool is_maximized(CL_GUITopLevelWindow *handle) const;
00280 
00282         void process_message();
00283 
00288         void capture_mouse(CL_GUITopLevelWindow *handle, bool state);
00289 
00295         CL_DisplayWindow get_display_window(CL_GUITopLevelWindow *handle) const;
00296 
00301         void set_cursor(CL_GUITopLevelWindow *handle, const CL_Cursor &cursor);
00302 
00307         void set_cursor(CL_GUITopLevelWindow *handle, enum CL_StandardCursor type);
00308 
00312         void update();
00313 
00315         void setup_painting();
00316 
00318         void complete_painting();
00319 
00323 
00324 private:
00325         CL_SharedPtr<CL_GUIWindowManager_Impl> impl;
00327 };
00328 

Generated on Thu Dec 3 02:39:29 2009 for ClanLib by  doxygen 1.4.6