3 (defcfun (g-type-fundamental "g_type_fundamental") g-type
6 (defcfun (%g-type-init "g_type_init") :void)
8 (at-init () (%g-type-init))
10 (defcfun (g-type-name "g_type_name") :string
11 "Returns the GType name
13 @arg[type]{an integer specifying the GType}
14 @return{a string - name of type}"
17 (defcfun (g-type-from-name "g_type_from_name") g-type
18 "Looks up the GType by its name
20 @arg[name]{a string naming the type}
21 @return{an integer specifying GType}"
24 (defcfun g-type-parent g-type
25 "Returns the parent of a GType
27 @arg[type]{an integer specifying the GType}
28 @return{an integer specifying the parent GType}"
31 (defcfun g-type-depth :uint
34 (defcfun g-type-next-base g-type
38 (defcfun g-type-is-a :boolean
42 (defcfun g-type-class-ref (:pointer g-type-class)
45 (defcfun g-type-class-unref :void
46 (class (:pointer g-type-class)))
48 (defcfun g-type-class-add-private :void
49 (class (:pointer g-type-class))
52 (defcfun g-type-default-interface-ref :pointer
55 (defcfun g-type-default-interface-unref :void
58 (defcfun (%g-type-children "g_type_children") (:pointer g-type)
60 (n-children (:pointer :uint)))
62 (defun g-type-children (g-type)
63 "Returns the list of types inherited from @code{g-type}.
65 @arg[g-type]{an integer or a string specifying type}"
66 (setf g-type (ensure-g-type g-type))
67 (with-foreign-object (n-children :uint)
68 (let ((g-types-ptr (%g-type-children g-type n-children)))
71 for i from 0 below (mem-ref n-children :uint)
72 collect (mem-aref g-types-ptr 'g-type i))
73 (g-free g-types-ptr)))))
75 (defcfun (%g-type-interfaces "g_type_interfaces") (:pointer g-type)
77 (n-interfaces (:pointer :uint)))
79 (defun g-type-interfaces (g-type)
80 (setf g-type (ensure-g-type g-type))
81 (with-foreign-object (n-interfaces :uint)
82 (let ((g-types-ptr (%g-type-interfaces g-type n-interfaces)))
85 for i from 0 below (mem-ref n-interfaces :uint)
86 collect (mem-aref g-types-ptr 'g-type i))
87 (g-free g-types-ptr)))))
89 (defcfun (%g-type-interface-prerequisites "g_type_interface_prerequisites") (:pointer g-type)
91 (n-interface-prerequisites (:pointer :uint)))
93 (defun g-type-interface-prerequisites (g-type)
94 (with-foreign-object (n-interface-prerequisites :uint)
95 (let ((g-types-ptr (%g-type-interface-prerequisites g-type n-interface-prerequisites)))
98 for i from 0 below (mem-ref n-interface-prerequisites :uint)
99 collect (mem-aref g-types-ptr 'g-type i))
100 (g-free g-types-ptr)))))
102 (defcfun g-type-register-static g-type
105 (info (:pointer g-type-info))
106 (flags g-type-flags))
108 (defcfun g-type-register-static-simple g-type
112 (class-init :pointer)
113 (instance-size :uint)
114 (instance-init :pointer)
115 (flags g-type-flags))
117 (defcfun g-type-add-interface-static :void
118 (instance-type g-type)
119 (interface-type g-type)
120 (info (:pointer g-interface-info)))
122 (defcfun g-type-interface-add-prerequisite :void
123 (interface-type g-type)
124 (prerequisite-type g-type))
126 (defun g-type-from-object (object)
127 "Returns the GType of an @code{object}
129 @arg[object]{C pointer to an object}
130 @return{an integer specifying the GType}"
131 (g-type-from-instance object))
133 (defun g-type-from-class (g-class)
134 (foreign-slot-value g-class 'g-type-class 'type))
136 (defun g-type-from-instance (type-instance)
137 (g-type-from-class (foreign-slot-value type-instance 'g-type-instance 'class)))
139 (defun g-type-from-interface (type-interface)
140 (foreign-slot-value type-interface 'g-type-interface 'type))
142 (defcfun g-strv-get-type g-type)
146 (defcfun g-closure-get-type g-type)
150 (defcfun g-type-query :void
152 (query (:pointer g-type-query)))