From 96f7710c25d296983649551ed2e0dc44db9614fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Sat, 8 Jan 2011 06:44:40 +0100 Subject: Introduce LdRectangle, LdPoint and LdPointArray. Remove LdCanvasRect and LdSymbolArea. --- src/ld-symbol.c | 57 +++++---------------------------------------------------- 1 file changed, 5 insertions(+), 52 deletions(-) (limited to 'src/ld-symbol.c') diff --git a/src/ld-symbol.c b/src/ld-symbol.c index 45f11c9..24a7ab9 100644 --- a/src/ld-symbol.c +++ b/src/ld-symbol.c @@ -2,7 +2,7 @@ * ld-symbol.c * * This file is a part of logdiag. - * Copyright Přemysl Janouch 2010. All rights reserved. + * Copyright Přemysl Janouch 2010 - 2011. All rights reserved. * * See the file LICENSE for licensing information. * @@ -12,6 +12,7 @@ #include "config.h" +#include "ld-types.h" #include "ld-symbol.h" #include "ld-symbol-category.h" #include "ld-library.h" @@ -82,7 +83,7 @@ ld_symbol_class_init (LdSymbolClass *klass) */ pspec = g_param_spec_boxed ("area", "Area", "The area of this symbol.", - LD_TYPE_SYMBOL_AREA, G_PARAM_READABLE); + LD_TYPE_RECTANGLE, G_PARAM_READABLE); g_object_class_install_property (object_class, PROP_AREA, pspec); } @@ -108,7 +109,7 @@ ld_symbol_get_property (GObject *object, guint property_id, break; case PROP_AREA: { - LdSymbolArea area; + LdRectangle area; ld_symbol_get_area (self, &area); g_value_set_boxed (value, &area); @@ -171,7 +172,7 @@ ld_symbol_get_human_name (LdSymbol *self) * Get the area of the symbol. */ void -ld_symbol_get_area (LdSymbol *self, LdSymbolArea *area) +ld_symbol_get_area (LdSymbol *self, LdRectangle *area) { LdSymbolClass *klass; @@ -202,51 +203,3 @@ ld_symbol_draw (LdSymbol *self, cairo_t *cr) g_return_if_fail (klass->draw != NULL); klass->draw (self, cr); } - -/** - * ld_symbol_area_copy: - * @self: An #LdSymbolArea structure. - * - * Makes a copy of the structure. - * The result must be freed by ld_symbol_area_free(). - * - * Return value: A copy of @self. - **/ -LdSymbolArea * -ld_symbol_area_copy (const LdSymbolArea *self) -{ - LdSymbolArea *new_area; - - g_return_val_if_fail (self != NULL, NULL); - - new_area = g_slice_new (LdSymbolArea); - *new_area = *self; - return new_area; -} - -/** - * ld_symbol_area_free: - * @self: An #LdSymbolArea structure. - * - * Frees the structure created with ld_symbol_area_copy(). - **/ -void -ld_symbol_area_free (LdSymbolArea *self) -{ - g_return_if_fail (self != NULL); - - g_slice_free (LdSymbolArea, self); -} - -GType -ld_symbol_area_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static - (g_intern_static_string ("LdSymbolArea"), - (GBoxedCopyFunc) ld_symbol_area_copy, - (GBoxedFreeFunc) ld_symbol_area_free); - return our_type; -} -- cgit v1.2.3