[librsvg] set proper mode-line and fix indent.
- From: Hiroyuki Ikezoe <hiikezoe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] set proper mode-line and fix indent.
- Date: Tue, 27 Apr 2010 11:43:25 +0000 (UTC)
commit 9b5fe34c5d5cf2f8f31bef66d76c345abd0ff01c
Author: Hiroyuki Ikezoe <hiikezoe gnome org>
Date: Tue Apr 27 20:43:12 2010 +0900
set proper mode-line and fix indent.
rsvg-bpath-util.c | 3 +-
rsvg-bpath-util.h | 21 ++++----
rsvg-image.c | 33 +++++++------
rsvg-image.h | 3 +-
rsvg-path.c | 134 ++++++++++++++++++++++++++--------------------------
rsvg-path.h | 3 +-
6 files changed, 101 insertions(+), 96 deletions(-)
---
diff --git a/rsvg-bpath-util.c b/rsvg-bpath-util.c
index 2f35e1f..e330a21 100644
--- a/rsvg-bpath-util.c
+++ b/rsvg-bpath-util.c
@@ -1,4 +1,5 @@
-/* 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-bpath-util.c: Data structure and convenience functions for creating bezier paths.
diff --git a/rsvg-bpath-util.h b/rsvg-bpath-util.h
index e531f12..8a84d77 100644
--- a/rsvg-bpath-util.h
+++ b/rsvg-bpath-util.h
@@ -1,4 +1,5 @@
-/* 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-bpath-util.h: Path utility functions
@@ -58,18 +59,18 @@ struct _RsvgBpathDef {
int moveto_idx;
};
-RsvgBpathDef *rsvg_bpath_def_new (void);
-RsvgBpathDef *rsvg_bpath_def_new_from (RsvgBpath * bpath);
+RsvgBpathDef *rsvg_bpath_def_new (void);
+RsvgBpathDef *rsvg_bpath_def_new_from (RsvgBpath * bpath);
-void rsvg_bpath_def_free (RsvgBpathDef * bpd);
+void rsvg_bpath_def_free (RsvgBpathDef * bpd);
-void rsvg_bpath_def_moveto (RsvgBpathDef * bpd, double x, double y);
-void 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);
-void rsvg_bpath_def_closepath (RsvgBpathDef * bpd);
+void rsvg_bpath_def_moveto (RsvgBpathDef * bpd, double x, double y);
+void 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);
+void rsvg_bpath_def_closepath (RsvgBpathDef * bpd);
-void rsvg_bpath_def_art_finish (RsvgBpathDef * bpd);
+void rsvg_bpath_def_art_finish (RsvgBpathDef * bpd);
G_END_DECLS
diff --git a/rsvg-image.c b/rsvg-image.c
index c91f666..3cd809b 100644
--- a/rsvg-image.c
+++ b/rsvg-image.c
@@ -1,4 +1,5 @@
-/* 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-image.c: Image loading and displaying
@@ -228,17 +229,17 @@ rsvg_get_file_path (const gchar * filename, const gchar * base_uri)
absolute_filename = g_strdup (filename);
} else {
gchar *tmpcdir;
- gchar *base_filename;
+ gchar *base_filename;
if (base_uri) {
- base_filename = g_filename_from_uri (base_uri, NULL, NULL);
- if (base_filename != NULL) {
- tmpcdir = g_path_get_dirname (base_filename);
- g_free (base_filename);
- } else
- return NULL;
- } else
- tmpcdir = g_get_current_dir ();
+ base_filename = g_filename_from_uri (base_uri, NULL, NULL);
+ if (base_filename != NULL) {
+ tmpcdir = g_path_get_dirname (base_filename);
+ g_free (base_filename);
+ } else
+ return NULL;
+ } else
+ tmpcdir = g_get_current_dir ();
absolute_filename = g_build_filename (tmpcdir, filename, NULL);
g_free (tmpcdir);
@@ -261,7 +262,7 @@ rsvg_acquire_file_resource (const char *filename, const char *base_uri, GError *
path = rsvg_get_file_path (filename, base_uri);
if (path == NULL)
- return NULL;
+ return NULL;
f = fopen (path, "rb");
g_free (path);
@@ -328,19 +329,19 @@ rsvg_acquire_vfs_resource (const char *filename, const char *base_uri, GError **
if (base_uri != NULL) {
GFile *base;
- rsvg_free_error(error);
-
- g_object_unref (file);
+ rsvg_free_error (error);
+
+ g_object_unref (file);
base = g_file_new_for_uri (base_uri);
file = g_file_resolve_relative_path (base, filename);
g_object_unref (base);
- res = g_file_load_contents (file, NULL, &data, &size, NULL, error);
+ res = g_file_load_contents (file, NULL, &data, &size, NULL, error);
}
}
- g_object_unref (file);
+ g_object_unref (file);
if (res) {
array = g_byte_array_new ();
diff --git a/rsvg-image.h b/rsvg-image.h
index 273d2c7..1971e6d 100644
--- a/rsvg-image.h
+++ b/rsvg-image.h
@@ -1,4 +1,5 @@
-/* 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-image.h: Image loading and displaying
diff --git a/rsvg-path.c b/rsvg-path.c
index 8be9177..46c228a 100644
--- a/rsvg-path.c
+++ b/rsvg-path.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim: set sw=4 sts=4 ts=4 expandtab: */
/*
rsvg-path.c: Parse SVG path element data into bezier path.
@@ -81,11 +83,11 @@ rsvg_path_arc_segment (RSVGParsePathCtx * ctx,
rsvg_bpath_def_curveto (ctx->bpath,
xc + cosf*x1 - sinf*y1,
- yc + sinf*x1 + cosf*y1,
+ yc + sinf*x1 + cosf*y1,
xc + cosf*x2 - sinf*y2,
- yc + sinf*x2 + cosf*y2,
+ yc + sinf*x2 + cosf*y2,
xc + cosf*x3 - sinf*y3,
- yc + sinf*x3 + cosf*y3);
+ yc + sinf*x3 + cosf*y3);
}
/**
@@ -106,18 +108,18 @@ rsvg_path_arc (RSVGParsePathCtx * ctx,
int large_arc_flag, int sweep_flag, double x, double y)
{
- /* See Appendix F.6 Elliptical arc implementation notes
- http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes */
+ /* See Appendix F.6 Elliptical arc implementation notes
+ http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes */
- double f, sinf, cosf;
- double x1, y1, x2, y2;
- double x1_, y1_;
- double cx_, cy_, cx, cy;
- double gamma;
- double theta1, delta_theta;
- double k1, k2, k3, k4, k5;
+ double f, sinf, cosf;
+ double x1, y1, x2, y2;
+ double x1_, y1_;
+ double cx_, cy_, cx, cy;
+ double gamma;
+ double theta1, delta_theta;
+ double k1, k2, k3, k4, k5;
- int i, n_segs;
+ int i, n_segs;
/* Start and end of path segment */
x1 = ctx->cpx;
@@ -127,7 +129,7 @@ rsvg_path_arc (RSVGParsePathCtx * ctx,
y2 = y;
if(x1 == x2 && y1 == y2)
- return;
+ return;
/* X-axis */
f = x_axis_rotation * M_PI / 180.0;
@@ -136,11 +138,10 @@ rsvg_path_arc (RSVGParsePathCtx * ctx,
/* Check the radius against floading point underflow.
See http://bugs.debian.org/508443 */
- if ((fabs(rx) < DBL_EPSILON) || (fabs(ry) < DBL_EPSILON))
- {
- rsvg_bpath_def_lineto (ctx->bpath, x, y);
+ if ((fabs(rx) < DBL_EPSILON) || (fabs(ry) < DBL_EPSILON)) {
+ rsvg_bpath_def_lineto (ctx->bpath, x, y);
return;
- }
+ }
if(rx < 0)rx = -rx;
if(ry < 0)ry = -ry;
@@ -152,21 +153,20 @@ rsvg_path_arc (RSVGParsePathCtx * ctx,
y1_ = -sinf * k1 + cosf * k2;
gamma = (x1_*x1_)/(rx*rx) + (y1_*y1_)/(ry*ry);
- if(gamma > 1)
- {
- rx *= sqrt(gamma);
- ry *= sqrt(gamma);
- }
+ if (gamma > 1) {
+ rx *= sqrt(gamma);
+ ry *= sqrt(gamma);
+ }
/* Compute the center */
k1 = rx*rx*y1_*y1_ + ry*ry*x1_*x1_;
if(k1 == 0)
- return;
+ return;
k1 = sqrt(fabs((rx*rx*ry*ry)/k1 - 1));
if(sweep_flag == large_arc_flag)
- k1 = -k1;
+ k1 = -k1;
cx_ = k1*rx*y1_/ry;
cy_ = -k1*ry*x1_/rx;
@@ -202,19 +202,19 @@ rsvg_path_arc (RSVGParsePathCtx * ctx,
if(k1*k4 - k3*k2 < 0)delta_theta = -delta_theta;
if(sweep_flag && delta_theta < 0)
- delta_theta += M_PI*2;
+ delta_theta += M_PI*2;
else if(!sweep_flag && delta_theta > 0)
- delta_theta -= M_PI*2;
+ delta_theta -= M_PI*2;
/* Now draw the arc */
n_segs = ceil (fabs (delta_theta / (M_PI * 0.5 + 0.001)));
for (i = 0; i < n_segs; i++)
- rsvg_path_arc_segment (ctx, cx, cy,
- theta1 + i * delta_theta / n_segs,
- theta1 + (i + 1) * delta_theta / n_segs,
- rx, ry, x_axis_rotation);
+ rsvg_path_arc_segment (ctx, cx, cy,
+ theta1 + i * delta_theta / n_segs,
+ theta1 + (i + 1) * delta_theta / n_segs,
+ rx, ry, x_axis_rotation);
ctx->cpx = x;
ctx->cpy = y;
@@ -409,40 +409,40 @@ rsvg_path_end_of_number (RSVGParsePathCtx * ctx, double val, int sign, int exp_s
{
val *= sign * pow (10, exp_sign * exp);
if (ctx->rel) {
- /* Handle relative coordinates. This switch statement attempts
- to determine _what_ the coords are relative to. This is
- underspecified in the 12 Apr working draft. */
- switch (ctx->cmd) {
- case 'l':
- case 'm':
- case 'c':
- case 's':
- case 'q':
- case 't':
- /* rule: even-numbered params are x-relative, odd-numbered
- are y-relative */
- if ((ctx->param & 1) == 0)
- val += ctx->cpx;
- else if ((ctx->param & 1) == 1)
- val += ctx->cpy;
- break;
- case 'a':
- /* rule: sixth and seventh are x and y, rest are not
- relative */
- if (ctx->param == 5)
- val += ctx->cpx;
- else if (ctx->param == 6)
- val += ctx->cpy;
- break;
- case 'h':
- /* rule: x-relative */
- val += ctx->cpx;
- break;
- case 'v':
- /* rule: y-relative */
- val += ctx->cpy;
- break;
- }
+ /* Handle relative coordinates. This switch statement attempts
+ to determine _what_ the coords are relative to. This is
+ underspecified in the 12 Apr working draft. */
+ switch (ctx->cmd) {
+ case 'l':
+ case 'm':
+ case 'c':
+ case 's':
+ case 'q':
+ case 't':
+ /* rule: even-numbered params are x-relative, odd-numbered
+ are y-relative */
+ if ((ctx->param & 1) == 0)
+ val += ctx->cpx;
+ else if ((ctx->param & 1) == 1)
+ val += ctx->cpy;
+ break;
+ case 'a':
+ /* rule: sixth and seventh are x and y, rest are not
+ relative */
+ if (ctx->param == 5)
+ val += ctx->cpx;
+ else if (ctx->param == 6)
+ val += ctx->cpy;
+ break;
+ case 'h':
+ /* rule: x-relative */
+ val += ctx->cpx;
+ break;
+ case 'v':
+ /* rule: y-relative */
+ val += ctx->cpy;
+ break;
+ }
}
ctx->params[ctx->param++] = val;
rsvg_parse_path_do_cmd (ctx, FALSE);
@@ -515,8 +515,8 @@ rsvg_parse_path_data (RSVGParsePathCtx * ctx, const char *data)
exp_sign = c == '+' ? 1 : -1;
} else if (in_num) {
/* end of number */
- rsvg_path_end_of_number(ctx, val, sign, exp_sign, exp);
- in_num = FALSE;
+ rsvg_path_end_of_number(ctx, val, sign, exp_sign, exp);
+ in_num = FALSE;
}
if (c == '\0')
diff --git a/rsvg-path.h b/rsvg-path.h
index 7560107..df4f50d 100644
--- a/rsvg-path.h
+++ b/rsvg-path.h
@@ -1,4 +1,5 @@
-/* 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-path.h: Draw SVG paths
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]