Blame gobject/gtypeplugin.h

Packit ae235b
/* GObject - GLib Type, Object, Parameter and Signal Library
Packit ae235b
 * Copyright (C) 2000 Red Hat, Inc.
Packit ae235b
 *
Packit ae235b
 * This library is free software; you can redistribute it and/or
Packit ae235b
 * modify it under the terms of the GNU Lesser General Public
Packit ae235b
 * License as published by the Free Software Foundation; either
Packit ae235b
 * version 2.1 of the License, or (at your option) any later version.
Packit ae235b
 *
Packit ae235b
 * This library is distributed in the hope that it will be useful,
Packit ae235b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit ae235b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit ae235b
 * Lesser General Public License for more details.
Packit ae235b
 *
Packit ae235b
 * You should have received a copy of the GNU Lesser General
Packit ae235b
 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit ae235b
 */
Packit ae235b
#ifndef __G_TYPE_PLUGIN_H__
Packit ae235b
#define __G_TYPE_PLUGIN_H__
Packit ae235b
Packit ae235b
#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
Packit ae235b
#error "Only <glib-object.h> can be included directly."
Packit ae235b
#endif
Packit ae235b
Packit ae235b
#include	<gobject/gtype.h>
Packit ae235b
Packit ae235b
G_BEGIN_DECLS
Packit ae235b
Packit ae235b
/* --- type macros --- */
Packit ae235b
#define G_TYPE_TYPE_PLUGIN		(g_type_plugin_get_type ())
Packit ae235b
#define G_TYPE_PLUGIN(inst)		(G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TYPE_PLUGIN, GTypePlugin))
Packit ae235b
#define G_TYPE_PLUGIN_CLASS(vtable)	(G_TYPE_CHECK_CLASS_CAST ((vtable), G_TYPE_TYPE_PLUGIN, GTypePluginClass))
Packit ae235b
#define G_IS_TYPE_PLUGIN(inst)		(G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TYPE_PLUGIN))
Packit ae235b
#define G_IS_TYPE_PLUGIN_CLASS(vtable)	(G_TYPE_CHECK_CLASS_TYPE ((vtable), G_TYPE_TYPE_PLUGIN))
Packit ae235b
#define G_TYPE_PLUGIN_GET_CLASS(inst)	(G_TYPE_INSTANCE_GET_INTERFACE ((inst), G_TYPE_TYPE_PLUGIN, GTypePluginClass))
Packit ae235b
Packit ae235b
Packit ae235b
/* --- typedefs & structures --- */
Packit ae235b
typedef struct _GTypePluginClass		   GTypePluginClass;
Packit ae235b
/**
Packit ae235b
 * GTypePluginUse:
Packit ae235b
 * @plugin: the #GTypePlugin whose use count should be increased
Packit ae235b
 * 
Packit ae235b
 * The type of the @use_plugin function of #GTypePluginClass, which gets called
Packit ae235b
 * to increase the use count of @plugin.
Packit ae235b
 */
Packit ae235b
typedef void  (*GTypePluginUse)			  (GTypePlugin     *plugin);
Packit ae235b
/**
Packit ae235b
 * GTypePluginUnuse:
Packit ae235b
 * @plugin: the #GTypePlugin whose use count should be decreased
Packit ae235b
 * 
Packit ae235b
 * The type of the @unuse_plugin function of #GTypePluginClass.
Packit ae235b
 */
Packit ae235b
typedef void  (*GTypePluginUnuse)		  (GTypePlugin     *plugin);
Packit ae235b
/**
Packit ae235b
 * GTypePluginCompleteTypeInfo:
Packit ae235b
 * @plugin: the #GTypePlugin
Packit ae235b
 * @g_type: the #GType whose info is completed
Packit ae235b
 * @info: the #GTypeInfo struct to fill in
Packit ae235b
 * @value_table: the #GTypeValueTable to fill in
Packit ae235b
 * 
Packit ae235b
 * The type of the @complete_type_info function of #GTypePluginClass.
Packit ae235b
 */
