Re: How to wrap objects based on GInitiallyUnowned (floating references)?



Anyway, I worked around the build problem and then followed the advice
in that C documentation. I had to hand-code the constructors to do it.
It seems to prevent the crash in the example. Ignore the extra crap in
the .patch caused by comparing two source directories without cvs.

 
-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
diff -up --recursive libcccmm-0.1.0/autom4te.cache/requests libcccmm-0.1.0murrayc/autom4te.cache/requests
--- libcccmm-0.1.0/autom4te.cache/requests	2006-11-14 20:05:23.000000000 +0100
+++ libcccmm-0.1.0murrayc/autom4te.cache/requests	2006-11-14 19:43:03.000000000 +0100
@@ -37,22 +37,22 @@
                       {
                         'AM_ENABLE_STATIC' => 1,
                         'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
-                        'AC_TYPE_OFF_T' => 1,
                         'AC_C_VOLATILE' => 1,
-                        'AC_FUNC_CLOSEDIR_VOID' => 1,
+                        'AC_TYPE_OFF_T' => 1,
                         '_LT_AC_SHELL_INIT' => 1,
+                        'AC_FUNC_CLOSEDIR_VOID' => 1,
                         'AC_REPLACE_FNMATCH' => 1,
                         'AC_DEFUN' => 1,
-                        '_LT_AC_LANG_CXX_CONFIG' => 1,
                         'AC_PROG_LIBTOOL' => 1,
-                        'AC_FUNC_STAT' => 1,
+                        '_LT_AC_LANG_CXX_CONFIG' => 1,
                         'AM_PROG_MKDIR_P' => 1,
+                        'AC_FUNC_STAT' => 1,
                         'AC_FUNC_WAIT3' => 1,
-                        'AC_STRUCT_TM' => 1,
-                        'AC_FUNC_LSTAT' => 1,
                         'AM_AUTOMAKE_VERSION' => 1,
-                        'AC_FUNC_STRTOD' => 1,
+                        'AC_FUNC_LSTAT' => 1,
+                        'AC_STRUCT_TM' => 1,
                         'AC_CHECK_HEADERS' => 1,
+                        'AC_FUNC_STRTOD' => 1,
                         'AM_MISSING_PROG' => 1,
                         'AC_FUNC_STRNLEN' => 1,
                         'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
@@ -67,28 +67,28 @@
                         'AM_SANITY_CHECK' => 1,
                         'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
                         'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
-                        '_LT_AC_CHECK_DLFCN' => 1,
                         'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
+                        '_LT_AC_CHECK_DLFCN' => 1,
                         '_AM_PROG_TAR' => 1,
                         'AC_LIBTOOL_GCJ' => 1,
                         'AC_PROG_GCC_TRADITIONAL' => 1,
                         'AC_LIBSOURCE' => 1,
                         'AC_STRUCT_ST_BLOCKS' => 1,
-                        'AC_LIBTOOL_CONFIG' => 1,
                         '_LT_AC_LANG_F77' => 1,
-                        'AC_CONFIG_AUX_DIR' => 1,
+                        'AC_LIBTOOL_CONFIG' => 1,
                         'AC_PROG_MAKE_SET' => 1,
+                        'AC_CONFIG_AUX_DIR' => 1,
                         'sinclude' => 1,
                         'AM_DISABLE_SHARED' => 1,
-                        'AM_PROG_LIBTOOL' => 1,
                         '_LT_AC_LANG_CXX' => 1,
-                        'AM_PROG_LD' => 1,
+                        'AM_PROG_LIBTOOL' => 1,
                         '_LT_AC_FILE_LTDLL_C' => 1,
+                        'AM_PROG_LD' => 1,
                         'AC_FUNC_STRERROR_R' => 1,
-                        'AC_FUNC_FORK' => 1,
                         'AC_DECL_SYS_SIGLIST' => 1,
-                        'AC_FUNC_VPRINTF' => 1,
+                        'AC_FUNC_FORK' => 1,
                         'AU_DEFUN' => 1,
+                        'AC_FUNC_VPRINTF' => 1,
                         'AC_PROG_NM' => 1,
                         'AC_LIBTOOL_DLOPEN' => 1,
                         'AC_PROG_LD' => 1,
@@ -101,9 +101,9 @@
                         '_AM_SET_OPTION' => 1,
                         'AC_CANONICAL_HOST' => 1,
                         '_LT_LINKER_BOILERPLATE' => 1,
-                        'AC_PROG_RANLIB' => 1,
-                        'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
                         'AC_LIBTOOL_PROG_CC_C_O' => 1,
+                        'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
+                        'AC_PROG_RANLIB' => 1,
                         'AC_FUNC_SETPGRP' => 1,
                         'AC_CONFIG_SUBDIRS' => 1,
                         'AC_FUNC_MMAP' => 1,
@@ -116,45 +116,45 @@
                         'AC_FUNC_UTIME_NULL' => 1,
                         'AC_FUNC_SELECT_ARGTYPES' => 1,
                         '_LT_AC_LANG_GCJ' => 1,
-                        'AC_HEADER_STAT' => 1,
                         'AC_FUNC_STRFTIME' => 1,
+                        'AC_HEADER_STAT' => 1,
                         'AC_C_INLINE' => 1,
                         'AC_LIBTOOL_RC' => 1,
-                        'AC_DISABLE_FAST_INSTALL' => 1,
                         '_LT_AC_PROG_ECHO_BACKSLASH' => 1,
+                        'AC_DISABLE_FAST_INSTALL' => 1,
                         'AC_CONFIG_FILES' => 1,
-                        'include' => 1,
-                        '_LT_AC_TRY_DLOPEN_SELF' => 1,
                         '_LT_AC_SYS_LIBPATH_AIX' => 1,
+                        '_LT_AC_TRY_DLOPEN_SELF' => 1,
+                        'include' => 1,
                         'LT_AC_PROG_SED' => 1,
                         'AM_ENABLE_SHARED' => 1,
                         'AM_GNU_GETTEXT' => 1,
                         '_LT_AC_LANG_GCJ_CONFIG' => 1,
-                        'AC_FUNC_OBSTACK' => 1,
-                        'AC_CHECK_LIB' => 1,
                         'AC_ENABLE_SHARED' => 1,
+                        'AC_CHECK_LIB' => 1,
+                        'AC_FUNC_OBSTACK' => 1,
                         'AC_FUNC_MALLOC' => 1,
                         'AC_FUNC_GETGROUPS' => 1,
                         'AC_FUNC_GETLOADAVG' => 1,
-                        'AC_FUNC_FSEEKO' => 1,
-                        'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
                         'AC_ENABLE_STATIC' => 1,
-                        'AM_PROG_CC_C_O' => 1,
+                        'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
+                        'AC_FUNC_FSEEKO' => 1,
                         '_LT_AC_TAGVAR' => 1,
+                        'AM_PROG_CC_C_O' => 1,
                         'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
-                        'AC_FUNC_MKTIME' => 1,
-                        'AL_PROG_PERL' => 1,
                         'AM_CONDITIONAL' => 1,
+                        'AL_PROG_PERL' => 1,
+                        'AC_FUNC_MKTIME' => 1,
                         'AC_HEADER_SYS_WAIT' => 1,
-                        'AC_PROG_LN_S' => 1,
                         'AC_FUNC_MEMCMP' => 1,
-                        'm4_include' => 1,
+                        'AC_PROG_LN_S' => 1,
                         'AM_PROG_INSTALL_SH' => 1,
-                        'AC_HEADER_DIRENT' => 1,
+                        'm4_include' => 1,
                         'AC_PROG_EGREP' => 1,
-                        'AL_PROG_GNU_MAKE' => 1,
-                        '_AC_AM_CONFIG_HEADER_HOOK' => 1,
+                        'AC_HEADER_DIRENT' => 1,
                         'AC_PATH_MAGIC' => 1,
+                        '_AC_AM_CONFIG_HEADER_HOOK' => 1,
+                        'AL_PROG_GNU_MAKE' => 1,
                         'AM_MAKE_INCLUDE' => 1,
                         '_LT_AC_TAGCONFIG' => 1,
                         'm4_pattern_forbid' => 1,
@@ -162,15 +162,15 @@
                         'AC_LIBTOOL_COMPILER_OPTION' => 1,
                         'AC_DISABLE_SHARED' => 1,
                         '_LT_COMPILER_BOILERPLATE' => 1,
-                        'AC_LIBTOOL_SETUP' => 1,
                         'AC_LIBTOOL_WIN32_DLL' => 1,
+                        'AC_LIBTOOL_SETUP' => 1,
                         'AC_PROG_LD_RELOAD_FLAG' => 1,
                         'AC_HEADER_TIME' => 1,
-                        'AC_TYPE_MODE_T' => 1,
-                        'AC_FUNC_GETMNTENT' => 1,
                         'AM_MISSING_HAS_RUN' => 1,
-                        'm4_sinclude' => 1,
+                        'AC_FUNC_GETMNTENT' => 1,
+                        'AC_TYPE_MODE_T' => 1,
                         'AC_LIBTOOL_DLOPEN_SELF' => 1,
+                        'm4_sinclude' => 1,
                         'AC_PATH_X' => 1,
                         'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
                         '_PKG_SHORT_ERRORS_SUPPORTED' => 1,
@@ -178,38 +178,38 @@
                         'AC_LIBTOOL_LINKER_OPTION' => 1,
                         'PKG_CHECK_EXISTS' => 1,
                         'AL_PROG_GNU_M4' => 1,
-                        'AC_LIBTOOL_CXX' => 1,
                         'LT_AC_PROG_RC' => 1,
+                        'AC_LIBTOOL_CXX' => 1,
                         'LT_AC_PROG_GCJ' => 1,
                         'AC_FUNC_ERROR_AT_LINE' => 1,
-                        'AM_DEP_TRACK' => 1,
-                        'AM_DISABLE_STATIC' => 1,
                         '_LT_AC_PROG_CXXCPP' => 1,
-                        'AC_FUNC_MBRTOWC' => 1,
-                        'AM_CONFIG_HEADER' => 1,
+                        'AM_DISABLE_STATIC' => 1,
+                        'AM_DEP_TRACK' => 1,
                         '_AC_PROG_LIBTOOL' => 1,
+                        'AM_CONFIG_HEADER' => 1,
+                        'AC_FUNC_MBRTOWC' => 1,
                         'AC_TYPE_SIGNAL' => 1,
-                        'AC_TYPE_UID_T' => 1,
                         '_AM_IF_OPTION' => 1,
+                        'AC_TYPE_UID_T' => 1,
                         'AC_PATH_TOOL_PREFIX' => 1,
-                        'AC_LIBTOOL_F77' => 1,
                         'm4_pattern_allow' => 1,
+                        'AC_LIBTOOL_F77' => 1,
                         'AM_SET_LEADING_DOT' => 1,
                         'AC_DEFINE_TRACE_LITERAL' => 1,
                         '_AM_DEPENDENCIES' => 1,
                         'AC_LIBTOOL_LANG_C_CONFIG' => 1,
-                        'AC_PROG_CC' => 1,
                         '_LT_AC_SYS_COMPILER' => 1,
+                        'AC_PROG_CC' => 1,
                         'AM_PROG_NM' => 1,
                         'PKG_CHECK_MODULES' => 1,
                         'AC_FUNC_STRCOLL' => 1,
                         'AC_PROG_YACC' => 1,
                         'AC_LIBLTDL_CONVENIENCE' => 1,
                         'AC_DEPLIBS_CHECK_METHOD' => 1,
-                        'AC_FUNC_CHOWN' => 1,
-                        'jm_MAINTAINER_MODE' => 1,
-                        'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
                         'AC_LIBLTDL_INSTALLABLE' => 1,
+                        'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
+                        'jm_MAINTAINER_MODE' => 1,
+                        'AC_FUNC_CHOWN' => 1,
                         'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
                         'AC_FUNC_GETPGRP' => 1,
                         'AM_INIT_AUTOMAKE' => 1,
@@ -220,29 +220,29 @@
                         '_LT_AC_LOCK' => 1,
                         '_LT_AC_LANG_RC_CONFIG' => 1,
                         'AC_PROG_CPP' => 1,
-                        'AC_TYPE_PID_T' => 1,
-                        'AC_PROG_LEX' => 1,
                         'AC_C_CONST' => 1,
+                        'AC_PROG_LEX' => 1,
+                        'AC_TYPE_PID_T' => 1,
                         'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
                         'AC_FUNC_SETVBUF_REVERSED' => 1,
-                        'AC_PROG_INSTALL' => 1,
                         'AM_AUX_DIR_EXPAND' => 1,
-                        'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
+                        'AC_PROG_INSTALL' => 1,
                         '_LT_AC_LANG_F77_CONFIG' => 1,
+                        'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
                         '_AM_SET_OPTIONS' => 1,
-                        'AM_RUN_LOG' => 1,
                         '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AM_RUN_LOG' => 1,
                         'AC_LIBTOOL_PICMODE' => 1,
                         'AH_OUTPUT' => 1,
                         'AC_CHECK_LIBM' => 1,
                         'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
                         '_AM_MANGLE_OPTION' => 1,
                         'AC_CANONICAL_SYSTEM' => 1,
-                        'AC_CONFIG_HEADERS' => 1,
                         'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1,
+                        'AC_CONFIG_HEADERS' => 1,
                         'AM_SET_DEPDIR' => 1,
-                        '_LT_CC_BASENAME' => 1,
                         'PKG_PROG_PKG_CONFIG' => 1,
+                        '_LT_CC_BASENAME' => 1,
                         'AC_CHECK_FUNCS' => 1
                       }
                     ], 'Autom4te::Request' ),
@@ -262,21 +262,21 @@
                         'm4_pattern_forbid' => 1,
                         'AC_CANONICAL_TARGET' => 1,
                         'AC_CONFIG_LIBOBJ_DIR' => 1,
-                        'AC_C_VOLATILE' => 1,
                         'AC_TYPE_OFF_T' => 1,
+                        'AC_C_VOLATILE' => 1,
                         'AC_FUNC_CLOSEDIR_VOID' => 1,
                         'AC_REPLACE_FNMATCH' => 1,
                         'AC_PROG_LIBTOOL' => 1,
                         'AC_FUNC_STAT' => 1,
-                        'AC_FUNC_WAIT3' => 1,
                         'AC_HEADER_TIME' => 1,
-                        'AM_AUTOMAKE_VERSION' => 1,
-                        'AC_FUNC_LSTAT' => 1,
+                        'AC_FUNC_WAIT3' => 1,
                         'AC_STRUCT_TM' => 1,
-                        'AC_FUNC_GETMNTENT' => 1,
+                        'AC_FUNC_LSTAT' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
                         'AC_TYPE_MODE_T' => 1,
-                        'AC_CHECK_HEADERS' => 1,
+                        'AC_FUNC_GETMNTENT' => 1,
                         'AC_FUNC_STRTOD' => 1,
+                        'AC_CHECK_HEADERS' => 1,
                         'AC_FUNC_STRNLEN' => 1,
                         'm4_sinclude' => 1,
                         'AC_PROG_CXX' => 1,
@@ -291,20 +291,20 @@
                         'AC_LIBSOURCE' => 1,
                         'AC_FUNC_MBRTOWC' => 1,
                         'AC_STRUCT_ST_BLOCKS' => 1,
-                        'AC_CANONICAL_BUILD' => 1,
                         'AC_TYPE_SIGNAL' => 1,
+                        'AC_CANONICAL_BUILD' => 1,
                         'AC_TYPE_UID_T' => 1,
-                        'AC_CONFIG_AUX_DIR' => 1,
                         'AC_PROG_MAKE_SET' => 1,
-                        'm4_pattern_allow' => 1,
+                        'AC_CONFIG_AUX_DIR' => 1,
                         'sinclude' => 1,
+                        'm4_pattern_allow' => 1,
                         'AC_DEFINE_TRACE_LITERAL' => 1,
                         'AC_FUNC_STRERROR_R' => 1,
                         'AC_PROG_CC' => 1,
-                        'AC_DECL_SYS_SIGLIST' => 1,
                         'AC_FUNC_FORK' => 1,
-                        'AC_FUNC_STRCOLL' => 1,
+                        'AC_DECL_SYS_SIGLIST' => 1,
                         'AC_FUNC_VPRINTF' => 1,
+                        'AC_FUNC_STRCOLL' => 1,
                         'AC_PROG_YACC' => 1,
                         'AC_STRUCT_TIMEZONE' => 1,
                         'AC_INIT' => 1,
@@ -327,34 +327,34 @@
                         'AM_MAINTAINER_MODE' => 1,
                         'AC_FUNC_UTIME_NULL' => 1,
                         'AC_FUNC_SELECT_ARGTYPES' => 1,
-                        'AC_FUNC_STRFTIME' => 1,
                         'AC_HEADER_STAT' => 1,
-                        'AC_C_INLINE' => 1,
+                        'AC_FUNC_STRFTIME' => 1,
                         'AC_PROG_CPP' => 1,
-                        'AM_ENABLE_MULTILIB' => 1,
-                        'AC_C_CONST' => 1,
-                        'AC_PROG_LEX' => 1,
+                        'AC_C_INLINE' => 1,
                         'AC_TYPE_PID_T' => 1,
+                        'AC_PROG_LEX' => 1,
+                        'AC_C_CONST' => 1,
+                        'AM_ENABLE_MULTILIB' => 1,
                         'AC_CONFIG_FILES' => 1,
                         'include' => 1,
                         'AC_FUNC_SETVBUF_REVERSED' => 1,
                         'AC_PROG_INSTALL' => 1,
                         'AM_GNU_GETTEXT' => 1,
-                        'AC_FUNC_OBSTACK' => 1,
                         'AC_CHECK_LIB' => 1,
+                        'AC_FUNC_OBSTACK' => 1,
                         'AC_FUNC_MALLOC' => 1,
                         'AC_FUNC_GETGROUPS' => 1,
                         'AC_FUNC_GETLOADAVG' => 1,
                         'AH_OUTPUT' => 1,
                         'AC_FUNC_FSEEKO' => 1,
                         'AM_PROG_CC_C_O' => 1,
-                        'AC_FUNC_MKTIME' => 1,
-                        'AM_CONDITIONAL' => 1,
                         'AC_CANONICAL_SYSTEM' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AC_FUNC_MKTIME' => 1,
                         'AC_CONFIG_HEADERS' => 1,
                         'AC_HEADER_SYS_WAIT' => 1,
-                        'AC_FUNC_MEMCMP' => 1,
                         'AC_PROG_LN_S' => 1,
+                        'AC_FUNC_MEMCMP' => 1,
                         'm4_include' => 1,
                         'AC_HEADER_DIRENT' => 1,
                         'AC_CHECK_FUNCS' => 1
diff -up --recursive libcccmm-0.1.0/libccc/libcccmm/item.cc libcccmm-0.1.0murrayc/libccc/libcccmm/item.cc
--- libcccmm-0.1.0/libccc/libcccmm/item.cc	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/libcccmm/item.cc	2006-11-14 19:59:59.000000000 +0100
@@ -10,6 +10,14 @@
 namespace Cc
 {
 
+Item::Item()
+: Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
+  Glib::Object(Glib::ConstructParams(item_class_.init(), (char*) 0))
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
 } // namespace Cc
 
 namespace
@@ -116,13 +124,6 @@ GType Item::get_base_type()
 }
 
 
-Item::Item()
-:
-  Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
-  Glib::Object(Glib::ConstructParams(item_class_.init()))
-{
-  }
-
 void Item::append(Item& child)
 {
 cc_item_append(gobj(), (child).gobj()); 
diff -up --recursive libcccmm-0.1.0/libccc/libcccmm/rectangle.cc libcccmm-0.1.0murrayc/libccc/libcccmm/rectangle.cc
--- libcccmm-0.1.0/libccc/libcccmm/rectangle.cc	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/libcccmm/rectangle.cc	2006-11-14 20:00:00.000000000 +0100
@@ -10,6 +10,16 @@
 namespace Cc
 {
 
+
+Rectangle::Rectangle()
+: Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
+  Shape(Glib::ConstructParams(rectangle_class_.init(), (char*) 0))
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
+
 } // namespace Cc
 
 namespace
@@ -115,13 +125,6 @@ GType Rectangle::get_base_type()
 }
 
 
-Rectangle::Rectangle()
-:
-  Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
-  Shape(Glib::ConstructParams(rectangle_class_.init()))
-{
-  }
-
 void Rectangle::set_position(double x, double y, double width, double height)
 {
 cc_rectangle_set_position(gobj(), x, y, width, height); 
diff -up --recursive libcccmm-0.1.0/libccc/libcccmm/rectangle.h libcccmm-0.1.0murrayc/libccc/libcccmm/rectangle.h
--- libcccmm-0.1.0/libccc/libcccmm/rectangle.h	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/libcccmm/rectangle.h	2006-11-14 19:58:05.000000000 +0100
@@ -66,7 +66,7 @@ public:
 private:
 
 	public:
-		Rectangle();
+                Rectangle();
 		
 		
   void set_position(double x, double y, double width, double height);
diff -up --recursive libcccmm-0.1.0/libccc/libcccmm/shape.cc libcccmm-0.1.0murrayc/libccc/libcccmm/shape.cc
--- libcccmm-0.1.0/libccc/libcccmm/shape.cc	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/libcccmm/shape.cc	2006-11-14 20:00:00.000000000 +0100
@@ -10,6 +10,15 @@
 namespace Cc
 {
 
+Shape::Shape()
+: Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
+  Item(Glib::ConstructParams(shape_class_.init(), (char*) 0))
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
+
 } // namespace Cc
 
 namespace
@@ -115,14 +124,6 @@ GType Shape::get_base_type()
 }
 
 
-Shape::Shape()
-:
-  Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
-  Item(Glib::ConstructParams(shape_class_.init()))
-{
-  }
-
-
 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
 
diff -up --recursive libcccmm-0.1.0/libccc/libcccmm/view.cc libcccmm-0.1.0murrayc/libccc/libcccmm/view.cc
--- libcccmm-0.1.0/libccc/libcccmm/view.cc	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/libcccmm/view.cc	2006-11-14 20:00:01.000000000 +0100
@@ -10,6 +10,14 @@
 namespace Cc
 {
 
+View::View()
+: Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
+  Glib::Object(Glib::ConstructParams(view_class_.init(), (char*) 0))
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
 } // namespace Cc
 
 namespace
@@ -115,13 +123,6 @@ GType View::get_base_type()
 }
 
 
-View::View()
-:
-  Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
-  Glib::Object(Glib::ConstructParams(view_class_.init()))
-{
-  }
-
 void View::window_to_world(const double* x, const double* y)
 {
 cc_view_window_to_world(gobj(), const_cast<gdouble*>(x), const_cast<gdouble*>(y)); 
diff -up --recursive libcccmm-0.1.0/libccc/libcccmm/view-widget.cc libcccmm-0.1.0murrayc/libccc/libcccmm/view-widget.cc
--- libcccmm-0.1.0/libccc/libcccmm/view-widget.cc	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/libcccmm/view-widget.cc	2006-11-14 20:00:02.000000000 +0100
@@ -10,11 +10,28 @@
 namespace Cc
 {
 
+ViewWidget::ViewWidget()
+: Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
+  Gtk::DrawingArea(Glib::ConstructParams(viewwidget_class_.init(), (char*) 0))
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
+ViewWidget::ViewWidget(Item& root)
+: Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
+  Gtk::DrawingArea(Glib::ConstructParams(viewwidget_class_.init(), "root",root.gobj(), (char*) 0))
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
 } // namespace Cc
 
 namespace
 {
 
+
 static void ViewWidget_signal_set_scroll_adjustments_callback(CcViewWidget* self, GtkAdjustment* p0,GtkAdjustment* p1,void* data)
 {
   using namespace Cc;
@@ -48,6 +65,7 @@ static const Glib::SignalProxyInfo ViewW
   (GCallback) &ViewWidget_signal_set_scroll_adjustments_callback
 };
 
+
 } // anonymous namespace
 
 
@@ -143,7 +161,6 @@ void ViewWidget_Class::set_scroll_adjust
       (*base->set_scroll_adjustments)(self, p0, p1);
   }
 }
-
 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
 
 
@@ -186,21 +203,6 @@ GType ViewWidget::get_base_type()
 }
 
 
