Flutter Linux Embedder
fl_subsurface.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_SUBSURFACE_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_SUBSURFACE_H_
7 
8 #include <gtk/gtk.h>
9 
10 struct wl_compositor;
11 struct wl_subcompositor;
12 struct wl_surface;
13 
14 G_BEGIN_DECLS
15 
16 G_DECLARE_FINAL_TYPE(FlSubsurface, fl_subsurface, FL, SUBSURFACE, GObject)
17 
18 /**
19  * FlSubsurface:
20  *
21  * #FlSubsurface manages a Wayland subsurface attached to another Wayland
22  * surface. It is used to render Flutter content directly to a Wayland surface,
23  * independently of the GTK widget hierarchy.
24  */
25 
26 /**
27  * fl_subsurface_new:
28  * @compositor: the Wayland compositor to create the surface with.
29  * @subcompositor: the Wayland subcompositor to create the subsurface with.
30  * @parent_surface: the Wayland surface to attach the subsurface to.
31  *
32  * Creates a new Wayland subsurface on @parent_surface.
33  *
34  * Returns: a new #FlSubsurface.
35  */
36 FlSubsurface* fl_subsurface_new(struct wl_compositor* compositor,
37  struct wl_subcompositor* subcompositor,
38  struct wl_surface* parent_surface);
39 
40 /**
41  * fl_subsurface_get_surface:
42  * @subsurface: an #FlSubsurface.
43  *
44  * Gets the Wayland surface backing this subsurface.
45  *
46  * Returns: a `struct wl_surface`.
47  */
48 struct wl_surface* fl_subsurface_get_surface(FlSubsurface* subsurface);
49 
50 /**
51  * fl_subsurface_set_position:
52  * @subsurface: an #FlSubsurface.
53  * @x: x coordinate in the parent surface.
54  * @y: y coordinate in the parent surface.
55  *
56  * Moves the subsurface to the given position relative to the parent surface.
57  */
58 void fl_subsurface_set_position(FlSubsurface* subsurface, gint x, gint y);
59 
60 G_END_DECLS
61 
62 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_SUBSURFACE_H_
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlAccessibilityChannel, fl_accessibility_channel, FL, ACCESSIBILITY_CHANNEL, GObject)
G_BEGIN_DECLS FlSubsurface * fl_subsurface_new(struct wl_compositor *compositor, struct wl_subcompositor *subcompositor, struct wl_surface *parent_surface)
struct wl_surface * fl_subsurface_get_surface(FlSubsurface *subsurface)
void fl_subsurface_set_position(FlSubsurface *subsurface, gint x, gint y)
G_BEGIN_DECLS FlSubsurface * subsurface