girepository: Rework IS_(type) macros to use G_TYPE_CHECK_INSTANCE_TYPE

This means they’re now using the `GType` type system rather than the old
`GIInfoType` type system. Given the preceding few commits, these two
systems should now be equivalent.

This makes the type handling more conventional and hence a bit simpler
for people to use if they have experience with GObject.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3216
This commit is contained in:
Philip Withnall
2024-01-17 15:43:47 +00:00
parent a99a35ab39
commit 5423bf4df7
19 changed files with 42 additions and 61 deletions

View File

@@ -42,11 +42,7 @@ G_BEGIN_DECLS
*
* Since: 2.80
*/
#define GI_IS_CALLABLE_INFO(info) \
((gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_FUNCTION) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_CALLBACK) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_SIGNAL) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_VFUNC))
#define GI_IS_CALLABLE_INFO(info) (G_TYPE_CHECK_INSTANCE_TYPE ((info), GI_TYPE_CALLABLE_INFO))
GI_AVAILABLE_IN_ALL