this patch exports a couple of internal helpers that Glib::Type::register uses when creating new subclasses. these are necessary if you want to create subclasses in a slightly different way, e.g., for the cell renderer stuff. this is a diff against clean Glib-1.00. -- muppet -=-=-=- diff -ru Glib-1.00-clean/gperl.h Glib-1.00/gperl.h --- Glib-1.00-clean/gperl.h 2003-10-02 03:12:08.000000000 -0400 +++ Glib-1.00/gperl.h 2003-10-15 20:43:30.000000000 -0400 @@ -118,6 +118,12 @@ SV * newSVGChar (const gchar * str); +/* stuff to use if and only if you really know what you are doing. + * these do some of the real work behing Glib::Type->register; see + * its docs for the formats of the signals hash and properties array. */ +void gperl_type_add_signals (GType type, HV * signals); +void gperl_type_add_properties (GType type, AV * properties); + /* * GValues diff -ru Glib-1.00-clean/GType.xs Glib-1.00/GType.xs --- Glib-1.00-clean/GType.xs 2003-10-09 22:43:41.000000000 -0400 +++ Glib-1.00/GType.xs 2003-10-15 20:43:23.000000000 -0400 @@ -905,8 +905,16 @@ } -static void -add_signals (GType instance_type, HV * signals) +=item void gperl_type_add_signals (GType type, HV * signals) + +Helper that does the real work of adding signals to a new type in +Glib::Type->register(). Use this if and only if you know what you +are doing, which will be customizing the way in which a new GType +is registered with both Glib and the bindings. + +=cut +void +gperl_type_add_signals (GType instance_type, HV * signals) { GObjectClass *oclass; HE * he; @@ -990,8 +998,16 @@ g_type_class_unref (oclass); } -static void -add_properties (GType instance_type, AV * properties) +=item void gperl_type_add_properties (GType type, AV * properties) + +Helper that does the real work of adding new properties to a new type in +Glib::Type->register(). Use this if and only if you know what you +are doing, which will be customizing the way in which a new GType +is registered with both Glib and the bindings. + +=cut +void +gperl_type_add_properties (GType instance_type, AV * properties) { GObjectClass *oclass; int propid; @@ -1261,13 +1277,13 @@ char * key = SvPV_nolen (ST (i)); if (strEQ (key, "signals")) { if (SvROK (ST (i+1)) && SvTYPE (SvRV (ST (i+1))) == SVt_PVHV) - add_signals (new_type, (HV*)SvRV (ST (i+1))); + gperl_type_add_signals (new_type, (HV*)SvRV (ST (i+1))); else croak ("signals must be a hash of signalname => signalspec pairs"); } if (strEQ (key, "properties")) { if (SvROK (ST (i+1)) && SvTYPE (SvRV (ST (i+1))) == SVt_PVAV) - add_properties (new_type, (AV*)SvRV (ST (i+1))); + gperl_type_add_properties (new_type, (AV*)SvRV (ST (i+1))); else croak ("properties must be an array of GParamSpecs"); }