From 0ae0098791e287bbc91e6ffc675a34b80f799c5f Mon Sep 17 00:00:00 2001 From: glenlow Date: Wed, 18 Feb 2009 13:36:50 +0000 Subject: [PATCH] begin_label + end_label around each textpara rendering for future labeling support --- lib/common/labels.c | 6 ++++-- lib/gvc/gvcjob.h | 2 ++ lib/gvc/gvcproc.h | 2 ++ lib/gvc/gvplugin_render.h | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/common/labels.c b/lib/common/labels.c index bff82b5f8..db1ba9856 100644 --- a/lib/common/labels.c +++ b/lib/common/labels.c @@ -227,8 +227,9 @@ void emit_label(GVJ_t * job, emit_state_t emit_state, textlabel_t * lp) if (lp->u.txt.nparas < 1) return; - gvrender_begin_context(job); - gvrender_set_pencolor(job, lp->fontcolor); + gvrender_begin_label(job, LABEL_PLAIN); + gvrender_begin_context(job); + gvrender_set_pencolor(job, lp->fontcolor); gvrender_set_font(job, lp->fontname, lp->fontsize); /* position for first para */ @@ -264,6 +265,7 @@ void emit_label(GVJ_t * job, emit_state_t emit_state, textlabel_t * lp) } gvrender_end_context(job); + gvrender_end_label(job); obj->emit_state = old_emit_state; } diff --git a/lib/gvc/gvcjob.h b/lib/gvc/gvcjob.h index 8df1094b0..f1ef61d17 100644 --- a/lib/gvc/gvcjob.h +++ b/lib/gvc/gvcjob.h @@ -38,6 +38,8 @@ extern "C" { typedef enum { PEN_NONE, PEN_DASHED, PEN_DOTTED, PEN_SOLID } pen_type; typedef enum { FILL_NONE, FILL_SOLID } fill_type; typedef enum { FONT_REGULAR, FONT_BOLD, FONT_ITALIC } font_type; + typedef enum { LABEL_PLAIN, LABEL_HTML } label_type; + #define PENWIDTH_NORMAL 1. #define PENWIDTH_BOLD 2. typedef enum { GVATTR_STRING, GVATTR_BOOL, GVATTR_COLOR } gvattr_t; diff --git a/lib/gvc/gvcproc.h b/lib/gvc/gvcproc.h index 67a7033d9..6bd9a9853 100644 --- a/lib/gvc/gvcproc.h +++ b/lib/gvc/gvcproc.h @@ -102,6 +102,8 @@ extern void gvrender_begin_anchor(GVJ_t * job, char *href, char *tooltip, char *target, char *id); extern void gvrender_end_anchor(GVJ_t * job); + extern void gvrender_begin_label(GVJ_t * job, label_type type); + extern void gvrender_end_label(GVJ_t * job); extern void gvrender_set_font(GVJ_t * job, char *fontname, double fontsize); extern void gvrender_textpara(GVJ_t * job, pointf p, textpara_t * para); diff --git a/lib/gvc/gvplugin_render.h b/lib/gvc/gvplugin_render.h index 1b66c97e4..272d4a81b 100644 --- a/lib/gvc/gvplugin_render.h +++ b/lib/gvc/gvplugin_render.h @@ -48,6 +48,8 @@ extern "C" { void (*begin_anchor) (GVJ_t * job, char *href, char *tooltip, char *target, char *id); void (*end_anchor) (GVJ_t * job); + void (*begin_label) (GVJ_t * job, label_type type); + void (*end_label) (GVJ_t * job); void (*textpara) (GVJ_t * job, pointf p, textpara_t * str); void (*resolve_color) (GVJ_t * job, gvcolor_t * color); void (*ellipse) (GVJ_t * job, pointf * A, int filled); -- 2.40.0