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