> // Custom vfunc callbacks, because the C++ vfuncs have different
> parameters
> and return types
> // that can not be generated automatically:
>
> Cuase I'm getting vfuncs generated, they're just braindead, but so are
> some
> other functions too.
I can maybe help if you give details.
I think I fixed them. My convert_libgoocanvasmm.m4 stuff was screwed up.
I'm a little confused about how I should wrap this though:
http://gooey.ecn.uiowa.edu/goocanvas/GooCanvasItem.html#GooCanvasItemIface(Hopefully this webserver works, I can't find the goocanvas docs online anywhere)
Anyway, the method create_view. Its giving me problems. Any ideas would be appreciated.
Wrapped as:
_WRAP_VFUNC(Glib::RefPtr<ItemView> create_view( Glib::RefPtr<View> canvas_view, Glib::RefPtr<ItemView> parent_view ), create_view)
This guy is getting an error:
GooCanvasItemView* Item_Class::create_view_vfunc_callback(GooCanvasItem* self, GooCanvasView* canvas_view, GooCanvasItemView* parent_view)
{
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
// Non-gtkmmproc-generated custom classes implicitly call the default
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
// generated classes can use this optimisation, which avoids the unnecessary
// parameter conversions if there is no possibility of the virtual function
// being overridden:
if(obj && obj->is_derived_())
{
#ifdef GLIBMM_EXCEPTIONS_ENABLED
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
#endif //GLIBMM_EXCEPTIONS_ENABLED
// Call the virtual member method, which derived classes might override.
return (obj->create_view_vfunc(Glib::wrap(canvas_view)
, Glib::wrap(parent_view)
))->gobj();
#ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
#endif //GLIBMM_EXCEPTIONS_ENABLED
}
else
{
BaseClassType *const base = static_cast<BaseClassType*>(
g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
) );
// Call the original underlying C function:
if(base && base->create_view)
return (*base->create_view)(self, canvas_view, parent_view);
}
typedef GooCanvasItemView* RType;
return RType();
}
The error is:
item.cc: In static member function 'static GooCanvasItemView* GooCanvas::Item_Class::create_view_vfunc_callback(GooCanvasItem*, GooCanvasView*, GooCanvasItemView*)':
item.cc:221: error: no matching function for call to 'GooCanvas::Item::create_view_vfunc(GooCanvas::View*, Glib::RefPtr<GooCanvas::ItemView>)'
../../libgoocanvas/libgoocanvasmm/item.h:246: note: candidates are: virtual Glib::RefPtr<GooCanvas::ItemView> GooCanvas::Item::create_view_vfunc(Glib::RefPtr<GooCanvas::View>, Glib::RefPtr<GooCanvas::ItemView>)
But, AFAIK, Glib::wrap(canvas_view) should return the Glib::RefPtr<View>
Unless my convert is messed up again. But I can't find it if it is.
_CONVERSION(`GooCanvasView*',`Glib::RefPtr<View>',`Glib::wrap($3)')
_CONVERSION(`Glib::RefPtr<View>',`GooCanvasView*',($3)->gobj())
Any help is much much appreciated.
Paul