/usr/include/libgsf-1/gsf/gsf-impl-utils.h is in libgsf-1-dev 1.14.21-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* gsf-impl-utils.h:
*
* Copyright (C) 2002-2006 Jody Goldberg (jody@gnome.org)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2.1 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*/
#ifndef GSF_IMPL_UTILS_H
#define GSF_IMPL_UTILS_H
#include <gsf/gsf.h>
#include <glib-object.h>
G_BEGIN_DECLS
/* We need to do this with a version check as this header gets installed.
*
* DEPRECATED in favour of G_PARAM_STATIC_STRINGS
**/
#if GLIB_CHECK_VERSION(2,7,0)
#define GSF_PARAM_STATIC (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)
#else
#define GSF_PARAM_STATIC 0
#endif
/*************************************************************************/
#define GSF_CLASS_FULL(name, prefix, base_init, base_finalize, \
class_init, class_finalize, instance_init, parent_type, \
abstract, interface_decl) \
GType \
prefix ## _get_type (void) \
{ \
static GType type = 0; \
if (G_UNLIKELY (type == 0)) { \
static GTypeInfo const object_info = { \
sizeof (name ## Class), \
(GBaseInitFunc) base_init, \
(GBaseFinalizeFunc) base_finalize, \
(GClassInitFunc) class_init, \
(GClassFinalizeFunc) class_finalize, \
NULL, /* class_data */ \
sizeof (name), \
0, /* n_preallocs */ \
(GInstanceInitFunc) instance_init, \
NULL \
}; \
type = g_type_register_static (parent_type, #name, \
&object_info, (GTypeFlags) abstract); \
interface_decl \
} \
return type; \
}
/**
* GSF_CLASS:
* @name: (string) Name of the class.
* @prefix: (string) Prefix designating the namespace to be used for
* implementing the class.
* @class_init: (#GClassInitFunc) Initialisation function for the class.
* @instance_init: (#GInstanceInitFunc) Initialisation (constructor) function
* for an instance of the class.
* @parent: Parent class to this class.
*
* Set up a GSF class.
*
*/
#define GSF_CLASS(name, prefix, class_init, instance_init, parent) \
GSF_CLASS_FULL(name, prefix, NULL, NULL, class_init, NULL, \
instance_init, parent, 0, {})
#define GSF_CLASS_ABSTRACT(name, prefix, class_init, instance_init, parent) \
GSF_CLASS_FULL(name, prefix, NULL, NULL, class_init, NULL, \
instance_init, parent, G_TYPE_FLAG_ABSTRACT, {})
#define GSF_INTERFACE_FULL(type, init_func, iface_type) { \
static GInterfaceInfo const iface = { \
(GInterfaceInitFunc) init_func, NULL, NULL }; \
g_type_add_interface_static (type, iface_type, &iface); \
}
#define GSF_INTERFACE(init_func, iface_type) \
GSF_INTERFACE_FULL(type, init_func, iface_type)
/*************************************************************************/
#define GSF_DYNAMIC_CLASS_FULL(name, prefix, base_init, base_finalize, \
class_init, class_finalize, instance_init, parent_type, \
abstract, interface_decl) \
static GType prefix ## _type; \
\
GType prefix ## _get_type (void); \
void prefix ## _register_type (GTypeModule *module); \
\
GType \
prefix ## _get_type (void) \
{ \
g_return_val_if_fail (prefix ## _type != 0, 0); \
return prefix ## _type; \
} \
void \
prefix ## _register_type (GTypeModule *module) \
{ \
GTypeInfo const type_info = { \
sizeof (name ## Class), \
(GBaseInitFunc) base_init, \
(GBaseFinalizeFunc) base_finalize, \
(GClassInitFunc) class_init, \
(GClassFinalizeFunc) class_finalize, \
NULL, /* class_data */ \
sizeof (name), \
0, /* n_preallocs */ \
(GInstanceInitFunc) instance_init, \
NULL \
}; \
GType type; \
\
g_return_if_fail (prefix ## _type == 0); \
\
prefix ## _type = type = g_type_module_register_type (module, \
parent_type, #name, &type_info, (GTypeFlags) abstract); \
interface_decl \
}
#define GSF_DYNAMIC_CLASS(name, prefix, class_init, instance_init, parent) \
GSF_DYNAMIC_CLASS_FULL(name, prefix, NULL, NULL, class_init, NULL, \
instance_init, parent, 0, {})
#define GSF_DYNAMIC_CLASS_ABSTRACT(name, prefix, class_init, instance_init, parent) \
GSF_DYNAMIC_CLASS_FULL(name, prefix, NULL, NULL, class_init, NULL, \
instance_init, parent, G_TYPE_FLAG_ABSTRACT, {})
#define GSF_DYNAMIC_INTERFACE_FULL(type, init_func, iface_type, module) { \
GInterfaceInfo const iface = { \
(GInterfaceInitFunc) init_func, NULL, NULL }; \
g_type_module_add_interface (module, type, iface_type, &iface); \
}
#define GSF_DYNAMIC_INTERFACE(init_func, iface_type, module) \
GSF_DYNAMIC_INTERFACE_FULL(type, init_func, iface_type, module)
G_END_DECLS
#endif /* GSF_IMPL_UTILS_H */
|