Flutter Linux Embedder
fl_view.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_VIEW_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_PUBLIC_FLUTTER_LINUX_FL_VIEW_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 <gmodule.h>
13 #include <gtk/gtk.h>
14 
15 #include "fl_dart_project.h"
16 #include "fl_engine.h"
17 
18 G_BEGIN_DECLS
19 
20 G_MODULE_EXPORT
21 G_DECLARE_FINAL_TYPE(FlView, fl_view, FL, VIEW, GtkBox)
22 
23 /**
24  * FlView:
25  *
26  * #FlView is a GTK widget that is capable of displaying a Flutter application.
27  *
28  * The following example shows how to set up a view in a GTK application:
29  * |[<!-- language="C" -->
30  * FlDartProject *project = fl_dart_project_new ();
31  * FlView *view = fl_view_new (project);
32  * gtk_widget_show (GTK_WIDGET (view));
33  * gtk_container_add (GTK_CONTAINER (parent), view);
34  *
35  * FlBinaryMessenger *messenger =
36  * fl_engine_get_binary_messenger (fl_view_get_engine (view));
37  * setup_channels_or_plugins (messenger);
38  * ]|
39  */
40 
41 /**
42  * fl_view_new:
43  * @project: The project to show.
44  *
45  * Creates a widget to show Flutter application.
46  *
47  * Returns: a new #FlView.
48  */
49 FlView* fl_view_new(FlDartProject* project);
50 
51 /**
52  * fl_view_get_engine:
53  * @view: an #FlView.
54  *
55  * Gets the engine being rendered in the view.
56  *
57  * Returns: an #FlEngine.
58  */
59 FlEngine* fl_view_get_engine(FlView* view);
60 
61 G_END_DECLS
62 
63 #endif // FLUTTER_SHELL_PLATFORM_LINUX_PUBLIC_FLUTTER_LINUX_FL_VIEW_H_
fl_dart_project.h
fl_view_new
G_BEGIN_DECLS G_MODULE_EXPORT FlView * fl_view_new(FlDartProject *project)
Definition: fl_view.cc:837
fl_view_get_engine
FlEngine * fl_view_get_engine(FlView *view)
Definition: fl_view.cc:842
G_DECLARE_FINAL_TYPE
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlAccessibleTextField, fl_accessible_text_field, FL, ACCESSIBLE_TEXT_FIELD, FlAccessibleNode)
FL
FL
Definition: fl_binary_messenger.cc:27
fl_engine.h