summaryrefslogtreecommitdiff
path: root/src/framework.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2024-07-20 23:23:43 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2024-07-20 23:23:43 (GMT)
commite4ccb9e56e822628e299527fee0b7325f0d25662 (patch)
tree10d5eb35fad4ba01b757d4c403c912f209eacb3e /src/framework.c
parent9d0d5edf372a9f681bbfd0a3639ee8fc367ce96d (diff)
Prepare a welcome screen.
Diffstat (limited to 'src/framework.c')
-rw-r--r--src/framework.c63
1 files changed, 26 insertions, 37 deletions
diff --git a/src/framework.c b/src/framework.c
index 9e4f81c..1c90fda 100644
--- a/src/framework.c
+++ b/src/framework.c
@@ -30,8 +30,8 @@
#include "framework.h"
#include "glibext/helpers.h"
#include "gui/core/core.h"
-#include "analysis/contents/file.h" // REMME
-#include "gtkext/hexview.h" // REMME
+#include "gui/core/panels.h" // REMME
+#include "gui/panels/welcome.h" // REMME
@@ -257,49 +257,24 @@ static void gtk_chrysalide_framework_activate(GApplication *app)
gtk_window_present(window);
+
do
{
- GBinContent *cnt;
-
- GtkWidget *parent;
- GtkHexView *wgt;
-
-
-#if 0
-
- cnt = g_file_content_new("tmp.bin");
-
- parent = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
- gtk_box_set_homogeneous(GTK_BOX(parent), FALSE);
- gtk_window_set_child(window, parent);
-
- wgt = gtk_hex_view_new(cnt);
- gtk_box_append(GTK_BOX(parent), GTK_WIDGET(wgt));
-
- wgt = gtk_hex_view_new(cnt);
- gtk_box_append(GTK_BOX(parent), GTK_WIDGET(wgt));
-
-#else
-
- cnt = g_file_content_new("/bin/id");
- //cnt = g_file_content_new("tmp.bin");
-
-
- parent = gtk_scrolled_window_new();
- gtk_window_set_child(window, parent);
-
- wgt = gtk_hex_view_new(cnt);
- gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(parent), GTK_WIDGET(wgt));
-
-#endif
+ GPanelItem *item;
+ GtkTiledPanel *panel;
+ item = find_item_panel_by_type(G_TYPE_WELCOME_PANEL);
+ panel = g_panel_item_get_panel(item);
+ gtk_window_set_child(window, GTK_WIDGET(panel));
+ unref_object(item);
}
while (0);
+
/* Chargement des extensions de thème */
/*
@@ -322,6 +297,20 @@ static void gtk_chrysalide_framework_activate(GApplication *app)
unref_object(css);
+
+
+
+
+ css = gtk_css_provider_new();
+
+ gtk_css_provider_load_from_resource(css, "/re/chrysalide/framework/gui/style.css");
+
+ gtk_style_context_add_provider_for_display(gtk_widget_get_display(GTK_WIDGET(window)),
+ GTK_STYLE_PROVIDER(css), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+
+ unref_object(css);
+
+
}
@@ -349,7 +338,7 @@ int main(int argc, char **argv)
int result; /* Bilan de l'exécution */
GtkChrysalideFramework *app; /* Gestion d'application GTK */
- if (!load_gui_components(AGC_BUFFER_FEATURES))
+ if (!load_gui_components(AGC_BUFFER_FEATURES | AGC_PANELS))
return EXIT_FAILURE;
ensure_wm_icon_and_name();
@@ -360,7 +349,7 @@ int main(int argc, char **argv)
g_object_unref(G_OBJECT(app));
- unload_gui_components(AGC_BUFFER_FEATURES);
+ unload_gui_components(AGC_BUFFER_FEATURES | AGC_PANELS);
return result;