diff options
Diffstat (limited to 'src/gui/panels')
-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 |
6 files changed, 73 insertions, 49 deletions
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)); |