From e9892d6b0823a7e9ba86bfc7685f437da3a0e53f Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Sat, 22 Aug 2015 09:27:40 +0300 Subject: [PATCH] Add GObject Introspection support GObject introspection allows other language bindings to read this metadata that's now generated and automatically provide bindings to call into the libxfce4ui at runtime. For more info see: https://wiki.gnome.org/Projects/GObjectIntrospection/ --- configure.ac.in | 5 +++++ docs/tmpl/xfce-dialogs.sgml | 35 ++++++++++++++++++++++++----- docs/tmpl/xfce-sm-client.sgml | 15 +++++++++++++ docs/tmpl/xfce-titled-dialog.sgml | 2 +- libxfce4ui/Makefile.am | 47 ++++++++++++++++++++++++++++++++++++++- 5 files changed, 96 insertions(+), 8 deletions(-) diff --git a/configure.ac.in b/configure.ac.in index 92f587e..b2db12c 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -129,6 +129,11 @@ XDT_CHECK_PACKAGE([GOBJECT], [gobject-2.0], [2.30.0]) XDT_CHECK_PACKAGE([GTK2], [gtk+-2.0], [2.24.0]) XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.12.0]) +dnl ******************************** +dnl *** Check for Introspection *** +dnl ******************************** +GOBJECT_INTROSPECTION_CHECK([1.38.0]) + dnl *********************************************************** dnl *** Optional support for a GTK+3 version of the library *** dnl *********************************************************** diff --git a/docs/tmpl/xfce-dialogs.sgml b/docs/tmpl/xfce-dialogs.sgml index f68ecf0..2f80a13 100644 --- a/docs/tmpl/xfce-dialogs.sgml +++ b/docs/tmpl/xfce-dialogs.sgml @@ -32,7 +32,7 @@ Useful convientent function to interact with the user using a @primary_text: @secondary_text: @first_button_text: -@Varargs: +@...: @Returns: @@ -62,10 +62,33 @@ Useful convientent function to interact with the user using a @primary_text: @secondary_text: @first_button_text: -@Varargs: +@...: @Returns: + + + + + +@parent: +@application: +@page: +@offset: + + + + + + + +@parent: +@application: +@page: +@offset: +@version: + + @@ -74,7 +97,7 @@ Useful convientent function to interact with the user using a @parent: @secondary_text: @primary_format: -@Varargs: +@...: @@ -85,7 +108,7 @@ Useful convientent function to interact with the user using a @parent: @secondary_text: @primary_format: -@Varargs: +@...: @@ -96,7 +119,7 @@ Useful convientent function to interact with the user using a @parent: @error: @primary_format: -@Varargs: +@...: @@ -109,7 +132,7 @@ Useful convientent function to interact with the user using a @confirm_label: @secondary_text: @primary_format: -@Varargs: +@...: @Returns: diff --git a/docs/tmpl/xfce-sm-client.sgml b/docs/tmpl/xfce-sm-client.sgml index 11974a8..c48acef 100644 --- a/docs/tmpl/xfce-sm-client.sgml +++ b/docs/tmpl/xfce-sm-client.sgml @@ -326,3 +326,18 @@ @restart_style: + + + + + + + + + + + + +@XFCE_SM_CLIENT_ERROR_FAILED: +@XFCE_SM_CLIENT_ERROR_INVALID_CLIENT: + diff --git a/docs/tmpl/xfce-titled-dialog.sgml b/docs/tmpl/xfce-titled-dialog.sgml index 356aa33..3ef8e6f 100644 --- a/docs/tmpl/xfce-titled-dialog.sgml +++ b/docs/tmpl/xfce-titled-dialog.sgml @@ -56,7 +56,7 @@ Structure for the #XfceTitledDialog. @parent: @flags: @first_button_text: -@Varargs: +@...: @Returns: diff --git a/libxfce4ui/Makefile.am b/libxfce4ui/Makefile.am index 7822226..3f3c0a8 100644 --- a/libxfce4ui/Makefile.am +++ b/libxfce4ui/Makefile.am @@ -1,3 +1,5 @@ +CLEANFILES = + AM_CPPFLAGS = \ -I$(top_srcdir) \ -DDATADIR=\"$(datadir)\" \ @@ -129,7 +131,7 @@ endif ## files as part of the dist tarball. ## if MAINTAINER_MODE -CLEANFILES = \ +CLEANFILES += \ actual-abi \ expected-abi @@ -185,6 +187,49 @@ libxfce4ui-enum-types.c: $(libxfce4ui_enum_headers) Makefile rm -f xgen-letc endif +-include $(INTROSPECTION_MAKEFILE) +if ENABLE_GTK3_LIBRARY +INTROSPECTION_GIRS = libxfce4ui_1_0_gir libxfce4ui_2_0_gir +else +INTROSPECTION_GIRS = libxfce4ui_1_0_gir +endif +INTROSPECTION_SCANNER_ARGS = --identifier-prefix=Xfce --symbol-prefix=xfce_ --add-include-path=$(srcdir) --warn-all +INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) + +if HAVE_INTROSPECTION +introspection_sources = $(libxfce4ui_sources) + +libxfce4ui-1.0.gir: libxfce4ui-1.la +libxfce4ui_1_0_gir_INCLUDES = GObject-2.0 libxfce4util-1.0 Gtk-2.0 GLib-2.0 +libxfce4ui_1_0_gir_CFLAGS = $(AM_CPPFLAGS) $(libxfce4ui_1_la_CFLAGS) +libxfce4ui_1_0_gir_PACKAGES = +libxfce4ui_1_0_gir_LIBS = libxfce4ui-1.la +libxfce4ui_1_0_gir_FILES = $(introspection_sources) +libxfce4ui_1_0_gir_NAMESPACE = libxfce4ui +INTROSPECTION_GIRS += libxfce4ui-1.0.gir + +if ENABLE_GTK3_LIBRARY +libxfce4ui-2.0.gir: libxfce4ui-2.la +libxfce4ui_2_0_gir_INCLUDES = GObject-2.0 libxfce4util-1.0 Gtk-3.0 GLib-2.0 +libxfce4ui_2_0_gir_CFLAGS = $(AM_CPPFLAGS) $(libxfce4ui_2_la_CFLAGS) +libxfce4ui_2_0_gir_PACKAGES = +libxfce4ui_2_0_gir_LIBS = libxfce4ui-2.la +libxfce4ui_2_0_gir_FILES = $(introspection_sources) +libxfce4ui_2_0_gir_NAMESPACE = libxfce4ui +INTROSPECTION_GIRS += libxfce4ui-2.0.gir +endif + +girdir = $(datadir)/gir-1.0 +gir_DATA = $(INTROSPECTION_GIRS) + +typelibdir = $(libdir)/girepository-1.0 +typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) + +CLEANFILES += \ + $(gir_DATA) \ + $(typelib_DATA) +endif + # required for gtk-doc dist-hook: all -- 2.5.0