[gimp/cage: 98/130] app: add a "text" property to GimpTextLayer and emit notifications for it
- From: Michael Muré <mmure src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/cage: 98/130] app: add a "text" property to GimpTextLayer and emit notifications for it
- Date: Thu, 30 Dec 2010 17:56:13 +0000 (UTC)
commit d709970a85e252d2d889af3ddc2153a00da2a8b7
Author: Michael Natterer <mitch gimp org>
Date: Sun Nov 28 15:27:35 2010 +0100
app: add a "text" property to GimpTextLayer and emit notifications for it
app/text/gimptextlayer.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/app/text/gimptextlayer.c b/app/text/gimptextlayer.c
index f5072ce..8a09507 100644
--- a/app/text/gimptextlayer.c
+++ b/app/text/gimptextlayer.c
@@ -59,6 +59,7 @@
enum
{
PROP_0,
+ PROP_TEXT,
PROP_AUTO_RENAME,
PROP_MODIFIED
};
@@ -150,6 +151,11 @@ gimp_text_layer_class_init (GimpTextLayerClass *klass)
drawable_class->set_tiles = gimp_text_layer_set_tiles;
drawable_class->push_undo = gimp_text_layer_push_undo;
+ GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_TEXT,
+ "text", NULL,
+ GIMP_TYPE_TEXT,
+ GIMP_PARAM_STATIC_STRINGS);
+
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_AUTO_RENAME,
"auto-rename", NULL,
TRUE,
@@ -192,6 +198,9 @@ gimp_text_layer_get_property (GObject *object,
switch (property_id)
{
+ case PROP_TEXT:
+ g_value_set_object (value, text_layer->text);
+ break;
case PROP_AUTO_RENAME:
g_value_set_boolean (value, text_layer->auto_rename);
break;
@@ -215,6 +224,9 @@ gimp_text_layer_set_property (GObject *object,
switch (property_id)
{
+ case PROP_TEXT:
+ gimp_text_layer_set_text (text_layer, g_value_get_object (value));
+ break;
case PROP_AUTO_RENAME:
text_layer->auto_rename = g_value_get_boolean (value);
break;
@@ -425,6 +437,7 @@ gimp_text_layer_set_text (GimpTextLayer *layer,
layer, G_CONNECT_SWAPPED);
}
+ g_object_notify (G_OBJECT (layer), "text");
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (layer));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]