diff options
author | scuri <scuri> | 2010-11-18 01:16:34 +0000 |
---|---|---|
committer | scuri <scuri> | 2010-11-18 01:16:34 +0000 |
commit | 95e5e9e6d4b9de49b59ef7ae101424e9f52c0257 (patch) | |
tree | e2e16c6f119b46cf78b20445ce17c1b323baac41 | |
parent | e89c87993b1426bde674103f47d454f1d87c7372 (diff) |
*** empty log message ***
-rw-r--r-- | html/en/history.html | 5 | ||||
-rw-r--r-- | src/cairo/cdcairo.c | 20 | ||||
-rw-r--r-- | src/cairo/cdcairops.c | 2 |
3 files changed, 26 insertions, 1 deletions
diff --git a/html/en/history.html b/html/en/history.html index 79de902..cdb7187 100644 --- a/html/en/history.html +++ b/html/en/history.html @@ -27,6 +27,11 @@ <body> <h2>History of Changes</h2> +<h3>CVS (17/Nov/2010)</h3> +<ul> + <li><span class="hist_fixed">Fixed:</span> defines in Cairo so it can be + compiled using older Cairo and Pango versions.</li> +</ul> <h3><a href="http://sourceforge.net/projects/canvasdraw/files/5.4.1/">Version 5.4.1</a> (09/Nov/2010)</h3> <ul> diff --git a/src/cairo/cdcairo.c b/src/cairo/cdcairo.c index 493ae1f..da96659 100644 --- a/src/cairo/cdcairo.c +++ b/src/cairo/cdcairo.c @@ -1918,6 +1918,7 @@ static char* get_linegradient_attrib(cdCtxCanvas* ctxcanvas) { double x1, y1, x2, y2; +#if (CAIRO_VERSION_MAJOR>1 || (CAIRO_VERSION_MAJOR==1 && CAIRO_VERSION_MINOR>=4)) if (cairo_pattern_get_linear_points(ctxcanvas->pattern, &x1, &y1, &x2, &y2) == CAIRO_STATUS_SUCCESS) { static char data[100]; @@ -1925,6 +1926,7 @@ static char* get_linegradient_attrib(cdCtxCanvas* ctxcanvas) return data; } else +#endif return NULL; } @@ -1988,6 +1990,7 @@ static char* get_radialgradient_attrib(cdCtxCanvas* ctxcanvas) { double cx1, cy1, rad1, cx2, cy2, rad2; +#if (CAIRO_VERSION_MAJOR>1 || (CAIRO_VERSION_MAJOR==1 && CAIRO_VERSION_MINOR>=4)) if (cairo_pattern_get_radial_circles(ctxcanvas->pattern, &cx1, &cy1, &rad1, &cx2, &cy2, &rad2) == CAIRO_STATUS_SUCCESS) { static char data[100]; @@ -1995,6 +1998,7 @@ static char* get_radialgradient_attrib(cdCtxCanvas* ctxcanvas) return data; } else +#endif return NULL; } @@ -2065,6 +2069,16 @@ static cdAttribute cairodc_attrib = get_cairodc_attrib }; +#if !PANGO_VERSION_CHECK(1,22,0) +static PangoContext * cd_pango_cairo_create_context (cairo_t *cr) +{ + PangoFontMap *fontmap = pango_cairo_font_map_get_default (); + PangoContext *context = pango_context_new(); + pango_context_set_font_map (context, fontmap); + pango_cairo_update_context (cr, context); + return context; +} +#endif cdCtxCanvas *cdcairoCreateCanvas(cdCanvas* canvas, cairo_t* cr) { @@ -2079,8 +2093,14 @@ cdCtxCanvas *cdcairoCreateCanvas(cdCanvas* canvas, cairo_t* cr) canvas->ctxcanvas = ctxcanvas; canvas->invert_yaxis = 1; +#if PANGO_VERSION_CHECK(1,22,0) ctxcanvas->fontcontext = pango_cairo_create_context(ctxcanvas->cr); +#else + ctxcanvas->fontcontext = cd_pango_cairo_create_context(ctxcanvas->cr); +#endif +#if PANGO_VERSION_CHECK(1,16,0) pango_context_set_language(ctxcanvas->fontcontext, pango_language_get_default()); +#endif cdRegisterAttribute(canvas, &rotate_attrib); cdRegisterAttribute(canvas, &version_attrib); diff --git a/src/cairo/cdcairops.c b/src/cairo/cdcairops.c index b08aee4..78cd3db 100644 --- a/src/cairo/cdcairops.c +++ b/src/cairo/cdcairops.c @@ -131,10 +131,10 @@ static void cdcreatecanvas(cdCanvas* canvas, void* data) cairo_ps_surface_restrict_to_level(surface, CAIRO_PS_LEVEL_2); else if (level == 3) cairo_ps_surface_restrict_to_level(surface, CAIRO_PS_LEVEL_3); -#endif if (eps) cairo_ps_surface_set_eps(surface, 1); +#endif cairo_ps_surface_dsc_comment(surface, "%%Title: CanvasDraw"); cairo_ps_surface_dsc_begin_setup (surface); |