4 * An object oriented GL/GLES Abstraction/Utility Layer
6 * Copyright (C) 2011 Intel Corporation.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser 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.
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 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 #if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <cogl/cogl.h> can be included directly."
28 #ifndef __COGL_WAYLAND_RENDERER_H__
29 #define __COGL_WAYLAND_RENDERER_H__
31 #include <cogl/cogl-types.h>
32 #include <cogl/cogl-renderer.h>
34 #include <wayland-client.h>
39 * cogl_wayland_renderer_set_foreign_display:
40 * @renderer: A #CoglRenderer
41 * @display: A Wayland display
43 * Allows you to explicitly control what Wayland display you want Cogl
44 * to work with instead of leaving Cogl to automatically connect to a
47 * <note>If you use this API you must also explicitly set foreign
48 * Wayland compositor and shell objects using the
49 * cogl_wayland_renderer_set_foreign_compositor() and
50 * cogl_wayland_renderer_set_foreign_shell() respectively. This ie
51 * because Wayland doesn't currently provide a way to retrospectively
52 * query these interfaces so the expectation is that if you have taken
53 * ownership of the display then you will also have been notified of
54 * the compositor and shell interfaces which Cogl needs to use.</note>
60 cogl_wayland_renderer_set_foreign_display (CoglRenderer *renderer,
61 struct wl_display *display);
64 * cogl_wayland_renderer_get_display:
65 * @renderer: A #CoglRenderer
66 * @display: A Wayland display
68 * Retrieves the Wayland display that Cogl is using. If a foreign
69 * display has been specified using
70 * cogl_wayland_renderer_set_foreign_display() then that display will
71 * be returned. If no foreign display has been specified then the
72 * display that Cogl creates internally will be returned unless the
73 * renderer has not yet been connected (either implicitly or explicitly by
74 * calling cogl_renderer_connect()) in which case %NULL is returned.
76 * Returns: The wayland display currently associated with @renderer,
77 * or %NULL if the renderer hasn't yet been connected and no
78 * foreign display has been specified.
84 cogl_wayland_renderer_get_display (CoglRenderer *renderer);
87 * cogl_wayland_renderer_set_foreign_compositor:
88 * @renderer: A #CoglRenderer
89 * @compositor: A Wayland compositor
91 * Allows you to explicitly notify Cogl of a Wayland compositor
92 * interface to use. This API should be used in conjunction with
93 * cogl_wayland_renderer_set_foreign_display() because if you are
94 * connecting to a wayland compositor manually that will also mean you
95 * will be notified on connection of the available interfaces that
96 * can't be queried retrosectively with the current Wayland protocol.
102 cogl_wayland_renderer_set_foreign_compositor (CoglRenderer *renderer,
103 struct wl_compositor *compositor);
106 * cogl_wayland_renderer_get_compositor:
107 * @renderer: A #CoglRenderer
109 * Retrieves the Wayland compositor interface that Cogl is using. If a
110 * foreign compositor has been specified using
111 * cogl_wayland_renderer_set_foreign_compositor() then that compositor
112 * will be returned. If no foreign compositor has been specified then
113 * the compositor that Cogl is notified of internally will be returned
114 * unless the renderer has not yet been connected (either implicitly
115 * or explicitly by calling cogl_renderer_connect()) in which case
119 * Stability: unstable
121 struct wl_compositor *
122 cogl_wayland_renderer_get_compositor (CoglRenderer *renderer);
125 * cogl_wayland_renderer_set_foreign_shell:
126 * @renderer: A #CoglRenderer
127 * @shell: A Wayland shell
129 * Allows you to explicitly notify Cogl of a Wayland shell interface
130 * to use. This API should be used in conjunction with
131 * cogl_wayland_renderer_set_foreign_display() because if you are
132 * connecting to a wayland compositor manually that will also mean you
133 * will be notified on connection of the available interfaces that
134 * can't be queried retrosectively with the current Wayland protocol.
137 * Stability: unstable
140 cogl_wayland_renderer_set_foreign_shell (CoglRenderer *renderer,
141 struct wl_shell *shell);
144 * cogl_wayland_renderer_get_shell:
145 * @renderer: A #CoglRenderer
147 * Retrieves the Wayland shell interface that Cogl is using. If a
148 * foreign shell has been specified using
149 * cogl_wayland_renderer_set_foreign_shell() then that shell
150 * will be returned. If no foreign shell has been specified then
151 * the shell that Cogl is notified of internally will be returned
152 * unless the renderer has not yet been connected (either implicitly
153 * or explicitly by calling cogl_renderer_connect()) in which case
157 * Stability: unstable
160 cogl_wayland_renderer_get_shell (CoglRenderer *renderer);
164 #endif /* __COGL_WAYLAND_RENDERER_H__ */