[gimp] Turn "display" into a construct-only property and pass it accordingly
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Turn "display" into a construct-only property and pass it accordingly
- Date: Tue, 29 Sep 2009 18:38:50 +0000 (UTC)
commit 7b62cb3b008725d99b8b54be6ee30a649a67634b
Author: Michael Natterer <mitch gimp org>
Date: Fri Sep 25 12:19:35 2009 +0200
Turn "display" into a construct-only property and pass it accordingly
app/display/gimpdisplayshell.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 61164f8..c197881 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -83,6 +83,7 @@
enum
{
PROP_0,
+ PROP_DISPLAY,
PROP_UNIT,
PROP_TITLE,
PROP_STATUS,
@@ -210,6 +211,12 @@ gimp_display_shell_class_init (GimpDisplayShellClass *klass)
klass->scrolled = NULL;
klass->reconnect = NULL;
+ g_object_class_install_property (object_class, PROP_DISPLAY,
+ g_param_spec_object ("display", NULL, NULL,
+ GIMP_TYPE_DISPLAY,
+ GIMP_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
g_object_class_install_property (object_class, PROP_UNIT,
gimp_param_spec_unit ("unit", NULL, NULL,
TRUE, FALSE,
@@ -437,6 +444,9 @@ gimp_display_shell_set_property (GObject *object,
switch (property_id)
{
+ case PROP_DISPLAY:
+ shell->display = g_value_get_object (value);
+ break;
case PROP_UNIT:
gimp_display_shell_set_unit (shell, g_value_get_int (value));
break;
@@ -470,6 +480,9 @@ gimp_display_shell_get_property (GObject *object,
switch (property_id)
{
+ case PROP_DISPLAY:
+ g_value_set_object (value, shell->display);
+ break;
case PROP_UNIT:
g_value_set_int (value, shell->unit);
break;
@@ -835,6 +848,7 @@ gimp_display_shell_new (GimpDisplay *display,
shell = g_object_new (GIMP_TYPE_DISPLAY_SHELL,
"menu-factory", menu_factory,
"display-factory", display_factory,
+ "display", display,
"unit", unit,
/* The window position will be overridden by the
* dialog factory, it is only really used on first
@@ -844,8 +858,6 @@ gimp_display_shell_new (GimpDisplay *display,
GTK_WIN_POS_CENTER,
NULL);
- shell->display = display;
-
shell->popup_manager = popup_manager;
if (display->image)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]