2010-12-11 05:14:53 +00:00
|
|
|
/* GDK - The GIMP Drawing Kit
|
|
|
|
* Copyright (C) 2010 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2010-12-11 05:14:53 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GDK_DISPLAY_PRIVATE_H__
|
|
|
|
#define __GDK_DISPLAY_PRIVATE_H__
|
|
|
|
|
|
|
|
#include "gdkdisplay.h"
|
2010-12-16 00:07:36 +00:00
|
|
|
#include "gdkwindow.h"
|
2010-12-13 17:36:35 +00:00
|
|
|
#include "gdkcursor.h"
|
2016-04-01 03:10:37 +00:00
|
|
|
#include "gdkmonitor.h"
|
2014-11-10 19:28:43 +00:00
|
|
|
#include "gdkinternals.h"
|
2010-12-11 05:14:53 +00:00
|
|
|
|
2016-12-09 19:11:37 +00:00
|
|
|
#ifdef GDK_RENDERING_VULKAN
|
2016-11-21 13:18:43 +00:00
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
#endif
|
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2010-12-24 20:54:12 +00:00
|
|
|
#define GDK_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY, GdkDisplayClass))
|
|
|
|
#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))
|
|
|
|
|
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
typedef struct _GdkDisplayClass GdkDisplayClass;
|
|
|
|
|
2014-06-09 02:17:39 +00:00
|
|
|
/* Tracks information about the device grab on this display */
|
2010-12-11 05:14:53 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GdkWindow *window;
|
|
|
|
GdkWindow *native_window;
|
|
|
|
gulong serial_start;
|
|
|
|
gulong serial_end; /* exclusive, i.e. not active on serial_end */
|
|
|
|
guint event_mask;
|
|
|
|
guint32 time;
|
|
|
|
GdkGrabOwnership ownership;
|
|
|
|
|
|
|
|
guint activated : 1;
|
|
|
|
guint implicit_ungrab : 1;
|
2011-04-12 14:34:55 +00:00
|
|
|
guint owner_events : 1;
|
|
|
|
guint implicit : 1;
|
2010-12-11 05:14:53 +00:00
|
|
|
} GdkDeviceGrabInfo;
|
|
|
|
|
|
|
|
/* 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.
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GdkWindow *window_under_pointer; /* window that last got a normal enter event */
|
|
|
|
gdouble toplevel_x, toplevel_y;
|
|
|
|
guint32 state;
|
|
|
|
guint32 button;
|
2011-12-03 14:04:19 +00:00
|
|
|
GdkDevice *last_slave;
|
2010-12-11 05:14:53 +00:00
|
|
|
} GdkPointerWindowInfo;
|
|
|
|
|
|
|
|
struct _GdkDisplay
|
|
|
|
{
|
|
|
|
GObject parent_instance;
|
|
|
|
|
|
|
|
GList *queued_events;
|
|
|
|
GList *queued_tail;
|
|
|
|
|
2012-10-07 18:13:56 +00:00
|
|
|
guint event_pause_count; /* How many times events are blocked */
|
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
guint closed : 1; /* Whether this display has been closed */
|
|
|
|
|
|
|
|
GHashTable *device_grabs;
|
|
|
|
|
|
|
|
GHashTable *pointers_info; /* GdkPointerWindowInfo for each device */
|
|
|
|
guint32 last_event_time; /* Last reported event time from server */
|
|
|
|
|
2014-01-12 14:39:23 +00:00
|
|
|
guint double_click_time; /* Maximum time between clicks in msecs */
|
2011-04-12 14:34:55 +00:00
|
|
|
guint double_click_distance; /* Maximum distance between clicks in pixels */
|
2014-10-27 20:12:40 +00:00
|
|
|
|
2016-12-09 19:11:37 +00:00
|
|
|
#ifdef GDK_RENDERING_VULKAN
|
2016-11-21 13:18:43 +00:00
|
|
|
VkInstance vk_instance;
|
2016-11-29 15:29:19 +00:00
|
|
|
VkDebugReportCallbackEXT vk_debug_callback;
|
2016-11-21 13:18:43 +00:00
|
|
|
VkPhysicalDevice vk_physical_device;
|
|
|
|
VkDevice vk_device;
|
|
|
|
VkQueue vk_queue;
|
2016-11-29 02:20:31 +00:00
|
|
|
uint32_t vk_queue_family_index;
|
2014-11-10 19:28:43 +00:00
|
|
|
|
2016-11-21 13:18:43 +00:00
|
|
|
guint vulkan_refcount;
|
2016-12-09 19:11:37 +00:00
|
|
|
#endif /* GDK_RENDERING_VULKAN */
|
2016-10-29 02:37:20 +00:00
|
|
|
guint rgba : 1;
|
|
|
|
guint composited : 1;
|
|
|
|
|
2014-11-10 19:28:43 +00:00
|
|
|
GdkRenderingMode rendering_mode;
|
2015-11-26 18:52:23 +00:00
|
|
|
|
|
|
|
GList *seats;
|
2010-12-11 05:14:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GdkDisplayClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
2010-12-21 02:13:55 +00:00
|
|
|
GType window_type; /* type for native windows for this display, set in class_init */
|
2016-11-28 15:34:01 +00:00
|
|
|
GType vk_context_type; /* type for GdkVulkanContext, must be set if vk_extension_name != NULL */
|
|
|
|
const char *vk_extension_name; /* Name of required windowing vulkan extension or %NULL (default) if Vulkan isn't supported */
|
2010-12-21 02:13:55 +00:00
|
|
|
|
2011-06-06 18:05:18 +00:00
|
|
|
const gchar * (*get_name) (GdkDisplay *display);
|
2010-12-11 05:14:53 +00:00
|
|
|
void (*beep) (GdkDisplay *display);
|
|
|
|
void (*sync) (GdkDisplay *display);
|
|
|
|
void (*flush) (GdkDisplay *display);
|
|
|
|
gboolean (*has_pending) (GdkDisplay *display);
|
|
|
|
void (*queue_events) (GdkDisplay *display);
|
2013-04-09 11:32:03 +00:00
|
|
|
void (*make_default) (GdkDisplay *display);
|
2010-12-11 05:14:53 +00:00
|
|
|
GdkWindow * (*get_default_group) (GdkDisplay *display);
|
|
|
|
gboolean (*supports_selection_notification) (GdkDisplay *display);
|
|
|
|
gboolean (*request_selection_notification) (GdkDisplay *display,
|
|
|
|
GdkAtom selection);
|
2010-12-13 17:36:35 +00:00
|
|
|
gboolean (*supports_shapes) (GdkDisplay *display);
|
|
|
|
gboolean (*supports_input_shapes) (GdkDisplay *display);
|
|
|
|
gboolean (*supports_cursor_alpha) (GdkDisplay *display);
|
|
|
|
gboolean (*supports_cursor_color) (GdkDisplay *display);
|
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
gboolean (*supports_clipboard_persistence) (GdkDisplay *display);
|
|
|
|
void (*store_clipboard) (GdkDisplay *display,
|
|
|
|
GdkWindow *clipboard_window,
|
|
|
|
guint32 time_,
|
|
|
|
const GdkAtom *targets,
|
|
|
|
gint n_targets);
|
2010-12-13 17:36:35 +00:00
|
|
|
|
|
|
|
void (*get_default_cursor_size) (GdkDisplay *display,
|
|
|
|
guint *width,
|
|
|
|
guint *height);
|
|
|
|
void (*get_maximal_cursor_size) (GdkDisplay *display,
|
|
|
|
guint *width,
|
|
|
|
guint *height);
|
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display);
|
|
|
|
|
2010-12-13 19:05:59 +00:00
|
|
|
gulong (*get_next_serial) (GdkDisplay *display);
|
|
|
|
|
2010-12-14 01:46:00 +00:00
|
|
|
void (*notify_startup_complete) (GdkDisplay *display,
|
|
|
|
const gchar *startup_id);
|
2010-12-15 05:37:40 +00:00
|
|
|
void (*event_data_copy) (GdkDisplay *display,
|
|
|
|
const GdkEvent *event,
|
|
|
|
GdkEvent *new_event);
|
|
|
|
void (*event_data_free) (GdkDisplay *display,
|
|
|
|
GdkEvent *event);
|
2010-12-16 00:07:36 +00:00
|
|
|
void (*create_window_impl) (GdkDisplay *display,
|
|
|
|
GdkWindow *window,
|
|
|
|
GdkWindow *real_parent,
|
|
|
|
GdkEventMask event_mask,
|
2016-11-07 00:33:43 +00:00
|
|
|
GdkWindowAttr *attributes);
|
2010-12-14 01:46:00 +00:00
|
|
|
|
2010-12-16 05:08:42 +00:00
|
|
|
GdkKeymap * (*get_keymap) (GdkDisplay *display);
|
|
|
|
|
2010-12-17 00:22:44 +00:00
|
|
|
GdkWindow * (*get_selection_owner) (GdkDisplay *display,
|
|
|
|
GdkAtom selection);
|
|
|
|
gboolean (*set_selection_owner) (GdkDisplay *display,
|
|
|
|
GdkWindow *owner,
|
|
|
|
GdkAtom selection,
|
|
|
|
guint32 time,
|
|
|
|
gboolean send_event);
|
2010-12-17 00:58:07 +00:00
|
|
|
void (*send_selection_notify) (GdkDisplay *dispay,
|
2011-02-01 16:22:04 +00:00
|
|
|
GdkWindow *requestor,
|
2010-12-17 00:58:07 +00:00
|
|
|
GdkAtom selection,
|
|
|
|
GdkAtom target,
|
|
|
|
GdkAtom property,
|
2010-12-17 01:25:32 +00:00
|
|
|
guint32 time);
|
2010-12-17 01:10:11 +00:00
|
|
|
gint (*get_selection_property) (GdkDisplay *display,
|
|
|
|
GdkWindow *requestor,
|
|
|
|
guchar **data,
|
|
|
|
GdkAtom *type,
|
|
|
|
gint *format);
|
2017-11-14 02:56:35 +00:00
|
|
|
void (*clear_selection_targets)(GdkDisplay *display,
|
|
|
|
GdkAtom selection);
|
|
|
|
void (*add_selection_targets) (GdkDisplay *display,
|
|
|
|
GdkWindow *window,
|
|
|
|
GdkAtom selection,
|
|
|
|
GdkAtom *targets,
|
|
|
|
guint ntargets);
|
2010-12-17 01:25:32 +00:00
|
|
|
void (*convert_selection) (GdkDisplay *display,
|
|
|
|
GdkWindow *requestor,
|
|
|
|
GdkAtom selection,
|
|
|
|
GdkAtom target,
|
|
|
|
guint32 time);
|
2010-12-17 00:22:44 +00:00
|
|
|
|
2010-12-17 04:44:50 +00:00
|
|
|
gint (*text_property_to_utf8_list) (GdkDisplay *display,
|
|
|
|
GdkAtom encoding,
|
|
|
|
gint format,
|
|
|
|
const guchar *text,
|
|
|
|
gint length,
|
|
|
|
gchar ***list);
|
|
|
|
gchar * (*utf8_to_string_target) (GdkDisplay *display,
|
|
|
|
const gchar *text);
|
|
|
|
|
2014-10-30 10:46:09 +00:00
|
|
|
gboolean (*make_gl_context_current) (GdkDisplay *display,
|
|
|
|
GdkGLContext *context);
|
2014-10-09 08:45:44 +00:00
|
|
|
|
2015-11-26 18:52:23 +00:00
|
|
|
GdkSeat * (*get_default_seat) (GdkDisplay *display);
|
|
|
|
|
2016-04-01 03:10:37 +00:00
|
|
|
int (*get_n_monitors) (GdkDisplay *display);
|
|
|
|
GdkMonitor * (*get_monitor) (GdkDisplay *display,
|
|
|
|
int index);
|
|
|
|
GdkMonitor * (*get_primary_monitor) (GdkDisplay *display);
|
2016-05-17 11:09:23 +00:00
|
|
|
GdkMonitor * (*get_monitor_at_window) (GdkDisplay *display,
|
|
|
|
GdkWindow *window);
|
2017-10-30 20:39:49 +00:00
|
|
|
gboolean (*get_setting) (GdkDisplay *display,
|
|
|
|
const char *name,
|
|
|
|
GValue *value);
|
2017-11-17 20:39:08 +00:00
|
|
|
guint32 (*get_last_seen_time) (GdkDisplay *display);
|
2017-11-17 22:42:12 +00:00
|
|
|
void (*set_cursor_theme) (GdkDisplay *display,
|
|
|
|
const char *name,
|
|
|
|
int size);
|
2016-04-01 03:10:37 +00:00
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
/* Signals */
|
2013-04-17 21:53:42 +00:00
|
|
|
void (*opened) (GdkDisplay *display);
|
2017-10-30 13:00:49 +00:00
|
|
|
void (*closed) (GdkDisplay *display,
|
|
|
|
gboolean is_error);
|
2010-12-11 05:14:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
GdkPointerWindowInfo *device_info,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2016-02-28 15:22:31 +00:00
|
|
|
void _gdk_display_update_last_event (GdkDisplay *display,
|
|
|
|
const GdkEvent *event);
|
2010-12-11 05:14:53 +00:00
|
|
|
void _gdk_display_device_grab_update (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
GdkDevice *source_device,
|
|
|
|
gulong current_serial);
|
|
|
|
GdkDeviceGrabInfo * _gdk_display_get_last_device_grab (GdkDisplay *display,
|
|
|
|
GdkDevice *device);
|
|
|
|
GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
GdkWindow *window,
|
|
|
|
GdkWindow *native_window,
|
|
|
|
GdkGrabOwnership grab_ownership,
|
|
|
|
gboolean owner_events,
|
|
|
|
GdkEventMask event_mask,
|
|
|
|
gulong serial_start,
|
|
|
|
guint32 time,
|
|
|
|
gboolean implicit);
|
|
|
|
GdkDeviceGrabInfo * _gdk_display_has_device_grab (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
gulong serial);
|
|
|
|
gboolean _gdk_display_end_device_grab (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
gulong serial,
|
|
|
|
GdkWindow *if_child,
|
|
|
|
gboolean implicit);
|
|
|
|
gboolean _gdk_display_check_grab_ownership (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
gulong serial);
|
|
|
|
GdkPointerWindowInfo * _gdk_display_get_pointer_info (GdkDisplay *display,
|
|
|
|
GdkDevice *device);
|
|
|
|
void _gdk_display_pointer_info_foreach (GdkDisplay *display,
|
|
|
|
GdkDisplayPointerInfoForeach func,
|
|
|
|
gpointer user_data);
|
2010-12-13 19:05:59 +00:00
|
|
|
gulong _gdk_display_get_next_serial (GdkDisplay *display);
|
2012-10-07 18:13:56 +00:00
|
|
|
void _gdk_display_pause_events (GdkDisplay *display);
|
|
|
|
void _gdk_display_unpause_events (GdkDisplay *display);
|
2010-12-15 05:37:40 +00:00
|
|
|
void _gdk_display_event_data_copy (GdkDisplay *display,
|
|
|
|
const GdkEvent *event,
|
|
|
|
GdkEvent *new_event);
|
|
|
|
void _gdk_display_event_data_free (GdkDisplay *display,
|
|
|
|
GdkEvent *event);
|
2010-12-16 00:07:36 +00:00
|
|
|
void _gdk_display_create_window_impl (GdkDisplay *display,
|
|
|
|
GdkWindow *window,
|
|
|
|
GdkWindow *real_parent,
|
|
|
|
GdkEventMask event_mask,
|
2016-11-07 00:33:43 +00:00
|
|
|
GdkWindowAttr *attributes);
|
2010-12-21 02:06:59 +00:00
|
|
|
GdkWindow * _gdk_display_create_window (GdkDisplay *display);
|
2010-12-11 05:14:53 +00:00
|
|
|
|
2014-10-30 10:46:09 +00:00
|
|
|
gboolean gdk_display_make_gl_context_current (GdkDisplay *display,
|
2014-10-09 08:45:44 +00:00
|
|
|
GdkGLContext *context);
|
|
|
|
|
2016-10-29 02:37:20 +00:00
|
|
|
void gdk_display_set_rgba (GdkDisplay *display,
|
|
|
|
gboolean rgba);
|
|
|
|
void gdk_display_set_composited (GdkDisplay *display,
|
|
|
|
gboolean composited);
|
|
|
|
|
2015-11-26 18:52:23 +00:00
|
|
|
void gdk_display_add_seat (GdkDisplay *display,
|
|
|
|
GdkSeat *seat);
|
|
|
|
void gdk_display_remove_seat (GdkDisplay *display,
|
|
|
|
GdkSeat *seat);
|
2016-04-01 03:10:37 +00:00
|
|
|
void gdk_display_monitor_added (GdkDisplay *display,
|
|
|
|
GdkMonitor *monitor);
|
|
|
|
void gdk_display_monitor_removed (GdkDisplay *display,
|
|
|
|
GdkMonitor *monitor);
|
2017-10-08 15:38:38 +00:00
|
|
|
void gdk_display_emit_opened (GdkDisplay *display);
|
2015-11-26 18:52:23 +00:00
|
|
|
|
2017-10-30 13:00:49 +00:00
|
|
|
void gdk_display_setting_changed (GdkDisplay *display,
|
|
|
|
const char *name);
|
|
|
|
|
2017-11-23 20:43:52 +00:00
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GDK_DISPLAY_PRIVATE_H__ */
|