Flutter Linux Embedder
fl_wayland_display.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_WAYLAND_DISPLAY_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_WAYLAND_DISPLAY_H_
7 
8 #include <gtk/gtk.h>
9 
11 
12 struct wl_display;
13 
14 G_BEGIN_DECLS
15 
16 G_DECLARE_FINAL_TYPE(FlWaylandDisplay,
17  fl_wayland_display,
18  FL,
19  WAYLAND_DISPLAY,
20  GObject)
21 
22 /**
23  * FlWaylandDisplay:
24  *
25  * #FlWaylandDisplay provides access to the Wayland globals used by Flutter,
26  * binding them from the Wayland registry a single time per display.
27  */
28 
29 /**
30  * fl_wayland_display_open:
31  * @wl_display: the Wayland display to use.
32  *
33  * Binds the Wayland globals used by Flutter on @wl_display. This is not a
34  * plain constructor - it fails if the compositor doesn't provide the globals
35  * that are required.
36  *
37  * Returns: (transfer full): an #FlWaylandDisplay, or %NULL if the required
38  * Wayland globals are not available.
39  */
40 FlWaylandDisplay* fl_wayland_display_open(struct wl_display* wl_display);
41 
42 /**
43  * fl_wayland_display_get_for_display:
44  * @display: a Wayland #GdkDisplay.
45  *
46  * Gets the #FlWaylandDisplay for @display, creating it if required. The
47  * Wayland registry is only queried the first time this is called for a given
48  * display. @display must be a Wayland display, it is a programmer error to
49  * call this otherwise.
50  *
51  * Returns: (transfer none): an #FlWaylandDisplay, or %NULL if the required
52  * Wayland globals are not available.
53  */
54 FlWaylandDisplay* fl_wayland_display_get_for_display(GdkDisplay* display);
55 
56 /**
57  * fl_wayland_display_create_subsurface:
58  * @display: an #FlWaylandDisplay.
59  * @parent_surface: the Wayland surface to attach the subsurface to.
60  *
61  * Creates a new Wayland subsurface on @parent_surface. @parent_surface must be
62  * on the display @display was created for, it is a programmer error to call
63  * this otherwise.
64  *
65  * Returns: (transfer full): a new #FlSubsurface.
66  */
68  FlWaylandDisplay* display,
69  struct wl_surface* parent_surface);
70 
71 G_END_DECLS
72 
73 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_WAYLAND_DISPLAY_H_
FlWaylandDisplay * fl_wayland_display_open(struct wl_display *wl_display)
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlWaylandDisplay, fl_wayland_display, FL, WAYLAND_DISPLAY, GObject) FlWaylandDisplay *fl_wayland_display_open(struct wl_display *wl_display)
FlSubsurface * fl_wayland_display_create_subsurface(FlWaylandDisplay *display, struct wl_surface *parent_surface)
FlWaylandDisplay * fl_wayland_display_get_for_display(GdkDisplay *display)