sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
|
sl@0
|
3 |
*
|
sl@0
|
4 |
* This library is free software; you can redistribute it and/or
|
sl@0
|
5 |
* modify it under the terms of the GNU Lesser General Public
|
sl@0
|
6 |
* License as published by the Free Software Foundation; either
|
sl@0
|
7 |
* version 2 of the License, or (at your option) any later version.
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* This library is distributed in the hope that it will be useful,
|
sl@0
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
sl@0
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
sl@0
|
12 |
* Lesser General Public License for more details.
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* You should have received a copy of the GNU Lesser General Public
|
sl@0
|
15 |
* License along with this library; if not, write to the
|
sl@0
|
16 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
sl@0
|
17 |
* Boston, MA 02111-1307, USA.
|
sl@0
|
18 |
*
|
sl@0
|
19 |
* Description:
|
sl@0
|
20 |
*
|
sl@0
|
21 |
*/
|
sl@0
|
22 |
|
sl@0
|
23 |
|
sl@0
|
24 |
#ifndef __DERIVED_H__
|
sl@0
|
25 |
#define __DERIVED_H__
|
sl@0
|
26 |
|
sl@0
|
27 |
#include <glib-object.h>
|
sl@0
|
28 |
|
sl@0
|
29 |
#define MAMAN_TYPE_IBAZ (maman_ibaz_get_type ())
|
sl@0
|
30 |
#define MAMAN_IBAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_TYPE_IBAZ, MamanIbaz))
|
sl@0
|
31 |
#define MAMAN_IS_IBAZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_TYPE_IBAZ))
|
sl@0
|
32 |
#define MAMAN_IBAZ_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), MAMAN_TYPE_IBAZ, MamanIbazInterface))
|
sl@0
|
33 |
|
sl@0
|
34 |
|
sl@0
|
35 |
typedef struct _MamanIbaz MamanIbaz; /* dummy object */
|
sl@0
|
36 |
typedef struct _MamanIbazInterface MamanIbazInterface;
|
sl@0
|
37 |
|
sl@0
|
38 |
struct _MamanIbazInterface {
|
sl@0
|
39 |
GTypeInterface parent;
|
sl@0
|
40 |
|
sl@0
|
41 |
void (*do_action) (MamanIbaz *self);
|
sl@0
|
42 |
};
|
sl@0
|
43 |
|
sl@0
|
44 |
GType maman_ibaz_get_type (void);
|
sl@0
|
45 |
|
sl@0
|
46 |
void maman_ibaz_do_action (MamanIbaz *self);
|
sl@0
|
47 |
|
sl@0
|
48 |
//that was the interface class
|
sl@0
|
49 |
//now the derived class
|
sl@0
|
50 |
|
sl@0
|
51 |
#include <glib-object.h>
|
sl@0
|
52 |
|
sl@0
|
53 |
#define MAMAN_TYPE_BAZ (baz_type)
|
sl@0
|
54 |
#define MAMAN_BAZ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAMAN_TYPE_BAZ, MamanBaz))
|
sl@0
|
55 |
#define MAMAN_BAZ_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), MAMAN_TYPE_BAZ, MamanbazClass))
|
sl@0
|
56 |
#define MAMAN_IS_BAZ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAMAN_TYPE_BAZ))
|
sl@0
|
57 |
#define MAMAN_IS_BAZ_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), MAMAN_TYPE_BAZ))
|
sl@0
|
58 |
#define MAMAN_BAZ_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), MAMAN_TYPE_BAZ, MamanbazClass))
|
sl@0
|
59 |
|
sl@0
|
60 |
|
sl@0
|
61 |
typedef struct _MamanBaz MamanBaz;
|
sl@0
|
62 |
typedef struct _MamanBazClass MamanBazClass;
|
sl@0
|
63 |
|
sl@0
|
64 |
struct _MamanBaz {
|
sl@0
|
65 |
GObject parent;
|
sl@0
|
66 |
int instance_member;
|
sl@0
|
67 |
};
|
sl@0
|
68 |
|
sl@0
|
69 |
struct _MamanBazClass {
|
sl@0
|
70 |
GObjectClass parent;
|
sl@0
|
71 |
};
|
sl@0
|
72 |
|
sl@0
|
73 |
GType maman_baz_get_type (void);
|
sl@0
|
74 |
|
sl@0
|
75 |
void baz_do_action (MamanBaz *self);
|
sl@0
|
76 |
void baz_instance_init (GTypeInstance *instance, gpointer g_class);
|
sl@0
|
77 |
void baz_interface_init (gpointer g_iface,gpointer iface_data);
|
sl@0
|
78 |
|
sl@0
|
79 |
|
sl@0
|
80 |
|
sl@0
|
81 |
|
sl@0
|
82 |
#endif // __DERIVED_H__ |