Ardour  9.0-pre0-384-ga76afae0e9
gdkdisplay.h
Go to the documentation of this file.
1 /*
2  * gdkdisplay.h
3  *
4  * Copyright 2001 Sun Microsystems Inc.
5  *
6  * Erwann Chenede <erwann.chenede@sun.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
24 #ifndef __GDK_DISPLAY_H__
25 #define __GDK_DISPLAY_H__
26 
27 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
29 #endif
30 
31 #include <gdk/gdktypes.h>
32 #include <gdk/gdkevents.h>
33 
34 G_BEGIN_DECLS
35 
36 typedef struct _GdkDisplayClass GdkDisplayClass;
38 
39 #define GDK_TYPE_DISPLAY (gdk_display_get_type ())
40 #define GDK_DISPLAY_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY, GdkDisplay))
41 #define GDK_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY, GdkDisplayClass))
42 #define GDK_IS_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY))
43 #define GDK_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY))
44 #define GDK_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY, GdkDisplayClass))
45 
46 /* Tracks information about the keyboard grab on this display */
47 typedef struct
48 {
51  gulong serial;
52  gboolean owner_events;
53  guint32 time;
55 
56 /* Tracks information about which window and position the pointer last was in.
57  * This is useful when we need to synthesize events later.
58  * Note that we track toplevel_under_pointer using enter/leave events,
59  * so in the case of a grab, either with owner_events==FALSE or with the
60  * pointer in no clients window the x/y coordinates may actually be outside
61  * the window.
62  */
63 typedef struct
64 {
65  GdkWindow *toplevel_under_pointer; /* The toplevel window with mouse inside, tracked via native events */
66  GdkWindow *window_under_pointer; /* The window that last got sent a normal enter event */
67  gdouble toplevel_x, toplevel_y;
68  guint32 state;
69  guint32 button;
70  gulong motion_hint_serial; /* 0 == didn't deliver hinted motion event */
72 
74 {
75  GObject parent_instance;
76 
77  /*< private >*/
78  GList *GSEAL (queued_events);
79  GList *GSEAL (queued_tail);
80 
81  /* Information for determining if the latest button click
82  * is part of a double-click or triple-click
83  */
84  guint32 GSEAL (button_click_time[2]); /* The last 2 button click times. */
85  GdkWindow *GSEAL (button_window[2]); /* The last 2 windows to receive button presses. */
86  gint GSEAL (button_number[2]); /* The last 2 buttons to be pressed. */
87 
88  guint GSEAL (double_click_time); /* Maximum time between clicks in msecs */
89  GdkDevice *GSEAL (core_pointer); /* Core pointer device */
90 
91  const GdkDisplayPointerHooks *GSEAL (pointer_hooks); /* Current hooks for querying pointer */
92 
93  guint GSEAL (closed) : 1; /* Whether this display has been closed */
94  guint GSEAL (ignore_core_events) : 1; /* Don't send core motion and button event */
95 
96  guint GSEAL (double_click_distance); /* Maximum distance between clicks in pixels */
97  gint GSEAL (button_x[2]); /* The last 2 button click positions. */
98  gint GSEAL (button_y[2]);
99 
100  GList *GSEAL (pointer_grabs);
101  GdkKeyboardGrabInfo GSEAL (keyboard_grab);
102  GdkPointerWindowInfo GSEAL (pointer_info);
103 
104  GHashTable *GSEAL (touch_grabs);
105 
106  /* Last reported event time from server */
107  guint32 GSEAL (last_event_time);
108 };
109 
111 {
112  GObjectClass parent_class;
113 
114  const gchar * (*get_display_name) (GdkDisplay *display);
115  gint (*get_n_screens) (GdkDisplay *display);
116  GdkScreen * (*get_screen) (GdkDisplay *display,
117  gint screen_num);
118  GdkScreen * (*get_default_screen) (GdkDisplay *display);
119 
120 
121  /* Signals */
122  void (*closed) (GdkDisplay *display,
123  gboolean is_error);
124 };
125 
127 {
128  void (*get_pointer) (GdkDisplay *display,
129  GdkScreen **screen,
130  gint *x,
131  gint *y,
132  GdkModifierType *mask);
133  GdkWindow* (*window_get_pointer) (GdkDisplay *display,
134  GdkWindow *window,
135  gint *x,
136  gint *y,
137  GdkModifierType *mask);
138  GdkWindow* (*window_at_pointer) (GdkDisplay *display,
139  gint *win_x,
140  gint *win_y);
141 };
142 
143 GType gdk_display_get_type (void) G_GNUC_CONST;
144 GdkDisplay *gdk_display_open (const gchar *display_name);
145 
146 const gchar * gdk_display_get_name (GdkDisplay *display);
147 
150  gint screen_num);
153  guint32 time_);
155  guint32 time_);
157 void gdk_display_beep (GdkDisplay *display);
158 void gdk_display_sync (GdkDisplay *display);
160 
162 gboolean gdk_display_is_closed (GdkDisplay *display);
163 
165 
169  const GdkEvent *event);
170 
172  GdkAtom message_type,
173  GdkFilterFunc func,
174  gpointer data);
175 
177  guint msec);
179  guint distance);
180 
182 
184 
186  GdkScreen **screen,
187  gint *x,
188  gint *y,
189  GdkModifierType *mask);
191  gint *win_x,
192  gint *win_y);
194  GdkScreen *screen,
195  gint x,
196  gint y);
197 
198 #ifndef GDK_DISABLE_DEPRECATED
200  const GdkDisplayPointerHooks *new_hooks);
201 #endif
202 
204 
209  guint *width,
210  guint *height);
211 
213 
217 
220  GdkWindow *clipboard_window,
221  guint32 time_,
222  const GdkAtom *targets,
223  gint n_targets);
224 
228 
229 G_END_DECLS
230 
231 #endif /* __GDK_DISPLAY_H__ */
void gdk_display_get_pointer(GdkDisplay *display, GdkScreen **screen, gint *x, gint *y, GdkModifierType *mask)
GdkScreen * gdk_display_get_default_screen(GdkDisplay *display)
void gdk_display_set_double_click_distance(GdkDisplay *display, guint distance)
GType gdk_display_get_type(void) G_GNUC_CONST
void gdk_display_keyboard_ungrab(GdkDisplay *display, guint32 time_)
gboolean gdk_display_is_closed(GdkDisplay *display)
GdkWindow * gdk_display_get_default_group(GdkDisplay *display)
GdkWindow * gdk_display_get_window_at_pointer(GdkDisplay *display, gint *win_x, gint *win_y)
gint gdk_display_get_n_screens(GdkDisplay *display)
void gdk_display_flush(GdkDisplay *display)
void gdk_display_warp_pointer(GdkDisplay *display, GdkScreen *screen, gint x, gint y)
GdkScreen * gdk_display_get_screen(GdkDisplay *display, gint screen_num)
typedefG_BEGIN_DECLS struct _GdkDisplayClass GdkDisplayClass
Definition: gdkdisplay.h:36
gboolean gdk_display_pointer_is_grabbed(GdkDisplay *display)
guint gdk_display_get_default_cursor_size(GdkDisplay *display)
GdkEvent * gdk_display_get_event(GdkDisplay *display)
GdkDevice * gdk_display_get_core_pointer(GdkDisplay *display)
GList * gdk_display_list_devices(GdkDisplay *display)
void gdk_display_get_maximal_cursor_size(GdkDisplay *display, guint *width, guint *height)
void gdk_display_beep(GdkDisplay *display)
gboolean gdk_display_request_selection_notification(GdkDisplay *display, GdkAtom selection)
void gdk_display_close(GdkDisplay *display)
gboolean gdk_display_supports_input_shapes(GdkDisplay *display)
GdkDisplay * gdk_display_get_default(void)
gboolean gdk_display_supports_clipboard_persistence(GdkDisplay *display)
GdkDisplayPointerHooks * gdk_display_set_pointer_hooks(GdkDisplay *display, const GdkDisplayPointerHooks *new_hooks)
void gdk_display_store_clipboard(GdkDisplay *display, GdkWindow *clipboard_window, guint32 time_, const GdkAtom *targets, gint n_targets)
gboolean gdk_display_supports_selection_notification(GdkDisplay *display)
void gdk_display_pointer_ungrab(GdkDisplay *display, guint32 time_)
const gchar * gdk_display_get_name(GdkDisplay *display)
GdkDisplay * gdk_display_open(const gchar *display_name)
gboolean gdk_display_supports_cursor_alpha(GdkDisplay *display)
GdkEvent * gdk_display_peek_event(GdkDisplay *display)
gboolean gdk_display_supports_cursor_color(GdkDisplay *display)
void gdk_display_put_event(GdkDisplay *display, const GdkEvent *event)
void gdk_display_set_double_click_time(GdkDisplay *display, guint msec)
gboolean gdk_display_supports_shapes(GdkDisplay *display)
GdkDisplay * gdk_display_open_default_libgtk_only(void)
void gdk_display_add_client_message_filter(GdkDisplay *display, GdkAtom message_type, GdkFilterFunc func, gpointer data)
void gdk_display_sync(GdkDisplay *display)
gboolean gdk_display_supports_composite(GdkDisplay *display)
GdkFilterReturn(* GdkFilterFunc)(GdkXEvent *xevent, GdkEvent *event, gpointer data)
Definition: gdkevents.h:88
struct _GdkAtom * GdkAtom
Definition: gdktypes.h:80
GdkModifierType
Definition: gdktypes.h:127
gboolean owner_events
Definition: gdkdisplay.h:52
GdkWindow * native_window
Definition: gdkdisplay.h:50
GdkWindow * window
Definition: gdkdisplay.h:49
gulong motion_hint_serial
Definition: gdkdisplay.h:70
GdkWindow * toplevel_under_pointer
Definition: gdkdisplay.h:65
GdkWindow * window_under_pointer
Definition: gdkdisplay.h:66
gint(* get_n_screens)(GdkDisplay *display)
Definition: gdkdisplay.h:115
GObjectClass parent_class
Definition: gdkdisplay.h:112
void(* closed)(GdkDisplay *display, gboolean is_error)
Definition: gdkdisplay.h:122
void(* get_pointer)(GdkDisplay *display, GdkScreen **screen, gint *x, gint *y, GdkModifierType *mask)
Definition: gdkdisplay.h:128
GdkPointerWindowInfo GSEAL(pointer_info)
GList * GSEAL(queued_tail)
guint GSEAL(double_click_time)
GList * GSEAL(queued_events)
const GdkDisplayPointerHooks * GSEAL(pointer_hooks)
GList * GSEAL(pointer_grabs)
GdkKeyboardGrabInfo GSEAL(keyboard_grab)
GHashTable * GSEAL(touch_grabs)
GdkDevice * GSEAL(core_pointer)
guint32 GSEAL(last_event_time)
guint GSEAL(closed) guint GSEAL(ignore_core_events) guint GSEAL(double_click_distance)
GObject parent_instance
Definition: gdkdisplay.h:75
gint GSEAL(button_number[2])
guint32 GSEAL(button_click_time[2])
gint GSEAL(button_x[2])
GdkWindow * GSEAL(button_window[2])
gint GSEAL(button_y[2])
link region and track selection
gint height
Definition: xcursors.h:1
gint width
Definition: xcursors.h:1