Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /* GObject - GLib Type, Object, Parameter and Signal Library
0002  * Copyright (C) 1997-1999, 2000-2001 Tim Janik and 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  * gvaluetypes.h: GLib default values
0020  */
0021 #ifndef __G_VALUETYPES_H__
0022 #define __G_VALUETYPES_H__
0023 
0024 #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
0025 #error "Only <glib-object.h> can be included directly."
0026 #endif
0027 
0028 #include    <gobject/gvalue.h>
0029 
0030 G_BEGIN_DECLS
0031 
0032 /* --- type macros --- */
0033 /**
0034  * G_VALUE_HOLDS_CHAR:
0035  * @value: a valid #GValue structure
0036  * 
0037  * Checks whether the given #GValue can hold values of type %G_TYPE_CHAR.
0038  * 
0039  * Returns: %TRUE on success.
0040  */
0041 #define G_VALUE_HOLDS_CHAR(value)    (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_CHAR))
0042 /**
0043  * G_VALUE_HOLDS_UCHAR:
0044  * @value: a valid #GValue structure
0045  * 
0046  * Checks whether the given #GValue can hold values of type %G_TYPE_UCHAR.
0047  * 
0048  * Returns: %TRUE on success.
0049  */
0050 #define G_VALUE_HOLDS_UCHAR(value)   (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UCHAR))
0051 /**
0052  * G_VALUE_HOLDS_BOOLEAN:
0053  * @value: a valid #GValue structure
0054  * 
0055  * Checks whether the given #GValue can hold values of type %G_TYPE_BOOLEAN.
0056  * 
0057  * Returns: %TRUE on success.
0058  */
0059 #define G_VALUE_HOLDS_BOOLEAN(value)     (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_BOOLEAN))
0060 /**
0061  * G_VALUE_HOLDS_INT:
0062  * @value: a valid #GValue structure
0063  * 
0064  * Checks whether the given #GValue can hold values of type %G_TYPE_INT.
0065  * 
0066  * Returns: %TRUE on success.
0067  */
0068 #define G_VALUE_HOLDS_INT(value)     (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT))
0069 /**
0070  * G_VALUE_HOLDS_UINT:
0071  * @value: a valid #GValue structure
0072  * 
0073  * Checks whether the given #GValue can hold values of type %G_TYPE_UINT.
0074  * 
0075  * Returns: %TRUE on success.
0076  */
0077 #define G_VALUE_HOLDS_UINT(value)    (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT))
0078 /**
0079  * G_VALUE_HOLDS_LONG:
0080  * @value: a valid #GValue structure
0081  * 
0082  * Checks whether the given #GValue can hold values of type %G_TYPE_LONG.
0083  * 
0084  * Returns: %TRUE on success.
0085  */
0086 #define G_VALUE_HOLDS_LONG(value)    (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_LONG))
0087 /**
0088  * G_VALUE_HOLDS_ULONG:
0089  * @value: a valid #GValue structure
0090  * 
0091  * Checks whether the given #GValue can hold values of type %G_TYPE_ULONG.
0092  * 
0093  * Returns: %TRUE on success.
0094  */
0095 #define G_VALUE_HOLDS_ULONG(value)   (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_ULONG))
0096 /**
0097  * G_VALUE_HOLDS_INT64:
0098  * @value: a valid #GValue structure
0099  * 
0100  * Checks whether the given #GValue can hold values of type %G_TYPE_INT64.
0101  * 
0102  * Returns: %TRUE on success.
0103  */
0104 #define G_VALUE_HOLDS_INT64(value)   (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_INT64))
0105 /**
0106  * G_VALUE_HOLDS_UINT64:
0107  * @value: a valid #GValue structure
0108  * 
0109  * Checks whether the given #GValue can hold values of type %G_TYPE_UINT64.
0110  * 
0111  * Returns: %TRUE on success.
0112  */
0113 #define G_VALUE_HOLDS_UINT64(value)  (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_UINT64))
0114 /**
0115  * G_VALUE_HOLDS_FLOAT:
0116  * @value: a valid #GValue structure
0117  * 
0118  * Checks whether the given #GValue can hold values of type %G_TYPE_FLOAT.
0119  * 
0120  * Returns: %TRUE on success.
0121  */
0122 #define G_VALUE_HOLDS_FLOAT(value)   (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_FLOAT))
0123 /**
0124  * G_VALUE_HOLDS_DOUBLE:
0125  * @value: a valid #GValue structure
0126  * 
0127  * Checks whether the given #GValue can hold values of type %G_TYPE_DOUBLE.
0128  * 
0129  * Returns: %TRUE on success.
0130  */
0131 #define G_VALUE_HOLDS_DOUBLE(value)  (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_DOUBLE))
0132 /**
0133  * G_VALUE_HOLDS_STRING:
0134  * @value: a valid #GValue structure
0135  * 
0136  * Checks whether the given #GValue can hold values of type %G_TYPE_STRING.
0137  * 
0138  * Returns: %TRUE on success.
0139  */
0140 #define G_VALUE_HOLDS_STRING(value)  (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_STRING))
0141 /**
0142  * G_VALUE_IS_INTERNED_STRING:
0143  * @value: a valid #GValue structure
0144  *
0145  * Checks whether @value contains a string which is canonical.
0146  *
0147  * Returns: %TRUE if the value contains a string in its canonical
0148  * representation, as returned by g_intern_string(). See also
0149  * g_value_set_interned_string().
0150  *
0151  * Since: 2.66
0152  */
0153 #define G_VALUE_IS_INTERNED_STRING(value) (G_VALUE_HOLDS_STRING (value) && ((value)->data[1].v_uint & G_VALUE_INTERNED_STRING)) GOBJECT_AVAILABLE_MACRO_IN_2_66
0154 /**
0155  * G_VALUE_HOLDS_POINTER:
0156  * @value: a valid #GValue structure
0157  * 
0158  * Checks whether the given #GValue can hold values of type %G_TYPE_POINTER.
0159  * 
0160  * Returns: %TRUE on success.
0161  */
0162 #define G_VALUE_HOLDS_POINTER(value)     (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_POINTER))
0163 /**
0164  * G_TYPE_GTYPE:
0165  * 
0166  * The type for #GType.
0167  */
0168 #define G_TYPE_GTYPE             (g_gtype_get_type())
0169 /**
0170  * G_VALUE_HOLDS_GTYPE:
0171  * @value: a valid #GValue structure
0172  * 
0173  * Checks whether the given #GValue can hold values of type %G_TYPE_GTYPE.
0174  * 
0175  * Since: 2.12
0176  * Returns: %TRUE on success.
0177  */
0178 #define G_VALUE_HOLDS_GTYPE(value)   (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_GTYPE))
0179 /**
0180  * G_VALUE_HOLDS_VARIANT:
0181  * @value: a valid #GValue structure
0182  *
0183  * Checks whether the given #GValue can hold values of type %G_TYPE_VARIANT.
0184  *
0185  * Returns: %TRUE on success.
0186  *
0187  * Since: 2.26
0188  */
0189 #define G_VALUE_HOLDS_VARIANT(value)     (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_VARIANT))
0190 
0191 
0192 /* --- prototypes --- */
0193 GOBJECT_DEPRECATED_IN_2_32_FOR(g_value_set_schar)
0194 void                  g_value_set_char          (GValue       *value,
0195                                                  gchar         v_char);
0196 GOBJECT_DEPRECATED_IN_2_32_FOR(g_value_get_schar)
0197 gchar                 g_value_get_char          (const GValue *value);
0198 GOBJECT_AVAILABLE_IN_ALL
0199 void              g_value_set_schar     (GValue       *value,
0200                          gint8         v_char);
0201 GOBJECT_AVAILABLE_IN_ALL
0202 gint8             g_value_get_schar     (const GValue *value);
0203 GOBJECT_AVAILABLE_IN_ALL
0204 void              g_value_set_uchar     (GValue       *value,
0205                          guchar        v_uchar);
0206 GOBJECT_AVAILABLE_IN_ALL
0207 guchar            g_value_get_uchar     (const GValue *value);
0208 GOBJECT_AVAILABLE_IN_ALL
0209 void              g_value_set_boolean   (GValue       *value,
0210                          gboolean      v_boolean);
0211 GOBJECT_AVAILABLE_IN_ALL
0212 gboolean          g_value_get_boolean   (const GValue *value);
0213 GOBJECT_AVAILABLE_IN_ALL
0214 void              g_value_set_int       (GValue       *value,
0215                          gint          v_int);
0216 GOBJECT_AVAILABLE_IN_ALL
0217 gint              g_value_get_int       (const GValue *value);
0218 GOBJECT_AVAILABLE_IN_ALL
0219 void              g_value_set_uint      (GValue       *value,
0220                          guint         v_uint);
0221 GOBJECT_AVAILABLE_IN_ALL
0222 guint             g_value_get_uint      (const GValue *value);
0223 GOBJECT_AVAILABLE_IN_ALL
0224 void              g_value_set_long      (GValue       *value,
0225                          glong         v_long);
0226 GOBJECT_AVAILABLE_IN_ALL
0227 glong             g_value_get_long      (const GValue *value);
0228 GOBJECT_AVAILABLE_IN_ALL
0229 void              g_value_set_ulong     (GValue       *value,
0230                          gulong        v_ulong);
0231 GOBJECT_AVAILABLE_IN_ALL
0232 gulong            g_value_get_ulong     (const GValue *value);
0233 GOBJECT_AVAILABLE_IN_ALL
0234 void              g_value_set_int64     (GValue       *value,
0235                          gint64        v_int64);
0236 GOBJECT_AVAILABLE_IN_ALL
0237 gint64            g_value_get_int64     (const GValue *value);
0238 GOBJECT_AVAILABLE_IN_ALL
0239 void              g_value_set_uint64    (GValue       *value,
0240                          guint64      v_uint64);
0241 GOBJECT_AVAILABLE_IN_ALL
0242 guint64           g_value_get_uint64    (const GValue *value);
0243 GOBJECT_AVAILABLE_IN_ALL
0244 void              g_value_set_float     (GValue       *value,
0245                          gfloat        v_float);
0246 GOBJECT_AVAILABLE_IN_ALL
0247 gfloat            g_value_get_float     (const GValue *value);
0248 GOBJECT_AVAILABLE_IN_ALL
0249 void              g_value_set_double    (GValue       *value,
0250                          gdouble       v_double);
0251 GOBJECT_AVAILABLE_IN_ALL
0252 gdouble           g_value_get_double    (const GValue *value);
0253 GOBJECT_AVAILABLE_IN_ALL
0254 void              g_value_set_string    (GValue       *value,
0255                          const gchar  *v_string);
0256 GOBJECT_AVAILABLE_IN_ALL
0257 void              g_value_set_static_string (GValue       *value,
0258                          const gchar  *v_string);
0259 GOBJECT_AVAILABLE_IN_2_66
0260 void              g_value_set_interned_string (GValue      *value,
0261                            const gchar  *v_string);
0262 GOBJECT_AVAILABLE_IN_ALL
0263 const gchar *         g_value_get_string    (const GValue *value);
0264 GOBJECT_AVAILABLE_IN_ALL
0265 gchar*            g_value_dup_string    (const GValue *value);
0266 GOBJECT_AVAILABLE_IN_2_80
0267 gchar*            g_value_steal_string  (GValue *value);
0268 GOBJECT_AVAILABLE_IN_ALL
0269 void              g_value_set_pointer   (GValue       *value,
0270                          gpointer      v_pointer);
0271 GOBJECT_AVAILABLE_IN_ALL
0272 gpointer          g_value_get_pointer   (const GValue *value);
0273 GOBJECT_AVAILABLE_IN_ALL
0274 GType             g_gtype_get_type      (void);
0275 GOBJECT_AVAILABLE_IN_ALL
0276 void              g_value_set_gtype         (GValue       *value,
0277                          GType         v_gtype);
0278 GOBJECT_AVAILABLE_IN_ALL
0279 GType                 g_value_get_gtype         (const GValue *value);
0280 GOBJECT_AVAILABLE_IN_ALL
0281 void              g_value_set_variant   (GValue       *value,
0282                          GVariant     *variant);
0283 GOBJECT_AVAILABLE_IN_ALL
0284 void              g_value_take_variant  (GValue       *value,
0285                          GVariant     *variant);
0286 GOBJECT_AVAILABLE_IN_ALL
0287 GVariant*         g_value_get_variant   (const GValue *value);
0288 GOBJECT_AVAILABLE_IN_ALL
0289 GVariant*         g_value_dup_variant   (const GValue *value);
0290 
0291 
0292 /* Convenience for registering new pointer types */
0293 GOBJECT_AVAILABLE_IN_ALL
0294 GType                 g_pointer_type_register_static (const gchar *name);
0295 
0296 /* debugging aid, describe value contents as string */
0297 GOBJECT_AVAILABLE_IN_ALL
0298 gchar*                g_strdup_value_contents   (const GValue *value);
0299 
0300 
0301 GOBJECT_AVAILABLE_IN_ALL
0302 void g_value_take_string                (GValue        *value,
0303                          gchar         *v_string);
0304 GOBJECT_DEPRECATED_FOR(g_value_take_string)
0305 void g_value_set_string_take_ownership          (GValue            *value,
0306                                                  gchar             *v_string);
0307 
0308 
0309 /* humpf, need a C representable type name for G_TYPE_STRING */
0310 /**
0311  * gchararray:
0312  * 
0313  * A C representable type name for %G_TYPE_STRING.
0314  */
0315 typedef gchar* gchararray;
0316 
0317 
0318 G_END_DECLS
0319 
0320 #endif /* __G_VALUETYPES_H__ */