[dia/zbrown/test-build: 1/7] enums: move LineStyle into the Dia namespace
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia/zbrown/test-build: 1/7] enums: move LineStyle into the Dia namespace
- Date: Mon, 27 Sep 2021 08:21:39 +0000 (UTC)
commit 4ff2148188658d3d0be2d123a2978f4d6697c863
Author: Zander Brown <zbrown gnome org>
Date: Sun Sep 26 02:40:12 2021 +0100
enums: move LineStyle into the Dia namespace
Now we can generate a GType for it
app/connectionpoint_ops.c | 2 +-
app/grid.c | 14 ++---
app/handle_ops.c | 2 +-
app/toolbox.c | 29 +++++-----
lib/arrows.c | 44 +++++++--------
lib/attributes.c | 6 +--
lib/attributes.h | 26 ++++-----
lib/bezier-common.c | 2 +-
lib/dia-enums.h | 45 ++++++++++++----
lib/dia-line-cell-renderer.c | 16 +++---
lib/dia-line-chooser.c | 16 +++---
lib/dia-line-chooser.h | 8 +--
lib/dia-line-preview.c | 21 ++++----
lib/dia-line-preview.h | 4 +-
lib/dia-line-style-selector.c | 22 ++++----
lib/dia-line-style-selector.h | 4 +-
lib/dia_svg.c | 90 ++++++++++++++++++-------------
lib/dia_svg.h | 2 +-
lib/diaimportrenderer.c | 8 +--
lib/diaimportrenderer.h | 9 ++--
lib/diapathrenderer.c | 6 ++-
lib/diarenderer.c | 19 ++++---
lib/diarenderer.h | 8 +--
lib/diasvgrenderer.c | 87 +++++++++++++++---------------
lib/diatransformrenderer.c | 9 ++--
lib/meson.build | 1 +
lib/prop_attr.c | 27 ++++++----
lib/prop_attr.h | 19 ++++---
lib/properties.h | 7 ++-
lib/proplist.c | 12 +++--
lib/renderer/diacairo-renderer.c | 21 ++++----
lib/standard-path.c | 6 +--
lib/text.c | 2 +-
objects/AADL/aadl.h | 10 ++--
objects/AADL/aadlbus.c | 2 +-
objects/AADL/aadldata.c | 2 +-
objects/AADL/aadldevice.c | 2 +-
objects/AADL/aadlmemory.c | 2 +-
objects/AADL/aadlpackage.c | 2 +-
objects/AADL/aadlport.c | 18 +++----
objects/AADL/aadlprocess.c | 10 ++--
objects/AADL/aadlprocessor.c | 2 +-
objects/AADL/aadlsubprogram.c | 2 +-
objects/AADL/aadlsystem.c | 12 ++---
objects/AADL/aadlthread.c | 17 +++---
objects/AADL/aadlthreadgroup.c | 15 +++---
objects/Database/database.h | 20 +++----
objects/Database/table.c | 2 +-
objects/ER/attribute.c | 8 +--
objects/ER/entity.c | 4 +-
objects/ER/participation.c | 2 +-
objects/ER/relationship.c | 2 +-
objects/FS/flow-ortho.c | 6 +--
objects/FS/flow.c | 6 +--
objects/FS/function.c | 4 +-
objects/GRAFCET/action.c | 2 +-
objects/GRAFCET/action_text_draw.c | 2 +-
objects/GRAFCET/boolequation.c | 2 +-
objects/GRAFCET/condition.c | 2 +-
objects/GRAFCET/step.c | 2 +-
objects/GRAFCET/transition.c | 2 +-
objects/GRAFCET/vector.c | 2 +-
objects/GRAFCET/vergent.c | 2 +-
objects/Istar/goal.c | 2 +-
objects/Istar/link.c | 2 +-
objects/Istar/other.c | 2 +-
objects/Jackson/domain.c | 2 +-
objects/Jackson/phenomenon.c | 6 ++-
objects/Jackson/requirement.c | 2 +-
objects/KAOS/goal.c | 2 +-
objects/KAOS/metaandorrel.c | 10 +++-
objects/KAOS/metabinrel.c | 2 +-
objects/KAOS/other.c | 2 +-
objects/Misc/analog_clock.c | 2 +-
objects/Misc/grid_object.c | 2 +-
objects/Misc/measure.c | 2 +-
objects/Misc/n_gon.c | 6 +--
objects/Misc/tree.c | 2 +-
objects/SADT/annotation.c | 2 +-
objects/SADT/arrow.c | 2 +-
objects/SADT/box.c | 2 +-
objects/UML/activity.c | 2 +-
objects/UML/actor.c | 2 +-
objects/UML/association.c | 2 +-
objects/UML/branch.c | 2 +-
objects/UML/class.c | 4 +-
objects/UML/classicon.c | 2 +-
objects/UML/component.c | 2 +-
objects/UML/component_feature.c | 2 +-
objects/UML/constraint.c | 2 +-
objects/UML/dependency.c | 4 +-
objects/UML/fork.c | 2 +-
objects/UML/generalization.c | 2 +-
objects/UML/implements.c | 2 +-
objects/UML/large_package.c | 2 +-
objects/UML/lifeline.c | 6 ++-
objects/UML/message.c | 6 ++-
objects/UML/node.c | 2 +-
objects/UML/note.c | 2 +-
objects/UML/object.c | 2 +-
objects/UML/realizes.c | 2 +-
objects/UML/small_package.c | 2 +-
objects/UML/state.c | 2 +-
objects/UML/state_term.c | 2 +-
objects/UML/transition.c | 2 +-
objects/UML/usecase.c | 4 +-
objects/chronogram/chronoline.c | 6 +--
objects/chronogram/chronoref.c | 2 +-
objects/custom/custom_object.c | 66 ++++++++++++++++-------
objects/custom/shape_info.c | 11 +++-
objects/custom_lines/line_info.c | 36 +++++++------
objects/custom_lines/line_info.h | 16 +++---
objects/flowchart/box.c | 16 +++---
objects/flowchart/diamond.c | 28 +++++-----
objects/flowchart/ellipse.c | 28 +++++-----
objects/flowchart/parallelogram.c | 30 ++++++-----
objects/network/basestation.c | 2 +-
objects/network/bus.c | 2 +-
objects/network/radiocell.c | 12 ++---
objects/network/wanlink.c | 2 +-
objects/standard/arc.c | 21 ++++----
objects/standard/bezier.c | 22 ++++----
objects/standard/beziergon.c | 12 ++---
objects/standard/box.c | 18 +++----
objects/standard/ellipse.c | 12 ++---
objects/standard/image.c | 18 +++----
objects/standard/line.c | 16 +++---
objects/standard/outline.c | 2 +-
objects/standard/polygon.c | 12 ++---
objects/standard/polyline.c | 8 +--
objects/standard/zigzagline.c | 8 +--
plug-ins/cgm/cgm.c | 53 +++++++++---------
plug-ins/drs/dia-render-script-import.c | 34 +++++++-----
plug-ins/drs/dia-render-script-renderer.c | 16 +++---
plug-ins/dxf/dxf-export.c | 18 +++----
plug-ins/dxf/dxf-import.c | 72 +++++++++++++------------
plug-ins/hpgl/hpgl.c | 46 ++++++++--------
plug-ins/metapost/render_metapost.c | 33 ++++++------
plug-ins/metapost/render_metapost.h | 5 +-
plug-ins/pdf/pdf-import.cpp | 28 +++++-----
plug-ins/pgf/render_pgf.c | 33 ++++++------
plug-ins/postscript/diapsrenderer.c | 24 ++++-----
plug-ins/pstricks/render_pstricks.c | 70 ++++++++++++------------
plug-ins/python/diasvg.py | 2 +-
plug-ins/python/diasvg_import.py | 10 ++--
plug-ins/python/pydia-render.c | 16 +++---
plug-ins/svg/svg-import.c | 9 ++--
plug-ins/vdx/vdx-export.c | 42 +++++++--------
plug-ins/vdx/vdx-import.c | 81 +++++++++++++++-------------
plug-ins/wmf/wmf.cpp | 66 ++++++++++++-----------
plug-ins/wpg/wpg-import.c | 24 ++++++---
plug-ins/wpg/wpg.c | 48 +++++++++--------
plug-ins/xfig/xfig-export.c | 30 +++++------
plug-ins/xfig/xfig-import.c | 28 +++++-----
154 files changed, 1132 insertions(+), 938 deletions(-)
---
diff --git a/app/connectionpoint_ops.c b/app/connectionpoint_ops.c
index fa406cd39..e996e7e56 100644
--- a/app/connectionpoint_ops.c
+++ b/app/connectionpoint_ops.c
@@ -64,7 +64,7 @@ object_draw_connectionpoints (DiaObject *obj, DDisplay *ddisp)
/* this does not change for any of the points */
dia_renderer_set_linewidth (renderer, 0.0);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
/* optimization to only draw the connection points at all if the size
* of the object (bounding box) is bigger than the summed size of the
diff --git a/app/grid.c b/app/grid.c
index 4ca2a60d3..2a316eb4e 100644
--- a/app/grid.c
+++ b/app/grid.c
@@ -120,9 +120,9 @@ grid_draw_horizontal_lines(DDisplay *ddisp, DiaRectangle *update, real length)
while (y < height) {
if (major_lines) {
if (major_count == 0) {
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
} else {
- dia_renderer_set_linestyle (renderer, LINESTYLE_DOTTED,
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DOTTED,
ddisplay_untransform_length (ddisp, 31));
}
major_count = (major_count + 1) % major_lines;
@@ -162,11 +162,11 @@ grid_draw_vertical_lines (DDisplay *ddisp, DiaRectangle *update, real length)
if (major_lines) {
if (major_count == 0) {
dia_renderer_set_linestyle (renderer,
- LINESTYLE_SOLID,
+ DIA_LINE_STYLE_SOLID,
0.0);
} else {
dia_renderer_set_linestyle (renderer,
- LINESTYLE_DOTTED,
+ DIA_LINE_STYLE_DOTTED,
ddisplay_untransform_length (ddisp, 31));
}
major_count = (major_count + 1) % major_lines;
@@ -352,9 +352,9 @@ pagebreak_draw (DDisplay *ddisp, DiaRectangle *update)
dia_renderer_set_linewidth (renderer, 0.0);
if (prefs.pagebreak.solid) {
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
} else {
- dia_renderer_set_linestyle (renderer, LINESTYLE_DOTTED,
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DOTTED,
ddisplay_untransform_length (ddisp, 31));
}
@@ -406,7 +406,7 @@ guidelines_draw (DDisplay *ddisp, DiaRectangle *update)
line_width = ddisplay_untransform_length (ddisp, 2);
dia_renderer_set_linewidth (renderer, line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
if (ddisp->guides_visible) {
list = dia->guides;
diff --git a/app/handle_ops.c b/app/handle_ops.c
index 5c12e086b..a5656f162 100644
--- a/app/handle_ops.c
+++ b/app/handle_ops.c
@@ -67,7 +67,7 @@ handle_draw (Handle *handle, DDisplay *ddisp)
}
dia_renderer_set_linewidth (renderer, 0.0);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
diff --git a/app/toolbox.c b/app/toolbox.c
index ef6f6f2c8..7c3a90109 100644
--- a/app/toolbox.c
+++ b/app/toolbox.c
@@ -828,20 +828,25 @@ change_end_arrow_style(Arrow arrow, gpointer user_data)
{
attributes_set_default_end_arrow(arrow);
}
+
+
static void
-change_line_style(LineStyle lstyle, real dash_length, gpointer user_data)
+change_line_style (DiaLineStyle lstyle,
+ double dash_length,
+ gpointer user_data)
{
- attributes_set_default_line_style(lstyle, dash_length);
+ attributes_set_default_line_style (lstyle, dash_length);
}
+
static void
-create_lineprops_area(GtkWidget *parent)
+create_lineprops_area (GtkWidget *parent)
{
GtkWidget *chooser;
Arrow arrow;
- real dash_length;
- LineStyle style;
- gchar *arrow_name;
+ double dash_length;
+ DiaLineStyle style;
+ char *arrow_name;
chooser = dia_arrow_chooser_new(TRUE, change_start_arrow_style, NULL);
gtk_wrap_box_pack_wrapped(GTK_WRAP_BOX(parent), chooser, FALSE, TRUE, FALSE, TRUE, TRUE);
@@ -855,13 +860,13 @@ create_lineprops_area(GtkWidget *parent)
gtk_widget_set_tooltip_text(chooser, _("Arrow style at the beginning of new lines. Click to pick an
arrow, or set arrow parameters with Details…"));
gtk_widget_show(chooser);
- chooser = dia_line_chooser_new(change_line_style, NULL);
- gtk_wrap_box_pack(GTK_WRAP_BOX(parent), chooser, TRUE, TRUE, FALSE, TRUE);
+ chooser = dia_line_chooser_new (change_line_style, NULL);
+ gtk_wrap_box_pack (GTK_WRAP_BOX (parent), chooser, TRUE, TRUE, FALSE, TRUE);
gtk_widget_set_tooltip_text (chooser, _("Line style for new lines. Click to pick a line style, or set
line style parameters with Details…"));
- style = persistence_register_integer("line-style", LINESTYLE_SOLID);
- dash_length = persistence_register_real("dash-length", DEFAULT_LINESTYLE_DASHLEN);
- dia_line_chooser_set_line_style(DIA_LINE_CHOOSER(chooser), style, dash_length);
- gtk_widget_show(chooser);
+ style = persistence_register_integer ("line-style", DIA_LINE_STYLE_SOLID);
+ dash_length = persistence_register_real ("dash-length", DEFAULT_LINESTYLE_DASHLEN);
+ dia_line_chooser_set_line_style (DIA_LINE_CHOOSER (chooser), style, dash_length);
+ gtk_widget_show (chooser);
chooser = dia_arrow_chooser_new(FALSE, change_end_arrow_style, NULL);
arrow.width = persistence_register_real("end-arrow-width", DEFAULT_ARROW_WIDTH);
diff --git a/lib/arrows.c b/lib/arrows.c
index c58ef988a..1c6c6491f 100644
--- a/lib/arrows.c
+++ b/lib/arrows.c
@@ -514,7 +514,7 @@ draw_none_or_many (DiaRenderer *renderer,
/* use the middle of the arrow */
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -618,7 +618,7 @@ draw_one_or_many (DiaRenderer *renderer,
calculate_arrow (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -702,7 +702,7 @@ draw_crow_foot (DiaRenderer *renderer,
calculate_crow (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_draw_line (renderer, &poly[0], &poly[1], fg_color);
@@ -736,7 +736,7 @@ draw_lines (DiaRenderer *renderer,
calculate_arrow (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -782,7 +782,7 @@ draw_fill_ellipse (DiaRenderer *renderer,
Point vl,vt;
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -863,7 +863,7 @@ draw_empty_ellipse (DiaRenderer *renderer,
Point disp;
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -973,7 +973,7 @@ draw_fill_box (DiaRenderer *renderer,
real lw_factor,clength,cwidth;
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1038,7 +1038,7 @@ draw_fill_dot (DiaRenderer *renderer,
real lw_factor,clength,cwidth;
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1132,7 +1132,7 @@ draw_integral (DiaRenderer *renderer,
Point vl,vt;
Point bs,be, bs2,be2;
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1235,7 +1235,7 @@ draw_slashed (DiaRenderer *renderer,
calculate_slashed (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1324,7 +1324,7 @@ draw_halfhead (DiaRenderer *renderer,
calculate_halfhead (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1358,7 +1358,7 @@ draw_triangle (DiaRenderer *renderer,
calculate_arrow (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_draw_polygon (renderer, poly, 3, bg_color, fg_color);
@@ -1447,7 +1447,7 @@ draw_diamond (DiaRenderer *renderer,
calculate_diamond (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1481,7 +1481,7 @@ draw_half_diamond (DiaRenderer *renderer,
calculate_diamond (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1572,7 +1572,7 @@ draw_slashed_cross (DiaRenderer *renderer,
calculate_slashed_cross (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1649,7 +1649,7 @@ draw_backslash (DiaRenderer *renderer,
calculate_backslash (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1683,7 +1683,7 @@ draw_cross (DiaRenderer *renderer,
calculate_arrow (poly, to, from, length, width);
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1853,7 +1853,7 @@ draw_concave_triangle (DiaRenderer *renderer,
calculate_concave (poly, to, from, length, width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1894,7 +1894,7 @@ draw_rounded (DiaRenderer *renderer,
real angle_start;
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -1954,7 +1954,7 @@ draw_open_rounded (DiaRenderer *renderer,
real len, rayon;
real angle_start;
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -2013,7 +2013,7 @@ draw_filled_dot_n_triangle (DiaRenderer *renderer,
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linewidth (renderer, linewidth);
delta = *from;
@@ -2087,7 +2087,7 @@ draw_three_dots (DiaRenderer *renderer,
hole_width = width / 3 - dot_width;
dia_renderer_set_linewidth (renderer, linewidth);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
for (i = 0; i < 3; i++) {
dot_from.x = to->x - i * (dot_width + hole_width) * delta.x;
diff --git a/lib/attributes.c b/lib/attributes.c
index 30863ede3..7be5c414c 100644
--- a/lib/attributes.c
+++ b/lib/attributes.c
@@ -39,7 +39,7 @@ static Arrow attributes_end_arrow = {
DEFAULT_ARROW_SIZE
};
-static LineStyle attributes_linestyle = LINESTYLE_SOLID;
+static DiaLineStyle attributes_linestyle = DIA_LINE_STYLE_SOLID;
static double attributes_dash_length = 1.0;
static DiaFont *attributes_font = NULL;
@@ -258,7 +258,7 @@ attributes_set_default_end_arrow (Arrow arrow)
* Since: dawn-of-time
*/
void
-attributes_get_default_line_style (LineStyle *style, double *dash_length)
+attributes_get_default_line_style (DiaLineStyle *style, double *dash_length)
{
if (style) {
*style = attributes_linestyle;
@@ -279,7 +279,7 @@ attributes_get_default_line_style (LineStyle *style, double *dash_length)
* Since: dawn-of-time
*/
void
-attributes_set_default_line_style (LineStyle style, double dash_length)
+attributes_set_default_line_style (DiaLineStyle style, double dash_length)
{
attributes_linestyle = style;
attributes_dash_length = dash_length;
diff --git a/lib/attributes.h b/lib/attributes.h
index 1c654cf84..6e6fe1acd 100644
--- a/lib/attributes.h
+++ b/lib/attributes.h
@@ -27,23 +27,23 @@ G_BEGIN_DECLS
Color attributes_get_foreground (void);
Color attributes_get_background (void);
-void attributes_set_foreground (Color *color);
-void attributes_set_background (Color *color);
+void attributes_set_foreground (Color *color);
+void attributes_set_background (Color *color);
void attributes_swap_fgbg (void);
void attributes_default_fgbg (void);
double attributes_get_default_linewidth (void);
-void attributes_set_default_linewidth (double width);
+void attributes_set_default_linewidth (double width);
Arrow attributes_get_default_start_arrow (void);
-void attributes_set_default_start_arrow (Arrow arrow);
+void attributes_set_default_start_arrow (Arrow arrow);
Arrow attributes_get_default_end_arrow (void);
-void attributes_set_default_end_arrow (Arrow arrow);
-void attributes_get_default_line_style (LineStyle *style,
- double *dash_length);
-void attributes_set_default_line_style (LineStyle style,
- double dash_length);
-void attributes_get_default_font (DiaFont **font,
- double *font_height);
-void attributes_set_default_font (DiaFont *font,
- double font_height);
+void attributes_set_default_end_arrow (Arrow arrow);
+void attributes_get_default_line_style (DiaLineStyle *style,
+ double *dash_length);
+void attributes_set_default_line_style (DiaLineStyle style,
+ double dash_length);
+void attributes_get_default_font (DiaFont **font,
+ double *font_height);
+void attributes_set_default_font (DiaFont *font,
+ double font_height);
G_END_DECLS
diff --git a/lib/bezier-common.c b/lib/bezier-common.c
index 3edb1ee41..6ee06d620 100644
--- a/lib/bezier-common.c
+++ b/lib/bezier-common.c
@@ -176,7 +176,7 @@ bezier_draw_control_lines (int num_points,
/* setup renderer ... */
dia_renderer_set_linewidth (renderer, 0);
- dia_renderer_set_linestyle (renderer, LINESTYLE_DOTTED, 1);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DOTTED, 1);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
diff --git a/lib/dia-enums.h b/lib/dia-enums.h
index 63a84f32d..e60df4188 100644
--- a/lib/dia-enums.h
+++ b/lib/dia-enums.h
@@ -1,5 +1,28 @@
-#ifndef DIA_ENUMS_H
-#define DIA_ENUMS_H
+/* Dia -- an diagram creation/manipulation program
+ * Copyright (C) 1998 Alexander Larsson
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#pragma once
+
+#include "dia-lib-enums.h"
+
+G_BEGIN_DECLS
typedef enum {
LINECAPS_DEFAULT = -1, /* default usually butt, this is unset */
@@ -15,14 +38,14 @@ typedef enum {
LINEJOIN_BEVEL
} LineJoin;
-typedef enum {
- LINESTYLE_DEFAULT = -1, /* default usually solid, this is unset */
- LINESTYLE_SOLID = 0,
- LINESTYLE_DASHED,
- LINESTYLE_DASH_DOT,
- LINESTYLE_DASH_DOT_DOT,
- LINESTYLE_DOTTED
-} LineStyle;
+typedef enum /*< enum >*/ {
+ DIA_LINE_STYLE_DEFAULT = -1, /* default usually solid, this is unset */
+ DIA_LINE_STYLE_SOLID = 0,
+ DIA_LINE_STYLE_DASHED,
+ DIA_LINE_STYLE_DASH_DOT,
+ DIA_LINE_STYLE_DASH_DOT_DOT,
+ DIA_LINE_STYLE_DOTTED
+} DiaLineStyle;
typedef enum {
FILLSTYLE_SOLID
@@ -44,4 +67,4 @@ typedef enum {
#define DEFAULT_LINESTYLE LINESTYLE_SOLID
#define DEFAULT_LINESTYLE_DASHLEN 1.0
-#endif
+G_END_DECLS
diff --git a/lib/dia-line-cell-renderer.c b/lib/dia-line-cell-renderer.c
index 0da6827f5..db6c49c33 100644
--- a/lib/dia-line-cell-renderer.c
+++ b/lib/dia-line-cell-renderer.c
@@ -32,8 +32,8 @@
typedef struct _DiaLineCellRendererPrivate DiaLineCellRendererPrivate;
struct _DiaLineCellRendererPrivate {
- DiaRenderer *renderer;
- LineStyle line;
+ DiaRenderer *renderer;
+ DiaLineStyle line;
};
@@ -244,14 +244,12 @@ dia_line_cell_renderer_class_init (DiaLineCellRendererClass *klass)
*
* Since: 0.98
*/
- // TODO: Make LineStyle a GEnum
pspecs[PROP_LINE] =
- g_param_spec_int ("line",
- "Line",
- "Line style",
- LINESTYLE_DEFAULT,
- LINESTYLE_DOTTED, // KEEP IN SYNC
- LINESTYLE_SOLID,
+ g_param_spec_enum ("line",
+ "Line",
+ "Line style",
+ DIA_TYPE_LINE_STYLE,
+ DIA_LINE_STYLE_DEFAULT,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
g_object_class_install_properties (object_class, LAST_PROP, pspecs);
diff --git a/lib/dia-line-chooser.c b/lib/dia-line-chooser.c
index 81cfedf6f..def992048 100644
--- a/lib/dia-line-chooser.c
+++ b/lib/dia-line-chooser.c
@@ -33,7 +33,7 @@
struct _DiaLineChooser {
GtkButton button;
DiaLinePreview *preview;
- LineStyle lstyle;
+ DiaLineStyle lstyle;
double dash_length;
GtkMenu *menu;
@@ -97,7 +97,7 @@ dia_line_chooser_dialog_response (GtkWidget *dialog,
int response_id,
DiaLineChooser *lchooser)
{
- LineStyle new_style;
+ DiaLineStyle new_style;
double new_dash;
if (response_id == GTK_RESPONSE_OK) {
@@ -126,8 +126,8 @@ dia_line_chooser_dialog_response (GtkWidget *dialog,
static void
dia_line_chooser_change_line_style (GtkMenuItem *mi, DiaLineChooser *lchooser)
{
- LineStyle lstyle = GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (mi),
- dia_menuitem_key_quark ()));
+ DiaLineStyle lstyle = GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (mi),
+ dia_menuitem_key_quark ()));
dia_line_chooser_set_line_style (lchooser, lstyle, lchooser->dash_length);
}
@@ -135,7 +135,7 @@ dia_line_chooser_change_line_style (GtkMenuItem *mi, DiaLineChooser *lchooser)
void
dia_line_chooser_set_line_style (DiaLineChooser *lchooser,
- LineStyle lstyle,
+ DiaLineStyle lstyle,
double dashlength)
{
if (lstyle != lchooser->lstyle) {
@@ -162,10 +162,10 @@ dia_line_chooser_init (DiaLineChooser *lchooser)
GtkWidget *mi, *ln;
int i;
- lchooser->lstyle = LINESTYLE_SOLID;
+ lchooser->lstyle = DIA_LINE_STYLE_SOLID;
lchooser->dash_length = DEFAULT_LINESTYLE_DASHLEN;
- wid = dia_line_preview_new (LINESTYLE_SOLID);
+ wid = dia_line_preview_new (DIA_LINE_STYLE_SOLID);
gtk_container_add (GTK_CONTAINER (lchooser), wid);
gtk_widget_show (wid);
lchooser->preview = DIA_LINE_PREVIEW (wid);
@@ -193,7 +193,7 @@ dia_line_chooser_init (DiaLineChooser *lchooser)
lchooser->selector = DIA_LINE_STYLE_SELECTOR (wid);
lchooser->menu = GTK_MENU (g_object_ref_sink (gtk_menu_new ()));
- for (i = 0; i <= LINESTYLE_DOTTED; i++) {
+ for (i = 0; i <= DIA_LINE_STYLE_DOTTED; i++) {
mi = gtk_menu_item_new ();
g_object_set_qdata (G_OBJECT (mi),
dia_menuitem_key_quark (),
diff --git a/lib/dia-line-chooser.h b/lib/dia-line-chooser.h
index 77a5eaa42..3508aeaea 100644
--- a/lib/dia-line-chooser.h
+++ b/lib/dia-line-chooser.h
@@ -32,14 +32,14 @@ G_BEGIN_DECLS
#define DIA_TYPE_LINE_CHOOSER dia_line_chooser_get_type ()
G_DECLARE_FINAL_TYPE (DiaLineChooser, dia_line_chooser, DIA, LINE_CHOOSER, GtkButton)
-typedef void (*DiaChangeLineCallback) (LineStyle lstyle,
- double dash_length,
- gpointer user_data);
+typedef void (*DiaChangeLineCallback) (DiaLineStyle lstyle,
+ double dash_length,
+ gpointer user_data);
GtkWidget *dia_line_chooser_new (DiaChangeLineCallback callback,
gpointer user_data);
void dia_line_chooser_set_line_style (DiaLineChooser *lchooser,
- LineStyle style,
+ DiaLineStyle style,
double dashlength);
G_END_DECLS
diff --git a/lib/dia-line-preview.c b/lib/dia-line-preview.c
index 7da55ff4d..d602f3cfc 100644
--- a/lib/dia-line-preview.c
+++ b/lib/dia-line-preview.c
@@ -22,7 +22,7 @@
struct _DiaLinePreview {
GtkMisc misc;
- LineStyle lstyle;
+ DiaLineStyle lstyle;
};
G_DEFINE_TYPE (DiaLinePreview, dia_line_preview, GTK_TYPE_MISC)
@@ -64,23 +64,23 @@ dia_line_preview_expose (GtkWidget *widget, GdkEventExpose *event)
cairo_set_line_join (ctx, CAIRO_LINE_JOIN_MITER);
switch (line->lstyle) {
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
cairo_set_dash (ctx, dash_list, 0, 0);
break;
- case LINESTYLE_DASHED:
+ case DIA_LINE_STYLE_DASHED:
dash_list[0] = 10;
dash_list[1] = 10;
cairo_set_dash (ctx, dash_list, 2, 0);
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
dash_list[0] = 10;
dash_list[1] = 4;
dash_list[2] = 2;
dash_list[3] = 4;
cairo_set_dash (ctx, dash_list, 4, 0);
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
dash_list[0] = 10;
dash_list[1] = 2;
dash_list[2] = 2;
@@ -89,7 +89,7 @@ dia_line_preview_expose (GtkWidget *widget, GdkEventExpose *event)
dash_list[5] = 2;
cairo_set_dash (ctx, dash_list, 6, 0);
break;
- case LINESTYLE_DOTTED:
+ case DIA_LINE_STYLE_DOTTED:
dash_list[0] = 2;
dash_list[1] = 2;
cairo_set_dash (ctx, dash_list, 2, 0);
@@ -127,12 +127,12 @@ dia_line_preview_init (DiaLinePreview *line)
30 + xpad * 2,
15 + ypad * 2);
- line->lstyle = LINESTYLE_SOLID;
+ line->lstyle = DIA_LINE_STYLE_SOLID;
}
GtkWidget *
-dia_line_preview_new (LineStyle lstyle)
+dia_line_preview_new (DiaLineStyle lstyle)
{
DiaLinePreview *line = g_object_new (DIA_TYPE_LINE_PREVIEW, NULL);
@@ -143,7 +143,7 @@ dia_line_preview_new (LineStyle lstyle)
void
-dia_line_preview_set_style (DiaLinePreview *line, LineStyle lstyle)
+dia_line_preview_set_style (DiaLinePreview *line, DiaLineStyle lstyle)
{
if (line->lstyle == lstyle) {
return;
@@ -155,4 +155,3 @@ dia_line_preview_set_style (DiaLinePreview *line, LineStyle lstyle)
gtk_widget_queue_draw (GTK_WIDGET (line));
}
}
-
diff --git a/lib/dia-line-preview.h b/lib/dia-line-preview.h
index a98d37f0f..31e5d7bf2 100644
--- a/lib/dia-line-preview.h
+++ b/lib/dia-line-preview.h
@@ -30,8 +30,8 @@ G_BEGIN_DECLS
#define DIA_TYPE_LINE_PREVIEW dia_line_preview_get_type ()
G_DECLARE_FINAL_TYPE (DiaLinePreview, dia_line_preview, DIA, LINE_PREVIEW, GtkMisc)
-GtkWidget *dia_line_preview_new (LineStyle lstyle);
+GtkWidget *dia_line_preview_new (DiaLineStyle lstyle);
void dia_line_preview_set_style (DiaLinePreview *line,
- LineStyle lstyle);
+ DiaLineStyle lstyle);
G_END_DECLS
diff --git a/lib/dia-line-style-selector.c b/lib/dia-line-style-selector.c
index 97dbfd252..d50c8ff7a 100644
--- a/lib/dia-line-style-selector.c
+++ b/lib/dia-line-style-selector.c
@@ -38,7 +38,7 @@ struct _DiaLineStyleSelector {
GtkWidget *combo;
GtkListStore *line_store;
- LineStyle looking_for;
+ DiaLineStyle looking_for;
};
G_DEFINE_TYPE (DiaLineStyleSelector, dia_line_style_selector, GTK_TYPE_VBOX)
@@ -69,7 +69,7 @@ set_linestyle_sensitivity (DiaLineStyleSelector *fs)
GtkTreeIter iter;
if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (fs->combo), &iter)) {
- LineStyle line;
+ DiaLineStyle line;
gtk_tree_model_get (GTK_TREE_MODEL (fs->line_store),
&iter,
@@ -77,9 +77,9 @@ set_linestyle_sensitivity (DiaLineStyleSelector *fs)
-1);
gtk_widget_set_sensitive (GTK_WIDGET (fs->lengthlabel),
- line != LINESTYLE_SOLID);
+ line != DIA_LINE_STYLE_SOLID);
gtk_widget_set_sensitive (GTK_WIDGET (fs->dashlength),
- line != LINESTYLE_SOLID);
+ line != DIA_LINE_STYLE_SOLID);
} else {
gtk_widget_set_sensitive (GTK_WIDGET (fs->lengthlabel), FALSE);
gtk_widget_set_sensitive (GTK_WIDGET (fs->dashlength), FALSE);
@@ -116,9 +116,9 @@ dia_line_style_selector_init (DiaLineStyleSelector *fs)
GtkTreeIter iter;
GtkCellRenderer *renderer;
- fs->line_store = gtk_list_store_new (N_COL, G_TYPE_INT);
+ fs->line_store = gtk_list_store_new (N_COL, DIA_TYPE_LINE_STYLE);
- for (int i = 0; i <= LINESTYLE_DOTTED; i++) {
+ for (int i = 0; i <= DIA_LINE_STYLE_DOTTED; i++) {
gtk_list_store_append (fs->line_store, &iter);
gtk_list_store_set (fs->line_store,
&iter,
@@ -177,7 +177,7 @@ dia_line_style_selector_new (void)
void
dia_line_style_selector_get_linestyle (DiaLineStyleSelector *fs,
- LineStyle *ls,
+ DiaLineStyle *ls,
double *dl)
{
GtkTreeIter iter;
@@ -188,7 +188,7 @@ dia_line_style_selector_get_linestyle (DiaLineStyleSelector *fs,
COL_LINE, ls,
-1);
} else {
- *ls = LINESTYLE_DEFAULT;
+ *ls = DIA_LINE_STYLE_DEFAULT;
}
if (dl != NULL) {
@@ -204,7 +204,7 @@ set_style (GtkTreeModel *model,
gpointer data)
{
DiaLineStyleSelector *self = DIA_LINE_STYLE_SELECTOR (data);
- LineStyle line;
+ DiaLineStyle line;
gboolean res = FALSE;
gtk_tree_model_get (model,
@@ -223,12 +223,12 @@ set_style (GtkTreeModel *model,
void
dia_line_style_selector_set_linestyle (DiaLineStyleSelector *as,
- LineStyle linestyle,
+ DiaLineStyle linestyle,
double dashlength)
{
as->looking_for = linestyle;
gtk_tree_model_foreach (GTK_TREE_MODEL (as->line_store), set_style, as);
- as->looking_for = LINESTYLE_DEFAULT;
+ as->looking_for = DIA_LINE_STYLE_DEFAULT;
gtk_spin_button_set_value (GTK_SPIN_BUTTON (as->dashlength), dashlength);
}
diff --git a/lib/dia-line-style-selector.h b/lib/dia-line-style-selector.h
index 21b8630ef..ca703eb12 100644
--- a/lib/dia-line-style-selector.h
+++ b/lib/dia-line-style-selector.h
@@ -32,10 +32,10 @@ G_DECLARE_FINAL_TYPE (DiaLineStyleSelector, dia_line_style_selector, DIA, LINE_S
GtkWidget *dia_line_style_selector_new (void);
void dia_line_style_selector_get_linestyle (DiaLineStyleSelector *as,
- LineStyle *linestyle,
+ DiaLineStyle *linestyle,
double *dashlength);
void dia_line_style_selector_set_linestyle (DiaLineStyleSelector *as,
- LineStyle linestyle,
+ DiaLineStyle linestyle,
double dashlength);
G_END_DECLS
diff --git a/lib/dia_svg.c b/lib/dia_svg.c
index 36e10f5ab..7e43312e3 100644
--- a/lib/dia_svg.c
+++ b/lib/dia_svg.c
@@ -61,7 +61,7 @@ dia_svg_style_init(DiaSvgStyle *gs, DiaSvgStyle *parent_style)
gs->stroke = parent_style ? parent_style->stroke : DIA_SVG_COLOUR_DEFAULT;
gs->stroke_opacity = parent_style ? parent_style->stroke_opacity : 1.0;
gs->line_width = parent_style ? parent_style->line_width : 0.0;
- gs->linestyle = parent_style ? parent_style->linestyle : LINESTYLE_SOLID;
+ gs->linestyle = parent_style ? parent_style->linestyle : DIA_LINE_STYLE_SOLID;
gs->dashlength = parent_style ? parent_style->dashlength : 1;
/* http://www.w3.org/TR/SVG/painting.html#FillProperty - default black
* but we still have to see the difference
@@ -70,7 +70,7 @@ dia_svg_style_init(DiaSvgStyle *gs, DiaSvgStyle *parent_style)
gs->fill_opacity = parent_style ? parent_style->fill_opacity : 1.0;
gs->linecap = parent_style ? parent_style->linecap : LINECAPS_DEFAULT;
gs->linejoin = parent_style ? parent_style->linejoin : LINEJOIN_DEFAULT;
- gs->linestyle = parent_style ? parent_style->linestyle : LINESTYLE_DEFAULT;
+ gs->linestyle = parent_style ? parent_style->linestyle : DIA_LINE_STYLE_DEFAULT;
gs->font = (parent_style && parent_style->font) ? g_object_ref (parent_style->font) : NULL;
gs->font_height = parent_style ? parent_style->font_height : 0.8;
gs->alignment = parent_style ? parent_style->alignment : ALIGN_LEFT;
@@ -411,57 +411,70 @@ enum
FONT_NAME_LENGTH_MAX = 40
};
+
static void
_parse_dasharray (DiaSvgStyle *s, double user_scale, char *str, char **end)
{
char *ptr;
/* by also splitting on ';' we can also parse the continued style string */
- char **dashes = g_regex_split_simple ("[\\s,;]+", (char *)str, 0, 0);
+ char **dashes = g_regex_split_simple ("[\\s,;]+", (char *) str, 0, 0);
int n = 0;
double dl;
s->dashlength = g_ascii_strtod(str, &ptr);
- if (s->dashlength <= 0.0) /* e.g. "none" */
- s->linestyle = LINESTYLE_SOLID;
- else if (user_scale > 0)
+ if (s->dashlength <= 0.0) {
+ /* e.g. "none" */
+ s->linestyle = DIA_LINE_STYLE_SOLID;
+ } else if (user_scale > 0) {
s->dashlength /= user_scale;
+ }
if (s->dashlength) { /* at least one value */
- while (dashes[n] && g_ascii_strtod (dashes[n], NULL) > 0)
+ while (dashes[n] && g_ascii_strtod (dashes[n], NULL) > 0) {
++n; /* Dia can not do arbitrary length, the number of dashes gives the style */
+ }
}
- if (n > 0)
+
+ if (n > 0) {
s->dashlength = g_ascii_strtod (dashes[0], NULL);
- if (user_scale > 0)
+ }
+
+ if (user_scale > 0) {
s->dashlength /= user_scale;
+ }
+
switch (n) {
- case 0 :
- s->linestyle = LINESTYLE_SOLID;
+ case 0:
+ s->linestyle = DIA_LINE_STYLE_SOLID;
break;
- case 1 :
- s->linestyle = LINESTYLE_DASHED;
+ case 1:
+ s->linestyle = DIA_LINE_STYLE_DASHED;
break;
- case 2 :
+ case 2:
dl = g_ascii_strtod (dashes[1], NULL);
- if (user_scale > 0)
+
+ if (user_scale > 0) {
dl /= user_scale;
- if (dl < s->line_width || dl > s->dashlength) { /* the difference is arbitrary */
- s->linestyle = LINESTYLE_DOTTED;
- s->dashlength *= 10.0; /* dot = 10% of len */
+ }
+
+ if (dl < s->line_width || dl > s->dashlength) {
+ /* the difference is arbitrary */
+ s->linestyle = DIA_LINE_STYLE_DOTTED;
+ s->dashlength *= 10.0; /* dot = 10% of len */
} else {
- s->linestyle = LINESTYLE_DASHED;
+ s->linestyle = DIA_LINE_STYLE_DASHED;
}
break;
- case 4 :
- s->linestyle = LINESTYLE_DASH_DOT;
+ case 4:
+ s->linestyle = DIA_LINE_STYLE_DASH_DOT;
break;
default :
/* If an odd number of values is provided, then the list of values is repeated to
* yield an even number of values. Thus, stroke-dasharray: 5,3,2 is equivalent to
* stroke-dasharray: 5,3,2,5,3,2.
*/
- case 6 :
- s->linestyle = LINESTYLE_DASH_DOT_DOT;
+ case 6:
+ s->linestyle = DIA_LINE_STYLE_DASH_DOT_DOT;
break;
}
g_strfreev (dashes);
@@ -685,20 +698,21 @@ dia_svg_parse_style_string (DiaSvgStyle *s, double user_scale, const char *str)
while (ptr[0] != '\0' && g_ascii_isspace(ptr[0])) ptr++;
if (ptr[0] == '\0') break;
- if (!strncmp(ptr, "solid", 5))
- s->linestyle = LINESTYLE_SOLID;
- else if (!strncmp(ptr, "dashed", 6))
- s->linestyle = LINESTYLE_DASHED;
- else if (!strncmp(ptr, "dash-dot", 8))
- s->linestyle = LINESTYLE_DASH_DOT;
- else if (!strncmp(ptr, "dash-dot-dot", 12))
- s->linestyle = LINESTYLE_DASH_DOT_DOT;
- else if (!strncmp(ptr, "dotted", 6))
- s->linestyle = LINESTYLE_DOTTED;
- else if (!strncmp(ptr, "default", 7))
- s->linestyle = LINESTYLE_DEFAULT;
+ if (!strncmp (ptr, "solid", 5)) {
+ s->linestyle = DIA_LINE_STYLE_SOLID;
+ } else if (!strncmp (ptr, "dashed", 6)) {
+ s->linestyle = DIA_LINE_STYLE_DASHED;
+ } else if (!strncmp (ptr, "dash-dot", 8)) {
+ s->linestyle = DIA_LINE_STYLE_DASH_DOT;
+ } else if (!strncmp (ptr, "dash-dot-dot", 12)) {
+ s->linestyle = DIA_LINE_STYLE_DASH_DOT_DOT;
+ } else if (!strncmp (ptr, "dotted", 6)) {
+ s->linestyle = DIA_LINE_STYLE_DOTTED;
+ } else if (!strncmp (ptr, "default", 7)) {
+ s->linestyle = DIA_LINE_STYLE_DEFAULT;
+ }
/* XXX: deal with a real pattern */
- } else if (!strncmp("stroke-dashlength:", ptr, 18)) {
+ } else if (!strncmp ("stroke-dashlength:", ptr, 18)) {
ptr += 18;
while (ptr[0] != '\0' && g_ascii_isspace(ptr[0])) ptr++;
if (ptr[0] == '\0') break;
@@ -710,8 +724,8 @@ dia_svg_parse_style_string (DiaSvgStyle *s, double user_scale, const char *str)
if (user_scale > 0)
s->dashlength /= user_scale;
}
- } else if (!strncmp("stroke-dasharray:", ptr, 17)) {
- s->linestyle = LINESTYLE_DASHED;
+ } else if (!strncmp ("stroke-dasharray:", ptr, 17)) {
+ s->linestyle = DIA_LINE_STYLE_DASHED;
ptr += 17;
while (ptr[0] != '\0' && g_ascii_isspace(ptr[0])) ptr++;
if (ptr[0] == '\0') break;
diff --git a/lib/dia_svg.h b/lib/dia_svg.h
index cdb7155ec..8a33b526b 100644
--- a/lib/dia_svg.h
+++ b/lib/dia_svg.h
@@ -43,7 +43,7 @@ struct _DiaSvgStyle {
LineCaps linecap;
LineJoin linejoin;
- LineStyle linestyle;
+ DiaLineStyle linestyle;
double dashlength;
DiaFont *font;
diff --git a/lib/diaimportrenderer.c b/lib/diaimportrenderer.c
index 8c199435e..338285ce5 100644
--- a/lib/diaimportrenderer.c
+++ b/lib/diaimportrenderer.c
@@ -36,7 +36,7 @@ static void end_render (DiaRenderer *);
static void set_linewidth (DiaRenderer *renderer, real linewidth);
static void set_linecaps (DiaRenderer *renderer, LineCaps mode);
static void set_linejoin (DiaRenderer *renderer, LineJoin mode);
-static void set_linestyle (DiaRenderer *renderer, LineStyle mode, real dash_length);
+static void set_linestyle (DiaRenderer *renderer, DiaLineStyle mode, double dash_length);
static void set_fillstyle (DiaRenderer *renderer, FillStyle mode);
static void draw_line (DiaRenderer *renderer,
@@ -203,7 +203,7 @@ static void
dia_import_renderer_init (DiaImportRenderer *self)
{
/* set all (non-null) defaults */
- self->line_style = LINESTYLE_SOLID;
+ self->line_style = DIA_LINE_STYLE_SOLID;
self->dash_length = 1.0;
self->line_caps = LINECAPS_BUTT;
self->line_join = LINEJOIN_MITER;
@@ -246,14 +246,16 @@ set_linejoin (DiaRenderer *renderer, LineJoin mode)
self->line_join = mode;
}
+
static void
-set_linestyle (DiaRenderer *renderer, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *renderer, DiaLineStyle mode, double dash_length)
{
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
self->line_style = mode;
self->dash_length = dash_length;
}
+
static void
set_fillstyle (DiaRenderer *renderer, FillStyle mode)
{
diff --git a/lib/diaimportrenderer.h b/lib/diaimportrenderer.h
index e21e6a439..fa3333410 100644
--- a/lib/diaimportrenderer.h
+++ b/lib/diaimportrenderer.h
@@ -26,16 +26,15 @@ typedef struct _DiaImportRendererClass DiaImportRendererClass;
*
* \extends _DiaRenderer
*/
-struct _DiaImportRenderer
-{
+struct _DiaImportRenderer {
DiaRenderer parent_instance;
/*! \protected state variables should not be set directly but with the rendering interface */
- LineStyle line_style;
+ DiaLineStyle line_style;
FillStyle fill_style;
- real dash_length;
+ double dash_length;
- real line_width;
+ double line_width;
LineCaps line_caps;
LineJoin line_join;
diff --git a/lib/diapathrenderer.c b/lib/diapathrenderer.c
index 045b16f48..683541e7b 100644
--- a/lib/diapathrenderer.c
+++ b/lib/diapathrenderer.c
@@ -216,10 +216,14 @@ static void
set_linejoin(DiaRenderer *self, LineJoin mode)
{
}
+
+
static void
-set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
}
+
+
static void
set_fillstyle(DiaRenderer *self, FillStyle mode)
{
diff --git a/lib/diarenderer.c b/lib/diarenderer.c
index 382d78c89..3e489fc0e 100644
--- a/lib/diarenderer.c
+++ b/lib/diarenderer.c
@@ -79,7 +79,9 @@ static void end_render (DiaRenderer *);
static void set_linewidth (DiaRenderer *renderer, real linewidth);
static void set_linecaps (DiaRenderer *renderer, LineCaps mode);
static void set_linejoin (DiaRenderer *renderer, LineJoin mode);
-static void set_linestyle (DiaRenderer *renderer, LineStyle mode, real length);
+static void set_linestyle (DiaRenderer *renderer,
+ DiaLineStyle mode,
+ double length);
static void set_fillstyle (DiaRenderer *renderer, FillStyle mode);
static void draw_line (DiaRenderer *renderer,
@@ -311,7 +313,7 @@ draw_object (DiaRenderer *renderer,
pt[3].y = matrix->yx * bb->left + matrix->yy * bb->bottom + matrix->y0;
dia_renderer_set_linewidth(renderer, 0.0);
- dia_renderer_set_linestyle(renderer, LINESTYLE_DOTTED, 1.0);
+ dia_renderer_set_linestyle(renderer, DIA_LINE_STYLE_DOTTED, 1.0);
dia_renderer_draw_polygon(renderer, pt, 4, NULL, &red);
dia_renderer_draw_line(renderer, &pt[0], &pt[2], &red);
dia_renderer_draw_line(renderer, &pt[1], &pt[3], &red);
@@ -486,17 +488,18 @@ set_linejoin (DiaRenderer *renderer, LineJoin mode)
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
}
-/*!
- * \brief Change line style and dash length for the strokes to come
- * \memberof _DiaRenderer \pure
+
+/*
+ * Change line style and dash length for the strokes to come
*/
static void
-set_linestyle (DiaRenderer *renderer, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *renderer, DiaLineStyle mode, double dash_length)
{
g_warning ("%s::set_line_style not implemented!",
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
}
+
/*!
* \brief Set the fill mode for following fills
*
@@ -2242,8 +2245,8 @@ dia_renderer_set_linejoin (DiaRenderer *self,
void
dia_renderer_set_linestyle (DiaRenderer *self,
- LineStyle mode,
- real length)
+ DiaLineStyle mode,
+ double length)
{
g_return_if_fail (DIA_IS_RENDERER (self));
diff --git a/lib/diarenderer.h b/lib/diarenderer.h
index 1db11d907..1f617c89b 100644
--- a/lib/diarenderer.h
+++ b/lib/diarenderer.h
@@ -137,8 +137,8 @@ struct _DiaRendererClass
void (*set_linejoin) (DiaRenderer *renderer,
LineJoin mode);
void (*set_linestyle) (DiaRenderer *renderer,
- LineStyle mode,
- real length);
+ DiaLineStyle mode,
+ double length);
void (*set_fillstyle) (DiaRenderer *renderer,
FillStyle mode);
@@ -300,8 +300,8 @@ void dia_renderer_set_linecaps (DiaRenderer *self,
void dia_renderer_set_linejoin (DiaRenderer *self,
LineJoin mode);
void dia_renderer_set_linestyle (DiaRenderer *self,
- LineStyle mode,
- real length);
+ DiaLineStyle mode,
+ double length);
void dia_renderer_set_fillstyle (DiaRenderer *self,
FillStyle mode);
void dia_renderer_set_font (DiaRenderer *self,
diff --git a/lib/diasvgrenderer.c b/lib/diasvgrenderer.c
index 87613b0fe..e3b28cefb 100644
--- a/lib/diasvgrenderer.c
+++ b/lib/diasvgrenderer.c
@@ -278,73 +278,74 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
}
}
-/*!
- * \brief Set line style
- * \memberof _DiaSvgRenderer
+
+/*
+ * Set line style
*/
static void
-set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
- real hole_width;
- gchar dash_length_buf[DTOSTR_BUF_SIZE];
- gchar dot_length_buf[DTOSTR_BUF_SIZE];
- gchar hole_width_buf[DTOSTR_BUF_SIZE];
- real dot_length; /* dot = 20% of len */
+ double hole_width;
+ char dash_length_buf[DTOSTR_BUF_SIZE];
+ char dot_length_buf[DTOSTR_BUF_SIZE];
+ char hole_width_buf[DTOSTR_BUF_SIZE];
+ double dot_length; /* dot = 20% of len */
- if (dash_length<0.001)
+ if (dash_length < 0.001) {
dash_length = 0.001;
- dot_length = dash_length*0.2;
+ }
+ dot_length = dash_length * 0.2;
g_clear_pointer (&renderer->linestyle, g_free);
switch (mode) {
- case LINESTYLE_SOLID:
+ case DIA_LINE_STYLE_SOLID:
renderer->linestyle = NULL;
break;
- case LINESTYLE_DASHED:
- dia_svg_dtostr(dash_length_buf, dash_length);
- renderer->linestyle = g_strdup_printf("%s", dash_length_buf);
+ case DIA_LINE_STYLE_DASHED:
+ dia_svg_dtostr (dash_length_buf, dash_length);
+ renderer->linestyle = g_strdup_printf ("%s", dash_length_buf);
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
hole_width = (dash_length - dot_length) / 2.0;
- dia_svg_dtostr(dash_length_buf, dash_length);
- dia_svg_dtostr(dot_length_buf, dot_length);
- dia_svg_dtostr(hole_width_buf, hole_width);
+ dia_svg_dtostr (dash_length_buf, dash_length);
+ dia_svg_dtostr (dot_length_buf, dot_length);
+ dia_svg_dtostr (hole_width_buf, hole_width);
- renderer->linestyle = g_strdup_printf("%s %s %s %s",
- dash_length_buf,
- hole_width_buf,
- dot_length_buf,
- hole_width_buf );
+ renderer->linestyle = g_strdup_printf ("%s %s %s %s",
+ dash_length_buf,
+ hole_width_buf,
+ dot_length_buf,
+ hole_width_buf);
break;
- case LINESTYLE_DASH_DOT_DOT:
- hole_width = (dash_length - 2.0*dot_length) / 3.0;
-
- dia_svg_dtostr(dash_length_buf, dash_length);
- dia_svg_dtostr(dot_length_buf, dot_length);
- dia_svg_dtostr(hole_width_buf, hole_width);
-
- renderer->linestyle = g_strdup_printf("%s %s %s %s %s %s",
- dash_length_buf,
- hole_width_buf,
- dot_length_buf,
- hole_width_buf,
- dot_length_buf,
- hole_width_buf );
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
+ hole_width = (dash_length - (2.0 * dot_length)) / 3.0;
+
+ dia_svg_dtostr (dash_length_buf, dash_length);
+ dia_svg_dtostr (dot_length_buf, dot_length);
+ dia_svg_dtostr (hole_width_buf, hole_width);
+
+ renderer->linestyle = g_strdup_printf ("%s %s %s %s %s %s",
+ dash_length_buf,
+ hole_width_buf,
+ dot_length_buf,
+ hole_width_buf,
+ dot_length_buf,
+ hole_width_buf);
break;
- case LINESTYLE_DOTTED:
-
- dia_svg_dtostr(dot_length_buf, dot_length);
+ case DIA_LINE_STYLE_DOTTED:
+ dia_svg_dtostr (dot_length_buf, dot_length);
- renderer->linestyle = g_strdup_printf("%s", dot_length_buf);
+ renderer->linestyle = g_strdup_printf ("%s", dot_length_buf);
break;
- case LINESTYLE_DEFAULT:
+ case DIA_LINE_STYLE_DEFAULT:
default:
renderer->linestyle = NULL;
}
}
+
/*!
* \brief Set fill style
* \memberof _DiaSvgRenderer
diff --git a/lib/diatransformrenderer.c b/lib/diatransformrenderer.c
index b1b98d0bd..fb9af4fd1 100644
--- a/lib/diatransformrenderer.c
+++ b/lib/diatransformrenderer.c
@@ -178,12 +178,12 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
dia_renderer_set_linejoin (renderer->worker, mode);
}
-/*!
- * \brief Pass through line style, transform dash length and pass through
- * \memberof _DiaTransformRenderer
+
+/*
+ * Pass through line style, transform dash length and pass through
*/
static void
-set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
DiaTransformRenderer *renderer = DIA_TRANSFORM_RENDERER (self);
DiaMatrix *m = g_queue_peek_tail (renderer->matrices);
@@ -197,6 +197,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
dia_renderer_set_linestyle (renderer->worker, mode, dash_length);
}
+
/*!
* \brief Pass through fill style
* \memberof _DiaTransformRenderer
diff --git a/lib/meson.build b/lib/meson.build
index 107c4d6dc..b2e81f8a4 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -191,6 +191,7 @@ gnome = import('gnome')
libdia_sources += gnome.mkenums_simple('dia-lib-enums',
sources: [
+ 'dia-enums.h',
'font.h',
'units.h',
]
diff --git a/lib/prop_attr.c b/lib/prop_attr.c
index b071dcbf1..3e81d17d5 100644
--- a/lib/prop_attr.c
+++ b/lib/prop_attr.c
@@ -43,7 +43,7 @@ linestyleprop_new(const PropDescription *pdesc,
{
LinestyleProperty *prop = g_new0(LinestyleProperty,1);
initialize_property(&prop->common,pdesc,reason);
- prop->style = LINESTYLE_SOLID;
+ prop->style = DIA_LINE_STYLE_SOLID;
prop->dash = 0.0;
return prop;
}
@@ -93,7 +93,7 @@ linestyleprop_load(LinestyleProperty *prop, AttributeNode attr, DataNode data, D
prop->style = data_enum(data, ctx);
prop->dash = 1.0;
/* don't bother checking dash length if we have a solid line. */
- if (prop->style != LINESTYLE_SOLID) {
+ if (prop->style != DIA_LINE_STYLE_SOLID) {
data = data_next(data);
if (data)
prop->dash = data_real(data, ctx);
@@ -114,22 +114,29 @@ linestyleprop_save(LinestyleProperty *prop, AttributeNode attr, DiaContext *ctx)
data_add_real(attr, prop->dash, ctx);
}
+
static void
-linestyleprop_get_from_offset(LinestyleProperty *prop,
- void *base, guint offset, guint offset2)
+linestyleprop_get_from_offset (LinestyleProperty *prop,
+ void *base,
+ guint offset,
+ guint offset2)
{
- prop->style = struct_member(base, offset, LineStyle);
- prop->dash = struct_member(base, offset2, real);
+ prop->style = struct_member (base, offset, DiaLineStyle);
+ prop->dash = struct_member (base, offset2, double);
}
+
static void
-linestyleprop_set_from_offset(LinestyleProperty *prop,
- void *base, guint offset, guint offset2)
+linestyleprop_set_from_offset (LinestyleProperty *prop,
+ void *base,
+ guint offset,
+ guint offset2)
{
- struct_member(base, offset, LineStyle) = prop->style;
- struct_member(base, offset2, real) = prop->dash;
+ struct_member (base, offset, DiaLineStyle) = prop->style;
+ struct_member (base, offset2, double) = prop->dash;
}
+
static const PropertyOps linestyleprop_ops = {
(PropertyType_New) linestyleprop_new,
(PropertyType_Free) noopprop_free,
diff --git a/lib/prop_attr.h b/lib/prop_attr.h
index fb89f5d2c..5584ac753 100644
--- a/lib/prop_attr.h
+++ b/lib/prop_attr.h
@@ -22,20 +22,23 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifndef PROP_ATTR_H
-#define PROP_ATTR_H
+
+#pragma once
#include "properties.h"
#include "dia_xml.h"
-/*!
- * \brief Property for LineStyle
- * \extends _Property
+G_BEGIN_DECLS
+
+/**
+ * LinestyleProperty:
+ *
+ * #Property for #DiaLineStyle
*/
typedef struct {
Property common;
- LineStyle style;
- real dash;
+ DiaLineStyle style;
+ double dash;
} LinestyleProperty;
/*!
@@ -67,4 +70,4 @@ typedef struct {
void prop_attr_register(void);
-#endif
+G_END_DECLS
diff --git a/lib/properties.h b/lib/properties.h
index a7e3b11c1..535979a9a 100644
--- a/lib/properties.h
+++ b/lib/properties.h
@@ -446,8 +446,11 @@ GPtrArray *prop_list_from_descs(const PropDescription *plist,
GPtrArray *prop_list_from_single(Property *prop);
/* Convenience functions to construct a prop list from standard properties */
-void prop_list_add_line_width (GPtrArray *plist, real line_width);
-void prop_list_add_line_style (GPtrArray *plist, LineStyle line_style, real dash);
+void prop_list_add_line_width (GPtrArray *plist,
+ double line_width);
+void prop_list_add_line_style (GPtrArray *plist,
+ DiaLineStyle line_style,
+ double dash);
void prop_list_add_line_colour (GPtrArray *plist, const Color *color);
void prop_list_add_fill_colour (GPtrArray *plist, const Color *color);
void prop_list_add_show_background (GPtrArray *plist, gboolean fill);
diff --git a/lib/proplist.c b/lib/proplist.c
index 34bdd6cfe..dea439750 100644
--- a/lib/proplist.c
+++ b/lib/proplist.c
@@ -239,15 +239,21 @@ prop_list_add_line_width (GPtrArray *plist, real line_width)
((RealProperty *)prop)->real_data = line_width;
g_ptr_array_add (plist, prop);
}
+
+
void
-prop_list_add_line_style (GPtrArray *plist, LineStyle line_style, real dash)
+prop_list_add_line_style (GPtrArray *plist,
+ DiaLineStyle line_style,
+ double dash)
{
Property *prop = make_new_prop ("line_style", PROP_TYPE_LINESTYLE, 0);
- ((LinestyleProperty *)prop)->style = line_style;
- ((LinestyleProperty *)prop)->dash = dash;
+ ((LinestyleProperty *) prop)->style = line_style;
+ ((LinestyleProperty *) prop)->dash = dash;
g_ptr_array_add (plist, prop);
}
+
+
static void
_prop_list_add_colour (GPtrArray *plist, const char *name, const Color *color)
{
diff --git a/lib/renderer/diacairo-renderer.c b/lib/renderer/diacairo-renderer.c
index db852a594..3065c7f9a 100644
--- a/lib/renderer/diacairo-renderer.c
+++ b/lib/renderer/diacairo-renderer.c
@@ -458,10 +458,11 @@ dia_cairo_renderer_set_linejoin (DiaRenderer *self, LineJoin mode)
DIAG_STATE (renderer->cr)
}
+
static void
-dia_cairo_renderer_set_linestyle (DiaRenderer *self,
- LineStyle mode,
- real dash_length)
+dia_cairo_renderer_set_linestyle (DiaRenderer *self,
+ DiaLineStyle mode,
+ double dash_length)
{
/* dot = 10% of len */
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
@@ -473,23 +474,23 @@ dia_cairo_renderer_set_linestyle (DiaRenderer *self,
/* line type */
switch (mode) {
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
cairo_set_dash (renderer->cr, NULL, 0, 0);
break;
- case LINESTYLE_DASHED:
+ case DIA_LINE_STYLE_DASHED:
dash[0] = dash_length;
dash[1] = dash_length;
cairo_set_dash (renderer->cr, dash, 2, 0);
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
dash[0] = dash_length;
dash[1] = dash_length * 0.45;
dash[2] = dash_length * 0.1;
dash[3] = dash_length * 0.45;
cairo_set_dash (renderer->cr, dash, 4, 0);
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
dash[0] = dash_length;
dash[1] = dash_length * (0.8/3);
dash[2] = dash_length * 0.1;
@@ -498,13 +499,13 @@ dia_cairo_renderer_set_linestyle (DiaRenderer *self,
dash[5] = dash_length * (0.8/3);
cairo_set_dash (renderer->cr, dash, 6, 0);
break;
- case LINESTYLE_DOTTED:
+ case DIA_LINE_STYLE_DOTTED:
dash[0] = dash_length * 0.1;
dash[1] = dash_length * 0.1;
cairo_set_dash (renderer->cr, dash, 2, 0);
break;
default:
- g_warning("DiaCairoRenderer : Unsupported line style specified!\n");
+ g_warning ("DiaCairoRenderer : Unsupported line style specified!\n");
}
DIAG_STATE (renderer->cr)
diff --git a/lib/standard-path.c b/lib/standard-path.c
index 747e92cee..f3ed693d6 100644
--- a/lib/standard-path.c
+++ b/lib/standard-path.c
@@ -78,9 +78,9 @@ struct _StdPath {
int stroke_or_fill;
Color line_color;
- real line_width;
- LineStyle line_style;
- real dashlength;
+ double line_width;
+ DiaLineStyle line_style;
+ double dashlength;
LineJoin line_join;
LineCaps line_caps;
Color fill_color;
diff --git a/lib/text.c b/lib/text.c
index 1e926098f..f1920785f 100644
--- a/lib/text.c
+++ b/lib/text.c
@@ -697,7 +697,7 @@ text_draw (Text *text, DiaRenderer *renderer)
p2.x = curs_x;
p2.y = curs_y + height;
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linewidth (renderer, height / CURSOR_HEIGHT_RATIO);
dia_renderer_draw_line (renderer, &p1, &p2, &color_black);
}
diff --git a/objects/AADL/aadl.h b/objects/AADL/aadl.h
index 7fa0170ef..de1c2a9d5 100644
--- a/objects/AADL/aadl.h
+++ b/objects/AADL/aadl.h
@@ -217,14 +217,16 @@ aadlbox_inclined_project_point_on_nearest_border(Aadlbox *aadlbox,Point *p,
void aadlprocess_text_position(Aadlbox *aadlbox, Point *p);
/* aadlthread.c */
-void aadlbox_draw_inclined_box(Aadlbox *aadlbox, DiaRenderer *renderer,
- LineStyle linestyle);
+void aadlbox_draw_inclined_box (Aadlbox *aadlbox,
+ DiaRenderer *renderer,
+ DiaLineStyle linestyle);
/* aadlsubprogram.c */
void
aadlsubprogram_project_point_on_nearest_border(Aadlbox *aadlbox,Point *p,
real *angle);
/* aadlsystem.c */
-void aadlbox_draw_rounded_box (Aadlbox *aadlbox, DiaRenderer *renderer,
- LineStyle linestyle);
+void aadlbox_draw_rounded_box (Aadlbox *aadlbox,
+ DiaRenderer *renderer,
+ DiaLineStyle linestyle);
diff --git a/objects/AADL/aadlbus.c b/objects/AADL/aadlbus.c
index 3daf46329..a8b5250ff 100644
--- a/objects/AADL/aadlbus.c
+++ b/objects/AADL/aadlbus.c
@@ -76,7 +76,7 @@ aadlbus_draw_borders (Aadlbox *aadlbox, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, AADLBOX_BORDERWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_draw_polygon (renderer,
points,
diff --git a/objects/AADL/aadldata.c b/objects/AADL/aadldata.c
index 0f90c0b9a..cf067b355 100644
--- a/objects/AADL/aadldata.c
+++ b/objects/AADL/aadldata.c
@@ -46,7 +46,7 @@ aadldata_draw_borders (Aadlbox *aadlbox, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, AADLBOX_BORDERWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
points[0].x = x; points[0].y = y;
points[1].x = x + w; points[1].y = y + h;
diff --git a/objects/AADL/aadldevice.c b/objects/AADL/aadldevice.c
index b63e0c460..a3eb7c8bc 100644
--- a/objects/AADL/aadldevice.c
+++ b/objects/AADL/aadldevice.c
@@ -46,7 +46,7 @@ aadldevice_draw_borders (Aadlbox *aadlbox, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, AADLBOX_BORDERWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
points[0].x = x; points[0].y = y;
points[1].x = x + w; points[1].y = y + h;
diff --git a/objects/AADL/aadlmemory.c b/objects/AADL/aadlmemory.c
index 6e5ad6818..6394d7800 100644
--- a/objects/AADL/aadlmemory.c
+++ b/objects/AADL/aadlmemory.c
@@ -72,7 +72,7 @@ aadlmemory_draw_borders (Aadlbox *aadlbox, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, AADLBOX_BORDERWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_draw_beziergon (renderer,
bez,
diff --git a/objects/AADL/aadlpackage.c b/objects/AADL/aadlpackage.c
index ff01116e5..9d7be649b 100644
--- a/objects/AADL/aadlpackage.c
+++ b/objects/AADL/aadlpackage.c
@@ -50,7 +50,7 @@ aadlpackage_draw_borders (Aadlbox *aadlbox, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, AADLBOX_BORDERWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
points[0].x = x; points[0].y = y;
points[1].x = x + 0.03 * w ; points[1].y = y;
diff --git a/objects/AADL/aadlport.c b/objects/AADL/aadlport.c
index e32b93229..db133a21e 100644
--- a/objects/AADL/aadlport.c
+++ b/objects/AADL/aadlport.c
@@ -92,7 +92,7 @@ rotate_around_origin (Point *p, real angle) /* FIXME: no namespace */
\
dia_renderer_set_linewidth(renderer, AADL_PORT_LINEWIDTH); \
dia_renderer_set_linejoin(renderer, LINEJOIN_MITER); \
- dia_renderer_set_linestyle(renderer, LINESTYLE_SOLID, 0.0); \
+ dia_renderer_set_linestyle(renderer, DIA_LINE_STYLE_SOLID, 0.0); \
\
dia_renderer_draw_polygon(renderer, p, 3, &color_black, &color_black);
@@ -116,7 +116,7 @@ rotate_around_origin (Point *p, real angle) /* FIXME: no namespace */
\
dia_renderer_set_linewidth(renderer, AADL_PORT_LINEWIDTH); \
dia_renderer_set_linejoin(renderer, LINEJOIN_MITER); \
- dia_renderer_set_linestyle(renderer, LINESTYLE_SOLID, 0.0); \
+ dia_renderer_set_linestyle(renderer, DIA_LINE_STYLE_SOLID, 0.0); \
\
dia_renderer_draw_polyline(renderer, p, 3, &color_black);
@@ -140,7 +140,7 @@ rotate_around_origin (Point *p, real angle) /* FIXME: no namespace */
\
dia_renderer_set_linewidth(renderer, AADL_PORT_LINEWIDTH); \
dia_renderer_set_linejoin(renderer, LINEJOIN_MITER); \
- dia_renderer_set_linestyle(renderer, LINESTYLE_SOLID, 0.0); \
+ dia_renderer_set_linestyle(renderer, DIA_LINE_STYLE_SOLID, 0.0); \
\
dia_renderer_draw_polygon(renderer, p, 3, &color_black, &color_black);
@@ -164,7 +164,7 @@ rotate_around_origin (Point *p, real angle) /* FIXME: no namespace */
\
dia_renderer_set_linewidth(renderer, AADL_PORT_LINEWIDTH); \
dia_renderer_set_linejoin(renderer, LINEJOIN_MITER); \
- dia_renderer_set_linestyle(renderer, LINESTYLE_SOLID, 0.0); \
+ dia_renderer_set_linestyle(renderer, DIA_LINE_STYLE_SOLID, 0.0); \
\
dia_renderer_draw_polyline(renderer, p, 3, &color_black);
@@ -193,7 +193,7 @@ rotate_around_origin (Point *p, real angle) /* FIXME: no namespace */
\
dia_renderer_set_linewidth(renderer, AADL_PORT_LINEWIDTH); \
dia_renderer_set_linejoin(renderer, LINEJOIN_MITER); \
- dia_renderer_set_linestyle(renderer, LINESTYLE_SOLID, 0.0); \
+ dia_renderer_set_linestyle(renderer, DIA_LINE_STYLE_SOLID, 0.0); \
\
dia_renderer_draw_polygon(renderer, p, 4, &color_black, &color_black);
@@ -222,7 +222,7 @@ rotate_around_origin (Point *p, real angle) /* FIXME: no namespace */
\
dia_renderer_set_linewidth(renderer, AADL_PORT_LINEWIDTH); \
dia_renderer_set_linejoin(renderer, LINEJOIN_MITER); \
- dia_renderer_set_linestyle(renderer, LINESTYLE_SOLID, 0.0); \
+ dia_renderer_set_linestyle(renderer, DIA_LINE_STYLE_SOLID, 0.0); \
\
dia_renderer_draw_polygon(renderer, p, 4, NULL, &color_black);
@@ -269,7 +269,7 @@ aadlbox_draw_port (Aadlport *port, DiaRenderer *renderer)
dia_renderer_set_linewidth (renderer, AADL_PORT_LINEWIDTH);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_draw_polygon (renderer, p, 5, &color_white, &color_black);
@@ -305,7 +305,7 @@ aadlbox_draw_port (Aadlport *port, DiaRenderer *renderer)
dia_renderer_set_linewidth (renderer, AADL_PORT_LINEWIDTH);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_draw_polygon (renderer, p, 5, &color_white, &color_black);
@@ -364,7 +364,7 @@ aadlbox_draw_port (Aadlport *port, DiaRenderer *renderer)
dia_renderer_set_linewidth (renderer, AADL_PORT_LINEWIDTH);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_draw_ellipse (renderer,
p,
diff --git a/objects/AADL/aadlprocess.c b/objects/AADL/aadlprocess.c
index 85d84ab67..fdcb833c1 100644
--- a/objects/AADL/aadlprocess.c
+++ b/objects/AADL/aadlprocess.c
@@ -28,12 +28,12 @@
void
-aadlbox_draw_inclined_box (Aadlbox *aadlbox,
- DiaRenderer *renderer,
- LineStyle linestyle)
+aadlbox_draw_inclined_box (Aadlbox *aadlbox,
+ DiaRenderer *renderer,
+ DiaLineStyle linestyle)
{
Element *elem;
- real x, y, w, h;
+ double x, y, w, h;
Point points[4];
assert(aadlbox != NULL);
@@ -68,7 +68,7 @@ aadlbox_draw_inclined_box (Aadlbox *aadlbox,
static void aadlprocess_draw_borders(Aadlbox *aadlbox, DiaRenderer *renderer)
{
- aadlbox_draw_inclined_box(aadlbox, renderer, LINESTYLE_SOLID);
+ aadlbox_draw_inclined_box(aadlbox, renderer, DIA_LINE_STYLE_SOLID);
}
diff --git a/objects/AADL/aadlprocessor.c b/objects/AADL/aadlprocessor.c
index 4eef01a6a..0d67263c1 100644
--- a/objects/AADL/aadlprocessor.c
+++ b/objects/AADL/aadlprocessor.c
@@ -46,7 +46,7 @@ aadlprocessor_draw_borders (Aadlbox *aadlbox, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, AADLBOX_BORDERWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
points[0].x = x; points[0].y = y;
points[1].x = x + w; points[1].y = y + h;
diff --git a/objects/AADL/aadlsubprogram.c b/objects/AADL/aadlsubprogram.c
index 2a5a6f512..fdc75389b 100644
--- a/objects/AADL/aadlsubprogram.c
+++ b/objects/AADL/aadlsubprogram.c
@@ -48,7 +48,7 @@ aadlsubprogram_draw_borders (Aadlbox *aadlbox, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, AADLBOX_BORDERWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_draw_ellipse (renderer,
¢er,
diff --git a/objects/AADL/aadlsystem.c b/objects/AADL/aadlsystem.c
index c3838bf5d..085597513 100644
--- a/objects/AADL/aadlsystem.c
+++ b/objects/AADL/aadlsystem.c
@@ -27,12 +27,12 @@
***********************************************/
void
-aadlbox_draw_rounded_box (Aadlbox *aadlbox,
- DiaRenderer *renderer,
- LineStyle linestyle)
+aadlbox_draw_rounded_box (Aadlbox *aadlbox,
+ DiaRenderer *renderer,
+ DiaLineStyle linestyle)
{
Element *elem;
- real x, y, w, h;
+ double x, y, w, h;
BezPoint bez[9];
assert(aadlbox != NULL);
@@ -98,13 +98,13 @@ aadlbox_draw_rounded_box (Aadlbox *aadlbox,
}
-
static void
aadlsystem_draw_borders (Aadlbox *aadlbox, DiaRenderer *renderer)
{
- aadlbox_draw_rounded_box (aadlbox, renderer, LINESTYLE_SOLID);
+ aadlbox_draw_rounded_box (aadlbox, renderer, DIA_LINE_STYLE_SOLID);
}
+
static Aadlbox_specific aadlsystem_specific =
{
(AadlProjectionFunc) aadldata_project_point_on_nearest_border,
diff --git a/objects/AADL/aadlthread.c b/objects/AADL/aadlthread.c
index 3a6068638..c091ff525 100644
--- a/objects/AADL/aadlthread.c
+++ b/objects/AADL/aadlthread.c
@@ -27,15 +27,18 @@
***********************************************/
/* same as process */
-static void aadlthread_draw_borders(Aadlbox *aadlbox, DiaRenderer *renderer)
+static void
+aadlthread_draw_borders (Aadlbox *aadlbox, DiaRenderer *renderer)
{
- aadlbox_draw_inclined_box(aadlbox, renderer, LINESTYLE_DASHED);
+ aadlbox_draw_inclined_box (aadlbox, renderer, DIA_LINE_STYLE_DASHED);
}
-static void aadlthread_draw(Aadlbox *aadlbox, DiaRenderer *renderer)
+
+static void
+aadlthread_draw (Aadlbox *aadlbox, DiaRenderer *renderer)
{
- aadlthread_draw_borders(aadlbox, renderer);
- aadlbox_draw(aadlbox, renderer);
+ aadlthread_draw_borders (aadlbox, renderer);
+ aadlbox_draw (aadlbox, renderer);
}
static Aadlbox_specific aadlthread_specific =
@@ -90,7 +93,7 @@ static DiaObject *aadlthread_create(Point *startpoint, void *user_data, Handle *
obj->type = &aadlthread_type;
obj->ops = &aadlthread_ops;
-
+
return obj;
}
@@ -100,7 +103,7 @@ aadlthread_load(ObjectNode obj_node, int version, DiaContext *ctx)
DiaObject *obj;
Point startpoint = {0.0,0.0};
Handle *handle1,*handle2;
-
+
obj = aadlthread_create(&startpoint,&aadlthread_specific, &handle1,&handle2);
aadlbox_load(obj_node, version, ctx, (Aadlbox *) obj);
return obj;
diff --git a/objects/AADL/aadlthreadgroup.c b/objects/AADL/aadlthreadgroup.c
index a2b7ef2e7..e7bb1329a 100644
--- a/objects/AADL/aadlthreadgroup.c
+++ b/objects/AADL/aadlthreadgroup.c
@@ -31,13 +31,14 @@
#define AADL_THREADGROUP_CORNER_SIZE_FACTOR 0.25
-static void aadlthreadgroup_draw_borders(Aadlbox *aadlbox, DiaRenderer *renderer)
+static void
+aadlthreadgroup_draw_borders (Aadlbox *aadlbox, DiaRenderer *renderer)
{
- aadlbox_draw_rounded_box(aadlbox, renderer, LINESTYLE_DASHED);
+ aadlbox_draw_rounded_box (aadlbox, renderer, DIA_LINE_STYLE_DASHED);
}
-static Aadlbox_specific aadlthreadgroup_specific =
-{
+
+static Aadlbox_specific aadlthreadgroup_specific = {
(AadlProjectionFunc) aadldata_project_point_on_nearest_border,
(AadlTextPosFunc) aadldata_text_position,
(AadlSizeFunc) aadldata_minsize
@@ -93,7 +94,7 @@ static DiaObject *aadlthreadgroup_create(Point *startpoint, void *user_data, Han
obj->type = &aadlthreadgroup_type;
obj->ops = &aadlthreadgroup_ops;
-
+
return obj;
}
@@ -103,8 +104,8 @@ aadlthreadgroup_load(ObjectNode obj_node, int version, DiaContext *ctx)
DiaObject *obj;
Point startpoint = {0.0,0.0};
Handle *handle1,*handle2;
-
- obj = aadlthreadgroup_create(&startpoint, &aadlthreadgroup_specific,
+
+ obj = aadlthreadgroup_create(&startpoint, &aadlthreadgroup_specific,
&handle1,&handle2);
aadlbox_load(obj_node, version, ctx, (Aadlbox *) obj);
return obj;
diff --git a/objects/Database/database.h b/objects/Database/database.h
index d7dd4f4a8..2ac1dfe65 100644
--- a/objects/Database/database.h
+++ b/objects/Database/database.h
@@ -134,26 +134,26 @@ struct _TableState {
struct _TableReference {
OrthConn orth; /* inheritance */
- real line_width;
- real dashlength;
- LineStyle line_style;
+ double line_width;
+ double dashlength;
+ DiaLineStyle line_style;
Color line_color;
Color text_color;
- gchar * start_point_desc;
- gchar * end_point_desc;
+ char *start_point_desc;
+ char *end_point_desc;
Arrow end_arrow;
- real corner_radius;
+ double corner_radius;
- DiaFont * normal_font;
- real normal_font_height;
+ DiaFont *normal_font;
+ double normal_font_height;
/* computed data */
- real sp_desc_width; /* start-point */
+ double sp_desc_width; /* start-point */
Point sp_desc_pos; /* start-point */
Alignment sp_desc_text_align; /* start-point */
- real ep_desc_width; /* end-point */
+ double ep_desc_width; /* end-point */
Point ep_desc_pos; /* end-point */
Alignment ep_desc_text_align; /* end-point */
};
diff --git a/objects/Database/table.c b/objects/Database/table.c
index 9fa4a4657..5b4628988 100644
--- a/objects/Database/table.c
+++ b/objects/Database/table.c
@@ -559,7 +559,7 @@ table_draw (Table *table, DiaRenderer *renderer)
dia_renderer_set_linewidth (renderer, table->border_width);
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
elem = &table->element;
diff --git a/objects/ER/attribute.c b/objects/ER/attribute.c
index 4e4adc0d8..0a400d2f8 100644
--- a/objects/ER/attribute.c
+++ b/objects/ER/attribute.c
@@ -277,9 +277,9 @@ attribute_draw (Attribute *attribute, DiaRenderer *renderer)
dia_renderer_set_linewidth (renderer, attribute->border_width);
if (attribute->derived) {
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, 0.3);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DASHED, 0.3);
} else {
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
}
dia_renderer_draw_ellipse (renderer,
@@ -313,9 +313,9 @@ attribute_draw (Attribute *attribute, DiaRenderer *renderer)
if (attribute->key || attribute->weakkey) {
if (attribute->weakkey) {
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, 0.3);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DASHED, 0.3);
} else {
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
}
width = dia_font_string_width (attribute->name,
attribute->font,
diff --git a/objects/ER/entity.c b/objects/ER/entity.c
index f17cf3893..7fbd841ca 100644
--- a/objects/ER/entity.c
+++ b/objects/ER/entity.c
@@ -246,7 +246,7 @@ entity_draw (Entity *entity, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, entity->border_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_draw_rect (renderer,
@@ -280,7 +280,7 @@ entity_draw (Entity *entity, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, entity->border_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_draw_polygon (renderer, corners, 4,
diff --git a/objects/ER/participation.c b/objects/ER/participation.c
index 03a2d6068..723b4de27 100644
--- a/objects/ER/participation.c
+++ b/objects/ER/participation.c
@@ -216,7 +216,7 @@ participation_draw (Participation *participation, DiaRenderer *renderer)
last_right = 0.0;
dia_renderer_set_linewidth (renderer, PARTICIPATION_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
diff --git a/objects/ER/relationship.c b/objects/ER/relationship.c
index 54f9863d7..982e0258c 100644
--- a/objects/ER/relationship.c
+++ b/objects/ER/relationship.c
@@ -275,7 +275,7 @@ relationship_draw (Relationship *relationship, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, relationship->border_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_draw_polygon (renderer,
diff --git a/objects/FS/flow-ortho.c b/objects/FS/flow-ortho.c
index 6530a234a..3e0010ce6 100644
--- a/objects/FS/flow-ortho.c
+++ b/objects/FS/flow-ortho.c
@@ -397,17 +397,17 @@ orthflow_draw (Orthflow *orthflow, DiaRenderer *renderer)
switch (orthflow->type) {
case ORTHFLOW_SIGNAL:
linewidth = ORTHFLOW_WIDTH;
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, ORTHFLOW_DASHLEN);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DASHED, ORTHFLOW_DASHLEN);
render_color = &orthflow_color_signal;
break ;
case ORTHFLOW_MATERIAL:
linewidth = ORTHFLOW_MATERIAL_WIDTH;
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
render_color = &orthflow_color_material;
break ;
case ORTHFLOW_ENERGY:
linewidth = ORTHFLOW_WIDTH;
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
render_color = &orthflow_color_energy;
break ;
default:
diff --git a/objects/FS/flow.c b/objects/FS/flow.c
index 6beca65a6..8cf814f08 100644
--- a/objects/FS/flow.c
+++ b/objects/FS/flow.c
@@ -334,17 +334,17 @@ flow_draw (Flow *flow, DiaRenderer *renderer)
switch (flow->type) {
case FLOW_SIGNAL:
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, FLOW_DASHLEN);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DASHED, FLOW_DASHLEN);
render_color = &flow_color_signal ;
break ;
case FLOW_MATERIAL:
dia_renderer_set_linewidth (renderer, FLOW_MATERIAL_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
render_color = &flow_color_material;
break ;
case FLOW_ENERGY:
render_color = &flow_color_energy;
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
break;
default:
g_return_if_reached ();
diff --git a/objects/FS/function.c b/objects/FS/function.c
index 3ca07fec0..226398130 100644
--- a/objects/FS/function.c
+++ b/objects/FS/function.c
@@ -347,10 +347,10 @@ function_draw (Function *pkg, DiaRenderer *renderer)
dia_renderer_set_linewidth (renderer,
font_height / FUNCTION_BORDERWIDTH_SCALE);
if (pkg->is_wish) {
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED,
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DASHED,
font_height / FUNCTION_DASHLENGTH_SCALE);
} else {
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
}
p1.x = x; p1.y = y;
diff --git a/objects/GRAFCET/action.c b/objects/GRAFCET/action.c
index 56ee610d0..1841ba67d 100644
--- a/objects/GRAFCET/action.c
+++ b/objects/GRAFCET/action.c
@@ -327,7 +327,7 @@ action_draw (Action *action, DiaRenderer *renderer)
Color cl;
dia_renderer_set_linewidth (renderer, ACTION_LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
/* first, draw the line or polyline from the step to the action label */
diff --git a/objects/GRAFCET/action_text_draw.c b/objects/GRAFCET/action_text_draw.c
index 71e4afb47..eb432dab3 100644
--- a/objects/GRAFCET/action_text_draw.c
+++ b/objects/GRAFCET/action_text_draw.c
@@ -98,7 +98,7 @@ action_text_draw (Text *text, DiaRenderer *renderer)
p2.x = curs_x;
p2.y = curs_y + text->height;
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linewidth (renderer, 0.1);
dia_renderer_draw_line (renderer, &p1, &p2, &color_black);
}
diff --git a/objects/GRAFCET/boolequation.c b/objects/GRAFCET/boolequation.c
index 338891587..edb4f4cfe 100644
--- a/objects/GRAFCET/boolequation.c
+++ b/objects/GRAFCET/boolequation.c
@@ -308,7 +308,7 @@ overlineblock_draw (Block *block, Boolequation *booleq, DiaRenderer *renderer)
Point ul,ur;
g_assert(block); g_assert(block->type == BLOCK_OVERLINE);
block->d.inside->ops->draw (block->d.inside,booleq,renderer);
- dia_renderer_set_linestyle (renderer,LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linewidth (renderer,booleq->fontheight * OVERLINE_RATIO);
ul.x = block->bl.x;
ur.y = ul.y = block->ur.y;
diff --git a/objects/GRAFCET/condition.c b/objects/GRAFCET/condition.c
index 1c212066c..f065c5864 100644
--- a/objects/GRAFCET/condition.c
+++ b/objects/GRAFCET/condition.c
@@ -347,7 +347,7 @@ condition_draw (Condition *condition, DiaRenderer *renderer)
Connection *conn = &condition->connection;
dia_renderer_set_linewidth (renderer, CONDITION_LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
if (CONDITION_ARROW_SIZE > (CONDITION_LINE_WIDTH/2.0)) {
diff --git a/objects/GRAFCET/step.c b/objects/GRAFCET/step.c
index 756c99295..b0a13e345 100644
--- a/objects/GRAFCET/step.c
+++ b/objects/GRAFCET/step.c
@@ -395,7 +395,7 @@ step_draw (Step *step, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, STEP_LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
pts[0] = step->north.pos;
diff --git a/objects/GRAFCET/transition.c b/objects/GRAFCET/transition.c
index 3303636c9..5a54bd97e 100644
--- a/objects/GRAFCET/transition.c
+++ b/objects/GRAFCET/transition.c
@@ -388,7 +388,7 @@ transition_draw (Transition *transition, DiaRenderer *renderer)
{
Point pts[6];
dia_renderer_set_linewidth (renderer, TRANSITION_LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
pts[0] = transition->north.pos;
diff --git a/objects/GRAFCET/vector.c b/objects/GRAFCET/vector.c
index af51e08c5..2cca52ca6 100644
--- a/objects/GRAFCET/vector.c
+++ b/objects/GRAFCET/vector.c
@@ -216,7 +216,7 @@ arc_draw (Arc *arc, DiaRenderer *renderer)
n = orth->numpoints;
dia_renderer_set_linewidth (renderer, ARC_LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
diff --git a/objects/GRAFCET/vergent.c b/objects/GRAFCET/vergent.c
index a25f3dc35..d8a22250f 100644
--- a/objects/GRAFCET/vergent.c
+++ b/objects/GRAFCET/vergent.c
@@ -275,7 +275,7 @@ vergent_draw (Vergent *vergent, DiaRenderer *renderer)
Connection *conn = &vergent->connection;
Point p1,p2;
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
switch(vergent->type) {
case VERGENT_OR:
diff --git a/objects/Istar/goal.c b/objects/Istar/goal.c
index 693498ebc..1644207f6 100644
--- a/objects/Istar/goal.c
+++ b/objects/Istar/goal.c
@@ -353,7 +353,7 @@ goal_draw (Goal *goal, DiaRenderer *renderer)
elem = &goal->element;
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linewidth (renderer, GOAL_LINE_WIDTH);
diff --git a/objects/Istar/link.c b/objects/Istar/link.c
index 50e64ec9f..6030bff8c 100644
--- a/objects/Istar/link.c
+++ b/objects/Istar/link.c
@@ -505,7 +505,7 @@ link_draw (Link *link, DiaRenderer *renderer)
/** drawing line **/
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linewidth (renderer, w);
dia_renderer_draw_bezier_with_arrows (renderer,
link->line,
diff --git a/objects/Istar/other.c b/objects/Istar/other.c
index a31cfa2f4..351af1cba 100644
--- a/objects/Istar/other.c
+++ b/objects/Istar/other.c
@@ -338,7 +338,7 @@ other_draw (Other *other, DiaRenderer *renderer)
elem = &other->element;
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
switch (other->type) {
diff --git a/objects/Jackson/domain.c b/objects/Jackson/domain.c
index f6950ff40..8f6da3fe6 100644
--- a/objects/Jackson/domain.c
+++ b/objects/Jackson/domain.c
@@ -392,7 +392,7 @@ jackson_box_draw (Box *box, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, JACKSON_BOX_LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_draw_rect (renderer, &b0, &b1,
diff --git a/objects/Jackson/phenomenon.c b/objects/Jackson/phenomenon.c
index 646ec79a3..31a4ea257 100644
--- a/objects/Jackson/phenomenon.c
+++ b/objects/Jackson/phenomenon.c
@@ -272,10 +272,12 @@ message_draw (Message *message, DiaRenderer *renderer)
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
if (message->type==MSG_REQ) {
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, MESSAGE_DASHLEN);
+ dia_renderer_set_linestyle (renderer,
+ DIA_LINE_STYLE_DASHED,
+ MESSAGE_DASHLEN);
arrow.type = ARROW_FILLED_TRIANGLE;
} else {
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
arrow.type = ARROW_NONE;
}
diff --git a/objects/Jackson/requirement.c b/objects/Jackson/requirement.c
index e7925ce0a..e683b25a6 100644
--- a/objects/Jackson/requirement.c
+++ b/objects/Jackson/requirement.c
@@ -239,7 +239,7 @@ req_draw (Requirement *req, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, REQ_LINEWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, REQ_DASHLEN);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DASHED, REQ_DASHLEN);
dia_renderer_draw_ellipse (renderer, &c, w, h, &color_white, &color_black);
diff --git a/objects/KAOS/goal.c b/objects/KAOS/goal.c
index 5bd10314d..fd62b0917 100644
--- a/objects/KAOS/goal.c
+++ b/objects/KAOS/goal.c
@@ -458,7 +458,7 @@ goal_draw (Goal *goal, DiaRenderer *renderer)
break;
}
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
if (goal->type != SOFTGOAL) {
diff --git a/objects/KAOS/metaandorrel.c b/objects/KAOS/metaandorrel.c
index 88fac883d..f24ce4724 100644
--- a/objects/KAOS/metaandorrel.c
+++ b/objects/KAOS/metaandorrel.c
@@ -446,8 +446,14 @@ maor_draw (Maor *maor, DiaRenderer *renderer)
/** drawing directed line **/
dia_renderer_set_linewidth (renderer, MAOR_WIDTH);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0);
- dia_renderer_draw_line_with_arrows (renderer,&p1,&p2,MAOR_WIDTH,&MAOR_FG_COLOR,NULL,&arrow);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0);
+ dia_renderer_draw_line_with_arrows (renderer,
+ &p1,
+ &p2,
+ MAOR_WIDTH,
+ &MAOR_FG_COLOR,
+ NULL,
+ &arrow);
/** drawing vector decoration **/
/* and ref */
diff --git a/objects/KAOS/metabinrel.c b/objects/KAOS/metabinrel.c
index c07c9401f..0daa782b2 100644
--- a/objects/KAOS/metabinrel.c
+++ b/objects/KAOS/metabinrel.c
@@ -403,7 +403,7 @@ mbr_draw (Mbr *mbr, DiaRenderer *renderer)
/** drawing directed line **/
dia_renderer_set_linewidth (renderer, MBR_WIDTH);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dx=p1.x-p2.x;
dy=p1.y-p2.y;
diff --git a/objects/KAOS/other.c b/objects/KAOS/other.c
index 5ba2df68d..ce4e20122 100644
--- a/objects/KAOS/other.c
+++ b/objects/KAOS/other.c
@@ -389,7 +389,7 @@ other_draw (Other *other, DiaRenderer *renderer)
assert(other != NULL);
assert(renderer != NULL);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
if (other->type==AGENT) {
diff --git a/objects/Misc/analog_clock.c b/objects/Misc/analog_clock.c
index f5f218a07..3559500e8 100644
--- a/objects/Misc/analog_clock.c
+++ b/objects/Misc/analog_clock.c
@@ -315,7 +315,7 @@ analog_clock_draw (Analog_Clock *analog_clock, DiaRenderer *renderer)
g_assert(renderer != NULL);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0);
dia_renderer_set_linewidth (renderer, analog_clock->border_line_width);
dia_renderer_draw_ellipse (renderer,
diff --git a/objects/Misc/grid_object.c b/objects/Misc/grid_object.c
index 027a9d217..6b47d15dd 100644
--- a/objects/Misc/grid_object.c
+++ b/objects/Misc/grid_object.c
@@ -329,7 +329,7 @@ grid_object_draw (Grid_Object *grid_object, DiaRenderer *renderer)
lr_corner.y = elem->corner.y + elem->height;
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
/* draw gridlines */
dia_renderer_set_linewidth (renderer,
diff --git a/objects/Misc/measure.c b/objects/Misc/measure.c
index 1357cc324..93b8c1a56 100644
--- a/objects/Misc/measure.c
+++ b/objects/Misc/measure.c
@@ -266,7 +266,7 @@ measure_draw (Measure *measure, DiaRenderer *renderer)
Arrow arrow = MEASURE_ARROW(measure);
dia_renderer_set_linewidth (renderer, measure->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_ROUND);
diff --git a/objects/Misc/n_gon.c b/objects/Misc/n_gon.c
index 93d579f37..4fd2599d5 100644
--- a/objects/Misc/n_gon.c
+++ b/objects/Misc/n_gon.c
@@ -59,10 +59,10 @@ struct _Ngon {
int density;
int last_density; /*!< last value to decide direction */
- LineStyle line_style;
+ DiaLineStyle line_style;
LineJoin line_join;
- real dashlength;
- real line_width;
+ double dashlength;
+ double line_width;
Color stroke;
Color fill;
gboolean show_background;
diff --git a/objects/Misc/tree.c b/objects/Misc/tree.c
index a02a4bef5..0201b7c1c 100644
--- a/objects/Misc/tree.c
+++ b/objects/Misc/tree.c
@@ -324,7 +324,7 @@ tree_draw (Tree *tree, DiaRenderer *renderer)
endpoints = &tree->real_ends[0];
dia_renderer_set_linewidth (renderer, LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
dia_renderer_draw_line (renderer,
diff --git a/objects/SADT/annotation.c b/objects/SADT/annotation.c
index d3654a3bc..86104e70b 100644
--- a/objects/SADT/annotation.c
+++ b/objects/SADT/annotation.c
@@ -283,7 +283,7 @@ annotation_draw (Annotation *annotation, DiaRenderer *renderer)
assert(renderer != NULL);
dia_renderer_set_linewidth (renderer, ANNOTATION_LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
vect = annotation->connection.endpoints[1];
diff --git a/objects/SADT/arrow.c b/objects/SADT/arrow.c
index c7782f790..0a228a418 100644
--- a/objects/SADT/arrow.c
+++ b/objects/SADT/arrow.c
@@ -259,7 +259,7 @@ sadtarrow_draw (Sadtarrow *sadtarrow, DiaRenderer *renderer)
n = orth->numpoints;
dia_renderer_set_linewidth (renderer, ARROW_LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
col = sadtarrow->line_color;
diff --git a/objects/SADT/box.c b/objects/SADT/box.c
index 95fc2cb05..2de44562e 100644
--- a/objects/SADT/box.c
+++ b/objects/SADT/box.c
@@ -307,7 +307,7 @@ sadtbox_draw (Box *box, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, SADTBOX_LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_draw_rect (renderer,
diff --git a/objects/UML/activity.c b/objects/UML/activity.c
index c23338f4f..b19fe3592 100644
--- a/objects/UML/activity.c
+++ b/objects/UML/activity.c
@@ -222,7 +222,7 @@ state_draw(State *state, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, STATE_LINEWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
p1.x = x;
p1.y = y;
diff --git a/objects/UML/actor.c b/objects/UML/actor.c
index 2b9a6b776..12432ab18 100644
--- a/objects/UML/actor.c
+++ b/objects/UML/actor.c
@@ -236,7 +236,7 @@ actor_draw(Actor *actor, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, actor->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
r = ACTOR_HEAD (actor_height);
r1 = 2*r;
diff --git a/objects/UML/association.c b/objects/UML/association.c
index 6c03cbac6..69b9109b8 100644
--- a/objects/UML/association.c
+++ b/objects/UML/association.c
@@ -430,7 +430,7 @@ association_draw (Association *assoc, DiaRenderer *renderer)
n = orth->numpoints;
dia_renderer_set_linewidth (renderer, assoc->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
diff --git a/objects/UML/branch.c b/objects/UML/branch.c
index bd1b51957..b54aa3b65 100644
--- a/objects/UML/branch.c
+++ b/objects/UML/branch.c
@@ -214,7 +214,7 @@ branch_draw (Branch *branch, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, BRANCH_BORDERWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_draw_polygon (renderer, points, 4, &branch->fill_color, &branch->line_color);
}
diff --git a/objects/UML/class.c b/objects/UML/class.c
index ce5de0233..6916df1d1 100644
--- a/objects/UML/class.c
+++ b/objects/UML/class.c
@@ -1202,7 +1202,7 @@ umlclass_draw_template_parameters_box (UMLClass *umlclass,
LowerRight.x += umlclass->templates_width;
LowerRight.y += umlclass->templates_height;
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, 0.3);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DASHED, 0.3);
dia_renderer_draw_rect (renderer, &UpperLeft, &LowerRight, fill_color, line_color);
TextInsert.x += 0.3;
@@ -1247,7 +1247,7 @@ umlclass_draw (UMLClass *umlclass, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, umlclass->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
elem = ¨class->element;
diff --git a/objects/UML/classicon.c b/objects/UML/classicon.c
index 959e3752b..2060fd89d 100644
--- a/objects/UML/classicon.c
+++ b/objects/UML/classicon.c
@@ -263,7 +263,7 @@ classicon_draw (Classicon *icon, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, icon->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_draw_ellipse (renderer,
¢er,
diff --git a/objects/UML/component.c b/objects/UML/component.c
index 383b5a4b8..5e166f389 100644
--- a/objects/UML/component.c
+++ b/objects/UML/component.c
@@ -239,7 +239,7 @@ component_draw (Component *cmp, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, COMPONENT_BORDERWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
p1.x = x + COMPONENT_CWIDTH/2; p1.y = y;
p2.x = x+w; p2.y = y+h;
diff --git a/objects/UML/component_feature.c b/objects/UML/component_feature.c
index 40778fb85..2b286ca11 100644
--- a/objects/UML/component_feature.c
+++ b/objects/UML/component_feature.c
@@ -342,7 +342,7 @@ compfeat_draw (Compfeat *compfeat, DiaRenderer *renderer)
n = orth->numpoints;
dia_renderer_set_linewidth (renderer, compfeat->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
if (compfeat->orth.orientation[orth->numorient - 1] == HORIZONTAL) {
diff --git a/objects/UML/constraint.c b/objects/UML/constraint.c
index f67b190ce..77d8cfaac 100644
--- a/objects/UML/constraint.c
+++ b/objects/UML/constraint.c
@@ -256,7 +256,7 @@ constraint_draw (Constraint *constraint, DiaRenderer *renderer)
endpoints = &constraint->connection.endpoints[0];
dia_renderer_set_linewidth (renderer, constraint->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, CONSTRAINT_DASHLEN);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DASHED, CONSTRAINT_DASHLEN);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
arrow.type = ARROW_LINES;
diff --git a/objects/UML/dependency.c b/objects/UML/dependency.c
index a1869f792..5ef604439 100644
--- a/objects/UML/dependency.c
+++ b/objects/UML/dependency.c
@@ -247,7 +247,9 @@ dependency_draw (Dependency *dep, DiaRenderer *renderer)
n = orth->numpoints;
dia_renderer_set_linewidth (renderer, dep->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, DEPENDENCY_DASHLEN);
+ dia_renderer_set_linestyle (renderer,
+ DIA_LINE_STYLE_DASHED,
+ DEPENDENCY_DASHLEN);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
diff --git a/objects/UML/fork.c b/objects/UML/fork.c
index 4e6cd6026..8dbc16c48 100644
--- a/objects/UML/fork.c
+++ b/objects/UML/fork.c
@@ -217,7 +217,7 @@ fork_draw (Fork *branch, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, FORK_BORDERWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
p1.x = elem->corner.x;
p1.y = elem->corner.y;
diff --git a/objects/UML/generalization.c b/objects/UML/generalization.c
index f96deb22f..61b19ff54 100644
--- a/objects/UML/generalization.c
+++ b/objects/UML/generalization.c
@@ -242,7 +242,7 @@ generalization_draw (Generalization *genlz, DiaRenderer *renderer)
n = orth->numpoints;
dia_renderer_set_linewidth (renderer, genlz->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
diff --git a/objects/UML/implements.c b/objects/UML/implements.c
index a773db7d8..c60a47e87 100644
--- a/objects/UML/implements.c
+++ b/objects/UML/implements.c
@@ -267,7 +267,7 @@ implements_draw (Implements *implements, DiaRenderer *renderer)
endpoints = &implements->connection.endpoints[0];
dia_renderer_set_linewidth (renderer, implements->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
dia_renderer_draw_line (renderer,
diff --git a/objects/UML/large_package.c b/objects/UML/large_package.c
index 9e4d7fbcd..9f5eea3c2 100644
--- a/objects/UML/large_package.c
+++ b/objects/UML/large_package.c
@@ -257,7 +257,7 @@ largepackage_draw (LargePackage *pkg, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, pkg->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
p1.x = x; p1.y = y;
diff --git a/objects/UML/lifeline.c b/objects/UML/lifeline.c
index 50b7d6a92..22d2a713c 100644
--- a/objects/UML/lifeline.c
+++ b/objects/UML/lifeline.c
@@ -380,7 +380,9 @@ lifeline_draw (Lifeline *lifeline, DiaRenderer *renderer)
endpoints = &lifeline->connection.endpoints[0];
dia_renderer_set_linewidth (renderer, LIFELINE_LINEWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, LIFELINE_DASHLEN);
+ dia_renderer_set_linestyle (renderer,
+ DIA_LINE_STYLE_DASHED,
+ LIFELINE_DASHLEN);
/* Ok, instead rendering one big line between two endpoints we just
from endpoints to rtop and rbottom respectively.
@@ -401,7 +403,7 @@ lifeline_draw (Lifeline *lifeline, DiaRenderer *renderer)
dia_renderer_set_linewidth (renderer, LIFELINE_BOXWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
p1.x = endpoints[0].x - LIFELINE_WIDTH/2.0;
p1.y = endpoints[0].y + lifeline->rtop;
diff --git a/objects/UML/message.c b/objects/UML/message.c
index b37d52a0e..b2616bf5d 100644
--- a/objects/UML/message.c
+++ b/objects/UML/message.c
@@ -307,11 +307,13 @@ message_draw (Message *message, DiaRenderer *renderer)
}
if (message->type==MESSAGE_RETURN) {
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, MESSAGE_DASHLEN);
+ dia_renderer_set_linestyle (renderer,
+ DIA_LINE_STYLE_DASHED,
+ MESSAGE_DASHLEN);
n1 = 0;
n2 = 1;
} else {
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
}
p1 = endpoints[n1];
p2 = endpoints[n2];
diff --git a/objects/UML/node.c b/objects/UML/node.c
index 8cbfca6dd..1d9b61a57 100644
--- a/objects/UML/node.c
+++ b/objects/UML/node.c
@@ -243,7 +243,7 @@ node_draw (Node *node, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, node->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
/* Draw outer box */
points[0].x = x; points[0].y = y;
diff --git a/objects/UML/note.c b/objects/UML/note.c
index 570ae5b7c..af6be1530 100644
--- a/objects/UML/note.c
+++ b/objects/UML/note.c
@@ -227,7 +227,7 @@ note_draw (Note *note, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, note->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
poly[0].x = x;
poly[0].y = y;
diff --git a/objects/UML/object.c b/objects/UML/object.c
index 57aa176cd..331338a2e 100644
--- a/objects/UML/object.c
+++ b/objects/UML/object.c
@@ -293,7 +293,7 @@ objet_draw (Objet *ob, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, bw);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
p1.x = x; p1.y = y;
diff --git a/objects/UML/realizes.c b/objects/UML/realizes.c
index 05ec8a84f..e771e9956 100644
--- a/objects/UML/realizes.c
+++ b/objects/UML/realizes.c
@@ -241,7 +241,7 @@ realizes_draw (Realizes *realize, DiaRenderer *renderer)
n = orth->numpoints;
dia_renderer_set_linewidth (renderer, realize->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, REALIZES_DASHLEN);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DASHED, REALIZES_DASHLEN);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
diff --git a/objects/UML/small_package.c b/objects/UML/small_package.c
index af27dcf1c..d4b5d0f73 100644
--- a/objects/UML/small_package.c
+++ b/objects/UML/small_package.c
@@ -251,7 +251,7 @@ smallpackage_draw (SmallPackage *pkg, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, pkg->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
p1.x = x; p1.y = y;
p2.x = x+w; p2.y = y+h;
diff --git a/objects/UML/state.c b/objects/UML/state.c
index 14bacd698..550da5f04 100644
--- a/objects/UML/state.c
+++ b/objects/UML/state.c
@@ -284,7 +284,7 @@ state_draw (State *state, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, state->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
if (state->state_type!=STATE_NORMAL) {
p1.x = x + w/2;
diff --git a/objects/UML/state_term.c b/objects/UML/state_term.c
index da339f4fe..33d45c20f 100644
--- a/objects/UML/state_term.c
+++ b/objects/UML/state_term.c
@@ -210,7 +210,7 @@ state_draw (State *state, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linewidth (renderer, STATE_LINEWIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0);
p1.x = x + w/2;
p1.y = y + h/2;
diff --git a/objects/UML/transition.c b/objects/UML/transition.c
index 0c2133d1b..7298171b5 100644
--- a/objects/UML/transition.c
+++ b/objects/UML/transition.c
@@ -370,7 +370,7 @@ transition_draw (Transition *transition, DiaRenderer *renderer)
dia_renderer_set_linewidth (renderer, TRANSITION_WIDTH);
/* TODO, find out about the meaning of this... */
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
if (transition->direction_inverted) {
start_arrow = &arrow;
diff --git a/objects/UML/usecase.c b/objects/UML/usecase.c
index 19db659c7..40bdc4c35 100644
--- a/objects/UML/usecase.c
+++ b/objects/UML/usecase.c
@@ -261,9 +261,9 @@ usecase_draw (Usecase *usecase, DiaRenderer *renderer)
dia_renderer_set_linewidth (renderer, usecase->line_width);
if (usecase->collaboration)
- dia_renderer_set_linestyle (renderer, LINESTYLE_DASHED, 1.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DASHED, 1.0);
else
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_draw_ellipse (renderer,
&c,
diff --git a/objects/chronogram/chronoline.c b/objects/chronogram/chronoline.c
index c33fb9d0e..00ab53d0a 100644
--- a/objects/chronogram/chronoline.c
+++ b/objects/chronogram/chronoline.c
@@ -413,7 +413,7 @@ chronoline_draw_really (Chronoline *chronoline,
lst = chronoline->evtlist;
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linewidth (renderer, chronoline->data_lwidth);
while (lst) {
@@ -467,7 +467,7 @@ chronoline_draw (Chronoline *chronoline, DiaRenderer *renderer)
elem = &chronoline->element;
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
- dia_renderer_set_linestyle (renderer, LINESTYLE_DOTTED, 1.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DOTTED, 1.0);
dia_renderer_set_linewidth (renderer, chronoline->main_lwidth);
p1.x = elem->corner.x + elem->width;
p1.y = elem->corner.y;
@@ -476,7 +476,7 @@ chronoline_draw (Chronoline *chronoline, DiaRenderer *renderer)
chronoline_draw_really (chronoline,renderer,TRUE);
chronoline_draw_really (chronoline,renderer,FALSE);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
lr_corner.x = elem->corner.x + elem->width;
lr_corner.y = elem->corner.y + elem->height;
diff --git a/objects/chronogram/chronoref.c b/objects/chronogram/chronoref.c
index e8d2bb6d8..93e8adf96 100644
--- a/objects/chronogram/chronoref.c
+++ b/objects/chronogram/chronoref.c
@@ -283,7 +283,7 @@ chronoref_draw(Chronoref *chronoref, DiaRenderer *renderer)
elem = &chronoref->element;
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
diff --git a/objects/custom/custom_object.c b/objects/custom/custom_object.c
index a1d51dc8f..0fa219cfd 100644
--- a/objects/custom/custom_object.c
+++ b/objects/custom/custom_object.c
@@ -100,7 +100,7 @@ struct _Custom {
Color border_color;
Color inner_color;
gboolean show_background;
- LineStyle line_style;
+ DiaLineStyle line_style;
double dashlength;
gboolean flip_h, flip_v;
@@ -125,15 +125,30 @@ static DiaObjectChange *custom_move_handle (Custom *custom,
ModifierKeys modifiers);
static DiaObjectChange *custom_move (Custom *custom,
Point *to);
-static void custom_draw(Custom *custom, DiaRenderer *renderer);
-static void custom_draw_displaylist(GList *display_list, Custom *custom,
- DiaRenderer *renderer, GArray *arr, GArray *barr, real* cur_line,
- real* cur_dash, LineCaps* cur_caps, LineJoin* cur_join,
- LineStyle* cur_style);
-static void custom_draw_element(GraphicElement* el, Custom *custom,
- DiaRenderer *renderer, GArray *arr, GArray *barr, real* cur_line,
- real* cur_dash, LineCaps* cur_caps, LineJoin* cur_join,
- LineStyle* cur_style, Color* fg, Color* bg);
+static void custom_draw (Custom *custom,
+ DiaRenderer *renderer);
+static void custom_draw_displaylist (GList *display_list,
+ Custom *custom,
+ DiaRenderer *renderer,
+ GArray *arr,
+ GArray *barr,
+ double *cur_line,
+ double *cur_dash,
+ LineCaps *cur_caps,
+ LineJoin *cur_join,
+ DiaLineStyle *cur_style);
+static void custom_draw_element (GraphicElement *el,
+ Custom *custom,
+ DiaRenderer *renderer,
+ GArray *arr,
+ GArray *barr,
+ double *cur_line,
+ double *cur_dash,
+ LineCaps *cur_caps,
+ LineJoin *cur_join,
+ DiaLineStyle *cur_style,
+ Color *fg,
+ Color *bg);
static void custom_update_data(Custom *custom, AnchorShape h, AnchorShape v);
static void custom_reposition_text(Custom *custom, GraphicElementText *text);
static DiaObject *custom_create(Point *startpoint,
@@ -909,10 +924,10 @@ static void
custom_draw (Custom *custom, DiaRenderer *renderer)
{
static GArray *arr = NULL, *barr = NULL;
- real cur_line = 1.0, cur_dash = 1.0;
+ double cur_line = 1.0, cur_dash = 1.0;
LineCaps cur_caps = LINECAPS_BUTT;
LineJoin cur_join = LINEJOIN_MITER;
- LineStyle cur_style = custom->line_style;
+ DiaLineStyle cur_style = custom->line_style;
assert(custom != NULL);
assert(renderer != NULL);
@@ -950,12 +965,21 @@ custom_draw (Custom *custom, DiaRenderer *renderer)
}
}
+
static void
-custom_draw_displaylist(GList *display_list, Custom *custom, DiaRenderer *renderer,
- GArray *arr, GArray *barr, real* cur_line, real* cur_dash,
- LineCaps* cur_caps, LineJoin* cur_join, LineStyle* cur_style)
+custom_draw_displaylist (GList *display_list,
+ Custom *custom,
+ DiaRenderer *renderer,
+ GArray *arr,
+ GArray *barr,
+ double *cur_line,
+ double *cur_dash,
+ LineCaps *cur_caps,
+ LineJoin *cur_join,
+ DiaLineStyle *cur_style)
{
GList *tmp;
+
for (tmp = display_list; tmp; tmp = tmp->next) {
GraphicElement *el = tmp->data;
Color fg, bg;
@@ -976,11 +1000,11 @@ custom_draw_element (GraphicElement *el,
DiaRenderer *renderer,
GArray *arr,
GArray *barr,
- real *cur_line,
- real *cur_dash,
+ double *cur_line,
+ double *cur_dash,
LineCaps *cur_caps,
LineJoin *cur_join,
- LineStyle *cur_style,
+ DiaLineStyle *cur_style,
Color *fg,
Color *bg)
{
@@ -1011,13 +1035,15 @@ custom_draw_element (GraphicElement *el,
el->any.s.linejoin : LINEJOIN_MITER;
dia_renderer_set_linejoin (renderer, (*cur_join));
}
- if ((el->any.s.linestyle == LINESTYLE_DEFAULT &&
+
+ if ((el->any.s.linestyle == DIA_LINE_STYLE_DEFAULT &&
(*cur_style) != custom->line_style) || el->any.s.linestyle != (*cur_style)) {
- (*cur_style) = (el->any.s.linestyle!=LINESTYLE_DEFAULT) ?
+ (*cur_style) = (el->any.s.linestyle != DIA_LINE_STYLE_DEFAULT) ?
el->any.s.linestyle : custom->line_style;
dia_renderer_set_linestyle (renderer, (*cur_style),
custom->dashlength*(*cur_dash));
}
+
if (el->any.s.dashlength != (*cur_dash)) {
(*cur_dash) = el->any.s.dashlength;
dia_renderer_set_linestyle (renderer,
diff --git a/objects/custom/shape_info.c b/objects/custom/shape_info.c
index 71ff404b8..bf6c8f77f 100644
--- a/objects/custom/shape_info.c
+++ b/objects/custom/shape_info.c
@@ -931,8 +931,15 @@ load_shape_info (const gchar *filename, ShapeInfo *preload)
xmlFree (tmp);
} else if (node->ns == svg_ns && !xmlStrcmp(node->name, (const xmlChar *)"svg")) {
DiaSvgStyle s = {
- 1.0, DIA_SVG_COLOUR_FOREGROUND, 1.0, DIA_SVG_COLOUR_NONE, 1.0,
- LINECAPS_DEFAULT, LINEJOIN_DEFAULT, LINESTYLE_DEFAULT, 1.0
+ 1.0,
+ DIA_SVG_COLOUR_FOREGROUND,
+ 1.0,
+ DIA_SVG_COLOUR_NONE,
+ 1.0,
+ LINECAPS_DEFAULT,
+ LINEJOIN_DEFAULT,
+ DIA_LINE_STYLE_DEFAULT,
+ 1.0
};
dia_svg_parse_style(node, &s, -1);
diff --git a/objects/custom_lines/line_info.c b/objects/custom_lines/line_info.c
index 42a708c3b..c1b466cd7 100644
--- a/objects/custom_lines/line_info.c
+++ b/objects/custom_lines/line_info.c
@@ -86,29 +86,31 @@ line_info_get_line_type( const gchar* filename, xmlNodePtr node )
static guint
-line_info_get_line_style( const gchar* filename, xmlNodePtr node )
+line_info_get_line_style (const char* filename, xmlNodePtr node)
{
- guint res = LINESTYLE_SOLID;
+ guint res = DIA_LINE_STYLE_SOLID;
xmlChar* tmp = xmlNodeGetContent(node);
- if( !strcmp((char*)tmp, "Solid") )
- res = LINESTYLE_SOLID;
- else if( !strcmp((char*)tmp, "Dashed") )
- res = LINESTYLE_DASHED;
- else if( !strcmp((char*)tmp, "Dash-Dot") )
- res = LINESTYLE_DASH_DOT;
- else if( !strcmp((char*)tmp, "Dash-Dot-Dot") )
- res = LINESTYLE_DASH_DOT_DOT;
- else if( !strcmp((char*)tmp, "Dotted") )
- res = LINESTYLE_DOTTED;
- else
- g_warning("%s: `%s' is not a valid line style", filename, tmp);
+ if (!g_strcmp0((char*) tmp, "Solid")) {
+ res = DIA_LINE_STYLE_SOLID;
+ } else if (!g_strcmp0((char*) tmp, "Dashed")) {
+ res = DIA_LINE_STYLE_DASHED;
+ } else if (!g_strcmp0((char*) tmp, "Dash-Dot")) {
+ res = DIA_LINE_STYLE_DASH_DOT;
+ } else if (!g_strcmp0((char*) tmp, "Dash-Dot-Dot")) {
+ res = DIA_LINE_STYLE_DASH_DOT_DOT;
+ } else if (!g_strcmp0((char*) tmp, "Dotted")) {
+ res = DIA_LINE_STYLE_DOTTED;
+ } else {
+ g_warning ("%s: `%s' is not a valid line style", filename, tmp);
+ }
- xmlFree(tmp);
+ dia_clear_xml_string (&tmp);
- return( res );
+ return res ;
}
+
static gfloat
line_info_get_as_float( const gchar* filename, xmlNodePtr node )
{
@@ -275,7 +277,7 @@ LineInfo* line_info_load(const gchar *filename)
res->line_color.green = 0.0f;
res->line_color.blue = 0.0f;
res->line_color.alpha = 1.0f;
- res->line_style = LINESTYLE_SOLID;
+ res->line_style = DIA_LINE_STYLE_SOLID;
res->dashlength = 1.0f;
res->line_width = 0.1f;
res->corner_radius = 0.0f;
diff --git a/objects/custom_lines/line_info.h b/objects/custom_lines/line_info.h
index 48c0b2d5b..b47b09aef 100644
--- a/objects/custom_lines/line_info.h
+++ b/objects/custom_lines/line_info.h
@@ -44,18 +44,18 @@ typedef enum {
extern char* custom_linetype_strings[];
typedef struct _LineInfo {
- gchar *line_info_filename;
+ char *line_info_filename;
- gchar *name;
- gchar *icon_filename;
+ char *name;
+ char *icon_filename;
CustomLineType type;
Color line_color;
- LineStyle line_style;
- real dashlength;
- real line_width;
- real corner_radius;
+ DiaLineStyle line_style;
+ double dashlength;
+ double line_width;
+ double corner_radius;
Arrow start_arrow, end_arrow;
-
+
DiaObjectType* object_type;
} LineInfo;
diff --git a/objects/flowchart/box.c b/objects/flowchart/box.c
index e24ab2d2e..5c5d0625a 100644
--- a/objects/flowchart/box.c
+++ b/objects/flowchart/box.c
@@ -55,16 +55,16 @@ struct _Box {
Element element;
ConnectionPoint connections[NUM_CONNECTIONS];
- real border_width;
+ double border_width;
Color border_color;
Color inner_color;
gboolean show_background;
- LineStyle line_style;
- real dashlength;
- real corner_radius;
+ DiaLineStyle line_style;
+ double dashlength;
+ double corner_radius;
Text *text;
- real padding;
+ double padding;
TextFitting text_fitting;
};
@@ -653,11 +653,11 @@ box_save(Box *box, ObjectNode obj_node, DiaContext *ctx)
data_add_boolean(new_attribute(obj_node, "show_background"),
box->show_background, ctx);
- if (box->line_style != LINESTYLE_SOLID)
+ if (box->line_style != DIA_LINE_STYLE_SOLID)
data_add_enum(new_attribute(obj_node, "line_style"),
box->line_style, ctx);
- if (box->line_style != LINESTYLE_SOLID &&
+ if (box->line_style != DIA_LINE_STYLE_SOLID &&
box->dashlength != DEFAULT_LINESTYLE_DASHLEN)
data_add_real(new_attribute(obj_node, "dashlength"),
box->dashlength, ctx);
@@ -711,7 +711,7 @@ box_load(ObjectNode obj_node, int version,DiaContext *ctx)
if (attr != NULL)
box->show_background = data_boolean(attribute_first_data(attr), ctx);
- box->line_style = LINESTYLE_SOLID;
+ box->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
box->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/flowchart/diamond.c b/objects/flowchart/diamond.c
index e714e6b3b..e39e8409d 100644
--- a/objects/flowchart/diamond.c
+++ b/objects/flowchart/diamond.c
@@ -56,15 +56,15 @@ struct _Diamond {
Element element;
ConnectionPoint connections[NUM_CONNECTIONS];
- real border_width;
+ double border_width;
Color border_color;
Color inner_color;
gboolean show_background;
- LineStyle line_style;
- real dashlength;
+ DiaLineStyle line_style;
+ double dashlength;
Text *text;
- real padding;
+ double padding;
TextFitting text_fitting;
};
@@ -623,14 +623,18 @@ diamond_save(Diamond *diamond, ObjectNode obj_node, DiaContext *ctx)
data_add_boolean(new_attribute(obj_node, "show_background"),
diamond->show_background, ctx);
- if (diamond->line_style != LINESTYLE_SOLID)
- data_add_enum(new_attribute(obj_node, "line_style"),
- diamond->line_style, ctx);
+ if (diamond->line_style != DIA_LINE_STYLE_SOLID) {
+ data_add_enum (new_attribute (obj_node, "line_style"),
+ diamond->line_style,
+ ctx);
+ }
- if (diamond->line_style != LINESTYLE_SOLID &&
- diamond->dashlength != DEFAULT_LINESTYLE_DASHLEN)
- data_add_real(new_attribute(obj_node, "dashlength"),
- diamond->dashlength, ctx);
+ if (diamond->line_style != DIA_LINE_STYLE_SOLID &&
+ diamond->dashlength != DEFAULT_LINESTYLE_DASHLEN) {
+ data_add_real (new_attribute (obj_node, "dashlength"),
+ diamond->dashlength,
+ ctx);
+ }
data_add_real(new_attribute(obj_node, "padding"), diamond->padding, ctx);
@@ -679,7 +683,7 @@ diamond_load(ObjectNode obj_node, int version,DiaContext *ctx)
if (attr != NULL)
diamond->show_background = data_boolean(attribute_first_data(attr), ctx);
- diamond->line_style = LINESTYLE_SOLID;
+ diamond->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
diamond->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/flowchart/ellipse.c b/objects/flowchart/ellipse.c
index 4a5c52bb6..d8f25c7f4 100644
--- a/objects/flowchart/ellipse.c
+++ b/objects/flowchart/ellipse.c
@@ -56,15 +56,15 @@ struct _Ellipse {
Element element;
ConnectionPoint connections[NUM_CONNECTIONS];
- real border_width;
+ double border_width;
Color border_color;
Color inner_color;
gboolean show_background;
- LineStyle line_style;
- real dashlength;
+ DiaLineStyle line_style;
+ double dashlength;
Text *text;
- real padding;
+ double padding;
TextFitting text_fitting;
};
@@ -601,14 +601,18 @@ ellipse_save(Ellipse *ellipse, ObjectNode obj_node, DiaContext *ctx)
data_add_boolean(new_attribute(obj_node, "show_background"),
ellipse->show_background, ctx);
- if (ellipse->line_style != LINESTYLE_SOLID)
- data_add_enum(new_attribute(obj_node, "line_style"),
- ellipse->line_style, ctx);
+ if (ellipse->line_style != DIA_LINE_STYLE_SOLID) {
+ data_add_enum (new_attribute (obj_node, "line_style"),
+ ellipse->line_style,
+ ctx);
+ }
- if (ellipse->line_style != LINESTYLE_SOLID &&
- ellipse->dashlength != DEFAULT_LINESTYLE_DASHLEN)
- data_add_real(new_attribute(obj_node, "dashlength"),
- ellipse->dashlength, ctx);
+ if (ellipse->line_style != DIA_LINE_STYLE_SOLID &&
+ ellipse->dashlength != DEFAULT_LINESTYLE_DASHLEN) {
+ data_add_real (new_attribute (obj_node, "dashlength"),
+ ellipse->dashlength,
+ ctx);
+ }
data_add_real(new_attribute(obj_node, "padding"), ellipse->padding, ctx);
@@ -657,7 +661,7 @@ ellipse_load(ObjectNode obj_node, int version,DiaContext *ctx)
if (attr != NULL)
ellipse->show_background = data_boolean( attribute_first_data(attr), ctx);
- ellipse->line_style = LINESTYLE_SOLID;
+ ellipse->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
ellipse->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/flowchart/parallelogram.c b/objects/flowchart/parallelogram.c
index fef2dc5ef..91cd83309 100644
--- a/objects/flowchart/parallelogram.c
+++ b/objects/flowchart/parallelogram.c
@@ -56,16 +56,16 @@ struct _Pgram {
Element element;
ConnectionPoint connections[NUM_CONNECTIONS];
- real border_width;
+ double border_width;
Color border_color;
Color inner_color;
gboolean show_background;
- LineStyle line_style;
- real dashlength;
- real shear_angle, shear_grad;
+ DiaLineStyle line_style;
+ double dashlength;
+ double shear_angle, shear_grad;
Text *text;
- real padding;
+ double padding;
TextFitting text_fitting;
};
@@ -676,14 +676,18 @@ pgram_save(Pgram *pgram, ObjectNode obj_node, DiaContext *ctx)
data_add_boolean(new_attribute(obj_node, "show_background"),
pgram->show_background, ctx);
- if (pgram->line_style != LINESTYLE_SOLID)
- data_add_enum(new_attribute(obj_node, "line_style"),
- pgram->line_style, ctx);
+ if (pgram->line_style != DIA_LINE_STYLE_SOLID) {
+ data_add_enum (new_attribute (obj_node, "line_style"),
+ pgram->line_style,
+ ctx);
+ }
- if (pgram->line_style != LINESTYLE_SOLID &&
- pgram->dashlength != DEFAULT_LINESTYLE_DASHLEN)
- data_add_real(new_attribute(obj_node, "dashlength"),
- pgram->dashlength, ctx);
+ if (pgram->line_style != DIA_LINE_STYLE_SOLID &&
+ pgram->dashlength != DEFAULT_LINESTYLE_DASHLEN) {
+ data_add_real (new_attribute (obj_node, "dashlength"),
+ pgram->dashlength,
+ ctx);
+ }
data_add_real(new_attribute(obj_node, "shear_angle"),
pgram->shear_angle, ctx);
@@ -734,7 +738,7 @@ pgram_load(ObjectNode obj_node, int version,DiaContext *ctx)
if (attr != NULL)
pgram->show_background = data_boolean(attribute_first_data(attr), ctx);
- pgram->line_style = LINESTYLE_SOLID;
+ pgram->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
pgram->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/network/basestation.c b/objects/network/basestation.c
index d6ec77aa5..45873c7b5 100644
--- a/objects/network/basestation.c
+++ b/objects/network/basestation.c
@@ -249,7 +249,7 @@ basestation_draw (Basestation *basestation, DiaRenderer *renderer)
dia_renderer_set_fillstyle (renderer, FILLSTYLE_SOLID);
dia_renderer_set_linejoin (renderer, LINEJOIN_ROUND);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0);
dia_renderer_set_linewidth (renderer, BASESTATION_LINEWIDTH);
ct.x = x + w/2.0;
diff --git a/objects/network/bus.c b/objects/network/bus.c
index 162645f34..462e92e00 100644
--- a/objects/network/bus.c
+++ b/objects/network/bus.c
@@ -325,7 +325,7 @@ bus_draw (Bus *bus, DiaRenderer *renderer)
endpoints = &bus->real_ends[0];
dia_renderer_set_linewidth (renderer, LINE_WIDTH);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
dia_renderer_draw_line (renderer,
diff --git a/objects/network/radiocell.c b/objects/network/radiocell.c
index 8519da12d..053364167 100644
--- a/objects/network/radiocell.c
+++ b/objects/network/radiocell.c
@@ -40,13 +40,13 @@
typedef struct _RadioCell RadioCell;
struct _RadioCell {
- PolyShape poly; /* always 1st! */
- real radius; /* pseudo-radius */
- Point center; /* point in the center */
+ PolyShape poly; /* always 1st! */
+ double radius; /* pseudo-radius */
+ Point center; /* point in the center */
Color line_colour;
- LineStyle line_style;
- real dashlength;
- real line_width;
+ DiaLineStyle line_style;
+ double dashlength;
+ double line_width;
gboolean show_background;
Color fill_colour;
Text *text;
diff --git a/objects/network/wanlink.c b/objects/network/wanlink.c
index 10628740a..e2c5f94a8 100644
--- a/objects/network/wanlink.c
+++ b/objects/network/wanlink.c
@@ -223,7 +223,7 @@ wanlink_draw (WanLink *wanlink, DiaRenderer *renderer)
dia_renderer_set_linewidth (renderer, FLASH_LINE);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_draw_polygon (renderer,
wanlink->poly,
diff --git a/objects/standard/arc.c b/objects/standard/arc.c
index 8f06fdfa5..c12985fea 100644
--- a/objects/standard/arc.c
+++ b/objects/standard/arc.c
@@ -56,18 +56,17 @@ struct _Arc {
Handle center_handle; /*!< Handle on he center of the full circle */
Color arc_color; /*!< Color of the Arc */
- real curve_distance; /*!< distance between middle_handle and chord */
- real line_width; /*!< line width for the Arc */
- LineStyle line_style; /*!< line style for the Arc */
+ double curve_distance; /*!< distance between middle_handle and chord */
+ double line_width; /*!< line width for the Arc */
+ DiaLineStyle line_style; /*!< line style for the Arc */
LineCaps line_caps; /*!< line ends of the Arc */
- real dashlength; /*!< part of the linestyle if not LINESTYLE_SOLID */
+ double dashlength; /*!< part of the linestyle if not DIA_LINE_STYLE_SOLID */
Arrow start_arrow, end_arrow; /*!< arrows */
/* Calculated parameters: */
- real radius;
+ double radius;
Point center;
- real angle1, angle2;
-
+ double angle1, angle2;
};
/* updates both endpoints and arc->curve_distance */
@@ -660,7 +659,7 @@ arc_draw (Arc *arc, DiaRenderer *renderer)
Color line_color = { 0.0, 0.0, 0.6, 1.0 };
dia_renderer_set_linewidth (renderer, 0);
- dia_renderer_set_linestyle (renderer, LINESTYLE_DOTTED, 1);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_DOTTED, 1);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_BUTT);
@@ -957,11 +956,11 @@ arc_save(Arc *arc, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, PROP_STDNAME_LINE_WIDTH),
arc->line_width, ctx);
- if (arc->line_style != LINESTYLE_SOLID)
+ if (arc->line_style != DIA_LINE_STYLE_SOLID)
data_add_enum(new_attribute(obj_node, "line_style"),
arc->line_style, ctx);
- if (arc->line_style != LINESTYLE_SOLID &&
+ if (arc->line_style != DIA_LINE_STYLE_SOLID &&
arc->dashlength != DEFAULT_LINESTYLE_DASHLEN)
data_add_real(new_attribute(obj_node, "dashlength"),
arc->dashlength, ctx);
@@ -1024,7 +1023,7 @@ arc_load(ObjectNode obj_node, int version,DiaContext *ctx)
if (attr != NULL)
arc->line_width = data_real(attribute_first_data(attr), ctx);
- arc->line_style = LINESTYLE_SOLID;
+ arc->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
arc->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/standard/bezier.c b/objects/standard/bezier.c
index cdc8bcdd5..fe18d883d 100644
--- a/objects/standard/bezier.c
+++ b/objects/standard/bezier.c
@@ -48,7 +48,7 @@ struct _Bezierline {
BezierConn bez;
Color line_color;
- LineStyle line_style;
+ DiaLineStyle line_style;
LineJoin line_join;
LineCaps line_caps;
double dashlength;
@@ -621,14 +621,18 @@ bezierline_save(Bezierline *bezierline, ObjectNode obj_node,
data_add_real(new_attribute(obj_node, PROP_STDNAME_LINE_WIDTH),
bezierline->line_width, ctx);
- if (bezierline->line_style != LINESTYLE_SOLID)
- data_add_enum(new_attribute(obj_node, "line_style"),
- bezierline->line_style, ctx);
+ if (bezierline->line_style != DIA_LINE_STYLE_SOLID) {
+ data_add_enum (new_attribute (obj_node, "line_style"),
+ bezierline->line_style,
+ ctx);
+ }
- if (bezierline->line_style != LINESTYLE_SOLID &&
- bezierline->dashlength != DEFAULT_LINESTYLE_DASHLEN)
- data_add_real(new_attribute(obj_node, "dashlength"),
- bezierline->dashlength, ctx);
+ if (bezierline->line_style != DIA_LINE_STYLE_SOLID &&
+ bezierline->dashlength != DEFAULT_LINESTYLE_DASHLEN) {
+ data_add_real (new_attribute (obj_node, "dashlength"),
+ bezierline->dashlength,
+ ctx);
+ }
if (bezierline->line_join != LINEJOIN_MITER)
data_add_enum(new_attribute(obj_node, "line_join"),
@@ -692,7 +696,7 @@ bezierline_load(ObjectNode obj_node, int version, DiaContext *ctx)
if (attr != NULL)
bezierline->line_width = data_real(attribute_first_data(attr), ctx);
- bezierline->line_style = LINESTYLE_SOLID;
+ bezierline->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
bezierline->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/standard/beziergon.c b/objects/standard/beziergon.c
index 3a3d3fdae..26350c7c3 100644
--- a/objects/standard/beziergon.c
+++ b/objects/standard/beziergon.c
@@ -47,12 +47,12 @@ typedef struct _Beziergon {
BezierShape bezier;
Color line_color;
- LineStyle line_style;
+ DiaLineStyle line_style;
LineJoin line_join;
Color inner_color;
gboolean show_background;
- real dashlength;
- real line_width;
+ double dashlength;
+ double line_width;
DiaPattern *pattern;
} Beziergon;
@@ -402,11 +402,11 @@ beziergon_save(Beziergon *beziergon, ObjectNode obj_node,
data_add_boolean(new_attribute(obj_node, "show_background"),
beziergon->show_background, ctx);
- if (beziergon->line_style != LINESTYLE_SOLID)
+ if (beziergon->line_style != DIA_LINE_STYLE_SOLID)
data_add_enum(new_attribute(obj_node, "line_style"),
beziergon->line_style, ctx);
- if (beziergon->line_style != LINESTYLE_SOLID &&
+ if (beziergon->line_style != DIA_LINE_STYLE_SOLID &&
beziergon->dashlength != DEFAULT_LINESTYLE_DASHLEN)
data_add_real(new_attribute(obj_node, "dashlength"),
beziergon->dashlength, ctx);
@@ -459,7 +459,7 @@ beziergon_load(ObjectNode obj_node, int version, DiaContext *ctx)
if (attr != NULL)
beziergon->show_background = data_boolean(attribute_first_data(attr), ctx);
- beziergon->line_style = LINESTYLE_SOLID;
+ beziergon->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
beziergon->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/standard/box.c b/objects/standard/box.c
index 903f745ac..78626087e 100644
--- a/objects/standard/box.c
+++ b/objects/standard/box.c
@@ -57,22 +57,22 @@ struct _Box {
ConnectionPoint connections[NUM_CONNECTIONS];
- real border_width;
+ double border_width;
Color border_color;
Color inner_color;
gboolean show_background;
- LineStyle line_style;
+ DiaLineStyle line_style;
LineJoin line_join;
- real dashlength;
- real corner_radius;
+ double dashlength;
+ double corner_radius;
AspectType aspect;
DiaPattern *pattern;
- real angle; /*!< between [-45°-45°] to simplify connection point handling */
+ double angle; /*!< between [-45°-45°] to simplify connection point handling */
};
static struct _BoxProperties {
gboolean show_background;
- real corner_radius;
+ double corner_radius;
AspectType aspect;
} default_properties = { TRUE, 0.0 };
@@ -601,11 +601,11 @@ box_save(Box *box, ObjectNode obj_node, DiaContext *ctx)
data_add_boolean(new_attribute(obj_node, "show_background"),
box->show_background, ctx);
- if (box->line_style != LINESTYLE_SOLID)
+ if (box->line_style != DIA_LINE_STYLE_SOLID)
data_add_enum(new_attribute(obj_node, "line_style"),
box->line_style, ctx);
- if (box->line_style != LINESTYLE_SOLID &&
+ if (box->line_style != DIA_LINE_STYLE_SOLID &&
box->dashlength != DEFAULT_LINESTYLE_DASHLEN)
data_add_real(new_attribute(obj_node, "dashlength"),
box->dashlength, ctx);
@@ -670,7 +670,7 @@ box_load(ObjectNode obj_node, int version, DiaContext *ctx)
if (attr != NULL)
box->show_background = data_boolean(attribute_first_data(attr), ctx);
- box->line_style = LINESTYLE_SOLID;
+ box->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
box->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/standard/ellipse.c b/objects/standard/ellipse.c
index ba96828f6..1700eacb9 100644
--- a/objects/standard/ellipse.c
+++ b/objects/standard/ellipse.c
@@ -56,15 +56,15 @@ struct _Ellipse {
ConnectionPoint connections[9];
Handle center_handle;
- real border_width;
+ double border_width;
Color border_color;
Color inner_color;
gboolean show_background;
AspectType aspect;
- LineStyle line_style;
- real dashlength;
+ DiaLineStyle line_style;
+ double dashlength;
DiaPattern *pattern;
- real angle; /*!< between [-45-45] to simplify connection point handling */
+ double angle; /*!< between [-45-45] to simplify connection point handling */
};
static struct _EllipseProperties {
@@ -625,7 +625,7 @@ ellipse_save(Ellipse *ellipse, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, "angle"),
ellipse->angle, ctx);
- if (ellipse->line_style != LINESTYLE_SOLID) {
+ if (ellipse->line_style != DIA_LINE_STYLE_SOLID) {
data_add_enum(new_attribute(obj_node, "line_style"),
ellipse->line_style, ctx);
@@ -686,7 +686,7 @@ static DiaObject *ellipse_load(ObjectNode obj_node, int version, DiaContext *ctx
if (attr != NULL)
ellipse->angle = data_real(attribute_first_data(attr), ctx);
- ellipse->line_style = LINESTYLE_SOLID;
+ ellipse->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
ellipse->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/standard/image.c b/objects/standard/image.c
index 27d06d968..726704b0c 100644
--- a/objects/standard/image.c
+++ b/objects/standard/image.c
@@ -51,13 +51,13 @@ struct _Image {
ConnectionPoint connections[NUM_CONNECTIONS];
- real border_width;
+ double border_width;
Color border_color;
- LineStyle line_style;
- real dashlength;
+ DiaLineStyle line_style;
+ double dashlength;
DiaImage *image;
- gchar *file;
+ char *file;
gboolean inline_data;
/* may contain the images pixbuf pointer - if so: reference counted! */
@@ -66,13 +66,13 @@ struct _Image {
gboolean draw_border;
gboolean keep_aspect;
- real angle;
+ double angle;
time_t mtime;
};
static struct _ImageProperties {
- gchar *file;
+ char *file;
gboolean draw_border;
gboolean keep_aspect;
} default_properties = { "", FALSE, TRUE };
@@ -722,11 +722,11 @@ image_save(Image *image, ObjectNode obj_node, DiaContext *ctx)
data_add_color(new_attribute(obj_node, "border_color"),
&image->border_color, ctx);
- if (image->line_style != LINESTYLE_SOLID)
+ if (image->line_style != DIA_LINE_STYLE_SOLID)
data_add_enum(new_attribute(obj_node, "line_style"),
image->line_style, ctx);
- if (image->line_style != LINESTYLE_SOLID &&
+ if (image->line_style != DIA_LINE_STYLE_SOLID &&
image->dashlength != DEFAULT_LINESTYLE_DASHLEN)
data_add_real(new_attribute(obj_node, "dashlength"),
image->dashlength, ctx);
@@ -796,7 +796,7 @@ image_load (ObjectNode obj_node, int version, DiaContext *ctx)
data_color (attribute_first_data (attr), &image->border_color, ctx);
}
- image->line_style = LINESTYLE_SOLID;
+ image->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute (obj_node, "line_style");
if (attr != NULL) {
image->line_style = data_enum (attribute_first_data (attr), ctx);
diff --git a/objects/standard/line.c b/objects/standard/line.c
index f1c22060f..a3e0b6158 100644
--- a/objects/standard/line.c
+++ b/objects/standard/line.c
@@ -54,16 +54,16 @@ typedef struct _Line {
ConnPointLine *cpl;
Color line_color;
- real line_width;
- LineStyle line_style;
+ double line_width;
+ DiaLineStyle line_style;
LineCaps line_caps;
Arrow start_arrow, end_arrow;
- real dashlength;
- real absolute_start_gap, absolute_end_gap;
+ double dashlength;
+ double absolute_start_gap, absolute_end_gap;
} Line;
struct _LineProperties {
- real absolute_start_gap, absolute_end_gap;
+ double absolute_start_gap, absolute_end_gap;
};
static LineProperties default_properties;
@@ -661,7 +661,7 @@ line_save(Line *line, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, PROP_STDNAME_LINE_WIDTH),
line->line_width, ctx);
- if (line->line_style != LINESTYLE_SOLID)
+ if (line->line_style != DIA_LINE_STYLE_SOLID)
data_add_enum(new_attribute(obj_node, "line_style"),
line->line_style, ctx);
@@ -694,7 +694,7 @@ line_save(Line *line, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, "absolute_end_gap"),
line->absolute_end_gap, ctx);
- if (line->line_style != LINESTYLE_SOLID && line->dashlength != DEFAULT_LINESTYLE_DASHLEN)
+ if (line->line_style != DIA_LINE_STYLE_SOLID && line->dashlength != DEFAULT_LINESTYLE_DASHLEN)
data_add_real(new_attribute(obj_node, "dashlength"),
line->dashlength, ctx);
}
@@ -727,7 +727,7 @@ line_load(ObjectNode obj_node, int version, DiaContext *ctx)
if (attr != NULL)
line->line_width = data_real(attribute_first_data(attr), ctx);
- line->line_style = LINESTYLE_SOLID;
+ line->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
line->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/standard/outline.c b/objects/standard/outline.c
index 41108d495..70679fdad 100644
--- a/objects/standard/outline.c
+++ b/objects/standard/outline.c
@@ -344,7 +344,7 @@ outline_draw (Outline *outline, DiaRenderer *renderer)
return;
dia_renderer_set_linewidth (renderer, outline->line_width);
- dia_renderer_set_linestyle (renderer, LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (renderer, DIA_LINE_STYLE_SOLID, 0.0);
dia_renderer_set_linejoin (renderer, LINEJOIN_MITER);
dia_renderer_set_linecaps (renderer, LINECAPS_ROUND);
diff --git a/objects/standard/polygon.c b/objects/standard/polygon.c
index 9024a10b1..1a6e11a36 100644
--- a/objects/standard/polygon.c
+++ b/objects/standard/polygon.c
@@ -51,12 +51,12 @@ typedef struct _Polygon {
PolyShape poly;
Color line_color;
- LineStyle line_style;
+ DiaLineStyle line_style;
LineJoin line_join;
Color inner_color;
gboolean show_background;
- real dashlength;
- real line_width;
+ double dashlength;
+ double line_width;
DiaPattern *pattern;
} Polygon;
@@ -374,11 +374,11 @@ polygon_save(Polygon *polygon, ObjectNode obj_node,
data_add_boolean(new_attribute(obj_node, "show_background"),
polygon->show_background, ctx);
- if (polygon->line_style != LINESTYLE_SOLID)
+ if (polygon->line_style != DIA_LINE_STYLE_SOLID)
data_add_enum(new_attribute(obj_node, "line_style"),
polygon->line_style, ctx);
- if (polygon->line_style != LINESTYLE_SOLID &&
+ if (polygon->line_style != DIA_LINE_STYLE_SOLID &&
polygon->dashlength != DEFAULT_LINESTYLE_DASHLEN)
data_add_real(new_attribute(obj_node, "dashlength"),
polygon->dashlength, ctx);
@@ -430,7 +430,7 @@ polygon_load(ObjectNode obj_node, int version, DiaContext *ctx)
if (attr != NULL)
polygon->show_background = data_boolean(attribute_first_data(attr), ctx);
- polygon->line_style = LINESTYLE_SOLID;
+ polygon->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
polygon->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/standard/polyline.c b/objects/standard/polyline.c
index cefe120f8..6e3724764 100644
--- a/objects/standard/polyline.c
+++ b/objects/standard/polyline.c
@@ -42,7 +42,7 @@ typedef struct _Polyline {
PolyConn poly;
Color line_color;
- LineStyle line_style;
+ DiaLineStyle line_style;
LineJoin line_join;
LineCaps line_caps;
double dashlength;
@@ -479,11 +479,11 @@ polyline_save(Polyline *polyline, ObjectNode obj_node,
data_add_real(new_attribute(obj_node, PROP_STDNAME_LINE_WIDTH),
polyline->line_width, ctx);
- if (polyline->line_style != LINESTYLE_SOLID)
+ if (polyline->line_style != DIA_LINE_STYLE_SOLID)
data_add_enum(new_attribute(obj_node, "line_style"),
polyline->line_style, ctx);
- if (polyline->line_style != LINESTYLE_SOLID &&
+ if (polyline->line_style != DIA_LINE_STYLE_SOLID &&
polyline->dashlength != DEFAULT_LINESTYLE_DASHLEN)
data_add_real(new_attribute(obj_node, "dashlength"),
polyline->dashlength, ctx);
@@ -553,7 +553,7 @@ polyline_load(ObjectNode obj_node, int version, DiaContext *ctx)
if (attr != NULL)
polyline->line_width = data_real(attribute_first_data(attr), ctx);
- polyline->line_style = LINESTYLE_SOLID;
+ polyline->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
polyline->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/objects/standard/zigzagline.c b/objects/standard/zigzagline.c
index 5c7f4b4ea..d4c34c43e 100644
--- a/objects/standard/zigzagline.c
+++ b/objects/standard/zigzagline.c
@@ -44,7 +44,7 @@ typedef struct _Zigzagline {
OrthConn orth;
Color line_color;
- LineStyle line_style;
+ DiaLineStyle line_style;
LineJoin line_join;
LineCaps line_caps;
double dashlength;
@@ -500,7 +500,7 @@ zigzagline_save(Zigzagline *zigzagline, ObjectNode obj_node,
data_add_real(new_attribute(obj_node, PROP_STDNAME_LINE_WIDTH),
zigzagline->line_width, ctx);
- if (zigzagline->line_style != LINESTYLE_SOLID)
+ if (zigzagline->line_style != DIA_LINE_STYLE_SOLID)
data_add_enum(new_attribute(obj_node, "line_style"),
zigzagline->line_style, ctx);
@@ -529,7 +529,7 @@ zigzagline_save(Zigzagline *zigzagline, ObjectNode obj_node,
ctx);
}
- if (zigzagline->line_style != LINESTYLE_SOLID &&
+ if (zigzagline->line_style != DIA_LINE_STYLE_SOLID &&
zigzagline->dashlength != DEFAULT_LINESTYLE_DASHLEN)
data_add_real(new_attribute(obj_node, "dashlength"),
zigzagline->dashlength, ctx);
@@ -567,7 +567,7 @@ zigzagline_load(ObjectNode obj_node, int version, DiaContext *ctx)
if (attr != NULL)
zigzagline->line_width = data_real(attribute_first_data(attr), ctx);
- zigzagline->line_style = LINESTYLE_SOLID;
+ zigzagline->line_style = DIA_LINE_STYLE_SOLID;
attr = object_find_attribute(obj_node, "line_style");
if (attr != NULL)
zigzagline->line_style = data_enum(attribute_first_data(attr), ctx);
diff --git a/plug-ins/cgm/cgm.c b/plug-ins/cgm/cgm.c
index d78e12762..20293c1d1 100644
--- a/plug-ins/cgm/cgm.c
+++ b/plug-ins/cgm/cgm.c
@@ -631,38 +631,39 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
renderer->lcurrent.join = renderer->fcurrent.join = join;
}
+
static void
-set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
- CgmRenderer *renderer = CGM_RENDERER(self);
- gint16 style;
+ CgmRenderer *renderer = CGM_RENDERER (self);
+ gint16 style;
- /* XXX: According to specs (mil-std-2301) and tests with OpenOffice only
- * solid=1 and dashed=2 are supported.
- */
- switch(mode)
- {
- case LINESTYLE_DASHED:
- style = 2;
- break;
- case LINESTYLE_DASH_DOT:
- style = 4;
- break;
- case LINESTYLE_DASH_DOT_DOT:
- style = 5;
- break;
- case LINESTYLE_DOTTED:
- style = 3;
- break;
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
+ /* XXX: According to specs (mil-std-2301) and tests with OpenOffice only
+ * solid=1 and dashed=2 are supported.
+ */
+ switch (mode) {
+ case DIA_LINE_STYLE_DASHED:
+ style = 2;
+ break;
+ case DIA_LINE_STYLE_DASH_DOT:
+ style = 4;
+ break;
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
+ style = 5;
+ break;
+ case DIA_LINE_STYLE_DOTTED:
+ style = 3;
+ break;
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
default:
- style = 1;
- break;
- }
- renderer->lcurrent.style = renderer->fcurrent.style = style;
+ style = 1;
+ break;
+ }
+ renderer->lcurrent.style = renderer->fcurrent.style = style;
}
+
static void
set_fillstyle(DiaRenderer *self, FillStyle mode)
{
diff --git a/plug-ins/drs/dia-render-script-import.c b/plug-ins/drs/dia-render-script-import.c
index da503e035..ef122a790 100644
--- a/plug-ins/drs/dia-render-script-import.c
+++ b/plug-ins/drs/dia-render-script-import.c
@@ -150,26 +150,34 @@ _parse_color (xmlNodePtr node, const char *attrib)
}
return val;
}
-static LineStyle
+
+
+static DiaLineStyle
_parse_linestyle (xmlNodePtr node, const char *attrib)
{
- xmlChar *str = xmlGetProp(node, (const xmlChar *)attrib);
- LineStyle val = LINESTYLE_SOLID;
+ xmlChar *str = xmlGetProp (node, (const xmlChar *) attrib);
+ DiaLineStyle val = DIA_LINE_STYLE_SOLID;
+
if (str) {
- if (strcmp ((const char *)str, "dashed") == 0)
- val = LINESTYLE_DASHED;
- else if (strcmp ((const char *)str, "dash-dot") == 0)
- val = LINESTYLE_DASH_DOT;
- else if (strcmp ((const char *)str, "dash-dot-dot") == 0)
- val = LINESTYLE_DASH_DOT_DOT;
- else if (strcmp ((const char *)str, "dotted") == 0)
- val = LINESTYLE_DOTTED;
- else if (strcmp ((const char *)str, "solid") != 0)
+ if (g_strcmp0 ((const char *) str, "dashed") == 0) {
+ val = DIA_LINE_STYLE_DASHED;
+ } else if (g_strcmp0 ((const char *) str, "dash-dot") == 0) {
+ val = DIA_LINE_STYLE_DASH_DOT;
+ } else if (g_strcmp0 ((const char *) str, "dash-dot-dot") == 0) {
+ val = DIA_LINE_STYLE_DASH_DOT_DOT;
+ } else if (g_strcmp0 ((const char *) str, "dotted") == 0) {
+ val = DIA_LINE_STYLE_DOTTED;
+ } else if (g_strcmp0 ((const char *) str, "solid") != 0) {
g_warning ("DRS: unknown linestyle: %s", str);
- xmlFree(str);
+ }
}
+
+ dia_clear_xml_string (&str);
+
return val;
}
+
+
static LineCaps
_parse_linecaps (xmlNodePtr node, const char *attrib)
{
diff --git a/plug-ins/drs/dia-render-script-renderer.c b/plug-ins/drs/dia-render-script-renderer.c
index 4970717c8..b00800ef2 100644
--- a/plug-ins/drs/dia-render-script-renderer.c
+++ b/plug-ins/drs/dia-render-script-renderer.c
@@ -444,7 +444,7 @@ set_linejoin (DiaRenderer *self, LineJoin mode)
static void
-set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
DrsRenderer *renderer = DRS_RENDERER (self);
xmlNodePtr node;
@@ -452,20 +452,20 @@ set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
/* line type */
switch (mode) {
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
value = "solid";
break;
- case LINESTYLE_DASHED:
+ case DIA_LINE_STYLE_DASHED:
value = "dashed";
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
value = "dash-dot";
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
value = "dash-dot-dot";
break;
- case LINESTYLE_DOTTED:
+ case DIA_LINE_STYLE_DOTTED:
value = "dotted";
break;
default:
@@ -475,7 +475,7 @@ set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
(const xmlChar *) "set-linestyle", NULL);
xmlSetProp (node, (const xmlChar *) "mode",
value ? (xmlChar *) value : (xmlChar *) "?");
- if (mode != LINESTYLE_SOLID) {
+ if (mode != DIA_LINE_STYLE_SOLID) {
_node_set_real (node, "dash-length", dash_length);
}
}
diff --git a/plug-ins/dxf/dxf-export.c b/plug-ins/dxf/dxf-export.c
index 3f95d7525..0ae3ebb64 100644
--- a/plug-ins/dxf/dxf-export.c
+++ b/plug-ins/dxf/dxf-export.c
@@ -265,26 +265,26 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
static void
-set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
- DxfRenderer *renderer = DXF_RENDERER(self);
- char *style;
+ DxfRenderer *renderer = DXF_RENDERER (self);
+ char *style;
switch (mode) {
- case LINESTYLE_DASHED:
+ case DIA_LINE_STYLE_DASHED:
style = "DASH";
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
style = "DASHDOT";
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
style = "DASHDOT";
break;
- case LINESTYLE_DOTTED:
+ case DIA_LINE_STYLE_DOTTED:
style = "DOT";
break;
- case LINESTYLE_SOLID:
- case LINESTYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
+ case DIA_LINE_STYLE_DEFAULT:
default:
style = "CONTINUOUS";
break;
diff --git a/plug-ins/dxf/dxf-import.c b/plug-ins/dxf/dxf-import.c
index a2a2ca6bf..9d64f754a 100644
--- a/plug-ins/dxf/dxf-import.c
+++ b/plug-ins/dxf/dxf-import.c
@@ -88,7 +88,7 @@ static void read_section_tables_dxf(FILE *filedxf, DxfData *data, DiagramData *d
static void read_section_entities_dxf(FILE *filedxf, DxfData *data, DiagramData *dia);
static void read_section_blocks_dxf(FILE *filedxf, DxfData *data, DiagramData *dia);
static DiaLayer *layer_find_by_name(char *layername, DiagramData *dia);
-static LineStyle get_dia_linestyle_dxf(char *dxflinestyle);
+static DiaLineStyle get_dia_linestyle_dxf(char *dxflinestyle);
GHashTable *_color_by_layer_ht = NULL;
@@ -152,21 +152,26 @@ layer_find_by_name (char *layername, DiagramData *dia)
/* returns the matching dia linestyle for a given dxf linestyle */
/* if no matching style is found, LINESTYLE solid is returned as a default */
-static LineStyle
-get_dia_linestyle_dxf(char *dxflinestyle)
+static DiaLineStyle
+get_dia_linestyle_dxf (char *dxflinestyle)
{
- if (strcmp(dxflinestyle, "DASHED") == 0)
- return LINESTYLE_DASHED;
- if (strcmp(dxflinestyle, "DASHDOT") == 0)
- return LINESTYLE_DASH_DOT;
- if (strcmp(dxflinestyle, "DOT") == 0)
- return LINESTYLE_DOTTED;
- if (strcmp(dxflinestyle, "DIVIDE") == 0)
- return LINESTYLE_DASH_DOT_DOT;
-
- return LINESTYLE_SOLID;
+ if (g_strcmp0 (dxflinestyle, "DASHED") == 0) {
+ return DIA_LINE_STYLE_DASHED;
+ }
+ if (g_strcmp0 (dxflinestyle, "DASHDOT") == 0) {
+ return DIA_LINE_STYLE_DASH_DOT;
+ }
+ if (g_strcmp0 (dxflinestyle, "DOT") == 0) {
+ return DIA_LINE_STYLE_DOTTED;
+ }
+ if (g_strcmp0 (dxflinestyle, "DIVIDE") == 0) {
+ return DIA_LINE_STYLE_DASH_DOT_DOT;
+ }
+
+ return DIA_LINE_STYLE_SOLID;
}
+
/* reads a line entity from the dxf file and creates a line object in dia*/
static DiaObject *
read_entity_line_dxf (FILE *filedxf, DxfData *data, DiagramData *dia)
@@ -182,8 +187,8 @@ read_entity_line_dxf (FILE *filedxf, DxfData *data, DiagramData *dia)
RGB_t color = { 0, };
GPtrArray *props;
- real line_width = DEFAULT_LINE_WIDTH;
- LineStyle style = LINESTYLE_SOLID;
+ double line_width = DEFAULT_LINE_WIDTH;
+ DiaLineStyle style = DIA_LINE_STYLE_SOLID;
DiaLayer *layer = dia_diagram_data_get_active_layer (dia);
end.x=0;
@@ -252,31 +257,30 @@ read_entity_line_dxf (FILE *filedxf, DxfData *data, DiagramData *dia)
return NULL;
}
+
/* reads a solid entity from the dxf file and creates a polygon object in dia*/
static DiaObject *
-read_entity_solid_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
+read_entity_solid_dxf (FILE *filedxf, DxfData *data, DiagramData *dia)
{
- /* polygon data */
- Point p[4];
-
- DiaObjectType *otype = object_get_type("Standard - Polygon");
- Handle *h1, *h2;
+ /* polygon data */
+ Point p[4];
- DiaObject *polygon_obj;
- MultipointCreateData *pcd;
+ DiaObjectType *otype = object_get_type ("Standard - Polygon");
+ Handle *h1, *h2;
- Color fill_colour;
+ DiaObject *polygon_obj;
+ MultipointCreateData *pcd;
- GPtrArray *props;
+ Color fill_colour;
- real line_width = 0.001;
- LineStyle style = LINESTYLE_SOLID;
- DiaLayer *layer = dia_diagram_data_get_active_layer (dia);
- RGB_t color = { 127, 127, 127 };
+ GPtrArray *props;
-/* printf( "Solid " ); */
+ double line_width = 0.001;
+ DiaLineStyle style = DIA_LINE_STYLE_SOLID;
+ DiaLayer *layer = dia_diagram_data_get_active_layer (dia);
+ RGB_t color = { 127, 127, 127 };
- memset(p, 0, sizeof(p));
+ memset (p, 0, sizeof (p));
do {
if (read_dxf_codes (filedxf, data) == FALSE) {
@@ -410,9 +414,9 @@ read_entity_polyline_dxf (FILE *filedxf, DxfData *data, DiagramData *dia)
GPtrArray *props;
- real line_width = DEFAULT_LINE_WIDTH;
- real radius, start_angle = 0;
- LineStyle style = LINESTYLE_SOLID;
+ double line_width = DEFAULT_LINE_WIDTH;
+ double radius, start_angle = 0;
+ DiaLineStyle style = DIA_LINE_STYLE_SOLID;
DiaLayer *layer = dia_diagram_data_get_active_layer (dia);
RGB_t color = { 0, };
unsigned char closed = 0;
diff --git a/plug-ins/hpgl/hpgl.c b/plug-ins/hpgl/hpgl.c
index e3536a48e..d56dd8619 100644
--- a/plug-ins/hpgl/hpgl.c
+++ b/plug-ins/hpgl/hpgl.c
@@ -242,39 +242,43 @@ set_linejoin(DiaRenderer *object, LineJoin mode)
}
}
+
static void
-set_linestyle(DiaRenderer *object, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *object, DiaLineStyle mode, double dash_length)
{
- HpglRenderer *renderer = HPGL_RENDERER (object);
+ HpglRenderer *renderer = HPGL_RENDERER (object);
- DIAG_NOTE(g_message("set_linestyle %d", mode));
+ DIAG_NOTE (g_message ("set_linestyle %d", mode));
- /* line type */
- switch (mode) {
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
- fprintf(renderer->file, "LT;\n");
+ /* line type */
+ switch (mode) {
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
+ fprintf (renderer->file, "LT;\n");
break;
- case LINESTYLE_DASHED:
- if (dash_length > 0.5) /* ??? unit of dash_lenght ? */
- fprintf(renderer->file, "LT2;\n"); /* short */
- else
- fprintf(renderer->file, "LT3;\n"); /* long */
+ case DIA_LINE_STYLE_DASHED:
+ if (dash_length > 0.5) {
+ /* ??? unit of dash_lenght ? */
+ fprintf (renderer->file, "LT2;\n"); /* short */
+ } else {
+ fprintf (renderer->file, "LT3;\n"); /* long */
+ }
break;
- case LINESTYLE_DASH_DOT:
- fprintf(renderer->file, "LT4;\n");
+ case DIA_LINE_STYLE_DASH_DOT:
+ fprintf (renderer->file, "LT4;\n");
break;
- case LINESTYLE_DASH_DOT_DOT:
- fprintf(renderer->file, "LT5;\n"); /* ??? Mittellinie? */
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
+ fprintf (renderer->file, "LT5;\n"); /* ??? Mittellinie? */
break;
- case LINESTYLE_DOTTED:
- fprintf(renderer->file, "LT1;\n");
+ case DIA_LINE_STYLE_DOTTED:
+ fprintf (renderer->file, "LT1;\n");
break;
default:
- g_warning("HpglRenderer : Unsupported fill mode specified!");
- }
+ g_warning ("HpglRenderer : Unsupported fill mode specified!");
+ }
}
+
static void
set_fillstyle(DiaRenderer *object, FillStyle mode)
{
diff --git a/plug-ins/metapost/render_metapost.c b/plug-ins/metapost/render_metapost.c
index e20b7a972..30bc5a065 100644
--- a/plug-ins/metapost/render_metapost.c
+++ b/plug-ins/metapost/render_metapost.c
@@ -300,17 +300,20 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
renderer->saved_line_join = mode;
}
+
static void
-set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
- MetapostRenderer *renderer = METAPOST_RENDERER (self);
- renderer->saved_line_style = mode;
- /* dot = 10% of len */
- if (dash_length < 0.001)
- dash_length = 0.001;
+ MetapostRenderer *renderer = METAPOST_RENDERER (self);
+
+ renderer->saved_line_style = mode;
+ /* dot = 10% of len */
+ if (dash_length < 0.001) {
+ dash_length = 0.001;
+ }
- renderer->dash_length = dash_length;
- renderer->dot_length = dash_length * 0.1;
+ renderer->dash_length = dash_length;
+ renderer->dot_length = dash_length * 0.1;
}
@@ -323,12 +326,12 @@ draw_with_linestyle (MetapostRenderer *renderer)
gchar hole_width_buf[DTOSTR_BUF_SIZE];
switch (renderer->saved_line_style) {
- case LINESTYLE_DASHED:
+ case DIA_LINE_STYLE_DASHED:
mp_dtostr (dash_length_buf, renderer->dash_length);
fprintf (renderer->file, "\n dashed dashpattern (on %sx off %sx)",
dash_length_buf, dash_length_buf);
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
hole_width = (renderer->dash_length - renderer->dot_length) / 2.0;
mp_dtostr (dash_length_buf, renderer->dash_length);
@@ -340,7 +343,7 @@ draw_with_linestyle (MetapostRenderer *renderer)
dash_length_buf, hole_width_buf,
dot_lenght_buf, hole_width_buf);
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
hole_width = (renderer->dash_length - 2.0*renderer->dot_length) / 3.0;
mp_dtostr (dash_length_buf, renderer->dash_length);
@@ -353,7 +356,7 @@ draw_with_linestyle (MetapostRenderer *renderer)
dot_lenght_buf, hole_width_buf,
dot_lenght_buf, hole_width_buf );
break;
- case LINESTYLE_DOTTED:
+ case DIA_LINE_STYLE_DOTTED:
hole_width = renderer->dot_length * 5.0;
mp_dtostr (dot_lenght_buf, renderer->dot_length);
mp_dtostr (hole_width_buf, hole_width);
@@ -361,8 +364,8 @@ draw_with_linestyle (MetapostRenderer *renderer)
fprintf (renderer->file, "\n dashed dashpattern (on %sx off %sx)",
dot_lenght_buf, hole_width_buf);
break;
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
default:
break;
}
@@ -1114,7 +1117,7 @@ export_metapost(DiagramData *data, DiaContext *ctx,
renderer->dash_length = 1.0;
renderer->dot_length = 0.2;
- renderer->saved_line_style = LINESTYLE_SOLID;
+ renderer->saved_line_style = DIA_LINE_STYLE_SOLID;
time_now = time(NULL);
extent = &data->extents;
diff --git a/plug-ins/metapost/render_metapost.h b/plug-ins/metapost/render_metapost.h
index 22d4dc6ad..c80f324f1 100644
--- a/plug-ins/metapost/render_metapost.h
+++ b/plug-ins/metapost/render_metapost.h
@@ -43,13 +43,12 @@ GType metapost_renderer_get_type (void) G_GNUC_CONST;
typedef struct _MetapostRenderer MetapostRenderer;
typedef struct _MetapostRendererClass MetapostRendererClass;
-struct _MetapostRenderer
-{
+struct _MetapostRenderer {
DiaRenderer parent_instance;
FILE *file;
- LineStyle saved_line_style;
+ DiaLineStyle saved_line_style;
LineCaps saved_line_cap;
LineJoin saved_line_join;
diff --git a/plug-ins/pdf/pdf-import.cpp b/plug-ins/pdf/pdf-import.cpp
index 15100bc61..dc92b9ef6 100644
--- a/plug-ins/pdf/pdf-import.cpp
+++ b/plug-ins/pdf/pdf-import.cpp
@@ -148,27 +148,31 @@ public :
{
this->line_width = state->getLineWidth() * scale;
}
- void updateLineDash(GfxState * state)
+
+ void
+ updateLineDash (GfxState *state)
{
double *dashPattern;
int dashLength;
double dashStart;
- state->getLineDash(&dashPattern, &dashLength, &dashStart);
+ state->getLineDash (&dashPattern, &dashLength, &dashStart);
this->dash_length = dashLength ? dashPattern[0] * scale : 1.0;
+
if (dashLength == 0)
- this->line_style = LINESTYLE_SOLID;
+ this->line_style = DIA_LINE_STYLE_SOLID;
else if (dashLength > 5)
- this->line_style = LINESTYLE_DASH_DOT_DOT;
+ this->line_style = DIA_LINE_STYLE_DASH_DOT_DOT;
else if (dashLength > 3)
- this->line_style = LINESTYLE_DASH_DOT;
+ this->line_style = DIA_LINE_STYLE_DASH_DOT;
else if (dashLength > 1) {
if (dashPattern[0] != dashPattern[1])
- this->line_style = LINESTYLE_DOTTED;
+ this->line_style = DIA_LINE_STYLE_DOTTED;
else
- this->line_style = LINESTYLE_DASHED;
+ this->line_style = DIA_LINE_STYLE_DASHED;
}
}
+
void updateLineJoin(GfxState * state)
{
if (state->getLineJoin() == 0)
@@ -435,9 +439,9 @@ private :
DiagramData *dia;
Color stroke_color;
- real line_width;
- LineStyle line_style;
- real dash_length;
+ double line_width;
+ DiaLineStyle line_style;
+ double dash_length;
LineJoin line_join;
LineCaps line_caps;
Color fill_color;
@@ -445,7 +449,7 @@ private :
Alignment alignment;
// multiply with to get from PDF to Dia
- real scale;
+ double scale;
//! list of DiaObject not yet added
GList *objects;
//! just the number got from poppler
@@ -476,7 +480,7 @@ DiaOutputDev::DiaOutputDev (DiagramData *_dia, int _n) :
stroke_color(attributes_get_foreground ()),
line_width(attributes_get_default_linewidth()),
// favoring member intitialization list over attributes_get_default_line_style()
- line_style(LINESTYLE_SOLID),
+ line_style(DIA_LINE_STYLE_SOLID),
dash_length(1.0),
line_join(LINEJOIN_MITER),
line_caps(LINECAPS_PROJECTING),
diff --git a/plug-ins/pgf/render_pgf.c b/plug-ins/pgf/render_pgf.c
index f7781b6ad..e9d5380a1 100644
--- a/plug-ins/pgf/render_pgf.c
+++ b/plug-ins/pgf/render_pgf.c
@@ -83,7 +83,7 @@ static void end_render(DiaRenderer *self);
static void set_linewidth(DiaRenderer *self, real linewidth);
static void set_linecaps(DiaRenderer *self, LineCaps mode);
static void set_linejoin(DiaRenderer *self, LineJoin mode);
-static void set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length);
+static void set_linestyle(DiaRenderer *self, DiaLineStyle mode, double dash_length);
static void set_fillstyle(DiaRenderer *self, FillStyle mode);
static void set_font(DiaRenderer *self, DiaFont *font, real height);
static void draw_line(DiaRenderer *self,
@@ -460,14 +460,14 @@ set_linejoin (DiaRenderer *self, LineJoin mode)
static void
-set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
PgfRenderer *renderer = PGF_RENDERER(self);
- real hole_width;
- gchar dash_length_buf[DTOSTR_BUF_SIZE];
- gchar dot_length_buf[DTOSTR_BUF_SIZE];
- gchar hole_width_buf[DTOSTR_BUF_SIZE];
- real dot_length;
+ double hole_width;
+ char dash_length_buf[DTOSTR_BUF_SIZE];
+ char dot_length_buf[DTOSTR_BUF_SIZE];
+ char hole_width_buf[DTOSTR_BUF_SIZE];
+ double dot_length;
if (dash_length < 0.001) {
dash_length = 0.001;
@@ -477,18 +477,18 @@ set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
dot_length = dash_length * 0.2;
switch(mode) {
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
default:
fprintf (renderer->file, "\\pgfsetdash{}{0pt}\n");
break;
- case LINESTYLE_DASHED:
+ case DIA_LINE_STYLE_DASHED:
pgf_dtostr (dash_length_buf, dash_length);
fprintf (renderer->file, "\\pgfsetdash{{%s\\du}{%s\\du}}{0\\du}\n",
dash_length_buf,
dash_length_buf);
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
hole_width = ( dash_length - dot_length) / 2.0;
pgf_dtostr (hole_width_buf, hole_width);
pgf_dtostr (dot_length_buf, dot_length);
@@ -499,7 +499,7 @@ set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
dot_length_buf,
hole_width_buf );
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
hole_width = ( dash_length - 2.0* dot_length) / 3.0;
pgf_dtostr (hole_width_buf, hole_width);
pgf_dtostr (dot_length_buf, dot_length);
@@ -512,13 +512,14 @@ set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
dot_length_buf,
hole_width_buf );
break;
- case LINESTYLE_DOTTED:
- pgf_dtostr(dot_length_buf, dot_length);
- fprintf(renderer->file, "\\pgfsetdash{{\\pgflinewidth}{%s\\du}}{0cm}\n", dot_length_buf);
+ case DIA_LINE_STYLE_DOTTED:
+ pgf_dtostr (dot_length_buf, dot_length);
+ fprintf (renderer->file, "\\pgfsetdash{{\\pgflinewidth}{%s\\du}}{0cm}\n", dot_length_buf);
break;
- }
+ }
}
+
static void
set_fillstyle(DiaRenderer *self, FillStyle mode)
{
diff --git a/plug-ins/postscript/diapsrenderer.c b/plug-ins/postscript/diapsrenderer.c
index cbde440fc..cba876465 100644
--- a/plug-ins/postscript/diapsrenderer.c
+++ b/plug-ins/postscript/diapsrenderer.c
@@ -209,14 +209,14 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
static void
-set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
- real hole_width;
- gchar dashl_buf[DTOSTR_BUF_SIZE];
- gchar dotl_buf[DTOSTR_BUF_SIZE];
- gchar holew_buf[DTOSTR_BUF_SIZE];
- real dot_length;
+ double hole_width;
+ char dashl_buf[DTOSTR_BUF_SIZE];
+ char dotl_buf[DTOSTR_BUF_SIZE];
+ char holew_buf[DTOSTR_BUF_SIZE];
+ double dot_length;
if (dash_length < 0.001) {
dash_length = 0.001;
@@ -225,15 +225,15 @@ set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
dot_length = dash_length*0.2; /* dot = 20% of len */
switch (mode) {
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
fprintf (renderer->file, "[] 0 sd\n");
break;
- case LINESTYLE_DASHED:
+ case DIA_LINE_STYLE_DASHED:
fprintf (renderer->file, "[%s] 0 sd\n",
psrenderer_dtostr (dashl_buf, dash_length) );
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
hole_width = (dash_length - dot_length) / 2.0;
psrenderer_dtostr (holew_buf, hole_width);
psrenderer_dtostr (dashl_buf, dash_length);
@@ -244,7 +244,7 @@ set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
dotl_buf,
holew_buf );
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
hole_width = (dash_length - 2.0*dot_length) / 3.0;
psrenderer_dtostr (holew_buf, hole_width);
psrenderer_dtostr (dashl_buf, dash_length);
@@ -257,7 +257,7 @@ set_linestyle (DiaRenderer *self, LineStyle mode, real dash_length)
dotl_buf,
holew_buf );
break;
- case LINESTYLE_DOTTED:
+ case DIA_LINE_STYLE_DOTTED:
fprintf (renderer->file, "[%s] 0 sd\n",
psrenderer_dtostr (dotl_buf, dot_length) );
break;
diff --git a/plug-ins/pstricks/render_pstricks.c b/plug-ins/pstricks/render_pstricks.c
index 382fbc41f..f04a0c46c 100644
--- a/plug-ins/pstricks/render_pstricks.c
+++ b/plug-ins/pstricks/render_pstricks.c
@@ -78,7 +78,7 @@ static void end_render(DiaRenderer *self);
static void set_linewidth(DiaRenderer *self, real linewidth);
static void set_linecaps(DiaRenderer *self, LineCaps mode);
static void set_linejoin(DiaRenderer *self, LineJoin mode);
-static void set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length);
+static void set_linestyle(DiaRenderer *self, DiaLineStyle mode, double dash_length);
static void set_fillstyle(DiaRenderer *self, FillStyle mode);
static void set_font(DiaRenderer *self, DiaFont *font, real height);
static void draw_line(DiaRenderer *self,
@@ -379,51 +379,54 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
fprintf(renderer->file, "\\setlinejoinmode{%d}\n", ps_mode);
}
+
static void
-set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
- PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
- real hole_width;
- gchar dash_length_buf[DTOSTR_BUF_SIZE];
- gchar dot_length_buf[DTOSTR_BUF_SIZE];
- gchar hole_width_buf[DTOSTR_BUF_SIZE];
- real dot_length;
+ PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
+ double hole_width;
+ char dash_length_buf[DTOSTR_BUF_SIZE];
+ char dot_length_buf[DTOSTR_BUF_SIZE];
+ char hole_width_buf[DTOSTR_BUF_SIZE];
+ double dot_length;
+
+ if (dash_length < 0.001) {
+ dash_length = 0.001;
+ }
- if (dash_length<0.001)
- dash_length = 0.001;
- /* dot = 20% of len - for some reason not the usual 10% */
- dot_length = dash_length * 0.2;
+ /* dot = 20% of len - for some reason not the usual 10% */
+ dot_length = dash_length * 0.2;
switch (mode) {
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
- fprintf(renderer->file, "\\psset{linestyle=solid}\n");
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
+ fprintf (renderer->file, "\\psset{linestyle=solid}\n");
break;
- case LINESTYLE_DASHED:
- pstricks_dtostr(dash_length_buf, dash_length);
+ case DIA_LINE_STYLE_DASHED:
+ pstricks_dtostr (dash_length_buf, dash_length);
fprintf (renderer->file, "\\psset{linestyle=dashed,dash=%s %s}\n",
dash_length_buf, dash_length_buf);
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
hole_width = (dash_length - dot_length) / 2.0;
- pstricks_dtostr(hole_width_buf,hole_width);
- pstricks_dtostr(dot_length_buf, dot_length);
- pstricks_dtostr(dash_length_buf, dash_length);
- fprintf(renderer->file, "\\psset{linestyle=dashed,dash=%s %s %s %s}\n",
- dash_length_buf, hole_width_buf, dot_length_buf, hole_width_buf );
+ pstricks_dtostr (hole_width_buf, hole_width);
+ pstricks_dtostr (dot_length_buf, dot_length);
+ pstricks_dtostr (dash_length_buf, dash_length);
+ fprintf (renderer->file, "\\psset{linestyle=dashed,dash=%s %s %s %s}\n",
+ dash_length_buf, hole_width_buf, dot_length_buf, hole_width_buf );
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
hole_width = (dash_length - 2.0*dot_length) / 3.0;
- pstricks_dtostr(hole_width_buf,hole_width);
- pstricks_dtostr(dot_length_buf,dot_length);
- pstricks_dtostr(dash_length_buf, dash_length);
- fprintf(renderer->file, "\\psset{linestyle=dashed,dash=%s %s %s %s %s %s}\n",
- dash_length_buf, hole_width_buf, dot_length_buf, hole_width_buf,
- dot_length_buf, hole_width_buf );
+ pstricks_dtostr (hole_width_buf, hole_width);
+ pstricks_dtostr (dot_length_buf, dot_length);
+ pstricks_dtostr (dash_length_buf, dash_length);
+ fprintf (renderer->file, "\\psset{linestyle=dashed,dash=%s %s %s %s %s %s}\n",
+ dash_length_buf, hole_width_buf, dot_length_buf, hole_width_buf,
+ dot_length_buf, hole_width_buf );
break;
- case LINESTYLE_DOTTED:
- pstricks_dtostr(dot_length_buf, dot_length);
- fprintf(renderer->file, "\\psset{linestyle=dotted,dotsep=%s}\n", dot_length_buf);
+ case DIA_LINE_STYLE_DOTTED:
+ pstricks_dtostr (dot_length_buf, dot_length);
+ fprintf (renderer->file, "\\psset{linestyle=dotted,dotsep=%s}\n", dot_length_buf);
break;
default:
g_warning ("Unknown mode %i", mode);
@@ -431,6 +434,7 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
}
}
+
static void
set_fillstyle(DiaRenderer *self, FillStyle mode)
{
diff --git a/plug-ins/python/diasvg.py b/plug-ins/python/diasvg.py
index 05ae6562d..1fa59d32f 100644
--- a/plug-ins/python/diasvg.py
+++ b/plug-ins/python/diasvg.py
@@ -224,7 +224,7 @@ class SvgRenderer :
join = self.line_join
style = self.line_style
st = ""
- if style == 0 : # LINESTYLE_SOLID
+ if style == 0 : # DIA_LINE_STYLE_SOLID
pass
elif style == 1 : # DASHED
st = 'stroke-dasharray="%.2f,%.2f"' % (dashlen, dashlen)
diff --git a/plug-ins/python/diasvg_import.py b/plug-ins/python/diasvg_import.py
index 48b8ec283..cb0f48e5e 100644
--- a/plug-ins/python/diasvg_import.py
+++ b/plug-ins/python/diasvg_import.py
@@ -127,16 +127,16 @@ class Object :
except :
n = 0
if n == 0 : # should not really happen
- self.props["line-style"] = (0, 1.0) # LINESTYLE_SOLID,
+ self.props["line-style"] = (0, 1.0) # DIA_LINE_STYLE_SOLID,
elif n == 2 :
if dlen > 0.1 : # FIXME:
- self.props["line-style"] = (1, dlen) # LINESTYLE_DASHED,
+ self.props["line-style"] = (1, dlen) # DIA_LINE_STYLE_DASHED,
else :
- self.props["line-style"] = (4, dlen) # LINESTYLE_DOTTED
+ self.props["line-style"] = (4, dlen) # DIA_LINE_STYLE_DOTTED
elif n == 4 :
- self.props["line-style"] = (2, dlen) # LINESTYLE_DASH_DOT,
+ self.props["line-style"] = (2, dlen) # DIA_LINE_STYLE_DASH_DOT,
elif n == 6 :
- self.props["line-style"] = (3, dlen) # LINESTYLE_DASH_DOT_DOT,
+ self.props["line-style"] = (3, dlen) # DIA_LINE_STYLE_DASH_DOT_DOT,
def id(self, s) :
# just to handle/ignore it
self.props["meta"] = { "id" : s }
diff --git a/plug-ins/python/pydia-render.c b/plug-ins/python/pydia-render.c
index 7ec3762a7..308e1488f 100644
--- a/plug-ins/python/pydia-render.c
+++ b/plug-ins/python/pydia-render.c
@@ -288,7 +288,7 @@ set_linejoin (DiaRenderer *renderer, LineJoin mode)
/**
* set_linestyle:
* @renderer: the #DiaRenderer
- * @mode: the new #LineStyle
+ * @mode: the new #DiaLineStyle
* @dash_length: how often to dash
*
* Set linestyle for later use
@@ -296,23 +296,23 @@ set_linejoin (DiaRenderer *renderer, LineJoin mode)
* Optional on the PyDia side.
*/
static void
-set_linestyle (DiaRenderer *renderer, LineStyle mode, double dash_length)
+set_linestyle (DiaRenderer *renderer, DiaLineStyle mode, double dash_length)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
/* line type */
switch (mode) {
- case LINESTYLE_SOLID:
+ case DIA_LINE_STYLE_SOLID:
break;
- case LINESTYLE_DASHED:
+ case DIA_LINE_STYLE_DASHED:
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
break;
- case LINESTYLE_DOTTED:
+ case DIA_LINE_STYLE_DOTTED:
break;
- case LINESTYLE_DEFAULT:
+ case DIA_LINE_STYLE_DEFAULT:
default:
PyErr_Warn (PyExc_RuntimeWarning,
"DiaPyRenderer : Unsupported fill mode specified!\n");
diff --git a/plug-ins/svg/svg-import.c b/plug-ins/svg/svg-import.c
index 2c92b795c..816297934 100644
--- a/plug-ins/svg/svg-import.c
+++ b/plug-ins/svg/svg-import.c
@@ -514,12 +514,13 @@ apply_style (DiaObject *obj,
rprop->real_data = gs->line_width * scale;
lsprop = g_ptr_array_index(props,2);
- if (gs->linestyle != LINESTYLE_DEFAULT)
+ if (gs->linestyle != DIA_LINE_STYLE_DEFAULT) {
lsprop->style = gs->linestyle;
- else if (init)
- lsprop->style = LINESTYLE_SOLID;
- else
+ } else if (init) {
+ lsprop->style = DIA_LINE_STYLE_SOLID;
+ } else {
lsprop->common.experience |= PXP_NOTSET; /* no overwrite */
+ }
lsprop->dash = gs->dashlength * scale;
cprop = g_ptr_array_index(props,3);
diff --git a/plug-ins/vdx/vdx-export.c b/plug-ins/vdx/vdx-export.c
index 1eb8c9dcb..d987e37fc 100644
--- a/plug-ins/vdx/vdx-export.c
+++ b/plug-ins/vdx/vdx-export.c
@@ -85,14 +85,14 @@ struct _VDXRenderer
int depth;
- real linewidth;
+ double linewidth;
LineCaps capsmode;
LineJoin joinmode;
- LineStyle stylemode;
- real dashlength;
+ DiaLineStyle stylemode;
+ double dashlength;
FillStyle fillmode;
DiaFont *font;
- real fontheight;
+ double fontheight;
/* Additions for VDX */
@@ -341,29 +341,27 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
renderer->joinmode = mode;
}
-/** Set line style
- * @param self a renderer
- * @param mode new line style
- */
+/*
+ * Set line style
+ */
static void
-set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
- VDXRenderer *renderer = VDX_RENDERER(self);
+ VDXRenderer *renderer = VDX_RENDERER (self);
renderer->stylemode = mode;
renderer->dashlength = dash_length;
}
-/** Set fill style
- * @param self a renderer
- * @param mode new file style
- */
+/*
+ * Set fill style
+ */
static void
-set_fillstyle(DiaRenderer *self, FillStyle mode)
+set_fillstyle (DiaRenderer *self, FillStyle mode)
{
- VDXRenderer *renderer = VDX_RENDERER(self);
+ VDXRenderer *renderer = VDX_RENDERER (self);
renderer->fillmode = mode;
}
@@ -439,20 +437,20 @@ create_Line (VDXRenderer *renderer,
Line->any.type = vdx_types_Line;
switch (renderer->stylemode) {
- case LINESTYLE_DASHED:
+ case DIA_LINE_STYLE_DASHED:
Line->LinePattern = 2;
break;
- case LINESTYLE_DOTTED:
+ case DIA_LINE_STYLE_DOTTED:
Line->LinePattern = 3;
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
Line->LinePattern = 4;
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
Line->LinePattern = 5;
break;
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
default:
Line->LinePattern = 1;
break;
diff --git a/plug-ins/vdx/vdx-import.c b/plug-ins/vdx/vdx-import.c
index 1fdd14f7a..5425aa4a3 100644
--- a/plug-ins/vdx/vdx-import.c
+++ b/plug-ins/vdx/vdx-import.c
@@ -594,7 +594,9 @@ dia_length(double length, const VDXDocument* theDoc)
return vdx_Point_Scale*length;
}
-/** Sets simple props
+
+/*
+ * Sets simple props
* @param obj the object
* @param Fill any fill
* @param Line any line
@@ -603,53 +605,58 @@ dia_length(double length, const VDXDocument* theDoc)
* @todo dash length not yet done - much other work needed
*/
static void
-vdx_simple_properties(DiaObject *obj,
- const struct vdx_Fill *Fill, const struct vdx_Line *Line,
- const VDXDocument* theDoc, DiaContext *ctx)
+vdx_simple_properties (DiaObject *obj,
+ const struct vdx_Fill *Fill,
+ const struct vdx_Line *Line,
+ const VDXDocument *theDoc,
+ DiaContext *ctx)
{
- GPtrArray *props = g_ptr_array_new ();
+ GPtrArray *props = g_ptr_array_new ();
- if (Line)
- {
- Color color;
+ if (Line) {
+ Color color;
- prop_list_add_line_width (props,Line->LineWeight * vdx_Line_Scale);
+ prop_list_add_line_width (props,Line->LineWeight * vdx_Line_Scale);
- color = Line->LineColor;
- color.alpha = 1.0 - Line->LineColorTrans;
+ color = Line->LineColor;
+ color.alpha = 1.0 - Line->LineColorTrans;
- if (!Line->LinePattern)
- color = vdx_parse_color("#FFFFFF", theDoc, ctx);
+ if (!Line->LinePattern) {
+ color = vdx_parse_color("#FFFFFF", theDoc, ctx);
+ }
- prop_list_add_line_colour (props, &color);
+ prop_list_add_line_colour (props, &color);
- if (Line->LinePattern)
- {
- LinestyleProperty *lsprop =
- (LinestyleProperty *)make_new_prop("line_style",
- PROP_TYPE_LINESTYLE,
- PROP_FLAG_DONT_SAVE);
- if (Line->LinePattern == 2)
- lsprop->style = LINESTYLE_DASHED;
- else if (Line->LinePattern == 4)
- lsprop->style = LINESTYLE_DASH_DOT;
- else if (Line->LinePattern == 3)
- lsprop->style = LINESTYLE_DOTTED;
- else if (Line->LinePattern == 5)
- lsprop->style = LINESTYLE_DASH_DOT_DOT;
- else
- lsprop->style = LINESTYLE_SOLID;
+ if (Line->LinePattern) {
+ LinestyleProperty *lsprop =
+ (LinestyleProperty *) make_new_prop ("line_style",
+ PROP_TYPE_LINESTYLE,
+ PROP_FLAG_DONT_SAVE);
+
+ if (Line->LinePattern == 2) {
+ lsprop->style = DIA_LINE_STYLE_DASHED;
+ } else if (Line->LinePattern == 4) {
+ lsprop->style = DIA_LINE_STYLE_DASH_DOT;
+ } else if (Line->LinePattern == 3) {
+ lsprop->style = DIA_LINE_STYLE_DOTTED;
+ } else if (Line->LinePattern == 5) {
+ lsprop->style = DIA_LINE_STYLE_DASH_DOT_DOT;
+ } else {
+ lsprop->style = DIA_LINE_STYLE_SOLID;
+ }
- lsprop->dash = vdx_Dash_Length;
+ lsprop->dash = vdx_Dash_Length;
- g_ptr_array_add(props,lsprop);
- }
- if (Line->Rounding > 0.0)
- {
- prop_list_add_real(props, "corner_radius", Line->Rounding * vdx_Line_Scale);
- }
+ g_ptr_array_add (props,lsprop);
}
+ if (Line->Rounding > 0.0) {
+ prop_list_add_real (props,
+ "corner_radius",
+ Line->Rounding * vdx_Line_Scale);
+ }
+ }
+
if (Fill && Fill->FillPattern)
{
Color color;
diff --git a/plug-ins/wmf/wmf.cpp b/plug-ins/wmf/wmf.cpp
index 0cb000e88..bcfeb7fcc 100644
--- a/plug-ins/wmf/wmf.cpp
+++ b/plug-ins/wmf/wmf.cpp
@@ -461,57 +461,61 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
}
}
+
static void
-set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
- WmfRenderer *renderer = WMF_RENDERER (self);
+ WmfRenderer *renderer = WMF_RENDERER (self);
+
+ DIAG_NOTE (renderer, "set_linestyle %d\n", mode);
- DIAG_NOTE(renderer, "set_linestyle %d\n", mode);
+ /* dot = 10% of len */
+ renderer->nDashLen = SC (dash_length);
+ /* line type */
+ renderer->fnPenStyle &= ~(PS_STYLE_MASK);
- /* dot = 10% of len */
- renderer->nDashLen = SC(dash_length);
- /* line type */
- renderer->fnPenStyle &= ~(PS_STYLE_MASK);
- switch (mode) {
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
+ switch (mode) {
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
renderer->fnPenStyle |= PS_SOLID;
break;
- case LINESTYLE_DASHED:
+ case DIA_LINE_STYLE_DASHED:
renderer->fnPenStyle |= PS_DASH;
break;
- case LINESTYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT:
renderer->fnPenStyle |= PS_DASHDOT;
break;
- case LINESTYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
renderer->fnPenStyle |= PS_DASHDOTDOT;
break;
- case LINESTYLE_DOTTED:
+ case DIA_LINE_STYLE_DOTTED:
renderer->fnPenStyle |= PS_DOT;
break;
default:
- g_warning("WmfRenderer : Unsupported fill mode specified!\n");
- }
+ g_warning ("WmfRenderer : Unsupported fill mode specified!\n");
+ }
- if (renderer->platform_is_nt)
- return;
+ if (renderer->platform_is_nt) {
+ return;
+ }
- /* Non-solid linestyles are only displayed if width <= 1.
- * Better implementation will require custom linestyles
- * not available on win9x ...
- */
- switch (mode) {
- case LINESTYLE_DASHED:
- case LINESTYLE_DASH_DOT:
- case LINESTYLE_DASH_DOT_DOT:
- case LINESTYLE_DOTTED:
- renderer->nLineWidth = MIN(renderer->nLineWidth, 1);
- case LINESTYLE_SOLID:
- case LINESTYLE_DEFAULT:
+ /* Non-solid linestyles are only displayed if width <= 1.
+ * Better implementation will require custom linestyles
+ * not available on win9x ...
+ */
+ switch (mode) {
+ case DIA_LINE_STYLE_DASHED:
+ case DIA_LINE_STYLE_DASH_DOT:
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
+ case DIA_LINE_STYLE_DOTTED:
+ renderer->nLineWidth = MIN (renderer->nLineWidth, 1);
+ case DIA_LINE_STYLE_SOLID:
+ case DIA_LINE_STYLE_DEFAULT:
break;
- }
+ }
}
+
static void
set_fillstyle(DiaRenderer *self, FillStyle mode)
{
diff --git a/plug-ins/wpg/wpg-import.c b/plug-ins/wpg/wpg-import.c
index 26a092359..938fe9568 100644
--- a/plug-ins/wpg/wpg-import.c
+++ b/plug-ins/wpg/wpg-import.c
@@ -328,22 +328,34 @@ _make_stroke (WpgImportRenderer *ren)
ren->stroke.alpha = 1.0;
switch (ren->LineAttr.Type) {
case WPG_LA_SOLID:
- dia_renderer_set_linestyle (DIA_RENDERER (ren), LINESTYLE_SOLID, 0.0);
+ dia_renderer_set_linestyle (DIA_RENDERER (ren),
+ DIA_LINE_STYLE_SOLID,
+ 0.0);
break;
case WPG_LA_MEDIUMDASH:
- dia_renderer_set_linestyle (DIA_RENDERER (ren), LINESTYLE_DASHED, 0.66);
+ dia_renderer_set_linestyle (DIA_RENDERER (ren),
+ DIA_LINE_STYLE_DASHED,
+ 0.66);
break;
case WPG_LA_SHORTDASH:
- dia_renderer_set_linestyle (DIA_RENDERER (ren), LINESTYLE_DASHED, 0.33);
+ dia_renderer_set_linestyle (DIA_RENDERER (ren),
+ DIA_LINE_STYLE_DASHED,
+ 0.33);
break;
case WPG_LA_DASHDOT:
- dia_renderer_set_linestyle (DIA_RENDERER (ren), LINESTYLE_DASH_DOT, 1.0);
+ dia_renderer_set_linestyle (DIA_RENDERER (ren),
+ DIA_LINE_STYLE_DASH_DOT,
+ 1.0);
break;
case WPG_LA_DASHDOTDOT:
- dia_renderer_set_linestyle (DIA_RENDERER (ren), LINESTYLE_DASH_DOT_DOT, 1.0);
+ dia_renderer_set_linestyle (DIA_RENDERER (ren),
+ DIA_LINE_STYLE_DASH_DOT_DOT,
+ 1.0);
break;
case WPG_LA_DOTS:
- dia_renderer_set_linestyle (DIA_RENDERER (ren), LINESTYLE_DOTTED, 1.0);
+ dia_renderer_set_linestyle (DIA_RENDERER (ren),
+ DIA_LINE_STYLE_DOTTED,
+ 1.0);
break;
default:
g_warning ("Unknown type %i", ren->LineAttr.Type);
diff --git a/plug-ins/wpg/wpg.c b/plug-ins/wpg/wpg.c
index f739e685a..dcce6986b 100644
--- a/plug-ins/wpg/wpg.c
+++ b/plug-ins/wpg/wpg.c
@@ -383,39 +383,41 @@ set_linejoin(DiaRenderer *self, LineJoin mode)
}
}
+
static void
-set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
WpgRenderer *renderer = WPG_RENDERER (self);
- DIAG_NOTE(g_message("set_linestyle %d, %g", mode, dash_length));
+ DIAG_NOTE (g_message ("set_linestyle %d, %g", mode, dash_length));
/* line type */
switch (mode) {
- case LINESTYLE_DEFAULT:
- case LINESTYLE_SOLID:
- renderer->LineAttr.Type = WPG_LA_SOLID;
- break;
- case LINESTYLE_DASHED:
- if (dash_length < 0.5)
- renderer->LineAttr.Type = WPG_LA_SHORTDASH;
- else
- renderer->LineAttr.Type = WPG_LA_MEDIUMDASH;
- break;
- case LINESTYLE_DASH_DOT:
- renderer->LineAttr.Type = WPG_LA_DASHDOT;
- break;
- case LINESTYLE_DASH_DOT_DOT:
- renderer->LineAttr.Type = WPG_LA_DASHDOTDOT;
- break;
- case LINESTYLE_DOTTED:
- renderer->LineAttr.Type = WPG_LA_DOTS;
- break;
- default:
- g_warning("WpgRenderer : Unsupported fill mode specified!\n");
+ case DIA_LINE_STYLE_DEFAULT:
+ case DIA_LINE_STYLE_SOLID:
+ renderer->LineAttr.Type = WPG_LA_SOLID;
+ break;
+ case DIA_LINE_STYLE_DASHED:
+ if (dash_length < 0.5)
+ renderer->LineAttr.Type = WPG_LA_SHORTDASH;
+ else
+ renderer->LineAttr.Type = WPG_LA_MEDIUMDASH;
+ break;
+ case DIA_LINE_STYLE_DASH_DOT:
+ renderer->LineAttr.Type = WPG_LA_DASHDOT;
+ break;
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
+ renderer->LineAttr.Type = WPG_LA_DASHDOTDOT;
+ break;
+ case DIA_LINE_STYLE_DOTTED:
+ renderer->LineAttr.Type = WPG_LA_DOTS;
+ break;
+ default:
+ g_warning ("WpgRenderer : Unsupported fill mode specified!\n");
}
}
+
static void
set_fillstyle(DiaRenderer *self, FillStyle mode)
{
diff --git a/plug-ins/xfig/xfig-export.c b/plug-ins/xfig/xfig-export.c
index 0e60ca689..0d58319c0 100644
--- a/plug-ins/xfig/xfig-export.c
+++ b/plug-ins/xfig/xfig-export.c
@@ -71,7 +71,7 @@ struct _DiaXfigRenderer {
double linewidth;
LineCaps capsmode;
LineJoin joinmode;
- LineStyle stylemode;
+ DiaLineStyle stylemode;
double dashlength;
FillStyle fillmode;
DiaFont *font;
@@ -186,19 +186,19 @@ static int
figLineStyle (DiaXfigRenderer *renderer)
{
switch (renderer->stylemode) {
- case LINESTYLE_SOLID:
- return 0;
- case LINESTYLE_DASHED:
- return 1;
- case LINESTYLE_DASH_DOT:
- return 3;
- case LINESTYLE_DASH_DOT_DOT:
- return 4;
- case LINESTYLE_DOTTED:
- return 2;
- case LINESTYLE_DEFAULT:
- default:
- return 0;
+ case DIA_LINE_STYLE_SOLID:
+ return 0;
+ case DIA_LINE_STYLE_DASHED:
+ return 1;
+ case DIA_LINE_STYLE_DASH_DOT:
+ return 3;
+ case DIA_LINE_STYLE_DASH_DOT_DOT:
+ return 4;
+ case DIA_LINE_STYLE_DOTTED:
+ return 2;
+ case DIA_LINE_STYLE_DEFAULT:
+ default:
+ return 0;
}
}
@@ -508,7 +508,7 @@ set_linejoin (DiaRenderer *self, LineJoin mode)
static void
-set_linestyle (DiaRenderer *self, LineStyle mode, double dash_length)
+set_linestyle (DiaRenderer *self, DiaLineStyle mode, double dash_length)
{
DiaXfigRenderer *renderer = DIA_XFIG_RENDERER (self);
diff --git a/plug-ins/xfig/xfig-import.c b/plug-ins/xfig/xfig-import.c
index 9741705d4..c412345f9 100644
--- a/plug-ins/xfig/xfig-import.c
+++ b/plug-ins/xfig/xfig-import.c
@@ -149,30 +149,32 @@ static PropDescription xfig_simple_prop_descs_line[] = {
{ "line_colour", PROP_TYPE_COLOUR },
PROP_DESC_END};
-static LineStyle
-fig_line_style_to_dia(int line_style, DiaContext *ctx)
+
+static DiaLineStyle
+fig_line_style_to_dia (int line_style, DiaContext *ctx)
{
- switch (line_style) {
+ switch (line_style) {
case 0:
- return LINESTYLE_SOLID;
+ return DIA_LINE_STYLE_SOLID;
case 1:
- return LINESTYLE_DASHED;
+ return DIA_LINE_STYLE_DASHED;
case 2:
- return LINESTYLE_DOTTED;
+ return DIA_LINE_STYLE_DOTTED;
case 3:
- return LINESTYLE_DASH_DOT;
+ return DIA_LINE_STYLE_DASH_DOT;
case 4:
- return LINESTYLE_DASH_DOT_DOT;
+ return DIA_LINE_STYLE_DASH_DOT_DOT;
case 5:
- dia_context_add_message(ctx, _("Triple-dotted lines are not supported by Dia; "
- "using double-dotted"));
- return LINESTYLE_DASH_DOT_DOT;
+ dia_context_add_message (ctx, _("Triple-dotted lines are not supported by Dia; "
+ "using double-dotted"));
+ return DIA_LINE_STYLE_DASH_DOT_DOT;
default:
- dia_context_add_message(ctx, _("Line style %d should not appear"), line_style);
- return LINESTYLE_SOLID;
+ dia_context_add_message (ctx, _("Line style %d should not appear"), line_style);
+ return DIA_LINE_STYLE_SOLID;
}
}
+
static void
fig_simple_properties (DiaObject *obj,
int line_style,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]