diff --git a/shell/platform/linux/fl_dart_project.cc b/shell/platform/linux/fl_dart_project.cc index 0a20dd6ade89750e0940810969d71780f236f16c..fcaeff22486187a2e8854f9fca88653adc1891a6 100644 --- a/shell/platform/linux/fl_dart_project.cc +++ b/shell/platform/linux/fl_dart_project.cc @@ -6,13 +6,6 @@ #include -/** - * FlDartProject: - * - * #FlDartProject represents a Dart project. It is used provide information - * about the application when creating a #FlView. - */ - struct _FlDartProject { GObject parent_instance; @@ -112,62 +105,21 @@ static void fl_dart_project_class_init(FlDartProjectClass* klass) { static void fl_dart_project_init(FlDartProject* self) {} -/** - * fl_dart_project_new: - * @path: a file path, e.g. "my_dart_project" - * - * Create a Flutter project. The project path should contain the following - * top-level items: - * - icudtl.dat (provided as a resource by the Flutter tool) - * - flutter_assets (as built by the Flutter tool) - * - * The path can either be absolute, or relative to the directory containing the - * running executable. - * - * Returns: a new #FlDartProject - */ G_MODULE_EXPORT FlDartProject* fl_dart_project_new(const gchar* path) { return static_cast( g_object_new(fl_dart_project_get_type(), "path", path, nullptr)); } -/** - * fl_dart_project_get_path: - * @view: a #FlDartProject - * - * Get the path to the directory containing the Flutter application. - * - * Returns: (type filename): a file path, e.g. "/projects/my_dart_project" - */ G_MODULE_EXPORT const gchar* fl_dart_project_get_path(FlDartProject* self) { g_return_val_if_fail(FL_IS_DART_PROJECT(self), nullptr); return self->path; } -/** - * fl_dart_project_get_assets_path: - * @view: a #FlDartProject - * - * Get the path to the directory containing the assets used in the Flutter - * application. - * - * Returns: (type filename): a file path, e.g. - * "/projects/my_dart_project/assets" - */ G_MODULE_EXPORT gchar* fl_dart_project_get_assets_path(FlDartProject* self) { g_return_val_if_fail(FL_IS_DART_PROJECT(self), nullptr); return g_build_filename(self->path, "flutter_assets", NULL); } -/** - * fl_dart_project_get_icu_data_path: - * @view: a #FlDartProject - * - * Get the path to the ICU data file in the Flutter application. - * - * Returns: (type filename): a file path, e.g. - * "/projects/my_dart_project/icudtl.dat" - */ G_MODULE_EXPORT gchar* fl_dart_project_get_icu_data_path(FlDartProject* self) { g_return_val_if_fail(FL_IS_DART_PROJECT(self), nullptr); return g_build_filename(self->path, "icudtl.dat", NULL); diff --git a/shell/platform/linux/fl_view.cc b/shell/platform/linux/fl_view.cc index 879a36201ac176bb68e2778bcab7752b2556f95c..a1aad509a52303b0e1283bea0c62199b72ea2352 100644 --- a/shell/platform/linux/fl_view.cc +++ b/shell/platform/linux/fl_view.cc @@ -11,12 +11,6 @@ #include "flutter/shell/platform/embedder/embedder.h" -/** - * FlView: - * - * #FlView is a GTK widget that is capable of displaying a Flutter application. - */ - struct _FlView { GtkWidget parent_instance; @@ -278,14 +272,6 @@ static void fl_view_class_init(FlViewClass* klass) { static void fl_view_init(FlView* self) {} -/** - * fl_view_new: - * @project: The project to show. - * - * Create a widget to show Flutter application. - * - * Returns: a new #FlView - */ G_MODULE_EXPORT FlView* fl_view_new(FlDartProject* project) { return static_cast( g_object_new(fl_view_get_type(), "flutter-project", project, nullptr)); diff --git a/shell/platform/linux/public/flutter_linux/fl_dart_project.h b/shell/platform/linux/public/flutter_linux/fl_dart_project.h index 8ee42502179eb53bdabf0f887e04f6691f531850..1a379713ccc06c042f62dd88fbecdcd0a0800cae 100644 --- a/shell/platform/linux/public/flutter_linux/fl_dart_project.h +++ b/shell/platform/linux/public/flutter_linux/fl_dart_project.h @@ -15,12 +15,75 @@ G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlDartProject, fl_dart_project, FL, DART_PROJECT, GObject) +/** + * FlDartProject: + * + * #FlDartProject represents a Dart project. It is used to provide information + * about the application when creating a #FlView. + */ + +/** + * fl_dart_project_new: + * @path: a file path, e.g. "my_dart_project" + * + * Create a Flutter project. The project path should contain the following + * top-level items: + * - icudtl.dat (provided as a resource by the Flutter tool) + * - flutter_assets (as built by the Flutter tool) + * + * The path can either be absolute, or relative to the directory containing the + * running executable. + * + * Returns: a new #FlDartProject + */ + +/** + * fl_dart_project_new: + * @path: a file path, e.g. "my_dart_project" + * + * Creates a Flutter project. The project path should contain the following + * top-level items: + * - icudtl.dat (provided as a resource by the Flutter tool) + * - flutter_assets (as built by the Flutter tool) + * + * The path can either be absolute, or relative to the directory containing the + * running executable. + * + * Returns: a new #FlDartProject + */ FlDartProject* fl_dart_project_new(const gchar* path); +/** + * fl_dart_project_get_path: + * @project: a #FlDartProject + * + * Gets the path to the directory containing the Flutter application. + * + * Returns: (type filename): a file path, e.g. "/projects/my_dart_project" + */ const gchar* fl_dart_project_get_path(FlDartProject* project); +/** + * fl_dart_project_get_assets_path: + * @project: a #FlDartProject + * + * Gets the path to the directory containing the assets used in the Flutter + * application. + * + * Returns: (type filename): a file path, e.g. + * "/projects/my_dart_project/assets" + */ gchar* fl_dart_project_get_assets_path(FlDartProject* project); +/** + * fl_dart_project_get_icu_data_path: + * @project: a #FlDartProject + * + * Gets the path to the ICU data file in the Flutter application. + * + * Returns: (type filename): a file path, e.g. + * "/projects/my_dart_project/icudtl.dat" + */ gchar* fl_dart_project_get_icu_data_path(FlDartProject* project); G_END_DECLS diff --git a/shell/platform/linux/public/flutter_linux/fl_view.h b/shell/platform/linux/public/flutter_linux/fl_view.h index a47733e251747d788c4dbcc253773aae95596425..6b93daebfb352628f64b968938f8f0c9f0ca19b3 100644 --- a/shell/platform/linux/public/flutter_linux/fl_view.h +++ b/shell/platform/linux/public/flutter_linux/fl_view.h @@ -17,6 +17,20 @@ G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlView, fl_view, FL, VIEW, GtkWidget) +/** + * FlView: + * + * #FlView is a GTK widget that is capable of displaying a Flutter application. + */ + +/** + * fl_view_new: + * @project: The project to show. + * + * Creates a widget to show Flutter application. + * + * Returns: a new #FlView + */ FlView* fl_view_new(FlDartProject* project); G_END_DECLS