From d9708a32626b181a545b4664d617ebb1ee7ac0b6 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 4 Aug 2024 19:45:28 +0300 Subject: [PATCH] init main component --- src/main.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main.h | 13 +++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 src/main.cpp create mode 100644 src/main.h diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 00000000..17db6133 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,48 @@ +#include "main.h" + +void activate( + GtkApplication *application +) { + // Init default component + new YodaBrowser( + application + ); +} + +int main( + int argc, + char *argv[] +) { + // Create a new application + GtkApplication *application = gtk_application_new( + NULL, + G_APPLICATION_DEFAULT_FLAGS + ); + + // Connect the "activate" signal to the callback function + g_signal_connect( + application, + "activate", + G_CALLBACK( + activate + ), + NULL + ); + + // Run the application + int status = g_application_run( + G_APPLICATION( + application + ), + argc, + argv + ); + + // Clean up + g_object_unref( + application + ); + + // Result + return status; +} \ No newline at end of file diff --git a/src/main.h b/src/main.h new file mode 100644 index 00000000..89af56cd --- /dev/null +++ b/src/main.h @@ -0,0 +1,13 @@ +#include +#include + +#include "Yoda/Browser.h" + +void static activate( + GtkApplication *application +); + +int main( + int argc, + char *argv[] +); \ No newline at end of file