From a0883ae895200d2a0e6183b60c8aff7bca0b6340 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 20 Apr 2020 16:03:44 +0100 Subject: Add autocleanup definitions The G_DEFINE_AUTOPTR_* macros are used to define various symbols needed in order to use the g_autoptr() macro in GLib, which are a requirement in order to use the G_DECLARE_* macros to cut down the GObject boilerplate in the headers. Fixes: #10 --- atk/atk-autocleanups.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ atk/atk.h | 2 ++ atk/meson.build | 1 + 3 files changed, 57 insertions(+) create mode 100644 atk/atk-autocleanups.h diff --git a/atk/atk-autocleanups.h b/atk/atk-autocleanups.h new file mode 100644 index 0000000..f928f70 --- /dev/null +++ b/atk/atk-autocleanups.h @@ -0,0 +1,54 @@ +/* ATK - Accessibility Toolkit + * Copyright 2020 GNOME Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library. If not, see . + */ + +#if !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __GI_SCANNER__ + +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkAction, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkComponent, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkDocument, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkEditableText, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkGObjectAccessible, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkHyperlink, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkHyperlinkImpl, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkHypertext, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkImage, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkImplementor, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkMisc, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkNoOpObjectFactory, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkNoOpObject, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkObjectFactory, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkObject, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkPlug, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkRegistry, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkRelationSet, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkRelation, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkSelection, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkSocket, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkStateSet, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkStreamableContent, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkTableCell, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkTable, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkText, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkUtil, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkValue, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (AtkWindow, g_object_unref) + +#endif /* __GI_SCANNER__ */ diff --git a/atk/atk.h b/atk/atk.h index dc121a5..0bc900d 100644 --- a/atk/atk.h +++ b/atk/atk.h @@ -56,6 +56,8 @@ #include #include +#include + #undef __ATK_H_INSIDE__ #endif /* __ATK_H__ */ diff --git a/atk/meson.build b/atk/meson.build index 79f37f6..5dd736a 100644 --- a/atk/meson.build +++ b/atk/meson.build @@ -65,6 +65,7 @@ atk_headers = [ 'atkutil.h', 'atkvalue.h', 'atkwindow.h', + 'atk-autocleanups.h', ] install_headers(atk_headers + ['atk.h'], subdir: atk_api_path) -- cgit v1.2.1