~ubuntu-branches/debian/jessie/glib2.0/jessie

« back to all changes in this revision

Viewing changes to docs/reference/gobject/html/gobject-Generic-values.html

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mto: (1.4.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 70.
  • Revision ID: james.westby@ubuntu.com-20090215130043-6snh45flhit8oalb
Tags: upstream-2.18.4
Import upstream version 2.18.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
<html>
3
3
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
 
<title>Generic Values</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
 
<link rel="start" href="index.html" title="GObject Reference Manual">
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
5
<title>Generic values</title>
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
 
7
<link rel="home" href="index.html" title="GObject Reference Manual">
8
8
<link rel="up" href="rn01.html" title="API Reference">
9
 
<link rel="prev" href="gobject-Boxed-Types.html" title="GBoxed">
 
9
<link rel="prev" href="gobject-Boxed-Types.html" title="Boxed Types">
10
10
<link rel="next" href="gobject-Standard-Parameter-and-Value-Types.html" title="Parameters and Values">
11
 
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="preface" href="pr01.html" title="Introduction">
14
 
<link rel="part" href="pt01.html" title="Part&#160;I.&#160;Concepts">
 
14
<link rel="part" href="pt01.html" title="Part I. Concepts">
15
15
<link rel="chapter" href="chapter-intro.html" title="Background">
16
16
<link rel="chapter" href="chapter-gtype.html" title="The GLib Dynamic Type System">
17
17
<link rel="chapter" href="chapter-gobject.html" title="The GObject base class">
18
18
<link rel="chapter" href="chapter-signal.html" title="The GObject messaging system">
19
19
<link rel="reference" href="rn01.html" title="API Reference">
20
20
<link rel="reference" href="rn02.html" title="Tools Reference">
21
 
<link rel="part" href="pt02.html" title="Part&#160;IV.&#160;Tutorial">
 
21
<link rel="part" href="pt02.html" title="Part IV. Tutorial">
22
22
<link rel="chapter" href="howto-gobject.html" title="How to define and implement a new GObject">
23
23
<link rel="chapter" href="howto-interface.html" title="How to define and implement interfaces">
24
24
<link rel="chapter" href="howto-signals.html" title="How to create and use signals">
25
 
<link rel="part" href="pt03.html" title="Part&#160;V.&#160;Related Tools">
 
25
<link rel="part" href="pt03.html" title="Part V. Related Tools">
 
26
<link rel="chapter" href="tools-vala.html" title="Vala">
26
27
<link rel="chapter" href="tools-gob.html" title="GObject builder">
27
28
<link rel="chapter" href="tools-ginspector.html" title="Graphical inspection of GObjects">
28
29
<link rel="chapter" href="tools-refdb.html" title="Debugging reference count problems">
36
37
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
37
38
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
38
39
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
 
40
<link rel="index" href="ix10.html" title="Index of new symbols in 2.14">
39
41
</head>
40
42
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
41
43
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
46
48
<th width="100%" align="center">GObject Reference Manual</th>
47
49
<td><a accesskey="n" href="gobject-Standard-Parameter-and-Value-Types.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
48
50
</tr>
49
 
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2886696" class="shortcut">Top</a>
50
 
                  &#160;|&#160;
51
 
                  <a href="#id2887156" class="shortcut">Description</a></nobr></td></tr>
 
51
<tr><td colspan="5" class="shortcuts">
 
52
<a href="#gobject-Generic-values.synopsis" class="shortcut">Top</a>
 
53
                 | 
 
54
                <a href="#gobject-Generic-values.description" class="shortcut">Description</a>
 
55
</td></tr>
52
56
</table>
53
57
<div class="refentry" lang="en">
54
58
<a name="gobject-Generic-values"></a><div class="titlepage"></div>
55
59
<div class="refnamediv"><table width="100%"><tr>
56
60
<td valign="top">
57
 
<h2>
58
 
<a name="id2886696"></a><span class="refentrytitle">Generic Values</span>
59
 
</h2>
60
 
<p>Generic Values &#8212; A polymorphic type that can hold values of any other type</p>
 
61
<h2><span class="refentrytitle"><a name="gobject-Generic-values.top_of_page"></a>Generic values</span></h2>
 
62
<p>Generic values — A polymorphic type that can hold values of any
 
63
    other type</p>
61
64
</td>
62
65
<td valign="top" align="right"></td>
63
66
</tr></table></div>
64
67
<div class="refsynopsisdiv">
65
 
<h2>Synopsis</h2>
 
68
<a name="gobject-Generic-values.synopsis"></a><h2>Synopsis</h2>
66
69
<pre class="synopsis">
67
70
 
68
71
#include &lt;glib-object.h&gt;
69
72
 
70
 
 
71
 
#define             <a class="link" href="gobject-Generic-values.html#G-VALUE-HOLDS:CAPS">G_VALUE_HOLDS</a>                       (value,type)
72
 
#define             <a class="link" href="gobject-Generic-values.html#G-VALUE-TYPE:CAPS">G_VALUE_TYPE</a>                        (value)
73
 
#define             <a class="link" href="gobject-Generic-values.html#G-VALUE-TYPE-NAME:CAPS">G_VALUE_TYPE_NAME</a>                   (value)
74
 
#define             <a class="link" href="gobject-Generic-values.html#G-TYPE-IS-VALUE:CAPS">G_TYPE_IS_VALUE</a>                     (type)
75
 
#define             <a class="link" href="gobject-Generic-values.html#G-TYPE-IS-VALUE-ABSTRACT:CAPS">G_TYPE_IS_VALUE_ABSTRACT</a>            (type)
76
 
#define             <a class="link" href="gobject-Generic-values.html#G-IS-VALUE:CAPS">G_IS_VALUE</a>                          (value)
77
 
                    <a class="link" href="gobject-Generic-values.html#GValue">GValue</a>;
78
 
#define             <a class="link" href="gobject-Generic-values.html#G-TYPE-VALUE:CAPS">G_TYPE_VALUE</a>
79
 
#define             <a class="link" href="gobject-Generic-values.html#G-TYPE-VALUE-ARRAY:CAPS">G_TYPE_VALUE_ARRAY</a>
80
 
<a class="link" href="gobject-Generic-values.html#GValue">GValue</a>*             <a class="link" href="gobject-Generic-values.html#g-value-init">g_value_init</a>                        (<a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value,
81
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> g_type);
82
 
void                <a class="link" href="gobject-Generic-values.html#g-value-copy">g_value_copy</a>                        (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *src_value,
83
 
                                                         <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *dest_value);
84
 
<a class="link" href="gobject-Generic-values.html#GValue">GValue</a>*             <a class="link" href="gobject-Generic-values.html#g-value-reset">g_value_reset</a>                       (<a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value);
85
 
void                <a class="link" href="gobject-Generic-values.html#g-value-unset">g_value_unset</a>                       (<a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value);
86
 
void                <a class="link" href="gobject-Generic-values.html#g-value-set-instance">g_value_set_instance</a>                (<a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value,
 
73
#define             <a class="link" href="gobject-Generic-values.html#G-VALUE-HOLDS--CAPS" title="G_VALUE_HOLDS()">G_VALUE_HOLDS</a>                       (value,type)
 
74
#define             <a class="link" href="gobject-Generic-values.html#G-VALUE-TYPE--CAPS" title="G_VALUE_TYPE()">G_VALUE_TYPE</a>                        (value)
 
75
#define             <a class="link" href="gobject-Generic-values.html#G-VALUE-TYPE-NAME--CAPS" title="G_VALUE_TYPE_NAME()">G_VALUE_TYPE_NAME</a>                   (value)
 
76
#define             <a class="link" href="gobject-Generic-values.html#G-TYPE-IS-VALUE--CAPS" title="G_TYPE_IS_VALUE()">G_TYPE_IS_VALUE</a>                     (type)
 
77
#define             <a class="link" href="gobject-Generic-values.html#G-TYPE-IS-VALUE-ABSTRACT--CAPS" title="G_TYPE_IS_VALUE_ABSTRACT()">G_TYPE_IS_VALUE_ABSTRACT</a>            (type)
 
78
#define             <a class="link" href="gobject-Generic-values.html#G-IS-VALUE--CAPS" title="G_IS_VALUE()">G_IS_VALUE</a>                          (value)
 
79
                    <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a>;
 
80
#define             <a class="link" href="gobject-Generic-values.html#G-TYPE-VALUE--CAPS" title="G_TYPE_VALUE">G_TYPE_VALUE</a>
 
81
#define             <a class="link" href="gobject-Generic-values.html#G-TYPE-VALUE-ARRAY--CAPS" title="G_TYPE_VALUE_ARRAY">G_TYPE_VALUE_ARRAY</a>
 
82
<a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a>*             <a class="link" href="gobject-Generic-values.html#g-value-init" title="g_value_init ()">g_value_init</a>                        (<a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value,
 
83
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> g_type);
 
84
void                <a class="link" href="gobject-Generic-values.html#g-value-copy" title="g_value_copy ()">g_value_copy</a>                        (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *src_value,
 
85
                                                         <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *dest_value);
 
86
<a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a>*             <a class="link" href="gobject-Generic-values.html#g-value-reset" title="g_value_reset ()">g_value_reset</a>                       (<a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value);
 
87
void                <a class="link" href="gobject-Generic-values.html#g-value-unset" title="g_value_unset ()">g_value_unset</a>                       (<a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value);
 
88
void                <a class="link" href="gobject-Generic-values.html#g-value-set-instance" title="g_value_set_instance ()">g_value_set_instance</a>                (<a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value,
87
89
                                                         <a
88
90
href="./../glib/glib/glib-Basic-Types.html#gpointer"
89
91
>gpointer</a> instance);
90
92
<a
91
93
href="./../glib/glib/glib-Basic-Types.html#gboolean"
92
 
>gboolean</a>            <a class="link" href="gobject-Generic-values.html#g-value-fits-pointer">g_value_fits_pointer</a>                (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value);
 
94
>gboolean</a>            <a class="link" href="gobject-Generic-values.html#g-value-fits-pointer" title="g_value_fits_pointer ()">g_value_fits_pointer</a>                (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value);
93
95
<a
94
96
href="./../glib/glib/glib-Basic-Types.html#gpointer"
95
 
>gpointer</a>            <a class="link" href="gobject-Generic-values.html#g-value-peek-pointer">g_value_peek_pointer</a>                (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value);
96
 
<a
97
 
href="./../glib/glib/glib-Basic-Types.html#gboolean"
98
 
>gboolean</a>            <a class="link" href="gobject-Generic-values.html#g-value-type-compatible">g_value_type_compatible</a>             (<a class="link" href="gobject-Type-Information.html#GType">GType</a> src_type,
99
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> dest_type);
100
 
<a
101
 
href="./../glib/glib/glib-Basic-Types.html#gboolean"
102
 
>gboolean</a>            <a class="link" href="gobject-Generic-values.html#g-value-type-transformable">g_value_type_transformable</a>          (<a class="link" href="gobject-Type-Information.html#GType">GType</a> src_type,
103
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> dest_type);
104
 
<a
105
 
href="./../glib/glib/glib-Basic-Types.html#gboolean"
106
 
>gboolean</a>            <a class="link" href="gobject-Generic-values.html#g-value-transform">g_value_transform</a>                   (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *src_value,
107
 
                                                         <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *dest_value);
108
 
void                (<a class="link" href="gobject-Generic-values.html#GValueTransform">*GValueTransform</a>)                  (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *src_value,
109
 
                                                         <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *dest_value);
110
 
void                <a class="link" href="gobject-Generic-values.html#g-value-register-transform-func">g_value_register_transform_func</a>     (<a class="link" href="gobject-Type-Information.html#GType">GType</a> src_type,
111
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> dest_type,
112
 
                                                         <a class="link" href="gobject-Generic-values.html#GValueTransform">GValueTransform</a> transform_func);
 
97
>gpointer</a>            <a class="link" href="gobject-Generic-values.html#g-value-peek-pointer" title="g_value_peek_pointer ()">g_value_peek_pointer</a>                (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value);
 
98
<a
 
99
href="./../glib/glib/glib-Basic-Types.html#gboolean"
 
100
>gboolean</a>            <a class="link" href="gobject-Generic-values.html#g-value-type-compatible" title="g_value_type_compatible ()">g_value_type_compatible</a>             (<a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> src_type,
 
101
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> dest_type);
 
102
<a
 
103
href="./../glib/glib/glib-Basic-Types.html#gboolean"
 
104
>gboolean</a>            <a class="link" href="gobject-Generic-values.html#g-value-type-transformable" title="g_value_type_transformable ()">g_value_type_transformable</a>          (<a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> src_type,
 
105
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> dest_type);
 
106
<a
 
107
href="./../glib/glib/glib-Basic-Types.html#gboolean"
 
108
>gboolean</a>            <a class="link" href="gobject-Generic-values.html#g-value-transform" title="g_value_transform ()">g_value_transform</a>                   (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *src_value,
 
109
                                                         <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *dest_value);
 
110
void                (<a class="link" href="gobject-Generic-values.html#GValueTransform" title="GValueTransform ()">*GValueTransform</a>)                  (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *src_value,
 
111
                                                         <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *dest_value);
 
112
void                <a class="link" href="gobject-Generic-values.html#g-value-register-transform-func" title="g_value_register_transform_func ()">g_value_register_transform_func</a>     (<a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> src_type,
 
113
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> dest_type,
 
114
                                                         <a class="link" href="gobject-Generic-values.html#GValueTransform" title="GValueTransform ()">GValueTransform</a> transform_func);
113
115
<a
114
116
href="./../glib/glib/glib-Basic-Types.html#gchar"
115
 
>gchar</a>*              <a class="link" href="gobject-Generic-values.html#g-strdup-value-contents">g_strdup_value_contents</a>             (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value);
116
 
 
 
117
>gchar</a>*              <a class="link" href="gobject-Generic-values.html#g-strdup-value-contents" title="g_strdup_value_contents ()">g_strdup_value_contents</a>             (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value);
117
118
</pre>
118
119
</div>
119
120
<div class="refsect1" lang="en">
120
 
<a name="id2887156"></a><h2>Description</h2>
 
121
<a name="gobject-Generic-values.description"></a><h2>Description</h2>
121
122
<p>
122
 
The <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure is basically a variable container that consists
 
123
The <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure is basically a variable container that consists
123
124
of a type identifier and a specific value of that type.
124
 
The type identifier within a <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure always determines the
 
125
The type identifier within a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure always determines the
125
126
type of the associated value.
126
 
To create a undefined <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure, simply create a zero-filled
127
 
<a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure. To initialize the <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a>, use the <a class="link" href="gobject-Generic-values.html#g-value-init"><code class="function">g_value_init()</code></a>
128
 
function. A <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> cannot be used until it is initialized.
 
127
To create a undefined <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure, simply create a zero-filled
 
128
<a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure. To initialize the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>, use the <a class="link" href="gobject-Generic-values.html#g-value-init" title="g_value_init ()"><code class="function">g_value_init()</code></a>
 
129
function. A <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> cannot be used until it is initialized.
129
130
The basic type operations (such as freeing and copying) are determined
130
 
by the <a class="link" href="gobject-Type-Information.html#GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with the type ID stored in the <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a>.
131
 
Other <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> operations (such as converting values between types) are
 
131
by the <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="type">GTypeValueTable</span></a> associated with the type ID stored in the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>.
 
132
Other <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> operations (such as converting values between types) are
132
133
provided by this interface.
133
134
</p>
 
135
<p>
 
136
The code in the example program below demonstrates <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>'s
 
137
features.
 
138
</p>
 
139
<p>
 
140
</p>
 
141
<div class="informalexample"><pre class="programlisting">
 
142
#include &lt;glib-object.h&gt;
 
143
 
 
144
static void
 
145
int2string (const GValue *src_value,
 
146
            GValue       *dest_value)
 
147
{
 
148
  if (g_value_get_int (src_value) == 42)
 
149
    g_value_set_static_string (dest_value, "An important number");
 
150
  else
 
151
    g_value_set_static_string (dest_value, "What's that?");
 
152
}
 
153
 
 
154
int
 
155
main (int   argc,
 
156
      char *argv[])
 
157
{
 
158
  /* GValues must start zero-filled */
 
159
  GValue a = {0};
 
160
  GValue b = {0};
 
161
  const gchar *message;
 
162
 
 
163
  g_type_init ();
 
164
 
 
165
  /* The GValue starts empty */
 
166
  g_assert (!G_VALUE_HOLDS_STRING (&amp;a));
 
167
 
 
168
  /* Put a string in it */
 
169
  g_value_init (&amp;a, G_TYPE_STRING);
 
170
  g_assert (G_VALUE_HOLDS_STRING (&amp;a));
 
171
  g_value_set_static_string (&amp;a, "Hello, world!");
 
172
  g_printf ("%s\n", g_value_get_string (&amp;a));
 
173
 
 
174
  /* Reset it to its pristine state */
 
175
  g_value_unset (&amp;a);
 
176
 
 
177
  /* It can then be reused for another type */
 
178
  g_value_init (&amp;a, G_TYPE_INT);
 
179
  g_value_set_int (&amp;a, 42);
 
180
 
 
181
  /* Attempt to transform it into a GValue of type STRING */
 
182
  g_value_init (&amp;b, G_TYPE_STRING);
 
183
 
 
184
  /* An INT is transformable to a STRING */
 
185
  g_assert (g_value_type_transformable (G_TYPE_INT, G_TYPE_STRING));
 
186
 
 
187
  g_value_transform (&amp;a, &amp;b);
 
188
  g_printf ("%s\n", g_value_get_string (&amp;b));
 
189
 
 
190
  /* Attempt to transform it again using a custom transform function */
 
191
  g_value_register_transform_func (G_TYPE_INT, G_TYPE_STRING, int2string);
 
192
  g_value_transform (&amp;a, &amp;b);
 
193
  g_printf ("%s\n", g_value_get_string (&amp;b));
 
194
  return 0;
 
195
}
 
196
</pre></div>
 
197
<p>
 
198
</p>
134
199
</div>
135
200
<div class="refsect1" lang="en">
136
 
<a name="id2887262"></a><h2>Details</h2>
 
201
<a name="gobject-Generic-values.details"></a><h2>Details</h2>
137
202
<div class="refsect2" lang="en">
138
 
<a name="id2887272"></a><h3>
139
 
<a name="G-VALUE-HOLDS:CAPS"></a>G_VALUE_HOLDS()</h3>
140
 
<a class="indexterm" name="id2887285"></a><pre class="programlisting">#define G_VALUE_HOLDS(value,type) (G_TYPE_CHECK_VALUE_TYPE ((value), (type)))
 
203
<a name="G-VALUE-HOLDS--CAPS"></a><h3>G_VALUE_HOLDS()</h3>
 
204
<pre class="programlisting">#define G_VALUE_HOLDS(value,type)   (G_TYPE_CHECK_VALUE_TYPE ((value), (type)))
141
205
</pre>
142
206
<p>
143
 
Returns <a
144
 
href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"
145
 
><code class="literal">TRUE</code></a> if <em class="parameter"><code>value</code></em> holds (or contains) a value of <em class="parameter"><code>type</code></em>.
 
207
Checks if <em class="parameter"><code>value</code></em> holds (or contains) a value of <em class="parameter"><code>type</code></em>.
146
208
This macro will also check for <em class="parameter"><code>value</code></em> != <a
147
 
href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"
 
209
href="./../glib/glib/glib-Standard-Macros.html#NULL--CAPS"
148
210
><code class="literal">NULL</code></a> and issue a
149
 
warning if the check fails.
 
211
warning if the check fails.</p>
 
212
<p>
150
213
</p>
151
214
<div class="variablelist"><table border="0">
152
215
<col align="left" valign="top">
153
216
<tbody>
154
217
<tr>
155
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
156
 
<td>A <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
 
218
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
219
<td> A <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
157
220
</td>
158
221
</tr>
159
222
<tr>
160
 
<td><p><span class="term"><em class="parameter"><code>type</code></em>&#160;:</span></p></td>
161
 
<td>A <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> value.
162
 
 
163
 
 
 
223
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
 
224
<td> A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.
164
225
</td>
165
226
</tr>
166
227
</tbody>
168
229
</div>
169
230
<hr>
170
231
<div class="refsect2" lang="en">
171
 
<a name="id2887388"></a><h3>
172
 
<a name="G-VALUE-TYPE:CAPS"></a>G_VALUE_TYPE()</h3>
173
 
<a class="indexterm" name="id2887401"></a><pre class="programlisting">#define   G_VALUE_TYPE(value)             (((GValue*) (value))-&gt;g_type)
174
 
</pre>
175
 
<p>
176
 
Returns the type identifier of <em class="parameter"><code>value</code></em>.
177
 
</p>
178
 
<div class="variablelist"><table border="0">
179
 
<col align="left" valign="top">
180
 
<tbody><tr>
181
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
182
 
<td>A <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
183
 
 
184
 
 
185
 
</td>
186
 
</tr></tbody>
187
 
</table></div>
188
 
</div>
189
 
<hr>
190
 
<div class="refsect2" lang="en">
191
 
<a name="id2887450"></a><h3>
192
 
<a name="G-VALUE-TYPE-NAME:CAPS"></a>G_VALUE_TYPE_NAME()</h3>
193
 
<a class="indexterm" name="id2887464"></a><pre class="programlisting">#define   G_VALUE_TYPE_NAME(value)        (g_type_name (G_VALUE_TYPE (value)))
194
 
</pre>
195
 
<p>
196
 
Returns the type name of <em class="parameter"><code>value</code></em>.
197
 
</p>
198
 
<div class="variablelist"><table border="0">
199
 
<col align="left" valign="top">
200
 
<tbody><tr>
201
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
202
 
<td>A <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
203
 
 
204
 
 
205
 
</td>
206
 
</tr></tbody>
207
 
</table></div>
208
 
</div>
209
 
<hr>
210
 
<div class="refsect2" lang="en">
211
 
<a name="id2887512"></a><h3>
212
 
<a name="G-TYPE-IS-VALUE:CAPS"></a>G_TYPE_IS_VALUE()</h3>
213
 
<a class="indexterm" name="id2887525"></a><pre class="programlisting">#define   G_TYPE_IS_VALUE(type)           (g_type_check_is_value_type (type))
214
 
</pre>
215
 
<p>
216
 
Return whether the passed in type ID can be used for <a class="link" href="gobject-Generic-values.html#g-value-init"><code class="function">g_value_init()</code></a>.
 
232
<a name="G-VALUE-TYPE--CAPS"></a><h3>G_VALUE_TYPE()</h3>
 
233
<pre class="programlisting">#define     G_VALUE_TYPE(value)             (((GValue*) (value))-&gt;g_type)
 
234
</pre>
 
235
<p>
 
236
Get the type identifier of <em class="parameter"><code>value</code></em>.</p>
 
237
<p>
 
238
</p>
 
239
<div class="variablelist"><table border="0">
 
240
<col align="left" valign="top">
 
241
<tbody><tr>
 
242
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
243
<td> A <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
 
244
</td>
 
245
</tr></tbody>
 
246
</table></div>
 
247
</div>
 
248
<hr>
 
249
<div class="refsect2" lang="en">
 
250
<a name="G-VALUE-TYPE-NAME--CAPS"></a><h3>G_VALUE_TYPE_NAME()</h3>
 
251
<pre class="programlisting">#define     G_VALUE_TYPE_NAME(value)        (g_type_name (G_VALUE_TYPE (value)))
 
252
</pre>
 
253
<p>
 
254
Gets the the type name of <em class="parameter"><code>value</code></em>.</p>
 
255
<p>
 
256
</p>
 
257
<div class="variablelist"><table border="0">
 
258
<col align="left" valign="top">
 
259
<tbody><tr>
 
260
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
261
<td> A <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
 
262
</td>
 
263
</tr></tbody>
 
264
</table></div>
 
265
</div>
 
266
<hr>
 
267
<div class="refsect2" lang="en">
 
268
<a name="G-TYPE-IS-VALUE--CAPS"></a><h3>G_TYPE_IS_VALUE()</h3>
 
269
<pre class="programlisting">#define     G_TYPE_IS_VALUE(type)           (g_type_check_is_value_type (type))
 
270
</pre>
 
271
<p>
 
272
Checks whether the passed in type ID can be used for <a class="link" href="gobject-Generic-values.html#g-value-init" title="g_value_init ()"><code class="function">g_value_init()</code></a>.
217
273
That is, this macro checks whether this type provides an implementation
218
 
of the <a class="link" href="gobject-Type-Information.html#GTypeValueTable"><span class="type">GTypeValueTable</span></a> functions required for a type to create a <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> of.
219
 
</p>
220
 
<div class="variablelist"><table border="0">
221
 
<col align="left" valign="top">
222
 
<tbody>
223
 
<tr>
224
 
<td><p><span class="term"><em class="parameter"><code>type</code></em>&#160;:</span></p></td>
225
 
<td>      A <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> value.
226
 
</td>
227
 
</tr>
228
 
<tr>
229
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
230
 
<td>Whether <em class="parameter"><code>type</code></em> is suitable as a <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> type.
231
 
 
232
 
 
233
 
</td>
234
 
</tr>
235
 
</tbody>
236
 
</table></div>
237
 
</div>
238
 
<hr>
239
 
<div class="refsect2" lang="en">
240
 
<a name="id2887622"></a><h3>
241
 
<a name="G-TYPE-IS-VALUE-ABSTRACT:CAPS"></a>G_TYPE_IS_VALUE_ABSTRACT()</h3>
242
 
<a class="indexterm" name="id2887635"></a><pre class="programlisting">#define G_TYPE_IS_VALUE_ABSTRACT(type)          (g_type_test_flags ((type), G_TYPE_FLAG_VALUE_ABSTRACT))
243
 
</pre>
244
 
<p>
245
 
Returns <a
246
 
href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"
247
 
><code class="literal">TRUE</code></a> if <em class="parameter"><code>type</code></em> is an abstract value type.  An abstract value type 
248
 
introduces a value table, but can't be used for <a class="link" href="gobject-Generic-values.html#g-value-init"><code class="function">g_value_init()</code></a> and is normally
249
 
used as an abstract base type for derived value types.
250
 
</p>
251
 
<div class="variablelist"><table border="0">
252
 
<col align="left" valign="top">
253
 
<tbody><tr>
254
 
<td><p><span class="term"><em class="parameter"><code>type</code></em>&#160;:</span></p></td>
255
 
<td>A <a class="link" href="gobject-Type-Information.html#GType"><span class="type">GType</span></a> value.
256
 
 
257
 
 
258
 
</td>
259
 
</tr></tbody>
260
 
</table></div>
261
 
</div>
262
 
<hr>
263
 
<div class="refsect2" lang="en">
264
 
<a name="id2887707"></a><h3>
265
 
<a name="G-IS-VALUE:CAPS"></a>G_IS_VALUE()</h3>
266
 
<a class="indexterm" name="id2887720"></a><pre class="programlisting">#define   G_IS_VALUE(value)               (G_TYPE_CHECK_VALUE (value))
267
 
</pre>
268
 
<p>
269
 
Returns <a
270
 
href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"
271
 
><code class="literal">TRUE</code></a> if <em class="parameter"><code>value</code></em> is a valid and initialized <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
272
 
</p>
273
 
<div class="variablelist"><table border="0">
274
 
<col align="left" valign="top">
275
 
<tbody><tr>
276
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
277
 
<td>A <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
278
 
 
279
 
 
280
 
</td>
281
 
</tr></tbody>
282
 
</table></div>
283
 
</div>
284
 
<hr>
285
 
<div class="refsect2" lang="en">
286
 
<a name="id2887786"></a><h3>
287
 
<a name="GValue"></a>GValue</h3>
288
 
<a class="indexterm" name="id2887798"></a><pre class="programlisting">typedef struct {
 
274
of the <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="type">GTypeValueTable</span></a> functions required for a type to create a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> of.</p>
 
275
<p>
 
276
</p>
 
277
<div class="variablelist"><table border="0">
 
278
<col align="left" valign="top">
 
279
<tbody><tr>
 
280
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
 
281
<td> A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.
 
282
</td>
 
283
</tr></tbody>
 
284
</table></div>
 
285
</div>
 
286
<hr>
 
287
<div class="refsect2" lang="en">
 
288
<a name="G-TYPE-IS-VALUE-ABSTRACT--CAPS"></a><h3>G_TYPE_IS_VALUE_ABSTRACT()</h3>
 
289
<pre class="programlisting">#define G_TYPE_IS_VALUE_ABSTRACT(type)          (g_type_test_flags ((type), G_TYPE_FLAG_VALUE_ABSTRACT))
 
290
</pre>
 
291
<p>
 
292
Checks if <em class="parameter"><code>type</code></em> is an abstract value type.  An abstract value type introduces
 
293
a value table, but can't be used for <a class="link" href="gobject-Generic-values.html#g-value-init" title="g_value_init ()"><code class="function">g_value_init()</code></a> and is normally used as
 
294
an abstract base type for derived value types.</p>
 
295
<p>
 
296
</p>
 
297
<div class="variablelist"><table border="0">
 
298
<col align="left" valign="top">
 
299
<tbody><tr>
 
300
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
 
301
<td> A <a class="link" href="gobject-Type-Information.html#GType" title="GType"><span class="type">GType</span></a> value.
 
302
</td>
 
303
</tr></tbody>
 
304
</table></div>
 
305
</div>
 
306
<hr>
 
307
<div class="refsect2" lang="en">
 
308
<a name="G-IS-VALUE--CAPS"></a><h3>G_IS_VALUE()</h3>
 
309
<pre class="programlisting">#define     G_IS_VALUE(value)               (G_TYPE_CHECK_VALUE (value))
 
310
</pre>
 
311
<p>
 
312
Checks if <em class="parameter"><code>value</code></em> is a valid and initialized <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.</p>
 
313
<p>
 
314
</p>
 
315
<div class="variablelist"><table border="0">
 
316
<col align="left" valign="top">
 
317
<tbody><tr>
 
318
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
319
<td> A <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
 
320
</td>
 
321
</tr></tbody>
 
322
</table></div>
 
323
</div>
 
324
<hr>
 
325
<div class="refsect2" lang="en">
 
326
<a name="GValue"></a><h3>GValue</h3>
 
327
<pre class="programlisting">typedef struct {
289
328
} GValue;
290
329
</pre>
291
330
<p>
292
331
An opaque structure used to hold different types of values.
293
332
The data within the structure has protected scope: it is accessible only
294
 
to functions within a <a class="link" href="gobject-Type-Information.html#GTypeValueTable"><span class="type">GTypeValueTable</span></a> structure, or implementations of
 
333
to functions within a <a class="link" href="gobject-Type-Information.html#GTypeValueTable" title="GTypeValueTable"><span class="type">GTypeValueTable</span></a> structure, or implementations of
295
334
the g_value_*() API. That is, code portions which implement new fundamental
296
335
types.
297
 
<a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> users can not make any assumptions about how data is stored
 
336
<a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> users can not make any assumptions about how data is stored
298
337
within the 2 element <em class="parameter"><code>data</code></em> union, and the <em class="parameter"><code>g_type</code></em> member should
299
 
only be accessed through the <a class="link" href="gobject-Generic-values.html#G-VALUE-TYPE:CAPS"><code class="function">G_VALUE_TYPE()</code></a> macro.
300
 
</p>
301
 
</div>
302
 
<hr>
303
 
<div class="refsect2" lang="en">
304
 
<a name="id2887859"></a><h3>
305
 
<a name="G-TYPE-VALUE:CAPS"></a>G_TYPE_VALUE</h3>
306
 
<a class="indexterm" name="id2887872"></a><pre class="programlisting">#define   G_TYPE_VALUE            (g_value_get_type ())
307
 
</pre>
308
 
<p>
309
 
Returns the type ID of the "GValue" type which is a boxed type,
310
 
used to pass around pointers to GValues.
311
 
</p>
312
 
</div>
313
 
<hr>
314
 
<div class="refsect2" lang="en">
315
 
<a name="id2887889"></a><h3>
316
 
<a name="G-TYPE-VALUE-ARRAY:CAPS"></a>G_TYPE_VALUE_ARRAY</h3>
317
 
<a class="indexterm" name="id2887903"></a><pre class="programlisting">#define   G_TYPE_VALUE_ARRAY      (g_value_array_get_type ())
318
 
</pre>
319
 
<p>
320
 
Returns the type ID of the "GValueArray" type which is a boxed type,
321
 
used to pass around pointers to GValueArrays.
322
 
</p>
323
 
</div>
324
 
<hr>
325
 
<div class="refsect2" lang="en">
326
 
<a name="id2887921"></a><h3>
327
 
<a name="g-value-init"></a>g_value_init ()</h3>
328
 
<a class="indexterm" name="id2887933"></a><pre class="programlisting"><a class="link" href="gobject-Generic-values.html#GValue">GValue</a>*             g_value_init                        (<a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value,
329
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> g_type);</pre>
330
 
<p>
331
 
Initializes <em class="parameter"><code>value</code></em> with the default value of <em class="parameter"><code>type</code></em>.
332
 
</p>
333
 
<div class="variablelist"><table border="0">
334
 
<col align="left" valign="top">
335
 
<tbody>
336
 
<tr>
337
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
338
 
<td>A zero-filled (uninitialized) <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
339
 
</td>
340
 
</tr>
341
 
<tr>
342
 
<td><p><span class="term"><em class="parameter"><code>g_type</code></em>&#160;:</span></p></td>
343
 
<td>Type the <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> should hold values of.
344
 
</td>
345
 
</tr>
346
 
<tr>
347
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
348
 
<td>the <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure that has been passed in
349
 
 
350
 
 
351
 
</td>
352
 
</tr>
353
 
</tbody>
354
 
</table></div>
355
 
</div>
356
 
<hr>
357
 
<div class="refsect2" lang="en">
358
 
<a name="id2888049"></a><h3>
359
 
<a name="g-value-copy"></a>g_value_copy ()</h3>
360
 
<a class="indexterm" name="id2888062"></a><pre class="programlisting">void                g_value_copy                        (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *src_value,
361
 
                                                         <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *dest_value);</pre>
362
 
<p>
363
 
Copies the value of <em class="parameter"><code>src_value</code></em> into <em class="parameter"><code>dest_value</code></em>.
364
 
</p>
365
 
<div class="variablelist"><table border="0">
366
 
<col align="left" valign="top">
367
 
<tbody>
368
 
<tr>
369
 
<td><p><span class="term"><em class="parameter"><code>src_value</code></em>&#160;:</span></p></td>
370
 
<td>An initialized <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
371
 
</td>
372
 
</tr>
373
 
<tr>
374
 
<td><p><span class="term"><em class="parameter"><code>dest_value</code></em>&#160;:</span></p></td>
375
 
<td>An initialized <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure of the same type as <em class="parameter"><code>src_value</code></em>.
376
 
 
377
 
 
378
 
</td>
379
 
</tr>
380
 
</tbody>
381
 
</table></div>
382
 
</div>
383
 
<hr>
384
 
<div class="refsect2" lang="en">
385
 
<a name="id2888165"></a><h3>
386
 
<a name="g-value-reset"></a>g_value_reset ()</h3>
387
 
<a class="indexterm" name="id2888178"></a><pre class="programlisting"><a class="link" href="gobject-Generic-values.html#GValue">GValue</a>*             g_value_reset                       (<a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value);</pre>
 
338
only be accessed through the <a class="link" href="gobject-Generic-values.html#G-VALUE-TYPE--CAPS" title="G_VALUE_TYPE()"><code class="function">G_VALUE_TYPE()</code></a> macro.</p>
 
339
<p>
 
340
</p>
 
341
</div>
 
342
<hr>
 
343
<div class="refsect2" lang="en">
 
344
<a name="G-TYPE-VALUE--CAPS"></a><h3>G_TYPE_VALUE</h3>
 
345
<pre class="programlisting">#define     G_TYPE_VALUE            (g_value_get_type ())
 
346
</pre>
 
347
<p>
 
348
The type ID of the "GValue" type which is a boxed type,
 
349
used to pass around pointers to GValues.</p>
 
350
<p>
 
351
</p>
 
352
</div>
 
353
<hr>
 
354
<div class="refsect2" lang="en">
 
355
<a name="G-TYPE-VALUE-ARRAY--CAPS"></a><h3>G_TYPE_VALUE_ARRAY</h3>
 
356
<pre class="programlisting">#define     G_TYPE_VALUE_ARRAY      (g_value_array_get_type ())
 
357
</pre>
 
358
<p>
 
359
The type ID of the "GValueArray" type which is a boxed type,
 
360
used to pass around pointers to GValueArrays.</p>
 
361
<p>
 
362
</p>
 
363
</div>
 
364
<hr>
 
365
<div class="refsect2" lang="en">
 
366
<a name="g-value-init"></a><h3>g_value_init ()</h3>
 
367
<pre class="programlisting"><a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a>*             g_value_init                        (<a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value,
 
368
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> g_type);</pre>
 
369
<p>
 
370
Initializes <em class="parameter"><code>value</code></em> with the default value of <em class="parameter"><code>type</code></em>.</p>
 
371
<p>
 
372
</p>
 
373
<div class="variablelist"><table border="0">
 
374
<col align="left" valign="top">
 
375
<tbody>
 
376
<tr>
 
377
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
378
<td> A zero-filled (uninitialized) <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
 
379
</td>
 
380
</tr>
 
381
<tr>
 
382
<td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
 
383
<td> Type the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> should hold values of.
 
384
</td>
 
385
</tr>
 
386
<tr>
 
387
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
388
<td> the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure that has been passed in
 
389
</td>
 
390
</tr>
 
391
</tbody>
 
392
</table></div>
 
393
</div>
 
394
<hr>
 
395
<div class="refsect2" lang="en">
 
396
<a name="g-value-copy"></a><h3>g_value_copy ()</h3>
 
397
<pre class="programlisting">void                g_value_copy                        (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *src_value,
 
398
                                                         <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *dest_value);</pre>
 
399
<p>
 
400
Copies the value of <em class="parameter"><code>src_value</code></em> into <em class="parameter"><code>dest_value</code></em>.</p>
 
401
<p>
 
402
</p>
 
403
<div class="variablelist"><table border="0">
 
404
<col align="left" valign="top">
 
405
<tbody>
 
406
<tr>
 
407
<td><p><span class="term"><em class="parameter"><code>src_value</code></em> :</span></p></td>
 
408
<td> An initialized <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
 
409
</td>
 
410
</tr>
 
411
<tr>
 
412
<td><p><span class="term"><em class="parameter"><code>dest_value</code></em> :</span></p></td>
 
413
<td> An initialized <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure of the same type as <em class="parameter"><code>src_value</code></em>.
 
414
</td>
 
415
</tr>
 
416
</tbody>
 
417
</table></div>
 
418
</div>
 
419
<hr>
 
420
<div class="refsect2" lang="en">
 
421
<a name="g-value-reset"></a><h3>g_value_reset ()</h3>
 
422
<pre class="programlisting"><a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a>*             g_value_reset                       (<a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value);</pre>
388
423
<p>
389
424
Clears the current value in <em class="parameter"><code>value</code></em> and resets it to the default value
390
 
(as if the value had just been initialized).
 
425
(as if the value had just been initialized).</p>
 
426
<p>
391
427
</p>
392
428
<div class="variablelist"><table border="0">
393
429
<col align="left" valign="top">
394
430
<tbody>
395
431
<tr>
396
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
397
 
<td>An initialized <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
 
432
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
433
<td> An initialized <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
398
434
</td>
399
435
</tr>
400
436
<tr>
401
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
402
 
<td>the <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure that has been passed in
403
 
 
404
 
 
 
437
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
438
<td> the <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure that has been passed in
405
439
</td>
406
440
</tr>
407
441
</tbody>
409
443
</div>
410
444
<hr>
411
445
<div class="refsect2" lang="en">
412
 
<a name="id2888260"></a><h3>
413
 
<a name="g-value-unset"></a>g_value_unset ()</h3>
414
 
<a class="indexterm" name="id2888272"></a><pre class="programlisting">void                g_value_unset                       (<a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value);</pre>
 
446
<a name="g-value-unset"></a><h3>g_value_unset ()</h3>
 
447
<pre class="programlisting">void                g_value_unset                       (<a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value);</pre>
415
448
<p>
416
449
Clears the current value in <em class="parameter"><code>value</code></em> and "unsets" the type,
417
450
this releases all resources associated with this GValue.
418
451
An unset value is the same as an uninitialized (zero-filled)
419
 
<a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
 
452
<a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.</p>
 
453
<p>
420
454
</p>
421
455
<div class="variablelist"><table border="0">
422
456
<col align="left" valign="top">
423
457
<tbody><tr>
424
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
425
 
<td>    An initialized <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
426
 
 
427
 
 
 
458
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
459
<td> An initialized <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
428
460
</td>
429
461
</tr></tbody>
430
462
</table></div>
431
463
</div>
432
464
<hr>
433
465
<div class="refsect2" lang="en">
434
 
<a name="id2888344"></a><h3>
435
 
<a name="g-value-set-instance"></a>g_value_set_instance ()</h3>
436
 
<a class="indexterm" name="id2888358"></a><pre class="programlisting">void                g_value_set_instance                (<a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value,
 
466
<a name="g-value-set-instance"></a><h3>g_value_set_instance ()</h3>
 
467
<pre class="programlisting">void                g_value_set_instance                (<a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value,
437
468
                                                         <a
438
469
href="./../glib/glib/glib-Basic-Types.html#gpointer"
439
470
>gpointer</a> instance);</pre>
440
471
<p>
441
 
Sets <em class="parameter"><code>value</code></em> from an instantiatable type via the 
442
 
value_table's <code class="function">collect_value()</code> function.
 
472
Sets <em class="parameter"><code>value</code></em> from an instantiatable type via the
 
473
value_table's <code class="function">collect_value()</code> function.</p>
 
474
<p>
443
475
</p>
444
476
<div class="variablelist"><table border="0">
445
477
<col align="left" valign="top">
446
478
<tbody>
447
479
<tr>
448
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
449
 
<td>An initialized <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
 
480
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
481
<td> An initialized <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
450
482
</td>
451
483
</tr>
452
484
<tr>
453
 
<td><p><span class="term"><em class="parameter"><code>instance</code></em>&#160;:</span></p></td>
454
 
<td>the instance
455
 
 
456
 
 
 
485
<td><p><span class="term"><em class="parameter"><code>instance</code></em> :</span></p></td>
 
486
<td> the instance
457
487
</td>
458
488
</tr>
459
489
</tbody>
461
491
</div>
462
492
<hr>
463
493
<div class="refsect2" lang="en">
464
 
<a name="id2888452"></a><h3>
465
 
<a name="g-value-fits-pointer"></a>g_value_fits_pointer ()</h3>
466
 
<a class="indexterm" name="id2888465"></a><pre class="programlisting"><a
 
494
<a name="g-value-fits-pointer"></a><h3>g_value_fits_pointer ()</h3>
 
495
<pre class="programlisting"><a
467
496
href="./../glib/glib/glib-Basic-Types.html#gboolean"
468
 
>gboolean</a>            g_value_fits_pointer                (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value);</pre>
 
497
>gboolean</a>            g_value_fits_pointer                (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value);</pre>
469
498
<p>
470
499
Determines if <em class="parameter"><code>value</code></em> will fit inside the size of a pointer value.
471
 
This is an internal function introduced mainly for C marshallers.
 
500
This is an internal function introduced mainly for C marshallers.</p>
 
501
<p>
472
502
</p>
473
503
<div class="variablelist"><table border="0">
474
504
<col align="left" valign="top">
475
505
<tbody>
476
506
<tr>
477
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
478
 
<td>An initialized <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
 
507
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
508
<td> An initialized <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
479
509
</td>
480
510
</tr>
481
511
<tr>
482
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
483
 
<td>
484
 
<a
485
 
href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"
 
512
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
513
<td> <a
 
514
href="./../glib/glib/glib-Standard-Macros.html#TRUE--CAPS"
486
515
><code class="literal">TRUE</code></a> if <em class="parameter"><code>value</code></em> will fit inside a pointer value.
487
 
 
488
 
 
489
516
</td>
490
517
</tr>
491
518
</tbody>
493
520
</div>
494
521
<hr>
495
522
<div class="refsect2" lang="en">
496
 
<a name="id2888553"></a><h3>
497
 
<a name="g-value-peek-pointer"></a>g_value_peek_pointer ()</h3>
498
 
<a class="indexterm" name="id2888567"></a><pre class="programlisting"><a
 
523
<a name="g-value-peek-pointer"></a><h3>g_value_peek_pointer ()</h3>
 
524
<pre class="programlisting"><a
499
525
href="./../glib/glib/glib-Basic-Types.html#gpointer"
500
 
>gpointer</a>            g_value_peek_pointer                (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value);</pre>
 
526
>gpointer</a>            g_value_peek_pointer                (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value);</pre>
501
527
<p>
502
528
Return the value contents as pointer. This function asserts that
503
 
<a class="link" href="gobject-Generic-values.html#g-value-fits-pointer"><code class="function">g_value_fits_pointer()</code></a> returned <a
504
 
href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"
 
529
<a class="link" href="gobject-Generic-values.html#g-value-fits-pointer" title="g_value_fits_pointer ()"><code class="function">g_value_fits_pointer()</code></a> returned <a
 
530
href="./../glib/glib/glib-Standard-Macros.html#TRUE--CAPS"
505
531
><code class="literal">TRUE</code></a> for the passed in value.
506
 
This is an internal function introduced mainly for C marshallers.
 
532
This is an internal function introduced mainly for C marshallers.</p>
 
533
<p>
507
534
</p>
508
535
<div class="variablelist"><table border="0">
509
536
<col align="left" valign="top">
510
537
<tbody>
511
538
<tr>
512
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
513
 
<td>An initialized <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> structure.
 
539
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
540
<td> An initialized <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> structure.
514
541
</td>
515
542
</tr>
516
543
<tr>
517
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
518
 
<td>
519
 
<a
520
 
href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"
 
544
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
545
<td> <a
 
546
href="./../glib/glib/glib-Standard-Macros.html#TRUE--CAPS"
521
547
><code class="literal">TRUE</code></a> if <em class="parameter"><code>value</code></em> will fit inside a pointer value.
522
 
 
523
 
 
524
 
</td>
525
 
</tr>
526
 
</tbody>
527
 
</table></div>
528
 
</div>
529
 
<hr>
530
 
<div class="refsect2" lang="en">
531
 
<a name="id2888671"></a><h3>
532
 
<a name="g-value-type-compatible"></a>g_value_type_compatible ()</h3>
533
 
<a class="indexterm" name="id2888684"></a><pre class="programlisting"><a
534
 
href="./../glib/glib/glib-Basic-Types.html#gboolean"
535
 
>gboolean</a>            g_value_type_compatible             (<a class="link" href="gobject-Type-Information.html#GType">GType</a> src_type,
536
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> dest_type);</pre>
537
 
<p>
538
 
Returns whether a <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> of type <em class="parameter"><code>src_type</code></em> can be copied into
539
 
a <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> of type <em class="parameter"><code>dest_type</code></em>.
540
 
</p>
541
 
<div class="variablelist"><table border="0">
542
 
<col align="left" valign="top">
543
 
<tbody>
544
 
<tr>
545
 
<td><p><span class="term"><em class="parameter"><code>src_type</code></em>&#160;:</span></p></td>
546
 
<td>source type to be copied.
547
 
</td>
548
 
</tr>
549
 
<tr>
550
 
<td><p><span class="term"><em class="parameter"><code>dest_type</code></em>&#160;:</span></p></td>
551
 
<td>destination type for copying.
552
 
</td>
553
 
</tr>
554
 
<tr>
555
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
556
 
<td>
557
 
<a
558
 
href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"
559
 
><code class="literal">TRUE</code></a> if <a class="link" href="gobject-Generic-values.html#g-value-copy"><code class="function">g_value_copy()</code></a> is possible with <em class="parameter"><code>src_type</code></em> and <em class="parameter"><code>dest_type</code></em>.
560
 
 
561
 
 
562
 
</td>
563
 
</tr>
564
 
</tbody>
565
 
</table></div>
566
 
</div>
567
 
<hr>
568
 
<div class="refsect2" lang="en">
569
 
<a name="id2888824"></a><h3>
570
 
<a name="g-value-type-transformable"></a>g_value_type_transformable ()</h3>
571
 
<a class="indexterm" name="id2888838"></a><pre class="programlisting"><a
572
 
href="./../glib/glib/glib-Basic-Types.html#gboolean"
573
 
>gboolean</a>            g_value_type_transformable          (<a class="link" href="gobject-Type-Information.html#GType">GType</a> src_type,
574
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> dest_type);</pre>
575
 
<p>
576
 
Check whether <a class="link" href="gobject-Generic-values.html#g-value-transform"><code class="function">g_value_transform()</code></a> is able to transform values
577
 
of type <em class="parameter"><code>src_type</code></em> into values of type <em class="parameter"><code>dest_type</code></em>.
578
 
</p>
579
 
<div class="variablelist"><table border="0">
580
 
<col align="left" valign="top">
581
 
<tbody>
582
 
<tr>
583
 
<td><p><span class="term"><em class="parameter"><code>src_type</code></em>&#160;:</span></p></td>
584
 
<td>Source type.
585
 
</td>
586
 
</tr>
587
 
<tr>
588
 
<td><p><span class="term"><em class="parameter"><code>dest_type</code></em>&#160;:</span></p></td>
589
 
<td>Target type.
590
 
</td>
591
 
</tr>
592
 
<tr>
593
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
594
 
<td>
595
 
<a
596
 
href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"
 
548
</td>
 
549
</tr>
 
550
</tbody>
 
551
</table></div>
 
552
</div>
 
553
<hr>
 
554
<div class="refsect2" lang="en">
 
555
<a name="g-value-type-compatible"></a><h3>g_value_type_compatible ()</h3>
 
556
<pre class="programlisting"><a
 
557
href="./../glib/glib/glib-Basic-Types.html#gboolean"
 
558
>gboolean</a>            g_value_type_compatible             (<a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> src_type,
 
559
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> dest_type);</pre>
 
560
<p>
 
561
Returns whether a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> of type <em class="parameter"><code>src_type</code></em> can be copied into
 
562
a <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> of type <em class="parameter"><code>dest_type</code></em>.</p>
 
563
<p>
 
564
</p>
 
565
<div class="variablelist"><table border="0">
 
566
<col align="left" valign="top">
 
567
<tbody>
 
568
<tr>
 
569
<td><p><span class="term"><em class="parameter"><code>src_type</code></em> :</span></p></td>
 
570
<td> source type to be copied.
 
571
</td>
 
572
</tr>
 
573
<tr>
 
574
<td><p><span class="term"><em class="parameter"><code>dest_type</code></em> :</span></p></td>
 
575
<td> destination type for copying.
 
576
</td>
 
577
</tr>
 
578
<tr>
 
579
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
580
<td> <a
 
581
href="./../glib/glib/glib-Standard-Macros.html#TRUE--CAPS"
 
582
><code class="literal">TRUE</code></a> if <a class="link" href="gobject-Generic-values.html#g-value-copy" title="g_value_copy ()"><code class="function">g_value_copy()</code></a> is possible with <em class="parameter"><code>src_type</code></em> and <em class="parameter"><code>dest_type</code></em>.
 
583
</td>
 
584
</tr>
 
585
</tbody>
 
586
</table></div>
 
587
</div>
 
588
<hr>
 
589
<div class="refsect2" lang="en">
 
590
<a name="g-value-type-transformable"></a><h3>g_value_type_transformable ()</h3>
 
591
<pre class="programlisting"><a
 
592
href="./../glib/glib/glib-Basic-Types.html#gboolean"
 
593
>gboolean</a>            g_value_type_transformable          (<a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> src_type,
 
594
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> dest_type);</pre>
 
595
<p>
 
596
Check whether <a class="link" href="gobject-Generic-values.html#g-value-transform" title="g_value_transform ()"><code class="function">g_value_transform()</code></a> is able to transform values
 
597
of type <em class="parameter"><code>src_type</code></em> into values of type <em class="parameter"><code>dest_type</code></em>.</p>
 
598
<p>
 
599
</p>
 
600
<div class="variablelist"><table border="0">
 
601
<col align="left" valign="top">
 
602
<tbody>
 
603
<tr>
 
604
<td><p><span class="term"><em class="parameter"><code>src_type</code></em> :</span></p></td>
 
605
<td> Source type.
 
606
</td>
 
607
</tr>
 
608
<tr>
 
609
<td><p><span class="term"><em class="parameter"><code>dest_type</code></em> :</span></p></td>
 
610
<td> Target type.
 
611
</td>
 
612
</tr>
 
613
<tr>
 
614
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
615
<td> <a
 
616
href="./../glib/glib/glib-Standard-Macros.html#TRUE--CAPS"
597
617
><code class="literal">TRUE</code></a> if the transformation is possible, <a
598
 
href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"
 
618
href="./../glib/glib/glib-Standard-Macros.html#FALSE--CAPS"
599
619
><code class="literal">FALSE</code></a> otherwise.
600
 
 
601
 
 
602
620
</td>
603
621
</tr>
604
622
</tbody>
606
624
</div>
607
625
<hr>
608
626
<div class="refsect2" lang="en">
609
 
<a name="id2888960"></a><h3>
610
 
<a name="g-value-transform"></a>g_value_transform ()</h3>
611
 
<a class="indexterm" name="id2888973"></a><pre class="programlisting"><a
 
627
<a name="g-value-transform"></a><h3>g_value_transform ()</h3>
 
628
<pre class="programlisting"><a
612
629
href="./../glib/glib/glib-Basic-Types.html#gboolean"
613
 
>gboolean</a>            g_value_transform                   (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *src_value,
614
 
                                                         <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *dest_value);</pre>
 
630
>gboolean</a>            g_value_transform                   (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *src_value,
 
631
                                                         <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *dest_value);</pre>
615
632
<p>
616
633
Tries to cast the contents of <em class="parameter"><code>src_value</code></em> into a type appropriate
617
 
to store in <em class="parameter"><code>dest_value</code></em>, e.g. to transform a <a class="link" href="gobject-Type-Information.html#G-TYPE-INT:CAPS"><code class="literal">G_TYPE_INT</code></a> value
618
 
into a <a class="link" href="gobject-Type-Information.html#G-TYPE-FLOAT:CAPS"><code class="literal">G_TYPE_FLOAT</code></a> value. Performing transformations between
 
634
to store in <em class="parameter"><code>dest_value</code></em>, e.g. to transform a <a class="link" href="gobject-Type-Information.html#G-TYPE-INT--CAPS" title="G_TYPE_INT"><code class="literal">G_TYPE_INT</code></a> value
 
635
into a <a class="link" href="gobject-Type-Information.html#G-TYPE-FLOAT--CAPS" title="G_TYPE_FLOAT"><code class="literal">G_TYPE_FLOAT</code></a> value. Performing transformations between
619
636
value types might incur precision lossage. Especially
620
637
transformations into strings might reveal seemingly arbitrary
621
638
results and shouldn't be relied upon for production code (such
622
 
as rcfile value or object property serialization).
 
639
as rcfile value or object property serialization).</p>
 
640
<p>
623
641
</p>
624
642
<div class="variablelist"><table border="0">
625
643
<col align="left" valign="top">
626
644
<tbody>
627
645
<tr>
628
 
<td><p><span class="term"><em class="parameter"><code>src_value</code></em>&#160;:</span></p></td>
629
 
<td>Source value.
630
 
</td>
631
 
</tr>
632
 
<tr>
633
 
<td><p><span class="term"><em class="parameter"><code>dest_value</code></em>&#160;:</span></p></td>
634
 
<td>Target value.
635
 
</td>
636
 
</tr>
637
 
<tr>
638
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
639
 
<td>Whether a transformation rule was found and could be applied.
640
 
          Upon failing transformations, <em class="parameter"><code>dest_value</code></em> is left untouched.
641
 
 
642
 
 
 
646
<td><p><span class="term"><em class="parameter"><code>src_value</code></em> :</span></p></td>
 
647
<td> Source value.
 
648
</td>
 
649
</tr>
 
650
<tr>
 
651
<td><p><span class="term"><em class="parameter"><code>dest_value</code></em> :</span></p></td>
 
652
<td> Target value.
 
653
</td>
 
654
</tr>
 
655
<tr>
 
656
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
657
<td> Whether a transformation rule was found and could be applied.
 
658
 Upon failing transformations, <em class="parameter"><code>dest_value</code></em> is left untouched.
643
659
</td>
644
660
</tr>
645
661
</tbody>
647
663
</div>
648
664
<hr>
649
665
<div class="refsect2" lang="en">
650
 
<a name="id2889099"></a><h3>
651
 
<a name="GValueTransform"></a>GValueTransform ()</h3>
652
 
<a class="indexterm" name="id2889112"></a><pre class="programlisting">void                (*GValueTransform)                  (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *src_value,
653
 
                                                         <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *dest_value);</pre>
 
666
<a name="GValueTransform"></a><h3>GValueTransform ()</h3>
 
667
<pre class="programlisting">void                (*GValueTransform)                  (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *src_value,
 
668
                                                         <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *dest_value);</pre>
654
669
<p>
655
670
The type of value transformation functions which can be registered with
656
 
<a class="link" href="gobject-Generic-values.html#g-value-register-transform-func"><code class="function">g_value_register_transform_func()</code></a>.
 
671
<a class="link" href="gobject-Generic-values.html#g-value-register-transform-func" title="g_value_register_transform_func ()"><code class="function">g_value_register_transform_func()</code></a>.</p>
 
672
<p>
657
673
</p>
658
674
<div class="variablelist"><table border="0">
659
675
<col align="left" valign="top">
660
676
<tbody>
661
677
<tr>
662
 
<td><p><span class="term"><em class="parameter"><code>src_value</code></em>&#160;:</span></p></td>
 
678
<td><p><span class="term"><em class="parameter"><code>src_value</code></em> :</span></p></td>
663
679
<td> Source value.
664
680
</td>
665
681
</tr>
666
682
<tr>
667
 
<td><p><span class="term"><em class="parameter"><code>dest_value</code></em>&#160;:</span></p></td>
668
 
<td>Target value.
669
 
 
670
 
 
 
683
<td><p><span class="term"><em class="parameter"><code>dest_value</code></em> :</span></p></td>
 
684
<td> Target value.
671
685
</td>
672
686
</tr>
673
687
</tbody>
675
689
</div>
676
690
<hr>
677
691
<div class="refsect2" lang="en">
678
 
<a name="id2889193"></a><h3>
679
 
<a name="g-value-register-transform-func"></a>g_value_register_transform_func ()</h3>
680
 
<a class="indexterm" name="id2889206"></a><pre class="programlisting">void                g_value_register_transform_func     (<a class="link" href="gobject-Type-Information.html#GType">GType</a> src_type,
681
 
                                                         <a class="link" href="gobject-Type-Information.html#GType">GType</a> dest_type,
682
 
                                                         <a class="link" href="gobject-Generic-values.html#GValueTransform">GValueTransform</a> transform_func);</pre>
 
692
<a name="g-value-register-transform-func"></a><h3>g_value_register_transform_func ()</h3>
 
693
<pre class="programlisting">void                g_value_register_transform_func     (<a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> src_type,
 
694
                                                         <a class="link" href="gobject-Type-Information.html#GType" title="GType">GType</a> dest_type,
 
695
                                                         <a class="link" href="gobject-Generic-values.html#GValueTransform" title="GValueTransform ()">GValueTransform</a> transform_func);</pre>
683
696
<p>
684
 
Registers a value transformation function for use in <a class="link" href="gobject-Generic-values.html#g-value-transform"><code class="function">g_value_transform()</code></a>.
 
697
Registers a value transformation function for use in <a class="link" href="gobject-Generic-values.html#g-value-transform" title="g_value_transform ()"><code class="function">g_value_transform()</code></a>.
685
698
A previously registered transformation function for <em class="parameter"><code>src_type</code></em> and <em class="parameter"><code>dest_type</code></em>
686
 
will be replaced.
 
699
will be replaced.</p>
 
700
<p>
687
701
</p>
688
702
<div class="variablelist"><table border="0">
689
703
<col align="left" valign="top">
690
704
<tbody>
691
705
<tr>
692
 
<td><p><span class="term"><em class="parameter"><code>src_type</code></em>&#160;:</span></p></td>
 
706
<td><p><span class="term"><em class="parameter"><code>src_type</code></em> :</span></p></td>
693
707
<td> Source type.
694
708
</td>
695
709
</tr>
696
710
<tr>
697
 
<td><p><span class="term"><em class="parameter"><code>dest_type</code></em>&#160;:</span></p></td>
698
 
<td>Target type.
 
711
<td><p><span class="term"><em class="parameter"><code>dest_type</code></em> :</span></p></td>
 
712
<td> Target type.
699
713
</td>
700
714
</tr>
701
715
<tr>
702
 
<td><p><span class="term"><em class="parameter"><code>transform_func</code></em>&#160;:</span></p></td>
703
 
<td>a function which transforms values of type <em class="parameter"><code>src_type</code></em>
704
 
  into value of type <em class="parameter"><code>dest_type</code></em>
705
 
 
706
 
 
 
716
<td><p><span class="term"><em class="parameter"><code>transform_func</code></em> :</span></p></td>
 
717
<td> a function which transforms values of type <em class="parameter"><code>src_type</code></em>
 
718
 into value of type <em class="parameter"><code>dest_type</code></em>
707
719
</td>
708
720
</tr>
709
721
</tbody>
711
723
</div>
712
724
<hr>
713
725
<div class="refsect2" lang="en">
714
 
<a name="id2889334"></a><h3>
715
 
<a name="g-strdup-value-contents"></a>g_strdup_value_contents ()</h3>
716
 
<a class="indexterm" name="id2889347"></a><pre class="programlisting"><a
 
726
<a name="g-strdup-value-contents"></a><h3>g_strdup_value_contents ()</h3>
 
727
<pre class="programlisting"><a
717
728
href="./../glib/glib/glib-Basic-Types.html#gchar"
718
 
>gchar</a>*              g_strdup_value_contents             (const <a class="link" href="gobject-Generic-values.html#GValue">GValue</a> *value);</pre>
719
 
<p>
720
 
Return a newly allocated string, which describes the contents of a <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a>.
721
 
The main purpose of this function is to describe <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> contents for 
722
 
debugging output, the way in which the contents are described may change 
723
 
between different GLib versions.
 
729
>gchar</a>*              g_strdup_value_contents             (const <a class="link" href="gobject-Generic-values.html#GValue" title="GValue">GValue</a> *value);</pre>
 
730
<p>
 
731
Return a newly allocated string, which describes the contents of a
 
732
<a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>.  The main purpose of this function is to describe <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>
 
733
contents for debugging output, the way in which the contents are
 
734
described may change between different GLib versions.</p>
 
735
<p>
724
736
</p>
725
737
<div class="variablelist"><table border="0">
726
738
<col align="left" valign="top">
727
739
<tbody>
728
740
<tr>
729
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
730
 
<td>  <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> which contents are to be described.
 
741
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
 
742
<td> <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a> which contents are to be described.
731
743
</td>
732
744
</tr>
733
745
<tr>
734
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
735
 
<td>Newly allocated string.
736
 
 
737
 
 
 
746
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
747
<td> Newly allocated string.
738
748
</td>
739
749
</tr>
740
750
</tbody>
742
752
</div>
743
753
</div>
744
754
<div class="refsect1" lang="en">
745
 
<a name="id2889434"></a><h2>See Also</h2>
746
 
<p>
747
 
The fundamental types which all support <a class="link" href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> operations and thus
748
 
can be used as a type initializer for <a class="link" href="gobject-Generic-values.html#g-value-init"><code class="function">g_value_init()</code></a> are defined by
749
 
a separate interface.  See the <a class="link" href="gobject-Standard-Parameter-and-Value-Types.html" title="Parameters and Values">Standard Values 
750
 
API</a> for details.
751
 
</p>
752
 
</div>
753
 
<div class="refsect1" lang="en">
754
 
<a name="id2889475"></a><div class="refsect2" lang="en"><a name="id2889476"></a></div>
 
755
<a name="gobject-Generic-values.see-also"></a><h2>See Also</h2>
 
756
The fundamental types which all support <a class="link" href="gobject-Generic-values.html#GValue" title="GValue"><span class="type">GValue</span></a>
 
757
    operations and thus can be used as a type initializer for
 
758
    <a class="link" href="gobject-Generic-values.html#g-value-init" title="g_value_init ()"><code class="function">g_value_init()</code></a> are defined by a separate interface.  See the <a class="link" href="gobject-Standard-Parameter-and-Value-Types.html" title="Parameters and Values">Standard
 
759
    Values API</a> for details.
 
760
</div>
 
761
</div>
 
762
<div class="footer">
755
763
<hr>
756
 
<div class="refsect2" lang="en"><a name="id2889477"></a></div>
757
 
</div>
758
 
</div>
 
764
          Generated by GTK-Doc V1.11</div>
759
765
</body>
760
766
</html>