From 859beb871b9cdf231c66a19fc6cb85fbad7a0fbf Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 4 Aug 2024 19:44:57 +0300 Subject: [PATCH] init browser component --- src/Yoda/Browser.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ src/Yoda/Browser.h | 21 +++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 src/Yoda/Browser.cpp create mode 100644 src/Yoda/Browser.h diff --git a/src/Yoda/Browser.cpp b/src/Yoda/Browser.cpp new file mode 100644 index 00000000..32774577 --- /dev/null +++ b/src/Yoda/Browser.cpp @@ -0,0 +1,43 @@ +#include "Browser.h" + +YodaBrowser::YodaBrowser( + GtkApplication *application +) { + this->gtk = gtk_application_window_new( + application + ); + + gtk_window_set_title( + GTK_WINDOW( + this->gtk + ), + YodaBrowser::TITLE + ); + + gtk_window_set_default_size( + GTK_WINDOW( + this->gtk + ), + YodaBrowser::WIDTH, + YodaBrowser::HEIGHT + ); + + GtkWidget *label = gtk_label_new( + "Hello, World!" + ); + + gtk_window_set_child( + GTK_WINDOW( + this->gtk + ), + label + ); + + gtk_widget_show( + GTK_WIDGET( + this->gtk + ) + ); + + // @TODO signals +} \ No newline at end of file diff --git a/src/Yoda/Browser.h b/src/Yoda/Browser.h new file mode 100644 index 00000000..aca04d83 --- /dev/null +++ b/src/Yoda/Browser.h @@ -0,0 +1,21 @@ +#ifndef YODA_BROWSER_H +#define YODA_BROWSER_H + +#include "../main.h" + +class YodaBrowser +{ + public: + + GtkWidget *gtk; + + const guint WIDTH = 640; + const guint HEIGHT = 480; + const gchar* TITLE = "Yoda"; + + YodaBrowser( + GtkApplication *application + ); +}; + +#endif \ No newline at end of file