Re: Feature request: GType name without "gtkmm__CustomObject_"



Am Samstag, den 06.01.2007, 17:42 +0100 schrieb Oliver Nittka:
> Hi
> 
> I'm still working on glade integration for gtkmm custom widgets (at a
> very low pace :-/)
> 
> One issue that was raised on the glade-devel mailing list was the type
> name of gtkmm derived widgets: When deriving from a Gtk::Widget -
> derived type and calling Glib::ObjectBase(const char *custom_type_name)
> in its constructor, a new GType gets registered with its name set to
> "gtkmm__CustomObject_" + custom_type_name. (see class.cc (from glibmm)
> line 58ff.)
> 
> I suppose this was introduced to avoid name clashes. Now, it was
> suggested to find a possibility to avoid this name expansion, because it
> makes the respective glade catalog less easy to read (the wigdet's
> identifier in the catalog has to be the same as the GType's name).
> 
> So the question is: would it be likely for a patch introducing this
> behaviour to be accepted? How should this be accomplished? I could
> imagine an additional flag for Glib::ObjectBase or Glib::Class, or doing
> the name expansion directly in Glib::ObjectBase(const char *) and adding
> another c'tor that doesn't expand the name.

Hmm, I had a look at the code and it seems that it would be just fine to
remove the prefix altogether -- unconditionally.  The type name string
is either retrieved implicitely from the C++ runtime type_info, or
specified explicitely by the user.  The type_info name will be mangled
anyway so that clashes are quite unlikely.  If you specify the type name
yourself, you should also take care of proper namespacing.

> If this would be accepted, i'd be glad to submit a patch.

Gladly accepted, unless Murray objects to this change.

--Daniel





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