Files
peyawallet/linux/runner/my_application.cc
T
Codex Bot 94b0dc9da4
build / Build Linux wallet (push) Failing after 12s
build / Build Windows wallet (push) Has been cancelled
Fix Linux runner flags for Ubuntu 22.04
2026-04-11 11:06:14 +02:00

59 lines
1.9 KiB
C++

#include "my_application.h"
#include <flutter_linux/flutter_linux.h>
#include <gtk/gtk.h>
#include "flutter/generated_plugin_registrant.h"
#ifndef G_APPLICATION_DEFAULT_FLAGS
#define G_APPLICATION_DEFAULT_FLAGS static_cast<GApplicationFlags>(0)
#endif
struct _MyApplication {
GtkApplication parent_instance;
gchar **dart_entrypoint_arguments;
};
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
static void my_application_activate(GApplication *application) {
MyApplication *self = MY_APPLICATION(application);
GtkWindow *window = GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
gtk_window_set_default_size(window, 1200, 720);
gtk_window_set_title(window, "Peya Wallet");
g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
FlView *view = fl_view_new(project);
gtk_widget_show(GTK_WIDGET(view));
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
gtk_widget_show(GTK_WIDGET(window));
}
static void my_application_dispose(GObject *object) {
MyApplication *self = MY_APPLICATION(object);
g_strfreev(self->dart_entrypoint_arguments);
G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
}
static void my_application_class_init(MyApplicationClass *klass) {
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
}
static void my_application_init(MyApplication *self) {
self->dart_entrypoint_arguments = nullptr;
}
MyApplication *my_application_new() {
return MY_APPLICATION(g_object_new(my_application_get_type(),
"application-id", "com.peya.wallet",
"flags", G_APPLICATION_DEFAULT_FLAGS,
nullptr));
}