]> Pileus Git - ~andy/gtk/blob - gdk/wayland/gdkdisplay-wayland.h
wayland: Improve the error reporting in the Cairo GL surface code path
[~andy/gtk] / gdk / wayland / gdkdisplay-wayland.h
1 /*
2  * gdkdisplay-wayland.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, see <http://www.gnu.org/licenses/>.
20  */
21
22 #ifndef __GDK_WAYLAND_DISPLAY__
23 #define __GDK_WAYLAND_DISPLAY__
24
25 #include <config.h>
26 #include <stdint.h>
27 #include <wayland-client.h>
28
29 #ifdef GDK_WAYLAND_USE_EGL
30 #include <wayland-egl.h>
31 #include <EGL/egl.h>
32 #include <EGL/eglext.h>
33 #include <GL/gl.h>
34 #include <GL/glext.h>
35 #include <cairo-gl.h>
36 #endif
37
38 #include <glib.h>
39 #include <gdk/gdkkeys.h>
40 #include <gdk/gdkwindow.h>
41 #include <gdk/gdkinternals.h>
42 #include <gdk/gdk.h>            /* For gdk_get_program_class() */
43
44 #include "gdkdisplayprivate.h"
45
46 G_BEGIN_DECLS
47
48 typedef struct _GdkWaylandDisplay GdkWaylandDisplay;
49 typedef struct _GdkWaylandDisplayClass GdkWaylandDisplayClass;
50
51 #define GDK_TYPE_WAYLAND_DISPLAY              (_gdk_wayland_display_get_type())
52 #define GDK_WAYLAND_DISPLAY(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_DISPLAY, GdkWaylandDisplay))
53 #define GDK_WAYLAND_DISPLAY_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_DISPLAY, GdkWaylandDisplayClass))
54 #define GDK_IS_WAYLAND_DISPLAY(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_DISPLAY))
55 #define GDK_IS_WAYLAND_DISPLAY_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_DISPLAY))
56 #define GDK_WAYLAND_DISPLAY_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_DISPLAY, GdkWaylandDisplayClass))
57
58 struct _GdkWaylandDisplay
59 {
60   GdkDisplay parent_instance;
61   GdkScreen *screen;
62
63   /* Keyboard related information */
64   GdkKeymap *keymap;
65
66   /* input GdkDevice list */
67   GList *input_devices;
68
69   /* Startup notification */
70   gchar *startup_notification_id;
71
72   /* Time of most recent user interaction. */
73   gulong user_time;
74
75   /* Wayland fields below */
76   struct wl_display *wl_display;
77   struct wl_compositor *compositor;
78   struct wl_shm *shm;
79   struct wl_shell *shell;
80   struct wl_output *output;
81   struct wl_input_device *input_device;
82   struct wl_data_device_manager *data_device_manager;
83   GSource *event_source;
84
85 #ifdef GDK_WAYLAND_USE_EGL
86   EGLDisplay egl_display;
87   EGLContext egl_context;
88   cairo_device_t *cairo_device;
89 #endif
90
91   GdkCursor **cursors;
92
93 #ifdef GDK_WAYLAND_USE_EGL
94   PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d;
95   PFNEGLCREATEIMAGEKHRPROC create_image;
96   PFNEGLDESTROYIMAGEKHRPROC destroy_image;
97 #endif
98 };
99
100 struct _GdkWaylandDisplayClass
101 {
102   GdkDisplayClass parent_class;
103 };
104
105 GType      _gdk_wayland_display_get_type            (void);
106
107 G_END_DECLS
108
109 #endif                          /* __GDK_WAYLAND_DISPLAY__ */