Commit 91c16170 authored by Hiroyuki Ikezoe's avatar Hiroyuki Ikezoe

set proper mode-line and fix indent.

parent d81104d5
/* vim: set sw=4 sts=4: -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 sts=4 ts=4 expandtab: */
/*
rsvg-shapes.c: Draw shapes with cairo
......@@ -47,29 +48,29 @@ struct RsvgCairoClipRender {
static void
rsvg_cairo_clip_apply_affine (RsvgCairoClipRender *render, const double affine[6])
{
cairo_matrix_t matrix;
gboolean nest = render->cr != render->parent->initial_cr;
cairo_matrix_init (&matrix,
affine[0], affine[1],
affine[2], affine[3],
affine[4] + (nest ? 0 : render->parent->offset_x),
affine[5] + (nest ? 0 : render->parent->offset_y));
cairo_set_matrix (render->cr, &matrix);
cairo_matrix_t matrix;
gboolean nest = render->cr != render->parent->initial_cr;
cairo_matrix_init (&matrix,
affine[0], affine[1],
affine[2], affine[3],
affine[4] + (nest ? 0 : render->parent->offset_x),
affine[5] + (nest ? 0 : render->parent->offset_y));
cairo_set_matrix (render->cr, &matrix);
}
static void
rsvg_cairo_clip_render_path (RsvgDrawingCtx * ctx, const RsvgBpathDef * bpath_def)
{
RsvgCairoClipRender *render = (RsvgCairoClipRender *) ctx->render;
RsvgState *state = rsvg_state_current (ctx);
RsvgState *state = rsvg_state_current (ctx);
cairo_t *cr;
RsvgBpath *bpath;
int i;
cr = render->cr;
rsvg_cairo_clip_apply_affine (render, state->affine);
rsvg_cairo_clip_apply_affine (render, state->affine);
if (rsvg_state_current (ctx)->clip_rule == FILL_RULE_EVENODD)
cairo_set_fill_rule (((RsvgCairoRender *) ctx->render)->cr, CAIRO_FILL_RULE_EVEN_ODD);
......
/* vim: set sw=4 sts=4: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 sts=4 ts=4 expandtab: */
/*
rsvg-cairo-render.h: The cairo backend plugin
......
/* vim: set sw=4 sts=4: -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 sts=4 ts=4 expandtab: */
/*
rsvg-shapes.c: Draw shapes with cairo
......@@ -44,27 +45,27 @@
static void
_rsvg_cairo_set_shape_antialias (cairo_t * cr, ShapeRenderingProperty aa)
{
if (SHAPE_RENDERING_AUTO == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
else if (SHAPE_RENDERING_OPTIMIZE_SPEED == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
else if (SHAPE_RENDERING_CRISP_EDGES == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
else if (SHAPE_RENDERING_GEOMETRIC_PRECISION == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
if (SHAPE_RENDERING_AUTO == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
else if (SHAPE_RENDERING_OPTIMIZE_SPEED == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
else if (SHAPE_RENDERING_CRISP_EDGES == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
else if (SHAPE_RENDERING_GEOMETRIC_PRECISION == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
}
static void
_rsvg_cairo_set_text_antialias (cairo_t * cr, TextRenderingProperty aa)
{
if (TEXT_RENDERING_AUTO == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
else if (TEXT_RENDERING_OPTIMIZE_SPEED == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
else if (TEXT_RENDERING_OPTIMIZE_LEGIBILITY == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
else if (TEXT_RENDERING_GEOMETRIC_PRECISION == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
if (TEXT_RENDERING_AUTO == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
else if (TEXT_RENDERING_OPTIMIZE_SPEED == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
else if (TEXT_RENDERING_OPTIMIZE_LEGIBILITY == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
else if (TEXT_RENDERING_GEOMETRIC_PRECISION == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
}
static void
......@@ -107,8 +108,8 @@ _rsvg_cairo_set_operator (cairo_t * cr, RsvgCompOpType comp_op)
op = CAIRO_OPERATOR_XOR;
break;
case RSVG_COMP_OP_PLUS:
op = CAIRO_OPERATOR_ADD;
break;
op = CAIRO_OPERATOR_ADD;
break;
case RSVG_COMP_OP_MULTIPLY:
case RSVG_COMP_OP_SCREEN:
case RSVG_COMP_OP_OVERLAY:
......@@ -513,7 +514,7 @@ rsvg_cairo_render_pango_layout (RsvgDrawingCtx * ctx, PangoLayout * layout, doub
state->stroke_opacity,
bbox, rsvg_state_current (ctx)->current_color);
cairo_set_line_width (render->cr, _rsvg_css_normalize_length (&state->stroke_width, ctx, 'h'));
cairo_set_line_width (render->cr, _rsvg_css_normalize_length (&state->stroke_width, ctx, 'h'));
cairo_stroke (render->cr);
}
}
......@@ -741,19 +742,19 @@ rsvg_cairo_render_image (RsvgDrawingCtx * ctx, const GdkPixbuf * pixbuf,
#if 1
cairo_set_source_surface (render->cr, surface, pixbuf_x, pixbuf_y);
#else
{
cairo_pattern_t *pattern;
cairo_matrix_t matrix;
{
cairo_pattern_t *pattern;
cairo_matrix_t matrix;
pattern = cairo_pattern_create_for_surface (surface);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);
pattern = cairo_pattern_create_for_surface (surface);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);
cairo_matrix_init_translate (&matrix, -pixbuf_x, -pixbuf_y);
cairo_pattern_set_matrix (pattern, &matrix);
cairo_matrix_init_translate (&matrix, -pixbuf_x, -pixbuf_y);
cairo_pattern_set_matrix (pattern, &matrix);
cairo_set_source (render->cr, pattern);
cairo_pattern_destroy (pattern);
}
cairo_set_source (render->cr, pattern);
cairo_pattern_destroy (pattern);
}
#endif
cairo_paint (render->cr);
......@@ -1082,8 +1083,8 @@ rsvg_cairo_get_image_of_node (RsvgDrawingCtx * ctx,
rsvg_node_draw (drawable, ctx, 0);
rsvg_state_pop (ctx);
/* no colorspace conversion necessary. this is just a convenient
holder of ARGB data with a width, height, & stride */
/* no colorspace conversion necessary. this is just a convenient
holder of ARGB data with a width, height, & stride */
img = gdk_pixbuf_new_from_data (pixels,
GDK_COLORSPACE_RGB,
TRUE,
......
/* vim: set sw=4 sts=4: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 sts=4 ts=4 expandtab: */
/*
rsvg-shapes.c: Draw shapes with libart
......@@ -31,23 +32,23 @@
G_BEGIN_DECLS
PangoContext *rsvg_cairo_create_pango_context (RsvgDrawingCtx *ctx);
void rsvg_cairo_render_pango_layout (RsvgDrawingCtx *ctx, PangoLayout *layout,
double x, double y);
void rsvg_cairo_render_path (RsvgDrawingCtx *ctx,
const RsvgBpathDef * path);
void rsvg_cairo_render_image (RsvgDrawingCtx *ctx, const GdkPixbuf * img,
double x, double y, double w, double h);
void rsvg_cairo_push_discrete_layer (RsvgDrawingCtx *ctx);
void rsvg_cairo_pop_discrete_layer (RsvgDrawingCtx *ctx);
void rsvg_cairo_add_clipping_rect (RsvgDrawingCtx *ctx,
double x, double y, double width, double height);
GdkPixbuf *rsvg_cairo_get_image_of_node (RsvgDrawingCtx *ctx, RsvgNode *drawable,
double width, double height);
void rsvg_cairo_to_pixbuf (guint8 * pixels, int rowstride, int height);
void rsvg_pixbuf_to_cairo (guint8 * pixels, int rowstride, int height);
PangoContext *rsvg_cairo_create_pango_context (RsvgDrawingCtx *ctx);
void rsvg_cairo_render_pango_layout (RsvgDrawingCtx *ctx, PangoLayout *layout,
double x, double y);
void rsvg_cairo_render_path (RsvgDrawingCtx *ctx,
const RsvgBpathDef * path);
void rsvg_cairo_render_image (RsvgDrawingCtx *ctx, const GdkPixbuf * img,
double x, double y, double w, double h);
void rsvg_cairo_push_discrete_layer (RsvgDrawingCtx *ctx);
void rsvg_cairo_pop_discrete_layer (RsvgDrawingCtx *ctx);
void rsvg_cairo_add_clipping_rect (RsvgDrawingCtx *ctx,
double x, double y, double width, double height);
GdkPixbuf *rsvg_cairo_get_image_of_node (RsvgDrawingCtx *ctx, RsvgNode *drawable,
double width, double height);
void rsvg_cairo_to_pixbuf (guint8 * pixels, int rowstride, int height);
void rsvg_pixbuf_to_cairo (guint8 * pixels, int rowstride, int height);
G_END_DECLS
......
/* vim: set sw=4 sts=4: -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 sts=4 ts=4 expandtab: */
/*
rsvg-cairo-render.c: The cairo backend plugin
......@@ -211,10 +212,10 @@ rsvg_handle_render_cairo_sub (RsvgHandle * handle, cairo_t * cr, const char *id)
if (id && *id)
drawsub = rsvg_defs_lookup (handle->priv->defs, id);
if (drawsub == NULL && id != NULL) {
/* todo: there's no way to signal that @id doesn't exist */
return FALSE;
}
if (drawsub == NULL && id != NULL) {
/* todo: there's no way to signal that @id doesn't exist */
return FALSE;
}
draw = rsvg_cairo_new_drawing_ctx (cr, handle);
if (!draw)
......@@ -234,7 +235,7 @@ rsvg_handle_render_cairo_sub (RsvgHandle * handle, cairo_t * cr, const char *id)
rsvg_state_pop (draw);
rsvg_drawing_ctx_free (draw);
return TRUE;
return TRUE;
}
/**
......
/* vim: set sw=4 sts=4: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 sts=4 ts=4 expandtab: */
/*
rsvg-cairo-render.h: The cairo backend plugin
......@@ -50,8 +51,8 @@ struct _RsvgCairoRender {
};
RsvgCairoRender *rsvg_cairo_render_new (cairo_t * cr, double width, double height);
void rsvg_cairo_render_rsvg_handle (cairo_t * cr, RsvgHandle * handle);
RsvgDrawingCtx *rsvg_cairo_new_drawing_ctx (cairo_t * cr, RsvgHandle * handle);
void rsvg_cairo_render_rsvg_handle (cairo_t * cr, RsvgHandle * handle);
RsvgDrawingCtx *rsvg_cairo_new_drawing_ctx (cairo_t * cr, RsvgHandle * handle);
G_END_DECLS
......
/* vim: set sw=4 sts=4: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 sts=4 ts=4 expandtab: */
/*
rsvg-cairo.h: SAX-based renderer for SVG files using cairo
......@@ -29,8 +30,8 @@
G_BEGIN_DECLS
gboolean rsvg_handle_render_cairo (RsvgHandle * handle, cairo_t * cr);
gboolean rsvg_handle_render_cairo_sub (RsvgHandle * handle, cairo_t * cr, const char *id);
gboolean rsvg_handle_render_cairo (RsvgHandle * handle, cairo_t * cr);
gboolean rsvg_handle_render_cairo_sub (RsvgHandle * handle, cairo_t * cr, const char *id);
G_END_DECLS
......
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