mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
init main component
This commit is contained in:
parent
859beb871b
commit
d9708a3262
2 changed files with 61 additions and 0 deletions
48
src/main.cpp
Normal file
48
src/main.cpp
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
13
src/main.h
Normal file
13
src/main.h
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "Yoda/Browser.h"
|
||||||
|
|
||||||
|
void static activate(
|
||||||
|
GtkApplication *application
|
||||||
|
);
|
||||||
|
|
||||||
|
int main(
|
||||||
|
int argc,
|
||||||
|
char *argv[]
|
||||||
|
);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue