From 9117d9f21de5daf0c44265bcebd24e9bc3298004 Mon Sep 17 00:00:00 2001 From: Olivier Duchateau Date: Sun, 20 Jan 2019 21:32:57 +0100 Subject: [PATCH] Fix GObject Introspection language bindings --- libxfce4util/Makefile.am | 6 +++--- libxfce4util/xfce-rc.c | 16 ++++++++++++++++ libxfce4util/xfce-rc.h | 4 ++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/libxfce4util/Makefile.am b/libxfce4util/Makefile.am index e7dff26..a1abc31 100644 --- a/libxfce4util/Makefile.am +++ b/libxfce4util/Makefile.am @@ -39,7 +39,6 @@ libxfce4util_built_sources = \ libxfce4utilincludedir = $(includedir)/xfce4/libxfce4util libxfce4utilinclude_HEADERS = \ - $(libxfce4util_built_public_sources) \ $(libxfce4util_headers) \ libxfce4util.h \ libxfce4util-config.h @@ -91,13 +90,14 @@ INTROSPECTION_SCANNER_ARGS = \ --identifier-prefix=Xfce \ --identifier-prefix=xfce \ --identifier-prefix=libxfce \ - --c-include=libxfce4util.h + -DLIBXFCE4UTIL_COMPILATION \ + --c-include=libxfce4util/libxfce4util.h INTROSPECTION_COMPILER_ARGS = \ --includedir=$(srcdir) \ --includedir=. if HAVE_INTROSPECTION -introspection_sources = $(libxfce4util_la_SOURCES) +introspection_sources = $(filter-out %private.h, $(libxfce4util_la_SOURCES)) libxfce4util-1.0.gir: libxfce4util.la Makefile libxfce4util_1_0_gir_INCLUDES = GObject-2.0 GLib-2.0 diff --git a/libxfce4util/xfce-rc.c b/libxfce4util/xfce-rc.c index bd6402a..a97b3ca 100644 --- a/libxfce4util/xfce-rc.c +++ b/libxfce4util/xfce-rc.c @@ -65,7 +65,23 @@ #include #include +static XfceRc * +xfce_rc_copy (const XfceRc *rc) +{ + return g_slice_dup (XfceRc, rc); +} + +static void +xfce_rc_free (XfceRc *rc) +{ + if (G_LIKELY (rc != NULL)) + { + g_slice_free (XfceRc, rc); + } +} +G_DEFINE_BOXED_TYPE (XfceRc, xfce_rc, + xfce_rc_copy, xfce_rc_free) /* called by _xfce_rc_{simple,config}_new */ void diff --git a/libxfce4util/xfce-rc.h b/libxfce4util/xfce-rc.h index 6f97ada..2c13cef 100644 --- a/libxfce4util/xfce-rc.h +++ b/libxfce4util/xfce-rc.h @@ -26,15 +26,19 @@ #ifndef __XFCE_RC_H__ #define __XFCE_RC_H__ +#include #include G_BEGIN_DECLS typedef struct _XfceRc XfceRc; +#define XFCE_TYPE_RC (xfce_rc_get_type ()) #define XFCE_RC(obj) ((XfceRc *) (obj)) #define XFCE_RC_CONST(obj) ((const XfceRc *) (obj)) +GType xfce_rc_get_type (void); + XfceRc* xfce_rc_simple_open (const gchar *filename, gboolean readonly) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; -- 2.20.1