sl@0: /* sl@0: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. sl@0: * sl@0: * This library is free software; you can redistribute it and/or sl@0: * modify it under the terms of the GNU Lesser General Public sl@0: * License as published by the Free Software Foundation; either sl@0: * version 2 of the License, or (at your option) any later version. sl@0: * sl@0: * This library is distributed in the hope that it will be useful, sl@0: * but WITHOUT ANY WARRANTY; without even the implied warranty of sl@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU sl@0: * Lesser General Public License for more details. sl@0: * sl@0: * You should have received a copy of the GNU Lesser General Public sl@0: * License along with this library; if not, write to the sl@0: * Free Software Foundation, Inc., 59 Temple Place - Suite 330, sl@0: * Boston, MA 02111-1307, USA. sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: #include "mambaz.h" sl@0: sl@0: extern GType baz_type; sl@0: sl@0: static void sl@0: maman_ibaz_base_init (gpointer g_class) sl@0: { sl@0: sl@0: } sl@0: sl@0: GType sl@0: maman_ibaz_get_type (void) sl@0: { sl@0: static GType type = 0; sl@0: if (type == 0) { sl@0: static const GTypeInfo info = { sl@0: sizeof (MamanIbazInterface), sl@0: maman_ibaz_base_init, /* base_init */ sl@0: NULL, /* base_finalize */ sl@0: NULL, /* class_init */ sl@0: NULL, /* class_finalize */ sl@0: NULL, /* class_data */ sl@0: 0, sl@0: 0, /* n_preallocs */ sl@0: NULL /* instance_init */ sl@0: }; sl@0: type = g_type_register_static (G_TYPE_INTERFACE, "MamanIbaz", &info, 0); sl@0: } sl@0: return type; sl@0: } sl@0: sl@0: void maman_ibaz_do_action (MamanIbaz *self) sl@0: { sl@0: sl@0: MAMAN_IBAZ_GET_INTERFACE (self)->do_action (self); sl@0: } sl@0: sl@0: //that was the interface class sl@0: sl@0: static void baz_do_action (MamanBaz *self) sl@0: { sl@0: self->instance_member = 10; sl@0: } sl@0: sl@0: void sl@0: baz_interface_init (gpointer g_iface, sl@0: gpointer iface_data) sl@0: { sl@0: MamanIbazInterface *iface = (MamanIbazInterface *)g_iface; sl@0: iface->do_action = (void (*) (MamanIbaz *self))baz_do_action; sl@0: } sl@0: sl@0: void sl@0: baz_instance_init (GTypeInstance *instance, sl@0: gpointer g_class) sl@0: { sl@0: MamanBaz *self = MAMAN_BAZ(instance); sl@0: self->instance_member = 0xdeadbeaf; sl@0: } sl@0: sl@0: sl@0: