1
// included by glib2.pas
3
{$IFDEF read_forward_definitions}
8
{ Basic Type Structures }
10
PGTypeClass = ^TGTypeClass;
16
PGTypeInstance = ^TGTypeInstance;
17
TGTypeInstance = record
18
g_class : PGTypeClass;
23
PGTypeInterface = ^TGTypeInterface;
24
TGTypeInterface = record
26
g_instance_type : GType;
29
PGTypeQuery = ^TGTypeQuery;
34
instance_size : guint;
36
{$ENDIF read_forward_definitions}
38
//------------------------------------------------------------------------------
40
{$IFDEF read_interface_rest}
45
G_TYPE_FUNDAMENTAL_SHIFT = 2;
46
G_TYPE_FUNDAMENTAL_MAX = 255 shl G_TYPE_FUNDAMENTAL_SHIFT;
48
{ Constant fundamental types,
49
introduced by g_type_init(). }
50
G_TYPE_INVALID = GType(0 shl G_TYPE_FUNDAMENTAL_SHIFT);
51
G_TYPE_NONE = GType(1 shl G_TYPE_FUNDAMENTAL_SHIFT);
52
G_TYPE_INTERFACE = GType(2 shl G_TYPE_FUNDAMENTAL_SHIFT);
53
G_TYPE_CHAR = GType(3 shl G_TYPE_FUNDAMENTAL_SHIFT);
54
G_TYPE_UCHAR = GType(4 shl G_TYPE_FUNDAMENTAL_SHIFT);
55
G_TYPE_BOOLEAN = GType(5 shl G_TYPE_FUNDAMENTAL_SHIFT);
56
G_TYPE_INT = GType(6 shl G_TYPE_FUNDAMENTAL_SHIFT);
57
G_TYPE_UINT = GType(7 shl G_TYPE_FUNDAMENTAL_SHIFT);
58
G_TYPE_LONG = GType(8 shl G_TYPE_FUNDAMENTAL_SHIFT);
59
G_TYPE_ULONG = GType(9 shl G_TYPE_FUNDAMENTAL_SHIFT);
60
G_TYPE_INT64 = GType(10 shl G_TYPE_FUNDAMENTAL_SHIFT);
61
G_TYPE_UINT64 = GType(11 shl G_TYPE_FUNDAMENTAL_SHIFT);
62
G_TYPE_ENUM = GType(12 shl G_TYPE_FUNDAMENTAL_SHIFT);
63
G_TYPE_FLAGS = GType(13 shl G_TYPE_FUNDAMENTAL_SHIFT);
64
G_TYPE_FLOAT = GType(14 shl G_TYPE_FUNDAMENTAL_SHIFT);
65
G_TYPE_DOUBLE = GType(15 shl G_TYPE_FUNDAMENTAL_SHIFT);
66
G_TYPE_STRING = GType(16 shl G_TYPE_FUNDAMENTAL_SHIFT);
67
G_TYPE_POINTER = GType(17 shl G_TYPE_FUNDAMENTAL_SHIFT);
68
G_TYPE_BOXED = GType(18 shl G_TYPE_FUNDAMENTAL_SHIFT);
69
G_TYPE_PARAM = GType(19 shl G_TYPE_FUNDAMENTAL_SHIFT);
70
G_TYPE_OBJECT = GType(20 shl G_TYPE_FUNDAMENTAL_SHIFT);
72
{ Reserved fundamental type numbers to create new fundamental
73
type IDs with G_TYPE_MAKE_FUNDAMENTAL().
74
Send email to gtk-devel-list@redhat.com for reservations.
77
function G_TYPE_MAKE_FUNDAMENTAL(x : longint) : GType;
81
G_TYPE_RESERVED_GLIB_FIRST = 21;
82
G_TYPE_RESERVED_GLIB_LAST = 31;
83
G_TYPE_RESERVED_BSE_FIRST = 32;
84
G_TYPE_RESERVED_BSE_LAST = 48;
85
G_TYPE_RESERVED_USER_FIRST = 49;
88
{ Type Checking Macros }
90
function G_TYPE_IS_FUNDAMENTAL(_type : GType) : boolean;
91
function G_TYPE_IS_DERIVED(_type : GType) : boolean;
92
function G_TYPE_IS_INTERFACE(_type : GType) : boolean;
93
function G_TYPE_IS_CLASSED(_type : GType) : gboolean;
94
function G_TYPE_IS_INSTANTIATABLE(_type : GType) : boolean;
95
function G_TYPE_IS_DERIVABLE(_type : GType) : boolean;
96
function G_TYPE_IS_DEEP_DERIVABLE(_type : GType) : boolean;
97
function G_TYPE_IS_ABSTRACT(_type : GType) : boolean;
98
function G_TYPE_IS_VALUE_ABSTRACT(_type : GType) : boolean;
99
function G_TYPE_IS_VALUE_TYPE(_type : GType) : boolean;
100
function G_TYPE_HAS_VALUE_TABLE(_type : GType) : boolean;
102
{ Casts, checks and accessors for structured types
103
usage of these macros is reserved to type implementations only }
105
function G_TYPE_CHECK_INSTANCE(instance : Pointer) : gboolean;
106
function G_TYPE_CHECK_INSTANCE_CAST(instance: Pointer; g_type: GType) : PGTypeInstance;
107
function G_TYPE_CHECK_INSTANCE_TYPE(instance: Pointer; g_type: GType) : boolean;
108
function G_TYPE_INSTANCE_GET_CLASS(instance: Pointer; g_type: GType) : PGTypeClass;
109
function G_TYPE_INSTANCE_GET_INTERFACE(instance: Pointer; g_type: GType) : Pointer;
110
function G_TYPE_CHECK_CLASS_CAST(g_class: pointer; g_type: GType) : Pointer;
111
function G_TYPE_CHECK_CLASS_TYPE(g_class: pointer; g_type : GType) : boolean;
112
function G_TYPE_CHECK_VALUE(value : Pointer) : boolean;
113
function G_TYPE_CHECK_VALUE_TYPE(value: pointer; g_type : GType) : boolean;
114
function G_TYPE_FROM_INSTANCE(instance : Pointer) : GType;
115
function G_TYPE_FROM_CLASS(g_class : Pointer) : GType;
116
function G_TYPE_FROM_INTERFACE(g_iface : Pointer) : GType;
118
{ debug flags for g_type_init_with_debug_flags() }
121
PGTypeDebugFlags = ^TGTypeDebugFlags;
122
TGTypeDebugFlags = longint;
125
G_TYPE_DEBUG_NONE = 0;
126
G_TYPE_DEBUG_OBJECTS = 1 shl 0;
127
G_TYPE_DEBUG_SIGNALS = 1 shl 1;
128
G_TYPE_DEBUG_MASK = $03;
131
{ --- prototypes --- }
133
procedure g_type_init; cdecl; external gobjectlib;
134
procedure g_type_init_with_debug_flags(debug_flags:TGTypeDebugFlags); cdecl; external gobjectlib;
135
function g_type_name(_type:GType):Pgchar; cdecl; external gobjectlib;
136
function g_type_qname(_type:GType):TGQuark; cdecl; external gobjectlib;
137
function g_type_from_name(name:Pgchar):GType; cdecl; external gobjectlib;
138
function g_type_parent(_type:GType):GType; cdecl; external gobjectlib;
139
function g_type_depth(_type:GType):guint; cdecl; external gobjectlib;
140
function g_type_next_base(leaf_type:GType; root_type:GType):GType; cdecl; external gobjectlib;
141
function g_type_is_a(_type:GType; is_a_type:GType):gboolean; cdecl; external gobjectlib;
142
function g_type_class_ref(_type:GType):gpointer; cdecl; external gobjectlib;
143
function g_type_class_peek(_type:GType):gpointer; cdecl; external gobjectlib;
144
procedure g_type_class_unref(g_class:gpointer); cdecl; external gobjectlib;
145
function g_type_class_peek_parent(g_class:gpointer):gpointer; cdecl; external gobjectlib;
146
function g_type_interface_peek(instance_class:gpointer; iface_type:GType):gpointer; cdecl; external gobjectlib;
147
function g_type_interface_peek_parent(g_iface:gpointer):gpointer; cdecl; external gobjectlib;
148
{ g_free() the returned arrays }
149
function g_type_children(_type:GType; n_children:Pguint):PGType; cdecl; external gobjectlib;
150
function g_type_interfaces(_type:GType; n_interfaces:Pguint):PGType; cdecl; external gobjectlib;
151
{ per-type _static_ data }
152
procedure g_type_set_qdata(_type:GType; quark:TGQuark; data:gpointer); cdecl; external gobjectlib;
153
function g_type_get_qdata(_type:GType; quark:TGQuark):gpointer; cdecl; external gobjectlib;
154
procedure g_type_query(_type:GType; query:PGTypeQuery); cdecl; external gobjectlib;
157
{ --- type registration --- }
159
TGBaseInitFunc = procedure (g_class:gpointer); cdecl;
161
TGBaseFinalizeFunc = procedure (g_class:gpointer); cdecl;
163
TGClassInitFunc = procedure (g_class:gpointer; class_data:gpointer); cdecl;
165
TGClassFinalizeFunc = procedure (g_class:gpointer; class_data:gpointer); cdecl;
167
TGInstanceInitFunc = procedure (instance:PGTypeInstance; g_class:gpointer); cdecl;
169
TGInterfaceInitFunc = procedure (g_iface:gpointer; iface_data:gpointer); cdecl;
171
TGInterfaceFinalizeFunc = procedure (g_iface:gpointer; iface_data:gpointer); cdecl;
173
TGTypeClassCacheFunc = function (cache_data:gpointer; g_class:PGTypeClass):gboolean; cdecl;
177
PGTypeFundamentalFlags = ^TGTypeFundamentalFlags;
178
TGTypeFundamentalFlags = longint;
181
G_TYPE_FLAG_CLASSED = 1 shl 0;
182
G_TYPE_FLAG_INSTANTIATABLE = 1 shl 1;
183
G_TYPE_FLAG_DERIVABLE = 1 shl 2;
184
G_TYPE_FLAG_DEEP_DERIVABLE = 1 shl 3;
189
PGTypeFlags = ^TGTypeFlags;
190
TGTypeFlags = longint;
193
G_TYPE_FLAG_ABSTRACT = 1 shl 4;
194
G_TYPE_FLAG_VALUE_ABSTRACT = 1 shl 5;
197
{ interface types, classed types, instantiated types }
199
{ varargs functionality (optional) }
200
PGTypeValueTable = ^TGTypeValueTable;
201
TGTypeValueTable = record
202
value_init : procedure (value:PGValue); cdecl;
203
value_free : procedure (value:PGValue); cdecl;
204
value_copy : procedure (src_value:PGValue; dest_value:PGValue); cdecl;
205
value_peek_pointer : function (value:PGValue):gpointer; cdecl;
206
collect_format : Pgchar;
207
collect_value : function (value:PGValue; n_collect_values:guint; collect_values:PGTypeCValue; collect_flags:guint):Pgchar; cdecl;
208
lcopy_format : Pgchar;
209
lcopy_value : function (value:PGValue; n_collect_values:guint; collect_values:PGTypeCValue; collect_flags:guint):Pgchar; cdecl;
213
{ classed types, instantiated types }
214
{ instantiated types }
216
PGTypeInfo = ^TGTypeInfo;
218
class_size : guint16;
219
base_init : TGBaseInitFunc;
220
base_finalize : TGBaseFinalizeFunc;
221
class_init : TGClassInitFunc;
222
class_finalize : TGClassFinalizeFunc;
223
class_data : gconstpointer;
224
instance_size : guint16;
225
n_preallocs : guint16;
226
instance_init : TGInstanceInitFunc;
227
value_table : PGTypeValueTable;
230
PGTypeFundamentalInfo = ^TGTypeFundamentalInfo;
231
TGTypeFundamentalInfo = record
232
type_flags : TGTypeFundamentalFlags;
235
PGInterfaceInfo = ^TGInterfaceInfo;
236
TGInterfaceInfo = record
237
interface_init : TGInterfaceInitFunc;
238
interface_finalize : TGInterfaceFinalizeFunc;
239
interface_data : gpointer;
243
function g_type_register_static(parent_type:GType; type_name:Pgchar; info:PGTypeInfo; flags:TGTypeFlags):GType; cdecl; external gobjectlib;
244
function g_type_register_dynamic(parent_type:GType; type_name:Pgchar; plugin:PGTypePlugin; flags:TGTypeFlags):GType; cdecl; external gobjectlib;
245
function g_type_register_fundamental(type_id:GType; type_name:Pgchar; info:PGTypeInfo; finfo:PGTypeFundamentalInfo; flags:TGTypeFlags):GType; cdecl; external gobjectlib;
246
procedure g_type_add_interface_static(instance_type:GType; interface_type:GType; info:PGInterfaceInfo); cdecl; external gobjectlib;
247
procedure g_type_add_interface_dynamic(instance_type:GType; interface_type:GType; plugin:PGTypePlugin); cdecl; external gobjectlib;
248
procedure g_type_interface_add_prerequisite(interface_type:GType; prerequisite_type:GType); cdecl; external gobjectlib;
249
{ --- protected (for fundamental type implementations) --- }
250
function g_type_get_plugin(_type:GType):PGTypePlugin; cdecl; external gobjectlib;
251
function g_type_interface_get_plugin(instance_type:GType; implementation_type:GType):PGTypePlugin; cdecl; external gobjectlib;
252
function g_type_fundamental_next:GType; cdecl; external gobjectlib;
253
function g_type_fundamental(type_id:GType):GType; cdecl; external gobjectlib;
254
function g_type_create_instance(_type:GType):PGTypeInstance; cdecl; external gobjectlib;
255
procedure g_type_free_instance(instance:PGTypeInstance); cdecl; external gobjectlib;
256
procedure g_type_add_class_cache_func(cache_data:gpointer; cache_func:TGTypeClassCacheFunc); cdecl; external gobjectlib;
257
procedure g_type_remove_class_cache_func(cache_data:gpointer; cache_func:TGTypeClassCacheFunc); cdecl; external gobjectlib;
258
procedure g_type_class_unref_uncached(g_class:gpointer); cdecl; external gobjectlib;
259
function g_type_value_table_peek(_type:GType):PGTypeValueTable; cdecl; external gobjectlib;
261
function private_g_type_check_instance(instance:PGTypeInstance):gboolean; cdecl; external gobjectlib name 'g_type_check_instance';
262
function private_g_type_check_instance_cast(instance:PGTypeInstance; iface_type:GType):PGTypeInstance; cdecl; external gobjectlib name 'g_type_check_instance_cast';
263
function private_g_type_check_instance_is_a(instance:PGTypeInstance; iface_type:GType):gboolean; cdecl; external gobjectlib name 'g_type_check_instance_is_a';
264
function private_g_type_check_class_cast(g_class:PGTypeClass; is_a_type:GType):PGTypeClass; cdecl; external gobjectlib name 'g_type_check_class_cast';
265
function private_g_type_check_class_is_a(g_class:PGTypeClass; is_a_type:GType):gboolean; cdecl; external gobjectlib name 'g_type_check_class_is_a';
266
function private_g_type_check_is_value_type(_type:GType):gboolean; cdecl; external gobjectlib name 'g_type_check_is_value_type';
267
function private_g_type_check_value(value:PGValue):gboolean; cdecl; external gobjectlib name 'g_type_check_value';
268
function private_g_type_check_value_holds(value:PGValue; _type:GType):gboolean; cdecl; external gobjectlib name 'g_type_check_value_holds';
269
function private_g_type_test_flags(_type:GType; flags:guint):gboolean; cdecl; external gobjectlib name 'g_type_test_flags';
270
{ --- debugging functions --- }
271
function g_type_name_from_instance(instance:PGTypeInstance):Pgchar; cdecl; external gobjectlib;
272
function g_type_name_from_class(g_class:PGTypeClass):Pgchar; cdecl; external gobjectlib;
273
{ --- implementation bits --- }
276
G_TYPE_FLAG_RESERVED_ID_BIT = GType(1 shl 0);
278
{$ENDIF read_interface_rest}
280
// included by glib2.pas