Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:17:40

0001 /* GObject - GLib Type, Object, Parameter and Signal Library
0002  * Copyright (C) 2000 Red Hat, Inc.
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2.1 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Lesser General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General
0017  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0018  */
0019 #ifndef __G_TYPE_PLUGIN_H__
0020 #define __G_TYPE_PLUGIN_H__
0021 
0022 #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
0023 #error "Only <glib-object.h> can be included directly."
0024 #endif
0025 
0026 #include    <gobject/gtype.h>
0027 
0028 G_BEGIN_DECLS
0029 
0030 /* --- type macros --- */
0031 #define G_TYPE_TYPE_PLUGIN      (g_type_plugin_get_type ())
0032 #define G_TYPE_PLUGIN(inst)     (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TYPE_PLUGIN, GTypePlugin))
0033 #define G_TYPE_PLUGIN_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), G_TYPE_TYPE_PLUGIN, GTypePluginClass))
0034 #define G_IS_TYPE_PLUGIN(inst)      (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TYPE_PLUGIN))
0035 #define G_IS_TYPE_PLUGIN_CLASS(vtable)  (G_TYPE_CHECK_CLASS_TYPE ((vtable), G_TYPE_TYPE_PLUGIN))
0036 #define G_TYPE_PLUGIN_GET_CLASS(inst)   (G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_TYPE_PLUGIN, GTypePluginClass))
0037 
0038 
0039 /* --- typedefs & structures --- */
0040 typedef struct _GTypePluginClass           GTypePluginClass;
0041 /**
0042  * GTypePluginUse:
0043  * @plugin: the #GTypePlugin whose use count should be increased
0044  * 
0045  * The type of the @use_plugin function of #GTypePluginClass, which gets called
0046  * to increase the use count of @plugin.
0047  */
0048 typedef void  (*GTypePluginUse)           (GTypePlugin     *plugin);
0049 /**
0050  * GTypePluginUnuse:
0051  * @plugin: the #GTypePlugin whose use count should be decreased
0052  * 
0053  * The type of the @unuse_plugin function of #GTypePluginClass.
0054  */
0055 typedef void  (*GTypePluginUnuse)         (GTypePlugin     *plugin);
0056 /**
0057  * GTypePluginCompleteTypeInfo:
0058  * @plugin: the #GTypePlugin
0059  * @g_type: the #GType whose info is completed
0060  * @info: the #GTypeInfo struct to fill in
0061  * @value_table: the #GTypeValueTable to fill in
0062  * 
0063  * The type of the @complete_type_info function of #GTypePluginClass.
0064  */
0065 typedef void  (*GTypePluginCompleteTypeInfo)      (GTypePlugin     *plugin,
0066                            GType            g_type,
0067                            GTypeInfo       *info,
0068                            GTypeValueTable *value_table);
0069 /**
0070  * GTypePluginCompleteInterfaceInfo:
0071  * @plugin: the #GTypePlugin
0072  * @instance_type: the #GType of an instantiatable type to which the interface
0073  *  is added
0074  * @interface_type: the #GType of the interface whose info is completed
0075  * @info: the #GInterfaceInfo to fill in
0076  * 
0077  * The type of the @complete_interface_info function of #GTypePluginClass.
0078  */
0079 typedef void  (*GTypePluginCompleteInterfaceInfo) (GTypePlugin     *plugin,
0080                            GType            instance_type,
0081                            GType            interface_type,
0082                            GInterfaceInfo  *info);
0083 /**
0084  * GTypePluginClass:
0085  * @use_plugin: Increases the use count of the plugin.
0086  * @unuse_plugin: Decreases the use count of the plugin.
0087  * @complete_type_info: Fills in the #GTypeInfo and 
0088  *  #GTypeValueTable structs for the type. The structs are initialized
0089  *  with `memset(s, 0, sizeof (s))` before calling this function.
0090  * @complete_interface_info: Fills in missing parts of the #GInterfaceInfo 
0091  *  for the interface. The structs is initialized with
0092  *  `memset(s, 0, sizeof (s))` before calling this function.
0093  * 
0094  * The #GTypePlugin interface is used by the type system in order to handle
0095  * the lifecycle of dynamically loaded types.
0096  */
0097 struct _GTypePluginClass
0098 {
0099   /*< private >*/
0100   GTypeInterface           base_iface;
0101   
0102   /*< public >*/
0103   GTypePluginUse           use_plugin;
0104   GTypePluginUnuse         unuse_plugin;
0105   GTypePluginCompleteTypeInfo      complete_type_info;
0106   GTypePluginCompleteInterfaceInfo complete_interface_info;
0107 };
0108 
0109 
0110 /* --- prototypes --- */
0111 GOBJECT_AVAILABLE_IN_ALL
0112 GType   g_type_plugin_get_type          (void)  G_GNUC_CONST;
0113 GOBJECT_AVAILABLE_IN_ALL
0114 void    g_type_plugin_use           (GTypePlugin     *plugin);
0115 GOBJECT_AVAILABLE_IN_ALL
0116 void    g_type_plugin_unuse         (GTypePlugin     *plugin);
0117 GOBJECT_AVAILABLE_IN_ALL
0118 void    g_type_plugin_complete_type_info    (GTypePlugin     *plugin,
0119                          GType            g_type,
0120                          GTypeInfo       *info,
0121                          GTypeValueTable *value_table);
0122 GOBJECT_AVAILABLE_IN_ALL
0123 void    g_type_plugin_complete_interface_info   (GTypePlugin     *plugin,
0124                          GType            instance_type,
0125                          GType            interface_type,
0126                          GInterfaceInfo  *info);
0127 
0128 G_END_DECLS
0129 
0130 #endif /* __G_TYPE_PLUGIN_H__ */