summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkdisplaypanel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext/gtkdisplaypanel.c')
-rw-r--r--src/gtkext/gtkdisplaypanel.c34
1 files changed, 31 insertions, 3 deletions
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);