summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-12-04 20:54:16 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-12-04 20:54:16 (GMT)
commit5c51c967a7566f29218b3d8233248742ff4d5e4c (patch)
treeda7511731b487d29da7198db175e9c691e391036 /src
parent6c67ffbb6c8a8dfb7120a0dab82dadbbf8112e88 (diff)
Drawn a dirty preview for buffer views.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@295 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src')
-rw-r--r--src/gtkext/gtkbufferview.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gtkext/gtkbufferview.c b/src/gtkext/gtkbufferview.c
index e94d11a..027ae5c 100644
--- a/src/gtkext/gtkbufferview.c
+++ b/src/gtkext/gtkbufferview.c
@@ -49,6 +49,9 @@ static bool gtk_buffer_view_get_address_coordinates(const GtkBufferView *, vmpa_
/* Réagit à un défilement quelconque. */
static void gtk_buffer_view_scroll(GtkBufferView *);
+/* Place en cache un rendu destiné à l'aperçu graphique rapide. */
+static void gtk_buffer_view_cache_glance(GtkBufferView *, cairo_t *);
+
/* ---------------------------------------------------------------------------------- */
@@ -105,6 +108,7 @@ static void gtk_buffer_view_init(GtkBufferView *view)
viewpanel->get_coordinates = (get_addr_coordinates_fc)gtk_buffer_view_get_address_coordinates;
viewpanel->scroll = (scroll_fc)gtk_buffer_view_scroll;
+ viewpanel->cache_glance = (cache_glance_fc)gtk_buffer_view_cache_glance;
}
@@ -378,6 +382,38 @@ static void gtk_buffer_view_scroll(GtkBufferView *view)
/******************************************************************************
* *
+* Paramètres : view = composant GTK à manipuler. *
+* cairo = assistant pour la création de rendus. *
+* *
+* Description : Place en cache un rendu destiné à l'aperçu graphique rapide. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_buffer_view_cache_glance(GtkBufferView *view, cairo_t *cairo)
+{
+ GtkRequisition req; /* Pleine taille de la source */
+
+ gtk_widget_size_request(GTK_WIDGET(view), &req);
+ gtk_buffer_view_compute_real_coord(view, &req.width, &req.height);
+
+ /* FIXME : hardcoded 20 */
+
+ cairo_set_line_width(cairo, 20);
+ cairo_set_source_rgb(cairo, 0, 0, 0);
+
+ cairo_rectangle(cairo, 0, 0, req.width - 20, req.height - 20);
+
+ cairo_stroke(cairo);
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : view = composant GTK à mettre à jour. *
* buffer = tampon de lignes à encadrer. *
* addr = indique si les positions doivent être affichées. *