source: trunk/third/glib2/gobject/gtypeplugin.c @ 18159

Revision 18159, 2.6 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18158, which included commits to RCS files with non-trunk default branches.
Line 
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#include        "gtypeplugin.h"
20
21
22
23/* --- functions --- */
24GType
25g_type_plugin_get_type (void)
26{
27  static GType type_plugin_type = 0;
28 
29  if (!type_plugin_type)
30    {
31      static const GTypeInfo type_plugin_info = {
32        sizeof (GTypePluginClass),
33        NULL,           /* base_init */
34        NULL,           /* base_finalize */
35      };
36     
37      type_plugin_type = g_type_register_static (G_TYPE_INTERFACE, "GTypePlugin", &type_plugin_info, 0);
38    }
39 
40  return type_plugin_type;
41}
42
43void
44g_type_plugin_use (GTypePlugin *plugin)
45{
46  GTypePluginClass *iface;
47 
48  g_return_if_fail (G_IS_TYPE_PLUGIN (plugin));
49 
50  iface = G_TYPE_PLUGIN_GET_CLASS (plugin);
51  iface->use_plugin (plugin);
52}
53
54void
55g_type_plugin_unuse (GTypePlugin *plugin)
56{
57  GTypePluginClass *iface;
58 
59  g_return_if_fail (G_IS_TYPE_PLUGIN (plugin));
60 
61  iface = G_TYPE_PLUGIN_GET_CLASS (plugin);
62  iface->unuse_plugin (plugin);
63}
64
65void
66g_type_plugin_complete_type_info (GTypePlugin     *plugin,
67                                  GType            g_type,
68                                  GTypeInfo       *info,
69                                  GTypeValueTable *value_table)
70{
71  GTypePluginClass *iface;
72 
73  g_return_if_fail (G_IS_TYPE_PLUGIN (plugin));
74  g_return_if_fail (info != NULL);
75  g_return_if_fail (value_table != NULL);
76 
77  iface = G_TYPE_PLUGIN_GET_CLASS (plugin);
78  iface->complete_type_info (plugin,
79                             g_type,
80                             info,
81                             value_table);
82}
83
84void
85g_type_plugin_complete_interface_info (GTypePlugin    *plugin,
86                                       GType           instance_type,
87                                       GType           interface_type,
88                                       GInterfaceInfo *info)
89{
90  GTypePluginClass *iface;
91 
92  g_return_if_fail (G_IS_TYPE_PLUGIN (plugin));
93  g_return_if_fail (info != NULL);
94 
95  iface = G_TYPE_PLUGIN_GET_CLASS (plugin);
96  iface->complete_interface_info (plugin,
97                                  instance_type,
98                                  interface_type,
99                                  info);
100}
Note: See TracBrowser for help on using the repository browser.