diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/core/global.c | 8 | ||||
-rw-r--r-- | src/gui/core/global.h | 6 | ||||
-rw-r--r-- | src/gui/core/items.c | 67 | ||||
-rw-r--r-- | src/gui/core/items.h | 6 | ||||
-rw-r--r-- | src/gui/editem-int.h | 4 | ||||
-rw-r--r-- | src/gui/editem.c | 25 | ||||
-rw-r--r-- | src/gui/editem.h | 6 | ||||
-rw-r--r-- | src/gui/editor.c | 2 | ||||
-rw-r--r-- | src/gui/menus/binary.c | 7 | ||||
-rw-r--r-- | src/gui/menus/edition.c | 35 | ||||
-rw-r--r-- | src/gui/menus/menubar.c | 2 | ||||
-rw-r--r-- | src/gui/menus/view.c | 2 | ||||
-rw-r--r-- | src/gui/panels/bintree.c | 11 | ||||
-rw-r--r-- | src/gui/panels/bookmarks.c | 18 | ||||
-rw-r--r-- | src/gui/panels/errors.c | 11 | ||||
-rw-r--r-- | src/gui/panels/glance.c | 46 | ||||
-rw-r--r-- | src/gui/panels/strings.c | 25 | ||||
-rw-r--r-- | src/gui/panels/symbols.c | 11 | ||||
-rw-r--r-- | src/gui/tb/portions.c | 5 |
19 files changed, 183 insertions, 114 deletions
diff --git a/src/gui/core/global.c b/src/gui/core/global.c index b4001c6..0d0ec92 100644 --- a/src/gui/core/global.c +++ b/src/gui/core/global.c @@ -37,7 +37,7 @@ static GLoadedBinary *_current_binary = NULL; G_LOCK_DEFINE_STATIC(_cb_mutex); /* Suivi du panneau d'affichage courant ou NULL */ -static GtkDisplayPanel *_current_view = NULL; +static GLoadedPanel *_current_view = NULL; G_LOCK_DEFINE_STATIC(_cv_mutex); @@ -192,7 +192,7 @@ GLoadedBinary *get_current_binary(void) * * ******************************************************************************/ -void set_current_view(GtkDisplayPanel *view) +void set_current_view(GLoadedPanel *view) { G_LOCK(_cv_mutex); @@ -218,9 +218,9 @@ void set_current_view(GtkDisplayPanel *view) * * ******************************************************************************/ -GtkDisplayPanel *get_current_view(void) +GLoadedPanel *get_current_view(void) { - GtkDisplayPanel *result; /* Instance à retourner */ + GLoadedPanel *result; /* Instance à retourner */ G_LOCK(_cv_mutex); diff --git a/src/gui/core/global.h b/src/gui/core/global.h index e69f743..68aeb8a 100644 --- a/src/gui/core/global.h +++ b/src/gui/core/global.h @@ -26,7 +26,7 @@ #include "../../analysis/binary.h" -#include "../../gtkext/gtkdisplaypanel.h" +#include "../../glibext/gloadedpanel.h" #include "../../gtkext/gtkstatusstack.h" @@ -50,10 +50,10 @@ void set_current_binary(GLoadedBinary *); GLoadedBinary *get_current_binary(void); /* Définit l'affichage de binaire courant. */ -void set_current_view(GtkDisplayPanel *); +void set_current_view(GLoadedPanel *); /* Fournit l'affichage de binaire courant. */ -GtkDisplayPanel *get_current_view(void); +GLoadedPanel *get_current_view(void); /* Définit le support contenant la position active. */ void set_caret_instance(GObject *); diff --git a/src/gui/core/items.c b/src/gui/core/items.c index 923a565..ce60bcb 100644 --- a/src/gui/core/items.c +++ b/src/gui/core/items.c @@ -35,7 +35,7 @@ static GEditorItem *_editem_list = NULL; /* Suit les changements de focus des panneaux d'affichage. */ -static gboolean notify_view_panel_focus_change(GtkDisplayPanel *, GdkEventFocus *, gpointer); +static gboolean notify_view_panel_focus_change(GLoadedPanel *, GdkEventFocus *, gpointer); /* Lance une procédure de déplacement de la position courante. */ static void start_moving_to_address_in_view_panel(GtkDisplayPanel *, const vmpa2t *, gpointer); @@ -109,18 +109,13 @@ void change_editor_items_current_binary(GLoadedBinary *binary) * * ******************************************************************************/ -static gboolean notify_view_panel_focus_change(GtkDisplayPanel *panel, GdkEventFocus *event, gpointer unused) +static gboolean notify_view_panel_focus_change(GLoadedPanel *panel, GdkEventFocus *event, gpointer unused) { GEditorItem *iter; /* Boucle de parcours */ - GEditorItemClass *klass; /* Classe correspondante */ editem_list_for_each(iter, _editem_list) { - klass = G_EDITOR_ITEM_GET_CLASS(iter); - - if (klass->notify_focus != NULL) - klass->notify_focus(iter, event->in ? panel : NULL); - + notify_focus_change_for_editor_item(iter, event->in ? panel : NULL); } return FALSE; @@ -210,9 +205,9 @@ static void track_caret_address_on_view_panel(GtkDisplayPanel *panel, const vmpa * * ******************************************************************************/ -void change_editor_items_current_view(GtkDisplayPanel *panel) +void change_editor_items_current_view(GLoadedPanel *panel) { - GtkDisplayPanel *view; /* Affichage actif */ + GLoadedPanel *view; /* Affichage actif */ GEditorItem *iter; /* Boucle de parcours */ GEditorItemClass *klass; /* Classe correspondante */ GObject *caret; /* Support du curseur actif */ @@ -249,36 +244,40 @@ void change_editor_items_current_view(GtkDisplayPanel *panel) /* Suivi du curseur */ - caret = get_caret_instance(); - - if (caret != NULL) + if (GTK_IS_DISPLAY_PANEL(panel)) { - g_signal_handlers_disconnect_by_func(caret, - G_CALLBACK(start_moving_to_address_in_view_panel), - NULL); - g_signal_handlers_disconnect_by_func(caret, - G_CALLBACK(track_caret_address_on_view_panel), - NULL); + caret = get_caret_instance(); - set_caret_instance(NULL); - g_object_unref(caret); + if (caret != NULL) + { + g_signal_handlers_disconnect_by_func(caret, + G_CALLBACK(start_moving_to_address_in_view_panel), + NULL); + g_signal_handlers_disconnect_by_func(caret, + G_CALLBACK(track_caret_address_on_view_panel), + NULL); - } + set_caret_instance(NULL); + g_object_unref(caret); - if (panel != NULL) - { - g_signal_connect(panel, "move-request", - G_CALLBACK(start_moving_to_address_in_view_panel), - NULL); + } + + if (panel != NULL) + { + g_signal_connect(panel, "move-request", + G_CALLBACK(start_moving_to_address_in_view_panel), + NULL); + + g_signal_connect(panel, "caret-moved", + G_CALLBACK(track_caret_address_on_view_panel), + NULL); - g_signal_connect(panel, "caret-moved", - G_CALLBACK(track_caret_address_on_view_panel), - NULL); + caret = G_OBJECT(panel); - caret = G_OBJECT(panel); + g_object_ref(caret); + set_caret_instance(caret); - g_object_ref(caret); - set_caret_instance(caret); + } } @@ -297,7 +296,7 @@ void change_editor_items_current_view(GtkDisplayPanel *panel) * * ******************************************************************************/ -void change_editor_items_current_view_content(GtkDisplayPanel *panel) +void change_editor_items_current_view_content(GLoadedPanel *panel) { GEditorItem *iter; /* Boucle de parcours */ GEditorItemClass *klass; /* Classe correspondante */ diff --git a/src/gui/core/items.h b/src/gui/core/items.h index fc73b5e..13c3d9c 100644 --- a/src/gui/core/items.h +++ b/src/gui/core/items.h @@ -28,7 +28,7 @@ #include "../editem.h" #include "../../analysis/binary.h" #include "../../analysis/project.h" -#include "../../gtkext/gtkdisplaypanel.h" +#include "../../glibext/gloadedpanel.h" @@ -39,10 +39,10 @@ void register_editor_item(GEditorItem *); void change_editor_items_current_binary(GLoadedBinary *); /* Lance une actualisation du fait d'un changement de vue. */ -void change_editor_items_current_view(GtkDisplayPanel *); +void change_editor_items_current_view(GLoadedPanel *); /* Lance une actualisation du fait d'un changement de contenu. */ -void change_editor_items_current_view_content(GtkDisplayPanel *); +void change_editor_items_current_view_content(GLoadedPanel *); /* Concentre l'attention de l'ensemble sur une adresse donnée. */ void focus_address_in_editor_items(GLoadedBinary *, const vmpa2t *, GEditorItem *); diff --git a/src/gui/editem-int.h b/src/gui/editem-int.h index 69b0181..a70cc87 100644 --- a/src/gui/editem-int.h +++ b/src/gui/editem-int.h @@ -41,10 +41,10 @@ typedef void (* update_item_binary_fc) (GEditorItem *, GLoadedBinary *); /* Réagit à un changement d'affichage principal de contenu. */ -typedef void (* update_item_view_fc) (GEditorItem *, GtkDisplayPanel *); +typedef void (* update_item_view_fc) (GEditorItem *, GLoadedPanel *); /* Réagit à un changement de focus des panneaux d'affichage. */ -typedef void (* notify_focus_change_fc) (GEditorItem *, GtkDisplayPanel *); +typedef void (* notify_focus_change_fc) (GEditorItem *, GLoadedPanel *); /* Suit les changements de position dans du code d'assembleur. */ typedef void (* track_caret_in_view_fc) (GEditorItem *, GtkDisplayPanel *, const vmpa2t *); diff --git a/src/gui/editem.c b/src/gui/editem.c index 4848cc9..bf3dfa6 100644 --- a/src/gui/editem.c +++ b/src/gui/editem.c @@ -132,3 +132,28 @@ GtkWidget *g_editor_item_get_widget(const GEditorItem *item) return item->widget; } + + +/****************************************************************************** +* * +* Paramètres : bar = instance à actualiser. * +* panel = composant d'affichage concerné par l'opération. * +* * +* Description : Réagit à un changement de focus des panneaux d'affichage. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void notify_focus_change_for_editor_item(GEditorItem *item, GLoadedPanel *panel) +{ + GEditorItemClass *klass; /* Classe correspondante */ + + klass = G_EDITOR_ITEM_GET_CLASS(item); + + if (klass->notify_focus != NULL) + klass->notify_focus(item, panel); + +} diff --git a/src/gui/editem.h b/src/gui/editem.h index 476299b..f102d5c 100644 --- a/src/gui/editem.h +++ b/src/gui/editem.h @@ -30,6 +30,9 @@ #include <gtk/gtk.h> +#include "../glibext/gloadedpanel.h" + + #define G_TYPE_EDITOR_ITEM g_editor_item_get_type() #define G_EDITOR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_editor_item_get_type(), GEditorItem)) @@ -58,6 +61,9 @@ const char *g_editor_item_get_name(const GEditorItem *); /* Fournit le composant GTK associé à l'élément réactif. */ GtkWidget *g_editor_item_get_widget(const GEditorItem *); +/* Réagit à un changement de focus des panneaux d'affichage. */ +void notify_focus_change_for_editor_item(GEditorItem *, GLoadedPanel *); + #endif /* _GUI_EDITEM_H */ diff --git a/src/gui/editor.c b/src/gui/editor.c index d44d2af..2488a27 100644 --- a/src/gui/editor.c +++ b/src/gui/editor.c @@ -1385,7 +1385,7 @@ static void on_dock_item_switch(GtkDockStation *station, GtkWidget *widget, gpoi g_object_unref(G_OBJECT(old_binary)); g_object_ref(G_OBJECT(widget)); - change_editor_items_current_view(GTK_DISPLAY_PANEL(widget)); + change_editor_items_current_view(G_LOADED_PANEL(widget)); } diff --git a/src/gui/menus/binary.c b/src/gui/menus/binary.c index e67c377..b7be1b9 100644 --- a/src/gui/menus/binary.c +++ b/src/gui/menus/binary.c @@ -160,7 +160,7 @@ static void mcb_binary_entry_points(GtkMenuItem *menuitem, GMenuBar *bar) GLoadedBinary *binary; /* Binaire présenté à l'écran */ GtkWidget *dialog; /* Boîte de dialogue à montrer */ vmpa2t *addr; /* Adresse de destination */ - GtkDisplayPanel *panel; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ item = G_EDITOR_ITEM(bar); @@ -174,7 +174,10 @@ static void mcb_binary_entry_points(GtkMenuItem *menuitem, GMenuBar *bar) addr = get_address_from_gotox_dialog(dialog); panel = get_current_view(); - gtk_display_panel_request_move(panel, addr); + + if (GTK_IS_DISPLAY_PANEL(panel)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), addr); + g_object_unref(G_OBJECT(panel)); delete_vmpa(addr); diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c index 2491e3d..848d04c 100644 --- a/src/gui/menus/edition.c +++ b/src/gui/menus/edition.c @@ -313,7 +313,7 @@ static void mcb_edition_goto(GtkMenuItem *menuitem, GMenuBar *bar) GObject *ref; /* Espace de référencements */ GtkWidget *dialog; /* Boîte de dialogue à montrer */ vmpa2t *addr; /* Adresse de destination */ - GtkDisplayPanel *panel; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ ref = g_editor_item_get_global_ref(G_EDITOR_ITEM(bar)); dialog = create_goto_dialog(GTK_WINDOW(ref)); @@ -323,7 +323,10 @@ static void mcb_edition_goto(GtkMenuItem *menuitem, GMenuBar *bar) addr = get_address_from_goto_dialog(dialog); panel = get_current_view(); - gtk_display_panel_request_move(panel, addr); + + if (GTK_IS_DISPLAY_PANEL(panel)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), addr); + g_object_unref(G_OBJECT(panel)); delete_vmpa(addr); @@ -351,7 +354,7 @@ static void mcb_edition_goto(GtkMenuItem *menuitem, GMenuBar *bar) static void mcb_edition_switch_numeric_operand(GtkMenuItem *menuitem, gpointer unused) { ImmOperandDisplay display; /* Type de basculement */ - GtkDisplayPanel *panel; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ GBufferLine *line; /* Ligne de position courante */ GObject *creator; /* Créateur à l'orgine du seg. */ GDbSwitcher *switcher; /* Bascule à mettre en place */ @@ -364,7 +367,8 @@ static void mcb_edition_switch_numeric_operand(GtkMenuItem *menuitem, gpointer u panel = get_current_view(); - if (gtk_display_panel_get_position(panel, &line, &creator)) + if (GTK_IS_DISPLAY_PANEL(panel) + && gtk_display_panel_get_position(GTK_DISPLAY_PANEL(panel), &line, &creator)) { assert(G_IS_IMM_OPERAND(creator)); @@ -429,7 +433,7 @@ static void mcb_edition_go_back(GtkMenuItem *menuitem, GMenuBar *bar) static void mcb_edition_follow_ref(GtkMenuItem *menuitem, gpointer unused) { - GtkDisplayPanel *panel; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ GBufferLine *line; /* Ligne de position courante */ GObject *creator; /* Créateur à l'orgine du seg. */ bool defined; /* Adresse définie ? */ @@ -438,7 +442,8 @@ static void mcb_edition_follow_ref(GtkMenuItem *menuitem, gpointer unused) panel = get_current_view(); - if (gtk_display_panel_get_position(panel, &line, &creator)) + if (GTK_IS_DISPLAY_PANEL(panel) + && gtk_display_panel_get_position(GTK_DISPLAY_PANEL(panel), &line, &creator)) { assert(creator != NULL); @@ -460,7 +465,7 @@ static void mcb_edition_follow_ref(GtkMenuItem *menuitem, gpointer unused) } if (defined) - gtk_display_panel_request_move(panel, &addr); + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), &addr); g_object_unref(creator); g_object_unref(G_OBJECT(line)); @@ -487,7 +492,7 @@ static void mcb_edition_follow_ref(GtkMenuItem *menuitem, gpointer unused) static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar) { - GtkDisplayPanel *panel; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ GBufferLine *line; /* Ligne de position courante */ const mrange_t *range; /* Couverture en mémoire */ GLoadedBinary *binary; /* Représentation binaire */ @@ -499,7 +504,8 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar) panel = get_current_view(); - if (gtk_display_panel_get_position(panel, &line, NULL)) + if (GTK_IS_DISPLAY_PANEL(panel) + && gtk_display_panel_get_position(GTK_DISPLAY_PANEL(panel), &line, NULL)) { range = g_buffer_line_get_range(line); @@ -524,7 +530,7 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar) { addr = get_address_from_gotox_dialog(dialog); - gtk_display_panel_request_move(panel, addr); + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), addr); delete_vmpa(addr); @@ -562,7 +568,7 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar) static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar) { - GtkDisplayPanel *panel; /* Vue offrant l'affichage */ + GLoadedPanel *panel; /* Vue offrant l'affichage */ const vmpa2t *curloc; /* Localisation d'un curseur */ GLoadedBinary *binary; /* Binaire en cours d'étude */ GDbCollection *collec; /* Collection à manipuler */ @@ -576,7 +582,10 @@ static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar) panel = get_current_view(); - curloc = gtk_display_panel_get_caret_location(panel); + if (!GTK_IS_DISPLAY_PANEL(panel)) + goto done_with_panel; + + curloc = gtk_display_panel_get_caret_location(GTK_DISPLAY_PANEL(panel)); /* Accès à la collection */ @@ -638,6 +647,8 @@ static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar) g_object_unref(G_OBJECT(collec)); g_object_unref(G_OBJECT(binary)); + done_with_panel: + g_object_unref(G_OBJECT(panel)); } diff --git a/src/gui/menus/menubar.c b/src/gui/menus/menubar.c index 56540e9..32a8f20 100644 --- a/src/gui/menus/menubar.c +++ b/src/gui/menus/menubar.c @@ -295,7 +295,7 @@ static void update_menu_bar_for_view(GMenuBar *bar, GtkDisplayPanel *panel) /****************************************************************************** * * -* Paramètres : bar = barre de menus à actualiser. * +* Paramètres : bar = barre de menus à actualiser. * * panel = composant d'affichage concerné par l'opération. * * * * Description : Réagit à un changement de focus des panneaux d'affichage. * diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c index 5298af3..4298805 100644 --- a/src/gui/menus/view.c +++ b/src/gui/menus/view.c @@ -494,7 +494,7 @@ static void mcb_view_change_support(GtkRadioMenuItem *menuitem, gpointer unused) gtk_dock_panel_change_active_widget(station, scroll); - change_editor_items_current_view(new); + change_editor_items_current_view(G_LOADED_PANEL(new)); g_object_unref(G_OBJECT(panel)); diff --git a/src/gui/panels/bintree.c b/src/gui/panels/bintree.c index b7c31c1..89e2ae1 100644 --- a/src/gui/panels/bintree.c +++ b/src/gui/panels/bintree.c @@ -703,7 +703,7 @@ static void on_bintree_selection_changed(GtkTreeSelection *selection, gpointer u GtkTreeModel *model; /* Modèle de gestion */ GBinPortion *portion; /* Portion à traiter */ const mrange_t *range; /* Couverture dudit symbole */ - GtkDisplayPanel *display; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ if (gtk_tree_selection_get_selected(selection, &model, &iter)) { @@ -713,9 +713,12 @@ static void on_bintree_selection_changed(GtkTreeSelection *selection, gpointer u { range = g_binary_portion_get_range(portion); - display = get_current_view(); - gtk_display_panel_request_move(display, get_mrange_addr(range)); - g_object_unref(G_OBJECT(display)); + panel = get_current_view(); + + if (GTK_IS_DISPLAY_PANEL(panel)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), get_mrange_addr(range)); + + g_object_unref(G_OBJECT(panel)); g_object_unref(G_OBJECT(portion)); diff --git a/src/gui/panels/bookmarks.c b/src/gui/panels/bookmarks.c index 20d2bd0..27655cd 100644 --- a/src/gui/panels/bookmarks.c +++ b/src/gui/panels/bookmarks.c @@ -663,7 +663,7 @@ static void on_bookmarks_selection_change(GtkTreeSelection *selection, gpointer GtkTreeModel *model; /* Modèle de gestion */ GDbBookmark *bookmark; /* Signet en cours d'étude */ const vmpa2t *addr; /* Adressse associée au signet */ - GtkDisplayPanel *display; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ if (gtk_tree_selection_get_selected(selection, &model, &iter)) { @@ -671,9 +671,12 @@ static void on_bookmarks_selection_change(GtkTreeSelection *selection, gpointer addr = g_db_bookmark_get_address(bookmark); - display = get_current_view(); - gtk_display_panel_request_move(display, addr); - g_object_unref(G_OBJECT(display)); + panel = get_current_view(); + + if (GTK_IS_DISPLAY_PANEL(panel)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), addr); + + g_object_unref(G_OBJECT(panel)); g_object_unref(G_OBJECT(bookmark)); @@ -1049,7 +1052,7 @@ static gboolean on_button_press_over_bookmarks(GtkWidget *widget, GdkEventButton GtkTreeModel *model; /* Modèle de gestion */ GDbBookmark *bookmark; /* Signet en cours d'étude */ const vmpa2t *addr; /* Adressse associée au signet */ - GtkDisplayPanel *display; /* Afficheur effectif de code */ + GLoadedPanel *display; /* Afficheur effectif de code */ switch (event->button) { @@ -1064,7 +1067,10 @@ static gboolean on_button_press_over_bookmarks(GtkWidget *widget, GdkEventButton addr = g_db_bookmark_get_address(bookmark); display = get_current_view(); - gtk_display_panel_request_move(display, addr); + + if (GTK_IS_DISPLAY_PANEL(display)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(display), addr); + g_object_unref(G_OBJECT(display)); g_object_unref(G_OBJECT(bookmark)); diff --git a/src/gui/panels/errors.c b/src/gui/panels/errors.c index 1c2c54f..57fedaf 100644 --- a/src/gui/panels/errors.c +++ b/src/gui/panels/errors.c @@ -950,7 +950,7 @@ static void on_error_selection_changed(GtkTreeSelection *selection, gpointer unu GtkTreeIter iter; /* Point de sélection */ GtkTreeModel *model; /* Modèle de gestion */ vmpa2t *addr; /* Localisation à suivre */ - GtkDisplayPanel *display; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ if (gtk_tree_selection_get_selected(selection, &model, &iter)) { @@ -958,9 +958,12 @@ static void on_error_selection_changed(GtkTreeSelection *selection, gpointer unu if (addr != NULL) { - display = get_current_view(); - gtk_display_panel_request_move(display, addr); - g_object_unref(G_OBJECT(display)); + panel = get_current_view(); + + if (GTK_IS_DISPLAY_PANEL(panel)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), addr); + + g_object_unref(G_OBJECT(panel)); delete_vmpa(addr); diff --git a/src/gui/panels/glance.c b/src/gui/panels/glance.c index 27d3b46..c58f3b6 100644 --- a/src/gui/panels/glance.c +++ b/src/gui/panels/glance.c @@ -38,7 +38,7 @@ struct _GGlancePanel { GPanelItem parent; /* A laisser en premier */ - GtkDisplayPanel *display; /* Vue à représenter */ + GLoadedPanel *view; /* Vue à représenter */ GtkRequisition req; /* Pleine taille de la source */ GtkScrolledWindow *support; /* Support défilant associé */ @@ -87,7 +87,7 @@ static void g_glance_panel_dispose(GGlancePanel *); static void g_glance_panel_finalize(GGlancePanel *); /* Lance une actualisation du fait d'un changement de support. */ -static void update_glance_panel_for_view(GGlancePanel *, GtkDisplayPanel *); +static void update_glance_panel_for_view(GGlancePanel *, GLoadedPanel *); /* Réagit à la préparation du défilement du support original. */ static void on_view_scroll_setup(GtkAdjustment *, GGlancePanel *); @@ -102,7 +102,7 @@ static void on_glance_resize(GtkWidget *, GdkRectangle *, GGlancePanel *); static void compute_glance_scale(GGlancePanel *); /* Lance une actualisation du fait d'un changement de vue. */ -static void update_glance_panel_for_view_content(GGlancePanel *, GtkDisplayPanel *); +static void update_glance_panel_for_view_content(GGlancePanel *, GLoadedPanel *); /* Met à jour l'affichage de l'aperçu rapide à présenter. */ static gboolean redraw_glance_area(GtkWidget *, cairo_t *, GGlancePanel *); @@ -281,8 +281,8 @@ GPanelItem *g_glance_panel_new(void) /****************************************************************************** * * -* Paramètres : panel = panneau à actualiser. * -* display = nouveau panneau d'affichage actif. * +* Paramètres : panel = panneau à actualiser. * +* view = nouveau panneau d'affichage actif. * * * * Description : Lance une actualisation du fait d'un changement de support. * * * @@ -292,15 +292,15 @@ GPanelItem *g_glance_panel_new(void) * * ******************************************************************************/ -static void update_glance_panel_for_view(GGlancePanel *panel, GtkDisplayPanel *display) +static void update_glance_panel_for_view(GGlancePanel *panel, GLoadedPanel *view) { GtkWidget *parent; /* Support défilant de la vue */ GtkAdjustment *adj; /* Gestionnaire du défilement */ - if (panel->display != NULL) + if (panel->view != NULL) { - g_object_unref(panel->display); - panel->display = NULL; + g_object_unref(panel->view); + panel->view = NULL; g_object_unref(panel->support); panel->support = NULL; @@ -318,11 +318,11 @@ static void update_glance_panel_for_view(GGlancePanel *panel, GtkDisplayPanel *d * de la fonction mcb_view_change_support(). */ - parent = gtk_widget_get_parent(GTK_WIDGET(display)); + parent = gtk_widget_get_parent(GTK_WIDGET(view)); if (!GTK_IS_SCROLLED_WINDOW(parent)) return; - panel->display = display; - g_object_ref(panel->display); + panel->view = view; + g_object_ref(panel->view); panel->support = GTK_SCROLLED_WINDOW(parent); g_object_ref(panel->support); @@ -362,13 +362,13 @@ static void on_view_scroll_setup(GtkAdjustment *adj, GGlancePanel *panel) if (gtk_adjustment_get_page_size(hadj) == 0 || gtk_adjustment_get_page_size(vadj) == 0) return; - gtk_widget_get_preferred_size(GTK_WIDGET(panel->display), NULL, &panel->req); + gtk_widget_get_preferred_size(GTK_WIDGET(panel->view), NULL, &panel->req); compute_glance_scale(panel); on_view_scrolled(adj, panel); - update_glance_panel_for_view_content(panel, panel->display); + update_glance_panel_for_view_content(panel, panel->view); } @@ -423,10 +423,10 @@ static void on_view_scrolled(GtkAdjustment *adj, GGlancePanel *panel) static void on_glance_resize(GtkWidget *widget, GdkRectangle *allocation, GGlancePanel *panel) { - if (panel->display != NULL) + if (panel->view != NULL) { on_view_scroll_setup(NULL, panel); - update_glance_panel_for_view_content(panel, panel->display); + update_glance_panel_for_view_content(panel, panel->view); } } @@ -508,8 +508,8 @@ static void compute_glance_scale(GGlancePanel *panel) /****************************************************************************** * * -* Paramètres : panel = panneau à actualiser. * -* display = nouveau panneau d'affichage actif. * +* Paramètres : panel = panneau à actualiser. * +* view = nouveau panneau d'affichage actif. * * * * Description : Lance une actualisation du fait d'un changement de vue. * * * @@ -519,7 +519,7 @@ static void compute_glance_scale(GGlancePanel *panel) * * ******************************************************************************/ -static void update_glance_panel_for_view_content(GGlancePanel *panel, GtkDisplayPanel *display) +static void update_glance_panel_for_view_content(GGlancePanel *panel, GLoadedPanel *view) { cairo_t *cairo; /* Assistant pour le dessin */ GtkAllocation area; /* Dimension de la surface */ @@ -542,7 +542,7 @@ static void update_glance_panel_for_view_content(GGlancePanel *panel, GtkDisplay area.width = panel->painting.width; area.height = panel->painting.height; - gtk_display_panel_cache_glance(display, cairo, &area, panel->scale); + g_loaded_panel_cache_glance(view, cairo, &area, panel->scale); cairo_destroy(cairo); @@ -708,7 +708,7 @@ static gboolean on_button_press_over_glance(GtkWidget *widget, GdkEventButton *e GtkAdjustment *vadj; /* Gestionnaire du défilement */ GdkCursor *cursor; /* Pointeur pour la surface */ - if (panel->display != NULL && event->button == 1) + if (panel->view != NULL && event->button == 1) { panel->start_x = event->x; panel->start_y = event->y; @@ -754,7 +754,7 @@ static gboolean on_button_press_over_glance(GtkWidget *widget, GdkEventButton *e static gboolean on_button_release_over_glance(GtkWidget *widget, GdkEventButton *event, GGlancePanel *panel) { - if (panel->display != NULL && event->button == 1) + if (panel->view != NULL && event->button == 1) { if (panel->valid) gdk_window_set_cursor(gtk_widget_get_window(widget), NULL); @@ -788,7 +788,7 @@ static gboolean on_mouse_motion_over_glance(GtkWidget *widget, GdkEventMotion *e GtkAdjustment *vadj; /* Gestionnaire du défilement */ gdouble value; /* Nouvelle valeur bornée */ - if (panel->display != NULL && event->state & GDK_BUTTON1_MASK && panel->valid) + if (panel->view != NULL && event->state & GDK_BUTTON1_MASK && panel->valid) { diff_x = (event->x - panel->start_x) / panel->scale; diff_y = (event->y - panel->start_y) / panel->scale; diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c index 6ae44b1..23383a1 100644 --- a/src/gui/panels/strings.c +++ b/src/gui/panels/strings.c @@ -589,7 +589,7 @@ static void on_strings_selection_change(GtkTreeSelection *selection, gpointer un GtkTreeModel *model; /* Modèle de gestion */ GBinSymbol *symbol; /* Symbole en cours d'étude */ const vmpa2t *addr; /* Adressse associée au signet */ - GtkDisplayPanel *display; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ if (gtk_tree_selection_get_selected(selection, &model, &iter)) { @@ -597,9 +597,12 @@ static void on_strings_selection_change(GtkTreeSelection *selection, gpointer un addr = get_mrange_addr(g_binary_symbol_get_range(symbol)); - display = get_current_view(); - gtk_display_panel_request_move(display, addr); - g_object_unref(G_OBJECT(display)); + panel = get_current_view(); + + if (GTK_IS_DISPLAY_PANEL(panel)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), addr); + + g_object_unref(G_OBJECT(panel)); g_object_unref(G_OBJECT(symbol)); @@ -820,7 +823,7 @@ static gboolean on_button_event_over_strings(GtkWidget *widget, GdkEventButton * GtkTreeModel *model; /* Modèle de gestion */ GBinSymbol *symbol; /* Symbole en cours d'étude */ const vmpa2t *addr; /* Adressse associée au signet */ - GtkDisplayPanel *display; /* Afficheur effectif de code */ + GLoadedPanel *display; /* Afficheur effectif de code */ switch (event->button) { @@ -838,7 +841,10 @@ static gboolean on_button_event_over_strings(GtkWidget *widget, GdkEventButton * addr = get_mrange_addr(g_binary_symbol_get_range(symbol)); display = get_current_view(); - gtk_display_panel_request_move(display, addr); + + if (GTK_IS_DISPLAY_PANEL(display)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(display), addr); + g_object_unref(G_OBJECT(display)); g_object_unref(G_OBJECT(symbol)); @@ -1038,7 +1044,7 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa GObject *ref; /* Espace de référencements */ GtkWidget *dialog; /* Boîte de dialogue à montrer */ vmpa2t *addr; /* Adresse de destination */ - GtkDisplayPanel *display; /* Afficheur effectif de code */ + GLoadedPanel *display; /* Afficheur effectif de code */ symbol = get_selected_panel_symbol(panel->treeview, NULL); if (symbol == NULL) return; @@ -1063,7 +1069,10 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa addr = get_address_from_gotox_dialog(dialog); display = get_current_view(); - gtk_display_panel_request_move(display, addr); + + if (GTK_IS_DISPLAY_PANEL(display)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(display), addr); + g_object_unref(G_OBJECT(display)); delete_vmpa(addr); diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c index 5bd4eae..3b01f24 100644 --- a/src/gui/panels/symbols.c +++ b/src/gui/panels/symbols.c @@ -548,7 +548,7 @@ static void on_symbols_selection_change(GtkTreeSelection *selection, gpointer un GtkTreeModel *model; /* Modèle de gestion */ GBinSymbol *symbol; /* Symbole à traiter */ const mrange_t *range; /* Couverture dudit symbole */ - GtkDisplayPanel *display; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ if (gtk_tree_selection_get_selected(selection, &model, &iter)) { @@ -558,9 +558,12 @@ static void on_symbols_selection_change(GtkTreeSelection *selection, gpointer un { range = g_binary_symbol_get_range(symbol); - display = get_current_view(); - gtk_display_panel_request_move(display, get_mrange_addr(range)); - g_object_unref(G_OBJECT(display)); + panel = get_current_view(); + + if (GTK_IS_DISPLAY_PANEL(panel)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), get_mrange_addr(range)); + + g_object_unref(G_OBJECT(panel)); g_object_unref(G_OBJECT(symbol)); diff --git a/src/gui/tb/portions.c b/src/gui/tb/portions.c index 685f5ba..f60f83c 100644 --- a/src/gui/tb/portions.c +++ b/src/gui/tb/portions.c @@ -243,7 +243,7 @@ static void update_portions_item_binary(GEditorItem *item, GLoadedBinary *binary static void track_address_on_binary_strip(GtkBinaryStrip *strip, GEditorItem *item) { const vmpa2t *addr; /* Nouvelle destination */ - GtkDisplayPanel *panel; /* Afficheur effectif de code */ + GLoadedPanel *panel; /* Afficheur effectif de code */ GLoadedBinary *binary; /* Binaire chargé et actif */ addr = gtk_binary_strip_get_location(strip); @@ -251,7 +251,8 @@ static void track_address_on_binary_strip(GtkBinaryStrip *strip, GEditorItem *it panel = get_current_view(); binary = get_current_binary(); - gtk_display_panel_request_move(panel, addr); + if (GTK_IS_DISPLAY_PANEL(panel)) + gtk_display_panel_request_move(GTK_DISPLAY_PANEL(panel), addr); focus_address_in_editor_items(binary, addr, item); |