[Glade-devel] using glade.h from C++ (for gtkmm binding)



On Sat, 2006-12-09 at 22:15 +0100, Oliver Nittka wrote:
hi gladies :-)

i'm now (slowly) starting a gtkmm-binding for glade and the first thing
would probably be to create "glade-gtkmm.cc" with just glade_binding_init().

Please note the extension ".cc": we need to call e.g.
Gtk::Main::init_gtkmm_internals() from the init function.
So we'll just have to add AC_PROG_CXX to configure.in (or so i thought ;-).

However, the following happens when #including glade.h:

glade.h:35: error: use of enum '_GladeItemAppearance' without previous
declaration

Maybe I'm looking at a different version of glade3, but my src/glade.h
from cvs has this on line 35:
#include "glade-property.h" 

However, I do see this above it:

typedef enum   _GladeItemAppearance GladeItemAppearance;

That is very odd, and I doubt it's really necessary.

glade-property-class.h:58: error: declaration does not declare anything
glade-property-class.h:179: error: expected ',' or '...' before 'class'
glade-widget-adaptor.h:247: error: expected ',' or '...' before 'new'
[ ... more errors of the same kind ...]

I'm not sure i understand the first one, the others have to do with e.g.
 function arguments or variables called "class", "virtual" or "new".

my question:

should i send a parch to make the current glade code c++ - compatible
(with respect to the above errors) or is c++ definitely a no-no in glade?

I doubt that you'll have to introduce any C++isms to do that, though
maybe (just guessing) the GladeItemAppearance appearance enum will need
to go in a separate header, to avoid including whatever else they are
trying to avoid including by doing that predeclaration.

-- 
Murray Cumming
murrayc at murrayc.com
www.murrayc.com
www.openismus.com





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