-ViewWidget::ViewWidget()
-:
-  Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
-  Gtk::DrawingArea(Glib::ConstructParams(viewwidget_class_.init()))
-{
-  }
-
-ViewWidget::ViewWidget(Item& root)
-:
-  Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
-  Gtk::DrawingArea(Glib::ConstructParams(viewwidget_class_.init(), "root", (root).gobj(), (char*) 0))
-{
-  }
-
-
 Glib::SignalProxy2< void,Gtk::Adjustment*,Gtk::Adjustment* > ViewWidget::signal_set_scroll_adjustments()
 {
   return Glib::SignalProxy2< void,Gtk::Adjustment*,Gtk::Adjustment* >(this, &ViewWidget_signal_set_scroll_adjustments_info);
@@ -232,7 +234,6 @@ void Cc::ViewWidget::on_set_scroll_adjus
   if(base && base->set_scroll_adjustments)
     (*base->set_scroll_adjustments)(gobj(),(GtkAdjustment*)Glib::unwrap(p0),(GtkAdjustment*)Glib::unwrap(p1));
 }
-
 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
 
 #ifdef GLIBMM_VFUNCS_ENABLED
diff -up --recursive libcccmm-0.1.0/libccc/libcccmm/view-widget.h libcccmm-0.1.0murrayc/libccc/libcccmm/view-widget.h
--- libcccmm-0.1.0/libccc/libcccmm/view-widget.h	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/libcccmm/view-widget.h	2006-11-14 19:58:06.000000000 +0100
@@ -85,7 +85,8 @@ private:
 
 	public:
 		ViewWidget();
-		explicit ViewWidget(Item& root);;
+		explicit ViewWidget(Item& root);
+                ;
 
 		#ifdef GLIBMM_PROPERTIES_ENABLED
 /** Display the model centered if there is more space than the model needs.
@@ -108,6 +109,10 @@ private:
 #endif //#GLIBMM_PROPERTIES_ENABLED
 ;
 		
+/**
+   * @par Prototype:
+   * <tt>void %set_scroll_adjustments(Gtk::Adjustment* p0, Gtk::Adjustment* p1)</tt>
+   */
 
   Glib::SignalProxy2< void,Gtk::Adjustment*,Gtk::Adjustment* > signal_set_scroll_adjustments();
 ;
diff -up --recursive libcccmm-0.1.0/libccc/src/item.ccg libcccmm-0.1.0murrayc/libccc/src/item.ccg
--- libcccmm-0.1.0/libccc/src/item.ccg	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/src/item.ccg	2006-11-14 19:59:55.000000000 +0100
@@ -4,4 +4,11 @@
 namespace Cc
 {
 
+Item::Item()
+: _CONSTRUCT()
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
 } // namespace Cc
diff -up --recursive libcccmm-0.1.0/libccc/src/item.hg libcccmm-0.1.0murrayc/libccc/src/item.hg
--- libcccmm-0.1.0/libccc/src/item.hg	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/src/item.hg	2006-11-14 19:55:30.000000000 +0100
@@ -13,7 +13,7 @@ class Item : public Glib::Object,
 	_CLASS_GOBJECT(Item, CcItem, CC_ITEM, Glib::Object, GObject)
 	_IMPLEMENTS_INTERFACE(ItemView)
 	public:
-		_CTOR_DEFAULT
+		Item();
 
 		_WRAP_METHOD(void append(Item& child), cc_item_append)
 
diff -up --recursive libcccmm-0.1.0/libccc/src/rectangle.ccg libcccmm-0.1.0murrayc/libccc/src/rectangle.ccg
--- libcccmm-0.1.0/libccc/src/rectangle.ccg	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/src/rectangle.ccg	2006-11-14 19:59:55.000000000 +0100
@@ -4,4 +4,13 @@
 namespace Cc
 {
 
+
+Rectangle::Rectangle()
+: _CONSTRUCT()
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
+
 } // namespace Cc
