summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-07-20 16:43:23 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-07-20 16:43:23 (GMT)
commita809d3517eb928d5d7a03d96a85f8af96daa1047 (patch)
tree451decffd5fc20d1a5237b2aa814a62aaba99316 /src/gtkext
parent5093663eb4e4aa17edd97cbd864ccb4a3d48a803 (diff)
Included dynamic items in the view menu.
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/gtkdisplaypanel.c60
1 files changed, 28 insertions, 32 deletions
diff --git a/src/gtkext/gtkdisplaypanel.c b/src/gtkext/gtkdisplaypanel.c
index 706e8f7..97a4276 100644
--- a/src/gtkext/gtkdisplaypanel.c
+++ b/src/gtkext/gtkdisplaypanel.c
@@ -91,14 +91,14 @@ static void gtk_display_panel_update_adjustment(GtkDisplayPanel *, GtkOrientatio
/* Réagit à un défilement chez une barre associée au composant.*/
static void gtk_display_panel_adjustment_value_changed(GtkAdjustment *, GtkDisplayPanel *);
-/* Réagit à un changement des règles d'affichage. */
-static void on_view_panel_binary_option_change(GLoadedBinary *, BinaryView, BufferLineColumn, GtkDisplayPanel *);
-
/* ----------------------- INTERFACE DE PANNEAU DE CHARGEMENT ----------------------- */
+/* Réagit à un changement des règles d'affichage. */
+static void on_display_panel_option_change(GDisplayOptions *, size_t, bool, GtkDisplayPanel *);
+
/* Associe à un panneau d'affichage un binaire chargé. */
static void gtk_display_panel_set_content(GtkDisplayPanel *, GLoadedContent *);
@@ -860,34 +860,6 @@ void gtk_display_panel_draw_border(GtkDisplayPanel *panel, cairo_t *cr)
/******************************************************************************
* *
-* Paramètres : binary = bianire dont les consignes d'affichage ont évolué. *
-* view = type d'affichage à considérer. *
-* col = colonne dont le statut a changé. *
-* panel = composant GTK à consulter. *
-* *
-* Description : Réagit à un changement des règles d'affichage. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void on_view_panel_binary_option_change(GLoadedBinary *binary, BinaryView view, BufferLineColumn col, GtkDisplayPanel *panel)
-{
- if (panel->view_index == view)
- {
- gtk_widget_queue_resize(gtk_widget_get_parent(GTK_WIDGET(panel)));
- gtk_widget_queue_resize(GTK_WIDGET(panel));
- gtk_widget_queue_draw(GTK_WIDGET(panel));
-
- }
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : panel = composant GTK à consulter. *
* *
* Description : Indique la position courante du curseur. *
@@ -1047,6 +1019,30 @@ void gtk_display_panel_compute_relative_coords(GtkDisplayPanel *panel, gint *x,
/******************************************************************************
* *
+* Paramètres : options = options à mettre à jour. *
+* index = indice de l'option concernée. *
+* value = nouvelle valeur à intégrer. *
+* panel = composant GTK à consulter. *
+* *
+* Description : Réagit à un changement des règles d'affichage. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void on_display_panel_option_change(GDisplayOptions *options, size_t index, bool value, GtkDisplayPanel *panel)
+{
+ gtk_widget_queue_resize(gtk_widget_get_parent(GTK_WIDGET(panel)));
+ gtk_widget_queue_resize(GTK_WIDGET(panel));
+ gtk_widget_queue_draw(GTK_WIDGET(panel));
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : panel = composant GTK à mettre à jour. *
* content = binaire associé à intégrer. *
* *
@@ -1069,7 +1065,7 @@ static void gtk_display_panel_set_content(GtkDisplayPanel *panel, GLoadedContent
if (GTK_DISPLAY_PANEL_GET_CLASS(panel)->attach != NULL) /* REMME */
GTK_DISPLAY_PANEL_GET_CLASS(panel)->attach(panel, panel->binary);
- g_signal_connect(content, "value-changed", G_CALLBACK(on_view_panel_binary_option_change), panel);
+ g_signal_connect(panel->options, "value-changed", G_CALLBACK(on_display_panel_option_change), panel);
}