Commit 72aed17f authored by Dom Lachowicz's avatar Dom Lachowicz

more libart removal

parent d307bdce
2005-02-25 Dom Lachowicz <cinamod@hotmail.com>
* *: Get rid of deprecated stuff.
* *: Get rid of more libart data structures
* configure.in: Bump version number
2005-02-25 Caleb Moore <c.moore@student.unsw.edu.au>
......
......@@ -33,6 +33,8 @@
#include <libart_lgpl/art_rgb_svp.h>
#include <libart_lgpl/art_svp_intersect.h>
#include <libart_lgpl/art_svp_ops.h>
#include <libart_lgpl/art_svp_vpath_stroke.h>
#include <libart_lgpl/art_vpath_dash.h>
#include "rsvg-art-draw.h"
#include "rsvg-art-composite.h"
......@@ -309,7 +311,7 @@ rsvg_render_outline (RsvgState *state, ArtVpath *vpath)
/* if the path is dashed, stroke it */
if (state->dash.n_dash > 0)
{
ArtVpath * dashed_vpath = art_vpath_dash (vpath, &state->dash);
ArtVpath * dashed_vpath = art_vpath_dash (vpath, (ArtVpathDash *)(&state->dash));
vpath = dashed_vpath;
}
......@@ -505,7 +507,7 @@ rsvg_art_render_path(RsvgDrawingCtx *ctx, const char *d)
bpath_def = rsvg_parse_path (d);
rsvg_bpath_def_art_finish (bpath_def);
rsvg_render_bpath (ctx, bpath_def->bpath);
rsvg_render_bpath (ctx, (ArtBpath *)bpath_def->bpath);
rsvg_render_markers(bpath_def, ctx);
......@@ -522,7 +524,7 @@ rsvg_art_svp_render_path (RsvgDrawingCtx *ctx, const char *d)
bpath_def = rsvg_parse_path (d);
rsvg_bpath_def_art_finish (bpath_def);
svp2 = rsvg_render_bpath_into_svp (ctx, bpath_def->bpath);
svp2 = rsvg_render_bpath_into_svp (ctx, (ArtBpath *)bpath_def->bpath);
if (render->outline != NULL)
{
......
......@@ -44,20 +44,20 @@ rsvg_bpath_def_new (void)
bpd->n_bpath = 0;
bpd->n_bpath_max = 16;
bpd->moveto_idx = -1;
bpd->bpath = g_new (ArtBpath, bpd->n_bpath_max);
bpd->bpath = g_new (RsvgBpath, bpd->n_bpath_max);
return bpd;
}
RsvgBpathDef *
rsvg_bpath_def_new_from (ArtBpath *path)
rsvg_bpath_def_new_from (RsvgBpath *path)
{
RsvgBpathDef *bpd;
int i;
g_return_val_if_fail (path != NULL, NULL);
for (i = 0; path[i].code != ART_END; i++)
for (i = 0; path[i].code != RSVG_END; i++)
;
if (i <= 0)
return rsvg_bpath_def_new ();
......@@ -67,9 +67,9 @@ rsvg_bpath_def_new_from (ArtBpath *path)
bpd->n_bpath = i;
bpd->n_bpath_max = i;
bpd->moveto_idx = -1;
bpd->bpath = g_new (ArtBpath, i);
bpd->bpath = g_new (RsvgBpath, i);
memcpy (bpd->bpath, path, i * sizeof (ArtBpath));
memcpy (bpd->bpath, path, i * sizeof (RsvgBpath));
return bpd;
}
......@@ -85,7 +85,7 @@ rsvg_bpath_def_free (RsvgBpathDef *bpd)
void
rsvg_bpath_def_moveto (RsvgBpathDef *bpd, double x, double y)
{
ArtBpath *bpath;
RsvgBpath *bpath;
int n_bpath;
g_return_if_fail (bpd != NULL);
......@@ -96,7 +96,7 @@ rsvg_bpath_def_moveto (RsvgBpathDef *bpd, double x, double y)
n_bpath = bpd->n_bpath;
if (n_bpath > 0)
if (bpath[n_bpath - 1].code == ART_MOVETO_OPEN)
if (bpath[n_bpath - 1].code == RSVG_MOVETO_OPEN)
{
bpath[n_bpath - 1].x3 = x;
bpath[n_bpath - 1].y3 = y;
......@@ -108,9 +108,9 @@ rsvg_bpath_def_moveto (RsvgBpathDef *bpd, double x, double y)
if (n_bpath == bpd->n_bpath_max)
bpd->bpath = g_realloc (bpd->bpath,
(bpd->n_bpath_max <<= 1) * sizeof (ArtBpath));
(bpd->n_bpath_max <<= 1) * sizeof (RsvgBpath));
bpath = bpd->bpath;
bpath[n_bpath].code = ART_MOVETO_OPEN;
bpath[n_bpath].code = RSVG_MOVETO_OPEN;
bpath[n_bpath].x3 = x;
bpath[n_bpath].y3 = y;
bpd->moveto_idx = n_bpath;
......@@ -119,7 +119,7 @@ rsvg_bpath_def_moveto (RsvgBpathDef *bpd, double x, double y)
void
rsvg_bpath_def_lineto (RsvgBpathDef *bpd, double x, double y)
{
ArtBpath *bpath;
RsvgBpath *bpath;
int n_bpath;
g_return_if_fail (bpd != NULL);
......@@ -129,9 +129,9 @@ rsvg_bpath_def_lineto (RsvgBpathDef *bpd, double x, double y)
if (n_bpath == bpd->n_bpath_max)
bpd->bpath = g_realloc (bpd->bpath,
(bpd->n_bpath_max <<= 1) * sizeof (ArtBpath));
(bpd->n_bpath_max <<= 1) * sizeof (RsvgBpath));
bpath = bpd->bpath;
bpath[n_bpath].code = ART_LINETO;
bpath[n_bpath].code = RSVG_LINETO;
bpath[n_bpath].x3 = x;
bpath[n_bpath].y3 = y;
}
......@@ -139,7 +139,7 @@ rsvg_bpath_def_lineto (RsvgBpathDef *bpd, double x, double y)
void
rsvg_bpath_def_curveto (RsvgBpathDef *bpd, double x1, double y1, double x2, double y2, double x3, double y3)
{
ArtBpath *bpath;
RsvgBpath *bpath;
int n_bpath;
g_return_if_fail (bpd != NULL);
......@@ -149,9 +149,9 @@ rsvg_bpath_def_curveto (RsvgBpathDef *bpd, double x1, double y1, double x2, doub
if (n_bpath == bpd->n_bpath_max)
bpd->bpath = g_realloc (bpd->bpath,
(bpd->n_bpath_max <<= 1) * sizeof (ArtBpath));
(bpd->n_bpath_max <<= 1) * sizeof (RsvgBpath));
bpath = bpd->bpath;
bpath[n_bpath].code = ART_CURVETO;
bpath[n_bpath].code = RSVG_CURVETO;
bpath[n_bpath].x1 = x1;
bpath[n_bpath].y1 = y1;
bpath[n_bpath].x2 = x2;
......@@ -163,14 +163,14 @@ rsvg_bpath_def_curveto (RsvgBpathDef *bpd, double x1, double y1, double x2, doub
static void
rsvg_bpath_def_replicate (RsvgBpathDef *bpd, int index)
{
ArtBpath *bpath;
RsvgBpath *bpath;
int n_bpath;
n_bpath = bpd->n_bpath++;
if (n_bpath == bpd->n_bpath_max)
bpd->bpath = g_realloc (bpd->bpath,
(bpd->n_bpath_max <<= 1) * sizeof (ArtBpath));
(bpd->n_bpath_max <<= 1) * sizeof (RsvgBpath));
bpath = bpd->bpath;
bpath[n_bpath] = bpath[index];
}
......@@ -178,7 +178,7 @@ rsvg_bpath_def_replicate (RsvgBpathDef *bpd, int index)
void
rsvg_bpath_def_closepath (RsvgBpathDef *bpd)
{
ArtBpath *bpath;
RsvgBpath *bpath;
int n_bpath;
g_return_if_fail (bpd != NULL);
......@@ -199,7 +199,7 @@ rsvg_bpath_def_closepath (RsvgBpathDef *bpd)
rsvg_bpath_def_replicate (bpd, bpd->moveto_idx);
bpath = bpd->bpath;
bpath[bpd->moveto_idx].code = ART_MOVETO;
bpath[bpd->moveto_idx].code = RSVG_MOVETO;
bpd->moveto_idx = -1;
}
......@@ -214,6 +214,6 @@ rsvg_bpath_def_art_finish (RsvgBpathDef *bpd)
if (n_bpath == bpd->n_bpath_max)
bpd->bpath = g_realloc (bpd->bpath,
(bpd->n_bpath_max <<= 1) * sizeof (ArtBpath));
bpd->bpath[n_bpath].code = ART_END;
(bpd->n_bpath_max <<= 1) * sizeof (RsvgBpath));
bpd->bpath[n_bpath].code = RSVG_END;
}
......@@ -27,21 +27,40 @@
#define RSVG_BPATH_UTIL_H
#include <glib/gtypes.h>
#include <libart_lgpl/art_bpath.h>
G_BEGIN_DECLS
typedef enum {
RSVG_MOVETO,
RSVG_MOVETO_OPEN,
RSVG_CURVETO,
RSVG_LINETO,
RSVG_END
} RsvgPathcode;
typedef struct _RsvgBpath RsvgBpath;
struct _RsvgBpath {
/*< public >*/
RsvgPathcode code;
double x1;
double y1;
double x2;
double y2;
double x3;
double y3;
};
typedef struct _RsvgBpathDef RsvgBpathDef;
struct _RsvgBpathDef {
ArtBpath *bpath;
RsvgBpath *bpath;
int n_bpath;
int n_bpath_max;
int moveto_idx;
};
RsvgBpathDef *rsvg_bpath_def_new (void);
RsvgBpathDef *rsvg_bpath_def_new_from (ArtBpath *bpath);
RsvgBpathDef *rsvg_bpath_def_new_from (RsvgBpath *bpath);
void rsvg_bpath_def_free (RsvgBpathDef *bpd);
......
......@@ -27,10 +27,10 @@
#include "rsvg-styles.h"
#include "rsvg-image.h"
#include "rsvg-css.h"
#include <libart_lgpl/art_rgba.h>
#include <string.h>
#include <math.h>
#include <rsvg-art-render.h>
#include <rsvg-art-composite.h>
......
......@@ -34,8 +34,6 @@
#include "rsvg-mask.h"
#include "rsvg-marker.h"
#include <libart_lgpl/art_svp_ops.h>
#define RSVG_DEFAULT_FONT "Times New Roman"
gdouble
......@@ -65,8 +63,8 @@ rsvg_state_init (RsvgState *state)
state->stroke_opacity = 0xff;
state->stroke_width = 1;
state->miter_limit = 4;
state->cap = ART_PATH_STROKE_CAP_BUTT;
state->join = ART_PATH_STROKE_JOIN_MITER;
state->cap = RSVG_PATH_STROKE_CAP_BUTT;
state->join = RSVG_PATH_STROKE_JOIN_MITER;
state->stop_opacity = 0xff;
state->fill_rule = FILL_RULE_NONZERO;
state->clip_rule = FILL_RULE_NONZERO;
......@@ -468,11 +466,11 @@ rsvg_parse_style_arg (RsvgHandle *ctx, RsvgState *state, const char *str)
{
state->has_cap = TRUE;
if (!strcmp (str + arg_off, "butt"))
state->cap = ART_PATH_STROKE_CAP_BUTT;
state->cap = RSVG_PATH_STROKE_CAP_BUTT;
else if (!strcmp (str + arg_off, "round"))
state->cap = ART_PATH_STROKE_CAP_ROUND;
state->cap = RSVG_PATH_STROKE_CAP_ROUND;
else if (!strcmp (str + arg_off, "square"))
state->cap = ART_PATH_STROKE_CAP_SQUARE;
state->cap = RSVG_PATH_STROKE_CAP_SQUARE;
else
g_warning (_("unknown line cap style %s\n"), str + arg_off);
}
......@@ -485,11 +483,11 @@ rsvg_parse_style_arg (RsvgHandle *ctx, RsvgState *state, const char *str)
{
state->has_join = TRUE;
if (!strcmp (str + arg_off, "miter"))
state->join = ART_PATH_STROKE_JOIN_MITER;
state->join = RSVG_PATH_STROKE_JOIN_MITER;
else if (!strcmp (str + arg_off, "round"))
state->join = ART_PATH_STROKE_JOIN_ROUND;
state->join = RSVG_PATH_STROKE_JOIN_ROUND;
else if (!strcmp (str + arg_off, "bevel"))
state->join = ART_PATH_STROKE_JOIN_BEVEL;
state->join = RSVG_PATH_STROKE_JOIN_BEVEL;
else
g_warning (_("unknown line join style %s\n"), str + arg_off);
}
......
......@@ -30,8 +30,6 @@
#include "rsvg-paint-server.h"
#include <libxml/SAX.h>
#include <libart_lgpl/art_svp_vpath_stroke.h>
#include <libart_lgpl/art_vpath_dash.h>
#include <pango/pango.h>
G_BEGIN_DECLS
......@@ -62,6 +60,30 @@ typedef enum {
UNICODE_BIDI_OVERRIDE = 2
} UnicodeBidi;
/* enums and data structures are ABI compatible with libart */
typedef enum {
RSVG_PATH_STROKE_JOIN_MITER,
RSVG_PATH_STROKE_JOIN_ROUND,
RSVG_PATH_STROKE_JOIN_BEVEL
} RsvgPathStrokeJoinType;
typedef enum {
RSVG_PATH_STROKE_CAP_BUTT,
RSVG_PATH_STROKE_CAP_ROUND,
RSVG_PATH_STROKE_CAP_SQUARE
} RsvgPathStrokeCapType;
typedef struct _RsvgVpathDash RsvgVpathDash;
struct _RsvgVpathDash {
double offset;
int n_dash;
double *dash;
};
/* end libart theft... */
struct _RsvgState {
double affine[6];
double personal_affine[6];
......@@ -91,9 +113,9 @@ struct _RsvgState {
double miter_limit;
gboolean has_miter_limit;
ArtPathStrokeCapType cap;
RsvgPathStrokeCapType cap;
gboolean has_cap;
ArtPathStrokeJoinType join;
RsvgPathStrokeJoinType join;
gboolean has_join;
double font_size;
......@@ -132,7 +154,7 @@ struct _RsvgState {
gboolean has_cond;
gboolean cond_true;
ArtVpathDash dash;
RsvgVpathDash dash;
gboolean has_dash;
guint32 current_color;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment