Re: Example of glib-mkenums?



On Mon, 2003-09-01 at 10:37, Murray Cumming wrote:
> On Tue, 2003-08-26 at 17:29, Owen Taylor wrote:
> > On Tue, 2003-08-26 at 10:59, Murray Cumming Comneon com wrote:
> > > I'm trying to add gtype-registration of enums to gnome-vfs, for which I
> > > think I should use glib-mkenums, but I see different ways of doing this in
> > > gtk+, gconf, and libgnomeui. Does anyone know which would be best to copy?
> > 
> > Pango might be a good place to copy.
> 
> Thanks a lot. That was quite easy.
> ( http://bugzilla.gnome.org/show_bug.cgi?id=121182 )
> 
> I wonder if you know of any existing way to deal with badly capitalized
> enums? GnomeVFSURIHide gives gnome_vfsuri_hide_options_get_type() and
> I'm surprised that it does that well. I guess I could write some by
> hand.

I don't believe there is a way. There is a fairly complex set of rules
that handles all GTK+ names, and anything beyond that isn't handled.

It wouldn't be that hard to add such a capability - we currently
support

typedef enum {
  MY_FOO_BAR = 0x1, /*< nick=foo-bar >*/
  MY_BAH_FOO_BAZ = 0x2, /*< nick=foo-baz >*/
} MyBah /*< flags *>/

To handle cases where autodetection doesn't work for the short
"nicknames" for the enumeration and for whether the enum is a 
flags field or a standard enumeration.

Adding
 
 GnomeVFSURIHide /*< flags, lowercasename=gnome_vfs_uri_hide >*/

Or whatever would be fairly logical. (Possible a better keyword
than lowercasename)

Regards,
						Owen






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