fixed a bag full of subtle bugs of immensive screw-up potential in
[platform/upstream/glib.git] / gobject / gtypeplugin.h
1 /* GObject - GLib Type, Object, Parameter and Signal Library
2  * Copyright (C) 2000 Red Hat, Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General
15  * Public License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 #ifndef __G_TYPE_PLUGIN_H__
20 #define __G_TYPE_PLUGIN_H__
21
22
23 #include        <gobject/gtype.h>
24
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
30
31
32 /* --- type macros --- */
33 #define G_TYPE_TYPE_PLUGIN              (g_type_plugin_get_type ())
34 #define G_TYPE_PLUGIN(inst)             (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TYPE_PLUGIN, GTypePlugin))
35 #define G_TYPE_PLUGIN_CLASS(vtable)     (G_TYPE_CHECK_CLASS_CAST ((vtable), G_TYPE_TYPE_PLUGIN, GTypePluginClass))
36 #define G_IS_TYPE_PLUGIN(inst)          (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TYPE_PLUGIN))
37 #define G_IS_TYPE_PLUGIN_CLASS(vtable)  (G_TYPE_CHECK_CLASS_TYPE ((vtable), G_TYPE_TYPE_PLUGIN))
38 #define G_TYPE_PLUGIN_GET_CLASS(inst)   (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_TYPE_PLUGIN, GTypePluginClass))
39
40
41 /* --- typedefs & structures --- */
42 typedef struct _GTypePluginClass                   GTypePluginClass;
43 typedef void  (*GTypePluginUse)                   (GTypePlugin     *plugin);
44 typedef void  (*GTypePluginUnuse)                 (GTypePlugin     *plugin);
45 typedef void  (*GTypePluginCompleteTypeInfo)      (GTypePlugin     *plugin,
46                                                    GType            g_type,
47                                                    GTypeInfo       *info,
48                                                    GTypeValueTable *value_table);
49 typedef void  (*GTypePluginCompleteInterfaceInfo) (GTypePlugin     *plugin,
50                                                    GType            interface_type,
51                                                    GType            instance_type,
52                                                    GInterfaceInfo  *info);
53 struct _GTypePluginClass
54 {
55   GTypeInterface                   base_iface;
56   
57   GTypePluginUse                   use_plugin;
58   GTypePluginUnuse                 unuse_plugin;
59   GTypePluginCompleteTypeInfo      complete_type_info;
60   GTypePluginCompleteInterfaceInfo complete_interface_info;
61 };
62
63
64 /* --- prototypes --- */
65 GType   g_type_plugin_get_type                  (void)  G_GNUC_CONST;
66 void    g_type_plugin_use                       (GTypePlugin     *plugin);
67 void    g_type_plugin_unuse                     (GTypePlugin     *plugin);
68 void    g_type_plugin_complete_type_info        (GTypePlugin     *plugin,
69                                                  GType            g_type,
70                                                  GTypeInfo       *info,
71                                                  GTypeValueTable *value_table);
72 void    g_type_plugin_complete_interface_info   (GTypePlugin     *plugin,
73                                                  GType            interface_type,
74                                                  GType            instance_type,
75                                                  GInterfaceInfo  *info);
76
77
78
79
80
81 #ifdef __cplusplus
82 }
83 #endif /* __cplusplus */
84
85 #endif /* __G_TYPE_PLUGIN_H__ */