| Flutter Linux Embedder |

fl_texture_registrar.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_PUBLIC_FLUTTER_LINUX_FL_TEXTURE_REGISTRAR_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_PUBLIC_FLUTTER_LINUX_FL_TEXTURE_REGISTRAR_H_
7
8 #if !defined(__FLUTTER_LINUX_INSIDE__) && !defined(FLUTTER_LINUX_COMPILATION)
9 #error "Only <flutter_linux/flutter_linux.h> can be included directly."
10 #endif
11
12 #include <glib-object.h>
13 #include <gmodule.h>
14 #include <stdint.h>
15
16 #include "fl_texture.h"
17
18 G_BEGIN_DECLS
19
20 G_MODULE_EXPORT
21 G_DECLARE_INTERFACE(FlTextureRegistrar,
22 fl_texture_registrar,
23 FL,
24 TEXTURE_REGISTRAR,
25 GObject)
26
27 struct _FlTextureRegistrarInterface {
28 GTypeInterface parent_iface;
29
30 gboolean (*register_texture)(FlTextureRegistrar* registrar,
31 FlTexture* texture);
32
33 FlTexture* (*lookup_texture)(FlTextureRegistrar* registrar, int64_t id);
34
35 gboolean (*mark_texture_frame_available)(FlTextureRegistrar* registrar,
36 FlTexture* texture);
37
38 gboolean (*unregister_texture)(FlTextureRegistrar* registrar,
39 FlTexture* texture);
40 };
41
42 /**
43 * FlTextureRegistrar:
44 *
45 * #FlTextureRegistrar is used when registering textures.
46 *
47 * Flutter Framework accesses your texture by the related unique texture ID. To
48 * draw your texture in Dart, you should add Texture widget in your widget tree
49 * with the same texture ID. Use platform channels to send this unique texture
50 * ID to the Dart side.
51 */
52
53 /**
54 * fl_texture_registrar_register_texture:
55 * @registrar: an #FlTextureRegistrar.
56 * @texture: an #FlTexture for registration.
57 *
58 * Registers a texture.
59 *
60 * Returns: %TRUE on success.
61 */
62 gboolean fl_texture_registrar_register_texture(FlTextureRegistrar* registrar,
63 FlTexture* texture);
64
65 /**
66 * fl_texture_registrar_mark_texture_frame_available:
67 * @registrar: an #FlTextureRegistrar.
68 * @texture: the texture that has a frame available.
69 *
70 * Notifies the flutter engine that the texture object has updated and needs to
71 * be rerendered.
72 *
73 * Returns: %TRUE on success.
74 */
75 gboolean fl_texture_registrar_mark_texture_frame_available(
76 FlTextureRegistrar* registrar,
77 FlTexture* texture);
78
79 /**
80 * fl_texture_registrar_unregister_texture:
81 * @registrar: an #FlTextureRegistrar.
82 * @texture: the texture being unregistered.
83 *
84 * Unregisters an existing texture object.
85 *
86 * Returns: %TRUE on success.
87 */
88 gboolean fl_texture_registrar_unregister_texture(FlTextureRegistrar* registrar,
89 FlTexture* texture);
90
91 G_END_DECLS
92
93 #endif // FLUTTER_SHELL_PLATFORM_LINUX_PUBLIC_FLUTTER_LINUX_FL_TEXTURE_REGISTRAR_H_
fl_texture_registrar_register_texture
gboolean fl_texture_registrar_register_texture(FlTextureRegistrar *registrar, FlTexture *texture)
Definition: fl_texture_registrar.cc:182
G_DECLARE_INTERFACE
G_BEGIN_DECLS G_MODULE_EXPORT G_DECLARE_INTERFACE(FlTextureRegistrar, fl_texture_registrar, FL, TEXTURE_REGISTRAR, GObject) struct _FlTextureRegistrarInterface
Definition: fl_texture_registrar.h:21
id
int64_t id
Definition: fl_pixel_buffer_texture.cc:28
mark_texture_frame_available
static gboolean mark_texture_frame_available(FlTextureRegistrar *registrar, FlTexture *texture)
Definition: fl_texture_registrar.cc:133
unregister_texture
static gboolean unregister_texture(FlTextureRegistrar *registrar, FlTexture *texture)
Definition: fl_texture_registrar.cc:145
fl_texture_registrar_unregister_texture
gboolean fl_texture_registrar_unregister_texture(FlTextureRegistrar *registrar, FlTexture *texture)
Definition: fl_texture_registrar.cc:207
FL
FL
Definition: fl_binary_messenger.cc:27
fl_texture_registrar_mark_texture_frame_available
gboolean fl_texture_registrar_mark_texture_frame_available(FlTextureRegistrar *registrar, FlTexture *texture)
Definition: fl_texture_registrar.cc:198
register_texture
static gboolean register_texture(FlTextureRegistrar *registrar, FlTexture *texture)
Definition: fl_texture_registrar.cc:92
fl_texture.h