GNOME Bugzilla – Bug 111298
problems with enums...
Last modified: 2011-01-16 23:36:10 UTC
Ok, this is just one problem, but I've got it down to this: at line 31 of libgnomevfs/src/file-info.h, you have _WRAP_ENUM(FileInfoOptions, GnomeVFSFileInfoOptions) which gtkmmproc changes to gnome_vf_sfile_info_options_get_type() because of line 122 in base.m4. The comment says this: dnl _GET_TYPE_FUNC(GtkWidget) -> gtk_widget_get_type() dnl The funny `[A-Z]?' part of the regexp is to catch things like GdkGCFooBar. We have GnomeVFSFileInfoOptions and it breaks it up at two capital letters which would be Gnome VF SFile Info Options. It needs something special done for gnome-vfsmm to catch the VFS thing.
I guess we can have a _WRAP_ENUM_WITH_HINT() and _GET_TYPE_FUNC_WITH_HINT that takes the class name as an extra arg.
I found another problem which may have been addressed already, but I'll put it here for documentation's sake :) If I go in and uncomment the _WRAP_ENUM at the top of libgnomevfs/src/file-info.hg, run make to generate the files, change the vf_s to vfs_ at line 44 of the newly generated libgnomevfs/libgnomevfsmm/file-info.cc, it won't compile because there is no gnome_vfs_file_info_options_get_type(). This may have to do with something said about these enums aren't gtypes. I'm not sure.
Yes, I've mentioned this several times. We probably need to patch gnome-vfs, or use the C enums for now.
Created attachment 16035 [details] [review] Is this kind of what needs to be done? This is just one enumeration changed (GnomeVFSFileInfoOptions->FileInfoOptions).
One note: This patch is applied after my other patch, 111291. It compiles and install fine here, and it works compiling against it.
Added dependency on 111291.
Yes, I guess that's what gtkmmproc would generate. But it would be nice to fix gnome-vfs instead. If we can not do that then we would probably do this instead.
After some digging, I found out how to do it. I rummaged thru the m4 macros, the perl scripts, and found that if you append NO_GTYPE to the _WRAP_ENUM() parameter list, it doesn't output the Value<> stuff. Here's an example: _WRAP_ENUM(FileInfoOptions, GnomeVFSFileInfoOptions, NO_GTYPE) and it works! The only problem is, it changes enumeration values from GNOME_VFS_* to VFS_* and when put into code, it changes to Gnome::Vfs::VFS_*. Kind of redundant if you ask me. Now that we got the gtype thing figured out, I think we need to focus on getting rid of the VFS_ prefix.
Created attachment 16068 [details] [review] Scratch my last patch, try this one instead :)
This new patch uses my newfound knowledge of NO_GTYPE. Remember to apply <a href="http://bugzilla.gnome.org/show_bug.cgi?id=111291">the patch here</a> first so gnome-vfsmm will compile correctly, pkg-config will work, and the header files will install in the correct place. I hacked the libgnomevfs_enums.def file so the VFS_ prefix is gone from the enum values (I couldn't think of any other way to do that off the top of my head).
Well done. You are doing very well without me helping you enough.
Thanks. Applied.