source: appstream-generator/build/girepo/gobject/Type.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 25.0 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module gobject.Type;
22
23private import gi.gobject;
24public  import gi.gobjecttypes;
25private import glib.Str;
26private import gobject.ObjectG;
27private import gobject.TypeClass;
28private import gobject.TypeInstance;
29private import gobject.TypeInterface;
30private import gobject.TypePlugin;
31private import gobject.TypePluginIF;
32private import gobject.Value;
33
34
35/** */
36public struct Type
37{
38        public static T* getInstanceClass(T)(ObjectG obj)
39        {
40                return cast(T*) (cast(GTypeInstance*)obj.getObjectGStruct()).gClass;
41        }
42       
43        /**
44         * Get the unique name that is assigned to the Objects type.
45         * Returns: Static type name or NULL.
46         */
47        public static string name(ObjectG obj)
48        {
49                GType type = (cast(GTypeInstance*)obj.getObjectGStruct()).gClass.gType;
50               
51                return name(type);
52        }
53
54        /**
55         */
56
57        /**
58         * Adds a #GTypeClassCacheFunc to be called before the reference count of a
59         * class goes from one to zero. This can be used to prevent premature class
60         * destruction. All installed #GTypeClassCacheFunc functions will be chained
61         * until one of them returns %TRUE. The functions have to check the class id
62         * passed in to figure whether they actually want to cache the class of this
63         * type, since all classes are routed through the same #GTypeClassCacheFunc
64         * chain.
65         *
66         * Params:
67         *     cacheData = data to be passed to @cache_func
68         *     cacheFunc = a #GTypeClassCacheFunc
69         */
70        public static void addClassCacheFunc(void* cacheData, GTypeClassCacheFunc cacheFunc)
71        {
72                g_type_add_class_cache_func(cacheData, cacheFunc);
73        }
74
75        /**
76         * Registers a private class structure for a classed type;
77         * when the class is allocated, the private structures for
78         * the class and all of its parent types are allocated
79         * sequentially in the same memory block as the public
80         * structures, and are zero-filled.
81         *
82         * This function should be called in the
83         * type's get_type() function after the type is registered.
84         * The private structure can be retrieved using the
85         * G_TYPE_CLASS_GET_PRIVATE() macro.
86         *
87         * Params:
88         *     classType = GType of an classed type
89         *     privateSize = size of private structure
90         *
91         * Since: 2.24
92         */
93        public static void addClassPrivate(GType classType, size_t privateSize)
94        {
95                g_type_add_class_private(classType, privateSize);
96        }
97
98        /** */
99        public static int addInstancePrivate(GType classType, size_t privateSize)
100        {
101                return g_type_add_instance_private(classType, privateSize);
102        }
103
104        /**
105         * Adds a function to be called after an interface vtable is
106         * initialized for any class (i.e. after the @interface_init
107         * member of #GInterfaceInfo has been called).
108         *
109         * This function is useful when you want to check an invariant
110         * that depends on the interfaces of a class. For instance, the
111         * implementation of #GObject uses this facility to check that an
112         * object implements all of the properties that are defined on its
113         * interfaces.
114         *
115         * Params:
116         *     checkData = data to pass to @check_func
117         *     checkFunc = function to be called after each interface
118         *         is initialized
119         *
120         * Since: 2.4
121         */
122        public static void addInterfaceCheck(void* checkData, GTypeInterfaceCheckFunc checkFunc)
123        {
124                g_type_add_interface_check(checkData, checkFunc);
125        }
126
127        /**
128         * Adds the dynamic @interface_type to @instantiable_type. The information
129         * contained in the #GTypePlugin structure pointed to by @plugin
130         * is used to manage the relationship.
131         *
132         * Params:
133         *     instanceType = #GType value of an instantiable type
134         *     interfaceType = #GType value of an interface type
135         *     plugin = #GTypePlugin structure to retrieve the #GInterfaceInfo from
136         */
137        public static void addInterfaceDynamic(GType instanceType, GType interfaceType, TypePluginIF plugin)
138        {
139                g_type_add_interface_dynamic(instanceType, interfaceType, (plugin is null) ? null : plugin.getTypePluginStruct());
140        }
141
142        /**
143         * Adds the static @interface_type to @instantiable_type.
144         * The information contained in the #GInterfaceInfo structure
145         * pointed to by @info is used to manage the relationship.
146         *
147         * Params:
148         *     instanceType = #GType value of an instantiable type
149         *     interfaceType = #GType value of an interface type
150         *     info = #GInterfaceInfo structure for this
151         *         (@instance_type, @interface_type) combination
152         */
153        public static void addInterfaceStatic(GType instanceType, GType interfaceType, GInterfaceInfo* info)
154        {
155                g_type_add_interface_static(instanceType, interfaceType, info);
156        }
157
158        /** */
159        public static TypeClass checkClassCast(TypeClass gClass, GType isAType)
160        {
161                auto p = g_type_check_class_cast((gClass is null) ? null : gClass.getTypeClassStruct(), isAType);
162               
163                if(p is null)
164                {
165                        return null;
166                }
167               
168                return ObjectG.getDObject!(TypeClass)(cast(GTypeClass*) p);
169        }
170
171        /** */
172        public static bool checkClassIsA(TypeClass gClass, GType isAType)
173        {
174                return g_type_check_class_is_a((gClass is null) ? null : gClass.getTypeClassStruct(), isAType) != 0;
175        }
176
177        /**
178         * Private helper function to aid implementation of the
179         * G_TYPE_CHECK_INSTANCE() macro.
180         *
181         * Params:
182         *     instanc = a valid #GTypeInstance structure
183         *
184         * Returns: %TRUE if @instance is valid, %FALSE otherwise
185         */
186        public static bool checkInstance(TypeInstance instanc)
187        {
188                return g_type_check_instance((instanc is null) ? null : instanc.getTypeInstanceStruct()) != 0;
189        }
190
191        /** */
192        public static TypeInstance checkInstanceCast(TypeInstance instanc, GType ifaceType)
193        {
194                auto p = g_type_check_instance_cast((instanc is null) ? null : instanc.getTypeInstanceStruct(), ifaceType);
195               
196                if(p is null)
197                {
198                        return null;
199                }
200               
201                return ObjectG.getDObject!(TypeInstance)(cast(GTypeInstance*) p);
202        }
203
204        /** */
205        public static bool checkInstanceIsA(TypeInstance instanc, GType ifaceType)
206        {
207                return g_type_check_instance_is_a((instanc is null) ? null : instanc.getTypeInstanceStruct(), ifaceType) != 0;
208        }
209
210        /** */
211        public static bool checkInstanceIsFundamentallyA(TypeInstance instanc, GType fundamentalType)
212        {
213                return g_type_check_instance_is_fundamentally_a((instanc is null) ? null : instanc.getTypeInstanceStruct(), fundamentalType) != 0;
214        }
215
216        /** */
217        public static bool checkIsValueType(GType type)
218        {
219                return g_type_check_is_value_type(type) != 0;
220        }
221
222        /** */
223        public static bool checkValue(Value value)
224        {
225                return g_type_check_value((value is null) ? null : value.getValueStruct()) != 0;
226        }
227
228        /** */
229        public static bool checkValueHolds(Value value, GType type)
230        {
231                return g_type_check_value_holds((value is null) ? null : value.getValueStruct(), type) != 0;
232        }
233
234        /**
235         * Return a newly allocated and 0-terminated array of type IDs, listing
236         * the child types of @type.
237         *
238         * Params:
239         *     type = the parent type
240         *
241         * Returns: Newly allocated
242         *     and 0-terminated array of child types, free with g_free()
243         */
244        public static GType[] children(GType type)
245        {
246                uint nChildren;
247               
248                auto p = g_type_children(type, &nChildren);
249               
250                return p[0 .. nChildren];
251        }
252
253        /**
254         * Creates and initializes an instance of @type if @type is valid and
255         * can be instantiated. The type system only performs basic allocation
256         * and structure setups for instances: actual instance creation should
257         * happen through functions supplied by the type's fundamental type
258         * implementation.  So use of g_type_create_instance() is reserved for
259         * implementators of fundamental types only. E.g. instances of the
260         * #GObject hierarchy should be created via g_object_new() and never
261         * directly through g_type_create_instance() which doesn't handle things
262         * like singleton objects or object construction.
263         *
264         * The extended members of the returned instance are guaranteed to be filled
265         * with zeros.
266         *
267         * Note: Do not use this function, unless you're implementing a
268         * fundamental type. Also language bindings should not use this
269         * function, but g_object_new() instead.
270         *
271         * Params:
272         *     type = an instantiatable type to create an instance for
273         *
274         * Returns: an allocated and initialized instance, subject to further
275         *     treatment by the fundamental type implementation
276         */
277        public static TypeInstance createInstance(GType type)
278        {
279                auto p = g_type_create_instance(type);
280               
281                if(p is null)
282                {
283                        return null;
284                }
285               
286                return ObjectG.getDObject!(TypeInstance)(cast(GTypeInstance*) p);
287        }
288
289        /**
290         * If the interface type @g_type is currently in use, returns its
291         * default interface vtable.
292         *
293         * Params:
294         *     gType = an interface type
295         *
296         * Returns: the default
297         *     vtable for the interface, or %NULL if the type is not currently
298         *     in use
299         *
300         * Since: 2.4
301         */
302        public static TypeInterface defaultInterfacePeek(GType gType)
303        {
304                auto p = g_type_default_interface_peek(gType);
305               
306                if(p is null)
307                {
308                        return null;
309                }
310               
311                return ObjectG.getDObject!(TypeInterface)(cast(GTypeInterface*) p);
312        }
313
314        /**
315         * Increments the reference count for the interface type @g_type,
316         * and returns the default interface vtable for the type.
317         *
318         * If the type is not currently in use, then the default vtable
319         * for the type will be created and initalized by calling
320         * the base interface init and default vtable init functions for
321         * the type (the @base_init and @class_init members of #GTypeInfo).
322         * Calling g_type_default_interface_ref() is useful when you
323         * want to make sure that signals and properties for an interface
324         * have been installed.
325         *
326         * Params:
327         *     gType = an interface type
328         *
329         * Returns: the default
330         *     vtable for the interface; call g_type_default_interface_unref()
331         *     when you are done using the interface.
332         *
333         * Since: 2.4
334         */
335        public static TypeInterface defaultInterfaceRef(GType gType)
336        {
337                auto p = g_type_default_interface_ref(gType);
338               
339                if(p is null)
340                {
341                        return null;
342                }
343               
344                return ObjectG.getDObject!(TypeInterface)(cast(GTypeInterface*) p);
345        }
346
347        /**
348         * Decrements the reference count for the type corresponding to the
349         * interface default vtable @g_iface. If the type is dynamic, then
350         * when no one is using the interface and all references have
351         * been released, the finalize function for the interface's default
352         * vtable (the @class_finalize member of #GTypeInfo) will be called.
353         *
354         * Params:
355         *     gIface = the default vtable
356         *         structure for a interface, as returned by g_type_default_interface_ref()
357         *
358         * Since: 2.4
359         */
360        public static void defaultInterfaceUnref(TypeInterface gIface)
361        {
362                g_type_default_interface_unref((gIface is null) ? null : gIface.getTypeInterfaceStruct());
363        }
364
365        /**
366         * Returns the length of the ancestry of the passed in type. This
367         * includes the type itself, so that e.g. a fundamental type has depth 1.
368         *
369         * Params:
370         *     type = a #GType
371         *
372         * Returns: the depth of @type
373         */
374        public static uint depth(GType type)
375        {
376                return g_type_depth(type);
377        }
378
379        /**
380         * Ensures that the indicated @type has been registered with the
381         * type system, and its _class_init() method has been run.
382         *
383         * In theory, simply calling the type's _get_type() method (or using
384         * the corresponding macro) is supposed take care of this. However,
385         * _get_type() methods are often marked %G_GNUC_CONST for performance
386         * reasons, even though this is technically incorrect (since
387         * %G_GNUC_CONST requires that the function not have side effects,
388         * which _get_type() methods do on the first call). As a result, if
389         * you write a bare call to a _get_type() macro, it may get optimized
390         * out by the compiler. Using g_type_ensure() guarantees that the
391         * type's _get_type() method is called.
392         *
393         * Params:
394         *     type = a #GType
395         *
396         * Since: 2.34
397         */
398        public static void ensure(GType type)
399        {
400                g_type_ensure(type);
401        }
402
403        /**
404         * Frees an instance of a type, returning it to the instance pool for
405         * the type, if there is one.
406         *
407         * Like g_type_create_instance(), this function is reserved for
408         * implementors of fundamental types.
409         *
410         * Params:
411         *     instanc = an instance of a type
412         */
413        public static void freeInstance(TypeInstance instanc)
414        {
415                g_type_free_instance((instanc is null) ? null : instanc.getTypeInstanceStruct());
416        }
417
418        /**
419         * Lookup the type ID from a given type name, returning 0 if no type
420         * has been registered under this name (this is the preferred method
421         * to find out by name whether a specific type has been registered
422         * yet).
423         *
424         * Params:
425         *     name = type name to lookup
426         *
427         * Returns: corresponding type ID or 0
428         */
429        public static GType fromName(string name)
430        {
431                return g_type_from_name(Str.toStringz(name));
432        }
433
434        /**
435         * Internal function, used to extract the fundamental type ID portion.
436         * Use G_TYPE_FUNDAMENTAL() instead.
437         *
438         * Params:
439         *     typeId = valid type ID
440         *
441         * Returns: fundamental type ID
442         */
443        public static GType fundamental(GType typeId)
444        {
445                return g_type_fundamental(typeId);
446        }
447
448        /**
449         * Returns the next free fundamental type id which can be used to
450         * register a new fundamental type with g_type_register_fundamental().
451         * The returned type ID represents the highest currently registered
452         * fundamental type identifier.
453         *
454         * Returns: the next available fundamental type ID to be registered,
455         *     or 0 if the type system ran out of fundamental type IDs
456         */
457        public static GType fundamentalNext()
458        {
459                return g_type_fundamental_next();
460        }
461
462        /**
463         * Returns the #GTypePlugin structure for @type.
464         *
465         * Params:
466         *     type = #GType to retrieve the plugin for
467         *
468         * Returns: the corresponding plugin
469         *     if @type is a dynamic type, %NULL otherwise
470         */
471        public static TypePluginIF getPlugin(GType type)
472        {
473                auto p = g_type_get_plugin(type);
474               
475                if(p is null)
476                {
477                        return null;
478                }
479               
480                return ObjectG.getDObject!(TypePlugin, TypePluginIF)(cast(GTypePlugin*) p);
481        }
482
483        /**
484         * Obtains data which has previously been attached to @type
485         * with g_type_set_qdata().
486         *
487         * Note that this does not take subtyping into account; data
488         * attached to one type with g_type_set_qdata() cannot
489         * be retrieved from a subtype using g_type_get_qdata().
490         *
491         * Params:
492         *     type = a #GType
493         *     quark = a #GQuark id to identify the data
494         *
495         * Returns: the data, or %NULL if no data was found
496         */
497        public static void* getQdata(GType type, GQuark quark)
498        {
499                return g_type_get_qdata(type, quark);
500        }
501
502        /**
503         * Returns an opaque serial number that represents the state of the set
504         * of registered types. Any time a type is registered this serial changes,
505         * which means you can cache information based on type lookups (such as
506         * g_type_from_name()) and know if the cache is still valid at a later
507         * time by comparing the current serial with the one at the type lookup.
508         *
509         * Returns: An unsigned int, representing the state of type registrations
510         *
511         * Since: 2.36
512         */
513        public static uint getTypeRegistrationSerial()
514        {
515                return g_type_get_type_registration_serial();
516        }
517
518        /**
519         * This function used to initialise the type system.  Since GLib 2.36,
520         * the type system is initialised automatically and this function does
521         * nothing.
522         *
523         * Deprecated: the type system is now initialised automatically
524         */
525        public static void init()
526        {
527                g_type_init();
528        }
529
530        /**
531         * This function used to initialise the type system with debugging
532         * flags.  Since GLib 2.36, the type system is initialised automatically
533         * and this function does nothing.
534         *
535         * If you need to enable debugging features, use the GOBJECT_DEBUG
536         * environment variable.
537         *
538         * Deprecated: the type system is now initialised automatically
539         *
540         * Params:
541         *     debugFlags = bitwise combination of #GTypeDebugFlags values for
542         *         debugging purposes
543         */
544        public static void initWithDebugFlags(GTypeDebugFlags debugFlags)
545        {
546                g_type_init_with_debug_flags(debugFlags);
547        }
548
549        /**
550         * Return a newly allocated and 0-terminated array of type IDs, listing
551         * the interface types that @type conforms to.
552         *
553         * Params:
554         *     type = the type to list interface types for
555         *
556         * Returns: Newly allocated
557         *     and 0-terminated array of interface types, free with g_free()
558         */
559        public static GType[] interfaces(GType type)
560        {
561                uint nInterfaces;
562               
563                auto p = g_type_interfaces(type, &nInterfaces);
564               
565                return p[0 .. nInterfaces];
566        }
567
568        /**
569         * If @is_a_type is a derivable type, check whether @type is a
570         * descendant of @is_a_type. If @is_a_type is an interface, check
571         * whether @type conforms to it.
572         *
573         * Params:
574         *     type = type to check anchestry for
575         *     isAType = possible anchestor of @type or interface that @type
576         *         could conform to
577         *
578         * Returns: %TRUE if @type is a @is_a_type
579         */
580        public static bool isA(GType type, GType isAType)
581        {
582                return g_type_is_a(type, isAType) != 0;
583        }
584
585        /**
586         * Get the unique name that is assigned to a type ID.  Note that this
587         * function (like all other GType API) cannot cope with invalid type
588         * IDs. %G_TYPE_INVALID may be passed to this function, as may be any
589         * other validly registered type ID, but randomized type IDs should
590         * not be passed in and will most likely lead to a crash.
591         *
592         * Params:
593         *     type = type to return name for
594         *
595         * Returns: static type name or %NULL
596         */
597        public static string name(GType type)
598        {
599                return Str.toString(g_type_name(type));
600        }
601
602        /** */
603        public static string nameFromClass(TypeClass gClass)
604        {
605                return Str.toString(g_type_name_from_class((gClass is null) ? null : gClass.getTypeClassStruct()));
606        }
607
608        /** */
609        public static string nameFromInstance(TypeInstance instanc)
610        {
611                return Str.toString(g_type_name_from_instance((instanc is null) ? null : instanc.getTypeInstanceStruct()));
612        }
613
614        /**
615         * Given a @leaf_type and a @root_type which is contained in its
616         * anchestry, return the type that @root_type is the immediate parent
617         * of. In other words, this function determines the type that is
618         * derived directly from @root_type which is also a base class of
619         * @leaf_type.  Given a root type and a leaf type, this function can
620         * be used to determine the types and order in which the leaf type is
621         * descended from the root type.
622         *
623         * Params:
624         *     leafType = descendant of @root_type and the type to be returned
625         *     rootType = immediate parent of the returned type
626         *
627         * Returns: immediate child of @root_type and anchestor of @leaf_type
628         */
629        public static GType nextBase(GType leafType, GType rootType)
630        {
631                return g_type_next_base(leafType, rootType);
632        }
633
634        /**
635         * Return the direct parent type of the passed in type. If the passed
636         * in type has no parent, i.e. is a fundamental type, 0 is returned.
637         *
638         * Params:
639         *     type = the derived type
640         *
641         * Returns: the parent type
642         */
643        public static GType parent(GType type)
644        {
645                return g_type_parent(type);
646        }
647
648        /**
649         * Get the corresponding quark of the type IDs name.
650         *
651         * Params:
652         *     type = type to return quark of type name for
653         *
654         * Returns: the type names quark or 0
655         */
656        public static GQuark qname(GType type)
657        {
658                return g_type_qname(type);
659        }
660
661        /**
662         * Queries the type system for information about a specific type.
663         * This function will fill in a user-provided structure to hold
664         * type-specific information. If an invalid #GType is passed in, the
665         * @type member of the #GTypeQuery is 0. All members filled into the
666         * #GTypeQuery structure should be considered constant and have to be
667         * left untouched.
668         *
669         * Params:
670         *     type = #GType of a static, classed type
671         *     query = a user provided structure that is
672         *         filled in with constant values upon success
673         */
674        public static void query(GType type, out GTypeQuery query)
675        {
676                g_type_query(type, &query);
677        }
678
679        /**
680         * Registers @type_name as the name of a new dynamic type derived from
681         * @parent_type.  The type system uses the information contained in the
682         * #GTypePlugin structure pointed to by @plugin to manage the type and its
683         * instances (if not abstract).  The value of @flags determines the nature
684         * (e.g. abstract or not) of the type.
685         *
686         * Params:
687         *     parentType = type from which this type will be derived
688         *     typeName = 0-terminated string used as the name of the new type
689         *     plugin = #GTypePlugin structure to retrieve the #GTypeInfo from
690         *     flags = bitwise combination of #GTypeFlags values
691         *
692         * Returns: the new type identifier or #G_TYPE_INVALID if registration failed
693         */
694        public static GType registerDynamic(GType parentType, string typeName, TypePluginIF plugin, GTypeFlags flags)
695        {
696                return g_type_register_dynamic(parentType, Str.toStringz(typeName), (plugin is null) ? null : plugin.getTypePluginStruct(), flags);
697        }
698
699        /**
700         * Registers @type_id as the predefined identifier and @type_name as the
701         * name of a fundamental type. If @type_id is already registered, or a
702         * type named @type_name is already registered, the behaviour is undefined.
703         * The type system uses the information contained in the #GTypeInfo structure
704         * pointed to by @info and the #GTypeFundamentalInfo structure pointed to by
705         * @finfo to manage the type and its instances. The value of @flags determines
706         * additional characteristics of the fundamental type.
707         *
708         * Params:
709         *     typeId = a predefined type identifier
710         *     typeName = 0-terminated string used as the name of the new type
711         *     info = #GTypeInfo structure for this type
712         *     finfo = #GTypeFundamentalInfo structure for this type
713         *     flags = bitwise combination of #GTypeFlags values
714         *
715         * Returns: the predefined type identifier
716         */
717        public static GType registerFundamental(GType typeId, string typeName, GTypeInfo* info, GTypeFundamentalInfo* finfo, GTypeFlags flags)
718        {
719                return g_type_register_fundamental(typeId, Str.toStringz(typeName), info, finfo, flags);
720        }
721
722        /**
723         * Registers @type_name as the name of a new static type derived from
724         * @parent_type. The type system uses the information contained in the
725         * #GTypeInfo structure pointed to by @info to manage the type and its
726         * instances (if not abstract). The value of @flags determines the nature
727         * (e.g. abstract or not) of the type.
728         *
729         * Params:
730         *     parentType = type from which this type will be derived
731         *     typeName = 0-terminated string used as the name of the new type
732         *     info = #GTypeInfo structure for this type
733         *     flags = bitwise combination of #GTypeFlags values
734         *
735         * Returns: the new type identifier
736         */
737        public static GType registerStatic(GType parentType, string typeName, GTypeInfo* info, GTypeFlags flags)
738        {
739                return g_type_register_static(parentType, Str.toStringz(typeName), info, flags);
740        }
741
742        /**
743         * Registers @type_name as the name of a new static type derived from
744         * @parent_type.  The value of @flags determines the nature (e.g.
745         * abstract or not) of the type. It works by filling a #GTypeInfo
746         * struct and calling g_type_register_static().
747         *
748         * Params:
749         *     parentType = type from which this type will be derived
750         *     typeName = 0-terminated string used as the name of the new type
751         *     classSize = size of the class structure (see #GTypeInfo)
752         *     classInit = location of the class initialization function (see #GTypeInfo)
753         *     instanceSize = size of the instance structure (see #GTypeInfo)
754         *     instanceInit = location of the instance initialization function (see #GTypeInfo)
755         *     flags = bitwise combination of #GTypeFlags values
756         *
757         * Returns: the new type identifier
758         *
759         * Since: 2.12
760         */
761        public static GType registerStaticSimple(GType parentType, string typeName, uint classSize, GClassInitFunc classInit, uint instanceSize, GInstanceInitFunc instanceInit, GTypeFlags flags)
762        {
763                return g_type_register_static_simple(parentType, Str.toStringz(typeName), classSize, classInit, instanceSize, instanceInit, flags);
764        }
765
766        /**
767         * Removes a previously installed #GTypeClassCacheFunc. The cache
768         * maintained by @cache_func has to be empty when calling
769         * g_type_remove_class_cache_func() to avoid leaks.
770         *
771         * Params:
772         *     cacheData = data that was given when adding @cache_func
773         *     cacheFunc = a #GTypeClassCacheFunc
774         */
775        public static void removeClassCacheFunc(void* cacheData, GTypeClassCacheFunc cacheFunc)
776        {
777                g_type_remove_class_cache_func(cacheData, cacheFunc);
778        }
779
780        /**
781         * Removes an interface check function added with
782         * g_type_add_interface_check().
783         *
784         * Params:
785         *     checkData = callback data passed to g_type_add_interface_check()
786         *     checkFunc = callback function passed to g_type_add_interface_check()
787         *
788         * Since: 2.4
789         */
790        public static void removeInterfaceCheck(void* checkData, GTypeInterfaceCheckFunc checkFunc)
791        {
792                g_type_remove_interface_check(checkData, checkFunc);
793        }
794
795        /**
796         * Attaches arbitrary data to a type.
797         *
798         * Params:
799         *     type = a #GType
800         *     quark = a #GQuark id to identify the data
801         *     data = the data
802         */
803        public static void setQdata(GType type, GQuark quark, void* data)
804        {
805                g_type_set_qdata(type, quark, data);
806        }
807
808        /** */
809        public static bool testFlags(GType type, uint flags)
810        {
811                return g_type_test_flags(type, flags) != 0;
812        }
813}
Note: See TracBrowser for help on using the repository browser.