summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-04-20 16:03:44 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2020-04-22 14:59:32 +0100
commita0883ae895200d2a0e6183b60c8aff7bca0b6340 (patch)
tree6cc0b191e03ed2e7786575cab3c7f555863297f5
parentd84f962da02658b84c116e7a3c0ede8c56e9dc1b (diff)
downloadatk-a0883ae895200d2a0e6183b60c8aff7bca0b6340.tar.gz
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
-rw-r--r--atk/atk-autocleanups.h54
-rw-r--r--atk/atk.h2
-rw-r--r--atk/meson.build1
3 files changed, 57 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
+ */
+
+#if !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
+#error "Only <atk/atk.h> 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 <atk/atkversion.h>
#include <atk/atkwindow.h>
+#include <atk/atk-autocleanups.h>
+
#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)