summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Regier <garrettregier@gmail.com>2015-05-19 23:59:46 -0700
committerGarrett Regier <garrettregier@gmail.com>2015-05-20 00:01:20 -0700
commitd3ecd070527facebb7a02d2c8927f83881e6f4a4 (patch)
tree07c8d67bfa522f1e8c8766d117d23d304c4d719e
parent102357e5214f28dfdcd77f05b0b38d59bef582c9 (diff)
downloadlibpeas-d3ecd070527facebb7a02d2c8927f83881e6f4a4.tar.gz
Add g_autoptr() autocleanup support
https://bugzilla.gnome.org/show_bug.cgi?id=749616
-rw-r--r--libpeas-gtk/Makefile.am1
-rw-r--r--libpeas-gtk/peas-gtk-autocleanups.h44
-rw-r--r--libpeas-gtk/peas-gtk.h1
-rw-r--r--libpeas/Makefile.am1
-rw-r--r--libpeas/peas-autocleanups.h49
-rw-r--r--libpeas/peas.h1
6 files changed, 97 insertions, 0 deletions
diff --git a/libpeas-gtk/Makefile.am b/libpeas-gtk/Makefile.am
index acc3e19..108c901 100644
--- a/libpeas-gtk/Makefile.am
+++ b/libpeas-gtk/Makefile.am
@@ -25,6 +25,7 @@ libpeas_gtk_1_0_la_LDFLAGS += -framework Cocoa
endif
INST_H_FILES = \
+ peas-gtk-autocleanups.h \
peas-gtk-configurable.h \
peas-gtk-plugin-manager.h \
peas-gtk-plugin-manager-view.h \
diff --git a/libpeas-gtk/peas-gtk-autocleanups.h b/libpeas-gtk/peas-gtk-autocleanups.h
new file mode 100644
index 0000000..587f3d8
--- /dev/null
+++ b/libpeas-gtk/peas-gtk-autocleanups.h
@@ -0,0 +1,44 @@
+/*
+ * peas-gtk-autocleanups.h
+ * This file is part of libpeas
+ *
+ * Copyright (C) 2015 - Garrett Regier
+ *
+ * libpeas is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * libpeas 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+#ifndef __PEAS_GTK_AUTOCLEANUPS_H__
+#define __PEAS_GTK_AUTOCLEANUPS_H__
+
+#include "peas-gtk-configurable.h"
+#include "peas-gtk-plugin-manager.h"
+#include "peas-gtk-plugin-manager-view.h"
+
+G_BEGIN_DECLS
+
+#ifndef __GI_SCANNER__
+#if GLIB_CHECK_VERSION (2, 44, 0)
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (PeasGtkConfigurable, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (PeasGtkPluginManager, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (PeasGtkPluginManagerView, g_object_unref)
+
+#endif /* GLIB_CHECK_VERSION (2, 44, 0) */
+#endif /* __GI_SCANNER__ */
+
+G_END_DECLS
+
+#endif /* __PEAS_GTK_AUTOCLEANUPS_H__ */
diff --git a/libpeas-gtk/peas-gtk.h b/libpeas-gtk/peas-gtk.h
index 893d18c..aade466 100644
--- a/libpeas-gtk/peas-gtk.h
+++ b/libpeas-gtk/peas-gtk.h
@@ -20,6 +20,7 @@
#ifndef __PEAS_GTK_H__
#define __PEAS_GTK_H__
+#include "peas-gtk-autocleanups.h"
#include "peas-gtk-configurable.h"
#include "peas-gtk-plugin-manager.h"
#include "peas-gtk-plugin-manager-view.h"
diff --git a/libpeas/Makefile.am b/libpeas/Makefile.am
index 31213d3..660ddff 100644
--- a/libpeas/Makefile.am
+++ b/libpeas/Makefile.am
@@ -24,6 +24,7 @@ endif
libpeas_1_0_la_LIBADD = $(PEAS_LIBS)
INST_H_FILES = \
+ peas-autocleanups.h \
peas-plugin-info.h \
peas-object-module.h \
peas-extension-base.h \
diff --git a/libpeas/peas-autocleanups.h b/libpeas/peas-autocleanups.h
new file mode 100644
index 0000000..68f7870
--- /dev/null
+++ b/libpeas/peas-autocleanups.h
@@ -0,0 +1,49 @@
+/*
+ * peas-autocleanups.h
+ * This file is part of libpeas
+ *
+ * Copyright (C) 2015 - Garrett Regier
+ *
+ * libpeas is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * libpeas 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __PEAS_AUTOCLEANUPS_H__
+#define __PEAS_AUTOCLEANUPS_H__
+
+#include "peas-activatable.h"
+#include "peas-engine.h"
+#include "peas-extension.h"
+#include "peas-extension-base.h"
+#include "peas-extension-set.h"
+#include "peas-object-module.h"
+
+G_BEGIN_DECLS
+
+#ifndef __GI_SCANNER__
+#if GLIB_CHECK_VERSION (2, 44, 0)
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (PeasActivatable, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (PeasEngine, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (PeasExtension, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (PeasExtensionBase, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (PeasExtensionSet, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (PeasObjectModule, g_object_unref)
+
+#endif /* GLIB_CHECK_VERSION (2, 44, 0) */
+#endif /* __GI_SCANNER__ */
+
+G_END_DECLS
+
+#endif /* __PEAS_AUTOCLEANUPS_H__ */
diff --git a/libpeas/peas.h b/libpeas/peas.h
index 161fe05..e46bbfc 100644
--- a/libpeas/peas.h
+++ b/libpeas/peas.h
@@ -21,6 +21,7 @@
#define __PEAS_H__
#include "peas-activatable.h"
+#include "peas-autocleanups.h"
#include "peas-engine.h"
#include "peas-extension.h"
#include "peas-extension-base.h"