docs: Ditch more markup
[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, see <http://www.gnu.org/licenses/>.
16  */
17 #ifndef __G_TYPE_PLUGIN_H__
18 #define __G_TYPE_PLUGIN_H__
19
20 #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
21 #error "Only <glib-object.h> can be included directly."
22 #endif
23
24 #include        <gobject/gtype.h>
25
26 G_BEGIN_DECLS
27
28 /* --- type macros --- */
29 #define G_TYPE_TYPE_PLUGIN              (g_type_plugin_get_type ())
30 #define G_TYPE_PLUGIN(inst)             (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TYPE_PLUGIN, GTypePlugin))
31 #define G_TYPE_PLUGIN_CLASS(vtable)     (G_TYPE_CHECK_CLASS_CAST ((vtable), G_TYPE_TYPE_PLUGIN, GTypePluginClass))
32 #define G_IS_TYPE_PLUGIN(inst)          (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TYPE_PLUGIN))
33 #define G_IS_TYPE_PLUGIN_CLASS(vtable)  (G_TYPE_CHECK_CLASS_TYPE ((vtable), G_TYPE_TYPE_PLUGIN))
34 #define G_TYPE_PLUGIN_GET_CLASS(inst)   (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_TYPE_PLUGIN, GTypePluginClass))
35
36
37 /* --- typedefs & structures --- */
38 typedef struct _GTypePluginClass                   GTypePluginClass;
39 /**
40  * GTypePluginUse:
41  * @plugin: the #GTypePlugin whose use count should be increased
42  * 
43  * The type of the @use_plugin function of #GTypePluginClass, which gets called
44  * to increase the use count of @plugin.
45  */
46 typedef void  (*GTypePluginUse)                   (GTypePlugin     *plugin);
47 /**
48  * GTypePluginUnuse:
49  * @plugin: the #GTypePlugin whose use count should be decreased
50  * 
51  * The type of the @unuse_plugin function of #GTypePluginClass.
52  */
53 typedef void  (*GTypePluginUnuse)                 (GTypePlugin     *plugin);
54 /**
55  * GTypePluginCompleteTypeInfo:
56  * @plugin: the #GTypePlugin
57  * @g_type: the #GType whose info is completed
58  * @info: the #GTypeInfo struct to fill in
59  * @value_table: the #GTypeValueTable to fill in
60  * 
61  * The type of the @complete_type_info function of #GTypePluginClass.
62  */
63 typedef void  (*GTypePluginCompleteTypeInfo)      (GTypePlugin     *plugin,
64                                                    GType            g_type,
65                                                    GTypeInfo       *info,
66                                                    GTypeValueTable *value_table);
67 /**
68  * GTypePluginCompleteInterfaceInfo:
69  * @plugin: the #GTypePlugin
70  * @instance_type: the #GType of an instantiable type to which the interface
71  *  is added
72  * @interface_type: the #GType of the interface whose info is completed
73  * @info: the #GInterfaceInfo to fill in
74  * 
75  * The type of the @complete_interface_info function of #GTypePluginClass.
76  */
77 typedef void  (*GTypePluginCompleteInterfaceInfo) (GTypePlugin     *plugin,
78                                                    GType            instance_type,
79                                                    GType            interface_type,
80                                                    GInterfaceInfo  *info);
81 /**
82  * GTypePlugin:
83  * 
84  * The <structname>GTypePlugin</structname> typedef is used as a placeholder 
85  * for objects that implement the <structname>GTypePlugin</structname> 
86  * interface.
87  */
88 /**
89  * GTypePluginClass:
90  * @use_plugin: Increases the use count of the plugin.
91  * @unuse_plugin: Decreases the use count of the plugin.
92  * @complete_type_info: Fills in the #GTypeInfo and 
93  *  #GTypeValueTable structs for the type. The structs are initialized
94  *  with `memset(s, 0, sizeof (s))` before calling this function.
95  * @complete_interface_info: Fills in missing parts of the #GInterfaceInfo 
96  *  for the interface. The structs is initialized with
97  *  `memset(s, 0, sizeof (s))` before calling this function.
98  * 
99  * The #GTypePlugin interface is used by the type system in order to handle
100  * the lifecycle of dynamically loaded types.
101  */
102 struct _GTypePluginClass
103 {
104   /*< private >*/
105   GTypeInterface                   base_iface;
106   
107   /*< public >*/
108   GTypePluginUse                   use_plugin;
109   GTypePluginUnuse                 unuse_plugin;
110   GTypePluginCompleteTypeInfo      complete_type_info;
111   GTypePluginCompleteInterfaceInfo complete_interface_info;
112 };
113
114
115 /* --- prototypes --- */
116 GLIB_AVAILABLE_IN_ALL
117 GType   g_type_plugin_get_type                  (void)  G_GNUC_CONST;
118 GLIB_AVAILABLE_IN_ALL
119 void    g_type_plugin_use                       (GTypePlugin     *plugin);
120 GLIB_AVAILABLE_IN_ALL
121 void    g_type_plugin_unuse                     (GTypePlugin     *plugin);
122 GLIB_AVAILABLE_IN_ALL
123 void    g_type_plugin_complete_type_info        (GTypePlugin     *plugin,
124                                                  GType            g_type,
125                                                  GTypeInfo       *info,
126                                                  GTypeValueTable *value_table);
127 GLIB_AVAILABLE_IN_ALL
128 void    g_type_plugin_complete_interface_info   (GTypePlugin     *plugin,
129                                                  GType            instance_type,
130                                                  GType            interface_type,
131                                                  GInterfaceInfo  *info);
132
133 G_END_DECLS
134
135 #endif /* __G_TYPE_PLUGIN_H__ */