summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkgraphdisplay.c
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/gtkext/gtkgraphdisplay.c
parentf65f83fd222d14934b527152899359327813128e (diff)
Exported graph views using Cairo.
Diffstat (limited to 'src/gtkext/gtkgraphdisplay.c')
-rw-r--r--src/gtkext/gtkgraphdisplay.c63
1 files changed, 61 insertions, 2 deletions
diff --git a/src/gtkext/gtkgraphdisplay.c b/src/gtkext/gtkgraphdisplay.c
index fb89b2e..97bb4d3 100644
--- a/src/gtkext/gtkgraphdisplay.c
+++ b/src/gtkext/gtkgraphdisplay.c
@@ -146,6 +146,9 @@ static GLineCursor *gtk_graph_display_get_cursor(const GtkGraphDisplay *);
/* Place en cache un rendu destiné à l'aperçu graphique rapide. */
static void gtk_graph_display_cache_glance(GtkGraphDisplay *, cairo_t *, const GtkAllocation *, double);
+/* Marque ou non le composant pour une exportation prochaine. */
+static void gtk_graph_display_prepare_export(GtkGraphDisplay *, bool);
+
/* Supprime tout contenu de l'afficheur de code en graphique. */
static void gtk_graph_display_reset(GtkGraphDisplay *, bool);
@@ -202,6 +205,8 @@ static void gtk_graph_display_class_init(GtkGraphDisplayClass *class)
panel_class->get_cursor = (get_cursor_fc)gtk_graph_display_get_cursor;
panel_class->cache_glance = (cache_glance_fc)gtk_graph_display_cache_glance;
+ panel_class->prepare_export = (prepare_export_fc)gtk_graph_display_prepare_export;
+
}
@@ -465,15 +470,15 @@ static void gtk_graph_display_adjust_scroll_value(GtkGraphDisplay *display, GtkA
static gboolean gtk_graph_display_draw(GtkWidget *widget, cairo_t *cr, GtkGraphDisplay *display)
{
- size_t i; /* Boucle de parcours */
cairo_surface_t *pat_image; /* Fond du futur pinceau */
cairo_t *pat_cr; /* Pinceau pour le pinceau */
cairo_pattern_t *pattern; /* Patron de remplissage */
double degrees; /* Conversion en degrés */
+ size_t i; /* Boucle de parcours */
/* Eventuel fond pour la zone de compression */
- if (display->may_collapsing)
+ if (display->may_collapsing && !GTK_DISPLAY_PANEL(display)->export)
{
/* Préparation du pinceau */
@@ -1158,6 +1163,35 @@ static void gtk_graph_display_cache_glance(GtkGraphDisplay *display, cairo_t *cr
/******************************************************************************
* *
+* Paramètres : display = composant GTK à mettre à jour. *
+* export = préparation d'une exportation complète du rendu ? *
+* *
+* Description : Marque ou non le composant pour une exportation prochaine. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void gtk_graph_display_prepare_export(GtkGraphDisplay *display, bool export)
+{
+ void prepare_child_export(GtkWidget *child, gpointer unused)
+ {
+ if (!GTK_IS_BUFFER_DISPLAY(child))
+ return;
+
+ gtk_display_panel_prepare_export(GTK_DISPLAY_PANEL(child), export);
+
+ }
+
+ gtk_container_foreach(GTK_CONTAINER(display->support), (GtkCallback)prepare_child_export, NULL);
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : - *
* *
* Description : Crée un nouveau composant pour l'affichage en graphique. *
@@ -1177,6 +1211,31 @@ GtkWidget *gtk_graph_display_new(void)
/******************************************************************************
* *
+* Paramètres : display = composant GTK à consulter. *
+* *
+* Description : Fournit le support utilisé pour le rendu graphique. *
+* *
+* Retour : Composant GTK de support. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GtkWidget *gtk_graph_display_get_support(GtkGraphDisplay *display)
+{
+ GtkWidget *result; /* Instance à retourner */
+
+ result = display->support;
+
+ g_object_ref(G_OBJECT(result));
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : display = composant GTK à mettre à jour. *
* widget = composant GTK à insérer. *
* x = abscisse du point d'insertion. *