1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
2 * GObject introspection: Private headers
3 *
4 * Copyright (C) 2010 Johan Dahlin
5 *
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
22 */
23
24 #pragma once
25
26 #include <ffi.h>
27 #include <glib.h>
28
29 #define __GIREPOSITORY_H_INSIDE__
30
31 #include <girepository/gibaseinfo.h>
32 #include <girepository/girepository.h>
33 #include <girepository/gitypelib.h>
34
35 /* FIXME: For now, GIRealInfo is a compatibility define. This will eventually
36 * be removed. */
37 typedef struct _GIBaseInfo GIRealInfo;
38
39 /* We changed a gint32 -> gint in the structure below, which should be
40 * valid everywhere we care about.
41 */
42 G_STATIC_ASSERT (sizeof (int) == sizeof (gint32));
43
44 /*
45 * We just use one structure for all of the info object
46 * types; in general, we should be reading data directly
47 * from the typelib, and not having computed data in
48 * per-type structures.
49 */
50 struct _GIBaseInfo
51 {
52 /*< private >*/
53 GTypeInstance parent_instance;
54 gatomicrefcount ref_count;
55
56 GIRepository *repository;
57 GIBaseInfo *container;
58
59 GITypelib *typelib;
60 guint32 offset;
61
62 guint32 type_is_embedded : 1; /* Used by GITypeInfo */
63 };
64
65 /* Subtypes */
66 struct _GICallableInfo
67 {
68 GIBaseInfo parent;
69 };
70
71 void gi_callable_info_class_init (gpointer g_class,
72 gpointer class_data);
73
74 struct _GIFunctionInfo
75 {
76 GIBaseInfo parent;
77 };
78
79 void gi_function_info_class_init (gpointer g_class,
80 gpointer class_data);
81
82 struct _GICallbackInfo
83 {
84 GIBaseInfo parent;
85 };
86
87 void gi_callback_info_class_init (gpointer g_class,
88 gpointer class_data);
89
90 struct _GIRegisteredTypeInfo
91 {
92 GIBaseInfo parent;
93 };
94
95 void gi_registered_type_info_class_init (gpointer g_class,
96 gpointer class_data);
97
98 struct _GIStructInfo
99 {
100 GIBaseInfo parent;
101 };
102
103 void gi_struct_info_class_init (gpointer g_class,
104 gpointer class_data);
105
106 struct _GIUnionInfo
107 {
108 GIBaseInfo parent;
109 };
110
111 void gi_union_info_class_init (gpointer g_class,
112 gpointer class_data);
113
114 struct _GIEnumInfo
115 {
116 GIBaseInfo parent;
117 };
118
119 void gi_enum_info_class_init (gpointer g_class,
120 gpointer class_data);
121
122 struct _GIObjectInfo
123 {
124 GIBaseInfo parent;
125 };
126
127 void gi_object_info_class_init (gpointer g_class,
128 gpointer class_data);
129
130 struct _GIInterfaceInfo
131 {
132 GIBaseInfo parent;
133 };
134
135 void gi_interface_info_class_init (gpointer g_class,
136 gpointer class_data);
137
138 struct _GIConstantInfo
139 {
140 GIBaseInfo parent;
141 };
142
143 void gi_constant_info_class_init (gpointer g_class,
144 gpointer class_data);
145
146 struct _GIValueInfo
147 {
148 GIBaseInfo parent;
149 };
150
151 void gi_value_info_class_init (gpointer g_class,
152 gpointer class_data);
153
154 struct _GISignalInfo
155 {
156 GIBaseInfo parent;
157 };
158
159 void gi_signal_info_class_init (gpointer g_class,
160 gpointer class_data);
161
162 struct _GIVFuncInfo
163 {
164 GIBaseInfo parent;
165 };
166
167 void gi_vfunc_info_class_init (gpointer g_class,
168 gpointer class_data);
169
170 struct _GIPropertyInfo
171 {
172 GIBaseInfo parent;
173 };
174
175 void gi_property_info_class_init (gpointer g_class,
176 gpointer class_data);
177
178 struct _GIFieldInfo
179 {
180 GIBaseInfo parent;
181 };
182
183 void gi_field_info_class_init (gpointer g_class,
184 gpointer class_data);
185
186 struct _GIArgInfo
187 {
188 GIBaseInfo parent;
189 };
190
191 void gi_arg_info_class_init (gpointer g_class,
192 gpointer class_data);
193
194 struct _GITypeInfo
195 {
196 GIBaseInfo parent;
197 };
198
199 void gi_type_info_class_init (gpointer g_class,
200 gpointer class_data);
201
202 struct _GIUnresolvedInfo
203 {
204 GIBaseInfo parent;
205
206 const gchar *name;
207 const gchar *namespace;
208 };
209
210 void gi_unresolved_info_class_init (gpointer g_class,
211 gpointer class_data);
212
213 void gi_info_init (GIRealInfo *info,
214 GIInfoType type,
215 GIRepository *repository,
216 GIBaseInfo *container,
217 GITypelib *typelib,
218 guint32 offset);
219
220 GIBaseInfo * gi_info_from_entry (GIRepository *repository,
221 GITypelib *typelib,
222 guint16 index);
223
224 GIBaseInfo * gi_info_new_full (GIInfoType type,
225 GIRepository *repository,
226 GIBaseInfo *container,
227 GITypelib *typelib,
228 guint32 offset);
229
230 GITypeInfo * gi_type_info_new (GIBaseInfo *container,
231 GITypelib *typelib,
232 guint32 offset);
233
234 void gi_type_info_init (GIBaseInfo *info,
235 GIBaseInfo *container,
236 GITypelib *typelib,
237 guint32 offset);
238
239 GIFunctionInfo * gi_base_info_find_method (GIBaseInfo *base,
240 guint32 offset,
241 guint n_methods,
242 const gchar *name);
243
244 GIVFuncInfo * gi_base_info_find_vfunc (GIRealInfo *rinfo,
245 guint32 offset,
246 guint n_vfuncs,
247 const gchar *name);