After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 111298 - problems with enums...
problems with enums...
Status: RESOLVED FIXED
Product: gnome-vfsmm
Classification: Deprecated
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on: 111291
Blocks:
 
 
Reported: 2003-04-21 20:44 UTC by Bryan Forbes
Modified: 2011-01-16 23:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Is this kind of what needs to be done? This is just one enumeration changed (GnomeVFSFileInfoOptions->FileInfoOptions). (14.86 KB, patch)
2003-04-27 01:39 UTC, Bryan Forbes
none Details | Review
Scratch my last patch, try this one instead :) (13.91 KB, patch)
2003-04-28 00:33 UTC, Bryan Forbes
none Details | Review

Description Bryan Forbes 2003-04-21 20:44:52 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.
Comment 1 Murray Cumming 2003-04-24 11:35:39 UTC
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.
Comment 2 Bryan Forbes 2003-04-24 17:55:24 UTC
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.
Comment 3 Murray Cumming 2003-04-25 06:44:18 UTC
Yes, I've mentioned this several times. We probably need to patch 
gnome-vfs, or use the C enums for now.
Comment 4 Bryan Forbes 2003-04-27 01:39:46 UTC
Created attachment 16035 [details] [review]
Is this kind of what needs to be done?  This is just one enumeration changed (GnomeVFSFileInfoOptions->FileInfoOptions).
Comment 5 Bryan Forbes 2003-04-27 01:42:16 UTC
One note:  This patch is applied after my other patch, 111291.  It
compiles and install fine here, and it works compiling against it.
Comment 6 Bryan Forbes 2003-04-27 02:22:22 UTC
Added dependency on 111291.
Comment 7 Murray Cumming 2003-04-27 15:31:02 UTC
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.
Comment 8 Bryan Forbes 2003-04-27 23:19:40 UTC
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.
Comment 9 Bryan Forbes 2003-04-28 00:33:59 UTC
Created attachment 16068 [details] [review]
Scratch my last patch, try this one instead :)
Comment 10 Bryan Forbes 2003-04-28 00:41:14 UTC
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).
Comment 11 Murray Cumming 2003-04-28 10:51:23 UTC
Well done. You are doing very well without me helping you enough.
Comment 12 Murray Cumming 2003-04-30 18:43:20 UTC
Thanks. Applied.