2
3
4
5
6
7
13#include "../preprocessor/gimbal_macro_utils.h"
20# define GBL_DECLS_BEGIN extern "C" {
21# define GBL_DECLS_END }
23# define GBL_DECLS_BEGIN
27#define GBL_CLASS_IMPL_INTERFACE(iface)
29 iface##Class iface##Impl;
31#define GBL_CLASS_DERIVE_N(instance, baseKlass, ...)
35#define GBL_CLASS_DERIVE_2(instance, baseInstance)
36 struct instance##Class;
37 typedef struct instance##Class instance##Class;
38 struct instance##Class {
40 baseInstance##Class base;
42#define GBL_CLASS_DERIVE_1(instance)
45#define GBL_CLASS_DERIVE(...)
48#define GBL_CLASS_BASE_N(instance, ...)
51#define GBL_CLASS_BASE_1(instance)
54#define GBL_CLASS_BASE(...)
57#define GBL_CLASS_BASE_EMPTY(...)
61#define GBL_CLASS_END };
63#define GBL_CLASS_DERIVE_EMPTY(...)
67#define GBL_STATIC_CLASS_DERIVE_N(klass, ...)
70#define GBL_STATIC_CLASS_DERIVE_1(klass)
73#define GBL_STATIC_CLASS_DERIVE(...)
76#define GBL_STATIC_CLASS_DERIVE_EMPTY(...)
80#define GBL_INTERFACE_DERIVE_N(instance, klass, baseClass, ...)
84#define GBL_INTERFACE_DERIVE_3(instance, klass, baseKlass)
86 typedef struct instance instance;
88 typedef struct klass klass;
93#define GBL_INTERFACE_DERIVE_2(instance, klass)
96#define GBL_INTERFACE_DERIVE_1(instance)
99#define GBL_INTERFACE_DERIVE(...)
102#define GBL_INTERFACE_END };
104#define GBL_INSTANCE_DERIVE(derivedInstance, baseInstance)
105 struct derivedInstance;
106 typedef struct derivedInstance derivedInstance;
107 struct derivedInstance {
110 derivedInstance##Class* pClass;
115#define GBL_INSTANCE_BASE(instance)
117 typedef struct instance instance;
121 instance##Class* pClass;
126#define GBL_INSTANCE_BASE_EMPTY(instance)
130#define GBL_INSTANCE_END };
132#define GBL_INSTANCE_DERIVE_EMPTY(derived, base)
136#define GBL_TYPEID(instanceStruct)
139#define GBL_CLASS_STRUCT(cType) cType##Class
141#define GBL_INSTANCE_PRIVATE_STRUCT(instanceStruct)
144#define GBL_CLASS_PRIVATE_STRUCT(instanceStruct)
148# define GBL_DECLARE_TYPE(instanceStruct)
151# define GBL_DECLARE_TYPE(instanceStruct)
152 GBL_DECLARE_TYPE_(instanceStruct)
155#define GBL_DECLARE_TYPE_(instanceStruct)
158#define GBL_DERIVE_EMPTY_TYPE(derivedInstance, baseInstance)
166#define GBL_DECLARE_UNION(S)
171#define GBL_DECLARE_STRUCT(S)
176#define GBL_DECLARE_STRUCT_PRIVATE(S)
178 typedef struct S##_ S##_;
181#define GBL_FORWARD_DECLARE_STRUCT(S)
185#define GBL_FORWARD_DECLARE_STRUCT_PRIVATE(S)
187 typedef struct S##_ S
189#define GBL_FORWARD_DECLARE_TYPE(t)
193# define GBL_DECLARE_ENUM(E)
197# define GBL_DECLARE_ENUM(E)
202# define GBL_DECLARE_FLAGS(F)
206# define GBL_DECLARE_FLAGS(F)
210#define GBL_FORWARD_DECLARE_ENUM(E)
213#define GBL_FORWARD_DECLARE_FLAGS(F)
216#define GBL_DECLARE_OPAQUE(S)
218 typedef struct S##_* S
220#define GBL_PRIVATE_BEGIN struct {
222#define GBL_PRIVATE_END } private_;
224#define GBL_PRIV(a) (a).private_
225#define GBL_PRIV_REF(a) (a)->private_
227#define GBL_VSELF GBL_SELF_TYPE self
229#define GBL_KLASS GBL_GLUE(GBL_SELF_TYPE, Class)* pSelf
232#define GBL_SELF GBL_SELF_TYPE* pSelf
236#define GBL_DEFINE_EMPTY_STRUCT(S)
241#define GBL_UNUSED_(a)
246#ifdef GBL_CTX_SHARED_LIB
247# ifdef GBL_CTX_EXPORTS
248# define GBL_EXPORT GBL_EXPORT_SHARED
250# define GBL_EXPORT GBL_IMPORT_SHARED
257#define GBL_DECL_VAR_TYPE(type, ...)
259#define GBL_DECL_VAR_NAME(type, name)
262#define GBL_DECL_VAR(type, name)
265#define GBL_DECL_VAR_PAIR_TYPE(pair)
268#define GBL_DECL_VAR_PAIR_NAME(pair)
271#define GBL_DECL_VAR_PAIR(pair)
277#define GBL_ENUM_TABLE_DECL_ENUM(cName, value, name, string)
282#define GBL_ENUM_TABLE_DECLARE(table)
288#define GBL_ENUM_TABLE_RETURN_STRING(cName, value, name, string)
289 case value: return string;
291#define GBL_ENUM_TABLE_TO_STRING(table, value)
296#define GBL_ENUM_TABLE_DECLARE_STRINGIFIER(table)
302#define GBL_META_ENUM_TUPLE(tuple)
304#define GBL_META_ENUM_TUPLE_TYPE_INFO(typeInfo, valueTable) typeInfo
306#define GBL_META_ENUM_TUPLE_TYPE_INFO_PROPERTY_CNAME(cName, name, description, stringifier) cName
307#define GBL_META_ENUM_TUPLE_TYPE_INFO_PROPERTY_NAME(cName, name, description, stringifier) name
308#define GBL_META_ENUM_TUPLE_TYPE_INFO_PROPERTY_DESCRIPTION(cName, name, description, stringifier) description
309#define GBL_META_ENUM_TUPLE_TYPE_INFO_PROPERTY_STRINGIFIER(cName, name, description, stringifier) stringifier
311#define GBL_META_ENUM_TUPLE_VALUE_ARRAY(typeInfo, valueArray) valueArray
313#define GBL_META_ENUM_TUPLE_VALUE_ARRAY_TUPLE_VALUE(...) GBL_EVAL __VA_ARGS__
315#define GBL_META_ENUM_TUPLE_VALUE_PROPERTY_CNAME(cName, value, name, string) cName
316#define GBL_META_ENUM_TUPLE_VALUE_PROPERTY_NAME(cName, value, name, string) name
317#define GBL_META_ENUM_TUPLE_VALUE_PROPERTY_VALUE(cName, value, name, string) value
318#define GBL_META_ENUM_TUPLE_VALUE_PROPERTY_STRING(cName, value, name, string) string
#define GBL_META_ENUM_TUPLE_VALUE_ARRAY(typeInfo, valueArray)
#define GBL_INSTANCE_BASE(instance)
#define GBL_ENUM_TABLE_DECL_ENUM(cName, value, name, string)
#define GBL_TYPEID(instanceStruct)
#define GBL_INTERFACE_DERIVE_3(instance, klass, baseKlass)
#define GBL_CLASS_IMPL_INTERFACE(iface)
#define GBL_INSTANCE_DERIVE(derivedInstance, baseInstance)
#define GBL_CLASS_BASE(...)
#define GBL_DECL_VAR(type, name)
#define GBL_DECL_VAR_TYPE(type,...)
#define GBL_DECLARE_ENUM(E)
#define GBL_CLASS_DERIVE(...)
#define GBL_INTERFACE_DERIVE(...)
#define GBL_INTERFACE_DERIVE_2(instance, klass)
#define GBL_DECL_VAR_NAME(type, name)
#define GBL_DECLARE_TYPE_(instanceStruct)
#define GBL_DECLARE_TYPE(instanceStruct)
#define GBL_CLASS_DERIVE_N(instance, baseKlass,...)
#define GBL_STATIC_CLASS_DERIVE(...)
#define GBL_ENUM_TABLE_TO_STRING(table, value)
#define GBL_CLASS_DERIVE_2(instance, baseInstance)
#define GBL_META_ENUM_TUPLE_TYPE_INFO(typeInfo, valueTable)
#define GBL_ENUM_TABLE_DECLARE_STRINGIFIER(table)
#define GBL_ENUM_TABLE_RETURN_STRING(cName, value, name, string)
#define GBL_META_ENUM_TYPE_PROPERTY(table, postfix)
#define GBL_VA_OVERLOAD_CALL(BASE, SUFFIXER,...)
#define GBL_VA_OVERLOAD_SUFFIXER_3_N(...)
#define GBL_VA_OVERLOAD_SUFFIXER_1_N(...)
#define GBL_VA_OVERLOAD_SUFFIXER_2_N(...)
#define GBL_MAP(f,...)
Applies the function macro f to each of the remaining parameters.
#define GBL_MAP_LIST(f,...)
#define GBL_MAP_TUPLES(f,...)