1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/glib/tsrc/BC/tests/gobject/mambaz.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,82 @@
1.4 +/*
1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.6 +*
1.7 +* This library is free software; you can redistribute it and/or
1.8 +* modify it under the terms of the GNU Lesser General Public
1.9 +* License as published by the Free Software Foundation; either
1.10 +* version 2 of the License, or (at your option) any later version.
1.11 +*
1.12 +* This library is distributed in the hope that it will be useful,
1.13 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
1.14 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.15 +* Lesser General Public License for more details.
1.16 +*
1.17 +* You should have received a copy of the GNU Lesser General Public
1.18 +* License along with this library; if not, write to the
1.19 +* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1.20 +* Boston, MA 02111-1307, USA.
1.21 +*
1.22 +* Description:
1.23 +*
1.24 +*/
1.25 +
1.26 +
1.27 +#ifndef __DERIVED_H__
1.28 +#define __DERIVED_H__
1.29 +
1.30 +#include <glib-object.h>
1.31 +
1.32 +#define MAMAN_TYPE_IBAZ (maman_ibaz_get_type ())
1.33 +#define MAMAN_IBAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_TYPE_IBAZ, MamanIbaz))
1.34 +#define MAMAN_IS_IBAZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_TYPE_IBAZ))
1.35 +#define MAMAN_IBAZ_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), MAMAN_TYPE_IBAZ, MamanIbazInterface))
1.36 +
1.37 +
1.38 +typedef struct _MamanIbaz MamanIbaz; /* dummy object */
1.39 +typedef struct _MamanIbazInterface MamanIbazInterface;
1.40 +
1.41 +struct _MamanIbazInterface {
1.42 + GTypeInterface parent;
1.43 +
1.44 + void (*do_action) (MamanIbaz *self);
1.45 +};
1.46 +
1.47 +GType maman_ibaz_get_type (void);
1.48 +
1.49 +void maman_ibaz_do_action (MamanIbaz *self);
1.50 +
1.51 +//that was the interface class
1.52 +//now the derived class
1.53 +
1.54 +#include <glib-object.h>
1.55 +
1.56 +#define MAMAN_TYPE_BAZ (baz_type)
1.57 +#define MAMAN_BAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_TYPE_BAZ, MamanBaz))
1.58 +#define MAMAN_BAZ_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), MAMAN_TYPE_BAZ, MamanbazClass))
1.59 +#define MAMAN_IS_BAZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_TYPE_BAZ))
1.60 +#define MAMAN_IS_BAZ_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), MAMAN_TYPE_BAZ))
1.61 +#define MAMAN_BAZ_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), MAMAN_TYPE_BAZ, MamanbazClass))
1.62 +
1.63 +
1.64 +typedef struct _MamanBaz MamanBaz;
1.65 +typedef struct _MamanBazClass MamanBazClass;
1.66 +
1.67 +struct _MamanBaz {
1.68 + GObject parent;
1.69 + int instance_member;
1.70 +};
1.71 +
1.72 +struct _MamanBazClass {
1.73 + GObjectClass parent;
1.74 +};
1.75 +
1.76 +GType maman_baz_get_type (void);
1.77 +
1.78 +void baz_do_action (MamanBaz *self);
1.79 +void baz_instance_init (GTypeInstance *instance, gpointer g_class);
1.80 +void baz_interface_init (gpointer g_iface,gpointer iface_data);
1.81 +
1.82 +
1.83 +
1.84 +
1.85 +#endif // __DERIVED_H__
1.86 \ No newline at end of file