1
/* $Id: display.hg,v 1.22 2006/04/12 11:11:24 murrayc Exp $ */
5
* Copyright (C) 1998-2002 The gtkmm Development Team
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free
19
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
#include <gdkmm/screen.h>
25
//#include <gdkmm/devicemanager.h>
26
#include <gdkmm/types.h> //For ModifierType
28
_PINCLUDE(glibmm/private/object_p.h)
34
_CC_INCLUDE(gdk/gdk.h)
38
/** Gdk::Display object's purpose is two fold:
39
* To grab/ungrab keyboard focus and mouse pointer
40
* To manage and provide information about the Gdk::Screen(s) available for this Gdk::Display
42
* Gdk::Display objects are the GDK representation of the X Display which can be described as a workstation consisting
43
* of a keyboard a pointing device (such as a mouse) and one or more screens. It is used to open and keep track of
44
* various Gdk::Screen objects currently instantiated by the application. It is also used to grab and release the keyboard
45
* and the mouse pointer.
47
class Display : public Glib::Object
49
_CLASS_GOBJECT(Display,GdkDisplay,GDK_DISPLAY,Glib::Object,GObject)
54
_WRAP_METHOD(static Glib::RefPtr<Display> open(const Glib::ustring& display_name), gdk_display_open, refreturn)
56
_WRAP_METHOD(Glib::ustring get_name() const, gdk_display_get_name)
58
_WRAP_METHOD(int get_n_screens() const, gdk_display_get_n_screens)
59
_WRAP_METHOD(Glib::RefPtr<Screen> get_screen(int screen_num), gdk_display_get_screen, refreturn)
60
_WRAP_METHOD(Glib::RefPtr<const Screen> get_screen(int screen_num) const, gdk_display_get_screen, refreturn, constversion)
62
_WRAP_METHOD(Glib::RefPtr<Screen> get_default_screen(), gdk_display_get_default_screen, refreturn)
63
_WRAP_METHOD(Glib::RefPtr<const Screen> get_default_screen() const, gdk_display_get_default_screen, refreturn, constversion)
65
_IGNORE(gdk_display_pointer_ungrab, gdk_display_keyboard_ungrab,
66
gdk_display_pointer_is_grabbed, gdk_display_device_is_grabbed) //deprecated
68
_WRAP_METHOD(void beep(), gdk_display_beep)
69
_WRAP_METHOD(void sync(), gdk_display_sync)
70
_WRAP_METHOD(void close(), gdk_display_close)
71
_WRAP_METHOD(bool is_closed() const, gdk_display_is_closed)
74
_IGNORE(gdk_display_list_devices) //deprecated
76
//TODO: Use C++ Gdk::Event:
77
//TODO: get_event() might remove the event - if so, then there should not be a const version:
78
_WRAP_METHOD(GdkEvent* get_event(), gdk_display_get_event)
79
_WRAP_METHOD(const GdkEvent* get_event() const, gdk_display_get_event, constversion)
81
_WRAP_METHOD(GdkEvent* peek_event(), gdk_display_peek_event)
82
_WRAP_METHOD(GdkEvent* peek_event() const, gdk_display_peek_event, constversion)
83
_WRAP_METHOD(void put_event(GdkEvent* event), gdk_display_put_event)
84
_WRAP_METHOD(bool has_pending() const, gdk_display_has_pending)
87
_WRAP_METHOD(void set_double_click_time(guint msec), gdk_display_set_double_click_time)
88
_WRAP_METHOD(void set_double_click_distance(guint distance), gdk_display_set_double_click_distance)
91
_WRAP_METHOD(static Glib::RefPtr<Display> get_default(), gdk_display_get_default, refreturn)
95
_IGNORE(gdk_display_get_pointer, gdk_display_get_core_pointer,
96
gdk_display_get_window_at_pointer, gdk_display_warp_pointer) //deprecated
98
_WRAP_METHOD(static Glib::RefPtr<Display> open_default_libgtk_only(), gdk_display_open_default_libgtk_only, refreturn)
100
_WRAP_METHOD(GdkKeymap* get_keymap(), gdk_keymap_get_for_display)
101
_WRAP_METHOD(const GdkKeymap* get_keymap() const, gdk_keymap_get_for_display, constversion)
103
bool set_selection_owner(const Glib::RefPtr<Window>& owner, Glib::ustring& selection, guint32 time_, bool send_event);
104
Glib::RefPtr<Window> get_selection_owner(const Glib::ustring& selection);
106
/** Send a response to SelectionRequest event.
109
* @param requestor Window to which to deliver response.
110
* @param selection Selection that was requested.
111
* @param target Target that was selected.
112
* @param property Property in which the selection owner stored the data,
113
* or "None" to indicate that the request was rejected.
114
* @param time_ Timestamp.
116
void selection_send_notify(const Glib::RefPtr<Window>& requestor, Glib::ustring& selection, Glib::ustring& target, Glib::ustring& property, guint32 time_);
118
_WRAP_METHOD(void flush(), gdk_display_flush)
119
//TODO: Read the docs to know what the types are really: _WRAP_METHOD(GdkDisplayDeviceHooks* set_device_hooks(const GdkDisplayDeviceHooks *new_hooks), gdk_display_set_device_hooks)
120
_WRAP_METHOD(bool supports_cursor_alpha() const, gdk_display_supports_cursor_alpha)
121
_WRAP_METHOD(bool supports_cursor_color() const, gdk_display_supports_cursor_color)
122
_WRAP_METHOD(guint get_default_cursor_size() const, gdk_display_get_default_cursor_size)
123
_WRAP_METHOD(void get_maximal_cursor_size(guint& width, guint& height), gdk_display_get_maximal_cursor_size)
125
_WRAP_METHOD(Glib::RefPtr<Window> get_default_group(), gdk_display_get_default_group, refreturn)
126
_WRAP_METHOD(Glib::RefPtr<const Window> get_default_group() const, gdk_display_get_default_group, refreturn, constversion)
128
//TODO: wrap the vfuncs, though they are not very useful because people will not derive from this class? murrayc.
131
_WRAP_METHOD(bool supports_selection_notification() const, gdk_display_supports_selection_notification)
132
_WRAP_METHOD(bool request_selection_notification(const Glib::ustring& selection), gdk_display_request_selection_notification)
134
_WRAP_METHOD(bool supports_clipboard_persistence() const, gdk_display_supports_clipboard_persistence)
136
/** Issues a request to the clipboard manager to store the clipboard data,
137
* saving all available targets.
138
* On X11, this is a special program that works according to the freedesktop clipboard specification,
139
* available at http://www.freedesktop.org/Standards/clipboard-manager-spec.
142
* @param clipboard_window A Gdk::Window belonging to the clipboard owner.
143
* @param time_ A timestamp.
145
void store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_);
147
void store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_, const std::vector<Glib::ustring>& targets);
148
_IGNORE(gdk_display_store_clipboard)
150
_WRAP_METHOD(bool supports_shapes() const, gdk_display_supports_shapes)
151
_WRAP_METHOD(bool supports_input_shapes() const, gdk_display_supports_input_shapes)
152
_WRAP_METHOD(bool supports_composite() const, gdk_display_supports_composite)
153
_WRAP_METHOD(void notify_startup_complete(const Glib::ustring& startup_id), gdk_display_notify_startup_complete)
155
_WRAP_METHOD(Glib::RefPtr<DeviceManager> get_device_manager(), gdk_display_get_device_manager, refreturn)
156
_WRAP_METHOD(Glib::RefPtr<const DeviceManager> get_device_manager() const, gdk_display_get_device_manager, refreturn, constversion)
158
//TODO: Wrap GdkAppLaunchContext: _WRAP_METHOD(GdkAppLaunchContext* get_app_launch_context(), gdk_display_get_app_launch_context)
161
//We use no_default_handler because GdkDisplayClass is private.
163
/** The closed signal is emitted when the connection to the windowing
164
* system for this display is closed.
166
* @param is_error true if the display was closed due to an error
168
_WRAP_SIGNAL(void closed(bool is_error), closed, no_default_handler)
170
_WRAP_SIGNAL(void opened(), opened, no_default_handler)
173
} /* namespace Gdk */