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