2012-02-03 19:42:56 +01:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
|
|
|
|
* GObject introspection: Parsed GIR
|
2008-08-09 14:46:48 +02:00
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Matthias Clasen
|
|
|
|
*
|
2023-10-25 18:10:10 +02:00
|
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
*
|
2008-08-09 14:46:48 +02:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2023-11-07 19:23:17 +01:00
|
|
|
#pragma once
|
2008-08-09 14:46:48 +02:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
2023-11-08 01:06:01 +01:00
|
|
|
#include "girmodule-private.h"
|
2008-11-11 01:48:17 +01:00
|
|
|
|
2008-08-09 14:46:48 +02:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
typedef struct _GIIrNode GIIrNode;
|
|
|
|
typedef struct _GIIrNodeFunction GIIrNodeFunction;
|
|
|
|
typedef struct _GIIrNodeParam GIIrNodeParam;
|
|
|
|
typedef struct _GIIrNodeType GIIrNodeType;
|
|
|
|
typedef struct _GIIrNodeInterface GIIrNodeInterface;
|
|
|
|
typedef struct _GIIrNodeSignal GIIrNodeSignal;
|
|
|
|
typedef struct _GIIrNodeProperty GIIrNodeProperty;
|
|
|
|
typedef struct _GIIrNodeVFunc GIIrNodeVFunc;
|
|
|
|
typedef struct _GIIrNodeField GIIrNodeField;
|
|
|
|
typedef struct _GIIrNodeValue GIIrNodeValue;
|
|
|
|
typedef struct _GIIrNodeEnum GIIrNodeEnum;
|
|
|
|
typedef struct _GIIrNodeBoxed GIIrNodeBoxed;
|
|
|
|
typedef struct _GIIrNodeStruct GIIrNodeStruct;
|
|
|
|
typedef struct _GIIrNodeConstant GIIrNodeConstant;
|
|
|
|
typedef struct _GIIrNodeXRef GIIrNodeXRef;
|
|
|
|
typedef struct _GIIrNodeUnion GIIrNodeUnion;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2010-03-24 19:00:06 +01:00
|
|
|
typedef enum
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GI_IR_NODE_INVALID = 0,
|
|
|
|
GI_IR_NODE_FUNCTION = 1,
|
|
|
|
GI_IR_NODE_CALLBACK = 2,
|
|
|
|
GI_IR_NODE_STRUCT = 3,
|
|
|
|
GI_IR_NODE_BOXED = 4,
|
|
|
|
GI_IR_NODE_ENUM = 5,
|
|
|
|
GI_IR_NODE_FLAGS = 6,
|
|
|
|
GI_IR_NODE_OBJECT = 7,
|
|
|
|
GI_IR_NODE_INTERFACE = 8,
|
|
|
|
GI_IR_NODE_CONSTANT = 9,
|
|
|
|
GI_IR_NODE_INVALID_0 = 10, /* DELETED - used to be ERROR_DOMAIN */
|
|
|
|
GI_IR_NODE_UNION = 11,
|
|
|
|
GI_IR_NODE_PARAM = 12,
|
|
|
|
GI_IR_NODE_TYPE = 13,
|
|
|
|
GI_IR_NODE_PROPERTY = 14,
|
|
|
|
GI_IR_NODE_SIGNAL = 15,
|
|
|
|
GI_IR_NODE_VALUE = 16,
|
|
|
|
GI_IR_NODE_VFUNC = 17,
|
|
|
|
GI_IR_NODE_FIELD = 18,
|
|
|
|
GI_IR_NODE_XREF = 19
|
|
|
|
} GIIrNodeTypeId;
|
|
|
|
|
2024-01-17 12:47:49 +01:00
|
|
|
/**
|
|
|
|
* GIIrOffsetsState:
|
|
|
|
* @GI_IR_OFFSETS_UNKNOWN: offsets have not been calculated yet
|
|
|
|
* @GI_IR_OFFSETS_COMPUTED: offsets have been successfully calculated
|
|
|
|
* @GI_IR_OFFSETS_FAILED: calculating the offsets failed
|
|
|
|
* @GI_IR_OFFSETS_IN_PROGRESS: offsets are currently being calculated (used to
|
|
|
|
* detect type recursion)
|
|
|
|
*
|
|
|
|
* State tracking for calculating size and alignment of
|
|
|
|
* [type@GIRepository.IrNode]s.
|
|
|
|
*
|
|
|
|
* Since: 2.80
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GI_IR_OFFSETS_UNKNOWN,
|
|
|
|
GI_IR_OFFSETS_COMPUTED,
|
|
|
|
GI_IR_OFFSETS_FAILED,
|
|
|
|
GI_IR_OFFSETS_IN_PROGRESS,
|
|
|
|
} GIIrOffsetsState;
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNode
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNodeTypeId type;
|
2024-01-25 23:54:25 +01:00
|
|
|
char *name; /* (owned) */
|
|
|
|
GIIrModule *module; /* (unowned) */
|
2009-02-20 03:48:51 +01:00
|
|
|
|
2024-01-15 22:20:02 +01:00
|
|
|
uint32_t offset; /* Assigned as we build the typelib */
|
2009-02-20 03:48:51 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GHashTable *attributes; /* (element-type utf8 utf8) (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeXRef
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *namespace; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeFunction
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t deprecated : 1;
|
|
|
|
uint8_t is_varargs : 1; /* Not in typelib yet */
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t is_method : 1;
|
|
|
|
uint8_t is_setter : 1;
|
|
|
|
uint8_t is_getter : 1;
|
|
|
|
uint8_t is_constructor : 1;
|
|
|
|
uint8_t wraps_vfunc : 1;
|
|
|
|
uint8_t throws : 1;
|
|
|
|
uint8_t instance_transfer_full : 1;
|
2024-05-07 15:46:13 +02:00
|
|
|
uint8_t is_async : 1;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *symbol; /* (owned) */
|
|
|
|
char *property; /* (owned) */
|
2024-05-07 15:46:13 +02:00
|
|
|
char *finish_func; /* (owned) */
|
|
|
|
char *sync_func; /* (owned) */
|
|
|
|
char *async_func; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GIIrNodeParam *result; /* (owned) */
|
|
|
|
GList *parameters; /* (element-type GIIrNode) (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeType
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t is_pointer : 1;
|
|
|
|
uint8_t is_basic : 1;
|
|
|
|
uint8_t is_array : 1;
|
|
|
|
uint8_t is_glist : 1;
|
|
|
|
uint8_t is_gslist : 1;
|
|
|
|
uint8_t is_ghashtable : 1;
|
|
|
|
uint8_t is_interface : 1;
|
|
|
|
uint8_t is_error : 1;
|
2024-01-15 22:20:02 +01:00
|
|
|
int tag;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *unparsed; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t zero_terminated : 1;
|
|
|
|
uint8_t has_length : 1;
|
2024-01-26 10:15:43 +01:00
|
|
|
unsigned int length;
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t has_size : 1;
|
2024-01-26 10:15:43 +01:00
|
|
|
size_t size;
|
|
|
|
GIArrayType array_type;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GIIrNodeType *parameter_type1; /* (owned) */
|
|
|
|
GIIrNodeType *parameter_type2; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *giinterface; /* (owned) */
|
|
|
|
char **errors; /* (array zero-terminated=1) (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeParam
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t in : 1;
|
|
|
|
uint8_t out : 1;
|
|
|
|
uint8_t caller_allocates : 1;
|
|
|
|
uint8_t optional : 1;
|
|
|
|
uint8_t retval : 1;
|
|
|
|
uint8_t nullable : 1;
|
|
|
|
uint8_t skip : 1;
|
|
|
|
uint8_t transfer : 1;
|
|
|
|
uint8_t shallow_transfer : 1;
|
|
|
|
GIScopeType scope : 3;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-15 22:20:02 +01:00
|
|
|
int8_t closure;
|
|
|
|
int8_t destroy;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GIIrNodeType *type; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeProperty
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t deprecated : 1;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *name; /* (owned) */
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t readable : 1;
|
|
|
|
uint8_t writable : 1;
|
|
|
|
uint8_t construct : 1;
|
|
|
|
uint8_t construct_only : 1;
|
|
|
|
uint8_t transfer : 1;
|
|
|
|
uint8_t shallow_transfer : 1;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *setter; /* (owned) */
|
|
|
|
char *getter; /* (owned) */
|
Add introspection data for property accessors
A GObject property can be accessed generically through the GObject API,
e.g. g_object_set_property() and g_object_get_property(). Properties
typically also have public accessor functions, which are (according to
our own best practices) called through the generic API.
The introspection data is currently missing the relation between a
property and its public accessor functions. With this information, a
language binding could, for instance, avoid exposing the C API entirely,
thus minimizing the chances of collisions between property names and
accessor functions; alternatively, a binding could call the C API
directly instead of going through the generic GObject API, thus avoiding
the boxing and unboxing from a native type to a GIArgument and finally
into a GValue, and vice versa.
In the GIR, we add two new attributes to the `property` element:
- setter="SYMBOL"
- getter="SYMBOL"
where "symbol" is the C function identifier of the setter and getter
functions, respectively. The `setter` attribute is only applied to
writable, non-construct-only properties; the `getter` attribute is only
applied to readable properties.
We maintain the ABI compatibility of the typelib data by using 20 bits
of the 25 reserved bits inside the PropertyBlob structure. The data is
exposed through two new GIPropertyInfo methods:
- g_property_info_get_setter()
- g_property_info_get_getter()
which return the GIFunctionInfo for the setter and getter functions,
respectively.
2021-06-17 14:07:35 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GIIrNodeType *type; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeSignal
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t deprecated : 1;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t run_first : 1;
|
|
|
|
uint8_t run_last : 1;
|
|
|
|
uint8_t run_cleanup : 1;
|
|
|
|
uint8_t no_recurse : 1;
|
|
|
|
uint8_t detailed : 1;
|
|
|
|
uint8_t action : 1;
|
|
|
|
uint8_t no_hooks : 1;
|
|
|
|
uint8_t instance_transfer_full : 1;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t has_class_closure : 1;
|
|
|
|
uint8_t true_stops_emit : 1;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-26 10:17:19 +01:00
|
|
|
unsigned int class_closure;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GList *parameters; /* (element-type GIIrNode) (owned) */
|
|
|
|
GIIrNodeParam *result; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeVFunc
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t is_varargs : 1; /* Not in typelib yet */
|
|
|
|
uint8_t must_chain_up : 1;
|
|
|
|
uint8_t must_be_implemented : 1;
|
|
|
|
uint8_t must_not_be_implemented : 1;
|
|
|
|
uint8_t is_class_closure : 1;
|
|
|
|
uint8_t throws : 1;
|
|
|
|
uint8_t instance_transfer_full : 1;
|
2024-05-07 15:46:13 +02:00
|
|
|
uint8_t is_async : 1;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *invoker; /* (owned) */
|
2024-05-07 15:46:13 +02:00
|
|
|
char *finish_func; /* (owned) */
|
|
|
|
char *sync_func; /* (owned) */
|
|
|
|
char *async_func; /* (owned) */
|
2009-02-28 01:02:48 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GList *parameters; /* (element-type GIIrNode) (owned) */
|
|
|
|
GIIrNodeParam *result; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-26 10:19:11 +01:00
|
|
|
size_t offset;
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeField
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t readable : 1;
|
|
|
|
uint8_t writable : 1;
|
2024-01-26 10:20:07 +01:00
|
|
|
unsigned int bits;
|
|
|
|
size_t offset;
|
|
|
|
GIIrOffsetsState offset_state;
|
2024-01-25 23:54:25 +01:00
|
|
|
GIIrNodeFunction *callback; /* (owned) */
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GIIrNodeType *type; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeInterface
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t abstract : 1;
|
|
|
|
uint8_t deprecated : 1;
|
|
|
|
uint8_t fundamental : 1;
|
|
|
|
uint8_t final_ : 1;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *gtype_name; /* (owned) */
|
|
|
|
char *gtype_init; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *ref_func; /* (owned) */
|
|
|
|
char *unref_func; /* (owned) */
|
|
|
|
char *set_value_func; /* (owned) */
|
|
|
|
char *get_value_func; /* (owned) */
|
2010-06-12 23:08:56 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *parent; /* (owned) */
|
|
|
|
char *glib_type_struct; /* (owned) */
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GList *interfaces; /* (element-type GIIrNode) (owned) */
|
|
|
|
GList *prerequisites; /* (element-type utf8) (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-17 12:47:49 +01:00
|
|
|
size_t alignment;
|
2024-01-16 02:30:53 +01:00
|
|
|
size_t size;
|
2024-01-17 12:47:49 +01:00
|
|
|
GIIrOffsetsState offsets_state;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GList *members; /* (element-type GIIrNode) (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeValue
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t deprecated : 1;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-15 22:20:02 +01:00
|
|
|
int64_t value;
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeConstant
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t deprecated : 1;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GIIrNodeType *type; /* (owned) */
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *value; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeEnum
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t deprecated : 1;
|
2024-01-26 10:20:55 +01:00
|
|
|
GITypeTag storage_type;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *gtype_name; /* (owned) */
|
|
|
|
char *gtype_init; /* (owned) */
|
|
|
|
char *error_domain; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GList *values; /* (element-type GIIrNode) (owned) */
|
|
|
|
GList *methods; /* (element-type GIIrNode) (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeBoxed
|
2010-03-24 19:00:06 +01:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t deprecated : 1;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *gtype_name; /* (owned) */
|
|
|
|
char *gtype_init; /* (owned) */
|
2008-11-11 06:10:36 +01:00
|
|
|
|
2024-01-17 12:47:49 +01:00
|
|
|
size_t alignment;
|
2024-01-16 02:30:53 +01:00
|
|
|
size_t size;
|
2024-01-17 12:47:49 +01:00
|
|
|
GIIrOffsetsState offsets_state;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GList *members; /* (element-type GIIrNode) (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeStruct
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t deprecated : 1;
|
|
|
|
uint8_t disguised : 1;
|
|
|
|
uint8_t opaque : 1;
|
|
|
|
uint8_t pointer : 1;
|
|
|
|
uint8_t is_gtype_struct : 1;
|
|
|
|
uint8_t foreign : 1;
|
2008-09-06 22:33:51 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *gtype_name; /* (owned) */
|
|
|
|
char *gtype_init; /* (owned) */
|
2008-11-11 06:10:36 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *copy_func; /* (owned) */
|
|
|
|
char *free_func; /* (owned) */
|
2022-10-29 19:09:23 +02:00
|
|
|
|
2024-01-17 12:47:49 +01:00
|
|
|
size_t alignment;
|
2024-01-16 02:30:53 +01:00
|
|
|
size_t size;
|
2024-01-17 12:47:49 +01:00
|
|
|
GIIrOffsetsState offsets_state;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GList *members; /* (element-type GIIrNode) (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
2023-11-08 15:17:52 +01:00
|
|
|
struct _GIIrNodeUnion
|
2008-08-09 14:46:48 +02:00
|
|
|
{
|
2023-11-08 15:17:52 +01:00
|
|
|
GIIrNode node;
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2023-12-21 02:39:52 +01:00
|
|
|
uint8_t deprecated : 1;
|
2010-03-24 19:00:06 +01:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
GList *members; /* (element-type GIIrNode) (owned) */
|
|
|
|
GList *discriminators; /* (element-type GIIrNode) (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *gtype_name; /* (owned) */
|
|
|
|
char *gtype_init; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
|
2024-01-25 23:54:25 +01:00
|
|
|
char *copy_func; /* (owned) */
|
|
|
|
char *free_func; /* (owned) */
|
2022-10-29 19:09:23 +02:00
|
|
|
|
2024-01-17 12:47:49 +01:00
|
|
|
size_t alignment;
|
2024-01-16 02:30:53 +01:00
|
|
|
size_t size;
|
2024-01-17 12:47:49 +01:00
|
|
|
GIIrOffsetsState offsets_state;
|
2008-11-11 06:10:36 +01:00
|
|
|
|
2024-01-26 10:21:22 +01:00
|
|
|
size_t discriminator_offset;
|
2024-01-25 23:54:25 +01:00
|
|
|
GIIrNodeType *discriminator_type; /* (owned) */
|
2008-08-09 14:46:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-11-08 16:23:31 +01:00
|
|
|
GIIrNode *gi_ir_node_new (GIIrNodeTypeId type,
|
|
|
|
GIIrModule *module);
|
|
|
|
void gi_ir_node_free (GIIrNode *node);
|
2024-01-15 22:20:02 +01:00
|
|
|
uint32_t gi_ir_node_get_size (GIIrNode *node);
|
|
|
|
uint32_t gi_ir_node_get_full_size (GIIrNode *node);
|
2023-11-08 16:23:31 +01:00
|
|
|
void gi_ir_node_build_typelib (GIIrNode *node,
|
|
|
|
GIIrNode *parent,
|
|
|
|
GIIrTypelibBuild *build,
|
2024-01-15 22:20:02 +01:00
|
|
|
uint32_t *offset,
|
|
|
|
uint32_t *offset2,
|
|
|
|
uint16_t *count2);
|
2023-11-08 16:23:31 +01:00
|
|
|
int gi_ir_node_cmp (GIIrNode *node,
|
|
|
|
GIIrNode *other);
|
|
|
|
gboolean gi_ir_node_can_have_member (GIIrNode *node);
|
|
|
|
void gi_ir_node_add_member (GIIrNode *node,
|
|
|
|
GIIrNodeFunction *member);
|
2024-01-15 22:20:02 +01:00
|
|
|
uint32_t gi_ir_write_string (const char *str,
|
2023-11-08 16:23:31 +01:00
|
|
|
GHashTable *strings,
|
2024-01-16 00:10:43 +01:00
|
|
|
uint8_t *data,
|
2024-01-15 22:20:02 +01:00
|
|
|
uint32_t *offset);
|
2023-11-08 16:23:31 +01:00
|
|
|
|
2024-01-15 20:20:47 +01:00
|
|
|
const char * gi_ir_node_param_direction_string (GIIrNodeParam * node);
|
|
|
|
const char * gi_ir_node_type_to_string (GIIrNodeTypeId type);
|
2023-11-08 16:23:31 +01:00
|
|
|
|
|
|
|
GIIrNode *gi_ir_find_node (GIIrTypelibBuild *build,
|
|
|
|
GIIrModule *module,
|
|
|
|
const char *name);
|
2008-11-11 01:48:17 +01:00
|
|
|
|
2008-11-11 06:10:36 +01:00
|
|
|
/* In giroffsets.c */
|
|
|
|
|
2023-11-08 16:23:31 +01:00
|
|
|
void gi_ir_node_compute_offsets (GIIrTypelibBuild *build,
|
|
|
|
GIIrNode *node);
|
2008-11-11 06:10:36 +01:00
|
|
|
|
|
|
|
|
2008-08-09 14:46:48 +02:00
|
|
|
G_END_DECLS
|