diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2024-07-14 17:58:45 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2024-07-14 17:58:45 (GMT) |
commit | 9d0d5edf372a9f681bbfd0a3639ee8fc367ce96d (patch) | |
tree | 58493507927e69bb0fb9f337845fb010900f35e3 /src/gtkext/dockstation.c | |
parent | beb69108d4efcebc5a6d70d0de6bdc9ea8026960 (diff) |
Setup basic features for framework GUI panels.
Diffstat (limited to 'src/gtkext/dockstation.c')
-rw-r--r-- | src/gtkext/dockstation.c | 225 |
1 files changed, 222 insertions, 3 deletions
diff --git a/src/gtkext/dockstation.c b/src/gtkext/dockstation.c index 1757542..093f120 100644 --- a/src/gtkext/dockstation.c +++ b/src/gtkext/dockstation.c @@ -1,8 +1,8 @@ /* Chrysalide - Outil d'analyse de fichiers binaires - * gtkdockstation.c - manipulation et l'affichage de composants rassemblés + * dockstation.c - manipulation et l'affichage de composants rassemblés * - * Copyright (C) 2012-2019 Cyrille Bagard + * Copyright (C) 2012-2024 Cyrille Bagard * * This file is part of Chrysalide. * @@ -21,9 +21,224 @@ */ -#include "gtkdockstation.h" +#include "dockstation.h" +#include "dockstation-int.h" + + + +/* Procède à l'initialisation de l'afficheur concentré. */ +static void gtk_dock_station_class_init(GtkDockStationClass *); + +/* Procède à l'initialisation du support d'affichage concentré. */ +static void gtk_dock_station_init(GtkDockStation *); + +/* Supprime toutes les références externes. */ +static void gtk_dock_station_dispose(GtkDockStation *); + +/* Procède à la libération totale de la mémoire. */ +static void gtk_dock_station_finalize(GtkDockStation *); + + + + +/* Détermine le type du composant d'affichage concentré. */ +G_DEFINE_TYPE(GtkDockStation, gtk_dock_station, GTK_TYPE_WIDGET) + + +/****************************************************************************** +* * +* Paramètres : class = classe GTK à initialiser. * +* * +* Description : Procède à l'initialisation de l'afficheur concentré. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void gtk_dock_station_class_init(GtkDockStationClass *class) +{ + GObjectClass *object; /* Autre version de la classe */ + + object = G_OBJECT_CLASS(class); + + object->dispose = (GObjectFinalizeFunc/* ! */)gtk_dock_station_dispose; + object->finalize = (GObjectFinalizeFunc)gtk_dock_station_finalize; + + g_signal_new("dock-widget", + GTK_TYPE_DOCK_STATION, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(GtkDockStationClass, dock_widget), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, GTK_TYPE_WIDGET); + + g_signal_new("undock-widget", + GTK_TYPE_DOCK_STATION, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(GtkDockStationClass, undock_widget), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, GTK_TYPE_WIDGET); + + g_signal_new("switch-widget", + GTK_TYPE_DOCK_STATION, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(GtkDockStationClass, switch_widget), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, GTK_TYPE_WIDGET); + + g_signal_new("menu-requested", + GTK_TYPE_DOCK_STATION, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(GtkDockStationClass, menu_requested), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, GTK_TYPE_WIDGET); + + g_signal_new("close-requested", + GTK_TYPE_DOCK_STATION, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(GtkDockStationClass, close_requested), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, GTK_TYPE_WIDGET); + +} + + +/****************************************************************************** +* * +* Paramètres : station = composant GTK à initialiser. * +* * +* Description : Procède à l'initialisation du support d'affichage concentré. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void gtk_dock_station_init(GtkDockStation *station) +{ +#if 0 + + GtkNotebook *notebook; /* Autre version du composant */ + GtkWidget *hbox; /* Division supérieure */ + GtkWidget *button; /* Bouton de contrôle */ + + notebook = GTK_NOTEBOOK(station); + + gtk_notebook_set_show_border(notebook, FALSE); + gtk_notebook_set_scrollable(notebook, TRUE); + + /* Définition de la zone de contrôle */ + + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_widget_set_valign(hbox, GTK_ALIGN_CENTER); + gtk_widget_set_margin_end(hbox, 8); + gtk_widget_show(hbox); + + button = qck_create_toggle_button_with_named_img(G_OBJECT(station), "search", + "edit-find-symbolic", GTK_ICON_SIZE_MENU, NULL, + G_CALLBACK(on_toggle_revealer), station); + gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); + gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); + + button = qck_create_button_with_named_img(G_OBJECT(station), "menu", + "go-down-symbolic", GTK_ICON_SIZE_MENU, NULL, + G_CALLBACK(on_click_for_menu), station); + gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); + gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); + + button = qck_create_button_with_named_img(G_OBJECT(station), "close", + "window-close-symbolic", GTK_ICON_SIZE_MENU, NULL, + G_CALLBACK(on_click_for_close), station); + gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); + gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); + + gtk_notebook_set_action_widget(notebook, hbox, GTK_PACK_END); + + g_signal_connect(notebook, "switch-page", + G_CALLBACK(gtk_dock_station_switch_panel), station); + +#endif + +} + + +/****************************************************************************** +* * +* Paramètres : station = instance d'objet GLib à traiter. * +* * +* Description : Supprime toutes les références externes. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void gtk_dock_station_dispose(GtkDockStation *station) +{ + G_OBJECT_CLASS(gtk_dock_station_parent_class)->dispose(G_OBJECT(station)); + +} + + +/****************************************************************************** +* * +* Paramètres : station = instance d'objet GLib à traiter. * +* * +* Description : Procède à la libération totale de la mémoire. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void gtk_dock_station_finalize(GtkDockStation *station) +{ + G_OBJECT_CLASS(gtk_dock_station_parent_class)->finalize(G_OBJECT(station)); + +} + + +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Crée un nouveau composant pour support d'affichage concentré.* +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +GtkWidget *gtk_dock_station_new(void) +{ + GtkWidget *result; /* Instance à retourner */ + + result = g_object_new(GTK_TYPE_DOCK_STATION, NULL); + + return result; + +} + + + + + + + +#if 0 + #include <malloc.h> #include <string.h> @@ -465,3 +680,7 @@ static void on_click_for_close(GtkButton *button, GtkDockStation *station) g_signal_emit_by_name(station, "close-requested", button); } + + +#endif + |