gtk.cfg: Add more macros and some functions used in the macros.

This commit is contained in:
versat 2019-03-15 14:51:45 +01:00
parent 6f7612de03
commit 0cb45b1f42
1 changed files with 72 additions and 0 deletions

View File

@ -7,14 +7,63 @@
<define name="g_return_if_reached()" value="do{return;}while(0)"/> <define name="g_return_if_reached()" value="do{return;}while(0)"/>
<define name="g_return_val_if_reached(val)" value="do{return val;}while(0)"/> <define name="g_return_val_if_reached(val)" value="do{return val;}while(0)"/>
<define name="G_CALLBACK(cb)" value="cb"/> <define name="G_CALLBACK(cb)" value="cb"/>
<!-- https://developer.gnome.org/glib/stable/glib-Miscellaneous-Macros.html -->
<!-- https://github.com/GNOME/glib/blob/master/glib/gmacros.h -->
<define name="G_GNUC_PURE" value="__attribute__((__pure__))"/>
<define name="G_GNUC_MALLOC" value="__attribute__((__malloc__))"/>
<define name="G_GNUC_NO_INLINE" value=""/>
<define name="G_GNUC_NULL_TERMINATED" value="__attribute__((__sentinel__))"/>
<define name="G_GNUC_WARN_UNUSED_RESULT" value="__attribute__((warn_unused_result))"/>
<define name="G_GNUC_FUNCTION" value="__FUNCTION__"/>
<define name="G_GNUC_ALLOC_SIZE(x)" value="__attribute__((__alloc_size__(x)))"/>
<define name="G_GNUC_ALLOC_SIZE2(x,y)" value="__attribute__((__alloc_size__(x,y)))"/>
<define name="G_GNUC_FALLTHROUGH" value="__attribute__((fallthrough))"/>
<define name="G_GNUC_NORETURN" value="__attribute__((__noreturn__))"/>
<define name="G_GNUC_CONST" value="__attribute__((__const__))"/>
<define name="G_GNUC_UNUSED" value="__attribute__((__unused__))"/>
<define name="G_STRINGIFY(macro_or_string)" value="G_STRINGIFY_ARG (macro_or_string)"/>
<define name="G_STRINGIFY_ARG(contents)" value="#contents"/>
<define name="G_STRLOC" value="__FILE__ &quot;:&quot; G_STRINGIFY (__LINE__)"/>
<define name="G_STRFUNC" value="((const char*) (__FUNCTION__))"/>
<define name="MAX(a, b)" value="(((a) &gt; (b)) ? (a) : (b))"/>
<define name="MIN(a, b)" value="(((a) &lt; (b)) ? (a) : (b))"/>
<define name="ABS(a)" value="(((a) &lt; 0) ? -(a) : (a))"/>
<define name="CLAMP(x, low, high)" value="(((x) &gt; (high)) ? (high) : (((x) &lt; (low)) ? (low) : (x)))"/>
<define name="G_APPROX_VALUE(a, b, epsilon)" value="(((a) &gt; (b) ? (a) - (b) : (b) - (a)) &lt; (epsilon))"/>
<define name="G_N_ELEMENTS(arr)" value="(sizeof (arr) / sizeof ((arr)[0]))"/>
<define name="G_STRUCT_OFFSET(struct_type, member)" value="((glong) offsetof (struct_type, member))"/>
<define name="G_STRUCT_MEMBER_P(struct_p, struct_offset)" value="((gpointer) ((guint8*) (struct_p) + (glong) (struct_offset)))"/>
<define name="G_STRUCT_MEMBER(member_type, struct_p, struct_offset)" value="(*(member_type*) G_STRUCT_MEMBER_P ((struct_p), (struct_offset)))"/>
<define name="G_CONST_RETURN" value=""/>
<define name="G_LIKELY(expr)" value="(expr)"/> <define name="G_LIKELY(expr)" value="(expr)"/>
<define name="G_UNLIKELY(expr)" value="(expr)"/> <define name="G_UNLIKELY(expr)" value="(expr)"/>
<define name="G_DEPRECATED" value="__attribute__((__deprecated__))"/>
<define name="G_STMT_START" value="do"/>
<define name="G_STMT_END" value="while (0)"/>
<define name="_G_TYPE_CIC(ip, gt, ct)" value="((ct*) ip)"/> <define name="_G_TYPE_CIC(ip, gt, ct)" value="((ct*) ip)"/>
<define name="_G_TYPE_CCC(cp, gt, ct)" value="((ct*) cp)"/> <define name="_G_TYPE_CCC(cp, gt, ct)" value="((ct*) cp)"/>
<define name="_G_TYPE_CHI(ip)" value="(g_type_check_instance ((GTypeInstance*) ip))"/>
<define name="_G_TYPE_CHV(vl)" value="(g_type_check_value ((GValue*) vl))"/>
<define name="_G_TYPE_IGC(ip, gt, ct)" value="((ct*) (((GTypeInstance*) ip)-&gt;g_class))"/>
<define name="_G_TYPE_IGI(ip, gt, ct)" value="((ct*) g_type_interface_peek (((GTypeInstance*) ip)-&gt;g_class, gt))"/>
<define name="_G_TYPE_CIFT(ip, ft)" value="(g_type_check_instance_is_fundamentally_a ((GTypeInstance*) ip, ft))"/>
<define name="_G_TYPE_CIT(ip, gt)" value="(g_type_check_instance_is_a ((GTypeInstance*) ip, gt))"/>
<define name="_G_TYPE_CCT(cp, gt)" value="(g_type_check_class_is_a ((GTypeClass*) cp, gt))"/>
<define name="_G_TYPE_CVH(vl, gt)" value="(g_type_check_value_holds ((GValue*) vl, gt))"/>
<define name="G_TYPE_FLAG_RESERVED_ID_BIT" value="((GType) (1 &lt;&lt; 0))"/>
<define name="G_TYPE_CHECK_CLASS_CAST(g_class, g_type, c_type)" value="(_G_TYPE_CCC ((g_class), (g_type), c_type))"/>
<define name="G_TYPE_CHECK_CLASS_TYPE(g_class, g_type)" value="(_G_TYPE_CCT ((g_class), (g_type)))"/>
<define name="G_TYPE_CHECK_INSTANCE(instance)" value="(_G_TYPE_CHI ((GTypeInstance*) (instance)))"/> <define name="G_TYPE_CHECK_INSTANCE(instance)" value="(_G_TYPE_CHI ((GTypeInstance*) (instance)))"/>
<define name="G_TYPE_CHECK_INSTANCE_TYPE(instance, g_type)" value="(_G_TYPE_CIT ((instance), (g_type)))"/> <define name="G_TYPE_CHECK_INSTANCE_TYPE(instance, g_type)" value="(_G_TYPE_CIT ((instance), (g_type)))"/>
<define name="G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type)" value="(_G_TYPE_CIC ((instance), (g_type), c_type))"/> <define name="G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type)" value="(_G_TYPE_CIC ((instance), (g_type), c_type))"/>
<define name="G_TYPE_CHECK_VALUE(value)" value="(_G_TYPE_CHV ((value)))"/>
<define name="G_TYPE_CHECK_VALUE_TYPE(value, g_type)" value="(_G_TYPE_CVH ((value), (g_type)))"/>
<define name="G_TYPE_FROM_INSTANCE(instance)" value="(G_TYPE_FROM_CLASS (((GTypeInstance*) (instance))-&gt;g_class))"/>
<define name="G_TYPE_FROM_CLASS(g_class)" value="(((GTypeClass*) (g_class))-&gt;g_type)"/>
<define name="G_TYPE_FROM_INTERFACE(g_iface)" value="(((GTypeInterface*) (g_iface))-&gt;g_type)"/>
<define name="G_TYPE_INSTANCE_GET_PRIVATE(instance, g_type, c_type)" value="((c_type*) g_type_instance_get_private ((GTypeInstance*) (instance), (g_type)))"/>
<define name="G_OBJECT(obj)" value="(GObject*)(obj)"/> <define name="G_OBJECT(obj)" value="(GObject*)(obj)"/>
<define name="G_OBJECT_CLASS(class)" value="(G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_OBJECT, GObjectClass))"/>
<define name="GTK_BOX(obj)" value="((GtkBox*)(obj))"/> <define name="GTK_BOX(obj)" value="((GtkBox*)(obj))"/>
<define name="GTK_CONTAINER(obj)" value="((GtkContainer*)(obj))"/> <define name="GTK_CONTAINER(obj)" value="((GtkContainer*)(obj))"/>
<define name="GTK_ENTRY(obj)" value="((GtkEntry*)(obj))"/> <define name="GTK_ENTRY(obj)" value="((GtkEntry*)(obj))"/>
@ -5108,6 +5157,29 @@
<leak-ignore/> <leak-ignore/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
</function> </function>
<!-- GLIB_AVAILABLE_IN_ALL gboolean g_type_check_class_is_a (GTypeClass *g_class, GType is_a_type) G_GNUC_PURE; -->
<!-- GLIB_AVAILABLE_IN_ALL gboolean g_type_check_instance_is_a (GTypeInstance *instance, GType iface_type) G_GNUC_PURE; -->
<!-- GLIB_AVAILABLE_IN_2_42 gboolean g_type_check_instance_is_fundamentally_a (GTypeInstance *instance, GType fundamental_type) G_GNUC_PURE; -->
<!-- GLIB_AVAILABLE_IN_ALL gboolean g_type_check_value_holds (const GValue *value, GType type) G_GNUC_PURE; -->
<function name="g_type_check_class_is_a,g_type_check_instance_is_a,g_type_check_instance_is_fundamentally_a,g_type_check_value_holds">
<noreturn>false</noreturn>
<returnValue type="gboolean"/>
<use-retval/>
<pure/>
<arg nr="1" direction="in"/>
<arg nr="2" direction="in"/>
</function>
<!-- GLIB_AVAILABLE_IN_ALL gboolean g_type_test_flags (GType type, guint flags) G_GNUC_CONST; -->
<function name="g_type_test_flags">
<noreturn>false</noreturn>
<returnValue type="gboolean"/>
<use-retval/>
<const/>
<arg nr="1" direction="in"/>
<arg nr="2" direction="in">
<not-uninit/>
</arg>
</function>
<function name="g_variant_check_format_string"> <function name="g_variant_check_format_string">
<leak-ignore/> <leak-ignore/>
<noreturn>false</noreturn> <noreturn>false</noreturn>