@@ -15,8 +15,7 @@ struct _MyApplication {
1515G_DEFINE_TYPE (MyApplication, my_application, GTK_TYPE_APPLICATION)
1616
1717// Called when first Flutter frame received.
18- static void first_frame_cb(MyApplication* self, FlView *view)
19- {
18+ static void first_frame_cb(MyApplication* self, FlView* view) {
2019 gtk_widget_show (gtk_widget_get_toplevel (GTK_WIDGET (view)));
2120}
2221
@@ -56,19 +55,22 @@ static void my_application_activate(GApplication* application) {
5655 gtk_window_set_default_size (window, 1280 , 720 );
5756
5857 g_autoptr (FlDartProject) project = fl_dart_project_new ();
59- fl_dart_project_set_dart_entrypoint_arguments (project, self->dart_entrypoint_arguments );
58+ fl_dart_project_set_dart_entrypoint_arguments (
59+ project, self->dart_entrypoint_arguments );
6060
6161 FlView* view = fl_view_new (project);
6262 GdkRGBA background_color;
63- // Background defaults to black, override it here if necessary, e.g. #00000000 for transparent.
63+ // Background defaults to black, override it here if necessary, e.g. #00000000
64+ // for transparent.
6465 gdk_rgba_parse (&background_color, " #000000" );
6566 fl_view_set_background_color (view, &background_color);
6667 gtk_widget_show (GTK_WIDGET (view));
6768 gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (view));
6869
6970 // Show the window when Flutter renders.
7071 // Requires the view to be realized so we can start rendering.
71- g_signal_connect_swapped (view, " first-frame" , G_CALLBACK (first_frame_cb), self);
72+ g_signal_connect_swapped (view, " first-frame" , G_CALLBACK (first_frame_cb),
73+ self);
7274 gtk_widget_realize (GTK_WIDGET (view));
7375
7476 fl_register_plugins (FL_PLUGIN_REGISTRY (view));
@@ -77,16 +79,18 @@ static void my_application_activate(GApplication* application) {
7779}
7880
7981// Implements GApplication::local_command_line.
80- static gboolean my_application_local_command_line (GApplication* application, gchar*** arguments, int * exit_status) {
82+ static gboolean my_application_local_command_line (GApplication* application,
83+ gchar*** arguments,
84+ int * exit_status) {
8185 MyApplication* self = MY_APPLICATION (application);
8286 // Strip out the first argument as it is the binary name.
8387 self->dart_entrypoint_arguments = g_strdupv (*arguments + 1 );
8488
8589 g_autoptr (GError) error = nullptr ;
8690 if (!g_application_register (application, nullptr , &error)) {
87- g_warning (" Failed to register: %s" , error->message );
88- *exit_status = 1 ;
89- return TRUE ;
91+ g_warning (" Failed to register: %s" , error->message );
92+ *exit_status = 1 ;
93+ return TRUE ;
9094 }
9195
9296 g_application_activate (application);
@@ -97,7 +101,7 @@ static gboolean my_application_local_command_line(GApplication* application, gch
97101
98102// Implements GApplication::startup.
99103static void my_application_startup (GApplication* application) {
100- // MyApplication* self = MY_APPLICATION(object);
104+ // MyApplication* self = MY_APPLICATION(object);
101105
102106 // Perform any actions required at application startup.
103107
@@ -106,7 +110,7 @@ static void my_application_startup(GApplication* application) {
106110
107111// Implements GApplication::shutdown.
108112static void my_application_shutdown (GApplication* application) {
109- // MyApplication* self = MY_APPLICATION(object);
113+ // MyApplication* self = MY_APPLICATION(object);
110114
111115 // Perform any actions required at application shutdown.
112116
@@ -122,7 +126,8 @@ static void my_application_dispose(GObject* object) {
122126
123127static void my_application_class_init (MyApplicationClass* klass) {
124128 G_APPLICATION_CLASS (klass)->activate = my_application_activate;
125- G_APPLICATION_CLASS (klass)->local_command_line = my_application_local_command_line;
129+ G_APPLICATION_CLASS (klass)->local_command_line =
130+ my_application_local_command_line;
126131 G_APPLICATION_CLASS (klass)->startup = my_application_startup;
127132 G_APPLICATION_CLASS (klass)->shutdown = my_application_shutdown;
128133 G_OBJECT_CLASS (klass)->dispose = my_application_dispose;
@@ -138,7 +143,6 @@ MyApplication* my_application_new() {
138143 g_set_prgname (APPLICATION_ID);
139144
140145 return MY_APPLICATION (g_object_new (my_application_get_type (),
141- " application-id" , APPLICATION_ID,
142- " flags" , G_APPLICATION_NON_UNIQUE,
143- nullptr ));
146+ " application-id" , APPLICATION_ID, " flags" ,
147+ G_APPLICATION_NON_UNIQUE, nullptr ));
144148}
0 commit comments