2002-04-25 22:29:14 +00:00
|
|
|
/*
|
|
|
|
* gdkdisplay.h
|
|
|
|
*
|
|
|
|
* Copyright 2001 Sun Microsystems Inc.
|
|
|
|
*
|
|
|
|
* Erwann Chenede <erwann.chenede@sun.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2009-10-21 18:30:04 +00:00
|
|
|
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
2008-05-28 14:01:57 +00:00
|
|
|
#error "Only <gdk/gdk.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
#ifndef __GDK_DISPLAY_H__
|
|
|
|
#define __GDK_DISPLAY_H__
|
|
|
|
|
|
|
|
#include <gdk/gdktypes.h>
|
|
|
|
#include <gdk/gdkevents.h>
|
2010-05-25 22:38:44 +00:00
|
|
|
#include <gdk/gdkdevicemanager.h>
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
typedef struct _GdkDisplayClass GdkDisplayClass;
|
2002-10-07 19:42:49 +00:00
|
|
|
typedef struct _GdkDisplayPointerHooks GdkDisplayPointerHooks;
|
2010-05-25 22:38:44 +00:00
|
|
|
typedef struct _GdkDisplayDeviceHooks GdkDisplayDeviceHooks;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
#define GDK_TYPE_DISPLAY (gdk_display_get_type ())
|
|
|
|
#define GDK_DISPLAY_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY, GdkDisplay))
|
|
|
|
#define GDK_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY, GdkDisplayClass))
|
|
|
|
#define GDK_IS_DISPLAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY))
|
|
|
|
#define GDK_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY))
|
|
|
|
#define GDK_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY, GdkDisplayClass))
|
|
|
|
|
2009-01-23 14:05:44 +00:00
|
|
|
/* Tracks information about the keyboard grab on this display */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GdkWindow *window;
|
|
|
|
GdkWindow *native_window;
|
|
|
|
gulong serial;
|
|
|
|
gboolean owner_events;
|
|
|
|
guint32 time;
|
|
|
|
} GdkKeyboardGrabInfo;
|
|
|
|
|
2008-12-15 09:24:54 +00:00
|
|
|
/* Tracks information about which window and position the pointer last was in.
|
|
|
|
* This is useful when we need to synthesize events later.
|
|
|
|
* Note that we track toplevel_under_pointer using enter/leave events,
|
|
|
|
* so in the case of a grab, either with owner_events==FALSE or with the
|
|
|
|
* pointer in no clients window the x/y coordinates may actually be outside
|
|
|
|
* the window.
|
2008-07-18 13:03:42 +00:00
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
2008-12-15 09:24:54 +00:00
|
|
|
GdkWindow *toplevel_under_pointer; /* The toplevel window with mouse inside, tracked via native events */
|
|
|
|
GdkWindow *window_under_pointer; /* The window that last got sent a normal enter event */
|
|
|
|
gdouble toplevel_x, toplevel_y;
|
2008-07-18 13:03:42 +00:00
|
|
|
guint32 state;
|
2009-01-23 12:04:44 +00:00
|
|
|
guint32 button;
|
2008-07-18 13:03:42 +00:00
|
|
|
} GdkPointerWindowInfo;
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
guint32 button_click_time[2]; /* The last 2 button click times. */
|
|
|
|
GdkWindow *button_window[2]; /* The last 2 windows to receive button presses. */
|
|
|
|
gint button_number[2]; /* The last 2 buttons to be pressed. */
|
|
|
|
gint button_x[2]; /* The last 2 button click positions. */
|
|
|
|
gint button_y[2];
|
|
|
|
} GdkMultipleClickInfo;
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
struct _GdkDisplay
|
|
|
|
{
|
|
|
|
GObject parent_instance;
|
|
|
|
|
|
|
|
/*< private >*/
|
2010-05-25 15:54:16 +00:00
|
|
|
GList *GSEAL (queued_events);
|
|
|
|
GList *GSEAL (queued_tail);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
/* Information for determining if the latest button click
|
|
|
|
* is part of a double-click or triple-click
|
|
|
|
*/
|
2010-05-25 22:38:44 +00:00
|
|
|
GHashTable *GSEAL (multiple_click_info);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2010-05-25 15:54:16 +00:00
|
|
|
guint GSEAL (double_click_time); /* Maximum time between clicks in msecs */
|
|
|
|
GdkDevice *GSEAL (core_pointer); /* Core pointer device */
|
2002-06-18 23:23:30 +00:00
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
const GdkDisplayDeviceHooks *GSEAL (device_hooks); /* Current hooks for querying pointer */
|
2002-10-07 19:42:49 +00:00
|
|
|
|
2010-05-25 15:54:16 +00:00
|
|
|
guint GSEAL (closed) : 1; /* Whether this display has been closed */
|
|
|
|
guint GSEAL (ignore_core_events) : 1; /* Don't send core motion and button event */
|
2003-12-16 00:56:48 +00:00
|
|
|
|
2010-05-25 15:54:16 +00:00
|
|
|
guint GSEAL (double_click_distance); /* Maximum distance between clicks in pixels */
|
2008-07-18 13:03:42 +00:00
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
GHashTable *GSEAL (device_grabs);
|
|
|
|
GHashTable *GSEAL (motion_hint_info);
|
|
|
|
|
|
|
|
/* Hashtable containing a GdkPointerWindowInfo for each device */
|
|
|
|
GHashTable *GSEAL (pointers_info);
|
2009-01-31 18:42:44 +00:00
|
|
|
|
|
|
|
/* Last reported event time from server */
|
2010-05-25 15:54:16 +00:00
|
|
|
guint32 GSEAL (last_event_time);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
/* Device manager associated to the display */
|
|
|
|
GdkDeviceManager *GSEAL (device_manager);
|
2002-04-25 22:29:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GdkDisplayClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
G_CONST_RETURN gchar * (*get_display_name) (GdkDisplay *display);
|
|
|
|
gint (*get_n_screens) (GdkDisplay *display);
|
|
|
|
GdkScreen * (*get_screen) (GdkDisplay *display,
|
|
|
|
gint screen_num);
|
|
|
|
GdkScreen * (*get_default_screen) (GdkDisplay *display);
|
2002-08-01 23:43:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Signals */
|
2002-08-09 12:06:14 +00:00
|
|
|
void (*closed) (GdkDisplay *display,
|
2002-08-01 23:43:13 +00:00
|
|
|
gboolean is_error);
|
2002-04-25 22:29:14 +00:00
|
|
|
};
|
|
|
|
|
2010-11-15 02:37:21 +00:00
|
|
|
/**
|
|
|
|
* GdkDisplayPointerHooks:
|
|
|
|
* @get_pointer: Obtains the current pointer position and modifier state.
|
|
|
|
* The position is given in coordinates relative to the screen containing
|
|
|
|
* the pointer, which is returned in @screen.
|
|
|
|
* @window_get_pointer: Obtains the window underneath the mouse pointer.
|
|
|
|
* Current pointer position and modifier state are returned in @x, @y and
|
|
|
|
* @mask. The position is given in coordinates relative to @window.
|
|
|
|
* @window_at_pointer: Obtains the window underneath the mouse pointer,
|
|
|
|
* returning the location of that window in @win_x, @win_y. Returns %NULL
|
|
|
|
* if the window under the mouse pointer is not known to GDK (for example,
|
|
|
|
* belongs to another application).
|
|
|
|
*
|
|
|
|
* A table of pointers to functions for getting quantities related to
|
|
|
|
* the current pointer position. Each #GdkDisplay has a table of this type,
|
|
|
|
* which can be set using gdk_display_set_pointer_hooks().
|
|
|
|
*
|
|
|
|
* This is only useful for such low-level tools as an event recorder.
|
|
|
|
* Applications should never have any reason to use this facility
|
|
|
|
*
|
|
|
|
* Since: 2.2
|
|
|
|
*/
|
2002-10-07 19:42:49 +00:00
|
|
|
struct _GdkDisplayPointerHooks
|
|
|
|
{
|
|
|
|
void (*get_pointer) (GdkDisplay *display,
|
|
|
|
GdkScreen **screen,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask);
|
|
|
|
GdkWindow* (*window_get_pointer) (GdkDisplay *display,
|
|
|
|
GdkWindow *window,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask);
|
|
|
|
GdkWindow* (*window_at_pointer) (GdkDisplay *display,
|
|
|
|
gint *win_x,
|
|
|
|
gint *win_y);
|
|
|
|
};
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
/**
|
|
|
|
* GdkDisplayDeviceHooks:
|
|
|
|
* @get_device_state: Obtains the current position and modifier state for
|
|
|
|
* @device. The position is given in coordinates relative to the window
|
|
|
|
* containing the pointer, which is returned in @window.
|
|
|
|
* @window_get_device_position: Obtains the window underneath the device
|
|
|
|
* position. Current device position and modifier state are returned in
|
|
|
|
* @x, @y and @mask. The position is given in coordinates relative to
|
|
|
|
* @window.
|
|
|
|
* @window_at_device_position: Obtains the window underneath the device
|
|
|
|
* position, returning the location of that window in @win_x, @win_y.
|
|
|
|
* Returns %NULL if the window under the mouse pointer is not known to
|
|
|
|
* GDK (for example, belongs to another application).
|
|
|
|
*
|
|
|
|
* A table of pointers to functions for getting quantities related to
|
|
|
|
* the current device position. Each #GdkDisplay has a table of this type,
|
|
|
|
* which can be set using gdk_display_set_device_hooks().
|
|
|
|
*/
|
|
|
|
struct _GdkDisplayDeviceHooks
|
|
|
|
{
|
|
|
|
void (* get_device_state) (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
GdkScreen **screen,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask);
|
|
|
|
GdkWindow * (* window_get_device_position) (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
GdkWindow *window,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask);
|
|
|
|
GdkWindow * (* window_at_device_position) (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
gint *win_x,
|
|
|
|
gint *win_y);
|
|
|
|
};
|
|
|
|
|
2004-11-28 06:45:52 +00:00
|
|
|
GType gdk_display_get_type (void) G_GNUC_CONST;
|
2002-06-20 23:59:27 +00:00
|
|
|
GdkDisplay *gdk_display_open (const gchar *display_name);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
G_CONST_RETURN gchar * gdk_display_get_name (GdkDisplay *display);
|
|
|
|
|
|
|
|
gint gdk_display_get_n_screens (GdkDisplay *display);
|
|
|
|
GdkScreen * gdk_display_get_screen (GdkDisplay *display,
|
|
|
|
gint screen_num);
|
|
|
|
GdkScreen * gdk_display_get_default_screen (GdkDisplay *display);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
#ifndef GDK_MULTIDEVICE_SAFE
|
2002-04-25 22:29:14 +00:00
|
|
|
void gdk_display_pointer_ungrab (GdkDisplay *display,
|
2002-11-08 19:41:50 +00:00
|
|
|
guint32 time_);
|
2002-04-25 22:29:14 +00:00
|
|
|
void gdk_display_keyboard_ungrab (GdkDisplay *display,
|
2002-11-08 19:41:50 +00:00
|
|
|
guint32 time_);
|
2002-04-25 22:29:14 +00:00
|
|
|
gboolean gdk_display_pointer_is_grabbed (GdkDisplay *display);
|
2010-05-25 22:38:44 +00:00
|
|
|
#endif /* GDK_MULTIDEVICE_SAFE */
|
|
|
|
|
|
|
|
gboolean gdk_display_device_is_grabbed (GdkDisplay *display,
|
|
|
|
GdkDevice *device);
|
2002-04-25 22:29:14 +00:00
|
|
|
void gdk_display_beep (GdkDisplay *display);
|
|
|
|
void gdk_display_sync (GdkDisplay *display);
|
2003-07-05 01:54:05 +00:00
|
|
|
void gdk_display_flush (GdkDisplay *display);
|
|
|
|
|
2010-07-14 08:48:54 +00:00
|
|
|
void gdk_display_close (GdkDisplay *display);
|
|
|
|
gboolean gdk_display_is_closed (GdkDisplay *display);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
#ifndef GDK_DISABLE_DEPRECATED
|
2002-04-25 22:29:14 +00:00
|
|
|
GList * gdk_display_list_devices (GdkDisplay *display);
|
2010-05-25 22:38:44 +00:00
|
|
|
#endif /* GDK_DISABLE_DEPRECATED */
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2008-01-15 15:32:37 +00:00
|
|
|
GdkEvent* gdk_display_get_event (GdkDisplay *display);
|
|
|
|
GdkEvent* gdk_display_peek_event (GdkDisplay *display);
|
|
|
|
void gdk_display_put_event (GdkDisplay *display,
|
|
|
|
const GdkEvent *event);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
void gdk_display_add_client_message_filter (GdkDisplay *display,
|
|
|
|
GdkAtom message_type,
|
|
|
|
GdkFilterFunc func,
|
|
|
|
gpointer data);
|
|
|
|
|
2003-12-16 00:56:48 +00:00
|
|
|
void gdk_display_set_double_click_time (GdkDisplay *display,
|
|
|
|
guint msec);
|
|
|
|
void gdk_display_set_double_click_distance (GdkDisplay *display,
|
|
|
|
guint distance);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2002-06-20 23:59:27 +00:00
|
|
|
GdkDisplay *gdk_display_get_default (void);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
#ifndef GDK_MULTIDEVICE_SAFE
|
|
|
|
|
|
|
|
#ifndef GDK_DISABLE_DEPRECATED
|
2002-06-18 23:23:30 +00:00
|
|
|
GdkDevice *gdk_display_get_core_pointer (GdkDisplay *display);
|
2010-05-25 22:38:44 +00:00
|
|
|
#endif /* GDK_DISABLE_DEPRECATED */
|
2002-06-18 23:23:30 +00:00
|
|
|
|
2002-10-07 19:42:49 +00:00
|
|
|
void gdk_display_get_pointer (GdkDisplay *display,
|
|
|
|
GdkScreen **screen,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask);
|
|
|
|
GdkWindow * gdk_display_get_window_at_pointer (GdkDisplay *display,
|
|
|
|
gint *win_x,
|
|
|
|
gint *win_y);
|
2005-01-18 20:59:31 +00:00
|
|
|
void gdk_display_warp_pointer (GdkDisplay *display,
|
|
|
|
GdkScreen *screen,
|
|
|
|
gint x,
|
|
|
|
gint y);
|
2010-05-25 22:38:44 +00:00
|
|
|
#endif /* GDK_MULTIDEVICE_SAFE */
|
|
|
|
|
|
|
|
void gdk_display_get_device_state (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
GdkScreen **screen,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
GdkModifierType *mask);
|
|
|
|
GdkWindow * gdk_display_get_window_at_device_position (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
gint *win_x,
|
|
|
|
gint *win_y);
|
|
|
|
void gdk_display_warp_device (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
GdkScreen *screen,
|
|
|
|
gint x,
|
|
|
|
gint y);
|
|
|
|
|
|
|
|
#ifndef GDK_MULTIDEVICE_SAFE
|
2002-10-07 19:42:49 +00:00
|
|
|
GdkDisplayPointerHooks *gdk_display_set_pointer_hooks (GdkDisplay *display,
|
|
|
|
const GdkDisplayPointerHooks *new_hooks);
|
2010-05-25 22:38:44 +00:00
|
|
|
#endif /* GDK_MULTIDEVICE_SAFE */
|
|
|
|
|
|
|
|
GdkDisplayDeviceHooks *gdk_display_set_device_hooks (GdkDisplay *display,
|
|
|
|
const GdkDisplayDeviceHooks *new_hooks);
|
2002-10-07 19:42:49 +00:00
|
|
|
|
2002-10-31 21:12:23 +00:00
|
|
|
GdkDisplay *gdk_display_open_default_libgtk_only (void);
|
|
|
|
|
2003-06-30 22:30:54 +00:00
|
|
|
gboolean gdk_display_supports_cursor_alpha (GdkDisplay *display);
|
|
|
|
gboolean gdk_display_supports_cursor_color (GdkDisplay *display);
|
|
|
|
guint gdk_display_get_default_cursor_size (GdkDisplay *display);
|
|
|
|
void gdk_display_get_maximal_cursor_size (GdkDisplay *display,
|
|
|
|
guint *width,
|
|
|
|
guint *height);
|
|
|
|
|
2003-12-09 23:12:53 +00:00
|
|
|
GdkWindow *gdk_display_get_default_group (GdkDisplay *display);
|
|
|
|
|
2004-05-18 20:56:54 +00:00
|
|
|
gboolean gdk_display_supports_selection_notification (GdkDisplay *display);
|
|
|
|
gboolean gdk_display_request_selection_notification (GdkDisplay *display,
|
|
|
|
GdkAtom selection);
|
|
|
|
|
2008-01-15 15:32:37 +00:00
|
|
|
gboolean gdk_display_supports_clipboard_persistence (GdkDisplay *display);
|
|
|
|
void gdk_display_store_clipboard (GdkDisplay *display,
|
|
|
|
GdkWindow *clipboard_window,
|
|
|
|
guint32 time_,
|
|
|
|
const GdkAtom *targets,
|
|
|
|
gint n_targets);
|
New API to handle the clipboard manager.
2004-10-25 Anders Carlsson <andersca@imendio.com>
* gdk/gdk.symbols:
* gdk/gdkdisplay.h:
* gdk/x11/gdkdisplay-x11.c:
(gdk_display_supports_clipboard_persistence),
(gdk_display_store_clipboard):
New API to handle the clipboard manager.
* gtk/gtk.symbols:
* gtk/gtkclipboard.c: (gtk_clipboard_class_init),
(gtk_clipboard_finalize), (selection_clear_event_cb),
(clipboard_unset), (gtk_clipboard_set_text),
(gtk_clipboard_request_targets), (gtk_clipboard_wait_for_targets),
(clipboard_peek), (gtk_clipboard_owner_change),
(gtk_clipboard_wait_is_target_available),
(gtk_clipboard_store_timeout), (gtk_clipboard_set_can_store),
(gtk_clipboard_selection_notify), (gtk_clipboard_store),
(_gtk_clipboard_store_all):
* gtk/gtkclipboard.h:
Add API for clipboard persistence and implement it, also add
gtk_clipboard_wait_is_target_available.
* gtk/gtkmain.c: (gtk_main):
Call _gtk_clipboard_store_all before exiting.
2004-10-25 18:53:30 +00:00
|
|
|
|
2006-02-20 01:36:50 +00:00
|
|
|
gboolean gdk_display_supports_shapes (GdkDisplay *display);
|
|
|
|
gboolean gdk_display_supports_input_shapes (GdkDisplay *display);
|
2007-06-01 12:16:12 +00:00
|
|
|
gboolean gdk_display_supports_composite (GdkDisplay *display);
|
2006-02-20 01:36:50 +00:00
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
GdkDeviceManager * gdk_display_get_device_manager (GdkDisplay *display);
|
|
|
|
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2004-05-18 20:56:54 +00:00
|
|
|
#endif /* __GDK_DISPLAY_H__ */
|