Add change notifications to properties.

Also fix the "human-name" property in LdSymbolCategory
and correct gtk-doc comments for coordinates properties
accessors in LdDocumentObject.
This commit is contained in:
Přemysl Eric Janouch 2010-12-12 19:03:36 +01:00
parent 45aeda982b
commit 2c3345a4fd
4 changed files with 21 additions and 3 deletions

View File

@ -389,6 +389,8 @@ ld_canvas_set_document (LdCanvas *self, LdDocument *document)
self->priv->document = document; self->priv->document = document;
g_object_ref (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; self->priv->library = library;
g_object_ref (library); g_object_ref (library);
g_object_notify (G_OBJECT (self), "library");
} }
/** /**

View File

@ -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. * @self: An #LdDocumentObject object.
* @x: The new X coordinate.
* *
* Set the X coordinate of the object. * 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)); g_return_if_fail (LD_IS_DOCUMENT_OBJECT (self));
self->priv->x = x; 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. * @self: An #LdDocumentObject object.
* @y: The new Y coordinate.
* *
* Set the Y coordinate of the object. * 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)); g_return_if_fail (LD_IS_DOCUMENT_OBJECT (self));
self->priv->y = y; self->priv->y = y;
g_object_notify (G_OBJECT (self), "y");
} }

View File

@ -321,6 +321,8 @@ ld_document_set_modified (LdDocument *self, gboolean value)
{ {
g_return_if_fail (LD_IS_DOCUMENT (self)); g_return_if_fail (LD_IS_DOCUMENT (self));
self->priv->modified = value; self->priv->modified = value;
g_object_notify (G_OBJECT (self), "modified");
} }
/** /**

View File

@ -90,7 +90,7 @@ ld_symbol_category_class_init (LdSymbolCategoryClass *klass)
pspec = g_param_spec_string ("human-name", "Human name", pspec = g_param_spec_string ("human-name", "Human name",
"The localized human name of this symbol category.", "The localized human name of this symbol category.",
"", G_PARAM_READWRITE); "", 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: * LdSymbolCategory:image-path:
@ -215,6 +215,8 @@ ld_symbol_category_set_name (LdSymbolCategory *self, const gchar *name)
if (self->priv->name) if (self->priv->name)
g_free (self->priv->name); g_free (self->priv->name);
self->priv->name = g_strdup (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) if (self->priv->human_name)
g_free (self->priv->human_name); g_free (self->priv->human_name);
self->priv->human_name = g_strdup (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) if (self->priv->image_path)
g_free (self->priv->image_path); g_free (self->priv->image_path);
self->priv->image_path = g_strdup (image_path); self->priv->image_path = g_strdup (image_path);
g_object_notify (G_OBJECT (self), "image-path");
} }
/** /**