From 7faa82c93af28995e4e17cced27d28a290caef6b Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Mon, 14 Jul 2008 17:30:09 +0000 Subject: [PATCH] Cleaned up old (and crappy) style stuff --- adg/adg-canvas-private.h | 5 - adg/adg-canvas.c | 350 ++++++++++------------------------------------- adg/adg-entity.c | 272 ------------------------------------ adg/adg-entity.h | 24 ---- adg/adg-path-private.h | 1 - adg/adg-path.c | 85 ------------ docs/adg-sections.txt | 8 -- 7 files changed, 75 insertions(+), 670 deletions(-) rewrite adg/adg-canvas.c (74%) diff --git a/adg/adg-canvas-private.h b/adg/adg-canvas-private.h index 20e808ac..022d5350 100644 --- a/adg/adg-canvas-private.h +++ b/adg/adg-canvas-private.h @@ -29,11 +29,6 @@ G_BEGIN_DECLS struct _AdgCanvasPrivate { - /* Fallback styles */ - AdgLineStyle *line_style; - AdgFontStyle *font_style; - AdgArrowStyle *arrow_style; - AdgDimStyle *dim_style; }; diff --git a/adg/adg-canvas.c b/adg/adg-canvas.c dissimilarity index 74% index 8a0c7609..ac0010f3 100644 --- a/adg/adg-canvas.c +++ b/adg/adg-canvas.c @@ -1,275 +1,75 @@ -/* ADG - Automatic Drawing Generation - * Copyright (C) 2007-2008, Nicola Fontana - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - - -/** - * SECTION:canvas - * @title: AdgCanvas - * @short_description: The drawing container - * - * This container represents the object where the rendering process draws. All - * the drawing must have a canvas, and only one, as master parent (as all the - * #GtkWidget must have a #GtkWindow). - * - * Internally, the target is mantained as a #cairo_t context pointer. - */ - -#include "adg-canvas.h" -#include "adg-canvas-private.h" -#include "adg-line-style.h" -#include "adg-font-style.h" -#include "adg-arrow-style.h" -#include "adg-intl.h" - -#define PARENT_CLASS ((AdgContainerClass *) adg_canvas_parent_class) - - -enum -{ - PROP_0, - PROP_LINE_STYLE, - PROP_FONT_STYLE, - PROP_ARROW_STYLE, - PROP_DIM_STYLE -}; - - -static void get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -static void set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static const AdgLineStyle * - get_line_style (AdgEntity *entity); -static void set_line_style (AdgEntity *entity, - AdgLineStyle *line_style); -static const AdgFontStyle * - get_font_style (AdgEntity *entity); -static void set_font_style (AdgEntity *entity, - AdgFontStyle *font_style); -static const AdgArrowStyle * - get_arrow_style (AdgEntity *entity); -static void set_arrow_style (AdgEntity *entity, - AdgArrowStyle *arrow_style); -static const AdgDimStyle * - get_dim_style (AdgEntity *entity); -static void set_dim_style (AdgEntity *entity, - AdgDimStyle *dim_style); - - -G_DEFINE_TYPE (AdgCanvas, adg_canvas, ADG_TYPE_CONTAINER); - - -static void -adg_canvas_class_init (AdgCanvasClass *klass) -{ - GObjectClass *gobject_class; - AdgEntityClass *entity_class; - GParamSpec *param; - - gobject_class = (GObjectClass *) klass; - entity_class = (AdgEntityClass *) klass; - - g_type_class_add_private (klass, sizeof (AdgCanvasPrivate)); - - gobject_class->set_property = set_property; - gobject_class->get_property = get_property; - - entity_class->get_line_style = get_line_style; - entity_class->set_line_style = set_line_style; - entity_class->get_font_style = get_font_style; - entity_class->set_font_style = set_font_style; - entity_class->get_arrow_style = get_arrow_style; - entity_class->set_arrow_style = set_arrow_style; - entity_class->get_dim_style = get_dim_style; - entity_class->set_dim_style = set_dim_style; - - param = g_param_spec_boxed ("line-style", - P_("Line Style"), - P_("Fallback line style of the canvas"), - ADG_TYPE_LINE_STYLE, - G_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_LINE_STYLE, param); - - param = g_param_spec_boxed ("font-style", - P_("Font Style"), - P_("Fallback font style of the canvas"), - ADG_TYPE_FONT_STYLE, - G_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_FONT_STYLE, param); - - param = g_param_spec_boxed ("arrow-style", - P_("Arrow Style"), - P_("Fallback arrow style of the canvas"), - ADG_TYPE_ARROW_STYLE, - G_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_ARROW_STYLE, param); - - param = g_param_spec_boxed ("dim-style", - P_("Dimension Style"), - P_("Fallback dimension style of the canvas"), - ADG_TYPE_DIM_STYLE, - G_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_DIM_STYLE, param); -} - -static void -adg_canvas_init (AdgCanvas *canvas) -{ - AdgCanvasPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (canvas, - ADG_TYPE_CANVAS, - AdgCanvasPrivate); - - priv->line_style = (AdgLineStyle *) adg_style_from_id (ADG_TYPE_LINE_STYLE, - ADG_LINE_STYLE_DRAW); - priv->font_style = (AdgFontStyle *) adg_style_from_id (ADG_TYPE_FONT_STYLE, - ADG_FONT_STYLE_TEXT); - priv->arrow_style = (AdgArrowStyle *) adg_style_from_id (ADG_TYPE_ARROW_STYLE, - ADG_ARROW_STYLE_ARROW); - priv->dim_style = (AdgDimStyle *) adg_style_from_id (ADG_TYPE_DIM_STYLE, - ADG_DIM_STYLE_ISO); - - adg_entity_set_context ((AdgEntity *) canvas, adg_context_new ()); - - canvas->priv = priv; -} - - -static void -get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - AdgCanvasPrivate *priv = ((AdgCanvas *) object)->priv; - - switch (prop_id) - { - case PROP_LINE_STYLE: - g_value_set_boxed (value, priv->line_style); - break; - case PROP_FONT_STYLE: - g_value_set_boxed (value, priv->font_style); - break; - case PROP_ARROW_STYLE: - g_value_set_boxed (value, priv->arrow_style); - break; - case PROP_DIM_STYLE: - g_value_set_boxed (value, priv->dim_style); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - AdgEntity *entity = (AdgEntity *) object; - - switch (prop_id) - { - case PROP_LINE_STYLE: - set_line_style (entity, g_value_get_boxed (value)); - break; - case PROP_FONT_STYLE: - set_font_style (entity, g_value_get_boxed (value)); - break; - case PROP_ARROW_STYLE: - set_arrow_style (entity, g_value_get_boxed (value)); - break; - case PROP_DIM_STYLE: - set_dim_style (entity, g_value_get_boxed (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - - -AdgCanvas * -adg_canvas_new (void) -{ - return g_object_new (ADG_TYPE_CANVAS, NULL); -} - - -static const AdgLineStyle * -get_line_style (AdgEntity *entity) -{ - return ((AdgCanvas *) entity)->priv->line_style; -} - -static void -set_line_style (AdgEntity *entity, - AdgLineStyle *line_style) -{ - ((AdgCanvas *) entity)->priv->line_style = line_style; - g_object_notify ((GObject *) entity, "line-style"); -} - -static const AdgFontStyle * -get_font_style (AdgEntity *entity) -{ - return ((AdgCanvas *) entity)->priv->font_style; -} - -static void -set_font_style (AdgEntity *entity, - AdgFontStyle *font_style) -{ - ((AdgCanvas *) entity)->priv->font_style = font_style; - g_object_notify ((GObject *) entity, "font-style"); -} - -static const AdgArrowStyle * -get_arrow_style (AdgEntity *entity) -{ - return ((AdgCanvas *) entity)->priv->arrow_style; -} - -static void -set_arrow_style (AdgEntity *entity, - AdgArrowStyle *arrow_style) -{ - ((AdgCanvas *) entity)->priv->arrow_style = arrow_style; - g_object_notify ((GObject *) entity, "arrow-style"); -} - -static const AdgDimStyle * -get_dim_style (AdgEntity *entity) -{ - return ((AdgCanvas *) entity)->priv->dim_style; -} - -static void -set_dim_style (AdgEntity *entity, - AdgDimStyle *dim_style) -{ - ((AdgCanvas *) entity)->priv->dim_style = dim_style; - g_object_notify ((GObject *) entity, "dim-style"); -} +/* ADG - Automatic Drawing Generation + * Copyright (C) 2007-2008, Nicola Fontana + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +/** + * SECTION:canvas + * @title: AdgCanvas + * @short_description: The drawing container + * + * This container represents the object where the rendering process draws. All + * the drawing must have a canvas, and only one, as master parent (as all the + * #GtkWidget must have a #GtkWindow). + * + * Internally, the target is mantained as a #cairo_t context pointer. + */ + +#include "adg-canvas.h" +#include "adg-canvas-private.h" +#include "adg-line-style.h" +#include "adg-font-style.h" +#include "adg-arrow-style.h" +#include "adg-intl.h" + +#define PARENT_CLASS ((AdgContainerClass *) adg_canvas_parent_class) + + +G_DEFINE_TYPE (AdgCanvas, adg_canvas, ADG_TYPE_CONTAINER); + + +static void +adg_canvas_class_init (AdgCanvasClass *klass) +{ + g_type_class_add_private (klass, sizeof (AdgCanvasPrivate)); +} + +static void +adg_canvas_init (AdgCanvas *canvas) +{ + AdgCanvasPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (canvas, + ADG_TYPE_CANVAS, + AdgCanvasPrivate); + canvas->priv = priv; + + adg_entity_set_context ((AdgEntity *) canvas, adg_context_new ()); +} + + +/** + * adg_canvas_new: + * + * Creates a new empty canvas object. + * + * Return value: the canvas + **/ +AdgCanvas * +adg_canvas_new (void) +{ + return g_object_new (ADG_TYPE_CANVAS, NULL); +} diff --git a/adg/adg-entity.c b/adg/adg-entity.c index 910b27f8..6a37cfda 100644 --- a/adg/adg-entity.c +++ b/adg/adg-entity.c @@ -109,14 +109,6 @@ adg_entity_class_init (AdgEntityClass *klass) klass->model_matrix_changed = model_matrix_changed; klass->paper_matrix_changed = NULL; klass->render = render; - klass->get_line_style = NULL; - klass->set_line_style = NULL; - klass->get_font_style = NULL; - klass->set_font_style = NULL; - klass->get_arrow_style = NULL; - klass->set_arrow_style = NULL; - klass->get_dim_style = NULL; - klass->set_dim_style = NULL; klass->get_model_matrix = get_model_matrix; klass->get_paper_matrix = get_paper_matrix; @@ -416,270 +408,6 @@ adg_entity_apply (AdgEntity *entity, } /** - * adg_entity_get_line_style: - * @entity: an #AdgEntity object - * - * Gets the line style for @entity. If @entity does not implement - * get_line_style, %NULL is returned and an error is logged. - * If get_line_style is implemented but the line style is not set, - * a fallback line style is searched in the hierarchy of @entity. - * - * Return value: the requested line style - */ -const AdgLineStyle * -adg_entity_get_line_style (AdgEntity *entity) -{ - AdgEntityClass *entity_class; - const AdgLineStyle *line_style; - gboolean is_parent; - - g_return_val_if_fail (ADG_IS_ENTITY (entity), NULL); - - for (is_parent = FALSE; entity != NULL; entity = (AdgEntity *) entity->priv->parent) - { - entity_class = ADG_ENTITY_GET_CLASS (entity); - - if (entity_class->get_line_style != NULL) - { - line_style = entity_class->get_line_style (entity); - - if (line_style != NULL) - break; - } - else - { - /* Abort if the first entity does not implement get_line_style */ - g_return_val_if_fail (is_parent, NULL); - } - - is_parent = TRUE; - } - - return line_style; -} - -/** - * adg_entity_set_line_style: - * @entity: an #AdgEntity object - * @line_style: an #AdgLineStyle style - * - * Sets the line style for @entity to @line_style. - * If @entity does not implement set_line_style, an error is logged. - */ -void -adg_entity_set_line_style (AdgEntity *entity, - AdgLineStyle *line_style) -{ - AdgEntityClass *entity_class; - - g_return_if_fail (ADG_IS_ENTITY (entity)); - - entity_class = ADG_ENTITY_GET_CLASS (entity); - - g_return_if_fail (entity_class->set_line_style != NULL); - - entity_class->set_line_style (entity, line_style); -} - -/** - * adg_entity_get_font_style: - * @entity: an #AdgEntity object - * - * Gets the font style for @entity. If @entity does not implement - * get_font_style, %NULL is returned and an error is logged. - * If get_font_style is implemented but the font style is not set, - * a fallback font style is searched in the hierarchy of @entity. - * - * Return value: the requested font style - */ -const AdgFontStyle * -adg_entity_get_font_style (AdgEntity *entity) -{ - AdgEntityClass *entity_class; - const AdgFontStyle *font_style; - gboolean is_parent; - - g_return_val_if_fail (ADG_IS_ENTITY (entity), NULL); - - for (is_parent = FALSE; entity != NULL; entity = (AdgEntity *) entity->priv->parent) - { - entity_class = ADG_ENTITY_GET_CLASS (entity); - - if (entity_class->get_font_style != NULL) - { - font_style = entity_class->get_font_style (entity); - - if (font_style != NULL) - break; - } - else - { - /* Abort if the first entity does not implement get_font_style */ - g_return_val_if_fail (is_parent, NULL); - } - - is_parent = TRUE; - } - - return font_style; -} - -/** - * adg_entity_set_font_style: - * @entity: an #AdgEntity object - * @font_style: an #AdgFontStyle style - * - * Sets the font style for @entity to @font_style. - * If @entity does not implement set_font_style, an error is logged. - */ -void -adg_entity_set_font_style (AdgEntity *entity, - AdgFontStyle *font_style) -{ - AdgEntityClass *entity_class; - - g_return_if_fail (ADG_IS_ENTITY (entity)); - - entity_class = ADG_ENTITY_GET_CLASS (entity); - - g_return_if_fail (entity_class->set_font_style != NULL); - - entity_class->set_font_style (entity, font_style); -} - -/** - * adg_entity_get_arrow_style: - * @entity: an #AdgEntity object - * - * Gets the arrow style for @entity. If @entity does not implement - * get_arrow_style, %NULL is returned and an error is logged. - * If get_arrow_style is implemented but the arrow style is not set, - * a fallback arrow style is searched in the hierarchy of @entity. - * - * Return value: the requested arrow style - */ -const AdgArrowStyle * -adg_entity_get_arrow_style (AdgEntity *entity) -{ - AdgEntityClass *entity_class; - const AdgArrowStyle *arrow_style; - gboolean is_parent; - - g_return_val_if_fail (ADG_IS_ENTITY (entity), NULL); - - for (is_parent = FALSE; entity != NULL; entity = (AdgEntity *) entity->priv->parent) - { - entity_class = ADG_ENTITY_GET_CLASS (entity); - - if (entity_class->get_arrow_style != NULL) - { - arrow_style = entity_class->get_arrow_style (entity); - - if (arrow_style != NULL) - break; - } - else - { - /* Abort if the first entity does not implement get_arrow_style */ - g_return_val_if_fail (is_parent, NULL); - } - - is_parent = TRUE; - } - - return arrow_style; -} - -/** - * adg_entity_set_arrow_style: - * @entity: an #AdgEntity object - * @arrow_style: an #AdgArrowStyle style - * - * Sets the arrow style for @entity to @arrow_style. - * If @entity does not implement set_arrow_style, an error is logged. - */ -void -adg_entity_set_arrow_style (AdgEntity *entity, - AdgArrowStyle *arrow_style) -{ - AdgEntityClass *entity_class; - - g_return_if_fail (ADG_IS_ENTITY (entity)); - - entity_class = ADG_ENTITY_GET_CLASS (entity); - - g_return_if_fail (entity_class->set_arrow_style != NULL); - - entity_class->set_arrow_style (entity, arrow_style); -} - -/** - * adg_entity_get_dim_style: - * @entity: an #AdgEntity object - * - * Gets the dimension style for @entity. If @entity does not implement - * get_dim_style, %NULL is returned and an error is logged. - * If get_dim_style is implemented but the dimension style is not set, - * a fallback dimension style is searched in the hierarchy of @entity. - * - * Return value: the requested dimension style - */ -const AdgDimStyle * -adg_entity_get_dim_style (AdgEntity *entity) -{ - AdgEntityClass *entity_class; - const AdgDimStyle *dim_style; - gboolean is_parent; - - g_return_val_if_fail (ADG_IS_ENTITY (entity), NULL); - - for (is_parent = FALSE; entity != NULL; entity = (AdgEntity *) entity->priv->parent) - { - entity_class = ADG_ENTITY_GET_CLASS (entity); - - if (entity_class->get_dim_style != NULL) - { - dim_style = entity_class->get_dim_style (entity); - - if (dim_style != NULL) - break; - } - else - { - /* Abort if the first entity does not implement get_dim_style */ - g_return_val_if_fail (is_parent, NULL); - } - - is_parent = TRUE; - } - - return dim_style; -} - -/** - * adg_entity_set_dim_style: - * @entity: an #AdgEntity object - * @dim_style: an #AdgDimStyle style - * - * Sets the dimension style for @entity to @dim_style. - * If @entity does not implement set_dim_style, an error is logged. - */ -void -adg_entity_set_dim_style (AdgEntity *entity, - AdgDimStyle *dim_style) -{ - AdgEntityClass *entity_class; - - g_return_if_fail (ADG_IS_ENTITY (entity)); - - entity_class = ADG_ENTITY_GET_CLASS (entity); - - g_return_if_fail (entity_class->set_dim_style != NULL); - - entity_class->set_dim_style (entity, dim_style); -} - -/** * adg_entity_model_matrix_applied: * @entity: an #AdgEntity * diff --git a/adg/adg-entity.h b/adg/adg-entity.h index a081e559..cc183390 100644 --- a/adg/adg-entity.h +++ b/adg/adg-entity.h @@ -70,18 +70,6 @@ struct _AdgEntityClass cairo_t *cr); /* Virtual Table */ - const AdgLineStyle * (*get_line_style) (AdgEntity *entity); - void (*set_line_style) (AdgEntity *entity, - AdgLineStyle *line_style); - const AdgFontStyle * (*get_font_style) (AdgEntity *entity); - void (*set_font_style) (AdgEntity *entity, - AdgFontStyle *font_style); - const AdgArrowStyle * (*get_arrow_style) (AdgEntity *entity); - void (*set_arrow_style) (AdgEntity *entity, - AdgArrowStyle *arrow_style); - const AdgDimStyle * (*get_dim_style) (AdgEntity *entity); - void (*set_dim_style) (AdgEntity *entity, - AdgDimStyle *dim_style); const AdgMatrix * (*get_model_matrix) (AdgEntity *entity); const AdgMatrix * (*get_paper_matrix) (AdgEntity *entity); }; @@ -110,18 +98,6 @@ AdgStyle * adg_entity_get_style (AdgEntity *entity, void adg_entity_apply (AdgEntity *entity, AdgStyleSlot style_slot, cairo_t *cr); -const AdgLineStyle * adg_entity_get_line_style (AdgEntity *entity); -void adg_entity_set_line_style (AdgEntity *entity, - AdgLineStyle *line_style); -const AdgFontStyle * adg_entity_get_font_style (AdgEntity *entity); -void adg_entity_set_font_style (AdgEntity *entity, - AdgFontStyle *font_style); -const AdgArrowStyle * adg_entity_get_arrow_style (AdgEntity *entity); -void adg_entity_set_arrow_style (AdgEntity *entity, - AdgArrowStyle *arrow_style); -const AdgDimStyle * adg_entity_get_dim_style (AdgEntity *entity); -void adg_entity_set_dim_style (AdgEntity *entity, - AdgDimStyle *dim_style); gboolean adg_entity_model_matrix_applied (AdgEntity *entity); gboolean adg_entity_paper_matrix_applied (AdgEntity *entity); gboolean adg_entity_model_applied (AdgEntity *entity); diff --git a/adg/adg-path-private.h b/adg/adg-path-private.h index 267039fc..cca868a9 100644 --- a/adg/adg-path-private.h +++ b/adg/adg-path-private.h @@ -32,7 +32,6 @@ G_BEGIN_DECLS struct _AdgPathPrivate { - AdgLineStyle *line_style; cairo_path_t cairo_path; GArray *portions; AdgPair cp; diff --git a/adg/adg-path.c b/adg/adg-path.c index 17bf27ee..eab6c49f 100644 --- a/adg/adg-path.c +++ b/adg/adg-path.c @@ -40,12 +40,6 @@ #define ARC_TOLERANCE 0.1 -enum -{ - PROP_0, - PROP_LINE_STYLE -}; - typedef enum _Direction Direction; enum _Direction { @@ -54,19 +48,7 @@ enum _Direction }; -static void get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -static void set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); static void finalize (GObject *object); -static const AdgLineStyle * - get_line_style (AdgEntity *entity); -static void set_line_style (AdgEntity *entity, - AdgLineStyle *line_style); static void render (AdgEntity *entity, cairo_t *cr); static void add_portion (AdgPath *path, @@ -102,27 +84,15 @@ adg_path_class_init (AdgPathClass *klass) { GObjectClass *gobject_class; AdgEntityClass *entity_class; - GParamSpec *param; gobject_class = (GObjectClass *) klass; entity_class = (AdgEntityClass *) klass; g_type_class_add_private (klass, sizeof (AdgPathPrivate)); - gobject_class->get_property = get_property; - gobject_class->set_property = set_property; gobject_class->finalize = finalize; - entity_class->get_line_style = get_line_style; - entity_class->set_line_style = set_line_style; entity_class->render = render; - - param = g_param_spec_boxed ("line-style", - P_("Line Style"), - P_("Line style to use while rendering the path"), - ADG_TYPE_LINE_STYLE, - G_PARAM_READWRITE); - g_object_class_install_property (gobject_class, PROP_LINE_STYLE, param); } static void @@ -131,7 +101,6 @@ adg_path_init (AdgPath *path) AdgPathPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (path, ADG_TYPE_PATH, AdgPathPrivate); - priv->line_style = NULL; priv->cairo_path.status = CAIRO_STATUS_SUCCESS; priv->cairo_path.data = NULL; priv->cairo_path.num_data = 0; @@ -144,45 +113,6 @@ adg_path_init (AdgPath *path) } static void -get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - AdgPathPrivate *priv = ((AdgPath *) object)->priv; - - switch (prop_id) - { - case PROP_LINE_STYLE: - g_value_set_boxed (value, priv->line_style); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - AdgPath *path = (AdgPath *) object; - - switch (prop_id) - { - case PROP_LINE_STYLE: - path->priv->line_style = g_value_get_boxed (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - - -static void finalize (GObject *object) { adg_path_clear ((AdgPath *) object); @@ -190,21 +120,6 @@ finalize (GObject *object) ((GObjectClass *) PARENT_CLASS)->finalize (object); } - -static const AdgLineStyle * -get_line_style (AdgEntity *entity) -{ - return ((AdgPath *) entity)->priv->line_style; -} - -static void -set_line_style (AdgEntity *entity, - AdgLineStyle *line_style) -{ - ((AdgPath *) entity)->priv->line_style = line_style; - g_object_notify (G_OBJECT (entity), "line-style"); -} - static void render (AdgEntity *entity, cairo_t *cr) diff --git a/docs/adg-sections.txt b/docs/adg-sections.txt index 3fc12b2b..367d7b56 100644 --- a/docs/adg-sections.txt +++ b/docs/adg-sections.txt @@ -275,14 +275,6 @@ adg_entity_get_context adg_entity_set_context adg_entity_get_style adg_entity_apply -adg_entity_get_line_style -adg_entity_set_line_style -adg_entity_set_font_style -adg_entity_get_font_style -adg_entity_get_arrow_style -adg_entity_set_arrow_style -adg_entity_get_dim_style -adg_entity_set_dim_style adg_entity_model_applied adg_entity_model_matrix_applied -- 2.11.4.GIT