Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /* GObject - GLib Type, Object, Parameter and Signal Library
0002  * Copyright (C) 2000-2001 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_BOXED_H__
0020 #define __G_BOXED_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 #ifndef __GI_SCANNER__
0029 #include        <gobject/glib-types.h>
0030 #endif
0031 
0032 G_BEGIN_DECLS
0033 
0034 /* --- type macros --- */
0035 #define G_TYPE_IS_BOXED(type)      (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED)
0036 /**
0037  * G_VALUE_HOLDS_BOXED:
0038  * @value: a valid #GValue structure
0039  *
0040  * Checks whether the given #GValue can hold values derived
0041  * from type %G_TYPE_BOXED.
0042  *
0043  * Returns: %TRUE on success.
0044  */
0045 #define G_VALUE_HOLDS_BOXED(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_BOXED))
0046 
0047 
0048 /* --- typedefs --- */
0049 /**
0050  * GBoxedCopyFunc:
0051  * @boxed: (not nullable): The boxed structure to be copied.
0052  *
0053  * This function is provided by the user and should produce a copy
0054  * of the passed in boxed structure.
0055  *
0056  * Returns: (not nullable): The newly created copy of the boxed structure.
0057  */
0058 typedef gpointer (*GBoxedCopyFunc) (gpointer boxed);
0059 
0060 /**
0061  * GBoxedFreeFunc:
0062  * @boxed: (not nullable): The boxed structure to be freed.
0063  *
0064  * This function is provided by the user and should free the boxed
0065  * structure passed.
0066  */
0067 typedef void (*GBoxedFreeFunc) (gpointer boxed);
0068 
0069 
0070 /* --- prototypes --- */
0071 GOBJECT_AVAILABLE_IN_ALL
0072 gpointer g_boxed_copy                     (GType boxed_type,
0073                                            gconstpointer  src_boxed);
0074 GOBJECT_AVAILABLE_IN_ALL
0075 void     g_boxed_free                     (GType          boxed_type,
0076                                            gpointer       boxed);
0077 GOBJECT_AVAILABLE_IN_ALL
0078 void     g_value_set_boxed                (GValue        *value,
0079                                            gconstpointer  v_boxed);
0080 GOBJECT_AVAILABLE_IN_ALL
0081 void     g_value_set_static_boxed         (GValue        *value,
0082                                            gconstpointer  v_boxed);
0083 GOBJECT_AVAILABLE_IN_ALL
0084 void     g_value_take_boxed               (GValue        *value,
0085                                            gconstpointer  v_boxed);
0086 GOBJECT_DEPRECATED_FOR(g_value_take_boxed)
0087 void     g_value_set_boxed_take_ownership (GValue        *value,
0088                                            gconstpointer  v_boxed);
0089 GOBJECT_AVAILABLE_IN_ALL
0090 gpointer g_value_get_boxed                (const GValue  *value);
0091 GOBJECT_AVAILABLE_IN_ALL
0092 gpointer g_value_dup_boxed                (const GValue  *value);
0093 
0094 
0095 /* --- convenience --- */
0096 GOBJECT_AVAILABLE_IN_ALL
0097 GType    g_boxed_type_register_static     (const gchar   *name,
0098                                            GBoxedCopyFunc boxed_copy,
0099                                            GBoxedFreeFunc boxed_free);
0100 
0101 /* --- GObject boxed types --- */
0102 /**
0103  * G_TYPE_CLOSURE:
0104  *
0105  * The #GType for #GClosure.
0106  */
0107 #define G_TYPE_CLOSURE (g_closure_get_type ())
0108 
0109 /**
0110  * G_TYPE_VALUE:
0111  *
0112  * The type ID of the "GValue" type which is a boxed type,
0113  * used to pass around pointers to GValues.
0114  */
0115 #define G_TYPE_VALUE (g_value_get_type ())
0116 
0117 GOBJECT_AVAILABLE_IN_ALL
0118 GType   g_closure_get_type         (void) G_GNUC_CONST;
0119 GOBJECT_AVAILABLE_IN_ALL
0120 GType   g_value_get_type           (void) G_GNUC_CONST;
0121 
0122 G_END_DECLS
0123 
0124 #endif  /* __G_BOXED_H__ */