/* Chrysalide - Outil d'analyse de fichiers binaires * dockstation.c - manipulation et l'affichage de composants rassemblés * * Copyright (C) 2012-2024 Cyrille Bagard * * This file is part of Chrysalide. * * Chrysalide is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Chrysalide is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Chrysalide. If not, see . */ #include "dockstation.h" #include "dockstation-int.h" /* --------------------------- INTERFACE DU COMPOSANT GTK --------------------------- */ /* Liste des propriétés */ typedef enum _DockStationProperty { PROP_0, /* Réservé */ /* Interface GtkOrientable */ PROP_ORIENTATION, N_PROPERTIES = PROP_ORIENTATION } DockStationProperty; //static GParamSpec *_dock_station_properties[N_PROPERTIES] = { NULL, }; /* 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(GObject *); /* Procède à la libération totale de la mémoire. */ static void gtk_dock_station_finalize(GObject *); /* --------------------- IMPLEMENTATION DES FONCTIONS DE CLASSE --------------------- */ /* Met à jour une propriété d'instance GObject. */ static void gtk_dock_station_set_property(GObject *, guint, const GValue *, GParamSpec *); /* Fournit la valeur d'une propriété d'instance GObject. */ static void gtk_dock_station_get_property(GObject *, guint, GValue *, GParamSpec *); /* ---------------------------------------------------------------------------------- */ /* INTERFACE DU COMPOSANT GTK */ /* ---------------------------------------------------------------------------------- */ /* Détermine le type du composant d'affichage concentré. */ G_DEFINE_TYPE(GtkDockStation, gtk_dock_station, GTK_TYPE_GRID) /****************************************************************************** * * * 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 */ GtkWidgetClass *widget; /* Classe de haut niveau */ object = G_OBJECT_CLASS(class); object->dispose = gtk_dock_station_dispose; object->finalize = gtk_dock_station_finalize; object->set_property = gtk_dock_station_set_property; object->get_property = gtk_dock_station_get_property; //g_object_class_install_properties(object, N_PROPERTIES, _dock_station_properties); g_object_class_override_property(object, PROP_ORIENTATION, "orientation"); widget = GTK_WIDGET_CLASS(class); gtk_widget_class_set_template_from_resource(widget, "/re/chrysalide/framework/gtkext/dockstation.ui"); //gtk_widget_class_bind_template_callback_full(widget, BUILDER_CB(gtk_status_stack_on_zoom_icon_press)); gtk_widget_class_bind_template_child(widget, GtkDockStation, tabs); gtk_widget_class_bind_template_child(widget, GtkDockStation, toolbar); gtk_widget_class_bind_template_child(widget, GtkDockStation, sep1); gtk_widget_class_bind_template_child(widget, GtkDockStation, stack); gtk_widget_class_bind_template_child(widget, GtkDockStation, sep2); g_signal_new("panel-docked", GTK_TYPE_DOCK_STATION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(GtkDockStationClass, panel_docked), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GTK_TYPE_WIDGET); g_signal_new("panel-undocked", GTK_TYPE_DOCK_STATION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(GtkDockStationClass, panel_undocked), 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) { gtk_widget_init_template(GTK_WIDGET(station)); station->orientation = GTK_ORIENTATION_HORIZONTAL; station->def_panel = NULL; } /****************************************************************************** * * * Paramètres : object = instance d'objet GLib à traiter. * * * * Description : Supprime toutes les références externes. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ static void gtk_dock_station_dispose(GObject *object) { GtkDockStation *station; /* Version spécialisée */ station = GTK_DOCK_STATION(object); gtk_widget_dispose_template(GTK_WIDGET(object), GTK_TYPE_DOCK_STATION); g_clear_object(&station->def_panel); G_OBJECT_CLASS(gtk_dock_station_parent_class)->dispose(object); } /****************************************************************************** * * * Paramètres : object = instance d'objet GLib à traiter. * * * * Description : Procède à la libération totale de la mémoire. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ static void gtk_dock_station_finalize(GObject *object) { G_OBJECT_CLASS(gtk_dock_station_parent_class)->finalize(object); } /****************************************************************************** * * * 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; } /****************************************************************************** * * * Paramètres : station = station d'accueil pour panneau à compléter. * * panel = nouveau panneau à afficher. * * * * Description : Ajoute un panneau à un groupe de tuiles. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ void gtk_dock_station_add_panel(GtkDockStation *station, GtkTiledPanel *panel) { GtkStackPage *page; /* Nouvelle page insérée */ page = gtk_stack_add_child(station->stack, GTK_WIDGET(panel)); if (0) // TODO gtk_stack_page_set_title(page, "settings"); else gtk_stack_page_set_icon_name(page, "logs-symbolic"); gtk_stack_set_visible_child(station->stack, GTK_WIDGET(panel)); g_signal_emit_by_name(station, "panel-docked", panel); } /****************************************************************************** * * * Paramètres : station = station d'accueil pour panneau à compléter. * * panel = nouveau panneau à afficher. * * * * Description : Ajoute un panneau à conserver à un groupe de tuiles. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ void gtk_dock_station_keep_panel(GtkDockStation *station, GtkTiledPanel *panel) { bool visible; /* Visibilité des barres */ g_clear_object(&station->def_panel); if (panel != NULL) { station->def_panel = panel; ref_object(panel); if (gtk_stack_get_page(station->stack, GTK_WIDGET(panel)) == NULL) gtk_dock_station_add_panel(station, panel); } visible = (station->def_panel == NULL); gtk_widget_set_visible(station->tabs, visible); gtk_widget_set_visible(station->toolbar, visible); gtk_widget_set_visible(station->sep1, visible); gtk_widget_set_visible(station->sep2, visible && station->orientation == GTK_ORIENTATION_HORIZONTAL); } /****************************************************************************** * * * Paramètres : station = station d'accueil pour panneau à consulter. * * * * Description : Indique si la station d'accueil contient au moins un panneau.* * * * Retour : true si aucun panneau n'est intégré, false sinon. * * * * Remarques : - * * * ******************************************************************************/ bool gtk_dock_station_is_empty(const GtkDockStation *station) { bool result; /* Bilan à retourner */ GtkSelectionModel *model; /* Modèle pour la pile */ guint count; /* Nombre de panneaux présents */ model = gtk_stack_get_pages(station->stack); count = g_list_model_get_n_items(G_LIST_MODEL(model)); result = (count == 0); unref_object(model); return result; } /* ---------------------------------------------------------------------------------- */ /* IMPLEMENTATION DES FONCTIONS DE CLASSE */ /* ---------------------------------------------------------------------------------- */ /****************************************************************************** * * * Paramètres : object = instance d'objet GLib à mamnipuler. * * prop_id = identifiant de la propriété visée. * * value = valeur à prendre en compte. * * pspec = définition de la propriété. * * * * Description : Met à jour une propriété d'instance GObject. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ static void gtk_dock_station_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GtkDockStation *station; /* Version spécialisée */ GtkOrientation orientation; /* Spécification d'orientation */ GtkLayoutManager *layout; /* Gestionnaire de disposition */ GtkLayoutChild *child_layout; /* Disposition de composant */ station = GTK_DOCK_STATION(object); switch (prop_id) { case PROP_ORIENTATION: orientation = g_value_get_enum(value); if (station->orientation != orientation) { station->orientation = orientation; gtk_orientable_set_orientation(GTK_ORIENTABLE(station->tabs), orientation); gtk_orientable_set_orientation(GTK_ORIENTABLE(station->toolbar), orientation); layout = gtk_widget_get_layout_manager(GTK_WIDGET(object)); if (orientation == GTK_ORIENTATION_VERTICAL) { g_object_set(G_OBJECT(station->tabs), "halign", GTK_ALIGN_START, "valign", GTK_ALIGN_CENTER, NULL); g_object_set(G_OBJECT(station->toolbar), "halign", GTK_ALIGN_END, "valign", GTK_ALIGN_CENTER, NULL); child_layout = gtk_layout_manager_get_layout_child(layout, station->toolbar); g_object_set(G_OBJECT(child_layout), "column", 1, "row", 0, NULL); child_layout = gtk_layout_manager_get_layout_child(layout, station->sep1); g_object_set(G_OBJECT(child_layout), "column", 0, "row", 1, "column-span", 2, NULL); gtk_widget_set_visible(station->sep2, FALSE); child_layout = gtk_layout_manager_get_layout_child(layout, GTK_WIDGET(station->stack)); g_object_set(G_OBJECT(child_layout), "column", 0, "row", 2, "column-span", 2, NULL); } else { g_object_set(G_OBJECT(station->tabs), "halign", GTK_ALIGN_START, "valign", GTK_ALIGN_START, NULL); g_object_set(G_OBJECT(station->toolbar), "halign", GTK_ALIGN_END, "valign", GTK_ALIGN_START, NULL); child_layout = gtk_layout_manager_get_layout_child(layout, station->sep1); g_object_set(G_OBJECT(child_layout), "column", 1, "row", 0, "column-span", 1, NULL); child_layout = gtk_layout_manager_get_layout_child(layout, GTK_WIDGET(station->stack)); g_object_set(G_OBJECT(child_layout), "column", 2, "row", 0, "column-span", 1, NULL); gtk_widget_set_visible(station->sep2, TRUE); child_layout = gtk_layout_manager_get_layout_child(layout, station->sep2); g_object_set(G_OBJECT(child_layout), "column", 3, "row", 0, NULL); child_layout = gtk_layout_manager_get_layout_child(layout, station->toolbar); g_object_set(G_OBJECT(child_layout), "column", 4, "row", 0, NULL); } g_object_notify_by_pspec(object, pspec); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /****************************************************************************** * * * Paramètres : object = instance d'objet GLib à mamnipuler. * * prop_id = identifiant de la propriété visée. * * value = valeur à transmettre. [OUT] * * pspec = définition de la propriété. * * * * Description : Fournit la valeur d'une propriété d'instance GObject. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ static void gtk_dock_station_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GtkDockStation *station; /* Version spécialisée */ station = GTK_DOCK_STATION(object); switch (prop_id) { case PROP_ORIENTATION: g_value_set_enum(value, station->orientation); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } #if 0 #include #include #include "easygtk.h" #include "../core/params.h" #include "../common/extstr.h" #include "../glibext/chrysamarshal.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 *); /* Met à jour le titre du support de panneaux concentrés. */ static gboolean gtk_dock_station_switch_panel(GtkNotebook *, gpointer *, guint, GtkDockStation *); /* Révèle ou cache la zone de recherches. */ static void on_toggle_revealer(GtkToggleButton *, GtkDockStation *); /* Demande l'apparition d'un menu pour inclure des composants. */ static void on_click_for_menu(GtkButton *, GtkDockStation *); /* Demande la disparition du composant courant. */ static void on_click_for_close(GtkButton *, GtkDockStation *); /* Détermine le type du composant d'affichage concentré. */ G_DEFINE_TYPE(GtkDockStation, gtk_dock_station, GTK_TYPE_NOTEBOOK) /****************************************************************************** * * * 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) { 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) { 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); } /****************************************************************************** * * * Paramètres : - * * * * Description : Crée un nouveau composant pour support d'affichage concentré.* * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ GtkWidget *gtk_dock_station_new(void) { return g_object_new(GTK_TYPE_DOCK_STATION, NULL); } /****************************************************************************** * * * Paramètres : notebook = support à l'origine de la mise à jour. * * page = onglet mis en avant. * * index = indice de l'onglet actuellement actif. * * station = conteneur de gestion supérieur. * * * * Description : Met à jour le titre du support de panneaux concentrés. * * * * Retour : TRUE ? * * * * Remarques : - * * * ******************************************************************************/ static gboolean gtk_dock_station_switch_panel(GtkNotebook *notebook, gpointer *page, guint index, GtkDockStation *station) { GtkWidget *widget; /* Panneau concerné */ GtkDockable *dockable; /* Elément encapsulé */ GtkWidget *button; /* Bouton de contrôle */ widget = gtk_notebook_get_nth_page(notebook, index); dockable = GTK_DOCKABLE(g_object_get_data(G_OBJECT(widget), "dockable")); /* Mise à jour des boutons utilisables */ button = GTK_WIDGET(g_object_get_data(G_OBJECT(station), "search")); if (gtk_dockable_can_search(dockable)) gtk_widget_show(button); else gtk_widget_hide(button); /* Remontée du changement d'onglet */ g_signal_emit_by_name(station, "switch-widget", widget); return TRUE; } /****************************************************************************** * * * Paramètres : station = plateforme GTK à compléter. * * dockable = nouvel élément à intégrer. * * * * Description : Ajoute un paquet d'informations à l'affichage centralisé. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ #include "gtkdisplaypanel.h" #include "../gui/panels/history.h" void gtk_dock_station_add_dockable(GtkDockStation *station, GtkDockable *dockable) { GtkWidget *widget; /* Composant GTK à intégrer */ char *name; /* Nom à donner à l'onglet */ char *desc; /* Description à y associer */ int max; /* Taille maximale des titres */ GtkWidget *label; /* Etiquette d'onglet */ GtkNotebook *notebook; /* Autre version du composant */ /* Récupération des éléments utiles */ widget = gtk_dockable_build_widget(dockable); //widget = gtk_button_new_with_label("123"); gtk_widget_show(widget); g_object_set_data(G_OBJECT(widget), "dockable", dockable); name = gtk_dockable_get_name(dockable); desc = gtk_dockable_get_desc(dockable); /* Mise en place de la page */ if (!g_generic_config_get_value(get_main_configuration(), MPK_ELLIPSIS_TAB, &max)) max = -1; name = ellipsis(name, max); label = qck_create_label(NULL, NULL, name); free(name); notebook = GTK_NOTEBOOK(station); if (gtk_notebook_get_n_pages(notebook) > 0) g_signal_handlers_disconnect_by_func(notebook, G_CALLBACK(gtk_dock_station_switch_panel), station); gtk_notebook_append_page(notebook, widget, label); gtk_widget_set_tooltip_text(label, desc); free(desc); if (gtk_notebook_get_n_pages(notebook) > 1) g_signal_connect(notebook, "switch-page", G_CALLBACK(gtk_dock_station_switch_panel), station); /* Lancement des mises à jour */ if (gtk_notebook_get_n_pages(notebook) > 1) gtk_notebook_set_current_page(notebook, -1); //g_signal_emit_by_name(station, "dock-widget", widget); } /****************************************************************************** * * * Paramètres : station = plateforme GTK à compléter. * * widget = nouvel élément à intégrer. * * * * Description : Change le contenu de l'onglet courant uniquement. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ void gtk_dock_panel_change_active_widget(GtkDockStation *station, GtkWidget *widget) { GtkNotebook *notebook; /* Autre version du composant */ gint index; /* Indice de l'onglet actif */ GtkWidget *old; /* Ancien composant */ GtkWidget *label; /* Etiquette d'onglet */ char *str; /* Titre des prochaines fois */ notebook = GTK_NOTEBOOK(station); index = gtk_notebook_get_current_page(notebook); g_signal_handlers_disconnect_by_func(notebook, G_CALLBACK(gtk_dock_station_switch_panel), station); old = gtk_notebook_get_nth_page(notebook, index); label = gtk_notebook_get_tab_label(notebook, old); g_object_ref(G_OBJECT(label)); str = g_object_get_data(G_OBJECT(old), "title"); gtk_notebook_remove_page(notebook, index); gtk_notebook_insert_page(notebook, widget, label, index); g_object_unref(G_OBJECT(label)); g_object_set_data(G_OBJECT(widget), "title", str); gtk_notebook_set_current_page(notebook, index); g_signal_connect(notebook, "switch-page", G_CALLBACK(gtk_dock_station_switch_panel), station); } /****************************************************************************** * * * Paramètres : station = plateforme GTK à compléter. * * dockable = élément existant à retirer. * * * * Description : Retire un paquet d'informations de l'affichage centralisé. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ void gtk_dock_station_remove_dockable(GtkDockStation *station, GtkDockable *dockable) { GtkNotebook *notebook; /* Autre version du composant */ GtkWidget *widget; /* Composant GTK à retirer */ gint index; /* Indice de l'onglet visé */ notebook = GTK_NOTEBOOK(station); widget = gtk_dockable_decompose(dockable, NULL); index = gtk_notebook_page_num(notebook, widget); gtk_notebook_remove_page(notebook, index); } /****************************************************************************** * * * Paramètres : button = bouton à l'origine de la procédure. * * station = station d'accueil pour différents composants. * * * * Description : Révèle ou cache la zone de recherches. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ static void on_toggle_revealer(GtkToggleButton *button, GtkDockStation *station) { GtkNotebook *notebook; /* Autre version du composant */ gint index; /* Indice de l'onglet courant */ GtkWidget *widget; /* Panneau concerné */ GtkDockable *dockable; /* Elément encapsulé */ notebook = GTK_NOTEBOOK(station); index = gtk_notebook_get_current_page(notebook); widget = gtk_notebook_get_nth_page(notebook, index); dockable = GTK_DOCKABLE(g_object_get_data(G_OBJECT(widget), "dockable")); gtk_dockable_toggle_revealer(dockable, widget, gtk_toggle_button_get_active(button)); } /****************************************************************************** * * * Paramètres : button = bouton à l'origine de la procédure. * * station = station d'accueil pour différents composants. * * * * Description : Demande l'apparition d'un menu pour inclure des composants. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ static void on_click_for_menu(GtkButton *button, GtkDockStation *station) { g_signal_emit_by_name(station, "menu-requested", button); } /****************************************************************************** * * * Paramètres : button = bouton à l'origine de la procédure. * * station = station d'accueil pour différents composants. * * * * Description : Demande la disparition du composant courant. * * * * Retour : - * * * * Remarques : - * * * ******************************************************************************/ static void on_click_for_close(GtkButton *button, GtkDockStation *station) { g_signal_emit_by_name(station, "close-requested", button); } #endif