miscellaneous classes, containers, child properties
[cl-gtk2.git] / glib / gobject.type.lisp
1 (in-package :gobject)
2
3 (defcfun (g-type-fundamental "g_type_fundamental") g-type
4   (type-id g-type))
5
6 (defcfun (%g-type-init "g_type_init") :void)
7
8 (%g-type-init)
9
10 (defcfun (g-type-name "g_type_name") :string
11   (type g-type))
12
13 (defcfun (g-type-from-name "g_type_from_name") g-type
14   (name :string))
15
16 (defcfun g-type-parent g-type
17   (type g-type))
18
19 (defcfun g-type-depth :uint
20   (type g-type))
21
22 (defcfun g-type-next-base g-type
23   (leaf-type g-type)
24   (root-type g-type))
25
26 (defcfun g-type-is-a :boolean
27   (type g-type)
28   (is-a-type g-type))
29
30 (defcfun g-type-class-ref (:pointer g-type-class)
31   (type g-type))
32
33 (defcfun g-type-class-unref :void
34   (class (:pointer g-type-class)))
35
36 (defcfun g-type-class-add-private :void
37   (class (:pointer g-type-class))
38   (private-size gsize))
39
40 (defcfun g-type-default-interface-ref :pointer
41   (type g-type))
42
43 (defcfun g-type-default-interface-unref :void
44   (interface :pointer))
45
46 (defcfun (%g-type-children "g_type_children") (:pointer g-type)
47   (type g-type)
48   (n-children (:pointer :uint)))
49
50 (defun g-type-children (g-type)
51   (setf g-type (ensure-g-type g-type))
52   (with-foreign-object (n-children :uint)
53     (let ((g-types-ptr (%g-type-children g-type n-children)))
54       (prog1
55           (loop
56              for i from 0 below (mem-ref n-children :uint)
57              collect (mem-aref g-types-ptr 'g-type i))
58         (g-free g-types-ptr)))))
59
60 (defcfun (%g-type-interfaces "g_type_interfaces") (:pointer g-type)
61   (type g-type)
62   (n-interfaces (:pointer :uint)))
63
64 (defun g-type-interfaces (g-type)
65   (setf g-type (ensure-g-type g-type))
66   (with-foreign-object (n-interfaces :uint)
67     (let ((g-types-ptr (%g-type-interfaces g-type n-interfaces)))
68       (prog1
69           (loop
70              for i from 0 below (mem-ref n-interfaces :uint)
71              collect (mem-aref g-types-ptr 'g-type i))
72         (g-free g-types-ptr)))))
73
74 (defcfun (%g-type-interface-prerequisites "g_type_interface_prerequisites") (:pointer g-type)
75   (type g-type)
76   (n-interface-prerequisites (:pointer :uint)))
77
78 (defun g-type-interface-prerequisites (g-type)
79   (with-foreign-object (n-interface-prerequisites :uint)
80     (let ((g-types-ptr (%g-type-interface-prerequisites g-type n-interface-prerequisites)))
81       (prog1
82           (loop
83              for i from 0 below (mem-ref n-interface-prerequisites :uint)
84              collect (mem-aref g-types-ptr 'g-type i))
85         (g-free g-types-ptr)))))
86
87 (defcfun g-type-register-static g-type
88   (parent-type g-type)
89   (type-name :string)
90   (info (:pointer g-type-info))
91   (flags g-type-flags))
92
93 (defcfun g-type-register-static-simple g-type
94   (parent-type g-type)
95   (type-name :string)
96   (class-size :uint)
97   (class-init :pointer)
98   (instance-size :uint)
99   (instance-init :pointer)
100   (flags g-type-flags))
101
102 (defcfun g-type-add-interface-static :void
103   (instance-type g-type)
104   (interface-type g-type)
105   (info (:pointer g-interface-info)))
106
107 (defcfun g-type-interface-add-prerequisite :void
108   (interface-type g-type)
109   (prerequisite-type g-type))
110
111 (defun g-type-from-object (object)
112   (g-type-from-instance object))
113
114 (defun g-type-from-class (g-class)
115   (foreign-slot-value g-class 'g-type-class 'type))
116
117 (defun g-type-from-instance (type-instance)
118   (g-type-from-class (foreign-slot-value type-instance 'g-type-instance 'class)))
119
120 (defun g-type-from-interface (type-interface)
121   (foreign-slot-value type-interface 'g-type-interface 'type))
122
123 (defcfun g-strv-get-type g-type)
124
125 (g-strv-get-type)
126
127 (defcfun g-closure-get-type g-type)
128
129 (g-closure-get-type)
130
131 (defcfun g-type-query :void
132   (type g-type)
133   (query (:pointer g-type-query)))