[libpeas] Add g_autoptr() autocleanup support



commit d3ecd070527facebb7a02d2c8927f83881e6f4a4
Author: Garrett Regier <garrettregier gmail com>
Date:   Tue May 19 23:59:46 2015 -0700

    Add g_autoptr() autocleanup support
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749616

 libpeas-gtk/Makefile.am             |    1 +
 libpeas-gtk/peas-gtk-autocleanups.h |   44 +++++++++++++++++++++++++++++++
 libpeas-gtk/peas-gtk.h              |    1 +
 libpeas/Makefile.am                 |    1 +
 libpeas/peas-autocleanups.h         |   49 +++++++++++++++++++++++++++++++++++
 libpeas/peas.h                      |    1 +
 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"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]