summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-03-18 09:00:20 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-03-18 09:00:55 (GMT)
commit43d57853c6f2c59197c7dc20ff61f3f2eacc2445 (patch)
tree3dcb5ad426c7e5d4159d95f7e9e5e80eef45bfe0 /src/glibext
parentf65f83fd222d14934b527152899359327813128e (diff)
Exported graph views using Cairo.
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/gbufferview.c14
-rw-r--r--src/glibext/gbufferview.h2
2 files changed, 13 insertions, 3 deletions
diff --git a/src/glibext/gbufferview.c b/src/glibext/gbufferview.c
index 2239d23..c5021f2 100644
--- a/src/glibext/gbufferview.c
+++ b/src/glibext/gbufferview.c
@@ -1100,6 +1100,7 @@ bool g_buffer_view_highlight_segments(GBufferView *view, gint x, gint y, const G
* options = règles d'affichage des colonnes modulables. *
* offsets = décalages supplémentaires à appliquer. *
* selected = ordonnée d'une ligne sélectionnée ou NULL. *
+* export = indique si la vue est en cours d'exportation. *
* *
* Description : Imprime la visualisation du tampon de lignes quelconques. *
* *
@@ -1109,12 +1110,13 @@ bool g_buffer_view_highlight_segments(GBufferView *view, gint x, gint y, const G
* *
******************************************************************************/
-void g_buffer_view_draw(const GBufferView *view, cairo_t *cr, gint virt_y, const cairo_rectangle_int_t *area, const GDisplayOptions *options, const line_width_summary *offsets, gint *selected)
+void g_buffer_view_draw(const GBufferView *view, cairo_t *cr, gint virt_y, const cairo_rectangle_int_t *area, const GDisplayOptions *options, const line_width_summary *offsets, gint *selected, bool export)
{
gint line_height; /* Hauteur d'une ligne */
gint cr_y; /* Ordonnée pour le dessin */
size_t first; /* Première ligne visée */
size_t last; /* Dernière ligne visée */
+ segcnt_list *highlighted; /* Segments mis en évidence */
line_height = g_buffer_cache_get_line_height(view->cache);
@@ -1144,7 +1146,15 @@ void g_buffer_view_draw(const GBufferView *view, cairo_t *cr, gint virt_y, const
if (selected != NULL)
*selected -= cr_y;
- g_buffer_cache_draw(view->cache, cr, first, last, area, options, offsets, selected, view->highlighted);
+ if (export)
+ highlighted = init_segment_content_list();
+ else
+ highlighted = view->highlighted;
+
+ g_buffer_cache_draw(view->cache, cr, first, last, area, options, offsets, selected, highlighted);
+
+ if (export)
+ unref_segment_content_list(highlighted);
}
diff --git a/src/glibext/gbufferview.h b/src/glibext/gbufferview.h
index 7e29cfd..9d40cbd 100644
--- a/src/glibext/gbufferview.h
+++ b/src/glibext/gbufferview.h
@@ -98,7 +98,7 @@ bool g_buffer_view_unhighlight_segments(GBufferView *);
bool g_buffer_view_highlight_segments(GBufferView *, gint, gint, const GDisplayOptions *, const line_width_summary *);
/* Imprime la visualisation du tampon de lignes quelconques. */
-void g_buffer_view_draw(const GBufferView *, cairo_t *, gint, const cairo_rectangle_int_t *, const GDisplayOptions *, const line_width_summary *, gint *);
+void g_buffer_view_draw(const GBufferView *, cairo_t *, gint, const cairo_rectangle_int_t *, const GDisplayOptions *, const line_width_summary *, gint *, bool);