diff options
Diffstat (limited to 'src/gtkext')
| -rw-r--r-- | src/gtkext/gtkdisplaypanel-int.h | 2 | ||||
| -rw-r--r-- | src/gtkext/gtkdisplaypanel.c | 34 | ||||
| -rw-r--r-- | src/gtkext/gtkdisplaypanel.h | 11 | ||||
| -rw-r--r-- | src/gtkext/gtkgraphdisplay.c | 5 | 
4 files changed, 39 insertions, 13 deletions
| diff --git a/src/gtkext/gtkdisplaypanel-int.h b/src/gtkext/gtkdisplaypanel-int.h index 38c76b4..a2170e7 100644 --- a/src/gtkext/gtkdisplaypanel-int.h +++ b/src/gtkext/gtkdisplaypanel-int.h @@ -1,6 +1,6 @@  /* Chrysalide - Outil d'analyse de fichiers binaires - * gtkdisplaypanel-int.h - définitions internes propre à l'affichage de contenu de binaire + * gtkdisplaypanel-int.h - définitions internes propres à l'affichage de contenus de binaire   *   * Copyright (C) 2016-2017 Cyrille Bagard   * diff --git a/src/gtkext/gtkdisplaypanel.c b/src/gtkext/gtkdisplaypanel.c index be84006..003ac5f 100644 --- a/src/gtkext/gtkdisplaypanel.c +++ b/src/gtkext/gtkdisplaypanel.c @@ -1,6 +1,6 @@  /* Chrysalide - Outil d'analyse de fichiers binaires - * gtkdisplaypanel.c - affichage de contenu de binaire + * gtkdisplaypanel.c - affichage de contenus de binaire   *   * Copyright (C) 2016-2017 Cyrille Bagard   * @@ -28,6 +28,8 @@  #include "gtkdisplaypanel-int.h" +#include "../glibext/gloadedpanel-int.h" +  /* Amplitude de l'arrondi pour les coins */ @@ -40,6 +42,9 @@ static void gtk_display_panel_class_init(GtkDisplayPanelClass *);  /* Procède à l'initialisation de l'afficheur générique. */  static void gtk_display_panel_init(GtkDisplayPanel *); +/* Procède à l'initialisation de l'interface d'affichage. */ +static void gtk_display_panel_loaded_interface_init(GLoadedPanelInterface *); +  /* Définit une propriété du composant d'affichage. */  static void gtk_display_panel_set_property(GObject *, guint, const GValue *, GParamSpec *); @@ -82,11 +87,15 @@ static void gtk_display_panel_adjustment_value_changed(GtkAdjustment *, GtkDispl  /* Réagit à un changement des règles d'affichage. */  static void on_view_panel_binary_display_change(GLoadedBinary *, BinaryView, BufferLineColumn, GtkDisplayPanel *); +/* Place en cache un rendu destiné à l'aperçu graphique rapide. */ +static void gtk_display_panel_cache_glance(GtkDisplayPanel *, cairo_t *, const GtkAllocation *, double); +  /* Détermine le type du composant d'affichage générique. */  G_DEFINE_TYPE_WITH_CODE(GtkDisplayPanel, gtk_display_panel, GTK_TYPE_FIXED, -                        G_IMPLEMENT_INTERFACE(GTK_TYPE_SCROLLABLE, NULL)) +                        G_IMPLEMENT_INTERFACE(GTK_TYPE_SCROLLABLE, NULL) +                        G_IMPLEMENT_INTERFACE(G_TYPE_LOADED_PANEL, gtk_display_panel_loaded_interface_init));  /****************************************************************************** @@ -169,6 +178,25 @@ static void gtk_display_panel_init(GtkDisplayPanel *panel)  /******************************************************************************  *                                                                             * +*  Paramètres  : iface = interface GLib à initialiser.                        * +*                                                                             * +*  Description : Procède à l'initialisation de l'interface d'affichage.       * +*                                                                             * +*  Retour      : -                                                            * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +static void gtk_display_panel_loaded_interface_init(GLoadedPanelInterface *iface) +{ +    iface->cache_glance = (cache_loaded_glance_fc)gtk_display_panel_cache_glance; + +} + + +/****************************************************************************** +*                                                                             *  *  Paramètres  : object  = instance de composant GTK à manipuler.             *  *                prop_id = identifiant de la propriété concernée.             *  *                value   = valeur attribuée.                                  * @@ -1052,7 +1080,7 @@ bool gtk_display_panel_get_position(const GtkDisplayPanel *panel, GBufferLine **  *                                                                             *  ******************************************************************************/ -void gtk_display_panel_cache_glance(GtkDisplayPanel *panel, cairo_t *cairo, const GtkAllocation *area, double scale) +static void gtk_display_panel_cache_glance(GtkDisplayPanel *panel, cairo_t *cairo, const GtkAllocation *area, double scale)  {      if (GTK_DISPLAY_PANEL_GET_CLASS(panel)->cache_glance != NULL)          GTK_DISPLAY_PANEL_GET_CLASS(panel)->cache_glance(panel, cairo, area, scale); diff --git a/src/gtkext/gtkdisplaypanel.h b/src/gtkext/gtkdisplaypanel.h index 7cb2aeb..3ea967a 100644 --- a/src/gtkext/gtkdisplaypanel.h +++ b/src/gtkext/gtkdisplaypanel.h @@ -1,6 +1,6 @@  /* Chrysalide - Outil d'analyse de fichiers binaires - * gtkdisplaypanel.h - prototypes pour l'affichage de contenu de binaire + * gtkdisplaypanel.h - prototypes pour l'affichage de contenus de binaire   *   * Copyright (C) 2016-2017 Cyrille Bagard   * @@ -21,8 +21,8 @@   */ -#ifndef _GTK_DISPLAYPANEL_H -#define _GTK_DISPLAYPANEL_H +#ifndef _GTKEXT_DISPLAYPANEL_H +#define _GTKEXT_DISPLAYPANEL_H  #include <glib-object.h> @@ -97,9 +97,6 @@ void gtk_display_panel_request_move(GtkDisplayPanel *, const vmpa2t *);  /* Fournit des éléments liés à la position courante dans la vue. */  bool gtk_display_panel_get_position(const GtkDisplayPanel *, GBufferLine **, GObject **); -/* Place en cache un rendu destiné à l'aperçu graphique rapide. */ -void gtk_display_panel_cache_glance(GtkDisplayPanel *, cairo_t *, const GtkAllocation *, double); - -#endif  /* _GTK_DISPLAYPANEL_H */ +#endif  /* _GTKEXT_DISPLAYPANEL_H */ diff --git a/src/gtkext/gtkgraphdisplay.c b/src/gtkext/gtkgraphdisplay.c index 4d11050..9c6933e 100644 --- a/src/gtkext/gtkgraphdisplay.c +++ b/src/gtkext/gtkgraphdisplay.c @@ -33,6 +33,7 @@  #include "graph/cluster.h"  #include "../analysis/routine.h"  #include "../format/format.h" +#include "../glibext/gloadedpanel.h"  #include "../gui/core/items.h" @@ -683,7 +684,7 @@ static void gtk_graph_display_define_main_address(GtkGraphDisplay *display, cons   ggddma_done: -        change_editor_items_current_view_content(GTK_DISPLAY_PANEL(display)); +        change_editor_items_current_view_content(G_LOADED_PANEL(display));          g_object_unref(G_OBJECT(format)); @@ -823,7 +824,7 @@ static void gtk_graph_display_cache_glance(GtkGraphDisplay *display, cairo_t *cr          sub_area.width = sub_area.width * scale + 1;          sub_area.height = sub_area.height * scale + 1; -        gtk_display_panel_cache_glance(GTK_DISPLAY_PANEL(child), cr, &sub_area, scale); +        g_loaded_panel_cache_glance(G_LOADED_PANEL(child), cr, &sub_area, scale);      } | 
