Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
fl_plugin_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_PLUGIN_REGISTRAR_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_PUBLIC_FLUTTER_LINUX_FL_PLUGIN_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
15#include "fl_binary_messenger.h"
17#include "fl_view.h"
18
19G_BEGIN_DECLS
20
21G_MODULE_EXPORT
22G_DECLARE_INTERFACE(FlPluginRegistrar,
23 fl_plugin_registrar,
24 FL,
25 PLUGIN_REGISTRAR,
26 GObject)
27
28struct _FlPluginRegistrarInterface {
29 GTypeInterface parent_iface;
30
31 FlBinaryMessenger* (*get_messenger)(FlPluginRegistrar* registrar);
32
33 FlTextureRegistrar* (*get_texture_registrar)(FlPluginRegistrar* registrar);
34
35 FlView* (*get_view)(FlPluginRegistrar* registrar);
36};
37
38/**
39 * FlPluginRegistrar:
40 *
41 * #FlPluginRegistrar is used when registering new plugins.
42 */
43
44/**
45 * fl_plugin_registrar_get_messenger:
46 * @registrar: an #FlPluginRegistrar.
47 *
48 * Gets the messenger this plugin can communicate with.
49 *
50 * Returns: an #FlBinaryMessenger.
51 */
52FlBinaryMessenger* fl_plugin_registrar_get_messenger(
53 FlPluginRegistrar* registrar);
54
55/**
56 * fl_plugin_registrar_get_texture_registrar:
57 * @registrar: an #FlPluginRegistrar.
58 *
59 * Gets the texture registrar this plugin can communicate with.
60 *
61 * Returns: an #FlTextureRegistrar.
62 */
64 FlPluginRegistrar* registrar);
65
66/**
67 * fl_plugin_registrar_get_view:
68 * @registrar: an #FlPluginRegistrar.
69 *
70 * Get the view that Flutter is rendering with.
71 *
72 * Returns: (allow-none): an #FlView or %NULL if running in headless mode.
73 */
74FlView* fl_plugin_registrar_get_view(FlPluginRegistrar* registrar);
75
76G_END_DECLS
77
78#endif // FLUTTER_SHELL_PLATFORM_LINUX_PUBLIC_FLUTTER_LINUX_FL_PLUGIN_REGISTRAR_H_
FlBinaryMessenger * fl_plugin_registrar_get_messenger(FlPluginRegistrar *registrar)
G_BEGIN_DECLS G_MODULE_EXPORT G_DECLARE_INTERFACE(FlPluginRegistrar, fl_plugin_registrar, FL, PLUGIN_REGISTRAR, GObject) struct _FlPluginRegistrarInterface
FlView * fl_plugin_registrar_get_view(FlPluginRegistrar *registrar)
FlTextureRegistrar * fl_plugin_registrar_get_texture_registrar(FlPluginRegistrar *registrar)