rosenrot/rose.c

30 lines
743 B
C
Raw Normal View History

2022-05-09 21:03:14 +00:00
#include "rose.h"
#include "config.h"
2022-05-10 15:35:37 +00:00
#include "webview.h"
#include "window.h"
2022-05-09 21:03:14 +00:00
#include <stdio.h>
#include <stdlib.h>
static void run(GtkApplication *app)
{
2022-05-10 15:35:37 +00:00
RoseWindow *window = rose_window_new(app);
GtkWidget *webview = rose_webview_new();
2022-05-09 21:03:14 +00:00
2022-05-10 15:35:37 +00:00
if (dark_mode) {
g_object_set(gtk_settings_get_default(), "gtk-application-prefer-dark-theme", true, NULL);
}
2022-05-09 21:03:14 +00:00
2022-05-10 15:35:37 +00:00
rose_window_set_webview(window, webview);
rose_window_show(window);
2022-05-09 21:03:14 +00:00
if (homepage)
2022-05-10 15:35:37 +00:00
rose_webview_load_url(WEBKIT_WEB_VIEW(webview), homepage);
2022-05-09 21:03:14 +00:00
}
int main(int argc, char **argv)
{
GtkApplication *app = gtk_application_new("org.gtk.rose", G_APPLICATION_FLAGS_NONE);
g_signal_connect(app, "activate", G_CALLBACK(run), NULL);
g_application_run(G_APPLICATION(app), argc, argv);
}