From 541965a8343998fc5d01108535bbd2b62be274fd Mon Sep 17 00:00:00 2001 From: Andre Miranda <andreldm@xfce.org> Date: Wed, 22 Nov 2017 00:36:01 -0300 Subject: [PATCH] Add GObject Introspection support to thunarx --- .gitignore | 2 ++ Makefile.am | 5 +++-- configure.ac.in | 5 +++++ thunarx/Makefile.am | 27 ++++++++++++++++++++++++ thunarx/thunarx-config.h.in | 4 ++-- thunarx/thunarx-file-info.h | 12 +++++------ thunarx/thunarx-menu-provider.h | 4 ++-- thunarx/thunarx-menu.h | 4 ++-- thunarx/thunarx-preferences-provider.h | 4 ++-- thunarx/thunarx-private.h | 4 ++-- thunarx/thunarx-property-page-provider.h | 4 ++-- thunarx/thunarx-property-page.h | 4 ++-- thunarx/thunarx-provider-factory.h | 4 ++-- thunarx/thunarx-renamer-provider.h | 4 ++-- thunarx/thunarx-renamer.h | 4 ++-- 15 files changed, 63 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 7022baffd..63ea6741a 100644 --- a/.gitignore +++ b/.gitignore @@ -120,6 +120,8 @@ thunar/stamp-thunar-*.* thunar/thunar-dbus-service-infos.h thunarx/.*.swp thunarx/*.pc +thunarx/*.gir +thunarx/*.typelib thunarx/thunarx-alias*.[ch] thunarx/thunarx-config.h *.o diff --git a/Makefile.am b/Makefile.am index d9b86bc8d..d12892881 100644 --- a/Makefile.am +++ b/Makefile.am @@ -119,5 +119,6 @@ DISTCLEANFILES = \ $(polkit_policy_DATA) DISTCHECK_CONFIGURE_FLAGS = \ - --enable-gtk-doc \ - --enable-gen-doc + --enable-gtk-doc \ + --enable-gen-doc \ + --enable-introspection diff --git a/configure.ac.in b/configure.ac.in index f74fa81a7..166ffe349 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -156,6 +156,11 @@ XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.12.0]) XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.12.0]) XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.12.0]) +dnl ****************************** +dnl *** GObject Instrospection *** +dnl ****************************** +GOBJECT_INTROSPECTION_CHECK([1.30.0]) + dnl ******************************************** dnl *** Check for session management support *** dnl ******************************************** diff --git a/thunarx/Makefile.am b/thunarx/Makefile.am index 82161ec8f..0a0aca39e 100644 --- a/thunarx/Makefile.am +++ b/thunarx/Makefile.am @@ -75,6 +75,8 @@ EXTRA_DIST = \ abicheck.sh \ thunarx.symbols +CLEANFILES = $(NULL) + ## ## Rules to auto-generate built sources ## @@ -97,4 +99,29 @@ endif # required for gtk-doc dist-hook: all +-include $(INTROSPECTION_MAKEFILE) +#AM_DEFAULT_VERBOSITY = 1 + +INTROSPECTION_GIRS = +INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) -I.. -DTHUNARX_COMPILATION +INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) + +if HAVE_INTROSPECTION +Thunarx-3.0.gir: libthunarx-3.la +Thunarx_3_0_gir_INCLUDES = GObject-2.0 Gtk-3.0 +Thunarx_3_0_gir_CFLAGS = $(INCLUDES) +Thunarx_3_0_gir_LIBS = libthunarx-3.la +Thunarx_3_0_gir_FILES = $(libthunarx_headers) +INTROSPECTION_GIRS += Thunarx-3.0.gir + +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 + # vi:set ts=8 sw=8 noet ai nocindent syntax=automake: diff --git a/thunarx/thunarx-config.h.in b/thunarx/thunarx-config.h.in index 2e6407828..6b6cd6671 100644 --- a/thunarx/thunarx-config.h.in +++ b/thunarx/thunarx-config.h.in @@ -27,7 +27,7 @@ #include <glib-object.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS #define THUNARX_MAJOR_VERSION @THUNAR_VERSION_MAJOR@ #define THUNARX_MINOR_VERSION @THUNAR_VERSION_MINOR@ @@ -58,6 +58,6 @@ const gchar *thunarx_check_version (guint required_major, #endif /* __GNUC__ */ #endif /* !defined(G_GNUC_WARN_UNUSED_RESULT) */ -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_CONFIG_H__ */ diff --git a/thunarx/thunarx-file-info.h b/thunarx/thunarx-file-info.h index 2a2f9cbb0..4f1f91165 100644 --- a/thunarx/thunarx-file-info.h +++ b/thunarx/thunarx-file-info.h @@ -30,12 +30,12 @@ #include <thunarx/thunarx-config.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS -/** +/* * File information namespaces available in the #GFileInfo returned by * thunarx_file_info_get_file_info(). - **/ + */ #define THUNARX_FILE_INFO_NAMESPACE \ "access::*," \ "id::filesystem," \ @@ -51,10 +51,10 @@ G_BEGIN_DECLS; -/** +/* * Filesystem information namespaces available in the #GFileInfo * returned by thunarx_file_info_get_filesystem_info(). - **/ + */ #define THUNARX_FILESYSTEM_INFO_NAMESPACE \ "filesystem::*" @@ -158,6 +158,6 @@ GType thunarx_file_info_list_get_type (void) G_GNUC_CONST; GList *thunarx_file_info_list_copy (GList *file_infos); void thunarx_file_info_list_free (GList *file_infos); -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_FILE_INFO_H__ */ diff --git a/thunarx/thunarx-menu-provider.h b/thunarx/thunarx-menu-provider.h index f81ba22ff..550e5a287 100644 --- a/thunarx/thunarx-menu-provider.h +++ b/thunarx/thunarx-menu-provider.h @@ -29,7 +29,7 @@ #include <thunarx/thunarx-file-info.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _ThunarxMenuProviderIface ThunarxMenuProviderIface; typedef struct _ThunarxMenuProvider ThunarxMenuProvider; @@ -91,6 +91,6 @@ GList *thunarx_menu_provider_get_dnd_menu_items (ThunarxMenuProvider *provide ThunarxFileInfo *folder, GList *files) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT; -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_MENU_PROVIDER_H__ */ diff --git a/thunarx/thunarx-menu.h b/thunarx/thunarx-menu.h index 1f43f6e50..6869f5e1d 100644 --- a/thunarx/thunarx-menu.h +++ b/thunarx/thunarx-menu.h @@ -25,7 +25,7 @@ #include <glib-object.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS /* ThunarxMenu types */ typedef struct _ThunarxMenuPrivate ThunarxMenuPrivate; @@ -110,6 +110,6 @@ void thunarx_menu_item_list_free (GList *items); void thunarx_menu_item_set_menu (ThunarxMenuItem *item, ThunarxMenu *menu); -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_MENU_H__ */ diff --git a/thunarx/thunarx-preferences-provider.h b/thunarx/thunarx-preferences-provider.h index 1a742d9e9..50c2b5a8b 100644 --- a/thunarx/thunarx-preferences-provider.h +++ b/thunarx/thunarx-preferences-provider.h @@ -27,7 +27,7 @@ #include <gtk/gtk.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _ThunarxPreferencesProviderIface ThunarxPreferencesProviderIface; typedef struct _ThunarxPreferencesProvider ThunarxPreferencesProvider; @@ -69,6 +69,6 @@ GType thunarx_preferences_provider_get_type (void) G_GNUC_CONST; GList *thunarx_preferences_provider_get_menu_items (ThunarxPreferencesProvider *provider, GtkWidget *window); -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_PREFERENCES_PROVIDER_H__ */ diff --git a/thunarx/thunarx-private.h b/thunarx/thunarx-private.h index 8d28b6af6..1f9d714fe 100644 --- a/thunarx/thunarx-private.h +++ b/thunarx/thunarx-private.h @@ -27,7 +27,7 @@ #include <glib-object.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS #define I_(string) (g_intern_static_string ((string))) @@ -38,6 +38,6 @@ void thunarx_object_list_take_reference (GList *object_list, G_GNUC_INTERNAL gchar *thunarx_param_spec_get_option_name (GParamSpec *pspec) G_GNUC_MALLOC; -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_PRIVATE_H__ */ diff --git a/thunarx/thunarx-property-page-provider.h b/thunarx/thunarx-property-page-provider.h index bb6f90d93..53a133128 100644 --- a/thunarx/thunarx-property-page-provider.h +++ b/thunarx/thunarx-property-page-provider.h @@ -27,7 +27,7 @@ #include <thunarx/thunarx-property-page.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _ThunarxPropertyPageProviderIface ThunarxPropertyPageProviderIface; typedef struct _ThunarxPropertyPageProvider ThunarxPropertyPageProvider; @@ -66,6 +66,6 @@ GType thunarx_property_page_provider_get_type (void) G_GNUC_CONST; GList *thunarx_property_page_provider_get_pages (ThunarxPropertyPageProvider *provider, GList *files); -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_PROPERTY_PAGE_PROVIDER_H__ */ diff --git a/thunarx/thunarx-property-page.h b/thunarx/thunarx-property-page.h index 489e7fbc1..0fb3d8150 100644 --- a/thunarx/thunarx-property-page.h +++ b/thunarx/thunarx-property-page.h @@ -27,7 +27,7 @@ #include <gtk/gtk.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _ThunarxPropertyPagePrivate ThunarxPropertyPagePrivate; typedef struct _ThunarxPropertyPageClass ThunarxPropertyPageClass; @@ -72,6 +72,6 @@ GtkWidget *thunarx_property_page_get_label_widget (ThunarxPropertyPage *p void thunarx_property_page_set_label_widget (ThunarxPropertyPage *property_page, GtkWidget *label_widget); -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_PROPERTY_PAGE_H__ */ diff --git a/thunarx/thunarx-provider-factory.h b/thunarx/thunarx-provider-factory.h index 5874e2465..0d046833b 100644 --- a/thunarx/thunarx-provider-factory.h +++ b/thunarx/thunarx-provider-factory.h @@ -27,7 +27,7 @@ #include <glib-object.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _ThunarxProviderFactoryClass ThunarxProviderFactoryClass; typedef struct _ThunarxProviderFactory ThunarxProviderFactory; @@ -46,6 +46,6 @@ ThunarxProviderFactory *thunarx_provider_factory_get_default (void); GList *thunarx_provider_factory_list_providers (ThunarxProviderFactory *factory, GType type) G_GNUC_MALLOC; -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_PROVIDER_FACTORY_H__ */ diff --git a/thunarx/thunarx-renamer-provider.h b/thunarx/thunarx-renamer-provider.h index 5dfb4d96f..48687be76 100644 --- a/thunarx/thunarx-renamer-provider.h +++ b/thunarx/thunarx-renamer-provider.h @@ -27,7 +27,7 @@ #include <thunarx/thunarx-renamer.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _ThunarxRenamerProviderIface ThunarxRenamerProviderIface; typedef struct _ThunarxRenamerProvider ThunarxRenamerProvider; @@ -65,6 +65,6 @@ GType thunarx_renamer_provider_get_type (void) G_GNUC_CONST; GList *thunarx_renamer_provider_get_renamers (ThunarxRenamerProvider *provider) G_GNUC_MALLOC; -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_RENAMER_PROVIDER_H__ */ diff --git a/thunarx/thunarx-renamer.h b/thunarx/thunarx-renamer.h index 5291554be..f1050fb44 100644 --- a/thunarx/thunarx-renamer.h +++ b/thunarx/thunarx-renamer.h @@ -29,7 +29,7 @@ #include <thunarx/thunarx-file-info.h> -G_BEGIN_DECLS; +G_BEGIN_DECLS typedef struct _ThunarxRenamerPrivate ThunarxRenamerPrivate; typedef struct _ThunarxRenamerClass ThunarxRenamerClass; @@ -130,6 +130,6 @@ GList *thunarx_renamer_get_menu_items (ThunarxRenamer *renamer, void thunarx_renamer_changed (ThunarxRenamer *renamer); -G_END_DECLS; +G_END_DECLS #endif /* !__THUNARX_RENAMER_H__ */ -- GitLab