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"
|
2018-03-20 10:46:11 +00:00
|
|
|
#include "gdksurface.h"
|
2010-12-13 17:36:35 +00:00
|
|
|
#include "gdkcursor.h"
|
2016-04-01 03:10:37 +00:00
|
|
|
#include "gdkmonitor.h"
|
2022-09-24 03:11:41 +00:00
|
|
|
#include "gdkdebugprivate.h"
|
2020-08-14 01:47:54 +00:00
|
|
|
#include "gdksurfaceprivate.h"
|
|
|
|
#include "gdkkeysprivate.h"
|
|
|
|
#include "gdkdeviceprivate.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
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
GdkSurface *surface;
|
2010-12-11 05:14:53 +00:00
|
|
|
gulong serial_start;
|
|
|
|
gulong serial_end; /* exclusive, i.e. not active on serial_end */
|
|
|
|
guint event_mask;
|
|
|
|
guint32 time;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2018-03-20 14:14:10 +00:00
|
|
|
/* Tracks information about which surface and position the pointer last was in.
|
2010-12-11 05:14:53 +00:00
|
|
|
* 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
|
2018-03-20 14:14:10 +00:00
|
|
|
* pointer in no clients surface the x/y coordinates may actually be outside
|
|
|
|
* the surface.
|
2010-12-11 05:14:53 +00:00
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
2018-03-20 14:14:10 +00:00
|
|
|
GdkSurface *surface_under_pointer; /* surface that last got a normal enter event */
|
2020-07-24 20:32:16 +00:00
|
|
|
double toplevel_x, toplevel_y;
|
2010-12-11 05:14:53 +00:00
|
|
|
guint32 state;
|
|
|
|
guint32 button;
|
2020-06-18 18:22:20 +00:00
|
|
|
GdkDevice *last_physical_device;
|
2018-03-20 10:40:08 +00:00
|
|
|
} GdkPointerSurfaceInfo;
|
2010-12-11 05:14:53 +00:00
|
|
|
|
|
|
|
struct _GdkDisplay
|
|
|
|
{
|
|
|
|
GObject parent_instance;
|
|
|
|
|
2019-02-05 15:05:06 +00:00
|
|
|
GQueue queued_events;
|
2010-12-11 05:14:53 +00:00
|
|
|
|
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;
|
|
|
|
|
2014-05-29 03:55:53 +00:00
|
|
|
GdkClipboard *clipboard;
|
|
|
|
GdkClipboard *primary_clipboard;
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
GHashTable *pointers_info; /* GdkPointerSurfaceInfo for each device */
|
2010-12-11 05:14:53 +00:00
|
|
|
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
|
|
|
|
2021-10-05 22:48:33 +00:00
|
|
|
GList *seats;
|
|
|
|
|
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 */
|
2015-11-26 18:52:23 +00:00
|
|
|
|
2021-10-05 22:48:33 +00:00
|
|
|
/* egl info */
|
|
|
|
guint have_egl_buffer_age : 1;
|
2021-10-06 00:41:31 +00:00
|
|
|
guint have_egl_no_config_context : 1;
|
2021-10-06 01:33:24 +00:00
|
|
|
guint have_egl_pixel_format_float : 1;
|
2022-01-18 16:16:11 +00:00
|
|
|
guint have_egl_win32_libangle : 1;
|
2010-12-11 05:14:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GdkDisplayClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
2018-04-12 14:48:31 +00:00
|
|
|
GType cairo_context_type; /* type for GdkCairoContext, must be set */
|
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
|
|
|
|
2020-07-24 18:40:36 +00:00
|
|
|
const char * (*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-13 17:36:35 +00:00
|
|
|
|
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,
|
2020-07-24 18:40:36 +00:00
|
|
|
const char *startup_id);
|
|
|
|
const char * (*get_startup_notification_id) (GdkDisplay *display);
|
2018-06-04 16:27:36 +00:00
|
|
|
|
2019-04-22 01:14:46 +00:00
|
|
|
GdkSurface * (*create_surface) (GdkDisplay *display,
|
|
|
|
GdkSurfaceType surface_type,
|
|
|
|
GdkSurface *parent,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
|
|
|
int height);
|
2010-12-14 01:46:00 +00:00
|
|
|
|
2010-12-16 05:08:42 +00:00
|
|
|
GdkKeymap * (*get_keymap) (GdkDisplay *display);
|
|
|
|
|
2021-10-03 04:22:21 +00:00
|
|
|
GdkGLContext * (* init_gl) (GdkDisplay *display,
|
2021-07-04 23:57:03 +00:00
|
|
|
GError **error);
|
2021-10-03 04:22:21 +00:00
|
|
|
/* Returns the distance from a perfect score EGL config.
|
|
|
|
* GDK chooses the one with the *LOWEST* score */
|
|
|
|
guint (* rate_egl_config) (GdkDisplay *display,
|
|
|
|
gpointer egl_display,
|
|
|
|
gpointer egl_config);
|
2014-10-09 08:45:44 +00:00
|
|
|
|
2021-10-03 04:22:21 +00:00
|
|
|
GdkSeat * (*get_default_seat) (GdkDisplay *display);
|
2015-11-26 18:52:23 +00:00
|
|
|
|
2020-05-13 05:00:35 +00:00
|
|
|
GListModel * (*get_monitors) (GdkDisplay *self);
|
|
|
|
GdkMonitor * (*get_monitor_at_surface) (GdkDisplay *display,
|
2018-03-20 14:14:10 +00:00
|
|
|
GdkSurface *surface);
|
2017-10-30 20:39:49 +00:00
|
|
|
gboolean (*get_setting) (GdkDisplay *display,
|
|
|
|
const char *name,
|
|
|
|
GValue *value);
|
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,
|
2018-03-20 10:40:08 +00:00
|
|
|
GdkPointerSurfaceInfo *device_info,
|
2010-12-11 05:14:53 +00:00
|
|
|
gpointer user_data);
|
|
|
|
|
2016-02-28 15:22:31 +00:00
|
|
|
void _gdk_display_update_last_event (GdkDisplay *display,
|
2020-02-16 16:09:02 +00:00
|
|
|
GdkEvent *event);
|
2010-12-11 05:14:53 +00:00
|
|
|
void _gdk_display_device_grab_update (GdkDisplay *display,
|
|
|
|
GdkDevice *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,
|
2018-03-20 14:14:10 +00:00
|
|
|
GdkSurface *surface,
|
2010-12-11 05:14:53 +00:00
|
|
|
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,
|
2018-03-20 10:40:08 +00:00
|
|
|
GdkSurface *if_child,
|
2010-12-11 05:14:53 +00:00
|
|
|
gboolean implicit);
|
2018-03-20 10:40:08 +00:00
|
|
|
GdkPointerSurfaceInfo * _gdk_display_get_pointer_info (GdkDisplay *display,
|
2010-12-11 05:14:53 +00:00
|
|
|
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);
|
2019-04-22 01:14:46 +00:00
|
|
|
GdkSurface * gdk_display_create_surface (GdkDisplay *display,
|
|
|
|
GdkSurfaceType surface_type,
|
|
|
|
GdkSurface *parent,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
|
|
|
int height);
|
2010-12-11 05:14:53 +00:00
|
|
|
|
2021-07-04 23:57:03 +00:00
|
|
|
GdkGLContext * gdk_display_get_gl_context (GdkDisplay *display);
|
2014-10-09 08:45:44 +00:00
|
|
|
|
2021-10-03 04:22:21 +00:00
|
|
|
gboolean gdk_display_init_egl (GdkDisplay *display,
|
|
|
|
int /*EGLenum*/ platform,
|
|
|
|
gpointer native_display,
|
|
|
|
gboolean allow_any,
|
|
|
|
GError **error);
|
|
|
|
gpointer gdk_display_get_egl_display (GdkDisplay *display);
|
|
|
|
gpointer gdk_display_get_egl_config (GdkDisplay *display);
|
2021-10-06 16:25:30 +00:00
|
|
|
gpointer gdk_display_get_egl_config_high_depth
|
|
|
|
(GdkDisplay *display);
|
2021-10-03 04:22:21 +00:00
|
|
|
|
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);
|
2020-05-18 02:05:24 +00:00
|
|
|
void gdk_display_set_input_shapes (GdkDisplay *display,
|
|
|
|
gboolean input_shapes);
|
2016-10-29 02:37:20 +00:00
|
|
|
|
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);
|
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);
|
|
|
|
|
2020-05-18 13:02:13 +00:00
|
|
|
GdkEvent * gdk_display_get_event (GdkDisplay *display);
|
|
|
|
|
2020-08-14 01:47:54 +00:00
|
|
|
GdkKeymap * gdk_display_get_keymap (GdkDisplay *display);
|
|
|
|
|
|
|
|
void _gdk_display_set_surface_under_pointer (GdkDisplay *display,
|
|
|
|
GdkDevice *device,
|
|
|
|
GdkSurface *surface);
|
|
|
|
|
|
|
|
void _gdk_windowing_got_event (GdkDisplay *display,
|
|
|
|
GList *event_link,
|
|
|
|
GdkEvent *event,
|
|
|
|
gulong serial);
|
2017-11-23 20:43:52 +00:00
|
|
|
|
2022-11-17 19:01:11 +00:00
|
|
|
GdkDisplay * gdk_display_open_default (void);
|
|
|
|
|
|
|
|
void gdk_display_set_double_click_time (GdkDisplay *display,
|
|
|
|
guint msec);
|
|
|
|
void gdk_display_set_double_click_distance (GdkDisplay *display,
|
|
|
|
guint distance);
|
|
|
|
void gdk_display_set_cursor_theme (GdkDisplay *display,
|
|
|
|
const char *theme,
|
|
|
|
int size);
|
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GDK_DISPLAY_PRIVATE_H__ */
|