[gimp] Implement GObject::constructor()



commit b11c3355cbf61eeb18de40e88eb875c738ba636a
Author: Michael Natterer <mitch gimp org>
Date:   Fri Sep 25 12:31:59 2009 +0200

    Implement GObject::constructor()
    
    For now, simply assert that all required construct properties are set.

 app/display/gimpdisplayshell.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index d29da66..8d1231b 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -104,6 +104,9 @@ enum
 
 static void      gimp_color_managed_iface_init     (GimpColorManagedInterface *iface);
 
+static GObject * gimp_display_shell_constructor    (GType             type,
+                                                    guint             n_params,
+                                                    GObjectConstructParam *params);
 static void      gimp_display_shell_finalize       (GObject          *object);
 static void      gimp_display_shell_set_property   (GObject          *object,
                                                     guint             property_id,
@@ -195,6 +198,7 @@ gimp_display_shell_class_init (GimpDisplayShellClass *klass)
                   gimp_marshal_VOID__VOID,
                   G_TYPE_NONE, 0);
 
+  object_class->constructor        = gimp_display_shell_constructor;
   object_class->finalize           = gimp_display_shell_finalize;
   object_class->set_property       = gimp_display_shell_set_property;
   object_class->get_property       = gimp_display_shell_get_property;
@@ -414,6 +418,24 @@ gimp_color_managed_iface_init (GimpColorManagedInterface *iface)
   iface->get_icc_profile = gimp_display_shell_get_icc_profile;
 }
 
+static GObject *
+gimp_display_shell_constructor (GType                  type,
+                                guint                  n_params,
+                                GObjectConstructParam *params)
+{
+  GObject          *object;
+  GimpDisplayShell *shell;
+
+  object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
+
+  shell = GIMP_DISPLAY_SHELL (object);
+
+  g_assert (GIMP_IS_UI_MANAGER (shell->popup_manager));
+  g_assert (GIMP_IS_DISPLAY (shell->display));
+
+  return object;
+}
+
 static void
 gimp_display_shell_finalize (GObject *object)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]