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_INTERFACE_DERIVE_N(instance, klass, baseClass, ...)
71#define GBL_INTERFACE_DERIVE_3(instance, klass, baseKlass)
73 typedef struct instance instance;
75 typedef struct klass klass;
80#define GBL_INTERFACE_DERIVE_2(instance, klass)
83#define GBL_INTERFACE_DERIVE_1(instance)
86#define GBL_INTERFACE_DERIVE(...)
89#define GBL_INTERFACE_END };
91#define GBL_INSTANCE_DERIVE(derivedInstance, baseInstance)
92 struct derivedInstance;
93 typedef struct derivedInstance derivedInstance;
94 struct derivedInstance {
97 derivedInstance##Class* pClass;
102#define GBL_INSTANCE_BASE(instance)
104 typedef struct instance instance;
108 instance##Class* pClass;
113#define GBL_INSTANCE_BASE_EMPTY(instance)
117#define GBL_INSTANCE_END };
119#define GBL_INSTANCE_DERIVE_EMPTY(derived, base)
123#define GBL_TYPEID(instanceStruct)
126#define GBL_CLASS_STRUCT(cType) cType##Class
128#define GBL_INSTANCE_PRIVATE_STRUCT(instanceStruct)
131#define GBL_CLASS_PRIVATE_STRUCT(instanceStruct)
135# define GBL_DECLARE_TYPE(instanceStruct)
138# define GBL_DECLARE_TYPE(instanceStruct)
139 GBL_DECLARE_TYPE_(instanceStruct)
142#define GBL_DECLARE_TYPE_(instanceStruct)
145#define GBL_DECLARE_UNION(S)
150#define GBL_DECLARE_STRUCT(S)
155#define GBL_DECLARE_STRUCT_PRIVATE(S)
157 typedef struct S##_ S##_;
160#define GBL_FORWARD_DECLARE_STRUCT(S)
164#define GBL_FORWARD_DECLARE_STRUCT_PRIVATE(S)
166 typedef struct S##_ S
168#define GBL_FORWARD_DECLARE_TYPE(t)
172# define GBL_DECLARE_ENUM(E)
176# define GBL_DECLARE_ENUM(E)
181# define GBL_DECLARE_FLAGS(F)
185# define GBL_DECLARE_FLAGS(F)
189#define GBL_FORWARD_DECLARE_ENUM(E)
192#define GBL_FORWARD_DECLARE_FLAGS(F)
195#define GBL_DECLARE_OPAQUE(S)
197 typedef struct S##_* S
199#define GBL_PRIVATE_BEGIN struct {
201#define GBL_PRIVATE_END } private_;
203#define GBL_PRIV(a) (a).private_
204#define GBL_PRIV_REF(a) (a)->private_
206#define GBL_VSELF GBL_SELF_TYPE self
208#define GBL_KLASS GBL_GLUE(GBL_SELF_TYPE, Class)* pSelf
211#define GBL_SELF GBL_SELF_TYPE* pSelf
215#define GBL_DEFINE_EMPTY_STRUCT(S)
220#define GBL_UNUSED_(a)
225#ifdef GBL_CTX_SHARED_LIB
226# ifdef GBL_CTX_EXPORTS
227# define GBL_EXPORT GBL_EXPORT_SHARED
229# define GBL_EXPORT GBL_IMPORT_SHARED
236#define GBL_DECL_VAR_TYPE(type, ...)
238#define GBL_DECL_VAR_NAME(type, name)
241#define GBL_DECL_VAR(type, name)
244#define GBL_DECL_VAR_PAIR_TYPE(pair)
247#define GBL_DECL_VAR_PAIR_NAME(pair)
250#define GBL_DECL_VAR_PAIR(pair)
256#define GBL_ENUM_TABLE_DECL_ENUM(cName, value, name, string)
261#define GBL_ENUM_TABLE_DECLARE(table)
267#define GBL_ENUM_TABLE_RETURN_STRING(cName, value, name, string)
268 case value: return string;
270#define GBL_ENUM_TABLE_TO_STRING(table, value)
275#define GBL_ENUM_TABLE_DECLARE_STRINGIFIER(table)
281#define GBL_META_ENUM_TUPLE(tuple)
283#define GBL_META_ENUM_TUPLE_TYPE_INFO(typeInfo, valueTable) typeInfo
285#define GBL_META_ENUM_TUPLE_TYPE_INFO_PROPERTY_CNAME(cName, name, description, stringifier) cName
286#define GBL_META_ENUM_TUPLE_TYPE_INFO_PROPERTY_NAME(cName, name, description, stringifier) name
287#define GBL_META_ENUM_TUPLE_TYPE_INFO_PROPERTY_DESCRIPTION(cName, name, description, stringifier) description
288#define GBL_META_ENUM_TUPLE_TYPE_INFO_PROPERTY_STRINGIFIER(cName, name, description, stringifier) stringifier
290#define GBL_META_ENUM_TUPLE_VALUE_ARRAY(typeInfo, valueArray) valueArray
292#define GBL_META_ENUM_TUPLE_VALUE_ARRAY_TUPLE_VALUE(...) GBL_EVAL __VA_ARGS__
294#define GBL_META_ENUM_TUPLE_VALUE_PROPERTY_CNAME(cName, value, name, string) cName
295#define GBL_META_ENUM_TUPLE_VALUE_PROPERTY_NAME(cName, value, name, string) name
296#define GBL_META_ENUM_TUPLE_VALUE_PROPERTY_VALUE(cName, value, name, string) value
297#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_CLASS_DERIVE_N(instance, baseKlass,...)
#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,...)