未验证 提交 b360eab6 编写于 作者: R Robert Ancell 提交者: GitHub

Move Linux shell docstrings to headers (#17410)

Update docstrings for typos and grammar style specified in the style guide.
上级 f82a615f
......@@ -6,13 +6,6 @@
#include <gmodule.h>
/**
* 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<FlDartProject*>(
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);
......
......@@ -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<FlView*>(
g_object_new(fl_view_get_type(), "flutter-project", project, nullptr));
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册