ClanLib  2.3.7
display_window_provider.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 ** Kenneth Gangstoe
29 */
30 
33 
34 #pragma once
35 
36 #include "../api_display.h"
37 #include "../../Core/System/sharedptr.h"
38 #include "../../Core/System/weakptr.h"
39 #include "../../Core/Text/string_types.h"
40 #include "../../Core/Signals/signal_v0.h"
41 #include "../../Core/Signals/signal_v1.h"
42 #include "../../Core/Signals/signal_v2.h"
43 #include "../../Core/Signals/callback_v1.h"
44 #include "../Window/display_window.h"
45 
46 #if !defined(WIN32) && !defined(__APPLE__)
47 #include <X11/Xlib.h>
48 #endif
49 
50 class CL_Point;
52 class CL_GraphicContext;
53 class CL_InputContext;
54 class CL_CursorProvider;
56 
61 {
64 public:
67 
70 
73 
76 
79 
82 
85 
88 
91 
94 
97 
101 };
102 
107 {
110 public:
111  virtual ~CL_DisplayWindowProvider() { return; }
112 
116 public:
118  virtual CL_Rect get_geometry() const = 0;
119 
121  virtual CL_Rect get_viewport() const = 0;
122 
124  virtual bool has_focus() const = 0;
125 
127  virtual bool is_minimized() const = 0;
128 
130  virtual bool is_maximized() const = 0;
131 
133  virtual bool is_visible() const = 0;
134 
136  virtual bool is_fullscreen() const = 0;
137 
139  virtual CL_Size get_minimum_size(bool client_area) const = 0;
140 
142  virtual CL_Size get_maximum_size(bool client_area) const = 0;
143 
145  virtual CL_String get_title() const = 0;
146 
148  virtual CL_GraphicContext& get_gc() = 0;
149 
151  virtual CL_InputContext& get_ic() = 0;
152 
153 #ifdef WIN32
154 
158  virtual HWND get_hwnd() const = 0;
159 #elif defined(__APPLE__)
160  // nothing
161 #else
162  virtual Display *get_display() const = 0;
164 
166  virtual Window get_window() const = 0;
167 #endif
168 
170  virtual bool is_clipboard_text_available() const = 0;
171 
173  virtual bool is_clipboard_image_available() const = 0;
174 
176  virtual CL_String get_clipboard_text() const = 0;
177 
179  virtual CL_PixelBuffer get_clipboard_image() const = 0;
180 
184 public:
186  virtual CL_Point client_to_screen(const CL_Point &client) = 0;
187 
189  virtual CL_Point screen_to_client(const CL_Point &screen) = 0;
190 
192  virtual void capture_mouse(bool capture) = 0;
193 
195  virtual void request_repaint(const CL_Rect &rect) = 0;
196 
198  virtual void destroy() = 0;
199 
201  virtual void create(CL_DisplayWindowSite *site, const CL_DisplayWindowDescription &description) = 0;
202 
204  virtual void show_system_cursor() = 0;
205 
207  virtual CL_CursorProvider *create_cursor(const CL_SpriteDescription &sprite_description, const CL_Point &hotspot) = 0;
208 
210  virtual void set_cursor(CL_CursorProvider *cursor) = 0;
211 
213  virtual void set_cursor(enum CL_StandardCursor type) = 0;
214 
216  virtual void hide_system_cursor() = 0;
217 
219  virtual void set_title(const CL_StringRef &new_title) = 0;
220 
222  virtual void set_position(const CL_Rect &pos, bool client_area) = 0;
223 
229  virtual void set_size(int width, int height, bool client_area) = 0;
230 
236  virtual void set_minimum_size(int width, int height, bool client_area) = 0;
237 
243  virtual void set_maximum_size(int width, int height, bool client_area) = 0;
244 
246  virtual void set_enabled(bool enable) = 0;
247 
249  virtual void minimize() = 0;
250 
252  virtual void restore() = 0;
253 
255  virtual void maximize() = 0;
256 
258  virtual void show(bool activate) = 0;
259 
261  virtual void hide() = 0;
262 
264  virtual void bring_to_front() = 0;
265 
267  virtual void flip(int interval) = 0;
268 
270  virtual void update(const CL_Rect &rect) = 0;
271 
273  virtual void set_clipboard_text(const CL_StringRef &text) = 0;
274 
276  virtual void set_clipboard_image(const CL_PixelBuffer &buf) = 0;
277 
279  virtual void set_large_icon(const CL_PixelBuffer &image) = 0;
280 
282  virtual void set_small_icon(const CL_PixelBuffer &image) = 0;
283 
287 private:
289 };
290