Packit ae235b
typedef void  (*GTypePluginCompleteTypeInfo)	  (GTypePlugin     *plugin,
Packit ae235b
						   GType            g_type,
Packit ae235b
						   GTypeInfo       *info,
Packit ae235b
						   GTypeValueTable *value_table);
Packit ae235b
/**
Packit ae235b
 * GTypePluginCompleteInterfaceInfo:
Packit ae235b
 * @plugin: the #GTypePlugin
Packit ae235b
 * @instance_type: the #GType of an instantiable type to which the interface
Packit ae235b
 *  is added
Packit ae235b
 * @interface_type: the #GType of the interface whose info is completed
Packit ae235b
 * @info: the #GInterfaceInfo to fill in
Packit ae235b
 * 
Packit ae235b
 * The type of the @complete_interface_info function of #GTypePluginClass.
Packit ae235b
 */
Packit ae235b
typedef void  (*GTypePluginCompleteInterfaceInfo) (GTypePlugin     *plugin,
Packit ae235b
						   GType            instance_type,
Packit ae235b
						   GType            interface_type,
Packit ae235b
						   GInterfaceInfo  *info);
Packit ae235b
/**
Packit ae235b
 * GTypePlugin:
Packit ae235b
 * 
Packit ae235b
 * The GTypePlugin typedef is used as a placeholder 
Packit ae235b
 * for objects that implement the GTypePlugin interface.
Packit ae235b
 */
Packit ae235b
/**
Packit ae235b
 * GTypePluginClass:
Packit ae235b
 * @use_plugin: Increases the use count of the plugin.
Packit ae235b
 * @unuse_plugin: Decreases the use count of the plugin.
Packit ae235b
 * @complete_type_info: Fills in the #GTypeInfo and 
Packit ae235b
 *  #GTypeValueTable structs for the type. The structs are initialized
Packit ae235b
 *  with `memset(s, 0, sizeof (s))` before calling this function.
Packit ae235b
 * @complete_interface_info: Fills in missing parts of the #GInterfaceInfo 
Packit ae235b
 *  for the interface. The structs is initialized with
Packit ae235b
 *  `memset(s, 0, sizeof (s))` before calling this function.
Packit ae235b
 * 
Packit ae235b
 * The #GTypePlugin interface is used by the type system in order to handle
Packit ae235b
 * the lifecycle of dynamically loaded types.
Packit ae235b
 */
Packit ae235b
struct _GTypePluginClass
Packit ae235b
{
Packit ae235b
  /*< private >*/
Packit ae235b
  GTypeInterface		   base_iface;
Packit ae235b
  
Packit ae235b
  /*< public >*/
Packit ae235b
  GTypePluginUse		   use_plugin;
Packit ae235b
  GTypePluginUnuse		   unuse_plugin;
Packit ae235b
  GTypePluginCompleteTypeInfo	   complete_type_info;
Packit ae235b
  GTypePluginCompleteInterfaceInfo complete_interface_info;
Packit ae235b
};
Packit ae235b
Packit ae235b
Packit ae235b
/* --- prototypes --- */
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GType	g_type_plugin_get_type			(void)	G_GNUC_CONST;
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void	g_type_plugin_use			(GTypePlugin	 *plugin);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void	g_type_plugin_unuse			(GTypePlugin	 *plugin);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void	g_type_plugin_complete_type_info	(GTypePlugin     *plugin,
Packit ae235b
						 GType            g_type,
Packit ae235b
						 GTypeInfo       *info,
Packit ae235b
						 GTypeValueTable *value_table);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void	g_type_plugin_complete_interface_info	(GTypePlugin     *plugin,
Packit ae235b
						 GType            instance_type,
Packit ae235b
						 GType            interface_type,
Packit ae235b
						 GInterfaceInfo  *info);
Packit ae235b
Packit ae235b
G_END_DECLS
Packit ae235b
Packit ae235b
#endif /* __G_TYPE_PLUGIN_H__ */