gdkdisplay-wayland.h 4.05 KB
Newer Older
Kristian Høgsberg's avatar
Kristian Høgsberg committed
1 2
/*
 * gdkdisplay-wayland.h
Matthias Clasen's avatar
Matthias Clasen committed
3 4
 *
 * Copyright 2001 Sun Microsystems Inc.
Kristian Høgsberg's avatar
Kristian Høgsberg committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * 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
Javier Jardon's avatar
Javier Jardon committed
19
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
Kristian Høgsberg's avatar
Kristian Høgsberg committed
20 21
 */

22 23
#ifndef __GDK_WAYLAND_DISPLAY__
#define __GDK_WAYLAND_DISPLAY__
Kristian Høgsberg's avatar
Kristian Høgsberg committed
24

25
#include <config.h>
Kristian Høgsberg's avatar
Kristian Høgsberg committed
26 27
#include <stdint.h>
#include <wayland-client.h>
28
#include <wayland-cursor.h>
29
#include <wayland-egl.h>
Carlos Garnacho's avatar
Carlos Garnacho committed
30
#include <gdk/wayland/tablet-unstable-v2-client-protocol.h>
31
#include <gdk/wayland/gtk-shell-client-protocol.h>
32
#include <gdk/wayland/xdg-shell-unstable-v6-client-protocol.h>
33
#include <gdk/wayland/xdg-foreign-unstable-v1-client-protocol.h>
34
#include <gdk/wayland/keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h>
35
#include <gdk/wayland/server-decoration-client-protocol.h>
36

Kristian Høgsberg's avatar
Kristian Høgsberg committed
37 38 39 40 41 42 43 44
#include <glib.h>
#include <gdk/gdkkeys.h>
#include <gdk/gdkwindow.h>
#include <gdk/gdkinternals.h>
#include <gdk/gdk.h>		/* For gdk_get_program_class() */

#include "gdkdisplayprivate.h"

45 46
#include <epoxy/egl.h>

Kristian Høgsberg's avatar
Kristian Høgsberg committed
47 48
G_BEGIN_DECLS

49 50 51
#define GDK_WAYLAND_MAX_THEME_SCALE 2
#define GDK_WAYLAND_THEME_SCALES_COUNT GDK_WAYLAND_MAX_THEME_SCALE

52
#define GDK_ZWP_POINTER_GESTURES_V1_VERSION 1
53

54 55
typedef struct _GdkWaylandSelection GdkWaylandSelection;

56
struct _GdkWaylandDisplay
Kristian Høgsberg's avatar
Kristian Høgsberg committed
57 58
{
  GdkDisplay parent_instance;
59
  GdkScreen *screen;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
60 61 62 63

  /* Startup notification */
  gchar *startup_notification_id;

64
  /* Most recent serial */
65
  guint32 serial;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
66 67 68

  /* Wayland fields below */
  struct wl_display *wl_display;
69
  struct wl_registry *wl_registry;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
70
  struct wl_compositor *compositor;
71
  struct wl_shm *shm;
72
  struct zxdg_shell_v6 *xdg_shell;
73
  struct gtk_shell1 *gtk_shell;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
74
  struct wl_input_device *input_device;
75
  struct wl_data_device_manager *data_device_manager;
76
  struct wl_subcompositor *subcompositor;
77
  struct zwp_pointer_gestures_v1 *pointer_gestures;
78
  struct gtk_primary_selection_device_manager *primary_selection_manager;
79
  struct zwp_tablet_manager_v2 *tablet_manager;
80
  struct zxdg_exporter_v1 *xdg_exporter;
81
  struct zxdg_importer_v1 *xdg_importer;
82
  struct zwp_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit;
83
  struct org_kde_kwin_server_decoration_manager *server_decoration_manager;
84

85 86
  GList *async_roundtrips;

87 88 89 90 91 92 93
  /* Keep track of the ID's of the known globals and their corresponding
   * names. This way we can check whether an interface is known, and
   * remove globals given its ID. This table is not expected to be very
   * large, meaning the lookup by interface name time is insignificant. */
  GHashTable *known_globals;
  GList *on_has_globals_closures;

94 95 96
  /* Keep a list of orphaned dialogs (i.e. without parent) */
  GList *orphan_dialogs;

97 98
  GList *current_popups;

99 100 101
  struct wl_cursor_theme *scaled_cursor_themes[GDK_WAYLAND_THEME_SCALES_COUNT];
  gchar *cursor_theme_name;
  int cursor_theme_size;
102
  GHashTable *cursor_cache;
103

Kristian Høgsberg's avatar
Kristian Høgsberg committed
104
  GSource *event_source;
105

106
  int compositor_version;
107
  int seat_version;
108
  int data_device_manager_version;
109
  int gtk_shell_version;
110

111 112
  uint32_t server_decoration_mode;

113
  struct xkb_context *xkb_context;
114 115

  GdkWaylandSelection *selection;
116

117 118
  GPtrArray *monitors;

119 120
  gint64 last_bell_time_ms;

121 122 123 124 125 126 127 128 129
  /* egl info */
  EGLDisplay egl_display;
  int egl_major_version;
  int egl_minor_version;

  guint have_egl : 1;
  guint have_egl_khr_create_context : 1;
  guint have_egl_buffer_age : 1;
  guint have_egl_swap_buffers_with_damage : 1;
130
  guint have_egl_surfaceless_context : 1;
131
  EGLint egl_min_swap_interval;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
132 133
};

134
struct _GdkWaylandDisplayClass
Kristian Høgsberg's avatar
Kristian Høgsberg committed
135 136 137 138 139 140
{
  GdkDisplayClass parent_class;
};

G_END_DECLS

Matthias Clasen's avatar
Matthias Clasen committed
141
#endif  /* __GDK_WAYLAND_DISPLAY__ */