[dia] [restructuring] use object_(describe|get)_props
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [restructuring] use object_(describe|get)_props
- Date: Wed, 3 Oct 2012 20:02:15 +0000 (UTC)
commit d86671fe8484cee51e38d68d62d2f790d8c639e0
Author: Hans Breuer <hans breuer org>
Date: Sat Sep 29 23:03:05 2012 +0200
[restructuring] use object_(describe|get)_props
objects/standard/arc.c | 75 ++++++++++++++-------------------
objects/standard/beziergon.c | 71 ++++++++++++-------------------
objects/standard/box.c | 91 +++++++++++++++++-----------------------
objects/standard/ellipse.c | 86 ++++++++++++++++---------------------
objects/standard/image.c | 56 ++++++++++++------------
objects/standard/line.c | 72 +++++++++++++------------------
objects/standard/outline.c | 93 +++++++++++++++-------------------------
objects/standard/polygon.c | 71 ++++++++++++-------------------
objects/standard/polyline.c | 79 ++++++++++++++---------------------
objects/standard/textobj.c | 88 ++++++++++++++++++--------------------
objects/standard/zigzagline.c | 77 ++++++++++++++--------------------
11 files changed, 362 insertions(+), 497 deletions(-)
---
diff --git a/objects/standard/arc.c b/objects/standard/arc.c
index 2ba545e..5ec6d48 100644
--- a/objects/standard/arc.c
+++ b/objects/standard/arc.c
@@ -89,8 +89,6 @@ static void arc_update_handles(Arc *arc);
static void arc_destroy(Arc *arc);
static DiaObject *arc_copy(Arc *arc);
-static PropDescription *arc_describe_props(Arc *arc);
-static void arc_get_props(Arc *arc, GPtrArray *props);
static void arc_set_props(Arc *arc, GPtrArray *props);
static void arc_save(Arc *arc, ObjectNode obj_node, const char *filename);
@@ -110,35 +108,6 @@ static ObjectTypeOps arc_type_ops =
(ApplyDefaultsFunc) NULL
};
-DiaObjectType arc_type =
-{
- "Standard - Arc", /* name */
- 0, /* version */
- (char **) arc_icon, /* pixmap */
-
- &arc_type_ops /* ops */
-};
-
-DiaObjectType *_arc_type = (DiaObjectType *) &arc_type;
-
-static ObjectOps arc_ops = {
- (DestroyFunc) arc_destroy,
- (DrawFunc) arc_draw,
- (DistanceFunc) arc_distance_from,
- (SelectFunc) arc_select,
- (CopyFunc) arc_copy,
- (MoveFunc) arc_move,
- (MoveHandleFunc) arc_move_handle,
- (GetPropertiesFunc) object_create_props_dialog,
- (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
- (ObjectMenuFunc) NULL,
- (DescribePropsFunc) arc_describe_props,
- (GetPropsFunc) arc_get_props,
- (SetPropsFunc) arc_set_props,
- (TextEditFunc) 0,
- (ApplyPropertiesListFunc) object_apply_props,
-};
-
static PropDescription arc_props[] = {
CONNECTION_COMMON_PROPERTIES,
PROP_STD_LINE_WIDTH,
@@ -152,14 +121,6 @@ static PropDescription arc_props[] = {
PROP_DESC_END
};
-static PropDescription *
-arc_describe_props(Arc *arc)
-{
- if (arc_props[0].quark == 0)
- prop_desc_list_calculate_quarks(arc_props);
- return arc_props;
-}
-
static PropOffset arc_offsets[] = {
CONNECTION_COMMON_PROPERTIES_OFFSETS,
{ PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Arc, line_width) },
@@ -175,12 +136,38 @@ static PropOffset arc_offsets[] = {
{ NULL, 0, 0 }
};
-static void
-arc_get_props(Arc *arc, GPtrArray *props)
+DiaObjectType arc_type =
{
- object_get_props_from_offsets(&arc->connection.object,
- arc_offsets, props);
-}
+ "Standard - Arc", /* name */
+ 0, /* version */
+ (char **) arc_icon, /* pixmap */
+
+ &arc_type_ops, /* ops */
+ NULL, /* pixmap_file */
+ NULL, /* default_user_data */
+ arc_props, /* prop_descs */
+ arc_offsets /* prop_offsets */
+};
+
+DiaObjectType *_arc_type = (DiaObjectType *) &arc_type;
+
+static ObjectOps arc_ops = {
+ (DestroyFunc) arc_destroy,
+ (DrawFunc) arc_draw,
+ (DistanceFunc) arc_distance_from,
+ (SelectFunc) arc_select,
+ (CopyFunc) arc_copy,
+ (MoveFunc) arc_move,
+ (MoveHandleFunc) arc_move_handle,
+ (GetPropertiesFunc) object_create_props_dialog,
+ (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
+ (ObjectMenuFunc) NULL,
+ (DescribePropsFunc) object_describe_props,
+ (GetPropsFunc) object_get_props,
+ (SetPropsFunc) arc_set_props,
+ (TextEditFunc) 0,
+ (ApplyPropertiesListFunc) object_apply_props,
+};
static void
arc_set_props(Arc *arc, GPtrArray *props)
diff --git a/objects/standard/beziergon.c b/objects/standard/beziergon.c
index 4a0f019..5792917 100644
--- a/objects/standard/beziergon.c
+++ b/objects/standard/beziergon.c
@@ -79,8 +79,6 @@ static void beziergon_update_data(Beziergon *beziergon);
static void beziergon_destroy(Beziergon *beziergon);
static DiaObject *beziergon_copy(Beziergon *beziergon);
-static PropDescription *beziergon_describe_props(Beziergon *beziergon);
-static void beziergon_get_props(Beziergon *beziergon, GPtrArray *props);
static void beziergon_set_props(Beziergon *beziergon, GPtrArray *props);
static void beziergon_save(Beziergon *beziergon, ObjectNode obj_node,
@@ -98,6 +96,29 @@ static ObjectTypeOps beziergon_type_ops =
(ApplyDefaultsFunc) NULL
};
+static PropDescription beziergon_props[] = {
+ BEZSHAPE_COMMON_PROPERTIES,
+ PROP_STD_LINE_WIDTH,
+ PROP_STD_LINE_COLOUR,
+ PROP_STD_LINE_STYLE,
+ PROP_STD_LINE_JOIN_OPTIONAL,
+ PROP_STD_FILL_COLOUR,
+ PROP_STD_SHOW_BACKGROUND,
+ PROP_DESC_END
+};
+
+static PropOffset beziergon_offsets[] = {
+ BEZSHAPE_COMMON_PROPERTIES_OFFSETS,
+ { PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Beziergon, line_width) },
+ { "line_colour", PROP_TYPE_COLOUR, offsetof(Beziergon, line_color) },
+ { "line_style", PROP_TYPE_LINESTYLE,
+ offsetof(Beziergon, line_style), offsetof(Beziergon, dashlength) },
+ { "line_join", PROP_TYPE_ENUM, offsetof(Beziergon, line_join) },
+ { "fill_colour", PROP_TYPE_COLOUR, offsetof(Beziergon, inner_color) },
+ { "show_background", PROP_TYPE_BOOL, offsetof(Beziergon, show_background) },
+ { NULL, 0, 0 }
+};
+
static DiaObjectType beziergon_type =
{
"Standard - Beziergon", /* name */
@@ -106,7 +127,9 @@ static DiaObjectType beziergon_type =
&beziergon_type_ops, /* ops */
NULL, /* pixmap_file */
- 0 /* default_user_data */
+ 0, /* default_user_data */
+ beziergon_props,
+ beziergon_offsets
};
DiaObjectType *_beziergon_type = (DiaObjectType *) &beziergon_type;
@@ -123,51 +146,13 @@ static ObjectOps beziergon_ops = {
(GetPropertiesFunc) object_create_props_dialog,
(ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
(ObjectMenuFunc) beziergon_get_object_menu,
- (DescribePropsFunc) beziergon_describe_props,
- (GetPropsFunc) beziergon_get_props,
+ (DescribePropsFunc) object_describe_props,
+ (GetPropsFunc) object_get_props,
(SetPropsFunc) beziergon_set_props,
(TextEditFunc) 0,
(ApplyPropertiesListFunc) object_apply_props,
};
-static PropDescription beziergon_props[] = {
- BEZSHAPE_COMMON_PROPERTIES,
- PROP_STD_LINE_WIDTH,
- PROP_STD_LINE_COLOUR,
- PROP_STD_LINE_STYLE,
- PROP_STD_LINE_JOIN_OPTIONAL,
- PROP_STD_FILL_COLOUR,
- PROP_STD_SHOW_BACKGROUND,
- PROP_DESC_END
-};
-
-static PropDescription *
-beziergon_describe_props(Beziergon *beziergon)
-{
- if (beziergon_props[0].quark == 0)
- prop_desc_list_calculate_quarks(beziergon_props);
- return beziergon_props;
-}
-
-static PropOffset beziergon_offsets[] = {
- BEZSHAPE_COMMON_PROPERTIES_OFFSETS,
- { PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Beziergon, line_width) },
- { "line_colour", PROP_TYPE_COLOUR, offsetof(Beziergon, line_color) },
- { "line_style", PROP_TYPE_LINESTYLE,
- offsetof(Beziergon, line_style), offsetof(Beziergon, dashlength) },
- { "line_join", PROP_TYPE_ENUM, offsetof(Beziergon, line_join) },
- { "fill_colour", PROP_TYPE_COLOUR, offsetof(Beziergon, inner_color) },
- { "show_background", PROP_TYPE_BOOL, offsetof(Beziergon, show_background) },
- { NULL, 0, 0 }
-};
-
-static void
-beziergon_get_props(Beziergon *beziergon, GPtrArray *props)
-{
- object_get_props_from_offsets(&beziergon->bezier.object, beziergon_offsets,
- props);
-}
-
static void
beziergon_set_props(Beziergon *beziergon, GPtrArray *props)
{
diff --git a/objects/standard/box.c b/objects/standard/box.c
index d16b0df..fc2d2f4 100644
--- a/objects/standard/box.c
+++ b/objects/standard/box.c
@@ -90,8 +90,6 @@ static DiaObject *box_create(Point *startpoint,
static void box_destroy(Box *box);
static DiaObject *box_copy(Box *box);
-static PropDescription *box_describe_props(Box *box);
-static void box_get_props(Box *box, GPtrArray *props);
static void box_set_props(Box *box, GPtrArray *props);
static void box_save(Box *box, ObjectNode obj_node, const char *filename);
@@ -107,33 +105,17 @@ static ObjectTypeOps box_type_ops =
(ApplyDefaultsFunc) NULL
};
-DiaObjectType box_type =
-{
- "Standard - Box", /* name */
- 0, /* version */
- (char **) box_icon, /* pixmap */
-
- &box_type_ops /* ops */
-};
-
-DiaObjectType *_box_type = (DiaObjectType *) &box_type;
-
-static ObjectOps box_ops = {
- (DestroyFunc) box_destroy,
- (DrawFunc) box_draw,
- (DistanceFunc) box_distance_from,
- (SelectFunc) box_select,
- (CopyFunc) box_copy,
- (MoveFunc) box_move,
- (MoveHandleFunc) box_move_handle,
- (GetPropertiesFunc) object_create_props_dialog,
- (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
- (ObjectMenuFunc) box_get_object_menu,
- (DescribePropsFunc) box_describe_props,
- (GetPropsFunc) box_get_props,
- (SetPropsFunc) box_set_props,
- (TextEditFunc) 0,
- (ApplyPropertiesListFunc) object_apply_props,
+static PropOffset box_offsets[] = {
+ ELEMENT_COMMON_PROPERTIES_OFFSETS,
+ { PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Box, border_width) },
+ { "line_colour", PROP_TYPE_COLOUR, offsetof(Box, border_color) },
+ { "fill_colour", PROP_TYPE_COLOUR, offsetof(Box, inner_color) },
+ { "show_background", PROP_TYPE_BOOL, offsetof(Box, show_background) },
+ { "aspect", PROP_TYPE_ENUM, offsetof(Box, aspect) },
+ { "line_style", PROP_TYPE_LINESTYLE,
+ offsetof(Box, line_style), offsetof(Box, dashlength) },
+ { "corner_radius", PROP_TYPE_REAL, offsetof(Box, corner_radius) },
+ { NULL, 0, 0 }
};
static PropNumData corner_radius_data = { 0.0, 10.0, 0.1 };
@@ -158,33 +140,38 @@ static PropDescription box_props[] = {
PROP_DESC_END
};
-static PropDescription *
-box_describe_props(Box *box)
+DiaObjectType box_type =
{
- if (box_props[0].quark == 0)
- prop_desc_list_calculate_quarks(box_props);
- return box_props;
-}
+ "Standard - Box", /* name */
+ 0, /* version */
+ (char **) box_icon, /* pixmap */
-static PropOffset box_offsets[] = {
- ELEMENT_COMMON_PROPERTIES_OFFSETS,
- { PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Box, border_width) },
- { "line_colour", PROP_TYPE_COLOUR, offsetof(Box, border_color) },
- { "fill_colour", PROP_TYPE_COLOUR, offsetof(Box, inner_color) },
- { "show_background", PROP_TYPE_BOOL, offsetof(Box, show_background) },
- { "aspect", PROP_TYPE_ENUM, offsetof(Box, aspect) },
- { "line_style", PROP_TYPE_LINESTYLE,
- offsetof(Box, line_style), offsetof(Box, dashlength) },
- { "corner_radius", PROP_TYPE_REAL, offsetof(Box, corner_radius) },
- { NULL, 0, 0 }
+ &box_type_ops, /* ops */
+ NULL, /* pixmap_file */
+ 0, /* default_user_data */
+ box_props,
+ box_offsets
};
-static void
-box_get_props(Box *box, GPtrArray *props)
-{
- object_get_props_from_offsets(&box->element.object,
- box_offsets, props);
-}
+DiaObjectType *_box_type = (DiaObjectType *) &box_type;
+
+static ObjectOps box_ops = {
+ (DestroyFunc) box_destroy,
+ (DrawFunc) box_draw,
+ (DistanceFunc) box_distance_from,
+ (SelectFunc) box_select,
+ (CopyFunc) box_copy,
+ (MoveFunc) box_move,
+ (MoveHandleFunc) box_move_handle,
+ (GetPropertiesFunc) object_create_props_dialog,
+ (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
+ (ObjectMenuFunc) box_get_object_menu,
+ (DescribePropsFunc) object_describe_props,
+ (GetPropsFunc) object_get_props,
+ (SetPropsFunc) box_set_props,
+ (TextEditFunc) 0,
+ (ApplyPropertiesListFunc) object_apply_props,
+};
static void
box_set_props(Box *box, GPtrArray *props)
diff --git a/objects/standard/ellipse.c b/objects/standard/ellipse.c
index cc938f6..5363867 100644
--- a/objects/standard/ellipse.c
+++ b/objects/standard/ellipse.c
@@ -86,7 +86,6 @@ static DiaObject *ellipse_create(Point *startpoint,
static void ellipse_destroy(Ellipse *ellipse);
static DiaObject *ellipse_copy(Ellipse *ellipse);
-static PropDescription *ellipse_describe_props(Ellipse *ellipse);
static void ellipse_get_props(Ellipse *ellipse, GPtrArray *props);
static void ellipse_set_props(Ellipse *ellipse, GPtrArray *props);
@@ -103,13 +102,47 @@ static ObjectTypeOps ellipse_type_ops =
(ApplyDefaultsFunc) NULL
};
+static PropOffset ellipse_offsets[] = {
+ ELEMENT_COMMON_PROPERTIES_OFFSETS,
+ { PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Ellipse, border_width) },
+ { "line_colour", PROP_TYPE_COLOUR, offsetof(Ellipse, border_color) },
+ { "fill_colour", PROP_TYPE_COLOUR, offsetof(Ellipse, inner_color) },
+ { "show_background", PROP_TYPE_BOOL, offsetof(Ellipse, show_background) },
+ { "aspect", PROP_TYPE_ENUM, offsetof(Ellipse, aspect) },
+ { "line_style", PROP_TYPE_LINESTYLE,
+ offsetof(Ellipse, line_style), offsetof(Ellipse, dashlength) },
+ { NULL, 0, 0 }
+};
+
+static PropEnumData prop_aspect_data[] = {
+ { N_("Free"), FREE_ASPECT },
+ { N_("Fixed"), FIXED_ASPECT },
+ { N_("Circle"), CIRCLE_ASPECT },
+ { NULL, 0 }
+};
+static PropDescription ellipse_props[] = {
+ ELEMENT_COMMON_PROPERTIES,
+ PROP_STD_LINE_WIDTH,
+ PROP_STD_LINE_COLOUR,
+ PROP_STD_FILL_COLOUR,
+ PROP_STD_SHOW_BACKGROUND,
+ PROP_STD_LINE_STYLE,
+ { "aspect", PROP_TYPE_ENUM, PROP_FLAG_VISIBLE,
+ N_("Aspect ratio"), NULL, prop_aspect_data },
+ PROP_DESC_END
+};
+
DiaObjectType ellipse_type =
{
"Standard - Ellipse", /* name */
0, /* version */
(char **) ellipse_icon, /* pixmap */
- &ellipse_type_ops /* ops */
+ &ellipse_type_ops, /* ops */
+ NULL,
+ 0,
+ ellipse_props,
+ ellipse_offsets
};
DiaObjectType *_ellipse_type = (DiaObjectType *) &ellipse_type;
@@ -125,58 +158,13 @@ static ObjectOps ellipse_ops = {
(GetPropertiesFunc) object_create_props_dialog,
(ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
(ObjectMenuFunc) ellipse_get_object_menu,
- (DescribePropsFunc) ellipse_describe_props,
- (GetPropsFunc) ellipse_get_props,
+ (DescribePropsFunc) object_describe_props,
+ (GetPropsFunc) object_get_props,
(SetPropsFunc) ellipse_set_props,
(TextEditFunc) 0,
(ApplyPropertiesListFunc) object_apply_props,
};
-static PropEnumData prop_aspect_data[] = {
- { N_("Free"), FREE_ASPECT },
- { N_("Fixed"), FIXED_ASPECT },
- { N_("Circle"), CIRCLE_ASPECT },
- { NULL, 0 }
-};
-static PropDescription ellipse_props[] = {
- ELEMENT_COMMON_PROPERTIES,
- PROP_STD_LINE_WIDTH,
- PROP_STD_LINE_COLOUR,
- PROP_STD_FILL_COLOUR,
- PROP_STD_SHOW_BACKGROUND,
- PROP_STD_LINE_STYLE,
- { "aspect", PROP_TYPE_ENUM, PROP_FLAG_VISIBLE,
- N_("Aspect ratio"), NULL, prop_aspect_data },
- PROP_DESC_END
-};
-
-static PropDescription *
-ellipse_describe_props(Ellipse *ellipse)
-{
- if (ellipse_props[0].quark == 0)
- prop_desc_list_calculate_quarks(ellipse_props);
- return ellipse_props;
-}
-
-static PropOffset ellipse_offsets[] = {
- ELEMENT_COMMON_PROPERTIES_OFFSETS,
- { PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Ellipse, border_width) },
- { "line_colour", PROP_TYPE_COLOUR, offsetof(Ellipse, border_color) },
- { "fill_colour", PROP_TYPE_COLOUR, offsetof(Ellipse, inner_color) },
- { "show_background", PROP_TYPE_BOOL, offsetof(Ellipse, show_background) },
- { "aspect", PROP_TYPE_ENUM, offsetof(Ellipse, aspect) },
- { "line_style", PROP_TYPE_LINESTYLE,
- offsetof(Ellipse, line_style), offsetof(Ellipse, dashlength) },
- { NULL, 0, 0 }
-};
-
-static void
-ellipse_get_props(Ellipse *ellipse, GPtrArray *props)
-{
- object_get_props_from_offsets(&ellipse->element.object,
- ellipse_offsets, props);
-}
-
static void
ellipse_set_props(Ellipse *ellipse, GPtrArray *props)
{
diff --git a/objects/standard/image.c b/objects/standard/image.c
index 9c94b00..79d4782 100644
--- a/objects/standard/image.c
+++ b/objects/standard/image.c
@@ -113,13 +113,34 @@ static ObjectTypeOps image_type_ops =
(ApplyDefaultsFunc) NULL
};
+static PropDescription image_props[] = {
+ ELEMENT_COMMON_PROPERTIES,
+ { "image_file", PROP_TYPE_FILE, PROP_FLAG_VISIBLE,
+ N_("Image file"), NULL, NULL},
+ { "inline_data", PROP_TYPE_BOOL, PROP_FLAG_DONT_MERGE|PROP_FLAG_VISIBLE|PROP_FLAG_OPTIONAL,
+ N_("Inline data"), N_("Store image data in diagram"), NULL },
+ { "pixbuf", PROP_TYPE_PIXBUF, PROP_FLAG_OPTIONAL,
+ N_("Pixbuf"), N_("The Pixbuf reference"), NULL },
+ { "show_border", PROP_TYPE_BOOL, PROP_FLAG_VISIBLE,
+ N_("Draw border"), NULL, NULL},
+ { "keep_aspect", PROP_TYPE_BOOL, PROP_FLAG_VISIBLE,
+ N_("Keep aspect ratio"), NULL, NULL},
+ PROP_STD_LINE_WIDTH,
+ PROP_STD_LINE_COLOUR,
+ PROP_STD_LINE_STYLE,
+ PROP_DESC_END
+};
+
DiaObjectType image_type =
{
"Standard - Image", /* name */
0, /* version */
(char **) image_icon, /* pixmap */
- &image_type_ops /* ops */
+ &image_type_ops, /* ops */
+ NULL,
+ 0,
+ image_props
};
DiaObjectType *_image_type = (DiaObjectType *) &image_type;
@@ -135,39 +156,13 @@ static ObjectOps image_ops = {
(GetPropertiesFunc) object_create_props_dialog,
(ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
(ObjectMenuFunc) NULL,
- (DescribePropsFunc) image_describe_props,
+ (DescribePropsFunc) object_describe_props,
(GetPropsFunc) image_get_props,
(SetPropsFunc) image_set_props,
(TextEditFunc) 0,
(ApplyPropertiesListFunc) object_apply_props,
};
-static PropDescription image_props[] = {
- ELEMENT_COMMON_PROPERTIES,
- { "image_file", PROP_TYPE_FILE, PROP_FLAG_VISIBLE,
- N_("Image file"), NULL, NULL},
- { "inline_data", PROP_TYPE_BOOL, PROP_FLAG_DONT_MERGE|PROP_FLAG_VISIBLE|PROP_FLAG_OPTIONAL,
- N_("Inline data"), N_("Store image data in diagram"), NULL },
- { "pixbuf", PROP_TYPE_PIXBUF, PROP_FLAG_OPTIONAL,
- N_("Pixbuf"), N_("The Pixbuf reference"), NULL },
- { "show_border", PROP_TYPE_BOOL, PROP_FLAG_VISIBLE,
- N_("Draw border"), NULL, NULL},
- { "keep_aspect", PROP_TYPE_BOOL, PROP_FLAG_VISIBLE,
- N_("Keep aspect ratio"), NULL, NULL},
- PROP_STD_LINE_WIDTH,
- PROP_STD_LINE_COLOUR,
- PROP_STD_LINE_STYLE,
- PROP_DESC_END
-};
-
-static PropDescription *
-image_describe_props(Image *image)
-{
- if (image_props[0].quark == 0)
- prop_desc_list_calculate_quarks(image_props);
- return image_props;
-}
-
static PropOffset image_offsets[] = {
ELEMENT_COMMON_PROPERTIES_OFFSETS,
{ "image_file", PROP_TYPE_FILE, offsetof(Image, file) },
@@ -182,6 +177,11 @@ static PropOffset image_offsets[] = {
{ NULL, 0, 0 }
};
+/*!
+ * \brief Get properties of the _Image
+ * \memberof _Image
+ * Overwites DiaObject::get_props() to initialize pixbuf property
+ */
static void
image_get_props(Image *image, GPtrArray *props)
{
diff --git a/objects/standard/line.c b/objects/standard/line.c
index 2aac244..fe8bfb9 100644
--- a/objects/standard/line.c
+++ b/objects/standard/line.c
@@ -90,7 +90,6 @@ static void line_destroy(Line *line);
static DiaObject *line_copy(Line *line);
static PropDescription *line_describe_props(Line *line);
-static void line_get_props(Line *line, GPtrArray *props);
static void line_set_props(Line *line, GPtrArray *props);
static void line_save(Line *line, ObjectNode obj_node, const char *filename);
@@ -108,34 +107,6 @@ static ObjectTypeOps line_type_ops =
(ApplyDefaultsFunc) NULL
};
-DiaObjectType line_type =
-{
- "Standard - Line", /* name */
- 0, /* version */
- (char **) line_icon, /* pixmap */
- &line_type_ops /* ops */
-};
-
-DiaObjectType *_line_type = (DiaObjectType *) &line_type;
-
-static ObjectOps line_ops = {
- (DestroyFunc) line_destroy,
- (DrawFunc) line_draw,
- (DistanceFunc) line_distance_from,
- (SelectFunc) line_select,
- (CopyFunc) line_copy,
- (MoveFunc) line_move,
- (MoveHandleFunc) line_move_handle,
- (GetPropertiesFunc) object_create_props_dialog,
- (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
- (ObjectMenuFunc) line_get_object_menu,
- (DescribePropsFunc) line_describe_props,
- (GetPropsFunc) line_get_props,
- (SetPropsFunc) line_set_props,
- (TextEditFunc) 0,
- (ApplyPropertiesListFunc) object_apply_props,
-};
-
static PropNumData gap_range = { -G_MAXFLOAT, G_MAXFLOAT, 0.1};
static PropDescription line_props[] = {
@@ -163,14 +134,6 @@ static PropDescription line_props[] = {
PROP_DESC_END
};
-static PropDescription *
-line_describe_props(Line *line)
-{
- if (line_props[0].quark == 0)
- prop_desc_list_calculate_quarks(line_props);
- return line_props;
-}
-
static PropOffset line_offsets[] = {
OBJECT_COMMON_PROPERTIES_OFFSETS,
{ PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Line, line_width) },
@@ -189,12 +152,37 @@ static PropOffset line_offsets[] = {
{ NULL, 0, 0 }
};
-static void
-line_get_props(Line *line, GPtrArray *props)
+DiaObjectType line_type =
{
- object_get_props_from_offsets(&line->connection.object,
- line_offsets, props);
-}
+ "Standard - Line", /* name */
+ 0, /* version */
+ (char **) line_icon, /* pixmap */
+ &line_type_ops, /* ops */
+ NULL,
+ 0,
+ line_props,
+ line_offsets
+};
+
+DiaObjectType *_line_type = (DiaObjectType *) &line_type;
+
+static ObjectOps line_ops = {
+ (DestroyFunc) line_destroy,
+ (DrawFunc) line_draw,
+ (DistanceFunc) line_distance_from,
+ (SelectFunc) line_select,
+ (CopyFunc) line_copy,
+ (MoveFunc) line_move,
+ (MoveHandleFunc) line_move_handle,
+ (GetPropertiesFunc) object_create_props_dialog,
+ (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
+ (ObjectMenuFunc) line_get_object_menu,
+ (DescribePropsFunc) object_describe_props,
+ (GetPropsFunc) object_get_props,
+ (SetPropsFunc) line_set_props,
+ (TextEditFunc) 0,
+ (ApplyPropertiesListFunc) object_apply_props,
+};
static void
line_set_props(Line *line, GPtrArray *props)
diff --git a/objects/standard/outline.c b/objects/standard/outline.c
index 1e1c05a..b40794e 100644
--- a/objects/standard/outline.c
+++ b/objects/standard/outline.c
@@ -94,6 +94,36 @@ static ObjectTypeOps outline_type_ops =
(ApplyDefaultsFunc) NULL
};
+static PropNumData _rotation_range = { 0.0f, 360.0f, 1.0f };
+static PropDescription outline_props[] = {
+ OBJECT_COMMON_PROPERTIES,
+ { "name", PROP_TYPE_STRING,PROP_FLAG_VISIBLE|PROP_FLAG_DONT_MERGE,
+ N_("Text content"),NULL },
+ { "rotation", PROP_TYPE_REAL,PROP_FLAG_VISIBLE,
+ N_("Rotation"), N_("Angle to rotate the outline"), &_rotation_range},
+ /* the default PROP_STD_TEXT_FONT has PROP_FLAG_DONT_SAVE, we need saving */
+ PROP_STD_TEXT_FONT_OPTIONS(PROP_FLAG_VISIBLE),
+ PROP_STD_TEXT_HEIGHT_OPTIONS(PROP_FLAG_VISIBLE),
+ PROP_STD_LINE_WIDTH,
+ PROP_STD_LINE_COLOUR,
+ PROP_STD_FILL_COLOUR,
+ PROP_STD_SHOW_BACKGROUND,
+ PROP_DESC_END
+};
+
+static PropOffset outline_offsets[] = {
+ OBJECT_COMMON_PROPERTIES_OFFSETS,
+ { "name", PROP_TYPE_STRING, offsetof(Outline, name) },
+ { "rotation", PROP_TYPE_REAL, offsetof(Outline, rotation) },
+ { "text_font",PROP_TYPE_FONT,offsetof(Outline,font) },
+ { PROP_STDNAME_TEXT_HEIGHT,PROP_STDTYPE_TEXT_HEIGHT,offsetof(Outline, font_height) },
+ { PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Outline, line_width) },
+ { "line_colour", PROP_TYPE_COLOUR, offsetof(Outline, line_color) },
+ { "fill_colour", PROP_TYPE_COLOUR, offsetof(Outline, fill_color) },
+ { "show_background", PROP_TYPE_BOOL, offsetof(Outline, show_background) },
+ { NULL, 0, 0 }
+};
+
static DiaObjectType outline_type =
{
"Standard - Outline", /* name */
@@ -102,7 +132,9 @@ static DiaObjectType outline_type =
&outline_type_ops, /* ops */
NULL, /* pixmap_file */
- 0 /* default_user_data */
+ 0, /* default_user_data */
+ outline_props,
+ outline_offsets
};
/* make accesible from the outside for type regristation */
@@ -123,8 +155,6 @@ static void outline_destroy (Outline *outline);
static DiaObject *outline_copy (Outline *outline);
static DiaMenu *outline_get_object_menu(Outline *outline,
Point *clickedpoint);
-static PropDescription *outline_describe_props(Outline *outline);
-static void outline_get_props(Outline *outline, GPtrArray *props);
static void outline_set_props(Outline *outline, GPtrArray *props);
static ObjectOps outline_ops = {
@@ -138,8 +168,8 @@ static ObjectOps outline_ops = {
(GetPropertiesFunc) object_create_props_dialog,
(ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
(ObjectMenuFunc) outline_get_object_menu,
- (DescribePropsFunc) outline_describe_props,
- (GetPropsFunc) outline_get_props,
+ (DescribePropsFunc) object_describe_props,
+ (GetPropsFunc) object_get_props,
(SetPropsFunc) outline_set_props,
(TextEditFunc) 0,
(ApplyPropertiesListFunc) object_apply_props,
@@ -203,36 +233,6 @@ outline_load(ObjectNode obj_node, int version,DiaContext *ctx)
obj_node,version,ctx);
}
-/* Class/Object implementation */
-static PropNumData _rotation_range = { 0.0f, 360.0f, 1.0f };
-static PropDescription outline_props[] = {
- OBJECT_COMMON_PROPERTIES,
- { "name", PROP_TYPE_STRING,PROP_FLAG_VISIBLE|PROP_FLAG_DONT_MERGE,
- N_("Text content"),NULL },
- { "rotation", PROP_TYPE_REAL,PROP_FLAG_VISIBLE,
- N_("Rotation"), N_("Angle to rotate the outline"), &_rotation_range},
- /* the default PROP_STD_TEXT_FONT has PROP_FLAG_DONT_SAVE, we need saving */
- PROP_STD_TEXT_FONT_OPTIONS(PROP_FLAG_VISIBLE),
- PROP_STD_TEXT_HEIGHT_OPTIONS(PROP_FLAG_VISIBLE),
- PROP_STD_LINE_WIDTH,
- PROP_STD_LINE_COLOUR,
- PROP_STD_FILL_COLOUR,
- PROP_STD_SHOW_BACKGROUND,
- PROP_DESC_END
-};
-
-static PropOffset outline_offsets[] = {
- OBJECT_COMMON_PROPERTIES_OFFSETS,
- { "name", PROP_TYPE_STRING, offsetof(Outline, name) },
- { "rotation", PROP_TYPE_REAL, offsetof(Outline, rotation) },
- { "text_font",PROP_TYPE_FONT,offsetof(Outline,font) },
- { PROP_STDNAME_TEXT_HEIGHT,PROP_STDTYPE_TEXT_HEIGHT,offsetof(Outline, font_height) },
- { PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Outline, line_width) },
- { "line_colour", PROP_TYPE_COLOUR, offsetof(Outline, line_color) },
- { "fill_colour", PROP_TYPE_COLOUR, offsetof(Outline, fill_color) },
- { "show_background", PROP_TYPE_BOOL, offsetof(Outline, show_background) },
- { NULL, 0, 0 }
-};
/* empty write function */
static cairo_status_t
write_nul (void *closure,
@@ -465,29 +465,6 @@ outline_get_object_menu(Outline *outline, Point *clickedpoint)
}
/*!
- * \brief Descibe the object parameters (bot it's values)
- *
- * A standard props compliant object needs to describe its parameters
- *
- * \memberof Outline
- */
-static PropDescription *
-outline_describe_props (Outline *outline)
-{
- if (outline_props[0].quark == 0)
- prop_desc_list_calculate_quarks(outline_props);
- return outline_props;
-}
-/*!
- * \brief Fill a properties vector reflecting the current state of the object
- * \memberof Outline
- */
-static void
-outline_get_props (Outline *outline, GPtrArray *props)
-{
- object_get_props_from_offsets(&outline->object, outline_offsets, props);
-}
-/*!
* \brief Set the object state from the given proeprty vector
* \memberof Outline
*/
diff --git a/objects/standard/polygon.c b/objects/standard/polygon.c
index 69cd55a..2ad9291 100644
--- a/objects/standard/polygon.c
+++ b/objects/standard/polygon.c
@@ -82,8 +82,6 @@ static void polygon_update_data(Polygon *polygon);
static void polygon_destroy(Polygon *polygon);
static DiaObject *polygon_copy(Polygon *polygon);
-static PropDescription *polygon_describe_props(Polygon *polygon);
-static void polygon_get_props(Polygon *polygon, GPtrArray *props);
static void polygon_set_props(Polygon *polygon, GPtrArray *props);
static void polygon_save(Polygon *polygon, ObjectNode obj_node,
@@ -100,6 +98,29 @@ static ObjectTypeOps polygon_type_ops =
(ApplyDefaultsFunc) NULL,
};
+static PropDescription polygon_props[] = {
+ POLYSHAPE_COMMON_PROPERTIES,
+ PROP_STD_LINE_WIDTH,
+ PROP_STD_LINE_COLOUR,
+ PROP_STD_LINE_STYLE,
+ PROP_STD_LINE_JOIN_OPTIONAL,
+ PROP_STD_FILL_COLOUR,
+ PROP_STD_SHOW_BACKGROUND,
+ PROP_DESC_END
+};
+
+static PropOffset polygon_offsets[] = {
+ POLYSHAPE_COMMON_PROPERTIES_OFFSETS,
+ { PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Polygon, line_width) },
+ { "line_colour", PROP_TYPE_COLOUR, offsetof(Polygon, line_color) },
+ { "line_style", PROP_TYPE_LINESTYLE,
+ offsetof(Polygon, line_style), offsetof(Polygon, dashlength) },
+ { "line_join", PROP_TYPE_ENUM, offsetof(Polygon, line_join) },
+ { "fill_colour", PROP_TYPE_COLOUR, offsetof(Polygon, inner_color) },
+ { "show_background", PROP_TYPE_BOOL, offsetof(Polygon, show_background) },
+ { NULL, 0, 0 }
+};
+
static DiaObjectType polygon_type =
{
"Standard - Polygon", /* name */
@@ -108,7 +129,9 @@ static DiaObjectType polygon_type =
&polygon_type_ops, /* ops */
NULL, /* pixmap_file */
- 0 /* default_user_data */
+ 0, /* default_user_data */
+ polygon_props,
+ polygon_offsets
};
DiaObjectType *_polygon_type = (DiaObjectType *) &polygon_type;
@@ -125,51 +148,13 @@ static ObjectOps polygon_ops = {
(GetPropertiesFunc) object_create_props_dialog,
(ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
(ObjectMenuFunc) polygon_get_object_menu,
- (DescribePropsFunc) polygon_describe_props,
- (GetPropsFunc) polygon_get_props,
+ (DescribePropsFunc) object_describe_props,
+ (GetPropsFunc) object_get_props,
(SetPropsFunc) polygon_set_props,
(TextEditFunc) 0,
(ApplyPropertiesListFunc) object_apply_props,
};
-static PropDescription polygon_props[] = {
- POLYSHAPE_COMMON_PROPERTIES,
- PROP_STD_LINE_WIDTH,
- PROP_STD_LINE_COLOUR,
- PROP_STD_LINE_STYLE,
- PROP_STD_LINE_JOIN_OPTIONAL,
- PROP_STD_FILL_COLOUR,
- PROP_STD_SHOW_BACKGROUND,
- PROP_DESC_END
-};
-
-static PropDescription *
-polygon_describe_props(Polygon *polygon)
-{
- if (polygon_props[0].quark == 0)
- prop_desc_list_calculate_quarks(polygon_props);
- return polygon_props;
-}
-
-static PropOffset polygon_offsets[] = {
- POLYSHAPE_COMMON_PROPERTIES_OFFSETS,
- { PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Polygon, line_width) },
- { "line_colour", PROP_TYPE_COLOUR, offsetof(Polygon, line_color) },
- { "line_style", PROP_TYPE_LINESTYLE,
- offsetof(Polygon, line_style), offsetof(Polygon, dashlength) },
- { "line_join", PROP_TYPE_ENUM, offsetof(Polygon, line_join) },
- { "fill_colour", PROP_TYPE_COLOUR, offsetof(Polygon, inner_color) },
- { "show_background", PROP_TYPE_BOOL, offsetof(Polygon, show_background) },
- { NULL, 0, 0 }
-};
-
-static void
-polygon_get_props(Polygon *polygon, GPtrArray *props)
-{
- object_get_props_from_offsets(&polygon->poly.object,
- polygon_offsets, props);
-}
-
static void
polygon_set_props(Polygon *polygon, GPtrArray *props)
{
diff --git a/objects/standard/polyline.c b/objects/standard/polyline.c
index 74c4967..908418d 100644
--- a/objects/standard/polyline.c
+++ b/objects/standard/polyline.c
@@ -73,8 +73,6 @@ static void polyline_update_data(Polyline *polyline);
static void polyline_destroy(Polyline *polyline);
static DiaObject *polyline_copy(Polyline *polyline);
-static PropDescription *polyline_describe_props(Polyline *polyline);
-static void polyline_get_props(Polyline *polyline, GPtrArray *props);
static void polyline_set_props(Polyline *polyline, GPtrArray *props);
static void polyline_save(Polyline *polyline, ObjectNode obj_node,
@@ -93,38 +91,6 @@ static ObjectTypeOps polyline_type_ops =
(ApplyDefaultsFunc) NULL /*polyline_apply_defaults*/
};
-static DiaObjectType polyline_type =
-{
- "Standard - PolyLine", /* name */
- 0, /* version */
- (char **) polyline_icon, /* pixmap */
-
- &polyline_type_ops, /* ops */
- NULL, /* pixmap_file */
- 0 /* default_user_data */
-};
-
-DiaObjectType *_polyline_type = (DiaObjectType *) &polyline_type;
-
-
-static ObjectOps polyline_ops = {
- (DestroyFunc) polyline_destroy,
- (DrawFunc) polyline_draw,
- (DistanceFunc) polyline_distance_from,
- (SelectFunc) polyline_select,
- (CopyFunc) polyline_copy,
- (MoveFunc) polyline_move,
- (MoveHandleFunc) polyline_move_handle,
- (GetPropertiesFunc) object_create_props_dialog,
- (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
- (ObjectMenuFunc) polyline_get_object_menu,
- (DescribePropsFunc) polyline_describe_props,
- (GetPropsFunc) polyline_get_props,
- (SetPropsFunc) polyline_set_props,
- (TextEditFunc) 0,
- (ApplyPropertiesListFunc) object_apply_props,
-};
-
static PropNumData polyline_corner_radius_data = { 0.0, 10.0, 0.1 };
static PropNumData gap_range = { -G_MAXFLOAT, G_MAXFLOAT, 0.1};
@@ -148,14 +114,6 @@ static PropDescription polyline_props[] = {
PROP_DESC_END
};
-static PropDescription *
-polyline_describe_props(Polyline *polyline)
-{
- if (polyline_props[0].quark == 0)
- prop_desc_list_calculate_quarks(polyline_props);
- return polyline_props;
-}
-
static PropOffset polyline_offsets[] = {
POLYCONN_COMMON_PROPERTIES_OFFSETS,
{ PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Polyline, line_width) },
@@ -174,12 +132,39 @@ static PropOffset polyline_offsets[] = {
{ NULL, 0, 0 }
};
-static void
-polyline_get_props(Polyline *polyline, GPtrArray *props)
+static DiaObjectType polyline_type =
{
- object_get_props_from_offsets(&polyline->poly.object, polyline_offsets,
- props);
-}
+ "Standard - PolyLine", /* name */
+ 0, /* version */
+ (char **) polyline_icon, /* pixmap */
+
+ &polyline_type_ops, /* ops */
+ NULL, /* pixmap_file */
+ 0, /* default_user_data */
+ polyline_props,
+ polyline_offsets
+};
+
+DiaObjectType *_polyline_type = (DiaObjectType *) &polyline_type;
+
+
+static ObjectOps polyline_ops = {
+ (DestroyFunc) polyline_destroy,
+ (DrawFunc) polyline_draw,
+ (DistanceFunc) polyline_distance_from,
+ (SelectFunc) polyline_select,
+ (CopyFunc) polyline_copy,
+ (MoveFunc) polyline_move,
+ (MoveHandleFunc) polyline_move_handle,
+ (GetPropertiesFunc) object_create_props_dialog,
+ (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
+ (ObjectMenuFunc) polyline_get_object_menu,
+ (DescribePropsFunc) object_describe_props,
+ (GetPropsFunc) object_get_props,
+ (SetPropsFunc) polyline_set_props,
+ (TextEditFunc) 0,
+ (ApplyPropertiesListFunc) object_apply_props,
+};
static void
polyline_set_props(Polyline *polyline, GPtrArray *props)
diff --git a/objects/standard/textobj.c b/objects/standard/textobj.c
index 5e7483d..61fdf4f 100644
--- a/objects/standard/textobj.c
+++ b/objects/standard/textobj.c
@@ -52,14 +52,17 @@ typedef struct _Textobj Textobj;
*/
struct _Textobj {
DiaObject object;
-
+ /*! just one handle to connect/move */
Handle text_handle;
-
+ /*! the real text object to be drawn */
Text *text;
+ /*! synched copy of attributes from _Text object */
TextAttributes attrs;
+ /*! vertical alignment of the whole text block */
Valign vert_align;
-
+ /*! bounding box filling */
Color fill_color;
+ /*! backround to be filled or transparent */
gboolean show_background;
};
@@ -83,7 +86,6 @@ static DiaObject *textobj_create(Point *startpoint,
Handle **handle2);
static void textobj_destroy(Textobj *textobj);
-static PropDescription *textobj_describe_props(Textobj *textobj);
static void textobj_get_props(Textobj *textobj, GPtrArray *props);
static void textobj_set_props(Textobj *textobj, GPtrArray *props);
@@ -101,40 +103,6 @@ static ObjectTypeOps textobj_type_ops =
(ApplyDefaultsFunc) NULL
};
-/* Version history:
- * Version 1 added vertical alignment, and needed old objects to use the
- * right alignment.
- */
-
-DiaObjectType textobj_type =
-{
- "Standard - Text", /* name */
- 1, /* version */
- (char **) text_icon, /* pixmap */
-
- &textobj_type_ops /* ops */
-};
-
-DiaObjectType *_textobj_type = (DiaObjectType *) &textobj_type;
-
-static ObjectOps textobj_ops = {
- (DestroyFunc) textobj_destroy,
- (DrawFunc) textobj_draw,
- (DistanceFunc) textobj_distance_from,
- (SelectFunc) textobj_select,
- (CopyFunc) object_copy_using_properties,
- (MoveFunc) textobj_move,
- (MoveHandleFunc) textobj_move_handle,
- (GetPropertiesFunc) object_create_props_dialog,
- (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
- (ObjectMenuFunc) NULL,
- (DescribePropsFunc) textobj_describe_props,
- (GetPropsFunc) textobj_get_props,
- (SetPropsFunc) textobj_set_props,
- (TextEditFunc) 0,
- (ApplyPropertiesListFunc) object_apply_props,
-};
-
PropEnumData prop_text_vert_align_data[] = {
{ N_("Bottom"), VALIGN_BOTTOM },
{ N_("Top"), VALIGN_TOP },
@@ -156,14 +124,6 @@ static PropDescription textobj_props[] = {
PROP_DESC_END
};
-static PropDescription *
-textobj_describe_props(Textobj *textobj)
-{
- if (textobj_props[0].quark == 0)
- prop_desc_list_calculate_quarks(textobj_props);
- return textobj_props;
-}
-
static PropOffset textobj_offsets[] = {
OBJECT_COMMON_PROPERTIES_OFFSETS,
{"text",PROP_TYPE_TEXT,offsetof(Textobj,text)},
@@ -177,6 +137,42 @@ static PropOffset textobj_offsets[] = {
{ NULL, 0, 0 }
};
+/* Version history:
+ * Version 1 added vertical alignment, and needed old objects to use the
+ * right alignment.
+ */
+DiaObjectType textobj_type =
+{
+ "Standard - Text", /* name */
+ 1, /* version */
+ (char **) text_icon, /* pixmap */
+ &textobj_type_ops, /* ops */
+ NULL,
+ 0,
+ textobj_props,
+ textobj_offsets
+};
+
+DiaObjectType *_textobj_type = (DiaObjectType *) &textobj_type;
+
+static ObjectOps textobj_ops = {
+ (DestroyFunc) textobj_destroy,
+ (DrawFunc) textobj_draw,
+ (DistanceFunc) textobj_distance_from,
+ (SelectFunc) textobj_select,
+ (CopyFunc) object_copy_using_properties,
+ (MoveFunc) textobj_move,
+ (MoveHandleFunc) textobj_move_handle,
+ (GetPropertiesFunc) object_create_props_dialog,
+ (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
+ (ObjectMenuFunc) NULL,
+ (DescribePropsFunc) object_describe_props,
+ (GetPropsFunc) textobj_get_props,
+ (SetPropsFunc) textobj_set_props,
+ (TextEditFunc) 0,
+ (ApplyPropertiesListFunc) object_apply_props,
+};
+
static void
textobj_get_props(Textobj *textobj, GPtrArray *props)
{
diff --git a/objects/standard/zigzagline.c b/objects/standard/zigzagline.c
index f683759..f49c83e 100644
--- a/objects/standard/zigzagline.c
+++ b/objects/standard/zigzagline.c
@@ -76,7 +76,6 @@ static DiaObject *zigzagline_copy(Zigzagline *zigzagline);
static DiaMenu *zigzagline_get_object_menu(Zigzagline *zigzagline,
Point *clickedpoint);
-static PropDescription *zigzagline_describe_props(Zigzagline *zigzagline);
static void zigzagline_get_props(Zigzagline *zigzagline, GPtrArray *props);
static void zigzagline_set_props(Zigzagline *zigzagline, GPtrArray *props);
@@ -93,37 +92,6 @@ static ObjectTypeOps zigzagline_type_ops =
(ApplyDefaultsFunc) NULL /*zigzagline_apply_defaults*/
};
-static DiaObjectType zigzagline_type =
-{
- "Standard - ZigZagLine", /* name */
- /* Version 0 had no autorouting and so shouldn't have it set by default. */
- 1, /* version */
- (char **) zigzagline_icon, /* pixmap */
-
- &zigzagline_type_ops /* ops */
-};
-
-DiaObjectType *_zigzagline_type = (DiaObjectType *) &zigzagline_type;
-
-
-static ObjectOps zigzagline_ops = {
- (DestroyFunc) zigzagline_destroy,
- (DrawFunc) zigzagline_draw,
- (DistanceFunc) zigzagline_distance_from,
- (SelectFunc) zigzagline_select,
- (CopyFunc) zigzagline_copy,
- (MoveFunc) zigzagline_move,
- (MoveHandleFunc) zigzagline_move_handle,
- (GetPropertiesFunc) object_create_props_dialog,
- (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
- (ObjectMenuFunc) zigzagline_get_object_menu,
- (DescribePropsFunc) zigzagline_describe_props,
- (GetPropsFunc) zigzagline_get_props,
- (SetPropsFunc) zigzagline_set_props,
- (TextEditFunc) 0,
- (ApplyPropertiesListFunc) object_apply_props,
-};
-
static PropNumData zigzagline_corner_radius_data = { 0.0, 10.0, 0.1 };
static PropDescription zigzagline_props[] = {
@@ -140,14 +108,6 @@ static PropDescription zigzagline_props[] = {
PROP_DESC_END
};
-static PropDescription *
-zigzagline_describe_props(Zigzagline *zigzagline)
-{
- if (zigzagline_props[0].quark == 0)
- prop_desc_list_calculate_quarks(zigzagline_props);
- return zigzagline_props;
-}
-
static PropOffset zigzagline_offsets[] = {
ORTHCONN_COMMON_PROPERTIES_OFFSETS,
{ PROP_STDNAME_LINE_WIDTH, PROP_STDTYPE_LINE_WIDTH, offsetof(Zigzagline, line_width) },
@@ -162,12 +122,39 @@ static PropOffset zigzagline_offsets[] = {
{ NULL, 0, 0 }
};
-static void
-zigzagline_get_props(Zigzagline *zigzagline, GPtrArray *props)
+static DiaObjectType zigzagline_type =
{
- object_get_props_from_offsets(&zigzagline->orth.object, zigzagline_offsets,
- props);
-}
+ "Standard - ZigZagLine", /* name */
+ /* Version 0 had no autorouting and so shouldn't have it set by default. */
+ 1, /* version */
+ (char **) zigzagline_icon, /* pixmap */
+ &zigzagline_type_ops, /* ops */
+ NULL,
+ 0,
+ zigzagline_props,
+ zigzagline_offsets
+};
+
+DiaObjectType *_zigzagline_type = (DiaObjectType *) &zigzagline_type;
+
+
+static ObjectOps zigzagline_ops = {
+ (DestroyFunc) zigzagline_destroy,
+ (DrawFunc) zigzagline_draw,
+ (DistanceFunc) zigzagline_distance_from,
+ (SelectFunc) zigzagline_select,
+ (CopyFunc) zigzagline_copy,
+ (MoveFunc) zigzagline_move,
+ (MoveHandleFunc) zigzagline_move_handle,
+ (GetPropertiesFunc) object_create_props_dialog,
+ (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
+ (ObjectMenuFunc) zigzagline_get_object_menu,
+ (DescribePropsFunc) object_describe_props,
+ (GetPropsFunc) object_get_props,
+ (SetPropsFunc) zigzagline_set_props,
+ (TextEditFunc) 0,
+ (ApplyPropertiesListFunc) object_apply_props,
+};
static void
zigzagline_set_props(Zigzagline *zigzagline, GPtrArray *props)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]