3 * Copyright (C) 2006-2010 Jürg Billeter
4 * Copyright (C) 2006-2008 Raffaele Sandrini
5 * Copyright (C) 2007 Mathias Hasselmann
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 * Jürg Billeter <j@bitron.ch>
23 * Raffaele Sandrini <rasa@gmx.ch>
24 * Mathias Hasselmann <mathias.hasselmann@gmx.de>
27 [CCode (cheader_filename = "glib.h", cprefix = "G", gir_namespace = "GObject", gir_version = "2.0", lower_case_cprefix = "g_")]
29 namespace SignalHandler {
30 public static void block (void* instance, ulong handler_id);
31 [CCode (cname = "g_signal_handlers_block_by_func")]
32 public static uint block_by_func (void* instance, void* func, void* data);
33 [CCode (cname = "g_signal_handlers_block_matched")]
34 public static uint block_matched (void* instance, GLib.SignalMatchType mask, uint signal_id, GLib.Quark detail, GLib.Closure? closure, void* func, void* data);
35 public static void disconnect (void* instance, ulong handler_id);
36 [CCode (cname = "g_signal_handlers_disconnect_by_func")]
37 public static uint disconnect_by_func (void* instance, void* func, void* data);
38 [CCode (cname = "g_signal_handlers_disconnect_matched")]
39 public static uint disconnect_matched (void* instance, GLib.SignalMatchType mask, uint signal_id, GLib.Quark detail, GLib.Closure? closure, void* func, void* data);
40 public static ulong find (void* instance, GLib.SignalMatchType mask, uint signal_id, GLib.Quark detail, GLib.Closure? closure, void* func, void* data);
41 public static bool is_connected (void* instance, ulong handler_id);
42 public static void unblock (void* instance, ulong handler_id);
43 [CCode (cname = "g_signal_handlers_unblock_by_func")]
44 public static uint unblock_by_func (void* instance, void* func, void* data);
45 [CCode (cname = "g_signal_handlers_unblock_matched")]
46 public static uint unblock_matched (void* instance, GLib.SignalMatchType mask, uint signal_id, GLib.Quark detail, GLib.Closure? closure, void* func, void* data);
48 [CCode (type_id = "G_TYPE_BINDING")]
49 [Version (since = "2.26")]
50 public class Binding : GLib.Object {
51 public GLib.BindingFlags get_flags ();
52 public unowned GLib.Object get_source ();
53 public unowned string get_source_property ();
54 public unowned GLib.Object get_target ();
55 public unowned string get_target_property ();
57 [Version (since = "2.38")]
58 public void unbind ();
59 public GLib.BindingFlags flags { get; construct; }
60 public GLib.Object source { get; construct; }
61 public string source_property { get; construct; }
62 public GLib.Object target { get; construct; }
63 public string target_property { get; construct; }
65 [CCode (ref_function = "g_closure_ref", type_id = "G_TYPE_CLOSURE", unref_function = "g_closure_unref")]
67 public class Closure {
68 [CCode (cname = "sizeof(GClosure)")]
69 public static size_t SIZE;
70 [CCode (cname = "g_closure_new_object")]
71 public Closure (ulong sizeof_closure, GLib.Object object);
72 public void add_finalize_notifier (void* notify_data, GLib.ClosureNotify notify_func);
73 public void add_invalidate_notifier (void* notify_data, GLib.ClosureNotify notify_func);
74 public void add_marshal_guards (void* pre_marshal_data, GLib.ClosureNotify pre_marshal_notify, void* post_marshal_data, GLib.ClosureNotify post_marshal_notify);
75 public void invalidate ();
76 public void invoke (out GLib.Value return_value, [CCode (array_length_cname = "n_param_values", array_length_pos = 1.5, array_length_type = "guint")] GLib.Value[] param_values, void* invocation_hint);
77 [CCode (has_construct_function = false)]
78 public Closure.object (uint sizeof_closure, GLib.Object object);
79 public unowned GLib.Closure @ref ();
80 public void remove_finalize_notifier (void* notify_data, GLib.ClosureNotify notify_func);
81 public void remove_invalidate_notifier (void* notify_data, GLib.ClosureNotify notify_func);
82 public void set_marshal (GLib.ClosureMarshal marshal);
83 public void set_meta_marshal (void* marshal_data, GLib.ClosureMarshal meta_marshal);
84 [CCode (has_construct_function = false)]
85 public Closure.simple (uint sizeof_closure, void* data);
89 [CCode (lower_case_csuffix = "enum")]
90 public class EnumClass : GLib.TypeClass {
94 [CCode (array_length_cname = "n_values")]
95 public weak GLib.EnumValue[] values;
96 public unowned GLib.EnumValue? get_value (int value);
97 public unowned GLib.EnumValue? get_value_by_name (string name);
98 public unowned GLib.EnumValue? get_value_by_nick (string name);
100 [CCode (lower_case_csuffix = "flags")]
101 public class FlagsClass : GLib.TypeClass {
103 public uint n_values;
104 [CCode (array_length_cname = "n_values")]
105 public weak GLib.FlagsValue[] values;
106 public unowned GLib.FlagsValue? get_first_value (uint value);
107 public unowned GLib.FlagsValue? get_value_by_name (string name);
108 public unowned GLib.FlagsValue? get_value_by_nick (string name);
110 [CCode (ref_sink_function = "g_object_ref_sink", type_id = "G_TYPE_INITIALLY_UNOWNED")]
111 public class InitiallyUnowned : GLib.Object {
112 [CCode (has_construct_function = false)]
113 protected InitiallyUnowned ();
115 [CCode (cheader_filename = "glib-object.h", get_value_function = "g_value_get_object", marshaller_type_name = "OBJECT", param_spec_function = "g_param_spec_object", ref_function = "g_object_ref", set_value_function = "g_value_set_object", take_value_function = "g_value_take_object", unref_function = "g_object_unref")]
116 public class Object {
117 public uint ref_count;
118 [CCode (construct_function = "g_object_new", has_new_function = false)]
120 public void add_toggle_ref (GLib.ToggleNotify notify);
121 public void add_weak_pointer (void** data);
122 [CCode (cname = "g_object_bind_property_with_closures")]
123 [Version (since = "2.26")]
124 public unowned GLib.Binding bind_property (string source_property, GLib.Object target, string target_property, GLib.BindingFlags flags = GLib.BindingFlags.DEFAULT, [CCode (type = "GClosure*")] owned GLib.BindingTransformFunc? transform_to = null, [CCode (type = "GClosure*")] owned GLib.BindingTransformFunc? transform_from = null);
125 public unowned GLib.Object connect (string signal_spec, ...);
127 public virtual void constructed ();
128 [CCode (cname = "g_signal_handler_disconnect")]
129 public void disconnect (ulong handler_id);
130 [CCode (cname = "g_object_run_dispose")]
131 public virtual void dispose ();
132 [CCode (simple_generics = true)]
133 [Version (since = "2.34")]
134 public T dup_data<T> (string key, GLib.DuplicateFunc<T> dup_func);
135 [CCode (simple_generics = true)]
136 [Version (since = "2.34")]
137 public T dup_qdata<T> (GLib.Quark quark, GLib.DuplicateFunc<T> dup_func);
138 public void force_floating ();
139 public void freeze_notify ();
140 public void @get (string first_property_name, ...);
141 [CCode (cname = "G_OBJECT_GET_CLASS")]
142 public unowned GLib.ObjectClass get_class ();
143 [CCode (simple_generics = true)]
144 public unowned T get_data<T> (string key);
145 public void get_property (string property_name, ref GLib.Value value);
146 [CCode (simple_generics = true)]
147 public unowned T get_qdata<T> (GLib.Quark quark);
148 [CCode (cname = "G_TYPE_FROM_INSTANCE")]
149 public GLib.Type get_type ();
150 [Version (since = "2.54")]
151 public void getv ([CCode (array_length_cname = "n_properties", array_length_pos = 0.5, array_length_type = "guint")] string[] names, [CCode (array_length_cname = "n_properties", array_length_pos = 0.5, array_length_type = "guint")] GLib.Value[] values);
152 public static unowned GLib.ParamSpec? interface_find_property (GLib.TypeInterface g_iface, string property_name);
153 public static void interface_install_property (GLib.TypeInterface g_iface, GLib.ParamSpec pspec);
154 [CCode (array_length_pos = 1.1, array_length_type = "guint")]
156 public static (unowned GLib.ParamSpec)[] interface_list_properties (GLib.TypeInterface g_iface);
158 public static unowned GLib.ParamSpec[] interface_list_properties (GLib.TypeInterface g_iface);
160 public bool is_floating ();
161 public static GLib.Object @new (GLib.Type type, ...);
162 public static GLib.Object new_valist (GLib.Type type, string? firstprop, va_list var_args);
163 [Version (deprecated = true, deprecated_since = "2.54")]
164 public static GLib.Object newv (GLib.Type type, [CCode (array_length_pos = 1.9, array_length_type = "guint")] GLib.Parameter[] parameters);
165 [Version (since = "2.54")]
166 public static GLib.Object new_with_properties (GLib.Type object_type, [CCode (array_length_cname = "n_properties", array_length_pos = 1.5, array_length_type = "guint")] string[] names, [CCode (array_length_cname = "n_properties", array_length_pos = 1.5, array_length_type = "guint")] GLib.Value[] values);
168 [CCode (cname = "g_object_notify")]
169 public void notify_property (string property_name);
170 public unowned GLib.Object @ref ();
171 public unowned GLib.Object ref_sink ();
172 [CCode (simple_generics = true)]
173 [Version (since = "2.34")]
174 public bool replace_data<G,T> (string key, G oldval, owned T newval, out GLib.DestroyNotify? old_destroy);
175 [CCode (simple_generics = true)]
176 [Version (since = "2.34")]
177 public bool replace_qdata<G,T> (GLib.Quark quark, G oldval, owned T newval, out GLib.DestroyNotify? old_destroy);
178 public void remove_toggle_ref (GLib.ToggleNotify notify);
179 public void remove_weak_pointer (void** data);
180 public void @set (string first_property_name, ...);
181 [CCode (cname = "g_object_set_data_full", simple_generics = true)]
182 public void set_data<T> (string key, owned T data);
183 public void set_data_full (string key, void* data, GLib.DestroyNotify? destroy);
184 public void set_property (string property_name, GLib.Value value);
185 [CCode (cname = "g_object_set_qdata_full", simple_generics = true)]
186 public void set_qdata<T> (GLib.Quark quark, owned T data);
187 public void set_qdata_full (GLib.Quark quark, void* data, GLib.DestroyNotify? destroy);
188 public void set_valist (string first_property_name, va_list var_args);
189 [Version (since = "2.54")]
190 public void setv ([CCode (array_length_cname = "n_properties", array_length_pos = 0.5, array_length_type = "guint")] string[] names, [CCode (array_length_cname = "n_properties", array_length_pos = 0.5, array_length_type = "guint")] GLib.Value[] values);
191 [CCode (simple_generics = true)]
192 public T steal_data<T> (string key);
193 [CCode (simple_generics = true)]
194 public T steal_qdata<T> (GLib.Quark quark);
195 public void thaw_notify ();
196 public void unref ();
197 public void watch_closure (GLib.Closure closure);
198 public void weak_ref (GLib.WeakNotify notify);
199 public void weak_unref (GLib.WeakNotify notify);
201 public virtual signal void notify (GLib.ParamSpec pspec);
203 [CCode (lower_case_csuffix = "object_class")]
204 public class ObjectClass : GLib.TypeClass {
205 public unowned GLib.ParamSpec? find_property (string property_name);
206 [CCode (cname = "G_OBJECT_CLASS_NAME")]
207 public unowned string get_name ();
208 [CCode (cname = "G_OBJECT_CLASS_TYPE")]
209 public GLib.Type get_type ();
210 public void install_properties ([CCode (array_length_pos = 0.9, array_length_type = "guint")] GLib.ParamSpec[] pspecs);
211 public void install_property (uint property_id, GLib.ParamSpec pspec);
212 [CCode (array_length_type = "guint")]
214 public (unowned GLib.ParamSpec)[] list_properties ();
216 public unowned GLib.ParamSpec[] list_properties ();
218 public void override_property (uint property_id, string name);
220 [CCode (get_value_function = "g_value_get_param", param_spec_function = "g_param_spec_param", ref_function = "g_param_spec_ref", set_value_function = "g_value_set_param", take_value_function = "g_value_take_param", type_id = "G_TYPE_PARAM", unref_function = "g_param_spec_unref")]
221 public class ParamSpec {
222 public GLib.ParamFlags flags;
224 public GLib.Type owner_type;
225 public GLib.Type value_type;
227 public virtual void finalize ();
228 public unowned string get_blurb ();
229 [Version (since = "2.38")]
230 public unowned GLib.Value? get_default_value ();
231 public unowned string get_name ();
232 [Version (since = "2.46")]
233 public GLib.Quark get_name_quark ();
234 public unowned string get_nick ();
235 public void* get_qdata (GLib.Quark quark);
236 public unowned GLib.ParamSpec get_redirect_target ();
237 [CCode (cname = "g_param_spec_internal")]
238 public ParamSpec.@internal (GLib.Type param_type, string name, string nick, string blurb, GLib.ParamFlags flags);
239 public unowned GLib.ParamSpec @ref ();
240 public unowned GLib.ParamSpec ref_sink ();
241 public void set_qdata (GLib.Quark quark, void* data);
242 public void set_qdata_full (GLib.Quark quark, void* data, GLib.DestroyNotify destroy);
243 [CCode (cname = "g_param_value_set_default")]
244 public void set_value_default (GLib.Value value);
246 public void* steal_qdata (GLib.Quark quark);
247 public void unref ();
248 [CCode (cname = "g_param_value_convert")]
249 public bool value_convert (GLib.Value src_value, GLib.Value dest_value, bool strict_validation);
250 [CCode (cname = "g_param_value_defaults", vfunc_name = "value_defaults")]
251 public virtual bool value_defaults (GLib.Value value);
252 [CCode (cname = "g_param_value_validate", vfunc_name = "value_validate")]
253 public virtual bool value_validate (GLib.Value value);
254 [CCode (cname = "g_param_values_cmp", vfunc_name = "values_cmp")]
255 public virtual int values_cmp (GLib.Value value1, GLib.Value value2);
257 [CCode (type_id = "G_TYPE_PARAM_BOOLEAN")]
258 public class ParamSpecBoolean : GLib.ParamSpec {
259 public bool default_value;
260 [CCode (cname = "g_param_spec_boolean")]
261 public ParamSpecBoolean (string name, string nick, string blurb, bool defaultvalue, GLib.ParamFlags flags);
263 [CCode (type_id = "G_TYPE_PARAM_BOXED")]
264 public class ParamSpecBoxed : GLib.ParamSpec {
265 [CCode (cname = "g_param_spec_boxed")]
266 public ParamSpecBoxed (string name, string nick, string blurb, GLib.Type boxed_type, GLib.ParamFlags flags);
268 [CCode (type_id = "G_TYPE_PARAM_CHAR")]
269 public class ParamSpecChar : GLib.ParamSpec {
270 public int8 default_value;
273 [CCode (cname = "g_param_spec_char")]
274 public ParamSpecChar (string name, string nick, string blurb, int8 minimum, int8 maximum, int8 default_value, GLib.ParamFlags flags);
276 [CCode (type_id = "G_TYPE_PARAM_DOUBLE")]
277 public class ParamSpecDouble : GLib.ParamSpec {
278 public double default_value;
279 public double maximum;
280 public double minimum;
281 [CCode (cname = "g_param_spec_double")]
282 public ParamSpecDouble (string name, string nick, string blurb, double minimum, double maximum, double default_value, GLib.ParamFlags flags);
284 [CCode (type_id = "G_TYPE_PARAM_ENUM")]
285 public class ParamSpecEnum : GLib.ParamSpec {
286 public int default_value;
287 public weak GLib.EnumClass enum_class;
288 [CCode (cname = "g_param_spec_enum")]
289 public ParamSpecEnum (string name, string nick, string blurb, GLib.Type enum_type, int default_value, GLib.ParamFlags flags);
291 [CCode (type_id = "G_TYPE_PARAM_FLAGS")]
292 public class ParamSpecFlags : GLib.ParamSpec {
293 public uint default_value;
294 public weak GLib.FlagsClass flags_class;
295 [CCode (cname = "g_param_spec_flags")]
296 public ParamSpecFlags (string name, string nick, string blurb, GLib.Type flags_type, uint default_value, GLib.ParamFlags flags);
298 [CCode (type_id = "G_TYPE_PARAM_FLOAT")]
299 public class ParamSpecFloat : GLib.ParamSpec {
300 public float default_value;
301 public float maximum;
302 public float minimum;
303 [CCode (cname = "g_param_spec_float")]
304 public ParamSpecFloat (string name, string nick, string blurb, float minimum, float maximum, float default_value, GLib.ParamFlags flags);
306 [CCode (type_id = "G_TYPE_PARAM_GTYPE")]
307 public class ParamSpecGType : GLib.ParamSpec {
308 public GLib.Type is_a_type;
309 [CCode (cname = "g_param_spec_gtype")]
310 public ParamSpecGType (string name, string nick, string blurb, GLib.Type is_a_type, GLib.ParamFlags flags);
312 [CCode (type_id = "G_TYPE_PARAM_INT")]
313 public class ParamSpecInt : GLib.ParamSpec {
314 public int default_value;
317 [CCode (cname = "g_param_spec_int")]
318 public ParamSpecInt (string name, string nick, string blurb, int minimum, int maximum, int default_value, GLib.ParamFlags flags);
320 [CCode (type_id = "G_TYPE_PARAM_INT64")]
321 public class ParamSpecInt64 : GLib.ParamSpec {
322 public int64 default_value;
323 public int64 maximum;
324 public int64 minimum;
325 [CCode (cname = "g_param_spec_int64")]
326 public ParamSpecInt64 (string name, string nick, string blurb, int64 minimum, int64 maximum, int64 default_value, GLib.ParamFlags flags);
328 [CCode (type_id = "G_TYPE_PARAM_LONG")]
329 public class ParamSpecLong : GLib.ParamSpec {
330 public long default_value;
333 [CCode (cname = "g_param_spec_long")]
334 public ParamSpecLong (string name, string nick, string blurb, long minimum, long maximum, long default_value, GLib.ParamFlags flags);
336 [CCode (type_id = "G_TYPE_PARAM_OBJECT")]
337 public class ParamSpecObject : GLib.ParamSpec {
338 [CCode (cname = "g_param_spec_object")]
339 public ParamSpecObject (string name, string nick, string blurb, GLib.Type object_type, GLib.ParamFlags flags);
341 [CCode (type_id = "G_TYPE_PARAM_PARAM")]
342 public class ParamSpecParam : GLib.ParamSpec {
343 [CCode (cname = "g_param_spec_param")]
344 public ParamSpecParam (string name, string nick, string blurb, GLib.Type param_type, GLib.ParamFlags flags);
346 [CCode (type_id = "G_TYPE_PARAM_POINTER")]
347 public class ParamSpecPointer : GLib.ParamSpec {
348 [CCode (cname = "g_param_spec_pointer")]
349 public ParamSpecPointer (string name, string nick, string blurb, GLib.ParamFlags flags);
352 public class ParamSpecPool {
353 public ParamSpecPool (bool type_prefixing = false);
354 public void insert (GLib.ParamSpec pspec, GLib.Type owner_type);
355 [CCode (array_length_pos = 1.1, array_length_type = "guint")]
357 public (unowned GLib.ParamSpec)[] list (GLib.Type owner_type);
359 public unowned GLib.ParamSpec[] list (GLib.Type owner_type);
361 public GLib.List<weak GLib.ParamSpec> list_owned (GLib.Type owner_type);
362 public unowned GLib.ParamSpec lookup (string param_name, GLib.Type owner_type, bool walk_ancestors);
363 public void remove (GLib.ParamSpec pspec);
365 [CCode (type_id = "G_TYPE_PARAM_STRING")]
366 public class ParamSpecString : GLib.ParamSpec {
367 public string cset_first;
368 public string cset_nth;
369 public string default_value;
370 public uint ensure_non_null;
371 public uint null_fold_if_empty;
372 public char substitutor;
373 [CCode (cname = "g_param_spec_string")]
374 public ParamSpecString (string name, string nick, string blurb, string default_value, GLib.ParamFlags flags);
376 [CCode (type_id = "G_TYPE_PARAM_UCHAR")]
377 public class ParamSpecUChar : GLib.ParamSpec {
378 public uint8 default_value;
379 public uint8 maximum;
380 public uint8 minimum;
381 [CCode (cname = "g_param_spec_uchar")]
382 public ParamSpecUChar (string name, string nick, string blurb, uint8 minimum, uint8 maximum, uint8 default_value, GLib.ParamFlags flags);
384 [CCode (type_id = "G_TYPE_PARAM_UINT")]
385 public class ParamSpecUInt : GLib.ParamSpec {
386 public uint default_value;
389 [CCode (cname = "g_param_spec_uint")]
390 public ParamSpecUInt (string name, string nick, string blurb, uint minimum, uint maximum, uint default_value, GLib.ParamFlags flags);
392 [CCode (type_id = "G_TYPE_PARAM_UINT64")]
393 public class ParamSpecUInt64 : GLib.ParamSpec {
394 public uint64 default_value;
395 public uint64 maximum;
396 public uint64 minimum;
397 [CCode (cname = "g_param_spec_uint64")]
398 public ParamSpecUInt64 (string name, string nick, string blurb, uint64 minimum, uint64 maximum, uint64 default_value, GLib.ParamFlags flags);
400 [CCode (type_id = "G_TYPE_PARAM_ULONG")]
401 public class ParamSpecULong : GLib.ParamSpec {
402 public ulong default_value;
403 public ulong maximum;
404 public ulong minimum;
405 [CCode (cname = "g_param_spec_ulong")]
406 public ParamSpecULong (string name, string nick, string blurb, ulong minimum, ulong maximum, ulong default_value, GLib.ParamFlags flags);
408 [CCode (type_id = "G_TYPE_PARAM_UNICHAR")]
409 public class ParamSpecUnichar : GLib.ParamSpec {
410 public unichar default_value;
411 [CCode (cname = "g_param_spec_unichar")]
412 public ParamSpecUnichar (string name, string nick, string blurb, unichar default_value, GLib.ParamFlags flags);
414 [Version (since = "2.26")]
415 [CCode (type_id = "G_TYPE_PARAM_VARIANT")]
416 public class ParamSpecVariant : GLib.ParamSpec {
417 public GLib.Variant? default_value;
418 public GLib.VariantType type;
419 [CCode (cname = "g_param_spec_variant")]
420 public ParamSpecVariant (string name, string nick, string blurb, GLib.VariantType type, GLib.Variant? default_value, GLib.ParamFlags flags);
422 [CCode (free_function = "g_type_class_unref", lower_case_csuffix = "type_class")]
424 public class TypeClass {
425 [Version (deprecated = true, deprecated_since = "2.58")]
426 public void add_private (size_t private_size);
427 [Version (since = "2.38")]
428 public void adjust_private_offset (ref int private_size_or_offset);
429 [Version (since = "2.38")]
430 public int get_instance_private_offset ();
431 [CCode (cname = "G_TYPE_FROM_CLASS")]
432 public GLib.Type get_type ();
433 [CCode (cname = "g_type_interface_peek")]
434 public unowned GLib.TypeInterface? peek (GLib.Type iface_type);
435 public unowned GLib.TypeClass? peek_parent ();
437 [CCode (lower_case_csuffix = "type_instance")]
439 public class TypeInstance {
441 [CCode (free_function = "g_type_default_interface_unref", lower_case_csuffix = "type_interface")]
443 public class TypeInterface {
444 public void add_prerequisite ();
445 public unowned GLib.TypePlugin get_plugin (GLib.Type interface_type);
446 [CCode (cname = "G_TYPE_FROM_INTERFACE")]
447 public GLib.Type get_type ();
448 public unowned GLib.TypeInterface? peek_parent ();
450 [CCode (cheader_filename = "glib-object.h", lower_case_csuffix = "type_module", type_id = "g_type_module_get_type ()")]
451 public abstract class TypeModule : GLib.Object, GLib.TypePlugin {
452 [CCode (has_construct_function = false)]
453 protected TypeModule ();
454 public void add_interface (GLib.Type instance_type, GLib.Type interface_type, GLib.InterfaceInfo interface_info);
456 public virtual bool load ();
457 [Version (since = "2.6")]
458 public GLib.Type register_enum (string name, GLib.EnumValue const_static_values);
459 [Version (since = "2.6")]
460 public GLib.Type register_flags (string name, GLib.FlagsValue const_static_values);
461 public GLib.Type register_type (GLib.Type parent_type, string type_name, GLib.TypeInfo type_info, GLib.TypeFlags flags);
462 public void set_name (string name);
464 public virtual void unload ();
465 public void unuse ();
468 [CCode (copy_function = "g_value_array_copy", free_function = "g_value_array_free", type_id = "G_TYPE_VALUE_ARRAY")]
470 [Version (deprecated = true, deprecated_since = "2.32")]
471 public class ValueArray {
472 public uint n_values;
473 [CCode (array_length_cname = "n_values", array_length_type = "guint")]
474 public GLib.Value[] values;
475 public ValueArray (uint n_prealloced);
476 public void append (GLib.Value value);
477 public GLib.ValueArray copy ();
478 public unowned GLib.Value? get_nth (uint index_);
479 public void insert (uint index_, GLib.Value value);
480 public void prepend (GLib.Value value);
481 public void remove (uint index_);
482 public void sort (GLib.CompareFunc<GLib.Value?> compare_func);
483 public void sort_with_data (GLib.CompareDataFunc<GLib.Value?> compare_func);
485 [CCode (cheader_filename = "glib-object.h", lower_case_csuffix = "type_plugin", type_id = "g_type_plugin_get_type ()")]
486 public interface TypePlugin {
487 public void complete_interface_info (GLib.Type instance_type, GLib.Type interface_type, GLib.InterfaceInfo info);
488 public void complete_type_info (GLib.Type g_type, GLib.TypeInfo info, GLib.TypeValueTable value_table);
489 public void unuse ();
492 [CCode (has_type_id = false)]
493 public struct EnumValue {
495 public weak string value_name;
496 public weak string value_nick;
498 [CCode (has_type_id = false)]
499 public struct FlagsValue {
501 public weak string value_name;
502 public weak string value_nick;
504 [CCode (has_type_id = false)]
505 public struct InterfaceInfo {
506 public GLib.InterfaceInitFunc interface_init;
507 public GLib.InterfaceFinalizeFunc interface_finalize;
508 public void* interface_data;
510 [CCode (has_copy_function = false, has_destroy_function = false)]
511 public struct ObjectConstructParam {
512 public ParamSpec pspec;
513 public GLib.Value value;
515 [CCode (has_copy_function = false, has_destroy_function = false)]
516 [Version (deprecated = true, deprecated_since = "2.54")]
517 public struct Parameter {
518 public weak string name;
519 public GLib.Value value;
521 [CCode (cname = "guint")]
522 public struct Signal : uint {
523 public static ulong add_emission_hook (uint signal_id, GLib.Quark detail, owned GLib.SignalEmissionHook hook_func);
524 public static void chain_from_overridden ([CCode (array_length = false)] GLib.Value[] instance_and_params, out GLib.Value return_value);
525 [Version (since = "2.18")]
526 public static void chain_from_overridden_handler (void* instance, ...);
527 public static ulong connect (void* instance, string detailed_signal, GLib.Callback handler, void* data);
528 public static ulong connect_after (void* instance, string detailed_signal, GLib.Callback handler, void* data);
529 public static ulong connect_closure (void* instance, string detailed_signal, GLib.Closure closure, bool after);
530 public static ulong connect_closure_by_id (void* instance, uint signal_id, GLib.Quark detail, GLib.Closure closure, bool after);
531 public static ulong connect_data (void* instance, string detailed_signal, GLib.Callback handler, void* data, GLib.ClosureNotify destroy_data, GLib.ConnectFlags flags);
532 public static ulong connect_object (void* instance, string detailed_signal, GLib.Callback handler, GLib.Object gobject, GLib.ConnectFlags flags);
533 public static ulong connect_swapped (void* instance, string detailed_signal, GLib.Callback handler, void* data);
534 public static void emit (void* instance, uint signal_id, GLib.Quark detail, ...);
535 public static void emit_by_name (void* instance, string detailed_signal, ...);
536 public static unowned GLib.SignalInvocationHint? get_invocation_hint (void* instance);
537 public static bool has_handler_pending (void* instance, uint signal_id, GLib.Quark detail, bool may_be_blocked);
538 public static uint[] list_ids (GLib.Type itype);
539 public static uint lookup (string name, GLib.Type itype);
540 public static unowned string name (uint signal_id);
541 public static GLib.Signal @new (string signal_name, GLib.Type itype, GLib.SignalFlags signal_flags, uint class_offset, GLib.SignalAccumulator? accumulator, void* accu_data, GLib.SignalCMarshaller? c_marshaller, GLib.Type return_type, uint n_params, ...);
542 [Version (since = "2.18")]
543 public static GLib.Signal new_class_handler (string signal_name, GLib.Type itype, GLib.SignalFlags signal_flags, GLib.Callback? class_handler, GLib.SignalAccumulator? accumulator, void* accu_data, GLib.SignalCMarshaller? c_marshaller, GLib.Type return_type, uint n_params, ...);
544 public static GLib.Signal new_valist (string signal_name, GLib.Type itype, GLib.SignalFlags signal_flags, GLib.Closure? class_closure, GLib.SignalAccumulator? accumulator, void* accu_data, GLib.SignalCMarshaller? c_marshaller, GLib.Type return_type, uint n_params, va_list args);
545 public static GLib.Signal newv (string signal_name, GLib.Type itype, GLib.SignalFlags signal_flags, GLib.Closure? class_closure, GLib.SignalAccumulator? accumulator, void* accu_data, GLib.SignalCMarshaller? c_marshaller, GLib.Type return_type, [CCode (array_length_cname = "n_params", array_length_pos = 7.5, array_length_type = "guint")] GLib.Type[]? param_types);
546 public static void override_class_closure (uint signal_id, GLib.Type instance_type, GLib.Closure class_closure);
547 [Version (since = "2.18")]
548 public static void override_class_handler (string signal_name, GLib.Type instance_type, GLib.Callback class_handler);
549 public static bool parse_name (string detailed_signal, GLib.Type itype, out uint signal_id, out GLib.Quark detail, bool force_detail_quark);
550 public static void query (uint signal_id, out GLib.SignalQuery query);
551 public static void remove_emission_hook (uint signal_id, ulong hook_id);
552 public static void stop_emission (void* instance, uint signal_id, GLib.Quark detail);
553 public static void stop_emission_by_name (void* instance, string detailed_signal);
555 public struct SignalInvocationHint {
556 public uint signal_id;
557 public GLib.Quark detail;
558 public GLib.SignalFlags run_type;
560 public struct SignalQuery {
561 public uint signal_id;
562 public weak string signal_name;
563 public GLib.Type itype;
564 public GLib.SignalFlags signal_flags;
565 public GLib.Type return_type;
566 public uint n_params;
567 [CCode (array_length_cname = "n_params", array_length_type = "guint")]
568 public weak GLib.Type[] param_types;
570 [CCode (get_value_function = "g_value_get_gtype", marshaller_type_name = "GTYPE", set_value_function = "g_value_set_gtype", type_id = "G_TYPE_GTYPE")]
571 [GIR (fullname = "GType")]
572 public struct Type : ulong {
573 public const GLib.Type BOOLEAN;
574 public const GLib.Type BOXED;
575 public const GLib.Type CHAR;
576 public const GLib.Type DOUBLE;
577 public const GLib.Type ENUM;
578 public const GLib.Type FLAGS;
579 public const GLib.Type FLOAT;
580 public const GLib.Type INT;
581 public const GLib.Type INT64;
582 public const GLib.Type INTERFACE;
583 public const GLib.Type INVALID;
584 public const GLib.Type LONG;
585 public const GLib.Type NONE;
586 public const GLib.Type OBJECT;
587 public const GLib.Type PARAM;
588 public const GLib.Type POINTER;
589 public const GLib.Type STRING;
590 public const GLib.Type UCHAR;
591 public const GLib.Type UINT;
592 public const GLib.Type UINT64;
593 public const GLib.Type ULONG;
594 public const GLib.Type VARIANT;
595 public void add_class_private (size_t private_size);
596 [CCode (array_length_type = "guint")]
597 public GLib.Type[] children ();
598 public unowned GLib.TypeClass? class_peek ();
599 public unowned GLib.TypeClass? class_peek_parent ();
600 public unowned GLib.TypeClass? class_peek_static ();
601 public unowned GLib.TypeClass? default_interface_peek ();
602 public GLib.TypeInterface default_interface_ref ();
603 public GLib.TypeClass class_ref ();
604 public uint depth ();
605 [Version (since = "2.34")]
606 public void ensure ();
607 [CCode (cname = "g_enum_to_string")]
608 [Version (since = "2.54")]
609 public string enum_to_string (int @value);
610 [CCode (cname = "g_flags_to_string")]
611 [Version (since = "2.54")]
612 public string flags_to_string (uint @value);
613 [CCode (cname = "G_TYPE_FROM_INSTANCE")]
614 public static GLib.Type from_instance (void* instance);
615 public static GLib.Type from_name (string name);
616 [Version (since = "2.44")]
617 public int get_instance_count ();
618 public void* get_qdata (GLib.Quark quark);
619 [Version (since = "2.36")]
620 public static uint get_type_registration_serial ();
621 [CCode (array_length_type = "guint")]
622 public GLib.Type[] interface_prerequisites ();
623 [CCode (array_length_type = "guint")]
624 public GLib.Type[] interfaces ();
625 public GLib.Type next_base (GLib.Type root_type);
626 public bool is_a (GLib.Type is_a_type);
627 [CCode (cname = "G_TYPE_IS_ABSTRACT")]
628 public bool is_abstract ();
629 [CCode (cname = "G_TYPE_IS_CLASSED")]
630 public bool is_classed ();
631 [CCode (cname = "G_TYPE_IS_DEEP_DERIVABLE")]
632 public bool is_deep_derivable ();
633 [CCode (cname = "G_TYPE_IS_DERIVABLE")]
634 public bool is_derivable ();
635 [CCode (cname = "G_TYPE_IS_DERIVED")]
636 public bool is_derived ();
637 [CCode (cname = "G_TYPE_IS_ENUM")]
638 public bool is_enum ();
639 [CCode (cname = "G_TYPE_IS_FLAGS")]
640 public bool is_flags ();
641 [CCode (cname = "G_TYPE_IS_FUNDAMENTAL")]
642 public bool is_fundamental ();
643 [CCode (cname = "G_TYPE_IS_INSTANTIATABLE")]
644 public bool is_instantiatable ();
645 [CCode (cname = "G_TYPE_IS_INTERFACE")]
646 public bool is_interface ();
647 [CCode (cname = "G_TYPE_IS_OBJECT")]
648 public bool is_object ();
649 [CCode (cname = "G_TYPE_IS_VALUE_TYPE")]
650 public bool is_value_type ();
651 public unowned string name ();
652 public GLib.Type parent ();
653 public GLib.Quark qname ();
654 public void query (out GLib.TypeQuery query);
655 public void set_qdata (GLib.Quark quark, void* data);
657 [CCode (has_type_id = false)]
658 public struct TypeInfo {
659 public uint16 class_size;
660 public GLib.BaseInitFunc base_init;
661 public GLib.BaseFinalizeFunc base_finalize;
662 public GLib.ClassInitFunc class_init;
663 public GLib.ClassFinalizeFunc class_finalize;
664 public void* class_data;
665 public uint16 instance_size;
666 public uint16 n_preallocs;
667 public GLib.InstanceInitFunc instance_init;
668 unowned GLib.TypeValueTable value_table;
670 public struct TypeQuery {
671 public GLib.Type type;
672 public weak string type_name;
673 public uint class_size;
674 public uint instance_size;
676 [CCode (has_type_id = false)]
677 public struct TypeValueTable {
679 [CCode (copy_function = "g_value_copy", destroy_function = "g_value_unset", get_value_function = "g_value_get_boxed", marshaller_type_name = "BOXED", set_value_function = "g_value_set_boxed", take_value_function = "g_value_take_boxed", type_id = "G_TYPE_VALUE", type_signature = "v")]
680 public struct Value {
681 public Value (GLib.Type g_type);
682 public void copy (ref GLib.Value dest_value);
683 public void* dup_boxed ();
684 public GLib.ParamSpec dup_param ();
685 public GLib.Object dup_object ();
686 public string dup_string ();
687 [Version (since = "2.26")]
688 public GLib.Variant? dup_variant ();
689 public bool fits_pointer ();
690 public bool get_boolean ();
691 public void* get_boxed ();
692 [Version (deprecated = true, deprecated_since = "2.32")]
693 public char get_char ();
694 public double get_double ();
695 public int get_enum ();
696 public uint get_flags ();
697 public float get_float ();
698 [Version (since = "2.12")]
699 public GLib.Type get_gtype ();
700 public int get_int ();
701 public int64 get_int64 ();
702 public long get_long ();
703 public unowned GLib.Object get_object ();
704 public unowned GLib.ParamSpec get_param ();
705 public void* get_pointer ();
706 [Version (since = "2.32")]
707 public int8 get_schar ();
708 public unowned string get_string ();
709 public uchar get_uchar ();
710 public uint get_uint ();
711 public uint64 get_uint64 ();
712 public ulong get_ulong ();
713 [Version (since = "2.26")]
714 public GLib.Variant? get_variant ();
715 [CCode (cname = "G_VALUE_HOLDS")]
716 public bool holds (GLib.Type type);
717 public unowned GLib.Value? init (GLib.Type g_type);
718 [Version (since = "2.42")]
719 public void init_from_instance (void* instance);
720 public void param_take_ownership (out GLib.ParamSpec param);
721 public void* peek_pointer ();
722 public static void register_transform_func (GLib.Type src_type, GLib.Type dest_type, GLib.ValueTransform transform_func);
723 public unowned GLib.Value? reset ();
724 public void set_boolean (bool v_boolean);
725 public void set_boxed (void* v_boxed);
726 [Version (deprecated = true, deprecated_since = "2.32")]
727 public void set_char (char v_char);
728 public void set_double (double v_double);
729 public void set_enum (int v_enum);
730 public void set_flags (uint v_flags);
731 public void set_float (float v_float);
732 [Version (since = "2.12")]
733 public void set_gtype (GLib.Type v_gtype);
734 public void set_instance (void* instance);
735 public void set_int (int v_int);
736 public void set_int64 (int64 v_int64);
737 public void set_long (long v_long);
738 public void set_object (GLib.Object? v_object);
739 public void set_param (GLib.ParamSpec? param);
740 public void set_pointer (void* v_pointer);
741 [Version (since = "2.32")]
742 public void set_schar (int8 v_char);
743 public void set_static_string (string? v_string);
744 public void set_string (string? v_string);
745 public void set_uchar (uchar v_uchar);
746 public void set_uint (uint v_uint);
747 public void set_uint64 (uint64 v_uint64);
748 public void set_ulong (ulong v_ulong);
749 [Version (since = "2.26")]
750 public void set_variant (GLib.Variant? variant);
751 [CCode (cname = "g_strdup_value_contents")]
752 public string strdup_contents ();
753 public void take_boxed (owned void* v_boxed);
754 public void take_object (owned GLib.Object? v_object);
755 public void take_param (owned GLib.ParamSpec? param);
756 public void take_string (owned string? v_string);
757 [Version (since = "2.26")]
758 public void take_variant (owned GLib.Variant? variant);
759 public bool transform (ref GLib.Value dest_value);
760 [CCode (cname = "G_VALUE_TYPE")]
761 public GLib.Type type ();
762 public static bool type_compatible (GLib.Type src_type, GLib.Type dest_type);
763 [CCode (cname = "G_VALUE_TYPE_NAME")]
764 public unowned string type_name ();
765 public static bool type_transformable (GLib.Type src_type, GLib.Type dest_type);
766 public void unset ();
768 [CCode (destroy_function = "g_weak_ref_clear", lvalue_access = false)]
769 [Version (since = "2.32")]
770 public struct WeakRef {
771 public WeakRef (GLib.Object? object);
772 public GLib.Object? @get ();
773 public void @set (GLib.Object? object);
775 [CCode (cprefix = "G_BINDING_")]
777 [Version (since = "2.26")]
778 public enum BindingFlags {
784 [CCode (cprefix = "G_CONNECT_", has_type_id = false)]
786 public enum ConnectFlags {
790 [CCode (cprefix = "G_PARAM_", has_type_id = false)]
792 public enum ParamFlags {
804 [Version (since = "2.42")]
806 [Version (since = "2.26")]
810 [CCode (cprefix = "G_SIGNAL_", has_type_id = false)]
812 public enum SignalFlags {
822 [CCode (cname = "G_SIGNAL_FLAGS_MASK")]
825 [CCode (cprefix = "G_SIGNAL_MATCH_", has_type_id = false)]
826 public enum SignalMatchType {
835 [CCode (cprefix = "G_TYPE_DEBUG_", has_type_id = false)]
837 [Version (deprecated = true, deprecated_since = "2.36")]
838 public enum TypeDebugFlags {
845 [CCode (cprefix = "G_TYPE_FLAG_", has_type_id = false)]
847 public enum TypeFlags {
851 [CCode (cprefix = "G_TYPE_FLAG_", has_type_id = false)]
853 public enum TypeFundamentalFlags {
859 [CCode (has_target = false)]
860 public delegate void BaseInitFunc (GLib.TypeClass g_class);
861 [CCode (has_target = false)]
862 public delegate void BaseFinalizeFunc (GLib.TypeClass g_class);
863 [Version (since = "2.26")]
864 public delegate bool BindingTransformFunc (GLib.Binding binding, GLib.Value source_value, ref GLib.Value target_value);
865 [CCode (has_target = false)]
866 public delegate void* BoxedCopyFunc (void* boxed);
867 [CCode (has_target = false)]
868 public delegate void BoxedFreeFunc (void* boxed);
869 [CCode (has_target = false)]
870 public delegate void Callback ();
871 [CCode (has_target = false)]
872 public delegate void ClassInitFunc (GLib.TypeClass g_class, void* class_data);
873 [CCode (has_target = false)]
874 public delegate void ClassFinalizeFunc (GLib.TypeClass g_class, void* class_data);
875 [CCode (has_target = false, instance_pos = 0)]
876 public delegate void ClosureMarshal (GLib.Closure closure, out GLib.Value return_value, [CCode (array_length_pos = 2.9, array_length_type = "guint")] GLib.Value[] param_values, void* invocation_hint, void* marshal_data);
877 [CCode (has_target = false)]
878 public delegate void ClosureNotify (void* data, GLib.Closure closure);
879 [CCode (has_target = false)]
880 public delegate void InstanceInitFunc (GLib.TypeInstance instance, GLib.TypeClass g_class);
881 [CCode (has_target = false)]
882 public delegate void InterfaceInitFunc (GLib.TypeInterface g_iface, void* iface_data);
883 [CCode (has_target = false)]
884 public delegate void InterfaceFinalizeFunc (GLib.TypeInterface g_iface, void* iface_data);
885 [CCode (cname = "GCallback", has_target = false)]
886 public delegate GLib.Object ObjectConstructorFunc (GLib.Type type, [CCode (array_length_pos = 1.9, array_length_type = "guint")] GLib.ObjectConstructParam[] construct_properties);
887 [CCode (has_target = false)]
888 public delegate void ObjectGetPropertyFunc (GLib.Object object, uint property_id, ref GLib.Value value, GLib.ParamSpec pspec);
889 [CCode (has_target = false)]
890 public delegate void ObjectFinalizeFunc (GLib.Object object);
891 [CCode (has_target = false)]
892 public delegate void ObjectSetPropertyFunc (GLib.Object object, uint property_id, GLib.Value value, GLib.ParamSpec pspec);
893 [CCode (has_target = false)]
894 public delegate bool SignalAccumulator (GLib.SignalInvocationHint ihint, GLib.Value return_accu, GLib.Value handler_return, void* data);
895 [CCode (has_target = false)]
896 public delegate void SignalCMarshaller (GLib.Closure closure, GLib.Value? return_value, [CCode (array_length_cname = "n_param_values", array_length_pos = 2.5, array_length_type = "guint")] GLib.Value[] param_values, void* invocation_hint, void* marshal_data);
897 [CCode (has_target = false)]
898 public delegate void SignalCVaMarshaller (GLib.Closure closure, GLib.Value? return_value, GLib.TypeInstance instance, va_list args, void* marshal_data, [CCode (array_length_cname = "n_params", array_length_pos = 5.5)] GLib.Type[] param_types);
899 public delegate bool SignalEmissionHook (GLib.SignalInvocationHint ihint, [CCode (array_length_pos = 1.9, array_length_type = "guint")] GLib.Value[] param_values);
900 [CCode (instance_pos = 0)]
901 public delegate void ToggleNotify (GLib.Object object, bool is_last_ref);
902 [CCode (has_target = false)]
903 public delegate void TypeClassCacheFunc (void* cache_data, GLib.TypeClass g_class);
904 [CCode (has_target = false)]
905 public delegate void ValueTransform (GLib.Value src_value, ref GLib.Value dest_value);
906 [CCode (instance_pos = 0)]
907 public delegate void WeakNotify (GLib.Object object);
908 public static void source_set_closure (GLib.Source source, GLib.Closure closure);
909 public static void source_set_dummy_callback (GLib.Source source);