Gobject construction for bindings.
- From: Germán Diago <germandiago gmail com>
- To: gtk-list gnome org
- Subject: Gobject construction for bindings.
- Date: Thu, 5 Nov 2009 01:20:08 +0100
Hello. I'm trying to implement a registration system for gobjects from c++.
I know the existence of gtkmm, but it's not enough for my purposes.
So I want to know the following. I have the GTypeInfo structure, which
I have to fill so that I can use my Gobjects from c++ and have them registered
in the type system. The problem is, that I don't know how to register a C++
constructor. I know I have to do it in the GInstanceInitFunc of the
GTypeInfo, but
I cannot understand the signature very well:
void (*GInstanceInitFunc) (GTypeInstance
*instance,
gpointer g_class);
So if I have a Car class:
class Car : public glib::object {
Car(int val);
};
I want to call my c++ constructor when g_type_new() is invoked, so I try:
extern "C" {
void carInit (GTypeInstance *instance,
gpointer g_class)
{
//What should I do here to be able to call my c++ constructor???????????????
}
}
I don't know how to access my instance to call the c++ constructor,
because I don't
understand very well the parameters.
Can anyone help? Thanks in advance.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]