~ubuntu-branches/ubuntu/precise/gtkmm3.0/precise

« back to all changes in this revision

Viewing changes to gdk/src/display.hg

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2011-06-17 00:12:44 UTC
  • Revision ID: james.westby@ubuntu.com-20110617001244-9hl5an15hiaaahi6
Tags: upstream-3.0.1
ImportĀ upstreamĀ versionĀ 3.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: display.hg,v 1.22 2006/04/12 11:11:24 murrayc Exp $ */
 
2
 
 
3
/* display.h
 
4
 *
 
5
 * Copyright (C) 1998-2002 The gtkmm Development Team
 
6
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
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.
 
20
 */
 
21
 
 
22
#include <vector>
 
23
 
 
24
#include <gdkmm/screen.h>
 
25
//#include <gdkmm/devicemanager.h>
 
26
#include <gdkmm/types.h> //For ModifierType
 
27
_DEFS(gdkmm,gdk)
 
28
_PINCLUDE(glibmm/private/object_p.h)
 
29
 
 
30
 
 
31
namespace Gdk
 
32
{
 
33
 
 
34
_CC_INCLUDE(gdk/gdk.h)
 
35
 
 
36
class DeviceManager;
 
37
 
 
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
 
41
 *
 
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.
 
46
 */
 
47
class Display : public Glib::Object
 
48
{
 
49
  _CLASS_GOBJECT(Display,GdkDisplay,GDK_DISPLAY,Glib::Object,GObject)
 
50
protected:
 
51
  _CTOR_DEFAULT
 
52
 
 
53
public:
 
54
  _WRAP_METHOD(static Glib::RefPtr<Display> open(const Glib::ustring& display_name), gdk_display_open, refreturn)
 
55
 
 
56
  _WRAP_METHOD(Glib::ustring get_name() const, gdk_display_get_name)
 
57
 
 
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)
 
61
 
 
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)
 
64
 
 
65
  _IGNORE(gdk_display_pointer_ungrab, gdk_display_keyboard_ungrab,
 
66
    gdk_display_pointer_is_grabbed, gdk_display_device_is_grabbed) //deprecated
 
67
 
 
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)
 
72
 
 
73
 
 
74
  _IGNORE(gdk_display_list_devices) //deprecated
 
75
 
 
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)
 
80
 
 
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)
 
85
 
 
86
 
 
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)
 
89
 
 
90
 
 
91
  _WRAP_METHOD(static Glib::RefPtr<Display> get_default(), gdk_display_get_default, refreturn)
 
92
 
 
93
 
 
94
  
 
95
  _IGNORE(gdk_display_get_pointer, gdk_display_get_core_pointer,
 
96
    gdk_display_get_window_at_pointer, gdk_display_warp_pointer) //deprecated
 
97
 
 
98
  _WRAP_METHOD(static Glib::RefPtr<Display> open_default_libgtk_only(), gdk_display_open_default_libgtk_only, refreturn)
 
99
 
 
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)
 
102
 
 
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);
 
105
 
 
106
  /** Send a response to SelectionRequest event.
 
107
   *
 
108
   * @newin{2,2}
 
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.
 
115
   */
 
116
  void selection_send_notify(const Glib::RefPtr<Window>& requestor, Glib::ustring& selection, Glib::ustring& target, Glib::ustring& property, guint32 time_);
 
117
 
 
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)
 
124
 
 
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)
 
127
 
 
128
  //TODO: wrap the vfuncs, though they are not very useful because people will not derive from this class? murrayc.
 
129
 
 
130
 
 
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)
 
133
 
 
134
  _WRAP_METHOD(bool supports_clipboard_persistence() const, gdk_display_supports_clipboard_persistence)
 
135
 
 
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.
 
140
   * @newin{2,6}
 
141
   *
 
142
   * @param clipboard_window A Gdk::Window belonging to the clipboard owner.
 
143
   * @param time_ A timestamp.
 
144
   */
 
145
  void store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_);
 
146
 
 
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)
 
149
 
 
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)
 
154
 
 
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)
 
157
 
 
158
  //TODO: Wrap GdkAppLaunchContext: _WRAP_METHOD(GdkAppLaunchContext* get_app_launch_context(), gdk_display_get_app_launch_context)
 
159
 
 
160
 
 
161
  //We use no_default_handler because GdkDisplayClass is private.
 
162
  
 
163
  /** The closed signal is emitted when the connection to the windowing
 
164
   * system for this display is closed.
 
165
   *
 
166
   * @param is_error true if the display was closed due to an error
 
167
   */
 
168
  _WRAP_SIGNAL(void closed(bool is_error), closed, no_default_handler)
 
169
  
 
170
  _WRAP_SIGNAL(void opened(), opened, no_default_handler)
 
171
};
 
172
 
 
173
} /* namespace Gdk */