diff -up --recursive libcccmm-0.1.0/libccc/src/rectangle.hg libcccmm-0.1.0murrayc/libccc/src/rectangle.hg
--- libcccmm-0.1.0/libccc/src/rectangle.hg	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/src/rectangle.hg	2006-11-14 19:55:14.000000000 +0100
@@ -10,7 +10,7 @@ class Rectangle : public Shape
 {
 	_CLASS_GOBJECT(Rectangle, CcRectangle, CC_RECTANGLE, Shape, CcShape)
 	public:
-		_CTOR_DEFAULT
+                Rectangle();
 		
 		_WRAP_METHOD(void set_position(double x, double y, double width, double height), cc_rectangle_set_position)
 		_WRAP_PROPERTY("position-h", double)
diff -up --recursive libcccmm-0.1.0/libccc/src/shape.ccg libcccmm-0.1.0murrayc/libccc/src/shape.ccg
--- libcccmm-0.1.0/libccc/src/shape.ccg	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/src/shape.ccg	2006-11-14 19:59:55.000000000 +0100
@@ -4,4 +4,12 @@
 namespace Cc
 {
 
+Shape::Shape()
+: _CONSTRUCT()
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
+
 } // namespace Cc
diff -up --recursive libcccmm-0.1.0/libccc/src/shape.hg libcccmm-0.1.0murrayc/libccc/src/shape.hg
--- libcccmm-0.1.0/libccc/src/shape.hg	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/src/shape.hg	2006-11-14 19:54:41.000000000 +0100
@@ -10,7 +10,7 @@ class Shape : public Item
 {
 	_CLASS_GOBJECT(Shape, CcShape, CC_SHAPE, Item, CcItem)
 	public:
-		_CTOR_DEFAULT
+		Shape();
 
 };
 
diff -up --recursive libcccmm-0.1.0/libccc/src/view.ccg libcccmm-0.1.0murrayc/libccc/src/view.ccg
--- libcccmm-0.1.0/libccc/src/view.ccg	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/src/view.ccg	2006-11-14 19:59:55.000000000 +0100
@@ -4,4 +4,11 @@
 namespace Cc
 {
 
+View::View()
+: _CONSTRUCT()
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
 } // namespace Cc
diff -up --recursive libcccmm-0.1.0/libccc/src/view.hg libcccmm-0.1.0murrayc/libccc/src/view.hg
--- libcccmm-0.1.0/libccc/src/view.hg	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/src/view.hg	2006-11-14 19:54:34.000000000 +0100
@@ -10,7 +10,7 @@ class View : public Glib::Object
 {
 	_CLASS_GOBJECT(View, CcView, CC_VIEW, Glib::Object, GObject)
 	public:
-		_CTOR_DEFAULT
+		View();
 
 		_WRAP_METHOD(void window_to_world(const double* x, const double* y), cc_view_window_to_world);
 
diff -up --recursive libcccmm-0.1.0/libccc/src/view-widget.ccg libcccmm-0.1.0murrayc/libccc/src/view-widget.ccg
--- libcccmm-0.1.0/libccc/src/view-widget.ccg	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/src/view-widget.ccg	2006-11-14 19:59:55.000000000 +0100
@@ -4,4 +4,18 @@
 namespace Cc
 {
 
+ViewWidget::ViewWidget()
+: _CONSTRUCT()
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
+ViewWidget::ViewWidget(Item& root)
+: _CONSTRUCT("root", root.gobj())
+{
+  //We don't need the "C convenience" of this "floating reference" in C++:
+  g_object_ref_sink(gobj());
+}
+
 } // namespace Cc
diff -up --recursive libcccmm-0.1.0/libccc/src/view-widget.hg libcccmm-0.1.0murrayc/libccc/src/view-widget.hg
--- libcccmm-0.1.0/libccc/src/view-widget.hg	2006-11-14 17:52:05.000000000 +0100
+++ libcccmm-0.1.0murrayc/libccc/src/view-widget.hg	2006-11-14 19:55:19.000000000 +0100
@@ -13,8 +13,9 @@ class ViewWidget : public Gtk::DrawingAr
 {
 	_CLASS_GTKOBJECT(ViewWidget, CcViewWidget, CC_VIEW_WIDGET, Gtk::DrawingArea, GtkDrawingArea)
 	public:
-		_CTOR_DEFAULT
-		_WRAP_CTOR(ViewWidget(Item& root), cc_view_widget_new_root);
+		ViewWidget();
+		explicit ViewWidget(Item& root);
+                _IGNORE(cc_view_widget_new_root);
 
 		_WRAP_PROPERTY("center-view", bool);
 		_WRAP_SIGNAL(void set_scroll_adjustments(Gtk::Adjustment* p0, Gtk::Adjustment* p1), "set-scroll-adjustments");


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