gtype.h | gtype.h | |||
---|---|---|---|---|
skipping to change at line 182 | skipping to change at line 182 | |||
* | * | |||
* The fundamental type from which all #GParamSpec types are derived. | * The fundamental type from which all #GParamSpec types are derived. | |||
*/ | */ | |||
#define G_TYPE_PARAM G_TYPE_MAKE_FUNDAMENTAL (19) | #define G_TYPE_PARAM G_TYPE_MAKE_FUNDAMENTAL (19) | |||
/** | /** | |||
* G_TYPE_OBJECT: | * G_TYPE_OBJECT: | |||
* | * | |||
* The fundamental type for #GObject. | * The fundamental type for #GObject. | |||
*/ | */ | |||
#define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) | #define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) | |||
/** | ||||
* G_TYPE_VARIANT: | ||||
* | ||||
* The fundamental type corresponding to #GVariant. | ||||
* | ||||
* All floating #GVariant instances passed through the #GType system are | ||||
* consumed. | ||||
* | ||||
* Note that callbacks in closures, and signal handlers | ||||
* for signals of return type %G_TYPE_VARIANT, must never return floating | ||||
* variants. | ||||
* | ||||
* Note: GLib 2.24 did include a boxed type with this name. It was replaced | ||||
* with this fundamental type in 2.26. | ||||
* | ||||
* Since: 2.26 | ||||
*/ | ||||
#define G_TYPE_VARIANT G_TYPE_MAKE_FUNDAMENTAL (21) | ||||
/* Reserved fundamental type numbers to create new fundamental | /* Reserved fundamental type numbers to create new fundamental | |||
* type IDs with G_TYPE_MAKE_FUNDAMENTAL(). | * type IDs with G_TYPE_MAKE_FUNDAMENTAL(). | |||
* Send email to gtk-devel-list@gnome.org for reservations. | * Send email to gtk-devel-list@gnome.org for reservations. | |||
*/ | */ | |||
/** | /** | |||
* G_TYPE_FUNDAMENTAL_SHIFT: | * G_TYPE_FUNDAMENTAL_SHIFT: | |||
* | * | |||
* Shift value used in converting numbers to type IDs. | * Shift value used in converting numbers to type IDs. | |||
*/ | */ | |||
skipping to change at line 210 | skipping to change at line 228 | |||
* | * | |||
* Returns: the GType | * Returns: the GType | |||
*/ | */ | |||
#define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUND AMENTAL_SHIFT)) | #define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUND AMENTAL_SHIFT)) | |||
/** | /** | |||
* G_TYPE_RESERVED_GLIB_FIRST: | * G_TYPE_RESERVED_GLIB_FIRST: | |||
* | * | |||
* First fundamental type number to create a new fundamental type id with | * First fundamental type number to create a new fundamental type id with | |||
* G_TYPE_MAKE_FUNDAMENTAL() reserved for GLib. | * G_TYPE_MAKE_FUNDAMENTAL() reserved for GLib. | |||
*/ | */ | |||
#define G_TYPE_RESERVED_GLIB_FIRST (21) | #define G_TYPE_RESERVED_GLIB_FIRST (22) | |||
/** | /** | |||
* G_TYPE_RESERVED_GLIB_LAST: | * G_TYPE_RESERVED_GLIB_LAST: | |||
* | * | |||
* Last fundamental type number reserved for GLib. | * Last fundamental type number reserved for GLib. | |||
*/ | */ | |||
#define G_TYPE_RESERVED_GLIB_LAST (31) | #define G_TYPE_RESERVED_GLIB_LAST (31) | |||
/** | /** | |||
* G_TYPE_RESERVED_BSE_FIRST: | * G_TYPE_RESERVED_BSE_FIRST: | |||
* | * | |||
* First fundamental type number to create a new fundamental type id with | * First fundamental type number to create a new fundamental type id with | |||
skipping to change at line 1164 | skipping to change at line 1182 | |||
* *string_p = g_strdup (value->data[0].v_pointer); | * *string_p = g_strdup (value->data[0].v_pointer); | |||
* ]| | * ]| | |||
* And an illustrative version of lcopy_value() for | * And an illustrative version of lcopy_value() for | |||
* reference-counted types: | * reference-counted types: | |||
* |[ | * |[ | |||
* GObject **object_p = collect_values[0].v_pointer; | * GObject **object_p = collect_values[0].v_pointer; | |||
* if (!object_p) | * if (!object_p) | |||
* return g_strdup_printf ("object location passed as NULL"); | * return g_strdup_printf ("object location passed as NULL"); | |||
* if (!value->data[0].v_pointer) | * if (!value->data[0].v_pointer) | |||
* *object_p = NULL; | * *object_p = NULL; | |||
* else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) // always honour | * else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) /* always honour */ | |||
* *object_p = value->data[0].v_pointer; | * *object_p = value->data[0].v_pointer; | |||
* else | * else | |||
* *object_p = g_object_ref (value->data[0].v_pointer); | * *object_p = g_object_ref (value->data[0].v_pointer); | |||
* return NULL; | * return NULL; | |||
* ]| | * ]| | |||
* | * | |||
* The #GTypeValueTable provides the functions required by the #GValue impl ementation, | * The #GTypeValueTable provides the functions required by the #GValue impl ementation, | |||
* to serve as a container for values of a type. | * to serve as a container for values of a type. | |||
*/ | */ | |||
skipping to change at line 1482 | skipping to change at line 1500 | |||
g_type_interface_add_prerequisite (g_define_type_id, TYPE_PREREQ); \ | g_type_interface_add_prerequisite (g_define_type_id, TYPE_PREREQ); \ | |||
{ /* custom code follows */ | { /* custom code follows */ | |||
#define _G_DEFINE_INTERFACE_EXTENDED_END() \ | #define _G_DEFINE_INTERFACE_EXTENDED_END() \ | |||
/* following custom code */ \ | /* following custom code */ \ | |||
} \ | } \ | |||
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \ | g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \ | |||
} \ | } \ | |||
return g_define_type_id__volatile; \ | return g_define_type_id__volatile; \ | |||
} /* closes type_name##_get_type() */ | } /* closes type_name##_get_type() */ | |||
/** | ||||
* G_DEFINE_BOXED_TYPE: | ||||
* @TypeName: The name of the new type, in Camel case. | ||||
* @type_name: The name of the new type, in lowercase, with words | ||||
* separated by '_'. | ||||
* @copy_func: the #GBoxedCopyFunc for the new type | ||||
* @free_func: the #GBoxedFreeFunc for the new type | ||||
* | ||||
* A convenience macro for boxed type implementations, which defines a | ||||
* type_name_get_type() function registering the boxed type. | ||||
* | ||||
* Since: 2.26 | ||||
*/ | ||||
#define G_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) G_DE | ||||
FINE_BOXED_TYPE_WITH_CODE (TypeName, type_name, copy_func, free_func, {}) | ||||
/** | ||||
* G_DEFINE_BOXED_TYPE_WITH_CODE: | ||||
* @TypeName: The name of the new type, in Camel case. | ||||
* @type_name: The name of the new type, in lowercase, with words | ||||
* separated by '_'. | ||||
* @copy_func: the #GBoxedCopyFunc for the new type | ||||
* @free_func: the #GBoxedFreeFunc for the new type | ||||
* @_C_: Custom code that gets inserted in the *_get_type() function. | ||||
* | ||||
* A convenience macro for boxed type implementations. | ||||
* Similar to G_DEFINE_BOXED_TYPE(), but allows to insert custom code into | ||||
the | ||||
* type_name_get_type() function, e.g. to register value transformations wi | ||||
th | ||||
* g_value_register_transform_func(). | ||||
* | ||||
* Since: 2.26 | ||||
*/ | ||||
#define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_ | ||||
func, _C_) _G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free | ||||
_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() | ||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) | ||||
#define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_fun | ||||
c) \ | ||||
GType \ | ||||
type_name##_get_type (void) \ | ||||
{ \ | ||||
static volatile gsize g_define_type_id__volatile = 0; \ | ||||
if (g_once_init_enter (&g_define_type_id__volatile)) \ | ||||
{ \ | ||||
GType (* _g_register_boxed) \ | ||||
(const gchar *, \ | ||||
union \ | ||||
{ \ | ||||
TypeName * (*do_copy_type) (TypeName *); \ | ||||
TypeName * (*do_const_copy_type) (const TypeName *); \ | ||||
GBoxedCopyFunc do_copy_boxed; \ | ||||
} __attribute__((__transparent_union__)), \ | ||||
union \ | ||||
{ \ | ||||
void (* do_free_type) (TypeName *); \ | ||||
GBoxedFreeFunc do_free_boxed; \ | ||||
} __attribute__((__transparent_union__)) \ | ||||
) = g_boxed_type_register_static; \ | ||||
GType g_define_type_id = \ | ||||
_g_register_boxed (g_intern_static_string (#TypeName), copy_func, f | ||||
ree_func); \ | ||||
{ /* custom code follows */ | ||||
#else | ||||
#define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_fun | ||||
c) \ | ||||
GType \ | ||||
type_name##_get_type (void) \ | ||||
{ \ | ||||
static volatile gsize g_define_type_id__volatile = 0; \ | ||||
if (g_once_init_enter (&g_define_type_id__volatile)) \ | ||||
{ \ | ||||
GType g_define_type_id = \ | ||||
g_boxed_type_register_static (g_intern_static_string (#TypeName), \ | ||||
(GBoxedCopyFunc) copy_func, \ | ||||
(GBoxedFreeFunc) free_func); \ | ||||
{ /* custom code follows */ | ||||
#endif /* __GNUC__ */ | ||||
/** | ||||
* G_DEFINE_POINTER_TYPE: | ||||
* @TypeName: The name of the new type, in Camel case. | ||||
* @type_name: The name of the new type, in lowercase, with words | ||||
* separated by '_'. | ||||
* | ||||
* A convenience macro for pointer type implementations, which defines a | ||||
* type_name_get_type() function registering the pointer type. | ||||
* | ||||
* Since: 2.26 | ||||
*/ | ||||
#define G_DEFINE_POINTER_TYPE(TypeName, type_name) G_DEFINE_POINTER_TYPE_WI | ||||
TH_CODE (TypeName, type_name, {}) | ||||
/** | ||||
* G_DEFINE_POINTER_TYPE_WITH_CODE: | ||||
* @TypeName: The name of the new type, in Camel case. | ||||
* @type_name: The name of the new type, in lowercase, with words | ||||
* separated by '_'. | ||||
* @_C_: Custom code that gets inserted in the *_get_type() function. | ||||
* | ||||
* A convenience macro for pointer type implementations. | ||||
* Similar to G_DEFINE_POINTER_TYPE(), but allows to insert custom code int | ||||
o the | ||||
* type_name_get_type() function. | ||||
* | ||||
* Since: 2.26 | ||||
*/ | ||||
#define G_DEFINE_POINTER_TYPE_WITH_CODE(TypeName, type_name, _C_) _G_DEFINE | ||||
_POINTER_TYPE_BEGIN (TypeName, type_name) {_C_;} _G_DEFINE_TYPE_EXTENDED_EN | ||||
D() | ||||
#define _G_DEFINE_POINTER_TYPE_BEGIN(TypeName, type_name) \ | ||||
GType \ | ||||
type_name##_get_type (void) \ | ||||
{ \ | ||||
static volatile gsize g_define_type_id__volatile = 0; \ | ||||
if (g_once_init_enter (&g_define_type_id__volatile)) \ | ||||
{ \ | ||||
GType g_define_type_id = \ | ||||
g_pointer_type_register_static (g_intern_static_string (#TypeName)) | ||||
; \ | ||||
{ /* custom code follows */ | ||||
/* --- protected (for fundamental type implementations) --- */ | /* --- protected (for fundamental type implementations) --- */ | |||
GTypePlugin* g_type_get_plugin (GType type); | GTypePlugin* g_type_get_plugin (GType type); | |||
GTypePlugin* g_type_interface_get_plugin (GType instanc e_type, | GTypePlugin* g_type_interface_get_plugin (GType instanc e_type, | |||
GType interfa ce_type); | GType interfa ce_type); | |||
GType g_type_fundamental_next (void); | GType g_type_fundamental_next (void); | |||
GType g_type_fundamental (GType type_id ); | GType g_type_fundamental (GType type_id ); | |||
GTypeInstance* g_type_create_instance (GType type); | GTypeInstance* g_type_create_instance (GType type); | |||
void g_type_free_instance (GTypeInstance *instan ce); | void g_type_free_instance (GTypeInstance *instan ce); | |||
void g_type_add_class_cache_func (gpointer cache_d ata, | void g_type_add_class_cache_func (gpointer cache_d ata, | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 143 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |