From 2c3345a4fd0d85a48ca441f908bc3d892786f2f2 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sun, 12 Dec 2010 19:03:36 +0100 Subject: Add change notifications to properties. Also fix the "human-name" property in LdSymbolCategory and correct gtk-doc comments for coordinates properties accessors in LdDocumentObject. --- src/ld-canvas.c | 4 ++++ src/ld-document-object.c | 10 ++++++++-- src/ld-document.c | 2 ++ src/ld-symbol-category.c | 8 +++++++- 4 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ld-canvas.c b/src/ld-canvas.c index dafbc52..dcab249 100644 --- a/src/ld-canvas.c +++ b/src/ld-canvas.c @@ -389,6 +389,8 @@ ld_canvas_set_document (LdCanvas *self, LdDocument *document) self->priv->document = document; g_object_ref (document); + + g_object_notify (G_OBJECT (self), "document"); } /** @@ -419,6 +421,8 @@ ld_canvas_set_library (LdCanvas *self, LdLibrary *library) self->priv->library = library; g_object_ref (library); + + g_object_notify (G_OBJECT (self), "library"); } /** diff --git a/src/ld-document-object.c b/src/ld-document-object.c index e82b3a6..09aa3cc 100644 --- a/src/ld-document-object.c +++ b/src/ld-document-object.c @@ -157,8 +157,9 @@ ld_document_object_get_y (LdDocumentObject *self) } /** - * ld_document_object_get_x: + * ld_document_object_set_x: * @self: An #LdDocumentObject object. + * @x: The new X coordinate. * * Set the X coordinate of the object. */ @@ -167,11 +168,14 @@ ld_document_object_set_x (LdDocumentObject *self, gdouble x) { g_return_if_fail (LD_IS_DOCUMENT_OBJECT (self)); self->priv->x = x; + + g_object_notify (G_OBJECT (self), "x"); } /** - * ld_document_object_get_x: + * ld_document_object_set_y: * @self: An #LdDocumentObject object. + * @y: The new Y coordinate. * * Set the Y coordinate of the object. */ @@ -180,4 +184,6 @@ ld_document_object_set_y (LdDocumentObject *self, gdouble y) { g_return_if_fail (LD_IS_DOCUMENT_OBJECT (self)); self->priv->y = y; + + g_object_notify (G_OBJECT (self), "y"); } diff --git a/src/ld-document.c b/src/ld-document.c index 7b28745..79beebf 100644 --- a/src/ld-document.c +++ b/src/ld-document.c @@ -321,6 +321,8 @@ ld_document_set_modified (LdDocument *self, gboolean value) { g_return_if_fail (LD_IS_DOCUMENT (self)); self->priv->modified = value; + + g_object_notify (G_OBJECT (self), "modified"); } /** diff --git a/src/ld-symbol-category.c b/src/ld-symbol-category.c index 6f0c673..9c74e90 100644 --- a/src/ld-symbol-category.c +++ b/src/ld-symbol-category.c @@ -90,7 +90,7 @@ ld_symbol_category_class_init (LdSymbolCategoryClass *klass) pspec = g_param_spec_string ("human-name", "Human name", "The localized human name of this symbol category.", "", G_PARAM_READWRITE); - g_object_class_install_property (object_class, PROP_NAME, pspec); + g_object_class_install_property (object_class, PROP_HUMAN_NAME, pspec); /** * LdSymbolCategory:image-path: @@ -215,6 +215,8 @@ ld_symbol_category_set_name (LdSymbolCategory *self, const gchar *name) if (self->priv->name) g_free (self->priv->name); self->priv->name = g_strdup (name); + + g_object_notify (G_OBJECT (self), "name"); } /** @@ -245,6 +247,8 @@ ld_symbol_category_set_human_name (LdSymbolCategory *self, if (self->priv->human_name) g_free (self->priv->human_name); self->priv->human_name = g_strdup (human_name); + + g_object_notify (G_OBJECT (self), "human-name"); } /** @@ -274,6 +278,8 @@ ld_symbol_category_set_image_path (LdSymbolCategory *self, if (self->priv->image_path) g_free (self->priv->image_path); self->priv->image_path = g_strdup (image_path); + + g_object_notify (G_OBJECT (self), "image-path"); } /** -- cgit v1.2.3-70-g09d2