nautilus-actions-3.2.3/0000755000175100017500000000000012220365534012025 500000000000000nautilus-actions-3.2.3/gtk-doc.make0000644000175100017500000002122212220365275014135 00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt EXTRA_DIST = \ $(HTML_IMAGES) \ $(SETUP_FILES) DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) if ENABLE_GTK_DOC if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) else all-local: endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_$(V)) GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ fi $(AM_V_at)touch setup-build.stamp #### scan #### GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_$(V)) GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_$(V)) GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### xml #### GTK_DOC_V_XML=$(GTK_DOC_V_XML_$(V)) GTK_DOC_V_XML_=$(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XML_0=@echo " DOC Building XML"; sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) $(GTK_DOC_V_XML)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_$(V)) GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_$(V)) GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp #### pdf #### GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_$(V)) GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if ENABLE_GTK_DOC dist-check-gtkdoc: docs else dist-check-gtkdoc: @echo "*** gtk-doc must be installed and enabled in order to make dist" @false endif dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs nautilus-actions-3.2.3/data/0000755000175100017500000000000012220365533012735 500000000000000nautilus-actions-3.2.3/data/exports/0000755000175100017500000000000012220365533014441 500000000000000nautilus-actions-3.2.3/data/exports/Makefile.am0000644000175100017500000000212412212601376016413 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) nautilus-actions-3.2.3/data/exports/Makefile.in0000644000175100017500000004074212220365302016427 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = data/exports DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/exports/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data/exports/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/data/exports/README0000644000175100017500000000022711663540314015244 00000000000000data/exports ------------ This directory contains examples of files exported from NACT, the Nautilus-Actions Configuration Tool. P. Wieser, Aug. 2010 nautilus-actions-3.2.3/data/gconf-schemas/0000755000175100017500000000000012220365533015452 500000000000000nautilus-actions-3.2.3/data/gconf-schemas/nautilus-actions-confs.schemas.in0000644000175100017500000002500611367255341023765 00000000000000 /schemas/apps/nautilus-actions/configurations/label nautilus-actions string Label of the context menu item (mandatory) The label of the menu item that will appear in the file manager context menu when the selection matches the appearance condition settings. It is also used as a default for the toolbar label of an action. /schemas/apps/nautilus-actions/configurations/tooltip nautilus-actions string Tooltip of the context menu item The tooltip of the menu item that will appear in the file manager statusbar when the user points to the file manager context menu item with his/her mouse. /schemas/apps/nautilus-actions/configurations/icon nautilus-actions string Icon of the context menu item The icon of the menu item that will appear next to the label in the file manager context menu when the selection matches the appearance conditions settings. May be the localized name of a themed icon, or a full path to any appropriate image. /schemas/apps/nautilus-actions/configurations/enabled nautilus-actions bool Whether the action or the menu is enabled (default) If the or the menu action is disabled, it will never appear in the file manager context menu. Defaults to TRUE. true /schemas/apps/nautilus-actions/configurations/target-selection nautilus-actions bool Targets the context menu (default) Whether the action of the menu targets the selection file manager context menus. This used to be the historical behavior. Defaults to TRUE. true /schemas/apps/nautilus-actions/configurations/target-toolbar nautilus-actions bool Targets the toolbar Whether the action is candidate to be displayed in file manager toolbar. Note, that as of Nautilus 2.26, menus can not be candidate to toolbar display. false /schemas/apps/nautilus-actions/configurations/toolbar-label nautilus-actions string Label of the toolbar item The label displayed besides of the icon in the file manager toolbar. Note that actual display may depend of your own Desktop Environment preferences. Defaults to label of the context menu when not set or empty. /schemas/apps/nautilus-actions/configurations/path nautilus-actions string Path of the command The path of the command to be executed when the user select the menu item in the file manager context menu or in the toolbar. /schemas/apps/nautilus-actions/configurations/parameters nautilus-actions string Parameters of the command The parameters of the command to be executed when the user selects the menu item in the file manager context menu or in the toolbar. The parameters may contain some special tokens which are replaced by the informations provided by the file manager before starting the command: %d: base folder of the selected file(s) %f: the name of the selected file or the first one if several are selected %h: hostname of the URI %m: space-separated list of the basenames of the selected file(s)/folder(s) %M: space-separated list of the selected file(s)/folder(s), with their full paths %p: port number of the first URI %R: space-separated list of selected URIs %s: scheme of the URI %u: URI %U: username of the URI %%: a percent sign. /schemas/apps/nautilus-actions/configurations/basenames nautilus-actions list string List of patterns to be matched against the selected file(s)/folder(s) A list of strings with joker '*' or '?' to be matched against the name(s) of the selected file(s)/folder(s). Each selected items must match at least one of the filename patterns for the action or the menu be candidate to display. This obviously only applies when there is a selection. Defaults to '*'. [*] /schemas/apps/nautilus-actions/configurations/matchcase nautilus-actions bool Whether the specified basenames are case sensitive (default) Must be set to 'true' if the filename patterns are case sensitive, to 'false' otherwise. E.g., if you need to match a filename in a case-sensitive manner, set this key to 'true'. If you also want, for example '*.jpg' to match 'photo.JPG', then set 'false'. This obviously only applies when there is a selection. Defaults to 'true'. true /schemas/apps/nautilus-actions/configurations/mimetypes nautilus-actions list string List of patterns to be matched against the mimetypes of the selected file(s)/folder(s) A list of strings with joker '*' to be matched against the mimetypes of the selected file(s)/folder(s). Each selected items must match at least one of the mimetype patterns for the action to appear. This obviously only applies when there is a selection. Defaults to '*'. [*] /schemas/apps/nautilus-actions/configurations/isfile nautilus-actions bool Whether the profile applies to files Set to 'true' if the selection can have files, to 'false' otherwise. This setting is tied in with the 'isdir' setting. The valid combinations are: isfile=TRUE and isdir=FALSE: the selection may hold only files isfile=FALSE and isdir=TRUE: the selection may hold only folders isfile=TRUE and isdir=TRUE: the selection may hold both files and folders isfile=FALSE and isdir=FALSE: this is an invalid combination (your configuration will never appear). This obviously only applies when there is a selection. Defaults to 'true'. true /schemas/apps/nautilus-actions/configurations/isdir nautilus-actions bool Whether the profile applies to folders Set to 'true' if the selection can have folders, to 'false' otherwise. This setting is tied in with the 'isfile' setting. The valid combinations are: isfile=TRUE and isdir=FALSE: the selection may hold only files isfile=FALSE and isdir=TRUE: the selection may hold only folders isfile=TRUE and isdir=TRUE: the selection may hold both files and folders isfile=FALSE and isdir=FALSE: this is an invalid combination (your configuration will never appear). This obviously only applies when there is a selection. Defaults to 'false'. false /schemas/apps/nautilus-actions/configurations/accept-multiple-files nautilus-actions bool Whether the selection may be multiple If you need more than one files or folders to be selected, set this key to 'true'. If you want just one file or folder, set it to 'false'. This obviously only applies when there is a selection. Defaults to 'false'. false /schemas/apps/nautilus-actions/configurations/schemes nautilus-actions list string List of schemes to be matched against those of selected file(s)/folder(s) Defines the list of valid schemes to be matched against the selected items. The scheme is the protocol used to access the files. The keyword to use is the one used in the URI by the file manager. Examples of valid URI include: - file:///tmp/foo.txt - sftp:///root@test.example.net/tmp/foo.txt The most common schemes are: 'file': local files 'sftp': files accessed via SSH 'ftp': files accessed via FTP 'smb': files accessed via Samba (Windows share) 'dav': files accessed via WebDAV. All schemes used by your favorite file manager may be used here. This obviously only applies when there is a selection. Defaults to 'file'. [file] /schemas/apps/nautilus-actions/configurations/folders nautilus-actions list string List of folders Defines the list of valid paths to be matched against the current folder. All folders 'under' the specified path are considered valid. This is only used when there is no selection, or the selection only contains directories. Defaults to '/'. [/] nautilus-actions-3.2.3/data/gconf-schemas/nautilus-actions-prefs.schemas.in0000644000175100017500000004224411663540314023773 00000000000000 /schemas/apps/nautilus-actions/preferences/assistant-esc-confirm nautilus-actions bool Ask for a confirmation when quitting by Esc If TRUE, a confirmation will be requested when quitting an assistant by hitting the Esc key. true /schemas/apps/nautilus-actions/preferences/assistant-esc-quit nautilus-actions bool Whether the Esc key should close the assistants If TRUE, assistant may be closed by hitting the Esc key. true /schemas/apps/nautilus-actions/preferences/auto-save-on nautilus-actions bool Whether the auto-save feature should be activated If TRUE, the pending modifications will be periodically and automatically saved. false /schemas/apps/nautilus-actions/preferences/auto-save-period nautilus-actions int Periodicity of the auto-save Defines the periodicity in minutes of the automatic save. 5 /schemas/apps/nautilus-actions/preferences/export-assistant nautilus-actions list int Position and size of the export assistant window Position and size of the export assistant window ; default is set by the window manager. [] /schemas/apps/nautilus-actions/preferences/export-folder-uri nautilus-actions string Last selected folder Last folder selected when choosing a folder where to export the actions. /tmp /schemas/apps/nautilus-actions/preferences/export-format nautilus-actions string Preferred export format This is the preferred export format, used as a default when exporting items, or dropping them outside of the application. Possible values are: - "GConfSchemaV1": this used to be the historical export format. The exported file may later be imported via Import assistant of the Nautilus-Actions Configuration Tool, or via the gconftool-2 --import-schema-file command-line tool. - "GConfSchemaV2": a lighter while still compatible schema. The exported file may later be imported via Import assistant of the Nautilus-Actions Configuration Tool, or via the gconftool-2 --import-schema-file command-line tool. - "GConfEntry": this should be the preferred format for newly exported actions. The exported file may later be imported via Import assistant of the Nautilus-Actions Configuration Tool, or via the gconftool-2 --load command-line tool. - "Ask": the user will be asked at runtime for the format he wishes use. /tmp /schemas/apps/nautilus-actions/preferences/icommand-command-chooser nautilus-actions list int Position and size of the command chooser window Position and size of the command chooser window in the Command tab ; default is set by the window manager. [] /schemas/apps/nautilus-actions/preferences/icommand-folder-uri nautilus-actions string Last selected folder Last folder selected when browsing for a command in the Command tab. /bin /schemas/apps/nautilus-actions/preferences/icommand-legend-dialog nautilus-actions list int Position and size of the Legend dialog Position and size of the Legend dialog ; default is set by the UI manager. [] /schemas/apps/nautilus-actions/preferences/ifolders-chooser nautilus-actions list int Position and size of the URI chooser window Position and size of the URI chooser window in the Folders tab ; default is set by the window manager. [] /schemas/apps/nautilus-actions/preferences/ifolders-uri nautilus-actions string Last selected folder Last folder selected when browsing for an URI in the Folders tab. /bin /schemas/apps/nautilus-actions/preferences/import-ask-user nautilus-actions list int Position and size of the interaction dialog at import time Position and size of the interaction dialog at import time ; default is set by the window manager. [] /schemas/apps/nautilus-actions/preferences/import-ask-user-last-mode nautilus-actions string Last import mode chosen by the user Last import mode chosen by the user when he is asked for in import mode. Possible values are: - "NoImport": do not import an action whose UUID already exists, - "Renumber": allocate a new UUID if the imported UUID already exists, - "Override": override the existing action with the imported one. NoImport /schemas/apps/nautilus-actions/preferences/import-assistant nautilus-actions list int Position and size of the import assistant window Position and size of the import assistant window ; default is set by the window manager. [] /schemas/apps/nautilus-actions/preferences/import-folder-uri nautilus-actions string Last selected folder Last folder selected when choosing a folder from where import new actions. /tmp /schemas/apps/nautilus-actions/preferences/import-keep-choicee nautilus-actions bool Keep last chosen import mode Whether the import system should reuse the last chosen import mode. false /schemas/apps/nautilus-actions/preferences/import-mode nautilus-actions string Import mode Last import mode chosen in the Import assistant. Possible values are : - "NoImport": do not import an action whose UUID already exists, - "Renumber": allocate a new UUID if the imported UUID already exists, - "Override": override the existing action with the imported one, - "Ask": ask the user each time. NoImport /schemas/apps/nautilus-actions/preferences/io-providers-order nautilus-actions list string I/O providers Write priority The order in which I/O providers are tested when we need to write a new item down to a storage subsystem. [] /schemas/apps/nautilus-actions/preferences/iprefs-add-about-item nautilus-actions bool Add an 'About' item in the Nautilus context menu If TRUE, and if the user has defined a single root menu for its actions, then an 'About Nautilus-Actions' will be displayed at end of the first submenu. true /schemas/apps/nautilus-actions/preferences/iprefs-alphabetical-order nautilus-actions string Sort mode This preference indicates the preferred sort mode. Possible values are : - "AscendingOrder": the actions are maintained in ascending alphabetical order (historical behavior). - "DescendingOrder": the actions are maintained in descending alphabetical order. - "ManualOrder": user is free to reorder them via Nautilus-Actions configuration tool. 0 /schemas/apps/nautilus-actions/preferences/iprefs-create-root-menu nautilus-actions bool Define a 'Nautilus-Actions actions' root menu If TRUE, then a 'Nautilus-Actions actions' item will be defined in the Nautilus context menu, and will be the root menu of all available actions. true /schemas/apps/nautilus-actions/preferences/iprefs-level-zero nautilus-actions list string List of items at first level of the hierarchy UUID of the items at the first level of the hierarchy. If this key is not found or empty, then all found items are considered as a flat list. [] /schemas/apps/nautilus-actions/preferences/iprefs-relabel-actions nautilus-actions bool Whether actions should be relabeled when pasted or duplicated Whether actions should be relabeled when pasted or duplicated. true /schemas/apps/nautilus-actions/preferences/iprefs-relabel-menus nautilus-actions bool Whether menus should be relabeled when pasted or duplicated Whether menus should be relabeled when pasted or duplicated. true /schemas/apps/nautilus-actions/preferences/iprefs-relabel-profiles nautilus-actions bool Whether profiles should be relabeled when pasted or duplicated Whether profiles should be relabeled when pasted or duplicated. true /schemas/apps/nautilus-actions/preferences/main-edit-toolbar nautilus-actions bool Display Edit toolbar Whether to display or not the Edit toolbar in the main window. false /schemas/apps/nautilus-actions/preferences/main-file-toolbar nautilus-actions bool Display File toolbar Whether to display or not the File toolbar in the main window. true /schemas/apps/nautilus-actions/preferences/main-help-toolbar nautilus-actions bool Display Help toolbar Whether to display or not the Help toolbar in the main window. false /schemas/apps/nautilus-actions/preferences/main-paned nautilus-actions int Main pane position Width of the main window pane ; default is set by the UI manager. 100 /schemas/apps/nautilus-actions/preferences/main-tools-toolbar nautilus-actions bool Display Tools toolbar Whether to display or not the Tools toolbar in the main window. false /schemas/apps/nautilus-actions/preferences/main-window nautilus-actions list int Position and size of the main window Position and size of the main window ; default is set by the window manager. [] /schemas/apps/nautilus-actions/preferences/preferences-editor nautilus-actions list int Position and size of the preferences dialog Position and size of the preferences dialog ; default is set by the window manager. [] /schemas/apps/nautilus-actions/preferences/schemes nautilus-actions list string List of default schemes The list of schemes proposed by default on each new profile. A default default list is harcoded in nautilus-actions-config-tool, which may be updated by the user. [] /schemas/apps/nautilus-actions/mandatory/all/locked nautilus-actions bool Whether the whole configuration is locked The whole configuration must be understood here as the global set and order of menus and actions. When this configuration is locked, then the user is no more able to modify nor create or delete any menu or action. All items are read-only. As the order of items is also locked, the level zero itself cannot be modified, and the user is unable to reorder the items. false /schemas/apps/nautilus-actions/mandatory/na-gconf/locked nautilus-actions bool Whether the GConf I/O provider is locked When set to true (most probably as a mandatory key), this prevents all items, menus and actions, read from GConf to being modified in NACT. false /schemas/apps/nautilus-actions/mandatory/na-desktop/locked nautilus-actions bool Whether the Desktop I/O provider is locked When set to true (most probably as a mandatory key), this prevents all items, menus and actions, read from .desktop files to being modified in NACT. false nautilus-actions-3.2.3/data/gconf-schemas/Makefile.am0000644000175100017500000000427212212601376017432 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) if HAVE_GCONF schemas_in_files = \ nautilus-actions-prefs.schemas.in \ nautilus-actions-confs.schemas.in \ $(NULL) schemas_files = $(schemas_in_files:.schemas.in=.schemas) nautilus-actions-confs.schemas.in: $(top_srcdir)/src/utils/na-print-schemas -s > $@ schemasdir = $(pkgdatadir)/gconf-schemas schemas_DATA = $(schemas_files) @INTLTOOL_SCHEMAS_RULE@ if GCONF_SCHEMAS_INSTALL NA_INSTALL_SCHEMAS = yes else NA_INSTALL_SCHEMAS = no endif EXTRA_DIST = \ $(schemas_in_files) \ $(NULL) install-data-hook: @if test "$(NA_INSTALL_SCHEMAS)" = "yes"; then \ if test `id -u` != 0; then \ echo "***"; \ echo "*** You need to be root to install GConf schemas"; \ echo "***"; \ exit 1; \ fi; \ for p in $(schemas_DATA); do \ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p; \ done \ fi CLEANFILES = $(schemas_files) uninstall-hook: @if test "$(NA_INSTALL_SCHEMAS)" = "yes"; then \ for p in $(schemas_DATA); do \ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $$p; \ done \ fi endif nautilus-actions-3.2.3/data/gconf-schemas/Makefile.in0000644000175100017500000005120612220365302017435 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = data/gconf-schemas DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(schemasdir)" DATA = $(schemas_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ @HAVE_GCONF_TRUE@schemas_in_files = \ @HAVE_GCONF_TRUE@ nautilus-actions-prefs.schemas.in \ @HAVE_GCONF_TRUE@ nautilus-actions-confs.schemas.in \ @HAVE_GCONF_TRUE@ $(NULL) @HAVE_GCONF_TRUE@schemas_files = $(schemas_in_files:.schemas.in=.schemas) @HAVE_GCONF_TRUE@schemasdir = $(pkgdatadir)/gconf-schemas @HAVE_GCONF_TRUE@schemas_DATA = $(schemas_files) @GCONF_SCHEMAS_INSTALL_FALSE@@HAVE_GCONF_TRUE@NA_INSTALL_SCHEMAS = no @GCONF_SCHEMAS_INSTALL_TRUE@@HAVE_GCONF_TRUE@NA_INSTALL_SCHEMAS = yes @HAVE_GCONF_TRUE@EXTRA_DIST = \ @HAVE_GCONF_TRUE@ $(schemas_in_files) \ @HAVE_GCONF_TRUE@ $(NULL) @HAVE_GCONF_TRUE@CLEANFILES = $(schemas_files) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/gconf-schemas/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data/gconf-schemas/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-schemasDATA: $(schemas_DATA) @$(NORMAL_INSTALL) @list='$(schemas_DATA)'; test -n "$(schemasdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(schemasdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(schemasdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(schemasdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(schemasdir)" || exit $$?; \ done uninstall-schemasDATA: @$(NORMAL_UNINSTALL) @list='$(schemas_DATA)'; test -n "$(schemasdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(schemasdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(schemasdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @HAVE_GCONF_FALSE@install-data-hook: @HAVE_GCONF_FALSE@uninstall-hook: clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-schemasDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-schemasDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-schemasDATA install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-hook uninstall-schemasDATA @HAVE_GCONF_TRUE@nautilus-actions-confs.schemas.in: @HAVE_GCONF_TRUE@ $(top_srcdir)/src/utils/na-print-schemas -s > $@ @HAVE_GCONF_TRUE@@INTLTOOL_SCHEMAS_RULE@ @HAVE_GCONF_TRUE@install-data-hook: @HAVE_GCONF_TRUE@ @if test "$(NA_INSTALL_SCHEMAS)" = "yes"; then \ @HAVE_GCONF_TRUE@ if test `id -u` != 0; then \ @HAVE_GCONF_TRUE@ echo "***"; \ @HAVE_GCONF_TRUE@ echo "*** You need to be root to install GConf schemas"; \ @HAVE_GCONF_TRUE@ echo "***"; \ @HAVE_GCONF_TRUE@ exit 1; \ @HAVE_GCONF_TRUE@ fi; \ @HAVE_GCONF_TRUE@ for p in $(schemas_DATA); do \ @HAVE_GCONF_TRUE@ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p; \ @HAVE_GCONF_TRUE@ done \ @HAVE_GCONF_TRUE@ fi @HAVE_GCONF_TRUE@uninstall-hook: @HAVE_GCONF_TRUE@ @if test "$(NA_INSTALL_SCHEMAS)" = "yes"; then \ @HAVE_GCONF_TRUE@ for p in $(schemas_DATA); do \ @HAVE_GCONF_TRUE@ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $$p; \ @HAVE_GCONF_TRUE@ done \ @HAVE_GCONF_TRUE@ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/data/gconf-schemas/README0000644000175100017500000000116311663540314016255 00000000000000data/gconf-schemas ------------------ This directory contains schemas to be installed in GConf. Note to translators. -------------------- Only nautilus-actions-prefs-schemas.in may be translated in place. Other files are automatically generated. In particular, nautilus-actions-conf-schemas.in is generated from data factory includes, and automatically takes into account translations from po/ files. Note to packagers. ------------------ Even if you choose to not actually install schemas in GConf at install time, we will find back them in prefix/share/nautilus-actions/gconf-schemas/ subdirectory. P. Wieser, Aug. 2010. nautilus-actions-3.2.3/data/Makefile.am0000644000175100017500000000224412212601376014712 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) SUBDIRS = \ actions \ exports \ gconf-schemas \ $(NULL) nautilus-actions-3.2.3/data/Makefile.in0000644000175100017500000005540012220365302014720 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = data DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ SUBDIRS = \ actions \ exports \ gconf-schemas \ $(NULL) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/data/actions/0000755000175100017500000000000012220365533014375 500000000000000nautilus-actions-3.2.3/data/actions/open-terminal-here.desktop0000644000175100017500000000151111663540313021402 00000000000000 [Desktop Entry] Type=Action TargetLocation=true Icon[en_US]=/usr/share/icons/gnome/24x24/apps/gnome-terminal.png Icon[en]=/usr/share/icons/gnome/24x24/apps/gnome-terminal.png Icon[C]=/usr/share/icons/gnome/24x24/apps/gnome-terminal.png Tooltip[en_US]=Open a terminal if the current location Tooltip[en]=Open a terminal if the current location Tooltip[C]=Open a terminal if the current location ToolbarLabel[en_US]=Open a terminal here ToolbarLabel[en]=Open a terminal here ToolbarLabel[C]=Open a terminal here Name[en_US]=Open a terminal here Name[en]=Open a terminal here Name[C]=Open a terminal here Profiles=profile-zero; TargetToolbar=true Enabled = false [X-Action-Profile profile-zero] Exec=gnome-terminal --working-directory=%f MimeTypes=inode/directory; Name[en_US]=Default profile Name[en]=Default profile Name[C]=Default profile nautilus-actions-3.2.3/data/actions/show-na-parameters.desktop0000644000175100017500000000342311663540313021430 00000000000000 [Desktop Entry] Type=Action Profiles=profile-pre-v2; Name[en_US]=Display Nautilus-Actions Parameters Name[en]=Display Nautilus-Actions Parameters Name[C]=Display Nautilus-Actions Parameters Icon[en_US]=/usr/share/icons/hicolor/16x16/apps/nautilus-actions.png Icon[en]=/usr/share/icons/hicolor/16x16/apps/nautilus-actions.png Icon[C]=/usr/share/icons/hicolor/16x16/apps/nautilus-actions.png ToolbarLabel[en_US]=Display Nautilus-Actions Parameters ToolbarLabel[en]=Display Nautilus-Actions Parameters ToolbarLabel[C]=Display Nautilus-Actions Parameters Tooltip[en_US]=Display the Nautilus-Actions parameters Tooltip[en]=Display the Nautilus-Actions parameters Tooltip[C]=Display the Nautilus-Actions parameters TargetLocation=true TargetToolbar=true Enabled = false [X-Action-Profile profile-pre-v2] Exec=zenity --list --text="Nautilus-Actions parameters for the selected items:" --column="Parameter" --column="Token" --column="Value" "space-separated list of basenames" %%B "%B" "(first) basename" %%b "%b" "count selection" %%c "%c" "(first) base directory" %%d "%d" "space-separated list of base directories" %%D "%D" "(first) filename" %%f "%f" "space-separated list of filenames" %%F "%F" "hostname" %%h "%h" "(first) mimetype" %%m "%m" "space-separated list of mimetypes" %%M "%M" "username" %%n "%n" "port number" %%p "%p" "scheme" %%s "%s" "(first) URI" %%u "%u" "space-separated list of URIs" %%U "%U" "(first) basename without extension" %%w "%w" "space-separated list of basenames w/o extension" %%W "%W" "(first) extension" %%x "%x" "space-separated list of extensions" %%X "%X" --height=370 --width=768 --print-column=ALL Name[en_US]=Profile automatically created from pre-v2 action Name[en]=Profile automatically created from pre-v2 action Name[C]=Profile automatically created from pre-v2 action nautilus-actions-3.2.3/data/actions/Makefile.am0000644000175100017500000000252112212601376016350 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) actions_files = \ my-first-na-action.desktop \ my-first-na-menu.desktop \ open-terminal-here.desktop \ show-na-parameters.desktop \ $(NULL) actionsdir = $(pkgdatadir)/samples dist_actions_DATA = $(addprefix $(srcdir)/, $(actions_files)) nautilus-actions-3.2.3/data/actions/Makefile.in0000644000175100017500000004574612220365302016374 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = data/actions DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(dist_actions_DATA) README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(actionsdir)" DATA = $(dist_actions_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ actions_files = \ my-first-na-action.desktop \ my-first-na-menu.desktop \ open-terminal-here.desktop \ show-na-parameters.desktop \ $(NULL) actionsdir = $(pkgdatadir)/samples dist_actions_DATA = $(addprefix $(srcdir)/, $(actions_files)) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/actions/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data/actions/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_actionsDATA: $(dist_actions_DATA) @$(NORMAL_INSTALL) @list='$(dist_actions_DATA)'; test -n "$(actionsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(actionsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(actionsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(actionsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(actionsdir)" || exit $$?; \ done uninstall-dist_actionsDATA: @$(NORMAL_UNINSTALL) @list='$(dist_actions_DATA)'; test -n "$(actionsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(actionsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(actionsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_actionsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_actionsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_actionsDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_actionsDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/data/actions/my-first-na-menu.desktop0000644000175100017500000000120211663540313021014 00000000000000 [Desktop Entry] Type=Menu Name[en_US]=My First Nautilus-Actions menu Name[en]=My First Nautilus-Actions menu Name[C]=My First Nautilus-Actions menu ItemsList=my-first-na-action;show-na-parameters;open-terminal-here; Tooltip[en_US]=Contains some default Nautilus-Actions actions Tooltip[en]=Contains some default Nautilus-Actions actions Tooltip[C]=Contains some default Nautilus-Actions actions Icon[en_US]=/usr/share/icons/hicolor/22x22/mimetypes/application-x-catalog.png Icon[en]=/usr/share/icons/hicolor/22x22/mimetypes/application-x-catalog.png Icon[C]=/usr/share/icons/hicolor/22x22/mimetypes/application-x-catalog.png Enabled = false nautilus-actions-3.2.3/data/actions/README0000644000175100017500000000075211663540313015202 00000000000000data/actions ------------ This directory contains some .desktop files as examples of actions or menus. Actions cited in the Nautilus-Actions Configuration Tool user's manual are in particular here. There is some rather common actions which could be used as starting examples by the user. All actions in this directory are marked as 'disabled'. The packager is so free to install them in XDG_DATA_DIRS/file-manager/actions without cluttering the file manager itself. P. Wieser, Aug. 2010. nautilus-actions-3.2.3/data/actions/my-first-na-action.desktop0000644000175100017500000000113311663540313021330 00000000000000 [Desktop Entry] Type=Action Icon[en_US]=gtk-about Icon[en]=gtk-about Icon[C]=gtk-about Tooltip[en_US]=This will execute an action with some parameters Tooltip[en]=This will execute an action with some parameters Tooltip[C]=This will execute an action with some parameters ToolbarLabel[en_US]=My first action ToolbarLabel[en]=My first action ToolbarLabel[C]=My first action Name[en_US]=My first action Name[en]=My first action Name[C]=My first action Profiles=profile-zero; Enabled = false [X-Action-Profile profile-zero] Exec=zenity --info --text="%c selected item(s): %f" Name[en_US]=Default profile nautilus-actions-3.2.3/configure0000775000175100017500000220100712220365301013650 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for Nautilus-Actions 3.2.3. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: maintainer@nautilus-actions.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Nautilus-Actions' PACKAGE_TARNAME='nautilus-actions' PACKAGE_VERSION='3.2.3' PACKAGE_STRING='Nautilus-Actions 3.2.3' PACKAGE_BUGREPORT='maintainer@nautilus-actions.org' PACKAGE_URL='http://www.nautilus-actions.org' ac_unique_file="src/plugin-menu/nautilus-module.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS NA_MAINTAINER_MODE_FALSE NA_MAINTAINER_MODE_TRUE NAUTILUS_EXTENSIONS_DIR ENABLE_MANUALS_FALSE ENABLE_MANUALS_TRUE ENABLE_PDF_MANUALS_FALSE ENABLE_PDF_MANUALS_TRUE with_dblatex ENABLE_HTML_MANUALS_FALSE ENABLE_HTML_MANUALS_TRUE WITH_GDT WITH_DB2HTML with_db2html with_gdt NA_LOGDOMAIN_UTILS NA_LOGDOMAIN_TEST NA_LOGDOMAIN_PLUGIN_TRACKER NA_LOGDOMAIN_PLUGIN_MENU NA_LOGDOMAIN_NACT NA_LOGDOMAIN_CORE NA_LOGDOMAIN_IO_XML NA_LOGDOMAIN_IO_GCONF NA_LOGDOMAIN_IO_DESKTOP HAVE_GNOME_DOC_UTILS_FALSE HAVE_GNOME_DOC_UTILS_TRUE DISTCHECK_CONFIGURE_FLAGS ENABLE_SK_FALSE ENABLE_SK_TRUE DOC_USER_FORMATS OMF_DIR HELP_DIR GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE GTK_DOC_BUILD_PDF_TRUE GTK_DOC_BUILD_HTML_FALSE GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE GTKDOC_DEPS_LIBS GTKDOC_DEPS_CFLAGS HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK NAUTILUS_ACTIONS_LIBS NAUTILUS_ACTIONS_CFLAGS NAUTILUS_EXTENSION_LIBS NAUTILUS_EXTENSION_CFLAGS UUID_LIBS UUID_CFLAGS ICE_LIBS ICE_CFLAGS SM_LIBS SM_CFLAGS LIBXML_LIBS LIBXML_CFLAGS GTOP_LIBS GTOP_CFLAGS GIO_UNIX_LIBS GIO_UNIX_CFLAGS GCONF_LIBS GCONF_CFLAGS HAVE_DBUS_GLIB_FALSE HAVE_DBUS_GLIB_TRUE HAVE_GDBUS_FALSE HAVE_GDBUS_TRUE DBUS_GLIB_LIBS DBUS_GLIB_CFLAGS GDBUS_LIBS GDBUS_CFLAGS GMODULE_LIBS GMODULE_CFLAGS GLIB_LIBS GLIB_CFLAGS GTK2_LIBS GTK2_CFLAGS UNIQUE_LIBS UNIQUE_CFLAGS GTK3_LIBS GTK3_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG HAVE_GCONF_FALSE HAVE_GCONF_TRUE GCONF_SCHEMAS_INSTALL_FALSE GCONF_SCHEMAS_INSTALL_TRUE GCONF_SCHEMA_FILE_DIR GCONF_SCHEMA_CONFIG_SOURCE AM_CPPFLAGS GCONFTOOL ENABLE_DEPRECATED_FALSE ENABLE_DEPRECATED_TRUE MKINSTALLDIRS POSUB POFILES PO_IN_DATADIR_FALSE PO_IN_DATADIR_TRUE INTLLIBS INSTOBJEXT GMOFILES CATOBJEXT CATALOGS MSGFMT_OPTS GETTEXT_PACKAGE DATADIRNAME ALL_LINGUAS INTLTOOL_PERL GMSGFMT MSGFMT MSGMERGE XGETTEXT INTLTOOL_POLICY_RULE INTLTOOL_SERVICE_RULE INTLTOOL_THEME_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_CAVES_RULE INTLTOOL_XML_NOMERGE_RULE INTLTOOL_XML_RULE INTLTOOL_KBD_RULE INTLTOOL_XAM_RULE INTLTOOL_UI_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_SHEET_RULE INTLTOOL_SERVER_RULE INTLTOOL_PONG_RULE INTLTOOL_OAF_RULE INTLTOOL_PROP_RULE INTLTOOL_KEYS_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_DESKTOP_RULE intltool__v_merge_options_0 intltool__v_merge_options_ INTLTOOL_V_MERGE_OPTIONS INTLTOOL__v_MERGE_0 INTLTOOL__v_MERGE_ INTLTOOL_V_MERGE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE USE_NLS OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL GLIB_GENMARSHAL AM_CFLAGS WARN_CFLAGS AM_LDFLAGS DISABLE_DEPRECATED ACLOCAL_AMFLAGS EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking enable_static enable_as_needed enable_compile_warnings enable_iso_c enable_shared with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_nls enable_deprecated enable_gconf with_gconf_source with_gconf_schema_file_dir enable_schemas_install with_gtk with_html_dir enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf with_help_dir with_omf_dir with_help_formats enable_scrollkeeper enable_html_manuals enable_pdf_manuals with_default_io_provider with_nautilus_extdir ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GTK3_CFLAGS GTK3_LIBS UNIQUE_CFLAGS UNIQUE_LIBS GTK2_CFLAGS GTK2_LIBS GLIB_CFLAGS GLIB_LIBS GMODULE_CFLAGS GMODULE_LIBS GDBUS_CFLAGS GDBUS_LIBS DBUS_GLIB_CFLAGS DBUS_GLIB_LIBS GCONF_CFLAGS GCONF_LIBS GIO_UNIX_CFLAGS GIO_UNIX_LIBS GTOP_CFLAGS GTOP_LIBS LIBXML_CFLAGS LIBXML_LIBS SM_CFLAGS SM_LIBS ICE_CFLAGS ICE_LIBS UUID_CFLAGS UUID_LIBS NAUTILUS_EXTENSION_CFLAGS NAUTILUS_EXTENSION_LIBS GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Nautilus-Actions 3.2.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/nautilus-actions] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Nautilus-Actions 3.2.3:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-static[=PKGS] build static libraries [default=no] --enable-as-needed Enable '-Wl,--as-needed' link option [no] --enable-compile-warnings=[no/minimum/yes/maximum/error] Turn on compiler warnings --enable-iso-c Try to warn if code is not ISO C --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-nls do not use Native Language Support --enable-deprecated whether to enable deprecated functions [no] --enable-gconf whether to enable GConf subsystem [auto] --disable-schemas-install Disable the schemas installation --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] --disable-scrollkeeper do not make updates to the scrollkeeper database --enable-html-manuals[=gdt|db2html] build HTML user's manuals [gdt] --enable-pdf-manuals[=dblatex] build PDF user's manuals [dblatex] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-gconf-source=sourceaddress Config database for installing schema files. --with-gconf-schema-file-dir=dir Directory for installing schema files. --with-gtk=[2|3] the Gtk+ version to build against [auto] --with-html-dir=PATH path to installed docs --with-help-dir=DIR path to help docs --with-omf-dir=DIR path to OMF files --with-help-formats=FORMATS list of formats --with-default-io-provider[=na-gconf|na-desktop] define default I/O provider [na-desktop] --with-nautilus-extdir=DIR nautilus plugins extension directory [auto] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path GTK3_CFLAGS C compiler flags for GTK3, overriding pkg-config GTK3_LIBS linker flags for GTK3, overriding pkg-config UNIQUE_CFLAGS C compiler flags for UNIQUE, overriding pkg-config UNIQUE_LIBS linker flags for UNIQUE, overriding pkg-config GTK2_CFLAGS C compiler flags for GTK2, overriding pkg-config GTK2_LIBS linker flags for GTK2, overriding pkg-config GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config GMODULE_CFLAGS C compiler flags for GMODULE, overriding pkg-config GMODULE_LIBS linker flags for GMODULE, overriding pkg-config GDBUS_CFLAGS C compiler flags for GDBUS, overriding pkg-config GDBUS_LIBS linker flags for GDBUS, overriding pkg-config DBUS_GLIB_CFLAGS C compiler flags for DBUS_GLIB, overriding pkg-config DBUS_GLIB_LIBS linker flags for DBUS_GLIB, overriding pkg-config GCONF_CFLAGS C compiler flags for GCONF, overriding pkg-config GCONF_LIBS linker flags for GCONF, overriding pkg-config GIO_UNIX_CFLAGS C compiler flags for GIO_UNIX, overriding pkg-config GIO_UNIX_LIBS linker flags for GIO_UNIX, overriding pkg-config GTOP_CFLAGS C compiler flags for GTOP, overriding pkg-config GTOP_LIBS linker flags for GTOP, overriding pkg-config LIBXML_CFLAGS C compiler flags for LIBXML, overriding pkg-config LIBXML_LIBS linker flags for LIBXML, overriding pkg-config SM_CFLAGS C compiler flags for SM, overriding pkg-config SM_LIBS linker flags for SM, overriding pkg-config ICE_CFLAGS C compiler flags for ICE, overriding pkg-config ICE_LIBS linker flags for ICE, overriding pkg-config UUID_CFLAGS C compiler flags for UUID, overriding pkg-config UUID_LIBS linker flags for UUID, overriding pkg-config NAUTILUS_EXTENSION_CFLAGS C compiler flags for NAUTILUS_EXTENSION, overriding pkg-config NAUTILUS_EXTENSION_LIBS linker flags for NAUTILUS_EXTENSION, overriding pkg-config GTKDOC_DEPS_CFLAGS C compiler flags for GTKDOC_DEPS, overriding pkg-config GTKDOC_DEPS_LIBS linker flags for GTKDOC_DEPS, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . Nautilus-Actions home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Nautilus-Actions configure 3.2.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------------- ## ## Report this to maintainer@nautilus-actions.org ## ## ---------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Nautilus-Actions $as_me 3.2.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version='1.13' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='nautilus-actions' VERSION='3.2.3' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' ac_config_headers="$ac_config_headers src/config.h" ac_config_files="$ac_config_files Makefile data/Makefile data/actions/Makefile data/exports/Makefile data/gconf-schemas/Makefile docs/Makefile docs/nact/Makefile docs/reference/Makefile docs/reference/version.xml m4/Makefile icons/Makefile icons/16x16/Makefile icons/22x22/Makefile icons/32x32/Makefile icons/48x48/Makefile icons/scalable/Makefile src/Makefile src/api/Makefile src/core/Makefile src/io-desktop/Makefile src/io-gconf/Makefile src/io-xml/Makefile src/plugin-menu/Makefile src/plugin-tracker/Makefile src/nact/Makefile src/test/Makefile src/utils/Makefile tools/Makefile po/Makefile.in" # pwi 2009-05-15 disabled as GNOME_COMMON_INIT takes care of that #AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS") # don't agree with maintainer mode use # see http://www.gnu.org/software/automake/manual/automake.html#index-AM_005fMAINTAINER_005fMODE-1001 # but gnome-autogen.sh forces its usage and gnome_common_init requires it { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # check for compiler characteristics and options ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi # other traditional tools { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # Gnome stuff ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}" if test -n "$ac_macro_dir"; then ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS" fi DISABLE_DEPRECATED="" if test $USE_MAINTAINER_MODE = yes; then DOMAINS="GCONF BONOBO BONOBO_UI GNOME LIBGLADE GNOME_VFS WNCK LIBSOUP" for DOMAIN in $DOMAINS; do DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES" done fi # Check whether --enable-as-needed was given. if test "${enable_as_needed+set}" = set; then : enableval=$enable_as_needed; enable_as_needed=$enableval else enable_as_needed=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to only link with needed libraries" >&5 $as_echo_n "checking whether to only link with needed libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_as_needed" >&5 $as_echo "$enable_as_needed" >&6; } if test "x${enable_as_needed}" = "xyes"; then AM_LDFLAGS="${AM_LDFLAGS} -Wl,--as-needed" fi _ac_warning_def=yes _ac_compliant_def="-ansi -Wno-overlength-strings -Wformat=2" # Check whether --enable-compile-warnings was given. if test "${enable_compile_warnings+set}" = set; then : enableval=$enable_compile_warnings; else enable_compile_warnings="${_ac_warning_def}" fi warnCFLAGS= if test "x$GCC" != xyes; then enable_compile_warnings=no fi warning_flags= realsave_CFLAGS="$CFLAGS" case "$enable_compile_warnings" in no) warning_flags= ;; minimum) warning_flags="-Wall" ;; yes) warning_flags="-Wall -Wmissing-prototypes" ;; maximum|error) warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith" CFLAGS="$warning_flags $CFLAGS" for option in -Wno-sign-compare; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc understands $option" >&5 $as_echo_n "checking whether gcc understands $option... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : has_option=yes else has_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_option" >&5 $as_echo "$has_option" >&6; } if test $has_option = yes; then warning_flags="$warning_flags $option" fi unset has_option unset SAVE_CFLAGS done unset option if test "$enable_compile_warnings" = "error" ; then warning_flags="$warning_flags -Werror" fi ;; *) as_fn_error $? "Unknown argument '$enable_compile_warnings' to --enable-compile-warnings" "$LINENO" 5 ;; esac CFLAGS="$realsave_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking what warning flags to pass to the C compiler" >&5 $as_echo_n "checking what warning flags to pass to the C compiler... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $warning_flags" >&5 $as_echo "$warning_flags" >&6; } # Check whether --enable-iso-c was given. if test "${enable_iso_c+set}" = set; then : enableval=$enable_iso_c; else enable_iso_c="${_ac_compliant_def}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking what language compliance flags to pass to the C compiler" >&5 $as_echo_n "checking what language compliance flags to pass to the C compiler... " >&6; } complCFLAGS= if test "x$enable_iso_c" != "xno"; then if test "x$GCC" = "xyes"; then if test "x${_ac_compliant_def}" = "x"; then case " $CFLAGS " in *\ \ -ansi\ \ *) ;; *) complCFLAGS="$complCFLAGS -ansi" ;; esac case " $CFLAGS " in *\ \ -pedantic\ \ *) ;; *) complCFLAGS="$complCFLAGS -pedantic" ;; esac else complCFLAGS="$complCFLAGS ${_ac_compliant_def}" fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $complCFLAGS" >&5 $as_echo "$complCFLAGS" >&6; } WARN_CFLAGS="$warning_flags $complCFLAGS" AM_CFLAGS="${AM_CFLAGS} ${WARN_CFLAGS}" # GLib marshaling # Extract the first word of "glib-genmarshal", so it can be a program name with args. set dummy glib-genmarshal; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GLIB_GENMARSHAL+:} false; then : $as_echo_n "(cached) " >&6 else case $GLIB_GENMARSHAL in [\\/]* | ?:[\\/]*) ac_cv_path_GLIB_GENMARSHAL="$GLIB_GENMARSHAL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GLIB_GENMARSHAL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GLIB_GENMARSHAL=$ac_cv_path_GLIB_GENMARSHAL if test -n "$GLIB_GENMARSHAL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_GENMARSHAL" >&5 $as_echo "$GLIB_GENMARSHAL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # libtool case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: # localization # note that this same version is also required by autogen.sh { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } case "$am__api_version" in 1.01234) as_fn_error $? "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 ;; *) ;; esac INTLTOOL_REQUIRED_VERSION_AS_INT=`echo 0.35.5 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` if test -n "0.35.5"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= 0.35.5" >&5 $as_echo_n "checking for intltool >= 0.35.5... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5 $as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || as_fn_error $? "Your intltool is too old. You need intltool 0.35.5 or later." "$LINENO" 5 fi # Extract the first word of "intltool-update", so it can be a program name with args. set dummy intltool-update; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_UPDATE+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_UPDATE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE if test -n "$INTLTOOL_UPDATE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5 $as_echo "$INTLTOOL_UPDATE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-merge", so it can be a program name with args. set dummy intltool-merge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_MERGE+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_MERGE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE if test -n "$INTLTOOL_MERGE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5 $as_echo "$INTLTOOL_MERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-extract", so it can be a program name with args. set dummy intltool-extract; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_EXTRACT+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_EXTRACT in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT if test -n "$INTLTOOL_EXTRACT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5 $as_echo "$INTLTOOL_EXTRACT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then as_fn_error $? "The intltool scripts were not found. Please install intltool." "$LINENO" 5 fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' INTLTOOL__v_MERGE_0='@echo " ITMRG " $@;' INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' intltool__v_merge_options_0='-q' INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< $@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< $@' else INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.$$RANDOM && mkdir $$_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u $$_it_tmp_dir $< $@ && rmdir $$_it_tmp_dir' fi INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' # Check the gettext tools to make sure they are GNU # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case $XGETTEXT in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XGETTEXT=$ac_cv_path_XGETTEXT if test -n "$XGETTEXT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case $MSGMERGE in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MSGMERGE=$ac_cv_path_MSGMERGE if test -n "$MSGMERGE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $MSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MSGFMT=$ac_cv_path_MSGFMT if test -n "$MSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL if test -n "$INTLTOOL_PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5 $as_echo "$INTLTOOL_PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_PERL"; then as_fn_error $? "perl not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5 $as_echo_n "checking for perl >= 5.8.1... " >&6; } $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 if test $? -ne 0; then as_fn_error $? "perl 5.8.1 is required for intltool" "$LINENO" 5 else IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5 $as_echo "$IT_PERL_VERSION" >&6; } fi if test "x" != "xno-xml"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5 $as_echo_n "checking for XML::Parser... " >&6; } if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else as_fn_error $? "XML::Parser perl module is required for intltool" "$LINENO" 5 fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile # Set DATADIRNAME correctly if it is not set yet # (copied from glib-gettext.m4) if test -z "$DATADIRNAME"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : DATADIRNAME=share else case $host in *-*-solaris*) ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : DATADIRNAME=share else DATADIRNAME=lib fi ;; *) DATADIRNAME=lib ;; esac fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi GETTEXT_PACKAGE=${PACKAGE} cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE "${GETTEXT_PACKAGE}" _ACEOF for ac_header in locale.h do : ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LOCALE_H 1 _ACEOF fi done if test $ac_cv_header_locale_h = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 $as_echo_n "checking for LC_MESSAGES... " >&6; } if ${am_cv_val_LC_MESSAGES+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_val_LC_MESSAGES=yes else am_cv_val_LC_MESSAGES=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 $as_echo "$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then $as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h fi fi USE_NLS=yes gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes; then : gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5 $as_echo_n "checking for ngettext in libc... " >&6; } if ${gt_cv_func_ngettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !ngettext ("","", 1) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_ngettext_libc=yes else gt_cv_func_ngettext_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5 $as_echo "$gt_cv_func_ngettext_libc" >&6; } if test "$gt_cv_func_ngettext_libc" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5 $as_echo_n "checking for dgettext in libc... " >&6; } if ${gt_cv_func_dgettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !dgettext ("","") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_dgettext_libc=yes else gt_cv_func_dgettext_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5 $as_echo "$gt_cv_func_dgettext_libc" >&6; } fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then for ac_func in bind_textdomain_codeset do : ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 1 _ACEOF fi done fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 $as_echo_n "checking for bindtextdomain in -lintl... " >&6; } if ${ac_cv_lib_intl_bindtextdomain+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bindtextdomain (); int main () { return bindtextdomain (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_bindtextdomain=yes else ac_cv_lib_intl_bindtextdomain=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5 $as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if ${ac_cv_lib_intl_ngettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_ngettext=yes else ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 $as_echo_n "checking for dgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dgettext (); int main () { return dgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dgettext=yes else ac_cv_lib_intl_dgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 $as_echo "$ac_cv_lib_intl_dgettext" >&6; } if test "x$ac_cv_lib_intl_dgettext" = xyes; then : gt_cv_func_dgettext_libintl=yes fi fi fi if test "$gt_cv_func_dgettext_libintl" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 $as_echo_n "checking if -liconv is needed to use gettext... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if ${ac_cv_lib_intl_ngettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_ngettext=yes else ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 $as_echo_n "checking for dcgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dcgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dcgettext (); int main () { return dcgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dcgettext=yes else ac_cv_lib_intl_dcgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5 $as_echo "$ac_cv_lib_intl_dcgettext" >&6; } if test "x$ac_cv_lib_intl_dcgettext" = xyes; then : gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv else : fi else : fi fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset for ac_func in bind_textdomain_codeset do : ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 1 _ACEOF fi done LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" for ac_func in dcgettext do : ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext" if test "x$ac_cv_func_dcgettext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi done MSGFMT_OPTS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5 $as_echo_n "checking if msgfmt accepts -c... " >&6; } cat >conftest.foo <<_ACEOF msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" _ACEOF if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5 ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then MSGFMT_OPTS=-c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } echo "$as_me: failed input was:" >&5 sed 's/^/| /' conftest.foo >&5 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : CATOBJEXT=.gmo DATADIRNAME=share else case $host in *-*-solaris*) ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : CATOBJEXT=.gmo DATADIRNAME=share else CATOBJEXT=.mo DATADIRNAME=lib fi ;; *-*-openbsd*) CATOBJEXT=.mo DATADIRNAME=share ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi fi if test "$gt_cv_have_gettext" = "yes" ; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po ac_config_commands="$ac_config_commands default-1" for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 $as_echo_n "checking for catalogs to be installed... " >&6; } NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 $as_echo "$LINGUAS" >&6; } fi if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES # Enable deprecated functions ? # Check whether --enable-deprecated was given. if test "${enable_deprecated+set}" = set; then : enableval=$enable_deprecated; enable_deprecated=$enableval else enable_deprecated="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deprecated symbols should be enabled" >&5 $as_echo_n "checking whether deprecated symbols should be enabled... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_deprecated}" >&5 $as_echo "${enable_deprecated}" >&6; } if test "${enable_deprecated}" = "yes"; then $as_echo "#define NA_ENABLE_DEPRECATED 1" >>confdefs.h fi if test "${enable_deprecated}" = "yes"; then ENABLE_DEPRECATED_TRUE= ENABLE_DEPRECATED_FALSE='#' else ENABLE_DEPRECATED_TRUE='#' ENABLE_DEPRECATED_FALSE= fi # Have and want GConf support ? # Check whether --enable-gconf was given. if test "${enable_gconf+set}" = set; then : enableval=$enable_gconf; enable_gconf=$enableval else enable_gconf="auto" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GConf is enabled" >&5 $as_echo_n "checking whether GConf is enabled... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_gconf}" >&5 $as_echo "${enable_gconf}" >&6; } if test "${enable_gconf}" = "auto"; then # Extract the first word of "gconftool-2", so it can be a program name with args. set dummy gconftool-2; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GCONFTOOL+:} false; then : $as_echo_n "(cached) " >&6 else case $GCONFTOOL in [\\/]* | ?:[\\/]*) ac_cv_path_GCONFTOOL="$GCONFTOOL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GCONFTOOL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GCONFTOOL" && ac_cv_path_GCONFTOOL="no" ;; esac fi GCONFTOOL=$ac_cv_path_GCONFTOOL if test -n "$GCONFTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONFTOOL" >&5 $as_echo "$GCONFTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "${GCONFTOOL}" = "no"; then enable_gconf="no" else enable_gconf="yes" fi else if test "${enable_gconf}" = "yes"; then # Extract the first word of "gconftool-2", so it can be a program name with args. set dummy gconftool-2; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GCONFTOOL+:} false; then : $as_echo_n "(cached) " >&6 else case $GCONFTOOL in [\\/]* | ?:[\\/]*) ac_cv_path_GCONFTOOL="$GCONFTOOL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GCONFTOOL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GCONFTOOL" && ac_cv_path_GCONFTOOL="no" ;; esac fi GCONFTOOL=$ac_cv_path_GCONFTOOL if test -n "$GCONFTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONFTOOL" >&5 $as_echo "$GCONFTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "${GCONFTOOL}" = "no"; then as_fn_error $? "gconftool-2: program not found" "$LINENO" 5 fi fi fi if test "${enable_gconf}" = "yes"; then AM_CPPFLAGS="${AM_CPPFLAGS} -DHAVE_GCONF" cat >>confdefs.h <<_ACEOF #define HAVE_GCONF 1 _ACEOF fi if test ""${enable_gconf}"" = "yes"; then if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source` else GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE fi fi # Check whether --with-gconf-source was given. if test "${with_gconf_source+set}" = set; then : withval=$with_gconf_source; GCONF_SCHEMA_CONFIG_SOURCE="$withval" fi if test ""${enable_gconf}"" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation" >&5 $as_echo "Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation" >&6; } fi if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas' fi # Check whether --with-gconf-schema-file-dir was given. if test "${with_gconf_schema_file_dir+set}" = set; then : withval=$with_gconf_schema_file_dir; GCONF_SCHEMA_FILE_DIR="$withval" fi if test ""${enable_gconf}"" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files" >&5 $as_echo "Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files" >&6; } fi # Check whether --enable-schemas-install was given. if test "${enable_schemas_install+set}" = set; then : enableval=$enable_schemas_install; case ${enableval} in yes|no) ;; *) as_fn_error $? "bad value ${enableval} for --enable-schemas-install" "$LINENO" 5 ;; esac fi if test "x${enable_schemas_install}" = "xno" -o ""${enable_gconf}"" != "yes"; then msg_schemas_install="disabled"; else msg_schemas_install="enabled in ${GCONF_SCHEMA_FILE_DIR}" fi if test "$enable_schemas_install" != no -a ""${enable_gconf}"" = "yes"; then GCONF_SCHEMAS_INSTALL_TRUE= GCONF_SCHEMAS_INSTALL_FALSE='#' else GCONF_SCHEMAS_INSTALL_TRUE='#' GCONF_SCHEMAS_INSTALL_FALSE= fi if test "${enable_gconf}" = "yes"; then HAVE_GCONF_TRUE= HAVE_GCONF_FALSE='#' else HAVE_GCONF_TRUE='#' HAVE_GCONF_FALSE= fi # note that requiring through pkg-config the version number of the # nautilus-extension library actually returns the version number of # nautilus itself (e.g. 2.24.2) instead of the library version info # (1.1.0) ; for the usual final user, this is very analog to requiring # a whole gnome version # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "${PKG_CONFIG}" = "no"; then as_fn_error $? "You need to install pkg-config" "$LINENO" 5 fi # Oldest supported distribution: Ubuntu 10 LTS (Gnome 2.30): april 2013 glib_required=2.24.0 gtk_required=2.20.0 # Check whether --with-gtk was given. if test "${with_gtk+set}" = set; then : withval=$with_gtk; with_gtk=$withval else with_gtk="auto" fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi if test "${with_gtk}" = "auto"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK3" >&5 $as_echo_n "checking for GTK3... " >&6; } if test -n "$GTK3_CFLAGS"; then pkg_cv_GTK3_CFLAGS="$GTK3_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= \${gtk_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= ${gtk_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK3_CFLAGS=`$PKG_CONFIG --cflags "gtk+-3.0 >= ${gtk_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTK3_LIBS"; then pkg_cv_GTK3_LIBS="$GTK3_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= \${gtk_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= ${gtk_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK3_LIBS=`$PKG_CONFIG --libs "gtk+-3.0 >= ${gtk_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTK3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-3.0 >= ${gtk_required}" 2>&1` else GTK3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-3.0 >= ${gtk_required}" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK3_PKG_ERRORS" >&5 have_gtk3=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_gtk3=no else GTK3_CFLAGS=$pkg_cv_GTK3_CFLAGS GTK3_LIBS=$pkg_cv_GTK3_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_gtk3=yes fi if test "${have_gtk3}" = "yes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNIQUE" >&5 $as_echo_n "checking for UNIQUE... " >&6; } if test -n "$UNIQUE_CFLAGS"; then pkg_cv_UNIQUE_CFLAGS="$UNIQUE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"unique-3.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "unique-3.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UNIQUE_CFLAGS=`$PKG_CONFIG --cflags "unique-3.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$UNIQUE_LIBS"; then pkg_cv_UNIQUE_LIBS="$UNIQUE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"unique-3.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "unique-3.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UNIQUE_LIBS=`$PKG_CONFIG --libs "unique-3.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then UNIQUE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "unique-3.0" 2>&1` else UNIQUE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "unique-3.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$UNIQUE_PKG_ERRORS" >&5 have_UNIQUE="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_UNIQUE="no" else UNIQUE_CFLAGS=$pkg_cv_UNIQUE_CFLAGS UNIQUE_LIBS=$pkg_cv_UNIQUE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_UNIQUE="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "UNIQUE_CFLAGS='${UNIQUE_CFLAGS}'" #echo "UNIQUE_LIBS='${UNIQUE_LIBS}'" #echo "against Gtk2: $(echo ${UNIQUE_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${UNIQUE_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_UNIQUE}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${UNIQUE_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_UNIQUE="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${UNIQUE_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_UNIQUE="no" fi fi else if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: condition unique-3.0 not satisfied" >&5 $as_echo "warning: UNIQUE: condition unique-3.0 not satisfied" >&6; } else as_fn_error $? "UNIQUE: condition unique-3.0 not satisfied" "$LINENO" 5 fi fi if test "${have_UNIQUE}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${UNIQUE_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${UNIQUE_LIBS}" fi if test "${have_UNIQUE}" != "yes"; then have_gtk3="no" else NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTK3_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTK3_LIBS}" fi fi if test "${have_gtk3}" != "yes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK2" >&5 $as_echo_n "checking for GTK2... " >&6; } if test -n "$GTK2_CFLAGS"; then pkg_cv_GTK2_CFLAGS="$GTK2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \${gtk_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= ${gtk_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= ${gtk_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTK2_LIBS"; then pkg_cv_GTK2_LIBS="$GTK2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \${gtk_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= ${gtk_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= ${gtk_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTK2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-2.0 >= ${gtk_required}" 2>&1` else GTK2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-2.0 >= ${gtk_required}" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK2_PKG_ERRORS" >&5 have_gtk2=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_gtk2=no else GTK2_CFLAGS=$pkg_cv_GTK2_CFLAGS GTK2_LIBS=$pkg_cv_GTK2_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_gtk2=yes fi if test "${have_gtk2}" = "yes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNIQUE" >&5 $as_echo_n "checking for UNIQUE... " >&6; } if test -n "$UNIQUE_CFLAGS"; then pkg_cv_UNIQUE_CFLAGS="$UNIQUE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"unique-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "unique-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UNIQUE_CFLAGS=`$PKG_CONFIG --cflags "unique-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$UNIQUE_LIBS"; then pkg_cv_UNIQUE_LIBS="$UNIQUE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"unique-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "unique-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UNIQUE_LIBS=`$PKG_CONFIG --libs "unique-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then UNIQUE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "unique-1.0" 2>&1` else UNIQUE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "unique-1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$UNIQUE_PKG_ERRORS" >&5 have_UNIQUE="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_UNIQUE="no" else UNIQUE_CFLAGS=$pkg_cv_UNIQUE_CFLAGS UNIQUE_LIBS=$pkg_cv_UNIQUE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_UNIQUE="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "UNIQUE_CFLAGS='${UNIQUE_CFLAGS}'" #echo "UNIQUE_LIBS='${UNIQUE_LIBS}'" #echo "against Gtk2: $(echo ${UNIQUE_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${UNIQUE_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_UNIQUE}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${UNIQUE_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_UNIQUE="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${UNIQUE_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_UNIQUE="no" fi fi else if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: condition unique-1.0 not satisfied" >&5 $as_echo "warning: UNIQUE: condition unique-1.0 not satisfied" >&6; } else as_fn_error $? "UNIQUE: condition unique-1.0 not satisfied" "$LINENO" 5 fi fi if test "${have_UNIQUE}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${UNIQUE_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${UNIQUE_LIBS}" fi if test "${have_UNIQUE}" != "yes"; then have_gtk2="no" else NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTK2_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTK2_LIBS}" fi fi if test "${have_gtk2}" != "yes"; then as_fn_error $? "unable to find any suitable Gtk+ library" "$LINENO" 5 fi fi else if test "${with_gtk}" = "2"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK2" >&5 $as_echo_n "checking for GTK2... " >&6; } if test -n "$GTK2_CFLAGS"; then pkg_cv_GTK2_CFLAGS="$GTK2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \${gtk_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= ${gtk_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= ${gtk_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTK2_LIBS"; then pkg_cv_GTK2_LIBS="$GTK2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \${gtk_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= ${gtk_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= ${gtk_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTK2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-2.0 >= ${gtk_required}" 2>&1` else GTK2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-2.0 >= ${gtk_required}" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK2_PKG_ERRORS" >&5 have_gtk2=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_gtk2=no else GTK2_CFLAGS=$pkg_cv_GTK2_CFLAGS GTK2_LIBS=$pkg_cv_GTK2_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_gtk2=yes fi if test "${have_gtk2}" = "yes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNIQUE" >&5 $as_echo_n "checking for UNIQUE... " >&6; } if test -n "$UNIQUE_CFLAGS"; then pkg_cv_UNIQUE_CFLAGS="$UNIQUE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"unique-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "unique-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UNIQUE_CFLAGS=`$PKG_CONFIG --cflags "unique-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$UNIQUE_LIBS"; then pkg_cv_UNIQUE_LIBS="$UNIQUE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"unique-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "unique-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UNIQUE_LIBS=`$PKG_CONFIG --libs "unique-1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then UNIQUE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "unique-1.0" 2>&1` else UNIQUE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "unique-1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$UNIQUE_PKG_ERRORS" >&5 have_UNIQUE="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_UNIQUE="no" else UNIQUE_CFLAGS=$pkg_cv_UNIQUE_CFLAGS UNIQUE_LIBS=$pkg_cv_UNIQUE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_UNIQUE="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "UNIQUE_CFLAGS='${UNIQUE_CFLAGS}'" #echo "UNIQUE_LIBS='${UNIQUE_LIBS}'" #echo "against Gtk2: $(echo ${UNIQUE_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${UNIQUE_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_UNIQUE}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${UNIQUE_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_UNIQUE="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${UNIQUE_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_UNIQUE="no" fi fi else if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: condition unique-1.0 not satisfied" >&5 $as_echo "warning: UNIQUE: condition unique-1.0 not satisfied" >&6; } else as_fn_error $? "UNIQUE: condition unique-1.0 not satisfied" "$LINENO" 5 fi fi if test "${have_UNIQUE}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${UNIQUE_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${UNIQUE_LIBS}" fi if test "${have_UNIQUE}" != "yes"; then have_gtk2="no" else NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTK2_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTK2_LIBS}" fi fi if test "${have_gtk2}" != "yes"; then as_fn_error $? "unable to build against Gtk+-2.0 library" "$LINENO" 5 fi else if test "${with_gtk}" = "3"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK3" >&5 $as_echo_n "checking for GTK3... " >&6; } if test -n "$GTK3_CFLAGS"; then pkg_cv_GTK3_CFLAGS="$GTK3_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= \${gtk_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= ${gtk_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK3_CFLAGS=`$PKG_CONFIG --cflags "gtk+-3.0 >= ${gtk_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTK3_LIBS"; then pkg_cv_GTK3_LIBS="$GTK3_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= \${gtk_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= ${gtk_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK3_LIBS=`$PKG_CONFIG --libs "gtk+-3.0 >= ${gtk_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTK3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-3.0 >= ${gtk_required}" 2>&1` else GTK3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-3.0 >= ${gtk_required}" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK3_PKG_ERRORS" >&5 have_gtk3=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_gtk3=no else GTK3_CFLAGS=$pkg_cv_GTK3_CFLAGS GTK3_LIBS=$pkg_cv_GTK3_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_gtk3=yes fi if test "${have_gtk3}" = "yes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNIQUE" >&5 $as_echo_n "checking for UNIQUE... " >&6; } if test -n "$UNIQUE_CFLAGS"; then pkg_cv_UNIQUE_CFLAGS="$UNIQUE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"unique-3.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "unique-3.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UNIQUE_CFLAGS=`$PKG_CONFIG --cflags "unique-3.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$UNIQUE_LIBS"; then pkg_cv_UNIQUE_LIBS="$UNIQUE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"unique-3.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "unique-3.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UNIQUE_LIBS=`$PKG_CONFIG --libs "unique-3.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then UNIQUE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "unique-3.0" 2>&1` else UNIQUE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "unique-3.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$UNIQUE_PKG_ERRORS" >&5 have_UNIQUE="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_UNIQUE="no" else UNIQUE_CFLAGS=$pkg_cv_UNIQUE_CFLAGS UNIQUE_LIBS=$pkg_cv_UNIQUE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_UNIQUE="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "UNIQUE_CFLAGS='${UNIQUE_CFLAGS}'" #echo "UNIQUE_LIBS='${UNIQUE_LIBS}'" #echo "against Gtk2: $(echo ${UNIQUE_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${UNIQUE_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_UNIQUE}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${UNIQUE_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "UNIQUE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_UNIQUE="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${UNIQUE_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "UNIQUE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_UNIQUE="no" fi fi else if test "no" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UNIQUE: condition unique-3.0 not satisfied" >&5 $as_echo "warning: UNIQUE: condition unique-3.0 not satisfied" >&6; } else as_fn_error $? "UNIQUE: condition unique-3.0 not satisfied" "$LINENO" 5 fi fi if test "${have_UNIQUE}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${UNIQUE_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${UNIQUE_LIBS}" fi if test "${have_UNIQUE}" != "yes"; then have_gtk3="no" else NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTK3_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTK3_LIBS}" fi fi if test "${have_gtk3}" != "yes"; then as_fn_error $? "unable to build against Gtk+-3.0 library" "$LINENO" 5 fi else as_fn_error $? "--with-gtk=${with_gtk}: invalid argument" "$LINENO" 5 fi fi fi # GDBus comes in GIO with 2.26 # so uses GDBus if present, or fallback into dbus-glib-1 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \${glib_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= ${glib_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= ${glib_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \${glib_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= ${glib_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= ${glib_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= ${glib_required}" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= ${glib_required}" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 have_GLIB="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_GLIB="no" else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_GLIB="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "GLIB_CFLAGS='${GLIB_CFLAGS}'" #echo "GLIB_LIBS='${GLIB_LIBS}'" #echo "against Gtk2: $(echo ${GLIB_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${GLIB_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_GLIB}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${GLIB_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GLIB: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: GLIB: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "GLIB: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_GLIB="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${GLIB_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GLIB: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: GLIB: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "GLIB: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_GLIB="no" fi fi else if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GLIB: condition glib-2.0 >= ${glib_required} not satisfied" >&5 $as_echo "warning: GLIB: condition glib-2.0 >= ${glib_required} not satisfied" >&6; } else as_fn_error $? "GLIB: condition glib-2.0 >= ${glib_required} not satisfied" "$LINENO" 5 fi fi if test "${have_GLIB}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GLIB_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GLIB_LIBS}" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMODULE" >&5 $as_echo_n "checking for GMODULE... " >&6; } if test -n "$GMODULE_CFLAGS"; then pkg_cv_GMODULE_CFLAGS="$GMODULE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-2.0 >= \${glib_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "gmodule-2.0 >= ${glib_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GMODULE_CFLAGS=`$PKG_CONFIG --cflags "gmodule-2.0 >= ${glib_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GMODULE_LIBS"; then pkg_cv_GMODULE_LIBS="$GMODULE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-2.0 >= \${glib_required}\""; } >&5 ($PKG_CONFIG --exists --print-errors "gmodule-2.0 >= ${glib_required}") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GMODULE_LIBS=`$PKG_CONFIG --libs "gmodule-2.0 >= ${glib_required}" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GMODULE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmodule-2.0 >= ${glib_required}" 2>&1` else GMODULE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmodule-2.0 >= ${glib_required}" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GMODULE_PKG_ERRORS" >&5 have_GMODULE="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_GMODULE="no" else GMODULE_CFLAGS=$pkg_cv_GMODULE_CFLAGS GMODULE_LIBS=$pkg_cv_GMODULE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_GMODULE="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "GMODULE_CFLAGS='${GMODULE_CFLAGS}'" #echo "GMODULE_LIBS='${GMODULE_LIBS}'" #echo "against Gtk2: $(echo ${GMODULE_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${GMODULE_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_GMODULE}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${GMODULE_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GMODULE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: GMODULE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "GMODULE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_GMODULE="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${GMODULE_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GMODULE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: GMODULE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "GMODULE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_GMODULE="no" fi fi else if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GMODULE: condition gmodule-2.0 >= ${glib_required} not satisfied" >&5 $as_echo "warning: GMODULE: condition gmodule-2.0 >= ${glib_required} not satisfied" >&6; } else as_fn_error $? "GMODULE: condition gmodule-2.0 >= ${glib_required} not satisfied" "$LINENO" 5 fi fi if test "${have_GMODULE}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GMODULE_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GMODULE_LIBS}" fi _na_have_gdbus="no" _na_have_dbus_glib="no" pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GDBUS" >&5 $as_echo_n "checking for GDBUS... " >&6; } if test -n "$GDBUS_CFLAGS"; then pkg_cv_GDBUS_CFLAGS="$GDBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= 2.30\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-2.0 >= 2.30") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GDBUS_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= 2.30" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GDBUS_LIBS"; then pkg_cv_GDBUS_LIBS="$GDBUS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= 2.30\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-2.0 >= 2.30") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GDBUS_LIBS=`$PKG_CONFIG --libs "gio-2.0 >= 2.30" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GDBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-2.0 >= 2.30" 2>&1` else GDBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-2.0 >= 2.30" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GDBUS_PKG_ERRORS" >&5 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_GLIB" >&5 $as_echo_n "checking for DBUS_GLIB... " >&6; } if test -n "$DBUS_GLIB_CFLAGS"; then pkg_cv_DBUS_GLIB_CFLAGS="$DBUS_GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-glib-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_GLIB_LIBS"; then pkg_cv_DBUS_GLIB_LIBS="$DBUS_GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-glib-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_GLIB_LIBS=`$PKG_CONFIG --libs "dbus-glib-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-glib-1" 2>&1` else DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-glib-1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-glib-1) were not met: $DBUS_GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_GLIB_CFLAGS and DBUS_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_GLIB_CFLAGS and DBUS_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_GLIB_CFLAGS=$pkg_cv_DBUS_GLIB_CFLAGS DBUS_GLIB_LIBS=$pkg_cv_DBUS_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } _na_have_dbus_glib="yes" fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_GLIB" >&5 $as_echo_n "checking for DBUS_GLIB... " >&6; } if test -n "$DBUS_GLIB_CFLAGS"; then pkg_cv_DBUS_GLIB_CFLAGS="$DBUS_GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-glib-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_GLIB_LIBS"; then pkg_cv_DBUS_GLIB_LIBS="$DBUS_GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-glib-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_GLIB_LIBS=`$PKG_CONFIG --libs "dbus-glib-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-glib-1" 2>&1` else DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-glib-1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-glib-1) were not met: $DBUS_GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_GLIB_CFLAGS and DBUS_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_GLIB_CFLAGS and DBUS_GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_GLIB_CFLAGS=$pkg_cv_DBUS_GLIB_CFLAGS DBUS_GLIB_LIBS=$pkg_cv_DBUS_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } _na_have_dbus_glib="yes" fi else GDBUS_CFLAGS=$pkg_cv_GDBUS_CFLAGS GDBUS_LIBS=$pkg_cv_GDBUS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } _na_have_gdbus="yes" fi if test "${_na_have_gdbus}" = "yes"; then cat >>confdefs.h <<_ACEOF #define HAVE_GDBUS 1 _ACEOF NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GDBUS_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GDBUS_LIBS}" fi if test "${_na_have_dbus_glib}" = "yes"; then cat >>confdefs.h <<_ACEOF #define HAVE_DBUS_GLIB 1 _ACEOF NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${DBUS_GLIB_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${DBUS_GLIB_LIBS}" fi if test "${_na_have_gdbus}" = "yes"; then HAVE_GDBUS_TRUE= HAVE_GDBUS_FALSE='#' else HAVE_GDBUS_TRUE='#' HAVE_GDBUS_FALSE= fi if test "${_na_have_dbus_glib}" = "yes"; then HAVE_DBUS_GLIB_TRUE= HAVE_DBUS_GLIB_FALSE='#' else HAVE_DBUS_GLIB_TRUE='#' HAVE_DBUS_GLIB_FALSE= fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCONF" >&5 $as_echo_n "checking for GCONF... " >&6; } if test -n "$GCONF_CFLAGS"; then pkg_cv_GCONF_CFLAGS="$GCONF_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gconf-2.0 >= 2.8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gconf-2.0 >= 2.8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 >= 2.8.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GCONF_LIBS"; then pkg_cv_GCONF_LIBS="$GCONF_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gconf-2.0 >= 2.8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gconf-2.0 >= 2.8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 >= 2.8.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GCONF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gconf-2.0 >= 2.8.0" 2>&1` else GCONF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gconf-2.0 >= 2.8.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GCONF_PKG_ERRORS" >&5 have_GCONF="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_GCONF="no" else GCONF_CFLAGS=$pkg_cv_GCONF_CFLAGS GCONF_LIBS=$pkg_cv_GCONF_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_GCONF="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "GCONF_CFLAGS='${GCONF_CFLAGS}'" #echo "GCONF_LIBS='${GCONF_LIBS}'" #echo "against Gtk2: $(echo ${GCONF_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${GCONF_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_GCONF}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${GCONF_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GCONF: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: GCONF: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "GCONF: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_GCONF="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${GCONF_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GCONF: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: GCONF: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "GCONF: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_GCONF="no" fi fi else if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GCONF: condition gconf-2.0 >= 2.8.0 not satisfied" >&5 $as_echo "warning: GCONF: condition gconf-2.0 >= 2.8.0 not satisfied" >&6; } else as_fn_error $? "GCONF: condition gconf-2.0 >= 2.8.0 not satisfied" "$LINENO" 5 fi fi if test "${have_GCONF}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GCONF_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GCONF_LIBS}" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIO_UNIX" >&5 $as_echo_n "checking for GIO_UNIX... " >&6; } if test -n "$GIO_UNIX_CFLAGS"; then pkg_cv_GIO_UNIX_CFLAGS="$GIO_UNIX_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-unix-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GIO_UNIX_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GIO_UNIX_LIBS"; then pkg_cv_GIO_UNIX_LIBS="$GIO_UNIX_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-unix-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GIO_UNIX_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GIO_UNIX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-unix-2.0" 2>&1` else GIO_UNIX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-unix-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GIO_UNIX_PKG_ERRORS" >&5 have_GIO_UNIX="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_GIO_UNIX="no" else GIO_UNIX_CFLAGS=$pkg_cv_GIO_UNIX_CFLAGS GIO_UNIX_LIBS=$pkg_cv_GIO_UNIX_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_GIO_UNIX="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "GIO_UNIX_CFLAGS='${GIO_UNIX_CFLAGS}'" #echo "GIO_UNIX_LIBS='${GIO_UNIX_LIBS}'" #echo "against Gtk2: $(echo ${GIO_UNIX_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${GIO_UNIX_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_GIO_UNIX}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${GIO_UNIX_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GIO_UNIX: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: GIO_UNIX: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "GIO_UNIX: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_GIO_UNIX="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${GIO_UNIX_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GIO_UNIX: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: GIO_UNIX: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "GIO_UNIX: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_GIO_UNIX="no" fi fi else if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GIO_UNIX: condition gio-unix-2.0 not satisfied" >&5 $as_echo "warning: GIO_UNIX: condition gio-unix-2.0 not satisfied" >&6; } else as_fn_error $? "GIO_UNIX: condition gio-unix-2.0 not satisfied" "$LINENO" 5 fi fi if test "${have_GIO_UNIX}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GIO_UNIX_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GIO_UNIX_LIBS}" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTOP" >&5 $as_echo_n "checking for GTOP... " >&6; } if test -n "$GTOP_CFLAGS"; then pkg_cv_GTOP_CFLAGS="$GTOP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgtop-2.0 >= 2.23.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "libgtop-2.0 >= 2.23.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTOP_CFLAGS=`$PKG_CONFIG --cflags "libgtop-2.0 >= 2.23.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTOP_LIBS"; then pkg_cv_GTOP_LIBS="$GTOP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgtop-2.0 >= 2.23.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "libgtop-2.0 >= 2.23.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTOP_LIBS=`$PKG_CONFIG --libs "libgtop-2.0 >= 2.23.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTOP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libgtop-2.0 >= 2.23.1" 2>&1` else GTOP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libgtop-2.0 >= 2.23.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTOP_PKG_ERRORS" >&5 have_GTOP="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_GTOP="no" else GTOP_CFLAGS=$pkg_cv_GTOP_CFLAGS GTOP_LIBS=$pkg_cv_GTOP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_GTOP="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "GTOP_CFLAGS='${GTOP_CFLAGS}'" #echo "GTOP_LIBS='${GTOP_LIBS}'" #echo "against Gtk2: $(echo ${GTOP_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${GTOP_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_GTOP}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${GTOP_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GTOP: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: GTOP: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "GTOP: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_GTOP="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${GTOP_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GTOP: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: GTOP: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "GTOP: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_GTOP="no" fi fi else if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: GTOP: condition libgtop-2.0 >= 2.23.1 not satisfied" >&5 $as_echo "warning: GTOP: condition libgtop-2.0 >= 2.23.1 not satisfied" >&6; } else as_fn_error $? "GTOP: condition libgtop-2.0 >= 2.23.1 not satisfied" "$LINENO" 5 fi fi if test "${have_GTOP}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${GTOP_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${GTOP_LIBS}" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML" >&5 $as_echo_n "checking for LIBXML... " >&6; } if test -n "$LIBXML_CFLAGS"; then pkg_cv_LIBXML_CFLAGS="$LIBXML_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBXML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBXML_LIBS"; then pkg_cv_LIBXML_LIBS="$LIBXML_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBXML_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBXML_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0 >= 2.6" 2>&1` else LIBXML_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0 >= 2.6" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBXML_PKG_ERRORS" >&5 have_LIBXML="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_LIBXML="no" else LIBXML_CFLAGS=$pkg_cv_LIBXML_CFLAGS LIBXML_LIBS=$pkg_cv_LIBXML_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_LIBXML="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "LIBXML_CFLAGS='${LIBXML_CFLAGS}'" #echo "LIBXML_LIBS='${LIBXML_LIBS}'" #echo "against Gtk2: $(echo ${LIBXML_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${LIBXML_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_LIBXML}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${LIBXML_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: LIBXML: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: LIBXML: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "LIBXML: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_LIBXML="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${LIBXML_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: LIBXML: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: LIBXML: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "LIBXML: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_LIBXML="no" fi fi else if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: LIBXML: condition libxml-2.0 >= 2.6 not satisfied" >&5 $as_echo "warning: LIBXML: condition libxml-2.0 >= 2.6 not satisfied" >&6; } else as_fn_error $? "LIBXML: condition libxml-2.0 >= 2.6 not satisfied" "$LINENO" 5 fi fi if test "${have_LIBXML}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${LIBXML_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${LIBXML_LIBS}" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SM" >&5 $as_echo_n "checking for SM... " >&6; } if test -n "$SM_CFLAGS"; then pkg_cv_SM_CFLAGS="$SM_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sm >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "sm >= 1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SM_CFLAGS=`$PKG_CONFIG --cflags "sm >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SM_LIBS"; then pkg_cv_SM_LIBS="$SM_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sm >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "sm >= 1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SM_LIBS=`$PKG_CONFIG --libs "sm >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sm >= 1.0" 2>&1` else SM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sm >= 1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SM_PKG_ERRORS" >&5 have_SM="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_SM="no" else SM_CFLAGS=$pkg_cv_SM_CFLAGS SM_LIBS=$pkg_cv_SM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_SM="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "SM_CFLAGS='${SM_CFLAGS}'" #echo "SM_LIBS='${SM_LIBS}'" #echo "against Gtk2: $(echo ${SM_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${SM_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_SM}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${SM_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: SM: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: SM: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "SM: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_SM="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${SM_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: SM: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: SM: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "SM: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_SM="no" fi fi else if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: SM: condition sm >= 1.0 not satisfied" >&5 $as_echo "warning: SM: condition sm >= 1.0 not satisfied" >&6; } else as_fn_error $? "SM: condition sm >= 1.0 not satisfied" "$LINENO" 5 fi fi if test "${have_SM}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${SM_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${SM_LIBS}" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICE" >&5 $as_echo_n "checking for ICE... " >&6; } if test -n "$ICE_CFLAGS"; then pkg_cv_ICE_CFLAGS="$ICE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ice\""; } >&5 ($PKG_CONFIG --exists --print-errors "ice") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ICE_CFLAGS=`$PKG_CONFIG --cflags "ice" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$ICE_LIBS"; then pkg_cv_ICE_LIBS="$ICE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ice\""; } >&5 ($PKG_CONFIG --exists --print-errors "ice") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ICE_LIBS=`$PKG_CONFIG --libs "ice" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then ICE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ice" 2>&1` else ICE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ice" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$ICE_PKG_ERRORS" >&5 have_ICE="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_ICE="no" else ICE_CFLAGS=$pkg_cv_ICE_CFLAGS ICE_LIBS=$pkg_cv_ICE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_ICE="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "ICE_CFLAGS='${ICE_CFLAGS}'" #echo "ICE_LIBS='${ICE_LIBS}'" #echo "against Gtk2: $(echo ${ICE_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${ICE_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_ICE}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${ICE_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: ICE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: ICE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "ICE: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_ICE="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${ICE_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: ICE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: ICE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "ICE: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_ICE="no" fi fi else if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: ICE: condition ice not satisfied" >&5 $as_echo "warning: ICE: condition ice not satisfied" >&6; } else as_fn_error $? "ICE: condition ice not satisfied" "$LINENO" 5 fi fi if test "${have_ICE}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${ICE_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${ICE_LIBS}" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UUID" >&5 $as_echo_n "checking for UUID... " >&6; } if test -n "$UUID_CFLAGS"; then pkg_cv_UUID_CFLAGS="$UUID_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5 ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UUID_CFLAGS=`$PKG_CONFIG --cflags "uuid" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$UUID_LIBS"; then pkg_cv_UUID_LIBS="$UUID_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5 ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UUID_LIBS=`$PKG_CONFIG --libs "uuid" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then UUID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "uuid" 2>&1` else UUID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "uuid" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$UUID_PKG_ERRORS" >&5 have_UUID="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_UUID="no" else UUID_CFLAGS=$pkg_cv_UUID_CFLAGS UUID_LIBS=$pkg_cv_UUID_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_UUID="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "UUID_CFLAGS='${UUID_CFLAGS}'" #echo "UUID_LIBS='${UUID_LIBS}'" #echo "against Gtk2: $(echo ${UUID_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${UUID_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_UUID}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${UUID_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UUID: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: UUID: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "UUID: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_UUID="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${UUID_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UUID: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: UUID: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "UUID: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_UUID="no" fi fi else if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: UUID: condition uuid not satisfied" >&5 $as_echo "warning: UUID: condition uuid not satisfied" >&6; } else as_fn_error $? "UUID: condition uuid not satisfied" "$LINENO" 5 fi fi if test "${have_UUID}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${UUID_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${UUID_LIBS}" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NAUTILUS_EXTENSION" >&5 $as_echo_n "checking for NAUTILUS_EXTENSION... " >&6; } if test -n "$NAUTILUS_EXTENSION_CFLAGS"; then pkg_cv_NAUTILUS_EXTENSION_CFLAGS="$NAUTILUS_EXTENSION_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnautilus-extension >= 2.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnautilus-extension >= 2.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NAUTILUS_EXTENSION_CFLAGS=`$PKG_CONFIG --cflags "libnautilus-extension >= 2.16" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NAUTILUS_EXTENSION_LIBS"; then pkg_cv_NAUTILUS_EXTENSION_LIBS="$NAUTILUS_EXTENSION_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnautilus-extension >= 2.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnautilus-extension >= 2.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NAUTILUS_EXTENSION_LIBS=`$PKG_CONFIG --libs "libnautilus-extension >= 2.16" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NAUTILUS_EXTENSION_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnautilus-extension >= 2.16" 2>&1` else NAUTILUS_EXTENSION_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnautilus-extension >= 2.16" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NAUTILUS_EXTENSION_PKG_ERRORS" >&5 have_NAUTILUS_EXTENSION="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_NAUTILUS_EXTENSION="no" else NAUTILUS_EXTENSION_CFLAGS=$pkg_cv_NAUTILUS_EXTENSION_CFLAGS NAUTILUS_EXTENSION_LIBS=$pkg_cv_NAUTILUS_EXTENSION_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_NAUTILUS_EXTENSION="yes" fi #echo "have_gtk2=$have_gtk2 have_gtk3=$have_gtk3" #echo "NAUTILUS_EXTENSION_CFLAGS='${NAUTILUS_EXTENSION_CFLAGS}'" #echo "NAUTILUS_EXTENSION_LIBS='${NAUTILUS_EXTENSION_LIBS}'" #echo "against Gtk2: $(echo ${NAUTILUS_EXTENSION_LIBS} | grep -E 'gtk-[^-]+-2\.0')" #echo "against Gtk3: $(echo ${NAUTILUS_EXTENSION_LIBS} | grep -E 'gtk-[^-]+-3\.0')" if test "${have_NAUTILUS_EXTENSION}" = "yes"; then if test "${have_gtk3}" = "yes"; then if echo ${NAUTILUS_EXTENSION_LIBS} | grep -qE 'gtk-[^-]+-2\.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: NAUTILUS_EXTENSION: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&5 $as_echo "warning: NAUTILUS_EXTENSION: compiling with Gtk+-3 but adresses Gtk+-2 libraries" >&6; } else as_fn_error $? "NAUTILUS_EXTENSION: compiling with Gtk+-3 but adresses Gtk+-2 libraries" "$LINENO" 5 fi have_NAUTILUS_EXTENSION="no" fi elif test "${have_gtk2}" = "yes"; then if echo ${NAUTILUS_EXTENSION_LIBS} | grep -qE 'gtk-[^-]+-3.0'; then if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: NAUTILUS_EXTENSION: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&5 $as_echo "warning: NAUTILUS_EXTENSION: compiling with Gtk+-2 but adresses Gtk+-3 libraries" >&6; } else as_fn_error $? "NAUTILUS_EXTENSION: compiling with Gtk+-2 but adresses Gtk+-3 libraries" "$LINENO" 5 fi have_NAUTILUS_EXTENSION="no" fi fi else if test "" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: NAUTILUS_EXTENSION: condition libnautilus-extension >= 2.16 not satisfied" >&5 $as_echo "warning: NAUTILUS_EXTENSION: condition libnautilus-extension >= 2.16 not satisfied" >&6; } else as_fn_error $? "NAUTILUS_EXTENSION: condition libnautilus-extension >= 2.16 not satisfied" "$LINENO" 5 fi fi if test "${have_NAUTILUS_EXTENSION}" = "yes"; then NAUTILUS_ACTIONS_CFLAGS="${NAUTILUS_ACTIONS_CFLAGS} ${NAUTILUS_EXTENSION_CFLAGS}" NAUTILUS_ACTIONS_LIBS="${NAUTILUS_ACTIONS_LIBS} ${NAUTILUS_EXTENSION_LIBS}" fi # check for gtk-doc # - starting with gtk-doc 1.16, is able to handle srcdir != builddir # - API documentation should not be built (would be incomplete) when deprecated # symbols are not enabled # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 $as_echo "$GTKDOC_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gtkdoc-rebase do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_REBASE+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_REBASE in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE if test -n "$GTKDOC_REBASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 $as_echo "$GTKDOC_REBASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GTKDOC_REBASE" && break done test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. set dummy gtkdoc-mkpdf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_MKPDF in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF if test -n "$GTKDOC_MKPDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 $as_echo "$GTKDOC_MKPDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else with_html_dir='${datadir}/gtk-doc/html' fi HTML_DIR="$with_html_dir" # Check whether --enable-gtk-doc was given. if test "${enable_gtk_doc+set}" = set; then : enableval=$enable_gtk_doc; else enable_gtk_doc=no fi if test x$enable_gtk_doc = xyes; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : else as_fn_error $? "You need to have gtk-doc >= 1.16 installed to build $PACKAGE_NAME" "$LINENO" 5 fi if test "x$PACKAGE_NAME" != "xglib"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 $as_echo_n "checking for GTKDOC_DEPS... " >&6; } if test -n "$GTKDOC_DEPS_CFLAGS"; then pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTKDOC_DEPS_LIBS"; then pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` else GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 : elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : else GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 $as_echo_n "checking whether to build gtk-doc documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 $as_echo "$enable_gtk_doc" >&6; } # Check whether --enable-gtk-doc-html was given. if test "${enable_gtk_doc_html+set}" = set; then : enableval=$enable_gtk_doc_html; else enable_gtk_doc_html=yes fi # Check whether --enable-gtk-doc-pdf was given. if test "${enable_gtk_doc_pdf+set}" = set; then : enableval=$enable_gtk_doc_pdf; else enable_gtk_doc_pdf=no fi if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc_html = xyes; then GTK_DOC_BUILD_HTML_TRUE= GTK_DOC_BUILD_HTML_FALSE='#' else GTK_DOC_BUILD_HTML_TRUE='#' GTK_DOC_BUILD_HTML_FALSE= fi if test x$enable_gtk_doc_pdf = xyes; then GTK_DOC_BUILD_PDF_TRUE= GTK_DOC_BUILD_PDF_FALSE='#' else GTK_DOC_BUILD_PDF_TRUE='#' GTK_DOC_BUILD_PDF_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi if test -n "$GTKDOC_REBASE"; then GTK_DOC_USE_REBASE_TRUE= GTK_DOC_USE_REBASE_FALSE='#' else GTK_DOC_USE_REBASE_TRUE='#' GTK_DOC_USE_REBASE_FALSE= fi if test "${enable_gtk_doc}" = "yes" -a "${enable_deprecated}" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: API documentation will be incomplete as deprecated symbols are disabled" >&5 $as_echo "$as_me: WARNING: API documentation will be incomplete as deprecated symbols are disabled" >&2;} fi # check for gnome-doc-utils # - starting with N-A 3.1.5, gnome-doc-utils is no more required when one want # compile the tarball distribution (i.e. without regenerating users's manuals) if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi gdu_cv_version_required=0.3.2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking gnome-doc-utils >= $gdu_cv_version_required" >&5 $as_echo_n "checking gnome-doc-utils >= $gdu_cv_version_required... " >&6; } if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnome-doc-utils >= \$gdu_cv_version_required\""; } >&5 ($PKG_CONFIG --exists --print-errors "gnome-doc-utils >= $gdu_cv_version_required") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then gdu_cv_have_gdu=yes else gdu_cv_have_gdu=no fi if test "$gdu_cv_have_gdu" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } gdu_cv_have_gdu=no fi # Check whether --with-help-dir was given. if test "${with_help_dir+set}" = set; then : withval=$with_help_dir; else with_help_dir='${datadir}/gnome/help' fi HELP_DIR="$with_help_dir" # Check whether --with-omf-dir was given. if test "${with_omf_dir+set}" = set; then : withval=$with_omf_dir; else with_omf_dir='${datadir}/omf' fi OMF_DIR="$with_omf_dir" # Check whether --with-help-formats was given. if test "${with_help_formats+set}" = set; then : withval=$with_help_formats; else with_help_formats='' fi DOC_USER_FORMATS="$with_help_formats" # Check whether --enable-scrollkeeper was given. if test "${enable_scrollkeeper+set}" = set; then : enableval=$enable_scrollkeeper; else enable_scrollkeeper=yes fi if test "$gdu_cv_have_gdu" = "yes" -a "$enable_scrollkeeper" = "yes"; then ENABLE_SK_TRUE= ENABLE_SK_FALSE='#' else ENABLE_SK_TRUE='#' ENABLE_SK_FALSE= fi DISTCHECK_CONFIGURE_FLAGS="--disable-scrollkeeper $DISTCHECK_CONFIGURE_FLAGS" if test "$gdu_cv_have_gdu" = "yes"; then HAVE_GNOME_DOC_UTILS_TRUE= HAVE_GNOME_DOC_UTILS_FALSE='#' else HAVE_GNOME_DOC_UTILS_TRUE='#' HAVE_GNOME_DOC_UTILS_FALSE= fi # defines log domains when in maintainer mode NA_LOGDOMAIN_IO_DESKTOP=NA-io-desktop cat >>confdefs.h <<_ACEOF #define NA_LOGDOMAIN_IO_DESKTOP "NA-io-desktop" _ACEOF NA_LOGDOMAIN_IO_GCONF=NA-io-gconf cat >>confdefs.h <<_ACEOF #define NA_LOGDOMAIN_IO_GCONF "NA-io-gconf" _ACEOF NA_LOGDOMAIN_IO_XML=NA-io-xml cat >>confdefs.h <<_ACEOF #define NA_LOGDOMAIN_IO_XML "NA-io-xml" _ACEOF NA_LOGDOMAIN_CORE=NA-core cat >>confdefs.h <<_ACEOF #define NA_LOGDOMAIN_CORE "NA-core" _ACEOF NA_LOGDOMAIN_NACT=NA-nact cat >>confdefs.h <<_ACEOF #define NA_LOGDOMAIN_NACT "NA-nact" _ACEOF NA_LOGDOMAIN_PLUGIN_MENU=NA-plugin-menu cat >>confdefs.h <<_ACEOF #define NA_LOGDOMAIN_PLUGIN_MENU "NA-plugin-menu" _ACEOF NA_LOGDOMAIN_PLUGIN_TRACKER=NA-plugin-tracker cat >>confdefs.h <<_ACEOF #define NA_LOGDOMAIN_PLUGIN_TRACKER "NA-plugin-tracker" _ACEOF NA_LOGDOMAIN_TEST=NA-test cat >>confdefs.h <<_ACEOF #define NA_LOGDOMAIN_TEST "NA-test" _ACEOF NA_LOGDOMAIN_UTILS=NA-utils cat >>confdefs.h <<_ACEOF #define NA_LOGDOMAIN_UTILS "NA-utils" _ACEOF # add --enable-html-manuals and --enable-pdf-manuals configure options # Check whether --enable-html-manuals was given. if test "${enable_html_manuals+set}" = set; then : enableval=$enable_html_manuals; enable_html_manuals=$enableval else enable_html_manuals="no" fi # Check whether --enable-pdf-manuals was given. if test "${enable_pdf_manuals+set}" = set; then : enableval=$enable_pdf_manuals; enable_pdf_manuals=$enableval else enable_pdf_manuals="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build HTML manuals" >&5 $as_echo_n "checking whether to build HTML manuals... " >&6; } msg_html_manuals="disabled" if test "x${enable_html_manuals}" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } if test "x${enable_html_manuals}" = "xyes"; then # Extract the first word of "gnome-doc-tool", so it can be a program name with args. set dummy gnome-doc-tool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_with_gdt+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$with_gdt"; then ac_cv_prog_with_gdt="$with_gdt" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_with_gdt="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_with_gdt" && ac_cv_prog_with_gdt="no" fi fi with_gdt=$ac_cv_prog_with_gdt if test -n "$with_gdt"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gdt" >&5 $as_echo "$with_gdt" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x${with_gdt}" = "xno"; then # Extract the first word of "db2html", so it can be a program name with args. set dummy db2html; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_with_db2html+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$with_db2html"; then ac_cv_prog_with_db2html="$with_db2html" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_with_db2html="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_with_db2html" && ac_cv_prog_with_db2html="no" fi fi with_db2html=$ac_cv_prog_with_db2html if test -n "$with_db2html"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_db2html" >&5 $as_echo "$with_db2html" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi elif test "x${enable_html_manuals}" = "xgdt"; then # Extract the first word of "gnome-doc-tool", so it can be a program name with args. set dummy gnome-doc-tool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_with_gdt+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$with_gdt"; then ac_cv_prog_with_gdt="$with_gdt" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_with_gdt="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_with_gdt" && ac_cv_prog_with_gdt="no" fi fi with_gdt=$ac_cv_prog_with_gdt if test -n "$with_gdt"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gdt" >&5 $as_echo "$with_gdt" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi with_db2html="no" elif test "x${enable_html_manuals}" = "xdb2html"; then # Extract the first word of "db2html", so it can be a program name with args. set dummy db2html; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_with_db2html+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$with_db2html"; then ac_cv_prog_with_db2html="$with_db2html" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_with_db2html="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_with_db2html" && ac_cv_prog_with_db2html="no" fi fi with_db2html=$ac_cv_prog_with_db2html if test -n "$with_db2html"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_db2html" >&5 $as_echo "$with_db2html" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi with_gdt="no" else as_fn_error $? "${enable_html_manuals} is not a known tool, must be 'gdt' or 'db2html'" "$LINENO" 5 fi if test "x${with_gdt}" = "xno" -a "x${with_db2html}" = "xno"; then as_fn_error $? "neither gnome-doc-tool not db2html have been found, unable to generate HTML manuals" "$LINENO" 5 fi msg_html_manuals="enabled with" if test "x${with_gdt}" = "xno"; then msg_html_manuals="${msg_html_manuals} db2html" else msg_html_manuals="${msg_html_manuals} gnome-doc-tool" fi fi WITH_DB2HTML=${with_db2html} WITH_GDT=${with_gdt} if test "x${enable_html_manuals}" != "xno"; then ENABLE_HTML_MANUALS_TRUE= ENABLE_HTML_MANUALS_FALSE='#' else ENABLE_HTML_MANUALS_TRUE='#' ENABLE_HTML_MANUALS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build PDF manuals" >&5 $as_echo_n "checking whether to build PDF manuals... " >&6; } msg_pdf_manuals="disabled" if test "x${enable_pdf_manuals}" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } if test "x${enable_pdf_manuals}" = "xyes"; then # Extract the first word of "dblatex", so it can be a program name with args. set dummy dblatex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_with_dblatex+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$with_dblatex"; then ac_cv_prog_with_dblatex="$with_dblatex" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_with_dblatex="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_with_dblatex" && ac_cv_prog_with_dblatex="no" fi fi with_dblatex=$ac_cv_prog_with_dblatex if test -n "$with_dblatex"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dblatex" >&5 $as_echo "$with_dblatex" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi msg_pdf_manuals="enabled with dblatex" elif test "x${enable_pdf_manuals}" = "xdblatex"; then # Extract the first word of "dblatex", so it can be a program name with args. set dummy dblatex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_with_dblatex+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$with_dblatex"; then ac_cv_prog_with_dblatex="$with_dblatex" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_with_dblatex="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_with_dblatex" && ac_cv_prog_with_dblatex="no" fi fi with_dblatex=$ac_cv_prog_with_dblatex if test -n "$with_dblatex"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dblatex" >&5 $as_echo "$with_dblatex" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi msg_pdf_manuals="enabled with dblatex" else as_fn_error $? "${enable_pdf_manuals} is not a known tool, must be 'dblatex'" "$LINENO" 5 fi if test "x${with_dblatex}" = "xno"; then as_fn_error $? "dblatex has not been found, unable to generate PDF manuals" "$LINENO" 5 fi fi if test "x${enable_pdf_manuals}" != "xno"; then ENABLE_PDF_MANUALS_TRUE= ENABLE_PDF_MANUALS_FALSE='#' else ENABLE_PDF_MANUALS_TRUE='#' ENABLE_PDF_MANUALS_FALSE= fi if test "x${enable_html_manuals}" != "xno" || test "x${enable_pdf_manuals}" != "xno"; then ENABLE_MANUALS_TRUE= ENABLE_MANUALS_FALSE='#' else ENABLE_MANUALS_TRUE='#' ENABLE_MANUALS_FALSE= fi # add --with-default-io-provider option # Check whether --with-default-io-provider was given. if test "${with_default_io_provider+set}" = set; then : withval=$with_default_io_provider; with_default_io_provider=$withval else with_default_io_provider="na-desktop" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default I/O provider on new items" >&5 $as_echo_n "checking for default I/O provider on new items... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_default_io_provider}" >&5 $as_echo "${with_default_io_provider}" >&6; } if test "x${with_default_io_provider}" != "xna-gconf"; then if test "x${with_default_io_provider}" != "xna-desktop"; then as_fn_error $? "a default I/O provider must be specified, must be 'na-gconf' or 'na-desktop'" "$LINENO" 5 fi fi cat >>confdefs.h <<_ACEOF #define NA_DEFAULT_IO_PROVIDER "${with_default_io_provider}" _ACEOF # when working in a test environment, nautilus extensions are typically # installed in a non-standard location ; lets specify this location here # Check whether --with-nautilus-extdir was given. if test "${with_nautilus_extdir+set}" = set; then : withval=$with_nautilus_extdir; with_nautilus_extdir=$withval else with_nautilus_extdir="" fi if test "${with_nautilus_extdir}" = ""; then if test "{PKG_CONFIG}" != ""; then with_nautilus_extdir=`${PKG_CONFIG} --variable=extensiondir libnautilus-extension` fi fi if test "${with_nautilus_extdir}" = ""; then as_fn_error $? "Unable to determine nautilus extension folder, please use --with-nautilus-extdir option" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: installing plugin in ${with_nautilus_extdir}" >&5 $as_echo "$as_me: installing plugin in ${with_nautilus_extdir}" >&6;} NAUTILUS_EXTENSIONS_DIR=${with_nautilus_extdir} cat >>confdefs.h <<_ACEOF #define NA_NAUTILUS_EXTENSIONS_DIR ${with_nautilus_extdir} _ACEOF fi # define NA_MAINTAINER_MODE variable msg_maintainer_mode="disabled" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether enabling maintainer mode" >&5 $as_echo_n "checking whether enabling maintainer mode... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${USE_MAINTAINER_MODE}" >&5 $as_echo "${USE_MAINTAINER_MODE}" >&6; } if test "${USE_MAINTAINER_MODE}" = "yes"; then $as_echo "#define NA_MAINTAINER_MODE 1" >>confdefs.h AM_CPPFLAGS="${AM_CPPFLAGS} ${DISABLE_DEPRECATED} -DGSEAL_ENABLED" AM_CFLAGS="${AM_CFLAGS} -Werror" msg_maintainer_mode="enabled" fi if test "${USE_MAINTAINER_MODE}" = "yes"; then NA_MAINTAINER_MODE_TRUE= NA_MAINTAINER_MODE_FALSE='#' else NA_MAINTAINER_MODE_TRUE='#' NA_MAINTAINER_MODE_FALSE= fi $as_echo "#define NAUTILUS_ACTIONS_DEBUG \"NAUTILUS_ACTIONS_DEBUG\"" >>confdefs.h # Check for menu update function { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nautilus_menu_item_new in -lnautilus-extension" >&5 $as_echo_n "checking for nautilus_menu_item_new in -lnautilus-extension... " >&6; } if ${ac_cv_lib_nautilus_extension_nautilus_menu_item_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnautilus-extension $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char nautilus_menu_item_new (); int main () { return nautilus_menu_item_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nautilus_extension_nautilus_menu_item_new=yes else ac_cv_lib_nautilus_extension_nautilus_menu_item_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nautilus_extension_nautilus_menu_item_new" >&5 $as_echo "$ac_cv_lib_nautilus_extension_nautilus_menu_item_new" >&6; } if test "x$ac_cv_lib_nautilus_extension_nautilus_menu_item_new" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNAUTILUS_EXTENSION 1 _ACEOF LIBS="-lnautilus-extension $LIBS" fi for ac_func in nautilus_menu_provider_emit_items_updated_signal do : ac_fn_c_check_func "$LINENO" "nautilus_menu_provider_emit_items_updated_signal" "ac_cv_func_nautilus_menu_provider_emit_items_updated_signal" if test "x$ac_cv_func_nautilus_menu_provider_emit_items_updated_signal" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NAUTILUS_MENU_PROVIDER_EMIT_ITEMS_UPDATED_SIGNAL 1 _ACEOF fi done # starting with 2.91.90, Nautilus no more allows extensions to add toolbar items for ac_func in nautilus_menu_provider_get_toolbar_items do : ac_fn_c_check_func "$LINENO" "nautilus_menu_provider_get_toolbar_items" "ac_cv_func_nautilus_menu_provider_get_toolbar_items" if test "x$ac_cv_func_nautilus_menu_provider_get_toolbar_items" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NAUTILUS_MENU_PROVIDER_GET_TOOLBAR_ITEMS 1 _ACEOF fi done # display and keep configuration informations config_options="`$as_echo "$ac_configure_args" | sed 's/^ //; s/\\""\`\$/\\\\&/g'`" cat >>confdefs.h <<_ACEOF #define NA_CONFIG_OPTIONS "$0 ${config_options}" _ACEOF cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi ac_config_commands="$ac_config_commands po/stamp-it" if test -z "${ENABLE_DEPRECATED_TRUE}" && test -z "${ENABLE_DEPRECATED_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DEPRECATED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GCONF_SCHEMAS_INSTALL_TRUE}" && test -z "${GCONF_SCHEMAS_INSTALL_FALSE}"; then as_fn_error $? "conditional \"GCONF_SCHEMAS_INSTALL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GCONF_TRUE}" && test -z "${HAVE_GCONF_FALSE}"; then as_fn_error $? "conditional \"HAVE_GCONF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GDBUS_TRUE}" && test -z "${HAVE_GDBUS_FALSE}"; then as_fn_error $? "conditional \"HAVE_GDBUS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_DBUS_GLIB_TRUE}" && test -z "${HAVE_DBUS_GLIB_FALSE}"; then as_fn_error $? "conditional \"HAVE_DBUS_GLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_SK_TRUE}" && test -z "${ENABLE_SK_FALSE}"; then as_fn_error $? "conditional \"ENABLE_SK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GNOME_DOC_UTILS_TRUE}" && test -z "${HAVE_GNOME_DOC_UTILS_FALSE}"; then as_fn_error $? "conditional \"HAVE_GNOME_DOC_UTILS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_HTML_MANUALS_TRUE}" && test -z "${ENABLE_HTML_MANUALS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_HTML_MANUALS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PDF_MANUALS_TRUE}" && test -z "${ENABLE_PDF_MANUALS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PDF_MANUALS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_MANUALS_TRUE}" && test -z "${ENABLE_MANUALS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_MANUALS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NA_MAINTAINER_MODE_TRUE}" && test -z "${NA_MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"NA_MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Nautilus-Actions $as_me 3.2.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . Nautilus-Actions home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ Nautilus-Actions config.status 3.2.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "data/actions/Makefile") CONFIG_FILES="$CONFIG_FILES data/actions/Makefile" ;; "data/exports/Makefile") CONFIG_FILES="$CONFIG_FILES data/exports/Makefile" ;; "data/gconf-schemas/Makefile") CONFIG_FILES="$CONFIG_FILES data/gconf-schemas/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/nact/Makefile") CONFIG_FILES="$CONFIG_FILES docs/nact/Makefile" ;; "docs/reference/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/Makefile" ;; "docs/reference/version.xml") CONFIG_FILES="$CONFIG_FILES docs/reference/version.xml" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "icons/Makefile") CONFIG_FILES="$CONFIG_FILES icons/Makefile" ;; "icons/16x16/Makefile") CONFIG_FILES="$CONFIG_FILES icons/16x16/Makefile" ;; "icons/22x22/Makefile") CONFIG_FILES="$CONFIG_FILES icons/22x22/Makefile" ;; "icons/32x32/Makefile") CONFIG_FILES="$CONFIG_FILES icons/32x32/Makefile" ;; "icons/48x48/Makefile") CONFIG_FILES="$CONFIG_FILES icons/48x48/Makefile" ;; "icons/scalable/Makefile") CONFIG_FILES="$CONFIG_FILES icons/scalable/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/api/Makefile") CONFIG_FILES="$CONFIG_FILES src/api/Makefile" ;; "src/core/Makefile") CONFIG_FILES="$CONFIG_FILES src/core/Makefile" ;; "src/io-desktop/Makefile") CONFIG_FILES="$CONFIG_FILES src/io-desktop/Makefile" ;; "src/io-gconf/Makefile") CONFIG_FILES="$CONFIG_FILES src/io-gconf/Makefile" ;; "src/io-xml/Makefile") CONFIG_FILES="$CONFIG_FILES src/io-xml/Makefile" ;; "src/plugin-menu/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugin-menu/Makefile" ;; "src/plugin-tracker/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugin-tracker/Makefile" ;; "src/nact/Makefile") CONFIG_FILES="$CONFIG_FILES src/nact/Makefile" ;; "src/test/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/Makefile" ;; "src/utils/Makefile") CONFIG_FILES="$CONFIG_FILES src/utils/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Whether or not to build static libraries. build_old_libs=$enable_static # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac ;; "po/stamp-it":C) if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 fi rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" >"po/stamp-it.tmp" sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r po/POTFILES } ' "po/Makefile.in" >"po/Makefile" rm -f "po/Makefile.tmp" mv "po/stamp-it.tmp" "po/stamp-it" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi msg_gtk_doc=`if test "x${enable_gtk_doc}" = "xno"; then echo "disabled"; else echo "enabled"; fi` msg_gtk_version="" if test "${have_gtk3}" = "yes"; then msg_gtk_version="Gtk+ 3.0"; elif test "${have_gtk2}" = "yes"; then msg_gtk_version="Gtk+ 2.0"; fi $as_echo " ${PACKAGE_STRING} configuration summary: Installation prefix ${prefix} Build system type ${ac_cv_build} Nautilus extensions directory ${with_nautilus_extdir} Gtk+ version ${msg_gtk_version} Default I/O provider ${with_default_io_provider} Enable deprecated functions ${enable_deprecated} GConf enabled ${enable_gconf} GConf schemas installation ${msg_schemas_install} Maintainer mode ${msg_maintainer_mode} API Reference generation ${msg_gtk_doc} HTML User's Manuals generation ${msg_html_manuals} PDF User's Manuals generation ${msg_pdf_manuals} " # Preprocessor flags ${AM_CPPFLAGS} # Compiler flags ${AM_CFLAGS} ${NAUTILUS_ACTIONS_CFLAGS} # Linker flags ${NAUTILUS_ACTIONS_LIBS} nautilus-actions-3.2.3/AUTHORS0000644000175100017500000000533111367255250013023 00000000000000Frederic Ruaudel Rodrigo Moya Pierre Wieser based on nautilus-sendto module from Roberto Majadas == Contributors == Bruce van der Kooij : - Patch to initialize GnomeVFS stuff waiting for migration to GVFS Tom Parker : - Patch to add actions in the background popup menu of Nautilus's windows. - Patch to add missing library test in configure. - Patch to remove numerous compilation warnings. Ed Catmur : - NACT .desktop file and Makefile patch for packaging on gentoo Kasys : - Makefile patch to build on 64bits arch Fryderyk Dziarmagowski : - Fix compilation problem when using --as-needed passed to LDFLAGS (Bug #378890). Christopher Taylor : - Fix compilation error (Bug #413834) Brian Pepple : - Fix problem with icon update during uninstall process == Artwork == Ulisse Perusin : - Create the Tango style nautilus-actions icons == Translators == Adam Weinberger Alexander Shopov Amanpreet Singh Alam Amanpreet Singh Brar Ankit Patel Benoît Dejean Chao-Hsiung Liao Christian Rose Clytie Siddall Daniel Nylander David Lodge Djihed Afifi Francisco Javier F. Serrador Frank Arnold Frederic Ruaudel Funda Wang Hendrik Brandt Hendrik Richter Ignacio Casal Quinteiro Ilkka Tuohela Josep Puigdemont i Casamajó Jovan Naumovski Kjartan Maraas Lasse Bang Mikkelsen Leonid Kanter Licio Fernando Lukas Novotny Mario Izquierdo Og Maciel Pedro Vaz de Mello de Medeiros Pema Geyleg Raivis Dejus Raphael Higino Runa Bhattacharjee Satoru SATOH Takeshi AIHANA Theppitak Karoonboonyanan Tino Meinen Valek Filippov Vincent van Adrighem Yair Hershkovitz Yangka Žygimantas Beručka nautilus-actions-3.2.3/ChangeLog0000644000175100017500000000611512220365103013512 000000000000002013-09-24 Pierre Wieser * NEWS: Updating NEWS before releasing. * docs/nact/Makefile.am: Fix the DOC_FIGURES variable, prefixing all images with 'figures/' directory name. 2013-09-14 Pierre Wieser * src/core/na-settings.h: Fix configuration filename in the class description. * src/core/na-gtk-utils.c (na_gtk_utils_restore_window_position): Provides a default size and position for main window. 2013-09-13 Pierre Wieser * docs/nact/Makefile.am: Fix the DOC_LINGUAS variable. 2013-09-11 Pierre Wieser * src/core/na-gtk-utils.c (na_gtk_utils_restore_window_position): Bad hack to try immediately target ideal size and position the first time we open the main window. Only allow the 'About Nautilus-Actions...' item inside of the Nautilus-Actions root menu. * src/nact/nact-preferences-editor.c (about_item_set_sensitive): New function. * src/plugin-menu/nautilus-actions.c (build_nautilus_menu): Only insert the 'About...' item inside of the root Nautilus-Actions menu. * src/plugin-menu/nautilus-actions.c (build_nautilus_menu_rec): Improve debug message. * src/plugin-menu/nautilus-actions.c (build_nautilus_menu): Do not try to create a root Nautilus-Actions menu if it will be empty. * src/core/na-io-provider.c (na_io_provider_get_io_providers_list): - Fix so that the first listed I/O provider has most probability to be writable. - Do not reread preferences for write order. 2013-09-10 Pierre Wieser * src/nact/nact-main-toolbar.c: * src/nact/nautilus-actions-config-tool.ui: Reintroduce fixed toolbars starting with Gtk 3.4. * src/plugin-menu/nautilus-actions.c (build_nautilus_menu_rec): Iterates through subitems of the source menu as they have not been duplucated yet (reported by Christopher Compagnon). 2013-09-07 Pierre Wieser * src/nact/nact-main-toolbar.c (nact_main_toolbar_activate): Obsoletes GtkHandleBox starting with Gtk 3.4 - No replacement. * src/nact/base-gtk-utils.c (base_gtk_utils_table_to_grid): Obsoletes GtkTable starting with Gtk 3.4. * src/nact/egg-sm-client-xsmp.c: Obsoletes gdk_threads_enter(), gdk_threads_leave() starting with gdk 3.6. * src/nact/base-gtk-utils.c: Remove useless blank lines. * src/nact/base-application.c (g_type_init): * src/test/test-iface.c (g_type_init): * src/test/test-iface2.c (g_type_init): * src/test/test-module.c (g_type_init): * src/test/test-parse-uris.c (g_type_init): * src/test/test-reader.c (g_type_init): * src/test/test-virtuals-without-test.c (g_type_init): * src/test/test-virtuals.c (g_type_init): * src/utils/na-delete-xmltree.c (g_type_init): * src/utils/na-print-schemas.c (g_type_init): * src/utils/na-set-conf.c (g_type_init): * src/utils/nautilus-actions-new.c (g_type_init): * src/utils/nautilus-actions-print.c (g_type_init): * src/utils/nautilus-actions-run.c (g_type_init): Obsoletes g_type_init() starting with glib 2.36. 2013-02-22 Pierre Wieser * Allmost all files: Bump copyright year. * ChangeLog-2012: New file. nautilus-actions-3.2.3/install-sh0000755000175100017500000003325612111632025013751 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: nautilus-actions-3.2.3/src/0000755000175100017500000000000012220365533012613 500000000000000nautilus-actions-3.2.3/src/io-desktop/0000755000175100017500000000000012220365532014670 500000000000000nautilus-actions-3.2.3/src/io-desktop/nadp-xdg-dirs.h0000644000175100017500000000263612212601376017431 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NADP_XDG_DIRS_H__ #define __NADP_XDG_DIRS_H__ #include G_BEGIN_DECLS GSList *nadp_xdg_dirs_get_data_dirs ( void ); gchar *nadp_xdg_dirs_get_user_data_dir ( void ); GSList *nadp_xdg_dirs_get_system_data_dirs( void ); G_END_DECLS #endif /* __NADP_XDG_DIRS_H__ */ nautilus-actions-3.2.3/src/io-desktop/nadp-keys.h0000644000175100017500000000502312212601376016654 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NADP_KEYS_H__ #define __NADP_KEYS_H__ #include G_BEGIN_DECLS #define NADP_GROUP_DESKTOP G_KEY_FILE_DESKTOP_GROUP #define NADP_GROUP_PROFILE "X-Action-Profile" #define NADP_KEY_TYPE G_KEY_FILE_DESKTOP_KEY_TYPE #define NADP_VALUE_TYPE_ACTION "Action" #define NADP_VALUE_TYPE_MENU "Menu" #define NADP_KEY_PROFILES "Profiles" #define NADP_KEY_EXECUTION_MODE "ExecutionMode" #define NADP_VALUE_EXECUTION_MODE_NORMAL "Normal" #define NADP_VALUE_EXECUTION_MODE_MINIMIZED "Minimized" #define NADP_VALUE_EXECUTION_MODE_MAXIMIZED "Maximized" #define NADP_VALUE_EXECUTION_MODE_TERMINAL "Terminal" #define NADP_VALUE_EXECUTION_MODE_EMBEDDED "Embedded" #define NADP_VALUE_EXECUTION_MODE_DISPLAY_OUTPUT "DisplayOutput" #define NADP_KEY_ITEMS_LIST "ItemsList" #define NADP_KEY_ONLY_SHOW_IN G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN #define NADP_KEY_NOT_SHOW_IN G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN #define NADP_KEY_NO_DISPLAY "NoDisplay" #define NADP_KEY_HIDDEN G_KEY_FILE_DESKTOP_KEY_HIDDEN #define NADP_KEY_CAPABILITIES "Capabilities" #define NADP_VALUE_CAPABILITY_OWNER "Owner" #define NADP_VALUE_CAPABILITY_READABLE "Readable" #define NADP_VALUE_CAPABILITY_WRITABLE "Writable" #define NADP_VALUE_CAPABILITY_EXECUTABLE "Executable" #define NADP_VALUE_CAPABILITY_LOCAL "Local" G_END_DECLS #endif /* __NADP_KEYS_H__ */ nautilus-actions-3.2.3/src/io-desktop/nadp-formats.c0000644000175100017500000001161112212601376017347 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "nadp-formats.h" typedef struct { gchar *format; gchar *label; gchar *description; gchar *image; } NadpExportFormat; static NadpExportFormat nadp_formats[] = { /* DESKTOP_V1: the initial desktop format as described in * http://www.nautilus-actions.org/?q=node/377 */ { NADP_FORMAT_DESKTOP_V1, N_( "Export as a ._desktop file" ), N_( "This format has been introduced with v 3.0 serie, " \ "and should be your newly preferred format when exporting items.\n" \ "It let you easily share your actions with the whole world, " \ "including with users of other desktop environments, " \ "as long as their own application implements the DES-EMA specification " \ "which describes this format.\n" \ "The exported .desktop file may later be imported via :\n" \ "- Import assistant of the Nautilus-Actions Configuration Tool,\n" \ "- drag-n-drop into the Nautilus-Actions Configuration Tool,\n" \ "- or by copying it into a XDG_DATA_DIRS/file-manager/actions directory." ), "export-desktop.png" }, { NULL } }; #if 0 static void on_pixbuf_finalized( const NAIExporter* exporter, GObject *pixbuf ); #endif /** * nadp_formats_get_formats: * @exporter: this #NAIExporter provider. * * Returns: a #GList of the #NAIExporterFormatv2 supported export formats. * * This list should be nadp_formats_free_formats() by the caller. * * Since: 3.2 */ GList * nadp_formats_get_formats( const NAIExporter* exporter ) { #if 0 static const gchar *thisfn = "nadp_formats_get_formats"; #endif GList *str_list; NAIExporterFormatv2 *str; guint i; gint width, height; gchar *fname; str_list = NULL; if( !gtk_icon_size_lookup( GTK_ICON_SIZE_DIALOG, &width, &height )){ width = height = 48; } for( i = 0 ; nadp_formats[i].format ; ++i ){ str = g_new0( NAIExporterFormatv2, 1 ); str->version = 2; str->provider = NA_IEXPORTER( exporter ); str->format = g_strdup( nadp_formats[i].format ); str->label = g_strdup( gettext( nadp_formats[i].label )); str->description = g_strdup( gettext( nadp_formats[i].description )); if( nadp_formats[i].image ){ fname = g_strdup_printf( "%s/%s", PROVIDER_DATADIR, nadp_formats[i].image ); str->pixbuf = gdk_pixbuf_new_from_file_at_size( fname, width, height, NULL ); g_free( fname ); #if 0 /* do not set weak reference on a graphical object provided by a plugin * if the windows does not have its own builder, it may happens that the * graphical object be finalized when destroying toplevels at common * builder finalization time, and so after the plugins have been shutdown */ if( str->pixbuf ){ g_debug( "%s: allocating pixbuf at %p", thisfn, str->pixbuf ); g_object_weak_ref( G_OBJECT( str->pixbuf ), ( GWeakNotify ) on_pixbuf_finalized, ( gpointer ) exporter ); } #endif } str_list = g_list_prepend( str_list, str ); } return( str_list ); } #if 0 static void on_pixbuf_finalized( const NAIExporter* exporter, GObject *pixbuf ) { g_debug( "nadp_formats_on_pixbuf_finalized: exporter=%p, pixbuf=%p", ( void * ) exporter, ( void * ) pixbuf ); } #endif /** * nadp_formats_free_formats: * @formats: a #GList to be freed. * * Returns: a #GList of the #NAIExporterFormatv2 supported export formats. * * This list should be nadp_format_free_formats() by the caller. * * Since: 3.2 */ void nadp_formats_free_formats( GList *formats ) { GList *is; NAIExporterFormatv2 *str; for( is = formats ; is ; is = is->next ){ str = ( NAIExporterFormatv2 * ) is->data; g_free( str->format ); g_free( str->label ); g_free( str->description ); if( str->pixbuf ){ g_object_unref( str->pixbuf ); } g_free( str ); } g_list_free( formats ); } nautilus-actions-3.2.3/src/io-desktop/nadp-desktop-provider.c0000644000175100017500000002723212212601376021203 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "nadp-desktop-provider.h" #include "nadp-formats.h" #include "nadp-keys.h" #include "nadp-monitor.h" #include "nadp-reader.h" #include "nadp-writer.h" /* private class data */ struct _NadpDesktopProviderClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; static GType st_module_type = 0; static GObjectClass *st_parent_class = NULL; static guint st_burst_timeout = 100; /* burst timeout in msec */ static void class_init( NadpDesktopProviderClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void iio_provider_iface_init( NAIIOProviderInterface *iface ); static gchar *iio_provider_get_id( const NAIIOProvider *provider ); static gchar *iio_provider_get_name( const NAIIOProvider *provider ); static guint iio_provider_get_version( const NAIIOProvider *provider ); static void ifactory_provider_iface_init( NAIFactoryProviderInterface *iface ); static guint ifactory_provider_get_version( const NAIFactoryProvider *reader ); static void iimporter_iface_init( NAIImporterInterface *iface ); static guint iimporter_get_version( const NAIImporter *importer ); static void iexporter_iface_init( NAIExporterInterface *iface ); static guint iexporter_get_version( const NAIExporter *exporter ); static gchar *iexporter_get_name( const NAIExporter *exporter ); static void *iexporter_get_formats( const NAIExporter *exporter ); static void iexporter_free_formats( const NAIExporter *exporter, GList *format_list ); static void on_monitor_timeout( NadpDesktopProvider *provider ); GType nadp_desktop_provider_get_type( void ) { return( st_module_type ); } void nadp_desktop_provider_register_type( GTypeModule *module ) { static const gchar *thisfn = "nadp_desktop_provider_register_type"; static GTypeInfo info = { sizeof( NadpDesktopProviderClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NadpDesktopProvider ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo iio_provider_iface_info = { ( GInterfaceInitFunc ) iio_provider_iface_init, NULL, NULL }; static const GInterfaceInfo ifactory_provider_iface_info = { ( GInterfaceInitFunc ) ifactory_provider_iface_init, NULL, NULL }; static const GInterfaceInfo iimporter_iface_info = { ( GInterfaceInitFunc ) iimporter_iface_init, NULL, NULL }; static const GInterfaceInfo iexporter_iface_info = { ( GInterfaceInitFunc ) iexporter_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); st_module_type = g_type_module_register_type( module, G_TYPE_OBJECT, "NadpDesktopProvider", &info, 0 ); g_type_module_add_interface( module, st_module_type, NA_TYPE_IIO_PROVIDER, &iio_provider_iface_info ); g_type_module_add_interface( module, st_module_type, NA_TYPE_IFACTORY_PROVIDER, &ifactory_provider_iface_info ); g_type_module_add_interface( module, st_module_type, NA_TYPE_IIMPORTER, &iimporter_iface_info ); g_type_module_add_interface( module, st_module_type, NA_TYPE_IEXPORTER, &iexporter_iface_info ); } static void class_init( NadpDesktopProviderClass *klass ) { static const gchar *thisfn = "nadp_desktop_provider_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NadpDesktopProviderClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "nadp_desktop_provider_instance_init"; NadpDesktopProvider *self; g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NADP_DESKTOP_PROVIDER( instance ); self->private = g_new0( NadpDesktopProviderPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->monitors = NULL; self->private->timeout.timeout = st_burst_timeout; self->private->timeout.handler = ( NATimeoutFunc ) on_monitor_timeout; self->private->timeout.user_data = self; self->private->timeout.source_id = 0; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "nadp_desktop_provider_instance_dispose"; NadpDesktopProvider *self; g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( object )); self = NADP_DESKTOP_PROVIDER( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; nadp_desktop_provider_release_monitors( self ); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "nadp_desktop_provider_instance_finalize"; NadpDesktopProvider *self; g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NADP_DESKTOP_PROVIDER( object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static void iio_provider_iface_init( NAIIOProviderInterface *iface ) { static const gchar *thisfn = "nadp_desktop_provider_iio_provider_iface_init"; g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); iface->get_version = iio_provider_get_version; iface->get_id = iio_provider_get_id; iface->get_name = iio_provider_get_name; iface->read_items = nadp_iio_provider_read_items; iface->is_willing_to_write = nadp_iio_provider_is_willing_to_write; iface->is_able_to_write = nadp_iio_provider_is_able_to_write; iface->write_item = nadp_iio_provider_write_item; iface->delete_item = nadp_iio_provider_delete_item; iface->duplicate_data = nadp_iio_provider_duplicate_data; } static guint iio_provider_get_version( const NAIIOProvider *provider ) { return( 1 ); } static gchar * iio_provider_get_id( const NAIIOProvider *provider ) { return( g_strdup( PROVIDER_ID )); } static gchar * iio_provider_get_name( const NAIIOProvider *provider ) { return( g_strdup( _( "Nautilus-Actions Desktop I/O Provider" ))); } static void ifactory_provider_iface_init( NAIFactoryProviderInterface *iface ) { static const gchar *thisfn = "nadp_desktop_provider_ifactory_provider_iface_init"; g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); iface->get_version = ifactory_provider_get_version; iface->read_start = nadp_reader_ifactory_provider_read_start; iface->read_data = nadp_reader_ifactory_provider_read_data; iface->read_done = nadp_reader_ifactory_provider_read_done; iface->write_start = nadp_writer_ifactory_provider_write_start; iface->write_data = nadp_writer_ifactory_provider_write_data; iface->write_done = nadp_writer_ifactory_provider_write_done; } static guint ifactory_provider_get_version( const NAIFactoryProvider *reader ) { return( 1 ); } static void iimporter_iface_init( NAIImporterInterface *iface ) { static const gchar *thisfn = "nadp_desktop_provider_iimporter_iface_init"; g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); iface->get_version = iimporter_get_version; iface->import_from_uri = nadp_reader_iimporter_import_from_uri; } static guint iimporter_get_version( const NAIImporter *importer ) { return( 2 ); } static void iexporter_iface_init( NAIExporterInterface *iface ) { static const gchar *thisfn = "nadp_desktop_iexporter_iface_init"; g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); iface->get_version = iexporter_get_version; iface->get_name = iexporter_get_name; iface->get_formats = iexporter_get_formats; iface->free_formats = iexporter_free_formats; iface->to_file = nadp_writer_iexporter_export_to_file; iface->to_buffer = nadp_writer_iexporter_export_to_buffer; } static guint iexporter_get_version( const NAIExporter *exporter ) { return( 2 ); } static gchar * iexporter_get_name( const NAIExporter *exporter ) { return( g_strdup( "NA Desktop Exporter" )); } static void * iexporter_get_formats( const NAIExporter *exporter ) { return(( void * ) nadp_formats_get_formats( exporter )); } static void iexporter_free_formats( const NAIExporter *exporter, GList *format_list ) { nadp_formats_free_formats( format_list ); } /** * nadp_desktop_provider_add_monitor: * @provider: this #NadpDesktopProvider object. * @dir: the path to the directory to be monitored. May not exist. * * Installs a GIO monitor on the given directory. */ void nadp_desktop_provider_add_monitor( NadpDesktopProvider *provider, const gchar *dir ) { NadpMonitor *monitor; g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( provider )); if( !provider->private->dispose_has_run ){ monitor = nadp_monitor_new( provider, dir ); provider->private->monitors = g_list_prepend( provider->private->monitors, monitor ); } } /** * nadp_desktop_provider_on_monitor_event: * @provider: this #NadpDesktopProvider object. * * Factorize events received from GIO when monitoring desktop directories. */ void nadp_desktop_provider_on_monitor_event( NadpDesktopProvider *provider ) { g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( provider )); if( !provider->private->dispose_has_run ){ na_timeout_event( &provider->private->timeout ); } } /** * nadp_desktop_provider_release_monitors: * @provider: this #NadpDesktopProvider object. * * Release previously set desktop monitors. */ void nadp_desktop_provider_release_monitors( NadpDesktopProvider *provider ) { g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( provider )); if( provider->private->monitors ){ g_list_foreach( provider->private->monitors, ( GFunc ) g_object_unref, NULL ); g_list_free( provider->private->monitors ); provider->private->monitors = NULL; } } static void on_monitor_timeout( NadpDesktopProvider *provider ) { static const gchar *thisfn = "nadp_desktop_provider_on_monitor_timeout"; /* last individual notification is older that the st_burst_timeout * so triggers the NAIIOProvider interface and destroys this timeout */ g_debug( "%s: triggering NAIIOProvider interface for provider=%p (%s)", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider )); na_iio_provider_item_changed( NA_IIO_PROVIDER( provider )); } nautilus-actions-3.2.3/src/io-desktop/nadp-module.c0000644000175100017500000000521712212601376017166 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "nadp-desktop-provider.h" /* the count of GType types provided by this extension * each new GType type must * - be registered in na_extension_startup() * - be addressed in na_extension_list_types(). */ #define NADP_TYPES_COUNT 1 /* * na_extension_startup: * * mandatory starting with API v. 1. */ gboolean na_extension_startup( GTypeModule *module ) { static const gchar *thisfn = "nadp_module_na_extension_startup"; g_debug( "%s: module=%p", thisfn, ( void * ) module ); nadp_desktop_provider_register_type( module ); return( TRUE ); } /* * na_extension_get_version: * * optional, defaults to 1. */ guint na_extension_get_version( void ) { static const gchar *thisfn = "nadp_module_na_extension_get_version"; guint version; version = 1; g_debug( "%s: version=%d", thisfn, version ); return( version ); } /* * na_extension_list_types: * * mandatory starting with v. 1. */ guint na_extension_list_types( const GType **types ) { static const gchar *thisfn = "nadp_module_na_extension_list_types"; static GType types_list [1+NADP_TYPES_COUNT]; g_debug( "%s: types=%p", thisfn, ( void * ) types ); types_list[0] = NADP_TYPE_DESKTOP_PROVIDER; types_list[NADP_TYPES_COUNT] = 0; *types = types_list; return( NADP_TYPES_COUNT ); } /* * na_extension_shutdown: * * mandatory starting with v. 1. */ void na_extension_shutdown( void ) { static const gchar *thisfn = "nadp_module_na_extension_shutdown"; g_debug( "%s", thisfn ); } nautilus-actions-3.2.3/src/io-desktop/export-desktop.png0000664000175100017500000001667211700105242020314 00000000000000PNG  IHDR00W OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3-bKGD pHYs  tIME պ>_IDAThi\uݷ}z @@DERRB-VU%v*rbQY'ȮV6'e;vfʊb"h٢@E $ooo7z4Sɇܪ[߹sm|` gxZ"@GmǨFLRP"5@ >{  d&Jw2rF4]-D$Tlj(jWZk 76[4k,}cλ `7NYG~0]ys'vgr)],#s@!PZ'ôu71U& Kk+W/?)l|gfg!?:&S=}l;F/pHUq'=v`L L1ba0֔A !qpl 0P ҊY. ?u=8?8=dt!~Z'AbqB9}Zm:5'5wX/P BXEQ44(Z6maLFc4m1xNodm<нwcctny7x> !sZmdypg>+?ii$aO@[] vLW PR,S"IقjI dF+I$L,0M7urr>LUO<{k?R43[cf~G: yM;9w- -ii:ickQH} FPYd~nf`DڞmlسɗE_1o4ᅥ[sW~us?NpOQ:p|cG~4m 5\]^]_ _rM!@oY|q\ ! \ iT֖ u BNtvÄNL<#֍ =tYo?755R~/y?%(}wxO_hɫח+3p0Hn.unAIt4ĵ%A&IՍ1Gl8ȨKP^mJ +3W/NMz4@f?(l`ʋpcqScE&@hPn;N]t0 Q 4\,bhd!?p}*)ڈHO)bkMV*7)Hd0',e%#Z_^tÞ LwbEMg%&nBǏРɗq29Kd^Q4CKg.`5aOA=lگUCnko 0ՠ[K~gH9\uA$0k-ΌP*SR\+G+ZMRR`EvX;0 4NÇn7eX %Hl0= ,7:Xgƕ oJӴ( ٬wlqmEB}}Vb2CUde-AM0v@YEYa#-KXE:aum"oB5/~, m: pS|<66fKr7cinn' I[%hh*"Ar'MbL!MX)Zjyv[ɂp mp (~ඦ2ə<;P~z/l&}h3 `KmTX@i|lTvLqfQ0-旘1a%j;&7C8^Naiы V+]_¶-r\ƶLX><_3:Zchƶ5ˆ/4oB˷P0ח{ჟLJFPƚ8(h R qVx]QJo=q7Ei6{ĖXL'9HFh8GhGN.#(i)ҽ@&v3z@w`mWgu޹RwDwcs&J$[Kk>v\[9WЍ{OnvH6~m!oz& ,.s~'[TeBS^=vn&d\a~0u-7I"J)d/\mш\XY>-ϼ\[ok-{hsτXFv@$ o+'J˒XI*e84]Gv;N}iJ3a!Eo2o a mFI u/ń^ҠtFr.JOȸ؊Ѕ'۵/7{ƳQ vjzB%bXY$l4!9t-{!.w p3(|sSJ2F5/@R)O.5J#aPniL=}<~o$ *JM{?߷_ >t0E;R~ bwIz[dtq"Phh8G<;bG :t4; acmj;7!2ۿ]~RTXVAfBa( J"4wN:g{67ٳ56jAcmzx7l+]P=סBעhi°w+/9IY*]*om_S+w&w~K)i&EހFWn'DJ[iQb\m0|[e-m |7n.䩻~ɇG t?vBnl$ݘ87%* 0&\z$ ;/>=_jwuz ›`7C7&o!c-a@,5`}NBeB6ïs_Nl@ƇG'+N&IENDB`nautilus-actions-3.2.3/src/io-desktop/nadp-utils.h0000644000175100017500000000266712212601376017054 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NADP_UTILS_H__ #define __NADP_UTILS_H__ #include G_BEGIN_DECLS GSList *nadp_utils_gslist_remove_from( GSList *list, const gchar *string ); gboolean nadp_utils_uri_delete ( const gchar *uri ); gboolean nadp_utils_uri_is_writable( const gchar *uri ); G_END_DECLS #endif /* __NADP_UTILS_H__ */ nautilus-actions-3.2.3/src/io-desktop/nadp-reader.c0000644000175100017500000005275312212601376017152 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "nadp-desktop-provider.h" #include "nadp-keys.h" #include "nadp-reader.h" #include "nadp-utils.h" #include "nadp-xdg-dirs.h" typedef struct { gchar *path; gchar *id; } DesktopPath; /* the structure passed as reader data to NAIFactoryObject */ typedef struct { NadpDesktopFile *ndf; NAObjectAction *action; } NadpReaderData; #define ERR_NOT_DESKTOP _( "The Desktop I/O Provider is not able to handle the URI" ) static GList *get_list_of_desktop_paths( NadpDesktopProvider *provider, GSList **mesages ); static void get_list_of_desktop_files( const NadpDesktopProvider *provider, GList **files, const gchar *dir, GSList **messages ); static gboolean is_already_loaded( const NadpDesktopProvider *provider, GList *files, const gchar *desktop_id ); static GList *desktop_path_from_id( const NadpDesktopProvider *provider, GList *files, const gchar *dir, const gchar *id ); static NAIFactoryObject *item_from_desktop_path( const NadpDesktopProvider *provider, DesktopPath *dps, GSList **messages ); static NAIFactoryObject *item_from_desktop_file( const NadpDesktopProvider *provider, NadpDesktopFile *ndf, GSList **messages ); static void desktop_weak_notify( NadpDesktopFile *ndf, GObject *item ); static void free_desktop_paths( GList *paths ); static void read_start_read_subitems_key( const NAIFactoryProvider *provider, NAObjectItem *item, NadpReaderData *reader_data, GSList **messages ); static void read_start_profile_attach_profile( const NAIFactoryProvider *provider, NAObjectProfile *profile, NadpReaderData *reader_data, GSList **messages ); static gboolean read_done_item_is_writable( const NAIFactoryProvider *provider, NAObjectItem *item, NadpReaderData *reader_data, GSList **messages ); static void read_done_action_read_profiles( const NAIFactoryProvider *provider, NAObjectAction *action, NadpReaderData *data, GSList **messages ); static void read_done_action_load_profile( const NAIFactoryProvider *provider, NadpReaderData *reader_data, const gchar *profile_id, GSList **messages ); /* * Returns an unordered list of NAIFactoryObject-derived objects * * This is implementation of NAIIOProvider::read_items method */ GList * nadp_iio_provider_read_items( const NAIIOProvider *provider, GSList **messages ) { static const gchar *thisfn = "nadp_iio_provider_read_items"; GList *items; GList *desktop_paths, *ip; NAIFactoryObject *item; g_debug( "%s: provider=%p (%s), messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) messages ); g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider ), NULL ); items = NULL; nadp_desktop_provider_release_monitors( NADP_DESKTOP_PROVIDER( provider )); desktop_paths = get_list_of_desktop_paths( NADP_DESKTOP_PROVIDER( provider ), messages ); for( ip = desktop_paths ; ip ; ip = ip->next ){ item = item_from_desktop_path( NADP_DESKTOP_PROVIDER( provider ), ( DesktopPath * ) ip->data, messages ); if( item ){ items = g_list_prepend( items, item ); na_object_dump( item ); } } free_desktop_paths( desktop_paths ); g_debug( "%s: count=%d", thisfn, g_list_length( items )); return( items ); } /* * returns a list of DesktopPath items * * we get the ordered list of XDG_DATA_DIRS, and the ordered list of * subdirs to add; then for each item of each list, we search for * .desktop files in the resulted built path * * the returned list is so a list of DesktopPath struct, in * the ordered of preference (most preferred first) */ static GList * get_list_of_desktop_paths( NadpDesktopProvider *provider, GSList **messages ) { GList *files; GSList *xdg_dirs, *idir; GSList *subdirs, *isub; gchar *dir; files = NULL; xdg_dirs = nadp_xdg_dirs_get_data_dirs(); subdirs = na_core_utils_slist_from_split( NADP_DESKTOP_PROVIDER_SUBDIRS, G_SEARCHPATH_SEPARATOR_S ); /* explore each directory from XDG_DATA_DIRS */ for( idir = xdg_dirs ; idir ; idir = idir->next ){ /* explore each N-A candidate subdirectory for each XDG dir */ for( isub = subdirs ; isub ; isub = isub->next ){ dir = g_build_filename(( gchar * ) idir->data, ( gchar * ) isub->data, NULL ); nadp_desktop_provider_add_monitor( provider, dir ); get_list_of_desktop_files( provider, &files, dir, messages ); g_free( dir ); } } na_core_utils_slist_free( subdirs ); na_core_utils_slist_free( xdg_dirs ); return( files ); } /* * scans the directory for .desktop files * only adds to the list those which have not been yet loaded */ static void get_list_of_desktop_files( const NadpDesktopProvider *provider, GList **files, const gchar *dir, GSList **messages ) { static const gchar *thisfn = "nadp_reader_get_list_of_desktop_files"; GDir *dir_handle; GError *error; const gchar *name; gchar *desktop_id; g_debug( "%s: provider=%p, files=%p (count=%d), dir=%s, messages=%p", thisfn, ( void * ) provider, ( void * ) files, g_list_length( *files ), dir, ( void * ) messages ); error = NULL; dir_handle = NULL; /* do not warn when the directory just doesn't exist */ if( g_file_test( dir, G_FILE_TEST_IS_DIR )){ dir_handle = g_dir_open( dir, 0, &error ); if( error ){ g_warning( "%s: %s: %s", thisfn, dir, error->message ); g_error_free( error ); goto close_dir_handle; } } else { g_debug( "%s: %s: directory doesn't exist", thisfn, dir ); } if( dir_handle ){ while(( name = g_dir_read_name( dir_handle ))){ if( g_str_has_suffix( name, NADP_DESKTOP_FILE_SUFFIX )){ desktop_id = na_core_utils_str_remove_suffix( name, NADP_DESKTOP_FILE_SUFFIX ); if( !is_already_loaded( provider, *files, desktop_id )){ *files = desktop_path_from_id( provider, *files, dir, desktop_id ); } g_free( desktop_id ); } } } close_dir_handle: if( dir_handle ){ g_dir_close( dir_handle ); } } static gboolean is_already_loaded( const NadpDesktopProvider *provider, GList *files, const gchar *desktop_id ) { gboolean found; GList *ip; DesktopPath *dps; found = FALSE; for( ip = files ; ip && !found ; ip = ip->next ){ dps = ( DesktopPath * ) ip->data; if( !g_ascii_strcasecmp( dps->id, desktop_id )){ found = TRUE; } } return( found ); } static GList * desktop_path_from_id( const NadpDesktopProvider *provider, GList *files, const gchar *dir, const gchar *id ) { DesktopPath *dps; gchar *bname; GList *list; dps = g_new0( DesktopPath, 1 ); bname = g_strdup_printf( "%s%s", id, NADP_DESKTOP_FILE_SUFFIX ); dps->path = g_build_filename( dir, bname, NULL ); g_free( bname ); dps->id = g_strdup( id ); list = g_list_prepend( files, dps ); return( list ); } /* * Returns a newly allocated NAIFactoryObject-derived object, initialized * from the .desktop file pointed to by DesktopPath struct */ static NAIFactoryObject * item_from_desktop_path( const NadpDesktopProvider *provider, DesktopPath *dps, GSList **messages ) { NadpDesktopFile *ndf; ndf = nadp_desktop_file_new_from_path( dps->path ); if( !ndf ){ return( NULL ); } return( item_from_desktop_file( provider, ndf, messages )); } /* * Returns a newly allocated NAIFactoryObject-derived object, initialized * from the .desktop file */ static NAIFactoryObject * item_from_desktop_file( const NadpDesktopProvider *provider, NadpDesktopFile *ndf, GSList **messages ) { /*static const gchar *thisfn = "nadp_reader_item_from_desktop_file";*/ NAIFactoryObject *item; gchar *type; NadpReaderData *reader_data; gchar *id; item = NULL; type = nadp_desktop_file_get_file_type( ndf ); if( !strcmp( type, NADP_VALUE_TYPE_ACTION )){ item = NA_IFACTORY_OBJECT( na_object_action_new()); } else if( !strcmp( type, NADP_VALUE_TYPE_MENU )){ item = NA_IFACTORY_OBJECT( na_object_menu_new()); } else { /* i18n: 'type' is the nature of the item: Action or Menu */ na_core_utils_slist_add_message( messages, _( "unknown type: %s" ), type ); } if( item ){ id = nadp_desktop_file_get_id( ndf ); na_object_set_id( item, id ); g_free( id ); reader_data = g_new0( NadpReaderData, 1 ); reader_data->ndf = ndf; na_ifactory_provider_read_item( NA_IFACTORY_PROVIDER( provider ), reader_data, item, messages ); na_object_set_provider_data( item, ndf ); g_object_weak_ref( G_OBJECT( item ), ( GWeakNotify ) desktop_weak_notify, ndf ); g_free( reader_data ); } g_free( type ); return( item ); } static void desktop_weak_notify( NadpDesktopFile *ndf, GObject *item ) { static const gchar *thisfn = "nadp_reader_desktop_weak_notify"; g_debug( "%s: ndf=%p (%s), item=%p (%s)", thisfn, ( void * ) ndf, G_OBJECT_TYPE_NAME( ndf ), ( void * ) item, G_OBJECT_TYPE_NAME( item )); g_object_unref( ndf ); } static void free_desktop_paths( GList *paths ) { GList *ip; DesktopPath *dps; for( ip = paths ; ip ; ip = ip->next ){ dps = ( DesktopPath * ) ip->data; g_free( dps->path ); g_free( dps->id ); g_free( dps ); } g_list_free( paths ); } /** * nadp_reader_iimporter_import_from_uri: * @instance: the #NAIImporter provider. * @parms: a #NAIImporterUriParms structure. * * Imports an item. * * Returns: the import operation code. * * As soon as we have a valid .desktop file, we are most probably willing * to successfully import an action or a menu of it. * * GLib does not have any primitive to load a key file from an uri. * So we have to load the file into memory, and then try to load the key * file from the memory data. * * Starting with N-A 3.2, we only honor the version 2 of #NAIImporter interface, * thus no more checking here against possible duplicate identifiers. */ guint nadp_reader_iimporter_import_from_uri( const NAIImporter *instance, void *parms_ptr ) { static const gchar *thisfn = "nadp_reader_iimporter_import_from_uri"; guint code; NAIImporterImportFromUriParmsv2 *parms; NadpDesktopFile *ndf; g_debug( "%s: instance=%p, parms=%p", thisfn, ( void * ) instance, parms_ptr ); g_return_val_if_fail( NA_IS_IIMPORTER( instance ), IMPORTER_CODE_PROGRAM_ERROR ); g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( instance ), IMPORTER_CODE_PROGRAM_ERROR ); parms = ( NAIImporterImportFromUriParmsv2 * ) parms_ptr; if( !na_core_utils_file_is_loadable( parms->uri )){ code = IMPORTER_CODE_NOT_LOADABLE; return( code ); } code = IMPORTER_CODE_NOT_WILLING_TO; ndf = nadp_desktop_file_new_from_uri( parms->uri ); if( ndf ){ parms->imported = ( NAObjectItem * ) item_from_desktop_file( ( const NadpDesktopProvider * ) NADP_DESKTOP_PROVIDER( instance ), ndf, &parms->messages ); if( parms->imported ){ g_return_val_if_fail( NA_IS_OBJECT_ITEM( parms->imported ), IMPORTER_CODE_NOT_WILLING_TO ); /* remove the weak reference on desktop file set by 'item_from_desktop_file' * as we must consider this #NAObjectItem as a new one */ na_object_set_provider_data( parms->imported, NULL ); g_object_weak_unref( G_OBJECT( parms->imported ), ( GWeakNotify ) desktop_weak_notify, ndf ); g_object_unref( ndf ); /* also remove the 'writable' status' */ na_object_set_readonly( parms->imported, FALSE ); code = IMPORTER_CODE_OK; } } if( code == IMPORTER_CODE_NOT_WILLING_TO ){ na_core_utils_slist_add_message( &parms->messages, ERR_NOT_DESKTOP ); } return( code ); } /* * at this time, the object has been allocated and its id has been set * read here the subitems key, which may be 'Profiles' or 'ItemsList' * depending of the exact class of the NAObjectItem */ void nadp_reader_ifactory_provider_read_start( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *serializable, GSList **messages ) { static const gchar *thisfn = "nadp_reader_ifactory_provider_read_start"; g_return_if_fail( NA_IS_IFACTORY_PROVIDER( reader )); g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( reader )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( serializable )); if( !NADP_DESKTOP_PROVIDER( reader )->private->dispose_has_run ){ g_debug( "%s: reader=%p (%s), reader_data=%p, serializable=%p (%s), messages=%p", thisfn, ( void * ) reader, G_OBJECT_TYPE_NAME( reader ), ( void * ) reader_data, ( void * ) serializable, G_OBJECT_TYPE_NAME( serializable ), ( void * ) messages ); if( NA_IS_OBJECT_ITEM( serializable )){ read_start_read_subitems_key( reader, NA_OBJECT_ITEM( serializable ), ( NadpReaderData * ) reader_data, messages ); na_object_set_iversion( serializable, 3 ); } if( NA_IS_OBJECT_PROFILE( serializable )){ read_start_profile_attach_profile( reader, NA_OBJECT_PROFILE( serializable ), ( NadpReaderData * ) reader_data, messages ); } } } static void read_start_read_subitems_key( const NAIFactoryProvider *provider, NAObjectItem *item, NadpReaderData *reader_data, GSList **messages ) { GSList *subitems; gboolean key_found; subitems = nadp_desktop_file_get_string_list( reader_data->ndf, NADP_GROUP_DESKTOP, NA_IS_OBJECT_ACTION( item ) ? NADP_KEY_PROFILES : NADP_KEY_ITEMS_LIST, &key_found, NULL ); if( key_found ){ na_object_set_items_slist( item, subitems ); } na_core_utils_slist_free( subitems ); } static void read_start_profile_attach_profile( const NAIFactoryProvider *provider, NAObjectProfile *profile, NadpReaderData *reader_data, GSList **messages ) { na_object_attach_profile( reader_data->action, profile ); } /* * reading any data from a desktop file requires: * - a NadpDesktopFile object which has been initialized with the .desktop file * -> has been attached to the NAObjectItem in get_item() above * - the data type (+ reading default value) * - group and key names * * Returns: NULL if the key has not been found * letting the caller deal with default values */ NADataBoxed * nadp_reader_ifactory_provider_read_data( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *object, const NADataDef *def, GSList **messages ) { static const gchar *thisfn = "nadp_reader_ifactory_provider_read_data"; NADataBoxed *boxed; gboolean found; NadpReaderData *nrd; gchar *group, *id; gchar *msg; gchar *str_value; gboolean bool_value; GSList *slist_value; guint uint_value; g_return_val_if_fail( NA_IS_IFACTORY_PROVIDER( reader ), NULL ); g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( reader ), NULL ); g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL ); boxed = NULL; if( !NADP_DESKTOP_PROVIDER( reader )->private->dispose_has_run ){ nrd = ( NadpReaderData * ) reader_data; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( nrd->ndf ), NULL ); if( def->desktop_entry ){ if( NA_IS_OBJECT_ITEM( object )){ group = g_strdup( NADP_GROUP_DESKTOP ); } else { g_return_val_if_fail( NA_IS_OBJECT_PROFILE( object ), NULL ); id = na_object_get_id( object ); group = g_strdup_printf( "%s %s", NADP_GROUP_PROFILE, id ); g_free( id ); } switch( def->type ){ case NA_DATA_TYPE_LOCALE_STRING: str_value = nadp_desktop_file_get_locale_string( nrd->ndf, group, def->desktop_entry, &found, def->default_value ); if( found ){ boxed = na_data_boxed_new( def ); na_boxed_set_from_void( NA_BOXED( boxed ), str_value ); } g_free( str_value ); break; case NA_DATA_TYPE_STRING: str_value = nadp_desktop_file_get_string( nrd->ndf, group, def->desktop_entry, &found, def->default_value ); if( found ){ boxed = na_data_boxed_new( def ); na_boxed_set_from_void( NA_BOXED( boxed ), str_value ); } g_free( str_value ); break; case NA_DATA_TYPE_BOOLEAN: bool_value = nadp_desktop_file_get_boolean( nrd->ndf, group, def->desktop_entry, &found, na_core_utils_boolean_from_string( def->default_value )); if( found ){ boxed = na_data_boxed_new( def ); na_boxed_set_from_void( NA_BOXED( boxed ), GUINT_TO_POINTER( bool_value )); } break; case NA_DATA_TYPE_STRING_LIST: slist_value = nadp_desktop_file_get_string_list( nrd->ndf, group, def->desktop_entry, &found, def->default_value ); if( found ){ boxed = na_data_boxed_new( def ); na_boxed_set_from_void( NA_BOXED( boxed ), slist_value ); } na_core_utils_slist_free( slist_value ); break; case NA_DATA_TYPE_UINT: uint_value = nadp_desktop_file_get_uint( nrd->ndf, group, def->desktop_entry, &found, atoi( def->default_value )); if( found ){ boxed = na_data_boxed_new( def ); na_boxed_set_from_void( NA_BOXED( boxed ), GUINT_TO_POINTER( uint_value )); } break; default: msg = g_strdup_printf( "%s: %d: invalid data type.", thisfn, def->type ); g_warning( "%s", msg ); *messages = g_slist_append( *messages, msg ); } g_free( group ); } } return( boxed ); } /* * called when each NAIFactoryObject object has been read */ void nadp_reader_ifactory_provider_read_done( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *serializable, GSList **messages ) { static const gchar *thisfn = "nadp_reader_ifactory_provider_read_done"; gboolean writable; g_return_if_fail( NA_IS_IFACTORY_PROVIDER( reader )); g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( reader )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( serializable )); if( !NADP_DESKTOP_PROVIDER( reader )->private->dispose_has_run ){ g_debug( "%s: reader=%p (%s), reader_data=%p, serializable=%p (%s), messages=%p", thisfn, ( void * ) reader, G_OBJECT_TYPE_NAME( reader ), ( void * ) reader_data, ( void * ) serializable, G_OBJECT_TYPE_NAME( serializable ), ( void * ) messages ); if( NA_IS_OBJECT_ITEM( serializable )){ writable = read_done_item_is_writable( reader, NA_OBJECT_ITEM( serializable ), ( NadpReaderData * ) reader_data, messages ); na_object_set_readonly( serializable, !writable ); } if( NA_IS_OBJECT_ACTION( serializable )){ read_done_action_read_profiles( reader, NA_OBJECT_ACTION( serializable ), ( NadpReaderData * ) reader_data, messages ); } g_debug( "%s: quitting for %s at %p", thisfn, G_OBJECT_TYPE_NAME( serializable ), ( void * ) serializable ); } } static gboolean read_done_item_is_writable( const NAIFactoryProvider *provider, NAObjectItem *item, NadpReaderData *reader_data, GSList **messages ) { NadpDesktopFile *ndf; gchar *uri; gboolean writable; ndf = reader_data->ndf; uri = nadp_desktop_file_get_key_file_uri( ndf ); writable = nadp_utils_uri_is_writable( uri ); g_free( uri ); return( writable ); } /* * Read and attach profiles in the specified order * - profiles which may exist in .desktop files, but are not referenced * in the 'Profiles' string list are just ignored * - profiles which may be referenced in the action string list, but are not * found in the .desktop file are recreated with default values (plus a warning) * - ensure that there is at least one profile attached to the action */ static void read_done_action_read_profiles( const NAIFactoryProvider *provider, NAObjectAction *action, NadpReaderData *reader_data, GSList **messages ) { static const gchar *thisfn = "nadp_reader_read_done_action_read_profiles"; GSList *order; GSList *ip; gchar *profile_id; NAObjectId *found; NAObjectProfile *profile; reader_data->action = action; order = na_object_get_items_slist( action ); for( ip = order ; ip ; ip = ip->next ){ profile_id = ( gchar * ) ip->data; found = na_object_get_item( action, profile_id ); if( !found ){ read_done_action_load_profile( provider, reader_data, profile_id, messages ); } } na_core_utils_slist_free( order ); if( !na_object_get_items_count( action )){ g_warning( "%s: no profile found in .desktop file", thisfn ); profile = na_object_profile_new_with_defaults(); na_object_attach_profile( action, profile ); } } static void read_done_action_load_profile( const NAIFactoryProvider *provider, NadpReaderData *reader_data, const gchar *profile_id, GSList **messages ) { static const gchar *thisfn = "nadp_reader_read_done_action_load_profile"; NAObjectProfile *profile; g_debug( "%s: loading profile=%s", thisfn, profile_id ); profile = na_object_profile_new_with_defaults(); na_object_set_id( profile, profile_id ); if( nadp_desktop_file_has_profile( reader_data->ndf, profile_id )){ na_ifactory_provider_read_item( NA_IFACTORY_PROVIDER( provider ), reader_data, NA_IFACTORY_OBJECT( profile ), messages ); } else { g_warning( "%s: profile '%s' not found in .desktop file", thisfn, profile_id ); na_object_attach_profile( reader_data->action, profile ); } } nautilus-actions-3.2.3/src/io-desktop/nadp-utils.c0000644000175100017500000000665712212601376017052 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "nadp-desktop-provider.h" #include "nadp-utils.h" /** * nadp_utils_gslist_remove_from: * @list: the #GSList from which remove the @string. * @string: the string to be removed. * * Removes a @string from a string list, then frees the removed @string. */ GSList * nadp_utils_gslist_remove_from( GSList *list, const gchar *string ) { GSList *is; for( is = list ; is ; is = is->next ){ const gchar *istr = ( const gchar * ) is->data; if( !na_core_utils_str_collate( string, istr )){ g_free( is->data ); list = g_slist_delete_link( list, is ); break; } } return( list ); } /** * */ gboolean nadp_utils_uri_delete( const gchar *uri ) { gboolean deleted; gchar *scheme; gchar *path; deleted = FALSE; scheme = g_uri_parse_scheme( uri ); if( !strcmp( scheme, "file" )){ path = g_filename_from_uri( uri, NULL, NULL ); if( path ){ deleted = na_core_utils_file_delete( path ); g_free( path ); } } g_free( scheme ); return( deleted ); } /** * nadp_utils_uri_is_writable: * @uri: the URI of the file to be tested. * * Returns: %TRUE if the file is writable, %FALSE else. * * Please note that this type of test is subject to race conditions, * as the file may become unwritable after a successful test, * but before the caller has been able to actually write into it. * * There is no "super-test". Just try... */ gboolean nadp_utils_uri_is_writable( const gchar *uri ) { static const gchar *thisfn = "nadp_utils_uri_is_writable"; GFile *file; GError *error = NULL; GFileInfo *info; gboolean writable; if( !uri || !g_utf8_strlen( uri, -1 )){ return( FALSE ); } file = g_file_new_for_uri( uri ); info = g_file_query_info( file, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "," G_FILE_ATTRIBUTE_STANDARD_TYPE, G_FILE_QUERY_INFO_NONE, NULL, &error ); if( error ){ g_warning( "%s: g_file_query_info error: %s", thisfn, error->message ); g_error_free( error ); g_object_unref( file ); return( FALSE ); } writable = g_file_info_get_attribute_boolean( info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE ); if( !writable ){ g_debug( "%s: %s is not writable", thisfn, uri ); } g_object_unref( info ); return( writable ); } nautilus-actions-3.2.3/src/io-desktop/nadp-writer.h0000644000175100017500000000517312212601376017223 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NADP_WRITER_H__ #define __NADP_WRITER_H__ #include #include #include G_BEGIN_DECLS gboolean nadp_iio_provider_is_willing_to_write ( const NAIIOProvider *provider ); gboolean nadp_iio_provider_is_able_to_write ( const NAIIOProvider *provider ); guint nadp_iio_provider_write_item ( const NAIIOProvider *provider, const NAObjectItem *item, GSList **messages ); guint nadp_iio_provider_delete_item ( const NAIIOProvider *provider, const NAObjectItem *item, GSList **messages ); guint nadp_iio_provider_duplicate_data ( const NAIIOProvider *provider, NAObjectItem *dest, const NAObjectItem *source, GSList **messages ); guint nadp_writer_iexporter_export_to_buffer( const NAIExporter *instance, NAIExporterBufferParmsv2 *parms ); guint nadp_writer_iexporter_export_to_file ( const NAIExporter *instance, NAIExporterFileParmsv2 *parms ); guint nadp_writer_ifactory_provider_write_start( const NAIFactoryProvider *provider, void *writer_data, const NAIFactoryObject *object, GSList **messages ); guint nadp_writer_ifactory_provider_write_data( const NAIFactoryProvider *provider, void *writer_data, const NAIFactoryObject *object, const NADataBoxed *boxed, GSList **messages ); guint nadp_writer_ifactory_provider_write_done( const NAIFactoryProvider *provider, void *writer_data, const NAIFactoryObject *object, GSList **messages ); G_END_DECLS #endif /* __NADP_WRITER_H__ */ nautilus-actions-3.2.3/src/io-desktop/nadp-desktop-file.c0000644000175100017500000007532612212601376020277 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "nadp-desktop-file.h" #include "nadp-keys.h" /* private class data */ struct _NadpDesktopFileClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NadpDesktopFilePrivate { gboolean dispose_has_run; gchar *id; gchar *uri; gchar *type; GKeyFile *key_file; }; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NadpDesktopFileClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static NadpDesktopFile *ndf_new( const gchar *uri ); static gchar *path2id( const gchar *path ); static gchar *uri2id( const gchar *uri ); static gboolean check_key_file( NadpDesktopFile *ndf ); static void remove_encoding_part( NadpDesktopFile *ndf ); GType nadp_desktop_file_get_type( void ) { static GType class_type = 0; if( !class_type ){ class_type = register_type(); } return( class_type ); } static GType register_type( void ) { static const gchar *thisfn = "nadp_desktop_file_register_type"; GType type; static GTypeInfo info = { sizeof( NadpDesktopFileClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NadpDesktopFile ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NadpDesktopFile", &info, 0 ); return( type ); } static void class_init( NadpDesktopFileClass *klass ) { static const gchar *thisfn = "nadp_desktop_file_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NadpDesktopFileClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "nadp_desktop_file_instance_init"; NadpDesktopFile *self; g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); g_return_if_fail( NADP_IS_DESKTOP_FILE( instance )); self = NADP_DESKTOP_FILE( instance ); self->private = g_new0( NadpDesktopFilePrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->key_file = g_key_file_new(); } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "nadp_desktop_file_instance_dispose"; NadpDesktopFile *self; g_return_if_fail( NADP_IS_DESKTOP_FILE( object )); self = NADP_DESKTOP_FILE( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "nadp_desktop_file_instance_finalize"; NadpDesktopFile *self; g_return_if_fail( NADP_IS_DESKTOP_FILE( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NADP_DESKTOP_FILE( object ); g_free( self->private->id ); g_free( self->private->uri ); g_free( self->private->type ); if( self->private->key_file ){ g_key_file_free( self->private->key_file ); } g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /** * nadp_desktop_file_new: * * Retuns: a newly allocated #NadpDesktopFile object. */ NadpDesktopFile * nadp_desktop_file_new( void ) { NadpDesktopFile *ndf; ndf = g_object_new( NADP_TYPE_DESKTOP_FILE, NULL ); return( ndf ); } /** * nadp_desktop_file_new_from_path: * @path: the full pathname of a .desktop file. * * Retuns: a newly allocated #NadpDesktopFile object. * * Key file has been loaded, and first validity checks made. */ NadpDesktopFile * nadp_desktop_file_new_from_path( const gchar *path ) { static const gchar *thisfn = "nadp_desktop_file_new_from_path"; NadpDesktopFile *ndf; GError *error; gchar *uri; ndf = NULL; g_debug( "%s: path=%s", thisfn, path ); g_return_val_if_fail( path && g_utf8_strlen( path, -1 ) && g_path_is_absolute( path ), ndf ); error = NULL; uri = g_filename_to_uri( path, NULL, &error ); if( !uri || error ){ g_warning( "%s: %s: %s", thisfn, path, error->message ); g_error_free( error ); g_free( uri ); return( NULL ); } ndf = ndf_new( uri ); g_free( uri ); g_key_file_load_from_file( ndf->private->key_file, path, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, &error ); if( error ){ g_warning( "%s: %s: %s", thisfn, path, error->message ); g_error_free( error ); g_object_unref( ndf ); return( NULL ); } if( !check_key_file( ndf )){ g_object_unref( ndf ); return( NULL ); } return( ndf ); } /** * nadp_desktop_file_new_from_uri: * @uri: the URI the desktop file should be loaded from. * * Retuns: a newly allocated #NadpDesktopFile object, or %NULL. * * Key file has been loaded, and first validity checks made. * * Note: This function is in particular used when importing a file. * So it is rather common that the file not be a .desktop one. * Do not warns when file is malformed. */ NadpDesktopFile * nadp_desktop_file_new_from_uri( const gchar *uri ) { static const gchar *thisfn = "nadp_desktop_file_new_from_uri"; NadpDesktopFile *ndf; GError *error; gchar *data; gsize length; ndf = NULL; data = NULL; length = 0; g_debug( "%s: uri=%s", thisfn, uri ); g_return_val_if_fail( uri && g_utf8_strlen( uri, -1 ), ndf ); data = na_core_utils_file_load_from_uri( uri, &length ); g_debug( "%s: length=%lu", thisfn, ( unsigned long ) length ); /* normally, length and data should be both NULL or both not NULL */ if( !length || !data ){ return( NULL ); } error = NULL; ndf = ndf_new( uri ); g_key_file_load_from_data( ndf->private->key_file, data, length, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, &error ); g_free( data ); if( error ){ if( error->code != G_KEY_FILE_ERROR_GROUP_NOT_FOUND ){ g_debug( "%s: %s", thisfn, error->message ); } g_error_free( error ); g_object_unref( ndf ); return( NULL ); } if( !check_key_file( ndf )){ g_object_unref( ndf ); return( NULL ); } return( ndf ); } /** * nadp_desktop_file_new_for_write: * @path: the full pathname of a .desktop file. * * Retuns: a newly allocated #NadpDesktopFile object. */ NadpDesktopFile * nadp_desktop_file_new_for_write( const gchar *path ) { static const gchar *thisfn = "nadp_desktop_file_new_for_write"; NadpDesktopFile *ndf; GError *error; gchar *uri; ndf = NULL; g_debug( "%s: path=%s", thisfn, path ); g_return_val_if_fail( path && g_utf8_strlen( path, -1 ) && g_path_is_absolute( path ), ndf ); error = NULL; uri = g_filename_to_uri( path, NULL, &error ); if( !uri || error ){ g_warning( "%s: %s: %s", thisfn, path, error->message ); g_error_free( error ); g_free( uri ); return( NULL ); } ndf = ndf_new( uri ); g_free( uri ); return( ndf ); } /** * nadp_desktop_file_get_key_file: * @ndf: the #NadpDesktopFile instance. * * Returns: a pointer to the internal #GKeyFile. */ GKeyFile * nadp_desktop_file_get_key_file( const NadpDesktopFile *ndf ) { GKeyFile *key_file; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL ); key_file = NULL; if( !ndf->private->dispose_has_run ){ key_file = ndf->private->key_file; } return( key_file ); } /** * nadp_desktop_file_get_key_file_uri: * @ndf: the #NadpDesktopFile instance. * * Returns: the URI of the key file, as a newly allocated * string which should be g_free() by the caller. */ gchar * nadp_desktop_file_get_key_file_uri( const NadpDesktopFile *ndf ) { gchar *uri; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL ); uri = NULL; if( !ndf->private->dispose_has_run ){ uri = g_strdup( ndf->private->uri ); } return( uri ); } static NadpDesktopFile * ndf_new( const gchar *uri ) { NadpDesktopFile *ndf; ndf = g_object_new( NADP_TYPE_DESKTOP_FILE, NULL ); ndf->private->id = uri2id( uri ); ndf->private->uri = g_strdup( uri ); return( ndf ); } /* * The id of the file is equal to the basename, minus the suffix. */ static gchar * path2id( const gchar *path ) { gchar *bname; gchar *id; bname = g_path_get_basename( path ); id = na_core_utils_str_remove_suffix( bname, NADP_DESKTOP_FILE_SUFFIX ); g_free( bname ); return( id ); } static gchar * uri2id( const gchar *uri ) { gchar *path; gchar *id; id = NULL; path = g_filename_from_uri( uri, NULL, NULL ); if( path ){ id = path2id( path ); g_free( path ); } return( id ); } static gboolean check_key_file( NadpDesktopFile *ndf ) { static const gchar *thisfn = "nadp_desktop_file_check_key_file"; gboolean ret; gchar *start_group; gboolean has_key; gboolean hidden; gchar *type; GError *error; ret = TRUE; error = NULL; /* start group must be [Desktop Entry] */ start_group = g_key_file_get_start_group( ndf->private->key_file ); if( strcmp( start_group, NADP_GROUP_DESKTOP )){ g_debug( "%s: %s: invalid start group, found %s, waited for %s", thisfn, ndf->private->uri, start_group, NADP_GROUP_DESKTOP ); ret = FALSE; } /* must not have Hidden=true value */ if( ret ){ has_key = g_key_file_has_key( ndf->private->key_file, start_group, NADP_KEY_HIDDEN, &error ); if( error ){ g_debug( "%s: %s: %s", thisfn, ndf->private->uri, error->message ); ret = FALSE; } else if( has_key ){ hidden = g_key_file_get_boolean( ndf->private->key_file, start_group, NADP_KEY_HIDDEN, &error ); if( error ){ g_debug( "%s: %s: %s", thisfn, ndf->private->uri, error->message ); ret = FALSE; } else if( hidden ){ g_debug( "%s: %s: Hidden=true", thisfn, ndf->private->uri ); ret = FALSE; } } } /* must have no Type (which defaults to Action) * or a known one (Action or Menu) */ if( ret ){ type = NULL; has_key = g_key_file_has_key( ndf->private->key_file, start_group, NADP_KEY_TYPE, &error ); if( error ){ g_debug( "%s: %s", thisfn, error->message ); g_error_free( error ); ret = FALSE; } else if( has_key ){ type = g_key_file_get_string( ndf->private->key_file, start_group, NADP_KEY_TYPE, &error ); if( error ){ g_debug( "%s: %s", thisfn, error->message ); g_free( type ); g_error_free( error ); ret = FALSE; } } if( ret ){ if( !type || !strlen( type )){ type = g_strdup( NADP_VALUE_TYPE_ACTION ); } else if( strcmp( type, NADP_VALUE_TYPE_MENU ) && strcmp( type, NADP_VALUE_TYPE_ACTION )){ g_debug( "%s: unmanaged type: %s", thisfn, type ); g_free( type ); ret = FALSE; } } if( ret ){ g_return_val_if_fail( type && strlen( type ), FALSE ); ndf->private->type = type; } } g_free( start_group ); return( ret ); } /** * nadp_desktop_file_get_type: * @ndf: the #NadpDesktopFile instance. * * Returns: the value for the Type entry as a newly allocated string which * should be g_free() by the caller. */ gchar * nadp_desktop_file_get_file_type( const NadpDesktopFile *ndf ) { gchar *type; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL ); type = NULL; if( !ndf->private->dispose_has_run ){ type = g_strdup( ndf->private->type ); } return( type ); } /** * nadp_desktop_file_get_id: * @ndf: the #NadpDesktopFile instance. * * Returns: a newly allocated string which holds the id of the Desktop * File. */ gchar * nadp_desktop_file_get_id( const NadpDesktopFile *ndf ) { gchar *value; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL ); value = NULL; if( !ndf->private->dispose_has_run ){ value = g_strdup( ndf->private->id ); } return( value ); } /** * nadp_desktop_file_get_profiles: * @ndf: the #NadpDesktopFile instance. * * Returns: the list of profiles in the file, as a newly allocated GSList * which must be na_core_utils_slist_free() by the caller. * * Silently ignore unknown groups. */ GSList * nadp_desktop_file_get_profiles( const NadpDesktopFile *ndf ) { GSList *list; gchar **groups, **ig; gchar *profile_pfx; gchar *profile_id; guint pfx_len; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL ); list = NULL; if( !ndf->private->dispose_has_run ){ groups = g_key_file_get_groups( ndf->private->key_file, NULL ); if( groups ){ ig = groups; profile_pfx = g_strdup_printf( "%s ", NADP_GROUP_PROFILE ); pfx_len = strlen( profile_pfx ); while( *ig ){ if( !strncmp( *ig, profile_pfx, pfx_len )){ profile_id = g_strdup( *ig+pfx_len ); list = g_slist_prepend( list, profile_id ); } ig++; } g_strfreev( groups ); g_free( profile_pfx ); } } return( list ); } /** * nadp_desktop_file_has_profile: * @ndf: the #NadpDesktopFile instance. * @profile_id: the identifier of the profile. * * Returns: %TRUE if a group can be found in the .desktop file for this profile, * %FALSE else. * * Since: 3.1 */ gboolean nadp_desktop_file_has_profile( const NadpDesktopFile *ndf, const gchar *profile_id ) { gboolean has_profile; gchar *group_name; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), FALSE ); g_return_val_if_fail( profile_id && g_utf8_strlen( profile_id, -1 ), FALSE ); has_profile = FALSE; if( !ndf->private->dispose_has_run ){ group_name = g_strdup_printf( "%s %s", NADP_GROUP_PROFILE, profile_id ); has_profile = g_key_file_has_group( ndf->private->key_file, group_name ); g_free( group_name ); } return( has_profile ); } /** * nadp_desktop_file_remove_key: * @ndf: this #NadpDesktopFile instance. * @group: the group. * @key: the key. * * Removes the specified key. * * Note that this doesn't work very well for localized keys, as we only * remove a key which has the exact same label that the provided one. * So we'd have to remove: * - key * - key[en_US.UTF-8] * - key[en_US] * - key[en] */ void nadp_desktop_file_remove_key( const NadpDesktopFile *ndf, const gchar *group, const gchar *key ) { char **locales; char **iloc; gchar *locale_key; g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf )); if( !ndf->private->dispose_has_run ){ g_key_file_remove_key( ndf->private->key_file, group, key, NULL ); locales = ( char ** ) g_get_language_names(); iloc = locales; while( *iloc ){ locale_key = g_strdup_printf( "%s[%s]", key, *iloc ); g_key_file_remove_key( ndf->private->key_file, group, locale_key, NULL ); g_free( locale_key ); iloc++; } } } /** * nadp_desktop_file_remove_profile: * @ndf: this #NadpDesktopFile instance. * @profile_id: the id of the profile. * * Removes the group which describes the specified profile. */ void nadp_desktop_file_remove_profile( const NadpDesktopFile *ndf, const gchar *profile_id ) { gchar *group_name; g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf )); if( !ndf->private->dispose_has_run ){ group_name = g_strdup_printf( "%s %s", NADP_GROUP_PROFILE, profile_id ); g_key_file_remove_group( ndf->private->key_file, group_name, NULL ); g_free( group_name ); } } /** * nadp_desktop_file_get_boolean: * @ndf: this #NadpDesktopFile instance. * @group: the searched group. * @entry: the searched entry. * @key_found: set to %TRUE if the key has been found, to %FALSE else. * @default_value: value to be set if key has not been found. * * Returns: the read value, or the default value if the entry has not * been found in the given group. */ gboolean nadp_desktop_file_get_boolean( const NadpDesktopFile *ndf, const gchar *group, const gchar *entry, gboolean *key_found, gboolean default_value ) { static const gchar *thisfn = "nadp_desktop_file_get_boolean"; gboolean value; gboolean read_value; gboolean has_entry; GError *error; value = default_value; *key_found = FALSE; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), FALSE ); if( !ndf->private->dispose_has_run ){ error = NULL; has_entry = g_key_file_has_key( ndf->private->key_file, group, entry, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } else if( has_entry ){ read_value = g_key_file_get_boolean( ndf->private->key_file, group, entry, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } else { value = read_value; *key_found = TRUE; } } } return( value ); } /** * nadp_desktop_file_get_locale_string: * @ndf: this #NadpDesktopFile instance. * @group: the searched group. * @entry: the searched entry. * @key_found: set to %TRUE if the key has been found, to %FALSE else. * @default_value: value to be set if key has not been found. * * Returns: the read value, or the default value if the entry has not * been found in the given group. */ gchar * nadp_desktop_file_get_locale_string( const NadpDesktopFile *ndf, const gchar *group, const gchar *entry, gboolean *key_found, const gchar *default_value ) { static const gchar *thisfn = "nadp_desktop_file_get_locale_string"; gchar *value; gchar *read_value; GError *error; value = g_strdup( default_value ); *key_found = FALSE; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL ); if( !ndf->private->dispose_has_run ){ error = NULL; read_value = g_key_file_get_locale_string( ndf->private->key_file, group, entry, NULL, &error ); if( !read_value || error ){ if( error->code != G_KEY_FILE_ERROR_KEY_NOT_FOUND ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); g_free( read_value ); } } else { g_free( value ); value = read_value; *key_found = TRUE; } } return( value ); } /** * nadp_desktop_file_get_string: * @ndf: this #NadpDesktopFile instance. * @group: the searched group. * @entry: the searched entry. * @key_found: set to %TRUE if the key has been found, to %FALSE else. * @default_value: value to be set if key has not been found. * * Returns: the read value, or the default value if the entry has not * been found in the given group. */ gchar * nadp_desktop_file_get_string( const NadpDesktopFile *ndf, const gchar *group, const gchar *entry, gboolean *key_found, const gchar *default_value ) { static const gchar *thisfn = "nadp_desktop_file_get_string"; gchar *value; gchar *read_value; gboolean has_entry; GError *error; value = g_strdup( default_value ); *key_found = FALSE; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL ); if( !ndf->private->dispose_has_run ){ error = NULL; has_entry = g_key_file_has_key( ndf->private->key_file, group, entry, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } else if( has_entry ){ read_value = g_key_file_get_string( ndf->private->key_file, group, entry, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); g_free( read_value ); } else { g_free( value ); value = read_value; *key_found = TRUE; } } } return( value ); } /** * nadp_desktop_file_get_string_list: * @ndf: this #NadpDesktopFile instance. * @group: the searched group. * @entry: the searched entry. * @key_found: set to %TRUE if the key has been found, to %FALSE else. * @default_value: value to be set if key has not been found. * * Returns: the read value, or the default value if the entry has not * been found in the given group. */ GSList * nadp_desktop_file_get_string_list( const NadpDesktopFile *ndf, const gchar *group, const gchar *entry, gboolean *key_found, const gchar *default_value ) { static const gchar *thisfn = "nadp_desktop_file_get_string_list"; GSList *value; gchar **read_array; gboolean has_entry; GError *error; value = g_slist_append( NULL, g_strdup( default_value )); *key_found = FALSE; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL ); if( !ndf->private->dispose_has_run ){ error = NULL; has_entry = g_key_file_has_key( ndf->private->key_file, group, entry, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } else if( has_entry ){ read_array = g_key_file_get_string_list( ndf->private->key_file, group, entry, NULL, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } else { na_core_utils_slist_free( value ); value = na_core_utils_slist_from_array(( const gchar ** ) read_array ); *key_found = TRUE; } g_strfreev( read_array ); } } return( value ); } /** * nadp_desktop_file_get_uint: * @ndf: this #NadpDesktopFile instance. * @group: the searched group. * @entry: the searched entry. * @key_found: set to %TRUE if the key has been found, to %FALSE else. * @default_value: value to be set if key has not been found. * * Returns: the read value, or the default value if the entry has not * been found in the given group. */ guint nadp_desktop_file_get_uint( const NadpDesktopFile *ndf, const gchar *group, const gchar *entry, gboolean *key_found, guint default_value ) { static const gchar *thisfn = "nadp_desktop_file_get_uint"; guint value; gboolean has_entry; GError *error; value = default_value; *key_found = FALSE; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), 0 ); if( !ndf->private->dispose_has_run ){ error = NULL; has_entry = g_key_file_has_key( ndf->private->key_file, group, entry, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } else if( has_entry ){ value = ( guint ) g_key_file_get_integer( ndf->private->key_file, group, entry, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } else { *key_found = TRUE; } } } return( value ); } /** * nadp_desktop_file_set_boolean: * @ndf: this #NadpDesktopFile object. * @group: the name of the group. * @key: the name of the key. * @value: the value to be written. * * Write the given boolean value. */ void nadp_desktop_file_set_boolean( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, gboolean value ) { g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf )); if( !ndf->private->dispose_has_run ){ g_key_file_set_boolean( ndf->private->key_file, group, key, value ); } } /** * nadp_desktop_file_set_locale_string: * @ndf: this #NadpDesktopFile object. * @group: the name of the group. * @key: the name of the key. * @value: the value to be written. * * Write the given string value. * * Until v 3.0.4, locale strings used to be written for all available locales * e.g. 'en_US.UTF-8', 'en_US', 'en.UTF-8', 'en', 'C'. * * Starting with v 3.0.4, encoding part of the locale is no more written. * * The better solution would be to include in the UI a listbox with all * available locales, letting the user choose himself which locale he wish * modify. * * A first fallback would be to set some sort of user preferences: whether * to write all available locales, whether to write all but C locales, ... * * As of v 3.0.4, we choose: * - always write the first locale, which should obviously be the user locale; * - also write all locales derived from the first (e.g. en_US, en_GB, en); * - when the prefix of the locale changes, stop to write other locales unless * the first prefix was 'en', as we suppose that the C locale will always be * in english. * * The locale prefix is identified by '_' or '@' character. */ void nadp_desktop_file_set_locale_string( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, const gchar *value ) { char **locales; guint i; gchar *prefix; gboolean write; g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf )); if( !ndf->private->dispose_has_run ){ locales = ( char ** ) g_get_language_names(); /* en_US.UTF-8 en_US en.UTF-8 en C */ prefix = g_strdup( locales[0] ); for( i = 0 ; prefix[i] ; ++i ){ if( prefix[i] == '_' || prefix[i] == '@' || prefix[i] == '.' ){ prefix[i] = '\0'; break; } } /* using locales[0] writes a string with, e.g. Label[en_US.UTF-8] * after that trying to read the same key with another locale, even en_US.utf-8, * fails ans returns an empty string. * so write all available locales for the string, so that there is a chance at * least one of these will be used as default * * pwi 2010-12-30 v 3.0.4 * no more write encoding part of the locale as desktop files are supposed to * be UTF-8 encoded. */ for( i = 0 ; i < g_strv_length( locales ) ; ++i ){ write = FALSE; if( g_strstr_len( locales[i], -1, "." )){ continue; } /* write the locale string for all locales derived from the first one */ if( !strncmp( locales[i], prefix, strlen( prefix ))){ write = TRUE; /* also write other locales if first was a 'en'-derivative */ } else if( !strcmp( prefix, "en" )){ write = TRUE; } if( write ){ g_key_file_set_locale_string( ndf->private->key_file, group, key, locales[i], value ); } } g_free( prefix ); } } /** * nadp_desktop_file_set_string: * @ndf: this #NadpDesktopFile object. * @group: the name of the group. * @key: the name of the key. * @value: the value to be written. * * Write the given string value. */ void nadp_desktop_file_set_string( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, const gchar *value ) { g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf )); if( !ndf->private->dispose_has_run ){ g_key_file_set_string( ndf->private->key_file, group, key, value ); } } /** * nadp_desktop_file_set_string_list: * @ndf: this #NadpDesktopFile object. * @group: the name of the group. * @key: the name of the key. * @value: the value to be written. * * Write the given list value. */ void nadp_desktop_file_set_string_list( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, GSList *value ) { gchar **array; g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf )); if( !ndf->private->dispose_has_run ){ array = na_core_utils_slist_to_array( value ); g_key_file_set_string_list( ndf->private->key_file, group, key, ( const gchar * const * ) array, g_slist_length( value )); g_strfreev( array ); } } /** * nadp_desktop_file_set_uint: * @ndf: this #NadpDesktopFile object. * @group: the name of the group. * @key: the name of the key. * @value: the value to be written. * * Write the given uint value. */ void nadp_desktop_file_set_uint( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, guint value ) { g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf )); if( !ndf->private->dispose_has_run ){ g_key_file_set_integer( ndf->private->key_file, group, key, value ); } } /** * nadp_desktop_file_write: * @ndf: the #NadpDesktopFile instance. * * Writes the key file to the disk. * * Returns: %TRUE if write is ok, %FALSE else. * * Starting with v 3.0.4, locale strings whose identifier include an * encoding part are removed from the desktop file when rewriting it * (these were wrongly written between v 2.99 and 3.0.3). */ gboolean nadp_desktop_file_write( NadpDesktopFile *ndf ) { static const gchar *thisfn = "nadp_desktop_file_write"; gboolean ret; gchar *data; GFile *file; GFileOutputStream *stream; GError *error; gsize length; ret = FALSE; error = NULL; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), ret ); if( !ndf->private->dispose_has_run ){ if( ndf->private->key_file ){ remove_encoding_part( ndf ); } data = g_key_file_to_data( ndf->private->key_file, &length, NULL ); file = g_file_new_for_uri( ndf->private->uri ); g_debug( "%s: uri=%s", thisfn, ndf->private->uri ); stream = g_file_replace( file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &error ); if( error ){ g_warning( "%s: g_file_replace: %s", thisfn, error->message ); g_error_free( error ); if( stream ){ g_object_unref( stream ); } g_object_unref( file ); g_free( data ); return( FALSE ); } g_output_stream_write( G_OUTPUT_STREAM( stream ), data, length, NULL, &error ); if( error ){ g_warning( "%s: g_output_stream_write: %s", thisfn, error->message ); g_error_free( error ); g_object_unref( stream ); g_object_unref( file ); g_free( data ); return( FALSE ); } g_output_stream_close( G_OUTPUT_STREAM( stream ), NULL, &error ); if( error ){ g_warning( "%s: g_output_stream_close: %s", thisfn, error->message ); g_error_free( error ); g_object_unref( stream ); g_object_unref( file ); g_free( data ); return( FALSE ); } g_object_unref( stream ); g_object_unref( file ); g_free( data ); return( TRUE ); } return( FALSE ); } static void remove_encoding_part( NadpDesktopFile *ndf ) { static const gchar *thisfn = "nadp_desktop_file_remove_encoding_part"; gchar **groups; gchar **keys; guint ig, ik; GRegex *regex; GMatchInfo *info; GError *error; error = NULL; regex = g_regex_new( "\\[(.*)\\.(.*)\\]$", G_REGEX_CASELESS | G_REGEX_UNGREEDY, G_REGEX_MATCH_NOTEMPTY, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } else { groups = g_key_file_get_groups( ndf->private->key_file, NULL ); for( ig = 0 ; ig < g_strv_length( groups ) ; ++ig ){ keys = g_key_file_get_keys( ndf->private->key_file, groups[ig], NULL, NULL ); for( ik = 0 ; ik < g_strv_length( keys ) ; ++ik ){ if( g_regex_match( regex, keys[ik], 0, &info )){ g_key_file_remove_key( ndf->private->key_file, groups[ig], keys[ik], &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); error = NULL; } } g_match_info_free( info ); } g_strfreev( keys ); } g_strfreev( groups ); g_regex_unref( regex ); } } nautilus-actions-3.2.3/src/io-desktop/nadp-desktop-provider.h0000644000175100017500000000676412212601376021217 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NADP_DESKTOP_PROVIDER_H__ #define __NADP_DESKTOP_PROVIDER_H__ /** * SECTION: nadp_desktop_provider * @short_description: #NadpDesktopProvider class definition. * @include: nadp-desktop-provider.h * * This class manages .desktop files I/O storage subsystem, or, in * other words, .desktop files as NAIIOProvider providers. As this, it * should only be used through the NAIIOProvider interface. */ #include #include #include "nadp-desktop-file.h" G_BEGIN_DECLS #define NADP_TYPE_DESKTOP_PROVIDER ( nadp_desktop_provider_get_type()) #define NADP_DESKTOP_PROVIDER( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NADP_TYPE_DESKTOP_PROVIDER, NadpDesktopProvider )) #define NADP_DESKTOP_PROVIDER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NADP_TYPE_DESKTOP_PROVIDER, NadpDesktopProviderClass )) #define NADP_IS_DESKTOP_PROVIDER( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NADP_TYPE_DESKTOP_PROVIDER )) #define NADP_IS_DESKTOP_PROVIDER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NADP_TYPE_DESKTOP_PROVIDER )) #define NADP_DESKTOP_PROVIDER_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NADP_TYPE_DESKTOP_PROVIDER, NadpDesktopProviderClass )) /* private instance data */ typedef struct _NadpDesktopProviderPrivate { /*< private >*/ gboolean dispose_has_run; GList *monitors; NATimeout timeout; } NadpDesktopProviderPrivate; typedef struct { /*< private >*/ GObject parent; NadpDesktopProviderPrivate *private; } NadpDesktopProvider; typedef struct _NadpDesktopProviderClassPrivate NadpDesktopProviderClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NadpDesktopProviderClassPrivate *private; } NadpDesktopProviderClass; /* this is a ':'-separated list of XDG_DATA_DIRS/subdirs searched for * menus or actions .desktop files. */ #define NADP_DESKTOP_PROVIDER_SUBDIRS "file-manager/actions" GType nadp_desktop_provider_get_type ( void ); void nadp_desktop_provider_register_type( GTypeModule *module ); void nadp_desktop_provider_add_monitor ( NadpDesktopProvider *provider, const gchar *dir ); void nadp_desktop_provider_on_monitor_event( NadpDesktopProvider *provider ); void nadp_desktop_provider_release_monitors( NadpDesktopProvider *provider ); G_END_DECLS #endif /* __NADP_DESKTOP_PROVIDER_H__ */ nautilus-actions-3.2.3/src/io-desktop/nadp-reader.h0000644000175100017500000000405612212601376017150 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NADP_READER_H__ #define __NADP_READER_H__ #include #include #include G_BEGIN_DECLS GList *nadp_iio_provider_read_items ( const NAIIOProvider *provider, GSList **messages ); guint nadp_reader_iimporter_import_from_uri ( const NAIImporter *instance, void *parms_ptr ); void nadp_reader_ifactory_provider_read_start( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *serializable, GSList **messages ); NADataBoxed *nadp_reader_ifactory_provider_read_data ( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *serializable, const NADataDef *iddef, GSList **messages ); void nadp_reader_ifactory_provider_read_done ( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *serializable, GSList **messages ); G_END_DECLS #endif /* __NADP_READER_H__ */ nautilus-actions-3.2.3/src/io-desktop/nadp-monitor.c0000644000175100017500000001507512212601376017373 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "nadp-monitor.h" /* private class data */ struct _NadpMonitorClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NadpMonitorPrivate { gboolean dispose_has_run; NadpDesktopProvider *provider; gchar *name; GFile *file; GFileMonitor *monitor; gulong handler; }; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NadpMonitorClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void on_monitor_changed( GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type, NadpMonitor *my_monitor ); GType nadp_monitor_get_type( void ) { static GType class_type = 0; if( !class_type ){ class_type = register_type(); } return( class_type ); } static GType register_type( void ) { static const gchar *thisfn = "nadp_monitor_register_type"; GType type; static GTypeInfo info = { sizeof( NadpMonitorClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NadpMonitor ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NadpMonitor", &info, 0 ); return( type ); } static void class_init( NadpMonitorClass *klass ) { static const gchar *thisfn = "nadp_monitor_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NadpMonitorClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "nadp_monitor_instance_init"; NadpMonitor *self; g_return_if_fail( NADP_IS_MONITOR( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NADP_MONITOR( instance ); self->private = g_new0( NadpMonitorPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "nadp_monitor_instance_dispose"; NadpMonitor *self; g_return_if_fail( NADP_IS_MONITOR( object )); self = NADP_MONITOR( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); if( self->private->handler ){ g_signal_handler_disconnect( self->private->monitor, self->private->handler ); } if( self->private->monitor ){ g_object_unref( self->private->monitor ); } if( self->private->file ){ g_object_unref( self->private->file ); } self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "nadp_monitor_instance_finalize"; NadpMonitor *self; g_return_if_fail( NADP_IS_MONITOR( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NADP_MONITOR( object ); g_free( self->private->name ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /** * nadp_monitor_new: * @provider: the #NadpDesktopProvider instance. * @path: the path of a directory to be monitored. * * Installs a new monitor on the given directory. * * Returns: a new #NadpMonitor instance. */ NadpMonitor * nadp_monitor_new( const NadpDesktopProvider *provider, const gchar *path ) { static const gchar *thisfn = "nadp_monitor_new"; NadpMonitor *monitor; GFileMonitorFlags flags; GError *error; monitor = g_object_new( NADP_TYPE_MONITOR, NULL ); monitor->private->provider = NADP_DESKTOP_PROVIDER( provider ); monitor->private->name = g_strdup( path ); monitor->private->file = g_file_new_for_path( path ); error = NULL; flags = G_FILE_MONITOR_NONE; monitor->private->monitor = g_file_monitor_directory( monitor->private->file, flags, NULL, &error ); if( error ){ g_warning( "%s: g_file_monitor: %s", thisfn, error->message ); g_error_free( error ); error = NULL; g_object_unref( monitor ); return( NULL ); } g_return_val_if_fail( monitor->private->monitor, NULL ); monitor->private->handler = g_signal_connect( monitor->private->monitor, "changed", G_CALLBACK( on_monitor_changed ), monitor ); return( monitor ); } /* * - an existing file is modified: n events on dir + m events on file * - an existing file is deleted: 1 event on file + 1 event on dir * - a new file is created: n events on the dir * - a new directory is created: 1 event of this new dir * - a directory is removed: 1 event of this new dir * - an existing file is renamed: 1 event on file + n events on dir * - the renamed file is modified: n events on dir */ static void on_monitor_changed( GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type, NadpMonitor *my_monitor ) { nadp_desktop_provider_on_monitor_event( my_monitor->private->provider ); } nautilus-actions-3.2.3/src/io-desktop/nadp-keys.c0000644000175100017500000000227612212601376016656 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include "nadp-keys.h" nautilus-actions-3.2.3/src/io-desktop/Makefile.am0000644000175100017500000000463712212601376016656 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) provider_id = na-desktop pkglib_LTLIBRARIES = libna-io-desktop.la provider_datadir = $(pkgdatadir)/$(provider_id) AM_CPPFLAGS += \ -I $(top_srcdir) \ -I $(top_srcdir)/src \ $(NAUTILUS_ACTIONS_CFLAGS) \ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_IO_DESKTOP}\" \ -DPROVIDER_ID=\"$(provider_id)\" \ -DPROVIDER_DATADIR=\"$(provider_datadir)\" \ $(NULL) libna_io_desktop_la_SOURCES = \ nadp-desktop-file.c \ nadp-desktop-file.h \ nadp-desktop-provider.c \ nadp-desktop-provider.h \ nadp-formats.c \ nadp-formats.h \ nadp-keys.c \ nadp-keys.h \ nadp-module.c \ nadp-monitor.c \ nadp-monitor.h \ nadp-reader.c \ nadp-reader.h \ nadp-utils.c \ nadp-utils.h \ nadp-writer.c \ nadp-writer.h \ nadp-xdg-dirs.c \ nadp-xdg-dirs.h \ $(NULL) libna_io_desktop_la_LIBADD = \ $(top_builddir)/src/core/libna-core.la \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libna_io_desktop_la_LDFLAGS = \ -module \ -no-undefined \ -avoid-version \ $(NULL) images_files = \ export-desktop.png \ $(NULL) provider_data_DATA = \ $(images_files) \ $(NULL) EXTRA_DIST = \ $(provider_data_DATA) \ $(NULL) nautilus-actions-3.2.3/src/io-desktop/nadp-formats.h0000644000175100017500000000267612212601376017367 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NADP_FORMATS_H__ #define __NADP_FORMATS_H__ #include #include G_BEGIN_DECLS #define NADP_FORMAT_DESKTOP_V1 "Desktop1" GList *nadp_formats_get_formats ( const NAIExporter *exporter ); void nadp_formats_free_formats( GList *formats ); G_END_DECLS #endif /* __NADP_FORMATS_H__ */ nautilus-actions-3.2.3/src/io-desktop/nadp-xdg-dirs.c0000644000175100017500000000605612212601376017424 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "nadp-xdg-dirs.h" /** * nadp_xdg_dirs_get_data_dirs: * * Returns: the ordered list of data directories, most important first, * as a GSList of newly allocated strings. * * The returned list, along with the pointed out strings, should be * freed by the caller. */ GSList * nadp_xdg_dirs_get_data_dirs( void ) { GSList *listdirs; gchar *userdir; GSList *datadirs; userdir = nadp_xdg_dirs_get_user_data_dir(); listdirs = g_slist_prepend( NULL, userdir ); datadirs = nadp_xdg_dirs_get_system_data_dirs(); listdirs = g_slist_concat( listdirs, datadirs ); return( listdirs ); } /** * nadp_xdg_dirs_get_user_data_dir: * * Returns: the path to the single base directory relative to which * user-specific data files should be written, as a newly allocated * string. * * This directory is defined by the environment variable XDG_DATA_HOME. * It defaults to ~/.local/share. * cf. http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html * * The returned string should be g_free() by the caller. */ gchar * nadp_xdg_dirs_get_user_data_dir( void ) { gchar *dir; dir = g_strdup( g_get_user_data_dir()); return( dir ); } /** * nadp_xdg_dirs_get_system_data_dirs: * * Returns: the set of preference ordered base directories relative to * which data files should be written, as a GSList of newly allocated * strings. * * This set of directories is defined by the environment variable * XDG_DATA_DIRS. It defaults to /usr/local/share:/usr/share. * * source: http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html * * The returned list, along with the pointed out strings, should be freed * by the caller. */ GSList * nadp_xdg_dirs_get_system_data_dirs( void ) { const gchar **dirs; GSList *paths; dirs = ( const gchar ** ) g_get_system_data_dirs(); paths = na_core_utils_slist_from_array( dirs ); return( paths ); } nautilus-actions-3.2.3/src/io-desktop/Makefile.in0000644000175100017500000006741012220365303016661 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/io-desktop DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" \ "$(DESTDIR)$(provider_datadir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = libna_io_desktop_la_DEPENDENCIES = \ $(top_builddir)/src/core/libna-core.la $(am__DEPENDENCIES_1) am_libna_io_desktop_la_OBJECTS = nadp-desktop-file.lo \ nadp-desktop-provider.lo nadp-formats.lo nadp-keys.lo \ nadp-module.lo nadp-monitor.lo nadp-reader.lo nadp-utils.lo \ nadp-writer.lo nadp-xdg-dirs.lo libna_io_desktop_la_OBJECTS = $(am_libna_io_desktop_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libna_io_desktop_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libna_io_desktop_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libna_io_desktop_la_SOURCES) DIST_SOURCES = $(libna_io_desktop_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(provider_data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ -I $(top_srcdir) -I $(top_srcdir)/src \ $(NAUTILUS_ACTIONS_CFLAGS) \ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_IO_DESKTOP}\" \ -DPROVIDER_ID=\"$(provider_id)\" \ -DPROVIDER_DATADIR=\"$(provider_datadir)\" $(NULL) AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ provider_id = na-desktop pkglib_LTLIBRARIES = libna-io-desktop.la provider_datadir = $(pkgdatadir)/$(provider_id) libna_io_desktop_la_SOURCES = \ nadp-desktop-file.c \ nadp-desktop-file.h \ nadp-desktop-provider.c \ nadp-desktop-provider.h \ nadp-formats.c \ nadp-formats.h \ nadp-keys.c \ nadp-keys.h \ nadp-module.c \ nadp-monitor.c \ nadp-monitor.h \ nadp-reader.c \ nadp-reader.h \ nadp-utils.c \ nadp-utils.h \ nadp-writer.c \ nadp-writer.h \ nadp-xdg-dirs.c \ nadp-xdg-dirs.h \ $(NULL) libna_io_desktop_la_LIBADD = \ $(top_builddir)/src/core/libna-core.la \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libna_io_desktop_la_LDFLAGS = \ -module \ -no-undefined \ -avoid-version \ $(NULL) images_files = \ export-desktop.png \ $(NULL) provider_data_DATA = \ $(images_files) \ $(NULL) EXTRA_DIST = \ $(provider_data_DATA) \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/io-desktop/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/io-desktop/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libna-io-desktop.la: $(libna_io_desktop_la_OBJECTS) $(libna_io_desktop_la_DEPENDENCIES) $(EXTRA_libna_io_desktop_la_DEPENDENCIES) $(AM_V_CCLD)$(libna_io_desktop_la_LINK) -rpath $(pkglibdir) $(libna_io_desktop_la_OBJECTS) $(libna_io_desktop_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nadp-desktop-file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nadp-desktop-provider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nadp-formats.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nadp-keys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nadp-module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nadp-monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nadp-reader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nadp-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nadp-writer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nadp-xdg-dirs.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-provider_dataDATA: $(provider_data_DATA) @$(NORMAL_INSTALL) @list='$(provider_data_DATA)'; test -n "$(provider_datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(provider_datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(provider_datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(provider_datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(provider_datadir)" || exit $$?; \ done uninstall-provider_dataDATA: @$(NORMAL_UNINSTALL) @list='$(provider_data_DATA)'; test -n "$(provider_datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(provider_datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(provider_datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-provider_dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES uninstall-provider_dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-provider_dataDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkglibLTLIBRARIES \ uninstall-provider_dataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/src/io-desktop/nadp-writer.c0000644000175100017500000004574412212601376017226 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "nadp-desktop-file.h" #include "nadp-desktop-provider.h" #include "nadp-formats.h" #include "nadp-keys.h" #include "nadp-utils.h" #include "nadp-writer.h" #include "nadp-xdg-dirs.h" /* the association between an export format and the functions */ typedef struct { gchar *format; void *foo; } ExportFormatFn; static ExportFormatFn st_export_format_fn[] = { { NADP_FORMAT_DESKTOP_V1, NULL }, { NULL } }; static guint write_item( const NAIIOProvider *provider, const NAObjectItem *item, NadpDesktopFile *ndf, GSList **messages ); static void desktop_weak_notify( NadpDesktopFile *ndf, GObject *item ); static void write_start_write_type( NadpDesktopFile *ndp, NAObjectItem *item ); static void write_done_write_subitems_list( NadpDesktopFile *ndp, NAObjectItem *item ); static ExportFormatFn *find_export_format_fn( const gchar *format ); #ifdef NA_ENABLE_DEPRECATED static ExportFormatFn *find_export_format_fn_from_quark( GQuark format ); #endif /* * This is implementation of NAIIOProvider::is_willing_to_write method */ gboolean nadp_iio_provider_is_willing_to_write( const NAIIOProvider *provider ) { return( TRUE ); } /* * NadpDesktopProvider is able to write if user data dir exists (or * can be created) and is writable * * This is implementation of NAIIOProvider::is_able_to_write method */ gboolean nadp_iio_provider_is_able_to_write( const NAIIOProvider *provider ) { static const gchar *thisfn = "nadp_writer_iio_provider_is_able_to_write"; gboolean able_to; gchar *userdir; g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), FALSE ); able_to = FALSE; userdir = nadp_xdg_dirs_get_user_data_dir(); if( g_file_test( userdir, G_FILE_TEST_IS_DIR )){ able_to = na_core_utils_dir_is_writable_path( userdir ); } else if( g_mkdir_with_parents( userdir, 0750 )){ g_warning( "%s: %s: %s", thisfn, userdir, g_strerror( errno )); } else { na_core_utils_dir_list_perms( userdir, thisfn ); able_to = na_core_utils_dir_is_writable_path( userdir ); } g_free( userdir ); return( able_to ); } /* * This is implementation of NAIIOProvider::write_item method */ guint nadp_iio_provider_write_item( const NAIIOProvider *provider, const NAObjectItem *item, GSList **messages ) { static const gchar *thisfn = "nadp_iio_provider_write_item"; guint ret; NadpDesktopFile *ndf; gchar *path; gchar *userdir; gchar *id; gchar *bname; GSList *subdirs; gchar *fulldir; gboolean dir_ok; ret = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), ret ); if( na_object_is_readonly( item )){ g_warning( "%s: item=%p is read-only", thisfn, ( void * ) item ); return( ret ); } ndf = ( NadpDesktopFile * ) na_object_get_provider_data( item ); /* write into the current key file and write it to current path */ if( ndf ){ g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), ret ); } else { userdir = nadp_xdg_dirs_get_user_data_dir(); subdirs = na_core_utils_slist_from_split( NADP_DESKTOP_PROVIDER_SUBDIRS, G_SEARCHPATH_SEPARATOR_S ); fulldir = g_build_filename( userdir, ( gchar * ) subdirs->data, NULL ); dir_ok = TRUE; if( !g_file_test( fulldir, G_FILE_TEST_IS_DIR )){ if( g_mkdir_with_parents( fulldir, 0750 )){ g_warning( "%s: %s: %s", thisfn, userdir, g_strerror( errno )); dir_ok = FALSE; } else { na_core_utils_dir_list_perms( userdir, thisfn ); } } g_free( userdir ); na_core_utils_slist_free( subdirs ); if( dir_ok ){ id = na_object_get_id( item ); bname = g_strdup_printf( "%s%s", id, NADP_DESKTOP_FILE_SUFFIX ); g_free( id ); path = g_build_filename( fulldir, bname, NULL ); g_free( bname ); } g_free( fulldir ); if( dir_ok ){ ndf = nadp_desktop_file_new_for_write( path ); na_object_set_provider_data( item, ndf ); g_object_weak_ref( G_OBJECT( item ), ( GWeakNotify ) desktop_weak_notify, ndf ); g_free( path ); } } if( ndf ){ ret = write_item( provider, item, ndf, messages ); } return( ret ); } /* * actually writes the item to the existing NadpDesktopFile * as we have chosen to take advantage of data factory management system * we do not need to enumerate each and every elementary data * * As we want keep comments between through multiple updates, we cannot * just delete the .desktop file and recreate it as we are doing for GConf. * Instead of that, we delete at end groups that have not been walked through * -> as a side effect, we lose comments inside of these groups :( */ static guint write_item( const NAIIOProvider *provider, const NAObjectItem *item, NadpDesktopFile *ndf, GSList **messages ) { static const gchar *thisfn = "nadp_iio_provider_write_item"; guint ret; NadpDesktopProvider *self; g_debug( "%s: provider=%p (%s), item=%p (%s), ndf=%p, messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) item, G_OBJECT_TYPE_NAME( item ), ( void * ) ndf, ( void * ) messages ); ret = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider ), ret ); g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_IFACTORY_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), ret ); g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( item ), ret ); g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), ret ); self = NADP_DESKTOP_PROVIDER( provider ); if( self->private->dispose_has_run ){ return( NA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN ); } ret = NA_IIO_PROVIDER_CODE_OK; na_ifactory_provider_write_item( NA_IFACTORY_PROVIDER( provider ), ndf, NA_IFACTORY_OBJECT( item ), messages ); if( !nadp_desktop_file_write( ndf )){ ret = NA_IIO_PROVIDER_CODE_WRITE_ERROR; } return( ret ); } guint nadp_iio_provider_delete_item( const NAIIOProvider *provider, const NAObjectItem *item, GSList **messages ) { static const gchar *thisfn = "nadp_iio_provider_delete_item"; guint ret; NadpDesktopProvider *self; NadpDesktopFile *ndf; gchar *uri; g_debug( "%s: provider=%p (%s), item=%p (%s), messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) item, G_OBJECT_TYPE_NAME( item ), ( void * ) messages ); ret = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider ), ret ); g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), ret ); self = NADP_DESKTOP_PROVIDER( provider ); if( self->private->dispose_has_run ){ return( NA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN ); } ndf = ( NadpDesktopFile * ) na_object_get_provider_data( item ); if( ndf ){ g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), ret ); uri = nadp_desktop_file_get_key_file_uri( ndf ); if( nadp_utils_uri_delete( uri )){ ret = NA_IIO_PROVIDER_CODE_OK; } g_free( uri ); } else { g_warning( "%s: NadpDesktopFile is null", thisfn ); ret = NA_IIO_PROVIDER_CODE_OK; } return( ret ); } static void desktop_weak_notify( NadpDesktopFile *ndf, GObject *item ) { static const gchar *thisfn = "nadp_writer_desktop_weak_notify"; g_debug( "%s: ndf=%p (%s), item=%p (%s)", thisfn, ( void * ) ndf, G_OBJECT_TYPE_NAME( ndf ), ( void * ) item, G_OBJECT_TYPE_NAME( item )); g_object_unref( ndf ); } /* * Implementation of NAIIOProvider::duplicate_data * Add a ref on NadpDesktopFile data, so that unreffing origin object in NACT * does not invalid duplicated pointer */ guint nadp_iio_provider_duplicate_data( const NAIIOProvider *provider, NAObjectItem *dest, const NAObjectItem *source, GSList **messages ) { static const gchar *thisfn = "nadp_iio_provider_duplicate_data"; guint ret; NadpDesktopProvider *self; NadpDesktopFile *ndf; g_debug( "%s: provider=%p (%s), dest=%p (%s), source=%p (%s), messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) dest, G_OBJECT_TYPE_NAME( dest ), ( void * ) source, G_OBJECT_TYPE_NAME( source ), ( void * ) messages ); ret = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider ), ret ); g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( dest ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( source ), ret ); self = NADP_DESKTOP_PROVIDER( provider ); if( self->private->dispose_has_run ){ return( NA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN ); } ndf = ( NadpDesktopFile * ) na_object_get_provider_data( source ); g_return_val_if_fail( ndf && NADP_IS_DESKTOP_FILE( ndf ), ret ); na_object_set_provider_data( dest, g_object_ref( ndf )); g_object_weak_ref( G_OBJECT( dest ), ( GWeakNotify ) desktop_weak_notify, ndf ); return( NA_IIO_PROVIDER_CODE_OK ); } /** * nadp_writer_iexporter_export_to_buffer: * @instance: this #NAIExporter instance. * @parms: a #NAIExporterBufferParmsv2 structure. * * Export the specified 'item' to a newly allocated buffer. */ guint nadp_writer_iexporter_export_to_buffer( const NAIExporter *instance, NAIExporterBufferParmsv2 *parms ) { static const gchar *thisfn = "nadp_writer_iexporter_export_to_buffer"; guint code, write_code; ExportFormatFn *fmt; GKeyFile *key_file; NadpDesktopFile *ndf; g_debug( "%s: instance=%p, parms=%p", thisfn, ( void * ) instance, ( void * ) parms ); parms->buffer = NULL; code = NA_IEXPORTER_CODE_OK; if( !parms->exported || !NA_IS_OBJECT_ITEM( parms->exported )){ code = NA_IEXPORTER_CODE_INVALID_ITEM; } if( code == NA_IEXPORTER_CODE_OK ){ #ifdef NA_ENABLE_DEPRECATED if( parms->version == 1 ){ fmt = find_export_format_fn_from_quark((( NAIExporterBufferParms * ) parms )->format ); } else { fmt = find_export_format_fn( parms->format ); } #else fmt = find_export_format_fn( parms->format ); #endif if( !fmt ){ code = NA_IEXPORTER_CODE_INVALID_FORMAT; } else { ndf = nadp_desktop_file_new(); write_code = na_ifactory_provider_write_item( NA_IFACTORY_PROVIDER( instance ), ndf, NA_IFACTORY_OBJECT( parms->exported ), &parms->messages ); if( write_code != NA_IIO_PROVIDER_CODE_OK ){ code = NA_IEXPORTER_CODE_ERROR; } else { key_file = nadp_desktop_file_get_key_file( ndf ); parms->buffer = g_key_file_to_data( key_file, NULL, NULL ); } g_object_unref( ndf ); } } g_debug( "%s: returning code=%u", thisfn, code ); return( code ); } /** * nadp_writer_iexporter_export_to_file: * @instance: this #NAIExporter instance. * @parms: a #NAIExporterFileParmsv2 structure. * * Export the specified 'item' to a newly created file. */ guint nadp_writer_iexporter_export_to_file( const NAIExporter *instance, NAIExporterFileParmsv2 *parms ) { static const gchar *thisfn = "nadp_writer_iexporter_export_to_file"; guint code, write_code; gchar *id, *folder_path, *dest_path; ExportFormatFn *fmt; NadpDesktopFile *ndf; g_debug( "%s: instance=%p, parms=%p", thisfn, ( void * ) instance, ( void * ) parms ); parms->basename = NULL; code = NA_IEXPORTER_CODE_OK; if( !parms->exported || !NA_IS_OBJECT_ITEM( parms->exported )){ code = NA_IEXPORTER_CODE_INVALID_ITEM; } if( code == NA_IEXPORTER_CODE_OK ){ #ifdef NA_ENABLE_DEPRECATED if( parms->version == 1 ){ fmt = find_export_format_fn_from_quark((( NAIExporterFileParms * ) parms )->format ); } else { fmt = find_export_format_fn( parms->format ); } #else fmt = find_export_format_fn( parms->format ); #endif if( !fmt ){ code = NA_IEXPORTER_CODE_INVALID_FORMAT; } else { id = na_object_get_id( parms->exported ); parms->basename = g_strdup_printf( "%s%s", id, NADP_DESKTOP_FILE_SUFFIX ); g_free( id ); folder_path = g_filename_from_uri( parms->folder, NULL, NULL ); dest_path = g_strdup_printf( "%s/%s", folder_path, parms->basename ); g_free( folder_path ); ndf = nadp_desktop_file_new_for_write( dest_path ); write_code = na_ifactory_provider_write_item( NA_IFACTORY_PROVIDER( instance ), ndf, NA_IFACTORY_OBJECT( parms->exported ), &parms->messages ); if( write_code != NA_IIO_PROVIDER_CODE_OK ){ code = NA_IEXPORTER_CODE_ERROR; } else if( !nadp_desktop_file_write( ndf )){ code = NA_IEXPORTER_CODE_UNABLE_TO_WRITE; } g_free( dest_path ); g_object_unref( ndf ); } } g_debug( "%s: returning code=%u", thisfn, code ); return( code ); } guint nadp_writer_ifactory_provider_write_start( const NAIFactoryProvider *provider, void *writer_data, const NAIFactoryObject *object, GSList **messages ) { if( NA_IS_OBJECT_ITEM( object )){ write_start_write_type( NADP_DESKTOP_FILE( writer_data ), NA_OBJECT_ITEM( object )); } return( NA_IIO_PROVIDER_CODE_OK ); } static void write_start_write_type( NadpDesktopFile *ndp, NAObjectItem *item ) { nadp_desktop_file_set_string( ndp, NADP_GROUP_DESKTOP, NADP_KEY_TYPE, NA_IS_OBJECT_ACTION( item ) ? NADP_VALUE_TYPE_ACTION : NADP_VALUE_TYPE_MENU ); } /* * when writing to .desktop file a profile which has both a path and parameters, * then concatenate these two fields to the 'Exec' key */ guint nadp_writer_ifactory_provider_write_data( const NAIFactoryProvider *provider, void *writer_data, const NAIFactoryObject *object, const NADataBoxed *boxed, GSList **messages ) { static const gchar *thisfn = "nadp_writer_ifactory_provider_write_data"; NadpDesktopFile *ndf; guint code; const NADataDef *def; gchar *profile_id; gchar *group_name; gchar *str_value; gboolean bool_value; GSList *slist_value; guint uint_value; gchar *parms, *tmp; g_return_val_if_fail( NADP_IS_DESKTOP_FILE( writer_data ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); /*g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ));*/ code = NA_IIO_PROVIDER_CODE_OK; ndf = NADP_DESKTOP_FILE( writer_data ); def = na_data_boxed_get_data_def( boxed ); if( def->desktop_entry && strlen( def->desktop_entry )){ if( NA_IS_OBJECT_PROFILE( object )){ profile_id = na_object_get_id( object ); group_name = g_strdup_printf( "%s %s", NADP_GROUP_PROFILE, profile_id ); g_free( profile_id ); } else { group_name = g_strdup( NADP_GROUP_DESKTOP ); } if( !na_data_boxed_is_default( boxed ) || def->write_if_default ){ switch( def->type ){ case NA_DATA_TYPE_STRING: str_value = na_boxed_get_string( NA_BOXED( boxed )); if( !strcmp( def->name, NAFO_DATA_PATH )){ parms = na_object_get_parameters( object ); tmp = g_strdup_printf( "%s %s", str_value, parms ); g_free( str_value ); g_free( parms ); str_value = tmp; } nadp_desktop_file_set_string( ndf, group_name, def->desktop_entry, str_value ); g_free( str_value ); break; case NA_DATA_TYPE_LOCALE_STRING: str_value = na_boxed_get_string( NA_BOXED( boxed )); nadp_desktop_file_set_locale_string( ndf, group_name, def->desktop_entry, str_value ); g_free( str_value ); break; case NA_DATA_TYPE_BOOLEAN: bool_value = GPOINTER_TO_UINT( na_boxed_get_as_void( NA_BOXED( boxed ))); nadp_desktop_file_set_boolean( ndf, group_name, def->desktop_entry, bool_value ); break; case NA_DATA_TYPE_STRING_LIST: slist_value = ( GSList * ) na_boxed_get_as_void( NA_BOXED( boxed )); nadp_desktop_file_set_string_list( ndf, group_name, def->desktop_entry, slist_value ); na_core_utils_slist_free( slist_value ); break; case NA_DATA_TYPE_UINT: uint_value = GPOINTER_TO_UINT( na_boxed_get_as_void( NA_BOXED( boxed ))); nadp_desktop_file_set_uint( ndf, group_name, def->desktop_entry, uint_value ); break; default: g_warning( "%s: unknown type=%u for %s", thisfn, def->type, def->name ); code = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; } } else { nadp_desktop_file_remove_key( ndf, group_name, def->desktop_entry ); } g_free( group_name ); } return( code ); } guint nadp_writer_ifactory_provider_write_done( const NAIFactoryProvider *provider, void *writer_data, const NAIFactoryObject *object, GSList **messages ) { if( NA_IS_OBJECT_ITEM( object )){ write_done_write_subitems_list( NADP_DESKTOP_FILE( writer_data ), NA_OBJECT_ITEM( object )); } return( NA_IIO_PROVIDER_CODE_OK ); } static void write_done_write_subitems_list( NadpDesktopFile *ndp, NAObjectItem *item ) { static const gchar *thisfn = "nadp_writer_write_done_write_subitems_list"; GSList *subitems; GSList *profile_groups, *ip; gchar *tmp; subitems = na_object_get_items_slist( item ); tmp = g_strdup_printf( "%s (written subitems)", thisfn ); na_core_utils_slist_dump( tmp, subitems ); g_free( tmp ); nadp_desktop_file_set_string_list( ndp, NADP_GROUP_DESKTOP, NA_IS_OBJECT_ACTION( item ) ? NADP_KEY_PROFILES : NADP_KEY_ITEMS_LIST, subitems ); profile_groups = nadp_desktop_file_get_profiles( ndp ); tmp = g_strdup_printf( "%s (existing profiles)", thisfn ); na_core_utils_slist_dump( tmp, profile_groups ); g_free( tmp ); for( ip = profile_groups ; ip ; ip = ip->next ){ if( na_core_utils_slist_count( subitems, ( const gchar * ) ip->data ) == 0 ){ g_debug( "%s: deleting (removed) profile %s", thisfn, ( const gchar * ) ip->data ); nadp_desktop_file_remove_profile( ndp, ( const gchar * ) ip->data ); } } na_core_utils_slist_free( profile_groups ); na_core_utils_slist_free( subitems ); } static ExportFormatFn * find_export_format_fn( const gchar *format ) { ExportFormatFn *found; ExportFormatFn *i; found = NULL; i = st_export_format_fn; while( i->format && !found ){ if( !strcmp( i->format, format )){ found = i; } i++; } return( found ); } #ifdef NA_ENABLE_DEPRECATED static ExportFormatFn * find_export_format_fn_from_quark( GQuark format ) { ExportFormatFn *found; ExportFormatFn *i; found = NULL; i = st_export_format_fn; while( i->format && !found ){ if( g_quark_from_string( i->format ) == format ){ found = i; } i++; } return( found ); } #endif nautilus-actions-3.2.3/src/io-desktop/nadp-monitor.h0000644000175100017500000000577212212601376017403 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NADP_MONITOR_H__ #define __NADP_MONITOR_H__ /** * SECTION: nadp_monitor * @short_description: #NadpMonitor class definition. * @include: nadp-monitor.h * * This class manages monitoring on .desktop files and directories. * We also put a monitor on directories which do not exist, to be * triggered when a file is dropped there. * * During tests of GIO monitoring, we don't have found any case where a * file monitor would be triggered without the parent directory monitor * has been itself triggered. We, so only monitor directories (not files). * More, as several events may be triggered for one user modification, * we try to factorize all monitor events before advertizing NAPivot. */ #include "nadp-desktop-provider.h" G_BEGIN_DECLS #define NADP_TYPE_MONITOR ( nadp_monitor_get_type()) #define NADP_MONITOR( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NADP_TYPE_MONITOR, NadpMonitor )) #define NADP_MONITOR_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NADP_TYPE_MONITOR, NadpMonitorClass )) #define NADP_IS_MONITOR( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NADP_TYPE_MONITOR )) #define NADP_IS_MONITOR_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NADP_TYPE_MONITOR )) #define NADP_MONITOR_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NADP_TYPE_MONITOR, NadpMonitorClass )) typedef struct _NadpMonitorPrivate NadpMonitorPrivate; typedef struct { /*< private >*/ GObject parent; NadpMonitorPrivate *private; } NadpMonitor; typedef struct _NadpMonitorClassPrivate NadpMonitorClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NadpMonitorClassPrivate *private; } NadpMonitorClass; GType nadp_monitor_get_type( void ); NadpMonitor *nadp_monitor_new( const NadpDesktopProvider *provider, const gchar *path ); G_END_DECLS #endif /* __NADP_MONITOR_H__ */ nautilus-actions-3.2.3/src/io-desktop/nadp-desktop-file.h0000644000175100017500000001262312212601376020273 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NADP_DESKTOP_FILE_H__ #define __NADP_DESKTOP_FILE_H__ /** * SECTION: nadp_desktop_file * @short_description: #NadpDesktopFile class definition. * @include: nadp-desktop-file.h * * This class encapŝulates the EggDesktopFile structure, adding some * private properties. An instance of this class is associated with * every #NAObjectItem for this provider. */ #include G_BEGIN_DECLS #define NADP_TYPE_DESKTOP_FILE ( nadp_desktop_file_get_type()) #define NADP_DESKTOP_FILE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NADP_TYPE_DESKTOP_FILE, NadpDesktopFile )) #define NADP_DESKTOP_FILE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NADP_TYPE_DESKTOP_FILE, NadpDesktopFileClass )) #define NADP_IS_DESKTOP_FILE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NADP_TYPE_DESKTOP_FILE )) #define NADP_IS_DESKTOP_FILE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NADP_TYPE_DESKTOP_FILE )) #define NADP_DESKTOP_FILE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NADP_TYPE_DESKTOP_FILE, NadpDesktopFileClass )) typedef struct _NadpDesktopFilePrivate NadpDesktopFilePrivate; typedef struct { /*< private >*/ GObject parent; NadpDesktopFilePrivate *private; } NadpDesktopFile; typedef struct _NadpDesktopFileClassPrivate NadpDesktopFileClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NadpDesktopFileClassPrivate *private; } NadpDesktopFileClass; /* standard suffix for desktop files */ #define NADP_DESKTOP_FILE_SUFFIX ".desktop" GType nadp_desktop_file_get_type ( void ); NadpDesktopFile *nadp_desktop_file_new ( void ); NadpDesktopFile *nadp_desktop_file_new_from_path ( const gchar *path ); NadpDesktopFile *nadp_desktop_file_new_from_uri ( const gchar *uri ); NadpDesktopFile *nadp_desktop_file_new_for_write ( const gchar *path ); GKeyFile *nadp_desktop_file_get_key_file ( const NadpDesktopFile *ndf ); gchar *nadp_desktop_file_get_key_file_uri ( const NadpDesktopFile *ndf ); gboolean nadp_desktop_file_write ( NadpDesktopFile *ndf ); gchar *nadp_desktop_file_get_file_type ( const NadpDesktopFile *ndf ); gchar *nadp_desktop_file_get_id ( const NadpDesktopFile *ndf ); GSList *nadp_desktop_file_get_profiles ( const NadpDesktopFile *ndf ); gboolean nadp_desktop_file_has_profile ( const NadpDesktopFile *ndf, const gchar *profile_id ); void nadp_desktop_file_remove_key ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key ); void nadp_desktop_file_remove_profile ( const NadpDesktopFile *ndf, const gchar *profile_id ); gboolean nadp_desktop_file_get_boolean ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, gboolean *key_found, gboolean default_value ); gchar *nadp_desktop_file_get_locale_string( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, gboolean *key_found, const gchar *default_value ); gchar *nadp_desktop_file_get_string ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, gboolean *key_found, const gchar *default_value ); GSList *nadp_desktop_file_get_string_list ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, gboolean *key_found, const gchar *default_value ); guint nadp_desktop_file_get_uint ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, gboolean *key_found, guint default_value ); void nadp_desktop_file_set_boolean ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, gboolean value ); void nadp_desktop_file_set_locale_string( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, const gchar *value ); void nadp_desktop_file_set_string ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, const gchar *value ); void nadp_desktop_file_set_string_list ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, GSList *value ); void nadp_desktop_file_set_uint ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, guint value ); G_END_DECLS #endif /* __NADP_DESKTOP_FILE_H__ */ nautilus-actions-3.2.3/src/plugin-menu/0000755000175100017500000000000012220365533015053 500000000000000nautilus-actions-3.2.3/src/plugin-menu/nautilus-module.c0000644000175100017500000001130012213237662020264 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "nautilus-actions.h" static void set_log_handler( void ); static void log_handler( const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data ); static GLogFunc st_default_log_func = NULL; /* * A nautilus extension must implement three functions : * * - nautilus_module_initialize * - nautilus_module_list_types * - nautilus_module_shutdown * * The first two functions are called at nautilus startup. * * The prototypes for these functions are defined in nautilus-extension-types.h */ void nautilus_module_initialize( GTypeModule *module ) { static const gchar *thisfn = "nautilus_module_initialize"; syslog( LOG_USER | LOG_INFO, "[N-A] %s Menu Extender %s initializing...", PACKAGE_NAME, PACKAGE_VERSION ); set_log_handler(); g_debug( "%s: module=%p", thisfn, ( void * ) module ); g_type_module_set_name( module, PACKAGE_STRING ); /* pwi 2011-01-05 * run GConf migration tools before doing anything else * above all before allocating a new NAPivot */ na_gconf_migration_run(); nautilus_actions_register_type( module ); } void nautilus_module_list_types( const GType **types, int *num_types ) { static const gchar *thisfn = "nautilus_module_list_types"; static GType type_list[1]; g_debug( "%s: types=%p, num_types=%p", thisfn, ( void * ) types, ( void * ) num_types ); type_list[0] = NAUTILUS_ACTIONS_TYPE; *types = type_list; *num_types = 1; /* this may let us some time to attach nautilus to the debugger :) */ /*sleep( 60 ); */ } void nautilus_module_shutdown( void ) { static const gchar *thisfn = "nautilus_module_shutdown"; g_debug( "%s", thisfn ); /* remove the log handler * almost useless as the process is nonetheless terminating at this time * but this is the art of coding... */ if( st_default_log_func ){ g_log_set_default_handler( st_default_log_func, NULL ); st_default_log_func = NULL; } } /* * a log handler that we install when in development mode in order to be * able to log plugin runtime * * enabling log in the plugin menu at runtime requires a Nautilus restart * (because we need to run in the code, which embeds g_debug instructions, * and we have to do so before the log handler be set, or we will run * into a deep stack recursion) */ static void set_log_handler( void ) { gboolean is_log_enabled; #ifdef NA_MAINTAINER_MODE is_log_enabled = TRUE; #else is_log_enabled = g_getenv( NAUTILUS_ACTIONS_DEBUG ) || na_settings_get_boolean( NA_IPREFS_PLUGIN_MENU_LOG, NULL, NULL ); #endif st_default_log_func = g_log_set_default_handler(( GLogFunc ) log_handler, GUINT_TO_POINTER( is_log_enabled )); } /* * we used to install a log handler for each and every log domain used * in Nautilus-Actions ; this led to a fastidious enumeration * instead we install a default log handler which will receive all * debug messages, i.e. not only from N-A, but also from other code * in the Nautilus process */ static void log_handler( const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data ) { gchar *tmp; gboolean is_log_enabled; is_log_enabled = ( gboolean ) GPOINTER_TO_UINT( user_data ); if( is_log_enabled ){ tmp = g_strdup( "" ); if( log_domain && strlen( log_domain )){ g_free( tmp ); tmp = g_strdup_printf( "[%s] ", log_domain ); } syslog( LOG_USER | LOG_DEBUG, "%s%s", tmp, message ); g_free( tmp ); } } nautilus-actions-3.2.3/src/plugin-menu/nautilus-actions.c0000644000175100017500000007704412214143655020457 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "nautilus-actions.h" /* private class data */ struct _NautilusActionsClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NautilusActionsPrivate { gboolean dispose_has_run; NAPivot *pivot; gulong items_changed_handler; gulong settings_changed_handler; NATimeout change_timeout; }; static GObjectClass *st_parent_class = NULL; static GType st_actions_type = 0; static gint st_burst_timeout = 100; /* burst timeout in msec */ static void class_init( NautilusActionsClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_constructed( GObject *object ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void menu_provider_iface_init( NautilusMenuProviderIface *iface ); static GList *menu_provider_get_background_items( NautilusMenuProvider *provider, GtkWidget *window, NautilusFileInfo *current_folder ); static GList *menu_provider_get_file_items( NautilusMenuProvider *provider, GtkWidget *window, GList *files ); #ifdef HAVE_NAUTILUS_MENU_PROVIDER_GET_TOOLBAR_ITEMS static GList *menu_provider_get_toolbar_items( NautilusMenuProvider *provider, GtkWidget *window, NautilusFileInfo *current_folder ); #endif static GList *build_nautilus_menu( NautilusActions *plugin, guint target, GList *selection ); static GList *build_nautilus_menu_rec( GList *tree, guint target, GList *selection, NATokens *tokens ); static NAObjectItem *expand_tokens_item( const NAObjectItem *item, NATokens *tokens ); static void expand_tokens_context( NAIContext *context, NATokens *tokens ); static NAObjectProfile *get_candidate_profile( NAObjectAction *action, guint target, GList *files ); static NautilusMenuItem *create_item_from_profile( NAObjectProfile *profile, guint target, GList *files, NATokens *tokens ); static NautilusMenuItem *create_item_from_menu( NAObjectMenu *menu, GList *subitems, guint target ); static NautilusMenuItem *create_menu_item( const NAObjectItem *item, guint target ); static void weak_notify_menu_item( void *user_data /* =NULL */, NautilusMenuItem *item ); static void attach_submenu_to_item( NautilusMenuItem *item, GList *subitems ); static void weak_notify_profile( NAObjectProfile *profile, NautilusMenuItem *item ); static void execute_action( NautilusMenuItem *item, NAObjectProfile *profile ); static GList *create_root_menu( NautilusActions *plugin, GList *nautilus_menu ); static GList *add_about_item( NautilusActions *plugin, GList *nautilus_menu ); static void execute_about( NautilusMenuItem *item, NautilusActions *plugin ); static void on_pivot_items_changed_handler( NAPivot *pivot, NautilusActions *plugin ); static void on_settings_key_changed_handler( const gchar *group, const gchar *key, gconstpointer new_value, gboolean mandatory, NautilusActions *plugin ); static void on_change_event_timeout( NautilusActions *plugin ); GType nautilus_actions_get_type( void ) { g_assert( st_actions_type ); return( st_actions_type ); } void nautilus_actions_register_type( GTypeModule *module ) { static const gchar *thisfn = "nautilus_actions_register_type"; static const GTypeInfo info = { sizeof( NautilusActionsClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NautilusActions ), 0, ( GInstanceInitFunc ) instance_init, }; static const GInterfaceInfo menu_provider_iface_info = { ( GInterfaceInitFunc ) menu_provider_iface_init, NULL, NULL }; g_assert( st_actions_type == 0 ); g_debug( "%s: module=%p", thisfn, ( void * ) module ); st_actions_type = g_type_module_register_type( module, G_TYPE_OBJECT, "NautilusActions", &info, 0 ); g_type_module_add_interface( module, st_actions_type, NAUTILUS_TYPE_MENU_PROVIDER, &menu_provider_iface_info ); } static void class_init( NautilusActionsClass *klass ) { static const gchar *thisfn = "nautilus_actions_class_init"; GObjectClass *gobject_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); gobject_class = G_OBJECT_CLASS( klass ); gobject_class->constructed = instance_constructed; gobject_class->dispose = instance_dispose; gobject_class->finalize = instance_finalize; klass->private = g_new0( NautilusActionsClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "nautilus_actions_instance_init"; NautilusActions *self; g_return_if_fail( NAUTILUS_IS_ACTIONS( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NAUTILUS_ACTIONS( instance ); self->private = g_new0( NautilusActionsPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->change_timeout.timeout = st_burst_timeout; self->private->change_timeout.handler = ( NATimeoutFunc ) on_change_event_timeout; self->private->change_timeout.user_data = self; self->private->change_timeout.source_id = 0; } /* * Runtime modification management: * We have to react to some runtime environment modifications: * * - whether the items list has changed (we have to reload a new pivot) * > registering for notifications against NAPivot * * - whether to add the 'About Nautilus-Actions' item * - whether to create a 'Nautilus-Actions actions' root menu * > registering for notifications against NASettings */ static void instance_constructed( GObject *object ) { static const gchar *thisfn = "nautilus_actions_instance_constructed"; NautilusActionsPrivate *priv; g_return_if_fail( NAUTILUS_IS_ACTIONS( object )); priv = NAUTILUS_ACTIONS( object )->private; if( !priv->dispose_has_run ){ /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->constructed ){ G_OBJECT_CLASS( st_parent_class )->constructed( object ); } g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); priv->pivot = na_pivot_new(); /* setup NAPivot properties before loading items */ na_pivot_set_loadable( priv->pivot, !PIVOT_LOAD_DISABLED & !PIVOT_LOAD_INVALID ); na_pivot_load_items( priv->pivot ); /* register against NAPivot to be notified of items changes */ priv->items_changed_handler = g_signal_connect( priv->pivot, PIVOT_SIGNAL_ITEMS_CHANGED, G_CALLBACK( on_pivot_items_changed_handler ), object ); /* register against NASettings to be notified of changes on * our runtime preferences * because we only monitor here a few runtime keys, we prefer the * callback way that the signal one */ na_settings_register_key_callback( NA_IPREFS_IO_PROVIDERS_READ_STATUS, G_CALLBACK( on_settings_key_changed_handler ), object ); na_settings_register_key_callback( NA_IPREFS_ITEMS_ADD_ABOUT_ITEM, G_CALLBACK( on_settings_key_changed_handler ), object ); na_settings_register_key_callback( NA_IPREFS_ITEMS_CREATE_ROOT_MENU, G_CALLBACK( on_settings_key_changed_handler ), object ); na_settings_register_key_callback( NA_IPREFS_ITEMS_LEVEL_ZERO_ORDER, G_CALLBACK( on_settings_key_changed_handler ), object ); na_settings_register_key_callback( NA_IPREFS_ITEMS_LIST_ORDER_MODE, G_CALLBACK( on_settings_key_changed_handler ), object ); } } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "nautilus_actions_instance_dispose"; NautilusActions *self; g_debug( "%s: object=%p", thisfn, ( void * ) object ); g_return_if_fail( NAUTILUS_IS_ACTIONS( object )); self = NAUTILUS_ACTIONS( object ); if( !self->private->dispose_has_run ){ self->private->dispose_has_run = TRUE; if( self->private->items_changed_handler ){ g_signal_handler_disconnect( self->private->pivot, self->private->items_changed_handler ); } g_object_unref( self->private->pivot ); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "nautilus_actions_instance_finalize"; NautilusActions *self; g_debug( "%s: object=%p", thisfn, ( void * ) object ); g_return_if_fail( NAUTILUS_IS_ACTIONS( object )); self = NAUTILUS_ACTIONS( object ); g_free( self->private ); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static void menu_provider_iface_init( NautilusMenuProviderIface *iface ) { static const gchar *thisfn = "nautilus_actions_menu_provider_iface_init"; g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); iface->get_file_items = menu_provider_get_file_items; iface->get_background_items = menu_provider_get_background_items; #ifdef HAVE_NAUTILUS_MENU_PROVIDER_GET_TOOLBAR_ITEMS iface->get_toolbar_items = menu_provider_get_toolbar_items; #endif } /* * this function is called when nautilus has to paint a folder background * one of the first calls is with current_folder = 'x-nautilus-desktop:///' * the menu items are available : * a) in File menu * b) in contextual menu of the folder if there is no current selection * * get_background_items is very similar, from the user point of view, to * get_file_items when: * - either there is zero item selected - current_folder should so be the * folder currently displayed in the file manager view * - or when there is only one selected directory * * Note that 'x-nautilus-desktop:///' cannot be interpreted by * #NASelectedInfo::query_file_attributes() function. It so never participate * to the display of actions. */ static GList * menu_provider_get_background_items( NautilusMenuProvider *provider, GtkWidget *window, NautilusFileInfo *current_folder ) { static const gchar *thisfn = "nautilus_actions_menu_provider_get_background_items"; GList *nautilus_menus_list = NULL; gchar *uri; GList *selected; g_return_val_if_fail( NAUTILUS_IS_ACTIONS( provider ), NULL ); if( !NAUTILUS_ACTIONS( provider )->private->dispose_has_run ){ selected = na_selected_info_get_list_from_item( current_folder ); if( selected ){ uri = nautilus_file_info_get_uri( current_folder ); g_debug( "%s: provider=%p, window=%p, current_folder=%p (%s)", thisfn, ( void * ) provider, ( void * ) window, ( void * ) current_folder, uri ); g_free( uri ); nautilus_menus_list = build_nautilus_menu( NAUTILUS_ACTIONS( provider ), ITEM_TARGET_LOCATION, selected ); na_selected_info_free_list( selected ); } } return( nautilus_menus_list ); } /* * this function is called each time the selection changed * menus items are available : * a) in Edit menu while the selection stays unchanged * b) in contextual menu while the selection stays unchanged */ static GList * menu_provider_get_file_items( NautilusMenuProvider *provider, GtkWidget *window, GList *files ) { static const gchar *thisfn = "nautilus_actions_menu_provider_get_file_items"; GList *nautilus_menus_list = NULL; GList *selected; g_return_val_if_fail( NAUTILUS_IS_ACTIONS( provider ), NULL ); if( !NAUTILUS_ACTIONS( provider )->private->dispose_has_run ){ /* no need to go further if there is no files in the list */ if( !g_list_length( files )){ return(( GList * ) NULL ); } selected = na_selected_info_get_list_from_list(( GList * ) files ); if( selected ){ g_debug( "%s: provider=%p, window=%p, files=%p, count=%d", thisfn, ( void * ) provider, ( void * ) window, ( void * ) files, g_list_length( files )); #ifdef NA_MAINTAINER_MODE GList *im; for( im = files ; im ; im = im->next ){ gchar *uri = nautilus_file_info_get_uri( NAUTILUS_FILE_INFO( im->data )); gchar *mimetype = nautilus_file_info_get_mime_type( NAUTILUS_FILE_INFO( im->data )); g_debug( "%s: uri='%s', mimetype='%s'", thisfn, uri, mimetype ); g_free( mimetype ); g_free( uri ); } #endif nautilus_menus_list = build_nautilus_menu( NAUTILUS_ACTIONS( provider ), ITEM_TARGET_SELECTION, selected ); na_selected_info_free_list( selected ); } } return( nautilus_menus_list ); } #ifdef HAVE_NAUTILUS_MENU_PROVIDER_GET_TOOLBAR_ITEMS /* * as of 2.26, this function is only called for folders, but for the * desktop (x-nautilus-desktop:///) which seems to be only called by * get_background_items ; also, only actions (not menus) are displayed * * the API is removed starting with Nautilus 2.91.90 */ static GList * menu_provider_get_toolbar_items( NautilusMenuProvider *provider, GtkWidget *window, NautilusFileInfo *current_folder ) { static const gchar *thisfn = "nautilus_actions_menu_provider_get_toolbar_items"; GList *nautilus_menus_list = NULL; gchar *uri; GList *selected; g_return_val_if_fail( NAUTILUS_IS_ACTIONS( provider ), NULL ); if( !NAUTILUS_ACTIONS( provider )->private->dispose_has_run ){ selected = na_selected_info_get_list_from_item( current_folder ); if( selected ){ uri = nautilus_file_info_get_uri( current_folder ); g_debug( "%s: provider=%p, window=%p, current_folder=%p (%s)", thisfn, ( void * ) provider, ( void * ) window, ( void * ) current_folder, uri ); g_free( uri ); nautilus_menus_list = build_nautilus_menu( NAUTILUS_ACTIONS( provider ), ITEM_TARGET_TOOLBAR, selected ); na_selected_info_free_list( selected ); } } return( nautilus_menus_list ); } #endif /* * build_nautilus_menu: * @target: whether the menu targets a location (a folder) or a selection * (the list of currently selected items in the file manager) * @selection: a list of NASelectedInfo, with: * - only one item if a location * - one item by selected file manager item, if a selection. * Note: a NASelectedInfo is just a sort of NautilusFileInfo, with * some added APIs. * * Build the Nautilus menu as a list of NautilusMenuItem items * * Returns: the Nautilus menu */ static GList * build_nautilus_menu( NautilusActions *plugin, guint target, GList *selection ) { GList *nautilus_menu; NATokens *tokens; GList *tree; gboolean items_add_about_item; gboolean items_create_root_menu; g_return_val_if_fail( NA_IS_PIVOT( plugin->private->pivot ), NULL ); tokens = na_tokens_new_from_selection( selection ); tree = na_pivot_get_items( plugin->private->pivot ); nautilus_menu = build_nautilus_menu_rec( tree, target, selection, tokens ); /* the NATokens object has been attached (and reffed) by each found * candidate profile, so it will be actually finalized only on actual * NautilusMenu finalization itself */ g_object_unref( tokens ); if( target != ITEM_TARGET_TOOLBAR && nautilus_menu && g_list_length( nautilus_menu )){ items_create_root_menu = na_settings_get_boolean( NA_IPREFS_ITEMS_CREATE_ROOT_MENU, NULL, NULL ); if( items_create_root_menu ){ nautilus_menu = create_root_menu( plugin, nautilus_menu ); items_add_about_item = na_settings_get_boolean( NA_IPREFS_ITEMS_ADD_ABOUT_ITEM, NULL, NULL ); if( items_add_about_item ){ nautilus_menu = add_about_item( plugin, nautilus_menu ); } } } return( nautilus_menu ); } static GList * build_nautilus_menu_rec( GList *tree, guint target, GList *selection, NATokens *tokens ) { static const gchar *thisfn = "nautilus_actions_build_nautilus_menu_rec"; GList *nautilus_menu; GList *it; GList *subitems; NAObjectItem *item; GList *submenu; NAObjectProfile *profile; NautilusMenuItem *menu_item; gchar *label; nautilus_menu = NULL; for( it = tree ; it ; it = it->next ){ g_return_val_if_fail( NA_IS_OBJECT_ITEM( it->data ), NULL ); label = na_object_get_label( it->data ); g_debug( "%s: examining %s", thisfn, label ); if( !na_icontext_is_candidate( NA_ICONTEXT( it->data ), target, selection )){ g_debug( "%s: is not candidate (NAIContext): %s", thisfn, label ); g_free( label ); continue; } item = expand_tokens_item( NA_OBJECT_ITEM( it->data ), tokens ); /* but we have to re-check for validity as a label may become * dynamically empty - thus the NAObjectItem invalid :( */ if( !na_object_is_valid( item )){ g_debug( "%s: item %s becomes invalid after tokens expansion", thisfn, label ); g_object_unref( item ); g_free( label ); continue; } /* recursively build sub-menus * the 'submenu' menu of nautilusMenuItem's is attached to the returned * 'item' */ if( NA_IS_OBJECT_MENU( it->data )){ subitems = na_object_get_items( NA_OBJECT( it->data )); g_debug( "%s: menu has %d items", thisfn, g_list_length( subitems )); submenu = build_nautilus_menu_rec( subitems, target, selection, tokens ); g_debug( "%s: submenu has %d items", thisfn, g_list_length( submenu )); if( submenu ){ if( target == ITEM_TARGET_TOOLBAR ){ nautilus_menu = g_list_concat( nautilus_menu, submenu ); } else { menu_item = create_item_from_menu( NA_OBJECT_MENU( item ), submenu, target ); nautilus_menu = g_list_append( nautilus_menu, menu_item ); } } g_object_unref( item ); g_free( label ); continue; } g_return_val_if_fail( NA_IS_OBJECT_ACTION( item ), NULL ); /* if we have an action, searches for a candidate profile */ profile = get_candidate_profile( NA_OBJECT_ACTION( item ), target, selection ); if( profile ){ menu_item = create_item_from_profile( profile, target, selection, tokens ); nautilus_menu = g_list_append( nautilus_menu, menu_item ); } else { g_debug( "%s: %s does not have any valid candidate profile", thisfn, label ); } g_object_unref( item ); g_free( label ); } return( nautilus_menu ); } /* * expand_tokens_item: * @item: a NAObjectItem read from the NAPivot. * @tokens: the NATokens object which holds current selection data * (uris, basenames, mimetypes, etc.) * * Updates the @item, replacing parameters with the corresponding token. * * This function is not recursive, but works for the plain item: * - the menu (itself) * - the action and its profiles * * Returns: a duplicated object which has to be g_object_unref() by the caller. */ static NAObjectItem * expand_tokens_item( const NAObjectItem *src, NATokens *tokens ) { gchar *old, *new; GSList *subitems_slist, *its, *new_slist; GList *subitems, *it; NAObjectItem *item; item = NA_OBJECT_ITEM( na_object_duplicate( src, DUPLICATE_OBJECT )); /* label, tooltip and icon name * plus the toolbar label if this is an action */ old = na_object_get_label( item ); new = na_tokens_parse_for_display( tokens, old, TRUE ); na_object_set_label( item, new ); g_free( old ); g_free( new ); old = na_object_get_tooltip( item ); new = na_tokens_parse_for_display( tokens, old, TRUE ); na_object_set_tooltip( item, new ); g_free( old ); g_free( new ); old = na_object_get_icon( item ); new = na_tokens_parse_for_display( tokens, old, TRUE ); na_object_set_icon( item, new ); g_free( old ); g_free( new ); if( NA_IS_OBJECT_ACTION( item )){ old = na_object_get_toolbar_label( item ); new = na_tokens_parse_for_display( tokens, old, TRUE ); na_object_set_toolbar_label( item, new ); g_free( old ); g_free( new ); } /* A NAObjectItem, whether it is an action or a menu, is also a NAIContext */ expand_tokens_context( NA_ICONTEXT( item ), tokens ); /* subitems lists, whether this is the profiles list of an action * or the items list of a menu, may be dynamic and embed a command; * this command itself may embed parameters */ subitems_slist = na_object_get_items_slist( item ); new_slist = NULL; for( its = subitems_slist ; its ; its = its->next ){ old = ( gchar * ) its->data; if( old[0] == '[' && old[strlen(old)-1] == ']' ){ new = na_tokens_parse_for_display( tokens, old, FALSE ); } else { new = g_strdup( old ); } new_slist = g_slist_prepend( new_slist, new ); } na_object_set_items_slist( item, new_slist ); na_core_utils_slist_free( subitems_slist ); na_core_utils_slist_free( new_slist ); /* last, deal with profiles of an action */ if( NA_IS_OBJECT_ACTION( item )){ subitems = na_object_get_items( item ); for( it = subitems ; it ; it = it->next ){ /* desktop Exec key = GConf path+parameters * do not touch them here */ old = na_object_get_working_dir( it->data ); new = na_tokens_parse_for_display( tokens, old, FALSE ); na_object_set_working_dir( it->data, new ); g_free( old ); g_free( new ); /* a NAObjectProfile is also a NAIContext */ expand_tokens_context( NA_ICONTEXT( it->data ), tokens ); } } return( item ); } static void expand_tokens_context( NAIContext *context, NATokens *tokens ) { gchar *old, *new; old = na_object_get_try_exec( context ); new = na_tokens_parse_for_display( tokens, old, FALSE ); na_object_set_try_exec( context, new ); g_free( old ); g_free( new ); old = na_object_get_show_if_registered( context ); new = na_tokens_parse_for_display( tokens, old, FALSE ); na_object_set_show_if_registered( context, new ); g_free( old ); g_free( new ); old = na_object_get_show_if_true( context ); new = na_tokens_parse_for_display( tokens, old, FALSE ); na_object_set_show_if_true( context, new ); g_free( old ); g_free( new ); old = na_object_get_show_if_running( context ); new = na_tokens_parse_for_display( tokens, old, FALSE ); na_object_set_show_if_running( context, new ); g_free( old ); g_free( new ); } /* * could also be a NAObjectAction method - but this is not used elsewhere */ static NAObjectProfile * get_candidate_profile( NAObjectAction *action, guint target, GList *files ) { static const gchar *thisfn = "nautilus_actions_get_candidate_profile"; NAObjectProfile *candidate = NULL; gchar *action_label; gchar *profile_label; GList *profiles, *ip; action_label = na_object_get_label( action ); profiles = na_object_get_items( action ); for( ip = profiles ; ip && !candidate ; ip = ip->next ){ NAObjectProfile *profile = NA_OBJECT_PROFILE( ip->data ); if( na_icontext_is_candidate( NA_ICONTEXT( profile ), target, files )){ profile_label = na_object_get_label( profile ); g_debug( "%s: selecting %s (profile=%p '%s')", thisfn, action_label, ( void * ) profile, profile_label ); g_free( profile_label ); candidate = profile; } } g_free( action_label ); return( candidate ); } static NautilusMenuItem * create_item_from_profile( NAObjectProfile *profile, guint target, GList *files, NATokens *tokens ) { NautilusMenuItem *item; NAObjectAction *action; NAObjectProfile *duplicate; action = NA_OBJECT_ACTION( na_object_get_parent( profile )); duplicate = NA_OBJECT_PROFILE( na_object_duplicate( profile, DUPLICATE_ONLY )); na_object_set_parent( duplicate, NULL ); item = create_menu_item( NA_OBJECT_ITEM( action ), target ); g_signal_connect( item, "activate", G_CALLBACK( execute_action ), duplicate ); /* unref the duplicated profile on menu item finalization */ g_object_weak_ref( G_OBJECT( item ), ( GWeakNotify ) weak_notify_profile, duplicate ); g_object_set_data_full( G_OBJECT( item ), "nautilus-actions-tokens", g_object_ref( tokens ), ( GDestroyNotify ) g_object_unref ); return( item ); } /* * called _after_ the NautilusMenuItem has been finalized */ static void weak_notify_profile( NAObjectProfile *profile, NautilusMenuItem *item ) { g_debug( "nautilus_actions_weak_notify_profile: profile=%p (ref_count=%d)", ( void * ) profile, G_OBJECT( profile )->ref_count ); g_object_unref( profile ); } /* * note that each appended NautilusMenuItem is ref-ed by the NautilusMenu * we can so safely release our own ref on subitems after having attached * the submenu */ static NautilusMenuItem * create_item_from_menu( NAObjectMenu *menu, GList *subitems, guint target ) { /*static const gchar *thisfn = "nautilus_actions_create_item_from_menu";*/ NautilusMenuItem *item; item = create_menu_item( NA_OBJECT_ITEM( menu ), target ); attach_submenu_to_item( item, subitems ); nautilus_menu_item_list_free( subitems ); /*g_debug( "%s: returning item=%p", thisfn, ( void * ) item );*/ return( item ); } /* * Creates a NautilusMenuItem * * We attach a weak notify function to the created item in order to be able * to check for instanciation/finalization cycles */ static NautilusMenuItem * create_menu_item( const NAObjectItem *item, guint target ) { NautilusMenuItem *menu_item; gchar *id, *name, *label, *tooltip, *icon; id = na_object_get_id( item ); name = g_strdup_printf( "%s-%s-%s-%d", PACKAGE, G_OBJECT_TYPE_NAME( item ), id, target ); label = na_object_get_label( item ); tooltip = na_object_get_tooltip( item ); icon = na_object_get_icon( item ); menu_item = nautilus_menu_item_new( name, label, tooltip, icon ); g_object_weak_ref( G_OBJECT( menu_item ), ( GWeakNotify ) weak_notify_menu_item, NULL ); g_free( icon ); g_free( tooltip ); g_free( label ); g_free( name ); g_free( id ); return( menu_item ); } /* * called _after_ the NautilusMenuItem has been finalized */ static void weak_notify_menu_item( void *user_data /* =NULL */, NautilusMenuItem *item ) { g_debug( "nautilus_actions_weak_notify_menu_item: item=%p", ( void * ) item ); } static void attach_submenu_to_item( NautilusMenuItem *item, GList *subitems ) { NautilusMenu *submenu; GList *it; submenu = nautilus_menu_new(); nautilus_menu_item_set_submenu( item, submenu ); for( it = subitems ; it ; it = it->next ){ nautilus_menu_append_item( submenu, NAUTILUS_MENU_ITEM( it->data )); } } /* * callback triggered when an item is activated * path and parameters must yet been parsed against tokens * * note that if first parameter if of singular form, then we have to loop * againt the selected, each time replacing the singular parameters with * the current item of the selection */ static void execute_action( NautilusMenuItem *item, NAObjectProfile *profile ) { static const gchar *thisfn = "nautilus_actions_execute_action"; NATokens *tokens; g_debug( "%s: item=%p, profile=%p", thisfn, ( void * ) item, ( void * ) profile ); tokens = NA_TOKENS( g_object_get_data( G_OBJECT( item ), "nautilus-actions-tokens" )); na_tokens_execute_action( tokens, profile ); } /* * create a root submenu */ static GList * create_root_menu( NautilusActions *plugin, GList *menu ) { static const gchar *thisfn = "nautilus_actions_create_root_menu"; GList *nautilus_menu; NautilusMenuItem *root_item; g_debug( "%s: plugin=%p, menu=%p (%d items)", thisfn, ( void * ) plugin, ( void * ) menu, g_list_length( menu )); if( !menu || !g_list_length( menu )){ return( NULL ); } root_item = nautilus_menu_item_new( "NautilusActionsExtensions", /* i18n: label of an automagic root submenu */ _( "Nautilus-Actions actions" ), /* i18n: tooltip of an automagic root submenu */ _( "A submenu which embeds the currently available Nautilus-Actions actions and menus" ), na_about_get_icon_name()); attach_submenu_to_item( root_item, menu ); nautilus_menu = g_list_append( NULL, root_item ); return( nautilus_menu ); } /* * if there is a root submenu, * then add the about item to the end of the first level of this menu */ static GList * add_about_item( NautilusActions *plugin, GList *menu ) { static const gchar *thisfn = "nautilus_actions_add_about_item"; GList *nautilus_menu; gboolean have_root_menu; NautilusMenuItem *root_item; NautilusMenuItem *about_item; NautilusMenu *first; g_debug( "%s: plugin=%p, menu=%p (%d items)", thisfn, ( void * ) plugin, ( void * ) menu, g_list_length( menu )); if( !menu || !g_list_length( menu )){ return( NULL ); } have_root_menu = FALSE; nautilus_menu = menu; if( g_list_length( menu ) == 1 ){ root_item = NAUTILUS_MENU_ITEM( menu->data ); g_object_get( G_OBJECT( root_item ), "menu", &first, NULL ); if( first ){ g_return_val_if_fail( NAUTILUS_IS_MENU( first ), NULL ); have_root_menu = TRUE; } } if( have_root_menu ){ about_item = nautilus_menu_item_new( "AboutNautilusActions", _( "About Nautilus-Actions" ), _( "Display some informations about Nautilus-Actions" ), na_about_get_icon_name()); g_signal_connect_data( about_item, "activate", G_CALLBACK( execute_about ), plugin, NULL, 0 ); nautilus_menu_append_item( first, about_item ); } return( nautilus_menu ); } static void execute_about( NautilusMenuItem *item, NautilusActions *plugin ) { g_return_if_fail( NAUTILUS_IS_ACTIONS( plugin )); na_about_display( NULL ); } /* * Not only the items list itself, but also several runtime preferences have * an effect on the display of items in file manager context menu. * * We of course monitor here all these informations; only asking NAPivot * for reloading its items when we detect the end of a burst of changes. * * Only when NAPivot has finished with reloading its items list, then we * inform the file manager that its items list has changed. */ /* signal emitted by NAPivot at the end of a burst of 'item-changed' signals * from i/o providers */ static void on_pivot_items_changed_handler( NAPivot *pivot, NautilusActions *plugin ) { g_return_if_fail( NA_IS_PIVOT( pivot )); g_return_if_fail( NAUTILUS_IS_ACTIONS( plugin )); if( !plugin->private->dispose_has_run ){ na_timeout_event( &plugin->private->change_timeout ); } } /* callback triggered by NASettings at the end of a burst of 'changed' signals * on runtime preferences which may affect the way file manager displays * its context menus */ static void on_settings_key_changed_handler( const gchar *group, const gchar *key, gconstpointer new_value, gboolean mandatory, NautilusActions *plugin ) { g_return_if_fail( NAUTILUS_IS_ACTIONS( plugin )); if( !plugin->private->dispose_has_run ){ na_timeout_event( &plugin->private->change_timeout ); } } /* * automatically reloads the items, then signal the file manager. */ static void on_change_event_timeout( NautilusActions *plugin ) { static const gchar *thisfn = "nautilus_actions_on_change_event_timeout"; g_debug( "%s: timeout expired", thisfn ); na_pivot_load_items( plugin->private->pivot ); nautilus_menu_provider_emit_items_updated_signal( NAUTILUS_MENU_PROVIDER( plugin )); } nautilus-actions-3.2.3/src/plugin-menu/Makefile.am0000644000175100017500000000342312212601376017030 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) AM_CPPFLAGS += \ -I $(top_srcdir) \ -I $(top_srcdir)/src \ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_PLUGIN_MENU}\" \ $(NAUTILUS_ACTIONS_CFLAGS) \ $(NULL) nautilus_extensiondir = $(NAUTILUS_EXTENSIONS_DIR) nautilus_extension_LTLIBRARIES = libnautilus-actions-menu.la libnautilus_actions_menu_la_SOURCES = \ nautilus-module.c \ nautilus-actions.c \ nautilus-actions.h \ $(NULL) libnautilus_actions_menu_la_LIBADD = \ $(top_builddir)/src/core/libna-core.la \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libnautilus_actions_menu_la_LDFLAGS = \ -module \ -no-undefined \ -avoid-version \ $(NULL) nautilus-actions-3.2.3/src/plugin-menu/nautilus-actions.h0000644000175100017500000000533112212601376020447 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __PLUGIN_MENU_NAUTILUS_ACTIONS_H__ #define __PLUGIN_MENU_NAUTILUS_ACTIONS_H__ /** * SECTION: nautilus-actions * @title: NautilusActions * @short_description: The NautilusActions plugin class definition * @include: plugin-menu/nautilus-actions.h * * This is the class which handles the file manager menu plugin. */ #include G_BEGIN_DECLS #define NAUTILUS_ACTIONS_TYPE ( nautilus_actions_get_type()) #define NAUTILUS_ACTIONS( object ) ( G_TYPE_CHECK_INSTANCE_CAST(( object ), NAUTILUS_ACTIONS_TYPE, NautilusActions )) #define NAUTILUS_ACTIONS_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST(( klass ), NAUTILUS_ACTIONS_TYPE, NautilusActionsClass )) #define NAUTILUS_IS_ACTIONS( object ) ( G_TYPE_CHECK_INSTANCE_TYPE(( object ), NAUTILUS_ACTIONS_TYPE )) #define NAUTILUS_IS_ACTIONS_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NAUTILUS_ACTIONS_TYPE )) #define NAUTILUS_ACTIONS_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NAUTILUS_ACTIONS_TYPE, NautilusActionsClass )) typedef struct _NautilusActionsPrivate NautilusActionsPrivate; typedef struct { /*< private >*/ GObject parent; NautilusActionsPrivate *private; } NautilusActions; typedef struct _NautilusActionsClassPrivate NautilusActionsClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NautilusActionsClassPrivate *private; } NautilusActionsClass; GType nautilus_actions_get_type ( void ); void nautilus_actions_register_type( GTypeModule *module ); G_END_DECLS #endif /* __PLUGIN_MENU_NAUTILUS_ACTIONS_H__ */ nautilus-actions-3.2.3/src/plugin-menu/Makefile.in0000644000175100017500000006344512220365303017047 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/plugin-menu DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(nautilus_extensiondir)" LTLIBRARIES = $(nautilus_extension_LTLIBRARIES) am__DEPENDENCIES_1 = libnautilus_actions_menu_la_DEPENDENCIES = \ $(top_builddir)/src/core/libna-core.la $(am__DEPENDENCIES_1) am_libnautilus_actions_menu_la_OBJECTS = nautilus-module.lo \ nautilus-actions.lo libnautilus_actions_menu_la_OBJECTS = \ $(am_libnautilus_actions_menu_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libnautilus_actions_menu_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libnautilus_actions_menu_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libnautilus_actions_menu_la_SOURCES) DIST_SOURCES = $(libnautilus_actions_menu_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ -I $(top_srcdir) -I $(top_srcdir)/src \ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_PLUGIN_MENU}\" \ $(NAUTILUS_ACTIONS_CFLAGS) $(NULL) AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ nautilus_extensiondir = $(NAUTILUS_EXTENSIONS_DIR) nautilus_extension_LTLIBRARIES = libnautilus-actions-menu.la libnautilus_actions_menu_la_SOURCES = \ nautilus-module.c \ nautilus-actions.c \ nautilus-actions.h \ $(NULL) libnautilus_actions_menu_la_LIBADD = \ $(top_builddir)/src/core/libna-core.la \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libnautilus_actions_menu_la_LDFLAGS = \ -module \ -no-undefined \ -avoid-version \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/plugin-menu/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/plugin-menu/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-nautilus_extensionLTLIBRARIES: $(nautilus_extension_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(nautilus_extension_LTLIBRARIES)'; test -n "$(nautilus_extensiondir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(nautilus_extensiondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(nautilus_extensiondir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(nautilus_extensiondir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(nautilus_extensiondir)"; \ } uninstall-nautilus_extensionLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(nautilus_extension_LTLIBRARIES)'; test -n "$(nautilus_extensiondir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(nautilus_extensiondir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(nautilus_extensiondir)/$$f"; \ done clean-nautilus_extensionLTLIBRARIES: -test -z "$(nautilus_extension_LTLIBRARIES)" || rm -f $(nautilus_extension_LTLIBRARIES) @list='$(nautilus_extension_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libnautilus-actions-menu.la: $(libnautilus_actions_menu_la_OBJECTS) $(libnautilus_actions_menu_la_DEPENDENCIES) $(EXTRA_libnautilus_actions_menu_la_DEPENDENCIES) $(AM_V_CCLD)$(libnautilus_actions_menu_la_LINK) -rpath $(nautilus_extensiondir) $(libnautilus_actions_menu_la_OBJECTS) $(libnautilus_actions_menu_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nautilus-actions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nautilus-module.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(nautilus_extensiondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool \ clean-nautilus_extensionLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nautilus_extensionLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nautilus_extensionLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-nautilus_extensionLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-nautilus_extensionLTLIBRARIES install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-nautilus_extensionLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/src/plugin-menu/README0000644000175100017500000000043211663540374015662 00000000000000This is the Nautilus-Actions plugin. The plugin is dynamically loaded by the Nautilus file manager. Please put only here code relevant to the plugin, and to itself only. I.e., code shared by the plugin with some other part of the package should go to runtime convenience library. nautilus-actions-3.2.3/src/plugin-tracker/0000755000175100017500000000000012220365533015542 500000000000000nautilus-actions-3.2.3/src/plugin-tracker/na-tracker-dbus-glib.xml0000644000175100017500000000057711710765672022125 00000000000000 nautilus-actions-3.2.3/src/plugin-tracker/na-tracker.h0000644000175100017500000000666212212601376017673 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NA_TRACKER_H__ #define __NA_TRACKER_H__ /** * SECTION: na_tracker * @short_description: #NATracker class definition. * @include: tracker/na-tracker.h * * The #NATracker object is instanciated when Nautilus file manager loads * this plugin (this is the normal behavior of Nautilus to instanciate one * object of each plugin type). * * There is so only one #NATracker object in the process. As any Nautilus * extension, it is instantiated when the module is loaded by the file * manager, usually at startup time. * * glib-dbus * * The #NATracker object initiates a connection on the session D-Bus, takes * ownership of our well-known name, and then register itself as the object * which serves our object path (so installing introspection infos). * * GDBus * * The #NATracker object instanciates and keeps a new GDBusObjectManagerServer * rooted on our D-Bus path. * It then allocates an object at this same path, and another object which * implements the .Properties1 interface. Last connects to the method signal * before connecting the server to the session D-Bus. */ #include G_BEGIN_DECLS #define NA_TYPE_TRACKER ( na_tracker_get_type()) #define NA_TRACKER( object ) ( G_TYPE_CHECK_INSTANCE_CAST(( object ), NA_TYPE_TRACKER, NATracker )) #define NA_TRACKER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST(( klass ), NA_TYPE_TRACKER, NATrackerClass )) #define NA_IS_TRACKER( object ) ( G_TYPE_CHECK_INSTANCE_TYPE(( object ), NA_TYPE_TRACKER )) #define NA_IS_TRACKER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_TRACKER )) #define NA_TRACKER_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_TRACKER, NATrackerClass )) typedef struct _NATrackerPrivate NATrackerPrivate; typedef struct { /*< private >*/ GObject parent; NATrackerPrivate *private; } NATracker; typedef struct _NATrackerClassPrivate NATrackerClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NATrackerClassPrivate *private; } NATrackerClass; GType na_tracker_get_type ( void ); void na_tracker_register_type ( GTypeModule *module ); #ifdef HAVE_DBUS_GLIB gboolean na_tracker_get_selected_paths( NATracker *tracker, char ***paths, GError **error ); #endif G_END_DECLS #endif /* __NA_TRACKER_H__ */ nautilus-actions-3.2.3/src/plugin-tracker/na-tracker-plugin.c0000644000175100017500000001022612212601376021151 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "na-tracker.h" static void set_log_handler( void ); static void log_handler( const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data ); static GLogFunc st_default_log_func = NULL; /* * A nautilus extension must implement three functions : * * - nautilus_module_initialize * - nautilus_module_list_types * - nautilus_module_shutdown * * The first two functions are called at nautilus startup. * * The prototypes for these functions are defined in nautilus-extension-types.h */ void nautilus_module_initialize( GTypeModule *module ) { static const gchar *thisfn = "nautilus_module_initialize"; syslog( LOG_USER | LOG_INFO, "[N-A] %s Tracker %s initializing...", PACKAGE_NAME, PACKAGE_VERSION ); set_log_handler(); g_debug( "%s: module=%p", thisfn, ( void * ) module ); g_type_module_set_name( module, PACKAGE_STRING ); na_tracker_register_type( module ); } void nautilus_module_list_types( const GType **types, int *num_types ) { static const gchar *thisfn = "nautilus_module_list_types"; static GType type_list[1]; g_debug( "%s: types=%p, num_types=%p", thisfn, ( void * ) types, ( void * ) num_types ); type_list[0] = NA_TYPE_TRACKER; *types = type_list; *num_types = 1; } void nautilus_module_shutdown( void ) { static const gchar *thisfn = "nautilus_module_shutdown"; g_debug( "%s", thisfn ); /* remove the log handler * almost useless as the process is nonetheless terminating at this time * but this is the art of coding... */ if( st_default_log_func ){ g_log_set_default_handler( st_default_log_func, NULL ); st_default_log_func = NULL; } } /* * a log handler that we install when in development mode in order to be * able to log plugin runtime * TODO: the debug flag should be dynamic, so that an advanced user could * setup a given key and obtain a full log to send to Bugzilla.. * For now, is always install when compiled in maintainer mode, never else */ static void set_log_handler( void ) { st_default_log_func = g_log_set_default_handler(( GLogFunc ) log_handler, NULL ); } /* * we used to install a log handler for each and every log domain used * in Nautilus-Actions ; this led to a fastidious enumeration * instead we install a default log handler which will receive all * debug messages, i.e. not only from N-A, but also from other code * in the Nautilus process */ static void log_handler( const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data ) { gchar *tmp; tmp = g_strdup( "" ); if( log_domain && strlen( log_domain )){ g_free( tmp ); tmp = g_strdup_printf( "[%s] ", log_domain ); } #ifdef NA_MAINTAINER_MODE /*( *st_default_log_func )( log_domain, log_level, message, user_data );*/ syslog( LOG_USER | LOG_DEBUG, "%s%s", tmp, message ); #else if( g_getenv( NAUTILUS_ACTIONS_DEBUG )){ syslog( LOG_USER | LOG_DEBUG, "%s%s", tmp, message ); } #endif g_free( tmp ); } nautilus-actions-3.2.3/src/plugin-tracker/na-tracker.c0000644000175100017500000003765712212601376017676 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_GDBUS #include #include "na-tracker-gdbus.h" #else # ifdef HAVE_DBUS_GLIB #include # endif #endif #include #include #include #include #include "na-tracker.h" #ifdef HAVE_DBUS_GLIB #include "na-tracker-dbus-glib.h" #endif /* private class data */ struct _NATrackerClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NATrackerPrivate { gboolean dispose_has_run; #ifdef HAVE_GDBUS guint owner_id; /* the identifier returns by g_bus_own_name */ GDBusObjectManagerServer *manager; #endif GList *selected; }; static GObjectClass *st_parent_class = NULL; static GType st_module_type = 0; static void class_init( NATrackerClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void initialize_dbus_connection( NATracker *tracker ); #ifdef HAVE_GDBUS static void on_bus_acquired( GDBusConnection *connection, const gchar *name, NATracker *tracker ); static void on_name_acquired( GDBusConnection *connection, const gchar *name, NATracker *tracker ); static void on_name_lost( GDBusConnection *connection, const gchar *name, NATracker *tracker ); static gboolean on_properties1_get_selected_paths( NATrackerProperties1 *tracker_properties, GDBusMethodInvocation *invocation, NATracker *tracker ); #endif static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void menu_provider_iface_init( NautilusMenuProviderIface *iface ); static GList *menu_provider_get_background_items( NautilusMenuProvider *provider, GtkWidget *window, NautilusFileInfo *folder ); static GList *menu_provider_get_file_items( NautilusMenuProvider *provider, GtkWidget *window, GList *files ); static void set_uris( NATracker *tracker, GList *files ); static gchar **get_selected_paths( NATracker *tracker ); static GList *free_selected( GList *selected ); GType na_tracker_get_type( void ) { g_assert( st_module_type ); return( st_module_type ); } void na_tracker_register_type( GTypeModule *module ) { static const gchar *thisfn = "na_tracker_register_type"; static const GTypeInfo info = { sizeof( NATrackerClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NATracker ), 0, ( GInstanceInitFunc ) instance_init, }; static const GInterfaceInfo menu_provider_iface_info = { ( GInterfaceInitFunc ) menu_provider_iface_init, NULL, NULL }; g_debug( "%s: module=%p", thisfn, ( void * ) module ); g_assert( st_module_type == 0 ); st_module_type = g_type_module_register_type( module, G_TYPE_OBJECT, "NATracker", &info, 0 ); g_type_module_add_interface( module, st_module_type, NAUTILUS_TYPE_MENU_PROVIDER, &menu_provider_iface_info ); } static void class_init( NATrackerClass *klass ) { static const gchar *thisfn = "na_tracker_class_init"; GObjectClass *gobject_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); gobject_class = G_OBJECT_CLASS( klass ); gobject_class->dispose = instance_dispose; gobject_class->finalize = instance_finalize; klass->private = g_new0( NATrackerClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_tracker_instance_init"; NATracker *self; g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) instance, ( void * ) klass ); g_return_if_fail( NA_IS_TRACKER( instance )); self = NA_TRACKER( instance ); self->private = g_new0( NATrackerPrivate, 1 ); self->private->dispose_has_run = FALSE; initialize_dbus_connection( self ); } /* * initialize the DBus connection at instanciation time * & instantiate the object which will do effective tracking */ static void initialize_dbus_connection( NATracker *tracker ) { #ifdef HAVE_GDBUS NATrackerPrivate *priv = tracker->private; priv->owner_id = g_bus_own_name( G_BUS_TYPE_SESSION, NAUTILUS_ACTIONS_DBUS_SERVICE, G_BUS_NAME_OWNER_FLAGS_REPLACE, ( GBusAcquiredCallback ) on_bus_acquired, ( GBusNameAcquiredCallback ) on_name_acquired, ( GBusNameLostCallback ) on_name_lost, tracker, NULL ); #else /* HAVE_GDBUS */ # ifdef HAVE_DBUS_GLIB static const gchar *thisfn = "na_tracker_initialize_dbus_connection"; DBusGConnection *connection; GError *error; DBusGProxy *proxy; guint32 request_name_ret; /* get a connection on session DBus */ error = NULL; connection = dbus_g_bus_get( DBUS_BUS_SESSION, &error ); if( !connection ){ g_warning( "%s: unable to get a connection on session DBus: %s", thisfn, error->message ); g_error_free( error ); return; } g_debug( "%s: connection is ok", thisfn ); /* get a proxy for this connection * this proxy let us request some standard DBus services */ proxy = dbus_g_proxy_new_for_name( connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS ); if( !proxy ){ g_warning( "%s: unable to get a proxy for the connection", thisfn ); dbus_g_connection_unref( connection ); return; } g_debug( "%s: proxy is ok", thisfn ); /* try to register our service name as a unique 'well known' name */ if( !org_freedesktop_DBus_request_name( proxy, NAUTILUS_ACTIONS_DBUS_SERVICE, 0, &request_name_ret, &error )){ g_warning( "%s: unable to register %s as a 'well known' name on the bus: %s", thisfn, NAUTILUS_ACTIONS_DBUS_SERVICE, error->message ); g_error_free( error ); dbus_g_connection_unref( connection ); return; } g_debug( "%s: well known name registration is ok", thisfn ); if( request_name_ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER ){ g_warning("%s: got result code %u from requesting name (not the primary owner of the name)", thisfn, request_name_ret ); dbus_g_connection_unref( connection ); return; } g_debug( "%s: primary owner check is ok", thisfn ); /* allocate the tracking object and register it * instantiation takes care of installing introspection infos */ dbus_g_object_type_install_info( NA_TYPE_TRACKER, &dbus_glib_na_tracker_dbus_object_info ); dbus_g_connection_register_g_object( connection, NAUTILUS_ACTIONS_DBUS_TRACKER_PATH "/0", G_OBJECT( tracker )); g_debug( "%s: registering tracker path is ok", thisfn ); # endif /* HAVE_DBUS_GLIB */ #endif } #ifdef HAVE_GDBUS static void on_bus_acquired( GDBusConnection *connection, const gchar *name, NATracker *tracker ) { static const gchar *thisfn = "na_tracker_on_bus_acquired"; NATrackerObjectSkeleton *tracker_object; NATrackerProperties1 *tracker_properties1; /*NATrackerDBus *tracker_object;*/ g_debug( "%s: connection=%p, name=%s, tracker=%p", thisfn, ( void * ) connection, name, ( void * ) tracker ); /* create a new org.freedesktop.DBus.ObjectManager rooted at * /org/nautilus_actions/DBus/Tracker */ tracker->private->manager = g_dbus_object_manager_server_new( NAUTILUS_ACTIONS_DBUS_TRACKER_PATH ); /* create a new D-Bus object at the path * /org/nautilus_actions/DBus/Tracker * (which must be same or below than that of object manager server) */ tracker_object = na_tracker_object_skeleton_new( NAUTILUS_ACTIONS_DBUS_TRACKER_PATH "/0" ); /* make a newly created object export the interface * org.nautilus_actions.DBus.Tracker.Properties1 * and attach it to the D-Bus object, which takes its own reference on it */ tracker_properties1 = na_tracker_properties1_skeleton_new(); na_tracker_object_skeleton_set_properties1( tracker_object, tracker_properties1 ); g_object_unref( tracker_properties1 ); /* handle GetSelectedPaths method invocation on the .Properties1 interface */ g_signal_connect( tracker_properties1, "handle-get-selected-paths", G_CALLBACK( on_properties1_get_selected_paths ), tracker ); /* and export the DBus object on the object manager server * (which takes its own reference on it) */ g_dbus_object_manager_server_export( tracker->private->manager, G_DBUS_OBJECT_SKELETON( tracker_object )); g_object_unref( tracker_object ); /* and connect the object manager server to the D-Bus session * exporting all attached objects */ g_dbus_object_manager_server_set_connection( tracker->private->manager, connection ); } static void on_name_acquired( GDBusConnection *connection, const gchar *name, NATracker *tracker ) { static const gchar *thisfn = "na_tracker_on_name_acquired"; g_debug( "%s: connection=%p, name=%s, tracker=%p", thisfn, ( void * ) connection, name, ( void * ) tracker ); } static void on_name_lost( GDBusConnection *connection, const gchar *name, NATracker *tracker ) { static const gchar *thisfn = "na_tracker_on_name_lost"; g_debug( "%s: connection=%p, name=%s, tracker=%p", thisfn, ( void * ) connection, name, ( void * ) tracker ); } #endif /* HAVE_GDBUS */ static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_tracker_instance_dispose"; NATrackerPrivate *priv; g_debug( "%s: object=%p", thisfn, ( void * ) object ); g_return_if_fail( NA_IS_TRACKER( object )); priv = NA_TRACKER( object )->private; if( !priv->dispose_has_run ){ priv->dispose_has_run = TRUE; #ifdef HAVE_GDBUS if( priv->owner_id ){ g_bus_unown_name( priv->owner_id ); } if( priv->manager ){ g_object_unref( priv->manager ); } #endif priv->selected = free_selected( priv->selected ); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_tracker_instance_finalize"; NATracker *self; g_debug( "%s: object=%p", thisfn, ( void * ) object ); g_return_if_fail( NA_IS_TRACKER( object )); self = NA_TRACKER( object ); g_free( self->private ); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static void menu_provider_iface_init( NautilusMenuProviderIface *iface ) { static const gchar *thisfn = "na_tracker_menu_provider_iface_init"; g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); iface->get_background_items = menu_provider_get_background_items; iface->get_file_items = menu_provider_get_file_items; } static GList * menu_provider_get_background_items( NautilusMenuProvider *provider, GtkWidget *window, NautilusFileInfo *folder ) { static const gchar *thisfn = "na_tracker_menu_provider_get_background_items"; NATracker *tracker; gchar *uri; GList *selected; g_return_val_if_fail( NA_IS_TRACKER( provider ), NULL ); tracker = NA_TRACKER( provider ); if( !tracker->private->dispose_has_run ){ uri = nautilus_file_info_get_uri( folder ); g_debug( "%s: provider=%p, window=%p, folder=%s", thisfn, ( void * ) provider, ( void * ) window, uri ); g_free( uri ); selected = g_list_prepend( NULL, folder ); set_uris( tracker, selected ); g_list_free( selected ); } return( NULL ); } /* * this function is called each time the selection changed * menus items are available : * a) in Edit menu while the selection stays unchanged * b) in contextual menu while the selection stays unchanged */ static GList * menu_provider_get_file_items( NautilusMenuProvider *provider, GtkWidget *window, GList *files ) { static const gchar *thisfn = "na_tracker_menu_provider_get_file_items"; NATracker *tracker; g_return_val_if_fail( NA_IS_TRACKER( provider ), NULL ); tracker = NA_TRACKER( provider ); if( !tracker->private->dispose_has_run ){ g_debug( "%s: provider=%p, window=%p, files=%p, count=%d", thisfn, ( void * ) provider, ( void * ) window, ( void * ) files, g_list_length( files )); set_uris( tracker, files ); } return( NULL ); } /* * set_uris: * @tracker: this #NATracker instance. * @files: the list of currently selected items. * * Maintains our own list of uris. */ static void set_uris( NATracker *tracker, GList *files ) { NATrackerPrivate *priv; priv = tracker->private; priv->selected = free_selected( tracker->private->selected ); priv->selected = nautilus_file_info_list_copy( files ); } #ifdef HAVE_GDBUS /* * Returns: %TRUE if the method has been handled. */ static gboolean on_properties1_get_selected_paths( NATrackerProperties1 *tracker_properties, GDBusMethodInvocation *invocation, NATracker *tracker ) { gchar **paths; g_return_val_if_fail( NA_IS_TRACKER( tracker ), FALSE ); paths = get_selected_paths( tracker ); na_tracker_properties1_complete_get_selected_paths( tracker_properties, invocation, ( const gchar * const * ) paths ); return( TRUE ); } #endif #ifdef HAVE_DBUS_GLIB /** * na_tracker_get_selected_paths: * @tracker: this #NATracker object. * @paths: the location in which copy the strings to be sent. * @error: the location of a GError. * * Sends on session D-Bus the list of currently selected items, as two * strings for each item : * - the uri * - the mimetype as returned by NautilusFileInfo. * * This is required as some particular items are only known by Nautilus * (e.g. computer), and standard GLib functions are not able to retrieve * their mimetype. * * Exported as GetSelectedPaths method on Tracker.Properties1 interface. * * Returns: %TRUE if the method has been handled. */ gboolean na_tracker_get_selected_paths( NATracker *tracker, char ***paths, GError **error ) { g_return_val_if_fail( NA_IS_TRACKER( tracker ), FALSE ); *error = NULL; *paths = get_selected_paths( tracker ); return( TRUE ); } #endif /* * get_selected_paths: * @tracker: this #NATracker object. * * Sends on session D-Bus the list of currently selected items, as two * strings for each item : * - the uri * - the mimetype as returned by NautilusFileInfo. * * This is required as some particular items are only known by Nautilus * (e.g. computer), and standard GLib functions are not able to retrieve * their mimetype. * * Exported as GetSelectedPaths method on Tracker.Properties1 interface. */ static gchar ** get_selected_paths( NATracker *tracker ) { static const gchar *thisfn = "na_tracker_get_selected_paths"; NATrackerPrivate *priv; gchar **paths; GList *it; int count; gchar **iter; paths = NULL; priv = tracker->private; g_debug( "%s: tracker=%p", thisfn, ( void * ) tracker ); count = 2 * g_list_length( priv->selected ); paths = ( char ** ) g_new0( gchar *, 1+count ); iter = paths; for( it = priv->selected ; it ; it = it->next ){ *iter = nautilus_file_info_get_uri(( NautilusFileInfo * ) it->data ); iter++; *iter = nautilus_file_info_get_mime_type(( NautilusFileInfo * ) it->data ); iter++; } return( paths ); } static GList * free_selected( GList *selected ) { nautilus_file_info_list_free( selected ); return( NULL ); } nautilus-actions-3.2.3/src/plugin-tracker/Makefile.am0000644000175100017500000000535412212601376017524 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) AM_CPPFLAGS += \ -I $(top_srcdir) \ -I $(top_srcdir)/src \ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_PLUGIN_TRACKER}\" \ $(NAUTILUS_ACTIONS_CFLAGS) \ $(NULL) nautilus_extensiondir = $(NAUTILUS_EXTENSIONS_DIR) nautilus_extension_LTLIBRARIES = libnautilus-actions-tracker.la BUILT_SOURCES = if HAVE_GDBUS BUILT_SOURCES += \ na-tracker-gdbus.c \ na-tracker-gdbus.h \ $(NULL) na-tracker-gdbus.c na-tracker-gdbus.h: na-tracker-gdbus.xml gdbus-codegen \ --interface-prefix org.nautilus_actions.DBus.Tracker. \ --generate-c-code na-tracker-gdbus \ --c-namespace NA_Tracker \ --c-generate-object-manager \ --generate-docbook na-tracker-gdbus-docs \ $< DISTCLEANFILES = \ na-tracker-gdbus-docs-org.nautilus_actions.DBus.Tracker.Properties1.xml endif if HAVE_DBUS_GLIB BUILT_SOURCES += \ na-tracker-dbus-glib.h \ $(NULL) na-tracker-dbus-glib.h: na-tracker-dbus-glib.xml dbus-binding-tool --mode=glib-server --prefix=na_tracker_dbus $< > $@ endif nodist_libnautilus_actions_tracker_la_SOURCES = \ $(BUILT_SOURCES) \ $(NULL) libnautilus_actions_tracker_la_SOURCES = \ na-tracker.c \ na-tracker.h \ na-tracker-plugin.c \ $(NULL) libnautilus_actions_tracker_la_LIBADD = \ $(top_builddir)/src/core/libna-core.la \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libnautilus_actions_tracker_la_LDFLAGS = \ -module \ -no-undefined \ -avoid-version \ $(NULL) EXTRA_DIST = \ na-tracker-dbus-glib.xml \ na-tracker-gdbus.xml \ $(NULL) CLEANFILES = \ $(BUILT_SOURCES) \ $(NULL) nautilus-actions-3.2.3/src/plugin-tracker/Makefile.in0000644000175100017500000006741612220365303017540 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @HAVE_GDBUS_TRUE@am__append_1 = \ @HAVE_GDBUS_TRUE@ na-tracker-gdbus.c \ @HAVE_GDBUS_TRUE@ na-tracker-gdbus.h \ @HAVE_GDBUS_TRUE@ $(NULL) @HAVE_DBUS_GLIB_TRUE@am__append_2 = \ @HAVE_DBUS_GLIB_TRUE@ na-tracker-dbus-glib.h \ @HAVE_DBUS_GLIB_TRUE@ $(NULL) subdir = src/plugin-tracker DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(nautilus_extensiondir)" LTLIBRARIES = $(nautilus_extension_LTLIBRARIES) am__DEPENDENCIES_1 = libnautilus_actions_tracker_la_DEPENDENCIES = \ $(top_builddir)/src/core/libna-core.la $(am__DEPENDENCIES_1) am_libnautilus_actions_tracker_la_OBJECTS = na-tracker.lo \ na-tracker-plugin.lo @HAVE_GDBUS_TRUE@am__objects_1 = na-tracker-gdbus.lo am__objects_2 = am__objects_3 = $(am__objects_1) $(am__objects_2) nodist_libnautilus_actions_tracker_la_OBJECTS = $(am__objects_3) libnautilus_actions_tracker_la_OBJECTS = \ $(am_libnautilus_actions_tracker_la_OBJECTS) \ $(nodist_libnautilus_actions_tracker_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libnautilus_actions_tracker_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libnautilus_actions_tracker_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libnautilus_actions_tracker_la_SOURCES) \ $(nodist_libnautilus_actions_tracker_la_SOURCES) DIST_SOURCES = $(libnautilus_actions_tracker_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ -I $(top_srcdir) -I $(top_srcdir)/src \ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_PLUGIN_TRACKER}\" \ $(NAUTILUS_ACTIONS_CFLAGS) $(NULL) AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ nautilus_extensiondir = $(NAUTILUS_EXTENSIONS_DIR) nautilus_extension_LTLIBRARIES = libnautilus-actions-tracker.la BUILT_SOURCES = $(am__append_1) $(am__append_2) @HAVE_GDBUS_TRUE@DISTCLEANFILES = \ @HAVE_GDBUS_TRUE@ na-tracker-gdbus-docs-org.nautilus_actions.DBus.Tracker.Properties1.xml nodist_libnautilus_actions_tracker_la_SOURCES = \ $(BUILT_SOURCES) \ $(NULL) libnautilus_actions_tracker_la_SOURCES = \ na-tracker.c \ na-tracker.h \ na-tracker-plugin.c \ $(NULL) libnautilus_actions_tracker_la_LIBADD = \ $(top_builddir)/src/core/libna-core.la \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libnautilus_actions_tracker_la_LDFLAGS = \ -module \ -no-undefined \ -avoid-version \ $(NULL) EXTRA_DIST = \ na-tracker-dbus-glib.xml \ na-tracker-gdbus.xml \ $(NULL) CLEANFILES = \ $(BUILT_SOURCES) \ $(NULL) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/plugin-tracker/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/plugin-tracker/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-nautilus_extensionLTLIBRARIES: $(nautilus_extension_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(nautilus_extension_LTLIBRARIES)'; test -n "$(nautilus_extensiondir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(nautilus_extensiondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(nautilus_extensiondir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(nautilus_extensiondir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(nautilus_extensiondir)"; \ } uninstall-nautilus_extensionLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(nautilus_extension_LTLIBRARIES)'; test -n "$(nautilus_extensiondir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(nautilus_extensiondir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(nautilus_extensiondir)/$$f"; \ done clean-nautilus_extensionLTLIBRARIES: -test -z "$(nautilus_extension_LTLIBRARIES)" || rm -f $(nautilus_extension_LTLIBRARIES) @list='$(nautilus_extension_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libnautilus-actions-tracker.la: $(libnautilus_actions_tracker_la_OBJECTS) $(libnautilus_actions_tracker_la_DEPENDENCIES) $(EXTRA_libnautilus_actions_tracker_la_DEPENDENCIES) $(AM_V_CCLD)$(libnautilus_actions_tracker_la_LINK) -rpath $(nautilus_extensiondir) $(libnautilus_actions_tracker_la_OBJECTS) $(libnautilus_actions_tracker_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-tracker-gdbus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-tracker-plugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-tracker.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(nautilus_extensiondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool \ clean-nautilus_extensionLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nautilus_extensionLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nautilus_extensionLTLIBRARIES .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-nautilus_extensionLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-nautilus_extensionLTLIBRARIES install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-nautilus_extensionLTLIBRARIES @HAVE_GDBUS_TRUE@na-tracker-gdbus.c na-tracker-gdbus.h: na-tracker-gdbus.xml @HAVE_GDBUS_TRUE@ gdbus-codegen \ @HAVE_GDBUS_TRUE@ --interface-prefix org.nautilus_actions.DBus.Tracker. \ @HAVE_GDBUS_TRUE@ --generate-c-code na-tracker-gdbus \ @HAVE_GDBUS_TRUE@ --c-namespace NA_Tracker \ @HAVE_GDBUS_TRUE@ --c-generate-object-manager \ @HAVE_GDBUS_TRUE@ --generate-docbook na-tracker-gdbus-docs \ @HAVE_GDBUS_TRUE@ $< @HAVE_DBUS_GLIB_TRUE@na-tracker-dbus-glib.h: na-tracker-dbus-glib.xml @HAVE_DBUS_GLIB_TRUE@ dbus-binding-tool --mode=glib-server --prefix=na_tracker_dbus $< > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/src/plugin-tracker/na-tracker-gdbus.xml0000644000175100017500000000132711710727540021343 00000000000000 nautilus-actions-3.2.3/src/api/0000755000175100017500000000000012220365532013363 500000000000000nautilus-actions-3.2.3/src/api/na-data-boxed.h0000644000175100017500000001050212212601376016056 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_DATA_BOXED_H__ #define __NAUTILUS_ACTIONS_API_NA_DATA_BOXED_H__ /** * SECTION: data-boxed * @title: NADataBoxed * @short_description: The Data Factory Element Class Definition * @include: nautilus-actions/na-data-boxed.h * * The object which encapsulates an elementary data of #NAIFactoryObject. * A #NADataBoxed object has a type and a value. * * #NADataBoxed class is derived from #NABoxed one, and implements the same * types that those defined in na-data-types.h. * * Additionally, #NADataBoxed class holds the #NADataDef data definition * suitable for a NAFactoryObject object. It such provides default value * and validity status. * * Since: 2.30 */ #include #include "na-boxed.h" #include "na-data-def.h" G_BEGIN_DECLS #define NA_TYPE_DATA_BOXED ( na_data_boxed_get_type()) #define NA_DATA_BOXED( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_DATA_BOXED, NADataBoxed )) #define NA_DATA_BOXED_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_DATA_BOXED, NADataBoxedClass )) #define NA_IS_DATA_BOXED( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_DATA_BOXED )) #define NA_IS_DATA_BOXED_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_DATA_BOXED )) #define NA_DATA_BOXED_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_DATA_BOXED, NADataBoxedClass )) typedef struct _NADataBoxedPrivate NADataBoxedPrivate; typedef struct { /*< private >*/ NABoxed parent; NADataBoxedPrivate *private; } NADataBoxed; typedef struct _NADataBoxedClassPrivate NADataBoxedClassPrivate; typedef struct { /*< private >*/ NABoxedClass parent; NADataBoxedClassPrivate *private; } NADataBoxedClass; GType na_data_boxed_get_type( void ); NADataBoxed *na_data_boxed_new ( const NADataDef *def ); const NADataDef *na_data_boxed_get_data_def ( const NADataBoxed *boxed ); void na_data_boxed_set_data_def ( NADataBoxed *boxed, const NADataDef *def ); GParamSpec *na_data_boxed_get_param_spec ( const NADataDef *def ); gboolean na_data_boxed_is_default ( const NADataBoxed *boxed ); gboolean na_data_boxed_is_valid ( const NADataBoxed *boxed ); /* These functions are deprecated starting with 3.1.0 */ #ifdef NA_ENABLE_DEPRECATED gboolean na_data_boxed_are_equal ( const NADataBoxed *a, const NADataBoxed *b ); void na_data_boxed_dump ( const NADataBoxed *boxed ); gchar *na_data_boxed_get_as_string ( const NADataBoxed *boxed ); void na_data_boxed_get_as_value ( const NADataBoxed *boxed, GValue *value ); void *na_data_boxed_get_as_void ( const NADataBoxed *boxed ); void na_data_boxed_set_from_boxed ( NADataBoxed *boxed, const NADataBoxed *value ); void na_data_boxed_set_from_string( NADataBoxed *boxed, const gchar *value ); void na_data_boxed_set_from_value ( NADataBoxed *boxed, const GValue *value ); void na_data_boxed_set_from_void ( NADataBoxed *boxed, const void *value ); #endif /* NA_ENABLE_DEPRECATED */ G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_DATA_BOXED_H__ */ nautilus-actions-3.2.3/src/api/na-object-menu.h0000644000175100017500000000516112212601376016263 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_OBJECT_MENU_H__ #define __NAUTILUS_ACTIONS_API_NA_OBJECT_MENU_H__ /** * SECTION: object-menu * @title: NAObjectMenu * @short_description: The Menu Class Definition * @include: nautilus-actions/na-object-menu.h */ #include "na-object-item.h" G_BEGIN_DECLS #define NA_TYPE_OBJECT_MENU ( na_object_menu_get_type()) #define NA_OBJECT_MENU( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_OBJECT_MENU, NAObjectMenu )) #define NA_OBJECT_MENU_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_OBJECT_MENU, NAObjectMenuClass )) #define NA_IS_OBJECT_MENU( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_OBJECT_MENU )) #define NA_IS_OBJECT_MENU_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_OBJECT_MENU )) #define NA_OBJECT_MENU_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_OBJECT_MENU, NAObjectMenuClass )) typedef struct _NAObjectMenuPrivate NAObjectMenuPrivate; typedef struct { /*< private >*/ NAObjectItem parent; NAObjectMenuPrivate *private; } NAObjectMenu; typedef struct _NAObjectMenuClassPrivate NAObjectMenuClassPrivate; typedef struct { /*< private >*/ NAObjectItemClass parent; NAObjectMenuClassPrivate *private; } NAObjectMenuClass; GType na_object_menu_get_type( void ); NAObjectMenu *na_object_menu_new( void ); NAObjectMenu *na_object_menu_new_with_defaults( void ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_OBJECT_MENU_H__ */ nautilus-actions-3.2.3/src/api/na-object-profile.h0000644000175100017500000000567712212601376016773 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_OBJECT_PROFILE_H__ #define __NAUTILUS_ACTIONS_API_NA_OBJECT_PROFILE_H__ /** * SECTION: object-profile * @title: NAObjectProfile * @short_description: The Action Profile Class Definition * @include: nautilus-actions/na-object-item.h */ #include "na-object-id.h" G_BEGIN_DECLS #define NA_TYPE_OBJECT_PROFILE ( na_object_profile_get_type()) #define NA_OBJECT_PROFILE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_OBJECT_PROFILE, NAObjectProfile )) #define NA_OBJECT_PROFILE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_OBJECT_PROFILE, NAObjectProfileClass )) #define NA_IS_OBJECT_PROFILE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_OBJECT_PROFILE )) #define NA_IS_OBJECT_PROFILE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_OBJECT_PROFILE )) #define NA_OBJECT_PROFILE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_OBJECT_PROFILE, NAObjectProfileClass )) typedef struct _NAObjectProfilePrivate NAObjectProfilePrivate; typedef struct { /*< private >*/ NAObjectId parent; NAObjectProfilePrivate *private; } NAObjectProfile; typedef struct _NAObjectProfileClassPrivate NAObjectProfileClassPrivate; typedef struct { /*< private >*/ NAObjectIdClass parent; NAObjectProfileClassPrivate *private; } NAObjectProfileClass; enum { NA_EXECUTION_MODE_NORMAL = 1, NA_EXECUTION_MODE_TERMINAL, NA_EXECUTION_MODE_EMBEDDED, NA_EXECUTION_MODE_DISPLAY_OUTPUT }; GType na_object_profile_get_type( void ); NAObjectProfile *na_object_profile_new( void ); NAObjectProfile *na_object_profile_new_with_defaults( void ); void na_object_profile_convert_v2_to_last( NAObjectProfile *profile ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_OBJECT_PROFILE_H__ */ nautilus-actions-3.2.3/src/api/na-core-utils.h0000644000175100017500000001042312212601376016136 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_CORE_UTILS_H__ #define __NAUTILUS_ACTIONS_API_NA_CORE_UTILS_H__ /** * SECTION: core-utils * @title: Core Misc * @short_description: The Core Library Utilities * @include: nautilus-action/na-core-utils.h */ #include G_BEGIN_DECLS /* boolean manipulation */ gboolean na_core_utils_boolean_from_string( const gchar *string ); /* string manipulation */ #ifdef NA_ENABLE_DEPRECATED gchar *na_core_utils_str_add_prefix( const gchar *prefix, const gchar *str ); #endif int na_core_utils_str_collate( const gchar *str1, const gchar *str2 ); gchar *na_core_utils_str_remove_char( const gchar *string, const gchar *to_remove ); gchar *na_core_utils_str_remove_suffix( const gchar *string, const gchar *suffix ); void na_core_utils_str_split_first_word( const gchar *string, gchar **first, gchar **other ); gchar *na_core_utils_str_subst( const gchar *pattern, const gchar *key, const gchar *subst ); /* some functions to get or set GSList list of strings */ void na_core_utils_slist_add_message( GSList **list, const gchar *format, ... ); GSList *na_core_utils_slist_duplicate( GSList *slist ); void na_core_utils_slist_dump( const gchar *prefix, GSList *list ); GSList *na_core_utils_slist_from_array( const gchar **str_array ); GSList *na_core_utils_slist_from_split( const gchar *text, const gchar *separator ); gchar *na_core_utils_slist_join_at_end( GSList *slist, const gchar *link ); GSList *na_core_utils_slist_remove_ascii( GSList *slist, const gchar *text ); GSList *na_core_utils_slist_remove_utf8( GSList *slist, const gchar *text ); gchar **na_core_utils_slist_to_array( GSList *slist ); gchar *na_core_utils_slist_to_text( GSList *slist ); GSList *na_core_utils_slist_setup_element( GSList *list, const gchar *element, gboolean set ); guint na_core_utils_slist_count( GSList *list, const gchar *str ); gboolean na_core_utils_slist_find_negated( GSList *list, const gchar *str ); gboolean na_core_utils_slist_are_equal( GSList *a, GSList *b ); void na_core_utils_slist_free( GSList *slist ); /* some functions for GString manipulations. */ gchar *na_core_utils_gstring_joinv( const gchar *start, const gchar *separator, gchar **list ); /* selection count */ void na_core_utils_selcount_get_ope_int( const gchar *selection_count, gchar **ope, gchar **uint ); /* directory management */ gboolean na_core_utils_dir_is_writable_path( const gchar *path ); gboolean na_core_utils_dir_is_writable_uri ( const gchar *uri ); void na_core_utils_dir_list_perms ( const gchar *path, const gchar *message ); void na_core_utils_dir_split_ext ( const gchar *string, gchar **first, gchar **ext ); /* file management */ gboolean na_core_utils_file_delete ( const gchar *path ); gboolean na_core_utils_file_exists ( const gchar *uri ); gboolean na_core_utils_file_is_loadable ( const gchar *uri ); void na_core_utils_file_list_perms ( const gchar *path, const gchar *message ); gchar *na_core_utils_file_load_from_uri( const gchar *uri, gsize *length ); /* miscellaneous */ void na_core_utils_print_version( void ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_CORE_UTILS_H__ */ nautilus-actions-3.2.3/src/api/na-object-action.h0000644000175100017500000000672112212601376016577 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_OBJECT_ACTION_H__ #define __NAUTILUS_ACTIONS_API_NA_OBJECT_ACTION_H__ /** * SECTION: object-action * @title: NAObjectAction * @short_description: The Action Class Definition * @include: nautilus-actions/na-object-action.h * * This is the class which maintains data and properties of a &prodname; * action. * * * * Edition status * * As a particular rule for a #NAObjectItem -derived class, * a #NAObjectAction is considered modified as soon as any of * its profiles has been modified itself * (because they are saved as a whole). * * * */ #include "na-object-item.h" #include "na-object-profile.h" G_BEGIN_DECLS #define NA_TYPE_OBJECT_ACTION ( na_object_action_get_type()) #define NA_OBJECT_ACTION( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_OBJECT_ACTION, NAObjectAction )) #define NA_OBJECT_ACTION_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_OBJECT_ACTION, NAObjectActionClass )) #define NA_IS_OBJECT_ACTION( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_OBJECT_ACTION )) #define NA_IS_OBJECT_ACTION_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_OBJECT_ACTION )) #define NA_OBJECT_ACTION_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_OBJECT_ACTION, NAObjectActionClass )) typedef struct _NAObjectActionPrivate NAObjectActionPrivate; typedef struct { /*< private >*/ NAObjectItem parent; NAObjectActionPrivate *private; } NAObjectAction; typedef struct _NAObjectActionClassPrivate NAObjectActionClassPrivate; typedef struct { /*< private >*/ NAObjectItemClass parent; NAObjectActionClassPrivate *private; } NAObjectActionClass; GType na_object_action_get_type( void ); NAObjectAction *na_object_action_new( void ); NAObjectAction *na_object_action_new_with_profile( void ); NAObjectAction *na_object_action_new_with_defaults( void ); gchar *na_object_action_get_new_profile_name( const NAObjectAction *action ); void na_object_action_attach_profile( NAObjectAction *action, NAObjectProfile *profile ); void na_object_action_set_last_version( NAObjectAction *action ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_OBJECT_ACTION_H__ */ nautilus-actions-3.2.3/src/api/na-icontext.h0000644000175100017500000001045712212601376015714 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_ICONTEXT_H__ #define __NAUTILUS_ACTIONS_API_NA_ICONTEXT_H__ /** * SECTION: icontext * @title: NAIContext * @short_description: The Contextual Interface * @include: nautilus-actions/na-icontext.h * * This interface is implemented by all #NAObject -derived objects * whose the display in the Nautilus context menu is subject to some * conditions. * * Implementors, typically #NAObjectAction, #NAObjectProfile and * #NAObjectMenu, host the required data as #NADataBoxed in a dedicated * NA_FACTORY_CONDITIONS_GROUP data group. */ #include G_BEGIN_DECLS #define NA_TYPE_ICONTEXT ( na_icontext_get_type()) #define NA_ICONTEXT( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_TYPE_ICONTEXT, NAIContext )) #define NA_IS_ICONTEXT( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NA_TYPE_ICONTEXT )) #define NA_ICONTEXT_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_TYPE_ICONTEXT, NAIContextInterface )) typedef struct _NAIContext NAIContext; typedef struct _NAIContextInterfacePrivate NAIContextInterfacePrivate; /** * NAIContextInterface: * @is_candidate: determines if the given NAObject-derived object is * candidate to display in Nautilus. * * This interface manages all conditions relevant to a displayable status * in Nautilus. */ typedef struct { /*< private >*/ GTypeInterface parent; NAIContextInterfacePrivate *private; /*< public >*/ /** * is_candidate: * @object: this NAIContext object. * @target: the initial target which triggered this function's stack. * This target is defined in na-object-item.h. * @selection: the current selection as a GList of NautilusFileInfo. * * The NAIContext implementor may take advantage of this * virtual function to check for its own specific data. Only if the * implementor does return %TRUE (or just doesn't implement this * virtual), the conditions themselves will be checked. * * Returns: %TRUE if the @object may be a potential candidate, %FALSE * else. * * Since: 2.30 */ gboolean ( *is_candidate )( NAIContext *object, guint target, GList *selection ); } NAIContextInterface; GType na_icontext_get_type( void ); gboolean na_icontext_are_equal ( const NAIContext *a, const NAIContext *b ); gboolean na_icontext_is_candidate ( const NAIContext *context, guint target, GList *selection ); gboolean na_icontext_is_valid ( const NAIContext *context ); void na_icontext_check_mimetypes ( const NAIContext *context ); void na_icontext_copy ( NAIContext *context, const NAIContext *source ); void na_icontext_read_done ( NAIContext *context ); void na_icontext_set_scheme ( NAIContext *context, const gchar *scheme, gboolean selected ); void na_icontext_set_only_desktop( NAIContext *context, const gchar *desktop, gboolean selected ); void na_icontext_set_not_desktop ( NAIContext *context, const gchar *desktop, gboolean selected ); void na_icontext_replace_folder ( NAIContext *context, const gchar *old, const gchar *new ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_ICONTEXT_H__ */ nautilus-actions-3.2.3/src/api/na-object-item.h0000644000175100017500000001104712212601376016255 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_OBJECT_ITEM_H__ #define __NAUTILUS_ACTIONS_API_NA_OBJECT_ITEM_H__ /** * SECTION: object-item * @title: NAObjectItem * @short_description: The Object Item Base Class Definition * @include: nautilus-actions/na-object-item.h * * This is a pure virtual class, i.e. not an instantiatable one, but * serves as the base class for #NAObjectAction and #NAObjectMenu. */ #include "na-object-id.h" G_BEGIN_DECLS #define NA_TYPE_OBJECT_ITEM ( na_object_item_get_type()) #define NA_OBJECT_ITEM( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_OBJECT_ITEM, NAObjectItem )) #define NA_OBJECT_ITEM_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_OBJECT_ITEM, NAObjectItemClass )) #define NA_IS_OBJECT_ITEM( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_OBJECT_ITEM )) #define NA_IS_OBJECT_ITEM_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_OBJECT_ITEM )) #define NA_OBJECT_ITEM_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_OBJECT_ITEM, NAObjectItemClass )) typedef struct _NAObjectItemPrivate NAObjectItemPrivate; typedef struct { /*< private >*/ NAObjectId parent; NAObjectItemPrivate *private; } NAObjectItem; typedef struct _NAObjectItemClassPrivate NAObjectItemClassPrivate; typedef struct { /*< private >*/ NAObjectIdClass parent; NAObjectItemClassPrivate *private; } NAObjectItemClass; /** * NAItemTarget: * @ITEM_TARGET_SELECTION: when targeting the selection context menu. * @ITEM_TARGET_LOCATION: when targeting the background context menu. * @ITEM_TARGET_TOOLBAR: when targeting the toolbar. * @ITEM_TARGET_ANY: a wilcard target defined in order to be able * to activate an action from a keyboard shortcut, * while keeping this same action hidden from the UI. * * The #NAItemTarget mode is Nautilus-driven. It determines in which part * of the Nautilus UI our actions will be displayed. */ typedef enum { ITEM_TARGET_SELECTION = 1, ITEM_TARGET_LOCATION, ITEM_TARGET_TOOLBAR, ITEM_TARGET_ANY } NAItemTarget; GType na_object_item_get_type( void ); NAObjectId *na_object_item_get_item ( const NAObjectItem *item, const gchar *id ); gint na_object_item_get_position( const NAObjectItem *item, const NAObjectId *child ); void na_object_item_append_item ( NAObjectItem *item, const NAObjectId *child ); void na_object_item_insert_at ( NAObjectItem *item, const NAObjectId *child, gint pos ); void na_object_item_insert_item ( NAObjectItem *item, const NAObjectId *child, const NAObjectId *before ); void na_object_item_remove_item ( NAObjectItem *item, const NAObjectId *child ); guint na_object_item_get_items_count( const NAObjectItem *item ); void na_object_item_count_items ( GList *items, gint *menus, gint *actions, gint *profiles, gboolean recurse ); GList *na_object_item_copyref_items( GList *items ); GList *na_object_item_free_items ( GList *items ); void na_object_item_deals_with_version ( NAObjectItem *item ); void na_object_item_rebuild_children_slist( NAObjectItem *item ); gboolean na_object_item_is_finally_writable ( const NAObjectItem *item, guint *reason ); void na_object_item_set_writability_status( NAObjectItem *item, gboolean writable, guint reason ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_OBJECT_ITEM_H__ */ nautilus-actions-3.2.3/src/api/na-iduplicable.h0000644000175100017500000001747512212601376016343 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_IDUPLICABLE_H__ #define __NAUTILUS_ACTIONS_API_NA_IDUPLICABLE_H__ /** * SECTION: iduplicable * @title: NAIDuplicable * @short_description: The Duplication Interface * @include: nautilus-actions/private/na-iduplicable.h * * This interface is implemented by #NAObject in order to let * #NAObject -derived instance duplication be easily tracked. This works * by keeping a pointer on the original object at duplication time, and * then only checking edition status when explicitely required. * * As the reference count of the original object is not incremented * here, the caller has to garantee itself that the original object * will stay in life at least as long as the duplicated one. * * * * Modification status in Nautilus-Actions configuration tool * * * * * Objects whose origin is NULL are considered as modified ; this is * in particular the case of new, pasted, imported and dropped * objects. * * * * * when a new object, whether is is really new or it has been pasted, * imported or dropped, is inserted somewhere in the tree, its * immediate parent is also marked as modified. * * * * * Check for edition status, which positions modification and validity * status, is not recursive ; it is the responsability of the * implementation to check for edition status of children of object.. * * * * * * * Versions historic * * Historic of the versions of the #NAIDuplicable interface * * * * * * * &prodname; version * #NAIDuplicable interface version * * * * * * since 2.30 * 1 * current version * * * *
*
*/ #include G_BEGIN_DECLS #define NA_TYPE_IDUPLICABLE ( na_iduplicable_get_type()) #define NA_IDUPLICABLE( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_TYPE_IDUPLICABLE, NAIDuplicable )) #define NA_IS_IDUPLICABLE( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NA_TYPE_IDUPLICABLE )) #define NA_IDUPLICABLE_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_TYPE_IDUPLICABLE, NAIDuplicableInterface )) typedef struct _NAIDuplicable NAIDuplicable; typedef struct _NAIDuplicableInterfacePrivate NAIDuplicableInterfacePrivate; /** * NAIDuplicableInterface: * @copy: copies one object to another. * @are_equal: tests if two objects are equals. * @is_valid: tests if one object is valid. * * This interface is implemented by #NAObject objects, in order to be able * to keep the trace of all duplicated objects. */ typedef struct { /*< private >*/ GTypeInterface parent; NAIDuplicableInterfacePrivate *private; /*< public >*/ /** * copy: * @target: the #NAIDuplicable target of the copy. * @source: the #NAIDuplicable source of the copy. * @mode: the duplication mode. * * Copies data from @source to @ŧarget, so that @target becomes an * exact copy of @source. * * Each derived class of the implementation should define this * function to copy its own data. The implementation should take * care itself of calling each function in the class hierarchy, * from topmost base class to most-derived one. * * Since: 2.30 */ void ( *copy ) ( NAIDuplicable *target, const NAIDuplicable *source, guint mode ); /** * are_equal: * @a: a first #NAIDuplicable object. * @b: a second #NAIDuplicable object to be compared to the first * one. * * Compares the two objects. * * Each derived class of the implementation should define this * function to compare its own data. The implementation should take * care itself of calling each function in the class hierarchy, * from topmost base class to most-derived one. * * When testing for the modification status of an object, @a stands for * the original object, while @b stands for the duplicated one. * * Returns: TRUE if @a and @b are identical, FALSE else. * * Since: 2.30 */ gboolean ( *are_equal ) ( const NAIDuplicable *a, const NAIDuplicable *b ); /** * is_valid: * @object: the NAIDuplicable object to be checked. * * Checks @object for validity. * * Each derived class of the implementation should define this * function to compare its own data. The implementation should take * care itself of calling each function in the class hierarchy, * from topmost base class to most-derived one. * * Returns: TRUE if @object is valid, FALSE else. * * Since: 2.30 */ gboolean ( *is_valid ) ( const NAIDuplicable *object ); } NAIDuplicableInterface; #define IDUPLICABLE_SIGNAL_MODIFIED_CHANGED "iduplicable-modified-changed" #define IDUPLICABLE_SIGNAL_VALID_CHANGED "iduplicable-valid-changed" /** * DuplicateMode: * @DUPLICATE_ONLY: only duplicates the provided object. * @DUPLICATE_OBJECT: only duplicate a menu * (a menu with some subitems is duplicated to an empty menu) * @DUPLICATE_REC: recursively duplicates all the provided hierarchy. */ typedef enum { DUPLICATE_ONLY = 1, DUPLICATE_OBJECT, DUPLICATE_REC } DuplicableMode; GType na_iduplicable_get_type ( void ); void na_iduplicable_dispose ( const NAIDuplicable *object ); void na_iduplicable_dump ( const NAIDuplicable *object ); NAIDuplicable *na_iduplicable_duplicate ( const NAIDuplicable *object, guint mode ); void na_iduplicable_check_status ( const NAIDuplicable *object ); NAIDuplicable *na_iduplicable_get_origin ( const NAIDuplicable *object ); gboolean na_iduplicable_is_valid ( const NAIDuplicable *object ); gboolean na_iduplicable_is_modified ( const NAIDuplicable *object ); void na_iduplicable_set_origin ( NAIDuplicable *object, const NAIDuplicable *origin ); void na_iduplicable_register_consumer( GObject *consumer ); #ifdef NA_ENABLE_DEPRECATED void na_iduplicable_set_modified( NAIDuplicable *object, gboolean modified ); #endif G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_IDUPLICABLE_H__ */ nautilus-actions-3.2.3/src/api/na-iexporter.h0000644000175100017500000004274312212601376016103 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_IEXPORTER_H__ #define __NAUTILUS_ACTIONS_API_NA_IEXPORTER_H__ /** * SECTION: iexporter * @title: NAIExporter * @short_description: The Export Interface * @include: nautilus-actions/na-iexporter.h * * The #NAIExporter interface exports items to the outside world. Each * implementation may provide one or more formats. * * * Export format identifier * * For its own internal needs, &prodname; requires that each export * format have its own identifier, as an ASCII string. * * * In order to avoid any collision, this export format identifier is * allocated by the &prodname; maintainers team. If you wish provide * yourself a new export format, and so need a new export format identifier, * please contact the maintainers (see nautilus-actions.doap at the * root of the source tree). * * * Below is a list of currently allocated export format identifiers. * This list has been last updated on 2010, July 28th. * * * Currently allocated export format identifiers * * * * * * * * Identifier * Name * Holder * Allocated on * * * * * Ask * Reserved for &prodname; internal needs * &prodname; * 2010-02-15 * * * Desktop1 * NA Desktop module * &prodname; * 2010-07-28 * * * GConfSchemaV1 * NA XML module * &prodname; * 2010-02-15 * * * GConfSchemaV2 * NA XML module * &prodname; * 2010-02-15 * * * GConfEntry * NA XML module * &prodname; * 2010-02-15 * * * *
*
* * * Versions historic * * Historic of the versions of the #NAIExporter interface * * * * * * * * &prodname; version * #NAIExporter interface version * * * * * * * from 2.30 to 3.1.5 * 1 * * deprecated * * * since 3.2 * 2 * current version * * * * *
*
*/ #include #include "na-object-item.h" G_BEGIN_DECLS #define NA_TYPE_IEXPORTER ( na_iexporter_get_type()) #define NA_IEXPORTER( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_TYPE_IEXPORTER, NAIExporter )) #define NA_IS_IEXPORTER( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NA_TYPE_IEXPORTER )) #define NA_IEXPORTER_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_TYPE_IEXPORTER, NAIExporterInterface )) typedef struct _NAIExporter NAIExporter; typedef struct _NAIExporterInterfacePrivate NAIExporterInterfacePrivate; #ifdef NA_ENABLE_DEPRECATED /** * NAIExporterFormat: * @format: format identifier (ascii). * @label: short label to be displayed in dialog (UTF-8 localized) * @description: full description of the format (UTF-8 localized); * mainly used in the export assistant. * * This structure describes a supported output format. * It must be provided by each #NAIExporter implementation * (see e.g. src/io-xml/naxml-formats.c). * * When listing available export formats, the instance returns a #GList * of these structures. * * Deprecated: 3.2 */ typedef struct { gchar *format; gchar *label; gchar *description; } NAIExporterFormat; /** * NAIExporterFileParms: * @version: [in] version of this structure; * since structure version 1. * @exported: [in] exported NAObjectItem-derived object; * since structure version 1. * @folder: [in] URI of the target folder; * since structure version 1. * @format: [in] export format as a GQuark; * since structure version 1. * @basename: [out] basename of the exported file; * since structure version 1. * @messages: [in/out] a #GSList list of localized strings; * the provider may append messages to this list, * but shouldn't reinitialize it; * since structure version 1. * * The structure that the implementation receives as a parameter of * #NAIExporterInterface.to_file () interface method. * * Deprecated: 3.2 */ typedef struct { guint version; NAObjectItem *exported; gchar *folder; GQuark format; gchar *basename; GSList *messages; } NAIExporterFileParms; /** * NAIExporterBufferParms: * @version: [in] version of this structure; * since structure version 1. * @exported: [in] exported NAObjectItem-derived object; * since structure version 1. * @format: [in] export format as a GQuark; * since structure version 1. * @buffer: [out] buffer which contains the exported object; * since structure version 1. * @messages: [in/out] a #GSList list of localized strings; * the provider may append messages to this list, * but shouldn't reinitialize it; * since structure version 1. * * The structure that the plugin receives as a parameter of * #NAIExporterInterface.to_buffer () interface method. * * Deprecated: 3.2 */ typedef struct { guint version; NAObjectItem *exported; GQuark format; gchar *buffer; GSList *messages; } NAIExporterBufferParms; #endif /* NA_ENABLE_DEPRECATED */ /** * NAIExporterFormatv2: * @version: the version of this #NAIExporterFormatv2 structure; * equals to 2; * since structure version 1. * @provider: the #NAIExporter provider for this format; * since structure version 2. * @format: format identifier (ascii, allocated by the Nautilus-Actions team); * since structure version 2. * @label: short label to be displayed in dialog (UTF-8 localized); * since structure version 2. * @description: full description of the format (UTF-8 localized); * mainly used as a tooltip; * since structure version 2. * @pixbuf: an image to be associated with this export format; * this pixbuf is supposed to be rendered with GTK_ICON_SIZE_DIALOG size; * since structure version 2. * * This structure describes a supported output format. * It must be provided by each #NAIExporter implementation * (see e.g. src/io-xml/naxml-formats.c). * * When listing available export formats, the @provider must return a #GList * of these structures. * * * Versions historic * * Historic of the versions of the #NAIExporterFormatv2 structure * * * * * * * &prodname; version * #NAIExporterFormatv2 structure version * * * * * * since 2.30 * 1 * * * * since 3.2 * 2 * current version * * * *
*
* * Since: 3.2 */ typedef struct { guint version; NAIExporter *provider; gchar *format; gchar *label; gchar *description; GdkPixbuf *pixbuf; } NAIExporterFormatv2; /** * NAIExporterFileParmsv2: * @version: [in] version of this structure; * equals to 2; * since structure version 1. * @content: [in] version of the content of this structure; * equals to 1; * since structure version 2. * @exported: [in] exported NAObjectItem-derived object; * since structure version 1. * @folder: [in] URI of the target folder; * since structure version 1. * @format: [in] export format string identifier; * since structure version 1. * @basename: [out] basename of the exported file; * since structure version 1. * @messages: [in/out] a #GSList list of localized strings; * the provider may append messages to this list, * but shouldn't reinitialize it; * since structure version 1. * * The structure that the plugin receives as a parameter of * #NAIExporterInterface.to_file () interface method. * * Since: 3.2 */ typedef struct { guint version; guint content; NAObjectItem *exported; gchar *folder; gchar *format; gchar *basename; GSList *messages; } NAIExporterFileParmsv2; /** * NAIExporterBufferParmsv2: * @version: [in] version of this structure; * equals to 2; * since structure version 1. * @content: [in] version of the content of this structure; * equals to 1; * since structure version 2. * @exported: [in] exported NAObjectItem-derived object; * since structure version 1. * @format: [in] export format string identifier; * since structure version 2. * @buffer: [out] buffer which contains the exported object; * since structure version 1. * @messages: [in/out] a #GSList list of localized strings; * the provider may append messages to this list, * but shouldn't reinitialize it; * since structure version 1. * * The structure that the plugin receives as a parameter of * #NAIExporterInterface.to_buffer () interface method. * * Since: 3.2 */ typedef struct { guint version; guint content; NAObjectItem *exported; gchar *format; gchar *buffer; GSList *messages; } NAIExporterBufferParmsv2; /** * NAIExporterInterface: * @get_version: [should] returns the version of this interface the plugin implements. * @get_name: [should] returns the public plugin name. * @get_formats: [should] returns the list of supported formats. * @free_formats: [should] free a list of formats * @to_file: [should] exports an item to a file. * @to_buffer: [should] exports an item to a buffer. * * This defines the interface that a #NAIExporter should implement. */ typedef struct { /*< private >*/ GTypeInterface parent; NAIExporterInterfacePrivate *private; /*< public >*/ /** * get_version: * @instance: this NAIExporter instance. * * Nautilus-Actions calls this method each time it needs to know * which version of this interface the plugin implements. * * If this method is not implemented by the plugin, * Nautilus-Actions considers that the plugin only implements * the version 1 of the NAIImporter interface. * * Return value: if implemented, this method must return the version * number of this interface the I/O provider is supporting. * * Defaults to 1. * * Since: 2.30 */ guint ( *get_version )( const NAIExporter *instance ); /** * get_name: * @instance: this NAIExporter instance. * * Return value: if implemented, the method should return the name to be * displayed, as a newly allocated string which will be g_free() by the * caller. * * This may be the name of the module itself, but this also may be a * special name the modules gives to this interface. * * Defaults to a NULL string. * * Since: 2.30 */ gchar * ( *get_name ) ( const NAIExporter *instance ); /** * get_formats: * @instance: this NAIExporter instance. * * For its own internal needs, Nautilus-Actions requires each export * format has its own unique identifier (in fact, just a small ASCII * string). * * To avoid any collision, the format identifier is allocated by the * Nautilus-Actions maintainers team. If you wish develop a new export * format, and so need a new format identifier, please contact the * maintainers (see nautilus-actions.doap). * * Return value: * - Interface v1: * a null-terminated list of NAIExporterFormat structures * which describes the formats supported by this NAIExporter * provider. * The returned list is owned by the NAIExporter provider, * and should not be freed nor released by the caller. * * - Interface v2: * a GList of NAIExporterFormatv2 structures * which describes the formats supported by this NAIExporter * provider. * The caller should then invoke the free_formats() method * in order the provider be able to release the resources * allocated to the list. * * Defaults to NULL (no format at all). * * Since: 2.30 */ void * ( *get_formats )( const NAIExporter *instance ); /** * free_formats: * @instance: this NAIExporter instance. * @formats: a null-terminated list of NAIExporterFormatv2 structures, * as returned by get_formats() method above. * * Free the resources allocated to the @formats list. * * Since: 3.2 */ void ( *free_formats )( const NAIExporter *instance, GList *formats ); /** * to_file: * @instance: this NAIExporter instance. * @parms: a NAIExporterFileParmsv2 structure. * * Exports the specified 'exported' to the target 'folder' in the required * 'format'. * * Return value: the NAIExporterExportStatus status of the operation. * * Since: 2.30 */ guint ( *to_file ) ( const NAIExporter *instance, NAIExporterFileParmsv2 *parms ); /** * to_buffer: * @instance: this NAIExporter instance. * @parms: a NAIExporterFileParmsv2 structure. * * Exports the specified 'exported' to a newly allocated 'buffer' in * the required 'format'. The allocated 'buffer' will be g_free() * by the caller. * * Return value: the NAIExporterExportStatus status of the operation. * * Since: 2.30 */ guint ( *to_buffer ) ( const NAIExporter *instance, NAIExporterBufferParmsv2 *parms ); } NAIExporterInterface; /** * NAIExporterExportStatus: * @NA_IEXPORTER_CODE_OK: export OK. * @NA_IEXPORTER_CODE_INVALID_ITEM: exported item was found invalid. * @NA_IEXPORTER_CODE_INVALID_TARGET: selected target was found invalid. * @NA_IEXPORTER_CODE_INVALID_FORMAT: asked format was found invalid. * @NA_IEXPORTER_CODE_UNABLE_TO_WRITE: unable to write the item. * @NA_IEXPORTER_CODE_ERROR: other undetermined error. * * The reasons for which an item may not have been exported */ typedef enum { NA_IEXPORTER_CODE_OK = 0, NA_IEXPORTER_CODE_INVALID_ITEM, NA_IEXPORTER_CODE_INVALID_TARGET, NA_IEXPORTER_CODE_INVALID_FORMAT, NA_IEXPORTER_CODE_UNABLE_TO_WRITE, NA_IEXPORTER_CODE_ERROR, } NAIExporterExportStatus; GType na_iexporter_get_type( void ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_IEXPORTER_H__ */ nautilus-actions-3.2.3/src/api/na-data-types.h0000644000175100017500000000577712212601376016143 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_DATA_TYPES_H__ #define __NAUTILUS_ACTIONS_API_NA_DATA_TYPES_H__ /** * SECTION: data-type * @title: NADataType * @short_description: The Data Factory Type Definitions * @include: nautilus-actions/na-data-types.h */ #include G_BEGIN_DECLS /** * NADataType: * @NA_DATA_TYPE_BOOLEAN: a boolean * can be initialized with "true" or "false" (case insensitive) * @NA_DATA_TYPE_POINTER: a ( void * ) pointer * @NA_DATA_TYPE_STRING: an ASCII string * @NA_DATA_TYPE_STRING_LIST: a list of ASCII strings * @NA_DATA_TYPE_LOCALE_STRING: a localized UTF-8 string * @NA_DATA_TYPE_UINT: an unsigned integer * @NA_DATA_TYPE_UINT_LIST: a list of unsigned integers * * Each elementary data which would take advantage of #NABoxed facilities * should be typed at instanciation time. * * #NAIFactoryProvider implementations should provide a primitive for reading * (resp. writing) a value for each of these elementary data types. * * * * Please note that this enumeration may be compiled in by the extensions. * They must so remain fixed, unless you are prepared to see strange effects * (e.g. an extension has been compiled with %NA_DATA_TYPE_STRING = 2, while you * have inserted another element, making it to 3 !) - or you know what * you are doing... * * * So, only add new items at the end of the enum. You have been warned! * * * * Since: 2.30 */ typedef enum { NA_DATA_TYPE_BOOLEAN = 1, NA_DATA_TYPE_POINTER, NA_DATA_TYPE_STRING, NA_DATA_TYPE_STRING_LIST, NA_DATA_TYPE_LOCALE_STRING, NA_DATA_TYPE_UINT, NA_DATA_TYPE_UINT_LIST, /*< private >*/ /* count of defined types */ NA_DATA_TYPE_N } NADataType; const gchar *na_data_types_get_gconf_dump_key( guint type ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_DATA_TYPES_H__ */ nautilus-actions-3.2.3/src/api/na-iio-provider.h0000644000175100017500000004450112212601376016464 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_IIO_PROVIDER_H__ #define __NAUTILUS_ACTIONS_API_NA_IIO_PROVIDER_H__ /** * SECTION: iio-provider * @title: NAIIOProvider * @short_description: The I/O Provider Interface * @include: nautilus-actions/na-iio-provider.h * * The #NAIIOProvider interface is defined in order to let both &prodname; * internal and user-provided external plugins provide read and write accesses * to their own private storage subsystem. * * &prodname; core does not provide by itself input/output code. Instead, * we entirely relies on input/output facilities provided by implementations * of this interface. * * &prodname; is bundled with several I/O providers. * Since version 3, the na-desktop I/O provider, which * implements the * DES-EMA * specification, is the preferred way of storing (and sharing) items. * * The #NAIIOProvider interface provides three types of services: * * * * * loading items * * * Loading items is used both by the &nautilus; plugin, by the * &nact; program, and by the command-line utilities. * * * * * * * creating, updating or deleting items * * * Updating items is a feature only used by the &nact; program and * by some command-line utilities. * * * * * * * informing &prodname; of extern modifications * * * The I/O provider should inform &prodname; when an item happens to * have been modified in the underlying storage subsystem. * * * * This feature is only used by the &nautilus; plugin and by the * &nact; program. * * * The #NAIIOProvider interface does not define specific monitoring * methods (but you can also take a glance at #NATimeout object). * Instead, it is waited that the I/O provider module takes care * itself of managing its own monitoring services at * load/unload time, calling the na_iio_provider_item_changed() * function when appropriate. * * * * * These services may be fully implemented by the I/O provider itself. * Or, the I/O provider may also prefer to take advantage of the data * factory management (see #NAIFactoryObject and #NAIFactoryProvider * interfaces) services. * * * I/O provider identifier * * For its own internal needs, &prodname; requires that each I/O provider * have its own identifier, as an ASCII string. * * * In order to avoid any collision, this I/O provider identifier is * allocated by the &prodname; maintainers team. If you wish develop * yourself a new I/O provider, and so need a new provider identifier, * please contact the maintainers (see nautilus-actions.doap at the * root of the source tree). * * * Below is a list of currently allocated I/O provider identifiers. * This list has been last updated on 2010, Feb. 14th. * * * Currently allocated I/O provider identifiers * * * * * * * * Identifier * Name * Holder * Allocated on * * * * * all * Reserved for &prodname; internal needs * &prodname; * 2010-01-28 * * * na-desktop * NA Desktop I/O Provider * &prodname; * 2009-12-16 * * * na-gconf * NA GConf I/O Provider * &prodname; * 2009-12-16 * * * na-xml * NA XML module * &prodname; * 2010-02-14 * * * *
*
* * * Versions historic * * Historic of the versions of the #NAIIOProvider interface * * * * * * * &prodname; version * #NAIIOProvider interface version * * * * * * since 2.30 * 1 * current version * * * *
*
*/ #include "na-object-item.h" G_BEGIN_DECLS #define NA_TYPE_IIO_PROVIDER ( na_iio_provider_get_type()) #define NA_IIO_PROVIDER( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_TYPE_IIO_PROVIDER, NAIIOProvider )) #define NA_IS_IIO_PROVIDER( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NA_TYPE_IIO_PROVIDER )) #define NA_IIO_PROVIDER_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_TYPE_IIO_PROVIDER, NAIIOProviderInterface )) typedef struct _NAIIOProvider NAIIOProvider; typedef struct _NAIIOProviderInterfacePrivate NAIIOProviderInterfacePrivate; /** * NAIIOProviderInterface: * @get_version: [should] returns the version of this interface that the * plugin implements. * @get_id: [must] returns the internal id of the plugin. * @get_name: [should] returns the public name of the plugin. * @read_items: [should] reads items. * @is_willing_to_write: [should] asks the plugin whether it is willing to write. * @is_able_to_write: [should] asks the plugin whether it is able to write. * @write_item: [should] writes an item. * @delete_item: [should] deletes an item. * @duplicate_data: [may] let the I/O provider duplicates its specific data. * * This defines the methods that a #NAIIOProvider may, should, or must * implement. */ typedef struct { /*< private >*/ GTypeInterface parent; NAIIOProviderInterfacePrivate *private; /*< public >*/ /** * get_version: * @instance: the NAIIOProvider provider. * * Nautilus-Actions calls this method each time it needs to know * which version of this interface the plugin implements. * * If this method is not implemented by the plugin, * Nautilus-Actions considers that the plugin only implements * the version 1 of the NAIIOProvider interface. * * Return value: if implemented, this method must return the version * number of this interface the I/O provider is supporting. * * Defaults to 1. * * Since: 2.30 */ guint ( *get_version ) ( const NAIIOProvider *instance ); /** * get_id: * @instance: the NAIIOProvider provider. * * The I/O provider must implement this method. * * Return value: the implementation must return the internal identifier * of the I/O provider, as a newly allocated string which will be g_free() * by the caller. * * Since: 2.30 */ gchar * ( *get_id ) ( const NAIIOProvider *instance ); /** * get_name: * @instance: the NAIIOProvider provider. * * Return value: if implemented, this method must return the display * name of the I/O provider, as a newly allocated string which will be * g_free() by the caller. * * This may be the name of the module itself, but this also may be a * special name the modules gives to this interface. * * Defaults to an empty string. * * Since: 2.30 */ gchar * ( *get_name ) ( const NAIIOProvider *instance ); /** * read_items: * @instance: the NAIIOProvider provider. * @messages: a pointer to a GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * Reads the whole items list from the specified I/O provider. * * The I/O provider should implement this method, but if it doesn't, * then this greatly lowerize the interest of this I/O provider (!). * * Return value: if implemented, this method must return a unordered * flat GList of NAObjectItem-derived objects (menus or actions); * the actions embed their own profiles. * * Defaults to NULL list. * * Since: 2.30 */ GList * ( *read_items ) ( const NAIIOProvider *instance, GSList **messages ); /** * is_willing_to_write: * @instance: the NAIIOProvider provider. * * The 'willing_to_write' property is intrinsic to the I/O provider. * It is not supposed to make any assumption on the environment it is * currently running on. * This property just says that the developer/maintainer has released * the needed code in order to update/create/delete NAObjectItem-derived * objects. * * Note that even if this property is TRUE, there is yet many * reasons for not being able to update/delete existing items or * create new ones (see e.g. is_able_to_write() method below). * * Return value: if implemented, this method must return a boolean * value, whose purpose is to let know to Nautilus-Actions whether * this I/O provider is, or not, willing to write. * * Defaults to FALSE. * * Since: 2.30 */ gboolean ( *is_willing_to_write )( const NAIIOProvider *instance ); /** * is_able_to_write: * @instance: the NAIIOProvider provider. * * The 'able_to_write' property is a runtime one. * When returning TRUE, the I/O provider insures that it has * successfully checked that it was able to write some things * down to its storage subsystem(s). * * The 'able_to_write' property is independent of the * 'willing_to_write' above, though it is only checked if the * I/O provider is actually willing to write. * * This condition is only relevant when trying to define new items, * to see if a willing_to provider is actually able to do write * operations. It it not relevant for updating/deleting already * existing items as they have already checked their own runtime * writability status when read from the storage subsystems. * * Note that even if this property is TRUE, there is yet many * reasons for not being able to update/delete existing items or * create new ones (see e.g. 'locked' user preference key). * * Return value: if implemented, this method must return a boolean * value, whose purpose is to let know to Nautilus-Actions whether * this I/O provider is eventually able to write. * * Defaults to FALSE. * * Since: 2.30 */ gboolean ( *is_able_to_write ) ( const NAIIOProvider *instance ); /** * write_item: * @instance: the NAIIOProvider provider. * @item: a NAObjectItem-derived item, menu or action. * @messages: a pointer to a GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * Writes a new @item down to the privat underlying storage subsystem * which happens to be managed by the I/O provider. * * There is no update_item function; it is the responsibility * of the provider to delete the previous version of an item before * actually writing the new one. * * The I/O provider should implement this method, or return * FALSE in is_willing_to_write() method above. * * Return value: NA_IIO_PROVIDER_CODE_OK if the write operation * was successful, or another code depending of the detected error. * * Since: 2.30 */ guint ( *write_item ) ( const NAIIOProvider *instance, const NAObjectItem *item, GSList **messages ); /** * delete_item: * @instance: the NAIIOProvider provider. * @item: a NAObjectItem-derived item, menu or action. * @messages: a pointer to a GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * Deletes an existing @item from the I/O subsystem. * * The I/O provider should implement this method, or return * FALSE in is_willing_to_write() method above. * * Return value: NA_IIO_PROVIDER_CODE_OK if the delete operation was * successful, or another code depending of the detected error. * * Since: 2.30 */ guint ( *delete_item ) ( const NAIIOProvider *instance, const NAObjectItem *item, GSList **messages ); /** * duplicate_data: * @instance: the NAIIOProvider provider. * @dest: a NAObjectItem-derived item, menu or action. * @source: a NAObjectItem-derived item, menu or action. * @messages: a pointer to a GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * Nautilus-Actions typically calls this method while duplicating * a NAObjectItem-derived object, in order to let the I/O provider * duplicates itself specific data (if any) it may have set on * @source object. * * Note that this does not duplicate in any way any * NAObjectItem-derived object. We are just dealing here with * the provider-specific data which may have been attached to * the NAObjectItem-derived object. * * Return value: NA_IIO_PROVIDER_CODE_OK if the duplicate operation * was successful, or another code depending of the detected error. * * Since: 2.30 */ guint ( *duplicate_data ) ( const NAIIOProvider *instance, NAObjectItem *dest, const NAObjectItem *source, GSList **messages ); } NAIIOProviderInterface; /* -- adding a new status here should imply also adding a new tooltip * -- in na_io_provider_get_readonly_tooltip(). */ /** * NAIIOProviderWritabilityStatus: * @NA_IIO_PROVIDER_STATUS_WRITABLE: item and i/o provider are writable. * @NA_IIO_PROVIDER_STATUS_UNAVAILABLE: unavailable i/o provider. * @NA_IIO_PROVIDER_STATUS_INCOMPLETE_API: i/o provider has an incomplete write api. * @NA_IIO_PROVIDER_STATUS_NOT_WILLING_TO: i/o provider is not willing to write. * @NA_IIO_PROVIDER_STATUS_NOT_ABLE_TO: i/o provider is not able to write. * @NA_IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN: i/o provider has been locked by the administrator. * @NA_IIO_PROVIDER_STATUS_LOCKED_BY_USER: i/o provider has been locked by the user. * @NA_IIO_PROVIDER_STATUS_ITEM_READONLY: item is read-only. * @NA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND: no writable i/o provider found. * @NA_IIO_PROVIDER_STATUS_LEVEL_ZERO: level zero is not writable. * @NA_IIO_PROVIDER_STATUS_UNDETERMINED: unknwon reason (and probably a bug). * * The reasons for which an item may not be writable. * * Not all reasons are to be managed at the I/O provider level. * Some are to be used only internally from &prodname; programs. */ typedef enum { NA_IIO_PROVIDER_STATUS_WRITABLE = 0, NA_IIO_PROVIDER_STATUS_UNAVAILABLE, NA_IIO_PROVIDER_STATUS_INCOMPLETE_API, NA_IIO_PROVIDER_STATUS_NOT_WILLING_TO, NA_IIO_PROVIDER_STATUS_NOT_ABLE_TO, NA_IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN, NA_IIO_PROVIDER_STATUS_LOCKED_BY_USER, NA_IIO_PROVIDER_STATUS_ITEM_READONLY, NA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND, NA_IIO_PROVIDER_STATUS_LEVEL_ZERO, NA_IIO_PROVIDER_STATUS_UNDETERMINED, /*< private >*/ NA_IIO_PROVIDER_STATUS_LAST, } NAIIOProviderWritabilityStatus; /* -- adding a new code here should imply also adding a new label * -- in #na_io_provider_get_return_code_label(). */ /** * NAIIOProviderOperationStatus: * @NA_IIO_PROVIDER_CODE_OK: the requested operation has been successful. * @NA_IIO_PROVIDER_CODE_PROGRAM_ERROR: a program error has been detected; * you should open a bug in * Bugzilla. * @NA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN: the provider is not willing * to do the requested action. * @NA_IIO_PROVIDER_CODE_WRITE_ERROR: a write error has been detected. * @NA_IIO_PROVIDER_CODE_DELETE_SCHEMAS_ERROR: the schemas could not be deleted. * @NA_IIO_PROVIDER_CODE_DELETE_CONFIG_ERROR: the configuration could not be deleted. * * The return code of operations. */ typedef enum { NA_IIO_PROVIDER_CODE_OK = 0, NA_IIO_PROVIDER_CODE_PROGRAM_ERROR = 1 + NA_IIO_PROVIDER_STATUS_LAST, NA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN, NA_IIO_PROVIDER_CODE_WRITE_ERROR, NA_IIO_PROVIDER_CODE_DELETE_SCHEMAS_ERROR, NA_IIO_PROVIDER_CODE_DELETE_CONFIG_ERROR, } NAIIOProviderOperationStatus; GType na_iio_provider_get_type ( void ); /* -- to be called by the I/O provider when an item has changed */ void na_iio_provider_item_changed( const NAIIOProvider *instance ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_IIO_PROVIDER_H__ */ nautilus-actions-3.2.3/src/api/na-timeout.h0000644000175100017500000000551712212601376015546 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_TIMEOUT_H__ #define __NAUTILUS_ACTIONS_API_NA_TIMEOUT_H__ /** * SECTION: timeout * @title: NATimeout * @short_description: The NATimeout Structure * @include: nautilus-actions/na-timeout.h * * The NATimeout structure is a convenience structure to manage timeout * functions. * * Since: 3.1 */ #include G_BEGIN_DECLS /** * NATimeoutFunc: * @user_data: data to be passed to the callback function. * * Prototype of the callback function. * * Since: 3.1 */ typedef void ( *NATimeoutFunc )( void *user_data ); /** * NATimeout: * @timeout: (i) timeout configurable parameter (ms) * @handler: (i) handler function * @user_data: (i) user data * * This structure let the user (i.e. the code which uses it) manage functions * which should only be called after some time of inactivity, which is typically * the case of 'item-change' handlers. * * The structure is supposed to be initialized at construction time with * @timeout in milliseconds, @handler and @user_data input parameters. * The private data should be set to %NULL. * * Such a structure must be allocated for each managed event. * * When an event is detected, the na_timeout_event() function must be called * with this structure. The function makes sure that the @handler callback * will be triggered as soon as no event will be recorded after @timeout * milliseconds of inactivity. * * Since: 3.1 */ typedef struct { /*< public >*/ guint timeout; NATimeoutFunc handler; gpointer user_data; /*< private >*/ GTimeVal last_time; guint source_id; } NATimeout; void na_timeout_event( NATimeout *timeout ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_TIMEOUT_H__ */ nautilus-actions-3.2.3/src/api/na-object-id.h0000644000175100017500000000770312212601376015717 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_OBJECT_ID_H__ #define __NAUTILUS_ACTIONS_API_NA_OBJECT_ID_H__ /** * SECTION: object-id * @title: NAObjectId * @short_description: The Identified Object Base Class Definition * @include: nautilus-actions/na-object-id.h * * This is a pure virtual class, i.e. not an instantiatable one. * It serves as the base class for #NAObject -derived object which have * a unique Id, i.e. for #NAObjectItem and #NAObjectProfile. */ #include "na-object.h" G_BEGIN_DECLS #define NA_TYPE_OBJECT_ID ( na_object_id_get_type()) #define NA_OBJECT_ID( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_OBJECT_ID, NAObjectId )) #define NA_OBJECT_ID_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_OBJECT_ID, NAObjectIdClass )) #define NA_IS_OBJECT_ID( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_OBJECT_ID )) #define NA_IS_OBJECT_ID_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_OBJECT_ID )) #define NA_OBJECT_ID_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_OBJECT_ID, NAObjectIdClass )) typedef struct _NAObjectIdPrivate NAObjectIdPrivate; typedef struct { /*< private >*/ NAObject parent; NAObjectIdPrivate *private; } NAObjectId; typedef struct _NAObjectIdClassPrivate NAObjectIdClassPrivate; /** * NAObjectIdClass: * @new_id: Allocate a new id to an existing NAObjectId. * * The #NAObjectIdClass defines some methods available to derived classes. */ typedef struct { /*< private >*/ NAObjectClass parent; NAObjectIdClassPrivate *private; /*< public >*/ /** * new_id: * @object: a NAObjectId object. * @new_parent: possibly the new NAObjectId parent, or NULL. * If not NULL, this should actually be a NAObjectItem. * * If @object is a NAObjectProfile, then @new_parent must be a * not null NAObjectAction. This function ensures that the new * profile name does not already exist in the given @new_parent. * * This is a pure virtual function which should be implemented by * the actual class. Actually, we asks for the most-derived class * which implements this function. * * Returns: a new id suitable for this @object. * * Since: 2.30 */ gchar * ( *new_id )( const NAObjectId *object, const NAObjectId *new_parent ); } NAObjectIdClass; GType na_object_id_get_type( void ); gint na_object_id_sort_alpha_asc ( const NAObjectId *a, const NAObjectId *b ); gint na_object_id_sort_alpha_desc ( const NAObjectId *a, const NAObjectId *b ); void na_object_id_prepare_for_paste( NAObjectId *object, gboolean relabel, gboolean renumber, NAObjectId *parent ); void na_object_id_set_copy_of_label( NAObjectId *object ); void na_object_id_set_new_id ( NAObjectId *object, const NAObjectId *new_parent ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_OBJECT_ID_H__ */ nautilus-actions-3.2.3/src/api/na-dbus.h0000644000175100017500000001131312212601376015004 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_DBUS_H__ #define __NAUTILUS_ACTIONS_API_NA_DBUS_H__ /** * SECTION: dbus * @title: D-Bus * @short_description: The D-Bus Services * @include: nautilus-actions/na-dbus.h * * &prodname;, through its tracker plugin, exposes * several D-Bus interfaces. These interfaces may be queried in order to get * informations about current selection, &prodname; status, and so on. * * * * To be really clear, &prodname; relies on &nautilus; in order * to be able to register its own D-Bus services via the * tracker plugin. * * * If &nautilus; does not run, or the tracker * plugin is not loaded at &nautilus; startup, then these D-Bus * services will not be available. * * */ #include G_BEGIN_DECLS /** * NAUTILUS_ACTIONS_DBUS_SERVICE: * * This is the « well-known » name that * &prodname; reserves on D-Bus session bus. */ #define NAUTILUS_ACTIONS_DBUS_SERVICE "org.nautilus-actions.DBus" /** * NAUTILUS_ACTIONS_DBUS_TRACKER_PATH: * * The D-Bus path of the tracker object. * * When requested through the Introspect of the * Introspectable D-Bus interface, the * tracker object returns following informations: * * * * dbus-send \ * --session \ * --type=method_call \ * --print-reply \ * --dest=org.nautilus-actions.DBus \ * /org/nautilus_actions/DBus/Tracker \ * org.freedesktop.DBus.Introspectable.Introspect * * * dest=:1.145 reply_serial=2 * string " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ]]> * * */ #define NAUTILUS_ACTIONS_DBUS_TRACKER_PATH "/org/nautilus_actions/DBus/Tracker" /** * NAUTILUS_ACTIONS_DBUS_TRACKER_IFACE: * * An interface defined on the tracker object, * identified by its %NAUTILUS_ACTIONS_DBUS_TRACKER_PATH D-Bus path. */ #define NAUTILUS_ACTIONS_DBUS_TRACKER_IFACE "org.nautilus_actions.DBus.Tracker.Properties1" G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_DBUS_H__ */ nautilus-actions-3.2.3/src/api/na-ifactory-object-data.h0000644000175100017500000001523112212601376020045 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_DATA_H__ #define __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_DATA_H__ /** * SECTION: data-name * @title: Constants * @short_description: The Data Factory Constant Definitions * @include: nautilus-actions/na-ifactory-object-data.h * * Each elementary data get its own name here. * * Through #NADataDef and #NADataGroup definitions, each #NAObjectItem * derived object which implement the #NAIFactoryObject interface will * dynamically define a property for each attached elementary data. */ #include G_BEGIN_DECLS /** * NA_FACTORY_OBJECT_ID_GROUP: * * #NAObjectId common data. */ #define NA_FACTORY_OBJECT_ID_GROUP "na-factory-group-id" #define NAFO_DATA_ID "na-factory-data-id" #define NAFO_DATA_LABEL "na-factory-data-label" #define NAFO_DATA_PARENT "na-factory-data-parent" #define NAFO_DATA_CONDITIONS "na-factory-data-conditions" /** * NA_FACTORY_OBJECT_ITEM_GROUP: * * #NAObjectItem common data. */ #define NA_FACTORY_OBJECT_ITEM_GROUP "na-factory-group-item" #define NAFO_DATA_IVERSION "na-factory-data-iversion" #define NAFO_DATA_TYPE "na-factory-data-type" #define NAFO_DATA_TOOLTIP "na-factory-data-tooltip" #define NAFO_DATA_ICON "na-factory-data-icon" #define NAFO_DATA_ICON_NOLOC "na-factory-data-unlocalized-icon" #define NAFO_DATA_DESCRIPTION "na-factory-data-description" #define NAFO_DATA_SHORTCUT "na-factory-data-shortcut" #define NAFO_DATA_SUBITEMS "na-factory-data-items" #define NAFO_DATA_SUBITEMS_SLIST "na-factory-data-items-slist" #define NAFO_DATA_ENABLED "na-factory-data-enabled" #define NAFO_DATA_READONLY "na-factory-data-readonly" #define NAFO_DATA_PROVIDER "na-factory-data-provider" #define NAFO_DATA_PROVIDER_DATA "na-factory-data-provider-data" /** * NA_FACTORY_OBJECT_ACTION_GROUP: * * #NAObjectAction specific datas. */ #define NA_FACTORY_OBJECT_ACTION_GROUP "na-factory-group-action" #define NAFO_DATA_VERSION "na-factory-data-version" #define NAFO_DATA_TARGET_SELECTION "na-factory-data-target-selection" #define NAFO_DATA_TARGET_LOCATION "na-factory-data-target-location" #define NAFO_DATA_TARGET_TOOLBAR "na-factory-data-target-toolbar" #define NAFO_DATA_TOOLBAR_LABEL "na-factory-data-toolbar-label" #define NAFO_DATA_TOOLBAR_SAME_LABEL "na-factory-data-toolbar-same-label" #define NAFO_DATA_LAST_ALLOCATED "na-factory-data-last-allocated" /** * NA_FACTORY_ACTION_V1_GROUP: * * A group of datas which are specific to v 1 actions. It happens to be * empty as all these datas have been alter embedded in #NAObjectItem * data group. */ #define NA_FACTORY_ACTION_V1_GROUP "na-factory-group-action-v1" /** * NA_FACTORY_OBJECT_MENU_GROUP: * * #NAObjectMenu specific datas. It happens to be empty as the definition * of a menu is very close of those of an action. */ #define NA_FACTORY_OBJECT_MENU_GROUP "na-factory-group-menu" /** * NA_FACTORY_OBJECT_PROFILE_GROUP: * * #NAObjectProfile specific datas. */ #define NA_FACTORY_OBJECT_PROFILE_GROUP "na-factory-group-profile" #define NAFO_DATA_DESCNAME "na-factory-data-descname" #define NAFO_DATA_DESCNAME_NOLOC "na-factory-data-unlocalized-descname" #define NAFO_DATA_PATH "na-factory-data-path" #define NAFO_DATA_PARAMETERS "na-factory-data-parameters" #define NAFO_DATA_WORKING_DIR "na-factory-data-working-dir" #define NAFO_DATA_EXECUTION_MODE "na-factory-data-execution-mode" #define NAFO_DATA_STARTUP_NOTIFY "na-factory-data-startup-notify" #define NAFO_DATA_STARTUP_WMCLASS "na-factory-data-startup-wm-class" #define NAFO_DATA_EXECUTE_AS "na-factory-data-execute-as" /** * NA_FACTORY_OBJECT_CONDITIONS_GROUP: * * The datas which determine the display conditions of a menu or an action. * * @see_also: #NAIContext interface. */ #define NA_FACTORY_OBJECT_CONDITIONS_GROUP "na-factory-group-conditions" #define NAFO_DATA_BASENAMES "na-factory-data-basenames" #define NAFO_DATA_MATCHCASE "na-factory-data-matchcase" #define NAFO_DATA_MIMETYPES "na-factory-data-mimetypes" #define NAFO_DATA_MIMETYPES_IS_ALL "na-factory-data-all-mimetypes" #define NAFO_DATA_ISFILE "na-factory-data-isfile" #define NAFO_DATA_ISDIR "na-factory-data-isdir" #define NAFO_DATA_MULTIPLE "na-factory-data-multiple" #define NAFO_DATA_SCHEMES "na-factory-data-schemes" #define NAFO_DATA_FOLDERS "na-factory-data-folders" #define NAFO_DATA_SELECTION_COUNT "na-factory-data-selection-count" #define NAFO_DATA_ONLY_SHOW "na-factory-data-only-show-in" #define NAFO_DATA_NOT_SHOW "na-factory-data-not-show-in" #define NAFO_DATA_TRY_EXEC "na-factory-data-try-exec" #define NAFO_DATA_SHOW_IF_REGISTERED "na-factory-data-show-if-registered" #define NAFO_DATA_SHOW_IF_TRUE "na-factory-data-show-if-true" #define NAFO_DATA_SHOW_IF_RUNNING "na-factory-data-show-if-running" #define NAFO_DATA_CAPABILITITES "na-factory-data-capabilitites" G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_DATA_H__ */ nautilus-actions-3.2.3/src/api/na-ifactory-provider-provider.h0000644000175100017500000000267212212601376021357 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_IFACTORY_PROVIDER_PROVIDER_H__ #define __NAUTILUS_ACTIONS_API_NA_IFACTORY_PROVIDER_PROVIDER_H__ #include G_BEGIN_DECLS typedef struct _NAIFactoryProvider NAIFactoryProvider; G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_IFACTORY_PROVIDER_PROVIDER_H__ */ nautilus-actions-3.2.3/src/api/na-gconf-monitor.h0000644000175100017500000000622512212601376016636 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_GCONF_MONITOR_H__ #define __NAUTILUS_ACTIONS_API_NA_GCONF_MONITOR_H__ #ifdef HAVE_GCONF #ifdef NA_ENABLE_DEPRECATED /** * SECTION: gconf-monitor * @title: NAGConfMonitor * @short_description: The GConf Monitoring Class Definition * @include: nautilus-actions/na-gconf-monitor.h * * This class manages the GConf monitoring. * It is used to monitor both the GConf provider and the GConf runtime * preferences. * * Starting with Nautilus-Actions 3.1.0, GConf, whether it is used as a * preference storage subsystem or as an I/O provider, is deprecated. */ #include G_BEGIN_DECLS #define NA_GCONF_MONITOR_TYPE ( na_gconf_monitor_get_type()) #define NA_GCONF_MONITOR( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_GCONF_MONITOR_TYPE, NAGConfMonitor )) #define NA_GCONF_MONITOR_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_GCONF_MONITOR_TYPE, NAGConfMonitorClass )) #define NA_IS_GCONF_MONITOR( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_GCONF_MONITOR_TYPE )) #define NA_IS_GCONF_MONITOR_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_GCONF_MONITOR_TYPE )) #define NA_GCONF_MONITOR_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_GCONF_MONITOR_TYPE, NAGConfMonitorClass )) typedef struct _NAGConfMonitorPrivate NAGConfMonitorPrivate; typedef struct { /*< private >*/ GObject parent; NAGConfMonitorPrivate *private; } NAGConfMonitor; typedef struct _NAGConfMonitorClassPrivate NAGConfMonitorClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NAGConfMonitorClassPrivate *private; } NAGConfMonitorClass; GType na_gconf_monitor_get_type( void ); NAGConfMonitor *na_gconf_monitor_new( const gchar *path, GConfClientNotifyFunc handler, gpointer user_data ); void na_gconf_monitor_release_monitors( GList *monitors ); G_END_DECLS #endif /* NA_ENABLE_DEPRECATED */ #endif /* HAVE_GCONF */ #endif /* __NAUTILUS_ACTIONS_API_NA_GCONF_MONITOR_H__ */ nautilus-actions-3.2.3/src/api/na-boxed.h0000644000175100017500000000717012212601376015156 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_BOXED_H__ #define __NAUTILUS_ACTIONS_API_NA_BOXED_H__ /** * SECTION: boxed * @title: NABoxed * @short_description: The NABoxed Structure * @include: nautilus-actions/na-boxed.h * * The NABoxed structure is a way of handling various types of data in an * opaque structure. * * Since: 3.1 */ #include G_BEGIN_DECLS #define NA_TYPE_BOXED ( na_boxed_get_type()) #define NA_BOXED( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_BOXED, NABoxed )) #define NA_BOXED_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_BOXED, NABoxedClass )) #define NA_IS_BOXED( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_BOXED )) #define NA_IS_BOXED_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_BOXED )) #define NA_BOXED_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_BOXED, NABoxedClass )) typedef struct _NABoxedPrivate NABoxedPrivate; typedef struct { /*< private >*/ GObject parent; NABoxedPrivate *private; } NABoxed; typedef struct _NABoxedClassPrivate NABoxedClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NABoxedClassPrivate *private; } NABoxedClass; GType na_boxed_get_type ( void ); void na_boxed_set_type ( NABoxed *boxed, guint type ); gboolean na_boxed_are_equal ( const NABoxed *a, const NABoxed *b ); NABoxed *na_boxed_copy ( const NABoxed *boxed ); void na_boxed_dump ( const NABoxed *boxed ); NABoxed *na_boxed_new_from_string( guint type, const gchar *string ); gboolean na_boxed_get_boolean ( const NABoxed *boxed ); gconstpointer na_boxed_get_pointer ( const NABoxed *boxed ); gchar *na_boxed_get_string ( const NABoxed *boxed ); GSList *na_boxed_get_string_list( const NABoxed *boxed ); guint na_boxed_get_uint ( const NABoxed *boxed ); GList *na_boxed_get_uint_list ( const NABoxed *boxed ); void na_boxed_get_as_value ( const NABoxed *boxed, GValue *value ); void *na_boxed_get_as_void ( const NABoxed *boxed ); void na_boxed_set_from_boxed ( NABoxed *boxed, const NABoxed *value ); void na_boxed_set_from_string( NABoxed *boxed, const gchar *value ); void na_boxed_set_from_value ( NABoxed *boxed, const GValue *value ); void na_boxed_set_from_void ( NABoxed *boxed, const void *value ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_BOXED_H__ */ nautilus-actions-3.2.3/src/api/Makefile.am0000644000175100017500000000360312212601376015341 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) api_includedir = $(pkgincludedir) api_include_HEADERS = \ na-extension.h \ \ na-dbus.h \ na-iexporter.h \ na-iimporter.h \ na-ifactory-provider.h \ na-ifactory-provider-provider.h \ na-iio-provider.h \ \ na-boxed.h \ na-core-utils.h \ na-data-boxed.h \ na-data-def.h \ na-data-types.h \ na-gconf-monitor.h \ na-gconf-utils.h \ na-icontext.h \ na-iduplicable.h \ na-ifactory-object.h \ na-ifactory-object-data.h \ na-object-api.h \ na-object.h \ na-object-id.h \ na-object-item.h \ na-object-action.h \ na-object-profile.h \ na-object-menu.h \ na-timeout.h \ $(NULL) nautilus-actions-3.2.3/src/api/na-gconf-utils.h0000644000175100017500000000722412212601376016307 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_GCONF_UTILS_H__ #define __NAUTILUS_ACTIONS_API_NA_GCONF_UTILS_H__ #ifdef HAVE_GCONF /** * SECTION: gconf-utils * @title: GConf Misc * @short_description: The GConf Library Utilities * @include: runtime/na-gconf-utils.h * * Starting with Nautilus-Actions 3.1.0, GConf, whether it is used as a * preference storage subsystem or as an I/O provider, is deprecated. */ #include G_BEGIN_DECLS GSList *na_gconf_utils_get_subdirs( GConfClient *gconf, const gchar *path ); void na_gconf_utils_free_subdirs( GSList *subdirs ); gboolean na_gconf_utils_has_entry ( GSList *entries, const gchar *entry ); GSList *na_gconf_utils_get_entries( GConfClient *gconf, const gchar *path ); gboolean na_gconf_utils_get_bool_from_entries ( GSList *entries, const gchar *entry, gboolean *value ); gboolean na_gconf_utils_get_string_from_entries ( GSList *entries, const gchar *entry, gchar **value ); gboolean na_gconf_utils_get_string_list_from_entries( GSList *entries, const gchar *entry, GSList **value ); void na_gconf_utils_dump_entries ( GSList *entries ); void na_gconf_utils_free_entries ( GSList *entries ); gboolean na_gconf_utils_read_bool ( GConfClient *gconf, const gchar *path, gboolean use_schema, gboolean default_value ); gint na_gconf_utils_read_int ( GConfClient *gconf, const gchar *path, gboolean use_schema, gint default_value ); gchar *na_gconf_utils_read_string ( GConfClient *gconf, const gchar *path, gboolean use_schema, const gchar *default_value ); GSList *na_gconf_utils_read_string_list ( GConfClient *gconf, const gchar *path ); /* Writing in GConf is deprecated since 3.1.0 */ #ifdef NA_ENABLE_DEPRECATED gboolean na_gconf_utils_write_bool ( GConfClient *gconf, const gchar *path, gboolean value, gchar **message ); gboolean na_gconf_utils_write_int ( GConfClient *gconf, const gchar *path, gint value, gchar **message ); gboolean na_gconf_utils_write_string ( GConfClient *gconf, const gchar *path, const gchar *value, gchar **message ); gboolean na_gconf_utils_write_string_list( GConfClient *gconf, const gchar *path, GSList *value, gchar **message ); gboolean na_gconf_utils_remove_entry ( GConfClient *gconf, const gchar *path, gchar **message ); GSList *na_gconf_utils_slist_from_string( const gchar *value ); gchar *na_gconf_utils_slist_to_string ( GSList *slist ); #endif /* NA_ENABLE_DEPRECATED */ G_END_DECLS #endif /* HAVE_GCONF */ #endif /* __NAUTILUS_ACTIONS_API_NA_GCONF_UTILS_H__ */ nautilus-actions-3.2.3/src/api/na-ifactory-provider.h0000644000175100017500000002645612212601376017535 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_IFACTORY_PROVIDER_H__ #define __NAUTILUS_ACTIONS_API_NA_IFACTORY_PROVIDER_H__ /** * SECTION: ifactory-provider * @title: NAIFactoryProvider * @short_description: The Data Factory Provider Interface v 1 * @include: nautilus-actions/na-ifactory_provider.h * * &prodname; has to deal with a relatively great number of elementary datas, * reading them from different supports, storing and displaying them, * then re-writing these same datas, with several output formats, and so on. * * This has rapidly become a pain, if not just a bug generator. * Each new data must be described, have a schema to be stored in * (historical storage subsystem) GConf; import and export assistants * must be carefully updated to export the new data... * * The #NAIFactoryProvider aims to simplify and organize all the work * which must be done around each and every elementary data. It is based * on three main things: * * * * * Elementary datas are banalized. * * whether they are a string, an integer, a boolean, a simple * or double-linked list, each elementary data is encapsuled * into a #NADataBoxed, small sort of structure (incidentally, * which acts almost as the new GLib #GVariant, but too late, * guys :)). * * * * * * Our objects are de-structured. * * Instead of organizing our elementary datas into structures, * our objects are just flat lists of #NADataBoxed. * * * * * * A full, centralized, data dictionary is defined. * * Now that our elementary datas are banalized and de-structured, * it is simple enough to describe each of these datas with all * iss properties in one single, centralized, place. * * * * * * Of course, I/O providers are good candidates to be users of this * #NAIFactoryProvider interface. * * Without this interface, each and every I/O provider must, * for example when reading an item, have the list of data to be * read for each item, then read each individual data, then * organize them in a I/O structure.. * Each time a new data is added to an object, as e.g. a new condition, * then all available I/O providers must be updated: read the data, * write the data, then display the data, and so on.. * * With this #NAIFactoryProvider interface, the I/O provider has just to * deal with reading/writing elementary types. It does need to know that * it will have to read, name, tooltip, description. It just needs to know * how to read a string. * And while we do not introduce another data type, the I/O provider * does not need any maintenance even if we add lot of new data, conditions * labels, and so on. * * So, this is the interface used by data factory management system for * providing serialization/unserialization services. This interface may * be implemented by I/O providers which would take advantage of this * system. * * * Versions historic * * Historic of the versions of the #NAIFactoryProvider interface * * * * * * * &prodname; version * #NAIFactoryProvider interface version * * * * * * since 2.30 * 1 * current version * * * *
*
*/ #include "na-data-boxed.h" #include "na-ifactory-object.h" #include "na-ifactory-provider-provider.h" G_BEGIN_DECLS #define NA_TYPE_IFACTORY_PROVIDER ( na_ifactory_provider_get_type()) #define NA_IFACTORY_PROVIDER( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_TYPE_IFACTORY_PROVIDER, NAIFactoryProvider )) #define NA_IS_IFACTORY_PROVIDER( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NA_TYPE_IFACTORY_PROVIDER )) #define NA_IFACTORY_PROVIDER_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_TYPE_IFACTORY_PROVIDER, NAIFactoryProviderInterface )) typedef struct _NAIFactoryProviderInterfacePrivate NAIFactoryProviderInterfacePrivate; /** * NAIFactoryProviderInterface: * @get_version: returns the version of this interface the plugin implements. * @read_start: triggered just before reading an item. * @read_data: reads an item. * @read_done: triggered at the end of item reading. * @write_start: triggered just before writing an item. * @write_data: writes an item. * @write_done: triggered at the end of item writing. * * This defines the interface that a #NAIFactoryProvider may implement. */ typedef struct { /*< private >*/ GTypeInterface parent; NAIFactoryProviderInterfacePrivate *private; /*< public >*/ /** * get_version: * @instance: this #NAIFactoryProvider instance. * * Defaults to 1. * * Returns: the version of this interface supported by @instance implementation. * * Since: 2.30 */ guint ( *get_version )( const NAIFactoryProvider *instance ); /** * read_start: * @reader: this #NAIFactoryProvider instance. * @reader_data: the data associated to this instance, as provided * when na_ifactory_provider_read_item() was called. * @object: the #NAIFactoryObject object which comes to be read. * @messages: a pointer to a #GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * API called by #NAIFactoryObject just before starting with reading data. * * Since: 2.30 */ void ( *read_start ) ( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *object, GSList **messages ); /** * read_data: * @reader: this #NAIFactoryProvider instance. * @reader_data: the data associated to this instance, as provided * when na_ifactory_provider_read_item() was called. * @object: the #NAIFactoryobject being unserialized. * @def: a #NADataDef structure which identifies the data to be unserialized. * @messages: a pointer to a #GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * This method must be implemented in order any data be read. * * Returns: a newly allocated NADataBoxed which contains the read value. * Should return %NULL if data is not found. * * Since: 2.30 */ NADataBoxed * ( *read_data ) ( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *object, const NADataDef *def, GSList **messages ); /** * read_done: * @reader: this #NAIFactoryProvider instance. * @reader_data: the data associated to this instance, as provided * when na_ifactory_provider_read_item() was called. * @object: the #NAIFactoryObject object which comes to be read. * @messages: a pointer to a #GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * API called by #NAIFactoryObject when all data have been read. * Implementor may take advantage of this to do some cleanup. * * Since: 2.30 */ void ( *read_done ) ( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *object, GSList **messages ); /** * write_start: * @writer: this #NAIFactoryProvider instance. * @writer_data: the data associated to this instance. * @object: the #NAIFactoryObject object which comes to be written. * @messages: a pointer to a #GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * API called by #NAIFactoryObject just before starting with writing data. * * Returns: a NAIIOProvider operation return code. * * Since: 2.30 */ guint ( *write_start )( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, GSList **messages ); /** * write_data: * @writer: this #NAIFactoryProvider instance. * @writer_data: the data associated to this instance. * @object: the #NAIFactoryObject object being written. * @def: the description of the data to be written. * @value: the #NADataBoxed to be written down. * @messages: a pointer to a #GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * Write the data embedded in @value down to @instance. * * This method must be implemented in order any data be written. * * Returns: a NAIIOProvider operation return code. * * Since: 2.30 */ guint ( *write_data ) ( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, const NADataBoxed *boxed, GSList **messages ); /** * write_done: * @writer: this #NAIFactoryProvider instance. * @writer_data: the data associated to this instance. * @object: the #NAIFactoryObject object which comes to be written. * @messages: a pointer to a #GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * API called by #NAIFactoryObject when all data have been written. * Implementor may take advantage of this to do some cleanup. * * Returns: a NAIIOProvider operation return code. * * Since: 2.30 */ guint ( *write_done ) ( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, GSList **messages ); } NAIFactoryProviderInterface; GType na_ifactory_provider_get_type( void ); void na_ifactory_provider_read_item ( const NAIFactoryProvider *reader, void *reader_data, NAIFactoryObject *object, GSList **messages ); guint na_ifactory_provider_write_item( const NAIFactoryProvider *writer, void *writer_data, NAIFactoryObject *object, GSList **messages ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_IFACTORY_PROVIDER_H__ */ nautilus-actions-3.2.3/src/api/na-object-api.h0000644000175100017500000005125412212601376016074 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_OBJECT_API_H__ #define __NAUTILUS_ACTIONS_API_NA_OBJECT_API_H__ /** * SECTION: object-api * @title: API * @short_description: The Common Public #NAObject API * @include: nautilus-actions/na-object-api.h * * We define here a common API which makes easier to write (and read) * the code; all object functions are named na_object; all arguments * are casted directly in the macro. */ #include "na-ifactory-object.h" #include "na-ifactory-object-data.h" #include "na-iduplicable.h" #include "na-icontext.h" #include "na-object-action.h" #include "na-object-profile.h" #include "na-object-menu.h" G_BEGIN_DECLS /* NAIDuplicable */ #define na_object_duplicate( obj, mode ) na_iduplicable_duplicate( NA_IDUPLICABLE( obj ), mode ) #define na_object_check_status( obj ) na_object_object_check_status_rec( NA_OBJECT( obj )) #define na_object_get_origin( obj ) na_iduplicable_get_origin( NA_IDUPLICABLE( obj )) #define na_object_is_valid( obj ) na_iduplicable_is_valid( NA_IDUPLICABLE( obj )) #define na_object_is_modified( obj ) na_iduplicable_is_modified( NA_IDUPLICABLE( obj )) #define na_object_set_origin( obj, origin ) na_iduplicable_set_origin( NA_IDUPLICABLE( obj ), ( NAIDuplicable * )( origin )) #define na_object_reset_origin( obj, origin ) na_object_object_reset_origin( NA_OBJECT( obj ), ( NAObject * )( origin )) /* NAObject */ #define na_object_dump( obj ) na_object_object_dump( NA_OBJECT( obj )) #define na_object_dump_norec( obj ) na_object_object_dump_norec( NA_OBJECT( obj )) #define na_object_dump_tree( tree ) na_object_object_dump_tree( tree ) #define na_object_ref( obj ) na_object_object_ref( NA_OBJECT( obj )) #define na_object_unref( obj ) na_object_object_unref( NA_OBJECT( obj )) #define na_object_debug_invalid( obj, reason ) na_object_object_debug_invalid( NA_OBJECT( obj ), ( const gchar * )( reason )) /* NAObjectId */ #define na_object_get_id( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ID )) #define na_object_get_label( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), ( NA_IS_OBJECT_PROFILE( obj ) ? NAFO_DATA_DESCNAME : NAFO_DATA_LABEL ))) #define na_object_get_label_noloc( obj ) (( gchar * )( NA_IS_OBJECT_PROFILE( obj ) ? na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_DESCNAME_NOLOC ) : NULL )) #define na_object_get_parent( obj ) (( NAObjectItem * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_PARENT )) #define na_object_set_id( obj, id ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ID, ( const void * )( id )) #define na_object_set_label( obj, label ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), ( NA_IS_OBJECT_PROFILE( obj ) ? NAFO_DATA_DESCNAME : NAFO_DATA_LABEL ), ( const void * )( label )) #define na_object_set_parent( obj, parent ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_PARENT, ( const void * )( parent )) #define na_object_sort_alpha_asc( a, b ) na_object_id_sort_alpha_asc( NA_OBJECT_ID( a ), NA_OBJECT_ID( b )) #define na_object_sort_alpha_desc( a, b ) na_object_id_sort_alpha_desc( NA_OBJECT_ID( a ), NA_OBJECT_ID( b )) #define na_object_prepare_for_paste( obj, relabel, renumber, parent ) \ na_object_id_prepare_for_paste( NA_OBJECT_ID( obj ), ( relabel ), ( renumber ), ( NAObjectId * )( parent )) #define na_object_set_copy_of_label( obj ) na_object_id_set_copy_of_label( NA_OBJECT_ID( obj )) #define na_object_set_new_id( obj, parent ) na_object_id_set_new_id( NA_OBJECT_ID( obj ), ( NAObjectId * )( parent )) /* NAObjectItem */ #define na_object_get_tooltip( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TOOLTIP )) #define na_object_get_icon( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ICON )) #define na_object_get_icon_noloc( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ICON_NOLOC )) #define na_object_get_description( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_DESCRIPTION )) #define na_object_get_items( obj ) (( GList * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SUBITEMS )) #define na_object_get_items_slist( obj ) (( GSList * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SUBITEMS_SLIST )) #define na_object_is_enabled( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ENABLED ))) #define na_object_is_readonly( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_READONLY ))) #define na_object_get_provider( obj ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_PROVIDER ) #define na_object_get_provider_data( obj ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_PROVIDER_DATA ) #define na_object_get_iversion( obj ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_IVERSION )) #define na_object_get_shortcut( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SHORTCUT )) #define na_object_set_tooltip( obj, tooltip ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TOOLTIP, ( const void * )( tooltip )) #define na_object_set_icon( obj, icon ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ICON, ( const void * )( icon )) #define na_object_set_description( obj, desc ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_DESCRIPTION, ( const void * )( desc )) #define na_object_set_items( obj, list ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SUBITEMS, ( const void * )( list )) #define na_object_set_items_slist( obj, slist ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SUBITEMS_SLIST, ( const void * )( slist )) #define na_object_set_enabled( obj, enabled ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ENABLED, ( const void * ) GUINT_TO_POINTER( enabled )) #define na_object_set_readonly( obj, readonly ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_READONLY, ( const void * ) GUINT_TO_POINTER( readonly )) #define na_object_set_provider( obj, provider ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_PROVIDER, ( const void * )( provider )) #define na_object_set_provider_data( obj, data ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_PROVIDER_DATA, ( const void * )( data )) #define na_object_set_iversion( obj, version ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_IVERSION, ( const void * ) GUINT_TO_POINTER( version )) #define na_object_set_shortcut( obj, shortcut ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SHORTCUT, ( const void * )( shortcut )) #define na_object_get_item( obj, id ) na_object_item_get_item( NA_OBJECT_ITEM( obj ),( const gchar * )( id )) #define na_object_get_position( obj, child ) na_object_item_get_position( NA_OBJECT_ITEM( obj ), NA_OBJECT_ID( child )) #define na_object_append_item( obj, child ) na_object_item_append_item( NA_OBJECT_ITEM( obj ), NA_OBJECT_ID( child )) #define na_object_insert_at( obj, child, pos ) na_object_item_insert_at( NA_OBJECT_ITEM( obj ), NA_OBJECT_ID( child ), ( pos )) #define na_object_insert_item( obj, child, sibling ) na_object_item_insert_item( NA_OBJECT_ITEM( obj ), NA_OBJECT_ID( child ), ( NAObjectId * )( sibling )) #define na_object_remove_item( obj, child ) na_object_item_remove_item( NA_OBJECT_ITEM( obj ), NA_OBJECT_ID( child )) #define na_object_get_items_count( obj ) na_object_item_get_items_count( NA_OBJECT_ITEM( obj )) #define na_object_count_items( list, cm, ca, cp ) na_object_item_count_items( list, ( cm ), ( ca ), ( cp ), TRUE ) #define na_object_copyref_items( tree ) na_object_item_copyref_items( tree ) #define na_object_free_items( tree ) na_object_item_free_items( tree ) #define na_object_is_finally_writable( obj, r ) na_object_item_is_finally_writable( NA_OBJECT_ITEM( obj ), ( r )) #define na_object_set_writability_status( obj, w, r ) na_object_item_set_writability_status( NA_OBJECT_ITEM( obj ), ( w ), ( r )) /* NAObjectAction */ #define na_object_get_version( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_VERSION )) #define na_object_is_target_selection( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_SELECTION ))) #define na_object_is_target_location( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_LOCATION ))) #define na_object_is_target_toolbar( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_TOOLBAR ))) #define na_object_get_toolbar_label( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TOOLBAR_LABEL )) #define na_object_is_toolbar_same_label( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TOOLBAR_SAME_LABEL ))) #define na_object_get_last_allocated( obj ) (( guint ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_LAST_ALLOCATED ))) #define na_object_set_version( obj, version ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_VERSION, ( const void * )( version )) #define na_object_set_target_selection( obj, target ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_SELECTION, ( const void * ) GUINT_TO_POINTER( target )) #define na_object_set_target_location( obj, target ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_LOCATION, ( const void * ) GUINT_TO_POINTER( target )) #define na_object_set_target_toolbar( obj, target ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TARGET_TOOLBAR, ( const void * ) GUINT_TO_POINTER( target )) #define na_object_set_toolbar_label( obj, label ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TOOLBAR_LABEL, ( const void * )( label )) #define na_object_set_toolbar_same_label( obj, same ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TOOLBAR_SAME_LABEL, ( const void * ) GUINT_TO_POINTER( same )) #define na_object_set_last_allocated( obj, last ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_LAST_ALLOCATED, ( const void * ) GUINT_TO_POINTER( last )) #define na_object_set_last_version( obj ) na_object_action_set_last_version( NA_OBJECT_ACTION( obj )) #define na_object_reset_last_allocated( obj ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_LAST_ALLOCATED, ( const void * ) GUINT_TO_POINTER( 0 )) #define na_object_attach_profile( obj, profile ) na_object_action_attach_profile( NA_OBJECT_ACTION( obj ), NA_OBJECT_PROFILE( profile )) /* NAObjectProfile */ #define na_object_get_path( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_PATH )) #define na_object_get_parameters( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_PARAMETERS )) #define na_object_get_working_dir( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_WORKING_DIR )) #define na_object_get_execution_mode( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_EXECUTION_MODE )) #define na_object_get_startup_notify( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_STARTUP_NOTIFY ))) #define na_object_get_startup_class( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_STARTUP_WMCLASS )) #define na_object_get_execute_as( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_EXECUTE_AS )) #define na_object_set_path( obj, path ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_PATH, ( const void * )( path )) #define na_object_set_parameters( obj, parms ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_PARAMETERS, ( const void * )( parms )) #define na_object_set_working_dir( obj, uri ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_WORKING_DIR, ( const void * )( uri )) #define na_object_set_execution_mode( obj, mode ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_EXECUTION_MODE, ( const void * )( mode )) #define na_object_set_startup_notify( obj, notify ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_STARTUP_NOTIFY, ( const void * ) GUINT_TO_POINTER( notify )) #define na_object_set_startup_class( obj, class ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_STARTUP_WMCLASS, ( const void * )( class )) #define na_object_set_execute_as( obj, user ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_EXECUTE_AS, ( const void * )( user )) /* NAIContext */ #define na_object_check_mimetypes( obj ) na_icontext_check_mimetypes( NA_ICONTEXT( obj )) #define na_object_get_basenames( obj ) (( GSList * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_BASENAMES )) #define na_object_get_matchcase( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_MATCHCASE ))) #define na_object_get_mimetypes( obj ) (( GSList * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_MIMETYPES )) #define na_object_get_all_mimetypes( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_MIMETYPES_IS_ALL ))) #define na_object_get_folders( obj ) (( GSList * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_FOLDERS )) #define na_object_get_schemes( obj ) (( GSList * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SCHEMES )) #define na_object_get_only_show_in( obj ) (( GSList * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ONLY_SHOW )) #define na_object_get_not_show_in( obj ) (( GSList * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_NOT_SHOW )) #define na_object_get_try_exec( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TRY_EXEC )) #define na_object_get_show_if_registered( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SHOW_IF_REGISTERED )) #define na_object_get_show_if_true( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SHOW_IF_TRUE )) #define na_object_get_show_if_running( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SHOW_IF_RUNNING )) #define na_object_get_selection_count( obj ) (( gchar * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SELECTION_COUNT )) #define na_object_get_capabilities( obj ) (( GSList * ) na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_CAPABILITITES )) #define na_object_set_basenames( obj, bnames ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_BASENAMES, ( const void * )( bnames )) #define na_object_set_matchcase( obj, match ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_MATCHCASE, ( const void * ) GUINT_TO_POINTER( match )) #define na_object_set_mimetypes( obj, types ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_MIMETYPES, ( const void * )( types )) #define na_object_set_all_mimetypes( obj, all ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_MIMETYPES_IS_ALL, ( const void * ) GUINT_TO_POINTER( all )) #define na_object_set_folders( obj, folders ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_FOLDERS, ( const void * )( folders )) #define na_object_replace_folder( obj, old, new ) na_icontext_replace_folder( NA_ICONTEXT( obj ), ( const gchar * )( old ), ( const gchar * )( new )) #define na_object_set_scheme( obj, scheme, add ) na_icontext_set_scheme( NA_ICONTEXT( obj ), ( const gchar * )( scheme ), ( add )) #define na_object_set_schemes( obj, schemes ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SCHEMES, ( const void * )( schemes )) #define na_object_set_only_show_in( obj, list ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ONLY_SHOW, ( const void * )( list )) #define na_object_set_only_desktop( obj, desktop, add ) na_icontext_set_only_desktop( NA_ICONTEXT( obj ), ( const gchar * )( desktop ), ( add )) #define na_object_set_not_show_in( obj, list ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_NOT_SHOW, ( const void * )( list )) #define na_object_set_not_desktop( obj, desktop, add ) na_icontext_set_not_desktop( NA_ICONTEXT( obj ), ( const gchar * )( desktop ), ( add )) #define na_object_set_try_exec( obj, exec ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_TRY_EXEC, ( const void * )( exec )) #define na_object_set_show_if_registered( obj, name ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SHOW_IF_REGISTERED, ( const void * )( name )) #define na_object_set_show_if_true( obj, exec ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SHOW_IF_TRUE, ( const void * )( exec )) #define na_object_set_show_if_running( obj, name ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SHOW_IF_RUNNING, ( const void * )( name )) #define na_object_set_selection_count( obj, cond ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_SELECTION_COUNT, ( const void * )( cond )) #define na_object_set_capabilities( obj, cap ) na_ifactory_object_set_from_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_CAPABILITITES, ( const void * )( cap )) #ifdef NA_ENABLE_DEPRECATED #define na_object_set_modified( obj, modified ) na_iduplicable_set_modified( NA_IDUPLICABLE( obj ), ( modified )) #endif G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_OBJECT_API_H__ */ nautilus-actions-3.2.3/src/api/na-extension.h0000644000175100017500000002265112212601376016072 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_EXTENSION_H__ #define __NAUTILUS_ACTIONS_API_NA_EXTENSION_H__ /** * SECTION: extension * @title: Plugins * @short_description: The Nautilus-Actions Extension Interface Definition v 1 * @include: nautilus-actions/na-extension.h * * &prodname; accepts extensions as dynamically loadable libraries * (aka plugins). * * As of today, &prodname; may be extended in the following areas: * * * * * Storing menus and actions in a specific storage subsystem * * * This extension is provided via the public * NAIIOProvider * interface; it takes care of reading and writing menus * and actions to a specific storage subsystem. * * * * * * * Exporting menus and actions * * * This extension is provided via the public * NAIExporter * interface; it takes care of exporting menus and actions * to the filesystem from the &prodname; Configuration Tool * user interface. * * * * * * * Importing menus and actions * * * This extension is provided via the public * NAIImporter * interface; it takes care of importing menus and actions * from the filesystem into the &prodname; Configuration Tool * user interface. * * * * * * In order to be recognized as a valid &prodname; plugin, the library * must at least export the functions described in this extension API. * * * Developing a &prodname; plugin * * Building the dynamically loadable library * * The suggested way of producing a dynamically loadable library is to * use * autoconf, * automake * and * libtool * GNU applications. * * * In this case, it should be enough to use the * option in your Makefile.am, as in: * * libna_io_desktop_la_LDFLAGS = -module -no-undefined -avoid-version * * * * * Installing the library * * At startup time, &prodname; searches for its candidate libraries in * PKGLIBDIR directory, which most often happens to * be /usr/lib/nautilus-actions/ or * /usr/lib64/nautilus-actions/, * depending of your system. * * * * * * Versions historic * * Historic of the versions of this extension API * * * * * * * &prodname; version * extension API version * * * * * * since 2.30 * 1 * current version * * * *
*
*/ #include G_BEGIN_DECLS /** * na_extension_startup: * @module: the #GTypeModule of the plugin library being loaded. * * This function is called by the Nautilus-Actions plugin manager when * the plugin library is first loaded in memory. The library may so take * advantage of this call by initializing itself, registering its * internal #GType types, etc. * * A Nautilus-Actions extension must implement this function in order * to be considered as a valid candidate to dynamic load. * * * * static GType st_module_type = 0; * * gboolean * na_extension_startup( GTypeModule *plugin ) * { * static GTypeInfo info = { * sizeof( NadpDesktopProviderClass ), * NULL, * NULL, * ( GClassInitFunc ) class_init, * NULL, * NULL, * sizeof( NadpDesktopProvider ), * 0, * ( GInstanceInitFunc ) instance_init * }; * * static const GInterfaceInfo iio_provider_iface_info = { * ( GInterfaceInitFunc ) iio_provider_iface_init, * NULL, * NULL * }; * * st_module_type = g_type_module_register_type( plugin, G_TYPE_OBJECT, "NadpDesktopProvider", &info, 0 ); * * g_type_module_add_interface( plugin, st_module_type, NA_TYPE_IIO_PROVIDER, &iio_provider_iface_info ); * * return( TRUE ); * } * * * * Returns: %TRUE if the initialization is successful, %FALSE else. * In this later case, the library is unloaded and no more considered. * * Since: 2.30 */ gboolean na_extension_startup ( GTypeModule *module ); /** * na_extension_get_version: * * This function is called by the &prodname; program each time * it needs to know which version of this API the plugin * implements. * * If this function is not exported by the library, * the plugin manager considers that the library only implements the * version 1 of this extension API. * * Returns: the version of this API supported by the module. * * Since: 2.30 */ guint na_extension_get_version( void ); /** * na_extension_list_types: * @types: the address where to store the zero-terminated array of * instantiable #GType types this library implements. * * Returned #GType types must already have been registered in the * #GType system (e.g. at #na_extension_startup() time), and the objects * they describe may implement one or more of the interfaces defined in * this Nautilus-Actions public API. * * The Nautilus-Actions plugin manager will instantiate one #GTypeInstance- * derived object for each returned #GType type, and associate these objects * to this library. * * A Nautilus-Actions extension must implement this function in order * to be considered as a valid candidate to dynamic load. * * * * &lcomment; the count of GType types provided by this extension * * each new GType type must * * - be registered in na_extension_startup() * * - be addressed in na_extension_list_types(). * &rcomment; * #define NADP_TYPES_COUNT 1 * * guint * na_extension_list_types( const GType **types ) * { * static GType types_list [1+NADP_TYPES_COUNT]; * * &lcomment; NADP_TYPE_DESKTOP_PROVIDER has been previously * * registered in na_extension_startup function * &rcomment; * types_list[0] = NADP_TYPE_DESKTOP_PROVIDER; * * types_list[NADP_TYPES_COUNT] = 0; * *types = types_list; * * return( NADP_TYPES_COUNT ); * } * * * * Returns: the number of #GType types returned in the @types array, not * counting the terminating zero item. * * Since: 2.30 */ guint na_extension_list_types ( const GType **types ); /** * na_extension_shutdown: * * This function is called by Nautilus-Actions when it is about to * shutdown itself. * * The dynamically loaded library may take advantage of this call to * release any resource, handle, and so on, it may have previously * allocated. * * A Nautilus-Actions extension must implement this function in order * to be considered as a valid candidate to dynamic load. * * Since: 2.30 */ void na_extension_shutdown ( void ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_EXTENSION_H__ */ nautilus-actions-3.2.3/src/api/na-iimporter.h0000644000175100017500000003606512212601376016074 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_IIMPORTER_H__ #define __NAUTILUS_ACTIONS_API_NA_IIMPORTER_H__ /** * SECTION: iimporter * @title: NAIImporter * @short_description: The Import Interface * @include: nautilus-actions/na-iimporter.h * * The #NAIImporter interface imports items from the outside world * into &prodname; repository (see #NAIIOProvider interface for how * these items will be later managed to be store somewhere). * * In version 1 of the #NAIImporter interface, &prodname; used to * provide the implementation with all was needed to be able to manage * the import process up to be ready for insertion, including the * deduplication if required. * * This used to put on the implementation the responsability to check * for the unicity of the imported identifier, maybe asking the caller * (via provided callback functions) what to do with it, maybe * reallocating a new identifier, and so on... * * Starting with &prodname; version 3.2, this interface is bumped to * a version 2 which greatly simplifies it. * * The I/O provider which implements the #NAIImporter interface is no * more required to check for existence of the imported items, but this * check is pushed back to the caller responsability. * * Rationale is that only the caller is able to check against a valid * repository in its current import context, while the #NAIImporter * provider should only be responsible to import an item in memory. * * * Versions historic * * Historic of the versions of the #NAIImporter interface * * * * * * * * &prodname; version * #NAIImporter interface version * * * * * * * from 2.30 up to 3.1.5 * 1 * * deprecated * * * since 3.2 * 2 * current version * * * * *
*
*/ #include "na-object-item.h" G_BEGIN_DECLS #define NA_TYPE_IIMPORTER ( na_iimporter_get_type()) #define NA_IIMPORTER( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_TYPE_IIMPORTER, NAIImporter )) #define NA_IS_IIMPORTER( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NA_TYPE_IIMPORTER )) #define NA_IIMPORTER_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_TYPE_IIMPORTER, NAIImporterInterface )) typedef struct _NAIImporter NAIImporter; typedef struct _NAIImporterInterfacePrivate NAIImporterInterfacePrivate; /** * NAIImporterInterface: * @get_version: [should] returns the version of this interface that the * plugin implements. * @import_from_uri: [should] imports an item. * * This defines the interface that a #NAIImporter should implement. */ typedef struct { /*< private >*/ GTypeInterface parent; NAIImporterInterfacePrivate *private; /*< public >*/ /** * get_version: * @instance: the NAIImporter provider. * * Nautilus-Actions calls this method each time it needs to know * which version of this interface the plugin implements. * * If this method is not implemented by the plugin, * Nautilus-Actions considers that the plugin only implements * the version 1 of the NAIImporter interface. * * Return value: if implemented, this method must return the version * number of this interface the I/O provider is supporting. * * Defaults to 1. * * Since: 2.30 */ guint ( *get_version ) ( const NAIImporter *instance ); /** * import_from_uri: * @instance: the NAIImporter provider. * @parms: a NAIImporterImportFromUriParms structure. * * Imports an item. * * If the provider implements the version 1 of this interface, then * @parms is supposed to map to NAIImporterImportFromUriParms structure. * * Contrarily, if the provider implements the version 2 of the interface, * then @parms is supposed to map to a NAIImporterImportFromUriParmsv2 * structure. * * Return value: the return code of the operation. * * Since: 2.30 */ guint ( *import_from_uri )( const NAIImporter *instance, void *parms ); } NAIImporterInterface; #ifdef NA_ENABLE_DEPRECATED /** * NAIImporterCheckFn: * @imported: the currently imported #NAObjectItem -derived object. * @fn_data: some data to be passed to the function. * * In version 1 of the interface, this function may be provided by * the caller in order the #NAIImporter provider be able to check for * pre-existence of the imported item. * This function should return the already existing item which has the * same id than the currently being imported one, or %NULL if the * imported id will be unique. * * If this function is not provided, then the #NAIImporter provider will not * be able to check for duplicates. In this case, the id of the imported item * should be systematically regenerated as a unique id, regardless of the * asked import mode. * * Standard N-A callers provide a function which checks for the existance * of the newly imported item : * * * * first among the current list of just imported items * * * * * and then amon the items currently visible in the main window. * * * * Items which may have been loaded by NAPivot at the start of the * application, and deleted meanwhile, are just ignored. * * Returns: the already existing #NAObjectItem with same id, or %NULL. * * Since: 2.30 * Deprecated: 3.2 */ typedef NAObjectItem * ( *NAIImporterCheckFn )( const NAObjectItem *, void * ); /** * NAIImporterAskUserFn: * @imported: the currently imported #NAObjectItem. * @existing: an already existing #NAObjectItem with same id. * @fn_data: some data to be passed to the function. * * In version 1 of the interface, this function may be provided by the * caller as a convenience way for the #NAIImporter to ask the user to * know what to do in the case of a duplicate id. * * If this function is not provided, and the #NAIImporter does not have * any other way to ask the user, then a 'no import' policy should be * preferred when managing duplicate identifiers. * * Returns: the import mode chosen by the user, which must not be * %IMPORTER_MODE_ASK. * * Since: 2.30 * Deprecated: 3.2 */ typedef guint ( *NAIImporterAskUserFn )( const NAObjectItem *, const NAObjectItem *, void * ); /** * NAIImporterManageImportModeParms: * @version: [in] the version of the structure content, equals to 1; * since structure version 1. * @imported: [in] the imported #NAObjectItem -derived object; * since structure version 1. * @asked_mode: [in] asked import mode; * since structure version 1. * @check_fn: [in] a #NAIImporterCheckFn function to check the existence of the imported id; * since structure version 1. * @check_fn_data: [in] @check_fn data; * since structure version 1. * @ask_fn: [in] a #NAIImporterAskUserFn function to ask the user what to do in case of a duplicate id; * since structure version 1. * @ask_fn_data: [in] @ask_fn data; * since structure version 1. * @exist: [out] whether the imported Id already existed; * since structure version 1. * @import_mode: [out] actually used import mode; * since structure version 1. * @messages: [in/out] a #GSList list of localized strings; * the provider may append messages to this list, but shouldn't reinitialize it; * since structure version 1. * * This structure allows all used parameters when managing the import mode * to be passed and received through a single structure. * * Since: 2.30 * Deprecated: 3.2 */ typedef struct { guint version; NAObjectItem *imported; guint asked_mode; NAIImporterCheckFn check_fn; void *check_fn_data; NAIImporterAskUserFn ask_fn; void *ask_fn_data; gboolean exist; guint import_mode; GSList *messages; } NAIImporterManageImportModeParms; /** * NAIImporterImportMode: * @IMPORTER_MODE_NO_IMPORT: a "do not import" mode. * @IMPORTER_MODE_RENUMBER: reallocate a new id when the imported one already exists. * @IMPORTER_MODE_OVERRIDE: override the existing id with the imported one. * @IMPORTER_MODE_ASK: ask the user for what to do with this particular item. * * Define the mode of an import operation. * * Deprecated: 3.2 */ typedef enum { IMPORTER_MODE_NO_IMPORT = 1, IMPORTER_MODE_RENUMBER, IMPORTER_MODE_OVERRIDE, IMPORTER_MODE_ASK } NAIImporterImportMode; guint na_iimporter_manage_import_mode( NAIImporterManageImportModeParms *parms ); /** * NAIImporterImportFromUriParms: * @version: [in] the version of this structure; * since structure version 1. * @uri: [in] uri of the file to be imported; * since structure version 1. * @asked_mode: [in] asked import mode; * since structure version 1. * @exist: [out] whether the imported Id already existed; * since structure version 1. * @import_mode: [out] actually used import mode; * since structure version 1. * @imported: [out] the imported #NAObjectItem -derived object, or %NULL; * since structure version 1. * @check_fn: [in] a NAIImporterCheckFn() function to check the existence * of the imported id; * since structure version 1. * @check_fn_data: [in] @check_fn data; * since structure version 1. * @ask_fn: [in] a NAIImporterAskUserFn() function to ask the user what to * do in case of a duplicate id; * since structure version 1. * @ask_fn_data: [in] @ask_fn data; * since structure version 1. * @messages: [in/out] a #GSList list of localized strings; * the provider may append messages to this list, but * shouldn't reinitialize it; * since structure version 1. * * This structure allows all used parameters when importing from an URI * to be passed and received through a single structure. * * Since: 2.30 * Deprecated: 3.2 */ typedef struct { guint version; gchar *uri; guint asked_mode; gboolean exist; guint import_mode; NAObjectItem *imported; NAIImporterCheckFn check_fn; void *check_fn_data; NAIImporterAskUserFn ask_fn; void *ask_fn_data; GSList *messages; } NAIImporterImportFromUriParms; #endif /* NA_ENABLE_DEPRECATED */ /** * NAIImporterImportStatus: * @IMPORTER_CODE_OK: import ok. * @IMPORTER_CODE_PROGRAM_ERROR: a program error has been detected. * You should open a bug in * Bugzilla. * @IMPORTER_CODE_NOT_WILLING_TO: the plugin is not willing to import the uri. * @IMPORTER_CODE_NO_ITEM_ID: item id not found. * @IMPORTER_CODE_NO_ITEM_TYPE: item type not found. * @IMPORTER_CODE_UNKNOWN_ITEM_TYPE: unknown item type. * @IMPORTER_CODE_CANCELLED: operation cancelled by the user. * @IMPORTER_CODE_NOT_LOADABLE: the file is considered as not loadable at all. * This is not a matter of which I/O provider has been tried, * but the file is empty, or too big, or eventually not a * regular file. * * Define the return status of an import operation. */ typedef enum { IMPORTER_CODE_OK = 0, IMPORTER_CODE_PROGRAM_ERROR, IMPORTER_CODE_NOT_WILLING_TO, IMPORTER_CODE_NO_ITEM_ID, IMPORTER_CODE_NO_ITEM_TYPE, IMPORTER_CODE_UNKNOWN_ITEM_TYPE, IMPORTER_CODE_CANCELLED, IMPORTER_CODE_NOT_LOADABLE } NAIImporterImportStatus; /** * NAIImporterImportFromUriParmsv2: * @version: [in] the version of the structure, equals to 2; * since structure version 1. * @content: [in] the version of the description content, equals to 1; * since structure version 2. * @uri: [in] uri of the file to be imported; * since structure version 1. * @imported: [out] the imported #NAObjectItem -derived object, or %NULL; * since structure version 1. * @messages: [in/out] a #GSList list of localized strings; * the provider may append messages to this list, but * shouldn't reinitialize it; * since structure version 1. * * This structure allows all used parameters when importing from an URI * to be passed and received through a single structure. * * Since: 3.2 */ typedef struct { guint version; guint content; const gchar *uri; NAObjectItem *imported; GSList *messages; } NAIImporterImportFromUriParmsv2; GType na_iimporter_get_type ( void ); guint na_iimporter_import_from_uri( const NAIImporter *importer, NAIImporterImportFromUriParmsv2 *parms ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_IIMPORTER_H__ */ nautilus-actions-3.2.3/src/api/Makefile.in0000644000175100017500000005312312220365303015350 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/api DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(api_include_HEADERS) README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(api_includedir)" HEADERS = $(api_include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ api_includedir = $(pkgincludedir) api_include_HEADERS = \ na-extension.h \ \ na-dbus.h \ na-iexporter.h \ na-iimporter.h \ na-ifactory-provider.h \ na-ifactory-provider-provider.h \ na-iio-provider.h \ \ na-boxed.h \ na-core-utils.h \ na-data-boxed.h \ na-data-def.h \ na-data-types.h \ na-gconf-monitor.h \ na-gconf-utils.h \ na-icontext.h \ na-iduplicable.h \ na-ifactory-object.h \ na-ifactory-object-data.h \ na-object-api.h \ na-object.h \ na-object-id.h \ na-object-item.h \ na-object-action.h \ na-object-profile.h \ na-object-menu.h \ na-timeout.h \ $(NULL) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/api/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/api/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-api_includeHEADERS: $(api_include_HEADERS) @$(NORMAL_INSTALL) @list='$(api_include_HEADERS)'; test -n "$(api_includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(api_includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(api_includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(api_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(api_includedir)" || exit $$?; \ done uninstall-api_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(api_include_HEADERS)'; test -n "$(api_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(api_includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(api_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-api_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-api_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-api_includeHEADERS install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-api_includeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/src/api/na-ifactory-object.h0000644000175100017500000002076112212601376017142 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_H__ #define __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_H__ /** * SECTION: ifactory-object * @title: NAIFactoryObject * @short_description: The #NAObjectItem Interface v 1 * @include: nautilus-actions/na-ifactory_object.h * * This interface is implemented by #NAObjectItem derived objects so that they * can take advantage of our data factory management system. * * A #NAObjectItem derived object which would implement this #NAIFactoryObject * interface must meet following conditions: * * * * accept an empty constructor * * * * * * Versions historic * * Historic of the versions of the #NAIFactoryObject interface * * * * * * * &prodname; version * #NAIFactoryObject interface version * * * * * * since 2.30 * 1 * current version * * * *
*
*/ #include "na-data-def.h" #include "na-data-boxed.h" #include "na-ifactory-provider-provider.h" G_BEGIN_DECLS #define NA_TYPE_IFACTORY_OBJECT ( na_ifactory_object_get_type()) #define NA_IFACTORY_OBJECT( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_TYPE_IFACTORY_OBJECT, NAIFactoryObject )) #define NA_IS_IFACTORY_OBJECT( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NA_TYPE_IFACTORY_OBJECT )) #define NA_IFACTORY_OBJECT_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_TYPE_IFACTORY_OBJECT, NAIFactoryObjectInterface )) typedef struct _NAIFactoryObject NAIFactoryObject; typedef struct _NAIFactoryObjectInterfacePrivate NAIFactoryObjectInterfacePrivate; /** * NAIFactoryObjectInterface: * @get_version: returns the version of this interface the NAObjectItem implements. * @get_groups: returns a pointer to the NADataGroup which defines this object. * @copy: post copy callback. * @are_equal: tests if two NAObjectItem are equals. * @is_valid: tests if one NAObjectItem is valid. * @read_start: triggered before serializing a NAObjectItem. * @read_done: triggered after a NAObjectItem has been serialized. * @write_start: triggered before unserializing a NAObjectItem. * @write_done: triggered after a NAObjectItem has been unserialized. * * In order to take full advantage of our data managament system, * NAObjectItem-derived objects all implement this #NAIFactoryObject * interface. */ typedef struct { /*< private >*/ GTypeInterface parent; NAIFactoryObjectInterfacePrivate *private; /*< public >*/ /** * get_version: * @instance: this #NAIFactoryObject instance. * * Defaults to 1. * * Returns: the version of this interface supported by @instance implementation. * * Since: 2.30 */ guint ( *get_version )( const NAIFactoryObject *instance ); /** * get_groups: * @instance: this #NAIFactoryObject instance. * * Returns: a pointer to the NADataGroup which defines this object. * * Since: 2.30 */ NADataGroup * ( *get_groups ) ( const NAIFactoryObject *instance ); /** * copy: * @instance: the target #NAIFactoryObject instance. * @source: the source #NAIFactoryObject instance. * * This function is triggered after having copied @source to * @instance target. This later may take advantage of this call * to do some particular copy tasks. * * Since: 2.30 */ void ( *copy ) ( NAIFactoryObject *instance, const NAIFactoryObject *source ); /** * are_equal: * @a: the first #NAIFactoryObject instance. * @b: the second #NAIFactoryObject instance. * * This function is triggered after all elementary data comparisons * have been sucessfully made. * * Returns: %TRUE if @a is equal to @b. * * Since: 2.30 */ gboolean ( *are_equal ) ( const NAIFactoryObject *a, const NAIFactoryObject *b ); /** * is_valid: * @object: the #NAIFactoryObject instance whose validity is to be checked. * * This function is triggered after all elementary data comparisons * have been sucessfully made. * * Returns: %TRUE if @object is valid. * * Since: 2.30 */ gboolean ( *is_valid ) ( const NAIFactoryObject *object ); /** * read_start: * @instance: this #NAIFactoryObject instance. * @reader: the instance which has provided read services. * @reader_data: the data associated to @reader. * @messages: a pointer to a #GSList list of strings; the instance * may append messages to this list, but shouldn't reinitialize it. * * Called just before the object is unserialized. * * Since: 2.30 */ void ( *read_start ) ( NAIFactoryObject *instance, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ); /** * read_done: * @instance: this #NAIFactoryObject instance. * @reader: the instance which has provided read services. * @reader_data: the data associated to @reader. * @messages: a pointer to a #GSList list of strings; the instance * may append messages to this list, but shouldn't reinitialize it. * * Called when the object has been unserialized. * * Since: 2.30 */ void ( *read_done ) ( NAIFactoryObject *instance, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ); /** * write_start: * @instance: this #NAIFactoryObject instance. * @writer: the instance which has provided writing services. * @writer_data: the data associated to @writer. * @messages: a pointer to a #GSList list of strings; the instance * may append messages to this list, but shouldn't reinitialize it. * * Called just before the object is serialized. * * Returns: a NAIIOProvider operation return code. * * Since: 2.30 */ guint ( *write_start )( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ); /** * write_done: * @instance: this #NAIFactoryObject instance. * @writer: the instance which has provided writing services. * @writer_data: the data associated to @writer. * @messages: a pointer to a #GSList list of strings; the instance * may append messages to this list, but shouldn't reinitialize it. * * Called when the object has been serialized. * * Returns: a NAIIOProvider operation return code. * * Since: 2.30 */ guint ( *write_done ) ( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ); } NAIFactoryObjectInterface; GType na_ifactory_object_get_type( void ); NADataBoxed *na_ifactory_object_get_data_boxed ( const NAIFactoryObject *object, const gchar *name ); NADataGroup *na_ifactory_object_get_data_groups( const NAIFactoryObject *object ); void *na_ifactory_object_get_as_void ( const NAIFactoryObject *object, const gchar *name ); void na_ifactory_object_set_from_void ( NAIFactoryObject *object, const gchar *name, const void *data ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_H__ */ nautilus-actions-3.2.3/src/api/na-data-def.h0000644000175100017500000001365512212601376015527 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_DEF_H__ #define __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_DEF_H__ /** * SECTION: data-def * @title: NADataDef, NADataGroup * @short_description: The Data Factory Structure Definitions * @include: nautilus-actions/na-data-def.h * * #NADataDef and #NADataGroup are structures which handle the list of * elementary datas for each and every #NAObjectItem which happens to * implement the #NAIFactoryObject interface. */ #include G_BEGIN_DECLS /** * NADataDef: * @name: both the id and the canonical name. * Used when getting/setting properties. * Is defined in na-ifactory-object-data.h and must be globally unique. * Must be an invariant as it is known from plugin extensions. * @readable: whether the data should be read on unserialization operations. * If FALSE, then no attempt will be made to read it * and the data will have to be set dynamically. * When a data has been written once (see below), and unless * special cases (see e.g. type), it should remain readable * even if it has becomen obsolete (for backward compatibility). * @writable: whether the data is to be written on serialization operations. * If FALSE, then no attempt will be made to write it. * Mainly set to FALSE for dynamically set variables and * obsoleted ones. * @has_property: whether a property should be set for this variable ? * Set to FALSE for obsolete variables. * @short_label: short localizable descriptive name. * Used in GParamSpec and in schemas. * @long_label: long, if not complete, localizable description. * Used in GParamSpec and in schemas? * @type: the elementary NA_DATA_TYPE_xxx data type. * @default_value: the default to assign when creating a new object. * This default is also displayed in command-line help * of nautilus-actions-new utility. * @write_if_default: write this value even if it is the default value ? * Should default to FALSE. * @copyable: whether this data should be automatically copied when * we are duplicating an object to another ? * In all cases, the implementation is always triggered * by the copy() interface method. * @comparable: whether this data should be compared when we * are testing two objects for equality. * @mandatory: whether this data must be not null and not empty * when we are testing for validity of an object. * @localizable: whether this is a localizable data when serializing or exporting. * @gconf_entry: same entry is also used for GConf-based XML docs. * @desktop_entry: entry in .desktop files. * @option_short: the short version of a command-line parameter in nautilus-actions-new, * or 0. * @option_long: the long version of the same command-line parameter in nautilus-actions-new, * or NULL. * @option_flags: #GOptionFlags for the command-line parameter, or 0. * @option_arg: the type of the option, or 0. * @option_label: the localizable description for the variable in nautilus-actions-new. * Defaults to @short_label if NULL. * @option_arg_label: the localizable description for the argument. * * This structure fully describes an elementary factory data. * Each #NAIFactoryObject item definition may include several groups of * this structure. */ typedef struct { gchar *name; gboolean readable; gboolean writable; gboolean has_property; gchar *short_label; gchar *long_label; guint type; gchar *default_value; gboolean write_if_default; gboolean copyable; gboolean comparable; gboolean mandatory; gboolean localizable; gchar *gconf_entry; gchar *desktop_entry; gchar option_short; gchar *option_long; gint option_flags; GOptionArg option_arg; gchar *option_label; gchar *option_arg_label; } NADataDef; /** * NADataGroup: * @group: the name of the group, as defined in na-ifactory-object-data.h. * @def: the list of the corresponding data structures. * * This structure fully describes a logical group of data. * Each #NAIFactoryObject item definition is built from a list of * these groups. */ typedef struct { gchar *group; NADataDef *def; } NADataGroup; const NADataDef *na_data_def_get_data_def( const NADataGroup *group, const gchar *group_name, const gchar *name ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_FACTORY_DATA_DEF_H__ */ nautilus-actions-3.2.3/src/api/README0000644000175100017500000000046311367255352014177 00000000000000This is the Nautilus-Actions extension interface. Each extension library should at least implement the interface defined in na-extension.h. Headers are installed as part of a development environment of such an extension. They are to be included by the extension as '#include '. nautilus-actions-3.2.3/src/api/na-object.h0000644000175100017500000001314112212601376015316 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_API_NA_OBJECT_H__ #define __NAUTILUS_ACTIONS_API_NA_OBJECT_H__ /** * SECTION: object * @title: NAObject * @short_description: The Deepest Base Class Definition * @include: nautilus-actions/na-object.h * * This is the base class of all our data object hierarchy. #NAObject is * supposed to be used as a pure virtual base class, i.e. should only be * derived. * * All the API described here is rather private. External code should * use the API described in nautilus-actions/na-object-api.h. */ #include G_BEGIN_DECLS #define NA_TYPE_OBJECT ( na_object_object_get_type()) #define NA_OBJECT( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_OBJECT, NAObject )) #define NA_OBJECT_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_OBJECT, NAObjectClass )) #define NA_IS_OBJECT( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_OBJECT )) #define NA_IS_OBJECT_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_OBJECT )) #define NA_OBJECT_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_OBJECT, NAObjectClass )) typedef struct _NAObjectPrivate NAObjectPrivate; typedef struct { /*< private >*/ GObject parent; NAObjectPrivate *private; } NAObject; typedef struct _NAObjectClassPrivate NAObjectClassPrivate; /** * NAObjectClass: * @dump: Dumps the #NAObject -part of the #NAObject -derived object. * @copy: Copies a #NAObject to another. * @are_equal: Tests if two #NAObject are equal. * @is_valid: Tests if a #NAObject is valid. * * The #NAObjectClass defines some methods available to derived classes. */ typedef struct { /*< private >*/ GObjectClass parent; NAObjectClassPrivate *private; /*< public >*/ /** * dump: * @object: the NAObject-derived object to be dumped. * * Dumps via g_debug the content of the object. * * The derived class should call its parent class at the end of the * dump of its own datas. * * Since: 2.30 */ void ( *dump ) ( const NAObject *object ); /** * copy: * @target: the NAObject-derived object which will receive data. * @source: the NAObject-derived object which provides data. * @mode: the copy mode. * * Copies data and properties from @source to @target. * * The derived class should call its parent class at the end of the * copy of its own datas. * * Since: 2.30 */ void ( *copy ) ( NAObject *target, const NAObject *source, guint mode ); /** * are_equal: * @a: a first NAObject object. * @b: a second NAObject object to be compared to the first one. * * Compares the two objects. * * When testing for the modification status of an object, @a stands for * the original object, while @b stands for the duplicated one. * * As long as no difference is detected, the derived class should call * its parent class at the end of its comparison. * As soon as a difference is detected, the calling sequence should * be stopped, and the result returned. * * Returns: TRUE if @a and @b are identical, FALSE else. * * Since: 2.30 */ gboolean ( *are_equal )( const NAObject *a, const NAObject *b ); /** * is_valid: * @object: the NAObject object to be checked. * * Checks @object for validity. * * A NAObject is valid if its internal identifier is set. * * As long as the item is valid, the derived class should call its parent * at the end of its checks. * As soon as an error is detected, the calling sequence should be stopped, * and the result returned. * * Returns: TRUE if @object is valid, FALSE else. * * Since: 2.30 */ gboolean ( *is_valid ) ( const NAObject *object ); } NAObjectClass; GType na_object_object_get_type( void ); void na_object_object_check_status_rec( const NAObject *object ); void na_object_object_reset_origin ( NAObject *object, const NAObject *origin ); NAObject *na_object_object_ref ( NAObject *object ); void na_object_object_unref( NAObject *object ); void na_object_object_dump ( const NAObject *object ); void na_object_object_dump_norec( const NAObject *object ); void na_object_object_dump_tree ( GList *tree ); #ifdef NA_ENABLE_DEPRECATED GList *na_object_get_hierarchy( const NAObject *object ); void na_object_free_hierarchy( GList *hierarchy ); #endif void na_object_object_debug_invalid( const NAObject *object, const gchar *reason ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_OBJECT_H__ */ nautilus-actions-3.2.3/src/io-gconf/0000755000175100017500000000000012220365532014313 500000000000000nautilus-actions-3.2.3/src/io-gconf/nagp-gconf-provider.c0000644000175100017500000003074312212601376020255 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "nagp-gconf-provider.h" #include "nagp-reader.h" #include "nagp-writer.h" #include "nagp-keys.h" /* private class data */ struct _NagpGConfProviderClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; static GType st_module_type = 0; static GObjectClass *st_parent_class = NULL; #ifdef NA_ENABLE_DEPRECATED static gint st_burst_timeout = 100; /* burst timeout in msec */ #endif static void class_init( NagpGConfProviderClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void iio_provider_iface_init( NAIIOProviderInterface *iface ); static gchar *iio_provider_get_id( const NAIIOProvider *provider ); static gchar *iio_provider_get_name( const NAIIOProvider *provider ); static guint iio_provider_get_version( const NAIIOProvider *provider ); static void ifactory_provider_iface_init( NAIFactoryProviderInterface *iface ); static guint ifactory_provider_get_version( const NAIFactoryProvider *provider ); #ifdef NA_ENABLE_DEPRECATED static GList *install_monitors( NagpGConfProvider *provider ); static void config_path_changed_cb( GConfClient *client, guint cnxn_id, GConfEntry *entry, NagpGConfProvider *provider ); static gboolean config_path_changed_trigger_interface( NagpGConfProvider *provider ); static gulong time_val_diff( const GTimeVal *recent, const GTimeVal *old ); #endif GType nagp_gconf_provider_get_type( void ) { return( st_module_type ); } void nagp_gconf_provider_register_type( GTypeModule *module ) { static const gchar *thisfn = "nagp_gconf_provider_register_type"; static GTypeInfo info = { sizeof( NagpGConfProviderClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NagpGConfProvider ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo iio_provider_iface_info = { ( GInterfaceInitFunc ) iio_provider_iface_init, NULL, NULL }; static const GInterfaceInfo ifactory_provider_iface_info = { ( GInterfaceInitFunc ) ifactory_provider_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); st_module_type = g_type_module_register_type( module, G_TYPE_OBJECT, "NagpGConfProvider", &info, 0 ); g_type_module_add_interface( module, st_module_type, NA_TYPE_IIO_PROVIDER, &iio_provider_iface_info ); g_type_module_add_interface( module, st_module_type, NA_TYPE_IFACTORY_PROVIDER, &ifactory_provider_iface_info ); } static void class_init( NagpGConfProviderClass *klass ) { static const gchar *thisfn = "nagp_gconf_provider_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NagpGConfProviderClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "nagp_gconf_provider_instance_init"; NagpGConfProvider *self; g_return_if_fail( NAGP_IS_GCONF_PROVIDER( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NAGP_GCONF_PROVIDER( instance ); self->private = g_new0( NagpGConfProviderPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->gconf = gconf_client_get_default(); #ifdef NA_ENABLE_DEPRECATED self->private->monitors = install_monitors( self ); #endif } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "nagp_gconf_provider_instance_dispose"; NagpGConfProvider *self; g_return_if_fail( NAGP_IS_GCONF_PROVIDER( object )); self = NAGP_GCONF_PROVIDER( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; #ifdef NA_ENABLE_DEPRECATED /* release the GConf monitoring */ na_gconf_monitor_release_monitors( self->private->monitors ); #endif /* release the GConf connexion */ g_object_unref( self->private->gconf ); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn =" nagp_gconf_provider_instance_finalize"; NagpGConfProvider *self; g_return_if_fail( NAGP_IS_GCONF_PROVIDER( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NAGP_GCONF_PROVIDER( object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static void iio_provider_iface_init( NAIIOProviderInterface *iface ) { static const gchar *thisfn = "nagp_gconf_provider_iio_provider_iface_init"; g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); iface->get_id = iio_provider_get_id; iface->get_name = iio_provider_get_name; iface->get_version = iio_provider_get_version; iface->read_items = nagp_iio_provider_read_items; iface->is_willing_to_write = nagp_iio_provider_is_willing_to_write; iface->is_able_to_write = nagp_iio_provider_is_able_to_write; #ifdef NA_ENABLE_DEPRECATED iface->write_item = nagp_iio_provider_write_item; iface->delete_item = nagp_iio_provider_delete_item; #else iface->write_item = NULL; iface->delete_item = NULL; #endif iface->duplicate_data = NULL; } static gchar * iio_provider_get_id( const NAIIOProvider *provider ) { return( g_strdup( "na-gconf" )); } static gchar * iio_provider_get_name( const NAIIOProvider *provider ) { return( g_strdup( _( "Nautilus-Actions GConf I/O Provider" ))); } static guint iio_provider_get_version( const NAIIOProvider *provider ) { return( 1 ); } static void ifactory_provider_iface_init( NAIFactoryProviderInterface *iface ) { static const gchar *thisfn = "nagp_gconf_provider_ifactory_provider_iface_init"; g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); iface->get_version = ifactory_provider_get_version; iface->read_start = nagp_reader_read_start; iface->read_data = nagp_reader_read_data; iface->read_done = nagp_reader_read_done; #ifdef NA_ENABLE_DEPRECATED iface->write_start = nagp_writer_write_start; iface->write_data = nagp_writer_write_data; iface->write_done = nagp_writer_write_done; #else iface->write_start = NULL; iface->write_data = NULL; iface->write_done = NULL; #endif } static guint ifactory_provider_get_version( const NAIFactoryProvider *provider ) { return( 1 ); } #ifdef NA_ENABLE_DEPRECATED static GList * install_monitors( NagpGConfProvider *provider ) { GList *list = NULL; g_return_val_if_fail( NAGP_IS_GCONF_PROVIDER( provider ), NULL ); g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider ), NULL ); g_return_val_if_fail( !provider->private->dispose_has_run, NULL ); /* monitor the configurations/ directory which contains all menus, * actions and profiles definitions */ list = g_list_prepend( list, na_gconf_monitor_new( NAGP_CONFIGURATIONS_PATH, ( GConfClientNotifyFunc ) config_path_changed_cb, provider )); list = g_list_prepend( list, na_gconf_monitor_new( NAGP_SCHEMAS_PATH, ( GConfClientNotifyFunc ) config_path_changed_cb, provider )); return( list ); } /* * this callback is triggered each time a value is changed under our * configurations/ directory ; as each object has several entries which * describe it, this callback is triggered several times for each object * update * * up to and including 1.10.1, the user interface took care of writing * a special key in GConf at the end of each update operations ; * as GConf monitored only this special key, it triggered this callback * once for each global update operation * * this special key was of the form xxx:yyyyyyyy-yyyy-yyyy-..., where : * xxx was a sequential number (inside of the ui session) * yyyyyyyy-yyyy-yyyy-... was the uuid of the involved action * * this was a sort of hack which simplified a lot the notification * system, but didn't take into account any modification which might * come from outside of the ui * * if the modification is made elsewhere (an action is imported as a * xml file in gconf, or gconf is directly edited), we'd have to rely * only on the standard monitor (GConf watch) mechanism * * this is what we do below, in three phases: * - first, GConf underlying subsystem advertises us, through the watch * mechanism, of each and every modification ; this leads us to be * triggered for each new/modified/deleted _entry_ * - as we want trigger the NAIIOProvider interface only once for each * update operation (i.e. once for each flow of individual notifications), * then we install a timer in order to wait for all * entries have been modified * - when a [burst_timeout] reasonable delay has elapsed without having * received any new individual notification, then we can assume that * we have reached the end of the flow and that we can now trigger * the NAIIOProvider interface * * Note that we used to try to send one notification per modified object. * This cannot work as we are not sure at all that we will received * individual notifications themselves grouped by object. */ static void config_path_changed_cb( GConfClient *client, guint cnxn_id, GConfEntry *entry, NagpGConfProvider *provider ) { g_return_if_fail( NAGP_IS_GCONF_PROVIDER( provider )); g_return_if_fail( NA_IS_IIO_PROVIDER( provider )); if( !provider->private->dispose_has_run ){ g_get_current_time( &provider->private->last_event ); if( !provider->private->event_source_id ){ provider->private->event_source_id = g_timeout_add( st_burst_timeout, ( GSourceFunc ) config_path_changed_trigger_interface, provider ); } } } /* * this timer is set when we receive the first event of a serie * we continue to loop until last event is older that the st_burst_timeout * delay (in msec) * there is no race condition here as we are not multithreaded * or .. is there ? */ static gboolean config_path_changed_trigger_interface( NagpGConfProvider *provider ) { static const gchar *thisfn = "nagp_gconf_provider_config_path_changed_trigger_interface"; GTimeVal now; gulong diff; gulong timeout_usec = 1000*st_burst_timeout; g_get_current_time( &now ); diff = time_val_diff( &now, &provider->private->last_event ); if( diff < timeout_usec ){ return( TRUE ); } /* last individual notification is older that the st_burst_timeout * so triggers the NAIIOProvider interface and destroys this timeout */ g_debug( "%s: triggering NAIIOProvider interface for provider=%p (%s)", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider )); na_iio_provider_item_changed( NA_IIO_PROVIDER( provider )); provider->private->event_source_id = 0; return( FALSE ); } /* * returns the difference in microseconds. */ static gulong time_val_diff( const GTimeVal *recent, const GTimeVal *old ) { gulong microsec = 1000000 * ( recent->tv_sec - old->tv_sec ); microsec += recent->tv_usec - old->tv_usec; return( microsec ); } #endif /* NA_ENABLE_DEPRECATED */ nautilus-actions-3.2.3/src/io-gconf/nagp-writer.h0000644000175100017500000000466412212601376016655 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAGP_WRITE_H__ #define __NAGP_WRITE_H__ #include #include #include G_BEGIN_DECLS /* NAIIOProvider interface */ gboolean nagp_iio_provider_is_willing_to_write( const NAIIOProvider *provider ); gboolean nagp_iio_provider_is_able_to_write ( const NAIIOProvider *provider ); /* Writing into GConf is deprecated since 3.1.0 */ #ifdef NA_ENABLE_DEPRECATED guint nagp_iio_provider_write_item ( const NAIIOProvider *provider, const NAObjectItem *item, GSList **message ); guint nagp_iio_provider_delete_item ( const NAIIOProvider *provider, const NAObjectItem *item, GSList **message ); /* NAIFactoryProvider interface */ guint nagp_writer_write_start( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, GSList **messages ); guint nagp_writer_write_data ( const NAIFactoryProvider *provider, void *writer_data, const NAIFactoryObject *object, const NADataBoxed *boxed, GSList **messages ); guint nagp_writer_write_done ( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, GSList **messages ); #endif /* NA_ENABLE_DEPRECATED */ G_END_DECLS #endif /* __NAGP_WRITE_H__ */ nautilus-actions-3.2.3/src/io-gconf/nagp-writer.c0000644000175100017500000002715712212601376016652 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "nagp-gconf-provider.h" #include "nagp-writer.h" #include "nagp-keys.h" #ifdef NA_ENABLE_DEPRECATED static void write_start_write_type( NagpGConfProvider *provider, NAObjectItem *item ); static void write_start_write_version( NagpGConfProvider *provider, NAObjectItem *item ); #endif /* * API function: should only be called through NAIIOProvider interface */ gboolean nagp_iio_provider_is_willing_to_write( const NAIIOProvider *provider ) { #ifdef NA_ENABLE_DEPRECATED return( TRUE ); #else return( FALSE ); #endif } /* * Rationale: gconf reads its storage path from /etc/gconf/2/path ; * there is there a 'xml:readwrite:$(HOME)/.gconf' line, but I do not * known any way to get it programatically, so an admin may have set a * readwrite space elsewhere.. * * So, we try to write a 'foo' key somewhere: if it is ok, then the * provider is supposed able to write... * * API function: should only be called through NAIIOProvider interface */ gboolean nagp_iio_provider_is_able_to_write( const NAIIOProvider *provider ) { #ifdef NA_ENABLE_DEPRECATED static const gchar *thisfn = "nagp_iio_provider_is_able_to_write"; static const gchar *path = "/apps/nautilus-actions/foo"; NagpGConfProvider *self; gboolean able_to = FALSE; /*g_debug( "%s: provider=%p", thisfn, ( void * ) provider );*/ g_return_val_if_fail( NAGP_IS_GCONF_PROVIDER( provider ), FALSE ); g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider ), FALSE ); self = NAGP_GCONF_PROVIDER( provider ); if( !self->private->dispose_has_run ){ if( !na_gconf_utils_write_string( self->private->gconf, path, "foo", NULL )){ able_to = FALSE; } else { gchar *str = na_gconf_utils_read_string( self->private->gconf, path, FALSE, NULL ); if( strcmp( str, "foo" )){ able_to = FALSE; } else if( !gconf_client_recursive_unset( self->private->gconf, path, 0, NULL )){ able_to = FALSE; } else { able_to = TRUE; } g_free( str ); } } gconf_client_suggest_sync( self->private->gconf, NULL ); g_debug( "%s: provider=%p, able_to=%s", thisfn, ( void * ) provider, able_to ? "True":"False" ); return( able_to ); #else return( FALSE ); #endif } #ifdef NA_ENABLE_DEPRECATED /* * update an existing item or write a new one * in all cases, it is much more easy to delete the existing entries * before trying to write the new ones */ guint nagp_iio_provider_write_item( const NAIIOProvider *provider, const NAObjectItem *item, GSList **messages ) { static const gchar *thisfn = "nagp_gconf_provider_iio_provider_write_item"; NagpGConfProvider *self; guint ret; g_debug( "%s: provider=%p (%s), item=%p (%s), messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) item, G_OBJECT_TYPE_NAME( item ), ( void * ) messages ); ret = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; g_return_val_if_fail( NAGP_IS_GCONF_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), ret ); self = NAGP_GCONF_PROVIDER( provider ); if( self->private->dispose_has_run ){ return( NA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN ); } ret = nagp_iio_provider_delete_item( provider, item, messages ); if( ret == NA_IIO_PROVIDER_CODE_OK ){ na_ifactory_provider_write_item( NA_IFACTORY_PROVIDER( provider ), NULL, NA_IFACTORY_OBJECT( item ), messages ); } gconf_client_suggest_sync( self->private->gconf, NULL ); return( ret ); } /* * also delete the schema which may be directly attached to this action * cf. http://bugzilla.gnome.org/show_bug.cgi?id=325585 */ guint nagp_iio_provider_delete_item( const NAIIOProvider *provider, const NAObjectItem *item, GSList **messages ) { static const gchar *thisfn = "nagp_gconf_provider_iio_provider_delete_item"; NagpGConfProvider *self; guint ret; gchar *uuid, *path; GError *error = NULL; g_debug( "%s: provider=%p (%s), item=%p (%s), messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) item, G_OBJECT_TYPE_NAME( item ), ( void * ) messages ); ret = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider ), ret ); g_return_val_if_fail( NAGP_IS_GCONF_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), ret ); self = NAGP_GCONF_PROVIDER( provider ); if( self->private->dispose_has_run ){ return( NA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN ); } ret = NA_IIO_PROVIDER_CODE_OK; uuid = na_object_get_id( NA_OBJECT( item )); /* GCONF_UNSET_INCLUDING_SCHEMA_NAMES seems mean: including the name * of the schemas which is embedded in the GConfEntry - this doesn't * mean including the schemas themselves */ if( ret == NA_IIO_PROVIDER_CODE_OK ){ path = gconf_concat_dir_and_key( NAGP_CONFIGURATIONS_PATH, uuid ); gconf_client_recursive_unset( self->private->gconf, path, GCONF_UNSET_INCLUDING_SCHEMA_NAMES, &error ); if( error ){ g_warning( "%s: path=%s, error=%s", thisfn, path, error->message ); *messages = g_slist_append( *messages, g_strdup( error->message )); g_error_free( error ); error = NULL; ret = NA_IIO_PROVIDER_CODE_DELETE_CONFIG_ERROR; } gconf_client_suggest_sync( self->private->gconf, NULL ); g_free( path ); } if( ret == NA_IIO_PROVIDER_CODE_OK ){ path = gconf_concat_dir_and_key( NAGP_SCHEMAS_PATH, uuid ); gconf_client_recursive_unset( self->private->gconf, path, 0, &error ); if( error ){ g_warning( "%s: path=%s, error=%s", thisfn, path, error->message ); *messages = g_slist_append( *messages, g_strdup( error->message )); g_error_free( error ); error = NULL; ret = NA_IIO_PROVIDER_CODE_DELETE_SCHEMAS_ERROR; } g_free( path ); gconf_client_suggest_sync( self->private->gconf, NULL ); } g_free( uuid ); return( ret ); } guint nagp_writer_write_start( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, GSList **messages ) { if( NA_IS_OBJECT_ITEM( object )){ write_start_write_type( NAGP_GCONF_PROVIDER( writer ), NA_OBJECT_ITEM( object )); write_start_write_version( NAGP_GCONF_PROVIDER( writer ), NA_OBJECT_ITEM( object )); } return( NA_IIO_PROVIDER_CODE_OK ); } static void write_start_write_type( NagpGConfProvider *provider, NAObjectItem *item ) { gchar *id, *path; id = na_object_get_id( item ); path = g_strdup_printf( "%s/%s/%s", NAGP_CONFIGURATIONS_PATH, id, NAGP_ENTRY_TYPE ); na_gconf_utils_write_string( provider->private->gconf, path, NA_IS_OBJECT_ACTION( item ) ? NAGP_VALUE_TYPE_ACTION : NAGP_VALUE_TYPE_MENU, NULL ); g_free( path ); g_free( id ); } static void write_start_write_version( NagpGConfProvider *provider, NAObjectItem *item ) { gchar *id, *path; guint iversion; id = na_object_get_id( item ); path = g_strdup_printf( "%s/%s/%s", NAGP_CONFIGURATIONS_PATH, id, NAGP_ENTRY_IVERSION ); iversion = na_object_get_iversion( item ); na_gconf_utils_write_int( provider->private->gconf, path, iversion, NULL ); g_free( path ); g_free( id ); } guint nagp_writer_write_data( const NAIFactoryProvider *provider, void *writer_data, const NAIFactoryObject *object, const NADataBoxed *boxed, GSList **messages ) { static const gchar *thisfn = "nagp_writer_write_data"; guint code; const NADataDef *def; gchar *this_id; gchar *this_path, *path; gchar *msg; gchar *str_value; gboolean bool_value; GSList *slist_value; guint uint_value; GConfClient *gconf; /*g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ));*/ msg = NULL; code = NA_IIO_PROVIDER_CODE_OK; def = na_data_boxed_get_data_def( boxed ); if( !na_data_boxed_is_default( boxed ) || def->write_if_default ){ if( NA_IS_OBJECT_PROFILE( object )){ NAObjectItem *parent = NA_OBJECT_ITEM( na_object_get_parent( object )); gchar *parent_id = na_object_get_id( parent ); gchar *id = na_object_get_id( object ); this_id = g_strdup_printf( "%s/%s", parent_id, id ); g_free( id ); g_free( parent_id ); } else { this_id = na_object_get_id( object ); } this_path = gconf_concat_dir_and_key( NAGP_CONFIGURATIONS_PATH, this_id ); path = gconf_concat_dir_and_key( this_path, def->gconf_entry ); gconf = NAGP_GCONF_PROVIDER( provider )->private->gconf; switch( def->type ){ case NA_DATA_TYPE_STRING: str_value = na_boxed_get_string( NA_BOXED( boxed )); na_gconf_utils_write_string( gconf, path, str_value, &msg ); if( msg ){ *messages = g_slist_append( *messages, msg ); code = NA_IIO_PROVIDER_CODE_WRITE_ERROR; } g_free( str_value ); break; case NA_DATA_TYPE_LOCALE_STRING: str_value = na_boxed_get_string( NA_BOXED( boxed )); na_gconf_utils_write_string( gconf, path, str_value, &msg ); if( msg ){ *messages = g_slist_append( *messages, msg ); code = NA_IIO_PROVIDER_CODE_WRITE_ERROR; } g_free( str_value ); break; case NA_DATA_TYPE_BOOLEAN: bool_value = GPOINTER_TO_UINT( na_boxed_get_as_void( NA_BOXED( boxed ))); na_gconf_utils_write_bool( gconf, path, bool_value, &msg ); if( msg ){ *messages = g_slist_append( *messages, msg ); code = NA_IIO_PROVIDER_CODE_WRITE_ERROR; } break; case NA_DATA_TYPE_STRING_LIST: slist_value = ( GSList * ) na_boxed_get_as_void( NA_BOXED( boxed )); na_gconf_utils_write_string_list( gconf, path, slist_value, &msg ); if( msg ){ *messages = g_slist_append( *messages, msg ); code = NA_IIO_PROVIDER_CODE_WRITE_ERROR; } na_core_utils_slist_free( slist_value ); break; case NA_DATA_TYPE_UINT: uint_value = GPOINTER_TO_UINT( na_boxed_get_as_void( NA_BOXED( boxed ))); na_gconf_utils_write_int( gconf, path, uint_value, &msg ); if( msg ){ *messages = g_slist_append( *messages, msg ); code = NA_IIO_PROVIDER_CODE_WRITE_ERROR; } break; default: g_warning( "%s: unknown type=%u for %s", thisfn, def->type, def->name ); code = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; } /*g_debug( "%s: gconf=%p, code=%u, path=%s", thisfn, ( void * ) gconf, code, path );*/ g_free( msg ); g_free( path ); g_free( this_path ); g_free( this_id ); } return( code ); } guint nagp_writer_write_done( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, GSList **messages ) { return( NA_IIO_PROVIDER_CODE_OK ); } #endif /* NA_ENABLE_DEPRECATED */ nautilus-actions-3.2.3/src/io-gconf/nagp-keys.h0000644000175100017500000000305012212601376016300 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAGP_GCONF_PROVIDER_KEYS_H__ #define __NAGP_GCONF_PROVIDER_KEYS_H__ #define NAGP_CONFIGURATIONS_PATH "/apps/nautilus-actions/configurations" #define NAGP_SCHEMAS_PATH "/schemas/apps/nautilus-actions/configurations" #define NAGP_ENTRY_TYPE "type" #define NAGP_VALUE_TYPE_MENU "Menu" #define NAGP_VALUE_TYPE_ACTION "Action" #define NAGP_ENTRY_IVERSION "iversion" #endif /* __NAGP_GCONF_PROVIDER_KEYS_H__ */ nautilus-actions-3.2.3/src/io-gconf/nagp-gconf-provider.h0000644000175100017500000000621512212601376020257 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAGP_GCONF_PROVIDER_H__ #define __NAGP_GCONF_PROVIDER_H__ /** * SECTION: nagp_gconf_provider * @short_description: #NagpGConfProvider class definition. * @include: na-gconf-provider.h * * This class manages the GConf I/O storage subsystem, or, in other words, * the GConf subsystem as an #NAIIOProvider. As this, it should only be * used through the #NAIIOProvider interface. * * #NagpGConfProvider uses #NAGConfMonitor to watch at the configuration * tree. Modifications are notified to the #NAIIOProvider interface. */ #include #include G_BEGIN_DECLS #define NAGP_GCONF_PROVIDER_TYPE ( nagp_gconf_provider_get_type()) #define NAGP_GCONF_PROVIDER( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NAGP_GCONF_PROVIDER_TYPE, NagpGConfProvider )) #define NAGP_GCONF_PROVIDER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NAGP_GCONF_PROVIDER_TYPE, NagpGConfProviderClass )) #define NAGP_IS_GCONF_PROVIDER( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NAGP_GCONF_PROVIDER_TYPE )) #define NAGP_IS_GCONF_PROVIDER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NAGP_GCONF_PROVIDER_TYPE )) #define NAGP_GCONF_PROVIDER_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NAGP_GCONF_PROVIDER_TYPE, NagpGConfProviderClass )) /* private instance data */ typedef struct _NagpGConfProviderPrivate { /*< private >*/ gboolean dispose_has_run; GConfClient *gconf; GList *monitors; guint event_source_id; GTimeVal last_event; } NagpGConfProviderPrivate; typedef struct { /*< private >*/ GObject parent; NagpGConfProviderPrivate *private; } NagpGConfProvider; typedef struct _NagpGConfProviderClassPrivate NagpGConfProviderClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NagpGConfProviderClassPrivate *private; } NagpGConfProviderClass; GType nagp_gconf_provider_get_type ( void ); void nagp_gconf_provider_register_type( GTypeModule *module ); G_END_DECLS #endif /* __NAGP_GCONF_PROVIDER_H__ */ nautilus-actions-3.2.3/src/io-gconf/nagp-reader.h0000644000175100017500000000353212212601376016574 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAGP_READER_H__ #define __NAGP_READER_H__ #include #include G_BEGIN_DECLS GList *nagp_iio_provider_read_items( const NAIIOProvider *provider, GSList **messages ); void nagp_reader_read_start( const NAIFactoryProvider *provider, void *reader_data, const NAIFactoryObject *object, GSList **messages ); NADataBoxed *nagp_reader_read_data ( const NAIFactoryProvider *provider, void *reader_data, const NAIFactoryObject *object, const NADataDef *def, GSList **messages ); void nagp_reader_read_done ( const NAIFactoryProvider *provider, void *reader_data, const NAIFactoryObject *object, GSList **messages ); G_END_DECLS #endif /* __NAGP_READER_H__ */ nautilus-actions-3.2.3/src/io-gconf/Makefile.am0000644000175100017500000000345112212601376016272 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) if HAVE_GCONF pkglib_LTLIBRARIES = libna-io-gconf.la AM_CPPFLAGS += \ -I $(top_srcdir) \ -I $(top_srcdir)/src \ $(NAUTILUS_ACTIONS_CFLAGS) \ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_IO_GCONF}\" \ $(NULL) libna_io_gconf_la_SOURCES = \ nagp-gconf-provider.c \ nagp-gconf-provider.h \ nagp-keys.h \ nagp-module.c \ nagp-reader.c \ nagp-reader.h \ nagp-writer.c \ nagp-writer.h \ $(NULL) libna_io_gconf_la_LIBADD = \ $(top_builddir)/src/core/libna-core.la \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libna_io_gconf_la_LDFLAGS = \ -module \ -no-undefined \ -avoid-version \ $(NULL) endif nautilus-actions-3.2.3/src/io-gconf/Makefile.in0000644000175100017500000006452512220365303016310 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @HAVE_GCONF_TRUE@am__append_1 = \ @HAVE_GCONF_TRUE@ -I $(top_srcdir) \ @HAVE_GCONF_TRUE@ -I $(top_srcdir)/src \ @HAVE_GCONF_TRUE@ $(NAUTILUS_ACTIONS_CFLAGS) \ @HAVE_GCONF_TRUE@ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_IO_GCONF}\" \ @HAVE_GCONF_TRUE@ $(NULL) subdir = src/io-gconf DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = @HAVE_GCONF_TRUE@libna_io_gconf_la_DEPENDENCIES = \ @HAVE_GCONF_TRUE@ $(top_builddir)/src/core/libna-core.la \ @HAVE_GCONF_TRUE@ $(am__DEPENDENCIES_1) am__libna_io_gconf_la_SOURCES_DIST = nagp-gconf-provider.c \ nagp-gconf-provider.h nagp-keys.h nagp-module.c nagp-reader.c \ nagp-reader.h nagp-writer.c nagp-writer.h @HAVE_GCONF_TRUE@am_libna_io_gconf_la_OBJECTS = \ @HAVE_GCONF_TRUE@ nagp-gconf-provider.lo nagp-module.lo \ @HAVE_GCONF_TRUE@ nagp-reader.lo nagp-writer.lo libna_io_gconf_la_OBJECTS = $(am_libna_io_gconf_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libna_io_gconf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libna_io_gconf_la_LDFLAGS) $(LDFLAGS) \ -o $@ @HAVE_GCONF_TRUE@am_libna_io_gconf_la_rpath = -rpath $(pkglibdir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libna_io_gconf_la_SOURCES) DIST_SOURCES = $(am__libna_io_gconf_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ $(am__append_1) AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ @HAVE_GCONF_TRUE@pkglib_LTLIBRARIES = libna-io-gconf.la @HAVE_GCONF_TRUE@libna_io_gconf_la_SOURCES = \ @HAVE_GCONF_TRUE@ nagp-gconf-provider.c \ @HAVE_GCONF_TRUE@ nagp-gconf-provider.h \ @HAVE_GCONF_TRUE@ nagp-keys.h \ @HAVE_GCONF_TRUE@ nagp-module.c \ @HAVE_GCONF_TRUE@ nagp-reader.c \ @HAVE_GCONF_TRUE@ nagp-reader.h \ @HAVE_GCONF_TRUE@ nagp-writer.c \ @HAVE_GCONF_TRUE@ nagp-writer.h \ @HAVE_GCONF_TRUE@ $(NULL) @HAVE_GCONF_TRUE@libna_io_gconf_la_LIBADD = \ @HAVE_GCONF_TRUE@ $(top_builddir)/src/core/libna-core.la \ @HAVE_GCONF_TRUE@ $(NAUTILUS_ACTIONS_LIBS) \ @HAVE_GCONF_TRUE@ $(NULL) @HAVE_GCONF_TRUE@libna_io_gconf_la_LDFLAGS = \ @HAVE_GCONF_TRUE@ -module \ @HAVE_GCONF_TRUE@ -no-undefined \ @HAVE_GCONF_TRUE@ -avoid-version \ @HAVE_GCONF_TRUE@ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/io-gconf/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/io-gconf/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libna-io-gconf.la: $(libna_io_gconf_la_OBJECTS) $(libna_io_gconf_la_DEPENDENCIES) $(EXTRA_libna_io_gconf_la_DEPENDENCIES) $(AM_V_CCLD)$(libna_io_gconf_la_LINK) $(am_libna_io_gconf_la_rpath) $(libna_io_gconf_la_OBJECTS) $(libna_io_gconf_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nagp-gconf-provider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nagp-module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nagp-reader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nagp-writer.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-pkglibLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/src/io-gconf/nagp-reader.c0000644000175100017500000003363512212601376016576 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "nagp-gconf-provider.h" #include "nagp-keys.h" #include "nagp-reader.h" typedef struct { gchar *path; GSList *entries; NAObjectItem *parent; } ReaderData; static NAObjectItem *read_item( NagpGConfProvider *provider, const gchar *path, GSList **messages ); static void read_start_profile_attach_profile( const NAIFactoryProvider *provider, NAObjectProfile *profile, ReaderData *data, GSList **messages ); static gboolean read_done_item_is_writable( const NAIFactoryProvider *provider, NAObjectItem *item, ReaderData *data, GSList **messages ); static void read_done_action_read_profiles( const NAIFactoryProvider *provider, NAObjectAction *action, ReaderData *data, GSList **messages ); static void read_done_action_load_profile( const NAIFactoryProvider *provider, ReaderData *data, const gchar *path, GSList **messages ); static NADataBoxed *get_boxed_from_path( const NagpGConfProvider *provider, const gchar *path, ReaderData *reader_data, const NADataDef *def ); static gboolean is_key_writable( NagpGConfProvider *gconf, const gchar *key ); /* * nagp_iio_provider_read_items: * * Note that whatever be the version of the read action, it will be * stored as a #NAObjectAction and its set of #NAObjectProfile of the same, * latest, version of these classes. */ GList * nagp_iio_provider_read_items( const NAIIOProvider *provider, GSList **messages ) { static const gchar *thisfn = "nagp_reader_nagp_iio_provider_read_items"; NagpGConfProvider *self; GList *items_list = NULL; GSList *listpath, *ip; NAObjectItem *item; g_debug( "%s: provider=%p, messages=%p", thisfn, ( void * ) provider, ( void * ) messages ); g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider ), NULL ); g_return_val_if_fail( NAGP_IS_GCONF_PROVIDER( provider ), NULL ); self = NAGP_GCONF_PROVIDER( provider ); if( !self->private->dispose_has_run ){ listpath = na_gconf_utils_get_subdirs( self->private->gconf, NAGP_CONFIGURATIONS_PATH ); for( ip = listpath ; ip ; ip = ip->next ){ item = read_item( self, ( const gchar * ) ip->data, messages ); if( item ){ items_list = g_list_prepend( items_list, item ); na_object_dump( item ); } } na_gconf_utils_free_subdirs( listpath ); } g_debug( "%s: count=%d", thisfn, g_list_length( items_list )); return( items_list ); } /* * path is here the full path to an item */ static NAObjectItem * read_item( NagpGConfProvider *provider, const gchar *path, GSList **messages ) { static const gchar *thisfn = "nagp_reader_read_item"; NAObjectItem *item; gchar *full_path; gchar *type; gchar *id; ReaderData *data; g_debug( "%s: provider=%p, path=%s", thisfn, ( void * ) provider, path ); g_return_val_if_fail( NAGP_IS_GCONF_PROVIDER( provider ), NULL ); g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider ), NULL ); g_return_val_if_fail( !provider->private->dispose_has_run, NULL ); full_path = gconf_concat_dir_and_key( path, NAGP_ENTRY_TYPE ); type = na_gconf_utils_read_string( provider->private->gconf, full_path, TRUE, NAGP_VALUE_TYPE_ACTION ); g_free( full_path ); item = NULL; /* an item may have 'Action' or 'Menu' type; defaults to Action */ if( !type || !strlen( type ) || !strcmp( type, NAGP_VALUE_TYPE_ACTION )){ item = NA_OBJECT_ITEM( na_object_action_new()); } else if( !strcmp( type, NAGP_VALUE_TYPE_MENU )){ item = NA_OBJECT_ITEM( na_object_menu_new()); } else { g_warning( "%s: unknown type '%s' at %s", thisfn, type, path ); } g_free( type ); if( item ){ id = g_path_get_basename( path ); na_object_set_id( item, id ); g_free( id ); data = g_new0( ReaderData, 1 ); data->path = ( gchar * ) path; data->entries = na_gconf_utils_get_entries( provider->private->gconf, path ); na_gconf_utils_dump_entries( data->entries ); na_ifactory_provider_read_item( NA_IFACTORY_PROVIDER( provider ), data, NA_IFACTORY_OBJECT( item ), messages ); na_gconf_utils_free_entries( data->entries ); g_free( data ); } return( item ); } void nagp_reader_read_start( const NAIFactoryProvider *provider, void *reader_data, const NAIFactoryObject *object, GSList **messages ) { static const gchar *thisfn = "nagp_reader_read_start"; g_return_if_fail( NA_IS_IFACTORY_PROVIDER( provider )); g_return_if_fail( NAGP_IS_GCONF_PROVIDER( provider )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); if( !NAGP_GCONF_PROVIDER( provider )->private->dispose_has_run ){ g_debug( "%s: provider=%p (%s), reader_data=%p, object=%p (%s), messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) reader_data, ( void * ) object, G_OBJECT_TYPE_NAME( object ), ( void * ) messages ); if( NA_IS_OBJECT_PROFILE( object )){ read_start_profile_attach_profile( provider, NA_OBJECT_PROFILE( object ), ( ReaderData * ) reader_data, messages ); } } } static void read_start_profile_attach_profile( const NAIFactoryProvider *provider, NAObjectProfile *profile, ReaderData *data, GSList **messages ) { na_object_attach_profile( data->parent, profile ); } NADataBoxed * nagp_reader_read_data( const NAIFactoryProvider *provider, void *reader_data, const NAIFactoryObject *object, const NADataDef *def, GSList **messages ) { static const gchar *thisfn = "nagp_reader_read_data"; NADataBoxed *boxed; g_return_val_if_fail( NA_IS_IFACTORY_PROVIDER( provider ), NULL ); g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL ); /*g_debug( "%s: reader_data=%p, object=%p (%s), data=%s", thisfn, ( void * ) reader_data, ( void * ) object, G_OBJECT_TYPE_NAME( object ), def->name );*/ if( !def->gconf_entry || !strlen( def->gconf_entry )){ g_warning( "%s: GConf entry is not set for NADataDef %s", thisfn, def->name ); return( NULL ); } boxed = get_boxed_from_path( NAGP_GCONF_PROVIDER( provider ), (( ReaderData * ) reader_data )->path, reader_data, def ); return( boxed ); } void nagp_reader_read_done( const NAIFactoryProvider *provider, void *reader_data, const NAIFactoryObject *object, GSList **messages ) { static const gchar *thisfn = "nagp_reader_read_done"; gboolean writable; g_return_if_fail( NA_IS_IFACTORY_PROVIDER( provider )); g_return_if_fail( NAGP_IS_GCONF_PROVIDER( provider )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); if( !NAGP_GCONF_PROVIDER( provider )->private->dispose_has_run ){ g_debug( "%s: provider=%p (%s), reader_data=%p, object=%p (%s), messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) reader_data, ( void * ) object, G_OBJECT_TYPE_NAME( object ), ( void * ) messages ); if( NA_IS_OBJECT_ITEM( object )){ writable = read_done_item_is_writable( provider, NA_OBJECT_ITEM( object ), ( ReaderData * ) reader_data, messages ); na_object_set_readonly( object, !writable ); } if( NA_IS_OBJECT_ACTION( object )){ read_done_action_read_profiles( provider, NA_OBJECT_ACTION( object ), ( ReaderData * ) reader_data, messages ); } g_debug( "%s: quitting for %s at %p", thisfn, G_OBJECT_TYPE_NAME( object ), ( void * ) object ); } } static gboolean read_done_item_is_writable( const NAIFactoryProvider *provider, NAObjectItem *item, ReaderData *data, GSList **messages ) { GSList *ie; gboolean writable; GConfEntry *gconf_entry; const gchar *key; /* check for writability of this item * item is writable if and only if all entries are themselves writable */ writable = TRUE; for( ie = data->entries ; ie && writable ; ie = ie->next ){ gconf_entry = ( GConfEntry * ) ie->data; key = gconf_entry_get_key( gconf_entry ); writable = is_key_writable( NAGP_GCONF_PROVIDER( provider ), key ); } g_debug( "nagp_reader_read_done_item: writable=%s", writable ? "True":"False" ); return( writable ); } static void read_done_action_read_profiles( const NAIFactoryProvider *provider, NAObjectAction *action, ReaderData *data, GSList **messages ) { static const gchar *thisfn = "nagp_reader_read_done_action_read_profiles"; GSList *order; GSList *list_profiles; GSList *ip; gchar *profile_id; gchar *profile_path; NAObjectId *found; NAObjectProfile *profile; data->parent = NA_OBJECT_ITEM( action ); order = na_object_get_items_slist( action ); list_profiles = na_gconf_utils_get_subdirs( NAGP_GCONF_PROVIDER( provider )->private->gconf, data->path ); /* read profiles in the specified order * as a protection against bugs in NACT, we check that profile has not * already been loaded */ for( ip = order ; ip ; ip = ip->next ){ profile_id = ( gchar * ) ip->data; found = na_object_get_item( action, profile_id ); if( !found ){ g_debug( "nagp_reader_read_done_action: loading profile=%s", profile_id ); profile_path = gconf_concat_dir_and_key( data->path, profile_id ); read_done_action_load_profile( provider, data, profile_path, messages ); g_free( profile_path ); } } /* append other profiles * this is mandatory for pre-2.29 actions which introduced order of profiles */ for( ip = list_profiles ; ip ; ip = ip->next ){ profile_id = g_path_get_basename(( const gchar * ) ip->data ); found = na_object_get_item( action, profile_id ); if( !found ){ g_debug( "nagp_reader_read_done_action: loading profile=%s", profile_id ); read_done_action_load_profile( provider, data, ( const gchar * ) ip->data, messages ); } g_free( profile_id ); } /* make sure we have at least one profile */ if( !na_object_get_items_count( action )){ g_warning( "%s: no profile found in GConf backend", thisfn ); profile = na_object_profile_new_with_defaults(); na_object_attach_profile( action, profile ); } } static void read_done_action_load_profile( const NAIFactoryProvider *provider, ReaderData *data, const gchar *path, GSList **messages ) { gchar *id; ReaderData *profile_data; NAObjectProfile *profile = na_object_profile_new(); id = g_path_get_basename( path ); na_object_set_id( profile, id ); g_free( id ); profile_data = g_new0( ReaderData, 1 ); profile_data->parent = data->parent; profile_data->path = ( gchar * ) path; profile_data->entries = na_gconf_utils_get_entries( NAGP_GCONF_PROVIDER( provider )->private->gconf, path ); na_ifactory_provider_read_item( NA_IFACTORY_PROVIDER( provider ), profile_data, NA_IFACTORY_OBJECT( profile ), messages ); na_gconf_utils_free_entries( profile_data->entries ); g_free( profile_data ); } static NADataBoxed * get_boxed_from_path( const NagpGConfProvider *provider, const gchar *path, ReaderData *reader_data, const NADataDef *def ) { static const gchar *thisfn = "nagp_reader_get_boxed_from_path"; NADataBoxed *boxed; gboolean have_entry; gchar *str_value; gboolean bool_value; GSList *slist_value; gint int_value; boxed = NULL; have_entry = na_gconf_utils_has_entry( reader_data->entries, def->gconf_entry ); g_debug( "%s: entry=%s, have_entry=%s", thisfn, def->gconf_entry, have_entry ? "True":"False" ); if( have_entry ){ gchar *entry_path = gconf_concat_dir_and_key( path, def->gconf_entry ); boxed = na_data_boxed_new( def ); switch( def->type ){ case NA_DATA_TYPE_STRING: case NA_DATA_TYPE_LOCALE_STRING: str_value = na_gconf_utils_read_string( provider->private->gconf, entry_path, TRUE, NULL ); na_boxed_set_from_string( NA_BOXED( boxed ), str_value ); g_free( str_value ); break; case NA_DATA_TYPE_BOOLEAN: bool_value = na_gconf_utils_read_bool( provider->private->gconf, entry_path, TRUE, FALSE ); na_boxed_set_from_void( NA_BOXED( boxed ), GUINT_TO_POINTER( bool_value )); break; case NA_DATA_TYPE_STRING_LIST: slist_value = na_gconf_utils_read_string_list( provider->private->gconf, entry_path ); na_boxed_set_from_void( NA_BOXED( boxed ), slist_value ); na_core_utils_slist_free( slist_value ); break; case NA_DATA_TYPE_UINT: int_value = na_gconf_utils_read_int( provider->private->gconf, entry_path, TRUE, 0 ); na_boxed_set_from_void( NA_BOXED( boxed ), GUINT_TO_POINTER( int_value )); break; default: g_warning( "%s: unknown type=%u for %s", thisfn, def->type, def->name ); g_free( boxed ); boxed = NULL; } g_free( entry_path ); } return( boxed ); } /* * key must be an existing entry (not a dir) to get a relevant return * value ; else we get FALSE */ static gboolean is_key_writable( NagpGConfProvider *gconf, const gchar *key ) { static const gchar *thisfn = "nagp_read_is_key_writable"; GError *error = NULL; gboolean is_writable; is_writable = gconf_client_key_is_writable( gconf->private->gconf, key, &error ); if( error ){ g_warning( "%s: gconf_client_key_is_writable: %s", thisfn, error->message ); g_error_free( error ); error = NULL; is_writable = FALSE; } return( is_writable ); } nautilus-actions-3.2.3/src/io-gconf/nagp-module.c0000644000175100017500000000521112212601376016606 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "nagp-gconf-provider.h" /* the count of GType types provided by this extension * each new GType type must * - be registered in na_extension_startup() * - be addressed in na_extension_list_types(). */ #define NAGP_TYPES_COUNT 1 /* * na_extension_startup: * * mandatory starting with API v. 1. */ gboolean na_extension_startup( GTypeModule *module ) { static const gchar *thisfn = "nagp_module_na_extension_startup"; g_debug( "%s: module=%p", thisfn, ( void * ) module ); nagp_gconf_provider_register_type( module ); return( TRUE ); } /* * na_extension_get_version: * * optional, defaults to 1. */ guint na_extension_get_version( void ) { static const gchar *thisfn = "nagp_module_na_extension_get_version"; guint version; version = 1; g_debug( "%s: version=%d", thisfn, version ); return( version ); } /* * na_extension_list_types: * * mandatory starting with v. 1. */ guint na_extension_list_types( const GType **types ) { static const gchar *thisfn = "nagp_module_na_extension_list_types"; static GType types_list [1+NAGP_TYPES_COUNT]; g_debug( "%s: types=%p", thisfn, ( void * ) types ); types_list[0] = NAGP_GCONF_PROVIDER_TYPE; types_list[NAGP_TYPES_COUNT] = 0; *types = types_list; return( NAGP_TYPES_COUNT ); } /* * na_extension_shutdown: * * mandatory starting with v. 1. */ void na_extension_shutdown( void ) { static const gchar *thisfn = "nagp_module_na_extension_shutdown"; g_debug( "%s", thisfn ); } nautilus-actions-3.2.3/src/core/0000755000175100017500000000000012220365532013542 500000000000000nautilus-actions-3.2.3/src/core/na-gnome-vfs-uri.h0000644000175100017500000000622612212601376016733 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_NA_PRIVATE_GNOME_VFS_URI_H__ #define __NAUTILUS_ACTIONS_NA_PRIVATE_GNOME_VFS_URI_H__ /* * pwi 2009-07-29 * shamelessly pull out of GnomeVFS (gnome-vfs-uri and consorts) */ /* gnome-vfs-uri.h - URI handling for the GNOME Virtual File System. Copyright (C) 1999 Free Software Foundation The Gnome Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The Gnome Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the Gnome Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Author: Ettore Perazzoli */ #include G_BEGIN_DECLS typedef struct { gchar *path; gchar *scheme; gchar *host_name; guint host_port; gchar *user_name; gchar *password; } NAGnomeVFSURI; /* * GNOME_VFS_URI_MAGIC_CHR: * * The character used to divide location from * extra "arguments" passed to the method. **/ /* * GNOME_VFS_URI_MAGIC_STR: * * The character used to divide location from * extra "arguments" passed to the method. **/ #define GNOME_VFS_URI_MAGIC_CHR '#' #define GNOME_VFS_URI_MAGIC_STR "#" /* * GNOME_VFS_URI_PATH_CHR: * * Defines the path seperator character. **/ /* * GNOME_VFS_URI_PATH_STR: * * Defines the path seperator string. **/ #define GNOME_VFS_URI_PATH_CHR '/' #define GNOME_VFS_URI_PATH_STR "/" void na_gnome_vfs_uri_parse( NAGnomeVFSURI *vfs, const gchar *uri ); void na_gnome_vfs_uri_free( NAGnomeVFSURI *vfs ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_NA_PRIVATE_GNOME_VFS_URI_H__ */ nautilus-actions-3.2.3/src/core/na-about.c0000644000175100017500000001164012212601376015336 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "na-about.h" /* * na_about_display: * @toplevel: the parent window. * * Displays the About dialog. */ void na_about_display( GtkWindow *toplevel ) { gchar *application_name, *copyright; int i; GString *license_i18n; static const gchar *artists[] = { "Ulisse Perusin ", "DragonArtz - http://www.dragonartz.net/", NULL }; static const gchar *authors[] = { "Frederic Ruaudel ", "Rodrigo Moya ", "Pierre Wieser ", NULL }; static const gchar *documenters[] = { NULL }; static gchar *license[] = { N_( "Nautilus-Actions Configuration Tool is free software; you can " "redistribute it and/or modify it under the terms of the GNU General " "Public License as published by the Free Software Foundation; either " "version 2 of the License, or (at your option) any later version." ), N_( "Nautilus-Actions Configuration Tool 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 General Public License for more details." ), N_( "You should have received a copy of the GNU General Public License along " "with Nautilus-Actions Configuration Tool ; if not, write to the Free " "Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, " "MA 02110-1301, USA." ), NULL }; application_name = na_about_get_application_name(); copyright = na_about_get_copyright( FALSE ); i = 0; license_i18n = g_string_new( "" ); while( license[i] ){ g_string_append_printf( license_i18n, "%s\n\n", gettext( license[i] )); i += 1; } gtk_show_about_dialog( toplevel, "artists", artists, "authors", authors, /* i10n: "Nautilus actions" here is not a typo; this does not refer to the * Nautilus-Actions product, but to the actions which are to be added to Nautilus */ "comments", _( "A graphical interface to create and edit your Nautilus actions." ), "copyright", copyright, "documenters", documenters, "license", license_i18n->str, "logo-icon-name", na_about_get_icon_name(), "program-name", application_name, "translator-credits", _( "The GNOME Translation Project " ), "version", PACKAGE_VERSION, "website", "http://www.nautilus-actions.org", "wrap-license", TRUE, NULL ); g_free( application_name ); g_string_free( license_i18n, TRUE ); g_free( copyright ); } /* * na_about_get_application_name: * * Returns: the name of the application, as a newly allocated string * which should be g_free() by the caller. */ gchar * na_about_get_application_name( void ) { /* i18n: title of the About dialog box, when seen from Nautilus file manager */ return( g_strdup( _( "Nautilus-Actions" ))); } /* * na_about_get_icon_name: * * Returns: the name of the default icon for the application. * * This name is owned by the package, and should not be released by the caller. * * cf. Makefile: PACKAGE = nautilus-actions */ const gchar * na_about_get_icon_name( void ) { return( PACKAGE ); } /* * na_about_get_copyright: * @console: whether the string is to be printed on a console. * * Returns: the copyright string, as a newly allocated string which * should be g_free() by the caller. */ gchar * na_about_get_copyright( gboolean console ) { gchar *copyright; gchar *symbol; symbol = g_strdup( console ? "(C)" : "\xc2\xa9"); copyright = g_strdup_printf( _( "Copyright %s 2005 The GNOME Foundation\n" "Copyright %s 2006-2008 Frederic Ruaudel \n" "Copyright %s 2009-2013 Pierre Wieser " ), symbol, symbol, symbol ); g_free( symbol ); return( copyright ); } nautilus-actions-3.2.3/src/core/na-data-types.c0000644000175100017500000000450712212601376016303 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include typedef struct { guint type; gchar *gconf_dump_key; gchar *gconf_secondary_key; } FactoryType; static FactoryType st_factory_type[] = { { NA_DATA_TYPE_BOOLEAN, "bool", NULL }, { NA_DATA_TYPE_POINTER, NULL, NULL }, { NA_DATA_TYPE_STRING, "string", NULL }, { NA_DATA_TYPE_STRING_LIST, "list", "string" }, { NA_DATA_TYPE_LOCALE_STRING, "string", NULL }, { NA_DATA_TYPE_UINT, "int", NULL }, { NA_DATA_TYPE_UINT_LIST, "list", "int" }, { 0 } }; /** * na_data_types_get_gconf_dump_key: * @type: the FactoryData type. * * Returns: the GConf key suitable for this type. * * The returned key is owned by the factory data management system, and * should not be released by the caller. * * Since: 2.30 */ const gchar * na_data_types_get_gconf_dump_key( guint type ) { static const gchar *thisfn = "na_data_types_get_gconf_dump_key"; FactoryType *str; str = st_factory_type; while( str->type ){ if( str->type == type ){ return( str->gconf_dump_key ); } str++; } g_warning( "%s: unknown data type: %d", thisfn, type ); return( NULL ); } nautilus-actions-3.2.3/src/core/na-exporter.h0000644000175100017500000000464212212601376016105 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_EXPORTER_H__ #define __CORE_NA_EXPORTER_H__ /* @title: NAIExporter * @short_description: The #NAIExporter Internal Functions * @include: core/na-exporter.h */ #include #include #include "na-ioption.h" #include "na-pivot.h" G_BEGIN_DECLS #define EXPORTER_FORMAT_ASK "Ask" #define EXPORTER_FORMAT_NOEXPORT "NoExport" GList *na_exporter_get_formats ( const NAPivot *pivot ); void na_exporter_free_formats ( GList *formats ); NAIOption *na_exporter_get_ask_option ( void ); gchar *na_exporter_to_buffer ( const NAPivot *pivot, const NAObjectItem *item, const gchar *format, GSList **messages ); gchar *na_exporter_to_file ( const NAPivot *pivot, const NAObjectItem *item, const gchar *folder_uri, const gchar *format, GSList **messages ); NAIExporter *na_exporter_find_for_format( const NAPivot *pivot, const gchar *format ); G_END_DECLS #endif /* __CORE_NA_EXPORTER_H__ */ nautilus-actions-3.2.3/src/core/na-ioption.c0000644000175100017500000001450612212601376015711 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include "na-ioption.h" /* private interface data */ struct _NAIOptionInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* data set against the instance * * Initialization here mainly means setting the weak ref against the instance. */ typedef struct { gboolean initialized; } IOptionData; #define IOPTION_PROP_DATA "na-prop-ioption-data" static guint st_initializations = 0; /* interface initialization count */ static GType register_type( void ); static void interface_base_init( NAIOptionInterface *iface ); static void interface_base_finalize( NAIOptionInterface *iface ); static guint ioption_get_version( const NAIOption *instance ); static IOptionData *get_ioption_data( NAIOption *instance ); static void on_instance_finalized( gpointer user_data, NAIOption *instance ); /** * na_ioption_get_type: * * Returns: the #GType type of this interface. */ GType na_ioption_get_type( void ) { static GType type = 0; if( !type ){ type = register_type(); } return( type ); } /* * na_ioption_register_type: * * Registers this interface. */ static GType register_type( void ) { static const gchar *thisfn = "na_ioption_register_type"; GType type; static const GTypeInfo info = { sizeof( NAIOptionInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NAIOption", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( NAIOptionInterface *iface ) { static const gchar *thisfn = "na_ioption_interface_base_init"; if( !st_initializations ){ g_debug( "%s: iface=%p (%s)", thisfn, ( void * ) iface, G_OBJECT_CLASS_NAME( iface )); iface->private = g_new0( NAIOptionInterfacePrivate, 1 ); iface->get_version = ioption_get_version; } st_initializations += 1; } static void interface_base_finalize( NAIOptionInterface *iface ) { static const gchar *thisfn = "na_ioption_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); g_free( iface->private ); } } static guint ioption_get_version( const NAIOption *instance ) { return( 1 ); } static IOptionData * get_ioption_data( NAIOption *instance ) { IOptionData *data; data = ( IOptionData * ) g_object_get_data( G_OBJECT( instance ), IOPTION_PROP_DATA ); if( !data ){ data = g_new0( IOptionData, 1 ); g_object_set_data( G_OBJECT( instance ), IOPTION_PROP_DATA, data ); g_object_weak_ref( G_OBJECT( instance ), ( GWeakNotify ) on_instance_finalized, NULL ); data->initialized = TRUE; } return( data ); } static void on_instance_finalized( gpointer user_data, NAIOption *instance ) { static const gchar *thisfn = "na_ioption_on_instance_finalized"; IOptionData *data; g_debug( "%s: user_data=%p, instance=%p", thisfn, ( void * ) user_data, ( void * ) instance ); data = get_ioption_data( instance ); g_free( data ); } /* * na_ioption_get_id: * @option: this #NAIOption instance. * * Returns: the string identifier of the format, as a newly * allocated string which should be g_free() by the caller. */ gchar * na_ioption_get_id( const NAIOption *option ) { gchar *id; g_return_val_if_fail( NA_IS_IOPTION( option ), NULL ); get_ioption_data( NA_IOPTION( option )); id = NULL; if( NA_IOPTION_GET_INTERFACE( option )->get_id ){ id = NA_IOPTION_GET_INTERFACE( option )->get_id( option ); } return( id ); } /* * na_ioption_get_label: * @option: this #NAIOption instance. * * Returns: the UTF-8 localizable label of the format, as a newly * allocated string which should be g_free() by the caller. */ gchar * na_ioption_get_label( const NAIOption *option ) { gchar *label; g_return_val_if_fail( NA_IS_IOPTION( option ), NULL ); get_ioption_data( NA_IOPTION( option )); label = NULL; if( NA_IOPTION_GET_INTERFACE( option )->get_label ){ label = NA_IOPTION_GET_INTERFACE( option )->get_label( option ); } return( label ); } /* * na_ioption_get_description: * @format: this #NAExportFormat object. * * Returns: the UTF-8 localizable description of the format, as a newly * allocated string which should be g_free() by the caller. */ gchar * na_ioption_get_description( const NAIOption *option ) { gchar *description; g_return_val_if_fail( NA_IS_IOPTION( option ), NULL ); get_ioption_data( NA_IOPTION( option )); description = NULL; if( NA_IOPTION_GET_INTERFACE( option )->get_description ){ description = NA_IOPTION_GET_INTERFACE( option )->get_description( option ); } return( description ); } /* * na_ioption_get_pixbuf: * @option: this #NAIOption instance. * * Returns: a new reference to the #GdkPixbuf image associated with this format, * or %NULL. */ GdkPixbuf * na_ioption_get_pixbuf( const NAIOption *option ) { GdkPixbuf *pixbuf; g_return_val_if_fail( NA_IS_IOPTION( option ), NULL ); get_ioption_data( NA_IOPTION( option )); pixbuf = NULL; if( NA_IOPTION_GET_INTERFACE( option )->get_pixbuf ){ pixbuf = NA_IOPTION_GET_INTERFACE( option )->get_pixbuf( option ); } return( pixbuf ); } nautilus-actions-3.2.3/src/core/na-selected-info.h0000644000175100017500000001101212212601376016743 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu selected_infos. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_SELECTED_INFO_H__ #define __CORE_NA_SELECTED_INFO_H__ /* @title: NASelectedInfo * @short_description: The #NASelectedInfo Class Definition * @include: core/na-selected-info.h * * An object is instantiated for each Nautilus selected item, in order * to gather some common properties for the selected item, mainly its * mime type for example. * * This class should be replaced by NautilusFileInfo class, as soon as * the required Nautilus version will have the * nautilus_file_info_create_for_uri() API (after 2.28) */ #include G_BEGIN_DECLS #define NA_TYPE_SELECTED_INFO ( na_selected_info_get_type()) #define NA_SELECTED_INFO( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_SELECTED_INFO, NASelectedInfo )) #define NA_SELECTED_INFO_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_SELECTED_INFO, NASelectedInfoClass )) #define NA_IS_SELECTED_INFO( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_SELECTED_INFO )) #define NA_IS_SELECTED_INFO_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_SELECTED_INFO )) #define NA_SELECTED_INFO_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_SELECTED_INFO, NASelectedInfoClass )) typedef struct _NASelectedInfoPrivate NASelectedInfoPrivate; typedef struct { /*< private >*/ GObject parent; NASelectedInfoPrivate *private; } NASelectedInfo; typedef struct _NASelectedInfoClassPrivate NASelectedInfoClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NASelectedInfoClassPrivate *private; } NASelectedInfoClass; GType na_selected_info_get_type( void ); GList *na_selected_info_get_list_from_item( NautilusFileInfo *item ); GList *na_selected_info_get_list_from_list( GList *nautilus_selection ); GList *na_selected_info_copy_list ( GList *files ); void na_selected_info_free_list ( GList *files ); gchar *na_selected_info_get_basename ( const NASelectedInfo *nsi ); gchar *na_selected_info_get_dirname ( const NASelectedInfo *nsi ); gchar *na_selected_info_get_mime_type ( const NASelectedInfo *nsi ); gchar *na_selected_info_get_path ( const NASelectedInfo *nsi ); gchar *na_selected_info_get_uri ( const NASelectedInfo *nsi ); gchar *na_selected_info_get_uri_host ( const NASelectedInfo *nsi ); gchar *na_selected_info_get_uri_user ( const NASelectedInfo *nsi ); guint na_selected_info_get_uri_port ( const NASelectedInfo *nsi ); gchar *na_selected_info_get_uri_scheme( const NASelectedInfo *nsi ); gboolean na_selected_info_is_directory ( const NASelectedInfo *nsi ); gboolean na_selected_info_is_regular ( const NASelectedInfo *nsi ); gboolean na_selected_info_is_executable ( const NASelectedInfo *nsi ); gboolean na_selected_info_is_local ( const NASelectedInfo *nsi ); gboolean na_selected_info_is_owner ( const NASelectedInfo *nsi, const gchar *user ); gboolean na_selected_info_is_readable ( const NASelectedInfo *nsi ); gboolean na_selected_info_is_writable ( const NASelectedInfo *nsi ); NASelectedInfo *na_selected_info_create_for_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg ); G_END_DECLS #endif /* __CORE_NA_SELECTED_INFO_H__ */ nautilus-actions-3.2.3/src/core/import-mode-renumber.png0000664000175100017500000000745211674472206020264 00000000000000PNG  IHDR00WsRGBbKGD pHYs  tIME  QSIDAThY]GZSgk/n/mw۝؎0!d ` F4^yB"o< xc 13H$ ABdxb'ް;v^~{IHbifxIp_ avava~A~'(i\@LI)C*A(J$JAxt+@NFPܚ*:((]+͈k8B0lFR+-ҩT*ڭnăJÿLpG hPss(X=shpPΛ(X'\j0hQbpF@[C  HX&Rt/ ͺX٨]Y]΍.NyPirё_v,T7\8s\oy77YCEa3n\Mpӆi3# f B)A?D>#EhR+P!GCcՔ_艧|ʓ>kjDpNL+q}F|ܦDhP"L4RAup:P6f ARQ !4Dy dlz[}pma.sW^&[ĉBZ-5??\>1}|}9DzvV?L@3 0D=Et5!>8F!DR#h}8Đ84 H>RMHqtAn73#Cgi%>DЩ!qW kH*7IN!RHQm0,/~j>`ǵ- guWW7%cQEY@_c:n疻41 amgb+0a}Ae ^1 k DQ6fFѾc(MD,0˃p2aOLPCXw2segNĹ0`6Ķf}h:iyc:-(I~Q*|% _ЃOO MS~2F{A c<6za$ C\p˃+t2ЦmtA`qcRT,g̹;+5T fbڕIb1:;?21n;V6q%\pN/{?|"Q ~GOe ( 2t2PELmH ;7P2TMqO ^}U71'dcsNtXVX]O_,-.\.6*8|0,` \?Cl: D 34<(f50 |tp4Sk?7] ,AF\<vh19}kz8^~XXYAilZk#z=#%}x1AQdjڐ M-jRTHR4 :Wx f;}㸵r {&'1"DИܻ:}CatԹ?x9 17p 0@)%v"SsraCLf@)h;&v'>n$ϯ )(B0kes BwwQ-K\Fn./c8l4. 0r6>c `xEvdaM_!R.B(4RLJAǸA( ť%d39 h}p˂7T)0{h~g]CC7 (c_o*v2(&M9)Uw F:;Q8=۲B4SJ(\tRDC{&'nADkHJэbd ETkHaX055߻Z~4A=Lۘl0l2B@E*5.\o. H?[HZ[Fl^cYG0$7L4=XB +l"SSj yg֘5-ʷn(CEvu&7z3քB8sY| 'vB3Ar\t0LNA^& xmHE' "<fnu`½#BisSykt;NNցR^kmZUt&0:@)Ћ"D/`~ M1 c%0FJ"kPJKt4n.1 Z+s9x^..޲}7}Y@RjM _5\sfQ 00^ZQL&0ql2ؖ@ň.C%La08JQo4Qjmסr}pn? >{\ۋpN[J)w>s߾'3O_uȬ&Ra›7.-\DXHR(¤S]mNCMl$@I0* 8=Z*퉓yǽvB)!k'36r}<^Jz-c)Lr)Zd iTAhesiKبW9rgXvkiլm]T3jsF(ʭ[ȸn1T)j[muXj{ҟlw:yS}sQSH5=czd(OADFTW]znN'Qx/ s(EZFZoBִUf$IJ@kQ A,`Zk.TiZR*jaL>)@}ȝlZ6n֏힞q~':8KeVnz=PiRR^[_~ͷ|jۺ^k\aqWT+I@k !R˲֚ZX !0dՒ&?˻_÷7~@wNJuN@#B11Mq4MImSfŹ˹ N(#+QJ;VE=!T677uPȉ cbbBP/U3?˿1>f<=ͥamC]8jj\.S0 CiR8IQ6A:44\wCݟω'HPqS4 8BEQ[zW/_:XjIENDB`nautilus-actions-3.2.3/src/core/na-selected-info.c0000644000175100017500000005476212212601376016761 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "na-gnome-vfs-uri.h" #include "na-selected-info.h" /* private class data */ struct _NASelectedInfoClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NASelectedInfoPrivate { gboolean dispose_has_run; gchar *uri; gchar *filename; gchar *dirname; gchar *basename; gchar *hostname; gchar *username; gchar *scheme; guint port; gchar *mimetype; GFileType file_type; gboolean can_read; gboolean can_write; gboolean can_execute; gchar *owner; gboolean attributes_are_set; }; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NASelectedInfoClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void dump( const NASelectedInfo *nsi ); static const char *dump_file_type( GFileType type ); static NASelectedInfo *new_from_nautilus_file_info( NautilusFileInfo *item ); static NASelectedInfo *new_from_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg ); static void query_file_attributes( NASelectedInfo *info, GFile *location, gchar **errmsg ); GType na_selected_info_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_selected_info_register_type"; GType type; static GTypeInfo info = { sizeof( NASelectedInfoClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NASelectedInfo ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NASelectedInfo", &info, 0 ); return( type ); } static void class_init( NASelectedInfoClass *klass ) { static const gchar *thisfn = "na_selected_info_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NASelectedInfoClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_selected_info_instance_init"; NASelectedInfo *self; g_return_if_fail( NA_IS_SELECTED_INFO( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_SELECTED_INFO( instance ); self->private = g_new0( NASelectedInfoPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->uri = NULL; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_selected_info_instance_dispose"; NASelectedInfo *self; g_return_if_fail( NA_IS_SELECTED_INFO( object )); self = NA_SELECTED_INFO( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_selected_info_instance_finalize"; NASelectedInfo *self; g_return_if_fail( NA_IS_SELECTED_INFO( object )); self = NA_SELECTED_INFO( object ); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); g_free( self->private->uri ); g_free( self->private->filename ); g_free( self->private->dirname ); g_free( self->private->basename ); g_free( self->private->hostname ); g_free( self->private->username ); g_free( self->private->scheme ); g_free( self->private->mimetype ); g_free( self->private->owner ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /* * na_selected_info_get_list_from_item: * @item: a #NautilusFileInfo item * * Returns: a #GList list which contains a #NASelectedInfo item with the * same URI that the @item. */ GList * na_selected_info_get_list_from_item( NautilusFileInfo *item ) { GList *selected; selected = NULL; NASelectedInfo *info = new_from_nautilus_file_info( item ); if( info ){ selected = g_list_prepend( NULL, info ); } return( selected ); } /* * na_selected_info_get_list_from_list: * @nautilus_selection: a #GList list of #NautilusFileInfo items. * * Returns: a #GList list of #NASelectedInfo items whose URI correspond * to those of @nautilus_selection. */ GList * na_selected_info_get_list_from_list( GList *nautilus_selection ) { GList *selected; GList *it; selected = NULL; for( it = nautilus_selection ; it ; it = it->next ){ NASelectedInfo *info = new_from_nautilus_file_info( NAUTILUS_FILE_INFO( it->data )); if( info ){ selected = g_list_prepend( selected, info ); } } return( selected ? g_list_reverse( selected ) : NULL ); } /* * na_selected_info_copy_list: * @files: a #GList list of #NASelectedInfo items. * * Returns: a copy of the provided @files list. */ GList * na_selected_info_copy_list( GList *files ) { GList *copy; GList *l; copy = g_list_copy( files ); for( l = copy ; l != NULL ; l = l->next ){ g_object_ref( G_OBJECT( l->data )); } return( copy ); } /* * na_selected_info_free_list: * @files: a #GList of #NASelectedInfo items. * * Frees up the #GList @files. */ void na_selected_info_free_list( GList *files ) { g_list_foreach( files, ( GFunc ) g_object_unref, NULL ); g_list_free( files ); } /* * na_selected_info_get_basename: * @nsi: this #NASelectedInfo object. * * Returns: the basename of the file associated with this * #NASelectedInfo object, as a newly allocated string which * must be g_free() by the caller. */ gchar * na_selected_info_get_basename( const NASelectedInfo *nsi ) { gchar *basename; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL ); basename = NULL; if( !nsi->private->dispose_has_run ){ basename = g_strdup( nsi->private->basename ); } return( basename ); } /* * na_selected_info_get_dirname: * @nsi: this #NASelectedInfo object. * * Returns: the dirname of the file associated with this * #NASelectedInfo object, as a newly allocated string which * must be g_free() by the caller. */ gchar * na_selected_info_get_dirname( const NASelectedInfo *nsi ) { gchar *dirname; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL ); dirname = NULL; if( !nsi->private->dispose_has_run ){ dirname = g_strdup( nsi->private->dirname ); } return( dirname ); } /* * na_selected_info_get_mime_type: * @nsi: this #NASelectedInfo object. * * Returns: the mime type associated with this #NASelectedInfo object, * as a newly allocated string which should be g_free() by the caller. */ gchar * na_selected_info_get_mime_type( const NASelectedInfo *nsi ) { gchar *mimetype; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL ); mimetype = NULL; if( !nsi->private->dispose_has_run ){ if( nsi->private->mimetype ){ mimetype = g_strdup( nsi->private->mimetype ); } } return( mimetype ); } /* * na_selected_info_get_path: * @nsi: this #NASelectedInfo object. * * Returns: the filename of the item as a newly allocated string which * should be g_free() by the caller. */ gchar * na_selected_info_get_path( const NASelectedInfo *nsi ) { gchar *path; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL ); path = NULL; if( !nsi->private->dispose_has_run ){ path = g_strdup( nsi->private->filename ); } return( path ); } /* * na_selected_info_get_uri: * @nsi: this #NASelectedInfo object. * * Returns: the URI associated with this #NASelectedInfo object, as a * newly allocated string which should be g_free() by the caller. */ gchar * na_selected_info_get_uri( const NASelectedInfo *nsi ) { gchar *uri; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL ); uri = NULL; if( !nsi->private->dispose_has_run ){ uri = g_strdup( nsi->private->uri ); } return( uri ); } /* * na_selected_info_get_uri_host: * @nsi: this #NASelectedInfo object. * * Returns: the host associated to this @nsi object, as a * newly allocated string which should be g_free() by the caller. */ gchar * na_selected_info_get_uri_host( const NASelectedInfo *nsi ) { gchar *host; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL ); host = NULL; if( !nsi->private->dispose_has_run ){ host = g_strdup( nsi->private->hostname ); } return( host ); } /* * na_selected_info_get_uri_user: * @nsi: this #NASelectedInfo object. * * Returns: the user associated to this @nsi object, as a * newly allocated string which should be g_free() by the caller. */ gchar * na_selected_info_get_uri_user( const NASelectedInfo *nsi ) { gchar *user; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL ); user = NULL; if( !nsi->private->dispose_has_run ){ user = g_strdup( nsi->private->username ); } return( user ); } /* * na_selected_info_get_uri_port: * @nsi: this #NASelectedInfo object. * * Returns: the port associated to this @nsi object. */ guint na_selected_info_get_uri_port( const NASelectedInfo *nsi ) { guint port; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), 0 ); port = 0; if( !nsi->private->dispose_has_run ){ port = nsi->private->port; } return( port ); } /* * na_selected_info_get_uri_scheme: * @nsi: this #NASelectedInfo object. * * Returns: the scheme associated to this @nsi object, as a * newly allocated string which should be g_free() by the caller. */ gchar * na_selected_info_get_uri_scheme( const NASelectedInfo *nsi ) { gchar *scheme; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL ); scheme = NULL; if( !nsi->private->dispose_has_run ){ scheme = g_strdup( nsi->private->scheme ); } return( scheme ); } /* * na_selected_info_is_directory: * @nsi: this #NASelectedInfo object. * * Returns: %TRUE if the item is a directory, %FALSE else. */ gboolean na_selected_info_is_directory( const NASelectedInfo *nsi ) { gboolean is_dir; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE ); is_dir = FALSE; if( !nsi->private->dispose_has_run ){ is_dir = ( nsi->private->file_type == G_FILE_TYPE_DIRECTORY ); } return( is_dir ); } /* * na_selected_info_is_regular: * @nsi: this #NASelectedInfo object. * * Returns: %TRUE if the item is a regular file, %FALSE else. */ gboolean na_selected_info_is_regular( const NASelectedInfo *nsi ) { gboolean is_regular; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE ); is_regular = FALSE; if( !nsi->private->dispose_has_run ){ is_regular = ( nsi->private->file_type == G_FILE_TYPE_REGULAR ); } return( is_regular ); } /* * na_selected_info_is_executable: * @nsi: this #NASelectedInfo object. * * Returns: %TRUE if the item is executable by the user, %FALSE else. */ gboolean na_selected_info_is_executable( const NASelectedInfo *nsi ) { gboolean is_exe; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE ); is_exe = FALSE; if( !nsi->private->dispose_has_run ){ is_exe = nsi->private->can_execute; } return( is_exe ); } /* * na_selected_info_is_local: * @nsi: this #NASelectedInfo object. * * Returns: %TRUE if the item is on a local filesystem, %FALSE else. */ gboolean na_selected_info_is_local( const NASelectedInfo *nsi ) { gboolean is_local; gchar *scheme; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE ); is_local = FALSE; if( !nsi->private->dispose_has_run ){ scheme = na_selected_info_get_uri_scheme( nsi ); is_local = ( strcmp( scheme, "file" ) == 0 ); g_free( scheme ); } return( is_local ); } /* * na_selected_info_is_owner: * @nsi: this #NASelectedInfo object. * @user: the user to be tested against the owner of the @nsi object. * * Returns: %TRUE if the item is a owner, %FALSE else. */ gboolean na_selected_info_is_owner( const NASelectedInfo *nsi, const gchar *user ) { gboolean is_owner; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE ); is_owner = FALSE; if( !nsi->private->dispose_has_run ){ is_owner = ( strcmp( nsi->private->owner, user ) == 0 ); } return( is_owner ); } /* * na_selected_info_is_readable: * @nsi: this #NASelectedInfo object. * * Returns: %TRUE if the item is a readable, %FALSE else. */ gboolean na_selected_info_is_readable( const NASelectedInfo *nsi ) { gboolean is_readable; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE ); is_readable = FALSE; if( !nsi->private->dispose_has_run ){ is_readable = nsi->private->can_read; } return( is_readable ); } /* * na_selected_info_is_writable: * @nsi: this #NASelectedInfo object. * * Returns: %TRUE if the item is a writable, %FALSE else. */ gboolean na_selected_info_is_writable( const NASelectedInfo *nsi ) { gboolean is_writable; g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE ); is_writable = FALSE; if( !nsi->private->dispose_has_run ){ is_writable = nsi->private->can_write; } return( is_writable ); } /* * na_selected_info_create_for_uri: * @uri: an URI. * @mimetype: the corresponding Nautilus mime type, or %NULL. * @errmsg: a pointer to a string which will contain an error message on * return. * * Returns: a newly allocated #NASelectedInfo object for the given @uri. */ NASelectedInfo * na_selected_info_create_for_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg ) { static const gchar *thisfn = "na_selected_info_create_for_uri"; g_debug( "%s: uri=%s, mimetype=%s", thisfn, uri, mimetype ); NASelectedInfo *obj = new_from_uri( uri, mimetype, errmsg ); return( obj ); } static void dump( const NASelectedInfo *nsi ) { static const gchar *thisfn = "na_selected_info_dump"; g_debug( "%s: uri=%s", thisfn, nsi->private->uri ); g_debug( "%s: mimetype=%s", thisfn, nsi->private->mimetype ); g_debug( "%s: filename=%s", thisfn, nsi->private->filename ); g_debug( "%s: dirname=%s", thisfn, nsi->private->dirname ); g_debug( "%s: basename=%s", thisfn, nsi->private->basename ); g_debug( "%s: hostname=%s", thisfn, nsi->private->hostname ); g_debug( "%s: username=%s", thisfn, nsi->private->username ); g_debug( "%s: scheme=%s", thisfn, nsi->private->scheme ); g_debug( "%s: port=%d", thisfn, nsi->private->port ); g_debug( "%s: attributes_are_set=%s", thisfn, nsi->private->attributes_are_set ? "True":"False" ); g_debug( "%s: file_type=%s", thisfn, dump_file_type( nsi->private->file_type )); g_debug( "%s: can_read=%s", thisfn, nsi->private->can_read ? "True":"False" ); g_debug( "%s: can_write=%s", thisfn, nsi->private->can_write ? "True":"False" ); g_debug( "%s: can_execute=%s", thisfn, nsi->private->can_execute ? "True":"False" ); g_debug( "%s: owner=%s", thisfn, nsi->private->owner ); } static const char * dump_file_type( GFileType type ) { switch( type ){ case G_FILE_TYPE_REGULAR: return( "regular" ); case G_FILE_TYPE_DIRECTORY: return( "directory" ); case G_FILE_TYPE_SYMBOLIC_LINK: return( "symbolic link" ); case G_FILE_TYPE_SPECIAL: return( "special (socket, fifo, blockdev, chardev)" ); case G_FILE_TYPE_SHORTCUT: return( "shortcut" ); case G_FILE_TYPE_MOUNTABLE: return( "mountable" ); default: break; } return( "unknown" ); } static NASelectedInfo * new_from_nautilus_file_info( NautilusFileInfo *item ) { gchar *uri = nautilus_file_info_get_uri( item ); gchar *mimetype = nautilus_file_info_get_mime_type( item ); NASelectedInfo *info = new_from_uri( uri, mimetype, NULL ); g_free( mimetype ); g_free( uri ); return( info ); } /* * Nautilus uses to address the desktop via the 'x-nautilus-desktop:///' URI. * g_filename_from_uri() complains that * "The URI 'x-nautilus-desktop:///' is not an absolute URI using the "file" scheme". * In this case, we prefer the vfs->path member wich is just a decomposition of the * URI, and does not try to interpret it. * * ********************************************************************************* * Extract from RFC 2396: * * 2.4.3. Excluded US-ASCII Characters * * Although they are disallowed within the URI syntax, we include here a * description of those US-ASCII characters that have been excluded and * the reasons for their exclusion. * * The control characters in the US-ASCII coded character set are not * used within a URI, both because they are non-printable and because * they are likely to be misinterpreted by some control mechanisms. * * control = * * The space character is excluded because significant spaces may * disappear and insignificant spaces may be introduced when URI are * transcribed or typeset or subjected to the treatment of word- * processing programs. Whitespace is also used to delimit URI in many * contexts. * * space = * * The angle-bracket "<" and ">" and double-quote (") characters are * excluded because they are often used as the delimiters around URI in * text documents and protocol fields. The character "#" is excluded * because it is used to delimit a URI from a fragment identifier in URI * references (Section 4). The percent character "%" is excluded because * it is used for the encoding of escaped characters. * * delims = "<" | ">" | "#" | "%" | <"> * * Other characters are excluded because gateways and other transport * agents are known to sometimes modify such characters, or they are * used as delimiters. * * unwise = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`" * * Data corresponding to excluded characters must be escaped in order to * be properly represented within a URI. * * pwi 2011-01-04: * It results from the above excerpt that: * - as double quotes are not valid character in URI, they have to be * escaped as %22, and so Nautilus does * - but simple quotes are not forbidden, and so have not to be * escaped, and so Nautilus does not escape them * * As a result, we may have valid, non-escaped, simple quotes in an URI. */ static NASelectedInfo * new_from_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg ) { GFile *location; NAGnomeVFSURI *vfs; NASelectedInfo *info = g_object_new( NA_TYPE_SELECTED_INFO, NULL ); info->private->uri = g_strdup( uri ); if( mimetype ){ info->private->mimetype = g_strdup( mimetype ); } /* pwi 2011-05-18 * Filename and dirname should be taken from the GFile location, itself taken * from the URI, so that we have dir='/home/pierre/.gvfs/sftp on stormy.trychlos.org/etc' * Taking filename and dirname from URI just gives '/etc' * see #650523 */ location = g_file_new_for_uri( uri ); info->private->filename = g_file_get_path( location ); vfs = g_new0( NAGnomeVFSURI, 1 ); na_gnome_vfs_uri_parse( vfs, uri ); if( !info->private->filename ){ g_debug( "na_selected_info_new_from_uri: uri='%s', filename=NULL, setting it to '%s'", uri, vfs->path ); info->private->filename = g_strdup( vfs->path ); } info->private->basename = g_path_get_basename( info->private->filename ); info->private->dirname = g_path_get_dirname( info->private->filename ); info->private->hostname = g_strdup( vfs->host_name ); info->private->username = g_strdup( vfs->user_name ); info->private->scheme = g_strdup( vfs->scheme ); info->private->port = vfs->host_port; na_gnome_vfs_uri_free( vfs ); query_file_attributes( info, location, errmsg ); g_object_unref( location ); dump( info ); return( info ); } static void query_file_attributes( NASelectedInfo *nsi, GFile *location, gchar **errmsg ) { static const gchar *thisfn = "na_selected_info_query_file_attributes"; GError *error; error = NULL; GFileInfo *info = g_file_query_info( location, G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," G_FILE_ATTRIBUTE_ACCESS_CAN_READ "," G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "," G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "," G_FILE_ATTRIBUTE_OWNER_USER, G_FILE_QUERY_INFO_NONE, NULL, &error ); if( error ){ if( errmsg ){ *errmsg = g_strdup_printf( _( "Error when querying informations for %s URI: %s" ), nsi->private->uri, error->message ); } else { g_warning( "%s: uri=%s, g_file_query_info: %s", thisfn, nsi->private->uri, error->message ); } g_error_free( error ); return; } if( !nsi->private->mimetype ){ nsi->private->mimetype = g_strdup( g_file_info_get_attribute_as_string( info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE )); } nsi->private->file_type = ( GFileType ) g_file_info_get_attribute_uint32( info, G_FILE_ATTRIBUTE_STANDARD_TYPE ); nsi->private->can_read = g_file_info_get_attribute_boolean( info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ ); nsi->private->can_write = g_file_info_get_attribute_boolean( info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE ); nsi->private->can_execute = g_file_info_get_attribute_boolean( info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE ); nsi->private->owner = g_strdup( g_file_info_get_attribute_as_string( info, G_FILE_ATTRIBUTE_OWNER_USER )); nsi->private->attributes_are_set = TRUE; g_object_unref( info ); } nautilus-actions-3.2.3/src/core/na-object-profile.c0000644000175100017500000005635412212601376017143 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "na-factory-provider.h" #include "na-factory-object.h" #include "na-selected-info.h" #include "na-gnome-vfs-uri.h" /* private class data */ struct _NAObjectProfileClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAObjectProfilePrivate { gboolean dispose_has_run; }; #define PROFILE_NAME_PREFIX "profile-" #define na_object_is_file( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ISFILE ))) #define na_object_is_dir( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_ISDIR ))) #define na_object_is_multiple( obj ) (( gboolean ) GPOINTER_TO_UINT( na_ifactory_object_get_as_void( NA_IFACTORY_OBJECT( obj ), NAFO_DATA_MULTIPLE ))) extern NADataGroup profile_data_groups []; /* defined in na-item-profile-factory.c */ static NAObjectIdClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAObjectProfileClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ); static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void object_dump( const NAObject *object ); static gboolean object_is_valid( const NAObject *object ); static void ifactory_object_iface_init( NAIFactoryObjectInterface *iface, void *user_data ); static guint ifactory_object_get_version( const NAIFactoryObject *instance ); static NADataGroup *ifactory_object_get_groups( const NAIFactoryObject *instance ); static void ifactory_object_read_done( NAIFactoryObject *instance, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ); static guint ifactory_object_write_done( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ); static void icontext_iface_init( NAIContextInterface *iface, void *user_data ); static gboolean icontext_is_candidate( NAIContext *object, guint target, GList *selection ); static gboolean convert_pre_v3_parameters( NAObjectProfile *profile ); static gboolean convert_pre_v3_parameters_str( gchar *str ); static gboolean convert_pre_v3_multiple( NAObjectProfile *profile ); static gboolean convert_pre_v3_isfiledir( NAObjectProfile *profile ); static void read_done_ending( NAObjectProfile *profile ); static void split_path_parameters( NAObjectProfile *profile ); static gboolean is_valid_path_parameters( const NAObjectProfile *profile ); static gchar *object_id_new_id( const NAObjectId *item, const NAObjectId *new_parent ); GType na_object_profile_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_object_profile_register_type"; GType type; static GTypeInfo info = { sizeof( NAObjectProfileClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAObjectProfile ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo icontext_iface_info = { ( GInterfaceInitFunc ) icontext_iface_init, NULL, NULL }; static const GInterfaceInfo ifactory_object_iface_info = { ( GInterfaceInitFunc ) ifactory_object_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( NA_TYPE_OBJECT_ID, "NAObjectProfile", &info, 0 ); g_type_add_interface_static( type, NA_TYPE_ICONTEXT, &icontext_iface_info ); g_type_add_interface_static( type, NA_TYPE_IFACTORY_OBJECT, &ifactory_object_iface_info ); return( type ); } static void class_init( NAObjectProfileClass *klass ) { static const gchar *thisfn = "na_object_profile_class_init"; GObjectClass *object_class; NAObjectClass *naobject_class; NAObjectIdClass *naobjectid_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->set_property = instance_set_property; object_class->get_property = instance_get_property; object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; naobject_class = NA_OBJECT_CLASS( klass ); naobject_class->dump = object_dump; naobject_class->is_valid = object_is_valid; naobjectid_class = NA_OBJECT_ID_CLASS( klass ); naobjectid_class->new_id = object_id_new_id; klass->private = g_new0( NAObjectProfileClassPrivate, 1 ); na_factory_object_define_properties( object_class, profile_data_groups ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_object_profile_instance_init"; NAObjectProfile *self; g_return_if_fail( NA_IS_OBJECT_PROFILE( instance )); self = NA_OBJECT_PROFILE( instance ); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self->private = g_new0( NAObjectProfilePrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ) { g_return_if_fail( NA_IS_OBJECT_PROFILE( object )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); if( !NA_OBJECT_PROFILE( object )->private->dispose_has_run ){ na_factory_object_get_as_value( NA_IFACTORY_OBJECT( object ), g_quark_to_string( property_id ), value ); } } static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ) { g_return_if_fail( NA_IS_OBJECT_PROFILE( object )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); if( !NA_OBJECT_PROFILE( object )->private->dispose_has_run ){ na_factory_object_set_from_value( NA_IFACTORY_OBJECT( object ), g_quark_to_string( property_id ), value ); } } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_object_profile_instance_dispose"; NAObjectProfile *self; g_return_if_fail( NA_IS_OBJECT_PROFILE( object )); self = NA_OBJECT_PROFILE( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_object_profile_instance_finalize"; NAObjectProfile *self; g_return_if_fail( NA_IS_OBJECT_PROFILE( object )); self = NA_OBJECT_PROFILE( object ); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static void object_dump( const NAObject *object ) { static const char *thisfn = "na_object_profile_object_dump"; NAObjectProfile *self; g_return_if_fail( NA_IS_OBJECT_PROFILE( object )); self = NA_OBJECT_PROFILE( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s, ref_count=%d)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ), G_OBJECT( object )->ref_count ); /* chain up to the parent class */ if( NA_OBJECT_CLASS( st_parent_class )->dump ){ NA_OBJECT_CLASS( st_parent_class )->dump( object ); } g_debug( "+- end of dump" ); } } static gboolean object_is_valid( const NAObject *object ) { static const gchar *thisfn = "na_object_profile_object_is_valid"; gboolean is_valid; NAObjectProfile *profile; g_return_val_if_fail( NA_IS_OBJECT_PROFILE( object ), FALSE ); is_valid = FALSE; profile = NA_OBJECT_PROFILE( object ); if( !profile->private->dispose_has_run ){ g_debug( "%s: profile=%p (%s)", thisfn, ( void * ) profile, G_OBJECT_TYPE_NAME( profile )); is_valid = is_valid_path_parameters( profile ); /* chain up to the parent class */ if( NA_OBJECT_CLASS( st_parent_class )->is_valid ){ is_valid &= NA_OBJECT_CLASS( st_parent_class )->is_valid( object ); } } return( is_valid ); } static void ifactory_object_iface_init( NAIFactoryObjectInterface *iface, void *user_data ) { static const gchar *thisfn = "na_object_profile_ifactory_object_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->get_version = ifactory_object_get_version; iface->get_groups = ifactory_object_get_groups; iface->read_done = ifactory_object_read_done; iface->write_done = ifactory_object_write_done; } static guint ifactory_object_get_version( const NAIFactoryObject *instance ) { return( 1 ); } static NADataGroup * ifactory_object_get_groups( const NAIFactoryObject *instance ) { return( profile_data_groups ); } static void ifactory_object_read_done( NAIFactoryObject *instance, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ) { static const gchar *thisfn = "na_object_profile_ifactory_object_read_done"; NAObjectAction *action; guint iversion; g_debug( "%s: instance=%p", thisfn, ( void * ) instance ); /* converts pre-v3 data */ action = NA_OBJECT_ACTION( na_object_get_parent( instance )); iversion = na_object_get_iversion( action ); g_debug( "%s: iversion=%d", thisfn, iversion ); if( iversion < 3 ){ na_object_profile_convert_v2_to_last( NA_OBJECT_PROFILE( instance )); /* must be always called, but is called when converting profile, anyway */ } else { read_done_ending( NA_OBJECT_PROFILE( instance )); } } static guint ifactory_object_write_done( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ) { return( NA_IIO_PROVIDER_CODE_OK ); } static void icontext_iface_init( NAIContextInterface *iface, void *user_data ) { static const gchar *thisfn = "na_object_profile_icontext_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->is_candidate = icontext_is_candidate; } static gboolean icontext_is_candidate( NAIContext *object, guint target, GList *selection ) { return( TRUE ); } /* * starting wih v3, parameters are relabeled * pre-v3 parameters post-v3 parameters * ---------------------------- ----------------------------------- * %b: (first) basename (was %f) * %B: list of basenames (was %m) * %c: count (new) * %d: (first) base directory ................... (unchanged) * %D: list of base dir (new) * %f: (first) filename -> %b %f: (first) pathname (new) * %F: list of pathnames (was %M) * %h: (first) hostname ................... (unchanged) * %m: list of basenames -> %B %m: (first) mimetype (new) * %M: list of pathnames -> %F %M: list of mimetypes (new) * %n: (first) username (was %U) * %p: (first) port number ................... (unchanged) * %R: list of URIs -> %U - (removed) * %s: (first) scheme ................... (unchanged) * %u: (first) URI ................... (unchanged) * %U: (first) username -> %n %U: list of URIs (was %R) * %w: (first) basename w/o ext. (new) * %W: list of basenames w/o ext. (new) * %x: (first) extension (new) * %X: list of extensions (new) * %%: % ................... (unchanged) * * For pre-v3 items, * - substitute %f with %b, and as a special case %d/%f -> %f * - substitute %m with %B * - substitute %M with %F * - substitute %R with %U * - substitute %U with %n * * Note that pre-v3 items only have parameters in the command and path fields. * Are only located in 'profile' objects. * Are only found in GConf or XML providers, as .desktop files have been * simultaneously introduced. * * As a recall of the dynamics of the reading when loading an action: * - na_object_action_read_done: set action defaults * - nagp_reader_read_done: read profiles * > nagp_reader_read_start: attach profile to its parent * > na_object_profile_read_done: convert old parameters * * So, when converting v2 to v3 parameters in a v2 profile, * action already has its default values (including iversion=3) */ static gboolean convert_pre_v3_parameters( NAObjectProfile *profile ) { static const gchar *thisfn = "na_object_profile_convert_pre_v3_parameters"; gboolean path_changed, parms_changed; gchar *before; gchar *path = na_object_get_path( profile ); before = g_strdup( path ); path_changed = convert_pre_v3_parameters_str( path ); if( path_changed ){ na_object_set_path( profile, path ); g_debug( "%s: path=%s changed to %s", thisfn, before, path ); } g_free( before ); g_free( path ); gchar *parms = na_object_get_parameters( profile ); before = g_strdup( parms ); parms_changed = convert_pre_v3_parameters_str( parms ); if( parms_changed ){ na_object_set_parameters( profile, parms ); g_debug( "%s: parameters=%s changed to %s", thisfn, before, parms ); } g_free( before ); g_free( parms ); return( path_changed || parms_changed ); } static gboolean convert_pre_v3_parameters_str( gchar *str ) { gboolean changed; gchar *iter = str; changed = FALSE; while( iter != NULL && strlen( iter ) > 0 && ( iter = g_strstr_len( iter, strlen( iter ), "%" )) != NULL ){ switch( iter[1] ){ /* as a special optimization case, "%d/%f" parameters * may be favourably converted to just "%f" instead of "%d/%b" */ case 'd': if( !strncmp( iter, "%d/%f", 5 )){ strncpy( iter, iter+3, strlen( iter )); changed = TRUE; } break; /* %f (first filename) becomes %b */ case 'f': iter[1] = 'b'; changed = TRUE; break; /* %m (list of basenames) becomes %B */ case 'm': iter[1] = 'B'; changed = TRUE; break; /* %M (list of filenames) becomes %F */ case 'M': iter[1] = 'F'; changed = TRUE; break; /* %R (list of URIs) becomes %U */ case 'R': iter[1] = 'U'; changed = TRUE; break; /* %U ((first) username) becomes %n */ case 'U': iter[1] = 'n'; changed = TRUE; break; } iter += 2; } return( changed ); } /* * default changes from accept_multiple=false * to selection_count>0 */ static gboolean convert_pre_v3_multiple( NAObjectProfile *profile ) { static const gchar *thisfn = "na_object_profile_convert_pre_v3_multiple"; gboolean accept_multiple; gchar *selection_count; accept_multiple = na_object_is_multiple( profile ); selection_count = g_strdup( accept_multiple ? ">0" : "=1" ); na_object_set_selection_count( profile, selection_count ); g_debug( "%s: accept_multiple=%s changed to selection_count= %s", thisfn, accept_multiple ? "True":"False", selection_count ); g_free( selection_count ); return( TRUE ); } /* * we may have file=true and dir=false -> only files -> all/allfiles * file=false and dir=true -> only dirs -> inode/directory * file=true and dir=true -> both files and dirs -> all/all * * we try to replace this with the corresponding mimetype, but only if * current mimetype is '*' (or * / * or all/all). * * note that inode/directory is actually the mimetype provided by Nautilus; * contrarily all/allfiles mimetype has to be checked separately. */ static gboolean convert_pre_v3_isfiledir( NAObjectProfile *profile ) { static const gchar *thisfn = "na_object_profile_convert_pre_v3_isfiledir"; gboolean is_all_mimetypes; gboolean converted; gboolean isfile, isdir; GSList *mimetypes; GSList *before_list; gchar *before_str, *after_str; converted = FALSE; na_object_check_mimetypes( profile ); is_all_mimetypes = na_object_get_all_mimetypes( profile ); g_debug( "%s: is_all_mimetypes=%s", thisfn, is_all_mimetypes ? "True":"False" ); if( is_all_mimetypes ){ converted = TRUE; mimetypes = NULL; before_list = na_object_get_mimetypes( profile ); /* this is needed because na_object_is_file() does not return the default * value when the data is not set (see #651911) */ isfile = TRUE; if( na_factory_object_is_set( NA_IFACTORY_OBJECT( profile ), NAFO_DATA_ISFILE )){ isfile = na_object_is_file( profile ); } isdir = na_object_is_dir( profile ); if( isfile ){ if( isdir ){ /* both file and dir -> do not modify mimetypes */ converted = FALSE; } else { /* files only */ mimetypes = g_slist_prepend( NULL, g_strdup( "all/allfiles" )); } } else { if( isdir ){ /* dir only */ mimetypes = g_slist_prepend( NULL, g_strdup( "inode/directory" )); } else { /* not files nor dir: this is an invalid case -> do not modify * mimetypes */ g_warning( "%s: is_dir=False, is_file=False is invalid", thisfn ); converted = FALSE; } } if( converted ){ na_object_set_mimetypes( profile, mimetypes ); before_str = na_core_utils_slist_join_at_end( before_list, ";" ); after_str = na_core_utils_slist_join_at_end( mimetypes, ";" ); g_debug( "%s; mimetypes=[%s] changed to [%s]", thisfn, before_str, after_str ); g_free( after_str ); g_free( before_str ); } na_core_utils_slist_free( mimetypes ); na_core_utils_slist_free( before_list ); } return( converted ); } static void read_done_ending( NAObjectProfile *profile ) { /* split path+parameters * not done in io-desktop because some actions may have all arguments in path */ split_path_parameters( profile ); /* prepare the context after the reading */ na_icontext_read_done( NA_ICONTEXT( profile )); /* last, set profile defaults */ na_factory_object_set_defaults( NA_IFACTORY_OBJECT( profile )); } /* * GConf used to store command path and parameters as two separated fields * Desktop store them as one field * NACT displays and edits them as two fields (this let us have Browse and Legend buttons) * => so we definitively keep them as separated boxed in our internal objects */ static void split_path_parameters( NAObjectProfile *profile ) { gchar *path, *parameters; gchar *exec; path = na_object_get_path( profile ); parameters = na_object_get_parameters( profile ); exec = g_strstrip( g_strdup_printf( "%s %s", path ? path : "", parameters ? parameters : "" )); g_free( parameters ); g_free( path ); na_core_utils_str_split_first_word( exec, &path, ¶meters ); g_free( exec ); na_object_set_path( profile, path ); na_object_set_parameters( profile, parameters ); g_free( parameters ); g_free( path ); } /* * historical behavior was to not check path nor parameters at all * 2.29.x serie, and up to 2.30.0, have tried to check an actual executable path * but most of already actions only used a command, relying on the PATH env variable * so, starting with 2.30.1, we only check for non empty path+parameters */ static gboolean is_valid_path_parameters( const NAObjectProfile *profile ) { gboolean valid; gchar *path, *parameters; gchar *command; path = na_object_get_path( profile ); parameters = na_object_get_parameters( profile ); command = g_strdup_printf( "%s %s", path, parameters ); g_strstrip( command ); valid = g_utf8_strlen( command, -1 ) > 0; g_free( command ); g_free( parameters ); g_free( path ); if( !valid ){ na_object_debug_invalid( profile, "command" ); } return( valid ); } /* * new_parent is specifically set to be able to allocate a new id for * the current profile into the target parent */ static gchar * object_id_new_id( const NAObjectId *item, const NAObjectId *new_parent ) { gchar *id = NULL; g_return_val_if_fail( NA_IS_OBJECT_PROFILE( item ), NULL ); g_return_val_if_fail( !new_parent || NA_IS_OBJECT_ACTION( new_parent ), NULL ); if( !NA_OBJECT_PROFILE( item )->private->dispose_has_run ){ if( new_parent ){ id = na_object_action_get_new_profile_name( NA_OBJECT_ACTION( new_parent )); } } return( id ); } /** * na_object_profile_new: * * Allocates a new profile. * * Returns: the newly allocated #NAObjectProfile profile. * * Since: 2.30 */ NAObjectProfile * na_object_profile_new( void ) { NAObjectProfile *profile; profile = g_object_new( NA_TYPE_OBJECT_PROFILE, NULL ); return( profile ); } /** * na_object_profile_new_with_defaults: * * Allocates a new profile, and set default values. * * Returns: the newly allocated #NAObjectProfile profile. * * Since: 2.30 */ NAObjectProfile * na_object_profile_new_with_defaults( void ) { NAObjectProfile *profile = na_object_profile_new(); na_object_set_id( profile, "profile-zero" ); /* i18n: label for the default profile */ na_object_set_label( profile, _( "Default profile" )); na_factory_object_set_defaults( NA_IFACTORY_OBJECT( profile )); return( profile ); } /** * na_object_profile_convert_v2_to_last: * @profile: the #NAObjectProfile profile to be converted. * * Converts a v2 profile to the last version, setting the defaults as needed. * * This is called after having converted a pre-v2 action on the newly created * profile, or just after having read a v2 profile. * In all situations, defaults are supposed to have been set. * * Since: 2.30 */ void na_object_profile_convert_v2_to_last( NAObjectProfile *profile ) { NAObjectAction *action; guint iversion; gboolean parms_converted, multiple_converted, isfiledir_converted; g_return_if_fail( NA_IS_OBJECT_PROFILE( profile )); action = NA_OBJECT_ACTION( na_object_get_parent( profile )); iversion = na_object_get_iversion( action ); g_return_if_fail( iversion < 3 ); parms_converted = convert_pre_v3_parameters( profile ); multiple_converted = convert_pre_v3_multiple( profile ); isfiledir_converted = convert_pre_v3_isfiledir( profile ); if( parms_converted || multiple_converted || isfiledir_converted ){ na_object_set_iversion( action, 3 ); } read_done_ending( profile ); } nautilus-actions-3.2.3/src/core/na-gconf-monitor.c0000644000175100017500000001761412212601376017014 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #ifdef HAVE_GCONF #ifdef NA_ENABLE_DEPRECATED /* private class data */ struct _NAGConfMonitorClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAGConfMonitorPrivate { gboolean dispose_has_run; GConfClient *gconf; gchar *path; gint preload; GConfClientNotifyFunc handler; gpointer user_data; guint monitor_id; }; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAGConfMonitorClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static guint install_monitor( NAGConfMonitor *monitor ); static void release_monitor( NAGConfMonitor *monitor ); GType na_gconf_monitor_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_gconf_monitor_register_type"; GType type; static GTypeInfo info = { sizeof( NAGConfMonitorClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAGConfMonitor ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NAGConfMonitor", &info, 0 ); return( type ); } static void class_init( NAGConfMonitorClass *klass ) { static const gchar *thisfn = "na_gconf_monitor_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NAGConfMonitorClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_gconf_monitor_instance_init"; NAGConfMonitor *self; g_return_if_fail( NA_IS_GCONF_MONITOR( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_GCONF_MONITOR( instance ); self->private = g_new0( NAGConfMonitorPrivate, 1 ); self->private->gconf = gconf_client_get_default(); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_gconf_monitor_instance_dispose"; NAGConfMonitor *self; g_return_if_fail( NA_IS_GCONF_MONITOR( object )); self = NA_GCONF_MONITOR( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); /* release the installed monitor before setting dispose_has_run */ release_monitor( self ); self->private->dispose_has_run = TRUE; g_object_unref( self->private->gconf ); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_gconf_monitor_instance_finalize"; NAGConfMonitor *self; g_return_if_fail( NA_IS_GCONF_MONITOR( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NA_GCONF_MONITOR( object ); g_free( self->private->path ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /** * na_gconf_monitor_new: * @path: the absolute path to monitor. * @handler: the function to be triggered by the monitor. * @user_data: data to pass to the @handler. * * Initializes the monitoring of a GConf path. * * This monitoring will only be stopped when object is released, via * g_object_unref(). * * Returns: a new #NAGConfMonitor object, which will monitor the given path, * triggeering the @handler in case of modifications. * * Since: 2.30 * Deprecated: 3.1 */ NAGConfMonitor * na_gconf_monitor_new( const gchar *path, GConfClientNotifyFunc handler, gpointer user_data ) { static const gchar *thisfn = "na_gconf_monitor_new"; NAGConfMonitor *monitor; g_debug( "%s: path=%s, user_data=%p", thisfn, path, ( void * ) user_data ); monitor = g_object_new( NA_GCONF_MONITOR_TYPE, NULL ); monitor->private->path = g_strdup( path ); monitor->private->preload = GCONF_CLIENT_PRELOAD_RECURSIVE; monitor->private->handler = handler; monitor->private->user_data = user_data; monitor->private->monitor_id = install_monitor( monitor ); return( monitor ); } static guint install_monitor( NAGConfMonitor *monitor ) { static const gchar *thisfn = "na_gconf_monitor_install_monitor"; GError *error = NULL; guint notify_id; g_return_val_if_fail( NA_IS_GCONF_MONITOR( monitor ), 0 ); g_return_val_if_fail( !monitor->private->dispose_has_run, 0 ); gconf_client_add_dir( monitor->private->gconf, monitor->private->path, monitor->private->preload, &error ); if( error ){ g_warning( "%s[gconf_client_add_dir] path=%s, error=%s", thisfn, monitor->private->path, error->message ); g_error_free( error ); return( 0 ); } notify_id = gconf_client_notify_add( monitor->private->gconf, monitor->private->path, monitor->private->handler, monitor->private->user_data, NULL, &error ); if( error ){ g_warning( "%s[gconf_client_notify_add] path=%s, error=%s", thisfn, monitor->private->path, error->message ); g_error_free( error ); return( 0 ); } return( notify_id ); } /** * na_gconf_monitor_release_monitors: * @monitors: a list of #NAGConfMonitors. * * Release allocated monitors. * * Since: 2.30 * Deprecated: 3.1 */ void na_gconf_monitor_release_monitors( GList *monitors ) { g_list_foreach( monitors, ( GFunc ) g_object_unref, NULL ); g_list_free( monitors ); } /* * this is called by instance_dispose, before setting dispose_has_run */ static void release_monitor( NAGConfMonitor *monitor ) { static const gchar *thisfn = "na_gconf_monitor_release_monitor"; GError *error = NULL; g_return_if_fail( NA_IS_GCONF_MONITOR( monitor )); if( !monitor->private->dispose_has_run ){ g_debug( "%s: monitor=%p", thisfn, ( void * ) monitor ); if( monitor->private->monitor_id ){ gconf_client_notify_remove( monitor->private->gconf, monitor->private->monitor_id ); } gconf_client_remove_dir( monitor->private->gconf, monitor->private->path, &error ); if( error ){ g_warning( "%s: path=%s, error=%s", thisfn, monitor->private->path, error->message ); g_error_free( error ); } } } #endif /* NA_ENABLE_DEPRECATED */ #endif /* HAVE_GCONF */ nautilus-actions-3.2.3/src/core/na-desktop-environment.c0000644000175100017500000001156212212601376020242 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "na-desktop-environment.h" static const NADesktopEnv st_desktops[] = { { DESKTOP_GNOME, N_( "GNOME desktop" ) }, { DESKTOP_KDE, N_( "KDE desktop" ) }, { DESKTOP_LXDE, N_( "LXDE desktop" ) }, { DESKTOP_ROX, N_( "ROX desktop" ) }, { DESKTOP_XFCE, N_( "XFCE desktop" ) }, { DESKTOP_OLD, N_( "Legacy systems" ) }, { NULL } }; /* * na_desktop_environment_get_known_list: * * Returns the list of known desktop environments as defined by the * corresponding XDG specification. */ const NADesktopEnv * na_desktop_environment_get_known_list( void ) { return(( const NADesktopEnv * ) st_desktops ); } /* * na_desktop_environment_detect_running_desktop: * * Have asked on xdg-list how to identify the currently running desktop environment * (see http://standards.freedesktop.org/menu-spec/latest/apb.html) * For now, just reproduce the xdg-open algorythm from xdg-utils 1.0 */ const gchar * na_desktop_environment_detect_running_desktop( void ) { static const gchar *thisfn = "na_desktop_environment_detect_running_desktop"; const gchar *value; gchar *output_str, *error_str; gint exit_status; GError *error; gboolean ok; int i; value = g_getenv( "XDG_CURRENT_DESKTOP" ); if( value && strlen( value )){ for( i = 0 ; st_desktops[i].id ; ++i ){ if( !strcmp( st_desktops[i].id, value )){ return( st_desktops[i].id ); } } } value = g_getenv( "KDE_FULL_SESSION" ); if( value && !strcmp( value, "true" )){ return( DESKTOP_KDE ); } /* GNOME_DESKTOP_SESSION_ID=this-is-deprecated */ value = g_getenv( "GNOME_DESKTOP_SESSION_ID" ); if( value && strlen( value )){ return( DESKTOP_GNOME ); } value = g_getenv( "DESKTOP_SESSION" ); if( value ){ if( !strcmp( value, "gnome" )){ return( DESKTOP_GNOME ); } if( !strcmp( value, "xfce" )){ return( DESKTOP_XFCE ); } } output_str = NULL; error_str = NULL; error = NULL; if( g_spawn_command_line_sync( "dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager", &output_str, &error_str, &exit_status, &error )){ ok = ( exit_status == 0 && output_str && strlen( output_str ) && ( !error_str || !strlen( error_str ))); g_free( output_str ); g_free( error_str ); if( ok ){ return( DESKTOP_GNOME ); } } if( error ){ g_warning( "%s: dbus-send: %s", thisfn, error->message ); g_error_free( error ); } output_str = NULL; error_str = NULL; error = NULL; if( g_spawn_command_line_sync( "xprop -root _DT_SAVE_MODE", &output_str, &error_str, &exit_status, &error )){ ok = ( exit_status == 0 && output_str && strlen( output_str ) && ( !error_str || !strlen( error_str ))); if( ok ){ ok = ( g_strstr_len( output_str, -1, "xfce" ) != NULL ); } g_free( output_str ); g_free( error_str ); if( ok ){ return( DESKTOP_XFCE ); } } if( error ){ g_warning( "%s: xprop: %s", thisfn, error->message ); g_error_free( error ); } /* do not know how to identify ROX * this one and other desktops are just identified as 'Old' (legacy systems) */ return( DESKTOP_OLD ); } /* * na_desktop_environment_get_label: * @id: desktop identifier. * * Returns: the label of the desktop environment. * * Defaults to returning the provided identifier if it is not found in * our internal reference. * * Since: 3.2 */ const gchar * na_desktop_environment_get_label( const gchar *id ) { static const gchar *thisfn = "na_desktop_environment_get_label"; int i; g_return_val_if_fail( id && strlen( id ), NULL ); for( i = 0 ; st_desktops[i].id ; ++ i ){ if( !strcmp( st_desktops[i].id, id )){ return( st_desktops[i].label ); } } g_warning( "%s: unknwon desktop identifier: %s", thisfn, id ); return( id ); } nautilus-actions-3.2.3/src/core/na-object-menu.c0000644000175100017500000002474712212601376016450 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "na-factory-provider.h" #include "na-factory-object.h" /* private class data */ struct _NAObjectMenuClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAObjectMenuPrivate { gboolean dispose_has_run; }; /* i18n: default label for a new menu */ #define NEW_NAUTILUS_MENU N_( "New Nautilus menu" ) extern NADataGroup menu_data_groups []; /* defined in na-item-menu-factory.c */ static NAObjectItemClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAObjectMenuClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ); static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void object_dump( const NAObject *object ); static void ifactory_object_iface_init( NAIFactoryObjectInterface *iface, void *user_data ); static guint ifactory_object_get_version( const NAIFactoryObject *instance ); static NADataGroup *ifactory_object_get_groups( const NAIFactoryObject *instance ); static void ifactory_object_read_done( NAIFactoryObject *instance, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ); static guint ifactory_object_write_start( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ); static guint ifactory_object_write_done( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ); static void icontext_iface_init( NAIContextInterface *iface, void *user_data ); static gboolean icontext_is_candidate( NAIContext *object, guint target, GList *selection ); GType na_object_menu_get_type( void ) { static GType menu_type = 0; if( menu_type == 0 ){ menu_type = register_type(); } return( menu_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_object_menu_register_type"; GType type; static GTypeInfo info = { sizeof( NAObjectMenuClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAObjectMenu ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo icontext_iface_info = { ( GInterfaceInitFunc ) icontext_iface_init, NULL, NULL }; static const GInterfaceInfo ifactory_object_iface_info = { ( GInterfaceInitFunc ) ifactory_object_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( NA_TYPE_OBJECT_ITEM, "NAObjectMenu", &info, 0 ); g_type_add_interface_static( type, NA_TYPE_ICONTEXT, &icontext_iface_info ); g_type_add_interface_static( type, NA_TYPE_IFACTORY_OBJECT, &ifactory_object_iface_info ); return( type ); } static void class_init( NAObjectMenuClass *klass ) { static const gchar *thisfn = "na_object_menu_class_init"; GObjectClass *object_class; NAObjectClass *naobject_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->set_property = instance_set_property; object_class->get_property = instance_get_property; object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; naobject_class = NA_OBJECT_CLASS( klass ); naobject_class->dump = object_dump; klass->private = g_new0( NAObjectMenuClassPrivate, 1 ); na_factory_object_define_properties( object_class, menu_data_groups ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_object_menu_instance_init"; NAObjectMenu *self; g_return_if_fail( NA_IS_OBJECT_MENU( instance )); self = NA_OBJECT_MENU( instance ); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self->private = g_new0( NAObjectMenuPrivate, 1 ); } static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ) { g_return_if_fail( NA_IS_OBJECT_MENU( object )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); if( !NA_OBJECT_MENU( object )->private->dispose_has_run ){ na_factory_object_get_as_value( NA_IFACTORY_OBJECT( object ), g_quark_to_string( property_id ), value ); } } static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ) { g_return_if_fail( NA_IS_OBJECT_MENU( object )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); if( !NA_OBJECT_MENU( object )->private->dispose_has_run ){ na_factory_object_set_from_value( NA_IFACTORY_OBJECT( object ), g_quark_to_string( property_id ), value ); } } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_object_menu_instance_dispose"; NAObjectMenu *self; g_return_if_fail( NA_IS_OBJECT_MENU( object )); self = NA_OBJECT_MENU( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_object_menu_instance_finalize"; NAObjectMenu *self; g_return_if_fail( NA_IS_OBJECT_MENU( object )); self = NA_OBJECT_MENU( object ); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static void object_dump( const NAObject *object ) { static const char *thisfn = "na_object_menu_object_dump"; NAObjectMenu *self; g_return_if_fail( NA_IS_OBJECT_MENU( object )); self = NA_OBJECT_MENU( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s, ref_count=%d)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ), G_OBJECT( object )->ref_count ); /* chain up to the parent class */ if( NA_OBJECT_CLASS( st_parent_class )->dump ){ NA_OBJECT_CLASS( st_parent_class )->dump( object ); } g_debug( "+- end of dump" ); } } static void ifactory_object_iface_init( NAIFactoryObjectInterface *iface, void *user_data ) { static const gchar *thisfn = "na_object_menu_ifactory_object_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->get_version = ifactory_object_get_version; iface->get_groups = ifactory_object_get_groups; iface->read_done = ifactory_object_read_done; iface->write_start = ifactory_object_write_start; iface->write_done = ifactory_object_write_done; } static guint ifactory_object_get_version( const NAIFactoryObject *instance ) { return( 1 ); } static NADataGroup * ifactory_object_get_groups( const NAIFactoryObject *instance ) { return( menu_data_groups ); } static void ifactory_object_read_done( NAIFactoryObject *instance, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ) { g_debug( "na_object_menu_ifactory_object_read_done: instance=%p", ( void * ) instance ); na_object_item_deals_with_version( NA_OBJECT_ITEM( instance )); /* prepare the context after the reading */ na_icontext_read_done( NA_ICONTEXT( instance )); /* last, set menu defaults */ na_factory_object_set_defaults( instance ); } static guint ifactory_object_write_start( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ) { na_object_item_rebuild_children_slist( NA_OBJECT_ITEM( instance )); return( NA_IIO_PROVIDER_CODE_OK ); } static guint ifactory_object_write_done( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ) { return( NA_IIO_PROVIDER_CODE_OK ); } static void icontext_iface_init( NAIContextInterface *iface, void *user_data ) { static const gchar *thisfn = "na_object_menu_icontext_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->is_candidate = icontext_is_candidate; } static gboolean icontext_is_candidate( NAIContext *object, guint target, GList *selection ) { return( TRUE ); } /** * na_object_menu_new: * * Allocates a new #NAObjectMenu object. * * Returns: the newly allocated #NAObjectMenu object. * * Since: 2.30 */ NAObjectMenu * na_object_menu_new( void ) { NAObjectMenu *menu; menu = g_object_new( NA_TYPE_OBJECT_MENU, NULL ); return( menu ); } /** * na_object_menu_new_with_defaults: * * Allocates a new #NAObjectMenu object, and setup default values. * * Returns: the newly allocated #NAObjectMenu object. * * Since: 2.30 */ NAObjectMenu * na_object_menu_new_with_defaults( void ) { NAObjectMenu *menu = na_object_menu_new(); na_object_set_new_id( menu, NULL ); na_object_set_label( menu, gettext( NEW_NAUTILUS_MENU )); na_factory_object_set_defaults( NA_IFACTORY_OBJECT( menu )); return( menu ); } nautilus-actions-3.2.3/src/core/na-importer-ask.h0000644000175100017500000000574212212601376016654 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_IMPORTER_ASK_H__ #define __CORE_NA_IMPORTER_ASK_H__ /* @title: NAImporterAsk * @short_description: The #NAImporterAsk Class Definition * @include: core/na-importer-ask.h * * This class creates and manages a dialog. It is ran each time an * imported action has the same Id as an existing one, and the user * want to be asked to know what to do with it. */ #include #include #include "na-pivot.h" G_BEGIN_DECLS #define NA_TYPE_IMPORTER_ASK ( na_importer_ask_get_type()) #define NA_IMPORTER_ASK( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_IMPORTER_ASK, NAImporterAsk )) #define NA_IMPORTER_ASK_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_IMPORTER_ASK, NAImporterAskClass )) #define NA_IS_IMPORTER_ASK( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_IMPORTER_ASK )) #define NA_IS_IMPORTER_ASK_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_IMPORTER_ASK )) #define NA_IMPORTER_ASK_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_IMPORTER_ASK, NAImporterAskClass )) typedef struct _NAImporterAskPrivate NAImporterAskPrivate; typedef struct { /*< private >*/ GObject parent; NAImporterAskPrivate *private; } NAImporterAsk; typedef struct _NAImporterAskClassPrivate NAImporterAskClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NAImporterAskClassPrivate *private; } NAImporterAskClass; typedef struct { GtkWindow *parent; gchar *uri; guint count; gboolean keep_choice; const NAPivot *pivot; } NAImporterAskUserParms; GType na_importer_ask_get_type( void ); guint na_importer_ask_user( const NAObjectItem *importing, const NAObjectItem *existing, NAImporterAskUserParms *parms ); G_END_DECLS #endif /* __CORE_NA_IMPORTER_ASK_H__ */ nautilus-actions-3.2.3/src/core/na-object-item.c0000644000175100017500000005556612212601376016445 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "na-io-provider.h" /* private class data */ struct _NAObjectItemClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAObjectItemPrivate { gboolean dispose_has_run; /* set at load time * takes into account the runtime 'readonly' status as well as the i/o * provider writability status - does not consider the level-zero case */ gboolean writable; guint reason; }; static NAObjectIdClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAObjectItemClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void object_dump( const NAObject *object ); static void object_copy( NAObject*target, const NAObject *source, guint mode ); static gboolean object_are_equal( const NAObject *a, const NAObject *b ); static gboolean object_is_valid( const NAObject *object ); static gchar *object_id_new_id( const NAObjectId *item, const NAObjectId *new_parent ); static void count_items_rec( GList *items, gint *menus, gint *actions, gint *profiles, gboolean recurse ); static GSList *get_children_slist( const NAObjectItem *item ); static void copy_children( NAObjectItem *target, const NAObjectItem *source, guint mode ); GType na_object_item_get_type( void ) { static GType item_type = 0; if( item_type == 0 ){ item_type = register_type(); } return( item_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_object_item_register_type"; GType type; static GTypeInfo info = { sizeof( NAObjectItemClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAObjectItem ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( NA_TYPE_OBJECT_ID, "NAObjectItem", &info, 0 ); return( type ); } static void class_init( NAObjectItemClass *klass ) { static const gchar *thisfn = "na_object_item_class_init"; GObjectClass *object_class; NAObjectClass *naobject_class; NAObjectIdClass *naobjectid_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; naobject_class = NA_OBJECT_CLASS( klass ); naobject_class->dump = object_dump; naobject_class->copy = object_copy; naobject_class->are_equal = object_are_equal; naobject_class->is_valid = object_is_valid; naobjectid_class = NA_OBJECT_ID_CLASS( klass ); naobjectid_class->new_id = object_id_new_id; klass->private = g_new0( NAObjectItemClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { NAObjectItem *self; g_return_if_fail( NA_IS_OBJECT_ITEM( instance )); self = NA_OBJECT_ITEM( instance ); self->private = g_new0( NAObjectItemPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->writable = TRUE; self->private->reason = 0; } static void instance_dispose( GObject *object ) { NAObjectItem *self; GList *children; g_return_if_fail( NA_IS_OBJECT_ITEM( object )); self = NA_OBJECT_ITEM( object ); if( !self->private->dispose_has_run ){ self->private->dispose_has_run = TRUE; children = na_object_get_items( self ); na_object_set_items( self, NULL ); na_object_free_items( children ); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { NAObjectItem *self; g_return_if_fail( NA_IS_OBJECT_ITEM( object )); self = NA_OBJECT_ITEM( object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static void object_dump( const NAObject *object ) { static const gchar *thisfn = "na_object_item_object_dump"; NAObjectItem *item; g_return_if_fail( NA_IS_OBJECT_ITEM( object )); item = NA_OBJECT_ITEM( object ); if( !item->private->dispose_has_run ){ g_debug( "| %s: writable=%s", thisfn, item->private->writable ? "True":"False" ); g_debug( "| %s: reason=%u", thisfn, item->private->reason ); /* chain up to the parent class */ if( NA_OBJECT_CLASS( st_parent_class )->dump ){ NA_OBJECT_CLASS( st_parent_class )->dump( object ); } } } static void object_copy( NAObject *target, const NAObject *source, guint mode ) { static const gchar *thisfn = "na_object_item_object_copy"; void *provider; NAObjectItem *dest, *src; g_return_if_fail( NA_IS_OBJECT_ITEM( target )); g_return_if_fail( NA_IS_OBJECT_ITEM( source )); dest = NA_OBJECT_ITEM( target ); src = NA_OBJECT_ITEM( source ); if( !dest->private->dispose_has_run && !src->private->dispose_has_run ){ if( mode == DUPLICATE_REC || ( mode == DUPLICATE_OBJECT && G_OBJECT_TYPE( source ) == NA_TYPE_OBJECT_ACTION )){ copy_children( dest, src, mode ); } provider = na_object_get_provider( source ); if( provider ){ if( !NA_IS_IO_PROVIDER( provider )){ g_warning( "%s: source=%p (%s), provider=%p is not a NAIOProvider", thisfn, ( void * ) source, G_OBJECT_TYPE_NAME( source ), ( void * ) provider ); } else { na_io_provider_duplicate_data( NA_IO_PROVIDER( provider ), NA_OBJECT_ITEM( target ), NA_OBJECT_ITEM( source ), NULL ); } } dest->private->writable = src->private->writable; dest->private->reason = src->private->reason; /* chain up to the parent class */ if( NA_OBJECT_CLASS( st_parent_class )->copy ){ NA_OBJECT_CLASS( st_parent_class )->copy( target, source, mode ); } } } /* * object_are_equal: * @a: the first (original) #NAObjectItem instance. * @b: the second #NAObjectItem instance. * * This function participates to the #na_iduplicable_check_status() stack, * and is triggered after all comparable elementary data (in #NAIFactoryObject * sense) have already been successfully compared. * * We have to deal here with the subitems: comparing children by their ids * between @a and @b. * * Returns: %TRUE if @a is equal to @b. */ static gboolean object_are_equal( const NAObject *a, const NAObject *b ) { static const gchar *thisfn = "na_object_item_object_are_equal"; gboolean are_equal; NAObjectItem *origin, *duplicate; GSList *a_slist, *b_slist; gchar *a_list, *b_list; g_return_val_if_fail( NA_IS_OBJECT_ITEM( a ), FALSE ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( b ), FALSE ); are_equal = FALSE; origin = NA_OBJECT_ITEM( a ); duplicate = NA_OBJECT_ITEM( b ); if( !origin->private->dispose_has_run && !duplicate->private->dispose_has_run ){ g_debug( "%s: a=%p, b=%p", thisfn, ( void * ) a, ( void * ) b ); a_slist = get_children_slist( origin ); a_list = na_core_utils_slist_join_at_end( a_slist, ";" ); na_core_utils_slist_free( a_slist ); b_slist = get_children_slist( duplicate ); b_list = na_core_utils_slist_join_at_end( b_slist, ";" ); na_core_utils_slist_free( b_slist ); are_equal = ( strcmp( a_list, b_list ) == 0 ); g_free( a_list ); g_free( b_list ); } /* chain call to parent class */ if( NA_OBJECT_CLASS( st_parent_class )->are_equal ){ are_equal &= NA_OBJECT_CLASS( st_parent_class )->are_equal( a, b ); } return( are_equal ); } /* * must have at least one valid subitem */ static gboolean object_is_valid( const NAObject *object ) { static const gchar *thisfn = "na_object_item_object_is_valid"; gboolean is_valid; NAObjectItem *item; GList *children, *ic; gint valid_children; g_return_val_if_fail( NA_IS_OBJECT_ITEM( object ), FALSE ); is_valid = FALSE; item = NA_OBJECT_ITEM( object ); if( !item->private->dispose_has_run ){ g_debug( "%s: item=%p (%s)", thisfn, ( void * ) item, G_OBJECT_TYPE_NAME( item )); is_valid = TRUE; valid_children = 0; children = na_object_get_items( item ); for( ic = children ; ic && !valid_children ; ic = ic->next ){ if( na_object_is_valid( ic->data )){ valid_children += 1; } } is_valid &= ( valid_children > 0 ); if( !is_valid ){ na_object_debug_invalid( item, "no valid child" ); } } /* chain up to the parent class */ if( NA_OBJECT_CLASS( st_parent_class )->is_valid ){ is_valid &= NA_OBJECT_CLASS( st_parent_class )->is_valid( object ); } return( is_valid ); } /* * new_parent is not relevant when allocating a new identifier for an * action or a menu ; it may safely be left as NULL though there is no * gain to check this */ static gchar * object_id_new_id( const NAObjectId *item, const NAObjectId *new_parent ) { GList *children, *it; uuid_t uuid; gchar uuid_str[64]; gchar *new_uuid = NULL; g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), NULL ); if( !NA_OBJECT_ITEM( item )->private->dispose_has_run ){ /* recurse into NAObjectItems children * i.e., if a menu, recurse into embedded actions */ children = na_object_get_items( item ); for( it = children ; it ; it = it->next ){ na_object_set_new_id( it->data, new_parent ); } uuid_generate( uuid ); uuid_unparse_lower( uuid, uuid_str ); new_uuid = g_strdup( uuid_str ); } return( new_uuid ); } /** * na_object_item_get_item: * @item: the #NAObjectItem from which we want retrieve a subitem. * @id: the id of the searched subitem. * * Returns: a pointer to the #NAObjectId -derived child with the required id. * * The returned #NAObjectId is owned by the @item object ; the * caller should not try to g_free() nor g_object_unref() it. * * Since: 2.30 */ NAObjectId * na_object_item_get_item( const NAObjectItem *item, const gchar *id ) { GList *children, *it; NAObjectId *found = NULL; NAObjectId *isub; gchar *isubid; g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), NULL ); if( !item->private->dispose_has_run ){ children = na_object_get_items( item ); for( it = children ; it && !found ; it = it->next ){ isub = NA_OBJECT_ID( it->data ); isubid = na_object_get_id( isub ); if( !strcmp( id, isubid )){ found = isub; } g_free( isubid ); } } return( found ); } /** * na_object_item_get_position: * @item: this #NAObjectItem object. * @child: a #NAObjectId -derived child. * * Returns: the position of @child in the subitems list of @item, * starting from zero, or -1 if not found. * * Since: 2.30 */ gint na_object_item_get_position( const NAObjectItem *item, const NAObjectId *child ) { gint pos = -1; GList *children; g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), pos ); g_return_val_if_fail( NA_IS_OBJECT_ID( child ), pos ); if( !child ){ return( pos ); } if( !item->private->dispose_has_run ){ children = na_object_get_items( item ); pos = g_list_index( children, ( gconstpointer ) child ); } return( pos ); } /** * na_object_item_append_item: * @item: the #NAObjectItem to which add the subitem. * @child: a #NAObjectId to be added to list of subitems. * * Appends a new @child to the list of subitems of @item, * and setup the parent pointer of the child to its new parent. * * Doesn't modify the reference count on @object. * * Since: 2.30 */ void na_object_item_append_item( NAObjectItem *item, const NAObjectId *child ) { GList *children; g_return_if_fail( NA_IS_OBJECT_ITEM( item )); g_return_if_fail( NA_IS_OBJECT_ID( child )); if( !item->private->dispose_has_run ){ children = na_object_get_items( item ); if( !g_list_find( children, ( gpointer ) child )){ children = g_list_append( children, ( gpointer ) child ); na_object_set_parent( child, item ); na_object_set_items( item, children ); } } } /** * na_object_item_insert_at: * @item: the #NAObjectItem in which add the subitem. * @child: a #NAObjectId -derived to be inserted in the list of subitems. * @pos: the position at which the @child should be inserted. * * Inserts a new @child in the list of subitems of @item. * * Doesn't modify the reference count on @child. * * Since: 2.30 */ void na_object_item_insert_at( NAObjectItem *item, const NAObjectId *child, gint pos ) { GList *children, *it; gint i; g_return_if_fail( NA_IS_OBJECT_ITEM( item )); g_return_if_fail( NA_IS_OBJECT_ID( child )); if( !item->private->dispose_has_run ){ children = na_object_get_items( item ); if( pos == -1 || pos >= g_list_length( children )){ na_object_append_item( item, child ); } else { i = 0; for( it = children ; it && i <= pos ; it = it->next ){ if( i == pos ){ children = g_list_insert_before( children, it, ( gpointer ) child ); } i += 1; } na_object_set_items( item, children ); } } } /** * na_object_item_insert_item: * @item: the #NAObjectItem to which add the subitem. * @child: a #NAObjectId to be inserted in the list of subitems. * @before: the #NAObjectId before which the @child should be inserted. * * Inserts a new @child in the list of subitems of @item. * * Doesn't modify the reference count on @child. * * Since: 2.30 */ void na_object_item_insert_item( NAObjectItem *item, const NAObjectId *child, const NAObjectId *before ) { GList *children; GList *before_list; g_return_if_fail( NA_IS_OBJECT_ITEM( item )); g_return_if_fail( NA_IS_OBJECT_ID( child )); g_return_if_fail( !before || NA_IS_OBJECT_ID( before )); if( !item->private->dispose_has_run ){ children = na_object_get_items( item ); if( !g_list_find( children, ( gpointer ) child )){ before_list = NULL; if( before ){ before_list = g_list_find( children, ( gconstpointer ) before ); } if( before_list ){ children = g_list_insert_before( children, before_list, ( gpointer ) child ); } else { children = g_list_prepend( children, ( gpointer ) child ); } na_object_set_items( item, children ); } } } /** * na_object_item_remove_item: * @item: the #NAObjectItem from which the subitem must be removed. * @child: a #NAObjectId -derived to be removed from the list of subitems. * * Removes a @child from the list of subitems of @item. * * Doesn't modify the reference count on @child. * * Since: 2.30 */ void na_object_item_remove_item( NAObjectItem *item, const NAObjectId *child ) { GList *children; g_return_if_fail( NA_IS_OBJECT_ITEM( item )); g_return_if_fail( NA_IS_OBJECT_ID( child )); if( !item->private->dispose_has_run ){ children = na_object_get_items( item ); if( children ){ g_debug( "na_object_item_remove_item: removing %p (%s) from %p (%s)", ( void * ) child, G_OBJECT_TYPE_NAME( child ), ( void * ) item, G_OBJECT_TYPE_NAME( item )); children = g_list_remove( children, ( gconstpointer ) child ); g_debug( "na_object_item_remove_item: after: children=%p, count=%u", ( void * ) children, g_list_length( children )); na_object_set_items( item, children ); } } } /** * na_object_item_get_items_count: * @item: the #NAObjectItem from which we want a count of subitems. * * Returns: the count of subitems of @item. * * Since: 2.30 */ guint na_object_item_get_items_count( const NAObjectItem *item ) { guint count = 0; GList *children; /*g_debug( "na_object_item_get_items_count: item=%p (%s)", ( void * ) item, G_OBJECT_TYPE_NAME( item ));*/ g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), 0 ); if( !item->private->dispose_has_run ){ children = na_object_get_items( item ); count = children ? g_list_length( children ) : 0; } return( count ); } /** * na_object_item_count_items: * @items: a list if #NAObject -derived to be counted. * @menus: will be set to the count of menus. * @actions: will be set to the count of actions. * @profiles: will be set to the count of profiles. * @recurse: whether to recursively count all items, or only those in * level zero of the list. * * Returns: the count the numbers of items if the provided list. * * As this function is recursive, the counters should be initialized by * the caller before calling it. * * Since: 2.30 */ void na_object_item_count_items( GList *items, gint *menus, gint *actions, gint *profiles, gboolean recurse ) { *menus = 0; *actions = 0; *profiles = 0; count_items_rec( items, menus, actions, profiles, recurse ); } static void count_items_rec( GList *items, gint *menus, gint *actions, gint *profiles, gboolean recurse ) { GList *it; for( it = items ; it ; it = it->next ){ if( recurse ){ if( NA_IS_OBJECT_ITEM( it->data )){ GList *subitems = na_object_get_items( it->data ); count_items_rec( subitems, menus, actions, profiles, recurse ); } } if( NA_IS_OBJECT_MENU( it->data )){ *menus += 1; } else if( NA_IS_OBJECT_ACTION( it->data )){ *actions += 1; } else if( NA_IS_OBJECT_PROFILE( it->data )){ *profiles += 1; } } } /** * na_object_item_copyref_items: * @items: a list of #NAObject -derived items. * * Creates a copy of the provided list, recursively incrementing the * reference count of NAObjects. * * Returns: the new list, which should be na_object_free_items() by the * caller. * * Since: 3.1 */ GList * na_object_item_copyref_items( GList *items ) { GList *copy = NULL; if( items ){ copy = g_list_copy( items ); g_list_foreach( copy, ( GFunc ) na_object_object_ref, NULL ); g_debug( "na_object_item_copyref_items: list at %p contains %s at %p (ref_count=%d)", ( void * ) copy, G_OBJECT_TYPE_NAME( copy->data ), ( void * ) copy->data, G_OBJECT( copy->data )->ref_count ); } return( copy ); } /** * na_object_item_free_items: * @items: a list of #NAObject -derived items. * * Free the items list. * * Returns: a %NULL pointer. * * Since: 3.1 */ GList * na_object_item_free_items( GList *items ) { if( items ){ g_debug( "na_object_item_free_items: freeing list at %p which contains %s at %p (ref_count=%d)", ( void * ) items, G_OBJECT_TYPE_NAME( items->data ), ( void * ) items->data, G_OBJECT( items->data )->ref_count ); g_list_foreach( items, ( GFunc ) na_object_object_unref, NULL ); g_list_free( items ); } return( NULL ); } /** * na_object_item_deals_with_version: * @item: this #NAObjectItem -derived object. * * Just after the @item has been read from NAIFactoryProvider, setup * the version. This is needed because some conversions may occur in * this object. * * Note that there is only some 2.x versions where the version string * was not systematically written. If @item has been read from a * .desktop file, then iversion is already set to (at least) 3. * * Since: 2.30 */ void na_object_item_deals_with_version( NAObjectItem *item ) { guint version_uint; gchar *version_str; g_return_if_fail( NA_IS_OBJECT_ITEM( item )); if( !item->private->dispose_has_run ){ version_uint = na_object_get_iversion( item ); if( !version_uint ){ version_str = na_object_get_version( item ); if( !version_str || !strlen( version_str )){ g_free( version_str ); version_str = g_strdup( "2.0" ); } version_uint = atoi( version_str ); na_object_set_iversion( item, version_uint ); g_free( version_str ); } } } /** * na_object_item_rebuild_children_slist: * @item: this #NAObjectItem -derived object. * * Rebuild the string list of children. * * Since: 2.30 */ void na_object_item_rebuild_children_slist( NAObjectItem *item ) { GSList *slist; na_object_set_items_slist( item, NULL ); if( !item->private->dispose_has_run ){ slist = get_children_slist( item ); na_object_set_items_slist( item, slist ); na_core_utils_slist_free( slist ); } } /* */ static GSList * get_children_slist( const NAObjectItem *item ) { GSList *slist; GList *subitems, *it; gchar *id; slist = NULL; subitems = na_object_get_items( item ); for( it = subitems ; it ; it = it->next ){ id = na_object_get_id( it->data ); slist = g_slist_prepend( slist, id ); } return( g_slist_reverse( slist )); } /* * only copy children if mode is 'full recursive' * or mode is 'duplicate object' and this is an action with profiles */ static void copy_children( NAObjectItem *target, const NAObjectItem *source, guint mode ) { static const gchar *thisfn = "na_object_item_copy_children"; GList *tgt_children, *src_children, *ic; NAObject *dup; tgt_children = na_object_get_items( target ); if( tgt_children ){ g_warning( "%s: target_children=%p (count=%d)", thisfn, ( void * ) tgt_children, g_list_length( tgt_children )); g_return_if_fail( tgt_children == NULL ); } src_children = na_object_get_items( source ); for( ic = src_children ; ic ; ic = ic->next ){ dup = ( NAObject * ) na_object_duplicate( ic->data, mode ); na_object_set_parent( dup, target ); tgt_children = g_list_prepend( tgt_children, dup ); } tgt_children = g_list_reverse( tgt_children ); na_object_set_items( target, tgt_children ); } /** * na_object_item_is_finally_writable: * @item: this #NAObjectItem -derived object. * @reason: if not %NULL, a pointer to a guint which will hold the reason code. * * Returns: the writability status of the @item. * * Since: 3.1 */ gboolean na_object_item_is_finally_writable( const NAObjectItem *item, guint *reason ) { gboolean writable; if( reason ){ *reason = NA_IIO_PROVIDER_STATUS_UNDETERMINED; } g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), FALSE ); writable = FALSE; if( !item->private->dispose_has_run ){ writable = item->private->writable; if( reason ){ *reason = item->private->reason; } } return( writable ); } /** * na_object_item_set_writability_status: * @item: this #NAObjectItem -derived object. * @writable: whether the item is finally writable. * @reason: the reason code. * * Set the writability status of the @item. * * Since: 3.1 */ void na_object_item_set_writability_status( NAObjectItem *item, gboolean writable, guint reason ) { g_return_if_fail( NA_IS_OBJECT_ITEM( item )); if( !item->private->dispose_has_run ){ item->private->writable = writable; item->private->reason = reason; } } nautilus-actions-3.2.3/src/core/na-object-profile-factory.c0000644000175100017500000002104512212601376020575 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include extern NADataDef data_def_id []; /* defined in na-object-id-factory.c */ extern NADataDef data_def_conditions []; /* defined in na-icontext-factory.c */ static NADataDef data_def_profile [] = { { NAFO_DATA_DESCNAME, TRUE, TRUE, TRUE, N_( "Name of the profile" ), N_( "May be used as a description for the function of the profile.\n" \ "If not set, it defaults to an auto-generated name." ), NA_DATA_TYPE_LOCALE_STRING, "", FALSE, TRUE, TRUE, FALSE, TRUE, "desc-name", "Name", 0, NULL, 0, 0, NULL, NULL }, /* label of the profile was unlocalized up to and included 1.11.0 */ { NAFO_DATA_DESCNAME_NOLOC, TRUE, FALSE, FALSE, "Unlocalized name of the profile", NULL, NA_DATA_TYPE_STRING, "", FALSE, FALSE, FALSE, FALSE, FALSE, "desc-name", NULL, 0, NULL, 0, 0, NULL, NULL }, /* Path and Parameters are two separate data both in GConf, in GConf-derived * export files and in NACT. Only in desktop files, they are merged as only * one 'Exec' data which is splitted at read time. */ { NAFO_DATA_PATH, TRUE, TRUE, TRUE, N_( "Path of the command" ), N_( "The path of the command to be executed when the user select the menu item " \ "in the file manager context menu or in the toolbar." ), NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, TRUE, FALSE, "path", "Exec", 'x', "command", 0, G_OPTION_ARG_FILENAME, NULL, N_( "" ) }, /* Desktop files not only introduced new properties conditions to item and profiles, * but also slightly changed the meaning of some parameters. This is synchronized * with the change of version data (from "2.0" string to '1' integer) */ { NAFO_DATA_PARAMETERS, TRUE, TRUE, TRUE, N_( "Parameters of the command" ), /* too long string for iso c: (max=509) */ N_( "The parameters of the command to be executed when the user selects the menu " \ "item in the file manager context menu or in the toolbar.\n" \ "The parameters may contain some special tokens which are replaced by the " \ "informations provided by the file manager before starting the command:\n" \ "- up to version 2.0:\n" \ " %d: base folder of the selected file(s)\n" \ " %f: the name of the selected file or the first one if several are selected\n" \ " %h: hostname of the URI\n" \ " %m: space-separated list of the basenames of the selected file(s)/folder(s)\n" \ " %M: space-separated list of the selected file(s)/folder(s), with their full paths\n" \ " %p: port number of the first URI\n" \ " %R: space-separated list of selected URIs\n" \ " %s: scheme of the URI\n" \ " %u: URI\n" \ " %U: username of the URI\n" \ " %%: a percent sign.\n" \ "- starting from version 3:\n" \ " %b: (first) basename\n" \ " %B: space-separated list of the basenames of the selected file(s)/folder(s)\n" \ " %c: count the selected file(s)/folder(s)\n" \ " %d: (first) base directory\n" \ " %D: space-separated list of base directories of the selected file(s)/folder(s)\n" \ " %f: (first) filename\n" \ " %F: space-separated list of the filenames of the selected file(s)/folder(s)\n" \ " %h: hostname of the (first) URI\n" \ " %m: (first) mimetype\n" \ " %M: space-separated list of the mimetypes of the selected file(s)/folder(s)\n" \ " %n: username of the (first) URI\n" \ " %o: no-op operator which forces the singular form of execution (since 3.0.2)\n" \ " %O: no-op operator which forces the plural form of execution (since 3.0.2)\n" \ " %p: port number of the (first) URI\n" \ " %s: scheme of the (first) URI\n" \ " %u: (first) URI\n" \ " %U: space-separated list of the URIs of the selected file(s)/folder(s)\n" \ " %w: (first) basename without the extension\n" \ " %W: space-separated list of basenames without the extension\n" \ " %x: (first) extension\n" \ " %X: space-separated list of the extensions of the selected file(s)/folder(s)\n" \ " %%: a percent sign." ), NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, FALSE, FALSE, "parameters", NULL, 'p', "parameters", 0, G_OPTION_ARG_STRING, NULL, N_( "" ) }, { NAFO_DATA_WORKING_DIR, TRUE, TRUE, TRUE, N_( "Working directory" ), N_( "The working directory the command will be started in.\n" \ "Defaults to \"%d\"." ), NA_DATA_TYPE_STRING, "%d", FALSE, TRUE, TRUE, FALSE, FALSE, "working-dir", "Path", 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_EXECUTION_MODE, TRUE, TRUE, TRUE, N_( "Execution mode" ), /* i18n: 'Normal', 'Terminal', 'Embedded' and 'DisplayOutput' are non-translatable keywords */ N_( "Execution mode of the program.\n" \ "This may be chosen between following values:\n" \ "- Normal: starts as a standard graphical user interface\n" \ "- Terminal: starts the preferred terminal of the graphical environment, " \ "and runs the command in it\n" \ "- Embedded: makes use of a special feature of the file manager which allows " \ "a terminal to be ran inside of it; an acceptable fallback is Terminal\n" \ "- DisplayOutput: the ran terminal may be closed at end of the command, but " \ "standard streams (stdout, stderr) should be collected and displayed; " \ "an acceptable fallback is Terminal.\n" \ "Defaults to \"Normal\"." ), NA_DATA_TYPE_STRING, "Normal", FALSE, TRUE, TRUE, FALSE, FALSE, "execution-mode", "ExecutionMode", 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_STARTUP_NOTIFY, TRUE, TRUE, TRUE, N_( "Startup notify" ), N_( "Only relevant when ExecutionMode=Normal.\n" \ "Defaults to FALSE." ), NA_DATA_TYPE_BOOLEAN, "false", FALSE, TRUE, TRUE, FALSE, FALSE, "startup-notify", "StartupNotify", 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_STARTUP_WMCLASS, TRUE, TRUE, TRUE, N_( "Startup WM Class" ), N_( "Only relevant when ExecutionMode=Normal.\n" \ "Defaults to empty." ), NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, FALSE, FALSE, "startup-wmclass", "StartupWMClass", 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_EXECUTE_AS, TRUE, TRUE, TRUE, N_( "Execute as user" ), N_( "The user the command must be ran as. " \ "The user may be identified by its numeric UID or by its login.\n" \ "The profile is ignored if defined with a non-existing UID or login.\n" \ "Defaults to empty: the command will be executed as the current user." ), NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, FALSE, FALSE, "execute-as", "ExecuteAs", 0, NULL, 0, 0, NULL, NULL }, { NULL }, }; NADataGroup profile_data_groups [] = { { NA_FACTORY_OBJECT_ID_GROUP, data_def_id }, { NA_FACTORY_OBJECT_PROFILE_GROUP, data_def_profile }, { NA_FACTORY_OBJECT_CONDITIONS_GROUP, data_def_conditions }, { NULL } }; nautilus-actions-3.2.3/src/core/na-importer.c0000644000175100017500000003637512212601376016101 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "na-import-mode.h" #include "na-importer.h" #include "na-importer-ask.h" typedef struct { guint id; /* the import mode used in switch statement in the code */ const gchar *mode; /* the import mode saved in user's preferences */ const gchar *label; /* short label */ const gchar *description; /* full description */ gchar *image; /* associated image */ } NAImportModeStr; static NAImportModeStr st_import_modes[] = { { IMPORTER_MODE_NO_IMPORT, "NoImport", N_( "Do _not import the item" ), N_( "This used to be the historical behavior.\n" \ "The selected file will be marked as \"NOT OK\" in the Summary page.\n" \ "The existing item will not be modified." ), "import-mode-no-import.png" }, { IMPORTER_MODE_RENUMBER, "Renumber", N_( "Import the item, _allocating it a new identifier" ), N_( "The selected file will be imported with a slightly modified label " \ "indicating the renumbering.\n" \ "The existing item will not be modified." ), "import-mode-renumber.png" }, { IMPORTER_MODE_OVERRIDE, "Override", N_( "_Override the existing item" ), N_( "The item found in the selected file will silently override the " \ "current one which has the same identifier.\n" \ "Be warned: this mode may be dangerous. You will not be prompted another time." ), "import-mode-override.png" }, { 0 } }; static NAImportModeStr st_import_ask_mode = { IMPORTER_MODE_ASK, "Ask", N_( "_Ask me" ), N_( "You will be asked each time an imported ID already exists." ), "import-mode-ask.png" }; static NAImporterResult *import_from_uri( const NAPivot *pivot, GList *modules, const gchar *uri ); static void manage_import_mode( NAImporterParms *parms, GList *results, NAImporterAskUserParms *ask_parms, NAImporterResult *result ); static NAObjectItem *is_importing_already_exists( NAImporterParms *parms, GList *results, NAImporterResult *result ); static void renumber_label_item( NAObjectItem *item ); static guint ask_user_for_mode( const NAObjectItem *importing, const NAObjectItem *existing, NAImporterAskUserParms *parms ); static guint get_id_from_string( const gchar *str ); static NAIOption *get_mode_from_struct( const NAImportModeStr *str ); /* i18n: '%s' stands for the file URI */ #define ERR_NOT_LOADABLE _( "%s is not loadable (empty or too big or not a regular file)" ) /* * na_importer_import_from_uris: * @pivot: the #NAPivot pivot for this application. * @parms: a #NAImporterParms structure. * * Imports a list of URIs. * * For each URI to import, we search through the available #NAIImporter * providers until the first which returns with something different from * "not_willing_to" code. * * #parms.uris contains a list of URIs to import. * * Each import operation will have its corresponding newly allocated * #NAImporterResult structure which will contain: * - the imported URI * - the #NAIImporter provider if one has been found, or %NULL * - a #NAObjectItem item if import was successful, or %NULL * - a list of error messages, or %NULL. * * Returns: a #GList of #NAImporterResult structures * (was the last import operation code up to 3.2). * * Since: 2.30 */ GList * na_importer_import_from_uris( const NAPivot *pivot, NAImporterParms *parms ) { static const gchar *thisfn = "na_importer_import_from_uris"; GList *results, *ires; GList *modules; GSList *uri; NAImporterResult *import_result; NAImporterAskUserParms ask_parms; gchar *mode_str; g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL ); g_return_val_if_fail( parms != NULL, NULL ); results = NULL; g_debug( "%s: pivot=%p, parms=%p", thisfn, ( void * ) pivot, ( void * ) parms ); /* first phase: just try to import the uris into memory */ modules = na_pivot_get_providers( pivot, NA_TYPE_IIMPORTER ); for( uri = parms->uris ; uri ; uri = uri->next ){ import_result = import_from_uri( pivot, modules, ( const gchar * ) uri->data ); results = g_list_prepend( results, import_result ); } na_pivot_free_providers( modules ); results = g_list_reverse( results ); memset( &ask_parms, '\0', sizeof( NAImporterAskUserParms )); ask_parms.parent = parms->parent_toplevel; ask_parms.count = 0; ask_parms.keep_choice = FALSE; ask_parms.pivot = pivot; /* set the default import mode */ if( !parms->preferred_mode ){ mode_str = na_settings_get_string( NA_IPREFS_IMPORT_PREFERRED_MODE, NULL, NULL ); parms->preferred_mode = get_id_from_string( mode_str ); g_free( mode_str ); } /* second phase: check for their pre-existence */ for( ires = results ; ires ; ires = ires->next ){ import_result = ( NAImporterResult * ) ires->data; if( import_result->imported ){ g_return_val_if_fail( NA_IS_OBJECT_ITEM( import_result->imported ), NULL ); g_return_val_if_fail( NA_IS_IIMPORTER( import_result->importer ), NULL ); ask_parms.uri = import_result->uri; manage_import_mode( parms, results, &ask_parms, import_result ); } } return( results ); } /* * na_importer_free_result: * @result: the #NAImporterResult structure to be released. * * Release the structure. */ void na_importer_free_result( NAImporterResult *result ) { g_free( result->uri ); na_core_utils_slist_free( result->messages ); g_free( result ); } /* * Each NAIImporter interface may return some messages, specially if it * recognized but is not able to import the provided URI. But as long * we do not have yet asked to all available interfaces, we are not sure * of whether this URI is eventually importable or not. * * We so let each interface push its messages in the list, but be ready to * only keep the messages provided by the interface which has successfully * imported the item. */ static NAImporterResult * import_from_uri( const NAPivot *pivot, GList *modules, const gchar *uri ) { NAImporterResult *result; NAIImporterImportFromUriParmsv2 provider_parms; GList *im; guint code; GSList *all_messages; NAIImporter *provider; result = NULL; all_messages = NULL; provider = NULL; code = IMPORTER_CODE_NOT_WILLING_TO; memset( &provider_parms, '\0', sizeof( NAIImporterImportFromUriParmsv2 )); provider_parms.version = 2; provider_parms.content = 1; provider_parms.uri = uri; for( im = modules ; im && ( code == IMPORTER_CODE_NOT_WILLING_TO || code == IMPORTER_CODE_NOT_LOADABLE ) ; im = im->next ){ code = na_iimporter_import_from_uri( NA_IIMPORTER( im->data ), &provider_parms ); if( code == IMPORTER_CODE_NOT_WILLING_TO ){ all_messages = g_slist_concat( all_messages, provider_parms.messages ); provider_parms.messages = NULL; } else if( code == IMPORTER_CODE_NOT_LOADABLE ){ na_core_utils_slist_free( all_messages ); all_messages = NULL; na_core_utils_slist_free( provider_parms.messages ); provider_parms.messages = NULL; na_core_utils_slist_add_message( &all_messages, ERR_NOT_LOADABLE, ( const gchar * ) uri ); } else { na_core_utils_slist_free( all_messages ); all_messages = provider_parms.messages; provider = NA_IIMPORTER( im->data ); } } result = g_new0( NAImporterResult, 1 ); result->uri = g_strdup( uri ); result->imported = provider_parms.imported; result->importer = provider; result->messages = all_messages; return( result ); } /* * check for existence of the imported item * ask for the user if needed */ static void manage_import_mode( NAImporterParms *parms, GList *results, NAImporterAskUserParms *ask_parms, NAImporterResult *result ) { static const gchar *thisfn = "na_importer_manage_import_mode"; NAObjectItem *exists; guint mode; gchar *id; exists = NULL; result->exist = FALSE; result->mode = parms->preferred_mode; mode = 0; /* if no check function is provided, then we systematically allocate * a new identifier to the imported item */ if( !parms->check_fn ){ renumber_label_item( result->imported ); na_core_utils_slist_add_message( &result->messages, "%s", _( "Item was renumbered because the caller did not provide any check function." )); result->mode = IMPORTER_MODE_RENUMBER; } else { exists = is_importing_already_exists( parms, results, result ); } g_debug( "%s: exists=%p", thisfn, exists ); if( exists ){ result->exist = TRUE; if( parms->preferred_mode == IMPORTER_MODE_ASK ){ mode = ask_user_for_mode( result->imported, exists, ask_parms ); } else { mode = parms->preferred_mode; } } /* mode is only set if asked mode was "ask me" and an ask function was provided * or if asked mode was not "ask me" */ if( mode ){ result->mode = mode; switch( mode ){ case IMPORTER_MODE_RENUMBER: renumber_label_item( result->imported ); if( parms->preferred_mode == IMPORTER_MODE_ASK ){ na_core_utils_slist_add_message( &result->messages, "%s", _( "Item was renumbered due to user request." )); } break; case IMPORTER_MODE_OVERRIDE: if( parms->preferred_mode == IMPORTER_MODE_ASK ){ na_core_utils_slist_add_message( &result->messages, "%s", _( "Existing item was overriden due to user request." )); } break; case IMPORTER_MODE_NO_IMPORT: default: id = na_object_get_id( result->imported ); na_core_utils_slist_add_message( &result->messages, _( "Item %s already exists." ), id ); if( parms->preferred_mode == IMPORTER_MODE_ASK ){ na_core_utils_slist_add_message( &result->messages, "%s", _( "Import was canceled due to user request." )); } g_free( id ); g_object_unref( result->imported ); result->imported = NULL; } } } /* * First check here for duplicates inside of imported population, * then delegates to the caller-provided check function the rest of work... */ static NAObjectItem * is_importing_already_exists( NAImporterParms *parms, GList *results, NAImporterResult *result ) { static const gchar *thisfn = "na_importer_is_importing_already_exists"; NAObjectItem *exists; GList *ip; exists = NULL; gchar *importing_id = na_object_get_id( result->imported ); g_debug( "%s: importing=%p, id=%s", thisfn, ( void * ) result->imported, importing_id ); /* is the importing item already in the current importation list ? * (only tries previous items of the list) */ for( ip = results ; ip && !exists && ip->data != result ; ip = ip->next ){ NAImporterResult *try_result = ( NAImporterResult * ) ip->data; if( try_result->imported ){ g_return_val_if_fail( NA_IS_OBJECT_ITEM( try_result->imported ), NULL ); gchar *id = na_object_get_id( try_result->imported ); if( !strcmp( importing_id, id )){ exists = NA_OBJECT_ITEM( try_result->imported ); } g_free( id ); } } g_free( importing_id ); /* if not found in our current importation list, * then check the existence via provided function and data */ if( !exists ){ exists = parms->check_fn( result->imported, parms->check_fn_data ); } return( exists ); } /* * renumber the item, and set a new label */ static void renumber_label_item( NAObjectItem *item ) { gchar *label, *tmp; na_object_set_new_id( item, NULL ); label = na_object_get_label( item ); /* i18n: the action has been renumbered during import operation */ tmp = g_strdup_printf( "%s %s", label, _( "(renumbered)" )); na_object_set_label( item, tmp ); g_free( tmp ); g_free( label ); } static guint ask_user_for_mode( const NAObjectItem *importing, const NAObjectItem *existing, NAImporterAskUserParms *parms ) { guint mode; gchar *mode_str; if( parms->count == 0 || !parms->keep_choice ){ mode = na_importer_ask_user( importing, existing, parms ); } else { mode_str = na_settings_get_string( NA_IPREFS_IMPORT_ASK_USER_LAST_MODE, NULL, NULL ); mode = get_id_from_string( mode_str ); g_free( mode_str ); } return( mode ); } static guint get_id_from_string( const gchar *str ) { int i; /* search in standard import modes */ for( i = 0 ; st_import_modes[i].id ; ++i ){ if( !strcmp( st_import_modes[i].mode, str )){ return( st_import_modes[i].id ); } } /* else, is it ask option ? */ if( !strcmp( st_import_ask_mode.mode, str )){ return( st_import_ask_mode.id ); } return( 0 ); } /* * na_importer_get_modes: * * Returns: the list of available import modes. * This list should later be released by calling na_importer_free_modes(); */ GList * na_importer_get_modes( void ) { static const gchar *thisfn = "na_importer_get_modes"; GList *modes; NAIOption *mode; guint i; g_debug( "%s", thisfn ); modes = NULL; for( i = 0 ; st_import_modes[i].id ; ++i ){ mode = get_mode_from_struct( st_import_modes+i ); modes = g_list_prepend( modes, mode ); } return( modes ); } static NAIOption * get_mode_from_struct( const NAImportModeStr *str ) { NAImportMode *mode; gint width, height; gchar *fname; GdkPixbuf *pixbuf; if( !gtk_icon_size_lookup( GTK_ICON_SIZE_DIALOG, &width, &height )){ width = height = 48; } mode = na_import_mode_new( str->id ); pixbuf = NULL; if( str->image && g_utf8_strlen( str->image, -1 )){ fname = g_strdup_printf( "%s/%s", PKGIMPORTMODEDIR, str->image ); pixbuf = gdk_pixbuf_new_from_file_at_size( fname, width, height, NULL ); g_free( fname ); } g_object_set( G_OBJECT( mode ), NA_IMPORT_PROP_MODE, str->mode, NA_IMPORT_PROP_LABEL, gettext( str->label ), NA_IMPORT_PROP_DESCRIPTION, gettext( str->description ), NA_IMPORT_PROP_IMAGE, pixbuf, NULL ); return( NA_IOPTION( mode )); } /* * na_importer_free_modes: * @modes: a #GList of #NAImportMode items, as returned by na_importer_get_modes(). * * Releases the resources allocated to the @modes list. */ void na_importer_free_modes( GList *modes ) { static const gchar *thisfn = "na_importer_free_modes"; g_debug( "%s: modes=%p", thisfn, ( void * ) modes ); g_list_foreach( modes, ( GFunc ) g_object_unref, NULL ); g_list_free( modes ); } /* * na_importer_get_ask_mode: * * Returns: a #NAImportMode object which describes the 'Ask me' option. */ NAIOption * na_importer_get_ask_mode( void ) { static const gchar *thisfn = "na_importer_get_ask_mode"; g_debug( "%s", thisfn ); return( get_mode_from_struct( &st_import_ask_mode )); } nautilus-actions-3.2.3/src/core/na-pivot.c0000644000175100017500000004236012212601376015370 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "na-io-provider.h" #include "na-module.h" #include "na-pivot.h" /* private class data */ struct _NAPivotClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAPivotPrivate { gboolean dispose_has_run; guint loadable_set; /* dynamically loaded modules (extension plugins) */ GList *modules; /* configuration tree of actions and menus */ GList *tree; /* timeout to manage i/o providers 'item-changed' burst */ NATimeout change_timeout; }; /* NAPivot properties */ enum { PRIVOT_PROP_0, PIVOT_PROP_LOADABLE_ID, PIVOT_PROP_TREE_ID, /* count of properties */ PIVOT_PROP_N }; /* signals */ enum { ITEMS_CHANGED, LAST_SIGNAL }; static GObjectClass *st_parent_class = NULL; static gint st_burst_timeout = 100; /* burst timeout in msec */ static gint st_signals[ LAST_SIGNAL ] = { 0 }; static GType register_type( void ); static void class_init( NAPivotClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_constructed( GObject *object ); static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ); static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static NAObjectItem *get_item_from_tree( const NAPivot *pivot, GList *tree, const gchar *id ); /* NAIIOProvider management */ static void on_items_changed_timeout( NAPivot *pivot ); GType na_pivot_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_pivot_register_type"; GType type; static GTypeInfo info = { sizeof( NAPivotClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAPivot ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NAPivot", &info, 0 ); return( type ); } static void class_init( NAPivotClass *klass ) { static const gchar *thisfn = "na_pivot_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->constructed = instance_constructed; object_class->set_property = instance_set_property; object_class->get_property = instance_get_property; object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; g_object_class_install_property( object_class, PIVOT_PROP_LOADABLE_ID, g_param_spec_uint( PIVOT_PROP_LOADABLE, "Loadable set", "The set of loadble items", 0, 255, 0, G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, PIVOT_PROP_TREE_ID, g_param_spec_pointer( PIVOT_PROP_TREE, "Items tree", "Hierarchical tree of items", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); klass->private = g_new0( NAPivotClassPrivate, 1 ); /* * NAPivot::pivot-items-changed: * * This signal is sent by NAPivot at the end of a burst of modifications * as signaled by i/o providers. * * The signal is registered without any default handler. */ st_signals[ ITEMS_CHANGED ] = g_signal_new( PIVOT_SIGNAL_ITEMS_CHANGED, NA_TYPE_PIVOT, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, 0, /* class offset */ NULL, /* accumulator */ NULL, /* accumulator data */ g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_pivot_instance_init"; NAPivot *self; g_return_if_fail( NA_IS_PIVOT( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_PIVOT( instance ); self->private = g_new0( NAPivotPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->loadable_set = PIVOT_LOAD_NONE; self->private->modules = NULL; self->private->tree = NULL; /* initialize timeout parameters for 'item-changed' handler */ self->private->change_timeout.timeout = st_burst_timeout; self->private->change_timeout.handler = ( NATimeoutFunc ) on_items_changed_timeout; self->private->change_timeout.user_data = self; self->private->change_timeout.source_id = 0; } static void instance_constructed( GObject *object ) { static const gchar *thisfn = "na_pivot_instance_constructed"; NAPivotPrivate *priv; g_return_if_fail( NA_IS_PIVOT( object )); priv = NA_PIVOT( object )->private; if( !priv->dispose_has_run ){ /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->constructed ){ G_OBJECT_CLASS( st_parent_class )->constructed( object ); } g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); priv->modules = na_module_load_modules(); /* force class initialization and io-factory registration */ g_object_unref( na_object_action_new_with_profile()); g_object_unref( na_object_menu_new()); } } static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ) { NAPivot *self; g_return_if_fail( NA_IS_PIVOT( object )); self = NA_PIVOT( object ); if( !self->private->dispose_has_run ){ switch( property_id ){ case PIVOT_PROP_LOADABLE_ID: g_value_set_uint( value, self->private->loadable_set ); break; case PIVOT_PROP_TREE_ID: g_value_set_pointer( value, self->private->tree ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec ); break; } } } static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ) { NAPivot *self; g_return_if_fail( NA_IS_PIVOT( object )); self = NA_PIVOT( object ); if( !self->private->dispose_has_run ){ switch( property_id ){ case PIVOT_PROP_LOADABLE_ID: self->private->loadable_set = g_value_get_uint( value ); break; case PIVOT_PROP_TREE_ID: self->private->tree = g_value_get_pointer( value ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec ); break; } } } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_pivot_instance_dispose"; NAPivot *self; g_return_if_fail( NA_IS_PIVOT( object )); self = NA_PIVOT( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; /* release modules */ na_module_release_modules( self->private->modules ); self->private->modules = NULL; /* release item tree */ g_debug( "%s: tree=%p (count=%u)", thisfn, ( void * ) self->private->tree, g_list_length( self->private->tree )); na_object_dump_tree( self->private->tree ); self->private->tree = na_object_free_items( self->private->tree ); /* release the settings */ na_settings_free(); /* release the I/O Provider object list */ na_io_provider_unref_io_providers_list(); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_pivot_instance_finalize"; NAPivot *self; g_return_if_fail( NA_IS_PIVOT( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NA_PIVOT( object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /* * na_pivot_new: * * This object takes care of all items/actions/menus/providers/settings * management which is required to correctly handle file manager context * menus. * * When this object is instantiated, it automatically takes care of: * - loading Nautilus-Actions dynamic modules; * - initializing the preferences monitoring. * * Actual loading of items from i/o providers is delayed until a call * to call to na_pivot_load_items() function, so that the caller is able * to set its own needed #NAPivot properties (e.g. the loadable set of * items). * * Only one #NAPivot object should be instantiated for a running application. * * Returns: a newly allocated #NAPivot object which should be g_object_unref() * by the caller at the end of the application. */ NAPivot * na_pivot_new( void ) { static const gchar *thisfn = "na_pivot_new"; NAPivot *pivot; g_debug( "%s", thisfn ); pivot = g_object_new( NA_TYPE_PIVOT, NULL ); return( pivot ); } /* * na_pivot_dump: * @pivot: the #NAPivot object do be dumped. * * Dumps the content of a #NAPivot object. */ void na_pivot_dump( const NAPivot *pivot ) { static const gchar *thisfn = "na_pivot_dump"; GList *it; int i; if( !pivot->private->dispose_has_run ){ g_debug( "%s: loadable_set=%d", thisfn, pivot->private->loadable_set ); g_debug( "%s: modules=%p (%d elts)", thisfn, ( void * ) pivot->private->modules, g_list_length( pivot->private->modules )); g_debug( "%s: tree=%p (%d elts)", thisfn, ( void * ) pivot->private->tree, g_list_length( pivot->private->tree )); /*g_debug( "%s: monitors=%p (%d elts)", thisfn, ( void * ) pivot->private->monitors, g_list_length( pivot->private->monitors ));*/ for( it = pivot->private->tree, i = 0 ; it ; it = it->next ){ g_debug( "%s: [%d]: %p", thisfn, i++, it->data ); } } } /* * na_pivot_get_providers: * @pivot: this #NAPivot instance. * @type: the type of searched interface. * For now, we only have NA_TYPE_IIO_PROVIDER interfaces. * * Returns: a newly allocated list of providers of the required interface. * * This function is called by interfaces API in order to find the * list of providers registered for their own given interface. * * The returned list should be release by calling na_pivot_free_providers(). */ GList * na_pivot_get_providers( const NAPivot *pivot, GType type ) { static const gchar *thisfn = "na_pivot_get_providers"; GList *list = NULL; g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL ); if( !pivot->private->dispose_has_run ){ g_debug( "%s: pivot=%p, type=%lu (%s)", thisfn, ( void * ) pivot, ( unsigned long ) type, g_type_name( type )); list = na_module_get_extensions_for_type( pivot->private->modules, type ); g_debug( "%s: list=%p, count=%d", thisfn, ( void * ) list, list ? g_list_length( list ) : 0 ); } return( list ); } /* * na_pivot_free_providers: * @providers: a list of providers. * * Frees a list of providers as returned from na_pivot_get_providers(). */ void na_pivot_free_providers( GList *providers ) { static const gchar *thisfn = "na_pivot_free_providers"; g_debug( "%s: providers=%p", thisfn, ( void * ) providers ); na_module_free_extensions_list( providers ); } /* * na_pivot_get_item: * @pivot: this #NAPivot instance. * @id: the required item identifier. * * Returns the specified item, action or menu. * * Returns: the required #NAObjectItem-derived object, or %NULL if not * found. * * The returned pointer is owned by #NAPivot, and should not be * g_free() nor g_object_unref() by the caller. */ NAObjectItem * na_pivot_get_item( const NAPivot *pivot, const gchar *id ) { NAObjectItem *object = NULL; g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL ); if( !pivot->private->dispose_has_run ){ if( !id || !strlen( id )){ return( NULL ); } object = get_item_from_tree( pivot, pivot->private->tree, id ); } return( object ); } static NAObjectItem * get_item_from_tree( const NAPivot *pivot, GList *tree, const gchar *id ) { GList *subitems, *ia; NAObjectItem *found = NULL; for( ia = tree ; ia && !found ; ia = ia->next ){ gchar *i_id = na_object_get_id( NA_OBJECT( ia->data )); if( !g_ascii_strcasecmp( id, i_id )){ found = NA_OBJECT_ITEM( ia->data ); } if( !found && NA_IS_OBJECT_ITEM( ia->data )){ subitems = na_object_get_items( ia->data ); found = get_item_from_tree( pivot, subitems, id ); } } return( found ); } /* * na_pivot_get_items: * @pivot: this #NAPivot instance. * * Returns: the current configuration tree. * * The returned list is owned by this #NAPivot object, and should not * be g_free(), nor g_object_unref() by the caller. */ GList * na_pivot_get_items( const NAPivot *pivot ) { GList *tree; g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL ); tree = NULL; if( !pivot->private->dispose_has_run ){ tree = pivot->private->tree; } return( tree ); } /* * na_pivot_load_items: * @pivot: this #NAPivot instance. * * Loads the hierarchical list of items from I/O providers. */ void na_pivot_load_items( NAPivot *pivot ) { static const gchar *thisfn = "na_pivot_load_items"; GSList *messages, *im; g_return_if_fail( NA_IS_PIVOT( pivot )); if( !pivot->private->dispose_has_run ){ g_debug( "%s: pivot=%p", thisfn, ( void * ) pivot ); messages = NULL; na_object_free_items( pivot->private->tree ); pivot->private->tree = na_io_provider_load_items( pivot, pivot->private->loadable_set, &messages ); for( im = messages ; im ; im = im->next ){ g_warning( "%s: %s", thisfn, ( const gchar * ) im->data ); } na_core_utils_slist_free( messages ); } } /* * na_pivot_set_new_items: * @pivot: this #NAPivot instance. * @tree: the new tree of items. * * Replace the current list with this one, acquiring the full ownership * of the provided @tree. */ void na_pivot_set_new_items( NAPivot *pivot, GList *items ) { static const gchar *thisfn = "na_pivot_set_new_items"; g_return_if_fail( NA_IS_PIVOT( pivot )); if( !pivot->private->dispose_has_run ){ g_debug( "%s: pivot=%p, items=%p (count=%d)", thisfn, ( void * ) pivot, ( void * ) items, items ? g_list_length( items ) : 0 ); na_object_free_items( pivot->private->tree ); pivot->private->tree = items; } } /* * na_pivot_on_item_changed_handler: * @provider: the #NAIIOProvider which has emitted the signal. * @pivot: this #NAPivot instance. * * This handler is trigerred by #NAIIOProvider providers when an action * is changed in their underlying storage subsystems. * * The NAIIOProvider is supposed to have itself already summarized * a minima its own burst of notifications. * * We don't care of updating our internal list with each and every * atomic modification; instead we wait for the end of notifications * serie, and then signal our consumers. */ void na_pivot_on_item_changed_handler( NAIIOProvider *provider, NAPivot *pivot ) { static const gchar *thisfn = "na_pivot_on_item_changed_handler"; g_return_if_fail( NA_IS_IIO_PROVIDER( provider )); g_return_if_fail( NA_IS_PIVOT( pivot )); if( !pivot->private->dispose_has_run ){ g_debug( "%s: provider=%p, pivot=%p", thisfn, ( void * ) provider, ( void * ) pivot ); na_timeout_event( &pivot->private->change_timeout ); } } /* * this callback is triggered after having received a first 'item-changed' event, * and having received no more event during a 'st_burst_timeout' period; we can * so suppose that the burst if modification events is terminated * this is up to NAPivot to send now its summarized signal */ static void on_items_changed_timeout( NAPivot *pivot ) { static const gchar *thisfn = "na_pivot_on_items_changed_timeout"; g_return_if_fail( NA_IS_PIVOT( pivot )); g_debug( "%s: emitting %s signal", thisfn, PIVOT_SIGNAL_ITEMS_CHANGED ); g_signal_emit_by_name(( gpointer ) pivot, PIVOT_SIGNAL_ITEMS_CHANGED ); } /* * na_pivot_set_loadable: * @pivot: this #NAPivot instance. * @loadable: the population of items to be loaded. * * Sets the loadable set. */ void na_pivot_set_loadable( NAPivot *pivot, guint loadable ) { g_return_if_fail( NA_IS_PIVOT( pivot )); if( !pivot->private->dispose_has_run ){ pivot->private->loadable_set = loadable; } } nautilus-actions-3.2.3/src/core/export-format-ask.png0000664000175100017500000000766111701521533017565 00000000000000PNG  IHDR00WsRGBbKGD pHYs  tIME + @1IDAThYYy9wfZ.IѦQT,;ˎbl4 Fy! ~[8 ÖJIkW$s=GUyكmK (tuOu ^{_7z7?rW|}}j;lS퓩&O[y5:_l_gK_]s q\=0ڻqQϺ5)j@ $ t@<|W$/oᙯ;ӹƯO/('_yrki4^g]`sݕixOX0}xv.+!lq/o:`vhF!U>;@mG#sU3gGo̼^t$m9"q{.hbb0H=\OAbrE`~sN"PCw2߭BwI18m4>pu){"۵?@>@/=d .9wa F`]}[e(ϟl7w@!` 9g怪?؝ ]*^i@bOUFYtkT][H_} KxfOCIA5R{2IƾպOW+\rPhx~*tpgUyEs1`bGivqH2zʺ] 80g$o1PEW18X5<dJb9U·^5Pj\i7_!:nfG4%$ `vZ|I-p)40)vڞ*Y{ `:RW*﯎,&K~q$B!J'AE0Idpd X"kj$ro[Kqcc}&:W $ƂoLp4=9۳3cTs% ! 0Ơit|\H$d݈Ji̴p,3!iWV}ʏ#hu4>zIxZ ]x٧x~=yl#ӇF?zd|SKJ(ɱ .Tz4:=FE @Bcu'B.rJՙ܋?@4ZSSc@Q<9/藏}o>񾡄|Tzg&L5$aHp <@ ǃe@zH 6Vp<@BZ~/B'=,; ^VvU'@Aڃ~` cxz766V G$l i`qcA ŐA2z¶цzFV+_;ߵ^'aؗy9[ʏ4s…Ru{ N8^| ;/;ֱKQIĝz7^xgBƈbo ]K5s}=Y@0|퍾ŗ..YjJ"A; ,\B[F\UtVf$E/2dt7 dpH;=GS%cVV}RyP(䈨 QRra?Zd\x#㇦*":K8K$Q[.^m Q8HR8H^` px]T;Q̡cË,YZSJ'1F%llEM8H[^@w:z&}(185{$ Q>ڥaH>I"=7NBfhtSΝ嬛 b *zYƼֵzz~v\eAQ.tk5W^GDQ(Cؠ7wS4{ S`:xS dh@஌W=GI~L>A޸F 6ch)] 6f֥՝  ͎%wI:(h5)V-"JH""360y!29y'B*[p+ձrn8ͅ3z62)#u o; 2ԙPAAHG!85S\3He 9GM#Pԁ0AX=ӇI4+% 9(~:d0:>Ǐȓ'OybI_l6)YHna VWnu6~p{š0/vL7$ls6z.z6:غ1F9%l`4%tX}S;{y8HJXfm' 6k[|~ԚҾ }\F.OcdR=>Z" e^ͭDabvӟA-out4@7< T2 p$4 ` ziF3miьvl팖F]WE3ȱCgk7#RmVY߬piXI`$gG*`~m_ټo}&s=TGq#8yH8N]Yr y Ni Ra$e|0l>uF RHMʫJ庮;̃BI}xhźQs3@hHXnPEK:߄f`q^>{8 D0^`oXl~S}fnBn',!Huƌ%frV\p}d1ֻbP8XR`m24)1>>*eVWǕJ 33f;&pc?{䡧GGzFM1RVY]>8WzϽ@w=Y68}r0/|#we-O\̆O=2S}E܉^Yj^_ɩљCaRv[h I|ߊOϜ>u^|hukml;tS'y7oޜW/acGH_|u֭;/< oٜRj~ 9SM/l;(x`*50VܺzW/_Ǝ&i*;bg(:]$SB4ǩqJ)ΥRi$VWW1993,k?y`pIENDB`nautilus-actions-3.2.3/src/core/import-mode-override.png0000664000175100017500000001061211674472206020254 00000000000000PNG  IHDR00WsRGBbKGD pHYs  tIME   IDAThieYUkgo~^c4T@0 %A!$(ItL0`hb 60؊= 3DUuuUzpߝϰ^~^tPbd';$oZl5AϽBBhq*Me AFg0|gG}TM (L&3c{k_^wNJON^ncozyL̰CLE˿@xw;yP3?ҾsϽԾې_8 D (rv|dĖ# t>QMQpVHgxP^oYx;[Y෬/_{iP_O<@98<Ȇ5yW"H/_{ 44Uq@ODTBzр@I/@VHX*tI -3XPx@X8/^bh{4kѯ:1$CCpXrcG1ZV+e3RIؘ1:B1{v޳un:+&w9- (A }k~i/" ~'D@0ca j Sc#ҎzXkL -AH$ Dq3ݳp ˳^Pai^^%E^GKYyA) 7y+OWFBAC/ q 4- ZJzbR7|ΨV0rK<;aS_݇C{0cݓcw+$S"v5J ) JA]>*D 5!6Rveib|hyP螟KĎ/gn/:c/,>x?hXxgڗwx:*ڑ'" P @j A2@IxR !à-!Z =@J)Hi( 4ZͻlwX%*-/?B)KqL0ۡ줡 F Ci; A2kw6ᖚ~^ٿx{q3mO9JЉ'zl6ѣGYm:|ӷط{+~9I!Y hI@ 3}<7 a@+Z f$VJ'k_=3LVK6Iw+ICz>la2`ᄆYl ?Bom`4+PXF^xS @a UR @{9PN~m %q_o~TsjLDU!Dbc 4'E16DRr2D0y`Fui (E2bb@ Xh(O*ȒZ~i7yG^4?455h0ID4T7gw+-_(İ %6Mn.#]%dyi1aQ8fi/B0AREZ}!LF")A:F}Ip᛬J>0r KbW^'W87$KT*zedEtZz}!=C{h-:YgE0iEPE!ZGA NE@@u:}qN9>@쬭X+J@E>(ZN~jnr0\n$nÈM=QՇs{m*!u Hв },!x)^qTFex  AT)UHQ.R)B&_CW?pyq#JDQ9,G!kXLqPDcte%v!CTTǰ/{a6C[a358dXW1"ONbϾЁȡAV7'Ϝq1JJ~fzNwŽL~j#JTt1x#E Ku~p𴆱achϭa,fD(0F)'4LAD`D!{xQX^0~b;}?9}!Y-g4- e}*`x K) 1>> !l{P AA7Sn@U@Gp:dODnl~V[Z?VJ_`z};)sPG9)#,Oac(@9CX[X2G7 RtCQm ;1cI "O>u_|r/&0`͗_A9wbհj@aJL 1e@6aI##@ LDA a"ARoCէ丘_]4:Ȍ9339fX%3s8X<>C+G2\(T )s(9B56.MhљYD ֬”k*u:TR+ S`[/zJyT VD6$p@쉙"H^8&1p+sl((cm6,˸l{_(:=*' P)b@d2" =!Ա a *A i iR(`Ty~dM]ٟ+ `L>Fx%]N+f$}o}IUGƬ`}BJ!uܖa^sMOa 5mGSr*جh[ ¹З#콱ݿ UҴ{ h~92ųDS?#ʤ@qLIENDB`nautilus-actions-3.2.3/src/core/na-iexporter.c0000644000175100017500000000636012212601376016250 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include /* private interface data */ struct _NAIExporterInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; static guint st_initializations = 0; /* interface initialization count */ static GType register_type( void ); static void interface_base_init( NAIExporterInterface *klass ); static void interface_base_finalize( NAIExporterInterface *klass ); static guint iexporter_get_version( const NAIExporter *instance ); /** * na_iexporter_get_type: * * Returns: the #GType type of this interface. */ GType na_iexporter_get_type( void ) { static GType type = 0; if( !type ){ type = register_type(); } return( type ); } /* * na_iexporter_register_type: * * Registers this interface. */ static GType register_type( void ) { static const gchar *thisfn = "na_iexporter_register_type"; GType type; static const GTypeInfo info = { sizeof( NAIExporterInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NAIExporter", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( NAIExporterInterface *klass ) { static const gchar *thisfn = "na_iexporter_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass%p (%s)", thisfn, ( void * ) klass, G_OBJECT_CLASS_NAME( klass )); klass->private = g_new0( NAIExporterInterfacePrivate, 1 ); klass->get_version = iexporter_get_version; klass->get_name = NULL; klass->get_formats = NULL; klass->to_file = NULL; klass->to_buffer = NULL; } st_initializations += 1; } static void interface_base_finalize( NAIExporterInterface *klass ) { static const gchar *thisfn = "na_iexporter_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } static guint iexporter_get_version( const NAIExporter *instance ) { return( 1 ); } nautilus-actions-3.2.3/src/core/na-factory-provider.h0000644000175100017500000000370712212601376017535 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_FACTORY_PROVIDER_H__ #define __CORE_NA_FACTORY_PROVIDER_H__ /* @title: NAIFactoryProvider * @short_description: The #NAIFactoryProvider Internal Functions * @include: core/na-factory-provider.h * * Declare the function only accessed from core library (not published as API). */ #include #include G_BEGIN_DECLS NADataBoxed *na_factory_provider_read_data ( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *object, const NADataDef *def, GSList **messages ); guint na_factory_provider_write_data( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, const NADataBoxed *boxed, GSList **messages ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_API_NA_FACTORY_PROVIDER_H__ */ nautilus-actions-3.2.3/src/core/na-marshal.def0000664000175100017500000000031611663540352016174 00000000000000# NAIDuplicable:: IDUPLICABLE_SIGNAL_MODIFIED_CHANGED # NAIDuplicable:: IDUPLICABLE_SIGNAL_VALID_CHANGED VOID:POINTER,BOOLEAN # # NASettings:: SETTINGS_SIGNAL_KEY_CHANGED VOID:STRING,STRING,POINTER,BOOLEAN nautilus-actions-3.2.3/src/core/na-object-action-factory.c0000644000175100017500000002071512212601376020415 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include /* * As of 3.2 non copyables data are: * - n/a */ extern NADataDef data_def_id []; /* defined in na-object-id-factory.c */ extern NADataDef data_def_item []; /* defined in na-object-item-factory.c */ extern NADataDef data_def_conditions []; /* defined in na-icontext-factory.c */ static NADataDef data_def_action [] = { /* this version number, expressed as a string, is obsoleted starting with .desktop * files introduction ; it is replaced by an integer version number, at the item level */ { NAFO_DATA_VERSION, TRUE, FALSE, TRUE, "Version of the format", "The version of the configuration format that will be used to manage backward compatibility.", NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, FALSE, FALSE, "version", NULL, 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_TARGET_SELECTION, TRUE, TRUE, TRUE, N_( "Targets the selection context menu" ), N_( "Whether the action targets the selection file manager context menus.\n" \ "This used to be the historical behavior.\n" \ "Note that menus are always potential candidate to the display in " \ "selection context menus provided that they contain at least one action.\n" \ "Defaults to TRUE." ), NA_DATA_TYPE_BOOLEAN, "true", FALSE, TRUE, TRUE, FALSE, FALSE, "target-selection", "TargetContext", 'n', "selection", 0, G_OPTION_ARG_NONE, N_( "Targets the selection context menu [true]" ), NULL }, { NAFO_DATA_TARGET_LOCATION, TRUE, TRUE, TRUE, N_( "Targets the location context menu" ), N_( "Whether the action targets the file manager context menus " \ "when there is no selection, thus applying to current location.\n" \ "Note that menus are always potential candidate to the display in " \ "selection context menus provided that they contain at least one action.\n" \ "Defaults to FALSE" ), NA_DATA_TYPE_BOOLEAN, "false", FALSE, TRUE, TRUE, FALSE, FALSE, "target-location", "TargetLocation", 'N', "location", 0, G_OPTION_ARG_NONE, N_( "Targets the location context menu [false]" ), NULL }, { NAFO_DATA_TARGET_TOOLBAR, TRUE, TRUE, TRUE, N_( "Targets the toolbar" ), N_( "Whether the action is candidate to be displayed in file manager toolbar.\n" \ "This only applies to current location.\n" \ "Note that menus are never displayed in the toolbar.\n" \ "Defaults to FALSE." ), NA_DATA_TYPE_BOOLEAN, "false", FALSE, TRUE, TRUE, FALSE, FALSE, "target-toolbar", "TargetToolbar", 'o', "toolbar", 0, G_OPTION_ARG_NONE, N_( "Targets the toolbar [false]" ), NULL }, { NAFO_DATA_TOOLBAR_LABEL, TRUE, TRUE, TRUE, N_( "Label of the toolbar item" ), N_( "The label displayed besides of the icon in the file manager toolbar.\n" \ "Note that actual display may depend of your own Desktop Environment preferences.\n" \ "Defaults to label of the context menu when not set or empty."), NA_DATA_TYPE_LOCALE_STRING, "", FALSE, TRUE, TRUE, FALSE, TRUE, "toolbar-label", "ToolbarLabel", 'L', "toolbar-label", 0, G_OPTION_ARG_STRING, NULL, N_( "" ) }, /* this data has been introduced in 2.29.1 and has been left up to 2.29.4 * it has been removed starting with 2.29.5 * it is now only used in the NACT user interface * it is so left readable, but no more writable (obsolete) */ { NAFO_DATA_TOOLBAR_SAME_LABEL, TRUE, FALSE, TRUE, "Does the toolbar label is the same than the main one ?", "Does the toolbar label is the same than the main one ?", NA_DATA_TYPE_BOOLEAN, "true", FALSE, TRUE, TRUE, FALSE, FALSE, "toolbar-same-label", NULL, 0, NULL, 0, 0, NULL, NULL }, /* dynamic data, so non readable / non writable */ { NAFO_DATA_LAST_ALLOCATED, FALSE, FALSE, TRUE, "Last allocated profile", "Last allocated profile number in na_object_action_get_new_profile_name(), " \ "reset to zero when saving the action.", NA_DATA_TYPE_UINT, "0", FALSE, TRUE, FALSE, FALSE, FALSE, NULL, NULL, 0, NULL, 0, 0, NULL, NULL }, { NULL }, }; /* all these data are pre-profiles data * these are obsoleted since 1.9 (which was a non-official version) * readable but non writable, no default, not copyable */ NADataDef data_def_action_v1 [] = { { NAFO_DATA_PATH, TRUE, FALSE, FALSE, "Command path", NULL, NA_DATA_TYPE_STRING, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "path", NULL, 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_PARAMETERS, TRUE, FALSE, FALSE, "Command parameters", NULL, NA_DATA_TYPE_STRING, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "parameters", NULL, 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_BASENAMES, TRUE, FALSE, FALSE, "Basenames", NULL, NA_DATA_TYPE_STRING_LIST, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "basenames", NULL, 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_MATCHCASE, TRUE, FALSE, FALSE, "Case sensitive", NULL, NA_DATA_TYPE_BOOLEAN, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "matchcase", NULL, 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_MIMETYPES, TRUE, FALSE, FALSE, "Mimetypes", NULL, NA_DATA_TYPE_STRING_LIST, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "mimetypes", NULL, 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_ISFILE, TRUE, FALSE, FALSE, "Applies to files only", NULL, NA_DATA_TYPE_BOOLEAN, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "isfile", NULL, 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_ISDIR, TRUE, FALSE, FALSE, "Applies to directories only", NULL, NA_DATA_TYPE_BOOLEAN, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "isdir", NULL, 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_MULTIPLE, TRUE, FALSE, FALSE, "Multiple selection", NULL, NA_DATA_TYPE_BOOLEAN, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "accept-multiple-files", NULL, 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_SCHEMES, TRUE, FALSE, FALSE, "Schemes", NULL, NA_DATA_TYPE_STRING_LIST, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "schemes", NULL, 0, NULL, 0, 0, NULL, NULL }, { NULL }, }; NADataGroup action_data_groups [] = { { NA_FACTORY_OBJECT_ID_GROUP, data_def_id }, { NA_FACTORY_OBJECT_ITEM_GROUP, data_def_item }, { NA_FACTORY_OBJECT_ACTION_GROUP, data_def_action }, { NA_FACTORY_ACTION_V1_GROUP, data_def_action_v1 }, { NA_FACTORY_OBJECT_CONDITIONS_GROUP, data_def_conditions }, { NULL } }; nautilus-actions-3.2.3/src/core/na-exporter.c0000644000175100017500000003057512212601376016104 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "na-exporter.h" #include "na-export-format.h" #include "na-settings.h" typedef struct { const gchar *format; /* export format saved in user's preferences */ const gchar *label; /* short label */ const gchar *description; /* full description */ const gchar *image; /* associated image */ } NAExporterFormatStr; static NAExporterFormatStr st_format_ask = { EXPORTER_FORMAT_ASK, N_( "_Ask me" ), N_( "You will be asked for the format to choose each time an item " \ "is about to be exported." ), "export-format-ask.png" }; /* i18n: NAIExporter is an interface name, do not even try to translate */ #define NO_IMPLEMENTATION_MSG N_( "No NAIExporter implementation found for '%s' format." ) static GList *exporter_get_formats( const NAIExporter *exporter ); static void exporter_free_formats( const NAIExporter *exporter, GList * str_list ); static gchar *exporter_get_name( const NAIExporter *exporter ); static void on_pixbuf_finalized( gpointer user_data, GObject *pixbuf ); /* * na_exporter_get_formats: * @pivot: the #NAPivot instance. * * Returns: a list of #NAExportFormat objects, each of them addressing an * available export format, i.e. a format provided by a module which * implement the #NAIExporter interface. * * The returned list should later be na_exporter_free_formats() by the caller. */ GList * na_exporter_get_formats( const NAPivot *pivot ) { GList *iexporters, *imod; GList *formats; GList *str_list, *is; NAExportFormat *format; g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL ); formats = NULL; iexporters = na_pivot_get_providers( pivot, NA_TYPE_IEXPORTER ); for( imod = iexporters ; imod ; imod = imod->next ){ str_list = exporter_get_formats( NA_IEXPORTER( imod->data )); for( is = str_list ; is ; is = is->next ){ format = na_export_format_new(( NAIExporterFormatv2 * ) is->data ); formats = g_list_prepend( formats, format ); } exporter_free_formats( NA_IEXPORTER( imod->data ), str_list ); } na_pivot_free_providers( iexporters ); return( formats ); } /* * Returns a GList of NAIExporterFormatv2 structures which describes * the export formats provided by the exporter * If the provider only implements the v1 interface, we dynamically * allocate a new structure and convert the v1 to the v2. */ static GList * exporter_get_formats( const NAIExporter *exporter ) { GList *str_list; guint version; str_list = NULL; version = 1; if( NA_IEXPORTER_GET_INTERFACE( exporter )->get_version ){ version = NA_IEXPORTER_GET_INTERFACE( exporter )->get_version( exporter ); } if( NA_IEXPORTER_GET_INTERFACE( exporter )->get_formats ){ if( version == 1 ){ #ifdef NA_ENABLE_DEPRECATED const NAIExporterFormat *strv1; strv1 = NA_IEXPORTER_GET_INTERFACE( exporter )->get_formats( exporter ); while( strv1->format ){ NAIExporterFormatv2 *strv2 = g_new0( NAIExporterFormatv2, 1 ); strv2->version = 2; strv2->provider = ( NAIExporter * ) exporter; strv2->format = strv1->format; strv2->label = strv1->label; strv2->description = strv1->description; strv2->pixbuf = NULL; str_list = g_list_prepend( str_list, strv2 ); strv1++; } #else ; #endif } else { str_list = NA_IEXPORTER_GET_INTERFACE( exporter )->get_formats( exporter ); } } return( str_list ); } /* * Free the list returned by exporter_get_formats() for this provider */ static void exporter_free_formats( const NAIExporter *exporter, GList *str_list ) { guint version; version = 1; if( NA_IEXPORTER_GET_INTERFACE( exporter )->get_version ){ version = NA_IEXPORTER_GET_INTERFACE( exporter )->get_version( exporter ); } if( version == 1 ){ g_list_foreach( str_list, ( GFunc ) g_free, NULL ); g_list_free( str_list ); } else { g_return_if_fail( NA_IEXPORTER_GET_INTERFACE( exporter )->free_formats ); NA_IEXPORTER_GET_INTERFACE( exporter )->free_formats( exporter, str_list ); } } /* * na_exporter_free_formats: * @formats: a list of available export formats, as returned by * na_exporter_get_formats(). * * Release the @formats #GList. */ void na_exporter_free_formats( GList *formats ) { static const gchar *thisfn = "na_exporter_free_formats"; g_debug( "%s: formats=%p (count=%d)", thisfn, ( void * ) formats, g_list_length( formats )); g_list_foreach( formats, ( GFunc ) g_object_unref, NULL ); g_list_free( formats ); } /* * na_exporter_get_ask_option: * * Returns the 'Ask me' option. * * Since: 3.2 */ NAIOption * na_exporter_get_ask_option( void ) { static const gchar *thisfn = "na_exporter_get_ask_option"; NAIExporterFormatv2 *str; gint width, height; gchar *fname; NAExportFormat *format; if( !gtk_icon_size_lookup( GTK_ICON_SIZE_DIALOG, &width, &height )){ width = height = 48; } str = g_new0( NAIExporterFormatv2, 1 ); str->version = 2; str->provider = NULL; str->format = g_strdup( st_format_ask.format ); str->label = g_strdup( gettext( st_format_ask.label )); str->description = g_strdup( gettext( st_format_ask.description )); if( st_format_ask.image ){ fname = g_strdup_printf( "%s/%s", PKGEXPORTFORMATDIR, st_format_ask.image ); str->pixbuf = gdk_pixbuf_new_from_file_at_size( fname, width, height, NULL ); g_free( fname ); if( str->pixbuf ){ g_debug( "%s: allocating pixbuf at %p", thisfn, str->pixbuf ); g_object_weak_ref( G_OBJECT( str->pixbuf ), ( GWeakNotify ) on_pixbuf_finalized, NULL ); } } format = na_export_format_new( str ); if( str->pixbuf ){ g_object_unref( str->pixbuf ); } g_free( str->description ); g_free( str->label ); g_free( str->format ); g_free( str ); return( NA_IOPTION( format )); } static void on_pixbuf_finalized( gpointer user_data /* ==NULL */, GObject *pixbuf ) { g_debug( "na_exporter_on_pixbuf_finalized: pixbuf=%p", ( void * ) pixbuf ); } /* * na_exporter_to_buffer: * @pivot: the #NAPivot pivot for the running application. * @item: a #NAObjectItem-derived object. * @format: the target format identifier. * @messages: a pointer to a #GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * Exports the specified @item in the required @format. * * Returns: the output buffer, as a newly allocated string which should * be g_free() by the caller, or %NULL if an error has been detected. */ gchar * na_exporter_to_buffer( const NAPivot *pivot, const NAObjectItem *item, const gchar *format, GSList **messages ) { static const gchar *thisfn = "na_exporter_to_buffer"; gchar *buffer; NAIExporterBufferParmsv2 parms; NAIExporter *exporter; gchar *name; gchar *msg; g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), NULL ); buffer = NULL; g_debug( "%s: pivot=%p, item=%p (%s), format=%s, messages=%p", thisfn, ( void * ) pivot, ( void * ) item, G_OBJECT_TYPE_NAME( item ), format, ( void * ) messages ); exporter = na_exporter_find_for_format( pivot, format ); g_debug( "%s: exporter=%p (%s)", thisfn, ( void * ) exporter, G_OBJECT_TYPE_NAME( exporter )); if( exporter ){ parms.version = 2; parms.exported = ( NAObjectItem * ) item; parms.format = g_strdup( format ); parms.buffer = NULL; parms.messages = messages ? *messages : NULL; if( NA_IEXPORTER_GET_INTERFACE( exporter )->to_buffer ){ NA_IEXPORTER_GET_INTERFACE( exporter )->to_buffer( exporter, &parms ); if( parms.buffer ){ buffer = parms.buffer; } } else { name = exporter_get_name( exporter ); /* i18n: NAIExporter is an interface name, do not even try to translate */ msg = g_strdup_printf( _( "%s NAIExporter doesn't implement 'to_buffer' interface." ), name ); *messages = g_slist_append( *messages, msg ); g_free( name ); } g_free( parms.format ); } else { msg = g_strdup_printf( NO_IMPLEMENTATION_MSG, format ); *messages = g_slist_append( *messages, msg ); } return( buffer ); } /* * na_exporter_to_file: * @pivot: the #NAPivot pivot for the running application. * @item: a #NAObjectItem-derived object. * @folder_uri: the URI of the target folder. * @format: the target format identifier. * @messages: a pointer to a #GSList list of strings; the provider * may append messages to this list, but shouldn't reinitialize it. * * Exports the specified @item to the target @uri in the required @format. * * Returns: the URI of the exported file, as a newly allocated string which * should be g_free() by the caller, or %NULL if an error has been detected. */ gchar * na_exporter_to_file( const NAPivot *pivot, const NAObjectItem *item, const gchar *folder_uri, const gchar *format, GSList **messages ) { static const gchar *thisfn = "na_exporter_to_file"; gchar *export_uri; NAIExporterFileParmsv2 parms; NAIExporter *exporter; gchar *msg; gchar *name; g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), NULL ); export_uri = NULL; g_debug( "%s: pivot=%p, item=%p (%s), folder_uri=%s, format=%s, messages=%p", thisfn, ( void * ) pivot, ( void * ) item, G_OBJECT_TYPE_NAME( item ), folder_uri, format, ( void * ) messages ); exporter = na_exporter_find_for_format( pivot, format ); if( exporter ){ parms.version = 2; parms.exported = ( NAObjectItem * ) item; parms.folder = ( gchar * ) folder_uri; parms.format = g_strdup( format ); parms.basename = NULL; parms.messages = messages ? *messages : NULL; if( NA_IEXPORTER_GET_INTERFACE( exporter )->to_file ){ NA_IEXPORTER_GET_INTERFACE( exporter )->to_file( exporter, &parms ); if( parms.basename ){ export_uri = g_strdup_printf( "%s%s%s", folder_uri, G_DIR_SEPARATOR_S, parms.basename ); } } else { name = exporter_get_name( exporter ); /* i18n: NAIExporter is an interface name, do not even try to translate */ msg = g_strdup_printf( _( "%s NAIExporter doesn't implement 'to_file' interface." ), name ); *messages = g_slist_append( *messages, msg ); g_free( name ); } g_free( parms.format ); } else { msg = g_strdup_printf( NO_IMPLEMENTATION_MSG, format ); *messages = g_slist_append( *messages, msg ); } return( export_uri ); } static gchar * exporter_get_name( const NAIExporter *exporter ) { gchar *name; name = NULL; if( NA_IEXPORTER_GET_INTERFACE( exporter )->get_name ){ name = NA_IEXPORTER_GET_INTERFACE( exporter )->get_name( exporter ); } return( name ); } /** * na_exporter_find_for_format: * @pivot: the #NAPivot instance. * @format: the string identifier of the searched format. * * Returns: the #NAIExporter instance which provides the @format export * format. The returned instance is owned by @pivot, and should not be * released by the caller. */ NAIExporter * na_exporter_find_for_format( const NAPivot *pivot, const gchar *format ) { NAIExporter *exporter; GList *formats, *ifmt; gchar *id; NAExportFormat *export_format; g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL ); exporter = NULL; formats = na_exporter_get_formats( pivot ); for( ifmt = formats ; ifmt && !exporter ; ifmt = ifmt->next ){ export_format = NA_EXPORT_FORMAT( ifmt->data ); id = na_ioption_get_id( NA_IOPTION( export_format )); if( !strcmp( id, format )){ exporter = na_export_format_get_provider( NA_EXPORT_FORMAT( ifmt->data )); } g_free( id ); } na_exporter_free_formats( formats ); return( exporter ); } nautilus-actions-3.2.3/src/core/na-factory-object.c0000644000175100017500000007044112212601376017143 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include "na-factory-object.h" #include "na-factory-provider.h" typedef gboolean ( *NADataDefIterFunc )( NADataDef *def, void *user_data ); enum { DATA_DEF_ITER_SET_PROPERTIES = 1, DATA_DEF_ITER_SET_DEFAULTS, DATA_DEF_ITER_IS_VALID, DATA_DEF_ITER_READ_ITEM, }; /* while iterating on read item */ typedef struct { NAIFactoryObject *object; NAIFactoryProvider *reader; void *reader_data; GSList **messages; } NafoReadIter; /* while iterating on write item */ typedef struct { NAIFactoryProvider *writer; void *writer_data; GSList **messages; guint code; } NafoWriteIter; /* while iterating on is_valid */ typedef struct { NAIFactoryObject *object; gboolean is_valid; } NafoValidIter; /* while iterating on set defaults */ typedef struct { NAIFactoryObject *object; } NafoDefaultIter; extern gboolean ifactory_object_initialized; extern gboolean ifactory_object_finalized; static gboolean define_class_properties_iter( const NADataDef *def, GObjectClass *class ); static gboolean set_defaults_iter( NADataDef *def, NafoDefaultIter *data ); static gboolean is_valid_mandatory_iter( const NADataDef *def, NafoValidIter *data ); static gboolean read_data_iter( NADataDef *def, NafoReadIter *iter ); static gboolean write_data_iter( const NAIFactoryObject *object, NADataBoxed *boxed, NafoWriteIter *iter ); static NADataGroup *v_get_groups( const NAIFactoryObject *object ); static void v_copy( NAIFactoryObject *target, const NAIFactoryObject *source ); static gboolean v_are_equal( const NAIFactoryObject *a, const NAIFactoryObject *b ); static gboolean v_is_valid( const NAIFactoryObject *object ); static void v_read_start( NAIFactoryObject *serializable, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ); static void v_read_done( NAIFactoryObject *serializable, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ); static guint v_write_start( NAIFactoryObject *serializable, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ); static guint v_write_done( NAIFactoryObject *serializable, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ); static void attach_boxed_to_object( NAIFactoryObject *object, NADataBoxed *boxed ); static void free_data_boxed_list( NAIFactoryObject *object ); static void iter_on_data_defs( const NADataGroup *idgroups, guint mode, NADataDefIterFunc pfn, void *user_data ); /* * na_factory_object_define_properties: * @class: the #GObjectClass. * @groups: the list of #NADataGroup structure which define the data of the class. * * Initializes all the properties for the class. */ void na_factory_object_define_properties( GObjectClass *class, const NADataGroup *groups ) { static const gchar *thisfn = "na_factory_object_define_properties"; g_return_if_fail( G_IS_OBJECT_CLASS( class )); g_debug( "%s: class=%p (%s)", thisfn, ( void * ) class, G_OBJECT_CLASS_NAME( class )); /* define class properties */ iter_on_data_defs( groups, DATA_DEF_ITER_SET_PROPERTIES, ( NADataDefIterFunc ) define_class_properties_iter, class ); } static gboolean define_class_properties_iter( const NADataDef *def, GObjectClass *class ) { static const gchar *thisfn = "na_factory_object_define_class_properties_iter"; gboolean stop; GParamSpec *spec; g_debug( "%s: def=%p (%s)", thisfn, ( void * ) def, def->name ); stop = FALSE; spec = na_data_boxed_get_param_spec( def ); if( spec ){ g_object_class_install_property( class, g_quark_from_string( def->name ), spec ); } else { g_warning( "%s: type=%d: unable to get a spec", thisfn, def->type ); } return( stop ); } /* * na_factory_object_get_data_def: * @object: this #NAIFactoryObject object. * @name: the searched name. * * Returns: the #NADataDef structure which describes this @name, or %NULL. */ NADataDef * na_factory_object_get_data_def( const NAIFactoryObject *object, const gchar *name ) { NADataDef *def; g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL ); def = NULL; NADataGroup *groups = v_get_groups( object ); while( groups->group ){ NADataDef *def = groups->def; if( def ){ while( def->name ){ if( !strcmp( def->name, name )){ return( def ); } def++; } } groups++; } return( def ); } /* * na_factory_object_get_data_groups: * @object: the #NAIFactoryObject instance. * * Returns: a pointer to the list of #NADataGroup which define the data. */ NADataGroup * na_factory_object_get_data_groups( const NAIFactoryObject *object ) { NADataGroup *groups; g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL ); groups = v_get_groups( object ); return( groups ); } /* * na_factory_object_iter_on_boxed: * @object: this #NAIFactoryObject object. * @pfn: the function to be called. * @user_data: data to be provided to the user function. * * Iterate on each #NADataBoxed attached to the @object. * * The @fn called function may return %TRUE to stop the iteration. */ void na_factory_object_iter_on_boxed( const NAIFactoryObject *object, NAFactoryObjectIterBoxedFn pfn, void *user_data ) { GList *list, *ibox; gboolean stop; g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); list = g_object_get_data( G_OBJECT( object ), NA_IFACTORY_OBJECT_PROP_DATA ); /*g_debug( "list=%p (count=%u)", ( void * ) list, g_list_length( list ));*/ stop = FALSE; for( ibox = list ; ibox && !stop ; ibox = ibox->next ){ stop = ( *pfn )( object, NA_DATA_BOXED( ibox->data ), user_data ); } } /* * na_factory_object_get_default: * @object: this #NAIFactoryObject object. * @name: the searched name. * * Returns: the default value for this @object, as a newly allocated * string which should be g_free() by the caller. */ gchar * na_factory_object_get_default( NAIFactoryObject *object, const gchar *name ) { static const gchar *thisfn = "na_factory_object_set_defaults"; gchar *value; NADataDef *def; g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL ); value = NULL; g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); def = na_factory_object_get_data_def( object, name ); if( def ){ value = g_strdup( def->default_value ); } return( value ); } /* * na_factory_object_set_defaults: * @object: this #NAIFactoryObject object. * * Implement default values in this new @object. */ void na_factory_object_set_defaults( NAIFactoryObject *object ) { static const gchar *thisfn = "na_factory_object_set_defaults"; NADataGroup *groups; NafoDefaultIter *iter_data; g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); groups = v_get_groups( object ); if( !groups ){ g_warning( "%s: no NADataGroup found for %s", thisfn, G_OBJECT_TYPE_NAME( object )); } else { iter_data = g_new0( NafoDefaultIter, 1 ); iter_data->object = object; iter_on_data_defs( groups, DATA_DEF_ITER_SET_DEFAULTS, ( NADataDefIterFunc ) set_defaults_iter, iter_data ); g_free( iter_data ); } } /* * because this function is called very early in the NAIFactoryObject life, * we assume here that if a NADataBoxed has been allocated, then this is * most probably because it is set. Thus a 'null' value is not considered * as an 'unset' value. */ static gboolean set_defaults_iter( NADataDef *def, NafoDefaultIter *data ) { NADataBoxed *boxed = na_ifactory_object_get_data_boxed( data->object, def->name ); if( !boxed ){ boxed = na_data_boxed_new( def ); attach_boxed_to_object( data->object, boxed ); na_boxed_set_from_string( NA_BOXED( boxed ), def->default_value ); } /* do not stop */ return( FALSE ); } /* * na_factory_object_move_boxed: * @target: the target #NAIFactoryObject instance. * @source: the source #NAIFactoryObject instance. * @boxed: a #NADataBoxed. * * Move the @boxed from @source to @target, detaching from @source list * to be attached to @target one. */ void na_factory_object_move_boxed( NAIFactoryObject *target, const NAIFactoryObject *source, NADataBoxed *boxed ) { g_return_if_fail( NA_IS_IFACTORY_OBJECT( target )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( source )); GList *src_list = g_object_get_data( G_OBJECT( source ), NA_IFACTORY_OBJECT_PROP_DATA ); if( g_list_find( src_list, boxed )){ src_list = g_list_remove( src_list, boxed ); g_object_set_data( G_OBJECT( source ), NA_IFACTORY_OBJECT_PROP_DATA, src_list ); attach_boxed_to_object( target, boxed ); const NADataDef *src_def = na_data_boxed_get_data_def( boxed ); NADataDef *tgt_def = na_factory_object_get_data_def( target, src_def->name ); na_data_boxed_set_data_def( boxed, tgt_def ); } } /* * na_factory_object_copy: * @target: the target #NAIFactoryObject instance. * @source: the source #NAIFactoryObject instance. * * Copies one instance to another. * Takes care of not overriding provider data. */ void na_factory_object_copy( NAIFactoryObject *target, const NAIFactoryObject *source ) { static const gchar *thisfn = "na_factory_object_copy"; GList *dest_list, *idest, *inext; GList *src_list, *isrc; NADataBoxed *boxed; const NADataDef *def; void *provider, *provider_data; g_return_if_fail( NA_IS_IFACTORY_OBJECT( target )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( source )); g_debug( "%s: target=%p (%s), source=%p (%s)", thisfn, ( void * ) target, G_OBJECT_TYPE_NAME( target ), ( void * ) source, G_OBJECT_TYPE_NAME( source )); /* first remove copyable data from target */ provider = na_object_get_provider( target ); provider_data = na_object_get_provider_data( target ); idest = dest_list = g_object_get_data( G_OBJECT( target ), NA_IFACTORY_OBJECT_PROP_DATA ); while( idest ){ boxed = NA_DATA_BOXED( idest->data ); inext = idest->next; def = na_data_boxed_get_data_def( boxed ); if( def->copyable ){ dest_list = g_list_remove_link( dest_list, idest ); g_object_unref( idest->data ); } idest = inext; } g_object_set_data( G_OBJECT( target ), NA_IFACTORY_OBJECT_PROP_DATA, dest_list ); /* only then copy copyable data from source */ src_list = g_object_get_data( G_OBJECT( source ), NA_IFACTORY_OBJECT_PROP_DATA ); for( isrc = src_list ; isrc ; isrc = isrc->next ){ boxed = NA_DATA_BOXED( isrc->data ); def = na_data_boxed_get_data_def( boxed ); if( def->copyable ){ NADataBoxed *tgt_boxed = na_ifactory_object_get_data_boxed( target, def->name ); if( !tgt_boxed ){ tgt_boxed = na_data_boxed_new( def ); attach_boxed_to_object( target, tgt_boxed ); } na_boxed_set_from_boxed( NA_BOXED( tgt_boxed ), NA_BOXED( boxed )); } } if( provider ){ na_object_set_provider( target, provider ); if( provider_data ){ na_object_set_provider_data( target, provider_data ); } } v_copy( target, source ); } /* * na_factory_object_are_equal: * @a: the first (original) #NAIFactoryObject instance. * @b: the second (current) #NAIFactoryObject isntance. * * Returns: %TRUE if @a is equal to @b, %FALSE else. */ gboolean na_factory_object_are_equal( const NAIFactoryObject *a, const NAIFactoryObject *b ) { static const gchar *thisfn = "na_factory_object_are_equal"; gboolean are_equal; GList *a_list, *b_list, *ia, *ib; are_equal = FALSE; a_list = g_object_get_data( G_OBJECT( a ), NA_IFACTORY_OBJECT_PROP_DATA ); b_list = g_object_get_data( G_OBJECT( b ), NA_IFACTORY_OBJECT_PROP_DATA ); g_debug( "%s: a=%p, b=%p", thisfn, ( void * ) a, ( void * ) b ); are_equal = TRUE; for( ia = a_list ; ia && are_equal ; ia = ia->next ){ NADataBoxed *a_boxed = NA_DATA_BOXED( ia->data ); const NADataDef *a_def = na_data_boxed_get_data_def( a_boxed ); if( a_def->comparable ){ NADataBoxed *b_boxed = na_ifactory_object_get_data_boxed( b, a_def->name ); if( b_boxed ){ are_equal = na_boxed_are_equal( NA_BOXED( a_boxed ), NA_BOXED( b_boxed )); if( !are_equal ){ g_debug( "%s: %s not equal as %s different", thisfn, G_OBJECT_TYPE_NAME( a ), a_def->name ); } } else { are_equal = FALSE; g_debug( "%s: %s not equal as %s has disappeared", thisfn, G_OBJECT_TYPE_NAME( a ), a_def->name ); } } } for( ib = b_list ; ib && are_equal ; ib = ib->next ){ NADataBoxed *b_boxed = NA_DATA_BOXED( ib->data ); const NADataDef *b_def = na_data_boxed_get_data_def( b_boxed ); if( b_def->comparable ){ NADataBoxed *a_boxed = na_ifactory_object_get_data_boxed( a, b_def->name ); if( !a_boxed ){ are_equal = FALSE; g_debug( "%s: %s not equal as %s was not set", thisfn, G_OBJECT_TYPE_NAME( a ), b_def->name ); } } } are_equal &= v_are_equal( a, b ); return( are_equal ); } /* * na_factory_object_is_valid: * @object: the #NAIFactoryObject instance whose validity is to be checked. * * Returns: %TRUE if @object is valid, %FALSE else. */ gboolean na_factory_object_is_valid( const NAIFactoryObject *object ) { static const gchar *thisfn = "na_factory_object_is_valid"; gboolean is_valid; NADataGroup *groups; GList *list, *iv; g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), FALSE ); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); list = g_object_get_data( G_OBJECT( object ), NA_IFACTORY_OBJECT_PROP_DATA ); is_valid = TRUE; /* mandatory data must be set */ NafoValidIter iter_data; iter_data.object = ( NAIFactoryObject * ) object; iter_data.is_valid = TRUE; groups = v_get_groups( object ); if( groups ){ iter_on_data_defs( groups, DATA_DEF_ITER_IS_VALID, ( NADataDefIterFunc ) is_valid_mandatory_iter, &iter_data ); } is_valid = iter_data.is_valid; for( iv = list ; iv && is_valid ; iv = iv->next ){ is_valid = na_data_boxed_is_valid( NA_DATA_BOXED( iv->data )); } is_valid &= v_is_valid( object ); return( is_valid ); } static gboolean is_valid_mandatory_iter( const NADataDef *def, NafoValidIter *data ) { NADataBoxed *boxed; if( def->mandatory ){ boxed = na_ifactory_object_get_data_boxed( data->object, def->name ); if( !boxed ){ g_debug( "na_factory_object_is_valid_mandatory_iter: invalid %s: mandatory but not set", def->name ); data->is_valid = FALSE; } } /* do not stop iteration while valid */ return( !data->is_valid ); } /* * na_factory_object_dump: * @object: this #NAIFactoryObject instance. * * Dumps the content of @object. */ void na_factory_object_dump( const NAIFactoryObject *object ) { static const gchar *thisfn = "na_factory_object_dump"; static const gchar *prefix = "na-factory-data-"; GList *list, *it; guint length; guint l_prefix; length = 0; l_prefix = strlen( prefix ); list = g_object_get_data( G_OBJECT( object ), NA_IFACTORY_OBJECT_PROP_DATA ); for( it = list ; it ; it = it->next ){ NADataBoxed *boxed = NA_DATA_BOXED( it->data ); const NADataDef *def = na_data_boxed_get_data_def( boxed ); length = MAX( length, strlen( def->name )); } length -= l_prefix; length += 1; for( it = list ; it ; it = it->next ){ NADataBoxed *boxed = NA_DATA_BOXED( it->data ); const NADataDef *def = na_data_boxed_get_data_def( boxed ); gchar *value = na_boxed_get_string( NA_BOXED( boxed )); g_debug( "| %s: %*s=%s", thisfn, length, def->name+l_prefix, value ); g_free( value ); } } /* * na_factory_object_finalize: * @object: the #NAIFactoryObject being finalized. * * Clears all data associated with this @object. */ void na_factory_object_finalize( NAIFactoryObject *object ) { free_data_boxed_list( object ); } /* * na_factory_object_read_item: * @object: this #NAIFactoryObject instance. * @reader: the #NAIFactoryProvider which is at the origin of this read. * @reader_data: reader data. * @messages: a pointer to a #GSList list of strings; the implementation * may append messages to this list, but shouldn't reinitialize it. * * Unserializes the object. */ void na_factory_object_read_item( NAIFactoryObject *object, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ) { static const gchar *thisfn = "na_factory_object_read_item"; g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); g_return_if_fail( NA_IS_IFACTORY_PROVIDER( reader )); NADataGroup *groups = v_get_groups( object ); if( groups ){ v_read_start( object, reader, reader_data, messages ); NafoReadIter *iter = g_new0( NafoReadIter, 1 ); iter->object = object; iter->reader = ( NAIFactoryProvider * ) reader; iter->reader_data = reader_data; iter->messages = messages; iter_on_data_defs( groups, DATA_DEF_ITER_READ_ITEM, ( NADataDefIterFunc ) read_data_iter, iter ); g_free( iter ); v_read_done( object, reader, reader_data, messages ); } else { g_warning( "%s: class %s doesn't return any NADataGroup structure", thisfn, G_OBJECT_TYPE_NAME( object )); } } static gboolean read_data_iter( NADataDef *def, NafoReadIter *iter ) { gboolean stop; stop = FALSE; NADataBoxed *boxed = na_factory_provider_read_data( iter->reader, iter->reader_data, iter->object, def, iter->messages ); if( boxed ){ NADataBoxed *exist = na_ifactory_object_get_data_boxed( iter->object, def->name ); if( exist ){ na_boxed_set_from_boxed( NA_BOXED( exist ), NA_BOXED( boxed )); g_object_unref( boxed ); } else { attach_boxed_to_object( iter->object, boxed ); } } return( stop ); } /* * na_factory_object_write_item: * @object: this #NAIFactoryObject instance. * @writer: the #NAIFactoryProvider which is at the origin of this write. * @writer_data: writer data. * @messages: a pointer to a #GSList list of strings; the implementation * may append messages to this list, but shouldn't reinitialize it. * * Serializes the object down to the @writer. * * Returns: a NAIIOProvider operation return code. */ guint na_factory_object_write_item( NAIFactoryObject *object, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ) { static const gchar *thisfn = "na_factory_object_write_item"; guint code; NADataGroup *groups; gchar *msg; g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); g_return_val_if_fail( NA_IS_IFACTORY_PROVIDER( writer ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); code = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; groups = v_get_groups( object ); if( groups ){ code = v_write_start( object, writer, writer_data, messages ); } else { msg = g_strdup_printf( "%s: class %s doesn't return any NADataGroup structure", thisfn, G_OBJECT_TYPE_NAME( object )); g_warning( "%s", msg ); *messages = g_slist_append( *messages, msg ); } if( code == NA_IIO_PROVIDER_CODE_OK ){ NafoWriteIter *iter = g_new0( NafoWriteIter, 1 ); iter->writer = ( NAIFactoryProvider * ) writer; iter->writer_data = writer_data; iter->messages = messages; iter->code = code; na_factory_object_iter_on_boxed( object, ( NAFactoryObjectIterBoxedFn ) write_data_iter, iter ); code = iter->code; g_free( iter ); } if( code == NA_IIO_PROVIDER_CODE_OK ){ code = v_write_done( object, writer, writer_data, messages ); } return( code ); } static gboolean write_data_iter( const NAIFactoryObject *object, NADataBoxed *boxed, NafoWriteIter *iter ) { const NADataDef *def = na_data_boxed_get_data_def( boxed ); if( def->writable ){ iter->code = na_factory_provider_write_data( iter->writer, iter->writer_data, object, boxed, iter->messages ); } /* iter while code is ok */ return( iter->code != NA_IIO_PROVIDER_CODE_OK ); } /* * na_factory_object_get_as_value: * @object: this #NAIFactoryObject instance. * @name: the elementary data id. * @value: the #GValue to be set. * * Set the @value with the current content of the #NADataBoxed attached * to @name. * * This is to be read as "set value from data element". */ void na_factory_object_get_as_value( const NAIFactoryObject *object, const gchar *name, GValue *value ) { NADataBoxed *boxed; g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); g_value_unset( value ); boxed = na_ifactory_object_get_data_boxed( object, name ); if( boxed ){ na_boxed_get_as_value( NA_BOXED( boxed ), value ); } } /* * na_factory_object_get_as_void: * @object: this #NAIFactoryObject instance. * @name: the elementary data whose value is to be got. * * Returns: the searched value. * * If the type of the value is NA_DATA_TYPE_STRING or NA_DATA_TYPE_LOCALE_STRING * (resp. NA_DATA_TYPE_STRING_LIST), then the returned value is a newly allocated * string (resp. GSList) and should be g_free() (resp. na_core_utils_slist_free()) * by the caller. */ void * na_factory_object_get_as_void( const NAIFactoryObject *object, const gchar *name ) { void *value; NADataBoxed *boxed; g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL ); value = NULL; boxed = na_ifactory_object_get_data_boxed( object, name ); if( boxed ){ value = na_boxed_get_as_void( NA_BOXED( boxed )); } return( value ); } /* * na_factory_object_is_set: * @object: this #NAIFactoryObject instance. * @name: the elementary data whose value is to be tested. * * Returns: %TRUE if the value is set (may be %NULL), %FALSE else. */ gboolean na_factory_object_is_set( const NAIFactoryObject *object, const gchar *name ) { NADataBoxed *boxed; g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), FALSE ); boxed = na_ifactory_object_get_data_boxed( object, name ); return( boxed != NULL ); } /* * na_factory_object_set_from_value: * @object: this #NAIFactoryObject instance. * @name: the elementary data id. * @value: the #GValue whose content is to be got. * * Get from the @value the content to be set in the #NADataBoxed * attached to @property_id. */ void na_factory_object_set_from_value( NAIFactoryObject *object, const gchar *name, const GValue *value ) { static const gchar *thisfn = "na_factory_object_set_from_value"; g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); NADataBoxed *boxed = na_ifactory_object_get_data_boxed( object, name ); if( boxed ){ na_boxed_set_from_value( NA_BOXED( boxed ), value ); } else { NADataDef *def = na_factory_object_get_data_def( object, name ); if( !def ){ g_warning( "%s: unknown NADataDef %s", thisfn, name ); } else { boxed = na_data_boxed_new( def ); na_boxed_set_from_value( NA_BOXED( boxed ), value ); attach_boxed_to_object( object, boxed ); } } } /* * na_factory_object_set_from_void: * @object: this #NAIFactoryObject instance. * @name: the elementary data whose value is to be set. * @data: the value to set. * * Set the elementary data with the given value. */ void na_factory_object_set_from_void( NAIFactoryObject *object, const gchar *name, const void *data ) { static const gchar *thisfn = "na_factory_object_set_from_void"; g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); NADataBoxed *boxed = na_ifactory_object_get_data_boxed( object, name ); if( boxed ){ na_boxed_set_from_void( NA_BOXED( boxed ), data ); } else { NADataDef *def = na_factory_object_get_data_def( object, name ); if( !def ){ g_warning( "%s: unknown NADataDef %s for %s", thisfn, name, G_OBJECT_TYPE_NAME( object )); } else { boxed = na_data_boxed_new( def ); na_boxed_set_from_void( NA_BOXED( boxed ), data ); attach_boxed_to_object( object, boxed ); } } } static NADataGroup * v_get_groups( const NAIFactoryObject *object ) { if( NA_IFACTORY_OBJECT_GET_INTERFACE( object )->get_groups ){ return( NA_IFACTORY_OBJECT_GET_INTERFACE( object )->get_groups( object )); } return( NULL ); } static void v_copy( NAIFactoryObject *target, const NAIFactoryObject *source ) { if( NA_IFACTORY_OBJECT_GET_INTERFACE( target )->copy ){ NA_IFACTORY_OBJECT_GET_INTERFACE( target )->copy( target, source ); } } static gboolean v_are_equal( const NAIFactoryObject *a, const NAIFactoryObject *b ) { if( NA_IFACTORY_OBJECT_GET_INTERFACE( a )->are_equal ){ return( NA_IFACTORY_OBJECT_GET_INTERFACE( a )->are_equal( a, b )); } return( TRUE ); } static gboolean v_is_valid( const NAIFactoryObject *object ) { if( NA_IFACTORY_OBJECT_GET_INTERFACE( object )->is_valid ){ return( NA_IFACTORY_OBJECT_GET_INTERFACE( object )->is_valid( object )); } return( TRUE ); } static void v_read_start( NAIFactoryObject *serializable, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ) { if( NA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->read_start ){ NA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->read_start( serializable, reader, reader_data, messages ); } } static void v_read_done( NAIFactoryObject *serializable, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ) { if( NA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->read_done ){ NA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->read_done( serializable, reader, reader_data, messages ); } } static guint v_write_start( NAIFactoryObject *serializable, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ) { guint code = NA_IIO_PROVIDER_CODE_OK; if( NA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->write_start ){ code = NA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->write_start( serializable, writer, writer_data, messages ); } return( code ); } static guint v_write_done( NAIFactoryObject *serializable, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ) { guint code = NA_IIO_PROVIDER_CODE_OK; if( NA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->write_done ){ code = NA_IFACTORY_OBJECT_GET_INTERFACE( serializable )->write_done( serializable, writer, writer_data, messages ); } return( code ); } static void attach_boxed_to_object( NAIFactoryObject *object, NADataBoxed *boxed ) { GList *list = g_object_get_data( G_OBJECT( object ), NA_IFACTORY_OBJECT_PROP_DATA ); list = g_list_prepend( list, boxed ); g_object_set_data( G_OBJECT( object ), NA_IFACTORY_OBJECT_PROP_DATA, list ); } static void free_data_boxed_list( NAIFactoryObject *object ) { GList *list; list = g_object_get_data( G_OBJECT( object ), NA_IFACTORY_OBJECT_PROP_DATA ); g_list_foreach( list, ( GFunc ) g_object_unref, NULL ); g_list_free( list ); g_object_set_data( G_OBJECT( object ), NA_IFACTORY_OBJECT_PROP_DATA, NULL ); } /* * the iter function must return TRUE to stops the enumeration */ static void iter_on_data_defs( const NADataGroup *groups, guint mode, NADataDefIterFunc pfn, void *user_data ) { static const gchar *thisfn = "na_factory_object_iter_on_data_defs"; NADataDef *def; gboolean stop; stop = FALSE; while( groups->group && !stop ){ if( groups->def ){ def = groups->def; while( def->name && !stop ){ /*g_debug( "serializable_only=%s, def->serializable=%s", serializable_only ? "True":"False", def->serializable ? "True":"False" );*/ switch( mode ){ case DATA_DEF_ITER_SET_PROPERTIES: if( def->has_property ){ stop = ( *pfn )( def, user_data ); } break; case DATA_DEF_ITER_SET_DEFAULTS: if( def->default_value ){ stop = ( *pfn )( def, user_data ); } break; case DATA_DEF_ITER_IS_VALID: stop = ( *pfn )( def, user_data ); break; case DATA_DEF_ITER_READ_ITEM: if( def->readable ){ stop = ( *pfn )( def, user_data ); } break; default: g_warning( "%s: unknown mode=%d", thisfn, mode ); } def++; } } groups++; } } nautilus-actions-3.2.3/src/core/na-ioptions-list.h0000644000175100017500000002140112212601376017042 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_IOPTIONS_LIST_H__ #define __CORE_NA_IOPTIONS_LIST_H__ /* * SECTION: ioptions_list * @title: NAIOptionsList * @short_description: The OptionsList Interface v 1 * @include: core/na-ioptions-list.h * * The #NAIOptionsList interface is to be used when we have one option to choose * among several. The interface takes care of: * * * * displaying the items, either as a radio button group or as a tree view, * inside of a parent container; * * * maybe displaying a tooltip and/or a pixbuf for each option; * * * maybe adding an 'Ask me' option; * * * setting a default option, identified by its identifier, which can * be anything resolvable to a #gpointer value; * * * returning the selected option as a #gpointer value; * * * freeing the allocated resources at end. * * * * * In order this interface to work, each option has to be seen as a #GObject * -derived object, which itself should implement the #NAIOption companion * interface. * * Note that the instance which implements this interface is able to provide * several list of values. This is the reason why each list of values is * identified by its container inside of the window's instance. * * Instance initialization * * Rather that having to call a na_ioptions_list_instance_init() on each * instance implementation, we prefer to check when entering in each public * method for an 'initialized' flag both at the instance level and at the * container level. * * Alternative might be be to have the na_ioptions_list_instance_init() * initialization interface method, which itself connect to #BaseWindow * signals. But this would not prevent of initializing for both managed * containers... * * Initialization mainly consists of defining weak references both on * instance and on containers levels. * * * Versions historic * * Historic of the versions of the #NAIOptionsList interface * * * * * * * &prodname; version * #NAIOptionsList interface version * * * * * * since 3.2 * 1 * current version * * * *
*
*/ #include #include "na-ioption.h" G_BEGIN_DECLS #define NA_TYPE_IOPTIONS_LIST ( na_ioptions_list_get_type()) #define NA_IOPTIONS_LIST( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_TYPE_IOPTIONS_LIST, NAIOptionsList )) #define NA_IS_IOPTIONS_LIST( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NA_TYPE_IOPTIONS_LIST )) #define NA_IOPTIONS_LIST_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_TYPE_IOPTIONS_LIST, NAIOptionsListInterface )) typedef struct _NAIOptionsList NAIOptionsList; typedef struct _NAIOptionsListInterfacePrivate NAIOptionsListInterfacePrivate; typedef struct _NAIOptionsListImportFromUriParms NAIOptionsListImportFromUriParms; typedef struct _NAIOptionsListManageImportModeParms NAIOptionsListManageImportModeParms; /* * NAIOptionsListInterface: * @get_version: returns the version of this interface that the * instance implements. * @get_options: returns the list of #NAIOption. * @free_options: releases the list of #NAIOption. * @get_ask_option: returns the 'Ask me' #NAIOption. * @free_ask_option: releases the 'Ask me' #NAIOption. * * This defines the interface that a #NAIOptionsList implementation should provide. */ typedef struct { /*< private >*/ GTypeInterface parent; NAIOptionsListInterfacePrivate *private; /*< public >*/ /* * get_version: * @instance: the #NAIOptionsList instance of the implementation. * * This method is supposed to let know to any caller which version of this * interface the implementation provides. This may be useful when this * interface will itself be upgraded. * * If this method is not provided by the implementation, one should suppose * that the implemented version is at last the version 1. * * Returns: the version of this interface provided by the implementation. * * Since: 3.2 */ guint ( *get_version ) ( const NAIOptionsList *instance ); /* * get_options: * @instance: the #NAIOptionsList instance of the implementation. * @container: the #GtkWidget which embeds the list of values. * * This method may be called at more or less early stage of the build * of the display, either rather early when displaying a radio button * group, or later in the case of a tree view. * * Returns: a #GList list of #NAIOptions object instances. * * Since: 3.2 */ GList * ( *get_options ) ( const NAIOptionsList *instance, GtkWidget *container ); /* * free_options: * @instance: the #NAIOptionsList instance of the implementation. * @container: the #GtkWidget which embeds the list of values. * @options: a #GList of #NAIoption objects as returned by get_options() method. * * Release the resources allocated to the @options list. * * Note that the interface defaults to just g_object_unref() each * instance of the @options list, the g_list_free() the list itself. * So if your implementation may satisfy itself with this default, you * just do not need to implement the method. * * Since: 3.2 */ void ( *free_options )( const NAIOptionsList *instance, GtkWidget *container, GList *options ); /* * get_ask_option: * @instance: the #NAIOptionsList instance of the implementation. * @container: the #GtkWidget which embeds the list of values. * * Ask the implementation to provide a #NAIOption which defines the * 'Ask me' option. * * Returns: a #NAIOption which defines the 'Ask me' option. * * Since: 3.2 */ NAIOption * ( *get_ask_option ) ( const NAIOptionsList *instance, GtkWidget *container ); /* * free_ask_option: * @instance: the #NAIOptionsList instance of the implementation. * @container: the #GtkWidget which embeds the list of values. * @ask_option: the #NAIoption to be released. * * Release the resources allocated to the @ask_option instance. * * Note that the interface defaults to just g_object_unref() the object. * So if your implementation may satisfy itself with this default, you just * do not need to implement the method. * * Since: 3.2 */ void ( *free_ask_option )( const NAIOptionsList *instance, GtkWidget *container, NAIOption *ask_option ); } NAIOptionsListInterface; GType na_ioptions_list_get_type( void ); void na_ioptions_list_gtk_init ( const NAIOptionsList *instance, GtkWidget *container, gboolean with_ask ); void na_ioptions_list_set_default ( const NAIOptionsList *instance, GtkWidget *container, const gchar *default_id ); void na_ioptions_list_set_editable ( const NAIOptionsList *instance, GtkWidget *container, gboolean editable ); void na_ioptions_list_set_sensitive( const NAIOptionsList *instance, GtkWidget *container, gboolean sensitive ); NAIOption *na_ioptions_list_get_selected ( const NAIOptionsList *instance, GtkWidget *container ); G_END_DECLS #endif /* __CORE_NA_IOPTIONS_LIST_H__ */ nautilus-actions-3.2.3/src/core/na-settings.c0000644000175100017500000013042512212601376016067 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "na-settings.h" #include "na-marshal.h" #define NA_SETTINGS_TYPE ( settings_get_type()) #define NA_SETTINGS( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_SETTINGS_TYPE, NASettings )) #define NA_SETTINGS_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_SETTINGS_TYPE, NASettingsClass )) #define NA_IS_SETTINGS( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_SETTINGS_TYPE )) #define NA_IS_SETTINGS_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_SETTINGS_TYPE )) #define NA_SETTINGS_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_SETTINGS_TYPE, NASettingsClass )) typedef struct _NASettingsPrivate NASettingsPrivate; typedef struct { /*< private >*/ GObject parent; NASettingsPrivate *private; } NASettings; typedef struct _NASettingsClassPrivate NASettingsClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NASettingsClassPrivate *private; } NASettingsClass; /* private class data */ struct _NASettingsClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* The characteristics of a configuration file. * We manage two configuration files: * - the global configuration file handles mandatory preferences; * - the user configuration file handles.. well, user preferences. */ typedef struct { gchar *fname; gboolean mandatory; GKeyFile *key_file; GFileMonitor *monitor; gulong handler; } KeyFile; /* Each consumer may register a callback function which will be triggered * when a key is modified. * * The monitored key usually is the real key read in the file; * as a special case, composite keys are defined: * - NA_IPREFS_IO_PROVIDERS_READ_STATUS monitors the 'readable' key for all i/o providers * * Note that we actually monitor the _user_view_ of the configuration: * e.g. if a key has a mandatory value in global conf, then the same * key in user conf will just be ignored. */ typedef struct { gchar *monitored_key; GCallback callback; gpointer user_data; } Consumer; /* private instance data */ struct _NASettingsPrivate { gboolean dispose_has_run; KeyFile *mandatory; KeyFile *user; GList *content; GList *consumers; NATimeout timeout; }; #define GROUP_NACT "nact" #define GROUP_RUNTIME "runtime" typedef struct { const gchar *key; const gchar *group; guint type; const gchar *default_value; } KeyDef; static const KeyDef st_def_keys[] = { { NA_IPREFS_ADMIN_PREFERENCES_LOCKED, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "false" }, { NA_IPREFS_ADMIN_IO_PROVIDERS_LOCKED, GROUP_RUNTIME, NA_DATA_TYPE_BOOLEAN, "false" }, { NA_IPREFS_ASSISTANT_ESC_CONFIRM, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "true" }, { NA_IPREFS_ASSISTANT_ESC_QUIT, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "true" }, { NA_IPREFS_CAPABILITY_ADD_CAPABILITY_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_COMMAND_CHOOSER_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_COMMAND_CHOOSER_URI, GROUP_NACT, NA_DATA_TYPE_STRING, "file:///bin" }, { NA_IPREFS_COMMAND_LEGEND_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_CONFIRM_LOGOUT_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_DESKTOP_ENVIRONMENT, GROUP_RUNTIME, NA_DATA_TYPE_STRING, "" }, { NA_IPREFS_WORKING_DIR_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_WORKING_DIR_URI, GROUP_NACT, NA_DATA_TYPE_STRING, "file:///" }, { NA_IPREFS_SHOW_IF_RUNNING_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_SHOW_IF_RUNNING_URI, GROUP_NACT, NA_DATA_TYPE_STRING, "file:///bin" }, { NA_IPREFS_TRY_EXEC_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_TRY_EXEC_URI, GROUP_NACT, NA_DATA_TYPE_STRING, "file:///bin" }, { NA_IPREFS_EXPORT_ASK_USER_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_EXPORT_ASK_USER_LAST_FORMAT, GROUP_NACT, NA_DATA_TYPE_STRING, "Desktop1" }, { NA_IPREFS_EXPORT_ASK_USER_KEEP_LAST_CHOICE, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "false" }, { NA_IPREFS_EXPORT_ASSISTANT_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_EXPORT_ASSISTANT_URI, GROUP_NACT, NA_DATA_TYPE_STRING, "file:///tmp" }, { NA_IPREFS_EXPORT_ASSISTANT_PANED, GROUP_NACT, NA_DATA_TYPE_UINT, "200" }, { NA_IPREFS_EXPORT_PREFERRED_FORMAT, GROUP_NACT, NA_DATA_TYPE_STRING, "Ask" }, { NA_IPREFS_FOLDER_CHOOSER_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_FOLDER_CHOOSER_URI, GROUP_NACT, NA_DATA_TYPE_STRING, "file:///" }, { NA_IPREFS_IMPORT_ASK_USER_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_IMPORT_ASK_USER_LAST_MODE, GROUP_NACT, NA_DATA_TYPE_STRING, "NoImport" }, { NA_IPREFS_IMPORT_ASSISTANT_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_IMPORT_ASSISTANT_URI, GROUP_NACT, NA_DATA_TYPE_STRING, "file:///tmp" }, { NA_IPREFS_IMPORT_ASK_USER_KEEP_LAST_CHOICE, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "false" }, { NA_IPREFS_IMPORT_PREFERRED_MODE, GROUP_NACT, NA_DATA_TYPE_STRING, "Ask" }, { NA_IPREFS_IO_PROVIDERS_WRITE_ORDER, GROUP_NACT, NA_DATA_TYPE_STRING_LIST, "" }, { NA_IPREFS_ICON_CHOOSER_URI, GROUP_NACT, NA_DATA_TYPE_STRING, "file:///" }, { NA_IPREFS_ICON_CHOOSER_PANED, GROUP_NACT, NA_DATA_TYPE_UINT, "200" }, { NA_IPREFS_ICON_CHOOSER_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_ITEMS_ADD_ABOUT_ITEM, GROUP_RUNTIME, NA_DATA_TYPE_BOOLEAN, "true" }, { NA_IPREFS_ITEMS_CREATE_ROOT_MENU, GROUP_RUNTIME, NA_DATA_TYPE_BOOLEAN, "true" }, { NA_IPREFS_ITEMS_LEVEL_ZERO_ORDER, GROUP_RUNTIME, NA_DATA_TYPE_STRING_LIST, "" }, { NA_IPREFS_ITEMS_LIST_ORDER_MODE, GROUP_RUNTIME, NA_DATA_TYPE_STRING, "AscendingOrder" }, { NA_IPREFS_MAIN_PANED, GROUP_NACT, NA_DATA_TYPE_UINT, "200" }, { NA_IPREFS_MAIN_SAVE_AUTO, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "false" }, { NA_IPREFS_MAIN_SAVE_PERIOD, GROUP_NACT, NA_DATA_TYPE_UINT, "5" }, { NA_IPREFS_MAIN_TABS_POS, GROUP_NACT, NA_DATA_TYPE_STRING, "Top" }, { NA_IPREFS_MAIN_TOOLBAR_EDIT_DISPLAY, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "true" }, { NA_IPREFS_MAIN_TOOLBAR_FILE_DISPLAY, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "true" }, { NA_IPREFS_MAIN_TOOLBAR_HELP_DISPLAY, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "true" }, { NA_IPREFS_MAIN_TOOLBAR_TOOLS_DISPLAY, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "false" }, { NA_IPREFS_MAIN_WINDOW_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_PREFERENCES_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_PLUGIN_MENU_LOG, GROUP_RUNTIME, NA_DATA_TYPE_BOOLEAN, "false" }, { NA_IPREFS_RELABEL_DUPLICATE_ACTION, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "false" }, { NA_IPREFS_RELABEL_DUPLICATE_MENU, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "false" }, { NA_IPREFS_RELABEL_DUPLICATE_PROFILE, GROUP_NACT, NA_DATA_TYPE_BOOLEAN, "false" }, { NA_IPREFS_SCHEME_ADD_SCHEME_WSP, GROUP_NACT, NA_DATA_TYPE_UINT_LIST, "" }, { NA_IPREFS_SCHEME_DEFAULT_LIST, GROUP_NACT, NA_DATA_TYPE_STRING_LIST, "" }, { NA_IPREFS_TERMINAL_PATTERN, GROUP_RUNTIME, NA_DATA_TYPE_STRING, "" }, { NA_IPREFS_IO_PROVIDER_READABLE, NA_IPREFS_IO_PROVIDER_GROUP, NA_DATA_TYPE_BOOLEAN, "true" }, { NA_IPREFS_IO_PROVIDER_WRITABLE, NA_IPREFS_IO_PROVIDER_GROUP, NA_DATA_TYPE_BOOLEAN, "true" }, { 0 } }; /* The configuration content is handled as a GList of KeyValue structs. * This list is loaded at initialization time, and then compared each * time our file monitors signal us that a change has occured. */ typedef struct { const KeyDef *def; const gchar *group; gboolean mandatory; NABoxed *boxed; } KeyValue; /* signals */ enum { KEY_CHANGED, LAST_SIGNAL }; static GObjectClass *st_parent_class = NULL; static gint st_burst_timeout = 100; /* burst timeout in msec */ static gint st_signals[ LAST_SIGNAL ] = { 0 }; static NASettings *st_settings = NULL; static GType settings_get_type( void ); static GType register_type( void ); static void class_init( NASettingsClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void settings_new( void ); static GList *content_diff( GList *old, GList *new ); static GList *content_load_keys( GList *content, KeyFile *keyfile ); static KeyDef *get_key_def( const gchar *key ); static KeyFile *key_file_new( const gchar *dir ); static void on_keyfile_changed( GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type ); static void on_keyfile_changed_timeout( void ); static void on_key_changed_final_handler( NASettings *settings, gchar *group, gchar *key, NABoxed *new_value, gboolean mandatory ); static KeyValue *peek_key_value_from_content( GList *content, const gchar *group, const gchar *key ); static KeyValue *read_key_value( const gchar *group, const gchar *key, gboolean *found, gboolean *mandatory ); static KeyValue *read_key_value_from_key_file( KeyFile *keyfile, const gchar *group, const gchar *key, const KeyDef *key_def ); static void release_consumer( Consumer *consumer ); static void release_key_file( KeyFile *key_file ); static void release_key_value( KeyValue *value ); static gboolean set_key_value( const gchar *group, const gchar *key, const gchar *string ); static gboolean write_user_key_file( void ); static GType settings_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_settings_register_type"; GType type; static GTypeInfo info = { sizeof( NASettingsClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NASettings ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NASettings", &info, 0 ); return( type ); } static void class_init( NASettingsClass *klass ) { static const gchar *thisfn = "na_settings_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NASettingsClassPrivate, 1 ); /* * NASettings::settings-key-changed: * * This signal is sent by NASettings when the value of a key is modified. * * Arguments are the group, the key, the new value as a NABoxed, * and whether it is mandatory. * * Handler is of type: * void ( *handler )( NASettings *settings, * const gchar *group, * const gchar *key, * NABoxed *value, * gboolean mandatory, * gpointer user_data ); * * The default class handler frees these datas. */ st_signals[ KEY_CHANGED ] = g_signal_new_class_handler( SETTINGS_SIGNAL_KEY_CHANGED, NA_SETTINGS_TYPE, G_SIGNAL_RUN_CLEANUP | G_SIGNAL_ACTION, G_CALLBACK( on_key_changed_final_handler ), NULL, /* accumulator */ NULL, /* accumulator data */ na_cclosure_marshal_VOID__STRING_STRING_POINTER_BOOLEAN, G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_settings_instance_init"; NASettings *self; g_return_if_fail( NA_IS_SETTINGS( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_SETTINGS( instance ); self->private = g_new0( NASettingsPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->mandatory = NULL; self->private->user = NULL; self->private->content = NULL; self->private->consumers = NULL; self->private->timeout.timeout = st_burst_timeout; self->private->timeout.handler = ( NATimeoutFunc ) on_keyfile_changed_timeout; self->private->timeout.user_data = NULL; self->private->timeout.source_id = 0; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_settings_instance_dispose"; NASettings *self; g_return_if_fail( NA_IS_SETTINGS( object )); self = NA_SETTINGS( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; release_key_file( self->private->mandatory ); release_key_file( self->private->user ); if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_settings_instance_finalize"; NASettings *self; g_return_if_fail( NA_IS_SETTINGS( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NA_SETTINGS( object ); g_list_foreach( self->private->content, ( GFunc ) release_key_value, NULL ); g_list_free( self->private->content ); g_list_foreach( self->private->consumers, ( GFunc ) release_consumer, NULL ); g_list_free( self->private->consumers ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /** * na_settings_new: * * Allocates a new #NASettings object which should be na_settings_free() * by the caller. */ static void settings_new( void ) { static const gchar *thisfn = "na_settings_new"; gchar *dir; GList *content; if( !st_settings ){ st_settings = g_object_new( NA_SETTINGS_TYPE, NULL ); g_debug( "%s: reading mandatory configuration", thisfn ); dir = g_build_filename( SYSCONFDIR, "xdg", PACKAGE, NULL ); st_settings->private->mandatory = key_file_new( dir ); g_free( dir ); st_settings->private->mandatory->mandatory = TRUE; content = content_load_keys( NULL, st_settings->private->mandatory ); g_debug( "%s: reading user configuration", thisfn ); dir = g_build_filename( g_get_home_dir(), ".config", PACKAGE, NULL ); g_mkdir_with_parents( dir, 0750 ); st_settings->private->user = key_file_new( dir ); g_free( dir ); st_settings->private->mandatory->mandatory = FALSE; content = content_load_keys( content, st_settings->private->user ); st_settings->private->content = g_list_copy( content ); g_list_free( content ); } } /** * na_settings_free: */ void na_settings_free( void ) { if( st_settings ){ g_object_unref( st_settings ); st_settings = NULL; } } /** * na_settings_register_key_callback: * @key: the key to be monitored. * @callback: the function to be called when the value of the key changes. * @user_data: data to be passed to the @callback function. * * Registers a new consumer of the monitoring of the @key. * * Since: 3.1 */ void na_settings_register_key_callback( const gchar *key, GCallback callback, gpointer user_data ) { static const gchar *thisfn = "na_settings_register_key_callback"; g_debug( "%s: key=%s, callback=%p, user_data=%p", thisfn, key, ( void * ) callback, ( void * ) user_data ); Consumer *consumer = g_new0( Consumer, 1 ); consumer->monitored_key = g_strdup( key ); consumer->callback = callback; consumer->user_data = user_data; settings_new(); st_settings->private->consumers = g_list_prepend( st_settings->private->consumers, consumer ); } /** * na_settings_get_boolean: * @key: the key whose value is to be returned. * @found: if not %NULL, a pointer to a gboolean in which we will store * whether the searched @key has been found (%TRUE), or if the returned * value comes from default (%FALSE). * @mandatory: if not %NULL, a pointer to a gboolean in which we will store * whether the returned value has been read from mandatory preferences * (%TRUE), or from the user preferences (%FALSE). When the @key has not * been found, @mandatory is set to %FALSE. * * This function should only be called for unambiguous keys; the resultat * is otherwise undefined (and rather unpredictable). * * Returns: the value of the key, of its default value if not found. * * Since: 3.1 */ gboolean na_settings_get_boolean( const gchar *key, gboolean *found, gboolean *mandatory ) { return( na_settings_get_boolean_ex( NULL, key, found, mandatory )); } /** * na_settings_get_boolean_ex: * @group: the group where the @key is to be searched for. May be %NULL. * @key: the key whose value is to be returned. * @found: if not %NULL, a pointer to a gboolean in which we will store * whether the searched @key has been found (%TRUE), or if the returned * value comes from default (%FALSE). * @mandatory: if not %NULL, a pointer to a gboolean in which we will store * whether the returned value has been read from mandatory preferences * (%TRUE), or from the user preferences (%FALSE). When the @key has not * been found, @mandatory is set to %FALSE. * * Returns: the value of the key, of its default value if not found. * * Since: 3.1 */ gboolean na_settings_get_boolean_ex( const gchar *group, const gchar *key, gboolean *found, gboolean *mandatory ) { gboolean value; KeyValue *key_value; KeyDef *key_def; value = FALSE; key_value = read_key_value( group, key, found, mandatory ); if( key_value ){ value = na_boxed_get_boolean( key_value->boxed ); release_key_value( key_value ); } else { key_def = get_key_def( key ); if( key_def ){ value = ( key_def->default_value ? ( strcasecmp( key_def->default_value, "true" ) == 0 || atoi( key_def->default_value ) != 0 ) : FALSE ); } } return( value ); } /** * na_settings_get_string: * @key: the key whose value is to be returned. * @found: if not %NULL, a pointer to a gboolean in which we will store * whether the searched @key has been found (%TRUE), or if the returned * value comes from default (%FALSE). * @mandatory: if not %NULL, a pointer to a gboolean in which we will store * whether the returned value has been read from mandatory preferences * (%TRUE), or from the user preferences (%FALSE). When the @key has not * been found, @mandatory is set to %FALSE. * * This function should only be called for unambiguous keys; the resultat * is otherwise undefined (and rather unpredictable). * * Returns: the value of the key as a newly allocated string, which should * be g_free() by the caller. * * Since: 3.1 */ gchar * na_settings_get_string( const gchar *key, gboolean *found, gboolean *mandatory ) { gchar *value; KeyValue *key_value; KeyDef *key_def; value = NULL; key_value = read_key_value( NULL, key, found, mandatory ); if( key_value ){ value = na_boxed_get_string( key_value->boxed ); release_key_value( key_value ); } else { key_def = get_key_def( key ); if( key_def && key_def->default_value ){ value = g_strdup( key_def->default_value ); } } return( value ); } /** * na_settings_get_string_list: * @key: the key whose value is to be returned. * @found: if not %NULL, a pointer to a gboolean in which we will store * whether the searched @key has been found (%TRUE), or if the returned * value comes from default (%FALSE). * @mandatory: if not %NULL, a pointer to a gboolean in which we will store * whether the returned value has been read from mandatory preferences * (%TRUE), or from the user preferences (%FALSE). When the @key has not * been found, @mandatory is set to %FALSE. * * This function should only be called for unambiguous keys; the resultat * is otherwise undefined (and rather unpredictable). * * Returns: the value of the key as a newly allocated list of strings. * The returned list should be na_core_utils_slist_free() by the caller. * * Since: 3.1 */ GSList * na_settings_get_string_list( const gchar *key, gboolean *found, gboolean *mandatory ) { GSList *value; KeyValue *key_value; KeyDef *key_def; value = NULL; key_value = read_key_value( NULL, key, found, mandatory ); if( key_value ){ value = na_boxed_get_string_list( key_value->boxed ); release_key_value( key_value ); } else { key_def = get_key_def( key ); if( key_def && key_def->default_value && strlen( key_def->default_value )){ value = g_slist_append( NULL, g_strdup( key_def->default_value )); } } return( value ); } /** * na_settings_get_uint: * @key: the key whose value is to be returned. * @found: if not %NULL, a pointer to a gboolean in which we will store * whether the searched @key has been found (%TRUE), or if the returned * value comes from default (%FALSE). * @mandatory: if not %NULL, a pointer to a gboolean in which we will store * whether the returned value has been read from mandatory preferences * (%TRUE), or from the user preferences (%FALSE). When the @key has not * been found, @mandatory is set to %FALSE. * * This function should only be called for unambiguous keys; the resultat * is otherwise undefined (and rather unpredictable). * * Returns: the value of the key. * * Since: 3.1 */ guint na_settings_get_uint( const gchar *key, gboolean *found, gboolean *mandatory ) { guint value; KeyDef *key_def; KeyValue *key_value; value = 0; key_value = read_key_value( NULL, key, found, mandatory ); if( key_value ){ value = na_boxed_get_uint( key_value->boxed ); release_key_value( key_value ); } else { key_def = get_key_def( key ); if( key_def && key_def->default_value ){ value = atoi( key_def->default_value ); } } return( value ); } /** * na_settings_get_uint_list: * @key: the key whose value is to be returned. * @found: if not %NULL, a pointer to a gboolean in which we will store * whether the searched @key has been found (%TRUE), or if the returned * value comes from default (%FALSE). * @mandatory: if not %NULL, a pointer to a gboolean in which we will store * whether the returned value has been read from mandatory preferences * (%TRUE), or from the user preferences (%FALSE). When the @key has not * been found, @mandatory is set to %FALSE. * * This function should only be called for unambiguous keys; the resultat * is otherwise undefined (and rather unpredictable). * * Returns: the value of the key as a newly allocated list of uints. * The returned list should be g_list_free() by the caller. * * Since: 3.1 */ GList * na_settings_get_uint_list( const gchar *key, gboolean *found, gboolean *mandatory ) { GList *value; KeyDef *key_def; KeyValue *key_value; value = NULL; key_value = read_key_value( NULL, key, found, mandatory ); if( key_value ){ value = na_boxed_get_uint_list( key_value->boxed ); release_key_value( key_value ); } else { key_def = get_key_def( key ); if( key_def && key_def->default_value ){ value = g_list_append( NULL, GUINT_TO_POINTER( atoi( key_def->default_value ))); } } return( value ); } /** * na_settings_set_boolean: * @key: the key whose value is to be returned. * @value: the boolean to be written. * * This function writes @value as a user preference. * * This function should only be called for unambiguous keys; the resultat * is otherwise undefined (and rather unpredictable). * * Returns: %TRUE is the writing has been successful, %FALSE else. * * Since: 3.1 */ gboolean na_settings_set_boolean( const gchar *key, gboolean value ) { gchar *string; gboolean ok; string = g_strdup_printf( "%s", value ? "true" : "false" ); ok = set_key_value( NULL, key, string ); g_free( string ); return( ok ); } /** * na_settings_set_boolean_ex: * @group: the group in the keyed file; * @key: the key whose value is to be returned. * @value: the boolean to be written. * * This function writes @value as a user preference. * * Returns: %TRUE is the writing has been successful, %FALSE else. * * Since: 3.1 */ gboolean na_settings_set_boolean_ex( const gchar *group, const gchar *key, gboolean value ) { gchar *string; gboolean ok; string = g_strdup_printf( "%s", value ? "true" : "false" ); ok = set_key_value( group, key, string ); g_free( string ); return( ok ); } /** * na_settings_set_string: * @key: the key whose value is to be returned. * @value: the string to be written. * * This function writes @value as a user preference. * * This function should only be called for unambiguous keys; the resultat * is otherwise undefined (and rather unpredictable). * * Returns: %TRUE is the writing has been successful, %FALSE else. * * Since: 3.1 */ gboolean na_settings_set_string( const gchar *key, const gchar *value ) { return( set_key_value( NULL, key, value )); } /** * na_settings_set_string_ex: * @group: the group in the keyed file; * @key: the key whose value is to be returned. * @value: the string to be written. * * This function writes @value as a user preference. * * Returns: %TRUE is the writing has been successful, %FALSE else. * * Since: 3.2 */ gboolean na_settings_set_string_ex( const gchar *group, const gchar *key, const gchar *value ) { return( set_key_value( group, key, value )); } /** * na_settings_set_string_list: * @key: the key whose value is to be returned. * @value: the list of strings to be written. * * This function writes @value as a user preference. * * This function should only be called for unambiguous keys; the resultat * is otherwise undefined (and rather unpredictable). * * Returns: %TRUE is the writing has been successful, %FALSE else. * * Since: 3.1 */ gboolean na_settings_set_string_list( const gchar *key, const GSList *value ) { GString *string; const GSList *it; gboolean ok; string = g_string_new( "" ); for( it = value ; it ; it = it->next ){ g_string_append_printf( string, "%s;", ( const gchar * ) it->data ); } ok = set_key_value( NULL, key, string->str ); g_string_free( string, TRUE ); return( ok ); } /** * na_settings_set_int_ex: * @group: the group in the keyed file; * @key: the key whose value is to be returned. * @value: the unsigned integer to be written. * * This function writes @value as a user preference. * * Returns: %TRUE is the writing has been successful, %FALSE else. * * Since: 3.2 */ gboolean na_settings_set_int_ex( const gchar *group, const gchar *key, int value ) { gchar *string; gboolean ok; string = g_strdup_printf( "%d", value ); ok = set_key_value( group, key, string ); g_free( string ); return( ok ); } /** * na_settings_set_uint: * @key: the key whose value is to be returned. * @value: the unsigned integer to be written. * * This function writes @value as a user preference. * * This function should only be called for unambiguous keys; the resultat * is otherwise undefined (and rather unpredictable). * * Returns: %TRUE is the writing has been successful, %FALSE else. * * Since: 3.1 */ gboolean na_settings_set_uint( const gchar *key, guint value ) { gchar *string; gboolean ok; string = g_strdup_printf( "%u", value ); ok = set_key_value( NULL, key, string ); g_free( string ); return( ok ); } /** * na_settings_set_uint_list: * @key: the key whose value is to be returned. * @value: the list of unsigned integers to be written. * * This function writes @value as a user preference. * * This function should only be called for unambiguous keys; the resultat * is otherwise undefined (and rather unpredictable). * * Returns: %TRUE is the writing has been successful, %FALSE else. * * Since: 3.1 */ gboolean na_settings_set_uint_list( const gchar *key, const GList *value ) { GString *string; const GList *it; gboolean ok; string = g_string_new( "" ); for( it = value ; it ; it = it->next ){ g_string_append_printf( string, "%u;", GPOINTER_TO_UINT( it->data )); } ok = set_key_value( NULL, key, string->str ); g_string_free( string, TRUE ); return( ok ); } /** * na_settings_get_groups: * * Returns: the list of groups in the configuration; this list should be * na_core_utils_slist_free() by the caller. * * This function participates to a rather bad hack to obtain the list of * known i/o providers from preferences. We do not care of returning unique * or sorted group names. * * Since: 3.1 */ GSList * na_settings_get_groups( void ) { GSList *groups; gchar **array; groups = NULL; settings_new(); array = g_key_file_get_groups( st_settings->private->mandatory->key_file, NULL ); if( array ){ groups = na_core_utils_slist_from_array(( const gchar ** ) array ); g_strfreev( array ); } array = g_key_file_get_groups( st_settings->private->user->key_file, NULL ); if( array ){ groups = g_slist_concat( groups, na_core_utils_slist_from_array(( const gchar ** ) array )); g_strfreev( array ); } return( groups ); } /* * returns a list of modified KeyValue * - order in the lists is not signifiant * - the mandatory flag is not signifiant * - a key is modified: * > if it appears in new * > if it disappears: the value is so reset to its default * > if the value has been modified * * we return here a new list, with newly allocated KeyValue structs * which hold the new value of each modified key */ static GList * content_diff( GList *old, GList *new ) { GList *diffs, *io, *in; KeyValue *kold, *knew, *kdiff; gboolean found; diffs = NULL; for( io = old ; io ; io = io->next ){ kold = ( KeyValue * ) io->data; found = FALSE; for( in = new ; in && !found ; in = in->next ){ knew = ( KeyValue * ) in->data; if( !strcmp( kold->group, knew->group ) && ( gpointer ) kold->def == ( gpointer ) knew->def ){ found = TRUE; if( !na_boxed_are_equal( kold->boxed, knew->boxed )){ /* a key has been modified */ kdiff = g_new0( KeyValue, 1 ); kdiff->group = g_strdup( knew->group ); kdiff->def = knew->def; kdiff->mandatory = knew->mandatory; kdiff->boxed = na_boxed_copy( knew->boxed ); diffs = g_list_prepend( diffs, kdiff ); } } } if( !found ){ /* a key has disappeared */ kdiff = g_new0( KeyValue, 1 ); kdiff->group = g_strdup( kold->group ); kdiff->def = kold->def; kdiff->mandatory = FALSE; kdiff->boxed = na_boxed_new_from_string( kold->def->type, kold->def->default_value ); diffs = g_list_prepend( diffs, kdiff ); } } for( in = new ; in ; in = in->next ){ knew = ( KeyValue * ) in->data; found = FALSE; for( io = old ; io && !found ; io = io->next ){ kold = ( KeyValue * ) io->data; if( !strcmp( kold->group, knew->group ) && ( gpointer ) kold->def == ( gpointer ) knew->def ){ found = TRUE; } } if( !found ){ /* a key is new */ kdiff = g_new0( KeyValue, 1 ); kdiff->group = g_strdup( knew->group ); kdiff->def = knew->def; kdiff->mandatory = knew->mandatory; kdiff->boxed = na_boxed_copy( knew->boxed ); diffs = g_list_prepend( diffs, kdiff ); } } return( diffs ); } /* add the content of a configuration files to those already loaded * * when the two configuration files have been read, then the content of * _the_ configuration has been loaded, while preserving the mandatory * keys */ static GList * content_load_keys( GList *content, KeyFile *keyfile ) { static const gchar *thisfn = "na_settings_content_load_keys"; GError *error; gchar **groups, **ig; gchar **keys, **ik; KeyValue *key_value; KeyDef *key_def; error = NULL; if( !g_key_file_load_from_file( keyfile->key_file, keyfile->fname, G_KEY_FILE_KEEP_COMMENTS, &error )){ if( error->code != G_FILE_ERROR_NOENT ){ g_warning( "%s: %s (%d) %s", thisfn, keyfile->fname, error->code, error->message ); } else { g_debug( "%s: %s: file doesn't exist", thisfn, keyfile->fname ); } g_error_free( error ); error = NULL; } else { groups = g_key_file_get_groups( keyfile->key_file, NULL ); ig = groups; while( *ig ){ keys = g_key_file_get_keys( keyfile->key_file, *ig, NULL, NULL ); ik = keys; while( *ik ){ key_def = get_key_def( *ik ); if( key_def ){ key_value = peek_key_value_from_content( content, *ig, *ik ); if( !key_value ){ key_value = read_key_value_from_key_file( keyfile, *ig, *ik, key_def ); if( key_value ){ key_value->mandatory = keyfile->mandatory; content = g_list_prepend( content, key_value ); } } } ik++; } g_strfreev( keys ); ig++; } g_strfreev( groups ); } return( content ); } static KeyDef * get_key_def( const gchar *key ) { static const gchar *thisfn = "na_settings_get_key_def"; KeyDef *found = NULL; KeyDef *idef; idef = ( KeyDef * ) st_def_keys; while( idef->key && !found ){ if( !strcmp( idef->key, key )){ found = idef; } idef++; } if( !found ){ g_warning( "%s: no KeyDef found for key=%s", thisfn, key ); } return( found ); } /* * called from na_settings_new * allocate and load the key files for global and user preferences */ static KeyFile * key_file_new( const gchar *dir ) { static const gchar *thisfn = "na_settings_key_file_new"; KeyFile *keyfile; GError *error; GFile *file; keyfile = g_new0( KeyFile, 1 ); keyfile->key_file = g_key_file_new(); keyfile->fname = g_strdup_printf( "%s/%s.conf", dir, PACKAGE ); na_core_utils_file_list_perms( keyfile->fname, thisfn ); error = NULL; file = g_file_new_for_path( keyfile->fname ); keyfile->monitor = g_file_monitor_file( file, 0, NULL, &error ); if( error ){ g_warning( "%s: %s: %s", thisfn, keyfile->fname, error->message ); g_error_free( error ); error = NULL; } else { keyfile->handler = g_signal_connect( keyfile->monitor, "changed", ( GCallback ) on_keyfile_changed, NULL ); } g_object_unref( file ); return( keyfile ); } /* * one of the two monitored configuration files have changed on the disk * we do not try to identify which keys have actually change * instead we trigger each registered consumer for the 'global' event * * consumers which register for the 'global_conf' event are recorded * with a NULL key */ static void on_keyfile_changed( GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type ) { settings_new(); na_timeout_event( &st_settings->private->timeout ); } static void on_keyfile_changed_timeout( void ) { static const gchar *thisfn = "na_settings_on_keyfile_changed_timeout"; GList *new_content; GList *modifs; GList *ic, *im; const KeyValue *changed; const Consumer *consumer; gchar *group_prefix, *key; #ifdef NA_MAINTAINER_MODE gchar *value; #endif /* last individual notification is older that the st_burst_timeout * we may so suppose that the burst is terminated */ new_content = content_load_keys( NULL, st_settings->private->mandatory ); new_content = content_load_keys( new_content, st_settings->private->user ); modifs = content_diff( st_settings->private->content, new_content ); #ifdef NA_MAINTAINER_MODE g_debug( "%s: %d found update(s)", thisfn, g_list_length( modifs )); for( im = modifs ; im ; im = im->next ){ changed = ( const KeyValue * ) im->data; value = na_boxed_get_string( changed->boxed ); g_debug( "%s: group=%s, key=%s, value=%s", thisfn, changed->group, changed->def->key, value ); g_free( value ); } #endif /* for each modification found, * - check if a consumer has registered for this key, and triggers callback if apply * - send a notification message */ for( im = modifs ; im ; im = im->next ){ changed = ( const KeyValue * ) im->data; for( ic = st_settings->private->consumers ; ic ; ic = ic->next ){ consumer = ( const Consumer * ) ic->data; group_prefix = NULL; if( !strcmp( consumer->monitored_key, NA_IPREFS_IO_PROVIDERS_READ_STATUS )){ group_prefix = g_strdup_printf( "%s ", NA_IPREFS_IO_PROVIDER_GROUP ); key = NA_IPREFS_IO_PROVIDER_READABLE; } else { key = consumer->monitored_key; } if(( !group_prefix || g_str_has_prefix( changed->group, group_prefix )) && !strcmp( changed->def->key, key )){ ( *( NASettingsKeyCallback ) consumer->callback )( changed->group, changed->def->key, na_boxed_get_pointer( changed->boxed ), changed->mandatory, consumer->user_data ); } g_free( group_prefix ); } g_debug( "%s: sending signal for group=%s, key=%s", thisfn, changed->group, changed->def->key ); g_signal_emit_by_name( st_settings, SETTINGS_SIGNAL_KEY_CHANGED, changed->group, changed->def->key, changed->boxed, changed->mandatory ); } g_debug( "%s: releasing content", thisfn ); g_list_foreach( st_settings->private->content, ( GFunc ) release_key_value, NULL ); g_list_free( st_settings->private->content ); st_settings->private->content = new_content; g_debug( "%s: releasing modifs", thisfn ); g_list_foreach( modifs, ( GFunc ) release_key_value, NULL ); g_list_free( modifs ); } static void on_key_changed_final_handler( NASettings *settings, gchar *group, gchar *key, NABoxed *new_value, gboolean mandatory ) { g_debug( "na_settings_on_key_changed_final_handler: group=%s, key=%s", group, key ); na_boxed_dump( new_value ); } static KeyValue * peek_key_value_from_content( GList *content, const gchar *group, const gchar *key ) { KeyValue *value, *found; GList *ic; found = NULL; for( ic = content ; ic && !found ; ic = ic->next ){ value = ( KeyValue * ) ic->data; if( !strcmp( value->group, group ) && !strcmp( value->def->key, key )){ found = value; } } return( found ); } /* group may be NULL */ static KeyValue * read_key_value( const gchar *group, const gchar *key, gboolean *found, gboolean *mandatory ) { static const gchar *thisfn = "na_settings_read_key_value"; KeyDef *key_def; gboolean has_entry; KeyValue *key_value; key_value = NULL; if( found ){ *found = FALSE; } if( mandatory ){ *mandatory = FALSE; } settings_new(); key_def = get_key_def( key ); if( key_def ){ has_entry = FALSE; key_value = read_key_value_from_key_file( st_settings->private->mandatory, group ? group : key_def->group, key, key_def ); if( key_value ){ has_entry = TRUE; if( found ){ *found = TRUE; } if( mandatory ){ *mandatory = TRUE; g_debug( "%s: %s: key is mandatory", thisfn, key ); } } if( !has_entry ){ key_value = read_key_value_from_key_file( st_settings->private->user, group ? group : key_def->group, key, key_def ); if( key_value ){ has_entry = TRUE; if( found ){ *found = TRUE; } } } } return( key_value ); } static KeyValue * read_key_value_from_key_file( KeyFile *keyfile, const gchar *group, const gchar *key, const KeyDef *key_def ) { static const gchar *thisfn = "na_settings_read_key_value_from_key_file"; KeyValue *value; gchar *str; GError *error; value = NULL; error = NULL; str = NULL; switch( key_def->type ){ case NA_DATA_TYPE_STRING: case NA_DATA_TYPE_STRING_LIST: case NA_DATA_TYPE_UINT: case NA_DATA_TYPE_UINT_LIST: case NA_DATA_TYPE_BOOLEAN: str = g_key_file_get_string( keyfile->key_file, group, key, &error ); if( error ){ if( error->code != G_KEY_FILE_ERROR_KEY_NOT_FOUND && error->code != G_KEY_FILE_ERROR_GROUP_NOT_FOUND ){ g_warning( "%s: %s", thisfn, error->message ); } g_error_free( error ); /* key exists, but may be empty */ } else { value = g_new0( KeyValue, 1 ); value->group = g_strdup( group ); value->def = key_def; switch( key_def->type ){ case NA_DATA_TYPE_STRING: case NA_DATA_TYPE_UINT: case NA_DATA_TYPE_BOOLEAN: case NA_DATA_TYPE_STRING_LIST: case NA_DATA_TYPE_UINT_LIST: value->boxed = na_boxed_new_from_string( key_def->type, str ); break; } } break; default: g_warning( "%s: group=%s, key=%s - unmanaged boxed type: %d", thisfn, group, key, key_def->type ); return( NULL ); } if( value ){ g_debug( "%s: group=%s, key=%s, value=%s, mandatory=%s", thisfn, group, key, str, keyfile->mandatory ? "True":"False" ); } g_free( str ); return( value ); } /* * called from instance_finalize * release the list of registered consumers */ static void release_consumer( Consumer *consumer ) { g_free( consumer->monitored_key ); g_free( consumer ); } /* * called from instance_dispose * release the opened and monitored GKeyFiles */ static void release_key_file( KeyFile *key_file ) { g_key_file_free( key_file->key_file ); if( key_file->monitor ){ if( key_file->handler ){ g_signal_handler_disconnect( key_file->monitor, key_file->handler ); } g_file_monitor_cancel( key_file->monitor ); g_object_unref( key_file->monitor ); } g_free( key_file->fname ); g_free( key_file ); } /* * called from instance_finalize * release a KeyValue struct */ static void release_key_value( KeyValue *value ) { g_free(( gpointer ) value->group ); g_object_unref( value->boxed ); g_free( value ); } static gboolean set_key_value( const gchar *group, const gchar *key, const gchar *string ) { static const gchar *thisfn = "na_settings_set_key_value"; KeyDef *key_def; const gchar *wgroup; gboolean ok; GError *error; ok = FALSE; settings_new(); wgroup = group; if( !wgroup ){ key_def = get_key_def( key ); if( key_def ){ wgroup = key_def->group; } } if( wgroup ){ ok = TRUE; if( string ){ g_key_file_set_string( st_settings->private->user->key_file, wgroup, key, string ); } else { error = NULL; ok = g_key_file_remove_key( st_settings->private->user->key_file, wgroup, key, &error ); if( error ){ g_warning( "%s: g_key_file_remove_key: %s", thisfn, error->message ); g_error_free( error ); } } ok &= write_user_key_file(); } return( ok ); } static gboolean write_user_key_file( void ) { static const gchar *thisfn = "na_settings_write_user_key_file"; gchar *data; GFile *file; GFileOutputStream *stream; GError *error; gsize length; error = NULL; settings_new(); data = g_key_file_to_data( st_settings->private->user->key_file, &length, NULL ); file = g_file_new_for_path( st_settings->private->user->fname ); stream = g_file_replace( file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, &error ); if( error ){ g_warning( "%s: g_file_replace: %s", thisfn, error->message ); g_error_free( error ); if( stream ){ g_object_unref( stream ); } g_object_unref( file ); g_free( data ); return( FALSE ); } g_output_stream_write( G_OUTPUT_STREAM( stream ), data, length, NULL, &error ); if( error ){ g_warning( "%s: g_output_stream_write: %s", thisfn, error->message ); g_error_free( error ); g_object_unref( stream ); g_object_unref( file ); g_free( data ); return( FALSE ); } g_output_stream_close( G_OUTPUT_STREAM( stream ), NULL, &error ); if( error ){ g_warning( "%s: g_output_stream_close: %s", thisfn, error->message ); g_error_free( error ); g_object_unref( stream ); g_object_unref( file ); g_free( data ); return( FALSE ); } g_object_unref( stream ); g_object_unref( file ); g_free( data ); return( TRUE ); } nautilus-actions-3.2.3/src/core/na-object-menu-factory.c0000644000175100017500000000357012212601376020104 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include extern NADataDef data_def_id []; /* defined in na-object-id-factory.c */ extern NADataDef data_def_item []; /* defined in na-object-item-factory.c */ extern NADataDef data_def_conditions []; /* defined in na-icontext-factory.c */ /* * As of 3.2 non copyables data are: * - n/a */ static NADataDef data_def_menu [] = { { NULL }, }; NADataGroup menu_data_groups [] = { { NA_FACTORY_OBJECT_ID_GROUP, data_def_id }, { NA_FACTORY_OBJECT_ITEM_GROUP, data_def_item }, { NA_FACTORY_OBJECT_MENU_GROUP, data_def_menu }, { NA_FACTORY_OBJECT_CONDITIONS_GROUP, data_def_conditions }, { NULL } }; nautilus-actions-3.2.3/src/core/na-module.h0000644000175100017500000000760012212601376015517 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu modules. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_MODULE_H__ #define __CORE_NA_MODULE_H__ /* @title: NAModule * @short_description: The #NAModule Class Definition * @include: core/na-module.h * * The NAModule class manages Nautilus-Actions extensions as dynamically * loadable modules (plugins). * * NAModule * +- is derived from GTypeModule * +- which itself implements GTypePlugin * * Each NAModule physically corresponds to a dynamically loadable library * (i.e. a plugin). A NAModule implements one or more interfaces, and/or * provides one or more services. * * Interfaces (resp. services) are implemented (resp. provided) by GObjects * which are dynamically instantiated at plugin initial-load time. * * So the dynamic is as follows: * - NAPivot scans for the PKGLIBDIR directory, trying to dynamically * load all found libraries * - to be considered as a N-A plugin, a library must implement some * functions (see api/na-api.h) * - for each found plugin, NAPivot calls na_api_list_types() which * returns the type of GObjects implemented in the plugin * - NAPivot dynamically instantiates a GObject for each returned GType. * * After that, when NAPivot wants to access, say to NAIIOProvider * interfaces, it asks each module for its list of objects which implement * this given interface. * Interface API is then called against the returned GObject. */ #include G_BEGIN_DECLS #define NA_TYPE_MODULE ( na_module_get_type()) #define NA_MODULE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_MODULE, NAModule )) #define NA_MODULE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_MODULE, NAModuleClass )) #define NA_IS_MODULE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_MODULE )) #define NA_IS_MODULE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_MODULE )) #define NA_MODULE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_MODULE, NAModuleClass )) typedef struct _NAModulePrivate NAModulePrivate; typedef struct { /*< private >*/ GTypeModule parent; NAModulePrivate *private; } NAModule; typedef struct _NAModuleClassPrivate NAModuleClassPrivate; typedef struct { /*< private >*/ GTypeModuleClass parent; NAModuleClassPrivate *private; } NAModuleClass; GType na_module_get_type ( void ); void na_module_dump ( const NAModule *module ); GList *na_module_load_modules ( void ); GList *na_module_get_extensions_for_type( GList *modules, GType type ); void na_module_free_extensions_list ( GList *extensions ); gboolean na_module_has_id ( NAModule *module, const gchar *id ); void na_module_release_modules ( GList *modules ); G_END_DECLS #endif /* __CORE_NA_MODULE_H__ */ nautilus-actions-3.2.3/src/core/na-io-provider.h0000644000175100017500000001225212212601376016470 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_IO_PROVIDER_H__ #define __CORE_NA_IO_PROVIDER_H__ /* @title: NAIOProvider * @short_description: The NAIOProvider Class Definition * @include: core/na-io-provider.h * * #NAIOProvider is the Nautilus-Actions class which is used to manage * external I/O Providers which implement #NAIIOProvider interface. Each * #NAIOProvider objects may (or not) encapsulates one #NAIIOProvider * provider. * * Internal Nautilus-Actions code should never directly call a * #NAIIOProvider interface method, but rather should call the * corresponding NAIOProvider class method. * * Two preferences are used for each i/o provider: * 'readable': means that the i/o provider should be read when building * the items hierarchy * 'writable': means that the i/o provider is candidate when writing a * new item; this also means that existing items are deletable. * * To be actually writable, a i/o provider must: * - be set as 'writable' from a configuration point of view * this may or not be edited depending of this is a mandatory or user * preference * - be willing to write: this is an intrisinc i/o provider attribute * - be able to write: this is a runtime i/o provider property * * and the whole configuration must not have been locked by an admin. */ #include "na-pivot.h" G_BEGIN_DECLS #define NA_IO_PROVIDER_TYPE ( na_io_provider_get_type()) #define NA_IO_PROVIDER( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_IO_PROVIDER_TYPE, NAIOProvider )) #define NA_IO_PROVIDER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_IO_PROVIDER_TYPE, NAIOProviderClass )) #define NA_IS_IO_PROVIDER( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_IO_PROVIDER_TYPE )) #define NA_IS_IO_PROVIDER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_IO_PROVIDER_TYPE )) #define NA_IO_PROVIDER_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_IO_PROVIDER_TYPE, NAIOProviderClass )) typedef struct _NAIOProviderPrivate NAIOProviderPrivate; typedef struct { /*< private >*/ GObject parent; NAIOProviderPrivate *private; } NAIOProvider; typedef struct _NAIOProviderClassPrivate NAIOProviderClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NAIOProviderClassPrivate *private; } NAIOProviderClass; /* signal sent from a NAIIOProvider * via the na_iio_provider_item_changed() function */ #define IO_PROVIDER_SIGNAL_ITEM_CHANGED "io-provider-item-changed" GType na_io_provider_get_type ( void ); NAIOProvider *na_io_provider_find_writable_io_provider( const NAPivot *pivot ); NAIOProvider *na_io_provider_find_io_provider_by_id ( const NAPivot *pivot, const gchar *id ); const GList *na_io_provider_get_io_providers_list ( const NAPivot *pivot ); void na_io_provider_unref_io_providers_list ( void ); gchar *na_io_provider_get_id ( const NAIOProvider *provider ); gchar *na_io_provider_get_name ( const NAIOProvider *provider ); gboolean na_io_provider_is_available ( const NAIOProvider *provider ); gboolean na_io_provider_is_conf_readable ( const NAIOProvider *provider, const NAPivot *pivot, gboolean *mandatory ); gboolean na_io_provider_is_conf_writable ( const NAIOProvider *provider, const NAPivot *pivot, gboolean *mandatory ); gboolean na_io_provider_is_finally_writable( const NAIOProvider *provider, guint *reason ); GList *na_io_provider_load_items( const NAPivot *pivot, guint loadable_set, GSList **messages ); guint na_io_provider_write_item ( const NAIOProvider *provider, const NAObjectItem *item, GSList **messages ); guint na_io_provider_delete_item ( const NAIOProvider *provider, const NAObjectItem *item, GSList **messages ); guint na_io_provider_duplicate_data( const NAIOProvider *provider, NAObjectItem *dest, const NAObjectItem *source, GSList **messages ); gchar *na_io_provider_get_readonly_tooltip ( guint reason ); gchar *na_io_provider_get_return_code_label( guint code ); G_END_DECLS #endif /* __CORE_NA_IO_PROVIDER_H__ */ nautilus-actions-3.2.3/src/core/na-updater.c0000644000175100017500000004053212212601376015672 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "na-io-provider.h" #include "na-settings.h" #include "na-updater.h" /* private class data */ struct _NAUpdaterClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAUpdaterPrivate { gboolean dispose_has_run; gboolean are_preferences_locked; gboolean is_level_zero_writable; }; static NAPivotClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAUpdaterClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static gboolean are_preferences_locked( const NAUpdater *updater ); static gboolean is_level_zero_writable( const NAUpdater *updater ); static void set_writability_status( NAObjectItem *item, const NAUpdater *updater ); GType na_updater_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_updater_register_type"; GType type; static GTypeInfo info = { sizeof( NAUpdaterClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAUpdater ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( NA_TYPE_PIVOT, "NAUpdater", &info, 0 ); return( type ); } static void class_init( NAUpdaterClass *klass ) { static const gchar *thisfn = "na_updater_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NAUpdaterClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_updater_instance_init"; NAUpdater *self; g_return_if_fail( NA_IS_UPDATER( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_UPDATER( instance ); self->private = g_new0( NAUpdaterPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_updater_instance_dispose"; NAUpdater *self; g_return_if_fail( NA_IS_UPDATER( object )); self = NA_UPDATER( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_updater_instance_finalize"; NAUpdater *self; g_return_if_fail( NA_IS_UPDATER( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NA_UPDATER( object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /* * na_updater_new: * * Returns: a newly allocated #NAUpdater object. */ NAUpdater * na_updater_new( void ) { static const gchar *thisfn = "na_updater_new"; NAUpdater *updater; g_debug( "%s", thisfn ); updater = g_object_new( NA_TYPE_UPDATER, NULL ); updater->private->are_preferences_locked = are_preferences_locked( updater ); updater->private->is_level_zero_writable = is_level_zero_writable( updater ); g_debug( "%s: is_level_zero_writable=%s", thisfn, updater->private->is_level_zero_writable ? "True":"False" ); return( updater ); } static gboolean are_preferences_locked( const NAUpdater *updater ) { gboolean are_locked; gboolean mandatory; are_locked = na_settings_get_boolean( NA_IPREFS_ADMIN_PREFERENCES_LOCKED, NULL, &mandatory ); return( are_locked && mandatory ); } static gboolean is_level_zero_writable( const NAUpdater *updater ) { GSList *level_zero; gboolean mandatory; level_zero = na_settings_get_string_list( NA_IPREFS_ITEMS_LEVEL_ZERO_ORDER, NULL, &mandatory ); na_core_utils_slist_free( level_zero ); g_debug( "na_updater_is_level_zero_writable: NA_IPREFS_ITEMS_LEVEL_ZERO_ORDER: mandatory=%s", mandatory ? "True":"False" ); return( !mandatory ); } /* * na_updater_check_item_writability_status: * @updater: this #NAUpdater object. * @item: the #NAObjectItem to be written. * * Compute and set the writability status of the @item. * * For an item be actually writable: * - the item must not be itself in a read-only store, which has been * checked when first reading it * - the provider must be willing (resp. able) to write * - the provider must not has been locked by the admin, nor by the user * * If the item does not have a parent, then the level zero must be writable. */ void na_updater_check_item_writability_status( const NAUpdater *updater, const NAObjectItem *item ) { gboolean writable; NAIOProvider *provider; NAObjectItem *parent; guint reason; g_return_if_fail( NA_IS_UPDATER( updater )); g_return_if_fail( NA_IS_OBJECT_ITEM( item )); writable = FALSE; reason = NA_IIO_PROVIDER_STATUS_UNDETERMINED; if( !updater->private->dispose_has_run ){ writable = TRUE; reason = NA_IIO_PROVIDER_STATUS_WRITABLE; /* Writability status of the item has been determined at load time * (cf. e.g. io-desktop/nadp-reader.c:read_done_item_is_writable()). * Though I'm plenty conscious that this status is subject to many * changes during the life of the item (e.g. by modifying permissions * on the underlying store), it is just more efficient to not reevaluate * this status each time we need it, and enough for our needs.. */ if( writable ){ if( na_object_is_readonly( item )){ writable = FALSE; reason = NA_IIO_PROVIDER_STATUS_ITEM_READONLY; } } if( writable ){ provider = na_object_get_provider( item ); if( provider ){ writable = na_io_provider_is_finally_writable( provider, &reason ); /* the get_writable_provider() api already takes care of above checks */ } else { provider = na_io_provider_find_writable_io_provider( NA_PIVOT( updater )); if( !provider ){ writable = FALSE; reason = NA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND; } } } /* if needed, the level zero must be writable */ if( writable ){ parent = ( NAObjectItem * ) na_object_get_parent( item ); if( !parent ){ if( updater->private->is_level_zero_writable ){ reason = NA_IIO_PROVIDER_STATUS_LEVEL_ZERO; } } } } na_object_set_writability_status( item, writable, reason ); } /* * na_updater_are_preferences_locked: * @updater: the #NAUpdater application object. * * Returns: %TRUE if preferences have been globally locked down by an * admin, %FALSE else. */ gboolean na_updater_are_preferences_locked( const NAUpdater *updater ) { gboolean are_locked; g_return_val_if_fail( NA_IS_UPDATER( updater ), TRUE ); are_locked = TRUE; if( !updater->private->dispose_has_run ){ are_locked = updater->private->are_preferences_locked; } return( are_locked ); } /* * na_updater_is_level_zero_writable: * @updater: the #NAUpdater application object. * * As of 3.1.0, level-zero is written as a user preference. * * This function considers that the level_zero is writable if it is not * a mandatory preference. * Whether preferences themselves are or not globally locked is not * considered here (as imho, level zero is not really and semantically * part of user preferences). * * This function only considers the case of the level zero itself. * It does not take into account whether the i/o provider (if any) * is writable, or if the item iself is not read only. * * Returns: %TRUE if we are able to update the level-zero list of items, * %FALSE else. */ gboolean na_updater_is_level_zero_writable( const NAUpdater *updater ) { gboolean is_writable; g_return_val_if_fail( NA_IS_UPDATER( updater ), FALSE ); is_writable = FALSE; if( !updater->private->dispose_has_run ){ is_writable = updater->private->is_level_zero_writable; } return( is_writable ); } /* * na_updater_append_item: * @updater: this #NAUpdater object. * @item: a #NAObjectItem-derived object to be appended to the tree. * * Append a new item at the end of the global tree. */ void na_updater_append_item( NAUpdater *updater, NAObjectItem *item ) { GList *tree; g_return_if_fail( NA_IS_UPDATER( updater )); g_return_if_fail( NA_IS_OBJECT_ITEM( item )); if( !updater->private->dispose_has_run ){ g_object_get( G_OBJECT( updater ), PIVOT_PROP_TREE, &tree, NULL ); tree = g_list_append( tree, item ); g_object_set( G_OBJECT( updater ), PIVOT_PROP_TREE, tree, NULL ); } } /* * na_updater_insert_item: * @updater: this #NAUpdater object. * @item: a #NAObjectItem-derived object to be inserted in the tree. * @parent_id: the id of the parent, or %NULL. * @pos: the position in the children of the parent, starting at zero, or -1. * * Insert a new item in the global tree. */ void na_updater_insert_item( NAUpdater *updater, NAObjectItem *item, const gchar *parent_id, gint pos ) { GList *tree; NAObjectItem *parent; g_return_if_fail( NA_IS_UPDATER( updater )); g_return_if_fail( NA_IS_OBJECT_ITEM( item )); if( !updater->private->dispose_has_run ){ parent = NULL; g_object_get( G_OBJECT( updater ), PIVOT_PROP_TREE, &tree, NULL ); if( parent_id ){ parent = na_pivot_get_item( NA_PIVOT( updater ), parent_id ); } if( parent ){ na_object_insert_at( parent, item, pos ); } else { tree = g_list_append( tree, item ); g_object_set( G_OBJECT( updater ), PIVOT_PROP_TREE, tree, NULL ); } } } /* * na_updater_remove_item: * @updater: this #NAPivot instance. * @item: the #NAObjectItem to be removed from the list. * * Removes a #NAObjectItem from the hierarchical tree. Does not delete it. */ void na_updater_remove_item( NAUpdater *updater, NAObject *item ) { GList *tree; NAObjectItem *parent; g_return_if_fail( NA_IS_PIVOT( updater )); if( !updater->private->dispose_has_run ){ g_debug( "na_updater_remove_item: updater=%p, item=%p (%s)", ( void * ) updater, ( void * ) item, G_IS_OBJECT( item ) ? G_OBJECT_TYPE_NAME( item ) : "(null)" ); parent = na_object_get_parent( item ); if( parent ){ tree = na_object_get_items( parent ); tree = g_list_remove( tree, ( gconstpointer ) item ); na_object_set_items( parent, tree ); } else { g_object_get( G_OBJECT( updater ), PIVOT_PROP_TREE, &tree, NULL ); tree = g_list_remove( tree, ( gconstpointer ) item ); g_object_set( G_OBJECT( updater ), PIVOT_PROP_TREE, tree, NULL ); } } } /** * na_updater_should_pasted_be_relabeled: * @updater: this #NAUpdater instance. * @object: the considered #NAObject-derived object. * * Whether the specified object should be relabeled when pasted ? * * Returns: %TRUE if the object should be relabeled, %FALSE else. */ gboolean na_updater_should_pasted_be_relabeled( const NAUpdater *updater, const NAObject *item ) { static const gchar *thisfn = "na_updater_should_pasted_be_relabeled"; gboolean relabel; if( NA_IS_OBJECT_MENU( item )){ relabel = na_settings_get_boolean( NA_IPREFS_RELABEL_DUPLICATE_MENU, NULL, NULL ); } else if( NA_IS_OBJECT_ACTION( item )){ relabel = na_settings_get_boolean( NA_IPREFS_RELABEL_DUPLICATE_ACTION, NULL, NULL ); } else if( NA_IS_OBJECT_PROFILE( item )){ relabel = na_settings_get_boolean( NA_IPREFS_RELABEL_DUPLICATE_PROFILE, NULL, NULL ); } else { g_warning( "%s: unknown item type at %p", thisfn, ( void * ) item ); g_return_val_if_reached( FALSE ); } return( relabel ); } /* * na_updater_load_items: * @updater: this #NAUpdater instance. * * Loads the items, updating simultaneously their writability status. * * Returns: a pointer (not a ref) on the loaded tree. * * Since: 3.1 */ GList * na_updater_load_items( NAUpdater *updater ) { static const gchar *thisfn = "na_updater_load_items"; GList *tree; g_return_val_if_fail( NA_IS_UPDATER( updater ), NULL ); tree = NULL; if( !updater->private->dispose_has_run ){ g_debug( "%s: updater=%p (%s)", thisfn, ( void * ) updater, G_OBJECT_TYPE_NAME( updater )); na_pivot_load_items( NA_PIVOT( updater )); tree = na_pivot_get_items( NA_PIVOT( updater )); g_list_foreach( tree, ( GFunc ) set_writability_status, ( gpointer ) updater ); } return( tree ); } static void set_writability_status( NAObjectItem *item, const NAUpdater *updater ) { GList *children; na_updater_check_item_writability_status( updater, item ); if( NA_IS_OBJECT_MENU( item )){ children = na_object_get_items( item ); g_list_foreach( children, ( GFunc ) set_writability_status, ( gpointer ) updater ); } } /* * na_updater_write_item: * @updater: this #NAUpdater instance. * @item: a #NAObjectItem to be written down to the storage subsystem. * @messages: the I/O provider can allocate and store here its error * messages. * * Writes an item (an action or a menu). * * Returns: the #NAIIOProvider return code. */ guint na_updater_write_item( const NAUpdater *updater, NAObjectItem *item, GSList **messages ) { guint ret; ret = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; g_return_val_if_fail( NA_IS_UPDATER( updater ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), ret ); g_return_val_if_fail( messages, ret ); if( !updater->private->dispose_has_run ){ NAIOProvider *provider = na_object_get_provider( item ); if( !provider ){ provider = na_io_provider_find_writable_io_provider( NA_PIVOT( updater )); g_return_val_if_fail( provider, NA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND ); } if( provider ){ ret = na_io_provider_write_item( provider, item, messages ); } } return( ret ); } /* * na_updater_delete_item: * @updater: this #NAUpdater instance. * @item: the #NAObjectItem to be deleted from the storage subsystem. * @messages: the I/O provider can allocate and store here its error * messages. * * Deletes an item, action or menu, from the I/O storage subsystem. * * Returns: the #NAIIOProvider return code. * * Note that a new item, not already written to an I/O subsystem, * doesn't have any attached provider. We so do nothing and return OK... */ guint na_updater_delete_item( const NAUpdater *updater, const NAObjectItem *item, GSList **messages ) { guint ret; NAIOProvider *provider; g_return_val_if_fail( NA_IS_UPDATER( updater ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); g_return_val_if_fail( messages, NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); ret = NA_IIO_PROVIDER_CODE_OK; if( !updater->private->dispose_has_run ){ provider = na_object_get_provider( item ); /* provider may be NULL if the item has been deleted from the UI * without having been ever saved */ if( provider ){ g_return_val_if_fail( NA_IS_IO_PROVIDER( provider ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); ret = na_io_provider_delete_item( provider, item, messages ); } } return( ret ); } nautilus-actions-3.2.3/src/core/na-marshal.c0000644000175100017500000001417412220365310015652 00000000000000#include "na-marshal.h" #include #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_schar (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #define g_marshal_value_peek_variant(v) g_value_get_variant (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* VOID:POINTER,BOOLEAN (/home/pierre/data/eclipse/nautilus-actions/src/core/na-marshal.def:3) */ void na_cclosure_marshal_VOID__POINTER_BOOLEAN (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__POINTER_BOOLEAN) (gpointer data1, gpointer arg_1, gboolean arg_2, gpointer data2); register GMarshalFunc_VOID__POINTER_BOOLEAN callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__POINTER_BOOLEAN) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_pointer (param_values + 1), g_marshal_value_peek_boolean (param_values + 2), data2); } /* VOID:STRING,STRING,POINTER,BOOLEAN (/home/pierre/data/eclipse/nautilus-actions/src/core/na-marshal.def:6) */ void na_cclosure_marshal_VOID__STRING_STRING_POINTER_BOOLEAN (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_STRING_POINTER_BOOLEAN) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gboolean arg_4, gpointer data2); register GMarshalFunc_VOID__STRING_STRING_POINTER_BOOLEAN callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 5); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__STRING_STRING_POINTER_BOOLEAN) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_string (param_values + 1), g_marshal_value_peek_string (param_values + 2), g_marshal_value_peek_pointer (param_values + 3), g_marshal_value_peek_boolean (param_values + 4), data2); } nautilus-actions-3.2.3/src/core/na-export-format.h0000644000175100017500000000522312212601376017040 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_EXPORT_FORMAT_H__ #define __CORE_NA_EXPORT_FORMAT_H__ /* @title: NAExportFormat * @short_description: The #NAExportFormat Class Definition * @include: core/na-export-format.h */ #include G_BEGIN_DECLS #define NA_TYPE_EXPORT_FORMAT ( na_export_format_get_type()) #define NA_EXPORT_FORMAT( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_EXPORT_FORMAT, NAExportFormat )) #define NA_EXPORT_FORMAT_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_EXPORT_FORMAT, NAExportFormatClass )) #define NA_IS_EXPORT_FORMAT( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_EXPORT_FORMAT )) #define NA_IS_EXPORT_FORMAT_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_EXPORT_FORMAT )) #define NA_EXPORT_FORMAT_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_EXPORT_FORMAT, NAExportFormatClass )) typedef struct _NAExportFormatPrivate NAExportFormatPrivate; typedef struct { GObject parent; NAExportFormatPrivate *private; } NAExportFormat; typedef struct _NAExportFormatClassPrivate NAExportFormatClassPrivate; typedef struct { GObjectClass parent; NAExportFormatClassPrivate *private; } NAExportFormatClass; GType na_export_format_get_type ( void ); NAExportFormat *na_export_format_new ( const NAIExporterFormatv2 *exporter_format ); NAIExporter *na_export_format_get_provider( const NAExportFormat *format ); G_END_DECLS #endif /* __CORE_NA_EXPORT_FORMAT_H__ */ nautilus-actions-3.2.3/src/core/na-core-utils.c0000644000175100017500000007004212212601376016313 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "na-about.h" /* minimal and maximal size for loading the content of a file in memory * used by na_core_utils_file_is_size_ok() */ #define SIZE_MIN 1 #define SIZE_MAX 1048576 /* 1 MB */ #ifdef NA_ENABLE_DEPRECATED static GSList *text_to_string_list( const gchar *text, const gchar *separator, const gchar *default_value ); #endif static gboolean info_dir_is_writable( GFile *file, const gchar *path ); static gboolean file_is_loadable( GFile *file ); static void list_perms( const gchar *path, const gchar *message, const gchar *command ); /** * na_core_utils_boolean_from_string * @string: a string to be converted. * * Returns: %TRUE if the string evaluates to "true" (case insensitive), * %FALSE else. * * Since: 2.30 */ gboolean na_core_utils_boolean_from_string( const gchar *string ) { if( !string ) return( FALSE ); return( g_ascii_strcasecmp( string, "true" ) == 0 || atoi( string ) != 0 ); } #ifdef NA_ENABLE_DEPRECATED /** * na_core_utils_str_add_prefix: * @prefix: the prefix to be prepended. * @str: a multiline string. * * Appends a prefix to each line of the string. * * Returns: a new string which should be g_free() by the caller. * * Since: 2.30 * Deprecated: 3.2 */ gchar * na_core_utils_str_add_prefix( const gchar *prefix, const gchar *str ) { GSList *list, *il; GString *result; list = text_to_string_list( str, "\n", NULL ); result = g_string_new( "" ); for( il = list ; il ; il = il->next ){ g_string_append_printf( result, "%s%s\n", prefix, ( gchar * ) il->data ); } na_core_utils_slist_free( list ); return( g_string_free( result, FALSE )); } /* * split a text buffer in lines */ static GSList * text_to_string_list( const gchar *text, const gchar *separator, const gchar *default_value ) { GSList *strlist = NULL; gchar **tokens; gchar *tmp; gchar *source = g_strdup( text ); tmp = g_strstrip( source ); if( !strlen( tmp ) && default_value ){ strlist = g_slist_append( strlist, g_strdup( default_value )); } else { tokens = g_strsplit( source, separator, -1 ); strlist = na_core_utils_slist_from_array(( const gchar ** ) tokens ); g_strfreev( tokens ); } g_free( source ); return( strlist ); } #endif /* NA_ENABLE_DEPRECATED */ /** * na_core_utils_str_collate: * @str1: an UTF-8 encoded string. * @str2: an UTF-8 encoded string. * * Returns: * * * -1 if str1 < str2, * * * 0 if str1 = str2, * * * +1 if str1 > str2. * * * * Since: 2.30 */ int na_core_utils_str_collate( const gchar *str1, const gchar *str2 ) { int res; if( str1 && str2 ){ res = g_utf8_collate( str1, str2 ); } else if( !str1 && !str2 ){ res = 0; } else if( !str1 ){ res = -1; } else { g_return_val_if_fail( str2 == NULL, 0 ); res = 1; } return( res ); } /** * na_core_utils_str_remove_char: * @string: source string. * @to_remove: the character to remove. * * Returns: a newly allocated string, which is a copy of the source @string, * minus all the found occurrences of the given @to_remove char. * * The returned string should be g_free() by the caller. * * Since: 2.30 */ gchar * na_core_utils_str_remove_char( const gchar *string, const gchar *to_remove ) { static const gchar *thisfn = "na_core_utils_str_remove_char"; gchar *removed; GRegex *regex; GError *error; removed = g_strdup( string ); if( g_utf8_validate( string, -1, NULL )){ error = NULL; regex = g_regex_new( to_remove, 0, 0, &error ); if( error ){ g_warning( "%s [g_regex_new] %s", thisfn, error->message ); g_error_free( error ); } else { g_free( removed ); removed = g_regex_replace_literal( regex, string, -1, 0, "", 0, &error ); if( error ){ g_warning( "%s [g_regex_replace_literal] %s", thisfn, error->message ); g_error_free( error ); } } } return( removed ); } /** * na_core_utils_str_remove_suffix: * @string: source string. * @suffix: suffix to be removed from @string. * * Returns: a newly allocated string, which is a copy of the source @string, * minus the removed @suffix if present. If @strings doesn't terminate with * @suffix, then the returned string is equal to source @string. * * The returned string should be g_free() by the caller. * * Since: 2.30 */ gchar * na_core_utils_str_remove_suffix( const gchar *string, const gchar *suffix ) { gchar *removed; gchar *ptr; removed = g_strdup( string ); if( g_str_has_suffix( string, suffix )){ ptr = g_strrstr( removed, suffix ); ptr[0] = '\0'; } return( removed ); } /** * na_core_utils_str_split_first_word: * @string: a space-separated string. * @first: a pointer to a gchar *. * @other: a pointer to a gchar *. * * Split the @string string into two components: * * * the first word which is allocated in @first, * * * the rest of the string which is allocated in @other. * * * * The two allocated strings should be g_free() by the caller. * * Since: 2.30 */ void na_core_utils_str_split_first_word( const gchar *string, gchar **first, gchar **other ) { gchar **splitted, **iter; if( first ){ *first = NULL; } if( other ){ *other = NULL; } if( string && g_utf8_strlen( string, -1 )){ splitted = g_strsplit( string, " ", 2 ); iter = splitted; if( first ){ *first = g_strdup( *iter ); } iter++; if( other ){ *other = g_strdup( *iter ); } g_strfreev( splitted ); } } /** * na_core_utils_str_subst: * @pattern: the pattern. * @key: the key string to be substituted. * @subst: the string which will replace @key. * * Returns: * a copy of @pattern where the first occurrence of @key has been * substituted with @subst, as a newly allocated string which should be * g_free() by the caller, * or a copy of @pattern if @key is not found in @pattern. */ gchar * na_core_utils_str_subst( const gchar *pattern, const gchar *key, const gchar *subst ) { GString *result; gchar *found; result = g_string_new( "" ); found = g_strstr_len( pattern, -1, key ); if( found ){ result = g_string_append_len( result, pattern, ( gssize )( found - pattern )); result = g_string_append( result, subst ); result = g_string_append( result, found + g_utf8_strlen( key, -1 )); } else { result = g_string_append( result, pattern ); } return( g_string_free( result, FALSE )); } void na_core_utils_slist_add_message( GSList **messages, const gchar *format, ... ) { va_list va; gchar *tmp; va_start( va, format ); tmp = g_markup_vprintf_escaped( format, va ); va_end( va ); *messages = g_slist_append( *messages, tmp ); } /** * na_core_utils_slist_duplicate: * @slist: the #GSList to be duplicated. * * Returns: a #GSList of strings. * * The returned list should be na_core_utils_slist_free() by the caller. * * Since: 2.30 */ GSList * na_core_utils_slist_duplicate( GSList *slist ) { GSList *dest_slist, *it; dest_slist = NULL; for( it = slist ; it != NULL ; it = it->next ){ dest_slist = g_slist_prepend( dest_slist, g_strdup(( gchar * ) it->data ) ); } dest_slist = g_slist_reverse( dest_slist ); return( dest_slist ); } /** * na_core_utils_slist_dump: * @prefix: a string to be used as a prefix for each outputed line. * @list: a list of strings. * * Dumps the content of a list of strings. * * Since: 2.30 */ void na_core_utils_slist_dump( const gchar *prefix, GSList *list ) { static const gchar *thisfn = "na_core_utils_slist_dump"; GSList *i; int c; const gchar *thispfx; thispfx = ( prefix && strlen( prefix )) ? prefix : thisfn; g_debug( "%s: list at %p has %d element(s)", thispfx, ( void * ) list, g_slist_length( list )); for( i=list, c=0 ; i ; i=i->next ){ g_debug( "%s: [%2d] %s (%lu)", thispfx, c++, ( gchar * ) i->data, g_utf8_strlen( ( gchar * ) i->data, -1 )); } } /** * na_core_utils_slist_from_split: * @text: a string to be splitted. * @separator: the string to be used as the separator. * * Returns: a #GSList with the list of strings after having been splitted. * * The returned #GSList should be na_core_utils_slist_free() by the caller. * * Since: 2.30 */ GSList * na_core_utils_slist_from_split( const gchar *text, const gchar *separator ) { GSList *slist; gchar **tokens; gchar *source, *tmp; if( !text ){ return( NULL ); } source = g_strdup( text ); tmp = g_strstrip( source ); if( !g_utf8_strlen( tmp, -1 )){ return( NULL ); } tokens = g_strsplit( tmp, separator, -1 ); slist = na_core_utils_slist_from_array(( const gchar ** ) tokens ); g_strfreev( tokens ); g_free( source ); return( slist ); } /** * na_core_utils_slist_from_array: * @str_array: an NULL-terminated array of strings. * * Returns: a #GSList list of strings, which should be #na_core_utils_slist_free() * by the caller. * * Since: 2.30 */ GSList * na_core_utils_slist_from_array( const gchar **str_array ) { GSList *slist; gchar **idx; slist = NULL; idx = ( gchar ** ) str_array; while( *idx ){ slist = g_slist_prepend( slist, g_strstrip( g_strdup( *idx ))); idx++; } return( g_slist_reverse( slist )); } /** * na_core_utils_slist_join_at_end: * @slist: the string list to join. * @link: the string used to join each element. * * Returns: a newly allocated string which should be g_free() by the caller. * * Since: 2.30 */ gchar * na_core_utils_slist_join_at_end( GSList *slist, const gchar *link ) { GSList *is; GString *str; str = g_string_new( "" ); for( is = slist ; is ; is = is->next ){ if( str->len ){ g_string_append_printf( str, "%s", link ); } g_string_append_printf( str, "%s", ( const gchar * ) is->data ); } return( g_string_free( str, FALSE )); } /** * na_core_utils_slist_remove_ascii: * @slist: the #GSList to be updated. * @text: string to remove. * * Removes a string from a GSList of strings. * * Returns: the same, updated, @slist. * * Since: 2.30 */ GSList * na_core_utils_slist_remove_ascii( GSList *slist, const gchar *text ) { GSList *il; for( il = slist ; il ; il = il->next ){ const gchar *istr = ( const gchar * ) il->data; if( !g_ascii_strcasecmp( text, istr )){ slist = g_slist_remove( slist, ( gconstpointer ) istr ); return( slist ); } } return( slist ); } /** * na_core_utils_slist_remove_utf8: * @slist: the #GSList to be updated. * @text: the string to be removed. * * Removes from the @slist the item which has a string which is equal to * @text. * * Returns: the new @slist start position. * * Since: 2.30 */ GSList * na_core_utils_slist_remove_utf8( GSList *slist, const gchar *text ) { GSList *is; for( is = slist ; is ; is = is->next ){ const gchar *istr = ( const gchar * ) is->data; if( !na_core_utils_str_collate( text, istr )){ g_free( is->data ); slist = g_slist_delete_link( slist, is ); break; } } return( slist ); } /** * na_core_utils_slist_to_array: * @slist: a list of strings. * * Returns: a newly allocated array of strings, which should be * g_strfreev() by the caller. * * Since: 2.30 */ gchar ** na_core_utils_slist_to_array( GSList *slist ) { GString *str; GSList *is; gchar **array; str = g_string_new( "" ); for( is = slist ; is ; is = is->next ){ g_string_append_printf( str, "%s;", ( const gchar * ) is->data ); } array = g_strsplit( str->str, ";", -1 ); g_string_free( str, TRUE ); return( array ); } /** * na_core_utils_slist_to_text: * @slist: a list of strings. * * Concatenates a string list to a semi-colon-separated text * suitable for an entry in the user interface * * Returns: a newly allocated string, which should be g_free() by the * caller. * * Since: 2.30 */ gchar * na_core_utils_slist_to_text( GSList *slist ) { GSList *ib; gchar *tmp; gchar *text = g_strdup( "" ); for( ib = slist ; ib ; ib = ib->next ){ if( strlen( text )){ tmp = g_strdup_printf( "%s; ", text ); g_free( text ); text = tmp; } tmp = g_strdup_printf( "%s%s", text, ( gchar * ) ib->data ); g_free( text ); text = tmp; } return( text ); } /** * na_core_utils_slist_setup_element: * @list: the GSList of strings to be setup. * @element: the string to add to or remove of the list. * @set: whether the @element should be set or removed. * * Setup the @list so that the @element is once in the @list if @set is %TRUE, * or not if @set is %FALSE. * * Returns: the updated @list. * * Since: 2.30 */ GSList * na_core_utils_slist_setup_element( GSList *list, const gchar *element, gboolean set ) { guint count; count = na_core_utils_slist_count( list, element ); if( set && count == 0 ){ list = g_slist_prepend( list, g_strdup( element )); } if( !set && count > 0 ){ list = na_core_utils_slist_remove_ascii( list, element ); } return( list ); } /** * na_core_utils_slist_count: * @list: the GSList of strings to be searched. * @str: the searched string. * * Search for a string in a string list. * * Returns: the count of @ßtr in @list list. * * Since: 2.30 */ guint na_core_utils_slist_count( GSList *list, const gchar *str ) { guint count; GSList *il; count = 0; for( il = list ; il ; il = il->next ){ const gchar *istr = ( const gchar * ) il->data; if( !na_core_utils_str_collate( str, istr )){ count += 1; } } return( count ); } /** * na_core_utils_slist_find_negated: * @list: the GSList of strings to be searched. * @str: the searched string. * * Search for a string in a string list which may contain nagated items. * * Returns: %TRUE if the string has been found in list. * * Since: 2.30 */ gboolean na_core_utils_slist_find_negated( GSList *list, const gchar *str ) { GSList *il; for( il = list ; il ; il = il->next ){ const gchar *istr = g_strstrip( g_strdup( ( const gchar * ) il->data )); if( istr[0] == '!' ){ gchar *istrdup = g_strdup( istr+1 ); int match = na_core_utils_str_collate( str, istrdup ); g_free( istrdup ); if( match == 0 ){ return( TRUE ); } } else if( na_core_utils_str_collate( str, istr ) == 0 ){ return( TRUE ); } } return( FALSE ); } /** * na_core_utils_slist_are_equal: * @a: a GSList of strings. * @b: another GSList of strings to be compared with @first. * * Compare two string lists, without regards to the order. * * Returns: %TRUE if the two lists have same content. * * Since: 2.30 */ gboolean na_core_utils_slist_are_equal( GSList *a, GSList *b ) { GSList *il; for( il = a ; il ; il = il->next ){ const gchar *str = ( const gchar * ) il->data; if( na_core_utils_slist_count( b, str ) == 0 ){ return( FALSE ); } } for( il = b ; il ; il = il->next ){ const gchar *str = ( const gchar * ) il->data; if( na_core_utils_slist_count( a, str ) == 0 ){ return( FALSE ); } } return( TRUE ); } /** * na_core_utils_slist_free: * @slist: a #GSList list of strings. * * Releases the strings and the list itself. * * Since: 2.30 */ void na_core_utils_slist_free( GSList *slist ) { g_slist_foreach( slist, ( GFunc ) g_free, NULL ); g_slist_free( slist ); } /** * na_core_utils_gstring_joinv: * @start: a prefix to be written at the beginning of the output string. * @separator: a string to be used as separator. * @list: the list of strings to be concatenated. * * Concatenates a gchar **list of strings to a new string. * * Returns: a newly allocated string which should be g_free() by the caller. * * Since: 2.30 */ gchar * na_core_utils_gstring_joinv( const gchar *start, const gchar *separator, gchar **list ) { GString *tmp_string = g_string_new( "" ); int i; g_return_val_if_fail( list != NULL, NULL ); if( start != NULL ){ tmp_string = g_string_append( tmp_string, start ); } if( list[0] != NULL ){ tmp_string = g_string_append( tmp_string, list[0] ); } for( i = 1 ; list[i] != NULL ; i++ ){ if( separator ){ tmp_string = g_string_append( tmp_string, separator ); } tmp_string = g_string_append( tmp_string, list[i] ); } return( g_string_free( tmp_string, FALSE )); } /*** * na_core_utils_selcount_get_ope: * @selcount: the selection count condition string. * @ope: a pointer to a newly allocated string which will contains the * operation code. * @uint: a pointer to a newly allocated string which will contains the * relevant integer. * * Parses a selection count string, and extract the operation code and the * relevant integer. * * The two returned strings must be g_free() by the caller. * * Since: 2.30 */ void na_core_utils_selcount_get_ope_int( const gchar *selcount, gchar **ope, gchar **uint ) { gchar *dup, *dup2; guint uint_int; g_return_if_fail( ope && uint ); *ope = NULL; *uint = NULL; dup = g_strstrip( g_strdup( selcount )); *ope = g_strdup( " " ); *ope[0] = dup[0]; dup2 = g_strstrip( g_strdup( dup+1 )); uint_int = abs( atoi( dup2 )); *uint = g_strdup_printf( "%d", uint_int ); g_free( dup2 ); g_free( dup ); } /** * na_core_utils_dir_is_writable_path: * @path: the path of the directory to be tested. * * Returns: %TRUE if the directory is writable, %FALSE else. * * Please note that this type of test is subject to race conditions, * as the directory may become unwritable after a successful test, * but before the caller has been able to actually write into it. * * There is no "super-test". Just try... * * Since: 2.30 */ gboolean na_core_utils_dir_is_writable_path( const gchar *path ) { static const gchar *thisfn = "na_core_utils_path_is_writable"; GFile *file; gboolean writable; if( !path || !g_utf8_strlen( path, -1 )){ g_warning( "%s: empty path", thisfn ); return( FALSE ); } file = g_file_new_for_path( path ); writable = info_dir_is_writable( file, path ); g_object_unref( file ); return( writable ); } /** * na_core_utils_dir_is_writable_uri: * @uri: the URI of the directory to be tested. * * Returns: %TRUE if the directory is writable, %FALSE else. * * Please note that this type of test is subject to race conditions, * as the directory may become unwritable after a successful test, * but before the caller has been able to actually write into it. * * There is no "super-test". Just try... * * Since: 2.30 */ gboolean na_core_utils_dir_is_writable_uri( const gchar *uri ) { static const gchar *thisfn = "na_core_utils_dir_is_writable_uri"; GFile *file; gboolean writable; if( !uri || !g_utf8_strlen( uri, -1 )){ g_warning( "%s: empty uri", thisfn ); return( FALSE ); } file = g_file_new_for_uri( uri ); writable = info_dir_is_writable( file, uri ); g_object_unref( file ); return( writable ); } static gboolean info_dir_is_writable( GFile *file, const gchar *path_or_uri ) { static const gchar *thisfn = "na_core_utils_info_dir_is_writable"; GError *error = NULL; GFileInfo *info; GFileType type; gboolean writable; info = g_file_query_info( file, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "," G_FILE_ATTRIBUTE_STANDARD_TYPE, G_FILE_QUERY_INFO_NONE, NULL, &error ); if( error ){ if( error->code != G_IO_ERROR_NOT_FOUND ){ g_warning( "%s: g_file_query_info error: %s", thisfn, error->message ); } g_error_free( error ); return( FALSE ); } type = g_file_info_get_file_type( info ); if( type != G_FILE_TYPE_DIRECTORY ){ g_debug( "%s: %s is not a directory", thisfn, path_or_uri ); g_object_unref( info ); return( FALSE ); } writable = g_file_info_get_attribute_boolean( info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE ); if( !writable ){ g_debug( "%s: %s is not writable", thisfn, path_or_uri ); } g_object_unref( info ); return( writable ); } /** * na_core_utils_dir_list_perms: * @path: the path of the directory to be tested. * @message: a message to be printed if not %NULL. * * Displays the permissions of the directory on debug output. * * Since: 3.1 */ void na_core_utils_dir_list_perms( const gchar *path, const gchar *message ) { list_perms( path, message, "ls -ld" ); } /** * na_core_utils_dir_split_ext: * @string: the input path or URI to be splitted. * @first: a pointer to a buffer which will contain the first part of the split. * @ext: a pointer to a buffer which will contain the extension part of the path. * * Split the given @string, returning the first part and the extension in newly * allocated buffers which should be g_free() by the caller. * * The extension is set to an empty string if no extension is detected. * * Since: 2.30 */ void na_core_utils_dir_split_ext( const gchar *string, gchar **first, gchar **ext ) { gchar *dupped; gchar **array, **iter; dupped = g_strreverse( g_strdup( string )); array = g_strsplit( dupped, ".", 2 ); if( g_strv_length( array ) == 1 ){ if( ext ){ *ext = g_strdup( "" ); } if( first ){ *first = g_strreverse( g_strdup(( const gchar * ) *array )); } } else { if( ext ){ *ext = g_strreverse( g_strdup(( const gchar * ) *array )); } iter = array; ++iter; if( first ){ *first = g_strreverse( g_strdup(( const gchar * ) *iter )); } } g_strfreev( array ); g_free( dupped ); } /** * na_core_utils_file_delete: * @path: the path of the file to be deleted. * * Returns: %TRUE if the file is successfully deleted, %FALSE else. * * Since: 2.30 */ gboolean na_core_utils_file_delete( const gchar *path ) { static const gchar *thisfn = "na_core_utils_file_delete"; gboolean deleted = FALSE; if( !path || !g_utf8_strlen( path, -1 )){ return( FALSE ); } if( g_unlink( path ) == 0 ){ deleted = TRUE; } else { g_warning( "%s: %s: %s", thisfn, path, g_strerror( errno )); } return( deleted ); } /** * na_core_utils_file_exists: * @uri: a file URI. * * Returns: %TRUE if the specified file exists, %FALSE else. * * Race condition: cf. na_core_utils_dir_is_writable_path() and * na_core_utils_dir_is_writable_uri() comments. * * Since: 2.30 */ gboolean na_core_utils_file_exists( const gchar *uri ) { GFile *file; gboolean exists; file = g_file_new_for_uri( uri ); exists = g_file_query_exists( file, NULL ); g_object_unref( file ); return( exists ); } /** * na_core_utils_file_is_loadable: * @uri: the URI to be checked. * * Checks that the file is suitable to be loaded in memory, because * it is not empty, and its size is reasonable (less than 1MB). * Also checks that a file is a regular file (or a symlink to a * regular file). * * Returns: whether the file is suitable to be loaded in memory. * * Since: 3.1 */ gboolean na_core_utils_file_is_loadable( const gchar *uri ) { static const gchar *thisfn = "na_core_utils_file_is_loadable"; GFile *file; gboolean isok; g_debug( "%s: uri=%s", thisfn, uri ); isok = FALSE; file = g_file_new_for_uri( uri ); isok = file_is_loadable( file ); g_object_unref( file ); return( isok ); } static gboolean file_is_loadable( GFile *file ) { static const gchar *thisfn = "na_core_utils_file_is_loadable"; GError *error; GFileInfo *info; guint64 size; GFileType type; gboolean isok; GFile *target_file; error = NULL; isok = FALSE; info = g_file_query_info( file, G_FILE_ATTRIBUTE_STANDARD_SIZE "," G_FILE_ATTRIBUTE_STANDARD_TYPE, G_FILE_QUERY_INFO_NONE, NULL, &error ); if( !info ){ if( error ){ g_debug( "%s: %s", thisfn, error->message ); g_error_free( error ); } } else { size = g_file_info_get_attribute_uint64( info, G_FILE_ATTRIBUTE_STANDARD_SIZE ); g_debug( "%s: size=%lu", thisfn, ( unsigned long ) size ); isok = ( size >= SIZE_MIN && size <= SIZE_MAX ); } if( isok ){ type = g_file_info_get_file_type( info ); g_debug( "%s: type=%u", thisfn, ( unsigned ) type ); if( type != G_FILE_TYPE_REGULAR ){ isok = FALSE; if( type == G_FILE_TYPE_SYMBOLIC_LINK ){ const char *target = g_file_info_get_symlink_target( info ); if( target && strlen( target )){ target_file = g_file_resolve_relative_path( file, target ); if( target_file ){ isok = file_is_loadable( target_file ); g_object_unref( target_file ); } } } } } g_object_unref( info ); return( isok ); } /** * na_core_utils_file_list_perms: * @path: the path of the file to be tested. * @message: a message to be printed if not %NULL. * * Displays the permissions of the file on debug output. * * Since: 3.2 */ void na_core_utils_file_list_perms( const gchar *path, const gchar *message ) { list_perms( path, message, "ls -l" ); } static void list_perms( const gchar *path, const gchar *message, const gchar *command ) { static const gchar *thisfn = "na_core_utils_list_perms"; gchar *cmd; gchar *out, *err; GError *error; error = NULL; cmd = g_strdup_printf( "%s %s", command, path ); if( !g_spawn_command_line_sync( cmd, &out, &err, NULL, &error )){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } else { g_debug( "%s: out=%s", message, out ); g_debug( "%s: err=%s", message, err ); g_free( out ); g_free( err ); } g_free( cmd ); } /** * na_core_utils_file_load_from_uri: * @uri: the URI the file must be loaded from. * @length: a pointer to the length of the read content. * * Loads the file into a newly allocated buffer, and set up the length of the * read content if not %NULL. * * Returns: the newly allocated buffer which contains the file content, or %NULL. * This buffer should be g_free() by the caller. * * Since: 2.30 */ gchar * na_core_utils_file_load_from_uri( const gchar *uri, gsize *length ) { static const gchar *thisfn = "na_core_utils_file_load_from_uri"; gchar *data; GFile *file; GError *error; g_debug( "%s: uri=%s, length=%p", thisfn, uri, ( void * ) length ); error = NULL; data = NULL; if( length ){ *length = 0; } file = g_file_new_for_uri( uri ); if( !g_file_load_contents( file, NULL, &data, length, NULL, &error )){ g_free( data ); data = NULL; if( length ){ *length = 0; } if( error ){ g_debug( "%s: %s", thisfn, error->message ); g_error_free( error ); } } g_object_unref( file ); return( data ); } /** * na_core_utils_print_version: * * Print a version message on the console * * * nautilus-actions-new (Nautilus-Actions) v 2.29.1 * Copyright (C) 2005-2007 Frederic Ruaudel * Copyright (C) 2009, 2010, 2011, 2012 Pierre Wieser * Nautilus-Actions is free software, licensed under GPLv2 or later. * * * Since: 2.30 */ void na_core_utils_print_version( void ) { gchar *copyright; g_print( "\n" ); g_print( "%s (%s) v %s\n", g_get_prgname(), PACKAGE_NAME, PACKAGE_VERSION ); copyright = na_about_get_copyright( TRUE ); g_print( "%s\n", copyright ); g_free( copyright ); g_print( "%s is free software, and is provided without any warranty. You may\n", PACKAGE_NAME ); g_print( "redistribute copies of %s under the terms of the GNU General Public\n", PACKAGE_NAME ); g_print( "License (see COPYING).\n" ); g_print( "\n" ); g_debug( "Program has been compiled against Glib %d.%d.%d, Gtk+ %d.%d.%d", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION, GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION ); g_debug( "Current system runs Glib %d.%d.%d, Gtk+ %d.%d.%d\n", glib_major_version, glib_minor_version, glib_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version ); } nautilus-actions-3.2.3/src/core/na-icontext.c0000644000175100017500000010574012212601376016066 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_GDBUS #include #else # ifdef HAVE_DBUS_GLIB #include # endif #endif #include #include #include #include #include #include #include #include #include #include "na-desktop-environment.h" #include "na-gnome-vfs-uri.h" #include "na-selected-info.h" #include "na-settings.h" /* private interface data */ struct _NAIContextInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; static guint st_initializations = 0; /* interface initialization count */ static GType register_type( void ); static void interface_base_init( NAIContextInterface *klass ); static void interface_base_finalize( NAIContextInterface *klass ); static gboolean v_is_candidate( NAIContext *object, guint target, GList *selection ); static gboolean is_candidate_for_target( const NAIContext *object, guint target, GList *files ); static gboolean is_candidate_for_show_in( const NAIContext *object, guint target, GList *files ); static gboolean is_candidate_for_try_exec( const NAIContext *object, guint target, GList *files ); static gboolean is_candidate_for_show_if_registered( const NAIContext *object, guint target, GList *files ); static gboolean is_candidate_for_show_if_true( const NAIContext *object, guint target, GList *files ); static gboolean is_candidate_for_show_if_running( const NAIContext *object, guint target, GList *files ); static gboolean is_candidate_for_mimetypes( const NAIContext *object, guint target, GList *files ); static gboolean is_all_mimetype( const gchar *mimetype ); static gboolean is_file_mimetype( const gchar *mimetype ); static gboolean is_mimetype_of( const gchar *file_type, const gchar *ftype, gboolean is_regular ); static gboolean is_candidate_for_basenames( const NAIContext *object, guint target, GList *files ); static gboolean is_candidate_for_selection_count( const NAIContext *object, guint target, GList *files ); static gboolean is_candidate_for_schemes( const NAIContext *object, guint target, GList *files ); static gboolean is_compatible_scheme( const gchar *pattern, const gchar *scheme ); static gboolean is_candidate_for_folders( const NAIContext *object, guint target, GList *files ); static gboolean is_candidate_for_capabilities( const NAIContext *object, guint target, GList *files ); static gboolean is_valid_basenames( const NAIContext *object ); static gboolean is_valid_mimetypes( const NAIContext *object ); static gboolean is_valid_schemes( const NAIContext *object ); static gboolean is_valid_folders( const NAIContext *object ); static gboolean is_positive_assertion( const gchar *assertion ); /** * na_icontext_get_type: * * Returns: the #GType type of this interface. */ GType na_icontext_get_type( void ) { static GType type = 0; if( !type ){ type = register_type(); } return( type ); } /* * na_icontext_register_type: * * Registers this interface. */ static GType register_type( void ) { static const gchar *thisfn = "na_icontext_register_type"; GType type; static const GTypeInfo info = { sizeof( NAIContextInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NAIContext", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( NAIContextInterface *klass ) { static const gchar *thisfn = "na_icontext_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass%p (%s)", thisfn, ( void * ) klass, G_OBJECT_CLASS_NAME( klass )); klass->private = g_new0( NAIContextInterfacePrivate, 1 ); } st_initializations += 1; } static void interface_base_finalize( NAIContextInterface *klass ) { static const gchar *thisfn = "na_icontext_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } /** * na_icontext_are_equal: * @a: the (original) #NAIContext context. * @b: the (duplicated) #NAIContext context to be checked. * * Returns: %TRUE if this @a and @b are equal, %FALSE else. * * Since: 3.1 */ gboolean na_icontext_are_equal( const NAIContext *a, const NAIContext *b ) { static const gchar *thisfn = "na_icontext_are_equal"; gboolean are_equal; g_return_val_if_fail( NA_IS_ICONTEXT( a ), FALSE ); g_return_val_if_fail( NA_IS_ICONTEXT( b ), FALSE ); g_debug( "%s: a=%p, b=%p", thisfn, ( void * ) a, ( void * ) b ); are_equal = TRUE; return( are_equal ); } /** * na_icontext_is_candidate: * @context: a #NAIContext to be checked. * @target: the current target. * @selection: the currently selected items, as a #GList of NASelectedInfo items. * * Determines if the given object may be candidate to be displayed in * the Nautilus context menu, depending of the list of currently selected * items. * * This function is called by build_nautilus_menus * plugin function for each item found in NAPivot items list, and, when this * an action, for each profile of this action. * * Returns: %TRUE if this @context succeeds to all tests and is so a * valid candidate to be displayed in Nautilus context menu, %FALSE * else. * * Since: 2.30 */ gboolean na_icontext_is_candidate( const NAIContext *context, guint target, GList *selection ) { static const gchar *thisfn = "na_icontext_is_candidate"; gboolean is_candidate; g_return_val_if_fail( NA_IS_ICONTEXT( context ), FALSE ); g_debug( "%s: object=%p (%s), target=%d, selection=%p (count=%d)", thisfn, ( void * ) context, G_OBJECT_TYPE_NAME( context ), target, (void * ) selection, g_list_length( selection )); is_candidate = v_is_candidate( NA_ICONTEXT( context ), target, selection ); if( is_candidate ){ is_candidate = is_candidate_for_target( context, target, selection ) && is_candidate_for_show_in( context, target, selection ) && is_candidate_for_try_exec( context, target, selection ) && is_candidate_for_show_if_registered( context, target, selection ) && is_candidate_for_show_if_true( context, target, selection ) && is_candidate_for_show_if_running( context, target, selection ) && is_candidate_for_mimetypes( context, target, selection ) && is_candidate_for_basenames( context, target, selection ) && is_candidate_for_selection_count( context, target, selection ) && is_candidate_for_schemes( context, target, selection ) && is_candidate_for_folders( context, target, selection ) && is_candidate_for_capabilities( context, target, selection ); } return( is_candidate ); } /** * na_icontext_is_valid: * @context: the #NAIContext to be checked. * * Returns: %TRUE if this @context is valid, %FALSE else. * * This function is part of NAIDuplicable::check_status * and is called by #NAIDuplicable objects which also implement #NAIContext * interface. It so doesn't make sense of asking the object for its * validity status as it has already been checked before calling the * function. * * Since: 2.30 */ gboolean na_icontext_is_valid( const NAIContext *context ) { static const gchar *thisfn = "na_icontext_is_valid"; gboolean is_valid; g_return_val_if_fail( NA_IS_ICONTEXT( context ), FALSE ); g_debug( "%s: context=%p (%s)", thisfn, ( void * ) context, G_OBJECT_TYPE_NAME( context )); is_valid = is_valid_basenames( context ) && is_valid_mimetypes( context ) && is_valid_schemes( context ) && is_valid_folders( context ); return( is_valid ); } /** * na_icontext_check_mimetypes: * @context: the #NAIContext object to be checked. * * Check the current list of mimetypes to see if it covers all mimetypes, * or all regular files, or something else. * * Since: 2.30 */ void na_icontext_check_mimetypes( const NAIContext *context ) { static const gchar *thisfn = "na_icontext_check_mimetypes"; gboolean is_all; GSList *mimetypes, *im; g_return_if_fail( NA_IS_ICONTEXT( context )); is_all = TRUE; mimetypes = na_object_get_mimetypes( context ); for( im = mimetypes ; im ; im = im->next ){ if( !im->data || !strlen( im->data )){ g_debug( "%s: empty mimetype for context=%p", thisfn, ( void * ) context ); continue; } const gchar *imtype = ( const gchar * ) im->data; if( is_all_mimetype( imtype )){ continue; } is_all = FALSE; /* do not break here so that we are able to check all mimetypes */ } na_object_set_all_mimetypes( context, is_all ); na_core_utils_slist_free( mimetypes ); } /** * na_icontext_copy: * @context: the target #NAIContext context. * @source: the source #NAIContext context. * * Copy specific data from @source to @context. * * Since: 3.1 */ void na_icontext_copy( NAIContext *context, const NAIContext *source ) { /* nothing to do for now */ } /** * na_icontext_read_done: * @context: the #NAIContext to be prepared. * * Prepares the specified #NAIContext just after it has been read. * * * * * This setup an internal flag when mimetypes is like 'all/all' * in order to optimize computation time; * * * * * Since: 2.30 */ void na_icontext_read_done( NAIContext *context ) { na_object_check_mimetypes( context ); } /** * na_icontext_set_scheme: * @context: the #NAIContext to be updated. * @scheme: name of the scheme. * @selected: whether this scheme is candidate to this @context. * * Sets the status of a @scheme relative to this @context. * * Since: 2.30 */ void na_icontext_set_scheme( NAIContext *context, const gchar *scheme, gboolean selected ) { GSList *schemes; g_return_if_fail( NA_IS_ICONTEXT( context )); schemes = na_object_get_schemes( context ); schemes = na_core_utils_slist_setup_element( schemes, scheme, selected ); na_object_set_schemes( context, schemes ); na_core_utils_slist_free( schemes ); } /** * na_icontext_set_only_desktop: * @context: the #NAIContext to be updated. * @desktop: name of the desktop environment. * @selected: whether this @desktop is candidate to this @context. * * Sets the status of the @desktop relative to this @context for the OnlyShowIn list. * * Since: 2.30 */ void na_icontext_set_only_desktop( NAIContext *context, const gchar *desktop, gboolean selected ) { GSList *desktops; g_return_if_fail( NA_IS_ICONTEXT( context )); desktops = na_object_get_only_show_in( context ); desktops = na_core_utils_slist_setup_element( desktops, desktop, selected ); na_object_set_only_show_in( context, desktops ); na_core_utils_slist_free( desktops ); } /** * na_icontext_set_only_desktop: * @context: the #NAIContext to be updated. * @desktop: name of the desktop environment. * @selected: whether this @desktop is candidate to this @context. * * Sets the status of the @desktop relative to this @context for the NotShowIn list. * * Since: 2.30 */ void na_icontext_set_not_desktop( NAIContext *context, const gchar *desktop, gboolean selected ) { GSList *desktops; g_return_if_fail( NA_IS_ICONTEXT( context )); desktops = na_object_get_not_show_in( context ); desktops = na_core_utils_slist_setup_element( desktops, desktop, selected ); na_object_set_not_show_in( context, desktops ); na_core_utils_slist_free( desktops ); } /** * na_icontext_replace_folder: * @context: the #NAIContext to be updated. * @old: the old uri. * @new: the new uri. * * Replaces the @old URI by the @new one. * * Since: 2.30 */ void na_icontext_replace_folder( NAIContext *context, const gchar *old, const gchar *new ) { GSList *folders; g_return_if_fail( NA_IS_ICONTEXT( context )); folders = na_object_get_folders( context ); folders = na_core_utils_slist_remove_utf8( folders, old ); folders = g_slist_append( folders, ( gpointer ) g_strdup( new )); na_object_set_folders( context, folders ); na_core_utils_slist_free( folders ); } static gboolean v_is_candidate( NAIContext *context, guint target, GList *selection ) { gboolean is_candidate; is_candidate = TRUE; if( NA_ICONTEXT_GET_INTERFACE( context )->is_candidate ){ is_candidate = NA_ICONTEXT_GET_INTERFACE( context )->is_candidate( context, target, selection ); } return( is_candidate ); } /* * whether the given NAIContext object is candidate for this target * target is context menu for location, context menu for selection or toolbar for location * only actions are concerned by this check */ static gboolean is_candidate_for_target( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_target"; gboolean ok = TRUE; if( NA_IS_OBJECT_ACTION( object )){ switch( target ){ case ITEM_TARGET_LOCATION: ok = na_object_is_target_location( object ); break; case ITEM_TARGET_TOOLBAR: ok = na_object_is_target_toolbar( object ); break; case ITEM_TARGET_SELECTION: ok = na_object_is_target_selection( object ); break; case ITEM_TARGET_ANY: ok = TRUE; break; default: g_warning( "%s: unknonw target=%d", thisfn, target ); ok = FALSE; } } if( !ok ){ g_debug( "%s: object is not candidate because target doesn't match (asked=%d)", thisfn, target ); /*na_object_dump( object );*/ } return( ok ); } /* * only show in / not show in * only one of these two data may be set */ static gboolean is_candidate_for_show_in( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_show_in"; gboolean ok = TRUE; GSList *only_in = na_object_get_only_show_in( object ); GSList *not_in = na_object_get_not_show_in( object ); static gchar *environment = NULL; /* there is a memory leak here when desktop comes from user preferences * because it is never freed (because it may come from runtime detection) * but this occurs only once.. */ if( !environment ){ environment = na_settings_get_string( NA_IPREFS_DESKTOP_ENVIRONMENT, NULL, NULL ); if( !environment || !strlen( environment )){ environment = ( gchar * ) na_desktop_environment_detect_running_desktop(); } g_debug( "%s: found %s desktop", thisfn, environment ); } if( only_in && g_slist_length( only_in )){ ok = ( na_core_utils_slist_count( only_in, environment ) > 0 ); } else if( not_in && g_slist_length( not_in )){ ok = ( na_core_utils_slist_count( not_in, environment ) == 0 ); } if( !ok ){ gchar *only_str = na_core_utils_slist_to_text( only_in ); gchar *not_str = na_core_utils_slist_to_text( not_in ); g_debug( "%s: object is not candidate because OnlyShowIn=%s, NotShowIn=%s", thisfn, only_str, not_str ); g_free( not_str ); g_free( only_str ); } na_core_utils_slist_free( not_in ); na_core_utils_slist_free( only_in ); return( ok ); } /* * if the data is set, it should be the path of an executable file */ static gboolean is_candidate_for_try_exec( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_try_exec"; gboolean ok = TRUE; GError *error = NULL; gchar *tryexec = na_object_get_try_exec( object ); if( tryexec && strlen( tryexec )){ ok = FALSE; GFile *file = g_file_new_for_path( tryexec ); GFileInfo *info = g_file_query_info( file, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE, G_FILE_QUERY_INFO_NONE, NULL, &error ); if( error ){ g_debug( "%s: %s", thisfn, error->message ); g_error_free( error ); } else { ok = g_file_info_get_attribute_boolean( info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE ); } if( info ){ g_object_unref( info ); } g_object_unref( file ); } if( !ok ){ g_debug( "%s: object is not candidate because TryExec=%s", thisfn, tryexec ); } g_free( tryexec ); return( ok ); } static gboolean is_candidate_for_show_if_registered( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_show_if_registered"; gboolean ok = TRUE; gchar *name = na_object_get_show_if_registered( object ); if( name && strlen( name )){ ok = FALSE; #ifdef HAVE_GDBUS #else # ifdef HAVE_DBUS_GLIB GError *error = NULL; DBusGConnection *connection = dbus_g_bus_get( DBUS_BUS_SESSION, &error ); if( !connection ){ if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } } else { DBusGProxy *proxy = dbus_g_proxy_new_for_name( connection, name, NULL, NULL ); ok = ( proxy != NULL ); dbus_g_connection_unref( connection ); } # endif #endif } if( !ok ){ g_debug( "%s: object is not candidate because ShowIfRegistered=%s", thisfn, name ); } g_free( name ); return( ok ); } static gboolean is_candidate_for_show_if_true( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_show_if_true"; gboolean ok = TRUE; gchar *command = na_object_get_show_if_true( object ); if( command && strlen( command )){ ok = FALSE; gchar *stdout = NULL; g_spawn_command_line_sync( command, &stdout, NULL, NULL, NULL ); if( stdout && !strcmp( stdout, "true" )){ ok = TRUE; } g_free( stdout ); } if( !ok ){ g_debug( "%s: object is not candidate because ShowIfTrue=%s", thisfn, command ); } g_free( command ); return( ok ); } static gboolean is_candidate_for_show_if_running( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_show_if_running"; gboolean ok = TRUE; gchar *searched; glibtop_proclist proclist; glibtop_proc_state procstate; pid_t *pid_list; guint i; gchar *running = na_object_get_show_if_running( object ); if( running && strlen( running )){ ok = FALSE; searched = g_path_get_basename( running ); pid_list = glibtop_get_proclist( &proclist, GLIBTOP_KERN_PROC_ALL, 0 ); for( i=0 ; inext ){ gchar *ftype; gboolean regular, match, positive; match = FALSE; ftype = na_selected_info_get_mime_type( NA_SELECTED_INFO( it->data )); regular = na_selected_info_is_regular( NA_SELECTED_INFO( it->data )); if( ftype ){ for( im = mimetypes ; im && ok ; im = im->next ){ const gchar *imtype = ( const gchar * ) im->data; positive = is_positive_assertion( imtype ); if( !positive || !match ){ if( is_mimetype_of( positive ? imtype : imtype+1, ftype, regular )){ g_debug( "%s: condition=%s, positive=%s, ftype=%s, matched", thisfn, imtype, positive ? "True":"False", ftype ); if( positive ){ match = TRUE; } else { ok = FALSE; } } } } if( !match ){ gchar *mimetypes_str = na_core_utils_slist_to_text( mimetypes ); g_debug( "%s: no positive match found for Mimetypes=%s", thisfn, mimetypes_str ); g_free( mimetypes_str ); ok = FALSE; } } else { gchar *uri = na_selected_info_get_uri( NA_SELECTED_INFO( it->data )); g_warning( "%s: null mimetype found for %s", thisfn, uri ); g_free( uri ); ok = FALSE; } g_free( ftype ); } na_core_utils_slist_free( mimetypes ); } return( ok ); } static gboolean is_all_mimetype( const gchar *mimetype ) { return( !strcmp( mimetype, "*" ) || !strcmp( mimetype, "*/*" ) || !strcmp( mimetype, "*/all" ) || /* should be considered as invalid */ !strcmp( mimetype, "all" ) || !strcmp( mimetype, "all/*" ) || !strcmp( mimetype, "all/all" )); } static gboolean is_file_mimetype( const gchar *mimetype ) { return( !strcmp( mimetype, "allfiles" ) || !strcmp( mimetype, "*/allfiles" ) || /* should be considered as invalid */ !strcmp( mimetype, "allfiles/*" ) || !strcmp( mimetype, "allfiles/all" ) || !strcmp( mimetype, "all/allfiles" )); } /* * does the file fgroup/fsubgroup have a mimetype which is 'a sort of' * mimetype specified one ? * for example, "image/jpeg" is clearly a sort of "image/ *" * * content type if the same as the mime type in *nix; * this is not true on Win32 platforms */ static gboolean is_mimetype_of( const gchar *mimetype, const gchar *ftype, gboolean is_regular ) { static const gchar *thisfn = "na_icontext_is_mimetype_of"; gboolean is_type_of; gchar *file_content_type, *def_content_type; if( is_all_mimetype( mimetype )){ return( TRUE ); } if( is_file_mimetype( mimetype ) && is_regular ){ return( TRUE ); } is_type_of = FALSE; file_content_type = g_content_type_from_mime_type( ftype ); def_content_type = g_content_type_from_mime_type( mimetype ); if( file_content_type && def_content_type ){ is_type_of = g_content_type_is_a( file_content_type, def_content_type ); g_debug( "%s: def_mimetype=%s content_type=%s file_mimetype=%s content_type=%s is_a=%s", thisfn, mimetype, def_content_type, ftype, file_content_type, is_type_of ? "True":"False" ); } g_free( file_content_type ); g_free( def_content_type ); return( is_type_of ); } static gboolean is_candidate_for_basenames( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_basenames"; gboolean ok = TRUE; GSList *basenames = na_object_get_basenames( object ); if( basenames ){ if( strcmp( basenames->data, "*" ) != 0 || g_slist_length( basenames ) > 1 ){ gboolean matchcase = na_object_get_matchcase( object ); GSList *ib; GList *it; gchar *tmp; for( it = files ; it && ok ; it = it->next ){ gchar *pattern, *bname, *bname_utf8; gboolean match, positive; gchar *pattern_utf8; bname = na_selected_info_get_basename( NA_SELECTED_INFO( it->data )); bname_utf8 = g_filename_to_utf8( bname, -1, NULL, NULL, NULL ); if( !matchcase ){ tmp = g_utf8_strdown( bname_utf8, -1 ); g_free( bname_utf8 ); bname_utf8 = tmp; } match = FALSE; for( ib = basenames ; ib && ok ; ib = ib->next ){ pattern = matchcase ? g_strdup(( gchar * ) ib->data ) : g_utf8_strdown(( gchar * ) ib->data, -1 ); positive = is_positive_assertion( pattern ); pattern_utf8 = g_filename_to_utf8( positive ? pattern : pattern+1, -1, NULL, NULL, NULL ); if( !positive || !match ){ if( g_pattern_match_simple( pattern_utf8, bname_utf8 )){ g_debug( "%s: condition=%s, positive=%s, basename=%s: matched", thisfn, pattern_utf8, positive ? "True":"False", bname_utf8 ); if( positive ){ match = TRUE; } else { ok = FALSE; } } } g_free( pattern_utf8 ); g_free( pattern ); } if( !match ){ gchar *basenames_str = na_core_utils_slist_to_text( basenames ); g_debug( "%s: no positive match found for Basenames=%s", thisfn, basenames_str ); g_free( basenames_str ); ok = FALSE; } g_free( bname_utf8 ); g_free( bname ); } } na_core_utils_slist_free( basenames ); } return( ok ); } static gboolean is_candidate_for_selection_count( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_selection_count"; gboolean ok = TRUE; gint limit; guint count; gchar *selection_count = na_object_get_selection_count( object ); if( selection_count && strlen( selection_count )){ limit = atoi( selection_count+1 ); count = g_list_length( files ); ok = FALSE; switch( selection_count[0] ){ case '<': ok = ( count < limit ); break; case '=': ok = ( count == limit ); break; case '>': ok = ( count > limit ); break; default: break; } } if( !ok ){ g_debug( "%s: object is not candidate because SelectionCount=%s", thisfn, selection_count ); } g_free( selection_count ); return( ok ); } /* * it is likely that all selected items have the same scheme, because they * are all in the same location and the scheme mainly depends on location * so we have here a great possible optimization by only testing the * first selected item. * note that this optimization may be wrong, for example when ran from the * command-line with a random set of pseudo-selected items * so we take care of only checking _distincts_ schemes of provided selection * against schemes conditions. */ static gboolean is_candidate_for_schemes( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_schemes"; gboolean ok = TRUE; GSList *schemes = na_object_get_schemes( object ); if( schemes ){ if( strcmp( schemes->data, "*" ) != 0 || g_slist_length( schemes ) > 1 ){ GSList *distincts = NULL; GList *it; for( it = files ; it && ok ; it = it->next ){ gchar *scheme = na_selected_info_get_uri_scheme( NA_SELECTED_INFO( it->data )); if( na_core_utils_slist_count( distincts, scheme ) == 0 ){ GSList *is; gchar *pattern; gboolean match, positive; match = FALSE; distincts = g_slist_prepend( distincts, g_strdup( scheme )); for( is = schemes ; is && ok ; is = is->next ){ pattern = ( gchar * ) is->data; positive = is_positive_assertion( pattern ); if( !positive || !match ){ if( is_compatible_scheme( positive ? pattern : pattern+1, scheme )){ if( positive ){ match = TRUE; } else { ok = FALSE; } } } } ok &= match; } g_free( scheme ); } na_core_utils_slist_free( distincts ); } if( !ok ){ gchar *schemes_str = na_core_utils_slist_to_text( schemes ); g_debug( "%s: object is not candidate because Schemes=%s", thisfn, schemes_str ); g_free( schemes_str ); } na_core_utils_slist_free( schemes ); } g_debug( "%s: ok=%s", thisfn, ok ? "True":"False" ); return( ok ); } static gboolean is_compatible_scheme( const gchar *pattern, const gchar *scheme ) { gboolean compatible; compatible = FALSE; if( strcmp( pattern, "*" ) == 0 ){ compatible = TRUE; } else { compatible = ( strcmp( pattern, scheme ) == 0 ); } return( compatible ); } /* * assuming here the same sort of optimization than for schemes * i.e. we assume that all selected items are most probably located * in the same dirname * so we take care of only checking _distinct_ dirnames against folder * conditions */ static gboolean is_candidate_for_folders( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_folders"; gboolean ok = TRUE; GSList *folders = na_object_get_folders( object ); if( folders ){ if( strcmp( folders->data, "/" ) != 0 || g_slist_length( folders ) > 1 ){ GSList *distincts = NULL; GList *it; for( it = files ; it && ok ; it = it->next ){ gchar *dirname = na_selected_info_get_dirname( NA_SELECTED_INFO( it->data )); if( na_core_utils_slist_count( distincts, dirname ) == 0 ){ g_debug( "%s: examining new distinct selected dirname=%s", thisfn, dirname ); GSList *id; gchar *dirname_utf8, *pattern_utf8; const gchar *pattern; gboolean match, positive; gboolean has_pattern; distincts = g_slist_prepend( distincts, g_strdup( dirname )); dirname_utf8 = g_filename_to_utf8( dirname, -1, NULL, NULL, NULL ); for( id = folders ; id && ok ; id = id->next ){ pattern = ( const gchar * ) id->data; g_debug( "%s: examining new condition pattern=%s", thisfn, pattern ); positive = is_positive_assertion( pattern ); pattern_utf8 = g_filename_to_utf8( positive ? pattern : pattern+1, -1, NULL, NULL, NULL ); has_pattern = ( g_strstr_len( pattern_utf8, -1, "*" ) != NULL ); match = ( has_pattern && g_pattern_match_simple( pattern_utf8, dirname_utf8 )) || g_str_has_prefix( dirname_utf8, pattern_utf8 ); ok &= ( match && positive ) || ( !match && !positive ); g_free( pattern_utf8 ); } g_free( dirname_utf8 ); } g_free( dirname ); } na_core_utils_slist_free( distincts ); } if( !ok ){ gchar *folders_str = na_core_utils_slist_to_text( folders ); g_debug( "%s: object is not candidate because Folders=%s", thisfn, folders_str ); g_free( folders_str ); } na_core_utils_slist_free( folders ); } return( ok ); } static gboolean is_candidate_for_capabilities( const NAIContext *object, guint target, GList *files ) { static const gchar *thisfn = "na_icontext_is_candidate_for_capabilities"; gboolean ok = TRUE; GSList *capabilities = na_object_get_capabilities( object ); if( capabilities ){ GSList *ic; GList *it; const gchar *cap; gboolean match, positive; for( it = files ; it && ok ; it = it->next ){ for( ic = capabilities ; ic && ok ; ic = ic->next ){ cap = ( const gchar * ) ic->data; positive = is_positive_assertion( cap ); match = FALSE; if( !strcmp( positive ? cap : cap+1, "Owner" )){ match = na_selected_info_is_owner( NA_SELECTED_INFO( it->data ), getlogin()); } else if( !strcmp( positive ? cap : cap+1, "Readable" )){ match = na_selected_info_is_readable( NA_SELECTED_INFO( it->data )); } else if( !strcmp( positive ? cap : cap+1, "Writable" )){ match = na_selected_info_is_writable( NA_SELECTED_INFO( it->data )); } else if( !strcmp( positive ? cap : cap+1, "Executable" )){ match = na_selected_info_is_executable( NA_SELECTED_INFO( it->data )); } else if( !strcmp( positive ? cap : cap+1, "Local" )){ match = na_selected_info_is_local( NA_SELECTED_INFO( it->data )); } else { g_warning( "%s: unknown capability %s", thisfn, cap ); } ok &= (( positive && match ) || ( !positive && !match )); } } if( !ok ){ gchar *capabilities_str = na_core_utils_slist_to_text( capabilities ); g_debug( "%s: object is not candidate because Capabilities=%s", thisfn, capabilities_str ); g_free( capabilities_str ); } na_core_utils_slist_free( capabilities ); } return( ok ); } static gboolean is_valid_basenames( const NAIContext *object ) { gboolean valid; GSList *basenames; basenames = na_object_get_basenames( object ); valid = basenames && g_slist_length( basenames ) > 0; na_core_utils_slist_free( basenames ); if( !valid ){ na_object_debug_invalid( object, "basenames" ); } return( valid ); } /* * check * that the list is not empty * that there is not empty item * that no mimetype is coded as '* / something' */ static gboolean is_valid_mimetypes( const NAIContext *object ) { static const gchar *thisfn = "na_icontext_is_valid_mimetypes"; gboolean valid; GSList *mimetypes, *it; guint count_ok, count_errs; const gchar *imtype; mimetypes = na_object_get_mimetypes( object ); count_ok = 0; count_errs = 0; for( it = mimetypes ; it ; it = it->next ){ imtype = ( const gchar * ) it->data; if( !imtype || !strlen( imtype )){ g_debug( "%s: null or empty mimetype", thisfn ); count_errs +=1; continue; } if( imtype[0] == '*' ){ if( imtype[1] ){ if( imtype[1] != '/' ){ g_debug( "%s: invalid mimetype: %s", thisfn, imtype ); count_errs +=1; continue; } if( imtype[2] && imtype[2] != '*' ){ g_debug( "%s: invalid mimetype: %s", thisfn, imtype ); count_errs +=1; continue; } } } count_ok += 1; } valid = ( count_ok > 0 && count_errs == 0 ); if( !valid ){ na_object_debug_invalid( object, "mimetypes" ); } na_core_utils_slist_free( mimetypes ); return( valid ); } static gboolean is_valid_schemes( const NAIContext *object ) { gboolean valid; GSList *schemes; schemes = na_object_get_schemes( object ); valid = schemes && g_slist_length( schemes ) > 0; na_core_utils_slist_free( schemes ); if( !valid ){ na_object_debug_invalid( object, "schemes" ); } return( valid ); } static gboolean is_valid_folders( const NAIContext *object ) { gboolean valid; GSList *folders; folders = na_object_get_folders( object ); valid = folders && g_slist_length( folders ) > 0; na_core_utils_slist_free( folders ); if( !valid ){ na_object_debug_invalid( object, "folders" ); } return( valid ); } /* * "image/ *" is a positive assertion * "!image/jpeg" is a negative one */ static gboolean is_positive_assertion( const gchar *assertion ) { gboolean positive = TRUE; if( assertion ){ gchar *dupped = g_strdup( assertion ); const gchar *stripped = g_strstrip( dupped ); if( stripped ){ positive = ( stripped[0] != '!' ); } g_free( dupped ); } return( positive ); } nautilus-actions-3.2.3/src/core/na-iimporter.c0000644000175100017500000002033412212601376016236 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include /* private interface data */ struct _NAIImporterInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; static guint st_initializations = 0; /* interface initialization count */ static GType register_type( void ); static void interface_base_init( NAIImporterInterface *klass ); static void interface_base_finalize( NAIImporterInterface *klass ); static guint iimporter_get_version( const NAIImporter *instance ); #ifdef NA_ENABLE_DEPRECATED static void renumber_label_item( NAIImporterManageImportModeParms *parms ); #endif /** * na_iimporter_get_type: * * Returns: the #GType type of this interface. */ GType na_iimporter_get_type( void ) { static GType type = 0; if( !type ){ type = register_type(); } return( type ); } /* * na_iimporter_register_type: * * Registers this interface. */ static GType register_type( void ) { static const gchar *thisfn = "na_iimporter_register_type"; GType type; static const GTypeInfo info = { sizeof( NAIImporterInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NAIImporter", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( NAIImporterInterface *klass ) { static const gchar *thisfn = "na_iimporter_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass%p (%s)", thisfn, ( void * ) klass, G_OBJECT_CLASS_NAME( klass )); klass->private = g_new0( NAIImporterInterfacePrivate, 1 ); klass->get_version = iimporter_get_version; klass->import_from_uri = NULL; } st_initializations += 1; } static void interface_base_finalize( NAIImporterInterface *klass ) { static const gchar *thisfn = "na_iimporter_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } static guint iimporter_get_version( const NAIImporter *instance ) { return( 1 ); } /** * na_iimporter_import_from_uri: * @importer: this #NAIImporter instance. * @parms: a #NAIImporterImportFromUriParmsv2 structure. * * Tries to import a #NAObjectItem from the URI specified in @parms, returning * the result in @parms->imported. * * Note that, starting with &prodname; 3.2, the @parms argument is no more a * #NAIImporterImportFromUriParms pointer, but a #NAIImporterImportFromUriParmsv2 * one. * * Returns: the return code of the operation. * * Since: 2.30 */ guint na_iimporter_import_from_uri( const NAIImporter *importer, NAIImporterImportFromUriParmsv2 *parms ) { static const gchar *thisfn = "na_iimporter_import_from_uri"; guint code; g_return_val_if_fail( NA_IS_IIMPORTER( importer ), IMPORTER_CODE_PROGRAM_ERROR ); g_return_val_if_fail( parms && parms->version == 2, IMPORTER_CODE_PROGRAM_ERROR ); code = IMPORTER_CODE_NOT_WILLING_TO; g_debug( "%s: importer=%p (%s), parms=%p", thisfn, ( void * ) importer, G_OBJECT_TYPE_NAME( importer), ( void * ) parms ); if( NA_IIMPORTER_GET_INTERFACE( importer )->import_from_uri ){ code = NA_IIMPORTER_GET_INTERFACE( importer )->import_from_uri( importer, parms ); } return( code ); } #ifdef NA_ENABLE_DEPRECATED /** * na_iimporter_manage_import_mode: * @parms: a #NAIImporterManageImportModeParms struct. * * Returns: the #NAIImporterImportStatus status of the operation: * * * * * IMPORTER_CODE_OK if we can safely insert the action: * * * * the id doesn't already exist * * * or the id already exists, but import mode is renumber * * * or the id already exists, but import mode is override * * * * * * IMPORTER_CODE_CANCELLED if user chooses to cancel the operation * * * * * Since: 2.30 * Deprecated: 3.2 */ guint na_iimporter_manage_import_mode( NAIImporterManageImportModeParms *parms ) { static const gchar *thisfn = "na_iimporter_manage_import_mode"; guint code; NAObjectItem *exists; guint mode; gchar *id; g_return_val_if_fail( parms->imported != NULL, IMPORTER_CODE_CANCELLED ); code = IMPORTER_CODE_OK; exists = NULL; mode = 0; parms->exist = FALSE; parms->import_mode = parms->asked_mode; if( parms->check_fn ){ exists = ( *parms->check_fn )( parms->imported, parms->check_fn_data ); } else { renumber_label_item( parms ); na_core_utils_slist_add_message( &parms->messages, "%s", _( "Item was renumbered because the caller did not provide any check function." )); parms->import_mode = IMPORTER_MODE_RENUMBER; } g_debug( "%s: exists=%p", thisfn, exists ); if( exists ){ parms->exist = TRUE; if( parms->asked_mode == IMPORTER_MODE_ASK ){ if( parms->ask_fn ){ mode = ( *parms->ask_fn )( parms->imported, exists, parms->ask_fn_data ); } else { renumber_label_item( parms ); na_core_utils_slist_add_message( &parms->messages, "%s", _( "Item was renumbered because the caller did not provide any ask user function." )); parms->import_mode = IMPORTER_MODE_RENUMBER; } } else { mode = parms->asked_mode; } } /* mode is only set if asked mode is ask user and an ask function was provided * or if asked mode was not ask user */ if( mode ){ parms->import_mode = mode; switch( mode ){ case IMPORTER_MODE_RENUMBER: renumber_label_item( parms ); if( parms->asked_mode == IMPORTER_MODE_ASK ){ na_core_utils_slist_add_message( &parms->messages, "%s", _( "Item was renumbered due to user request." )); } break; case IMPORTER_MODE_OVERRIDE: if( parms->asked_mode == IMPORTER_MODE_ASK ){ na_core_utils_slist_add_message( &parms->messages, "%s", _( "Existing item was overriden due to user request." )); } break; case IMPORTER_MODE_NO_IMPORT: default: id = na_object_get_id( parms->imported ); na_core_utils_slist_add_message( &parms->messages, _( "Item %s already exists." ), id ); if( parms->asked_mode == IMPORTER_MODE_ASK ){ na_core_utils_slist_add_message( &parms->messages, "%s", _( "Import was canceled due to user request." )); } g_free( id ); code = IMPORTER_CODE_CANCELLED; } } return( code ); } /* * renumber the item, and set a new label */ static void renumber_label_item( NAIImporterManageImportModeParms *parms ) { gchar *label, *tmp; na_object_set_new_id( parms->imported, NULL ); label = na_object_get_label( parms->imported ); /* i18n: the action has been renumbered during import operation */ tmp = g_strdup_printf( "%s %s", label, _( "(renumbered)" )); na_object_set_label( parms->imported, tmp ); g_free( tmp ); g_free( label ); } #endif /* NA_ENABLE_DEPRECATED */ nautilus-actions-3.2.3/src/core/na-module.c0000644000175100017500000003340112212601376015510 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "na-module.h" /* private class data */ struct _NAModuleClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAModulePrivate { gboolean dispose_has_run; gchar *path; /* full pathname of the plugin */ gchar *name; /* basename without the extension */ GModule *library; GList *objects; /* api */ gboolean ( *startup ) ( GTypeModule *module ); guint ( *get_version )( void ); gint ( *list_types ) ( const GType **types ); void ( *shutdown ) ( void ); }; static GTypeModuleClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAModuleClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static NAModule *module_new( const gchar *filename ); static gboolean on_module_load( GTypeModule *gmodule ); static gboolean is_a_na_plugin( NAModule *module ); static gboolean plugin_check( NAModule *module, const gchar *symbol, gpointer *pfn ); static void register_module_types( NAModule *module ); static void add_module_type( NAModule *module, GType type ); static void object_weak_notify( NAModule *module, GObject *object ); static void on_module_unload( GTypeModule *gmodule ); GType na_module_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_module_register_type"; GType type; static GTypeInfo info = { sizeof( NAModuleClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAModule ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_TYPE_MODULE, "NAModule", &info, 0 ); return( type ); } static void class_init( NAModuleClass *klass ) { static const gchar *thisfn = "na_module_class_init"; GObjectClass *object_class; GTypeModuleClass *module_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; module_class = G_TYPE_MODULE_CLASS( klass ); module_class->load = on_module_load; module_class->unload = on_module_unload; klass->private = g_new0( NAModuleClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_module_instance_init"; NAModule *self; g_return_if_fail( NA_IS_MODULE( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_MODULE( instance ); self->private = g_new0( NAModulePrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_module_instance_dispose"; NAModule *self; g_return_if_fail( NA_IS_MODULE( object )); self = NA_MODULE( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_module_instance_finalize"; NAModule *self; g_return_if_fail( NA_IS_MODULE( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NA_MODULE( object ); g_free( self->private->path ); g_free( self->private->name ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /* * na_module_dump: * @module: this #NAModule instance. * * Dumps the content of the module. */ void na_module_dump( const NAModule *module ) { static const gchar *thisfn = "na_module_dump"; GList *iobj; g_debug( "%s: path=%s", thisfn, module->private->path ); g_debug( "%s: name=%s", thisfn, module->private->name ); g_debug( "%s: library=%p", thisfn, ( void * ) module->private->library ); g_debug( "%s: objects=%p (count=%d)", thisfn, ( void * ) module->private->objects, g_list_length( module->private->objects )); for( iobj = module->private->objects ; iobj ; iobj = iobj->next ){ g_debug( "%s: iobj=%p (%s)", thisfn, ( void * ) iobj->data, G_OBJECT_TYPE_NAME( iobj->data )); } } /* * na_module_load_modules: * * Load availables dynamically loadable extension libraries (plugins). * * Returns: a #GList of #NAModule, each object representing a dynamically * loaded library. The list should be na_module_release_modules() by the * caller after use. */ GList * na_module_load_modules( void ) { static const gchar *thisfn = "na_module_load_modules"; const gchar *dirname = PKGLIBDIR; const gchar *suffix = ".so"; GList *modules; GDir *api_dir; GError *error; const gchar *entry; gchar *fname; NAModule *module; g_debug( "%s", thisfn ); modules = NULL; error = NULL; api_dir = g_dir_open( dirname, 0, &error ); if( error ){ g_warning( "%s: g_dir_open: %s", thisfn, error->message ); g_error_free( error ); error = NULL; } else { while(( entry = g_dir_read_name( api_dir )) != NULL ){ if( g_str_has_suffix( entry, suffix )){ fname = g_build_filename( dirname, entry, NULL ); module = module_new( fname ); if( module ){ module->private->name = na_core_utils_str_remove_suffix( entry, suffix ); modules = g_list_prepend( modules, module ); g_debug( "%s: module %s successfully loaded", thisfn, entry ); } g_free( fname ); } } g_dir_close( api_dir ); } return( modules ); } /* * @fname: full pathname of the being-loaded dynamic library. */ static NAModule * module_new( const gchar *fname ) { NAModule *module; module = g_object_new( NA_TYPE_MODULE, NULL ); module->private->path = g_strdup( fname ); if( !g_type_module_use( G_TYPE_MODULE( module )) || !is_a_na_plugin( module )){ g_object_unref( module ); return( NULL ); } register_module_types( module ); return( module ); } /* * triggered by GTypeModule base class when first loading the library, * which is itself triggered by module_new:g_type_module_use() * * returns: %TRUE if the module is successfully loaded */ static gboolean on_module_load( GTypeModule *gmodule ) { static const gchar *thisfn = "na_module_on_module_load"; NAModule *module; gboolean loaded; g_return_val_if_fail( G_IS_TYPE_MODULE( gmodule ), FALSE ); g_debug( "%s: gmodule=%p", thisfn, ( void * ) gmodule ); loaded = FALSE; module = NA_MODULE( gmodule ); module->private->library = g_module_open( module->private->path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL ); if( !module->private->library ){ g_warning( "%s: g_module_open: path=%s, error=%s", thisfn, module->private->path, g_module_error()); } else { loaded = TRUE; } return( loaded ); } /* * the module has been successfully loaded * is it a Nautilus-Action plugin ? * if ok, we ask the plugin to initialize itself * * As of API v 1: * - na_extension_startup, na_extension_list_types and na_extension_shutdown * are mandatory, and MUST be implemented by the plugin * - na_extension_get_version is optional, and defaults to 1. */ static gboolean is_a_na_plugin( NAModule *module ) { static const gchar *thisfn = "na_module_is_a_na_plugin"; gboolean ok; ok = plugin_check( module, "na_extension_startup" , ( gpointer * ) &module->private->startup) && plugin_check( module, "na_extension_list_types" , ( gpointer * ) &module->private->list_types ) && plugin_check( module, "na_extension_shutdown" , ( gpointer * ) &module->private->shutdown ) && module->private->startup( G_TYPE_MODULE( module )); if( ok ){ g_debug( "%s: %s: ok", thisfn, module->private->path ); } return( ok ); } static gboolean plugin_check( NAModule *module, const gchar *symbol, gpointer *pfn ) { static const gchar *thisfn = "na_module_plugin_check"; gboolean ok; ok = g_module_symbol( module->private->library, symbol, pfn ); if( !ok || !pfn ){ g_debug("%s: %s: %s: symbol not found", thisfn, module->private->path, symbol ); } return( ok ); } /* * The 'na_extension_startup' function of the plugin has been already * called ; the GType types the plugin provides have so already been * registered in the GType system * * We ask here the plugin to give us a list of these GTypes. * For each GType, we allocate a new object of the given class * and keep this object in the module's list */ static void register_module_types( NAModule *module ) { const GType *types; guint count, i; count = module->private->list_types( &types ); module->private->objects = NULL; for( i = 0 ; i < count ; i++ ){ if( types[i] ){ add_module_type( module, types[i] ); } } } static void add_module_type( NAModule *module, GType type ) { GObject *object; object = g_object_new( type, NULL ); g_debug( "na_module_add_module_type: allocating object=%p (%s)", ( void * ) object, G_OBJECT_TYPE_NAME( object )); g_object_weak_ref( object, ( GWeakNotify ) object_weak_notify, module ); module->private->objects = g_list_prepend( module->private->objects, object ); } static void object_weak_notify( NAModule *module, GObject *object ) { static const gchar *thisfn = "na_module_object_weak_notify"; g_debug( "%s: module=%p, object=%p (%s)", thisfn, ( void * ) module, ( void * ) object, G_OBJECT_TYPE_NAME( object )); module->private->objects = g_list_remove( module->private->objects, object ); } /* * 'unload' is triggered by the last 'unuse' call * which is itself called in na_module::instance_dispose */ static void on_module_unload( GTypeModule *gmodule ) { static const gchar *thisfn = "na_module_on_module_unload"; NAModule *module; g_return_if_fail( G_IS_TYPE_MODULE( gmodule )); g_debug( "%s: gmodule=%p", thisfn, ( void * ) gmodule ); module = NA_MODULE( gmodule ); if( module->private->shutdown ){ module->private->shutdown(); } if( module->private->library ){ g_module_close( module->private->library ); } module->private->startup = NULL; module->private->get_version = NULL; module->private->list_types = NULL; module->private->shutdown = NULL; } /* * na_module_get_extensions_for_type: * @type: the serched GType. * * Returns: a list of loaded modules willing to deal with requested @type. * * The returned list should be na_module_free_extensions_list() by the caller. */ GList * na_module_get_extensions_for_type( GList *modules, GType type ) { GList *willing_to, *im, *io; NAModule *a_modul; willing_to = NULL; for( im = modules; im ; im = im->next ){ a_modul = NA_MODULE( im->data ); for( io = a_modul->private->objects ; io ; io = io->next ){ if( G_TYPE_CHECK_INSTANCE_TYPE( G_OBJECT( io->data ), type )){ willing_to = g_list_prepend( willing_to, g_object_ref( io->data )); } } } return( willing_to ); } /* * na_module_free_extensions_list: * @extensions: a #GList as returned by #na_module_get_extensions_for_type(). * * Free the previously returned list. */ void na_module_free_extensions_list( GList *extensions ) { g_list_foreach( extensions, ( GFunc ) g_object_unref, NULL ); g_list_free( extensions ); } /* * na_module_has_id: * @module: this #NAModule object. * @id: the searched id. * * Returns: %TRUE if one of the interfaces advertised by the module has * the given id, %FALSE else. */ gboolean na_module_has_id( NAModule *module, const gchar *id ) { gboolean id_ok; GList *iobj; id_ok = FALSE; for( iobj = module->private->objects ; iobj && !id_ok ; iobj = iobj->next ){ g_debug( "na_module_has_id: object=%s", G_OBJECT_TYPE_NAME( iobj->data )); } return( id_ok ); } /* * na_module_release_modules: * @modules: the list of loaded modules. * * Release resources allocated to the loaded modules on #NAPivot dispose. */ void na_module_release_modules( GList *modules ) { static const gchar *thisfn = "na_modules_release_modules"; NAModule *module; GList *imod; GList *iobj; g_debug( "%s: modules=%p (count=%d)", thisfn, ( void * ) modules, g_list_length( modules )); for( imod = modules ; imod ; imod = imod->next ){ module = NA_MODULE( imod->data ); for( iobj = module->private->objects ; iobj ; iobj = iobj->next ){ g_object_unref( iobj->data ); } g_type_module_unuse( G_TYPE_MODULE( module )); } g_list_free( modules ); } nautilus-actions-3.2.3/src/core/na-ifactory-provider.c0000644000175100017500000002153412212601376017677 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "na-factory-object.h" #include "na-factory-provider.h" /* private interface data */ struct _NAIFactoryProviderInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; static guint st_initializations = 0; /* interface initialization count */ static GType register_type( void ); static void interface_base_init( NAIFactoryProviderInterface *klass ); static void interface_base_finalize( NAIFactoryProviderInterface *klass ); static guint ifactory_provider_get_version( const NAIFactoryProvider *instance ); static void v_factory_provider_read_start( const NAIFactoryProvider *reader, void *reader_data, NAIFactoryObject *serializable, GSList **messages ); static void v_factory_provider_read_done( const NAIFactoryProvider *reader, void *reader_data, NAIFactoryObject *serializable, GSList **messages ); static guint v_factory_provider_write_start( const NAIFactoryProvider *writer, void *writer_data, NAIFactoryObject *serializable, GSList **messages ); static guint v_factory_provider_write_done( const NAIFactoryProvider *writer, void *writer_data, NAIFactoryObject *serializable, GSList **messages ); /** * na_ifactory_provider_get_type: * * Registers the GType of this interface. * * Returns: the #NAIFactoryProvider #GType. */ GType na_ifactory_provider_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_ifactory_provider_register_type"; GType type; static const GTypeInfo info = { sizeof( NAIFactoryProviderInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NAIFactoryProvider", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( NAIFactoryProviderInterface *klass ) { static const gchar *thisfn = "na_ifactory_provider_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass=%p (%s)", thisfn, ( void * ) klass, G_OBJECT_CLASS_NAME( klass )); klass->private = g_new0( NAIFactoryProviderInterfacePrivate, 1 ); klass->get_version = ifactory_provider_get_version; klass->read_start = NULL; klass->read_data = NULL; klass->read_done = NULL; klass->write_start = NULL; klass->write_data = NULL; klass->write_done = NULL; } st_initializations += 1; } static void interface_base_finalize( NAIFactoryProviderInterface *klass ) { static const gchar *thisfn = "na_ifactory_provider_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } static guint ifactory_provider_get_version( const NAIFactoryProvider *instance ) { return( 1 ); } /** * na_ifactory_provider_read_item: * @reader: the instance which implements this #NAIFactoryProvider interface. * @reader_data: instance data which will be provided back to the interface * methods * @object: the #NAIFactoryObject object to be unserialilzed. * @messages: a pointer to a #GSList list of strings; the implementation * may append messages to this list, but shouldn't reinitialize it. * * This function is to be called by a #NAIIOProvider which would wish read * its items. The function takes care of collecting and structuring data, * while the callback interface methods #NAIFactoryProviderInterface.read_start(), * #NAIFactoryProviderInterface.read_data() and #NAIFactoryProviderInterface.read_done() * just have to fill a given #NADataBoxed with the ad-hoc data type. * * * * &lcomment; * * allocate the object to be read * &rcomment; * NAObjectItem *item = NA_OBJECT_ITEM( na_object_action_new()); * &lcomment; * * some data we may need to have access to in callback methods * &rcomment; * void *data; * &lcomment; * * now call interface function * &rcomment; * na_ifactory_provider_read_item( * NA_IFACTORY_PROVIDER( provider ), * data, * NA_IFACTORY_OBJECT( item ), * messages ); * * * * Since: 2.30 */ void na_ifactory_provider_read_item( const NAIFactoryProvider *reader, void *reader_data, NAIFactoryObject *object, GSList **messages ) { g_return_if_fail( NA_IS_IFACTORY_PROVIDER( reader )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); v_factory_provider_read_start( reader, reader_data, object, messages ); na_factory_object_read_item( object, reader, reader_data, messages ); v_factory_provider_read_done( reader, reader_data, object, messages ); } /** * na_ifactory_provider_write_item: * @writer: the instance which implements this #NAIFactoryProvider interface. * @writer_data: instance data. * @object: the #NAIFactoryObject derived object to be serialized. * @messages: a pointer to a #GSList list of strings; the implementation * may append messages to this list, but shouldn't reinitialize it. * * This function is to be called by a #NAIIOProvider which would wish write * an item. The function takes care of collecting and writing elementary data. * * Returns: a NAIIOProvider operation return code. * * Since: 2.30 */ guint na_ifactory_provider_write_item( const NAIFactoryProvider *writer, void *writer_data, NAIFactoryObject *object, GSList **messages ) { static const gchar *thisfn = "na_ifactory_provider_write_item"; guint code; g_return_val_if_fail( NA_IS_IFACTORY_PROVIDER( writer ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); g_debug( "%s: writer=%p, writer_data=%p, object=%p (%s)", thisfn, ( void * ) writer, ( void * ) writer_data, ( void * ) object, G_OBJECT_TYPE_NAME( object )); code = v_factory_provider_write_start( writer, writer_data, object, messages ); if( code == NA_IIO_PROVIDER_CODE_OK ){ code = na_factory_object_write_item( object, writer, writer_data, messages ); } if( code == NA_IIO_PROVIDER_CODE_OK ){ code = v_factory_provider_write_done( writer, writer_data, object, messages ); } return( code ); } static void v_factory_provider_read_start( const NAIFactoryProvider *reader, void *reader_data, NAIFactoryObject *serializable, GSList **messages ) { if( NA_IFACTORY_PROVIDER_GET_INTERFACE( reader )->read_start ){ NA_IFACTORY_PROVIDER_GET_INTERFACE( reader )->read_start( reader, reader_data, serializable, messages ); } } static void v_factory_provider_read_done( const NAIFactoryProvider *reader, void *reader_data, NAIFactoryObject *serializable, GSList **messages ) { if( NA_IFACTORY_PROVIDER_GET_INTERFACE( reader )->read_done ){ NA_IFACTORY_PROVIDER_GET_INTERFACE( reader )->read_done( reader, reader_data, serializable, messages ); } } static guint v_factory_provider_write_start( const NAIFactoryProvider *writer, void *writer_data, NAIFactoryObject *serializable, GSList **messages ) { guint code = NA_IIO_PROVIDER_CODE_OK; if( NA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_start ){ code = NA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_start( writer, writer_data, serializable, messages ); } return( code ); } static guint v_factory_provider_write_done( const NAIFactoryProvider *writer, void *writer_data, NAIFactoryObject *serializable, GSList **messages ) { guint code = NA_IIO_PROVIDER_CODE_OK; if( NA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_done ){ code = NA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_done( writer, writer_data, serializable, messages ); } return( code ); } nautilus-actions-3.2.3/src/core/na-data-def.c0000644000175100017500000000360312212601376015671 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include /** * na_data_def_get_data_def: * @group: a #NADataGroup structure array. * @group_name: the searched group name. * @name: the searched data name. * * Returns: a pointer to the #NADataDef structure, or %NULL if not found. * * Since: 2.30 */ const NADataDef * na_data_def_get_data_def( const NADataGroup *group, const gchar *group_name, const gchar *name ) { NADataGroup *igroup; NADataDef *idef; igroup = ( NADataGroup * ) group; while( igroup->group ){ if( !strcmp( igroup->group, group_name )){ idef = igroup->def; while( idef->name ){ if( !strcmp( idef->name, name )){ return( idef ); } idef++; } } igroup++; } return( NULL ); } nautilus-actions-3.2.3/src/core/import-mode-no-import.png0000664000175100017500000000744211674472206020370 00000000000000PNG  IHDR00WsRGBbKGD pHYs  tIME & IDAThYk]U<{̝'kvDJUPM "TTHx(!#(5I'ۉ̝{9gq<y{oo}ksOǧz'atKw|RlNv3ELg/t}J?ND  ap=M<~#]%n28fbf !@:$c.2[!t@yX~_h1IFRцW ^X3*Uց($ + $Ongn9|YD@+zl_{(J{ȿF`C~C⻅XNXXlWqoahw|օ ;W=:#@l8k?(sP۫#۶JKT fIRSU JHщrPÊvriK :>,@4Qt'WV[:{ྣ}qߎS;K[F*VUt_o2GYx jWP )fZ j9HB}UnM4ʐܯw!}p}۷3 BIdhR>@л\D.MtDT5GUD+vmBD/LfQhZϓ.u*MYRKH`CUD7We B\| }h%>/R*M˹ `@mkuQuh8|.Pt<\7M%<3@ih~ys @c ;**CFt-\$v _-{LZv\iFVjGS݇>7}߉L+肂iCh[n8P20 ʦVt* ܋s{?&9w5J)bV `8j@gZqi+}D CZWYBҵ^YC p+?Sk7nzg7 H> ?tɆF"(^&q3lv:040Czkڛ7Z\~]OtD? x5Ub9X2,Ӊki[(Uɾ;0K߁6QDv[oDDȉH@n|hN|~][qǩ/;i.Lm (;p!l1E@_J V='kC~^$Q.zDHKDfa{u὏uO<>:<{pepT&t;LYgN `B`@ ,&~ n:À<σcRAXR׮]ϵZN`1 ` 3OycAi/ U*Js޵%e5}p0y;.5) ݸsxr_j+mFܗ;|h?u:];JZYV'Q fn%cLixvnVm|gO|i]|ޚIfH$< =Oqα2s^x\~9笵*k2(T' Cfn:>.G]A[Ř twi4ضmZxXk (t:\.ǽ^ Ą9rD֞C|5gϞj8V1. * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "na-io-provider.h" /* private interface data */ struct _NAIIOProviderInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* signals */ enum { ITEM_CHANGED, LAST_SIGNAL }; static guint st_initializations = 0; /* interface initialization count */ static gint st_signals[ LAST_SIGNAL ] = { 0 }; static GType register_type( void ); static void interface_base_init( NAIIOProviderInterface *klass ); static void interface_base_finalize( NAIIOProviderInterface *klass ); static gboolean do_is_willing_to_write( const NAIIOProvider *instance ); static gboolean do_is_able_to_write( const NAIIOProvider *instance ); /** * na_iio_provider_get_type: * * Returns: the #GType type of this interface. */ GType na_iio_provider_get_type( void ) { static GType type = 0; if( !type ){ type = register_type(); } return( type ); } /* * na_iio_provider_register_type: * * Registers this interface. */ static GType register_type( void ) { static const gchar *thisfn = "na_iio_provider_register_type"; GType type; static const GTypeInfo info = { sizeof( NAIIOProviderInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NAIIOProvider", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( NAIIOProviderInterface *klass ) { static const gchar *thisfn = "na_iio_provider_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass%p (%s)", thisfn, ( void * ) klass, G_OBJECT_CLASS_NAME( klass )); klass->private = g_new0( NAIIOProviderInterfacePrivate, 1 ); klass->get_id = NULL; klass->get_version = NULL; klass->read_items = NULL; klass->is_willing_to_write = do_is_willing_to_write; klass->is_able_to_write = do_is_able_to_write; klass->write_item = NULL; klass->delete_item = NULL; klass->duplicate_data = NULL; /** * NAIIOProvider::io-provider-item-changed: * @provider: the #NAIIOProvider which has called the * na_iio_provider_item_changed() function. * * This signal is registered without any default handler. * * This signal is not meant to be directly sent by a plugin. * Instead, the plugin should call the na_iio_provider_item_changed() * function. * * See also na_iio_provider_item_changed(). */ st_signals[ ITEM_CHANGED ] = g_signal_new( IO_PROVIDER_SIGNAL_ITEM_CHANGED, NA_TYPE_IIO_PROVIDER, G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, 0, /* class offset */ NULL, /* accumulator */ NULL, /* accumulator data */ g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0 ); } st_initializations += 1; } static void interface_base_finalize( NAIIOProviderInterface *klass ) { static const gchar *thisfn = "na_iio_provider_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } static gboolean do_is_willing_to_write( const NAIIOProvider *instance ) { return( FALSE ); } static gboolean do_is_able_to_write( const NAIIOProvider *instance ) { return( FALSE ); } /** * na_iio_provider_item_changed: * @instance: the calling #NAIIOProvider. * * Informs &prodname; that this #NAIIOProvider @instance has * detected a modification in (at least) one of its items (menu * or action). * * This function may be triggered for each and every * #NAObjectItem -derived modified object, and should, at least, be * triggered once for a coherent set of updates. * * When receiving this signal, the currently running program may just * want to immediately reload the current list of items, menus and actions * (this is for example what &nautilus; plugin does); it may also choose * to ask the user if he is willing to reload such a current list (and * this is the way &nact; has chosen to deal with this message). * * Note that application NAPivot/NAUpdater pivot is typically the only * object connected to this signal. It acts so as a filtering proxy, * re-emitting its own 'items-changed' signal for a whole set of detected * underlying modifications. * * Since: 2.30 */ void na_iio_provider_item_changed( const NAIIOProvider *instance ) { static const gchar *thisfn = "na_iio_provider_item_changed"; g_debug( "%s: instance=%p", thisfn, ( void * ) instance ); g_signal_emit_by_name(( gpointer ) instance, IO_PROVIDER_SIGNAL_ITEM_CHANGED ); } nautilus-actions-3.2.3/src/core/na-object-action.c0000644000175100017500000005163412212601376016754 00000000000000/* * Nautilus ObjectActions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "na-factory-provider.h" #include "na-factory-object.h" /* private class data */ struct _NAObjectActionClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAObjectActionPrivate { gboolean dispose_has_run; }; /* i18n: default label for a new action */ #define NEW_NAUTILUS_ACTION N_( "New Nautilus action" ) extern NADataGroup action_data_groups []; /* defined in na-object-action-factory.c */ extern NADataDef data_def_action_v1 []; /* defined in na-object-action-factory.c */ static NAObjectItemClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAObjectActionClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ); static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void object_dump( const NAObject *object ); static gboolean object_are_equal( const NAObject *a, const NAObject *b ); static gboolean object_is_valid( const NAObject *object ); static void ifactory_object_iface_init( NAIFactoryObjectInterface *iface, void *user_data ); static guint ifactory_object_get_version( const NAIFactoryObject *instance ); static NADataGroup *ifactory_object_get_groups( const NAIFactoryObject *instance ); static void ifactory_object_read_done( NAIFactoryObject *instance, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ); static guint ifactory_object_write_start( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ); static guint ifactory_object_write_done( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ); static void icontext_iface_init( NAIContextInterface *iface, void *user_data ); static gboolean icontext_is_candidate( NAIContext *object, guint target, GList *selection ); static NAObjectProfile *read_done_convert_v1_to_v2( NAIFactoryObject *instance ); static void read_done_deals_with_toolbar_label( NAIFactoryObject *instance ); static guint write_done_write_profiles( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ); static gboolean is_valid_label( const NAObjectAction *action ); static gboolean is_valid_toolbar_label( const NAObjectAction *action ); GType na_object_action_get_type( void ) { static GType action_type = 0; if( action_type == 0 ){ action_type = register_type(); } return( action_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_object_action_register_type"; GType type; static GTypeInfo info = { sizeof( NAObjectActionClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAObjectAction ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo icontext_iface_info = { ( GInterfaceInitFunc ) icontext_iface_init, NULL, NULL }; static const GInterfaceInfo ifactory_object_iface_info = { ( GInterfaceInitFunc ) ifactory_object_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( NA_TYPE_OBJECT_ITEM, "NAObjectAction", &info, 0 ); g_type_add_interface_static( type, NA_TYPE_ICONTEXT, &icontext_iface_info ); g_type_add_interface_static( type, NA_TYPE_IFACTORY_OBJECT, &ifactory_object_iface_info ); return( type ); } static void class_init( NAObjectActionClass *klass ) { static const gchar *thisfn = "na_object_action_class_init"; GObjectClass *object_class; NAObjectClass *naobject_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->set_property = instance_set_property; object_class->get_property = instance_get_property; object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; naobject_class = NA_OBJECT_CLASS( klass ); naobject_class->dump = object_dump; naobject_class->are_equal = object_are_equal; naobject_class->is_valid = object_is_valid; klass->private = g_new0( NAObjectActionClassPrivate, 1 ); na_factory_object_define_properties( object_class, action_data_groups ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_object_action_instance_init"; NAObjectAction *self; g_return_if_fail( NA_IS_OBJECT_ACTION( instance )); self = NA_OBJECT_ACTION( instance ); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self->private = g_new0( NAObjectActionPrivate, 1 ); } static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ) { g_return_if_fail( NA_IS_OBJECT_ACTION( object )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); if( !NA_OBJECT_ACTION( object )->private->dispose_has_run ){ na_factory_object_get_as_value( NA_IFACTORY_OBJECT( object ), g_quark_to_string( property_id ), value ); } } static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ) { g_return_if_fail( NA_IS_OBJECT_ACTION( object )); g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); if( !NA_OBJECT_ACTION( object )->private->dispose_has_run ){ na_factory_object_set_from_value( NA_IFACTORY_OBJECT( object ), g_quark_to_string( property_id ), value ); } } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_object_action_instance_dispose"; NAObjectAction *self; g_return_if_fail( NA_IS_OBJECT_ACTION( object )); self = NA_OBJECT_ACTION( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_object_action_instance_finalize"; NAObjectAction *self; g_return_if_fail( NA_IS_OBJECT_ACTION( object )); self = NA_OBJECT_ACTION( object ); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static void object_dump( const NAObject *object ) { static const char *thisfn = "na_object_action_object_dump"; NAObjectAction *self; g_return_if_fail( NA_IS_OBJECT_ACTION( object )); self = NA_OBJECT_ACTION( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s, ref_count=%d)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ), G_OBJECT( object )->ref_count ); /* chain up to the parent class */ if( NA_OBJECT_CLASS( st_parent_class )->dump ){ NA_OBJECT_CLASS( st_parent_class )->dump( object ); } g_debug( "+- end of dump" ); } } /* * @a is the original object * @b is the current one * * Even if they have both the same children list, the current action is * considered modified as soon as one of its profile is itself modified. */ static gboolean object_are_equal( const NAObject *a, const NAObject *b ) { static const gchar *thisfn = "na_object_action_object_are_equal"; GList *it; gboolean are_equal; g_debug( "%s: a=%p, b=%p", thisfn, ( void * ) a, ( void * ) b ); for( it = na_object_get_items( b ) ; it ; it = it->next ){ if( na_object_is_modified( it->data )){ return( FALSE ); } } are_equal = TRUE; /* chain call to parent class */ if( NA_OBJECT_CLASS( st_parent_class )->are_equal ){ are_equal &= NA_OBJECT_CLASS( st_parent_class )->are_equal( a, b ); } return( are_equal ); } static gboolean object_is_valid( const NAObject *object ) { static const gchar *thisfn = "na_object_action_object_is_valid"; gboolean is_valid; NAObjectAction *action; g_return_val_if_fail( NA_IS_OBJECT_ACTION( object ), FALSE ); is_valid = FALSE; action = NA_OBJECT_ACTION( object ); if( !action->private->dispose_has_run ){ g_debug( "%s: action=%p (%s)", thisfn, ( void * ) action, G_OBJECT_TYPE_NAME( action )); is_valid = TRUE; if( na_object_is_target_toolbar( action )){ is_valid &= is_valid_toolbar_label( action ); } if( na_object_is_target_selection( action ) || na_object_is_target_location( action )){ is_valid &= is_valid_label( action ); } if( !is_valid ){ na_object_debug_invalid( action, "no valid profile" ); } } /* chain up to the parent class */ if( NA_OBJECT_CLASS( st_parent_class )->is_valid ){ is_valid &= NA_OBJECT_CLASS( st_parent_class )->is_valid( object ); } return( is_valid ); } static void ifactory_object_iface_init( NAIFactoryObjectInterface *iface, void *user_data ) { static const gchar *thisfn = "na_object_action_ifactory_object_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->get_version = ifactory_object_get_version; iface->get_groups = ifactory_object_get_groups; iface->read_done = ifactory_object_read_done; iface->write_start = ifactory_object_write_start; iface->write_done = ifactory_object_write_done; } static guint ifactory_object_get_version( const NAIFactoryObject *instance ) { return( 1 ); } static NADataGroup * ifactory_object_get_groups( const NAIFactoryObject *instance ) { return( action_data_groups ); } /* * at this time, we don't yet have read the profiles as this will be * triggered by ifactory_provider_read_done - we so just are able to deal with * action-specific properties (not to check for profiles consistency) */ static void ifactory_object_read_done( NAIFactoryObject *instance, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ) { guint iversion; NAObjectProfile *profile; g_debug( "na_object_action_ifactory_object_read_done: instance=%p", ( void * ) instance ); na_object_item_deals_with_version( NA_OBJECT_ITEM( instance )); /* should attach a new profile if we detect a pre-v2 action * the v1_to_v2 conversion must be followed by a v2_to_v3 one */ iversion = na_object_get_iversion( instance ); if( iversion < 2 ){ profile = read_done_convert_v1_to_v2( instance ); na_object_profile_convert_v2_to_last( profile ); } /* deals with obsoleted data, i.e. data which may have been written in the past * but are no long written by now - not relevant for a menu */ read_done_deals_with_toolbar_label( instance ); /* prepare the context after the reading */ na_icontext_read_done( NA_ICONTEXT( instance )); /* last, set action defaults */ na_factory_object_set_defaults( instance ); } static guint ifactory_object_write_start( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ) { na_object_item_rebuild_children_slist( NA_OBJECT_ITEM( instance )); return( NA_IIO_PROVIDER_CODE_OK ); } static guint ifactory_object_write_done( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ) { guint code; g_return_val_if_fail( NA_IS_OBJECT_ACTION( instance ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); code = write_done_write_profiles( instance, writer, writer_data, messages ); return( code ); } static void icontext_iface_init( NAIContextInterface *iface, void *user_data ) { static const gchar *thisfn = "na_object_action_icontext_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->is_candidate = icontext_is_candidate; } static gboolean icontext_is_candidate( NAIContext *object, guint target, GList *selection ) { return( TRUE ); } /* * if we have a pre-v2 action * any data found in data_def_action_v1 (defined in na-object-action-factory.c) * is obsoleted and should be moved to a new profile * * actions read from .desktop already have iversion=3 (cf. desktop_read_start) * so v1 actions may only come from xml or gconf * * returns the newly defined profile */ static NAObjectProfile * read_done_convert_v1_to_v2( NAIFactoryObject *instance ) { static const gchar *thisfn = "na_object_action_read_done_read_done_convert_v1_to_last"; GList *to_move; NADataDef *def; NADataBoxed *boxed; GList *ibox; NAObjectProfile *profile; /* search for old data in the body: this is only possible before profiles * because starting with contexts, iversion was written */ to_move = NULL; def = data_def_action_v1; while( def->name ){ boxed = na_ifactory_object_get_data_boxed( instance, def->name ); if( boxed ){ g_debug( "%s: boxed=%p (%s) marked to be moved from action body to profile", thisfn, ( void * ) boxed, def->name ); to_move = g_list_prepend( to_move, boxed ); } def++; } /* now create a new profile */ profile = na_object_profile_new(); na_object_set_id( profile, "profile-pre-v2" ); na_object_set_label( profile, _( "Profile automatically created from pre-v2 action" )); na_object_attach_profile( instance, profile ); for( ibox = to_move ; ibox ; ibox = ibox->next ){ na_factory_object_move_boxed( NA_IFACTORY_OBJECT( profile ), instance, NA_DATA_BOXED( ibox->data )); } return( profile ); } /* * if toolbar-same-label is true, then ensure that this is actually true */ static void read_done_deals_with_toolbar_label( NAIFactoryObject *instance ) { gchar *toolbar_label; gchar *action_label; gboolean same_label; toolbar_label = na_object_get_toolbar_label( instance ); action_label = na_object_get_label( instance ); if( !toolbar_label || !g_utf8_strlen( toolbar_label, -1 )){ na_object_set_toolbar_label( instance, action_label ); na_object_set_toolbar_same_label( instance, TRUE ); } else { same_label = ( na_core_utils_str_collate( action_label, toolbar_label ) == 0 ); na_object_set_toolbar_same_label( instance, same_label ); } g_free( action_label ); g_free( toolbar_label ); } /* * write the profiles of the action * note that subitems string list has been rebuilt on write_start */ static guint write_done_write_profiles( NAIFactoryObject *instance, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ) { static const gchar *thisfn = "na_object_action_write_done_write_profiles"; guint code; GSList *children_slist, *ic; NAObjectProfile *profile; code = NA_IIO_PROVIDER_CODE_OK; children_slist = na_object_get_items_slist( instance ); for( ic = children_slist ; ic && code == NA_IIO_PROVIDER_CODE_OK ; ic = ic->next ){ profile = NA_OBJECT_PROFILE( na_object_get_item( instance, ic->data )); if( profile ){ code = na_ifactory_provider_write_item( writer, writer_data, NA_IFACTORY_OBJECT( profile ), messages ); } else { g_warning( "%s: profile not found: %s", thisfn, ( const gchar * ) ic->data ); } } return( code ); } static gboolean is_valid_label( const NAObjectAction *action ) { gboolean is_valid; gchar *label; label = na_object_get_label( action ); is_valid = ( label && g_utf8_strlen( label, -1 ) > 0 ); g_free( label ); if( !is_valid ){ na_object_debug_invalid( action, "label" ); } return( is_valid ); } static gboolean is_valid_toolbar_label( const NAObjectAction *action ) { gboolean is_valid; gchar *label; label = na_object_get_toolbar_label( action ); is_valid = ( label && g_utf8_strlen( label, -1 ) > 0 ); g_free( label ); if( !is_valid ){ na_object_debug_invalid( action, "toolbar-label" ); } return( is_valid ); } /** * na_object_action_new: * * Allocates a new #NAObjectAction object. * * The new #NAObjectAction object is initialized with suitable default values, * but without any profile. * * Returns: the newly allocated #NAObjectAction object. * * Since: 2.30 */ NAObjectAction * na_object_action_new( void ) { NAObjectAction *action; action = g_object_new( NA_TYPE_OBJECT_ACTION, NULL ); return( action ); } /** * na_object_action_new_with_profile: * * Allocates a new #NAObjectAction object along with a default profile. * * Returns: the newly allocated #NAObjectAction action. * * Since: 2.30 */ NAObjectAction * na_object_action_new_with_profile( void ) { NAObjectAction *action; NAObjectProfile *profile; action = na_object_action_new(); profile = na_object_profile_new(); na_object_attach_profile( action, profile ); return( action ); } /** * na_object_action_new_with_defaults: * * Allocates a new #NAObjectAction object along with a default profile. * These two objects have suitable default values. * * Returns: the newly allocated #NAObjectAction action. * * Since: 2.30 */ NAObjectAction * na_object_action_new_with_defaults( void ) { NAObjectAction *action; NAObjectProfile *profile; action = na_object_action_new(); na_object_set_new_id( action, NULL ); na_object_set_label( action, gettext( NEW_NAUTILUS_ACTION )); na_object_set_toolbar_label( action, gettext( NEW_NAUTILUS_ACTION )); na_factory_object_set_defaults( NA_IFACTORY_OBJECT( action )); profile = na_object_profile_new_with_defaults(); na_object_attach_profile( action, profile ); return( action ); } /** * na_object_action_get_new_profile_name: * @action: the #NAObjectAction object which will receive a new profile. * * Returns a name suitable as a new profile name. * * The search is made by iterating over the standard profile name * prefix : basically, we increment a counter until finding a name * which is not yet allocated. The provided name is so only suitable * for the specified @action. * * When inserting a list of profiles in the action, we iter first for * new names, before actually do the insertion. We so keep the last * allocated name to avoid to allocate the same one twice. * * Returns: a newly allocated profile name, which should be g_free() by * the caller. * * Since: 2.30 */ gchar * na_object_action_get_new_profile_name( const NAObjectAction *action ) { int i; gboolean ok = FALSE; gchar *candidate = NULL; guint last_allocated; g_return_val_if_fail( NA_IS_OBJECT_ACTION( action ), NULL ); if( !action->private->dispose_has_run ){ last_allocated = na_object_get_last_allocated( action ); for( i = last_allocated + 1 ; !ok ; ++i ){ g_free( candidate ); candidate = g_strdup_printf( "profile-%d", i ); if( !na_object_get_item( action, candidate )){ ok = TRUE; na_object_set_last_allocated( action, i ); } } if( !ok ){ g_free( candidate ); candidate = NULL; } } /*g_debug( "returning candidate=%s", candidate );*/ return( candidate ); } /** * na_object_action_attach_profile: * @action: the #NAObjectAction action to which the profile will be attached. * @profile: the #NAObjectProfile profile to be attached to @action. * * Adds a profile at the end of the list of profiles. * * Since: 2.30 */ void na_object_action_attach_profile( NAObjectAction *action, NAObjectProfile *profile ) { g_return_if_fail( NA_IS_OBJECT_ACTION( action )); g_return_if_fail( NA_IS_OBJECT_PROFILE( profile )); if( !action->private->dispose_has_run ){ na_object_append_item( action, profile ); na_object_set_parent( profile, action ); } } /** * na_object_action_set_last_version: * @action: the #NAObjectAction action to update. * * Set the version number of the @action to the last one. * * Since: 2.30 */ void na_object_action_set_last_version( NAObjectAction *action ) { g_return_if_fail( NA_IS_OBJECT_ACTION( action )); if( !action->private->dispose_has_run ){ na_object_set_version( action, "2.0" ); } } nautilus-actions-3.2.3/src/core/na-gconf-migration.c0000644000175100017500000000415412212601376017311 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include "na-gconf-migration.h" #define MIGRATION_COMMAND PKGLIBEXECDIR "/na-gconf2key.sh -delete -nodummy -verbose" /** * na_gconf_migration_run: * * Migrate users actions and menus from GConf to .desktop files. * Disable GConf I/O provider both for reading and writing. * Migrate users preferences to NASettings. * * Since: 3.1 */ void na_gconf_migration_run( void ) { static const gchar *thisfn = "na_gconf_migration_run"; #ifdef HAVE_GCONF gchar *out, *err; GError *error; g_debug( "%s: running %s", thisfn, MIGRATION_COMMAND ); error = NULL; if( !g_spawn_command_line_sync( MIGRATION_COMMAND, &out, &err, NULL, &error )){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); error = NULL; } else { g_debug( "%s: out=%s", thisfn, out ); g_debug( "%s: err=%s", thisfn, err ); g_free( out ); g_free( err ); } #else g_debug( "%s: GConf support is disabled, no migration", thisfn ); #endif /* HAVE_GCONF */ } nautilus-actions-3.2.3/src/core/na-iduplicable.c0000644000175100017500000003751312212601376016510 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "na-marshal.h" /* private interface data */ struct _NAIDuplicableInterfacePrivate { GList *consumers; }; /* the data sructure set on each NAIDuplicable object */ typedef struct { NAIDuplicable *origin; gboolean modified; gboolean valid; } DuplicableStr; #define NA_IDUPLICABLE_DATA_DUPLICABLE "na-iduplicable-data-duplicable" /* signals emitted on NAIDuplicable when a status changes */ enum { MODIFIED_CHANGED, VALID_CHANGED, LAST_SIGNAL }; static NAIDuplicableInterface *st_interface = NULL; static guint st_initializations = 0; static gint st_signals[ LAST_SIGNAL ] = { 0 }; static GType register_type( void ); static void interface_base_init( NAIDuplicableInterface *klass ); static void interface_base_finalize( NAIDuplicableInterface *klass ); static void v_copy( NAIDuplicable *target, const NAIDuplicable *source, guint mode ); static gboolean v_are_equal( const NAIDuplicable *a, const NAIDuplicable *b ); static gboolean v_is_valid( const NAIDuplicable *object ); static DuplicableStr *get_duplicable_str( const NAIDuplicable *object ); static void on_modified_changed_class_handler( NAIDuplicable *instance, GObject *object, gboolean is_modified ); static void on_valid_changed_class_handler( NAIDuplicable *instance, GObject *object, gboolean is_valid ); static void propagate_signal_to_consumers( NAIDuplicable *instance, const gchar *signal, GObject *object, gboolean new_status ); static void release_signal_consumers( GList *consumers ); GType na_iduplicable_get_type( void ) { static GType iface_type = 0; if( !iface_type ){ iface_type = register_type(); } return( iface_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_iduplicable_register_type"; GType type; static const GTypeInfo info = { sizeof( NAIDuplicableInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NAIDuplicable", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( NAIDuplicableInterface *klass ) { static const gchar *thisfn = "na_iduplicable_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); klass->private = g_new0( NAIDuplicableInterfacePrivate, 1 ); klass->private->consumers = NULL; klass->copy = NULL; klass->are_equal = NULL; klass->is_valid = NULL; /** * NAIDuplicable::modified-changed: * * This signal is emitted by #NAIDuplicable when the modification * status of an object has been modified. * * The default class handler propagates the signal to registered * consumers. * * Signal args: New modification status * * Handler prototype: * void ( *handler )( NAIDuplicable *duplicable, NAObject *object, gboolean is_modified, gpointer user_data ); * * When the signal is first emitted, thus on NAIDuplicable, @duplicable * and @object are pointers to the same address. This duplication is * relevant when propagating the signal to customer, as the signal is * emitted on the customer itself, while we still need the @object * pointer. */ st_signals[ MODIFIED_CHANGED ] = g_signal_new_class_handler( IDUPLICABLE_SIGNAL_MODIFIED_CHANGED, G_TYPE_OBJECT, G_SIGNAL_RUN_CLEANUP, G_CALLBACK( on_modified_changed_class_handler ), NULL, NULL, na_cclosure_marshal_VOID__POINTER_BOOLEAN, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_BOOLEAN ); /** * NAIDuplicable::valid-changed: * * This signal is emitted by #NAIDuplicable when the validity * status of an object has been modified. * * The default class handler propagates the signal to registered * consumers. * * Signal args: New validity status * * Handler prototype: * void ( *handler )( NAIDuplicable *duplicable, NAObject *object, gboolean is_valid, gpointer user_data ); * * When the signal is first emitted, thus on NAIDuplicable, @duplicable * and @object are pointers to the same address. This duplication is * relevant when propagating the signal to customer, as the signal is * emitted on the customer itself, while we still need the @object * pointer. */ st_signals[ VALID_CHANGED ] = g_signal_new_class_handler( IDUPLICABLE_SIGNAL_VALID_CHANGED, G_TYPE_OBJECT, G_SIGNAL_RUN_CLEANUP, G_CALLBACK( on_valid_changed_class_handler ), NULL, NULL, na_cclosure_marshal_VOID__POINTER_BOOLEAN, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_BOOLEAN ); st_interface = klass; } st_initializations += 1; } static void interface_base_finalize( NAIDuplicableInterface *klass ) { static const gchar *thisfn = "na_iduplicable_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); release_signal_consumers( klass->private->consumers ); g_free( klass->private ); } } /** * na_iduplicable_dispose: * @object: the #NAIDuplicable object to be initialized. * * Releases resources. * * Since: 2.30 */ void na_iduplicable_dispose( const NAIDuplicable *object ) { DuplicableStr *str; g_return_if_fail( NA_IS_IDUPLICABLE( object )); str = get_duplicable_str( object ); g_free( str ); g_object_set_data( G_OBJECT( object ), NA_IDUPLICABLE_DATA_DUPLICABLE, NULL ); } /** * na_iduplicable_dump: * @object: the #NAIDuplicable object to be dumped. * * Dumps via g_debug the properties of the object. * * We ouput here only the data we set ourselves againt the * #NAIDuplicable -implemented object. * * This function should be called by the implementation when it dumps * itself its own content. * * Since: 2.30 */ void na_iduplicable_dump( const NAIDuplicable *object ) { static const gchar *thisfn = "na_iduplicable_dump"; DuplicableStr *str; g_return_if_fail( NA_IS_IDUPLICABLE( object )); str = get_duplicable_str( object ); g_debug( "| %s: origin=%p", thisfn, ( void * ) str->origin ); g_debug( "| %s: modified=%s", thisfn, str->modified ? "True" : "False" ); g_debug( "| %s: valid=%s", thisfn, str->valid ? "True" : "False" ); } /** * na_iduplicable_duplicate: * @object: the #NAIDuplicable object to be duplicated. * @mode: the %DuplicableMode duplication mode. * * Exactly duplicates a #NAIDuplicable -implemented object, including * modification and validity status which are copied from @object to * the duplicated one. * * Returns: a new #NAIDuplicable. * * Since: 2.30 */ NAIDuplicable * na_iduplicable_duplicate( const NAIDuplicable *object, guint mode ) { static const gchar *thisfn = "na_iduplicable_duplicate"; NAIDuplicable *dup; DuplicableStr *dup_str, *obj_str; g_return_val_if_fail( NA_IS_IDUPLICABLE( object ), NULL ); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); dup = g_object_new( G_OBJECT_TYPE( object ), NULL ); v_copy( dup, object, mode ); dup_str = get_duplicable_str( dup ); obj_str = get_duplicable_str( object ); dup_str->origin = ( NAIDuplicable * ) object; dup_str->modified = obj_str->modified; dup_str->valid = obj_str->valid; return( dup ); } /** * na_iduplicable_check_status: * @object: the #NAIDuplicable object to be checked. * * Checks the edition status of the #NAIDuplicable object, and set up * the corresponding properties. * * This function is supposed to be called each time the object may have * been modified in order to set the corresponding properties. Helper * functions na_iduplicable_is_modified() and na_iduplicable_is_valid() * will then only return the current value of the properties. * * na_iduplicable_check_status() is not, as itself, recursive. * That is, the modification and validity status are only set on the * specified object. * #NAObject implementation has chosen to handle itself the recursivity: * na_object_check_status() so first check status for children, before * calling this function. * * Since: 2.30 */ void na_iduplicable_check_status( const NAIDuplicable *object ) { static const gchar *thisfn = "na_iduplicable_check_status"; DuplicableStr *str; gboolean was_modified, was_valid; g_return_if_fail( NA_IS_IDUPLICABLE( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); str = get_duplicable_str( object ); was_modified = str->modified; was_valid = str->valid; if( str->origin ){ g_debug( "%s: vs. origin=%p (%s)", thisfn, ( void * ) str->origin, G_OBJECT_TYPE_NAME( str->origin )); g_return_if_fail( NA_IS_IDUPLICABLE( str->origin )); str->modified = !v_are_equal( str->origin, object ); } else { str->modified = TRUE; } if( was_modified != str->modified ){ g_debug( "%s: %p (%s) status changed to modified=%s", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ), str->modified ? "True":"False" ); g_signal_emit_by_name( G_OBJECT( object ), IDUPLICABLE_SIGNAL_MODIFIED_CHANGED, object, str->modified ); } str->valid = v_is_valid( object ); if( was_valid != str->valid ){ g_debug( "%s: %p (%s) status changed to valid=%s", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ), str->valid ? "True":"False" ); g_signal_emit_by_name( G_OBJECT( object ), IDUPLICABLE_SIGNAL_VALID_CHANGED, object, str->valid ); } } /** * na_iduplicable_get_origin: * @object: the #NAIDuplicable object whose origin is to be returned. * * Returns the origin of a duplicated #NAIDuplicable. * * Returns: the original #NAIDuplicable, or NULL. * * Since: 2.30 */ NAIDuplicable * na_iduplicable_get_origin( const NAIDuplicable *object ) { NAIDuplicable *origin; DuplicableStr *str; g_return_val_if_fail( NA_IS_IDUPLICABLE( object ), NULL ); str = get_duplicable_str( object ); origin = str->origin; return( origin ); } /** * na_iduplicable_is_valid: * @object: the #NAIDuplicable object whose status is to be returned. * * Returns the current value of the relevant property * without rechecking the edition status itself. * * Returns: %TRUE is the provided object is valid. * * Since: 2.30 */ gboolean na_iduplicable_is_valid( const NAIDuplicable *object ) { gboolean is_valid; DuplicableStr *str; g_return_val_if_fail( NA_IS_IDUPLICABLE( object ), FALSE ); str = get_duplicable_str( object ); is_valid = str->valid; return( is_valid ); } /** * na_iduplicable_is_modified: * @object: the #NAIDuplicable object whose status is to be returned. * * Returns the current value of the 'is_modified' * property without rechecking the edition status itself. * * Returns: %TRUE is the provided object has been modified regarding of * the original one. * * Since: 2.30 */ gboolean na_iduplicable_is_modified( const NAIDuplicable *object ) { gboolean is_modified; DuplicableStr *str; g_return_val_if_fail( NA_IS_IDUPLICABLE( object ), FALSE ); str = get_duplicable_str( object ); is_modified = str->modified; return( is_modified ); } /** * na_iduplicable_set_origin: * @object: the #NAIDuplicable object whose origin is to be set. * @origin: the new original #NAIDuplicable. * * Sets the new origin of a duplicated #NAIDuplicable. * * Since: 2.30 */ void na_iduplicable_set_origin( NAIDuplicable *object, const NAIDuplicable *origin ) { DuplicableStr *str; g_return_if_fail( NA_IS_IDUPLICABLE( object )); g_return_if_fail( NA_IS_IDUPLICABLE( origin ) || !origin ); str = get_duplicable_str( object ); str->origin = ( NAIDuplicable * ) origin; } #ifdef NA_ENABLE_DEPRECATED /** * na_iduplicable_set_modified: * @object: the #NAIDuplicable object whose modification status is to be set. * @modified: the new modification status #NAIDuplicable. * * Sets the new modification status of a duplicated #NAIDuplicable. * * Since: 2.30 * Deprecated: 3.1 */ void na_iduplicable_set_modified( NAIDuplicable *object, gboolean modified ) { DuplicableStr *str; g_return_if_fail( NA_IS_IDUPLICABLE( object )); str = get_duplicable_str( object ); str->modified = modified; } #endif /* NA_ENABLE_DEPRECATED */ static void v_copy( NAIDuplicable *target, const NAIDuplicable *source, guint mode ) { if( NA_IDUPLICABLE_GET_INTERFACE( target )->copy ){ NA_IDUPLICABLE_GET_INTERFACE( target )->copy( target, source, mode ); } } static gboolean v_are_equal( const NAIDuplicable *a, const NAIDuplicable *b ) { if( NA_IDUPLICABLE_GET_INTERFACE( a )->are_equal ){ return( NA_IDUPLICABLE_GET_INTERFACE( a )->are_equal( a, b )); } return( TRUE ); } static gboolean v_is_valid( const NAIDuplicable *object ) { if( NA_IDUPLICABLE_GET_INTERFACE( object )->is_valid ){ return( NA_IDUPLICABLE_GET_INTERFACE( object )->is_valid( object )); } return( TRUE ); } /** * na_iduplicable_register_consumer: * @consumer: the target instance. * * This function registers a consumer, i.e. an instance to which edition * status signals will be propagated. * * Since: 2.30 */ void na_iduplicable_register_consumer( GObject *consumer ) { g_return_if_fail( st_interface ); g_debug( "na_iduplicable_register_consumer: consumer=%p", ( void * ) consumer ); st_interface->private->consumers = g_list_prepend( st_interface->private->consumers, consumer ); } static void on_modified_changed_class_handler( NAIDuplicable *instance, GObject *object, gboolean is_modified ) { if( NA_IS_IDUPLICABLE( instance )){ propagate_signal_to_consumers( instance, IDUPLICABLE_SIGNAL_MODIFIED_CHANGED, object, is_modified ); } } static void on_valid_changed_class_handler( NAIDuplicable *instance, GObject *object, gboolean is_valid ) { if( NA_IS_IDUPLICABLE( instance )){ propagate_signal_to_consumers( instance, IDUPLICABLE_SIGNAL_VALID_CHANGED, object, is_valid ); } } static void propagate_signal_to_consumers( NAIDuplicable *instance, const gchar *signal, GObject *object, gboolean new_status ) { static const gchar *thisfn = "na_iduplicable_propagate_signals_to_consumers"; GList *ic; g_return_if_fail( NA_IS_IDUPLICABLE( instance )); g_debug( "%s: instance=%p, signal=%s", thisfn, ( void * ) instance, signal ); for( ic = st_interface->private->consumers ; ic ; ic = ic->next ){ g_signal_emit_by_name( ic->data, signal, object, new_status ); } } static void release_signal_consumers( GList *consumers ) { g_list_free( consumers ); } static DuplicableStr * get_duplicable_str( const NAIDuplicable *object ) { DuplicableStr *str; str = ( DuplicableStr * ) g_object_get_data( G_OBJECT( object ), NA_IDUPLICABLE_DATA_DUPLICABLE ); if( !str ){ str = g_new0( DuplicableStr, 1 ); str->origin = NULL; str->modified = FALSE; str->valid = TRUE; g_object_set_data( G_OBJECT( object ), NA_IDUPLICABLE_DATA_DUPLICABLE, str ); } return( str ); } nautilus-actions-3.2.3/src/core/na-import-mode.c0000644000175100017500000002656612212601376016475 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "na-import-mode.h" #include "na-ioption.h" /* private class data */ struct _NAImportModeClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAImportModePrivate { gboolean dispose_has_run; /* properties */ guint id; gchar *mode; gchar *label; gchar *description; GdkPixbuf *image; }; /* properties */ enum { MAIN_PROP_0 = 0, NA_IMPORT_PROP_MODE_ID, NA_IMPORT_PROP_LABEL_ID, NA_IMPORT_PROP_DESCRIPTION_ID, NA_IMPORT_PROP_IMAGE_ID, NA_IMPORT_PROP_N_PROPERTIES }; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAImportModeClass *klass ); static void ioption_iface_init( NAIOptionInterface *iface, void *user_data ); static gchar *ioption_get_id( const NAIOption *option ); static gchar *ioption_get_label( const NAIOption *option ); static gchar *ioption_get_description( const NAIOption *option ); static GdkPixbuf *ioption_get_pixbuf( const NAIOption *option ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ); static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); GType na_import_mode_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_import_mode_register_type"; GType type; static GTypeInfo info = { sizeof( NAImportModeClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAImportMode ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); static const GInterfaceInfo ioption_iface_info = { ( GInterfaceInitFunc ) ioption_iface_init, NULL, NULL }; type = g_type_register_static( G_TYPE_OBJECT, "NAImportMode", &info, 0 ); g_type_add_interface_static( type, NA_TYPE_IOPTION, &ioption_iface_info ); return( type ); } static void class_init( NAImportModeClass *klass ) { static const gchar *thisfn = "na_import_mode_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->set_property = instance_set_property; object_class->get_property = instance_get_property; object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NAImportModeClassPrivate, 1 ); g_object_class_install_property( object_class, NA_IMPORT_PROP_MODE_ID, g_param_spec_string( NA_IMPORT_PROP_MODE, "Import mode", "The string identifier of the import mode, stored in user's preferences", "", G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, NA_IMPORT_PROP_LABEL_ID, g_param_spec_string( NA_IMPORT_PROP_LABEL, "Import label", "The label associated to the import mode", "", G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, NA_IMPORT_PROP_DESCRIPTION_ID, g_param_spec_string( NA_IMPORT_PROP_DESCRIPTION, "Import mode description", "The description associated to the import mode", "", G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, NA_IMPORT_PROP_IMAGE_ID, g_param_spec_pointer( NA_IMPORT_PROP_IMAGE, "Import mode image", "The image associated to the import mode, as a GdkPixbuf", G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); } static void ioption_iface_init( NAIOptionInterface *iface, void *user_data ) { static const gchar *thisfn = "na_import_mode_ioption_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->get_id = ioption_get_id; iface->get_label = ioption_get_label; iface->get_description = ioption_get_description; iface->get_pixbuf = ioption_get_pixbuf; } /* * ioption_get_id: * @option: this #NAIOption instance. * * Returns: the ASCII id of the @option, as a newly allocated string which * should be g_free() by the caller. */ static gchar * ioption_get_id( const NAIOption *option ) { gchar *id; NAImportMode *mode; g_return_val_if_fail( NA_IS_IMPORT_MODE( option ), NULL ); mode = NA_IMPORT_MODE( option ); id = NULL; if( !mode->private->dispose_has_run ){ id = g_strdup( mode->private->mode ); } return( id ); } /* * ioption_get_label: * @option: this #NAIOption instance. * * Returns: the label associated to @option, as a newly allocated string * which should be g_free() by the caller. */ static gchar * ioption_get_label( const NAIOption *option ) { gchar *label; NAImportMode *mode; g_return_val_if_fail( NA_IS_IMPORT_MODE( option ), NULL ); mode = NA_IMPORT_MODE( option ); label = NULL; if( !mode->private->dispose_has_run ){ label = g_strdup( mode->private->label ); } return( label ); } /* * ioption_get_description: * @option: this #NAIOption instance. * * Returns: the description associated to @option, as a newly allocated string * which should be g_free() by the caller. */ static gchar * ioption_get_description( const NAIOption *option ) { gchar *description; NAImportMode *mode; g_return_val_if_fail( NA_IS_IMPORT_MODE( option ), NULL ); mode = NA_IMPORT_MODE( option ); description = NULL; if( !mode->private->dispose_has_run ){ description = g_strdup( mode->private->description ); } return( description ); } /* * ioption_get_pixbuf: * @option: this #NAIOption instance. * * Returns: a new reference to the pixbuf associated to @option; * which should later be g_object_unref() by the caller. */ static GdkPixbuf * ioption_get_pixbuf( const NAIOption *option ) { GdkPixbuf *pixbuf; NAImportMode *mode; g_return_val_if_fail( NA_IS_IMPORT_MODE( option ), NULL ); mode = NA_IMPORT_MODE( option ); pixbuf = NULL; if( !mode->private->dispose_has_run ){ pixbuf = mode->private->image ? g_object_ref( mode->private->image ) : NULL; } return( pixbuf ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_import_mode_instance_init"; NAImportMode *self; g_return_if_fail( NA_IS_IMPORT_MODE( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_IMPORT_MODE( instance ); self->private = g_new0( NAImportModePrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ) { NAImportMode *self; g_return_if_fail( NA_IS_IMPORT_MODE( object )); self = NA_IMPORT_MODE( object ); if( !self->private->dispose_has_run ){ switch( property_id ){ case NA_IMPORT_PROP_MODE_ID: g_value_set_string( value, self->private->mode ); break; case NA_IMPORT_PROP_LABEL_ID: g_value_set_string( value, self->private->label ); break; case NA_IMPORT_PROP_DESCRIPTION_ID: g_value_set_string( value, self->private->description ); break; case NA_IMPORT_PROP_IMAGE_ID: g_value_set_pointer( value, self->private->image ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec ); break; } } } static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ) { NAImportMode *self; g_return_if_fail( NA_IS_IMPORT_MODE( object )); self = NA_IMPORT_MODE( object ); if( !self->private->dispose_has_run ){ switch( property_id ){ case NA_IMPORT_PROP_MODE_ID: g_free( self->private->mode ); self->private->mode = g_value_dup_string( value ); break; case NA_IMPORT_PROP_LABEL_ID: g_free( self->private->label ); self->private->label = g_value_dup_string( value ); break; case NA_IMPORT_PROP_DESCRIPTION_ID: g_free( self->private->description ); self->private->description = g_value_dup_string( value ); break; case NA_IMPORT_PROP_IMAGE_ID: self->private->image = g_value_get_pointer( value ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec ); break; } } } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_import_mode_instance_dispose"; NAImportMode *self; g_return_if_fail( NA_IS_IMPORT_MODE( object )); self = NA_IMPORT_MODE( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_import_mode_instance_finalize"; NAImportMode *self; g_return_if_fail( NA_IS_IMPORT_MODE( object )); g_debug( "%s: object=%p", thisfn, ( void * ) object ); self = NA_IMPORT_MODE( object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /* * na_import_mode_new: * @mode_id: the internal identifier of the import mode. * * Returns: a newly allocated #NAImportMode object. * * Since: 3.2 */ NAImportMode * na_import_mode_new( guint mode_id ) { NAImportMode *mode; mode = g_object_new( NA_TYPE_IMPORT_MODE, NULL ); mode->private->id = mode_id; return( mode ); } /* * na_import_mode_get_id: * @mode: a #NAImportMode object. * * Returns: the internal identifier of the import mode. * * Since: 3.2 */ guint na_import_mode_get_id( const NAImportMode *mode ) { guint id; g_return_val_if_fail( NA_IS_IMPORT_MODE( mode ), 0 ); id = 0; if( !mode->private->dispose_has_run ){ id = mode->private->id; } return( id ); } nautilus-actions-3.2.3/src/core/na-factory-object.h0000644000175100017500000000731612212601376017151 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_FACTORY_OBJECT_H__ #define __CORE_NA_FACTORY_OBJECT_H__ /* @title: NAIFactoryObject * @short_description: The #NAIFactoryObject Internal Functions * @include: core/na-factory-object.h * * Declare the function only accessed from core library, i.e. not * published as API. */ #include G_BEGIN_DECLS typedef gboolean ( *NAFactoryObjectIterBoxedFn )( const NAIFactoryObject *object, NADataBoxed *boxed, void *data ); #define NA_IFACTORY_OBJECT_PROP_DATA "na-ifactory-object-prop-data" void na_factory_object_define_properties( GObjectClass *class, const NADataGroup *groups ); NADataDef *na_factory_object_get_data_def ( const NAIFactoryObject *object, const gchar *name ); NADataGroup *na_factory_object_get_data_groups ( const NAIFactoryObject *object ); void na_factory_object_iter_on_boxed ( const NAIFactoryObject *object, NAFactoryObjectIterBoxedFn pfn, void *user_data ); gchar *na_factory_object_get_default ( NAIFactoryObject *object, const gchar *name ); void na_factory_object_set_defaults ( NAIFactoryObject *object ); void na_factory_object_move_boxed ( NAIFactoryObject *target, const NAIFactoryObject *source, NADataBoxed *boxed ); void na_factory_object_copy ( NAIFactoryObject *target, const NAIFactoryObject *source ); gboolean na_factory_object_are_equal ( const NAIFactoryObject *a, const NAIFactoryObject *b ); gboolean na_factory_object_is_valid ( const NAIFactoryObject *object ); void na_factory_object_dump ( const NAIFactoryObject *object ); void na_factory_object_finalize ( NAIFactoryObject *object ); void na_factory_object_read_item ( NAIFactoryObject *object, const NAIFactoryProvider *reader, void *reader_data, GSList **messages ); guint na_factory_object_write_item ( NAIFactoryObject *object, const NAIFactoryProvider *writer, void *writer_data, GSList **messages ); void *na_factory_object_get_as_void ( const NAIFactoryObject *object, const gchar *name ); void na_factory_object_get_as_value ( const NAIFactoryObject *object, const gchar *name, GValue *value ); gboolean na_factory_object_is_set ( const NAIFactoryObject *object, const gchar *name ); void na_factory_object_set_from_value ( NAIFactoryObject *object, const gchar *name, const GValue *value ); void na_factory_object_set_from_void ( NAIFactoryObject *object, const gchar *name, const void *data ); G_END_DECLS #endif /* __CORE_NA_FACTORY_OBJECT_H__ */ nautilus-actions-3.2.3/src/core/na-gconf-utils.c0000644000175100017500000005144512212601376016465 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_GCONF #include #include #include static void dump_entry( GConfEntry *entry, void *user_data ); static GConfValue *read_value( GConfClient *gconf, const gchar *path, gboolean use_schema, GConfValueType type ); #ifdef NA_ENABLE_DEPRECATED static gboolean sync_gconf( GConfClient *gconf, gchar **message ); #endif /* NA_ENABLE_DEPRECATED */ /** * na_gconf_utils_get_subdirs: * @gconf: a GConfClient instance. * @path: a full path to be read. * * Returns: a list of full path subdirectories. * * The returned list should be na_gconf_utils_free_subdirs() by the caller. * * Since: 2.30 */ GSList * na_gconf_utils_get_subdirs( GConfClient *gconf, const gchar *path ) { static const gchar *thisfn = "na_gconf_utils_get_subdirs"; GError *error = NULL; GSList *list_subdirs; list_subdirs = gconf_client_all_dirs( gconf, path, &error ); if( error ){ g_warning( "%s: path=%s, error=%s", thisfn, path, error->message ); g_error_free( error ); return(( GSList * ) NULL ); } return( list_subdirs ); } /** * na_gconf_utils_free_subdirs: * @subdirs: the subdirectory list as returned from na_gconf_utils_get_subdirs(). * * Release the list. * * Since: 2.30 */ void na_gconf_utils_free_subdirs( GSList *subdirs ) { na_core_utils_slist_free( subdirs ); } /** * na_gconf_utils_has_entry: * @entries: the list of entries as returned by na_gconf_utils_get_entries(). * @entry: the entry to be tested. * * Returns: %TRUE if the given @entry exists in the specified @entries, * %FALSE else. * * Since: 2.30 */ gboolean na_gconf_utils_has_entry( GSList *entries, const gchar *entry ) { GSList *ie; for( ie = entries ; ie ; ie = ie->next ){ gchar *key = g_path_get_basename( gconf_entry_get_key( ( GConfEntry * ) ie->data)); int res = strcmp( key, entry ); g_free( key ); if( res == 0 ){ return( TRUE ); } } return( FALSE ); } /** * na_gconf_utils_get_entries: * @gconf: a GConfClient instance. * @path: a full path to be read. * * Loads all the key=value pairs of the specified key. * * Returns: a list of #GConfEntry. * * The returned list is not recursive : it contains only the immediate * children of @path. To free the returned list, call * na_gconf_utils_free_entries(). * * Since: 2.30 */ GSList * na_gconf_utils_get_entries( GConfClient *gconf, const gchar *path ) { static const gchar *thisfn = "na_gconf_utils_get_entries"; GError *error = NULL; GSList *list_entries; list_entries = gconf_client_all_entries( gconf, path, &error ); if( error ){ g_warning( "%s: path=%s, error=%s", thisfn, path, error->message ); g_error_free( error ); return(( GSList * ) NULL ); } return( list_entries ); } /** * na_gconf_utils_get_bool_from_entries: * @entries: a list of #GConfEntry as returned by na_gconf_utils_get_entries(). * @entry: the searched entry. * @value: a pointer to a gboolean to be set to the found value. * * Returns: %TRUE if the entry was found, %FALSE else. * * If the entry was not found, or was not of boolean type, @value is set * to %FALSE. * * Since: 2.30 */ gboolean na_gconf_utils_get_bool_from_entries( GSList *entries, const gchar *entry, gboolean *value ) { GSList *ip; GConfEntry *gconf_entry; GConfValue *gconf_value; gchar *key; gboolean found; g_return_val_if_fail( value, FALSE ); *value = FALSE; found = FALSE; for( ip = entries ; ip && !found ; ip = ip->next ){ gconf_entry = ( GConfEntry * ) ip->data; key = g_path_get_basename( gconf_entry_get_key( gconf_entry )); if( !strcmp( key, entry )){ gconf_value = gconf_entry_get_value( gconf_entry ); if( gconf_value && gconf_value->type == GCONF_VALUE_BOOL ){ found = TRUE; *value = gconf_value_get_bool( gconf_value ); } } g_free( key ); } return( found ); } /** * na_gconf_utils_get_string_from_entries: * @entries: a list of #GConfEntry as returned by na_gconf_utils_get_entries(). * @entry: the searched entry. * @value: a pointer to a gchar * to be set to the found value. * * Returns: %TRUE if the entry was found, %FALSE else. * * If the entry was not found, or was not of string type, @value is set * to %NULL. * * If @value is returned not NULL, it should be g_free() by the caller. * * Since: 2.30 */ gboolean na_gconf_utils_get_string_from_entries( GSList *entries, const gchar *entry, gchar **value ) { GSList *ip; GConfEntry *gconf_entry; GConfValue *gconf_value; gchar *key; gboolean found; g_return_val_if_fail( value, FALSE ); *value = NULL; found = FALSE; for( ip = entries ; ip && !found ; ip = ip->next ){ gconf_entry = ( GConfEntry * ) ip->data; key = g_path_get_basename( gconf_entry_get_key( gconf_entry )); if( !strcmp( key, entry )){ gconf_value = gconf_entry_get_value( gconf_entry ); if( gconf_value && gconf_value->type == GCONF_VALUE_STRING ){ found = TRUE; *value = g_strdup( gconf_value_get_string( gconf_value )); } } g_free( key ); } return( found ); } /** * na_gconf_utils_get_string_list_from_entries: * @entries: a list of #GConfEntry as returned by na_gconf_utils_get_entries(). * @entry: the searched entry. * @value: a pointer to a GSList * to be set to the found value. * * Returns: %TRUE if the entry was found, %FALSE else. * * If the entry was not found, or was not of string list type, @value * is set to %NULL. * * If @value is returned not NULL, it should be na_core_utils_slist_free() * by the caller. * * Since: 2.30 */ gboolean na_gconf_utils_get_string_list_from_entries( GSList *entries, const gchar *entry, GSList **value ) { GSList *ip, *iv; GConfEntry *gconf_entry; GConfValue *gconf_value; gchar *key; gboolean found; GSList *list_values; g_return_val_if_fail( value, FALSE ); *value = NULL; found = FALSE; for( ip = entries ; ip && !found ; ip = ip->next ){ gconf_entry = ( GConfEntry * ) ip->data; key = g_path_get_basename( gconf_entry_get_key( gconf_entry )); if( !strcmp( key, entry )){ gconf_value = gconf_entry_get_value( gconf_entry ); if( gconf_value && gconf_value->type == GCONF_VALUE_LIST ){ found = TRUE; list_values = gconf_value_get_list( gconf_value ); for( iv = list_values ; iv ; iv = iv->next ){ *value = g_slist_append( *value, g_strdup( gconf_value_get_string(( GConfValue * ) iv->data ))); } } } g_free( key ); } return( found ); } /** * na_gconf_utils_dump_entries: * @entries: a list of #GConfEntry as returned by na_gconf_utils_get_entries(). * * Dumps the content of the entries. * * Since: 2.30 */ void na_gconf_utils_dump_entries( GSList *entries ) { g_slist_foreach( entries, ( GFunc ) dump_entry, NULL ); } static void dump_entry( GConfEntry *entry, void *user_data ) { static const gchar *thisfn = "na_gconf_utils_dump_entry"; gchar *str = NULL; gboolean str_free = FALSE; GSList *value_list, *it; GConfValueType type_list; GString *string; gchar *key = g_path_get_basename( gconf_entry_get_key( entry )); GConfValue *value = gconf_entry_get_value( entry ); if( value ){ switch( value->type ){ case GCONF_VALUE_STRING: str = ( gchar * ) gconf_value_get_string( value ); break; case GCONF_VALUE_INT: str = g_strdup_printf( "%d", gconf_value_get_int( value )); str_free = TRUE; break; case GCONF_VALUE_FLOAT: str = g_strdup_printf( "%f", gconf_value_get_float( value )); str_free = TRUE; break; case GCONF_VALUE_BOOL: str = g_strdup_printf( "%s", gconf_value_get_bool( value ) ? "True":"False" ); str_free = TRUE; break; case GCONF_VALUE_LIST: type_list = gconf_value_get_list_type( value ); value_list = gconf_value_get_list( value ); switch( type_list ){ case GCONF_VALUE_STRING: string = g_string_new( "[" ); for( it = value_list ; it ; it = it->next ){ if( g_utf8_strlen( string->str, -1 ) > 1 ){ string = g_string_append( string, "," ); } string = g_string_append( string, ( const gchar * ) gconf_value_get_string( it->data )); } string = g_string_append( string, "]" ); str = g_string_free( string, FALSE ); break; default: str = g_strdup( "(undetermined value)" ); } str_free = TRUE; break; default: str = g_strdup( "(undetermined value)" ); str_free = TRUE; } } g_debug( "%s: key=%s, value=%s", thisfn, key, str ); if( str_free ){ g_free( str ); } g_free( key ); } /** * na_gconf_utils_free_entries: * @entries: a list of #GConfEntry as returned by na_gconf_utils_get_entries(). * * Releases the provided list. * * Since: 2.30 */ void na_gconf_utils_free_entries( GSList *entries ) { g_slist_foreach( entries, ( GFunc ) gconf_entry_unref, NULL ); g_slist_free( entries ); } /** * na_gconf_utils_read_bool: * @gconf: a GConfClient instance. * @path: the full path to the key. * @use_schema: whether to use the default value from schema, or not. * @default_value: default value to be used if schema is not used or * doesn't exist. * * Returns: the required boolean value. * * Since: 2.30 */ gboolean na_gconf_utils_read_bool( GConfClient *gconf, const gchar *path, gboolean use_schema, gboolean default_value ) { GConfValue *value; gboolean ret; g_return_val_if_fail( GCONF_IS_CLIENT( gconf ), FALSE ); ret = default_value; value = read_value( gconf, path, use_schema, GCONF_VALUE_BOOL ); if( value ){ ret = gconf_value_get_bool( value ); gconf_value_free( value ); } return( ret ); } /** * na_gconf_utils_read_int: * @gconf: a GConfClient instance. * @path: the full path to the key. * @use_schema: whether to use the default value from schema, or not. * @default_value: default value to be used if schema is not used or * doesn't exist. * * Returns: the required integer value. * * Since: 2.30 */ gint na_gconf_utils_read_int( GConfClient *gconf, const gchar *path, gboolean use_schema, gint default_value ) { GConfValue *value = NULL; gint ret; g_return_val_if_fail( GCONF_IS_CLIENT( gconf ), FALSE ); ret = default_value; value = read_value( gconf, path, use_schema, GCONF_VALUE_INT ); if( value ){ ret = gconf_value_get_int( value ); gconf_value_free( value ); } return( ret ); } /** * na_gconf_utils_read_string: * @gconf: a GConfClient instance. * @path: the full path to the key. * @use_schema: whether to use the default value from schema, or not. * @default_value: default value to be used if schema is not used or * doesn't exist. * * Returns: the required string value in a newly allocated string which * should be g_free() by the caller. * * Since: 2.30 */ gchar * na_gconf_utils_read_string( GConfClient *gconf, const gchar *path, gboolean use_schema, const gchar *default_value ) { GConfValue *value = NULL; gchar *result; g_return_val_if_fail( GCONF_IS_CLIENT( gconf ), NULL ); result = g_strdup( default_value ); value = read_value( gconf, path, use_schema, GCONF_VALUE_STRING ); if( value ){ g_free( result ); result = g_strdup( gconf_value_get_string( value )); gconf_value_free( value ); } return( result ); } /** * na_gconf_utils_read_string_list: * @gconf: a GConfClient instance. * @path: the full path to the key to be read. * * Returns: a list of strings, * or %NULL if the entry was not found or was not of string list type. * * The returned list must be released with na_core_utils_slist_free(). * * Since: 2.30 */ GSList * na_gconf_utils_read_string_list( GConfClient *gconf, const gchar *path ) { static const gchar *thisfn = "na_gconf_utils_read_string_list"; GError *error = NULL; GSList *list_strings; g_return_val_if_fail( GCONF_IS_CLIENT( gconf ), NULL ); list_strings = gconf_client_get_list( gconf, path, GCONF_VALUE_STRING, &error ); if( error ){ g_warning( "%s: path=%s, error=%s", thisfn, path, error->message ); g_error_free( error ); return( NULL ); } return( list_strings ); } #ifdef NA_ENABLE_DEPRECATED /** * na_gconf_utils_write_bool: * @gconf: a GConfClient instance. * @path: the full path to the key. * @value: the value to be written. * @message: a pointer to a gchar * which will be allocated if needed. * * Writes a boolean at the given @path. * * Returns: %TRUE if the writing has been successful, %FALSE else. * * If returned not NULL, the @message contains an error message. * It should be g_free() by the caller. * * Since: 2.30 * Deprecated: 3.1 */ gboolean na_gconf_utils_write_bool( GConfClient *gconf, const gchar *path, gboolean value, gchar **message ) { static const gchar *thisfn = "na_gconf_utils_write_bool"; gboolean ret = TRUE; GError *error = NULL; g_return_val_if_fail( GCONF_IS_CLIENT( gconf ), FALSE ); if( !gconf_client_set_bool( gconf, path, value, &error )){ if( message ){ *message = g_strdup( error->message ); } g_warning( "%s: path=%s, value=%s, error=%s", thisfn, path, value ? "True":"False", error->message ); g_error_free( error ); ret = FALSE; } return( ret ); } /** * na_gconf_utils_write_int: * @gconf: a GConfClient instance. * @path: the full path to the key. * @value: the value to be written. * @message: a pointer to a gchar * which will be allocated if needed. * * Writes an integer at the given @path. * * Returns: %TRUE if the writing has been successful, %FALSE else. * * If returned not NULL, the @message contains an error message. * It should be g_free() by the caller. * * Since: 2.30 * Deprecated: 3.1 */ gboolean na_gconf_utils_write_int( GConfClient *gconf, const gchar *path, gint value, gchar **message ) { static const gchar *thisfn = "na_gconf_utils_write_int"; gboolean ret = TRUE; GError *error = NULL; g_return_val_if_fail( GCONF_IS_CLIENT( gconf ), FALSE ); if( !gconf_client_set_int( gconf, path, value, &error )){ if( message ){ *message = g_strdup( error->message ); } g_warning( "%s: path=%s, value=%d, error=%s", thisfn, path, value, error->message ); g_error_free( error ); ret = FALSE; } return( ret ); } /** * na_gconf_utils_write_string: * @gconf: a GConfClient instance. * @path: the full path to the key. * @value: the value to be written. * @message: a pointer to a gchar * which will be allocated if needed. * * Writes a string at the given @path. * * Returns: %TRUE if the writing has been successful, %FALSE else. * * If returned not NULL, the @message contains an error message. * It should be g_free() by the caller. * * Since: 2.30 * Deprecated: 3.1 */ gboolean na_gconf_utils_write_string( GConfClient *gconf, const gchar *path, const gchar *value, gchar **message ) { static const gchar *thisfn = "na_gconf_utils_write_string"; gboolean ret = TRUE; GError *error = NULL; g_return_val_if_fail( GCONF_IS_CLIENT( gconf ), FALSE ); if( !gconf_client_set_string( gconf, path, value, &error )){ if( message ){ *message = g_strdup( error->message ); } g_warning( "%s: path=%s, value=%s, error=%s", thisfn, path, value, error->message ); g_error_free( error ); ret = FALSE; } return( ret ); } /** * na_gconf_utils_write_string_list: * @gconf: a GConfClient instance. * @path: the full path to the key. * @value: the list of values to be written. * @message: a pointer to a gchar * which will be allocated if needed. * * Writes a list of strings at the given @path. * * Returns: %TRUE if the writing has been successful, %FALSE else. * * If returned not NULL, the @message contains an error message. * It should be g_free() by the caller. * * Since: 2.30 * Deprecated: 3.1 */ gboolean na_gconf_utils_write_string_list( GConfClient *gconf, const gchar *path, GSList *value, gchar **message ) { static const gchar *thisfn = "na_gconf_utils_write_string_list"; gboolean ret = TRUE; GError *error = NULL; g_return_val_if_fail( GCONF_IS_CLIENT( gconf ), FALSE ); if( !gconf_client_set_list( gconf, path, GCONF_VALUE_STRING, value, &error )){ if( message ){ *message = g_strdup( error->message ); } g_warning( "%s: path=%s, value=%p (count=%d), error=%s", thisfn, path, ( void * ) value, g_slist_length( value ), error->message ); g_error_free( error ); ret = FALSE; } if( ret ){ ret = sync_gconf( gconf, message ); } return( ret ); } /** * na_gconf_utils_remove_entry: * @gconf: a GConfClient instance. * @path: the full path to the entry. * @message: a pointer to a gchar * which will be allocated if needed. * * Removes an entry from user preferences. * * Returns: %TRUE if the operation was successful, %FALSE else. * * Since: 2.30 * Deprecated: 3.1 */ gboolean na_gconf_utils_remove_entry( GConfClient *gconf, const gchar *path, gchar **message ) { static const gchar *thisfn = "na_gconf_utils_remove_entry"; gboolean ret; GError *error = NULL; g_return_val_if_fail( GCONF_IS_CLIENT( gconf ), FALSE ); ret = gconf_client_unset( gconf, path, &error ); if( !ret ){ if( message ){ *message = g_strdup( error->message ); } g_warning( "%s: path=%s, error=%s", thisfn, path, error->message ); g_error_free( error ); } if( ret ){ ret = sync_gconf( gconf, message ); } return( ret ); } /** * na_gconf_utils_slist_from_string: * @value: a string of the form [xxx,yyy,...] as read from GConf. * * Converts a string representing a list of strings in a GConf format * to a list of strings. * * Returns: a newly allocated list of strings, which should be * na_core_utils_slist_free() by the caller, or %NULL if the provided * string was not of the GConf form. * * Since: 2.30 * Deprecated: 3.1 */ GSList * na_gconf_utils_slist_from_string( const gchar *value ) { GSList *slist; gchar *tmp_string; tmp_string = g_strdup( value ); g_strstrip( tmp_string ); if( !tmp_string || strlen( tmp_string ) < 3 ){ g_free( tmp_string ); return( NULL ); } if( tmp_string[0] != '[' || tmp_string[strlen(tmp_string)-1] != ']' ){ g_free( tmp_string ); return( NULL ); } tmp_string += 1; tmp_string[strlen(tmp_string)-1] = '\0'; slist = na_core_utils_slist_from_split( tmp_string, "," ); return( slist ); } /** * na_gconf_utils_slist_to_string: * @slist: a #GSList to be displayed. * * Returns: the content of @slist, with the GConf format, as a newly * allocated string which should be g_free() by the caller. * * Since: 2.30 * Deprecated: 3.1 */ gchar * na_gconf_utils_slist_to_string( GSList *slist ) { GSList *is; GString *str = g_string_new( "[" ); gboolean first; first = TRUE; for( is = slist ; is ; is = is->next ){ if( !first ){ str = g_string_append( str, "," ); } str = g_string_append( str, ( const gchar * ) is->data ); first = FALSE; } str = g_string_append( str, "]" ); return( g_string_free( str, FALSE )); } #endif /* NA_ENABLE_DEPRECATED */ static GConfValue * read_value( GConfClient *gconf, const gchar *path, gboolean use_schema, GConfValueType type ) { static const gchar *thisfn = "na_gconf_utils_read_value"; GError *error = NULL; GConfValue *value = NULL; if( use_schema ){ value = gconf_client_get( gconf, path, &error ); } else { value = gconf_client_get_without_default( gconf, path, &error ); } if( error ){ g_warning( "%s: path=%s, error=%s", thisfn, path, error->message ); g_error_free( error ); if( value ){ gconf_value_free( value ); value = NULL; } } if( value ){ if( value->type != type ){ g_warning( "%s: path=%s, found type '%u' while waiting for type '%u'", thisfn, path, value->type, type ); gconf_value_free( value ); value = NULL; } } return( value ); } #ifdef NA_ENABLE_DEPRECATED static gboolean sync_gconf( GConfClient *gconf, gchar **message ) { static const gchar *thisfn = "na_gconf_utils_sync_gconf"; gboolean ret = TRUE; GError *error = NULL; gconf_client_suggest_sync( gconf, &error ); if( error ){ if( message ){ *message = g_strdup( error->message ); } g_warning( "%s: error=%s", thisfn, error->message ); g_error_free( error ); ret = FALSE; } return( ret ); } #endif /* NA_ENABLE_DEPRECATED */ #endif /* HAVE_GCONF */ nautilus-actions-3.2.3/src/core/na-tokens.c0000644000175100017500000006351612212601376015540 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "na-gnome-vfs-uri.h" #include "na-selected-info.h" #include "na-settings.h" #include "na-tokens.h" /* private class data */ struct _NATokensClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NATokensPrivate { gboolean dispose_has_run; guint count; GSList *uris; GSList *filenames; GSList *basedirs; GSList *basenames; GSList *basenames_woext; GSList *exts; GSList *mimetypes; gchar *hostname; gchar *username; guint port; gchar *scheme; }; /* the structure passed to the callback which waits for the end of the child */ typedef struct { gchar *command; gboolean is_output_displayed; gint child_stdout; gint child_stderr; } ChildStr; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NATokensClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void child_watch_fn( GPid pid, gint status, ChildStr *child_str ); static void display_output( const gchar *command, int fd_stdout, int fd_stderr ); static gchar *display_output_get_content( int fd ); static void execute_action_command( gchar *command, const NAObjectProfile *profile, const NATokens *tokens ); static gchar *get_command_execution_display_output( const gchar *command ); static gchar *get_command_execution_embedded( const gchar *command ); static gchar *get_command_execution_normal( const gchar *command ); static gchar *get_command_execution_terminal( const gchar *command ); static gboolean is_singular_exec( const NATokens *tokens, const gchar *exec ); static gchar *parse_singular( const NATokens *tokens, const gchar *input, guint i, gboolean utf8, gboolean quoted ); static GString *quote_string( GString *input, const gchar *name, gboolean quoted ); static GString *quote_string_list( GString *input, GSList *names, gboolean quoted ); GType na_tokens_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_tokens_register_type"; GType type; static GTypeInfo info = { sizeof( NATokensClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NATokens ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NATokens", &info, 0 ); return( type ); } static void class_init( NATokensClass *klass ) { static const gchar *thisfn = "na_tokens_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NATokensClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_tokens_instance_init"; NATokens *self; g_return_if_fail( NA_IS_TOKENS( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_TOKENS( instance ); self->private = g_new0( NATokensPrivate, 1 ); self->private->uris = NULL; self->private->filenames = NULL; self->private->basedirs = NULL; self->private->basenames = NULL; self->private->basenames_woext = NULL; self->private->exts = NULL; self->private->mimetypes = NULL; self->private->hostname = NULL; self->private->username = NULL; self->private->port = 0; self->private->scheme = NULL; self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_tokens_instance_dispose"; NATokens *self; g_return_if_fail( NA_IS_TOKENS( object )); self = NA_TOKENS( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_tokens_instance_finalize"; NATokens *self; g_return_if_fail( NA_IS_TOKENS( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NA_TOKENS( object ); g_free( self->private->scheme ); g_free( self->private->username ); g_free( self->private->hostname ); na_core_utils_slist_free( self->private->mimetypes ); na_core_utils_slist_free( self->private->exts ); na_core_utils_slist_free( self->private->basenames_woext ); na_core_utils_slist_free( self->private->basenames ); na_core_utils_slist_free( self->private->basedirs ); na_core_utils_slist_free( self->private->filenames ); na_core_utils_slist_free( self->private->uris ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /* * na_tokens_new_for_example: * * Returns: a new #NATokens object initialized with fake values for two * regular files, in order to be used as an example of an expanded command * line. */ NATokens * na_tokens_new_for_example( void ) { NATokens *tokens; const gchar *ex_uri1 = _( "file:///path/to/file1.mid" ); const gchar *ex_uri2 = _( "file:///path/to/file2.jpeg" ); const gchar *ex_mimetype1 = _( "audio/x-midi" ); const gchar *ex_mimetype2 = _( "image/jpeg" ); const guint ex_port = 8080; const gchar *ex_host = _( "test.example.net" ); const gchar *ex_user = _( "user" ); NAGnomeVFSURI *vfs; gchar *dirname, *bname, *bname_woext, *ext; GSList *is; gboolean first; tokens = g_object_new( NA_TYPE_TOKENS, NULL ); first = TRUE; tokens->private->count = 2; tokens->private->uris = g_slist_append( tokens->private->uris, g_strdup( ex_uri1 )); tokens->private->uris = g_slist_append( tokens->private->uris, g_strdup( ex_uri2 )); for( is = tokens->private->uris ; is ; is = is->next ){ vfs = g_new0( NAGnomeVFSURI, 1 ); na_gnome_vfs_uri_parse( vfs, is->data ); tokens->private->filenames = g_slist_append( tokens->private->filenames, g_strdup( vfs->path )); dirname = g_path_get_dirname( vfs->path ); tokens->private->basedirs = g_slist_append( tokens->private->basedirs, dirname ); bname = g_path_get_basename( vfs->path ); tokens->private->basenames = g_slist_append( tokens->private->basenames, bname ); na_core_utils_dir_split_ext( bname, &bname_woext, &ext ); tokens->private->basenames_woext = g_slist_append( tokens->private->basenames_woext, bname_woext ); tokens->private->exts = g_slist_append( tokens->private->exts, ext ); if( first ){ tokens->private->scheme = g_strdup( vfs->scheme ); first = FALSE; } na_gnome_vfs_uri_free( vfs ); } tokens->private->mimetypes = g_slist_append( tokens->private->mimetypes, g_strdup( ex_mimetype1 )); tokens->private->mimetypes = g_slist_append( tokens->private->mimetypes, g_strdup( ex_mimetype2 )); tokens->private->hostname = g_strdup( ex_host ); tokens->private->username = g_strdup( ex_user ); tokens->private->port = ex_port; return( tokens ); } /* * na_tokens_new_from_selection: * @selection: a #GList list of #NASelectedInfo objects. * * Returns: a new #NATokens object which holds all possible tokens. */ NATokens * na_tokens_new_from_selection( GList *selection ) { static const gchar *thisfn = "na_tokens_new_from_selection"; NATokens *tokens; GList *it; gchar *uri, *filename, *basedir, *basename, *bname_woext, *ext, *mimetype; gboolean first; g_debug( "%s: selection=%p (count=%d)", thisfn, ( void * ) selection, g_list_length( selection )); first = TRUE; tokens = g_object_new( NA_TYPE_TOKENS, NULL ); tokens->private->count = g_list_length( selection ); for( it = selection ; it ; it = it->next ){ mimetype = na_selected_info_get_mime_type( NA_SELECTED_INFO( it->data )); uri = na_selected_info_get_uri( NA_SELECTED_INFO( it->data )); filename = na_selected_info_get_path( NA_SELECTED_INFO( it->data )); basedir = na_selected_info_get_dirname( NA_SELECTED_INFO( it->data )); basename = na_selected_info_get_basename( NA_SELECTED_INFO( it->data )); na_core_utils_dir_split_ext( basename, &bname_woext, &ext ); if( first ){ tokens->private->hostname = na_selected_info_get_uri_host( NA_SELECTED_INFO( it->data )); tokens->private->username = na_selected_info_get_uri_user( NA_SELECTED_INFO( it->data )); tokens->private->port = na_selected_info_get_uri_port( NA_SELECTED_INFO( it->data )); tokens->private->scheme = na_selected_info_get_uri_scheme( NA_SELECTED_INFO( it->data )); first = FALSE; } tokens->private->uris = g_slist_append( tokens->private->uris, uri ); tokens->private->filenames = g_slist_append( tokens->private->filenames, filename ); tokens->private->basedirs = g_slist_append( tokens->private->basedirs, basedir ); tokens->private->basenames = g_slist_append( tokens->private->basenames, basename ); tokens->private->basenames_woext = g_slist_append( tokens->private->basenames_woext, bname_woext ); tokens->private->exts = g_slist_append( tokens->private->exts, ext ); tokens->private->mimetypes = g_slist_append( tokens->private->mimetypes, mimetype ); } return( tokens ); } /* * na_tokens_parse_for_display: * @tokens: a #NATokens object. * @string: the input string, may or may not contain tokens. * @utf8: whether the @input string is UTF-8 encoded, or a standard ASCII string. * * Expands the parameters in the given string. * * This expanded string is meant to be displayed only (not executed) as * filenames are not shell-quoted. * * Returns: a copy of @input string with tokens expanded, as a newly * allocated string which should be g_free() by the caller. */ gchar * na_tokens_parse_for_display( const NATokens *tokens, const gchar *string, gboolean utf8 ) { return( parse_singular( tokens, string, 0, utf8, FALSE )); } /* * na_tokens_execute_action: * @tokens: a #NATokens object. * @profile: the #NAObjectProfile to be executed. * * Execute the given action, regarding the context described by @tokens. */ void na_tokens_execute_action( const NATokens *tokens, const NAObjectProfile *profile ) { gchar *path, *parameters, *exec; gboolean singular; guint i; gchar *command; path = na_object_get_path( profile ); parameters = na_object_get_parameters( profile ); exec = g_strdup_printf( "%s %s", path, parameters ); g_free( parameters ); g_free( path ); singular = is_singular_exec( tokens, exec ); if( singular ){ for( i = 0 ; i < tokens->private->count ; ++i ){ command = parse_singular( tokens, exec, i, FALSE, TRUE ); execute_action_command( command, profile, tokens ); g_free( command ); } } else { command = parse_singular( tokens, exec, 0, FALSE, TRUE ); execute_action_command( command, profile, tokens ); g_free( command ); } g_free( exec ); } static void child_watch_fn( GPid pid, gint status, ChildStr *child_str ) { static const gchar *thisfn = "na_tokens_child_watch_fn"; g_debug( "%s: pid=%u, status=%d", thisfn, ( guint ) pid, status ); g_spawn_close_pid( pid ); if( child_str->is_output_displayed ){ display_output( child_str->command, child_str->child_stdout, child_str->child_stderr ); } g_free( child_str->command ); g_free( child_str ); } static void display_output( const gchar *command, int fd_stdout, int fd_stderr ) { GtkWidget *dialog; gchar *std_output, *std_error; dialog = gtk_message_dialog_new_with_markup( NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", _( "Output of the run command" )); g_object_set( G_OBJECT( dialog ) , "title", PACKAGE_NAME, NULL ); std_output = display_output_get_content( fd_stdout ); std_error = display_output_get_content( fd_stderr ); gtk_message_dialog_format_secondary_markup( GTK_MESSAGE_DIALOG( dialog ), "%s\n%s\n\n%s\n%s\n\n%s\n%s\n\n", _( "Run command:" ), command, _( "Standard output:" ), std_output, _( "Standard error:" ), std_error ); gtk_dialog_run( GTK_DIALOG( dialog )); gtk_widget_destroy( dialog ); g_free( std_output ); g_free( std_error ); } static gchar * display_output_get_content( int fd ) { static const gchar *thisfn = "na_tokens_display_output_get_content"; GInputStream *stream; GString *string; gchar buf[1024]; GError *error; gchar *msg; string = g_string_new( "" ); memset( buf, '\0', sizeof( buf )); if( fd > 0 ){ stream = g_unix_input_stream_new( fd, TRUE ); error = NULL; while( g_input_stream_read( stream, buf, sizeof( buf )-1, NULL, &error )){ string = g_string_append( string, buf ); memset( buf, '\0', sizeof( buf )); } if( error ){ g_warning( "%s: g_input_stream_read: %s", thisfn, error->message ); g_error_free( error ); } g_input_stream_close( stream, NULL, NULL ); } msg = g_locale_to_utf8( string->str, -1, NULL, NULL, NULL ); g_string_free( string, TRUE ); return( msg ); } /* * Execution environment: * - Normal: just execute the specified command * - Terminal: use the user preference to have a terminal which stays openeded * - Embedded: id. Terminal * - DisplayOutput: execute in a shell */ static void execute_action_command( gchar *command, const NAObjectProfile *profile, const NATokens *tokens ) { static const gchar *thisfn = "nautilus_actions_execute_action_command"; GError *error; gchar *execution_mode, *run_command; gchar **argv; gint argc; gchar *wdir, *wdir_nq; GPid child_pid; ChildStr *child_str; g_debug( "%s: profile=%p", thisfn, ( void * ) profile ); error = NULL; run_command = NULL; child_str = g_new0( ChildStr, 1 ); child_pid = ( GPid ) 0; execution_mode = na_object_get_execution_mode( profile ); if( !strcmp( execution_mode, "Normal" )){ run_command = get_command_execution_normal( command ); } else if( !strcmp( execution_mode, "Terminal" )){ run_command = get_command_execution_terminal( command ); } else if( !strcmp( execution_mode, "Embedded" )){ run_command = get_command_execution_embedded( command ); } else if( !strcmp( execution_mode, "DisplayOutput" )){ child_str->is_output_displayed = TRUE; run_command = get_command_execution_display_output( command ); } else { g_warning( "%s: unknown execution mode: %s", thisfn, execution_mode ); } if( run_command ){ child_str->command = g_strdup( run_command ); if( !g_shell_parse_argv( run_command, &argc, &argv, &error )){ g_warning( "%s: g_shell_parse_argv: %s", thisfn, error->message ); g_error_free( error ); } else { wdir = na_object_get_working_dir( profile ); wdir_nq = parse_singular( tokens, wdir, 0, FALSE, FALSE ); g_debug( "%s: run_command=%s, wdir=%s", thisfn, run_command, wdir_nq ); /* it appears that at least mplayer does not support g_spawn_async_with_pipes * (at least when not run in '-quiet' mode) while, e.g., totem and vlc rightly * support this function * So only use g_spawn_async_with_pipes when we really need to get back * the content of output and error streams * See https://bugzilla.gnome.org/show_bug.cgi?id=644289. */ if( child_str->is_output_displayed ){ g_spawn_async_with_pipes( wdir_nq, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &child_pid, NULL, &child_str->child_stdout, &child_str->child_stderr, &error ); } else { g_spawn_async( wdir_nq, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &child_pid, &error ); } if( error ){ g_warning( "%s: g_spawn_async: %s", thisfn, error->message ); g_error_free( error ); child_pid = ( GPid ) 0; } else { g_child_watch_add( child_pid, ( GChildWatchFunc ) child_watch_fn, child_str ); } g_free( wdir ); g_free( wdir_nq ); g_strfreev( argv ); } g_free( run_command ); } g_free( execution_mode ); if( child_pid == ( GPid ) 0 ){ g_free( child_str->command ); g_free( child_str ); } } static gchar * get_command_execution_display_output( const gchar *command ) { static const gchar *bin_sh = "/bin/sh -c COMMAND"; return( na_tokens_command_for_terminal( bin_sh, command )); } static gchar * get_command_execution_embedded( const gchar *command ) { return( get_command_execution_terminal( command )); } static gchar * get_command_execution_normal( const gchar *command ) { return( g_strdup( command )); } static gchar * get_command_execution_terminal( const gchar *command ) { gchar *run_command; gchar *pattern; pattern = na_settings_get_string( NA_IPREFS_TERMINAL_PATTERN, NULL, NULL ); run_command = na_tokens_command_for_terminal( pattern, command ); g_free( pattern ); return( run_command ); } /** * na_tokens_command_for_terminal: * @pattern: the command pattern; should include a 'COMMAND' keyword * @command: the command to be actually run in the terminal * * Returns: the command to be run, as a newly allocated string which should * be g_free() by the caller. */ gchar * na_tokens_command_for_terminal( const gchar *pattern, const gchar *command ) { gchar *run_command; gchar *quoted; if( pattern && strlen( pattern )){ quoted = g_shell_quote( command ); run_command = na_core_utils_str_subst( pattern, "COMMAND", quoted ); g_free( quoted ); } else { run_command = g_strdup( command ); } return( run_command ); } /* * na_tokens_is_singular_exec: * @tokens: the current #NATokens object. * @exec: the to be executed command-line before having been parsed * * Returns: %TRUE if the first relevant parameter found in @exec * command-line is of singular form, %FALSE else. */ static gboolean is_singular_exec( const NATokens *tokens, const gchar *exec ) { gboolean singular; gboolean found; gchar *iter; singular = FALSE; found = FALSE; iter = ( gchar * ) exec; while(( iter = g_strstr_len( iter, -1, "%" )) != NULL && !found ){ switch( iter[1] ){ case 'b': case 'd': case 'f': case 'm': case 'o': case 'u': case 'w': case 'x': found = TRUE; singular = TRUE; break; case 'B': case 'D': case 'F': case 'M': case 'O': case 'U': case 'W': case 'X': found = TRUE; singular = FALSE; break; /* all other parameters are irrelevant according to DES-EMA * c: selection count * h: hostname * n: username * p: port * s: scheme * %: % */ } iter += 2; /* skip the % sign and the character after */ } return( singular ); } /* * parse_singular: * @tokens: a #NATokens object. * @input: the input string, may or may not contain tokens. * @i: the number of the iteration in a multiple selection, starting with zero. * @utf8: whether the @input string is UTF-8 encoded, or a standard ASCII * string. * @quoted: whether the filenames have to be quoted (should be %TRUE when * about to execute a command). * * A command is said of 'singular form' when its first parameter is not * of plural form. In the case of a multiple selection, singular form * commands are executed one time for each element of the selection * * Returns: a #GSList which contains two fields: the command and its parameters. * The returned #GSList should be na_core_utils_slist_free() by the caller. */ static gchar * parse_singular( const NATokens *tokens, const gchar *input, guint i, gboolean utf8, gboolean quoted ) { GString *output; gchar *iter, *prev_iter; const gchar *nth; output = g_string_new( "" ); /* return NULL if input is NULL */ if( !input ){ return( g_string_free( output, TRUE )); } /* return an empty string if input is empty */ if( utf8 ){ if( !g_utf8_strlen( input, -1 )){ return( g_string_free( output, FALSE )); } } else { if( !strlen( input )){ return( g_string_free( output, FALSE )); } } iter = ( gchar * ) input; prev_iter = iter; while(( iter = g_strstr_len( iter, -1, "%" ))){ output = g_string_append_len( output, prev_iter, strlen( prev_iter ) - strlen( iter )); switch( iter[1] ){ case 'b': if( tokens->private->basenames ){ nth = ( const gchar * ) g_slist_nth_data( tokens->private->basenames, i ); if( nth ){ output = quote_string( output, nth, quoted ); } } break; case 'B': if( tokens->private->basenames ){ output = quote_string_list( output, tokens->private->basenames, quoted ); } break; case 'c': g_string_append_printf( output, "%d", tokens->private->count ); break; case 'd': if( tokens->private->basedirs ){ nth = ( const gchar * ) g_slist_nth_data( tokens->private->basedirs, i ); if( nth ){ output = quote_string( output, nth, quoted ); } } break; case 'D': if( tokens->private->basedirs ){ output = quote_string_list( output, tokens->private->basedirs, quoted ); } break; case 'f': if( tokens->private->filenames ){ nth = ( const gchar * ) g_slist_nth_data( tokens->private->filenames, i ); if( nth ){ output = quote_string( output, nth, quoted ); } } break; case 'F': if( tokens->private->filenames ){ output = quote_string_list( output, tokens->private->filenames, quoted ); } break; case 'h': if( tokens->private->hostname ){ output = quote_string( output, tokens->private->hostname, quoted ); } break; /* mimetypes are never quoted */ case 'm': if( tokens->private->mimetypes ){ nth = ( const gchar * ) g_slist_nth_data( tokens->private->mimetypes, i ); if( nth ){ output = quote_string( output, nth, FALSE ); } } break; case 'M': if( tokens->private->mimetypes ){ output = quote_string_list( output, tokens->private->mimetypes, FALSE ); } break; /* no-op operators */ case 'o': case 'O': break; case 'n': if( tokens->private->username ){ output = quote_string( output, tokens->private->username, quoted ); } break; /* port number is never quoted */ case 'p': if( tokens->private->port > 0 ){ g_string_append_printf( output, "%d", tokens->private->port ); } break; case 's': if( tokens->private->scheme ){ output = quote_string( output, tokens->private->scheme, quoted ); } break; case 'u': if( tokens->private->uris ){ nth = ( const gchar * ) g_slist_nth_data( tokens->private->uris, i ); if( nth ){ output = quote_string( output, nth, quoted ); } } break; case 'U': if( tokens->private->uris ){ output = quote_string_list( output, tokens->private->uris, quoted ); } break; case 'w': if( tokens->private->basenames_woext ){ nth = ( const gchar * ) g_slist_nth_data( tokens->private->basenames_woext, i ); if( nth ){ output = quote_string( output, nth, quoted ); } } break; case 'W': if( tokens->private->basenames_woext ){ output = quote_string_list( output, tokens->private->basenames_woext, quoted ); } break; case 'x': if( tokens->private->exts ){ nth = ( const gchar * ) g_slist_nth_data( tokens->private->exts, i ); if( nth ){ output = quote_string( output, nth, quoted ); } } break; case 'X': if( tokens->private->exts ){ output = quote_string_list( output, tokens->private->exts, quoted ); } break; /* a percent sign */ case '%': output = g_string_append_c( output, '%' ); break; } iter += 2; /* skip the % sign and the character after */ prev_iter = iter; /* store the new start of the string */ } output = g_string_append_len( output, prev_iter, strlen( prev_iter )); return( g_string_free( output, FALSE )); } static GString * quote_string( GString *input, const gchar *name, gboolean quoted ) { gchar *tmp; if( quoted ){ tmp = g_shell_quote( name ); input = g_string_append( input, tmp ); g_free( tmp ); } else { input = g_string_append( input, name ); } return( input ); } static GString * quote_string_list( GString *input, GSList *names, gboolean quoted ) { GSList *it; gchar *tmp; if( quoted ){ GSList *quoted_names = NULL; for( it = names ; it ; it = it->next ){ quoted_names = g_slist_append( quoted_names, g_shell_quote(( const gchar * ) it->data )); } tmp = na_core_utils_slist_join_at_end( quoted_names, " " ); na_core_utils_slist_free( quoted_names ); } else { tmp = na_core_utils_slist_join_at_end( g_slist_reverse( names ), " " ); } input = g_string_append( input, tmp ); g_free( tmp ); return( input ); } nautilus-actions-3.2.3/src/core/na-object-id-factory.c0000644000175100017500000000452012212601376017530 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* * As of 3.2 non copyables data are: * - the parent pointer */ NADataDef data_def_id [] = { /* this data is marked non readable / non writable as it has to be read * written specifically when serializing / deserializing items */ { NAFO_DATA_ID, FALSE, FALSE, TRUE, "NAObjectId identifier", "Internal identifier of the NAObjectId object. " \ "Historically a UUID used as a GConf directory (thus ASCII, case insensitive), " \ "it is also the basename of the .desktop file (thus UTF-8, case sensitive).", NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, TRUE, /* mandatory */ FALSE, NULL, NULL, 0, NULL, 0, 0, NULL, NULL }, /* dynamic data, so not readable / not writable */ { NAFO_DATA_PARENT, FALSE, FALSE, TRUE, "NAObjectId Parent", "The NAObjectItem which is the parent of this object.", NA_DATA_TYPE_POINTER, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, NULL, NULL, 0, NULL, 0, 0, NULL, NULL }, { NULL }, }; nautilus-actions-3.2.3/src/core/na-timeout.c0000644000175100017500000000540212212601376015711 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include static gboolean on_timeout_event_timeout( NATimeout *timeout ); static gulong time_val_diff( const GTimeVal *recent, const GTimeVal *old ); /** * na_timeout_event: * @timeout: the #NATimeout structure which will handle this event. */ void na_timeout_event( NATimeout *event ) { g_return_if_fail( event != NULL ); g_get_current_time( &event->last_time ); if( !event->source_id ){ event->source_id = g_timeout_add( event->timeout, ( GSourceFunc ) on_timeout_event_timeout, event ); } } /* * this timer is set when we receive the first event of a serie * we continue to loop until last event is older that our burst timeout */ static gboolean on_timeout_event_timeout( NATimeout *timeout ) { GTimeVal now; gulong diff; gulong timeout_usec; g_get_current_time( &now ); diff = time_val_diff( &now, &timeout->last_time ); timeout_usec = 1000*timeout->timeout; if( diff < timeout_usec ){ /* do not stop */ return( TRUE ); } /* last individual notification is older that the 'timeout' parameter * we may so suppose that the burst is terminated * and feel authorized to trigger the defined callback */ ( *timeout->handler )( timeout->user_data ); /* at the end of the callback execution, reset the event source id. * and stop the execution of this one */ timeout->source_id = 0; return( FALSE ); } /* * returns the difference in microseconds. */ static gulong time_val_diff( const GTimeVal *recent, const GTimeVal *old ) { gulong microsec = 1000000 * ( recent->tv_sec - old->tv_sec ); microsec += recent->tv_usec - old->tv_usec; return( microsec ); } nautilus-actions-3.2.3/src/core/na-tokens.h0000644000175100017500000001106512212601376015535 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu modules. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_TOKENS_H__ #define __CORE_NA_TOKENS_H__ /* @title: NATokens * @short_description: The #NATokens Class Definition * @include: core/na-tokens.h * * The #NATokens class manages the tokens which are to be replaced with * elements of the current selection at runtime. * * Note that until v2.30, tokens were parsed against selection list only * when an item was selected in the Nautilus context menu (i.e. at * execution time). * Starting with unstable v2.99 (stable v3.0), this same parsing may occur * for each displayed label (as new specs accept tokens in labels) - we so * factorize this parsing one time for each new selection in the Nautilus * plugin, attaching the result to each item in the context menu. * * Adding a parameter requires updating of: * - doc/nact/C/figures/nact-legend.png screenshot * - doc/nact/C/nact-execution.xml "Multiple execution" paragraph * - src/core/na-tokens.c::is_singular_exec() function * - src/core/na-tokens.c::parse_singular() function * - src/nact/nautilus-actions-config-tool.ui:LegendDialog labels * - src/core/na-object-profile-factory.c:NAFO_DATA_PARAMETERS comment * * Valid parameters are : * * %b: (first) basename * %B: space-separated list of basenames * %c: count of selected items * %d: (first) base directory * %D: space-separated list of base directory of each selected item * %f: (first) file name * %F: space-separated list of selected file names * %h: hostname of the (first) URI * %m: (first) mimetype * %M: space-separated list of mimetypes * %n: username of the (first) URI * %o: no-op operator which forces a singular form of execution * %O: no-op operator which forces a plural form of execution * %p: port number of the (first) URI * %s: scheme of the (first) URI * %u: (first) URI * %U: space-separated list of selected URIs * %w: (first) basename without the extension * %W: space-separated list of basenames without their extension * %x: (first) extension * %X: space-separated list of extensions * %%: the « % » character */ #include G_BEGIN_DECLS #define NA_TYPE_TOKENS ( na_tokens_get_type()) #define NA_TOKENS( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_TOKENS, NATokens )) #define NA_TOKENS_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_TOKENS, NATokensClass )) #define NA_IS_TOKENS( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_TOKENS )) #define NA_IS_TOKENS_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_TOKENS )) #define NA_TOKENS_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_TOKENS, NATokensClass )) typedef struct _NATokensPrivate NATokensPrivate; typedef struct { /*< private >*/ GObject parent; NATokensPrivate *private; } NATokens; typedef struct _NATokensClassPrivate NATokensClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NATokensClassPrivate *private; } NATokensClass; GType na_tokens_get_type ( void ); NATokens *na_tokens_new_for_example ( void ); NATokens *na_tokens_new_from_selection ( GList *selection ); gchar *na_tokens_parse_for_display ( const NATokens *tokens, const gchar *string, gboolean utf8 ); void na_tokens_execute_action ( const NATokens *tokens, const NAObjectProfile *profile ); gchar *na_tokens_command_for_terminal( const gchar *pattern, const gchar *command ); G_END_DECLS #endif /* __CORE_NA_TOKENS_H__ */ nautilus-actions-3.2.3/src/core/na-importer.h0000644000175100017500000001237112212601376016074 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_IMPORTER_H__ #define __CORE_NA_IMPORTER_H__ /* @title: NAIImporter * @short_description: The #NAIImporter Internal Functions * @include: core/na-importer.h * * Internal Nautilus-Actions code should never directly call a * #NAIImporter interface method, but rather should call the * corresponding na_importer_xxx() functions. * * Importing items is a three-phase operation: * * - first, just try to find an i/o provider which is willing to import * the item; * at this time, only some uris have been successfully imported * * - check then for existence of each imported item; * depending of the preferred import mode, this may be an interactive * process; * at this time, the importation of some objects may have been cancelled * by the user * * - last, and depending of the exact individual import mode of each item, * insert new items or override existing ones in the referential of the * import context. */ #include #include #include #include "na-ioption.h" #include "na-pivot.h" G_BEGIN_DECLS #ifndef NA_ENABLE_DEPRECATED /* * NAImporterImportMode: * @IMPORTER_MODE_NO_IMPORT: a "do not import" mode. * @IMPORTER_MODE_RENUMBER: reallocate a new id when the imported one already exists. * @IMPORTER_MODE_OVERRIDE: override the existing id with the imported one. * @IMPORTER_MODE_ASK: ask the user for what to do with this particular item. * * Define the mode of an import operation. * * Since: 3.2 * * This same enum used to be defined as NAIImporterImportMode in api/na-iimporter.h * header. The enum has been deprecated there in N-A 3.2 when the NAIImporter v2 * interface was defined. It has so been moved here with the NAImporterImportMode * name. */ typedef enum { IMPORTER_MODE_NO_IMPORT = 1, IMPORTER_MODE_RENUMBER, IMPORTER_MODE_OVERRIDE, IMPORTER_MODE_ASK } NAImporterImportMode; #endif /* * NAImporterCheckFn: * @imported: the currently imported #NAObjectItem -derived object. * @fn_data: some data to be passed to the function. * * The library takes care of checking for duplicates inside of the imported * population. * * The caller may provide this function in order to check for duplicates * in its own import context, e.g. (and typically) by checking for a same * identifier in the main window items tree view. * * The function should return the already existing item which has the same id * than the currently being imported one, or %NULL if the imported id will be * unique. * * If the caller does not provide its own check function, then each imported * item will be systematically renumbered (allocated a new identifier). * * Returns: the already existing #NAObjectItem with same id, or %NULL. * * Since: 3.2 */ typedef NAObjectItem * ( *NAImporterCheckFn )( const NAObjectItem *, void * ); typedef struct { GSList *uris; /* the list of uris to import */ NAImporterCheckFn check_fn; /* the check_for_duplicate function */ void *check_fn_data; /* data to be passed to the check_fn function */ guint preferred_mode; /* preferred import mode, defaults to NA_IPREFS_IMPORT_PREFERRED_MODE */ GtkWindow *parent_toplevel; /* parent toplevel */ } NAImporterParms; typedef struct { /* phase 1: import into memory from i/o provider */ gchar *uri; /* the imported uri */ NAObjectItem *imported; /* the imported NAObjectItem-derived object, or %NULL */ NAIImporter *importer; /* the importer module, or %NULL */ /* phase 2: check for pre-existence */ gboolean exist; /* whether the imported Id already existed */ guint mode; /* the actual mode in effect for this import */ GSList *messages; /* a #GSList list of localized strings */ } NAImporterResult; GList *na_importer_import_from_uris( const NAPivot *pivot, NAImporterParms *parms ); void na_importer_free_result ( NAImporterResult *result ); GList *na_importer_get_modes ( void ); void na_importer_free_modes ( GList *modes ); NAIOption *na_importer_get_ask_mode ( void ); G_END_DECLS #endif /* __CORE_NA_IMPORTER_H__ */ nautilus-actions-3.2.3/src/core/na-iprefs.c0000644000175100017500000001357012212601376015520 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "na-importer.h" #include "na-iprefs.h" #include "na-settings.h" typedef struct { guint id; const gchar *str; } EnumMap; /* sort mode of the items in the file manager context menu * enum is defined in core/na-iprefs.h */ #define ORDER_ALPHA_ASC_STR "AscendingOrder" #define ORDER_ALPHA_DESC_STR "DescendingOrder" #define ORDER_MANUAL_STR "ManualOrder" static EnumMap st_order_mode[] = { { IPREFS_ORDER_ALPHA_ASCENDING, ORDER_ALPHA_ASC_STR }, { IPREFS_ORDER_ALPHA_DESCENDING, ORDER_ALPHA_DESC_STR }, { IPREFS_ORDER_MANUAL, ORDER_MANUAL_STR }, { 0 } }; static EnumMap st_tabs_pos[] = { { 1+GTK_POS_LEFT, "Left" }, { 1+GTK_POS_RIGHT, "Right" }, { 1+GTK_POS_TOP, "Top" }, { 1+GTK_POS_BOTTOM, "Bottom" }, { 0 } }; static const gchar *enum_map_string_from_id( const EnumMap *map, guint id ); static guint enum_map_id_from_string( const EnumMap *map, const gchar *str ); /* * na_iprefs_get_order_mode: * @mandatory: if not %NULL, a pointer to a boolean which will receive the * mandatory property. * * Returns: the order mode currently set. */ guint na_iprefs_get_order_mode( gboolean *mandatory ) { gchar *order_mode_str; guint order_mode; order_mode_str = na_settings_get_string( NA_IPREFS_ITEMS_LIST_ORDER_MODE, NULL, mandatory ); order_mode = enum_map_id_from_string( st_order_mode, order_mode_str ); g_free( order_mode_str ); return( order_mode ); } /* * na_iprefs_get_order_mode_by_label: * @label: the label. * * This function converts a label (e.g. 'ManualOrder') stored in user preferences * into the corresponding integer internally used. This is needed e.g. when * monitoring the preferences changes. * * Returns: the order mode currently set. */ guint na_iprefs_get_order_mode_by_label( const gchar *label ) { guint order_mode; order_mode = enum_map_id_from_string( st_order_mode, label ); return( order_mode ); } /* * na_iprefs_set_order_mode: * @mode: the new value to be written. * * Writes the current status of 'alphabetical order' to the GConf * preference system. */ void na_iprefs_set_order_mode( guint mode ) { const gchar *order_str; order_str = enum_map_string_from_id( st_order_mode, mode ); na_settings_set_string( NA_IPREFS_ITEMS_LIST_ORDER_MODE, order_str ); } /* * na_iprefs_get_tabs_pos: * @mandatory: if not %NULL, a pointer to a boolean which will receive the * mandatory property. * * Returns: the tabs position of the main window. */ guint na_iprefs_get_tabs_pos( gboolean *mandatory ) { gchar *tabs_pos_str; guint tabs_pos; tabs_pos_str = na_settings_get_string( NA_IPREFS_MAIN_TABS_POS, NULL, mandatory ); tabs_pos = enum_map_id_from_string( st_tabs_pos, tabs_pos_str ); g_free( tabs_pos_str ); return( tabs_pos-1 ); } /* * na_iprefs_set_tabs_pos: * @position: the new value to be written. * * Writes the current status of 'tabs position' to the preference system. */ void na_iprefs_set_tabs_pos( guint position ) { const gchar *tabs_pos_str; tabs_pos_str = enum_map_string_from_id( st_tabs_pos, 1+position ); na_settings_set_string( NA_IPREFS_MAIN_TABS_POS, tabs_pos_str ); } /* * na_iprefs_write_level_zero: * @items: the #GList of items whose first level is to be written. * @messages: a pointer to a #GSList in which we will add happening * error messages; * the pointer may be %NULL; * if not %NULL, the #GSList must have been initialized by the * caller. * * Rewrite the level-zero items in GConf preferences. * * Returns: %TRUE if successfully written (i.e. writable, not locked, * and so on), %FALSE else. * * @messages #GSList is only filled up in case of an error has occured. * If there is no error (na_iprefs_write_level_zero() returns %TRUE), then * the caller may safely assume that @messages is returned in the same * state that it has been provided. */ gboolean na_iprefs_write_level_zero( const GList *items, GSList **messages ) { gboolean written; const GList *it; gchar *id; GSList *content; written = FALSE; content = NULL; for( it = items ; it ; it = it->next ){ id = na_object_get_id( it->data ); content = g_slist_prepend( content, id ); } content = g_slist_reverse( content ); written = na_settings_set_string_list( NA_IPREFS_ITEMS_LEVEL_ZERO_ORDER, content ); na_core_utils_slist_free( content ); return( written ); } static const gchar * enum_map_string_from_id( const EnumMap *map, guint id ) { const EnumMap *i = map; while( i->id ){ if( i->id == id ){ return( i->str ); } i++; } return( map->str ); } static guint enum_map_id_from_string( const EnumMap *map, const gchar *str ) { const EnumMap *i = map; while( i->id ){ if( !strcmp( i->str, str )){ return( i->id ); } i++; } return( map->id ); } nautilus-actions-3.2.3/src/core/na-object-id.c0000644000175100017500000002262712212601376016073 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* private class data */ struct _NAObjectIdClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAObjectIdPrivate { gboolean dispose_has_run; }; static NAObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAObjectIdClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static gchar *v_new_id( const NAObjectId *object, const NAObjectId *new_parent ); GType na_object_id_get_type( void ) { static GType item_type = 0; if( item_type == 0 ){ item_type = register_type(); } return( item_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_object_id_register_type"; GType type; static GTypeInfo info = { sizeof( NAObjectIdClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAObjectId ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( NA_TYPE_OBJECT, "NAObjectId", &info, 0 ); return( type ); } static void class_init( NAObjectIdClass *klass ) { static const gchar *thisfn = "na_object_id_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NAObjectIdClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { NAObjectId *self; g_return_if_fail( NA_IS_OBJECT_ID( instance )); self = NA_OBJECT_ID( instance ); self->private = g_new0( NAObjectIdPrivate, 1 ); } /* * note that when the tree store is cleared, Gtk begins with the deepest * levels, so that children are disposed before their parent * as we try to dispose all children when disposing a parent, we have to * remove a disposing child from its parent */ static void instance_dispose( GObject *object ) { NAObjectId *self; NAObjectItem *parent; g_return_if_fail( NA_IS_OBJECT_ID( object )); self = NA_OBJECT_ID( object ); if( !self->private->dispose_has_run ){ self->private->dispose_has_run = TRUE; parent = na_object_get_parent( object ); if( parent ){ na_object_remove_item( parent, object ); } self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { NAObjectId *self; g_return_if_fail( NA_IS_OBJECT_ID( object )); self = NA_OBJECT_ID( object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /** * na_object_id_sort_alpha_asc: * @a: first #NAObjectId. * @b: second #NAObjectId. * * Sort the objects in alphabetical ascending order of their label. * * Returns: * * * * -1 if @a must be sorted before @b, * * * 0 if @a and @b are equal from the local point of view, * * * 1 if @a must be sorted after @b. * * * * Since: 2.30 */ gint na_object_id_sort_alpha_asc( const NAObjectId *a, const NAObjectId *b ) { gchar *label_a, *label_b; gint compare; label_a = na_object_get_label( a ); label_b = na_object_get_label( b ); compare = na_core_utils_str_collate( label_a, label_b ); g_free( label_b ); g_free( label_a ); return( compare ); } /** * na_object_id_sort_alpha_desc: * @a: first #NAObjectId. * @b: second #NAObjectId. * * Sort the objects in alphabetical descending order of their label. * * Returns: * * * * -1 if @a must be sorted before @b, * * * 0 if @a and @b are equal from the local point of view, * * * 1 if @a must be sorted after @b. * * * * Since: 2.30 */ gint na_object_id_sort_alpha_desc( const NAObjectId *a, const NAObjectId *b ) { return( -1 * na_object_id_sort_alpha_asc( a, b )); } /** * na_object_id_prepare_for_paste: * @object: the #NAObjectId object to be pasted. * @relabel: whether this object should be relabeled when pasted. * @renumber: whether this item should be renumbered ? * @parent: the parent of @object, or %NULL. * * Prepares @object to be pasted. * * If a #NAObjectProfile, then @object is attached to the specified * #NAObjectAction @action. The identifier is always renumbered to be * suitable with the already existing profiles. * * If a #NAObjectAction or a #NAObjectMenu, a new identifier is allocated * if and only if @relabel is %TRUE. * * Actual relabeling takes place if @relabel is %TRUE, depending of the * user preferences. * * Since: 2.30 */ void na_object_id_prepare_for_paste( NAObjectId *object, gboolean relabel, gboolean renumber, NAObjectId *parent ) { static const gchar *thisfn = "na_object_id_prepare_for_paste"; GList *subitems, *it; g_return_if_fail( NA_IS_OBJECT_ID( object )); g_return_if_fail( !parent || NA_IS_OBJECT_ITEM( parent )); if( !object->private->dispose_has_run ){ g_debug( "%s: object=%p, relabel=%s, renumber=%s, parent=%p", thisfn, ( void * ) object, relabel ? "True":"False", renumber ? "True":"False", ( void * ) parent ); if( NA_IS_OBJECT_PROFILE( object )){ na_object_set_parent( object, parent ); na_object_set_new_id( object, parent ); if( renumber && relabel ){ na_object_set_copy_of_label( object ); } } else { if( renumber ){ na_object_set_new_id( object, NULL ); if( relabel ){ na_object_set_copy_of_label( object ); } na_object_set_provider( object, NULL ); na_object_set_provider_data( object, NULL ); na_object_set_readonly( object, FALSE ); } if( NA_IS_OBJECT_MENU( object )){ subitems = na_object_get_items( object ); for( it = subitems ; it ; it = it->next ){ na_object_prepare_for_paste( it->data, relabel, renumber, NULL ); } } } } } /** * na_object_id_set_copy_of_label: * @object: the #NAObjectId object whose label is to be changed. * * Sets the 'Copy of' label. * * Since: 2.30 */ void na_object_id_set_copy_of_label( NAObjectId *object ) { gchar *label, *new_label; g_return_if_fail( NA_IS_OBJECT_ID( object )); if( !object->private->dispose_has_run ){ label = na_object_get_label( object ); /* i18n: copied items have a label as 'Copy of original label' */ new_label = g_strdup_printf( _( "Copy of %s" ), label ); na_object_set_label( object, new_label ); g_free( new_label ); g_free( label ); } } /** * na_object_id_set_new_id: * @object: the #NAObjectId object whose internal identifier is to be * set. * @new_parent: if @object is a #NAObjectProfile, then @new_parent * should be set to the #NAObjectAction new parent. Else, it would not * be possible to allocate a new profile id compatible with already * existing ones. * * Request a new id to the derived class, and set it. * * Since: 2.30 */ void na_object_id_set_new_id( NAObjectId *object, const NAObjectId *new_parent ) { static const gchar *thisfn = "na_object_id_set_new_id"; gchar *id; g_return_if_fail( NA_IS_OBJECT_ID( object )); g_return_if_fail( !new_parent || NA_IS_OBJECT_ITEM( new_parent )); if( !object->private->dispose_has_run ){ g_debug( "%s: object=%p (%s), new_parent=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ), ( void * ) new_parent, new_parent ? G_OBJECT_TYPE_NAME( new_parent ) : "n/a" ); id = v_new_id( object, new_parent ); if( id ){ na_object_set_id( object, id ); g_free( id ); } } } static gchar * v_new_id( const NAObjectId *object, const NAObjectId *new_parent ) { gchar *new_id = NULL; if( NA_OBJECT_ID_GET_CLASS( object )->new_id ){ new_id = NA_OBJECT_ID_GET_CLASS( object )->new_id( object, new_parent ); } return( new_id ); } nautilus-actions-3.2.3/src/core/na-icontext-factory.c0000644000175100017500000004121112212601376017523 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include /* * As of 3.2 non copyables data are: * - multiple flag */ NADataDef data_def_conditions [] = { { NAFO_DATA_BASENAMES, TRUE, TRUE, TRUE, N_( "List of patterns to be matched against the selected file(s)/folder(s)" ), /* i18n: wildcard characters '*' and '?' should be considered as literals, * and not be translated */ N_( "A list of strings with joker '*' or '?' to be matched against the name(s) " \ "of the selected file(s)/folder(s). Each selected item must match at least " \ "one of the filename patterns for the action or the menu be candidate to " \ "display.\n" \ "This obviously only applies when there is a selection.\n" \ "Defaults to '*'." ), NA_DATA_TYPE_STRING_LIST, "*", FALSE, TRUE, TRUE, FALSE, FALSE, "basenames", "Basenames", 'b', "basename", 0, G_OPTION_ARG_STRING_ARRAY, /* i18n: wildcard characters '*' and '?' should be considered as literalls, * and not be translated */ N_( "A pattern to be matched against basenames of selected file(s)/folder(s). " \ "May include wildcards (* or ?). " \ "You must set one option for each pattern you need" ), /* i18n: the "" is just an abbreviation for "an expression", * so is tranlatable */ N_( "" ) }, { NAFO_DATA_MATCHCASE, TRUE, TRUE, TRUE, N_( "Whether the specified basenames are case sensitive (default)" ), /* i18n: 'true' and 'false' values are taken literally, and should not be translated */ N_( "Must be set to 'true' if the filename patterns are case sensitive, to 'false' " \ "otherwise. E.g., if you need to match a filename in a case-sensitive manner, " \ "set this key to 'true'. If you also want, for example '*.jpg' to match 'photo.JPG', " \ "then set 'false'.\n" \ "This obviously only applies when there is a selection.\n" \ "Defaults to 'true'." ), NA_DATA_TYPE_BOOLEAN, "true", FALSE, TRUE, TRUE, FALSE, FALSE, "matchcase", "Matchcase", 'a', "match-case", 0, G_OPTION_ARG_NONE, NULL, NULL }, { NAFO_DATA_MIMETYPES, TRUE, TRUE, TRUE, N_( "List of patterns to be matched against the mimetypes of the selected file(s)/folder(s)" ), /* i18n: wildcard character '*' is taken literally, and should not be translated */ N_( "A list of strings with joker '*' to be matched against the mimetypes of the " \ "selected file(s)/folder(s). Each selected item must match at least one of " \ "the mimetype patterns for the action to appear.\n" \ "This obviously only applies when there is a selection.\n" \ "Defaults to '*/*'." ), NA_DATA_TYPE_STRING_LIST, "*", FALSE, TRUE, TRUE, FALSE, FALSE, "mimetypes", "MimeTypes", 'm', "mimetype", 0, G_OPTION_ARG_STRING_ARRAY, /* i18n: wildcard character '*' is taken literally, and should not be translated */ N_( "A pattern to be matched against mimetypes of selected file(s)/folder(s). " \ "May include the asterisk wildcard '*'. " \ "You must set one option for each pattern you need" ), /* i18n: "" is just an abbreviation for "an expression", so is tranlatable */ N_( "" ) }, /* A runtime boolean set to TRUE if we detect that the previous string list * just cover all mimetypes: this let us optimize the check for candidates * in the menu plugin. * When FALSE, than we have to check each and every mimetype :( * This value is set when loading a pre-v3 profile, and then reset each time * we update the list of mimetypes. */ { NAFO_DATA_MIMETYPES_IS_ALL, FALSE, FALSE, TRUE, "Does the mimetypes list is generic ?", "The generic wildcard may be coded as '*', or '*/*' or 'all' or 'all/*' or 'all/all'. " "In each case, we will try to spend as less time as possible to check " \ "selection mimetypes", NA_DATA_TYPE_BOOLEAN, "true", FALSE, TRUE, TRUE, FALSE, FALSE, NULL, NULL, 0, NULL, 0, 0, NULL, NULL }, /* this is obsoleted starting with 2.30-newdata (released as 2.31.x serie) * and replaced by mimetypes */ { NAFO_DATA_ISFILE, TRUE, FALSE, FALSE, N_( "Whether the profile applies to files (deprecated option, see mimetype)" ), /* i18n: 'true' and 'false' values are taken literally, and should not be translated */ N_( "Set to 'true' if the selection can have files, to 'false' otherwise.\n" \ "This setting is tied in with the 'isdir' setting. The valid combinations are: \n" \ "isfile='true' and isdir='false': the selection may hold only files\n" \ "isfile='false' and isdir='true': the selection may hold only folders\n" \ "isfile='true' and isdir='true': the selection may hold both files and folders\n" \ "isfile='false' and isdir='false': this is an invalid combination " \ "(your configuration will never appear).\n" \ "This obviously only applies when there is a selection.\n" \ "Defaults to 'true'." ), NA_DATA_TYPE_BOOLEAN, "true", FALSE, TRUE, TRUE, FALSE, FALSE, "isfile", NULL, 'f', "accept-files", 0, G_OPTION_ARG_NONE, NULL, NULL }, { NAFO_DATA_ISDIR, TRUE, FALSE, FALSE, N_( "Whether the profile applies to folders (deprecated option, see mimetype)" ), /* i18n: 'true' and 'false' values are taken literally, and should not be translated */ N_( "Set to 'true' if the selection can have folders, to 'false' otherwise.\n" \ "This setting is tied in with the 'isfile' setting. The valid combinations are: \n" \ "isfile='true' and isdir='false': the selection may hold only files\n" \ "isfile='false' and isdir='true': the selection may hold only folders\n" \ "isfile='true' and isdir='true': the selection may hold both files and folders\n" \ "isfile='false' and isdir='false': this is an invalid combination " \ "(your configuration will never appear).\n" \ "This obviously only applies when there is a selection.\n" \ "Defaults to 'false'." ), NA_DATA_TYPE_BOOLEAN, "false", FALSE, TRUE, TRUE, FALSE, FALSE, "isdir", NULL, 'd', "accept-dirs", 0, G_OPTION_ARG_NONE, NULL, NULL }, /* this is obsoleted starting with 2.30-newdata (released as 2.31.x serie) * and replaced by selection-count */ { NAFO_DATA_MULTIPLE, TRUE, FALSE, FALSE, N_( "Whether the selection may be multiple (deprecated option, see selection count)" ), /* i18n: 'true' and 'false' values are taken literally, and should not be translated */ N_( "If you need more than one files or folders to be selected, set this " \ "key to 'true'. If you want just one file or folder, set it to 'false'.\n" \ "This obviously only applies when there is a selection.\n" \ "Defaults to 'false'." ), NA_DATA_TYPE_BOOLEAN, "false", FALSE, FALSE, FALSE, FALSE, FALSE, "accept-multiple-files", NULL, 'u', "accept-multiple", 0, G_OPTION_ARG_NONE, NULL, NULL }, { NAFO_DATA_SCHEMES, TRUE, TRUE, TRUE, N_( "List of schemes to be matched against those of selected file(s)/folder(s)" ), /* too long string for iso c: 510 (max=509) */ /* i18n: schemes (sftp, ssh, ftp, file, etc.) are standard keywords which define * the access protocol to an object, they should not be translated */ N_( "Defines the list of valid schemes to be matched against the selected " \ "items. The scheme is the protocol used to access the files. The " \ "keyword to use is the one used in the URI by the file manager.\n" \ "Examples of valid URI include:\n" \ "- file:///tmp/foo.txt\n" \ "- sftp:///root@test.example.net/tmp/foo.txt\n" \ "The most common schemes are:\n" \ "'file': local files\n" \ "'sftp': files accessed via SSH\n" \ "'ftp': files accessed via FTP\n" \ "'smb': files accessed via Samba (Windows share)\n" \ "'dav': files accessed via WebDAV.\n" \ "All schemes used by your favorite file manager may be used here.\n" \ "This obviously only applies when there is a selection, " \ "or when targeting the special 'x-nautilus-desktop' scheme.\n" \ "Defaults to 'file'." ), NA_DATA_TYPE_STRING_LIST, "*", FALSE, TRUE, TRUE, FALSE, FALSE, "schemes", "Schemes", 's', "scheme", 0, G_OPTION_ARG_STRING_ARRAY, N_( "A valid GIO scheme where the selected file(s)/folder(s) should be located. " \ "You must set one option for each scheme you need" ), /* i18n: "" is just an abbreviation for "a string", so is tranlatable */ N_( "" ) }, { NAFO_DATA_FOLDERS, TRUE, TRUE, TRUE, N_( "List of folders" ), N_( "Defines the list of valid paths to be matched against the current folder.\n " \ "All folders 'under' the specified path are considered valid.\n" \ "Defaults to '/'." ), NA_DATA_TYPE_STRING_LIST, "/", FALSE, TRUE, TRUE, FALSE, FALSE, "folders", "Folders", 'r', "folder", 0, G_OPTION_ARG_STRING_ARRAY, N_( "The path of a (parent) directory for which the item will be displayed. " \ "You must set one option for each folder you need" ), /* i18n: "" is just an abbreviation for "a folder path", so is tranlatable */ N_( "" ) }, { NAFO_DATA_SELECTION_COUNT, TRUE, TRUE, TRUE, N_( "Operator of the selection count relation" ), N_( "Whether this profile may be selected depending of the count of the selection.\n" \ "This is a string of the form \"{'<'|'='|'>'} number\".\n" \ "Examples of valid strings are: \"=0\", \"> 1\", \"< 10\".\n" \ "Defaults to \">0\"." ), NA_DATA_TYPE_STRING, ">0", FALSE, TRUE, TRUE, FALSE, FALSE, "selection-count", "SelectionCount", 'c', "selection-count", 0, G_OPTION_ARG_STRING, N_( "Selection count relation [>0]" ), /* i18n: "" is just an abbreviation for "an expression", so is tranlatable */ N_( "" ) }, { NAFO_DATA_ONLY_SHOW, TRUE, TRUE, TRUE, N_( "Only show in environment" ), N_( "Defaults to all." ), NA_DATA_TYPE_STRING_LIST, "", FALSE, TRUE, TRUE, FALSE, FALSE, "only-show-in", "OnlyShowIn", 'y', "only-show-in", 0, G_OPTION_ARG_STRING_ARRAY, N_( "The name of an only desktop environment where the item must be displayed. " \ "You must set one option for each environment you want" ), /* i18n: "" is just a placeholder for "a desktop name", so is tranlatable */ N_( "" ) }, { NAFO_DATA_NOT_SHOW, TRUE, TRUE, TRUE, N_( "Not show in environment" ), N_( "Defaults to none." ), NA_DATA_TYPE_STRING_LIST, "", FALSE, TRUE, TRUE, FALSE, FALSE, "not-show-in", "NotShowIn", 'Y', "not-show-in", 0, G_OPTION_ARG_STRING_ARRAY, N_( "The name of a desktop environment where the item must not be displayed. " \ "You must set one option for each environment you want" ), /* i18n: "" is just a placeholder for "a desktop name", so is tranlatable */ N_( "" ) }, { NAFO_DATA_TRY_EXEC, TRUE, TRUE, TRUE, N_( "Try exec" ), /* i18n: TryExec is a keyword of the specification, it is not translatable */ N_( "Note that, when specified, only the presence and the executability status of " \ "the specified file are checked.\n" \ "Parameters may appear in 'TryExec' value, and will be substituted at runtime.\n" \ "Defaults to successful." ), NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, FALSE, FALSE, "try-exec", "TryExec", 'X', "try-exec", 0, G_OPTION_ARG_STRING, N_( "the path to a file whose executability is to be checked" ), /* i18n: "" is the path to a binary, so may be tranlatable */ N_( "" ) }, { NAFO_DATA_SHOW_IF_REGISTERED, TRUE, TRUE, TRUE, N_( "Show if registered" ), /* i18n: ShowIfRegistered is a keyword of the specification, it is not translatable */ N_( "The well-known name of a DBus service.\n" \ "The item will be candidate if the named service is registered on session DBus at runtime.\n" \ "Parameters may appear in 'ShowIfRegistered' value, and will be substituted at runtime.\n" \ "Defaults to successful." ), NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, FALSE, FALSE, "show-if-registered", "ShowIfRegistered", 'g', "show-if-registered", 0, G_OPTION_ARG_STRING, N_( "The name of a service which must be registered on session DBus" ), N_( "" ) }, { NAFO_DATA_SHOW_IF_TRUE, TRUE, TRUE, TRUE, N_( "Show if True" ), /* i18n: ShowIfTrue is a keyword of the specification, it is not translatable */ N_( "A command which, when executed, should output a string on stdout.\n" \ "The item will be candidate if the outputed string is equal to \"true\".\n" \ "Parameters may appear in 'ShowIfTrue' value, and will be substituted at runtime.\n" \ "Defaults to successful." ), NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, FALSE, FALSE, "show-if-true", "ShowIfTrue", 'U', "show-if-true", 0, G_OPTION_ARG_STRING, /* i18n: 'true' is to be taken as a literal, must not be translated */ N_( "The path to a command which will display the 'true' string" ), N_( "" ) }, { NAFO_DATA_SHOW_IF_RUNNING, TRUE, TRUE, TRUE, N_( "Show if running" ), /* i18n: ShowIfRunning is a keyword of the specification, it is not translatable */ N_( "The name of a process.\n" \ "The item will be candidate if the process name is found in memory at runtime.\n" \ "Parameters may appear in 'ShowIfRunning' value, and will be substituted at runtime.\n" \ "Defaults to successful." ), NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, FALSE, FALSE, "show-if-running", "ShowIfRunning", 'R', "show-if-running", 0, G_OPTION_ARG_STRING, N_( "The name of a binary which must be running" ), N_( "" ) }, { NAFO_DATA_CAPABILITITES, TRUE, TRUE, TRUE, N_( "Capabilities" ), /* i18n: 'Owner', 'Readable', 'Writable', 'Executable' and 'Local' are all keywords * of the specification; they are not translatable */ N_( "A list of capabilities each item of the selection must satisfy in order for the item to be candidate.\n" \ "Capabilities may be negated.\n" \ "Capabilities have to be chosen between following predefined ones:\n" \ "- 'Owner': current user is the owner of selected items\n" \ "- 'Readable': selected items are readable by user (probably more usefull when negated)\n" \ "- 'Writable': selected items are writable by user\n" \ "- 'Executable': selected items are executable by user\n" \ "- 'Local': selected items are local.\n" \ "Defaults to empty list." ), NA_DATA_TYPE_STRING_LIST, "", FALSE, TRUE, TRUE, FALSE, FALSE, "capabilities", "Capabilities", 'P', "capability", 0, G_OPTION_ARG_STRING_ARRAY, N_( "The name of a capability the selection must meet. " "May be 'Owner', 'Readable', 'Writable', 'Executable' or 'Local'" ), N_( "" ) }, { NULL }, }; nautilus-actions-3.2.3/src/core/na-pivot.h0000644000175100017500000001332612212601376015375 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu pivots. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_PIVOT_H__ #define __CORE_NA_PIVOT_H__ /* @title: NAPivot * @short_description: The #NAPivot Class Definition * @include: core/na-pivot.h * * A consuming program should allocate one new NAPivot object in its * startup phase. The class takes care of declaring the I/O interfaces, * while registering the known providers. * NAPivot *pivot = na_pivot_new(); * * With this newly allocated #NAPivot object, the consuming program * is then able to ask for loading the items. * na_pivot_set_loadable( pivot, PIVOT_LOADABLE_SET ); * na_pivot_load_items( pivot ); * * Notification system. * * The NAPivot object acts as a sort of "summarizing relay" for notification * messages sent by I/O storage providers: * * - When an I/O storage subsystem detects a change on an item it manages, * action or menu, it is first supposed to do its best effort in order * to summarize its notifications messages; * * - At the end of this first stage of summarization, the I/O provider * should call the na_iio_provider_item_changed() function, which * itself will emit the "io-provider-item-changed" signal. * This is done so that an external I/O provider does not have to know * anything with the signal name, but has only to take care of calling * a function of the NAIIOProvider API. * * - The emitted signal is catched by na_pivot_on_item_changed_handler(), * which was connected when the I/O provider plugin was associated with * the NAIOProvider object. * * - The NAPivot object receives these notifications originating from all * loaded I/O providers, itself summarizes them, and only then notify its * consumers with only one message for a whole set of modifications. * * It is eventually up to the consumer to connect to this signal, and * choose itself whether to reload items or not. */ #include #include #include "na-settings.h" G_BEGIN_DECLS #define NA_TYPE_PIVOT ( na_pivot_get_type()) #define NA_PIVOT( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_PIVOT, NAPivot )) #define NA_PIVOT_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_PIVOT, NAPivotClass )) #define NA_IS_PIVOT( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_PIVOT )) #define NA_IS_PIVOT_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_PIVOT )) #define NA_PIVOT_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_PIVOT, NAPivotClass )) typedef struct _NAPivotPrivate NAPivotPrivate; typedef struct { /*< private >*/ GObject parent; NAPivotPrivate *private; } NAPivot; typedef struct _NAPivotClassPrivate NAPivotClassPrivate; typedef struct { /*< private >*/ GObjectClass parent; NAPivotClassPrivate *private; } NAPivotClass; GType na_pivot_get_type( void ); /* properties */ #define PIVOT_PROP_LOADABLE "pivot-prop-loadable" #define PIVOT_PROP_TREE "pivot-prop-tree" /* signals * * NAPivot acts as a 'summarizing' proxy for signals emitted by the * NAIIOProvider providers when they detect a modification in their * underlying items storage subsystems. * * As several to many signals may be emitted when such a modification occurs, * NAPivot summarizes all these signals in an only one 'items-changed' event. */ #define PIVOT_SIGNAL_ITEMS_CHANGED "pivot-items-changed" /* Loadable population * NACT management user interface defaults to PIVOT_LOAD_ALL * N-A plugin set the loadable population to !PIVOT_LOAD_DISABLED & !PIVOT_LOAD_INVALID */ typedef enum { PIVOT_LOAD_NONE = 0, PIVOT_LOAD_DISABLED = 1 << 0, PIVOT_LOAD_INVALID = 1 << 1, PIVOT_LOAD_ALL = 0xff } NAPivotLoadableSet; NAPivot *na_pivot_new ( void ); void na_pivot_dump( const NAPivot *pivot ); /* Management of the plugins which claim to implement a Nautilus-Actions interface. * As of 2.30, these may be NAIIOProvider, NAIImporter or NAIExporter */ GList *na_pivot_get_providers ( const NAPivot *pivot, GType type ); void na_pivot_free_providers( GList *providers ); /* Items, menus and actions, management */ NAObjectItem *na_pivot_get_item ( const NAPivot *pivot, const gchar *id ); GList *na_pivot_get_items ( const NAPivot *pivot ); void na_pivot_load_items ( NAPivot *pivot ); void na_pivot_set_new_items( NAPivot *pivot, GList *tree ); void na_pivot_on_item_changed_handler( NAIIOProvider *provider, NAPivot *pivot ); /* NAPivot properties and configuration */ void na_pivot_set_loadable ( NAPivot *pivot, guint loadable ); G_END_DECLS #endif /* __CORE_NA_PIVOT_H__ */ nautilus-actions-3.2.3/src/core/na-io-provider.c0000644000175100017500000012330212214136174016463 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "na-iprefs.h" #include "na-io-provider.h" /* private class data */ struct _NAIOProviderClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAIOProviderPrivate { gboolean dispose_has_run; gchar *id; NAIIOProvider *provider; gulong item_changed_handler; gboolean writable; guint reason; }; /* NAIOProvider properties */ enum { IO_PROVIDER_PROP_ID_ID = 1, }; #define IO_PROVIDER_PROP_ID "na-io-provider-prop-id" static const gchar *st_enter_bug = N_( "Please, be kind enough to fill out a bug report on " "https://bugzilla.gnome.org/enter_bug.cgi?product=nautilus-actions." ); static GObjectClass *st_parent_class = NULL; static GList *st_io_providers = NULL; static GType register_type( void ); static void class_init( NAIOProviderClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_constructed( GObject *object ); static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ); static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); #if 0 static void dump( const NAIOProvider *provider ); static void dump_providers_list( GList *providers ); #endif static NAIOProvider *io_provider_new( const NAPivot *pivot, NAIIOProvider *module, const gchar *id ); static GList *io_providers_list_add_from_plugins( const NAPivot *pivot, GList *list ); static GList *io_providers_list_add_from_prefs( const NAPivot *pivot, GList *objects_list ); static GSList *io_providers_get_from_prefs( void ); static GList *io_providers_list_add_from_write_order( const NAPivot *pivot, GList *objects_list ); static GList *io_providers_list_append_object( const NAPivot *pivot, GList *list, NAIIOProvider *module, const gchar *id ); static void io_providers_list_set_module( const NAPivot *pivot, NAIOProvider *provider_object, NAIIOProvider *provider_module ); static gboolean is_conf_writable( const NAIOProvider *provider, const NAPivot *pivot, gboolean *mandatory ); static gboolean is_finally_writable( const NAIOProvider *provider, const NAPivot *pivot, guint *reason ); static GList *load_items_filter_unwanted_items( const NAPivot *pivot, GList *merged, guint loadable_set ); static GList *load_items_filter_unwanted_items_rec( GList *merged, guint loadable_set ); static GList *load_items_get_merged_list( const NAPivot *pivot, guint loadable_set, GSList **messages ); static GList *load_items_hierarchy_build( GList **tree, GSList *level_zero, gboolean list_if_empty, NAObjectItem *parent ); static GList *load_items_hierarchy_sort( const NAPivot *pivot, GList *tree, GCompareFunc fn ); static gint peek_item_by_id_compare( const NAObject *obj, const gchar *id ); static NAIOProvider *peek_provider_by_id( const GList *providers, const gchar *id ); GType na_io_provider_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_io_provider_register_type"; GType type; static GTypeInfo info = { sizeof( NAIOProviderClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAIOProvider ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NAIOProvider", &info, 0 ); return( type ); } static void class_init( NAIOProviderClass *klass ) { static const gchar *thisfn = "na_io_provider_class_init"; GObjectClass *object_class; GParamSpec *spec; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->constructed = instance_constructed; object_class->set_property = instance_set_property; object_class->get_property = instance_get_property; object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; spec = g_param_spec_string( IO_PROVIDER_PROP_ID, "I/O Provider Id", "Internal identifier of the I/O provider (e.g. 'na-gconf')", "", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE ); g_object_class_install_property( object_class, IO_PROVIDER_PROP_ID_ID, spec ); klass->private = g_new0( NAIOProviderClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_io_provider_instance_init"; NAIOProvider *self; g_return_if_fail( NA_IS_IO_PROVIDER( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_IO_PROVIDER( instance ); self->private = g_new0( NAIOProviderPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->id = NULL; self->private->provider = NULL; self->private->item_changed_handler = 0; self->private->writable = FALSE; self->private->reason = NA_IIO_PROVIDER_STATUS_UNAVAILABLE; } static void instance_constructed( GObject *object ) { static const gchar *thisfn = "na_io_provider_instance_constructed"; NAIOProviderPrivate *priv; g_return_if_fail( NA_IS_IO_PROVIDER( object )); priv = NA_IO_PROVIDER( object )->private; if( !priv->dispose_has_run ){ /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->constructed ){ G_OBJECT_CLASS( st_parent_class )->constructed( object ); } g_debug( "%s: object=%p (%s), id=%s", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ), priv->id ); } } static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ) { NAIOProvider *self; g_return_if_fail( NA_IS_IO_PROVIDER( object )); self = NA_IO_PROVIDER( object ); if( !self->private->dispose_has_run ){ switch( property_id ){ case IO_PROVIDER_PROP_ID_ID: g_value_set_string( value, self->private->id ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec ); break; } } } static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ) { NAIOProvider *self; g_return_if_fail( NA_IS_IO_PROVIDER( object )); self = NA_IO_PROVIDER( object ); if( !self->private->dispose_has_run ){ switch( property_id ){ case IO_PROVIDER_PROP_ID_ID: g_free( self->private->id ); self->private->id = g_value_dup_string( value ); break; } } } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_io_provider_instance_dispose"; NAIOProvider *self; g_return_if_fail( NA_IS_IO_PROVIDER( object )); self = NA_IO_PROVIDER( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; if( self->private->provider ){ if( g_signal_handler_is_connected( self->private->provider, self->private->item_changed_handler )){ g_signal_handler_disconnect( self->private->provider, self->private->item_changed_handler ); } g_object_unref( self->private->provider ); } /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_io_provider_instance_finalize"; NAIOProvider *self; g_return_if_fail( NA_IS_IO_PROVIDER( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NA_IO_PROVIDER( object ); g_free( self->private->id ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /* * na_io_provider_find_writable_io_provider: * @pivot: the #NAPivot instance. * * Returns: the first willing and able to write I/O provider, or NULL. * * The returned provider is owned by NAIOProvider class, and should not * be released by the caller. */ NAIOProvider * na_io_provider_find_writable_io_provider( const NAPivot *pivot ) { const GList *providers; const GList *ip; NAIOProvider *provider; providers = na_io_provider_get_io_providers_list( pivot ); for( ip = providers ; ip ; ip = ip->next ){ provider = ( NAIOProvider * ) ip->data; if( provider->private->writable ){ return( provider ); } } return( NULL ); } /* * na_io_provider_find_io_provider_by_id: * @pivot: the #NAPivot instance. * @id: the identifier of the searched I/O provider. * * Returns: the I/O provider, or NULL. * * The returned provider is owned by NAIOProvider class, and should not * be released by the caller. */ NAIOProvider * na_io_provider_find_io_provider_by_id( const NAPivot *pivot, const gchar *id ) { const GList *providers; const GList *ip; NAIOProvider *provider; NAIOProvider *found; providers = na_io_provider_get_io_providers_list( pivot ); found = NULL; for( ip = providers ; ip && !found ; ip = ip->next ){ provider = NA_IO_PROVIDER( ip->data ); if( !strcmp( provider->private->id, id )){ found = provider; } } return( found ); } /* * na_io_provider_get_io_providers_list: * @pivot: the current #NAPivot instance. * * Build (if not already done) the write-ordered list of currently * available NAIOProvider objects. * * A NAIOProvider object may be created: * - either because we have loaded a plugin which claims to implement the * NAIIOProvider interface; * - or because an i/o provider identifier has been found in preferences. * * The objects in this list must be in write order: * - when loading items, items are ordered depending of menus items list * and of level zero defined order; * - when writing a new item, there is a 'writable-order' preference. * * Returns: the list of I/O providers. * * The returned list is owned by #NAIOProvider class, and should not be * released by the caller. */ const GList * na_io_provider_get_io_providers_list( const NAPivot *pivot ) { g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL ); if( !st_io_providers ){ st_io_providers = io_providers_list_add_from_write_order( pivot, NULL ); st_io_providers = io_providers_list_add_from_plugins( pivot, st_io_providers ); st_io_providers = io_providers_list_add_from_prefs( pivot, st_io_providers ); } return( st_io_providers ); } /* * adding from write-order means we only create NAIOProvider objects * without having any pointer to the underlying NAIIOProvider (if it exists) */ static GList * io_providers_list_add_from_write_order( const NAPivot *pivot, GList *objects_list ) { GList *merged; GSList *io_providers, *it; const gchar *id; merged = objects_list; io_providers = na_settings_get_string_list( NA_IPREFS_IO_PROVIDERS_WRITE_ORDER, NULL, NULL ); for( it = io_providers ; it ; it = it->next ){ id = ( const gchar * ) it->data; merged = io_providers_list_append_object( pivot, merged, NULL, id ); } na_core_utils_slist_free( io_providers ); return( merged ); } /* * add to the list a NAIOProvider object for each loaded plugin which claim * to implement the NAIIOProvider interface */ static GList * io_providers_list_add_from_plugins( const NAPivot *pivot, GList *objects_list ) { static const gchar *thisfn = "na_io_provider_io_providers_list_add_from_plugins"; GList *merged; GList *modules_list, *im; gchar *id; NAIIOProvider *provider_module; merged = objects_list; modules_list = na_pivot_get_providers( pivot, NA_TYPE_IIO_PROVIDER ); for( im = modules_list ; im ; im = im->next ){ id = NULL; provider_module = NA_IIO_PROVIDER( im->data ); if( NA_IIO_PROVIDER_GET_INTERFACE( provider_module )->get_id ){ id = NA_IIO_PROVIDER_GET_INTERFACE( provider_module )->get_id( provider_module ); if( !id || !strlen( id )){ g_warning( "%s: NAIIOProvider %p get_id() interface returns null or empty id", thisfn, ( void * ) im->data ); g_free( id ); id = NULL; } } else { g_warning( "%s: NAIIOProvider %p doesn't support get_id() interface", thisfn, ( void * ) im->data ); } if( id ){ merged = io_providers_list_append_object( pivot, merged, provider_module, id ); g_free( id ); } } na_pivot_free_providers( modules_list ); return( merged ); } /* * add to the list NAIOProvider objects for the identifiers we may find * in preferences without having found the plugin itself * * preferences come from the io-providers status. */ static GList * io_providers_list_add_from_prefs( const NAPivot *pivot, GList *objects_list ) { GList *merged; const gchar *id; GSList *io_providers, *it; merged = objects_list; io_providers = io_providers_get_from_prefs(); for( it = io_providers ; it ; it = it->next ){ id = ( const gchar * ) it->data; merged = io_providers_list_append_object( pivot, merged, NULL, id ); } na_core_utils_slist_free( io_providers ); return( merged ); } /* * io_providers_get_from_prefs: * * Searches in preferences system for all mentions of an i/o provider. * This does not mean in any way that the i/o provider is active, * available or so, but just that is mentioned here. * * I/o provider identifiers returned in the list are not supposed * to be unique, nor sorted. * * Returns: a list of i/o provider identifiers found in preferences * system; this list should be na_core_utils_slist_free() by the caller. * * Since: 3.1 */ static GSList * io_providers_get_from_prefs( void ) { GSList *providers; GSList *groups; GSList *it; const gchar *name; gchar *group_prefix; guint prefix_len; providers = NULL; groups = na_settings_get_groups(); group_prefix = g_strdup_printf( "%s ", NA_IPREFS_IO_PROVIDER_GROUP ); prefix_len = strlen( group_prefix ); for( it = groups ; it ; it = it->next ){ name = ( const gchar * ) it->data; if( g_str_has_prefix( name, group_prefix )){ providers = g_slist_prepend( providers, g_strdup( name+prefix_len )); } } g_free( group_prefix ); na_core_utils_slist_free( groups ); return( providers ); } /* * add to the list a NAIOProvider object for the specified module and id * if it does not have been already registered */ static GList * io_providers_list_append_object( const NAPivot *pivot, GList *list, NAIIOProvider *module, const gchar *id ) { GList *merged; NAIOProvider *object; merged = list; object = peek_provider_by_id( list, id ); if( !object ){ object = io_provider_new( pivot, module, id ); merged = g_list_append( merged, object ); } else if( module && !object->private->provider ){ io_providers_list_set_module( pivot, object, module ); } return( merged ); } static NAIOProvider * peek_provider_by_id( const GList *providers, const gchar *id ) { NAIOProvider *provider = NULL; const GList *ip; for( ip = providers ; ip && !provider ; ip = ip->next ){ if( !strcmp( NA_IO_PROVIDER( ip->data )->private->id, id )){ provider = NA_IO_PROVIDER( ip->data ); } } return( provider ); } /* * allocate a new NAIOProvider object for the specified module and id * * id is mandatory here * module may be NULL */ static NAIOProvider * io_provider_new( const NAPivot *pivot, NAIIOProvider *module, const gchar *id ) { NAIOProvider *object; g_return_val_if_fail( id && strlen( id ), NULL ); object = g_object_new( NA_IO_PROVIDER_TYPE, IO_PROVIDER_PROP_ID, id, NULL ); if( module ){ io_providers_list_set_module( pivot, object, module ); } return( object ); } /* * when a IIOProvider plugin is associated with the NAIOProvider object, * we connect the NAPivot callback to the 'item-changed' signal */ static void io_providers_list_set_module( const NAPivot *pivot, NAIOProvider *provider_object, NAIIOProvider *provider_module ) { provider_object->private->provider = g_object_ref( provider_module ); provider_object->private->item_changed_handler = g_signal_connect( provider_module, IO_PROVIDER_SIGNAL_ITEM_CHANGED, ( GCallback ) na_pivot_on_item_changed_handler, ( gpointer ) pivot ); provider_object->private->writable = is_finally_writable( provider_object, pivot, &provider_object->private->reason ); g_debug( "na_io_provider_list_set_module: provider_module=%p (%s), writable=%s, reason=%d", ( void * ) provider_module, provider_object->private->id, provider_object->private->writable ? "True":"False", provider_object->private->reason ); } /* * na_io_provider_unref_io_providers_list: * * Called by on #NAPivot dispose(), free here resources allocated to * the I/O providers. */ void na_io_provider_unref_io_providers_list( void ) { g_list_foreach( st_io_providers, ( GFunc ) g_object_unref, NULL ); g_list_free( st_io_providers ); st_io_providers = NULL; } /* * na_io_provider_get_id: * @provider: this #NAIOProvider. * * Returns: the internal id of this #NAIIOProvider, as a newly * allocated string which should be g_free() by the caller. */ gchar * na_io_provider_get_id( const NAIOProvider *provider ) { gchar *id; g_return_val_if_fail( NA_IS_IO_PROVIDER( provider ), NULL ); id = NULL; if( !provider->private->dispose_has_run ){ id = g_strdup( provider->private->id ); } return( id ); } /* * na_io_provider_get_name: * @provider: this #NAIOProvider. * * Returns: the displayable name of this #NAIIOProvider, as a newly * allocated string which should be g_free() by the caller. * * This function makes sure to never return %NULL. An empty string * may be returned if the NAIIOProvider is not present at runtime, * or does not implement the needed interface, or returns itself %NULL * or an empty string. */ gchar * na_io_provider_get_name( const NAIOProvider *provider ) { static const gchar *thisfn = "na_io_provider_get_name"; gchar *name; name = g_strdup( "" ); g_return_val_if_fail( NA_IS_IO_PROVIDER( provider ), name ); if( !provider->private->dispose_has_run ){ if( na_io_provider_is_available( provider ) && NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->get_name ){ g_free( name ); name = NULL; name = NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->get_name( provider->private->provider ); if( !name ){ g_warning( "%s: NAIIOProvider %s get_name() interface returns NULL", thisfn, provider->private->id ); name = g_strdup( "" ); } } else { g_warning( "%s: NAIIOProvider %s doesn't support get_name() interface", thisfn, provider->private->id ); } } return( name ); } /* * na_io_provider_is_available: * @provider: the #NAIOProvider object. * * Returns: %TRUE if the corresponding #NAIIOProvider module is available * at runtime, %FALSE else. */ gboolean na_io_provider_is_available( const NAIOProvider *provider ) { gboolean is_available; g_return_val_if_fail( NA_IS_IO_PROVIDER( provider ), FALSE ); is_available = FALSE; if( !provider->private->dispose_has_run ){ is_available = ( provider->private->provider && NA_IS_IIO_PROVIDER( provider->private->provider )); } return( is_available ); } /* * na_io_provider_is_conf_readable: * @provider: this #NAIOProvider. * @pivot: the #NAPivot application object. * @mandatory: a pointer to a boolean which will be set to %TRUE if the * preference is mandatory; may be %NULL. * * Returns: %TRUE is this I/O provider should be read at startup, and so * may participate to the global list of menus and actions, %FALSE else. * * This is a configuration property, which defaults to %TRUE. * * Whether it is editable by the user or not depends on: * - whether the whole configuration has been locked down by an admin; * - whether this flag has been set as mandatory by an admin. */ gboolean na_io_provider_is_conf_readable( const NAIOProvider *provider, const NAPivot *pivot, gboolean *mandatory ) { gboolean readable; gchar *group; g_return_val_if_fail( NA_IS_IO_PROVIDER( provider ), FALSE ); g_return_val_if_fail( NA_IS_PIVOT( pivot ), FALSE ); readable = FALSE; if( !provider->private->dispose_has_run ){ group = g_strdup_printf( "%s %s", NA_IPREFS_IO_PROVIDER_GROUP, provider->private->id ); readable = na_settings_get_boolean_ex( group, NA_IPREFS_IO_PROVIDER_READABLE, NULL, mandatory ); g_free( group ); } return( readable ); } /* * na_io_provider_is_conf_writable: * @provider: this #NAIOProvider. * @pivot: the #NAPivot application object. * @mandatory: a pointer to a boolean which will be set to %TRUE if the * preference is mandatory; may be %NULL. * * Returns: %TRUE is this I/O provider is candidate to be edited. * * This is a configuration property, which defaults to %TRUE. * * Whether it is editable by the user or not depends on: * - whether the whole configuration has been locked down by an admin; * - whether this flag has been set as mandatory by an admin. * * This property does not say that an item can actually be written by this * NAIIOProvider module. See also is_willing_to() and is_able_to(). */ gboolean na_io_provider_is_conf_writable( const NAIOProvider *provider, const NAPivot *pivot, gboolean *mandatory ) { gboolean is_writable; g_return_val_if_fail( NA_IS_IO_PROVIDER( provider ), FALSE ); g_return_val_if_fail( NA_IS_PIVOT( pivot ), FALSE ); is_writable = FALSE; if( !provider->private->dispose_has_run ){ is_writable = is_conf_writable( provider, pivot, mandatory ); } return( is_writable ); } /** * na_io_provider_is_finally_writable: * @provider: this #NAIOProvider. * @reason: if not %NULL, a pointer to a guint which will hold the reason. * * Returns: the current writability status of this I/O provider. */ gboolean na_io_provider_is_finally_writable( const NAIOProvider *provider, guint *reason ) { gboolean is_writable; if( reason ){ *reason = NA_IIO_PROVIDER_STATUS_UNDETERMINED; } g_return_val_if_fail( NA_IS_IO_PROVIDER( provider ), FALSE ); is_writable = FALSE; if( !provider->private->dispose_has_run ){ is_writable = provider->private->writable; if( reason ){ *reason = provider->private->reason; } } return( is_writable ); } /* * na_io_provider_load_items: * @pivot: the #NAPivot object which owns the list of registered I/O * storage providers. * @loadable_set: the set of loadable items * (cf. NAPivotLoadableSet enumeration defined in core/na-pivot.h). * @messages: error messages. * * Loads the tree from I/O storage subsystems. * * Returns: a #GList of newly allocated objects as a hierarchical tree * in display order. This tree contains #NAObjectMenu menus, along with * #NAObjectAction actions and their #NAObjectProfile profiles. * * The returned list should be na_object_free_items(). */ GList * na_io_provider_load_items( const NAPivot *pivot, guint loadable_set, GSList **messages ) { static const gchar *thisfn = "na_io_provider_load_items"; GList *flat, *hierarchy, *filtered; GSList *level_zero; guint order_mode; g_return_val_if_fail( NA_IS_PIVOT( pivot ), NULL ); g_debug( "%s: pivot=%p, loadable_set=%d, messages=%p", thisfn, ( void * ) pivot, loadable_set, ( void * ) messages ); /* get the global flat items list, as a merge of the list provided * by each available and readable i/o provider */ flat = load_items_get_merged_list( pivot, loadable_set, messages ); /* build the items hierarchy */ level_zero = na_settings_get_string_list( NA_IPREFS_ITEMS_LEVEL_ZERO_ORDER, NULL, NULL ); hierarchy = load_items_hierarchy_build( &flat, level_zero, TRUE, NULL ); /* items that stay left in the global flat list are simply appended * to the built hierarchy, and level zero is updated accordingly */ if( flat ){ g_debug( "%s: %d items left appended to the hierarchy", thisfn, g_list_length( flat )); hierarchy = g_list_concat( hierarchy, flat ); } if( flat || !level_zero || !g_slist_length( level_zero )){ g_debug( "%s: rewriting level-zero", thisfn ); if( !na_iprefs_write_level_zero( hierarchy, messages )){ g_warning( "%s: unable to update level-zero", thisfn ); } } na_core_utils_slist_free( level_zero ); /* sort the hierarchy according to preferences */ order_mode = na_iprefs_get_order_mode( NULL ); switch( order_mode ){ case IPREFS_ORDER_ALPHA_ASCENDING: hierarchy = load_items_hierarchy_sort( pivot, hierarchy, ( GCompareFunc ) na_object_id_sort_alpha_asc ); break; case IPREFS_ORDER_ALPHA_DESCENDING: hierarchy = load_items_hierarchy_sort( pivot, hierarchy, ( GCompareFunc ) na_object_id_sort_alpha_desc ); break; case IPREFS_ORDER_MANUAL: default: break; } /* check status here... */ filtered = load_items_filter_unwanted_items( pivot, hierarchy, loadable_set ); g_list_free( hierarchy ); g_debug( "%s: tree after filtering and reordering (if any)", thisfn ); na_object_dump_tree( filtered ); g_debug( "%s: end of tree", thisfn ); return( filtered ); } #if 0 static void dump( const NAIOProvider *provider ) { static const gchar *thisfn = "na_io_provider_dump"; g_debug( "%s: id=%s", thisfn, provider->private->id ); g_debug( "%s: provider=%p", thisfn, ( void * ) provider->private->provider ); g_debug( "%s: item_changed_handler=%lu", thisfn, provider->private->item_changed_handler ); } static void dump_providers_list( GList *providers ) { static const gchar *thisfn = "na_io_provider_dump_providers_list"; GList *ip; g_debug( "%s: providers=%p (count=%d)", thisfn, ( void * ) providers, g_list_length( providers )); for( ip = providers ; ip ; ip = ip->next ){ dump( NA_IO_PROVIDER( ip->data )); } } #endif static gboolean is_conf_writable( const NAIOProvider *provider, const NAPivot *pivot, gboolean *mandatory ) { gchar *group; gboolean is_writable; group = g_strdup_printf( "%s %s", NA_IPREFS_IO_PROVIDER_GROUP, provider->private->id ); is_writable = na_settings_get_boolean_ex( group, NA_IPREFS_IO_PROVIDER_WRITABLE, NULL, mandatory ); g_free( group ); return( is_writable ); } /* * Evaluate the writability status for this I/O provider at load time * This same status may later be reevaluated on demand. */ static gboolean is_finally_writable( const NAIOProvider *provider, const NAPivot *pivot, guint *reason ) { static const gchar *thisfn = "na_io_provider_is_finally_writable"; gboolean writable; gboolean is_writable, mandatory; g_return_val_if_fail( reason, FALSE ); writable = FALSE; *reason = NA_IIO_PROVIDER_STATUS_UNAVAILABLE; if( provider->private->provider && NA_IS_IIO_PROVIDER( provider->private->provider )){ writable = TRUE; *reason = NA_IIO_PROVIDER_STATUS_WRITABLE; if( !NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->is_willing_to_write || !NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->is_able_to_write || !NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->write_item || !NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->delete_item ){ writable = FALSE; *reason = NA_IIO_PROVIDER_STATUS_INCOMPLETE_API; g_debug( "%s: provider_module=%p (%s), writable=False, reason=NA_IIO_PROVIDER_STATUS_INCOMPLETE_API", thisfn, ( void * ) provider->private->provider, provider->private->id ); } else if( !NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->is_willing_to_write( provider->private->provider )){ writable = FALSE; *reason = NA_IIO_PROVIDER_STATUS_NOT_WILLING_TO; g_debug( "%s: provider_module=%p (%s), writable=False, reason=NA_IIO_PROVIDER_STATUS_NOT_WILLING_TO", thisfn, ( void * ) provider->private->provider, provider->private->id ); } else if( !NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->is_able_to_write( provider->private->provider )){ writable = FALSE; *reason = NA_IIO_PROVIDER_STATUS_NOT_ABLE_TO; g_debug( "%s: provider_module=%p (%s), writable=False, reason=NA_IIO_PROVIDER_STATUS_NOT_ABLE_TO", thisfn, ( void * ) provider->private->provider, provider->private->id ); } else { is_writable = is_conf_writable( provider, pivot, &mandatory ); if( !is_writable ){ writable = FALSE; if( mandatory ){ *reason = NA_IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN; } else { *reason = NA_IIO_PROVIDER_STATUS_LOCKED_BY_USER; } g_debug( "%s: provider_module=%p (%s), writable=False, reason=NA_IIO_PROVIDER_STATUS_LOCKED_BY_someone, mandatory=%s", thisfn, ( void * ) provider->private->provider, provider->private->id, mandatory ? "True":"False" ); } } } return( writable ); } static GList * load_items_filter_unwanted_items( const NAPivot *pivot, GList *hierarchy, guint loadable_set ) { GList *it; GList *filtered; for( it = hierarchy ; it ; it = it->next ){ na_object_check_status( it->data ); } filtered = load_items_filter_unwanted_items_rec( hierarchy, loadable_set ); return( filtered ); } /* * build a dest tree from a source tree, removing filtered items * an item is filtered if it is invalid (and not loading invalid ones) * or disabled (and not loading disabled ones) */ static GList * load_items_filter_unwanted_items_rec( GList *hierarchy, guint loadable_set ) { static const gchar *thisfn = "na_io_provider_load_items_filter_unwanted_items_rec"; GList *subitems, *subitems_f; GList *it, *itnext; GList *filtered; gboolean selected; gchar *label; gboolean load_invalid, load_disabled; filtered = NULL; load_invalid = loadable_set & PIVOT_LOAD_INVALID; load_disabled = loadable_set & PIVOT_LOAD_DISABLED; for( it = hierarchy ; it ; it = itnext ){ itnext = it->next; selected = FALSE; if( NA_IS_OBJECT_PROFILE( it->data )){ if( na_object_is_valid( it->data ) || load_invalid ){ filtered = g_list_append( filtered, it->data ); selected = TRUE; } } if( NA_IS_OBJECT_ITEM( it->data )){ if(( na_object_is_enabled( it->data ) || load_disabled ) && ( na_object_is_valid( it->data ) || load_invalid )){ subitems = na_object_get_items( it->data ); subitems_f = load_items_filter_unwanted_items_rec( subitems, loadable_set ); na_object_set_items( it->data, subitems_f ); filtered = g_list_append( filtered, it->data ); selected = TRUE; } } if( !selected ){ label = na_object_get_label( it->data ); g_debug( "%s: filtering %p (%s) '%s'", thisfn, ( void * ) it->data, G_OBJECT_TYPE_NAME( it->data ), label ); g_free( label ); na_object_unref( it->data ); } } return( filtered ); } /* * returns a concatened flat list of read actions / menus * we take care here of: * - i/o providers which appear unavailable at runtime * - i/o providers marked as unreadable * - items (actions or menus) which do not satisfy the defined loadable set */ static GList * load_items_get_merged_list( const NAPivot *pivot, guint loadable_set, GSList **messages ) { const GList *providers; const GList *ip; GList *merged, *items, *it; const NAIOProvider *provider_object; const NAIIOProvider *provider_module; merged = NULL; providers = na_io_provider_get_io_providers_list( pivot ); for( ip = providers ; ip ; ip = ip->next ){ provider_object = NA_IO_PROVIDER( ip->data ); provider_module = provider_object->private->provider; if( provider_module && NA_IIO_PROVIDER_GET_INTERFACE( provider_module )->read_items && na_io_provider_is_conf_readable( provider_object, pivot, NULL )){ items = NA_IIO_PROVIDER_GET_INTERFACE( provider_module )->read_items( provider_module, messages ); for( it = items ; it ; it = it->next ){ na_object_set_provider( it->data, provider_object ); na_object_dump( it->data ); } merged = g_list_concat( merged, items ); } } return( merged ); } /* * builds the hierarchy * * this is a recursive function which _moves_ items from input 'tree' to * output list. */ static GList * load_items_hierarchy_build( GList **tree, GSList *level_zero, gboolean list_if_empty, NAObjectItem *parent ) { static const gchar *thisfn = "na_io_provider_load_items_hierarchy_build"; GList *hierarchy, *it; GSList *ilevel; GSList *subitems_ids; GList *subitems; hierarchy = NULL; if( g_slist_length( level_zero )){ for( ilevel = level_zero ; ilevel ; ilevel = ilevel->next ){ /*g_debug( "%s: id=%s", thisfn, ( gchar * ) ilevel->data );*/ it = g_list_find_custom( *tree, ilevel->data, ( GCompareFunc ) peek_item_by_id_compare ); if( it ){ hierarchy = g_list_append( hierarchy, it->data ); na_object_set_parent( it->data, parent ); g_debug( "%s: id=%s: %s (%p) appended to hierarchy %p", thisfn, ( gchar * ) ilevel->data, G_OBJECT_TYPE_NAME( it->data ), ( void * ) it->data, ( void * ) hierarchy ); *tree = g_list_remove_link( *tree, it ); if( NA_IS_OBJECT_MENU( it->data )){ subitems_ids = na_object_get_items_slist( it->data ); subitems = load_items_hierarchy_build( tree, subitems_ids, FALSE, NA_OBJECT_ITEM( it->data )); na_object_set_items( it->data, subitems ); na_core_utils_slist_free( subitems_ids ); } } } } /* if level-zero list is empty, * we consider that all items are at the same level */ else if( list_if_empty ){ for( it = *tree ; it ; it = it->next ){ hierarchy = g_list_append( hierarchy, it->data ); na_object_set_parent( it->data, parent ); } g_list_free( *tree ); *tree = NULL; } return( hierarchy ); } static GList * load_items_hierarchy_sort( const NAPivot *pivot, GList *tree, GCompareFunc fn ) { GList *sorted; GList *items, *it; sorted = g_list_sort( tree, fn ); /* recursively sort each level of the tree */ for( it = sorted ; it ; it = it->next ){ if( NA_IS_OBJECT_MENU( it->data )){ items = na_object_get_items( it->data ); items = load_items_hierarchy_sort( pivot, items, fn ); na_object_set_items( it->data, items ); } } return( sorted ); } /* * returns zero when @obj has the required @id */ static gint peek_item_by_id_compare( const NAObject *obj, const gchar *id ) { gchar *obj_id; gint ret = 1; if( NA_IS_OBJECT_ITEM( obj )){ obj_id = na_object_get_id( obj ); ret = strcmp( obj_id, id ); g_free( obj_id ); } return( ret ); } /* * na_io_provider_write_item: * @provider: this #NAIOProvider object. * @item: a #NAObjectItem to be written to the storage subsystem. * @messages: error messages. * * Writes an @item to the storage subsystem. * * Returns: the NAIIOProvider return code. * * #NAPivot class, which should be the only caller of this function, * has already check that this item is writable, i.e. that all conditions * are met to be able to successfully write the item down to the * storage subsystem. */ guint na_io_provider_write_item( const NAIOProvider *provider, const NAObjectItem *item, GSList **messages ) { static const gchar *thisfn = "na_io_provider_write_item"; guint ret; g_debug( "%s: provider=%p (%s), item=%p (%s), messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) item, G_OBJECT_TYPE_NAME( item ), ( void * ) messages ); ret = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; g_return_val_if_fail( NA_IS_IO_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), ret ); g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider->private->provider ), ret ); g_return_val_if_fail( NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->write_item, ret ); ret = NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->write_item( provider->private->provider, item, messages ); if( ret == NA_IIO_PROVIDER_CODE_OK ){ na_object_set_provider( item, provider ); } return( ret ); } /* * na_io_provider_delete_item: * @provider: this #NAIOProvider object. * @item: the #NAObjectItem item to be deleted. * @messages: error messages. * * Deletes an item (action or menu) from the storage subsystem. * * Returns: the NAIIOProvider return code. */ guint na_io_provider_delete_item( const NAIOProvider *provider, const NAObjectItem *item, GSList **messages ) { static const gchar *thisfn = "na_io_provider_delete_item"; guint ret; g_debug( "%s: provider=%p (%s), item=%p (%s), messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) item, G_OBJECT_TYPE_NAME( item ), ( void * ) messages ); ret = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; g_return_val_if_fail( NA_IS_IO_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), ret ); g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider->private->provider ), ret ); g_return_val_if_fail( NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->delete_item, ret ); ret = NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->delete_item( provider->private->provider, item, messages ); return( ret ); } /* * na_io_provider_duplicate_data: * @provider: this #NAIOProvider object. * @dest: the target #NAObjectItem item. * @source: the source #NAObjectItem item. * @messages: error messages. * * Duplicates provider data (if any) from @source to @dest. * * Returns: the NAIIOProvider return code. */ guint na_io_provider_duplicate_data( const NAIOProvider *provider, NAObjectItem *dest, const NAObjectItem *source, GSList **messages ) { static const gchar *thisfn = "na_io_provider_duplicate_data"; guint ret; void *provider_data; g_debug( "%s: provider=%p (%s), dest=%p (%s), source=%p (%s), messages=%p", thisfn, ( void * ) provider, G_OBJECT_TYPE_NAME( provider ), ( void * ) dest, G_OBJECT_TYPE_NAME( dest ), ( void * ) source, G_OBJECT_TYPE_NAME( source ), ( void * ) messages ); ret = NA_IIO_PROVIDER_CODE_PROGRAM_ERROR; g_return_val_if_fail( NA_IS_IO_PROVIDER( provider ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( dest ), ret ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( source ), ret ); g_return_val_if_fail( NA_IS_IIO_PROVIDER( provider->private->provider ), ret ); na_object_set_provider_data( dest, NULL ); provider_data = na_object_get_provider_data( source ); if( provider_data && NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->duplicate_data ){ ret = NA_IIO_PROVIDER_GET_INTERFACE( provider->private->provider )->duplicate_data( provider->private->provider, dest, source, messages ); } return( ret ); } /* * na_io_provider_get_readonly_tooltip: * @reason: the reason for why an item is not writable. * * Returns: the associated tooltip, as a newly allocated string which * should be g_free() by the caller. */ gchar * na_io_provider_get_readonly_tooltip( guint reason ) { gchar *tooltip; tooltip = NULL; switch( reason ){ /* item is writable, so tooltip is empty */ case NA_IIO_PROVIDER_STATUS_WRITABLE: tooltip = g_strdup( "" ); break; case NA_IIO_PROVIDER_STATUS_UNAVAILABLE: tooltip = g_strdup( _( "Unavailable I/O provider." )); break; case NA_IIO_PROVIDER_STATUS_INCOMPLETE_API: tooltip = g_strdup( _( "I/O provider implementation lacks of required API." )); break; case NA_IIO_PROVIDER_STATUS_NOT_WILLING_TO: tooltip = g_strdup( _( "I/O provider is not willing to write." )); break; case NA_IIO_PROVIDER_STATUS_NOT_ABLE_TO: tooltip = g_strdup( _( "I/O provider announces itself as unable to write." )); break; case NA_IIO_PROVIDER_STATUS_LOCKED_BY_ADMIN: tooltip = g_strdup( _( "I/O provider has been locked down by an administrator." )); break; case NA_IIO_PROVIDER_STATUS_LOCKED_BY_USER: tooltip = g_strdup( _( "I/O provider has been locked down by the user." )); break; case NA_IIO_PROVIDER_STATUS_ITEM_READONLY: tooltip = g_strdup( _( "Item is read-only." )); break; case NA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND: tooltip = g_strdup( _( "No writable I/O provider found." )); break; default: tooltip = g_strdup_printf( _( "Item is not writable for an unknown reason (%d).\n%s" ), reason, st_enter_bug ); break; } return( tooltip ); } /* * na_io_provider_get_return_code_label: * @code: the return code of an operation. * * Returns: the associated label, as a newly allocated string which * should be g_free() by the caller. */ gchar * na_io_provider_get_return_code_label( guint code ) { gchar *label; label = NULL; switch( code ){ case NA_IIO_PROVIDER_CODE_OK: label = g_strdup( _( "OK." )); break; case NA_IIO_PROVIDER_CODE_PROGRAM_ERROR: label = g_strdup_printf( _( "Program flow error.\n%s" ), st_enter_bug ); break; case NA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN: label = g_strdup( _( "The I/O provider is not willing to do that." )); break; case NA_IIO_PROVIDER_CODE_WRITE_ERROR: label = g_strdup( _( "Write error in I/O provider." )); break; case NA_IIO_PROVIDER_CODE_DELETE_SCHEMAS_ERROR: label = g_strdup( _( "Unable to delete GConf schemas." )); break; case NA_IIO_PROVIDER_CODE_DELETE_CONFIG_ERROR: label = g_strdup( _( "Unable to delete configuration." )); break; default: label = g_strdup_printf( _( "Unknown return code (%d).\n%s" ), code, st_enter_bug ); break; } return( label ); } nautilus-actions-3.2.3/src/core/na-object-item-factory.c0000644000175100017500000002351612212601376020100 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include /* * As of 3.2 non copyables data are: * - the type * - non localized icon name * - subitems pointers list and string list * - read-only status */ NADataDef data_def_item [] = { /* this data is marked as non readable as it has to be read specifically * in order to be able to create the corresponding NAObjectItem-derived * object * it is not writable as different I/O providers may have different values * for it, and thus it must be written specifically * (cf. nagp_writer_write_start(), nadp_writer_write_start()) * it is not instantiated because we never need to have an actual value * (actually being determined at runtime by object class) * it is just left here to be able to define the corresponding GConf schema * and to export it as XML */ { NAFO_DATA_TYPE, FALSE, FALSE, FALSE, N_( "Type of the item" ), N_( "Defines if the item is an action or a menu. Possible values are :\n" \ "- 'Action',\n" \ "- 'Menu'.\n" \ "The value is case sensitive and must not be localized." ), NA_DATA_TYPE_STRING, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "type", NULL, 0, NULL, 0, 0, NULL, NULL }, /* this data is common between actions and menus * so default value is directly set in na_object_action_new_with_defaults() * and na_object_menu_new_with_defaults() */ { NAFO_DATA_LABEL, TRUE, TRUE, TRUE, N_( "Label of the context menu item (mandatory)" ), N_( "The label of the menu item that will appear in the file manager context " \ "menu when the selection matches the appearance condition settings.\n" \ "It is also used as a default for the toolbar label of an action." ), NA_DATA_TYPE_LOCALE_STRING, N_( "Empty label" ), FALSE, TRUE, TRUE, FALSE, TRUE, "label", "Name", 'l', "label", 0, G_OPTION_ARG_STRING, NULL, N_( "" ) }, { NAFO_DATA_TOOLTIP, TRUE, TRUE, TRUE, N_( "Tooltip of the context menu item" ), N_( "The tooltip of the menu item that will appear in the file manager " \ "statusbar when the user points to the file manager context menu item " \ "with his/her mouse." ), NA_DATA_TYPE_LOCALE_STRING, "", FALSE, TRUE, TRUE, FALSE, TRUE, "tooltip", "Tooltip", 't', "tooltip", 0, G_OPTION_ARG_STRING, NULL, N_( "" ) }, { NAFO_DATA_ICON, TRUE, TRUE, TRUE, N_( "Icon of the context menu item" ), N_( "The icon of the menu item that will appear next to the label " \ "in the file manager context menu when the selection matches the appearance " \ "conditions settings.\n" \ "May be the localized name of a themed icon, or a full path to any appropriate image." ), NA_DATA_TYPE_LOCALE_STRING, "", FALSE, TRUE, TRUE, FALSE, TRUE, "icon", "Icon", 'i', "icon", 0, G_OPTION_ARG_STRING, NULL, N_( "" ) }, /* icon used to be not localized up to and included 2.29.4 */ { NAFO_DATA_ICON_NOLOC, TRUE, FALSE, FALSE, "Unlocalized icon name or path", NULL, NA_DATA_TYPE_STRING, "", FALSE, FALSE, FALSE, FALSE, FALSE, "icon", NULL, 0, "icon", 0, 0, NULL, NULL }, { NAFO_DATA_DESCRIPTION, TRUE, TRUE, TRUE, N_( "Description relative to the item" ), N_( "Some text which explains the goal of the menu or the action.\n" \ "May be used, e.g. when displaying available items on a web site." ), NA_DATA_TYPE_LOCALE_STRING, "", FALSE, TRUE, TRUE, FALSE, TRUE, "description", "Description", 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_SHORTCUT, TRUE, TRUE, TRUE, N_( "Suggested shortcut" ), N_( "A shortcut suggested for the action or the menu.\n" \ "Please note that this might be only a suggestion as the shortcut may " \ "be already reserved for another use. Implementation should not override " \ "an already existing shortcut to define this one.\n" \ "The format may look like \"a\" or \"F1\".\n" \ "Defaults to empty." ), NA_DATA_TYPE_STRING, "", FALSE, TRUE, TRUE, FALSE, FALSE, "shortcut", "SuggestedShortcut", 0, NULL, 0, 0, NULL, NULL }, /* dynamic data, so not readable / not writable */ { NAFO_DATA_SUBITEMS, FALSE, /* not serializable */ FALSE, TRUE, "Subitems", "List of subitems objects", NA_DATA_TYPE_POINTER, NULL, FALSE, FALSE, /* not copyable */ FALSE, /* not comparable */ FALSE, /* not mandatory */ FALSE, /* not localized */ NULL, NULL, 0, NULL, 0, 0, NULL, NULL }, /* list of subitems as a string list * dynamically rebuilt on write_start() */ { NAFO_DATA_SUBITEMS_SLIST, TRUE, TRUE, TRUE, N_( "List of subitem ids" ), N_( "Ordered list of the IDs of the subitems. This may be actions or menus " \ "if the item is a menu, or profiles if the item is an action.\n" \ "If this list doesn't exist or is empty for an action or a menu, " \ "subitems are attached in the order of the read operations." ), NA_DATA_TYPE_STRING_LIST, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, "items", NULL, /* Profiles or ItemsList */ 0, NULL, 0, 0, NULL, NULL }, { NAFO_DATA_ENABLED, TRUE, TRUE, TRUE, N_( "Whether the action or the menu is enabled" ), N_( "If the or the menu action is disabled, it will never appear in the " \ "file manager context menu.\n" \ "Defaults to TRUE." ), NA_DATA_TYPE_BOOLEAN, "true", FALSE, TRUE, TRUE, FALSE, FALSE, "enabled", "Enabled", 'e', "enabled", 0, G_OPTION_ARG_NONE, N_( "Whether the action or the menu is enabled [enabled]" ), NULL }, /* dynamic data, so non readable / non writable * must be set by the NAIIOProvider when reading the item */ { NAFO_DATA_READONLY, FALSE, FALSE, TRUE, "Read-only", "Is the item only readable ? " \ "This is an intrinsic property, dynamically set when the item is unserialized. " \ "This property being FALSE doesn't mean that the item will actually be updatable, " \ "as this also depend of parameters set by user and administrator. " \ "Also, a property initially set to FALSE when first unserializing may be set to" \ "TRUE if an eccor occurs on a later write operation.", NA_DATA_TYPE_BOOLEAN, "false", FALSE, FALSE, FALSE, FALSE, FALSE, NULL, NULL, 0, NULL, 0, 0, NULL, NULL }, /* dynamic data, so non readable / non writable */ { NAFO_DATA_PROVIDER, FALSE, FALSE, TRUE, "I/O provider", "A pointer to the NAIOProvider object.", NA_DATA_TYPE_POINTER, NULL, FALSE, TRUE, FALSE, FALSE, FALSE, NULL, NULL, 0, NULL, 0, 0, NULL, NULL }, /* dynamic data, so non readable / non writable (but has property) * is left at the NAIIOProvider disposition * not copyable as directly duplicated by NAIIOProvider interface * (see NAObjectItem::object_copy) */ { NAFO_DATA_PROVIDER_DATA, FALSE, FALSE, TRUE, "I/O provider data", "A pointer to some NAIOProvider specific data.", NA_DATA_TYPE_POINTER, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, NULL, NULL, 0, NULL, 0, 0, NULL, NULL }, /* this integer version number is introduced with .desktop files and obsoletes * the previous string version number which was only set on actions * we so have: "1.0" < "1.1" < "2.0" < 3 * Also note that iversion=3 is only written in GConf, while .desktop files * do not have this key. * Only when version will need to be incremented again, we will write a version * key in .desktop files (probably 1 or 2), and increment this iversion to 4. * As this version number will not be the same in .desktop and in GConf, it * is marked as not automatically writable: it has to be written specifically * by each i/o provider. */ { NAFO_DATA_IVERSION, TRUE, FALSE, TRUE, N_( "Version of the format" ), N_( "The version of the configuration format that will be used to manage backward compatibility." ), NA_DATA_TYPE_UINT, "3", FALSE, TRUE, TRUE, FALSE, FALSE, "iversion", NULL, 0, NULL, 0, 0, NULL, NULL }, { NULL }, }; nautilus-actions-3.2.3/src/core/na-gconf-migration.h0000644000175100017500000000256712212601376017324 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NAUTILUS_ACTIONS_CORE_NA_GCONF_MIGRATION_H__ #define __NAUTILUS_ACTIONS_CORE_NA_GCONF_MIGRATION_H__ #include G_BEGIN_DECLS void na_gconf_migration_run( void ); G_END_DECLS #endif /* __NAUTILUS_ACTIONS_CORE_NA_GCONF_MIGRATION_H__ */ nautilus-actions-3.2.3/src/core/na-data-boxed.c0000644000175100017500000005114612212601376016241 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include /* private class data */ struct _NADataBoxedClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* additional features of our data types * (see NABoxed class for primary features) */ typedef struct { guint type; GParamSpec * ( *spec ) ( const NADataDef * ); gboolean ( *is_default )( const NADataBoxed * ); gboolean ( *is_valid ) ( const NADataBoxed * ); } DataBoxedDef; /* private instance data */ struct _NADataBoxedPrivate { gboolean dispose_has_run; const NADataDef *data_def ; const DataBoxedDef *boxed_def; }; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NADataBoxedClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static const DataBoxedDef *get_data_boxed_def( guint type ); static GParamSpec *bool_spec( const NADataDef *idtype ); static gboolean bool_is_default( const NADataBoxed *boxed ); static gboolean bool_is_valid( const NADataBoxed *boxed ); static GParamSpec *pointer_spec( const NADataDef *idtype ); static gboolean pointer_is_default( const NADataBoxed *boxed ); static gboolean pointer_is_valid( const NADataBoxed *boxed ); static GParamSpec *string_spec( const NADataDef *idtype ); static gboolean string_is_default( const NADataBoxed *boxed ); static gboolean string_is_valid( const NADataBoxed *boxed ); static GParamSpec *string_list_spec( const NADataDef *idtype ); static gboolean string_list_is_default( const NADataBoxed *boxed ); static gboolean string_list_is_valid( const NADataBoxed *boxed ); static gboolean locale_is_default( const NADataBoxed *boxed ); static gboolean locale_is_valid( const NADataBoxed *boxed ); static GParamSpec *uint_spec( const NADataDef *idtype ); static gboolean uint_is_default( const NADataBoxed *boxed ); static gboolean uint_is_valid( const NADataBoxed *boxed ); static GParamSpec *uint_list_spec( const NADataDef *idtype ); static gboolean uint_list_is_default( const NADataBoxed *boxed ); static gboolean uint_list_is_valid( const NADataBoxed *boxed ); static DataBoxedDef st_data_boxed_def[] = { { NA_DATA_TYPE_BOOLEAN, bool_spec, bool_is_default, bool_is_valid }, { NA_DATA_TYPE_POINTER, pointer_spec, pointer_is_default, pointer_is_valid }, { NA_DATA_TYPE_STRING, string_spec, string_is_default, string_is_valid }, { NA_DATA_TYPE_STRING_LIST, string_list_spec, string_list_is_default, string_list_is_valid }, { NA_DATA_TYPE_LOCALE_STRING, string_spec, locale_is_default, locale_is_valid }, { NA_DATA_TYPE_UINT, uint_spec, uint_is_default, uint_is_valid }, { NA_DATA_TYPE_UINT_LIST, uint_list_spec, uint_list_is_default, uint_list_is_valid }, { 0 } }; GType na_data_boxed_get_type( void ) { static GType item_type = 0; if( item_type == 0 ){ item_type = register_type(); } return( item_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_data_boxed_register_type"; GType type; static GTypeInfo info = { sizeof( NADataBoxedClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NADataBoxed ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( NA_TYPE_BOXED, "NADataBoxed", &info, 0 ); return( type ); } static void class_init( NADataBoxedClass *klass ) { static const gchar *thisfn = "na_data_boxed_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NADataBoxedClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { NADataBoxed *self; g_return_if_fail( NA_IS_DATA_BOXED( instance )); self = NA_DATA_BOXED( instance ); self->private = g_new0( NADataBoxedPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->data_def = NULL; self->private->boxed_def = NULL; } static void instance_dispose( GObject *object ) { NADataBoxed *self; g_return_if_fail( NA_IS_DATA_BOXED( object )); self = NA_DATA_BOXED( object ); if( !self->private->dispose_has_run ){ self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { NADataBoxed *self; g_return_if_fail( NA_IS_DATA_BOXED( object )); self = NA_DATA_BOXED( object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static const DataBoxedDef * get_data_boxed_def( guint type ) { static const gchar *thisfn = "na_data_boxed_get_data_boxed_def"; int i; for( i = 0 ; st_data_boxed_def[i].type ; ++i ){ if( st_data_boxed_def[i].type == type ){ return(( const DataBoxedDef * ) st_data_boxed_def+i ); } } g_warning( "%s: unmanaged data type=%d", thisfn, type ); return( NULL ); } /** * na_data_boxed_new: * @def: the #NADataDef definition structure for this boxed. * * Returns: a newly allocated #NADataBoxed. * * Since: 2.30 */ NADataBoxed * na_data_boxed_new( const NADataDef *def ) { NADataBoxed *boxed; g_return_val_if_fail( def != NULL, NULL ); boxed = g_object_new( NA_TYPE_DATA_BOXED, NULL ); na_boxed_set_type( NA_BOXED( boxed ), def->type ); boxed->private->data_def = def; boxed->private->boxed_def = get_data_boxed_def( def->type ); return( boxed ); } /** * na_data_boxed_get_data_def: * @boxed: this #NADataBoxed object. * * Returns: a pointer to the #NADataDef structure attached to the object. * Should never be %NULL. * * Since: 2.30 */ const NADataDef * na_data_boxed_get_data_def( const NADataBoxed *boxed ) { const NADataDef *def; g_return_val_if_fail( NA_IS_DATA_BOXED( boxed ), NULL ); def = NULL; if( !boxed->private->dispose_has_run ){ def = boxed->private->data_def; } return( def ); } /** * na_data_boxed_set_data_def: * @boxed: this #NADataBoxed object. * @def: the new #NADataDef to be set. * * Changes the #NADataDef a @boxed points to: * -> the new type must be the same that the previous one. * -> value is unchanged. * * Since: 2.30 */ void na_data_boxed_set_data_def( NADataBoxed *boxed, const NADataDef *new_def ) { g_return_if_fail( NA_IS_DATA_BOXED( boxed )); g_return_if_fail( boxed->private->data_def ); g_return_if_fail( new_def ); g_return_if_fail( new_def->type == boxed->private->data_def->type ); if( !boxed->private->dispose_has_run ){ boxed->private->data_def = ( NADataDef * ) new_def; } } /** * na_data_boxed_get_param_spec: * @def: a #NADataDef definition structure. * * Returns: a #GParamSpec structure. * * Since: 2.30 */ GParamSpec * na_data_boxed_get_param_spec( const NADataDef *def ) { GParamSpec *spec; const DataBoxedDef *fn; g_return_val_if_fail( def != NULL, NULL ); spec = NULL; fn = get_data_boxed_def( def->type ); if( fn ){ if( fn->spec ){ spec = ( *fn->spec )( def ); } } return( spec ); } #ifdef NA_ENABLE_DEPRECATED /** * na_data_boxed_are_equal: * @a: the first #NADataBoxed object. * @b: the second #NADataBoxed object. * * Returns: %TRUE if the two boxeds are equal, %FALSE else. * * Since: 2.30 * Deprecated: 3.1: Use na_boxed_are_equal() instead. */ gboolean na_data_boxed_are_equal( const NADataBoxed *a, const NADataBoxed *b ) { g_return_val_if_fail( NA_IS_DATA_BOXED( a ), FALSE ); g_return_val_if_fail( NA_IS_DATA_BOXED( b ), FALSE ); return( na_boxed_are_equal( NA_BOXED( a ), NA_BOXED( b ))); } #endif /* NA_ENABLE_DEPRECATED */ /** * na_data_boxed_is_default: * @boxed: this #NADataBoxed object. * * Returns: %TRUE if the #NADataBoxed holds its default value, * %FALSE else. * * Since: 2.30 */ gboolean na_data_boxed_is_default( const NADataBoxed *boxed ) { gboolean is_default; g_return_val_if_fail( NA_IS_DATA_BOXED( boxed ), FALSE ); g_return_val_if_fail( boxed->private->boxed_def, FALSE ); g_return_val_if_fail( boxed->private->boxed_def->is_default, FALSE ); is_default = FALSE; if( !boxed->private->dispose_has_run ){ is_default = ( *boxed->private->boxed_def->is_default )( boxed ); } return( is_default ); } /** * na_data_boxed_is_valid: * @boxed: the #NADataBoxed object whose validity is to be checked. * * Returns: %TRUE if the boxed is valid, %FALSE else. * * Since: 2.30 */ gboolean na_data_boxed_is_valid( const NADataBoxed *boxed ) { gboolean is_valid; g_return_val_if_fail( NA_IS_DATA_BOXED( boxed ), FALSE ); g_return_val_if_fail( boxed->private->boxed_def, FALSE ); g_return_val_if_fail( boxed->private->boxed_def->is_valid, FALSE ); is_valid = FALSE; if( !boxed->private->dispose_has_run ){ is_valid = ( *boxed->private->boxed_def->is_valid )( boxed ); } return( is_valid ); } #ifdef NA_ENABLE_DEPRECATED /** * na_data_boxed_dump: * @boxed: this #NADataBoxed object. * * Dump the content of @boxed. * * Since: 2.30 * Deprecated: 3.1: Use na_boxed_dump() instead. */ void na_data_boxed_dump( const NADataBoxed *boxed ) { na_boxed_dump( NA_BOXED( boxed )); } /** * na_data_boxed_get_as_string: * @boxed: the #NADataBoxed whose value is to be set. * * Returns: the value of the @boxed, as a newly allocated string which * should be g_free() by the caller. * * Since: 2.30 * Deprecated: 3.1: Use na_boxed_get_string() instead. */ gchar * na_data_boxed_get_as_string( const NADataBoxed *boxed ) { return( na_boxed_get_string( NA_BOXED( boxed ))); } /** * na_data_boxed_get_as_value: * @boxed: the #NADataBoxed whose value is to be set. * @value: the string to be set. * * Setup @value with the content of the @boxed. * * Since: 2.30 * Deprecated: 3.1: Use na_boxed_get_as_value() instead. */ void na_data_boxed_get_as_value( const NADataBoxed *boxed, GValue *value ) { na_boxed_get_as_value( NA_BOXED( boxed ), value ); } /** * na_data_boxed_get_as_void: * @boxed: the #NADataBoxed whose value is to be set. * * Returns: the content of the @boxed. * * If of type NAFD_TYPE_STRING, NAFD_TYPE_LOCALE_STRING OR * NAFD_TYPE_STRING_LIST, then the content is returned in a newly * allocated value, which should be released by the caller. * * Since: 2.30 * Deprecated: 3.1: Use na_boxed_get_as_void() instead. */ void * na_data_boxed_get_as_void( const NADataBoxed *boxed ) { return( na_boxed_get_as_void( NA_BOXED( boxed ))); } /** * na_data_boxed_set_from_boxed: * @boxed: the #NADataBoxed whose value is to be set. * @value: the source #NADataBoxed. * * Copy value from @value to @boxed. * * Since: 2.30 * Deprecated: 3.1: Use na_boxed_set_from_boxed() instead. */ void na_data_boxed_set_from_boxed( NADataBoxed *boxed, const NADataBoxed *value ) { na_boxed_set_from_boxed( NA_BOXED( boxed ), NA_BOXED( value )); } /** * na_data_boxed_set_from_string: * @boxed: the #NADataBoxed whose value is to be set. * @value: the string to be set. * * Evaluates the @value and set it to the @boxed. * * Since: 2.30 * Deprecated: 3.1: Use na_boxed_set_from_string() instead. */ void na_data_boxed_set_from_string( NADataBoxed *boxed, const gchar *value ) { na_boxed_set_from_string( NA_BOXED( boxed ), value ); } /** * na_data_boxed_set_from_value: * @boxed: the #NADataBoxed whose value is to be set. * @value: the value whose content is to be got. * * Evaluates the @value and set it to the @boxed. * * Since: 2.30 * Deprecated: 3.1: Use na_boxed_set_from_value() instead. */ void na_data_boxed_set_from_value( NADataBoxed *boxed, const GValue *value ) { na_boxed_set_from_value( NA_BOXED( boxed ), value ); } /** * na_data_boxed_set_from_void: * @boxed: the #NADataBoxed whose value is to be set. * @value: the value whose content is to be got. * * Evaluates the @value and set it to the @boxed. * * Since: 2.30 * Deprecated: 3.1: Use na_boxed_set_from_void() instead. */ void na_data_boxed_set_from_void( NADataBoxed *boxed, const void *value ) { na_boxed_set_from_void( NA_BOXED( boxed ), value ); } #endif /* NA_ENABLE_DEPRECATED */ static GParamSpec * bool_spec( const NADataDef *def ) { return( g_param_spec_boolean( def->name, gettext( def->short_label ), gettext( def->long_label ), na_core_utils_boolean_from_string( def->default_value ), G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); } static gboolean bool_is_default( const NADataBoxed *boxed ) { gboolean is_default = FALSE; gboolean default_value; if( boxed->private->data_def->default_value && strlen( boxed->private->data_def->default_value )){ default_value = na_core_utils_boolean_from_string( boxed->private->data_def->default_value ); is_default = ( default_value == na_boxed_get_boolean( NA_BOXED( boxed ))); } return( is_default ); } static gboolean bool_is_valid( const NADataBoxed *boxed ) { return( TRUE ); } static GParamSpec * pointer_spec( const NADataDef *def ) { return( g_param_spec_pointer( def->name, gettext( def->short_label ), gettext( def->long_label ), G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); } /* * say that a pointer never has its default value * (essentially because there cannot be / one cannot set any relevant * default value for a pointer) */ static gboolean pointer_is_default( const NADataBoxed *boxed ) { return( FALSE ); } static gboolean pointer_is_valid( const NADataBoxed *boxed ) { gboolean is_valid = TRUE; gconstpointer pointer; if( boxed->private->data_def->mandatory ){ pointer = na_boxed_get_pointer( NA_BOXED( boxed )); if( !pointer ){ g_debug( "na_data_boxed_pointer_is_valid: invalid %s: mandatory but null", boxed->private->data_def->name ); is_valid = FALSE; } } return( is_valid ); } static GParamSpec * string_spec( const NADataDef *def ) { return( g_param_spec_string( def->name, gettext( def->short_label ), gettext( def->long_label ), def->default_value, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); } static gboolean string_is_default( const NADataBoxed *boxed ) { gboolean is_default = FALSE; gchar *value = na_boxed_get_string( NA_BOXED( boxed )); if( boxed->private->data_def->default_value && strlen( boxed->private->data_def->default_value )){ if( value && strlen( value )){ /* default value is not null and string has something */ is_default = ( strcmp( value, boxed->private->data_def->default_value ) == 0 ); } else { /* default value is not null, but string is null */ is_default = FALSE; } } else if( value && strlen( value )){ /* default value is null, but string has something */ is_default = FALSE; } else { /* default value and string are both null */ is_default = TRUE; } g_free( value ); return( is_default ); } static gboolean string_is_valid( const NADataBoxed *boxed ) { gboolean is_valid = TRUE; if( boxed->private->data_def->mandatory ){ gchar *value = na_boxed_get_string( NA_BOXED( boxed )); if( !value || !strlen( value )){ g_debug( "na_data_boxed_string_is_valid: invalid %s: mandatory but empty or null", boxed->private->data_def->name ); is_valid = FALSE; } g_free( value ); } return( is_valid ); } static GParamSpec * string_list_spec( const NADataDef *def ) { return( g_param_spec_pointer( def->name, gettext( def->short_label ), gettext( def->long_label ), G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); } static gboolean string_list_is_default( const NADataBoxed *boxed ) { gboolean is_default = FALSE; gchar *value = na_boxed_get_string( NA_BOXED( boxed )); if( boxed->private->data_def->default_value && strlen( boxed->private->data_def->default_value )){ if( value && strlen( value )){ is_default = ( strcmp( value, boxed->private->data_def->default_value ) == 0 ); } else { is_default = FALSE; } } else if( value && strlen( value )){ is_default = FALSE; } else { is_default = TRUE; } g_free( value ); return( is_default ); } static gboolean string_list_is_valid( const NADataBoxed *boxed ) { gboolean is_valid = TRUE; if( boxed->private->data_def->mandatory ){ gchar *value = na_boxed_get_string( NA_BOXED( boxed )); if( !value || !strlen( value )){ g_debug( "na_data_boxed_string_list_is_valid: invalid %s: mandatory but empty or null", boxed->private->data_def->name ); is_valid = FALSE; } } return( is_valid ); } static gboolean locale_is_default( const NADataBoxed *boxed ) { gboolean is_default = FALSE; gchar *value = na_boxed_get_string( NA_BOXED( boxed )); if( boxed->private->data_def->default_value && g_utf8_strlen( boxed->private->data_def->default_value, -1 )){ if( value && strlen( value )){ /* default value is not null and string has something */ is_default = ( na_core_utils_str_collate( value, boxed->private->data_def->default_value ) == 0 ); } else { /* default value is not null, but string is null */ is_default = FALSE; } } else if( value && g_utf8_strlen( value, -1 )){ /* default value is null, but string has something */ is_default = FALSE; } else { /* default value and string are both null */ is_default = TRUE; } g_free( value ); return( is_default ); } static gboolean locale_is_valid( const NADataBoxed *boxed ) { gboolean is_valid = TRUE; if( boxed->private->data_def->mandatory ){ gchar *value = na_boxed_get_string( NA_BOXED( boxed )); if( !value || !g_utf8_strlen( value, -1 )){ g_debug( "na_data_boxed_locale_is_valid: invalid %s: mandatory but empty or null", boxed->private->data_def->name ); is_valid = FALSE; } g_free( value ); } return( is_valid ); } static GParamSpec * uint_spec( const NADataDef *def ) { return( g_param_spec_uint( def->name, gettext( def->short_label ), gettext( def->long_label ), 0, UINT_MAX, atoi( def->default_value ), G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); } static gboolean uint_is_default( const NADataBoxed *boxed ) { gboolean is_default = FALSE; guint default_value; if( boxed->private->data_def->default_value ){ default_value = atoi( boxed->private->data_def->default_value ); is_default = ( na_boxed_get_uint( NA_BOXED( boxed )) == default_value ); } return( is_default ); } static gboolean uint_is_valid( const NADataBoxed *boxed ) { return( TRUE ); } static GParamSpec * uint_list_spec( const NADataDef *def ) { return( g_param_spec_pointer( def->name, gettext( def->short_label ), gettext( def->long_label ), G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); } /* * we assume no default for uint list */ static gboolean uint_list_is_default( const NADataBoxed *boxed ) { return( FALSE ); } static gboolean uint_list_is_valid( const NADataBoxed *boxed ) { gboolean is_valid = TRUE; if( boxed->private->data_def->mandatory ){ gchar *value = na_boxed_get_string( NA_BOXED( boxed )); if( !value || !strlen( value )){ g_debug( "na_data_boxed_uint_list_is_valid: invalid %s: mandatory but empty or null", boxed->private->data_def->name ); is_valid = FALSE; } g_free( value ); } return( is_valid ); } nautilus-actions-3.2.3/src/core/na-desktop-environment.h0000644000175100017500000000514112212601376020243 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_API_NA_DESKTOP_ENVIRONMENT_H__ #define __CORE_API_NA_DESKTOP_ENVIRONMENT_H__ /* @title: Desktop Environment * @short_description: Desktop Environment Utilities. * @include: core/na-desktop-environment.h * * The desktop environment is used with OnlyShowIn and NotShowIn keys of * our desktop files. Unfortunately, there is no consensus between desktops * on how to determine the currently running desktop. * See http://lists.freedesktop.org/archives/xdg/2009-August/010940.html * and http://lists.freedesktop.org/archives/xdg/2011-February/011818.html * * Waiting for such a consensus (!), we have to determine this ourself. * Two methods: * - letting the user select himself which is the currenly running desktop * as a user preference * - try to determine it automatically. * * Known desktop environments are defined at * http://standards.freedesktop.org/menu-spec/latest/apb.html. */ #include G_BEGIN_DECLS #define DESKTOP_GNOME "GNOME" #define DESKTOP_KDE "KDE" #define DESKTOP_LXDE "LXDE" #define DESKTOP_ROX "ROX" #define DESKTOP_XFCE "XFCE" #define DESKTOP_OLD "Old" typedef struct { const gchar *id; const gchar *label; } NADesktopEnv; const NADesktopEnv *na_desktop_environment_get_known_list ( void ); const gchar *na_desktop_environment_detect_running_desktop( void ); const gchar *na_desktop_environment_get_label ( const gchar *id ); G_END_DECLS #endif /* __CORE_API_NA_DESKTOP_ENVIRONMENT_H__ */ nautilus-actions-3.2.3/src/core/na-importer-ask.c0000644000175100017500000003542212212601376016645 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "na-gtk-utils.h" #include "na-import-mode.h" #include "na-importer.h" #include "na-importer-ask.h" #include "na-ioptions-list.h" #include "na-settings.h" /* private class data */ struct _NAImporterAskClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAImporterAskPrivate { gboolean dispose_has_run; GtkWindow *toplevel; NAObjectItem *importing; NAObjectItem *existing; NAImporterAskUserParms *parms; guint mode; }; static GObjectClass *st_parent_class = NULL; static NAImporterAsk *st_dialog = NULL; static const gchar *st_uixml = PKGUIDIR "/na-importer-ask.ui"; static GType register_type( void ); static void class_init( NAImporterAskClass *klass ); static void ioptions_list_iface_init( NAIOptionsListInterface *iface, void *user_data ); static GList *ioptions_list_get_modes( const NAIOptionsList *instance, GtkWidget *container ); static void ioptions_list_free_modes( const NAIOptionsList *instance, GtkWidget *container, GList *modes ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *dialog ); static void instance_finalize( GObject *dialog ); static NAImporterAsk *import_ask_new( GtkWindow *parent ); static void initialize_gtk( NAImporterAsk *dialog, GtkWindow *toplevel ); static void initialize_window( NAImporterAsk *dialog, GtkWindow *toplevel ); static void get_selected_mode( NAImporterAsk *editor ); static void on_destroy_toplevel( GtkWindow *toplevel, NAImporterAsk *dialog ); static gboolean on_dialog_response( NAImporterAsk *editor, gint code ); GType na_importer_ask_get_type( void ) { static GType dialog_type = 0; if( !dialog_type ){ dialog_type = register_type(); } return( dialog_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_importer_ask_register_type"; GType type; static GTypeInfo info = { sizeof( NAImporterAskClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAImporterAsk ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo ioptions_list_iface_info = { ( GInterfaceInitFunc ) ioptions_list_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NAImporterAsk", &info, 0 ); g_type_add_interface_static( type, NA_TYPE_IOPTIONS_LIST, &ioptions_list_iface_info ); return( type ); } static void class_init( NAImporterAskClass *klass ) { static const gchar *thisfn = "na_importer_ask_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NAImporterAskClassPrivate, 1 ); } static void ioptions_list_iface_init( NAIOptionsListInterface *iface, void *user_data ) { static const gchar *thisfn = "nact_assistant_import_ioptions_list_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->get_options = ioptions_list_get_modes; iface->free_options = ioptions_list_free_modes; } static GList * ioptions_list_get_modes( const NAIOptionsList *instance, GtkWidget *container ) { GList *modes; g_return_val_if_fail( NA_IS_IMPORTER_ASK( instance ), NULL ); modes = na_importer_get_modes(); return( modes ); } static void ioptions_list_free_modes( const NAIOptionsList *instance, GtkWidget *container, GList *modes ) { g_return_if_fail( NA_IS_IMPORTER_ASK( instance )); na_importer_free_modes( modes ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_importer_ask_instance_init"; NAImporterAsk *self; g_return_if_fail( NA_IS_IMPORTER_ASK( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_IMPORTER_ASK( instance ); self->private = g_new0( NAImporterAskPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *dialog ) { static const gchar *thisfn = "na_importer_ask_instance_dispose"; NAImporterAsk *self; g_return_if_fail( NA_IS_IMPORTER_ASK( dialog )); self = NA_IMPORTER_ASK( dialog ); if( !self->private->dispose_has_run ){ g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( dialog ); } } } static void instance_finalize( GObject *dialog ) { static const gchar *thisfn = "na_importer_ask_instance_finalize"; NAImporterAsk *self; g_return_if_fail( NA_IS_IMPORTER_ASK( dialog )); g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog ); self = NA_IMPORTER_ASK( dialog ); if( self->private->toplevel ){ gtk_widget_destroy( GTK_WIDGET( self->private->toplevel )); } g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( dialog ); } } /* * Returns a newly allocated NAImporterAsk object. */ static NAImporterAsk * import_ask_new( GtkWindow *parent ) { NAImporterAsk *dialog; GtkBuilder *builder; GError *error; GtkWindow *toplevel; if( st_dialog ){ dialog = st_dialog; } else { dialog = g_object_new( NA_TYPE_IMPORTER_ASK, NULL ); builder = gtk_builder_new(); error = NULL; gtk_builder_add_from_file( builder, st_uixml, &error ); if( error ){ gtk_message_dialog_new( parent, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", error->message ); g_error_free( error ); g_object_unref( dialog ); dialog = NULL; } else { toplevel = GTK_WINDOW( gtk_builder_get_object( builder, "ImporterAskDialog" )); if( !toplevel ){ /* l10n: 'ImporterAskDialog' is the dialog name: do not translate */ gtk_message_dialog_new( parent, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _( "Unable to load 'ImporterAskDialog' from %s" ), st_uixml ); g_object_unref( dialog ); dialog = NULL; } else { dialog->private->toplevel = toplevel; if( parent ){ gtk_window_set_transient_for( dialog->private->toplevel, parent ); gtk_window_set_destroy_with_parent( dialog->private->toplevel, TRUE ); g_signal_connect( G_OBJECT( dialog->private->toplevel ), "destroy", G_CALLBACK( on_destroy_toplevel ), dialog ); st_dialog = dialog; } initialize_gtk( dialog, toplevel ); #if !GTK_CHECK_VERSION( 2,22,0 ) gtk_dialog_set_has_separator( GTK_DIALOG( toplevel ), FALSE ); #endif } } g_object_unref( builder ); } return( dialog ); } /* * na_importer_ask_user: * @importing: the #NAObjectItem-derived object being currently imported. * @existing: the #NAObjectItem-derived already existing object with the same ID. * @parms: a #NAIImporterUriParms structure. * * Ask the user for what to do when an imported item has the same ID * that an already existing one. * * If a parent is specified, then we allocate a new NAImporterAsk from * GtkBuilder, hiding and showing it for each invocation of the dialog * by the parent, as long as the parent exists. * When the parent is destroyed, this (maybe hidden) NAImporterAsk dialog * is also destroyed. * * If there is no specified parent, then we recreate a new NAImporterAsk * dialog at each invocation, destroying it after on_dialog_response() * returns. * * Returns: the definitive import mode. * * When the user selects 'Keep same choice without asking me', this choice * becomes his preference import mode. */ guint na_importer_ask_user( const NAObjectItem *importing, const NAObjectItem *existing, NAImporterAskUserParms *parms ) { static const gchar *thisfn = "na_importer_ask_user"; NAImporterAsk *dialog; guint mode; gint code; g_return_val_if_fail( NA_IS_OBJECT_ITEM( importing ), IMPORTER_MODE_NO_IMPORT ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( existing ), IMPORTER_MODE_NO_IMPORT ); g_debug( "%s: importing=%p, existing=%p, parms=%p", thisfn, ( void * ) importing, ( void * ) existing, ( void * ) parms ); mode = IMPORTER_MODE_ASK; dialog = import_ask_new( parms->parent ); if( dialog ){ dialog->private->importing = ( NAObjectItem * ) importing; dialog->private->existing = ( NAObjectItem * ) existing; dialog->private->parms = parms; initialize_window( dialog, dialog->private->toplevel ); do { code = gtk_dialog_run( GTK_DIALOG( dialog->private->toplevel )); } while ( !on_dialog_response( dialog, code )); mode = dialog->private->mode; na_gtk_utils_save_window_position( dialog->private->toplevel, NA_IPREFS_IMPORT_ASK_USER_WSP ); if( parms->parent ){ gtk_widget_hide( GTK_WIDGET( dialog->private->toplevel )); } else { g_object_unref( dialog ); } } return( mode ); } static void initialize_gtk( NAImporterAsk *dialog, GtkWindow *toplevel ) { static const gchar *thisfn = "na_importer_ask_initialize_gtk"; GtkWidget *container; g_return_if_fail( NA_IS_IMPORTER_ASK( dialog )); g_debug( "%s: dialog=%p, toplevel=%p", thisfn, ( void * ) dialog, ( void * ) toplevel ); container = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( toplevel ), "AskModeVBox" ); na_ioptions_list_gtk_init( NA_IOPTIONS_LIST( dialog ), container, FALSE ); } static void initialize_window( NAImporterAsk *editor, GtkWindow *toplevel ) { static const gchar *thisfn = "na_importer_ask_initialize_window"; gchar *imported_label, *existing_label; gchar *label; GtkWidget *widget; GtkWidget *button; gchar *mode_id; g_return_if_fail( NA_IS_IMPORTER_ASK( editor )); g_debug( "%s: editor=%p, toplevel=%p", thisfn, ( void * ) editor, ( void * ) toplevel ); imported_label = na_object_get_label( editor->private->importing ); existing_label = na_object_get_label( editor->private->existing ); if( NA_IS_OBJECT_ACTION( editor->private->importing )){ /* i18n: The action imported from has the same id than */ label = g_strdup_printf( _( "The action \"%s\" imported from \"%s\" has the same identifiant than the already existing \"%s\"." ), imported_label, editor->private->parms->uri, existing_label ); } else { /* i18n: The menu imported from has the same id than */ label = g_strdup_printf( _( "The menu \"%s\" imported from \"%s\" has the same identifiant than the already existing \"%s\"." ), imported_label, editor->private->parms->uri, existing_label ); } widget = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( toplevel ), "ImporterAskLabel" ); gtk_label_set_text( GTK_LABEL( widget ), label ); g_free( label ); widget = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( toplevel ), "AskModeVBox" ); mode_id = na_settings_get_string( NA_IPREFS_IMPORT_ASK_USER_LAST_MODE, NULL, NULL ); na_ioptions_list_set_default( NA_IOPTIONS_LIST( editor ), widget, mode_id ); g_free( mode_id ); button = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( toplevel ), "AskKeepChoiceButton" ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( button ), editor->private->parms->keep_choice ); na_gtk_utils_restore_window_position( toplevel, NA_IPREFS_IMPORT_ASK_USER_WSP ); gtk_widget_show_all( GTK_WIDGET( toplevel )); } static void get_selected_mode( NAImporterAsk *editor ) { GtkWidget *widget; NAIOption *mode; gchar *mode_id; GtkWidget *button; gboolean keep; widget = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( editor->private->toplevel ), "AskModeVBox" ); mode = na_ioptions_list_get_selected( NA_IOPTIONS_LIST( editor ), widget ); mode_id = na_ioption_get_id( mode ); na_settings_set_string( NA_IPREFS_IMPORT_ASK_USER_LAST_MODE, mode_id ); g_free( mode_id ); editor->private->mode = na_import_mode_get_id( NA_IMPORT_MODE( mode )); button = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( editor->private->toplevel ), "AskKeepChoiceButton" ); keep = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button )); na_settings_set_boolean( NA_IPREFS_IMPORT_ASK_USER_KEEP_LAST_CHOICE, keep ); } /* * destroy signal is only connected if the NAImporterAsk has been created * with a parent window; it has been defined with 'destroy_with_parent' * and so we have yet to unref the NAImporterAsk object itself */ static void on_destroy_toplevel( GtkWindow *toplevel, NAImporterAsk *dialog ) { static const gchar *thisfn = "na_importer_ask_on_destroy_toplevel"; g_debug( "%s: toplevel=%p, dialog=%p", thisfn, ( void * ) toplevel, ( void * ) dialog ); g_return_if_fail( NA_IS_IMPORTER_ASK( dialog )); g_return_if_fail( toplevel == dialog->private->toplevel ); if( !dialog->private->dispose_has_run ){ dialog->private->toplevel = NULL; g_object_unref( dialog ); } st_dialog = NULL; } static gboolean on_dialog_response( NAImporterAsk *editor, gint code ) { static const gchar *thisfn = "na_importer_ask_on_dialog_response"; g_return_val_if_fail( NA_IS_IMPORTER_ASK( editor ), FALSE ); g_debug( "%s: editor=%p, code=%d", thisfn, ( void * ) editor, code ); switch( code ){ case GTK_RESPONSE_NONE: case GTK_RESPONSE_DELETE_EVENT: case GTK_RESPONSE_CLOSE: case GTK_RESPONSE_CANCEL: editor->private->mode = IMPORTER_MODE_NO_IMPORT; return( TRUE ); break; case GTK_RESPONSE_OK: get_selected_mode( editor ); return( TRUE ); break; } return( FALSE ); } nautilus-actions-3.2.3/src/core/na-ioption.h0000644000175100017500000001307312212601376015714 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_IOPTION_H__ #define __CORE_NA_IOPTION_H__ /* * SECTION: ioptions * @title: NAIOption * @short_description: The Option Interface v 1 * @include: core/na-ioption.h * * The #NAIOption interface is to be implemented by #GObject -derived object which * are part of a #NAIOptionsList interface. * * * Versions historic * * Historic of the versions of the #NAIOption interface * * * * * * * &prodname; version * #NAIOption interface version * * * * * * since 3.2 * 1 * current version * * * *
*
*/ #include "gdk-pixbuf/gdk-pixbuf.h" G_BEGIN_DECLS #define NA_TYPE_IOPTION ( na_ioption_get_type()) #define NA_IOPTION( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NA_TYPE_IOPTION, NAIOption )) #define NA_IS_IOPTION( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NA_TYPE_IOPTION )) #define NA_IOPTION_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_TYPE_IOPTION, NAIOptionInterface )) typedef struct _NAIOption NAIOption; typedef struct _NAIOptionInterfacePrivate NAIOptionInterfacePrivate; typedef struct _NAIOptionImportFromUriParms NAIOptionImportFromUriParms; typedef struct _NAIOptionManageImportModeParms NAIOptionManageImportModeParms; /* * NAIOptionInterface: * @get_version: returns the version of this interface that the * instance implements. * @get_id: returns the string identifier of the option. * @get_label: returns the label of the option. * @get_description: returns the description of the option. * @get_pixbuf: returns the image associated to the option. * * This defines the interface that a #NAIOption implementation should provide. */ typedef struct { /*< private >*/ GTypeInterface parent; NAIOptionInterfacePrivate *private; /*< public >*/ /* * get_version: * @instance: the #NAIOption instance of the implementation. * * This method is supposed to let know to any caller which version of this * interface the implementation provides. This may be useful when this * interface will itself be upgraded. * * If this method is not provided by the implementation, one should suppose * that the implemented version is at last the version 1. * * Returns: the version of this interface provided by the implementation. * * Since: 3.2 */ guint ( *get_version ) ( const NAIOption *instance ); /* * get_id: * @instance: the #NAIOption instance of the implementation. * * Returns: the string identifier of the option, as a newly allocated string * which should be g_free() by the caller. * * Since: 3.2 */ gchar * ( *get_id ) ( const NAIOption *instance ); /* * get_label: * @instance: the #NAIOption instance of the implementation. * * Returns: the label of the option, as a newly allocated string * which should be g_free() by the caller. * * Since: 3.2 */ gchar * ( *get_label ) ( const NAIOption *instance ); /* * get_description: * @instance: the #NAIOption instance of the implementation. * * Returns: the description of the option, as a newly allocated string * which should be g_free() by the caller. * * Since: 3.2 */ gchar * ( *get_description )( const NAIOption *instance ); /* * get_pixbuf: * @instance: the #NAIOption instance of the implementation. * * Returns: the image assocated to the option, as a newly allocated string * which should be g_object_unref() by the caller. * * Since: 3.2 */ GdkPixbuf * ( *get_pixbuf ) ( const NAIOption *instance ); } NAIOptionInterface; GType na_ioption_get_type ( void ); gchar *na_ioption_get_id ( const NAIOption *option ); gchar *na_ioption_get_label ( const NAIOption *option ); gchar *na_ioption_get_description( const NAIOption *option ); GdkPixbuf *na_ioption_get_pixbuf ( const NAIOption *option ); G_END_DECLS #endif /* __CORE_NA_IOPTION_H__ */ nautilus-actions-3.2.3/src/core/Makefile.am0000644000175100017500000001136212212601376015521 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) pkglib_LTLIBRARIES = libna-core.la exportformat_datadir = $(pkgdatadir)/export-format importmode_datadir = $(pkgdatadir)/import-mode ui_datadir = $(pkgdatadir)/ui AM_CPPFLAGS += \ -I $(top_srcdir) \ -I $(top_srcdir)/src \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ -DPKGLIBDIR=\""$(pkglibdir)"\" \ -DPKGLIBEXECDIR=\""$(pkglibexecdir)"\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_CORE}\" \ -DPKGEXPORTFORMATDIR=\"$(exportformat_datadir)\" \ -DPKGIMPORTMODEDIR=\"$(importmode_datadir)\" \ -DPKGUIDIR=\"$(ui_datadir)\" \ $(NAUTILUS_ACTIONS_CFLAGS) \ $(NULL) BUILT_SOURCES = \ na-marshal.c \ na-marshal.h \ $(NULL) libna_core_la_SOURCES = \ na-about.c \ na-about.h \ na-boxed.c \ na-core-utils.c \ na-data-boxed.c \ na-data-def.c \ na-data-types.c \ na-desktop-environment.c \ na-desktop-environment.h \ na-exporter.c \ na-exporter.h \ na-export-format.c \ na-export-format.h \ na-factory-object.c \ na-factory-object.h \ na-factory-provider.c \ na-factory-provider.h \ na-gconf-migration.c \ na-gconf-migration.h \ na-gconf-monitor.c \ na-gconf-utils.c \ na-gnome-vfs-uri.c \ na-gnome-vfs-uri.h \ na-gtk-utils.c \ na-gtk-utils.h \ na-icontext.c \ na-icontext-factory.c \ na-iduplicable.c \ na-iexporter.c \ na-ifactory-object.c \ na-ifactory-provider.c \ na-iimporter.c \ na-iio-provider.c \ na-import-mode.c \ na-import-mode.h \ na-importer.c \ na-importer.h \ na-importer-ask.c \ na-importer-ask.h \ na-io-provider.c \ na-io-provider.h \ na-ioption.c \ na-ioption.h \ na-ioptions-list.c \ na-ioptions-list.h \ na-iprefs.c \ na-iprefs.h \ na-module.c \ na-module.h \ na-object.c \ na-object-id.c \ na-object-id-factory.c \ na-object-item.c \ na-object-item-factory.c \ na-object-action.c \ na-object-action-factory.c \ na-object-profile.c \ na-object-profile-factory.c \ na-object-menu.c \ na-object-menu-factory.c \ na-pivot.c \ na-pivot.h \ na-selected-info.c \ na-selected-info.h \ na-settings.c \ na-settings.h \ na-timeout.c \ na-tokens.c \ na-tokens.h \ na-updater.c \ na-updater.h \ $(BUILT_SOURCES) \ $(NULL) na-marshal.h: na-marshal.def $(GLIB_GENMARSHAL) $(GLIB_GENMARSHAL) $< --header --prefix=na_cclosure_marshal > $@ na-marshal.c: na-marshal.def $(GLIB_GENMARSHAL) echo "#include \"na-marshal.h\"" > $@ $(GLIB_GENMARSHAL) $< --body --prefix=na_cclosure_marshal >> $@ libna_core_la_LIBADD = \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libna_core_la_LDFLAGS = \ -no-undefined \ -avoid-version \ -fPIC \ $(NULL) ui_data_DATA = \ na-importer-ask.ui \ $(NULL) exportformat_data_DATA = \ export-format-ask.png \ $(NULL) importmode_data_DATA = \ import-mode-ask.png \ import-mode-no-import.png \ import-mode-override.png \ import-mode-renumber.png \ $(NULL) CLEANFILES = \ $(BUILT_SOURCES) \ $(NULL) EXTRA_DIST = \ $(ui_data_DATA) \ $(exportformat_data_DATA) \ $(importmode_data_DATA) \ na-marshal.def \ $(NULL) nautilus-actions-3.2.3/src/core/na-gtk-utils.h0000644000175100017500000000476312212601376016164 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_API_NA_GTK_UTILS_H__ #define __CORE_API_NA_GTK_UTILS_H__ /* @title: GTK+ * @short_description: The Gtk+ Library Utilities. * @include: core/na-gtk-utils.h */ #include G_BEGIN_DECLS /* widget hierarchy */ GtkWidget *na_gtk_utils_find_widget_by_name( GtkContainer *container, const gchar *name ); #ifdef NA_MAINTAINER_MODE void na_gtk_utils_dump_children ( GtkContainer *container ); #endif /* window size and position */ void na_gtk_utils_restore_window_position( GtkWindow *toplevel, const gchar *wsp_name ); void na_gtk_utils_save_window_position ( GtkWindow *toplevel, const gchar *wsp_name ); /* widget status */ void na_gtk_utils_set_editable( GObject *widget, gboolean editable ); void na_gtk_utils_radio_set_initial_state ( GtkRadioButton *button, GCallback toggled_handler, void *user_data, gboolean editable, gboolean sensitive ); void na_gtk_utils_radio_reset_initial_state( GtkRadioButton *button, GCallback toggled_handler ); /* default height of a panel bar (dirty hack!) */ #define DEFAULT_HEIGHT 22 #define NA_TOGGLE_DATA_EDITABLE "na-toggle-data-editable" #define NA_TOGGLE_DATA_BUTTON "na-toggle-data-button" #define NA_TOGGLE_DATA_HANDLER "na-toggle-data-handler" #define NA_TOGGLE_DATA_USER_DATA "na-toggle-data-user-data" G_END_DECLS #endif /* __CORE_API_NA_GTK_UTILS_H__ */ nautilus-actions-3.2.3/src/core/na-iprefs.h0000644000175100017500000000416012212601376015520 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_IPREFS_H__ #define __CORE_NA_IPREFS_H__ /* * Starting with 3.1.0, NAIPrefs interface is deprecated. * * Instead, this module is used as an intermediate level between actual * settings and the application; it so implements all maps needed to * transform an enum used in the code to and from a string stored in * preferences. */ #include "na-pivot.h" G_BEGIN_DECLS /* sort mode of the items in the file manager context menu */ enum { IPREFS_ORDER_ALPHA_ASCENDING = 1, /* default */ IPREFS_ORDER_ALPHA_DESCENDING, IPREFS_ORDER_MANUAL }; guint na_iprefs_get_order_mode ( gboolean *mandatory ); guint na_iprefs_get_order_mode_by_label( const gchar *label ); void na_iprefs_set_order_mode ( guint mode ); guint na_iprefs_get_tabs_pos ( gboolean *mandatory ); void na_iprefs_set_tabs_pos ( guint pos ); gboolean na_iprefs_write_level_zero ( const GList *items, GSList **messages ); G_END_DECLS #endif /* __CORE_NA_IPREFS_H__ */ nautilus-actions-3.2.3/src/core/na-ifactory-object.c0000644000175100017500000001411712212601376017312 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "na-factory-object.h" /* private interface data */ struct _NAIFactoryObjectInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; static guint st_initializations = 0; /* interface initialization count */ static GType register_type( void ); static void interface_base_init( NAIFactoryObjectInterface *klass ); static void interface_base_finalize( NAIFactoryObjectInterface *klass ); static guint ifactory_object_get_version( const NAIFactoryObject *instance ); /* * Registers the GType of this interface. */ GType na_ifactory_object_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_ifactory_object_register_type"; GType type; static const GTypeInfo info = { sizeof( NAIFactoryObjectInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NAIFactoryObject", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( NAIFactoryObjectInterface *klass ) { static const gchar *thisfn = "na_ifactory_object_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass=%p (%s)", thisfn, ( void * ) klass, G_OBJECT_CLASS_NAME( klass )); klass->private = g_new0( NAIFactoryObjectInterfacePrivate, 1 ); klass->get_version = ifactory_object_get_version; klass->get_groups = NULL; klass->copy = NULL; klass->are_equal = NULL; klass->is_valid = NULL; klass->read_start = NULL; klass->read_done = NULL; klass->write_start = NULL; klass->write_done = NULL; } st_initializations += 1; } static void interface_base_finalize( NAIFactoryObjectInterface *klass ) { static const gchar *thisfn = "na_ifactory_object_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } static guint ifactory_object_get_version( const NAIFactoryObject *instance ) { return( 1 ); } /** * na_ifactory_object_get_data_boxed: * @object: a #NAIFactoryObject object. * @name: the name of the elementary data we are searching for. * * The returned #NADataBoxed is owned by #NAIFactoryObject @object, and * should not be released by the caller. * * Returns: The #NADataBoxed object which contains the specified data, * or %NULL. * * Since: 2.30 */ NADataBoxed * na_ifactory_object_get_data_boxed( const NAIFactoryObject *object, const gchar *name ) { GList *list, *ip; g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL ); list = g_object_get_data( G_OBJECT( object ), NA_IFACTORY_OBJECT_PROP_DATA ); /*g_debug( "list=%p (count=%u)", ( void * ) list, g_list_length( list ));*/ for( ip = list ; ip ; ip = ip->next ){ NADataBoxed *boxed = NA_DATA_BOXED( ip->data ); const NADataDef *def = na_data_boxed_get_data_def( boxed ); if( !strcmp( def->name, name )){ return( boxed ); } } return( NULL ); } /** * na_ifactory_object_get_data_groups: * @object: a #NAIFactoryObject object. * * The returned #NADataGroup is owned by the #NAIFactoryObject @object, * and should not be released by the caller. * * Returns: The #NADataGroup groups definition, or %NULL. * * Since: 2.30 */ NADataGroup * na_ifactory_object_get_data_groups( const NAIFactoryObject *object ) { NADataGroup *groups; g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL ); groups = NULL; if( NA_IFACTORY_OBJECT_GET_INTERFACE( object )->get_groups ){ groups = NA_IFACTORY_OBJECT_GET_INTERFACE( object )->get_groups( object ); } return( groups ); } /** * na_ifactory_object_get_as_void: * @object: this #NAIFactoryObject instance. * @name: the elementary data whose value is to be got. * * If the type of the value is %NA_DATA_TYPE_STRING, %NA_DATA_TYPE_LOCALE_STRING, * or %NA_DATA_TYPE_STRING_LIST, then the returned value is a newly allocated * one and should be g_free() (resp. na_core_utils_slist_free()) by the * caller. * * Returns: the searched value. * * Since: 2.30 */ void * na_ifactory_object_get_as_void( const NAIFactoryObject *object, const gchar *name ) { g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL ); return( na_factory_object_get_as_void( object, name )); } /** * na_ifactory_object_set_from_void: * @object: this #NAIFactoryObject instance. * @name: the name of the elementary data whose value is to be set. * @data: the value to set. * * Set the elementary data with the given value. * * Since: 2.30 */ void na_ifactory_object_set_from_void( NAIFactoryObject *object, const gchar *name, const void *data ) { g_return_if_fail( NA_IS_IFACTORY_OBJECT( object )); na_factory_object_set_from_void( object, name, data ); } nautilus-actions-3.2.3/src/core/na-marshal.h0000644000175100017500000000271212220365310015652 00000000000000 #ifndef __na_cclosure_marshal_MARSHAL_H__ #define __na_cclosure_marshal_MARSHAL_H__ #include G_BEGIN_DECLS /* VOID:POINTER,BOOLEAN (/home/pierre/data/eclipse/nautilus-actions/src/core/na-marshal.def:3) */ extern void na_cclosure_marshal_VOID__POINTER_BOOLEAN (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:STRING,STRING,POINTER,BOOLEAN (/home/pierre/data/eclipse/nautilus-actions/src/core/na-marshal.def:6) */ extern void na_cclosure_marshal_VOID__STRING_STRING_POINTER_BOOLEAN (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); G_END_DECLS #endif /* __na_cclosure_marshal_MARSHAL_H__ */ nautilus-actions-3.2.3/src/core/na-gnome-vfs-uri.c0000644000175100017500000006134012212601376016724 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ /* * pwi 2009-07-29 * shamelessly pull out of GnomeVFS (gnome-vfs-uri and consorts) */ /* gnome-vfs-uri.h - URI handling for the GNOME Virtual File System. Copyright (C) 1999 Free Software Foundation The Gnome Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The Gnome Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the Gnome Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Author: Ettore Perazzoli */ #ifdef HAVE_CONFIG_H #include #endif #include #include "na-gnome-vfs-uri.h" #define HEX_ESCAPE '%' static void collapse_slash_runs (char *path, int from_offset); static int find_next_slash (const char *path, int current_offset); static int find_slash_before_offset (const char *path, int to); static const gchar *get_method_string (const gchar *substring, gchar **method_string); static gchar * gnome_vfs_canonicalize_pathname (gchar *path); static char *gnome_vfs_escape_set(const char *string, const char *match_set); static void gnome_vfs_remove_optional_escapes (char *uri); static char * gnome_vfs_unescape_string (const gchar *escaped_string, const gchar *illegal_characters); static int hex_to_int (gchar c); static void set_uri_element (NAGnomeVFSURI *vfs, const gchar *text, guint len); static gchar *split_toplevel_uri (const gchar *path, guint path_len, gchar **host_return, gchar **user_return, guint *port_return, gchar **password_return); static int unescape_character (const char *scanner); void na_gnome_vfs_uri_parse( NAGnomeVFSURI *vfs, const gchar *text_uri ) { const gchar *method_scanner; gchar *extension_scanner; vfs->path = NULL; vfs->scheme = NULL; vfs->host_name = NULL; vfs->host_port = 0; vfs->user_name = NULL; vfs->password = NULL; if (text_uri[0] == '\0') { return; } method_scanner = get_method_string(text_uri, &vfs->scheme ); if (strcmp (vfs->scheme, "pipe") == 0 ){ return; } extension_scanner = strchr (method_scanner, GNOME_VFS_URI_MAGIC_CHR); if (extension_scanner == NULL) { set_uri_element (vfs, method_scanner, strlen (method_scanner)); return; } /* handle '#' */ set_uri_element (vfs, method_scanner, extension_scanner - method_scanner); if (strchr (extension_scanner, ':') == NULL) { /* extension is a fragment identifier */ /*uri->fragment_id = g_strdup (extension_scanner + 1);*/ return; } } void na_gnome_vfs_uri_free( NAGnomeVFSURI *vfs ) { g_free( vfs->path ); g_free( vfs->scheme ); g_free( vfs->host_name ); g_free( vfs->user_name ); g_free( vfs->password ); g_free( vfs ); } static void collapse_slash_runs (char *path, int from_offset) { int i; /* Collapse multiple `/'s in a row. */ for (i = from_offset;; i++) { if (path[i] != GNOME_VFS_URI_PATH_CHR) { break; } } if (from_offset < i) { memmove (path + from_offset, path + i, strlen (path + i) + 1); i = from_offset + 1; } } static int find_next_slash (const char *path, int current_offset) { const char *match; g_assert (current_offset <= strlen (path)); match = strchr (path + current_offset, GNOME_VFS_URI_PATH_CHR); return match == NULL ? -1 : match - path; } static int find_slash_before_offset (const char *path, int to) { int result; int next_offset; result = -1; next_offset = 0; for (;;) { next_offset = find_next_slash (path, next_offset); if (next_offset < 0 || next_offset >= to) { break; } result = next_offset; next_offset++; } return result; } static const gchar * get_method_string (const gchar *substring, gchar **method_string) { const gchar *p; char *method; for (p = substring; g_ascii_isalnum (*p) || *p == '+' || *p == '-' || *p == '.'; p++) ; if (*p == ':' #ifdef G_OS_WIN32 && !(p == substring + 1 && g_ascii_isalpha (*substring)) #endif ) { /* Found toplevel method specification. */ method = g_strndup (substring, p - substring); *method_string = g_ascii_strdown (method, -1); g_free (method); p++; } else { *method_string = g_strdup ("file"); p = substring; } return p; } /* Canonicalize path, and return a new path. Do everything in situ. The new path differs from path in: Multiple `/'s are collapsed to a single `/'. Leading `./'s and trailing `/.'s are removed. Non-leading `../'s and trailing `..'s are handled by removing portions of the path. */ static gchar * gnome_vfs_canonicalize_pathname (gchar *path) { int i, marker; if (path == NULL || strlen (path) == 0) { return ""; } /* Walk along path looking for things to compact. */ for (i = 0, marker = 0;;) { if (!path[i]) break; /* Check for `../', `./' or trailing `.' by itself. */ if (path[i] == '.') { /* Handle trailing `.' by itself. */ if (path[i + 1] == '\0') { if (i > 1 && path[i - 1] == GNOME_VFS_URI_PATH_CHR) { /* strip the trailing /. */ path[i - 1] = '\0'; } else { /* convert path "/." to "/" */ path[i] = '\0'; } break; } /* Handle `./'. */ if (path[i + 1] == GNOME_VFS_URI_PATH_CHR) { memmove (path + i, path + i + 2, strlen (path + i + 2) + 1); if (i == 0) { /* don't leave leading '/' for paths that started * as relative (.//foo) */ collapse_slash_runs (path, i); marker = 0; } continue; } /* Handle `../' or trailing `..' by itself. * Remove the previous xxx/ part */ if (path[i + 1] == '.' && (path[i + 2] == GNOME_VFS_URI_PATH_CHR || path[i + 2] == '\0')) { /* ignore ../ at the beginning of a path */ if (i != 0) { marker = find_slash_before_offset (path, i - 1); /* Either advance past '/' or point to the first character */ marker ++; if (path [i + 2] == '\0' && marker > 1) { /* If we are looking at a /.. at the end of the uri and we * need to eat the last '/' too. */ marker--; } g_assert(marker < i); if (path[i + 2] == GNOME_VFS_URI_PATH_CHR) { /* strip the entire ../ string */ i++; } memmove (path + marker, path + i + 2, strlen (path + i + 2) + 1); i = marker; } else { i = 2; if (path[i] == GNOME_VFS_URI_PATH_CHR) { i++; } } collapse_slash_runs (path, i); continue; } } /* advance to the next '/' */ i = find_next_slash (path, i); /* If we didn't find any slashes, then there is nothing left to do. */ if (i < 0) { break; } marker = i++; collapse_slash_runs (path, i); } return path; } /* Escape undesirable characters using % * ------------------------------------- * * This function takes a pointer to a string in which * some characters may be unacceptable unescaped. * It returns a string which has these characters * represented by a '%' character followed by two hex digits. * * This routine returns a g_malloced string. */ static const gchar hex[16] = "0123456789ABCDEF"; /* * gnome_vfs_escape_set: * @string: string to be escaped. * @match_set: a string containing all characters to be escaped in @string. * * Escapes all characters in @string which are listed in @match_set. * * Return value: a newly allocated string equivalent to @string but * with characters in @match_string escaped. */ static char * gnome_vfs_escape_set (const char *string, const char *match_set) { char *result; const char *scanner; char *result_scanner; int escape_count; escape_count = 0; if (string == NULL) { return NULL; } if (match_set == NULL) { return g_strdup (string); } for (scanner = string; *scanner != '\0'; scanner++) { if (strchr(match_set, *scanner) != NULL) { /* this character is in the set of characters * we want escaped. */ escape_count++; } } if (escape_count == 0) { return g_strdup (string); } /* allocate two extra characters for every character that * needs escaping and space for a trailing zero */ result = g_malloc (scanner - string + escape_count * 2 + 1); for (scanner = string, result_scanner = result; *scanner != '\0'; scanner++) { if (strchr(match_set, *scanner) != NULL) { /* this character is in the set of characters * we want escaped. */ *result_scanner++ = HEX_ESCAPE; *result_scanner++ = hex[*scanner >> 4]; *result_scanner++ = hex[*scanner & 15]; } else { *result_scanner++ = *scanner; } } *result_scanner = '\0'; return result; } /* * gnome_vfs_remove_optional_escapes: * @uri: an escaped uri. * * Scans the @uri and converts characters that do not have to be * escaped into an un-escaped form. The characters that get treated this * way are defined as unreserved by the RFC. * * Return value: an error value if the @uri is found to be malformed. */ enum { RESERVED = 1, UNRESERVED, DELIMITERS, UNWISE, CONTROL, SPACE }; static const guchar uri_character_kind[128] = { CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL , CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL , CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL , CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL ,CONTROL , /* ' ' ! " # $ % & ' */ SPACE ,UNRESERVED,DELIMITERS,DELIMITERS,RESERVED ,DELIMITERS,RESERVED ,UNRESERVED, /* ( ) * + , - . / */ UNRESERVED,UNRESERVED,UNRESERVED,RESERVED ,RESERVED ,UNRESERVED,UNRESERVED,RESERVED , /* 0 1 2 3 4 5 6 7 */ UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED, /* 8 9 : ; < = > ? */ UNRESERVED,UNRESERVED,RESERVED ,RESERVED ,DELIMITERS,RESERVED ,DELIMITERS,RESERVED , /* @ A B C D E F G */ RESERVED ,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED, /* H I J K L M N O */ UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED, /* P Q R S T U V W */ UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED, /* X Y Z [ \ ] ^ _ */ UNRESERVED,UNRESERVED,UNRESERVED,UNWISE ,UNWISE ,UNWISE ,UNWISE ,UNRESERVED, /* ` a b c d e f g */ UNWISE ,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED, /* h i j k l m n o */ UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED, /* p q r s t u v w */ UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED,UNRESERVED, /* x y z { | } ~ DEL */ UNRESERVED,UNRESERVED,UNRESERVED,UNWISE ,UNWISE ,UNWISE ,UNRESERVED,CONTROL }; static void gnome_vfs_remove_optional_escapes (char *uri) { guchar *scanner; int character; int length; if (uri == NULL) { return; } length = strlen (uri); for (scanner = (guchar *)uri; *scanner != '\0'; scanner++, length--) { if (*scanner == HEX_ESCAPE) { character = unescape_character ((char *)scanner + 1); if (character < 0) { /* invalid hexadecimal character */ return; } if (uri_character_kind [character] == UNRESERVED) { /* This character does not need to be escaped, convert it * to a non-escaped form. */ *scanner = (guchar)character; g_assert (length >= 3); /* Shrink the string covering up the two extra digits of the * escaped character. Include the trailing '\0' in the copy * to keep the string terminated. */ memmove (scanner + 1, scanner + 3, length - 2); } else { /* This character must stay escaped, skip the entire * escaped sequence */ scanner += 2; } length -= 2; } else if (*scanner > 127 || uri_character_kind [*scanner] == DELIMITERS || uri_character_kind [*scanner] == UNWISE || uri_character_kind [*scanner] == CONTROL) { /* It is illegal for this character to be in an un-escaped form * in the uri. */ return; } } } static int hex_to_int (gchar c) { return c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 : c >= 'a' && c <= 'f' ? c - 'a' + 10 : -1; } static int unescape_character (const char *scanner) { int first_digit; int second_digit; first_digit = hex_to_int (*scanner++); if (first_digit < 0) { return -1; } second_digit = hex_to_int (*scanner++); if (second_digit < 0) { return -1; } return (first_digit << 4) | second_digit; } /* * gnome_vfs_unescape_string: * @escaped_string: an escaped uri, path, or other string. * @illegal_characters: a string containing a sequence of characters * considered "illegal" to be escaped, '\0' is automatically in this list. * * Decodes escaped characters (i.e. PERCENTxx sequences) in @escaped_string. * Characters are encoded in PERCENTxy form, where xy is the ASCII hex code * for character 16x+y. * * Return value: a newly allocated string with the unescaped * equivalents, or %NULL if @escaped_string contained an escaped * encoding of one of the characters in @illegal_characters. */ static char * gnome_vfs_unescape_string (const gchar *escaped_string, const gchar *illegal_characters) { const gchar *in; gchar *out, *result; gint character; if (escaped_string == NULL) { return NULL; } result = g_malloc (strlen (escaped_string) + 1); out = result; for (in = escaped_string; *in != '\0'; in++) { character = *in; if (*in == HEX_ESCAPE) { character = unescape_character (in + 1); /* Check for an illegal character. We consider '\0' illegal here. */ if (character <= 0 || (illegal_characters != NULL && strchr (illegal_characters, (char)character) != NULL)) { g_free (result); return NULL; } in += 2; } *out++ = (char)character; } *out = '\0'; g_assert (out - result <= strlen (escaped_string)); return result; } static void set_uri_element (NAGnomeVFSURI *vfs, const gchar *text, guint len) { char *escaped_text; if (text == NULL || len == 0) { vfs->path = g_strdup ("/"); return; } if ( text[0] == '/' && text[1] == '/') { vfs->path = split_toplevel_uri (text + 2, len - 2, &vfs->host_name, &vfs->user_name, &vfs->host_port, &vfs->password); } else { vfs->path = g_strndup (text, len); } /* FIXME: this should be handled/supported by the specific method. * This is a quick and dirty hack to minimize the amount of changes * right before a milestone release. * * Do some method specific escaping. This for instance converts * '?' to %3F in every method except "http" where it has a special * meaning. */ if ( ! (strcmp (vfs->scheme, "http") == 0 || strcmp (vfs->scheme, "https") == 0 || strcmp (vfs->scheme, "dav") == 0 || strcmp (vfs->scheme, "davs") == 0 || strcmp (vfs->scheme, "ghelp") == 0 || strcmp (vfs->scheme, "gnome-help") == 0 || strcmp (vfs->scheme, "help") == 0 )) { escaped_text = gnome_vfs_escape_set (vfs->path, ";?&=+$,"); g_free (vfs->path); vfs->path = escaped_text; } gnome_vfs_remove_optional_escapes (vfs->path); gnome_vfs_canonicalize_pathname (vfs->path); } /* split_toplevel_uri Extract hostname and username from "path" with length "path_len" examples: sunsite.unc.edu/pub/linux miguel@sphinx.nuclecu.unam.mx/c/nc tsx-11.mit.edu:8192/ joe@foo.edu:11321/private joe:password@foo.se This function implements the following regexp: (whitespace for clarity) ( ( ([^:@/]*) (:[^@/]*)? @ )? ([^/:]*) (:([0-9]*)?) )? (/.*)? ( ( ( user ) ( pw )? )? (host) (port)? )? (path )? It returns NULL if neither nor could be matched. port is checked to ensure that it does not exceed 0xffff. return value is or is "/" if the path portion is not present All other arguments are set to 0 or NULL if their portions are not present pedantic: this function ends up doing an unbounded lookahead, making it potentially O(n^2) instead of O(n). This could be avoided. Realistically, though, its just the password field. Differences between the old and the new implemention: Old New localhost:8080 host="localhost:8080" host="localhost" port=8080 /Users/mikef host="" host=NULL */ #define URI_MOVE_PAST_DELIMITER \ do { \ cur_tok_start = (++cur); \ if (path_end == cur) { \ success = FALSE; \ goto done; \ } \ } while (0); #define uri_strlen_to(from, to) ( (to) - (from) ) #define uri_strdup_to(from, to) g_strndup ((from), uri_strlen_to((from), (to))) typedef struct { const char *chrs; gboolean primed; char bv[32]; } UriStrspnSet; static UriStrspnSet uri_strspn_sets[] = { {":@]" GNOME_VFS_URI_PATH_STR, FALSE, ""}, {"@" GNOME_VFS_URI_PATH_STR, FALSE, ""}, {":" GNOME_VFS_URI_PATH_STR, FALSE, ""}, {"]" GNOME_VFS_URI_PATH_STR, FALSE, ""} }; #define URI_DELIMITER_ALL_SET (uri_strspn_sets + 0) #define URI_DELIMITER_USER_SET (uri_strspn_sets + 1) #define URI_DELIMITER_HOST_SET (uri_strspn_sets + 2) #define URI_DELIMITER_IPV6_SET (uri_strspn_sets + 3) #define BV_SET(bv, idx) (bv)[((guchar)(idx))>>3] |= (1 << ( (idx) & 7) ) #define BV_IS_SET(bv, idx) ((bv)[((guchar)(idx))>>3] & (1 << ( (idx) & 7))) static const char * uri_strspn_to(const char *str, UriStrspnSet *set, const char *path_end) { const char *cur; const char *cur_chr; if (!set->primed) { memset (set->bv, 0, sizeof(set->bv)); for (cur_chr = set->chrs; '\0' != *cur_chr; cur_chr++) { BV_SET (set->bv, *cur_chr); } BV_SET (set->bv, '\0'); set->primed = TRUE; } for (cur = str; cur < path_end && ! BV_IS_SET (set->bv, *cur); cur++) ; if (cur >= path_end || '\0' == *cur) { return NULL; } return cur; } static gchar * split_toplevel_uri (const gchar *path, guint path_len, gchar **host_return, gchar **user_return, guint *port_return, gchar **password_return) { const char *path_end; const char *cur_tok_start; const char *cur; const char *next_delimiter; char *ret; char *host; gboolean success; g_assert (host_return != NULL); g_assert (user_return != NULL); g_assert (port_return != NULL); g_assert (password_return != NULL); *host_return = NULL; *user_return = NULL; *port_return = 0; *password_return = NULL; ret = NULL; success = FALSE; if (path == NULL || path_len == 0) { return g_strdup ("/"); } path_end = path + path_len; cur_tok_start = path; cur = uri_strspn_to (cur_tok_start, URI_DELIMITER_ALL_SET, path_end); if (cur != NULL) { const char *tmp; if (*cur == ':') { /* This ':' belongs to username or IPv6 address.*/ tmp = uri_strspn_to (cur_tok_start, URI_DELIMITER_USER_SET, path_end); if (tmp == NULL || *tmp != '@') { tmp = uri_strspn_to (cur_tok_start, URI_DELIMITER_IPV6_SET, path_end); if (tmp != NULL && *tmp == ']') { cur = tmp; } } } } if (cur != NULL) { /* Check for IPv6 address. */ if (*cur == ']') { /* No username:password in the URI */ /* cur points to ']' */ cur = uri_strspn_to (cur, URI_DELIMITER_HOST_SET, path_end); } } if (cur != NULL) { next_delimiter = uri_strspn_to (cur, URI_DELIMITER_USER_SET, path_end); } else { next_delimiter = NULL; } if (cur != NULL && (*cur == '@' || (next_delimiter != NULL && *next_delimiter != '/' ))) { /* *cur == ':' or '@' and string contains a @ before a / */ if (uri_strlen_to (cur_tok_start, cur) > 0) { char *tmp; tmp = uri_strdup_to (cur_tok_start,cur); *user_return = gnome_vfs_unescape_string (tmp, NULL); g_free (tmp); } if (*cur == ':') { URI_MOVE_PAST_DELIMITER; cur = uri_strspn_to(cur_tok_start, URI_DELIMITER_USER_SET, path_end); if (cur == NULL || *cur != '@') { success = FALSE; goto done; } else if (uri_strlen_to (cur_tok_start, cur) > 0) { char *tmp; tmp = uri_strdup_to (cur_tok_start,cur); *password_return = gnome_vfs_unescape_string (tmp, NULL); g_free (tmp); } } if (*cur != '/') { URI_MOVE_PAST_DELIMITER; /* Move cur to point to ':' after ']' */ cur = uri_strspn_to (cur_tok_start, URI_DELIMITER_IPV6_SET, path_end); if (cur != NULL && *cur == ']') { /* For IPv6 address */ cur = uri_strspn_to (cur, URI_DELIMITER_HOST_SET, path_end); } else { cur = uri_strspn_to (cur_tok_start, URI_DELIMITER_HOST_SET, path_end); } } else { cur_tok_start = cur; } } if (cur == NULL) { /* [^:/]+$ */ if (uri_strlen_to (cur_tok_start, path_end) > 0) { *host_return = uri_strdup_to (cur_tok_start, path_end); if (*(path_end - 1) == GNOME_VFS_URI_PATH_CHR) { ret = g_strdup (GNOME_VFS_URI_PATH_STR); } else { ret = g_strdup (""); } success = TRUE; } else { /* No host, no path */ success = FALSE; } goto done; } else if (*cur == ':') { guint port; /* [^:/]*:.* */ if (uri_strlen_to (cur_tok_start, cur) > 0) { *host_return = uri_strdup_to (cur_tok_start, cur); } else { success = FALSE; goto done; /*No host but a port?*/ } URI_MOVE_PAST_DELIMITER; port = 0; for ( ; cur < path_end && g_ascii_isdigit (*cur); cur++) { port *= 10; port += *cur - '0'; } /* We let :(/.*)$ be treated gracefully */ if (*cur != '\0' && *cur != GNOME_VFS_URI_PATH_CHR) { success = FALSE; goto done; /* ...but this would be an error */ } if (port > 0xffff) { success = FALSE; goto done; } *port_return = port; cur_tok_start = cur; } else /* GNOME_VFS_URI_PATH_CHR == *cur */ { /* ^[^:@/]+/.*$ */ if (uri_strlen_to (cur_tok_start, cur) > 0) { *host_return = uri_strdup_to (cur_tok_start, cur); } cur_tok_start = cur; } if (*cur_tok_start != '\0' && uri_strlen_to (cur_tok_start, path_end) > 0) { ret = uri_strdup_to(cur, path_end); } else if (*host_return != NULL) { ret = g_strdup (GNOME_VFS_URI_PATH_STR); } success = TRUE; done: if (*host_return != NULL) { /* Check for an IPv6 address in square brackets.*/ if (strchr (*host_return, '[') && strchr (*host_return, ']') && strchr (*host_return, ':')) { /* Extract the IPv6 address from square braced string. */ host = g_ascii_strdown ((*host_return) + 1, strlen (*host_return) - 2); } else { host = g_ascii_strdown (*host_return, -1); } g_free (*host_return); *host_return = host; } /* If we didn't complete our mission, discard all the partials */ if (!success) { g_free (*host_return); g_free (*user_return); g_free (*password_return); g_free (ret); *host_return = NULL; *user_return = NULL; *port_return = 0; *password_return = NULL; ret = NULL; } return ret; } nautilus-actions-3.2.3/src/core/na-settings.h0000644000175100017500000002046012215126312016064 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu modules. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_SETTINGS_H__ #define __CORE_NA_SETTINGS_H__ /* @title: NASettings * @short_description: The Settings Class Definition * @include: core/na-settings.h * * The #NASettings class manages users preferences. * * Actual configuration may come from two sources: * - a global configuration, which apply to all users, as read-only * parameters; * - a per-user configuration. * * The configuration is implemented as keyed files: * - global configuration is sysconfdir/xdg/nautilus-actions/nautilus-actions.conf * - per-user configuration is HOME/.config/nautilus-actions/nautilus-actions.conf * * Each setting may so have its own read-only attribute, whether it * has been read from the global configuration or from the * per-user one. * * NASettings class monitors the whole configuration. * A client may be informed of a modification of the value of a key either by * pre-registering a callback on this key (see na_settings_register_key_callback() * function), or by connecting to and filtering the notification signal. * * #NASettings class defines a singleton object, which allocates itself * when needed */ #include G_BEGIN_DECLS /* This is a composite key; * by registering a callback on this key, a client may be informed of any * modification regarding the readability status of the i/o providers. */ #define NA_IPREFS_IO_PROVIDERS_READ_STATUS "io-providers-read-status-composite-key" /* other keys, mainly user preferences */ #define NA_IPREFS_ADMIN_PREFERENCES_LOCKED "preferences-locked" #define NA_IPREFS_ADMIN_IO_PROVIDERS_LOCKED "io-providers-locked" #define NA_IPREFS_ASSISTANT_ESC_CONFIRM "assistant-esc-confirm" #define NA_IPREFS_ASSISTANT_ESC_QUIT "assistant-esc-quit" #define NA_IPREFS_CAPABILITY_ADD_CAPABILITY_WSP "capability-add-capability-wsp" #define NA_IPREFS_COMMAND_CHOOSER_WSP "command-command-chooser-wsp" #define NA_IPREFS_COMMAND_CHOOSER_URI "command-command-chooser-lfu" #define NA_IPREFS_COMMAND_LEGEND_WSP "command-legend-wsp" #define NA_IPREFS_DESKTOP_ENVIRONMENT "desktop-environment" #define NA_IPREFS_CONFIRM_LOGOUT_WSP "confirm-logout-wsp" #define NA_IPREFS_WORKING_DIR_WSP "command-working-dir-chooser-wsp" #define NA_IPREFS_WORKING_DIR_URI "command-working-dir-chooser-lfu" #define NA_IPREFS_SHOW_IF_RUNNING_WSP "environment-show-if-running-wsp" #define NA_IPREFS_SHOW_IF_RUNNING_URI "environment-show-if-running-lfu" #define NA_IPREFS_TRY_EXEC_WSP "environment-try-exec-wsp" #define NA_IPREFS_TRY_EXEC_URI "environment-try-exec-lfu" #define NA_IPREFS_EXPORT_ASK_USER_WSP "export-ask-user-wsp" #define NA_IPREFS_EXPORT_ASK_USER_LAST_FORMAT "export-ask-user-last-format" #define NA_IPREFS_EXPORT_ASK_USER_KEEP_LAST_CHOICE "export-ask-user-keep-last-choice" #define NA_IPREFS_EXPORT_ASSISTANT_WSP "export-assistant-wsp" #define NA_IPREFS_EXPORT_ASSISTANT_URI "export-assistant-lfu" #define NA_IPREFS_EXPORT_ASSISTANT_PANED "export-assistant-paned-width" #define NA_IPREFS_EXPORT_PREFERRED_FORMAT "export-preferred-format" #define NA_IPREFS_FOLDER_CHOOSER_WSP "folder-chooser-wsp" #define NA_IPREFS_FOLDER_CHOOSER_URI "folder-chooser-lfu" #define NA_IPREFS_IMPORT_ASK_USER_WSP "import-ask-user-wsp" #define NA_IPREFS_IMPORT_ASK_USER_LAST_MODE "import-ask-user-last-mode" #define NA_IPREFS_IMPORT_ASSISTANT_WSP "import-assistant-wsp" #define NA_IPREFS_IMPORT_ASSISTANT_URI "import-assistant-lfu" #define NA_IPREFS_IMPORT_ASK_USER_KEEP_LAST_CHOICE "import-ask-user-keep-last-choice" #define NA_IPREFS_IMPORT_PREFERRED_MODE "import-preferred-mode" #define NA_IPREFS_ICON_CHOOSER_URI "item-icon-chooser-lfu" #define NA_IPREFS_ICON_CHOOSER_PANED "item-icon-chooser-paned-width" #define NA_IPREFS_ICON_CHOOSER_WSP "item-icon-chooser-wsp" #define NA_IPREFS_IO_PROVIDERS_WRITE_ORDER "io-providers-write-order" #define NA_IPREFS_ITEMS_ADD_ABOUT_ITEM "items-add-about-item" #define NA_IPREFS_ITEMS_CREATE_ROOT_MENU "items-create-root-menu" #define NA_IPREFS_ITEMS_LEVEL_ZERO_ORDER "items-level-zero-order" #define NA_IPREFS_ITEMS_LIST_ORDER_MODE "items-list-order-mode" #define NA_IPREFS_MAIN_PANED "main-paned-width" #define NA_IPREFS_MAIN_SAVE_AUTO "main-save-auto" #define NA_IPREFS_MAIN_SAVE_PERIOD "main-save-period" #define NA_IPREFS_MAIN_TABS_POS "main-tabs-pos" #define NA_IPREFS_MAIN_TOOLBAR_EDIT_DISPLAY "main-toolbar-edit-display" #define NA_IPREFS_MAIN_TOOLBAR_FILE_DISPLAY "main-toolbar-file-display" #define NA_IPREFS_MAIN_TOOLBAR_HELP_DISPLAY "main-toolbar-help-display" #define NA_IPREFS_MAIN_TOOLBAR_TOOLS_DISPLAY "main-toolbar-tools-display" #define NA_IPREFS_MAIN_WINDOW_WSP "main-window-wsp" #define NA_IPREFS_PREFERENCES_WSP "preferences-wsp" #define NA_IPREFS_PLUGIN_MENU_LOG "plugin-menu-log-enabled" #define NA_IPREFS_RELABEL_DUPLICATE_ACTION "relabel-when-duplicate-action" #define NA_IPREFS_RELABEL_DUPLICATE_MENU "relabel-when-duplicate-menu" #define NA_IPREFS_RELABEL_DUPLICATE_PROFILE "relabel-when-duplicate-profile" #define NA_IPREFS_SCHEME_ADD_SCHEME_WSP "scheme-add-scheme-wsp" #define NA_IPREFS_SCHEME_DEFAULT_LIST "scheme-default-list" #define NA_IPREFS_TERMINAL_PATTERN "terminal-pattern" #define NA_IPREFS_IO_PROVIDER_GROUP "io-provider" #define NA_IPREFS_IO_PROVIDER_READABLE "readable" #define NA_IPREFS_IO_PROVIDER_WRITABLE "writable" /* pre-registration of a callback */ typedef void ( *NASettingsKeyCallback )( const gchar *group, const gchar *key, gconstpointer new_value, gboolean mandatory, void *user_data ); void na_settings_register_key_callback( const gchar *key, GCallback callback, gpointer user_data ); /* signal sent when the value of a key changes */ #define SETTINGS_SIGNAL_KEY_CHANGED "settings-key-changed" void na_settings_free ( void ); gboolean na_settings_get_boolean ( const gchar *key, gboolean *found, gboolean *mandatory ); gboolean na_settings_get_boolean_ex ( const gchar *group, const gchar *key, gboolean *found, gboolean *mandatory ); gchar *na_settings_get_string ( const gchar *key, gboolean *found, gboolean *mandatory ); GSList *na_settings_get_string_list ( const gchar *key, gboolean *found, gboolean *mandatory ); guint na_settings_get_uint ( const gchar *key, gboolean *found, gboolean *mandatory ); GList *na_settings_get_uint_list ( const gchar *key, gboolean *found, gboolean *mandatory ); gboolean na_settings_set_boolean ( const gchar *key, gboolean value ); gboolean na_settings_set_boolean_ex ( const gchar *group, const gchar *key, gboolean value ); gboolean na_settings_set_string ( const gchar *key, const gchar *value ); gboolean na_settings_set_string_ex ( const gchar *group, const gchar *key, const gchar *value ); gboolean na_settings_set_string_list ( const gchar *key, const GSList *value ); gboolean na_settings_set_int_ex ( const gchar *group, const gchar *key, int value ); gboolean na_settings_set_uint ( const gchar *key, guint value ); gboolean na_settings_set_uint_list ( const gchar *key, const GList *value ); GSList *na_settings_get_groups ( void ); G_END_DECLS #endif /* __CORE_NA_SETTINGS_H__ */ nautilus-actions-3.2.3/src/core/na-updater.h0000644000175100017500000000671012212601376015677 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu pivots. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_UPDATER_H__ #define __CORE_NA_UPDATER_H__ /* @title: NAUpdater * @short_description: The #NAUpdater Class Definition * @include: core/na-updater.h * * #NAUpdater is a #NAPivot-derived class which allows its clients * to update actions and menus. */ #include "na-pivot.h" G_BEGIN_DECLS #define NA_TYPE_UPDATER ( na_updater_get_type()) #define NA_UPDATER( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_UPDATER, NAUpdater )) #define NA_UPDATER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_UPDATER, NAUpdaterClass )) #define NA_IS_UPDATER( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_UPDATER )) #define NA_IS_UPDATER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_UPDATER )) #define NA_UPDATER_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_UPDATER, NAUpdaterClass )) typedef struct _NAUpdaterPrivate NAUpdaterPrivate; typedef struct { /*< private >*/ NAPivot parent; NAUpdaterPrivate *private; } NAUpdater; typedef struct _NAUpdaterClassPrivate NAUpdaterClassPrivate; typedef struct { /*< private >*/ NAPivotClass parent; NAUpdaterClassPrivate *private; } NAUpdaterClass; GType na_updater_get_type( void ); NAUpdater *na_updater_new( void ); /* writability status */ void na_updater_check_item_writability_status( const NAUpdater *updater, const NAObjectItem *item ); gboolean na_updater_are_preferences_locked ( const NAUpdater *updater ); gboolean na_updater_is_level_zero_writable ( const NAUpdater *updater ); /* update the tree in memory */ void na_updater_append_item( NAUpdater *updater, NAObjectItem *item ); void na_updater_insert_item( NAUpdater *updater, NAObjectItem *item, const gchar *parent_id, gint pos ); void na_updater_remove_item( NAUpdater *updater, NAObject *item ); gboolean na_updater_should_pasted_be_relabeled( const NAUpdater *updater, const NAObject *item ); /* read from / write to the physical storage subsystem */ GList *na_updater_load_items ( NAUpdater *updater ); guint na_updater_write_item ( const NAUpdater *updater, NAObjectItem *item, GSList **messages ); guint na_updater_delete_item( const NAUpdater *updater, const NAObjectItem *item, GSList **messages ); G_END_DECLS #endif /* __CORE_NA_UPDATER_H__ */ nautilus-actions-3.2.3/src/core/Makefile.in0000644000175100017500000011025412220365303015526 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/core DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" \ "$(DESTDIR)$(exportformat_datadir)" \ "$(DESTDIR)$(importmode_datadir)" "$(DESTDIR)$(ui_datadir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = libna_core_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = na-marshal.lo am_libna_core_la_OBJECTS = na-about.lo na-boxed.lo na-core-utils.lo \ na-data-boxed.lo na-data-def.lo na-data-types.lo \ na-desktop-environment.lo na-exporter.lo na-export-format.lo \ na-factory-object.lo na-factory-provider.lo \ na-gconf-migration.lo na-gconf-monitor.lo na-gconf-utils.lo \ na-gnome-vfs-uri.lo na-gtk-utils.lo na-icontext.lo \ na-icontext-factory.lo na-iduplicable.lo na-iexporter.lo \ na-ifactory-object.lo na-ifactory-provider.lo na-iimporter.lo \ na-iio-provider.lo na-import-mode.lo na-importer.lo \ na-importer-ask.lo na-io-provider.lo na-ioption.lo \ na-ioptions-list.lo na-iprefs.lo na-module.lo na-object.lo \ na-object-id.lo na-object-id-factory.lo na-object-item.lo \ na-object-item-factory.lo na-object-action.lo \ na-object-action-factory.lo na-object-profile.lo \ na-object-profile-factory.lo na-object-menu.lo \ na-object-menu-factory.lo na-pivot.lo na-selected-info.lo \ na-settings.lo na-timeout.lo na-tokens.lo na-updater.lo \ $(am__objects_1) libna_core_la_OBJECTS = $(am_libna_core_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libna_core_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libna_core_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libna_core_la_SOURCES) DIST_SOURCES = $(libna_core_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(exportformat_data_DATA) $(importmode_data_DATA) \ $(ui_data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ -I $(top_srcdir) -I $(top_srcdir)/src \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ -DPKGLIBDIR=\""$(pkglibdir)"\" \ -DPKGLIBEXECDIR=\""$(pkglibexecdir)"\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_CORE}\" \ -DPKGEXPORTFORMATDIR=\"$(exportformat_datadir)\" \ -DPKGIMPORTMODEDIR=\"$(importmode_datadir)\" \ -DPKGUIDIR=\"$(ui_datadir)\" $(NAUTILUS_ACTIONS_CFLAGS) \ $(NULL) AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ pkglib_LTLIBRARIES = libna-core.la exportformat_datadir = $(pkgdatadir)/export-format importmode_datadir = $(pkgdatadir)/import-mode ui_datadir = $(pkgdatadir)/ui BUILT_SOURCES = \ na-marshal.c \ na-marshal.h \ $(NULL) libna_core_la_SOURCES = \ na-about.c \ na-about.h \ na-boxed.c \ na-core-utils.c \ na-data-boxed.c \ na-data-def.c \ na-data-types.c \ na-desktop-environment.c \ na-desktop-environment.h \ na-exporter.c \ na-exporter.h \ na-export-format.c \ na-export-format.h \ na-factory-object.c \ na-factory-object.h \ na-factory-provider.c \ na-factory-provider.h \ na-gconf-migration.c \ na-gconf-migration.h \ na-gconf-monitor.c \ na-gconf-utils.c \ na-gnome-vfs-uri.c \ na-gnome-vfs-uri.h \ na-gtk-utils.c \ na-gtk-utils.h \ na-icontext.c \ na-icontext-factory.c \ na-iduplicable.c \ na-iexporter.c \ na-ifactory-object.c \ na-ifactory-provider.c \ na-iimporter.c \ na-iio-provider.c \ na-import-mode.c \ na-import-mode.h \ na-importer.c \ na-importer.h \ na-importer-ask.c \ na-importer-ask.h \ na-io-provider.c \ na-io-provider.h \ na-ioption.c \ na-ioption.h \ na-ioptions-list.c \ na-ioptions-list.h \ na-iprefs.c \ na-iprefs.h \ na-module.c \ na-module.h \ na-object.c \ na-object-id.c \ na-object-id-factory.c \ na-object-item.c \ na-object-item-factory.c \ na-object-action.c \ na-object-action-factory.c \ na-object-profile.c \ na-object-profile-factory.c \ na-object-menu.c \ na-object-menu-factory.c \ na-pivot.c \ na-pivot.h \ na-selected-info.c \ na-selected-info.h \ na-settings.c \ na-settings.h \ na-timeout.c \ na-tokens.c \ na-tokens.h \ na-updater.c \ na-updater.h \ $(BUILT_SOURCES) \ $(NULL) libna_core_la_LIBADD = \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libna_core_la_LDFLAGS = \ -no-undefined \ -avoid-version \ -fPIC \ $(NULL) ui_data_DATA = \ na-importer-ask.ui \ $(NULL) exportformat_data_DATA = \ export-format-ask.png \ $(NULL) importmode_data_DATA = \ import-mode-ask.png \ import-mode-no-import.png \ import-mode-override.png \ import-mode-renumber.png \ $(NULL) CLEANFILES = \ $(BUILT_SOURCES) \ $(NULL) EXTRA_DIST = \ $(ui_data_DATA) \ $(exportformat_data_DATA) \ $(importmode_data_DATA) \ na-marshal.def \ $(NULL) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/core/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/core/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libna-core.la: $(libna_core_la_OBJECTS) $(libna_core_la_DEPENDENCIES) $(EXTRA_libna_core_la_DEPENDENCIES) $(AM_V_CCLD)$(libna_core_la_LINK) -rpath $(pkglibdir) $(libna_core_la_OBJECTS) $(libna_core_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-about.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-boxed.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-core-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-data-boxed.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-data-def.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-data-types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-desktop-environment.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-export-format.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-exporter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-factory-object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-factory-provider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-gconf-migration.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-gconf-monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-gconf-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-gnome-vfs-uri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-gtk-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-icontext-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-icontext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-iduplicable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-iexporter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-ifactory-object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-ifactory-provider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-iimporter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-iio-provider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-import-mode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-importer-ask.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-importer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-io-provider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-ioption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-ioptions-list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-iprefs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-marshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object-action-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object-action.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object-id-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object-id.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object-item-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object-item.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object-menu-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object-menu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object-profile-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object-profile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-pivot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-selected-info.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-settings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-timeout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-tokens.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/na-updater.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-exportformat_dataDATA: $(exportformat_data_DATA) @$(NORMAL_INSTALL) @list='$(exportformat_data_DATA)'; test -n "$(exportformat_datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(exportformat_datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(exportformat_datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(exportformat_datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(exportformat_datadir)" || exit $$?; \ done uninstall-exportformat_dataDATA: @$(NORMAL_UNINSTALL) @list='$(exportformat_data_DATA)'; test -n "$(exportformat_datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(exportformat_datadir)'; $(am__uninstall_files_from_dir) install-importmode_dataDATA: $(importmode_data_DATA) @$(NORMAL_INSTALL) @list='$(importmode_data_DATA)'; test -n "$(importmode_datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(importmode_datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(importmode_datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(importmode_datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(importmode_datadir)" || exit $$?; \ done uninstall-importmode_dataDATA: @$(NORMAL_UNINSTALL) @list='$(importmode_data_DATA)'; test -n "$(importmode_datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(importmode_datadir)'; $(am__uninstall_files_from_dir) install-ui_dataDATA: $(ui_data_DATA) @$(NORMAL_INSTALL) @list='$(ui_data_DATA)'; test -n "$(ui_datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ui_datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ui_datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ui_datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ui_datadir)" || exit $$?; \ done uninstall-ui_dataDATA: @$(NORMAL_UNINSTALL) @list='$(ui_data_DATA)'; test -n "$(ui_datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ui_datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(exportformat_datadir)" "$(DESTDIR)$(importmode_datadir)" "$(DESTDIR)$(ui_datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-exportformat_dataDATA \ install-importmode_dataDATA install-ui_dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-exportformat_dataDATA \ uninstall-importmode_dataDATA uninstall-pkglibLTLIBRARIES \ uninstall-ui_dataDATA .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exportformat_dataDATA install-html \ install-html-am install-importmode_dataDATA install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ install-strip install-ui_dataDATA installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-exportformat_dataDATA \ uninstall-importmode_dataDATA uninstall-pkglibLTLIBRARIES \ uninstall-ui_dataDATA na-marshal.h: na-marshal.def $(GLIB_GENMARSHAL) $(GLIB_GENMARSHAL) $< --header --prefix=na_cclosure_marshal > $@ na-marshal.c: na-marshal.def $(GLIB_GENMARSHAL) echo "#include \"na-marshal.h\"" > $@ $(GLIB_GENMARSHAL) $< --body --prefix=na_cclosure_marshal >> $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/src/core/na-gtk-utils.c0000644000175100017500000003354212216632107016154 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "na-gtk-utils.h" #include "na-settings.h" static void int_list_to_position( GList *list, gint *x, gint *y, gint *width, gint *height ); static GList *position_to_int_list( gint x, gint y, gint width, gint height ); static void free_int_list( GList *list ); /* * na_gtk_utils_find_widget_by_name: * @container: a #GtkContainer, usually the #GtkWindow toplevel. * @name: the name of the searched widget. * * Returns: the searched widget. */ GtkWidget * na_gtk_utils_find_widget_by_name( GtkContainer *container, const gchar *name ) { GList *children = gtk_container_get_children( container ); GList *ic; GtkWidget *found = NULL; GtkWidget *child; const gchar *child_name; for( ic = children ; ic && !found ; ic = ic->next ){ if( GTK_IS_WIDGET( ic->data )){ child = GTK_WIDGET( ic->data ); child_name = gtk_buildable_get_name( GTK_BUILDABLE( child )); if( child_name && strlen( child_name ) && !g_ascii_strcasecmp( name, child_name )){ found = child; break; } if( GTK_IS_CONTAINER( child )){ found = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( child ), name ); } } } g_list_free( children ); return( found ); } #ifdef NA_MAINTAINER_MODE static void dump_children( const gchar *thisfn, GtkContainer *container, int level ) { GList *children = gtk_container_get_children( container ); GList *ic; GtkWidget *child; const gchar *child_name; GString *prefix; int i; prefix = g_string_new( "" ); for( i = 0 ; i <= level ; ++i ){ g_string_append_printf( prefix, "%s", "| " ); } for( ic = children ; ic ; ic = ic->next ){ if( GTK_IS_WIDGET( ic->data )){ child = GTK_WIDGET( ic->data ); child_name = gtk_buildable_get_name( GTK_BUILDABLE( child )); g_debug( "%s: %s%s\t%p %s", thisfn, prefix->str, G_OBJECT_TYPE_NAME( child ), ( void * ) child, child_name ); if( GTK_IS_CONTAINER( child )){ dump_children( thisfn, GTK_CONTAINER( child ), level+1 ); } } } g_list_free( children ); g_string_free( prefix, TRUE ); } void na_gtk_utils_dump_children( GtkContainer *container ) { static const gchar *thisfn = "na_gtk_utils_dump_children"; g_debug( "%s: container=%p", thisfn, container ); dump_children( thisfn, container, 0 ); } #endif /** * na_gtk_utils_restore_position_window: * @toplevel: the #GtkWindow window. * @wsp_name: the string which handles the window size and position in user preferences. * * Position the specified window on the screen. * * A window position is stored as a list of integers "x,y,width,height". */ void na_gtk_utils_restore_window_position( GtkWindow *toplevel, const gchar *wsp_name ) { static const gchar *thisfn = "na_gtk_utils_restore_window_position"; GList *list; gint x=0, y=0, width=0, height=0; GdkDisplay *display; GdkScreen *screen; gint screen_width, screen_height; g_return_if_fail( GTK_IS_WINDOW( toplevel )); g_return_if_fail( wsp_name && strlen( wsp_name )); g_debug( "%s: toplevel=%p (%s), wsp_name=%s", thisfn, ( void * ) toplevel, G_OBJECT_TYPE_NAME( toplevel ), wsp_name ); list = na_settings_get_uint_list( wsp_name, NULL, NULL ); if( list ){ int_list_to_position( list, &x, &y, &width, &height ); g_debug( "%s: wsp_name=%s, x=%d, y=%d, width=%d, height=%d", thisfn, wsp_name, x, y, width, height ); free_int_list( list ); } x = MAX( 1, x ); y = MAX( 1, y ); width = MAX( 1, width ); height = MAX( 1, height ); /* bad hack for the first time we open the main window * try to target an ideal size and position */ if( !strcmp( wsp_name, NA_IPREFS_MAIN_WINDOW_WSP )){ if( x == 1 && y == 1 && width == 1 && height == 1 ){ x = 50; y = 70; width = 1030; height = 560; } else { display = gdk_display_get_default(); screen = gdk_display_get_screen( display, 0 ); screen_width = gdk_screen_get_width( screen ); screen_height = gdk_screen_get_height( screen ); g_debug( "%s: screen=(%d,%d), DEFAULT_HEIGHT=%d", thisfn, screen_width, screen_height, DEFAULT_HEIGHT ); screen_height -= 2*DEFAULT_HEIGHT; width = MIN( width, screen_width-x ); height = MIN( height, screen_height-y ); } } g_debug( "%s: wsp_name=%s, x=%d, y=%d, width=%d, height=%d", thisfn, wsp_name, x, y, width, height ); gtk_window_move( toplevel, x, y ); gtk_window_resize( toplevel, width, height ); } /** * na_gtk_utils_save_window_position: * @toplevel: the #GtkWindow window. * @wsp_name: the string which handles the window size and position in user preferences. * * Save the size and position of the specified window. */ void na_gtk_utils_save_window_position( GtkWindow *toplevel, const gchar *wsp_name ) { static const gchar *thisfn = "na_gtk_utils_save_window_position"; gint x, y, width, height; GList *list; g_return_if_fail( GTK_IS_WINDOW( toplevel )); g_return_if_fail( wsp_name && strlen( wsp_name )); gtk_window_get_position( toplevel, &x, &y ); gtk_window_get_size( toplevel, &width, &height ); g_debug( "%s: wsp_name=%s, x=%d, y=%d, width=%d, height=%d", thisfn, wsp_name, x, y, width, height ); list = position_to_int_list( x, y, width, height ); na_settings_set_uint_list( wsp_name, list ); free_int_list( list ); } /* * extract the position of the window from the list of unsigned integers */ static void int_list_to_position( GList *list, gint *x, gint *y, gint *width, gint *height ) { GList *it; int i; g_assert( x ); g_assert( y ); g_assert( width ); g_assert( height ); for( it=list, i=0 ; it ; it=it->next, i+=1 ){ switch( i ){ case 0: *x = GPOINTER_TO_UINT( it->data ); break; case 1: *y = GPOINTER_TO_UINT( it->data ); break; case 2: *width = GPOINTER_TO_UINT( it->data ); break; case 3: *height = GPOINTER_TO_UINT( it->data ); break; } } } static GList * position_to_int_list( gint x, gint y, gint width, gint height ) { GList *list = NULL; list = g_list_append( list, GUINT_TO_POINTER( x )); list = g_list_append( list, GUINT_TO_POINTER( y )); list = g_list_append( list, GUINT_TO_POINTER( width )); list = g_list_append( list, GUINT_TO_POINTER( height )); return( list ); } /* * free the list of int */ static void free_int_list( GList *list ) { g_list_free( list ); } /** * na_gtk_utils_set_editable: * @widget: the #GtkWdiget. * @editable: whether the @widget is editable or not. * * Try to set a visual indication of whether the @widget is editable or not. * * Having a GtkWidget should be enough, but we also deal with a GtkTreeViewColumn. * So the most-bottom common ancestor is just GObject (since GtkObject having been * deprecated in Gtk+-3.0) * * Note that using 'sensitivity' property is just a work-around because the * two things have distinct semantics: * - editable: whether we are allowed to modify the value (is not read-only) * - sensitive: whether the value is relevant (has a sense in this context) */ void na_gtk_utils_set_editable( GObject *widget, gboolean editable ) { GList *renderers, *irender; /* GtkComboBoxEntry is deprecated from Gtk+3 * see. http://git.gnome.org/browse/gtk+/commit/?id=9612c648176378bf237ad0e1a8c6c995b0ca7c61 * while 'has_entry' property exists since 2.24 */ #if GTK_CHECK_VERSION( 2,24,0 ) if( GTK_IS_COMBO_BOX( widget ) && gtk_combo_box_get_has_entry( GTK_COMBO_BOX( widget ))){ #else if( GTK_IS_COMBO_BOX_ENTRY( widget )){ #endif /* idem as GtkEntry */ gtk_editable_set_editable( GTK_EDITABLE( gtk_bin_get_child( GTK_BIN( widget ))), editable ); g_object_set( G_OBJECT( gtk_bin_get_child( GTK_BIN( widget ))), "can-focus", editable, NULL ); /* disable the listbox button itself */ gtk_combo_box_set_button_sensitivity( GTK_COMBO_BOX( widget ), editable ? GTK_SENSITIVITY_ON : GTK_SENSITIVITY_OFF ); } else if( GTK_IS_COMBO_BOX( widget )){ /* disable the listbox button itself */ gtk_combo_box_set_button_sensitivity( GTK_COMBO_BOX( widget ), editable ? GTK_SENSITIVITY_ON : GTK_SENSITIVITY_OFF ); } else if( GTK_IS_ENTRY( widget )){ gtk_editable_set_editable( GTK_EDITABLE( widget ), editable ); /* removing the frame leads to a disturbing modification of the * height of the control */ /*g_object_set( G_OBJECT( widget ), "has-frame", editable, NULL );*/ /* this prevents the caret to be displayed when we click in the entry */ g_object_set( G_OBJECT( widget ), "can-focus", editable, NULL ); } else if( GTK_IS_TEXT_VIEW( widget )){ g_object_set( G_OBJECT( widget ), "can-focus", editable, NULL ); gtk_text_view_set_editable( GTK_TEXT_VIEW( widget ), editable ); } else if( GTK_IS_TOGGLE_BUTTON( widget )){ /* transforms to a quasi standard GtkButton */ /*g_object_set( G_OBJECT( widget ), "draw-indicator", editable, NULL );*/ /* this at least prevent the keyboard focus to go to the button * (which is better than nothing) */ g_object_set( G_OBJECT( widget ), "can-focus", editable, NULL ); } else if( GTK_IS_TREE_VIEW_COLUMN( widget )){ renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( GTK_TREE_VIEW_COLUMN( widget ))); for( irender = renderers ; irender ; irender = irender->next ){ if( GTK_IS_CELL_RENDERER_TEXT( irender->data )){ g_object_set( G_OBJECT( irender->data ), "editable", editable, "editable-set", TRUE, NULL ); } } g_list_free( renderers ); } else if( GTK_IS_BUTTON( widget )){ gtk_widget_set_sensitive( GTK_WIDGET( widget ), editable ); } } /** * na_gtk_utils_radio_set_initial_state: * @button: the #GtkRadioButton button which is initially active. * @handler: the corresponding "toggled" handler. * @user_data: the user data associated to the handler. * @editable: whether this radio button group is editable. * @sensitive: whether this radio button group is sensitive. * * This function should be called for the button which is initially active * inside of a radio button group when the radio group may happen to not be * editable. * This function should be called only once for the radio button group. * * It does the following operations: * - set the button as active * - set other buttons of the radio button group as inactive * - set all buttons of radio button group as @editable * * The initially active @button, along with its @handler, are recorded * as properties of the radio button group (actually as properties of each * radio button of the group), so that they can later be used to reset the * initial state. */ void na_gtk_utils_radio_set_initial_state( GtkRadioButton *button, GCallback handler, void *user_data, gboolean editable, gboolean sensitive ) { GSList *group, *ig; GtkRadioButton *other; group = gtk_radio_button_get_group( button ); for( ig = group ; ig ; ig = ig->next ){ other = GTK_RADIO_BUTTON( ig->data ); g_object_set_data( G_OBJECT( other ), NA_TOGGLE_DATA_BUTTON, button ); g_object_set_data( G_OBJECT( other ), NA_TOGGLE_DATA_HANDLER, handler ); g_object_set_data( G_OBJECT( other ), NA_TOGGLE_DATA_USER_DATA, user_data ); g_object_set_data( G_OBJECT( other ), NA_TOGGLE_DATA_EDITABLE, GUINT_TO_POINTER( editable )); na_gtk_utils_set_editable( G_OBJECT( other ), editable ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( other ), FALSE ); gtk_widget_set_sensitive( GTK_WIDGET( other ), sensitive ); } gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( button ), TRUE ); } /** * na_gtk_utils_radio_reset_initial_state: * @button: the #GtkRadioButton being toggled. * @handler: the corresponding "toggled" handler. * @data: data associated with the @handler callback. * * When clicking on a read-only radio button, this function ensures that * the radio button is not modified. It may be called whether the radio * button group is editable or not (does nothing if group is actually * editable). */ void na_gtk_utils_radio_reset_initial_state( GtkRadioButton *button, GCallback handler ) { GtkToggleButton *initial_button; GCallback initial_handler; gboolean active; gboolean editable; gpointer user_data; active = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button )); editable = ( gboolean ) GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( button ), NA_TOGGLE_DATA_EDITABLE )); if( active && !editable ){ initial_button = GTK_TOGGLE_BUTTON( g_object_get_data( G_OBJECT( button ), NA_TOGGLE_DATA_BUTTON )); initial_handler = G_CALLBACK( g_object_get_data( G_OBJECT( button ), NA_TOGGLE_DATA_HANDLER )); user_data = g_object_get_data( G_OBJECT( button ), NA_TOGGLE_DATA_USER_DATA ); if( handler ){ g_signal_handlers_block_by_func(( gpointer ) button, handler, user_data ); } g_signal_handlers_block_by_func(( gpointer ) initial_button, initial_handler, user_data ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( button ), FALSE ); gtk_toggle_button_set_active( initial_button, TRUE ); g_signal_handlers_unblock_by_func(( gpointer ) initial_button, initial_handler, user_data ); if( handler ){ g_signal_handlers_unblock_by_func(( gpointer ) button, handler, user_data ); } } } nautilus-actions-3.2.3/src/core/na-boxed.c0000644000175100017500000011266112212601376015332 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include /* private class data */ struct _NABoxedClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* BoxedDef: * This is the structure which fully defines the behavior of this data type. */ typedef struct { guint type; const gchar *label; gboolean ( *are_equal ) ( const NABoxed *, const NABoxed * ); void ( *copy ) ( NABoxed *, const NABoxed * ); void ( *free ) ( NABoxed * ); void ( *from_string ) ( NABoxed *, const gchar * ); void ( *from_value ) ( NABoxed *, const GValue * ); void ( *from_void ) ( NABoxed *, const void * ); gboolean ( *to_bool ) ( const NABoxed * ); gconstpointer ( *to_pointer ) ( const NABoxed * ); gchar * ( *to_string ) ( const NABoxed * ); GSList * ( *to_string_list )( const NABoxed * ); guint ( *to_uint ) ( const NABoxed * ); GList * ( *to_uint_list ) ( const NABoxed * ); void ( *to_value ) ( const NABoxed *, GValue * ); void * ( *to_void ) ( const NABoxed * ); } BoxedDef; /* private instance data */ struct _NABoxedPrivate { gboolean dispose_has_run; const BoxedDef *def; gboolean is_set; union { gboolean boolean; void *pointer; gchar *string; GSList *string_list; guint uint; GList *uint_list; } u; }; #define LIST_SEPARATOR ";" static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NABoxedClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static NABoxed *boxed_new( const BoxedDef *def ); static const BoxedDef *get_boxed_def( guint type ); static gchar **string_to_array( const gchar *string ); static gboolean bool_are_equal( const NABoxed *a, const NABoxed *b ); static void bool_copy( NABoxed *dest, const NABoxed *src ); static void bool_free( NABoxed *boxed ); static void bool_from_string( NABoxed *boxed, const gchar *string ); static void bool_from_value( NABoxed *boxed, const GValue *value ); static void bool_from_void( NABoxed *boxed, const void *value ); static gchar *bool_to_string( const NABoxed *boxed ); static gboolean bool_to_bool( const NABoxed *boxed ); static gconstpointer bool_to_pointer( const NABoxed *boxed ); static gchar *bool_to_string( const NABoxed *boxed ); static void bool_to_value( const NABoxed *boxed, GValue *value ); static void *bool_to_void( const NABoxed *boxed ); static gboolean pointer_are_equal( const NABoxed *a, const NABoxed *b ); static void pointer_copy( NABoxed *dest, const NABoxed *src ); static void pointer_free( NABoxed *boxed ); static void pointer_from_string( NABoxed *boxed, const gchar *string ); static void pointer_from_value( NABoxed *boxed, const GValue *value ); static void pointer_from_void( NABoxed *boxed, const void *value ); static gconstpointer pointer_to_pointer( const NABoxed *boxed ); static gchar *pointer_to_string( const NABoxed *boxed ); static void pointer_to_value( const NABoxed *boxed, GValue *value ); static void *pointer_to_void( const NABoxed *boxed ); static gboolean string_are_equal( const NABoxed *a, const NABoxed *b ); static void string_copy( NABoxed *dest, const NABoxed *src ); static void string_free( NABoxed *boxed ); static void string_from_string( NABoxed *boxed, const gchar *string ); static void string_from_value( NABoxed *boxed, const GValue *value ); static void string_from_void( NABoxed *boxed, const void *value ); static gconstpointer string_to_pointer( const NABoxed *boxed ); static gchar *string_to_string( const NABoxed *boxed ); static void string_to_value( const NABoxed *boxed, GValue *value ); static void *string_to_void( const NABoxed *boxed ); static gboolean string_list_are_equal( const NABoxed *a, const NABoxed *b ); static void string_list_copy( NABoxed *dest, const NABoxed *src ); static void string_list_free( NABoxed *boxed ); static void string_list_from_string( NABoxed *boxed, const gchar *string ); static void string_list_from_value( NABoxed *boxed, const GValue *value ); static void string_list_from_void( NABoxed *boxed, const void *value ); static gconstpointer string_list_to_pointer( const NABoxed *boxed ); static gchar *string_list_to_string( const NABoxed *boxed ); static GSList *string_list_to_string_list( const NABoxed *boxed ); static void string_list_to_value( const NABoxed *boxed, GValue *value ); static void *string_list_to_void( const NABoxed *boxed ); static gboolean locale_are_equal( const NABoxed *a, const NABoxed *b ); static gboolean uint_are_equal( const NABoxed *a, const NABoxed *b ); static void uint_copy( NABoxed *dest, const NABoxed *src ); static void uint_free( NABoxed *boxed ); static void uint_from_string( NABoxed *boxed, const gchar *string ); static void uint_from_value( NABoxed *boxed, const GValue *value ); static void uint_from_void( NABoxed *boxed, const void *value ); static gconstpointer uint_to_pointer( const NABoxed *boxed ); static gchar *uint_to_string( const NABoxed *boxed ); static guint uint_to_uint( const NABoxed *boxed ); static void uint_to_value( const NABoxed *boxed, GValue *value ); static void *uint_to_void( const NABoxed *boxed ); static gboolean uint_list_are_equal( const NABoxed *a, const NABoxed *b ); static void uint_list_copy( NABoxed *dest, const NABoxed *src ); static void uint_list_free( NABoxed *boxed ); static void uint_list_from_string( NABoxed *boxed, const gchar *string ); static void uint_list_from_value( NABoxed *boxed, const GValue *value ); static void uint_list_from_void( NABoxed *boxed, const void *value ); static gconstpointer uint_list_to_pointer( const NABoxed *boxed ); static gchar *uint_list_to_string( const NABoxed *boxed ); static GList *uint_list_to_uint_list( const NABoxed *boxed ); static void uint_list_to_value( const NABoxed *boxed, GValue *value ); static void *uint_list_to_void( const NABoxed *boxed ); static BoxedDef st_boxed_def[] = { { NA_DATA_TYPE_BOOLEAN, "boolean", bool_are_equal, bool_copy, bool_free, bool_from_string, bool_from_value, bool_from_void, bool_to_bool, bool_to_pointer, bool_to_string, NULL, NULL, NULL, bool_to_value, bool_to_void }, { NA_DATA_TYPE_POINTER, "pointer", pointer_are_equal, pointer_copy, pointer_free, pointer_from_string, pointer_from_value, pointer_from_void, NULL, pointer_to_pointer, pointer_to_string, NULL, NULL, NULL, pointer_to_value, pointer_to_void }, { NA_DATA_TYPE_STRING, "string", string_are_equal, string_copy, string_free, string_from_string, string_from_value, string_from_void, NULL, /* to_bool */ string_to_pointer, string_to_string, NULL, /* to_string_list */ NULL, /* to_uint */ NULL, /* to_uint_list */ string_to_value, string_to_void }, { NA_DATA_TYPE_STRING_LIST, "string_list", string_list_are_equal, string_list_copy, string_list_free, string_list_from_string, string_list_from_value, string_list_from_void, NULL, string_list_to_pointer, string_list_to_string, string_list_to_string_list, NULL, NULL, string_list_to_value, string_list_to_void }, { NA_DATA_TYPE_LOCALE_STRING, "locale_string", locale_are_equal, string_copy, string_free, string_from_string, string_from_value, string_from_void, NULL, /* to_bool */ string_to_pointer, string_to_string, NULL, /* to_string_list */ NULL, /* to_uint */ NULL, /* to_uint_list */ string_to_value, string_to_void }, { NA_DATA_TYPE_UINT, "uint", uint_are_equal, uint_copy, uint_free, uint_from_string, uint_from_value, uint_from_void, NULL, uint_to_pointer, uint_to_string, NULL, uint_to_uint, NULL, uint_to_value, uint_to_void }, { NA_DATA_TYPE_UINT_LIST, "uint_list", uint_list_are_equal, uint_list_copy, uint_list_free, uint_list_from_string, uint_list_from_value, uint_list_from_void, NULL, uint_list_to_pointer, uint_list_to_string, NULL, NULL, uint_list_to_uint_list, uint_list_to_value, uint_list_to_void }, { 0 } }; GType na_boxed_get_type( void ) { static GType item_type = 0; if( item_type == 0 ){ item_type = register_type(); } return( item_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_boxed_register_type"; GType type; static GTypeInfo info = { sizeof( NABoxedClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NABoxed ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NABoxed", &info, 0 ); return( type ); } static void class_init( NABoxedClass *klass ) { static const gchar *thisfn = "na_boxed_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NABoxedClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_boxed_instance_init"; NABoxed *self; g_return_if_fail( NA_IS_BOXED( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_BOXED( instance ); self->private = g_new0( NABoxedPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->def = NULL; self->private->is_set = FALSE; } static void instance_dispose( GObject *object ) { NABoxed *self; g_return_if_fail( NA_IS_BOXED( object )); self = NA_BOXED( object ); if( !self->private->dispose_has_run ){ self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_boxed_instance_finalize"; NABoxed *self; g_return_if_fail( NA_IS_BOXED( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NA_BOXED( object ); if( self->private->def ){ if( self->private->def->free ){ ( *self->private->def->free )( self ); } } g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static NABoxed * boxed_new( const BoxedDef *def ) { NABoxed *boxed; boxed = g_object_new( NA_TYPE_BOXED, NULL ); boxed->private->def = def; return( boxed ); } static const BoxedDef * get_boxed_def( guint type ) { static const gchar *thisfn = "na_boxed_get_boxed_def"; BoxedDef *def; for( def = st_boxed_def ; def->type ; ++def ){ if( def->type == type ){ return(( const BoxedDef * ) def ); } } g_warning( "%s: unmanaged data type: %d", thisfn, type ); return( NULL ); } /* * converts a string to an array of strings * accepts both: * - a semi-comma-separated list of strings (the last separator, if any, is not counted) * - a comma-separated list of strings between square brackets (à la GConf) * */ static gchar ** string_to_array( const gchar *string ) { gchar *sdup; gchar **array; array = NULL; if( string && strlen( string )){ sdup = g_strstrip( g_strdup( string )); /* GConf-style string list [value,value] */ if( sdup[0] == '[' && sdup[strlen(sdup)-1] == ']' ){ sdup[0] = ' '; sdup[strlen(sdup)-1] = ' '; sdup = g_strstrip( sdup ); array = g_strsplit( sdup, ",", -1 ); /* semi-comma-separated list of strings */ } else { if( g_str_has_suffix( string, LIST_SEPARATOR )){ sdup[strlen(sdup)-1] = ' '; sdup = g_strstrip( sdup ); } array = g_strsplit( sdup, LIST_SEPARATOR, -1 ); } g_free( sdup ); } return( array ); } /** * na_boxed_set_type: * @boxed: this #NABoxed object. * @type: the required type as defined in na-data-types.h * * Set the type of the just-allocated @boxed object. * * Since: 3.1 */ void na_boxed_set_type( NABoxed *boxed, guint type ) { g_return_if_fail( NA_IS_BOXED( boxed )); g_return_if_fail( boxed->private->dispose_has_run == FALSE ); g_return_if_fail( boxed->private->def == NULL ); boxed->private->def = get_boxed_def( type ); } /** * na_boxed_are_equal: * @a: the first #NABoxed object. * @b: the second #NABoxed object. * * Returns: %TRUE if @a and @b are equal, %FALSE else. * * Since: 3.1 */ gboolean na_boxed_are_equal( const NABoxed *a, const NABoxed *b ) { gboolean are_equal; g_return_val_if_fail( NA_IS_BOXED( a ), FALSE ); g_return_val_if_fail( a->private->dispose_has_run == FALSE, FALSE ); g_return_val_if_fail( NA_IS_BOXED( b ), FALSE ); g_return_val_if_fail( b->private->dispose_has_run == FALSE, FALSE ); g_return_val_if_fail( a->private->def, FALSE ); g_return_val_if_fail( a->private->def == b->private->def, FALSE ); g_return_val_if_fail( a->private->def->are_equal, FALSE ); are_equal = FALSE; if( a->private->is_set == b->private->is_set ){ are_equal = TRUE; if( a->private->is_set ){ are_equal = ( *a->private->def->are_equal )( a, b ); } } return( are_equal ); } /** * na_boxed_copy: * @boxed: the source #NABoxed box. * * Returns: a copy of @boxed, as a newly allocated #NABoxed which should * be g_object_unref() by the caller. * * Since: 3.1 */ NABoxed * na_boxed_copy( const NABoxed *boxed ) { NABoxed *dest; g_return_val_if_fail( NA_IS_BOXED( boxed ), NULL ); g_return_val_if_fail( boxed->private->dispose_has_run == FALSE, NULL ); g_return_val_if_fail( boxed->private->def, NULL ); g_return_val_if_fail( boxed->private->def->copy, NULL ); dest = boxed_new( boxed->private->def ); if( boxed->private->is_set ){ ( *boxed->private->def->copy )( dest, boxed ); dest->private->is_set = TRUE; } return( dest ); } /** * na_boxed_dump: * @boxed: the #NABoxed box to be dumped. * * Dumps the @boxed box. * * Since: 3.1 */ void na_boxed_dump( const NABoxed *boxed ) { static const gchar *thisfn = "na_boxed_dump"; gchar *str; g_return_if_fail( NA_IS_BOXED( boxed )); g_return_if_fail( boxed->private->dispose_has_run == FALSE ); g_return_if_fail( boxed->private->def ); g_return_if_fail( boxed->private->def->to_string ); str = ( boxed->private->is_set ) ? ( *boxed->private->def->to_string )( boxed ) : NULL; g_debug( "%s: boxed=%p, type=%u, is_set=%s, value=%s", thisfn, ( void * ) boxed, boxed->private->def->type, boxed->private->is_set ? "True":"False", str ); g_free( str ); } /** * na_boxed_new_from_string: * @type: the type of the #NABoxed to be allocated. * @string: the initial value of the #NABoxed as a string. * * Allocates a new #NABoxed of the specified @type, and initializes it * with @string. * * If the type is a list, then the last separator is automatically stripped. * * Returns: a newly allocated #NABoxed, which should be g_object_unref() * by the caller, or %NULL if the type is unknowned, or does not provide * the 'from_string' function. * * Since: 3.1 */ NABoxed * na_boxed_new_from_string( guint type, const gchar *string ) { const BoxedDef *def; NABoxed *boxed; def = get_boxed_def( type ); g_return_val_if_fail( def, NULL ); g_return_val_if_fail( def->from_string, NULL ); boxed = boxed_new( def ); ( *def->from_string )( boxed, string ); boxed->private->is_set = TRUE; return( boxed ); } /** * na_boxed_get_boolean: * @boxed: the #NABoxed structure. * * Returns: the boolean value if @boxed is of %NA_DATA_TYPE_BOOLEAN type, * %FALSE else. * * Since: 3.1 */ gboolean na_boxed_get_boolean( const NABoxed *boxed ) { gboolean value; g_return_val_if_fail( NA_IS_BOXED( boxed ), FALSE ); g_return_val_if_fail( boxed->private->dispose_has_run == FALSE, FALSE ); g_return_val_if_fail( boxed->private->def, FALSE ); g_return_val_if_fail( boxed->private->def->type == NA_DATA_TYPE_BOOLEAN, FALSE ); g_return_val_if_fail( boxed->private->def->to_bool, FALSE ); value = ( *boxed->private->def->to_bool )( boxed ); return( value ); } /** * na_boxed_get_pointer: * @boxed: the #NABoxed structure. * * Returns: a const pointer to the data if @boxed is of %NA_DATA_TYPE_POINTER * type, %NULL else. * * Since: 3.1 */ gconstpointer na_boxed_get_pointer( const NABoxed *boxed ) { gconstpointer value; g_return_val_if_fail( NA_IS_BOXED( boxed ), NULL ); g_return_val_if_fail( boxed->private->dispose_has_run == FALSE, NULL ); g_return_val_if_fail( boxed->private->def, NULL ); g_return_val_if_fail( boxed->private->def->to_pointer, NULL ); value = ( *boxed->private->def->to_pointer )( boxed ); return( value ); } /** * na_boxed_get_string: * @boxed: the #NABoxed structure. * * Returns: a newly allocated string if @boxed is of %NA_DATA_TYPE_STRING * type, which should be g_free() by the caller, %NULL else. * * Since: 3.1 */ gchar * na_boxed_get_string( const NABoxed *boxed ) { gchar *value; g_return_val_if_fail( NA_IS_BOXED( boxed ), NULL ); g_return_val_if_fail( boxed->private->dispose_has_run == FALSE, NULL ); g_return_val_if_fail( boxed->private->def, NULL ); g_return_val_if_fail( boxed->private->def->to_string, NULL ); value = ( *boxed->private->def->to_string )( boxed ); return( value ); } /** * na_boxed_get_string_list: * @boxed: the #NABoxed structure. * * Returns: a newly allocated string list if @boxed is of %NA_DATA_TYPE_STRING_LIST * type, which should be na_core_utils_slist_free() by the caller, %NULL else. * * Since: 3.1 */ GSList * na_boxed_get_string_list( const NABoxed *boxed ) { GSList *value; g_return_val_if_fail( NA_IS_BOXED( boxed ), NULL ); g_return_val_if_fail( boxed->private->dispose_has_run == FALSE, NULL ); g_return_val_if_fail( boxed->private->def, NULL ); g_return_val_if_fail( boxed->private->def->type == NA_DATA_TYPE_STRING_LIST, NULL ); g_return_val_if_fail( boxed->private->def->to_string_list, NULL ); value = ( *boxed->private->def->to_string_list )( boxed ); return( value ); } /** * na_boxed_get_uint: * @boxed: the #NABoxed structure. * * Returns: an unsigned integer if @boxed is of %NA_DATA_TYPE_UINT type, * zero else. * * Since: 3.1 */ guint na_boxed_get_uint( const NABoxed *boxed ) { guint value; g_return_val_if_fail( NA_IS_BOXED( boxed ), 0 ); g_return_val_if_fail( boxed->private->dispose_has_run == FALSE, 0 ); g_return_val_if_fail( boxed->private->def, 0 ); g_return_val_if_fail( boxed->private->def->type == NA_DATA_TYPE_UINT, 0 ); g_return_val_if_fail( boxed->private->def->to_uint, 0 ); value = ( *boxed->private->def->to_uint )( boxed ); return( value ); } /** * na_boxed_get_uint_list: * @boxed: the #NABoxed structure. * * Returns: a newly allocated list if @boxed is of %NA_DATA_TYPE_UINT_LIST * type, which should be g_list_free() by the caller, %FALSE else. * * Since: 3.1 */ GList * na_boxed_get_uint_list( const NABoxed *boxed ) { GList *value; g_return_val_if_fail( NA_IS_BOXED( boxed ), NULL ); g_return_val_if_fail( boxed->private->dispose_has_run == FALSE, NULL ); g_return_val_if_fail( boxed->private->def, NULL ); g_return_val_if_fail( boxed->private->def->type == NA_DATA_TYPE_UINT_LIST, NULL ); g_return_val_if_fail( boxed->private->def->to_uint_list, NULL ); value = ( *boxed->private->def->to_uint_list )( boxed ); return( value ); } /** * na_boxed_get_as_value: * @boxed: the #NABoxed whose value is to be got. * @value: the #GValue which holds the string to be set. * * Setup @value with the content of the @boxed. * * Since: 3.1 */ void na_boxed_get_as_value( const NABoxed *boxed, GValue *value ) { g_return_if_fail( NA_IS_BOXED( boxed )); g_return_if_fail( boxed->private->dispose_has_run == FALSE ); g_return_if_fail( boxed->private->def ); g_return_if_fail( boxed->private->def->to_value ); ( *boxed->private->def->to_value )( boxed, value ); } /** * na_boxed_get_as_void: * @boxed: the #NABoxed whose value is to be got. * * Returns: the content of the @boxed. * * If of type NA_DATA_TYPE_STRING (resp. NA_DATA_TYPE_LOCALE_STRING, * NA_DATA_TYPE_STRING_LIST or NA_DATA_TYPE_UINT_LIST), then the content * is returned in a newly allocated value, which should be g_free() (resp. * g_free(), na_core_utils_slist_free(), g_list_free()) by the caller. * * Since: 3.1 */ void * na_boxed_get_as_void( const NABoxed *boxed ) { g_return_val_if_fail( NA_IS_BOXED( boxed ), NULL ); g_return_val_if_fail( boxed->private->dispose_has_run == FALSE, NULL ); g_return_val_if_fail( boxed->private->def, NULL ); g_return_val_if_fail( boxed->private->def->to_void, NULL ); return(( *boxed->private->def->to_void )( boxed )); } /** * na_boxed_set_from_boxed: * @boxed: the #NABoxed whose value is to be set. * @value: the source #NABoxed. * * Copy value from @value to @boxed. * * Since: 3.1 */ void na_boxed_set_from_boxed( NABoxed *boxed, const NABoxed *value ) { g_return_if_fail( NA_IS_BOXED( boxed )); g_return_if_fail( boxed->private->dispose_has_run == FALSE ); g_return_if_fail( NA_IS_BOXED( value )); g_return_if_fail( value->private->dispose_has_run == FALSE ); g_return_if_fail( boxed->private->def ); g_return_if_fail( boxed->private->def == value->private->def ); g_return_if_fail( boxed->private->def->copy ); g_return_if_fail( boxed->private->def->free ); ( *boxed->private->def->free )( boxed ); ( *boxed->private->def->copy )( boxed, value ); boxed->private->is_set = TRUE; } /** * na_boxed_set_from_string: * @boxed: the #NABoxed whose value is to be set. * @value: the string to be set. * * Evaluates the @value and set it to the @boxed. * * Since: 3.1 */ void na_boxed_set_from_string( NABoxed *boxed, const gchar *value ) { g_return_if_fail( NA_IS_BOXED( boxed )); g_return_if_fail( boxed->private->dispose_has_run == FALSE ); g_return_if_fail( boxed->private->def ); g_return_if_fail( boxed->private->def->free ); g_return_if_fail( boxed->private->def->from_string ); ( *boxed->private->def->free )( boxed ); ( *boxed->private->def->from_string )( boxed, value ); boxed->private->is_set = TRUE; } /** * na_boxed_set_from_value: * @boxed: the #NABoxed whose value is to be set. * @value: the value whose content is to be got. * * Evaluates the @value and set it to the @boxed. * * Since: 3.1 */ void na_boxed_set_from_value( NABoxed *boxed, const GValue *value ) { g_return_if_fail( NA_IS_BOXED( boxed )); g_return_if_fail( boxed->private->dispose_has_run == FALSE ); g_return_if_fail( boxed->private->def ); g_return_if_fail( boxed->private->def->free ); g_return_if_fail( boxed->private->def->from_value ); ( *boxed->private->def->free )( boxed ); ( *boxed->private->def->from_value )( boxed, value ); boxed->private->is_set = TRUE; } /** * na_boxed_set_from_void: * @boxed: the #NABoxed whose value is to be set. * @value: the value whose content is to be got. * * Evaluates the @value and set it to the @boxed. * * Since: 3.1 */ void na_boxed_set_from_void( NABoxed *boxed, const void *value ) { g_return_if_fail( NA_IS_BOXED( boxed )); g_return_if_fail( boxed->private->dispose_has_run == FALSE ); g_return_if_fail( boxed->private->def ); g_return_if_fail( boxed->private->def->free ); g_return_if_fail( boxed->private->def->from_void ); ( *boxed->private->def->free )( boxed ); ( *boxed->private->def->from_void )( boxed, value ); boxed->private->is_set = TRUE; } static gboolean bool_are_equal( const NABoxed *a, const NABoxed *b ) { return( a->private->u.boolean == b->private->u.boolean ); } static void bool_copy( NABoxed *dest, const NABoxed *src ) { dest->private->u.boolean = src->private->u.boolean; } static void bool_free( NABoxed *boxed ) { boxed->private->u.boolean = FALSE; boxed->private->is_set = FALSE; } static void bool_from_string( NABoxed *boxed, const gchar *string ) { boxed->private->u.boolean = na_core_utils_boolean_from_string( string ); } static void bool_from_value( NABoxed *boxed, const GValue *value ) { boxed->private->u.boolean = g_value_get_boolean( value ); } static void bool_from_void( NABoxed *boxed, const void *value ) { boxed->private->u.boolean = GPOINTER_TO_UINT( value ); } static gboolean bool_to_bool( const NABoxed *boxed ) { return( boxed->private->u.boolean ); } static gconstpointer bool_to_pointer( const NABoxed *boxed ) { return(( gconstpointer ) GUINT_TO_POINTER( boxed->private->u.boolean )); } static gchar * bool_to_string( const NABoxed *boxed ) { return( g_strdup_printf( "%s", boxed->private->u.boolean ? "true":"false" )); } static void bool_to_value( const NABoxed *boxed, GValue *value ) { g_value_set_boolean( value, boxed->private->u.boolean ); } static void * bool_to_void( const NABoxed *boxed ) { return( GUINT_TO_POINTER( boxed->private->u.boolean )); } static gboolean pointer_are_equal( const NABoxed *a, const NABoxed *b ) { return( a->private->u.pointer == b->private->u.pointer ); } /* * note that copying a pointer is not safe */ static void pointer_copy( NABoxed *dest, const NABoxed *src ) { dest->private->u.pointer = src->private->u.pointer; } static void pointer_free( NABoxed *boxed ) { boxed->private->u.pointer = NULL; boxed->private->is_set = FALSE; } static void pointer_from_string( NABoxed *boxed, const gchar *pointer ) { g_warning( "na_boxed_pointer_from_string: unrelevant function call" ); } static void pointer_from_value( NABoxed *boxed, const GValue *value ) { boxed->private->u.pointer = g_value_get_pointer( value ); } static void pointer_from_void( NABoxed *boxed, const void *value ) { boxed->private->u.pointer = ( void * ) value; } static gconstpointer pointer_to_pointer( const NABoxed *boxed ) { return( boxed->private->u.pointer ); } static gchar * pointer_to_string( const NABoxed *boxed ) { return( g_strdup_printf( "%p", boxed->private->u.pointer )); } static void pointer_to_value( const NABoxed *boxed, GValue *value ) { g_value_set_pointer( value, boxed->private->u.pointer ); } static void * pointer_to_void( const NABoxed *boxed ) { return( boxed->private->u.pointer ); } static gboolean string_are_equal( const NABoxed *a, const NABoxed *b ) { if( a->private->u.string && b->private->u.string ){ return( strcmp( a->private->u.string, b->private->u.string ) == 0 ); } if( !a->private->u.string && !b->private->u.string ){ return( TRUE ); } return( FALSE ); } static void string_copy( NABoxed *dest, const NABoxed *src ) { dest->private->u.string = g_strdup( src->private->u.string ); } static void string_free( NABoxed *boxed ) { g_free( boxed->private->u.string ); boxed->private->u.string = NULL; boxed->private->is_set = FALSE; } static void string_from_string( NABoxed *boxed, const gchar *string ) { boxed->private->u.string = g_strdup( string ? string : "" ); } static void string_from_value( NABoxed *boxed, const GValue *value ) { if( g_value_get_string( value )){ boxed->private->u.string = g_value_dup_string( value ); } else { boxed->private->u.string = g_strdup( "" ); } } static void string_from_void( NABoxed *boxed, const void *value ) { boxed->private->u.string = g_strdup( value ? ( const gchar * ) value : "" ); } static gconstpointer string_to_pointer( const NABoxed *boxed ) { return(( gconstpointer ) boxed->private->u.string ); } static gchar * string_to_string( const NABoxed *boxed ) { return( g_strdup( boxed->private->u.string )); } static void string_to_value( const NABoxed *boxed, GValue *value ) { gchar *str; str = string_to_string( boxed ); g_value_set_string( value, str ); g_free( str ); } static void * string_to_void( const NABoxed *boxed ) { return(( void * ) string_to_string( boxed )); } /* the two string lists are equal if they have the same elements in the * same order */ static gboolean string_list_are_equal( const NABoxed *a, const NABoxed *b ) { GSList *ia, *ib; gboolean diff = FALSE; guint na = g_slist_length( a->private->u.string_list ); guint nb = g_slist_length( b->private->u.string_list ); if( na != nb ) return( FALSE ); for( ia=a->private->u.string_list, ib=b->private->u.string_list ; ia && ib && !diff ; ia=ia->next, ib=ib->next ){ if( strcmp( ia->data, ib->data ) != 0 ){ diff = TRUE; } } return( !diff ); } static void string_list_copy( NABoxed *dest, const NABoxed *src ) { if( dest->private->is_set ){ string_list_free( dest ); } dest->private->u.string_list = na_core_utils_slist_duplicate( src->private->u.string_list ); dest->private->is_set = TRUE; } static void string_list_free( NABoxed *boxed ) { na_core_utils_slist_free( boxed->private->u.string_list ); boxed->private->u.string_list = NULL; boxed->private->is_set = FALSE; } /* * accept string list both: * - as a semi-comma-separated list of strings * - as a comma-separated list of string, between two square brackets (à la GConf) */ static void string_list_from_string( NABoxed *boxed, const gchar *string ) { gchar **array; gchar **i; array = string_to_array( string ); if( array ){ i = ( gchar ** ) array; while( *i ){ if( !na_core_utils_slist_count( boxed->private->u.string_list, ( const gchar * )( *i ))){ boxed->private->u.string_list = g_slist_prepend( boxed->private->u.string_list, g_strdup( *i )); } i++; } boxed->private->u.string_list = g_slist_reverse( boxed->private->u.string_list ); } g_strfreev( array ); } static void string_list_from_value( NABoxed *boxed, const GValue *value ) { string_list_from_void( boxed, ( const void * ) g_value_get_pointer( value )); } static void string_list_from_void( NABoxed *boxed, const void *value ) { GSList *value_slist; GSList *it; value_slist = ( GSList * ) value; for( it = value_slist ; it ; it = it->next ){ if( !na_core_utils_slist_count( boxed->private->u.string_list, ( const gchar * ) it->data )){ boxed->private->u.string_list = g_slist_prepend( boxed->private->u.string_list, g_strdup(( const gchar * ) it->data )); } } boxed->private->u.string_list = g_slist_reverse( boxed->private->u.string_list ); } static gconstpointer string_list_to_pointer( const NABoxed *boxed ) { return(( gconstpointer ) boxed->private->u.string_list ); } static gchar * string_list_to_string( const NABoxed *boxed ) { GSList *is; GString *str = g_string_new( "" ); gboolean first; first = TRUE; for( is = boxed->private->u.string_list ; is ; is = is->next ){ if( !first ){ str = g_string_append( str, LIST_SEPARATOR ); } str = g_string_append( str, ( const gchar * ) is->data ); first = FALSE; } return( g_string_free( str, FALSE )); } static GSList * string_list_to_string_list( const NABoxed *boxed ) { return( na_core_utils_slist_duplicate( boxed->private->u.string_list )); } static void string_list_to_value( const NABoxed *boxed, GValue *value ) { g_value_set_pointer( value, na_core_utils_slist_duplicate( boxed->private->u.string_list )); } static void * string_list_to_void( const NABoxed *boxed ) { void *value = NULL; if( boxed->private->u.string_list ){ value = na_core_utils_slist_duplicate( boxed->private->u.string_list ); } return( value ); } static gboolean locale_are_equal( const NABoxed *a, const NABoxed *b ) { if( !a->private->u.string && !b->private->u.string ){ return( TRUE ); } if( !a->private->u.string || !b->private->u.string ){ return( FALSE ); } return( na_core_utils_str_collate( a->private->u.string, b->private->u.string ) == 0 ); } static gboolean uint_are_equal( const NABoxed *a, const NABoxed *b ) { return( a->private->u.uint == b->private->u.uint ); } static void uint_copy( NABoxed *dest, const NABoxed *src ) { dest->private->u.uint = src->private->u.uint; dest->private->is_set = TRUE; } static void uint_free( NABoxed *boxed ) { boxed->private->u.uint = 0; boxed->private->is_set = FALSE; } static void uint_from_string( NABoxed *boxed, const gchar *string ) { boxed->private->u.uint = string ? atoi( string ) : 0; } static void uint_from_value( NABoxed *boxed, const GValue *value ) { boxed->private->u.uint = g_value_get_uint( value ); } static void uint_from_void( NABoxed *boxed, const void *value ) { boxed->private->u.uint = GPOINTER_TO_UINT( value ); } static gconstpointer uint_to_pointer( const NABoxed *boxed ) { return(( gconstpointer ) GUINT_TO_POINTER( boxed->private->u.uint )); } static gchar * uint_to_string( const NABoxed *boxed ) { return( g_strdup_printf( "%u", boxed->private->u.uint )); } static guint uint_to_uint( const NABoxed *boxed ) { return( boxed->private->u.uint ); } static void uint_to_value( const NABoxed *boxed, GValue *value ) { g_value_set_uint( value, boxed->private->u.uint ); } static void * uint_to_void( const NABoxed *boxed ) { return( GUINT_TO_POINTER( boxed->private->u.uint )); } /* compare uint list as string list: * if the two list do not have the same count, then one is lesser than the other * if they have same count and same elements in same order, they are equal * else just arbitrarily return -1 */ static gboolean uint_list_are_equal( const NABoxed *a, const NABoxed *b ) { GList *ia, *ib; gboolean diff = FALSE; guint na = g_list_length( a->private->u.uint_list ); guint nb = g_list_length( b->private->u.uint_list ); if( na != nb ) return( FALSE ); for( ia=a->private->u.uint_list, ib=b->private->u.uint_list ; ia && ib && !diff ; ia=ia->next, ib=ib->next ){ if( GPOINTER_TO_UINT( ia->data ) != GPOINTER_TO_UINT( ib->data )){ diff = TRUE; } } return( !diff ); } static void uint_list_copy( NABoxed *dest, const NABoxed *src ) { GList *isrc; dest->private->u.uint_list = NULL; for( isrc = src->private->u.uint_list ; isrc ; isrc = isrc->next ){ dest->private->u.uint_list = g_list_prepend( dest->private->u.uint_list, isrc->data ); } dest->private->u.uint_list = g_list_reverse( dest->private->u.uint_list ); } static void uint_list_free( NABoxed *boxed ) { g_list_free( boxed->private->u.uint_list ); boxed->private->u.uint_list = NULL; boxed->private->is_set = FALSE; } static void uint_list_from_string( NABoxed *boxed, const gchar *string ) { gchar **array; gchar **i; array = string_to_array( string ); if( array ){ i = ( gchar ** ) array; while( *i ){ boxed->private->u.uint_list = g_list_prepend( boxed->private->u.uint_list, GINT_TO_POINTER( atoi( *i ))); i++; } boxed->private->u.uint_list = g_list_reverse( boxed->private->u.uint_list ); } else { boxed->private->u.uint_list = NULL; } g_strfreev( array ); } static void uint_list_from_value( NABoxed *boxed, const GValue *value ) { if( g_value_get_pointer( value )){ boxed->private->u.uint_list = g_list_copy( g_value_get_pointer( value )); } } static void uint_list_from_void( NABoxed *boxed, const void *value ) { if( value ){ boxed->private->u.uint_list = g_list_copy(( GList * ) value ); } } static gconstpointer uint_list_to_pointer( const NABoxed *boxed ) { return(( gconstpointer ) boxed->private->u.uint_list ); } static gchar * uint_list_to_string( const NABoxed *boxed ) { GList *is; GString *str = g_string_new( "" ); gboolean first; first = TRUE; for( is = boxed->private->u.uint_list ; is ; is = is->next ){ if( !first ){ str = g_string_append( str, LIST_SEPARATOR ); } g_string_append_printf( str, "%u", GPOINTER_TO_UINT( is->data )); first = FALSE; } return( g_string_free( str, FALSE )); } static GList * uint_list_to_uint_list( const NABoxed *boxed ) { return( g_list_copy( boxed->private->u.uint_list )); } static void uint_list_to_value( const NABoxed *boxed, GValue *value ) { g_value_set_pointer( value, g_list_copy( boxed->private->u.uint_list )); } static void * uint_list_to_void( const NABoxed *boxed ) { void *value = NULL; if( boxed->private->u.uint_list ){ value = g_list_copy( boxed->private->u.uint_list ); } return( value ); } nautilus-actions-3.2.3/src/core/na-object.c0000644000175100017500000004507712212601376015505 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "na-factory-object.h" /* private class data */ struct _NAObjectClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAObjectPrivate { gboolean dispose_has_run; }; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAObjectClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void object_dump( const NAObject *object ); static void iduplicable_iface_init( NAIDuplicableInterface *iface, void *user_data ); static void iduplicable_copy( NAIDuplicable *target, const NAIDuplicable *source, guint mode ); static gboolean iduplicable_are_equal( const NAIDuplicable *a, const NAIDuplicable *b ); static gboolean iduplicable_is_valid( const NAIDuplicable *object ); static void check_status_down_rec( const NAObject *object ); static void check_status_up_rec( const NAObject *object, gboolean was_modified, gboolean was_valid ); static void v_copy( NAObject *target, const NAObject *source, guint mode ); static gboolean v_are_equal( const NAObject *a, const NAObject *b ); static gboolean v_is_valid( const NAObject *a ); static void dump_tree( GList *tree, gint level ); GType na_object_object_get_type( void ) { static GType item_type = 0; if( item_type == 0 ){ item_type = register_type(); } return( item_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_object_register_type"; GType type; static GTypeInfo info = { sizeof( NAObjectClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAObject ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo iduplicable_iface_info = { ( GInterfaceInitFunc ) iduplicable_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NAObject", &info, 0 ); g_type_add_interface_static( type, NA_TYPE_IDUPLICABLE, &iduplicable_iface_info ); return( type ); } static void class_init( NAObjectClass *klass ) { static const gchar *thisfn = "na_object_class_init"; GObjectClass *object_class; NAObjectClass *naobject_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; naobject_class = NA_OBJECT_CLASS( klass ); naobject_class->dump = object_dump; naobject_class->copy = NULL; naobject_class->are_equal = NULL; naobject_class->is_valid = NULL; klass->private = g_new0( NAObjectClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { NAObject *self; g_return_if_fail( NA_IS_OBJECT( instance )); self = NA_OBJECT( instance ); self->private = g_new0( NAObjectPrivate, 1 ); } static void instance_dispose( GObject *object ) { NAObject *self; g_return_if_fail( NA_IS_OBJECT( object )); self = NA_OBJECT( object ); if( !self->private->dispose_has_run ){ self->private->dispose_has_run = TRUE; na_iduplicable_dispose( NA_IDUPLICABLE( object )); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { NAObject *self; g_return_if_fail( NA_IS_OBJECT( object )); self = NA_OBJECT( object ); g_free( self->private ); if( NA_IS_IFACTORY_OBJECT( object )){ na_factory_object_finalize( NA_IFACTORY_OBJECT( object )); } /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static void object_dump( const NAObject *object ) { if( !object->private->dispose_has_run ){ na_iduplicable_dump( NA_IDUPLICABLE( object )); if( NA_IS_IFACTORY_OBJECT( object )){ na_factory_object_dump( NA_IFACTORY_OBJECT( object )); } } } static void iduplicable_iface_init( NAIDuplicableInterface *iface, void *user_data ) { static const gchar *thisfn = "na_object_iduplicable_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->copy = iduplicable_copy; iface->are_equal = iduplicable_are_equal; iface->is_valid = iduplicable_is_valid; } /* * implementation of na_iduplicable::copy interface virtual function * it recursively copies @source to @target */ static void iduplicable_copy( NAIDuplicable *target, const NAIDuplicable *source, guint mode ) { static const gchar *thisfn = "na_object_iduplicable_copy"; NAObject *dest, *src; g_return_if_fail( NA_IS_OBJECT( target )); g_return_if_fail( NA_IS_OBJECT( source )); dest = NA_OBJECT( target ); src = NA_OBJECT( source ); if( !dest->private->dispose_has_run && !src->private->dispose_has_run ){ g_debug( "%s: target=%p (%s), source=%p (%s), mode=%d", thisfn, ( void * ) dest, G_OBJECT_TYPE_NAME( dest ), ( void * ) src, G_OBJECT_TYPE_NAME( src ), mode ); if( NA_IS_IFACTORY_OBJECT( target )){ na_factory_object_copy( NA_IFACTORY_OBJECT( target ), NA_IFACTORY_OBJECT( source )); } if( NA_IS_ICONTEXT( target )){ na_icontext_copy( NA_ICONTEXT( target ), NA_ICONTEXT( source )); } v_copy( dest, src, mode ); } } static gboolean iduplicable_are_equal( const NAIDuplicable *a, const NAIDuplicable *b ) { static const gchar *thisfn = "na_object_iduplicable_are_equal"; gboolean are_equal; g_return_val_if_fail( NA_IS_OBJECT( a ), FALSE ); g_return_val_if_fail( NA_IS_OBJECT( b ), FALSE ); are_equal = FALSE; if( !NA_OBJECT( a )->private->dispose_has_run && !NA_OBJECT( b )->private->dispose_has_run ){ g_debug( "%s: a=%p (%s), b=%p", thisfn, ( void * ) a, G_OBJECT_TYPE_NAME( a ), ( void * ) b ); are_equal = TRUE; if( NA_IS_IFACTORY_OBJECT( a )){ are_equal &= na_factory_object_are_equal( NA_IFACTORY_OBJECT( a ), NA_IFACTORY_OBJECT( b )); } if( NA_IS_ICONTEXT( a )){ are_equal &= na_icontext_are_equal( NA_ICONTEXT( a ), NA_ICONTEXT( b )); } are_equal &= v_are_equal( NA_OBJECT( a ), NA_OBJECT( b )); } return( are_equal ); } static gboolean iduplicable_is_valid( const NAIDuplicable *object ) { static const gchar *thisfn = "na_object_iduplicable_is_valid"; gboolean is_valid; g_return_val_if_fail( NA_IS_OBJECT( object ), FALSE ); is_valid = FALSE; if( !NA_OBJECT( object )->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); is_valid = TRUE; if( NA_IS_IFACTORY_OBJECT( object )){ is_valid &= na_factory_object_is_valid( NA_IFACTORY_OBJECT( object )); } if( NA_IS_ICONTEXT( object )){ is_valid &= na_icontext_is_valid( NA_ICONTEXT( object )); } is_valid &= v_is_valid( NA_OBJECT( object )); } return( is_valid ); } /** * na_object_object_check_status_rec: * @object: the #NAObject -derived object to be checked. * * Recursively checks for the edition status of @object and its children * (if any). * * Internally set some properties which may be requested later. This * two-steps check-request let us optimize some work in the UI. * * * na_object_object_check_status_rec( object ) * +- na_iduplicable_check_status( object ) * +- get_origin( object ) * +- modified_status = v_are_equal( origin, object ) * | +-> interface NAObjectClass::are_equal * | which happens to be iduplicable_are_equal( a, b ) * | +- v_are_equal( a, b ) * | +- NAObjectAction::are_equal() * | +- na_factory_object_are_equal() * | +- check NAObjectActionPrivate data * | +- call parent class * | +- NAObjectItem::are_equal() * | +- check NAObjectItemPrivate data * | +- call parent class * | +- NAObjectId::are_equal() * | * +- valid_status = v_is_valid( object ) -> interface NAObjectClass::is_valid * * * Note that the recursivity is managed here, so that we can be sure * that edition status of children is actually checked before those of * the parent. * * * * As of 3.1.0: * * * * * * when the modification status of a NAObjectProfile changes, then its * NAObjectAction parent is rechecked; * * * * * when the validity status of an object is changed, then its parent is * also rechecked. * * * * * * * Since: 2.30 */ void na_object_object_check_status_rec( const NAObject *object ) { static const gchar *thisfn = "na_object_object_check_status_rec"; gboolean was_modified, was_valid; g_return_if_fail( NA_IS_OBJECT( object )); if( !object->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); was_modified = na_object_is_modified( object ); was_valid = na_object_is_valid( object ); check_status_down_rec( object ); check_status_up_rec( object, was_modified, was_valid ); } } /* * recursively checks the status downstream */ static void check_status_down_rec( const NAObject *object ) { if( NA_IS_OBJECT_ITEM( object )){ g_list_foreach( na_object_get_items( object ), ( GFunc ) check_status_down_rec, NULL ); } na_iduplicable_check_status( NA_IDUPLICABLE( object )); } /* * if the status appears changed, then rechecks the parent * recurse upstream while there is a parent, and its status changes */ static void check_status_up_rec( const NAObject *object, gboolean was_modified, gboolean was_valid ) { gboolean is_modified, is_valid; NAObjectItem *parent; is_modified = na_object_is_modified( object ); is_valid = na_object_is_valid( object ); if(( NA_IS_OBJECT_PROFILE( object ) && was_modified != is_modified ) || was_valid != is_valid ){ parent = na_object_get_parent( object ); if( parent ){ was_modified = na_object_is_modified( parent ); was_valid = na_object_is_valid( parent ); na_iduplicable_check_status( NA_IDUPLICABLE( parent )); check_status_up_rec( NA_OBJECT( parent ), was_modified, was_valid ); } } } static void v_copy( NAObject *target, const NAObject *source, guint mode ) { if( NA_OBJECT_GET_CLASS( target )->copy ){ NA_OBJECT_GET_CLASS( target )->copy( target, source, mode ); } } static gboolean v_are_equal( const NAObject *a, const NAObject *b ) { if( NA_OBJECT_GET_CLASS( a )->are_equal ){ return( NA_OBJECT_GET_CLASS( a )->are_equal( a, b )); } return( TRUE ); } static gboolean v_is_valid( const NAObject *a ) { if( NA_OBJECT_GET_CLASS( a )->is_valid ){ return( NA_OBJECT_GET_CLASS( a )->is_valid( a )); } return( TRUE ); } /** * na_object_object_dump: * @object: the #NAObject -derived object to be dumped. * * Dumps via g_debug() the actual content of the object. * * The recursivity is dealt with here because, if we would let * #NAObjectItem do this, the dump of #NAObjectItem -derived object * would be splitted, children being inserted inside. * * na_object_dump() doesn't modify the reference count of the dumped * object. * * Since: 2.30 */ void na_object_object_dump( const NAObject *object ) { GList *children, *ic; g_return_if_fail( NA_IS_OBJECT( object )); if( !object->private->dispose_has_run ){ na_object_dump_norec( object ); if( NA_IS_OBJECT_ITEM( object )){ children = na_object_get_items( object ); for( ic = children ; ic ; ic = ic->next ){ na_object_dump( ic->data ); } } } } /** * na_object_object_dump_norec: * @object: the #NAObject -derived object to be dumped. * * Dumps via g_debug the actual content of the object. * * This function is not recursive. * * Since: 2.30 */ void na_object_object_dump_norec( const NAObject *object ) { g_return_if_fail( NA_IS_OBJECT( object )); if( !object->private->dispose_has_run ){ if( NA_OBJECT_GET_CLASS( object )->dump ){ NA_OBJECT_GET_CLASS( object )->dump( object ); } } } /** * na_object_object_dump_tree: * @tree: a hierarchical list of #NAObject -derived objects. * * Outputs a brief, hierarchical dump of the provided list. * * Since: 2.30 */ void na_object_object_dump_tree( GList *tree ) { dump_tree( tree, 0 ); } static void dump_tree( GList *tree, gint level ) { GString *prefix; gint i; GList *it; const NAObject *object; gchar *label; prefix = g_string_new( "" ); for( i = 0 ; i < level ; ++i ){ g_string_append_printf( prefix, " " ); } for( it = tree ; it ; it = it->next ){ object = ( const NAObject * ) it->data; label = na_object_get_label( object ); g_debug( "na_object_dump_tree: %s%p (%s, ref_count=%u) '%s'", prefix->str, ( void * ) object, G_OBJECT_TYPE_NAME( object ), G_OBJECT( object )->ref_count, label ); g_free( label ); if( NA_IS_OBJECT_ITEM( object )){ dump_tree( na_object_get_items( object ), level+1 ); } } g_string_free( prefix, TRUE ); } /** * na_object_object_reset_origin: * @object: a #NAObject -derived object. * @origin: must be a duplication of @object. * * Recursively reset origin of @object and its children to @origin (and * its children), so that @origin appears as the actual origin of @object. * * The origin of @origin itself is set to NULL. * * This only works if @origin has just been duplicated from @object, * and thus we do not have to check if children lists are equal. * * Since: 2.30 */ void na_object_object_reset_origin( NAObject *object, const NAObject *origin ) { GList *origin_children, *iorig; GList *object_children, *iobj; g_return_if_fail( NA_IS_OBJECT( origin )); g_return_if_fail( NA_IS_OBJECT( object )); if( !object->private->dispose_has_run && !origin->private->dispose_has_run ){ origin_children = na_object_get_items( origin ); object_children = na_object_get_items( object ); for( iorig = origin_children, iobj = object_children ; iorig && iobj ; iorig = iorig->next, iobj = iobj->next ){ na_object_reset_origin( iobj->data, iorig->data ); } na_iduplicable_set_origin( NA_IDUPLICABLE( object ), NA_IDUPLICABLE( origin )); na_iduplicable_set_origin( NA_IDUPLICABLE( origin ), NULL ); } } /** * na_object_object_ref: * @object: a #NAObject -derived object. * * Recursively ref the @object and all its children, incrementing their * reference_count by 1. * * Returns: a reference on the @object. * * Since: 2.30 */ NAObject * na_object_object_ref( NAObject *object ) { NAObject *ref; g_return_val_if_fail( NA_IS_OBJECT( object ), NULL ); ref = NULL; if( !object->private->dispose_has_run ){ if( NA_IS_OBJECT_ITEM( object )){ g_list_foreach( na_object_get_items( object ), ( GFunc ) na_object_object_ref, NULL ); } ref = g_object_ref( object ); } return( ref ); } /** * na_object_object_unref: * @object: a #NAObject -derived object. * * Recursively unref the @object and all its children, decrementing their * reference_count by 1. * * Note that we may want to free a copy+ref of a list of items whichy have * had already disposed (which is probably a bug somewhere). So first test * is the object is still alive. * * Since: 2.30 */ void na_object_object_unref( NAObject *object ) { g_return_if_fail( NA_IS_OBJECT( object )); if( !object->private->dispose_has_run ){ if( NA_IS_OBJECT_ITEM( object )){ g_list_foreach( na_object_get_items( object ), ( GFunc ) na_object_object_unref, NULL ); } g_object_unref( object ); } } #ifdef NA_ENABLE_DEPRECATED /* * build the class hierarchy * returns a list of GObjectClass, which starts with NAObject, * and to with the most derived class (e.g. NAObjectAction or so) */ static GList * build_class_hierarchy( const NAObject *object ) { GObjectClass *class; GList *hierarchy; hierarchy = NULL; class = G_OBJECT_GET_CLASS( object ); while( G_OBJECT_CLASS_TYPE( class ) != NA_TYPE_OBJECT ){ hierarchy = g_list_prepend( hierarchy, class ); class = g_type_class_peek_parent( class ); } hierarchy = g_list_prepend( hierarchy, class ); return( hierarchy ); } /** * na_object_get_hierarchy: * @object: the #NAObject -derived object. * * Returns: the class hierarchy, * from the topmost base class, to the most-derived one. * * Since: 2.30 * Deprecated: 3.1 */ GList * na_object_get_hierarchy( const NAObject *object ) { GList *hierarchy; g_return_val_if_fail( NA_IS_OBJECT( object ), NULL ); hierarchy = NULL; if( !object->private->dispose_has_run ){ hierarchy = build_class_hierarchy( object ); } return( hierarchy ); } /** * na_object_free_hierarchy: * @hierarchy: the #GList of hierarchy, as returned from * na_object_get_hierarchy(). * * Releases the #NAObject hierarchy. * * Since: 2.30 * Deprecated: 3.1 */ void na_object_free_hierarchy( GList *hierarchy ) { g_list_free( hierarchy ); } #endif /* NA_ENABLE_DEPRECATED */ /** * na_object_object_debug_invalid: * @object: the #NAObject -derived object which is invalid. * @reason: the reason. * * Dump the object with the invalidity reason. * * Since: 2.30 */ void na_object_object_debug_invalid( const NAObject *object, const gchar *reason ) { g_debug( "na_object_object_debug_invalid: object %p (%s) is marked invalid for reason \"%s\"", ( void * ) object, G_OBJECT_TYPE_NAME( object ), reason ); } nautilus-actions-3.2.3/src/core/na-export-format.c0000644000175100017500000002211712212601376017034 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include "na-export-format.h" #include "na-ioption.h" /* private class data */ struct _NAExportFormatClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAExportFormatPrivate { gboolean dispose_has_run; gchar *format; gchar *label; gchar *description; GdkPixbuf *pixbuf; NAIExporter *provider; }; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAExportFormatClass *klass ); static void ioption_iface_init( NAIOptionInterface *iface, void *user_data ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static gchar *ioption_get_id( const NAIOption *option ); static gchar *ioption_get_label( const NAIOption *option ); static gchar *ioption_get_description( const NAIOption *option ); static GdkPixbuf *ioption_get_pixbuf( const NAIOption *option ); GType na_export_format_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_export_format_register_type"; GType type; static GTypeInfo info = { sizeof( NAExportFormatClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAExportFormat ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo ioption_iface_info = { ( GInterfaceInitFunc ) ioption_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "NAExportFormat", &info, 0 ); g_type_add_interface_static( type, NA_TYPE_IOPTION, &ioption_iface_info ); return( type ); } static void class_init( NAExportFormatClass *klass ) { static const gchar *thisfn = "na_export_format_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NAExportFormatClassPrivate, 1 ); } static void ioption_iface_init( NAIOptionInterface *iface, void *user_data ) { static const gchar *thisfn = "na_export_format_ioption_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->get_id = ioption_get_id; iface->get_label = ioption_get_label; iface->get_description = ioption_get_description; iface->get_pixbuf = ioption_get_pixbuf; } /* * ioption_get_id: * @option: this #NAIOption instance. * * Returns: the ASCII id of the @option, as a newly allocated string which * should be g_free() by the caller. */ static gchar * ioption_get_id( const NAIOption *option ) { gchar *id; NAExportFormat *format; g_return_val_if_fail( NA_IS_EXPORT_FORMAT( option ), NULL ); format = NA_EXPORT_FORMAT( option ); id = NULL; if( !format->private->dispose_has_run ){ id = g_strdup( format->private->format ); } return( id ); } /* * ioption_get_label: * @option: this #NAIOption instance. * * Returns: the label associated to @option, as a newly allocated string * which should be g_free() by the caller. */ static gchar * ioption_get_label( const NAIOption *option ) { gchar *label; NAExportFormat *format; g_return_val_if_fail( NA_IS_EXPORT_FORMAT( option ), NULL ); format = NA_EXPORT_FORMAT( option ); label = NULL; if( !format->private->dispose_has_run ){ label = g_strdup( format->private->label ); } return( label ); } /* * ioption_get_description: * @option: this #NAIOption instance. * * Returns: the description associated to @option, as a newly allocated string * which should be g_free() by the caller. */ static gchar * ioption_get_description( const NAIOption *option ) { gchar *description; NAExportFormat *format; g_return_val_if_fail( NA_IS_EXPORT_FORMAT( option ), NULL ); format = NA_EXPORT_FORMAT( option ); description = NULL; if( !format->private->dispose_has_run ){ description = g_strdup( format->private->description ); } return( description ); } /* * ioption_get_pixbuf: * @option: this #NAIOption instance. * * Returns: a new reference to the pixbuf associated to @option; * which should later be g_object_unref() by the caller. */ static GdkPixbuf * ioption_get_pixbuf( const NAIOption *option ) { GdkPixbuf *pixbuf; NAExportFormat *format; g_return_val_if_fail( NA_IS_EXPORT_FORMAT( option ), NULL ); format = NA_EXPORT_FORMAT( option ); pixbuf = NULL; if( !format->private->dispose_has_run ){ pixbuf = format->private->pixbuf ? g_object_ref( format->private->pixbuf ) : NULL; } return( pixbuf ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_export_format_instance_init"; NAExportFormat *self; g_return_if_fail( NA_IS_EXPORT_FORMAT( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_EXPORT_FORMAT( instance ); self->private = g_new0( NAExportFormatPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_export_format_instance_dispose"; NAExportFormat *self; g_return_if_fail( NA_IS_EXPORT_FORMAT( object )); self = NA_EXPORT_FORMAT( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; if( self->private->pixbuf ){ g_debug( "%s: pixbuf=%p (%s) ref_count=%d", thisfn, ( void * ) self->private->pixbuf, G_OBJECT_TYPE_NAME( self->private->pixbuf ), G_OBJECT( self->private->pixbuf )->ref_count ); g_object_unref( self->private->pixbuf ); self->private->pixbuf = NULL; } /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_export_format_instance_finalize"; NAExportFormat *self; g_return_if_fail( NA_IS_EXPORT_FORMAT( object )); g_debug( "%s: object=%p", thisfn, ( void * ) object ); self = NA_EXPORT_FORMAT( object ); g_free( self->private->format ); g_free( self->private->label ); g_free( self->private->description ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /* * na_export_format_new: * @exporter_format: a #NAIExporterFormatv2 which describes an export format. * * Returns: a newly allocated #NAExportFormat object. */ NAExportFormat * na_export_format_new( const NAIExporterFormatv2 *exporter_format ) { NAExportFormat *format; format = g_object_new( NA_TYPE_EXPORT_FORMAT, NULL ); format->private->format = g_strdup( exporter_format->format ); format->private->label = g_strdup( exporter_format->label ); format->private->description = g_strdup( exporter_format->description ); format->private->pixbuf = exporter_format->pixbuf ? g_object_ref( exporter_format->pixbuf ) : NULL; format->private->provider = exporter_format->provider; return( format ); } /* * na_export_format_get_provider: * @format: this #NAExportFormat object. * * Returns: a pointer to the #NAIExporter which provides this format. * * The pointer is owned by NAEportFormat class, and should not be released * by the caller. */ NAIExporter * na_export_format_get_provider( const NAExportFormat *format ) { NAIExporter *exporter; g_return_val_if_fail( NA_IS_EXPORT_FORMAT( format ), NULL ); exporter = NULL; if( !format->private->dispose_has_run ){ exporter = format->private->provider; } return( exporter ); } nautilus-actions-3.2.3/src/core/na-import-mode.h0000644000175100017500000000565112212601376016472 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_IMPORT_MODE_H__ #define __CORE_NA_IMPORT_MODE_H__ /* @title: NAImportMode * @short_description: The #NAImportMode Class Definition * @include: core/na-import-mode.h * * This class gathers and manages the different import modes we are able * to deal with. */ #include #include G_BEGIN_DECLS #define NA_TYPE_IMPORT_MODE ( na_import_mode_get_type()) #define NA_IMPORT_MODE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_IMPORT_MODE, NAImportMode )) #define NA_IMPORT_MODE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_IMPORT_MODE, NAImportModeClass )) #define NA_IS_IMPORT_MODE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_IMPORT_MODE )) #define NA_IS_IMPORT_MODE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_IMPORT_MODE )) #define NA_IMPORT_MODE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_IMPORT_MODE, NAImportModeClass )) typedef struct _NAImportModePrivate NAImportModePrivate; typedef struct { GObject parent; NAImportModePrivate *private; } NAImportMode; typedef struct _NAImportModeClassPrivate NAImportModeClassPrivate; typedef struct { GObjectClass parent; NAImportModeClassPrivate *private; } NAImportModeClass; GType na_import_mode_get_type( void ); /* NAImportMode properties * */ #define NA_IMPORT_PROP_MODE "na-import-mode-prop-mode" #define NA_IMPORT_PROP_LABEL "na-import-mode-prop-label" #define NA_IMPORT_PROP_DESCRIPTION "na-import-mode-prop-description" #define NA_IMPORT_PROP_IMAGE "na-import-mode-prop-image" NAImportMode *na_import_mode_new ( guint mode_id ); guint na_import_mode_get_id ( const NAImportMode *mode ); G_END_DECLS #endif /* __CORE_NA_IMPORT_MODE_H__ */ nautilus-actions-3.2.3/src/core/na-ioptions-list.c0000644000175100017500000007674312212601376017060 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "na-gtk-utils.h" #include "na-ioptions-list.h" /* private interface data */ struct _NAIOptionsListInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* column ordering in the tree view mode */ enum { IMAGE_COLUMN = 0, LABEL_COLUMN, TOOLTIP_COLUMN, OBJECT_COLUMN, N_COLUMN }; /* data associated to the container of the instance * * Note that data may be set against the instance itself (has it been * initialized ?), at the container level or at the option level. It * is not really worth to have a dedicated structure (because we should * actually have three!). */ #define IOPTIONS_LIST_DATA_EDITABLE "ioptions-list-data-editable" #define IOPTIONS_LIST_DATA_FIRST_BUTTON "ioptions-list-data-first-button" #define IOPTIONS_LIST_DATA_INITIALIZED "ioptions-list-data-initialized" #define IOPTIONS_LIST_DATA_OPTION "ioptions-list-data-option" #define IOPTIONS_LIST_DATA_OPTION_ID "ioptions-list-data-option-id" #define IOPTIONS_LIST_DATA_SENSITIVE "ioptions-list-data-sensitive" static guint st_initializations = 0; /* interface initialization count */ static GType register_type( void ); static void interface_base_init( NAIOptionsListInterface *iface ); static void interface_base_finalize( NAIOptionsListInterface *iface ); static guint ioptions_list_get_version( const NAIOptionsList *instance ); static void ioptions_list_free_options( const NAIOptionsList *instance, GtkWidget *container_parent, GList *options ); static void ioptions_list_free_ask_option( const NAIOptionsList *instance, GtkWidget *container_parent, NAIOption *option ); static GList *options_list_get_options( const NAIOptionsList *instance, GtkWidget *container_parent ); static void options_list_free_options( const NAIOptionsList *instance, GtkWidget *container_parent, GList *options ); static NAIOption *options_list_get_ask_option( const NAIOptionsList *instance, GtkWidget *container_parent ); static void options_list_free_ask_option( const NAIOptionsList *instance, GtkWidget *container_parent, NAIOption *ask_option ); static gboolean get_options_list_container_initialized( GtkWidget *container_parent ); static void set_options_list_container_initialized( GtkWidget *container_parent, gboolean initialized ); static gboolean get_options_list_editable( GtkWidget *container_parent ); static void set_options_list_editable( GtkWidget *container_parent, gboolean editable ); static GtkWidget *get_options_list_first_button( GtkWidget *container ); static void set_options_list_first_button( GtkWidget *container, GtkWidget *button ); static gboolean get_options_list_instance_initialized( const NAIOptionsList *instance ); static void set_options_list_instance_initialized( const NAIOptionsList *instance, gboolean initialized ); static NAIOption *get_options_list_option( GtkWidget *container ); static void set_options_list_option( GtkWidget *container, NAIOption *option ); static const gchar *get_options_list_option_id( GtkWidget *container ); static void set_options_list_option_id( GtkWidget *container, const gchar *id ); static gboolean get_options_list_sensitive( GtkWidget *container_parent ); static void set_options_list_sensitive( GtkWidget *container_parent, gboolean sensitive ); static void check_for_initializations( const NAIOptionsList *instance, GtkWidget *container_parent ); static void on_parent_container_finalized( gpointer user_data, GObject *container ); static void on_instance_finalized( gpointer user_data, GObject *instance ); static void radio_button_create_group( const NAIOptionsList *instance, GtkWidget *container_parent, gboolean with_ask ); static void radio_button_draw_vbox( GtkWidget *container_parent, const NAIOption *option ); static void radio_button_weak_notify( NAIOption *option, GObject *vbox ); static void tree_view_create_model( const NAIOptionsList *instance, GtkWidget *container_parent ); static void tree_view_populate( const NAIOptionsList *instance, GtkWidget *container_parent, gboolean with_ask ); static void tree_view_add_item( GtkTreeView *listview, GtkTreeModel *model, const NAIOption *option ); static void tree_view_weak_notify( GtkTreeModel *model, GObject *tree_view ); static void radio_button_select_iter( GtkWidget *container_option, GtkWidget *container_parent ); static gboolean tree_view_select_iter( GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, GtkWidget *container_parent ); static void radio_button_get_selected_iter( GtkWidget *container_option, GtkWidget *container_parent ); static void tree_view_get_selected( const NAIOptionsList *instance, GtkWidget *container_parent ); /** * na_ioptions_list_get_type: * * Returns: the #GType type of this interface. */ GType na_ioptions_list_get_type( void ) { static GType type = 0; if( !type ){ type = register_type(); } return( type ); } /* * na_ioptions_list_register_type: * * Registers this interface. */ static GType register_type( void ) { static const gchar *thisfn = "na_ioptions_list_register_type"; GType type; static const GTypeInfo info = { sizeof( NAIOptionsListInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NAIOptionsList", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( NAIOptionsListInterface *iface ) { static const gchar *thisfn = "na_ioptions_list_interface_base_init"; if( !st_initializations ){ g_debug( "%s: iface=%p (%s)", thisfn, ( void * ) iface, G_OBJECT_CLASS_NAME( iface )); iface->private = g_new0( NAIOptionsListInterfacePrivate, 1 ); iface->get_version = ioptions_list_get_version; iface->get_options = NULL; iface->free_options = ioptions_list_free_options; iface->get_ask_option = NULL; iface->free_ask_option = ioptions_list_free_ask_option; } st_initializations += 1; } static void interface_base_finalize( NAIOptionsListInterface *iface ) { static const gchar *thisfn = "na_ioptions_list_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); g_free( iface->private ); } } /* * defaults implemented by the interface */ static guint ioptions_list_get_version( const NAIOptionsList *instance ) { return( 1 ); } static void ioptions_list_free_options( const NAIOptionsList *instance, GtkWidget *container_parent, GList *options ) { static const gchar *thisfn = "na_ioptions_list_free_options"; g_debug( "%s: instance=%p, container_parent=%p, options=%p", thisfn, ( void * ) instance, ( void * ) container_parent, ( void * ) options ); g_list_foreach( options, ( GFunc ) g_object_unref, NULL ); g_list_free( options ); } static void ioptions_list_free_ask_option( const NAIOptionsList *instance, GtkWidget *container_parent, NAIOption *ask_option ) { static const gchar *thisfn = "na_ioptions_list_free_ask_option"; g_debug( "%s: instance=%p, container_parent=%p, ask_option=%p", thisfn, ( void * ) instance, ( void * ) container_parent, ( void * ) ask_option ); g_object_unref( ask_option ); } /* * call these functions will trigger either the implementation method * or the default provided by the interface */ static GList * options_list_get_options( const NAIOptionsList *instance, GtkWidget *container_parent ) { GList *options; options = NULL; if( NA_IOPTIONS_LIST_GET_INTERFACE( instance )->get_options ){ options = NA_IOPTIONS_LIST_GET_INTERFACE( instance )->get_options( instance, container_parent ); } return( options ); } static void options_list_free_options( const NAIOptionsList *instance, GtkWidget *container_parent, GList *options ) { if( NA_IOPTIONS_LIST_GET_INTERFACE( instance )->free_options ){ NA_IOPTIONS_LIST_GET_INTERFACE( instance )->free_options( instance, container_parent, options ); } } static NAIOption * options_list_get_ask_option( const NAIOptionsList *instance, GtkWidget *container_parent ) { NAIOption *option; option = NULL; if( NA_IOPTIONS_LIST_GET_INTERFACE( instance )->get_ask_option ){ option = NA_IOPTIONS_LIST_GET_INTERFACE( instance )->get_ask_option( instance, container_parent ); } return( option ); } static void options_list_free_ask_option( const NAIOptionsList *instance, GtkWidget *container_parent, NAIOption *ask_option ) { if( NA_IOPTIONS_LIST_GET_INTERFACE( instance )->free_ask_option ){ NA_IOPTIONS_LIST_GET_INTERFACE( instance )->free_ask_option( instance, container_parent, ask_option ); } } /* * get/set pseudo-properties * pseudo properties are set: * - against the instance: whether it has been initialized * - against the parent container: editable, sensitive, default and current options * - against each option container when drawing inside of a VBox: the corresponding option */ /* whether the container has been initialized * * initializing the container so that its pseudo-properties are valid */ static gboolean get_options_list_container_initialized( GtkWidget *container_parent ) { gboolean initialized; initialized = ( gboolean ) GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( container_parent ), IOPTIONS_LIST_DATA_INITIALIZED )); return( initialized ); } static void set_options_list_container_initialized( GtkWidget *container_parent, gboolean initialized ) { g_object_set_data( G_OBJECT( container_parent ), IOPTIONS_LIST_DATA_INITIALIZED, GUINT_TO_POINTER( initialized )); } /* whether the selectable user's preference is editable * most of the time, a user's preference is not editable if it is set as mandatory, * or if the whole user's preference are not writable */ static gboolean get_options_list_editable( GtkWidget *container_parent ) { gboolean editable; editable = ( gboolean ) GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( container_parent ), IOPTIONS_LIST_DATA_EDITABLE )); return( editable ); } static void set_options_list_editable( GtkWidget *container_parent, gboolean editable ) { g_object_set_data( G_OBJECT( container_parent ), IOPTIONS_LIST_DATA_EDITABLE, GUINT_TO_POINTER( editable )); } /* stores the first button of the radio button group */ static GtkWidget * get_options_list_first_button( GtkWidget *container_parent ) { GtkWidget *button; button = ( GtkWidget * ) g_object_get_data( G_OBJECT( container_parent ), IOPTIONS_LIST_DATA_FIRST_BUTTON ); return( button ); } static void set_options_list_first_button( GtkWidget *container_parent, GtkWidget *button ) { g_object_set_data( G_OBJECT( container_parent ), IOPTIONS_LIST_DATA_FIRST_BUTTON, button ); } /* whether the instance has been initialized * * initializing the instance let us register a 'weak notify' signal on the instance * we will so be able to free any allocated resources when the instance will be * finalized */ static gboolean get_options_list_instance_initialized( const NAIOptionsList *instance ) { gboolean initialized; initialized = ( gboolean ) GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( instance ), IOPTIONS_LIST_DATA_INITIALIZED )); return( initialized ); } static void set_options_list_instance_initialized( const NAIOptionsList *instance, gboolean initialized ) { g_object_set_data( G_OBJECT( instance ), IOPTIONS_LIST_DATA_INITIALIZED, GUINT_TO_POINTER( initialized )); } /* the parent container: the current option * the option container: the option attached to this container (VBox only) */ static NAIOption * get_options_list_option( GtkWidget *container ) { return(( NAIOption * ) g_object_get_data( G_OBJECT( container ), IOPTIONS_LIST_DATA_OPTION )); } static void set_options_list_option( GtkWidget *container, NAIOption *option ) { g_object_set_data( G_OBJECT( container ), IOPTIONS_LIST_DATA_OPTION, option ); } /* the string identifier of the option (stored as a GQuark) * it is set in two places: * - at the option container level, in order to identify the option (gtk initialization) * - at the parent container level, when setting the default option (display initialization) */ static const gchar * get_options_list_option_id( GtkWidget *container ) { GQuark quark; const gchar *id; quark = GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( container ), IOPTIONS_LIST_DATA_OPTION_ID )); id = g_quark_to_string( quark ); return( id ); } static void set_options_list_option_id( GtkWidget *container, const gchar *id ) { g_object_set_data( G_OBJECT( container ), IOPTIONS_LIST_DATA_OPTION_ID, GUINT_TO_POINTER( g_quark_from_string( id ))); } /* whether the selectable user's preference is sensitive * * an option should be made insensitive when it is not relevant in * the considered case */ static gboolean get_options_list_sensitive( GtkWidget *container_parent ) { gboolean sensitive; sensitive = ( gboolean ) GPOINTER_TO_UINT( g_object_get_data( G_OBJECT( container_parent ), IOPTIONS_LIST_DATA_SENSITIVE )); return( sensitive ); } static void set_options_list_sensitive( GtkWidget *container_parent, gboolean sensitive ) { g_object_set_data( G_OBJECT( container_parent ), IOPTIONS_LIST_DATA_SENSITIVE, GUINT_TO_POINTER( sensitive )); } /* * check_for_initializations: * @instance: the interface implementation. * @container: the #Gtkwidget which embeds our list of values. * * Setup both instance and container initialization levels. * * Having these levels explicitely initialized not only let us setup weak * references on the objects, but also assert that pseudo-properties have * valid values. */ static void check_for_initializations( const NAIOptionsList *instance, GtkWidget *container_parent ) { static const gchar *thisfn = "na_ioptions_list_check_for_initializations"; if( !get_options_list_instance_initialized( instance )){ g_debug( "%s: instance=%p", thisfn, ( void * ) instance ); g_object_weak_ref( G_OBJECT( instance ), ( GWeakNotify ) on_instance_finalized, NULL ); set_options_list_instance_initialized( instance, TRUE ); } if( !get_options_list_container_initialized( container_parent )){ g_debug( "%s: container_parent=%p", thisfn, ( void * ) container_parent ); set_options_list_editable( container_parent, TRUE ); set_options_list_sensitive( container_parent, TRUE ); g_object_weak_ref( G_OBJECT( container_parent ), ( GWeakNotify ) on_parent_container_finalized, NULL ); set_options_list_container_initialized( container_parent, TRUE ); } } static void on_parent_container_finalized( gpointer user_data, GObject *container ) { static const gchar *thisfn = "na_ioptions_list_on_parent_container_finalized"; g_debug( "%s: user_data=%p, container=%p", thisfn, ( void * ) user_data, ( void * ) container ); } static void on_instance_finalized( gpointer user_data, GObject *instance ) { static const gchar *thisfn = "na_ioptions_list_on_instance_finalized"; g_debug( "%s: user_data=%p, instance=%p", thisfn, ( void * ) user_data, ( void * ) instance ); } /* * na_ioptions_list_gtk_init: * @instance: the object which implements this #NAIOptionsList interface. * @container_parent: the #GtkWidget parent container in which we are going to setup the * list of values. @container_parent may be a #GtkVBox or a #GtkTreeView. * @with_ask: whether we should also display an 'Ask me' option. * * Initialize the gtk objects which will be used to display the selection. */ void na_ioptions_list_gtk_init( const NAIOptionsList *instance, GtkWidget *container_parent, gboolean with_ask ) { static const gchar *thisfn = "na_ioptions_list_gtk_init"; g_return_if_fail( NA_IS_IOPTIONS_LIST( instance )); check_for_initializations( instance, container_parent ); g_debug( "%s: instance=%p (%s), container_parent=%p (%s), with_ask=%s", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) container_parent, G_OBJECT_TYPE_NAME( container_parent ), with_ask ? "True":"False" ); if( GTK_IS_BOX( container_parent )){ radio_button_create_group( instance, container_parent, with_ask ); } else if( GTK_IS_TREE_VIEW( container_parent )){ tree_view_create_model( instance, container_parent ); tree_view_populate( instance, container_parent, with_ask ); } else { g_warning( "%s: unknown container_parent type: %s", thisfn, G_OBJECT_TYPE_NAME( container_parent )); } } static void radio_button_create_group( const NAIOptionsList *instance, GtkWidget *container_parent, gboolean with_ask ) { static const gchar *thisfn = "na_ioptions_list_radio_button_create_group"; GList *options, *iopt; NAIOption *option; g_debug( "%s: instance=%p, container_parent=%p (%s), with_ask=%s", thisfn, ( void * ) instance, ( void * ) container_parent, G_OBJECT_TYPE_NAME( container_parent ), with_ask ? "True":"False" ); options = options_list_get_options( instance, container_parent ); /* draw the formats as a group of radio buttons */ for( iopt = options ; iopt ; iopt = iopt->next ){ radio_button_draw_vbox( container_parent, NA_IOPTION( iopt->data )); } options_list_free_options( instance, container_parent, options ); /* eventually add the 'Ask me' mode */ if( with_ask ){ option = options_list_get_ask_option( instance, container_parent ); radio_button_draw_vbox( container_parent, option ); options_list_free_ask_option( instance, container_parent, option ); } } /* * @container_parent_parent used to be a glade-defined GtkVBox in which we dynamically * add a radio button and its label for each mode: * +- vbox * | +- radio button + label * | +- radio button + label */ static void radio_button_draw_vbox( GtkWidget *container_parent, const NAIOption *option ) { #if 0 static const gchar *thisfn = "na_ioptions_list_radio_button_draw_vbox"; #endif gchar *description; GtkWidget *button; GtkWidget *first; gchar *label; /* first button of the group does not have the property set */ label = na_ioption_get_label( option ); first = get_options_list_first_button( container_parent ); if( first ){ button = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON( first ), label ); } else { button = gtk_radio_button_new_with_label( NULL, label ); set_options_list_first_button( container_parent, button ); } g_free( label ); gtk_button_set_use_underline( GTK_BUTTON( button ), TRUE ); description = na_ioption_get_description( option ); g_object_set( G_OBJECT( button ), "tooltip-text", description, NULL ); g_free( description ); gtk_box_pack_start( GTK_BOX( container_parent ), button, FALSE, TRUE, 0 ); set_options_list_option( button, g_object_ref(( gpointer ) option )); g_object_weak_ref( G_OBJECT( button ), ( GWeakNotify ) radio_button_weak_notify, ( gpointer ) option ); } /* * release the resources attached to each individual 'option' container * when destroying the window */ static void radio_button_weak_notify( NAIOption *option, GObject *vbox ) { static const gchar *thisfn = "na_ioptions_list_radio_button_weak_notify"; g_debug( "%s: option=%p, vbox=%p", thisfn, ( void * ) option, ( void * ) vbox ); g_object_unref( option ); } static void tree_view_create_model( const NAIOptionsList *instance, GtkWidget *container_parent ) { static const gchar *thisfn = "na_ioptions_list_tree_view_create_model"; GtkListStore *model; GtkTreeViewColumn *column; GtkTreeSelection *selection; g_return_if_fail( GTK_IS_TREE_VIEW( container_parent )); g_debug( "%s: instance=%p, container_parent=%p (%s)", thisfn, ( void * ) instance, ( void * ) container_parent, G_OBJECT_TYPE_NAME( container_parent )); model = gtk_list_store_new( N_COLUMN, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_OBJECT ); gtk_tree_view_set_model( GTK_TREE_VIEW( container_parent ), GTK_TREE_MODEL( model )); g_object_unref( model ); /* create visible columns on the tree view */ column = gtk_tree_view_column_new_with_attributes( "image", gtk_cell_renderer_pixbuf_new(), "pixbuf", IMAGE_COLUMN, NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( container_parent ), column ); column = gtk_tree_view_column_new_with_attributes( "label", gtk_cell_renderer_text_new(), "text", LABEL_COLUMN, NULL ); gtk_tree_view_append_column( GTK_TREE_VIEW( container_parent ), column ); g_object_set( G_OBJECT( container_parent ), "tooltip-column", TOOLTIP_COLUMN, NULL ); selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( container_parent )); gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE ); g_object_weak_ref( G_OBJECT( container_parent ), ( GWeakNotify ) tree_view_weak_notify, ( gpointer ) model ); } static void tree_view_populate( const NAIOptionsList *instance, GtkWidget *container_parent, gboolean with_ask ) { static const gchar *thisfn = "na_ioptions_list_tree_view_populate"; GtkTreeModel *model; NAIOption *option; GList *options, *iopt; g_return_if_fail( GTK_IS_TREE_VIEW( container_parent )); g_debug( "%s: instance=%p, container_parent=%p (%s), with_ask=%s", thisfn, ( void * ) instance, ( void * ) container_parent, G_OBJECT_TYPE_NAME( container_parent ), with_ask ? "True":"False" ); model = gtk_tree_view_get_model( GTK_TREE_VIEW( container_parent )); options = options_list_get_options( instance, container_parent ); for( iopt = options ; iopt ; iopt = iopt->next ){ option = NA_IOPTION( iopt->data ); tree_view_add_item( GTK_TREE_VIEW( container_parent ), model, option ); } options_list_free_options( instance, container_parent, options ); /* eventually add the 'Ask me' mode */ if( with_ask ){ option = options_list_get_ask_option( instance, container_parent ); tree_view_add_item( GTK_TREE_VIEW( container_parent ), model, option ); options_list_free_ask_option( instance, container_parent, option ); } } static void tree_view_add_item( GtkTreeView *listview, GtkTreeModel *model, const NAIOption *option ) { GtkTreeIter iter; gchar *label, *label2, *description; GdkPixbuf *pixbuf; label = na_ioption_get_label( option ); label2 = na_core_utils_str_remove_char( label, "_" ); description = na_ioption_get_description( option ); pixbuf = na_ioption_get_pixbuf( option ); gtk_list_store_append( GTK_LIST_STORE( model ), &iter ); gtk_list_store_set( GTK_LIST_STORE( model ), &iter, IMAGE_COLUMN, pixbuf, LABEL_COLUMN, label2, TOOLTIP_COLUMN, description, OBJECT_COLUMN, option, -1 ); if( pixbuf ){ g_object_unref( pixbuf ); } g_free( label ); g_free( label2 ); g_free( description ); } /* * release the data structure attached to each individual 'option' container * when destroying the window */ static void tree_view_weak_notify( GtkTreeModel *model, GObject *tree_view ) { static const gchar *thisfn = "na_iptions_list_tree_view_weak_notify"; g_debug( "%s: model=%p, tree_view=%p", thisfn, ( void * ) model, ( void * ) tree_view ); } /* * na_ioptions_list_set_default: * @instance: the object which implements this #NAIOptionsList interface. * @container_parent: the #GtkWidget which embeds our list of values. * @default_id: the string identifier of the #NAIOption to be set as the default. * * Set the default, either of the radio button group or of the tree view. */ void na_ioptions_list_set_default( const NAIOptionsList *instance, GtkWidget *container_parent, const gchar *default_id ) { static const gchar *thisfn = "na_ioptions_list_set_default"; GtkTreeModel *model; g_return_if_fail( NA_IS_IOPTIONS_LIST( instance )); check_for_initializations( instance, container_parent ); g_debug( "%s: instance=%p (%s), container_parent=%p (%s), default_id=%s", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) container_parent, G_OBJECT_TYPE_NAME( container_parent ), default_id ); set_options_list_option_id( container_parent, default_id ); if( GTK_IS_BOX( container_parent )){ gtk_container_foreach( GTK_CONTAINER( container_parent ), ( GtkCallback ) radio_button_select_iter, container_parent ); } else if( GTK_IS_TREE_VIEW( container_parent )){ model = gtk_tree_view_get_model( GTK_TREE_VIEW( container_parent )); gtk_tree_model_foreach( model, ( GtkTreeModelForeachFunc ) tree_view_select_iter, container_parent ); } else { g_warning( "%s: unknown container_parent type: %s", thisfn, G_OBJECT_TYPE_NAME( container_parent )); } } /* * iterating through each radio button of the group: * - connecting to 'toggled' signal * - activating the button which holds our default value */ static void radio_button_select_iter( GtkWidget *button, GtkWidget *container_parent ) { const gchar *default_id; NAIOption *option; gboolean editable, sensitive; gchar *option_id; default_id = get_options_list_option_id( container_parent ); option = get_options_list_option( button ); option_id = na_ioption_get_id( option ); if( !strcmp( default_id, option_id )){ editable = get_options_list_editable( container_parent ); sensitive = get_options_list_sensitive( container_parent ); na_gtk_utils_radio_set_initial_state( GTK_RADIO_BUTTON( button ), NULL, NULL, editable, sensitive ); g_debug( "na_ioptions_list_radio_button_select_iter: container_parent=%p, set active button=%p", ( void * ) container_parent, ( void * ) button ); } g_free( option_id ); } /* * walks through the rows of the liststore until the function returns %TRUE */ static gboolean tree_view_select_iter( GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, GtkWidget *container_parent ) { gboolean stop; GtkTreeView *tree_view; NAIOption *option; const gchar *default_id; gchar *option_id; GtkTreeSelection *selection; stop = FALSE; tree_view = ( GtkTreeView * ) container_parent; g_return_val_if_fail( GTK_IS_TREE_VIEW( tree_view ), TRUE ); default_id = get_options_list_option_id( container_parent ); gtk_tree_model_get( model, iter, OBJECT_COLUMN, &option, -1 ); g_object_unref( option ); option_id = na_ioption_get_id( option ); if( !strcmp( default_id, option_id )){ selection = gtk_tree_view_get_selection( tree_view ); gtk_tree_selection_select_iter( selection, iter ); stop = TRUE; } g_free( option_id ); return( stop ); } /* * na_ioptions_list_set_editable: * @instance: the object which implements this #NAIOptionsList interface. * @container_parent: the #GtkWidget which embeds our list of values. * @editable: whether the selectable user's preference is editable; * Most of time, a user's preference is not editable if it is set as mandatory, * or if the whole user's preferences are not writable. * * Set the @editable pseudo-property on the @instance #NAIOptionsList instance. */ void na_ioptions_list_set_editable( const NAIOptionsList *instance, GtkWidget *container_parent, gboolean editable ) { static const gchar *thisfn = "na_ioptions_list_set_editable"; g_return_if_fail( NA_IS_IOPTIONS_LIST( instance )); check_for_initializations( instance, container_parent ); g_debug( "%s: instance=%p (%s), container_parent=%p (%s), editable=%s", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) container_parent, G_OBJECT_TYPE_NAME( container_parent ), editable ? "True":"False" ); set_options_list_editable( container_parent, editable ); } /* * na_ioptions_list_set_sensitive: * @instance: the object which implements this #NAIOptionsList interface. * @container_parent: the #GtkWidget which embeds our list of values. * @sensitive: whether the radio button group is to be sensitive; * a widget should not be sensitive if the selectable option is not relevant * in the considered case. * * Set the @sensitive pseudo-property on the @instance #NAIOptionsList instance. */ void na_ioptions_list_set_sensitive( const NAIOptionsList *instance, GtkWidget *container_parent, gboolean sensitive ) { static const gchar *thisfn = "na_ioptions_list_set_sensitive"; g_return_if_fail( NA_IS_IOPTIONS_LIST( instance )); check_for_initializations( instance, container_parent ); g_debug( "%s: instance=%p (%s), container_parent=%p (%s), sensitive=%s", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) container_parent, G_OBJECT_TYPE_NAME( container_parent ), sensitive ? "True":"False" ); set_options_list_sensitive( container_parent, sensitive ); } /* * na_ioptions_list_get_selected: * @instance: the object which implements this #NAIOptionsList interface. * @container_parent: the #GtkWidget which embeds our list of values. * * Returns: the currently selected #NAIOption. */ NAIOption * na_ioptions_list_get_selected( const NAIOptionsList *instance, GtkWidget *container_parent ) { static const gchar *thisfn = "na_ioptions_list_get_selected"; NAIOption *option; g_return_val_if_fail( NA_IS_IOPTIONS_LIST( instance ), NULL ); check_for_initializations( instance, container_parent ); g_debug( "%s: instance=%p (%s), container_parent=%p (%s)", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) container_parent, G_OBJECT_TYPE_NAME( container_parent )); option = NULL; if( GTK_IS_BOX( container_parent )){ gtk_container_foreach( GTK_CONTAINER( container_parent ), ( GtkCallback ) radio_button_get_selected_iter, container_parent ); option = get_options_list_option( container_parent ); } else if( GTK_IS_TREE_VIEW( container_parent )){ tree_view_get_selected( instance, container_parent ); option = get_options_list_option( container_parent ); } else { g_warning( "%s: unknown container_parent type: %s", thisfn, G_OBJECT_TYPE_NAME( container_parent )); } return( option ); } static void radio_button_get_selected_iter( GtkWidget *button, GtkWidget *container_parent ) { NAIOption *option; if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ))){ option = get_options_list_option( button ); set_options_list_option( container_parent, option ); g_debug( "na_ioptions_list_radio_button_get_selected_iter: container_parent=%p, active button=%p", ( void * ) container_parent, ( void * ) button ); } } static void tree_view_get_selected( const NAIOptionsList *instance, GtkWidget *container_parent ) { GtkTreeSelection *selection; GList *rows; GtkTreeModel *model; GtkTreeIter iter; NAIOption *option; selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( container_parent )); rows = gtk_tree_selection_get_selected_rows( selection, &model ); g_return_if_fail( g_list_length( rows ) == 1 ); gtk_tree_model_get_iter( model, &iter, ( GtkTreePath * ) rows->data ); gtk_tree_model_get( model, &iter, OBJECT_COLUMN, &option, -1 ); g_object_unref( option ); g_list_foreach( rows, ( GFunc ) gtk_tree_path_free, NULL ); g_list_free( rows ); set_options_list_option( container_parent, option ); } nautilus-actions-3.2.3/src/core/README0000664000175100017500000000022311700121167014335 00000000000000This is the core dynamic library for Nautilus-Actions. Come here which is not in the API and should yet be shared between several N-A components. nautilus-actions-3.2.3/src/core/na-about.h0000644000175100017500000000326612212601376015350 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_ABOUT_H__ #define __CORE_NA_ABOUT_H__ /* @title NAAbout * @short_description: The #NAAbout API * @include: runtime/na-about.h * * These functions displays the 'About Nautilus-Actions' dialog box, * and provides contant informations about the application. */ #include G_BEGIN_DECLS void na_about_display( GtkWindow *parent ); gchar *na_about_get_application_name( void ); const gchar *na_about_get_icon_name( void ); gchar *na_about_get_copyright( gboolean console ); G_END_DECLS #endif /* __CORE_NA_IABOUT_H__ */ nautilus-actions-3.2.3/src/core/import-mode-ask.png0000664000175100017500000000766111674472206017225 00000000000000PNG  IHDR00WsRGBbKGD pHYs  tIME + @1IDAThYYy9wfZ.IѦQT,;ˎbl4 Fy! ~[8 ÖJIkW$s=GUyكmK (tuOu ^{_7z7?rW|}}j;lS퓩&O[y5:_l_gK_]s q\=0ڻqQϺ5)j@ $ t@<|W$/oᙯ;ӹƯO/('_yrki4^g]`sݕixOX0}xv.+!lq/o:`vhF!U>;@mG#sU3gGo̼^t$m9"q{.hbb0H=\OAbrE`~sN"PCw2߭BwI18m4>pu){"۵?@>@/=d .9wa F`]}[e(ϟl7w@!` 9g怪?؝ ]*^i@bOUFYtkT][H_} KxfOCIA5R{2IƾպOW+\rPhx~*tpgUyEs1`bGivqH2zʺ] 80g$o1PEW18X5<dJb9U·^5Pj\i7_!:nfG4%$ `vZ|I-p)40)vڞ*Y{ `:RW*﯎,&K~q$B!J'AE0Idpd X"kj$ro[Kqcc}&:W $ƂoLp4=9۳3cTs% ! 0Ơit|\H$d݈Ji̴p,3!iWV}ʏ#hu4>zIxZ ]x٧x~=yl#ӇF?zd|SKJ(ɱ .Tz4:=FE @Bcu'B.rJՙ܋?@4ZSSc@Q<9/藏}o>񾡄|Tzg&L5$aHp <@ ǃe@zH 6Vp<@BZ~/B'=,; ^VvU'@Aڃ~` cxz766V G$l i`qcA ŐA2z¶цzFV+_;ߵ^'aؗy9[ʏ4s…Ru{ N8^| ;/;ֱKQIĝz7^xgBƈbo ]K5s}=Y@0|퍾ŗ..YjJ"A; ,\B[F\UtVf$E/2dt7 dpH;=GS%cVV}RyP(䈨 QRra?Zd\x#㇦*":K8K$Q[.^m Q8HR8H^` px]T;Q̡cË,YZSJ'1F%llEM8H[^@w:z&}(185{$ Q>ڥaH>I"=7NBfhtSΝ嬛 b *zYƼֵzz~v\eAQ.tk5W^GDQ(Cؠ7wS4{ S`:xS dh@஌W=GI~L>A޸F 6ch)] 6f֥՝  ͎%wI:(h5)V-"JH""360y!29y'B*[p+ձrn8ͅ3z62)#u o; 2ԙPAAHG!85S\3He 9GM#Pԁ0AX=ӇI4+% 9(~:d0:>Ǐȓ'OybI_l6)YHna VWnu6~p{š0/vL7$ls6z.z6:غ1F9%l`4%tX}S;{y8HJXfm' 6k[|~ԚҾ }\F.OcdR=>Z" e^ͭDabvӟA-out4@7< T2 p$4 ` ziF3miьvl팖F]WE3ȱCgk7#RmVY߬piXI`$gG*`~m_ټo}&s=TGq#8yH8N]Yr y Ni Ra$e|0l>uF RHMʫJ庮;̃BI}xhźQs3@hHXnPEK:߄f`q^>{8 D0^`oXl~S}fnBn',!Huƌ%frV\p}d1ֻbP8XR`m24)1>>*eVWǕJ 33f;&pc?{䡧GGzFM1RVY]>8WzϽ@w=Y68}r0/|#we-O\̆O=2S}E܉^Yj^_ɩљCaRv[h I|ߊOϜ>u^|hukml;tS'y7oޜW/acGH_|u֭;/< oٜRj~ 9SM/l;(x`*50VܺzW/_Ǝ&i*;bg(:]$SB4ǩqJ)ΥRi$VWW1993,k?y`pIENDB`nautilus-actions-3.2.3/src/core/na-importer-ask.ui0000664000175100017500000001451711700105242017034 00000000000000 5 Already existing item True center-on-parent dialog True vertical 2 True vertical 6 True vertical 6 True 0 6 True 0 True 0 6 What should I do with this ? 1 False 0 True vertical False 1 True False 2 True Re_member my choice in future import operations True True False True 0 True 0 False 3 False 2 True end gtk-cancel True True True True False False 0 gtk-ok True True True True False False 1 False end 0 CancelButton OKButton nautilus-actions-3.2.3/src/core/na-factory-provider.c0000644000175100017500000000663012212601376017526 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "na-factory-provider.h" /* * na_factory_provider_read_data: * @reader: the instance which implements this #NAIFactoryProvider interface. * @reader_data: instance data. * @object: the #NAIFactoryobject being unserialized. * @def: a #NADataDef structure which identifies the data to be unserialized. * @messages: a pointer to a #GSList list of strings; the implementation * may append messages to this list, but shouldn't reinitialize it. * * Reads the specified data and set it up into the @boxed. * * Returns: a new #NADataBoxed object which contains the data. */ NADataBoxed * na_factory_provider_read_data( const NAIFactoryProvider *reader, void *reader_data, const NAIFactoryObject *object, const NADataDef *def, GSList **messages ) { NADataBoxed *boxed; g_return_val_if_fail( NA_IS_IFACTORY_PROVIDER( reader ), NULL ); g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL ); boxed = NULL; if( NA_IFACTORY_PROVIDER_GET_INTERFACE( reader )->read_data ){ boxed = NA_IFACTORY_PROVIDER_GET_INTERFACE( reader )->read_data( reader, reader_data, object, def, messages ); } return( boxed ); } /* * na_factory_provider_write_data: * @writer: the instance which implements this #NAIFactoryProvider interface. * @writer_data: instance data. * @object: the #NAIFactoryobject being serialized. * @boxed: the #NADataBoxed object which is to be serialized. * @messages: a pointer to a #GSList list of strings; the implementation * may append messages to this list, but shouldn't reinitialize it. * * Returns: a NAIIOProvider operation return code. */ guint na_factory_provider_write_data( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, const NADataBoxed *boxed, GSList **messages ) { guint code; g_return_val_if_fail( NA_IS_IFACTORY_PROVIDER( writer ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR ); code = NA_IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN; if( NA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_data ){ code = NA_IFACTORY_PROVIDER_GET_INTERFACE( writer )->write_data( writer, writer_data, object, boxed, messages ); } return( code ); } nautilus-actions-3.2.3/src/test/0000755000175100017500000000000012220365533013572 500000000000000nautilus-actions-3.2.3/src/test/test-iface.c0000755000175100017500000000547212212633542015714 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ /* We verify here that derived class can also use interfaces implemented * in base class. */ #include #include "test-iface-derived.h" #include "test-iface-iface.h" int main( int argc, char **argv ) { TestBase *base, *base2; TestDerived *derived; #if !GLIB_CHECK_VERSION( 2,36, 0 ) g_type_init(); #endif g_debug( "allocating TestBase -------------------------------------" ); base = test_base_new(); g_debug( "calling test_iface_fna on Base object -------------------" ); test_iface_fna( TEST_IFACE( base )); g_debug( "calling test_iface_fnb on Base object -------------------" ); test_iface_fnb( TEST_IFACE( base )); g_debug( "allocating TestDerived ----------------------------------" ); derived = test_derived_new(); if( TEST_IS_IFACE( derived )){ g_debug( "Derived is also an IFace" ); } else { g_debug( "Derived is NOT an IFace" ); } g_debug( "calling test_iface_fna on Derived object ----------------" ); test_iface_fna( TEST_IFACE( derived )); g_debug( "calling test_iface_fnb on Derived object ----------------" ); test_iface_fnb( TEST_IFACE( derived )); g_debug( "allocating TestBase -------------------------------------" ); base2 = test_base_new(); g_debug( "calling test_iface_fna on another Base object -------------------" ); test_iface_fna( TEST_IFACE( base2 )); g_debug( "calling test_iface_fnb on another Base object -------------------" ); test_iface_fnb( TEST_IFACE( base2 )); g_debug( "unreffing TestDerived ------------------------------------" ); g_object_unref( derived ); g_debug( "unreffing TestBase ------------------------------------" ); g_object_unref( base ); g_debug( "end -----------------------------------------------------" ); return( 0 ); } nautilus-actions-3.2.3/src/test/test-parse-uris.c0000644000175100017500000000431512212633542016727 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include static const gchar *uris[] = { "http://robert:azerty01@mon.domain.com/path/to/a/document?query#anchor", "ssh://pwi.dyndns.biz:2207", "sftp://kde.org:1234/pub/kde", "/usr/bin/nautilus-actions-config-tool", "file:///home/pierre/data/eclipse/nautilus-actions/AUTHORS", NULL }; int main( int argc, char** argv ) { int i; #if !GLIB_CHECK_VERSION( 2,36, 0 ) g_type_init(); #endif g_printf( "URIs parsing test.\n\n" ); for( i = 0 ; uris[i] ; ++i ){ NAGnomeVFSURI *vfs = g_new0( NAGnomeVFSURI, 1 ); na_gnome_vfs_uri_parse( vfs, uris[i] ); g_printf( "original uri=%s\n", uris[i] ); g_printf( "vfs path=%s\n", vfs->path ); g_printf( "vfs scheme=%s\n", vfs->scheme ); g_printf( "vfs host_name=%s\n", vfs->host_name ); g_printf( "vfs host_port=%d\n", vfs->host_port ); g_printf( "vfs user_name=%s\n", vfs->user_name ); g_printf( "vfs password=%s\n", vfs->password ); g_printf( "\n" ); } return( EXIT_SUCCESS ); } nautilus-actions-3.2.3/src/test/test-iface-iface.h0000644000175100017500000000505412212601376016757 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __TEST_IFACE_IFACE_H__ #define __TEST_IFACE_IFACE_H__ /** * SECTION: test_iface * @short_description: #TestIFace interface definition. * @include: test-iface-iface.h * * Test to see if a derived class can directly beneficiate of the * interface implemented by its base class, or if we have to implement * virtual functions in the base class. */ #include G_BEGIN_DECLS #define TEST_IFACE_TYPE ( test_iface_get_type()) #define TEST_IFACE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, TEST_IFACE_TYPE, TestIFace )) #define TEST_IS_IFACE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, TEST_IFACE_TYPE )) #define TEST_IFACE_GET_INTERFACE( instance )( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), TEST_IFACE_TYPE, TestIFaceInterface )) typedef struct TestIFace TestIFace; typedef struct TestIFaceInterfacePrivate TestIFaceInterfacePrivate; typedef struct { GTypeInterface parent; TestIFaceInterfacePrivate *private; /** * fna: * @target: the #TestIFace target of the copy. * @source: the #TestIFace source of the copy * * Copies data from @source to @ŧarget, so that @target becomes an * exact copy of @source. */ void ( *fna )( TestIFace *object ); void ( *fnb )( TestIFace *object ); } TestIFaceInterface; GType test_iface_get_type( void ); void test_iface_fna( TestIFace *object ); void test_iface_fnb( TestIFace *object ); G_END_DECLS #endif /* __TEST_IFACE_IFACE_H__ */ nautilus-actions-3.2.3/src/test/test-reader.c0000755000175100017500000001122312212633542016076 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include static gchar *uri = ""; static gboolean version = FALSE; static GOptionEntry entries[] = { { "uri" , 'u', 0, G_OPTION_ARG_STRING , &uri, N_( "The URI of the file to be imported" ), N_( "" ) }, { NULL } }; static GOptionEntry misc_entries[] = { { "version" , 'v', 0, G_OPTION_ARG_NONE , &version, N_( "Output the version number" ), NULL }, { NULL } }; static GOptionContext *init_options( void ); static void check_options( int argc, char **argv, GOptionContext *context ); static void exit_with_usage( void ); int main( int argc, char **argv ) { NAImporterParms parms; GList *import_results; NAImporterResult *result; #if !GLIB_CHECK_VERSION( 2,36, 0 ) g_type_init(); #endif GOptionContext *context = init_options(); check_options( argc, argv, context ); NAPivot *pivot = na_pivot_new(); na_pivot_set_loadable( pivot, !PIVOT_LOAD_DISABLED & !PIVOT_LOAD_INVALID ); na_pivot_load_items( pivot ); parms.uris = g_slist_prepend( NULL, uri ); parms.check_fn = NULL; parms.check_fn_data = NULL; parms.preferred_mode = IMPORTER_MODE_ASK; parms.parent_toplevel = NULL; import_results = na_importer_import_from_uris( pivot, &parms ); result = import_results->data; if( result->imported ){ na_object_dump( result->imported ); g_object_unref( result->imported ); } na_core_utils_slist_dump( NULL, result->messages ); na_core_utils_slist_free( result->messages ); return( 0 ); } static GOptionContext * init_options( void ) { GOptionContext *context; gchar* description; GOptionGroup *misc_group; context = g_option_context_new( _( "Import a file." )); #ifdef ENABLE_NLS bindtextdomain( GETTEXT_PACKAGE, GNOMELOCALEDIR ); # ifdef HAVE_BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" ); # endif textdomain( GETTEXT_PACKAGE ); g_option_context_add_main_entries( context, entries, GETTEXT_PACKAGE ); #else g_option_context_add_main_entries( context, entries, NULL ); #endif description = g_strdup_printf( "%s.\n%s", PACKAGE_STRING, _( "Bug reports are welcomed at http://bugzilla.gnome.org," " or you may prefer to mail to .\n" )); g_option_context_set_description( context, description ); g_free( description ); misc_group = g_option_group_new( "misc", _( "Miscellaneous options" ), _( "Miscellaneous options" ), NULL, NULL ); g_option_group_add_entries( misc_group, misc_entries ); g_option_context_add_group( context, misc_group ); return( context ); } static void check_options( int argc, char **argv, GOptionContext *context ) { GError *error = NULL; if( argc == 1 ){ g_set_prgname( argv[0] ); gchar *help = g_option_context_get_help( context, FALSE, NULL ); g_print( "\n%s", help ); g_free( help ); exit( EXIT_SUCCESS ); } if( !g_option_context_parse( context, &argc, &argv, &error )){ g_printerr( _( "Syntax error: %s\n" ), error->message ); g_error_free (error); exit_with_usage(); } g_option_context_free( context ); if( version ){ na_core_utils_print_version(); exit( EXIT_SUCCESS ); } gint errors = 0; if( !uri || !strlen( uri )){ g_printerr( _( "Error: uri is mandatory.\n" )); errors += 1; } if( errors ){ exit_with_usage(); } } static void exit_with_usage( void ) { g_printerr( _( "Try %s --help for usage.\n" ), g_get_prgname()); exit( EXIT_FAILURE ); } nautilus-actions-3.2.3/src/test/test-iface2.c0000755000175100017500000002201312212633542015764 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ /* A class with implements an interface * This interface itself requiring the class... */ #include #include /* ******************************************************************** * Declaring the interface * ********************************************************************/ #define TEST_IFACE_TYPE ( test_iface_get_type()) #define TEST_IFACE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, TEST_IFACE_TYPE, TestIFace )) #define TEST_IS_IFACE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, TEST_IFACE_TYPE )) #define TEST_IFACE_GET_INTERFACE( instance )( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), TEST_IFACE_TYPE, TestIFaceInterface )) typedef struct TestIFace TestIFace; typedef struct TestIFaceInterfacePrivate TestIFaceInterfacePrivate; typedef struct { GTypeInterface parent; TestIFaceInterfacePrivate *private; } TestIFaceInterface; GType test_iface_get_type( void ); /* ******************************************************************** * Declaring the class * ********************************************************************/ #define TEST_BASE_TYPE ( test_base_get_type()) #define TEST_BASE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, TEST_BASE_TYPE, TestBase )) #define TEST_BASE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, TEST_BASE_TYPE, TestBaseClass )) #define TEST_IS_BASE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, TEST_BASE_TYPE )) #define TEST_IS_BASE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), TEST_BASE_TYPE )) #define TEST_BASE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), TEST_BASE_TYPE, TestBaseClass )) typedef struct TestBasePrivate TestBasePrivate; typedef struct { GObject parent; TestBasePrivate *private; } TestBase; typedef struct TestBaseClassPrivate TestBaseClassPrivate; typedef struct { GObjectClass parent; TestBaseClassPrivate *private; } TestBaseClass; GType test_base_get_type( void ); static TestBase *test_base_new( void ); /* ******************************************************************** * Implementing the interface * ********************************************************************/ /* private interface data */ struct TestIFaceInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; static guint st_initializations = 0; static GType iface_register_type( void ); static void interface_base_init( TestIFaceInterface *klass ); static void interface_base_finalize( TestIFaceInterface *klass ); GType test_iface_get_type( void ) { static GType iface_type = 0; if( !iface_type ){ iface_type = iface_register_type(); } return( iface_type ); } static GType iface_register_type( void ) { static const gchar *thisfn = "test_iface_iface_register_type"; GType type; static const GTypeInfo info = { sizeof( TestIFaceInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "TestIFace", &info, 0 ); g_type_interface_add_prerequisite( type, TEST_BASE_TYPE ); return( type ); } static void interface_base_init( TestIFaceInterface *klass ) { static const gchar *thisfn = "test_iface_iface_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); klass->private = g_new0( TestIFaceInterfacePrivate, 1 ); } st_initializations += 1; } static void interface_base_finalize( TestIFaceInterface *klass ) { static const gchar *thisfn = "test_iface_iface_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } /* ******************************************************************** * Implementing the class * ********************************************************************/ /* private class data */ struct TestBaseClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct TestBasePrivate { gboolean dispose_has_run; }; static GObjectClass *st_parent_class = NULL; static GType base_register_type( void ); static void class_init( TestBaseClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void iface_iface_init( TestIFaceInterface *iface, void *user_data ); GType test_base_get_type( void ) { static GType object_type = 0; static const GInterfaceInfo iface_iface_info = { ( GInterfaceInitFunc ) iface_iface_init, NULL, NULL }; if( !object_type ){ object_type = base_register_type(); g_type_add_interface_static( object_type, TEST_IFACE_TYPE, &iface_iface_info ); } return( object_type ); } static GType base_register_type( void ) { static const gchar *thisfn = "test_iface_base_register_type"; GType type; static GTypeInfo info = { sizeof( TestBaseClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( TestBase ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "TestBase", &info, 0 ); return( type ); } static void class_init( TestBaseClass *klass ) { static const gchar *thisfn = "test_iface_base_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( TestBaseClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "test_iface_base_instance_init"; TestBase *self; g_return_if_fail( TEST_IS_BASE( instance )); self = TEST_BASE( instance ); g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) instance, ( void * ) klass ); self->private = g_new0( TestBasePrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "test_iface_base_instance_dispose"; TestBase *self; g_return_if_fail( TEST_IS_BASE( object )); self = TEST_BASE( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p", thisfn, ( void * ) object ); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "test_iface_base_instance_finalize"; TestBase *self; g_return_if_fail( TEST_IS_BASE( object )); self = ( TestBase * ) object; g_debug( "%s: object=%p", thisfn, ( void * ) object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } static TestBase * test_base_new( void ) { TestBase *object = g_object_new( TEST_BASE_TYPE, NULL ); return( object ); } static void iface_iface_init( TestIFaceInterface *iface, void *user_data ) { static const gchar *thisfn = "test_iface_base_iface_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); } /* ******************************************************************** * main * ********************************************************************/ int main( int argc, char **argv ) { TestBase *base; #if !GLIB_CHECK_VERSION( 2,36, 0 ) g_type_init(); #endif g_debug( "allocating TestBase -------------------------------------" ); base = test_base_new(); g_debug( "unreffing TestBase ------------------------------------" ); g_object_unref( base ); g_debug( "end -----------------------------------------------------" ); return( 0 ); } nautilus-actions-3.2.3/src/test/test-iface-derived.h0000644000175100017500000000505512212601376017333 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __TEST_IFACE_DERIVED_H__ #define __TEST_IFACE_DERIVED_H__ /** * SECTION: test_iface_derived * @short_description: #TestDerived class definition. * @include: test-iface-derived.h * * Derivation of TestBae class. * Are we able to define our own implementation of testIFace interface ? * Also, the derived class is it recognized as implementing the interface ? */ #include "test-iface-base.h" G_BEGIN_DECLS #define TEST_DERIVED_TYPE ( test_derived_get_type()) #define TEST_DERIVED( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, TEST_DERIVED_TYPE, TestDerived )) #define TEST_DERIVED_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, TEST_DERIVED_TYPE, TestDerivedClass )) #define TEST_IS_DERIVED( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, TEST_DERIVED_TYPE )) #define TEST_IS_DERIVED_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), TEST_DERIVED_TYPE )) #define TEST_DERIVED_GET_CLASS( object )( G_TYPE_INSTANCE_GET_CLASS(( object ), TEST_DERIVED_TYPE, TestDerivedClass )) typedef struct TestDerivedPrivate TestDerivedPrivate; typedef struct { TestBase parent; TestDerivedPrivate *private; } TestDerived; typedef struct TestDerivedClassPrivate TestDerivedClassPrivate; typedef struct { TestBaseClass parent; TestDerivedClassPrivate *private; } TestDerivedClass; GType test_derived_get_type( void ); TestDerived *test_derived_new( void ); G_END_DECLS #endif /* __TEST_IFACE_DERIVED_H__ */ nautilus-actions-3.2.3/src/test/test-module-plugin.c0000755000175100017500000001737412212601376017432 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include /* this is a plugin, i.e. a dynamically loaded resource */ G_MODULE_EXPORT const gchar *g_module_check_init( GModule *module ); G_MODULE_EXPORT void g_module_unload( GModule *module ); #if 0 /* this is first version * the module is loaded, the function called, and then the module is unloaded * note that we do not define any GType here, so do not provide any sort of * GInterface implementation * (process:23911): NA-test-DEBUG: in g_module_check_init: module=0xf97f20 (process:23911): NA-test-DEBUG: say_hello: module=0xf97f20 (process:23911): NA-test-DEBUG: in g_module_unload: module=0xf97f20 * */ G_MODULE_EXPORT void say_hello( GModule *module ); /* automatically called when the module is loaded */ G_MODULE_EXPORT const gchar * g_module_check_init( GModule *module ) { const gchar *error; error = NULL; g_debug( "in g_module_check_init: module=%p", ( void * ) module ); return( error ); } /* automatically called when the module is unloaded */ G_MODULE_EXPORT void g_module_unload( GModule *module ) { g_debug( "in g_module_unload: module=%p", ( void * ) module ); } /* a function dynamically called from the program */ G_MODULE_EXPORT void say_hello( GModule *module ) { g_debug( "say_hello: module=%p", ( void * ) module ); } #endif /* version 2 * define the module as a GTypeModule-derived one */ #define TEST_MODULE_PLUGIN_TYPE ( na_module_plugin_get_type()) #define TEST_MODULE_PLUGIN( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, TEST_MODULE_PLUGIN_TYPE, NAModulePlugin )) #define TEST_MODULE_PLUGIN_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, TEST_MODULE_PLUGIN_TYPE, NAModulePluginClass )) #define TEST_IS_MODULE_PLUGIN( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, TEST_MODULE_PLUGIN_TYPE )) #define TEST_IS_MODULE_PLUGIN_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), TEST_MODULE_PLUGIN_TYPE )) #define TEST_MODULE_PLUGIN_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), TEST_MODULE_PLUGIN_TYPE, NAModulePluginClass )) typedef struct _NAModulePluginPrivate NAModulePluginPrivate; typedef struct _NAModulePluginClassPrivate NAModulePluginClassPrivate; typedef struct { GObject parent; NAModulePluginPrivate *private; } NAModulePlugin; typedef struct { GObjectClass parent; NAModulePluginClassPrivate *private; } NAModulePluginClass; GType na_module_plugin_get_type( void ); /* private instance data */ struct _NAModulePluginPrivate { gboolean dispose_has_run; }; /* private class data */ struct _NAModulePluginClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; static GType st_module_type = 0; static GTypeModuleClass *st_parent_class = NULL; static void na_module_plugin_register_type( GTypeModule *module ); static void class_init( NAModulePluginClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); G_MODULE_EXPORT void plugin_init( GTypeModule *module ); GType na_module_plugin_get_type( void ) { return( st_module_type ); } static void na_module_plugin_register_type( GTypeModule *module ) { static const gchar *thisfn = "na_module_plugin_register_type"; static GTypeInfo info = { sizeof( NAModulePluginClass ), NULL, NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAModulePlugin ), 0, ( GInstanceInitFunc ) instance_init }; /*static const GInterfaceInfo iio_provider_iface_info = { ( GInterfaceInitFunc ) iio_provider_iface_init, NULL, NULL };*/ g_debug( "%s", thisfn ); st_module_type = g_type_module_register_type( module, G_TYPE_OBJECT, "NAModulePlugin", &info, 0 ); /*g_type_module_add_interface( module, st_module_type, NA_TYPE_IIO_PROVIDER, &iio_provider_iface_info );*/ } static void class_init( NAModulePluginClass *klass ) { static const gchar *thisfn = "na_module_plugin_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NAModulePluginClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_module_plugin_instance_init"; NAModulePlugin *self; g_return_if_fail( TEST_IS_MODULE_PLUGIN( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = TEST_MODULE_PLUGIN( instance ); self->private = g_new0( NAModulePluginPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_module_plugin_instance_dispose"; NAModulePlugin *self; g_return_if_fail( TEST_IS_MODULE_PLUGIN( object )); self = TEST_MODULE_PLUGIN( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_test_module_plugin_instance_finalize"; NAModulePlugin *self; g_return_if_fail( TEST_IS_MODULE_PLUGIN( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = TEST_MODULE_PLUGIN( object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } /* automatically called when the module is loaded * this is very less useful in this version as we need a GTypeModule to register * our dynamic types */ G_MODULE_EXPORT const gchar * g_module_check_init( GModule *module ) { g_debug( "in g_module_check_init: module=%p", ( void * ) module ); return( NULL ); } /* automatically called when the module is unloaded */ G_MODULE_EXPORT void g_module_unload( GModule *module ) { g_debug( "in g_module_unload: module=%p", ( void * ) module ); } /* module is actually a NAModule, but we do not care of that * registering the type - but do not yet allocate an object */ G_MODULE_EXPORT void plugin_init( GTypeModule *module ) { g_debug( "plugin_init: module=%p", ( void * ) module ); na_module_plugin_register_type( module ); } nautilus-actions-3.2.3/src/test/test-iface-base.h0000644000175100017500000000450612212601376016623 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __TEST_IFACE_BASE_H__ #define __TEST_IFACE_BASE_H__ /** * SECTION: test_iface_base * @short_description: #TestBase class definition. * @include: test-iface-base.h * * A base class which implements TestIFace interface. */ #include G_BEGIN_DECLS #define TEST_BASE_TYPE ( test_base_get_type()) #define TEST_BASE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, TEST_BASE_TYPE, TestBase )) #define TEST_BASE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, TEST_BASE_TYPE, TestBaseClass )) #define TEST_IS_BASE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, TEST_BASE_TYPE )) #define TEST_IS_BASE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), TEST_BASE_TYPE )) #define TEST_BASE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), TEST_BASE_TYPE, TestBaseClass )) typedef struct TestBasePrivate TestBasePrivate; typedef struct { GObject parent; TestBasePrivate *private; } TestBase; typedef struct TestBaseClassPrivate TestBaseClassPrivate; typedef struct { GObjectClass parent; TestBaseClassPrivate *private; } TestBaseClass; GType test_base_get_type( void ); TestBase *test_base_new( void ); G_END_DECLS #endif /* __TEST_IFACE_BASE_H__ */ nautilus-actions-3.2.3/src/test/test-iface-iface.c0000644000175100017500000001300612212601376016746 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include "test-iface-iface.h" #include "test-iface-base.h" /* private interface data */ struct TestIFaceInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; static GType register_type( void ); static void interface_base_init( TestIFaceInterface *klass ); static void interface_base_finalize( TestIFaceInterface *klass ); static void v_fna( TestIFace *object ); static void do_fna( TestIFace *object ); GType test_iface_get_type( void ) { static GType iface_type = 0; if( !iface_type ){ iface_type = register_type(); } return( iface_type ); } static GType register_type( void ) { static const gchar *thisfn = "test_iface_iface_register_type"; GType type; static const GTypeInfo info = { sizeof( TestIFaceInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "TestIFace", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( TestIFaceInterface *klass ) { static const gchar *thisfn = "test_iface_iface_interface_base_init"; static gboolean initialized = FALSE; g_debug( "%s: klass=%p, initialized=%s", thisfn, ( void * ) klass, initialized ? "True":"False" ); if( !initialized ){ klass->private = g_new0( TestIFaceInterfacePrivate, 1 ); initialized = TRUE; } } static void interface_base_finalize( TestIFaceInterface *klass ) { static const gchar *thisfn = "test_iface_iface_interface_base_finalize"; static gboolean finalized = FALSE ; g_debug( "%s: klass=%p, finalized=%s", thisfn, ( void * ) klass, finalized ? "True":"False" ); if( !finalized ){ finalized = TRUE; g_free( klass->private ); } } /* * only call the implementation of the most-derived class (if any) * if the most-derived class has not implemented the function, * then fallback to local default */ void test_iface_fna( TestIFace *object ) { static const gchar *thisfn = "test_iface_iface_fna"; g_debug( "%s: %s at %p", thisfn, G_OBJECT_TYPE_NAME( object ), ( void * ) object ); v_fna( object ); } static void v_fna( TestIFace *object ) { static const gchar *thisfn = "test_iface_iface_v_fna"; g_debug( "%s: %s at %p", thisfn, G_OBJECT_TYPE_NAME( object ), ( void * ) object ); if( TEST_IFACE_GET_INTERFACE( object )->fna ){ TEST_IFACE_GET_INTERFACE( object )->fna( object ); } else { do_fna( object ); } } static void do_fna( TestIFace *object ) { static const gchar *thisfn = "test_iface_iface_do_fna"; g_debug( "%s: %s at %p", thisfn, G_OBJECT_TYPE_NAME( object ), ( void * ) object ); } /* * successively call the implementation (if any) of each derived class * in the hierarchy order, from topmost base class to most-derived class * if any of class in the hierarchy has not implemented the function, the * do nothing and go to next class */ void test_iface_fnb( TestIFace *object ) { static const gchar *thisfn = "test_iface_iface_fnb"; GSList *hierarchy; GObjectClass *class; GType type; GType base_type; GSList *ic; GTypeInterface *iface; g_debug( "%s: %s at %p", thisfn, G_OBJECT_TYPE_NAME( object ), ( void * ) object ); g_debug( "%s: g_type_from_instance=%d", thisfn, ( gint ) G_TYPE_FROM_INSTANCE( object )); g_debug( "%s: g_type_from_interface=%d", thisfn, ( gint ) G_TYPE_FROM_INTERFACE( object )); hierarchy = NULL; base_type = TEST_BASE_TYPE; type = G_OBJECT_TYPE( object ); g_debug( "%s: type=%d %s", thisfn, ( gint ) type, G_OBJECT_TYPE_NAME( object )); while( TRUE ){ /*hierarchy = g_slist_prepend( hierarchy, class );*/ hierarchy = g_slist_prepend( hierarchy, GINT_TO_POINTER( type )); /*type = G_TYPE_FROM_CLASS( class );*/ if( type == base_type ){ break; } type = g_type_parent( type ); if( !type ){ g_debug( "%s: GOT ZERO TYPE", thisfn ); break; } } for( ic = hierarchy ; ic ; ic = ic->next ){ type = GPOINTER_TO_INT( ic->data ); g_debug( "%s: iterating on %d type", thisfn, ( gint ) type ); class = g_type_class_peek_static( type ); g_debug( "%s: class is %s at %p", thisfn, G_OBJECT_CLASS_NAME( class ), ( void * ) class ); iface = g_type_interface_peek( class, TEST_IFACE_TYPE ); g_debug( "%s: iface at %p", thisfn, ( void * ) iface ); if( (( TestIFaceInterface * ) iface )->fnb ){ (( TestIFaceInterface * ) iface )->fnb( object ); } } } nautilus-actions-3.2.3/src/test/test-iface-base.c0000644000175100017500000001204612212601376016614 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include "test-iface-base.h" #include "test-iface-iface.h" /* private class data */ struct TestBaseClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct TestBasePrivate { gboolean dispose_has_run; }; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( TestBaseClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void iface_iface_init( TestIFaceInterface *iface, void *user_data ); static void iface_fna( TestIFace *object ); static void iface_fnb( TestIFace *object ); GType test_base_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "test_iface_base_register_type"; GType type; static GTypeInfo info = { sizeof( TestBaseClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( TestBase ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo iface_iface_info = { ( GInterfaceInitFunc ) iface_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_OBJECT, "TestBase", &info, 0 ); g_type_add_interface_static( type, TEST_IFACE_TYPE, &iface_iface_info ); return( type ); } static void class_init( TestBaseClass *klass ) { static const gchar *thisfn = "test_iface_base_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( TestBaseClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "test_iface_base_instance_init"; TestBase *self; g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) instance, ( void * ) klass ); g_assert( TEST_IS_BASE( instance )); self = TEST_BASE( instance ); self->private = g_new0( TestBasePrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "test_iface_base_instance_dispose"; TestBase *self; g_debug( "%s: object=%p", thisfn, ( void * ) object ); g_assert( TEST_IS_BASE( object )); self = TEST_BASE( object ); if( !self->private->dispose_has_run ){ self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { TestBase *self; g_assert( TEST_IS_BASE( object )); self = ( TestBase * ) object; g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } TestBase * test_base_new( void ) { TestBase *object = g_object_new( TEST_BASE_TYPE, NULL ); return( object ); } static void iface_iface_init( TestIFaceInterface *iface, void *user_data ) { static const gchar *thisfn = "test_iface_base_iface_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->fna = iface_fna; iface->fnb = iface_fnb; } static void iface_fna( TestIFace *object ) { static const gchar *thisfn = "test_iface_base_iface_fna"; g_debug( "%s: %s at %p", thisfn, G_OBJECT_TYPE_NAME( object ), ( void * ) object ); } static void iface_fnb( TestIFace *object ) { static const gchar *thisfn = "test_iface_base_iface_fnb"; g_debug( "%s: %s at %p", thisfn, G_OBJECT_TYPE_NAME( object ), ( void * ) object ); } nautilus-actions-3.2.3/src/test/test-virtuals-without-test.c0000755000175100017500000004270312212633542021172 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ /* We want test here what is the exact behavior of virtual functions in * derived classes, whether or not base class has implemented them or * not. * * We define three classes, and some virtual functions : * class A: fn1, fn2, fn3 * class AB: implements fn1, fn2 * class ABC: implements fn1, fn3 * * Public entry points are defined in class A: we check that calling * public entry points with an object of each class actually calls the * relevant virtual function. * * Also we check that calling the parent class is possible even if the * parent class has not explicitely defined the virtual function. * * Same as test-virtuals.c, without the test for existance of function. */ #include #include #define PWI_FIRST_TYPE ( pwi_first_get_type()) #define PWI_FIRST( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, PWI_FIRST_TYPE, PwiFirst )) #define PWI_FIRST_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, PWI_FIRST_TYPE, PwiFirstClass )) #define PWI_IS_FIRST( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, PWI_FIRST_TYPE )) #define PWI_IS_FIRST_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), PWI_FIRST_TYPE )) #define PWI_FIRST_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), PWI_FIRST_TYPE, PwiFirstClass )) typedef struct PwiFirstPrivate PwiFirstPrivate; typedef struct { GObject parent; PwiFirstPrivate *private; } PwiFirst; typedef struct PwiFirstClassPrivate PwiFirstClassPrivate; typedef struct { GObjectClass parent; PwiFirstClassPrivate *private; /* virtual functions */ void ( *fn_a )( PwiFirst *instance ); void ( *fn_b )( PwiFirst *instance ); void ( *fn_c )( PwiFirst *instance ); } PwiFirstClass; GType pwi_first_get_type( void ); void pwi_first_fn_a( PwiFirst *instance ); void pwi_first_fn_b( PwiFirst *instance ); void pwi_first_fn_c( PwiFirst *instance ); #define PWI_FIRST_SECOND_TYPE ( pwi_first_second_get_type()) #define PWI_FIRST_SECOND( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, PWI_FIRST_SECOND_TYPE, PwiFirstSecond )) #define PWI_FIRST_SECOND_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, PWI_FIRST_SECOND_TYPE, PwiFirstSecondClass )) #define PWI_IS_FIRST_SECOND( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, PWI_FIRST_SECOND_TYPE )) #define PWI_IS_FIRST_SECOND_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), PWI_FIRST_SECOND_TYPE )) #define PWI_FIRST_SECOND_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), PWI_FIRST_SECOND_TYPE, PwiFirstSecondClass )) typedef struct PwiFirstSecondPrivate PwiFirstSecondPrivate; typedef struct { PwiFirst parent; PwiFirstSecondPrivate *private; } PwiFirstSecond; typedef struct PwiFirstSecondClassPrivate PwiFirstSecondClassPrivate; typedef struct { PwiFirstClass parent; PwiFirstSecondClassPrivate *private; } PwiFirstSecondClass; GType pwi_first_second_get_type( void ); #define PWI_FIRST_SECOND_THREE_TYPE ( pwi_first_second_three_get_type()) #define PWI_FIRST_SECOND_THREE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, PWI_FIRST_SECOND_THREE_TYPE, PwiFirstSecondThree )) #define PWI_FIRST_SECOND_THREE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, PWI_FIRST_SECOND_THREE_TYPE, PwiFirstSecondThreeClass )) #define PWI_IS_FIRST_SECOND_THREE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, PWI_FIRST_SECOND_THREE_TYPE )) #define PWI_IS_FIRST_SECOND_THREE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), PWI_FIRST_SECOND_THREE_TYPE )) #define PWI_FIRST_SECOND_THREE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), PWI_FIRST_SECOND_THREE_TYPE, PwiFirstSecondThreeClass )) typedef struct PwiFirstSecondThreePrivate PwiFirstSecondThreePrivate; typedef struct { PwiFirstSecond parent; PwiFirstSecondThreePrivate *private; } PwiFirstSecondThree; typedef struct PwiFirstSecondThreeClassPrivate PwiFirstSecondThreeClassPrivate; typedef struct { PwiFirstSecondClass parent; PwiFirstSecondThreeClassPrivate *private; } PwiFirstSecondThreeClass; GType pwi_first_second_three_get_type( void ); struct PwiFirstClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; struct PwiFirstPrivate { void *empty; /* so that gcc -pedantic is happy */ }; static GObjectClass *st_first_parent_class = NULL; static GType first_register_type( void ); static void first_class_init( PwiFirstClass *klass ); static void first_instance_init( GTypeInstance *instance, gpointer klass ); static void first_instance_dispose( GObject *application ); static void first_instance_finalize( GObject *application ); static void do_first_fn_a( PwiFirst *instance ); static void do_first_fn_b( PwiFirst *instance ); static void do_first_fn_c( PwiFirst *instance ); GType pwi_first_get_type( void ) { static GType type = 0; if( !type ){ type = first_register_type(); } return( type ); } static GType first_register_type( void ) { static const gchar *thisfn = "first_register_type"; static GTypeInfo info = { sizeof( PwiFirstClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) first_class_init, NULL, NULL, sizeof( PwiFirst ), 0, ( GInstanceInitFunc ) first_instance_init }; g_debug( "%s", thisfn ); return( g_type_register_static( G_TYPE_OBJECT, "PwiFirst", &info, 0 )); } static void first_class_init( PwiFirstClass *klass ) { static const gchar *thisfn = "first_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_first_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = first_instance_dispose; object_class->finalize = first_instance_finalize; klass->private = g_new0( PwiFirstClassPrivate, 1 ); klass->fn_a = do_first_fn_a; klass->fn_b = do_first_fn_b; klass->fn_c = do_first_fn_c; } static void first_instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "first_instance_init"; PwiFirst *self; g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) instance, ( void * ) klass ); g_assert( PWI_IS_FIRST( instance )); self = PWI_FIRST( instance ); self->private = g_new0( PwiFirstPrivate, 1 ); } static void first_instance_dispose( GObject *instance ) { static const gchar *thisfn = "first_instance_dispose"; g_debug( "%s: instance=%p", thisfn, ( void * ) instance ); g_assert( PWI_IS_FIRST( instance )); /* chain up to the parent class */ G_OBJECT_CLASS( st_first_parent_class )->dispose( instance ); } static void first_instance_finalize( GObject *instance ) { static const gchar *thisfn = "first_instance_finalize"; PwiFirst *self; g_debug( "%s: instance=%p", thisfn, ( void * ) instance ); g_assert( PWI_IS_FIRST( instance )); self = PWI_FIRST( instance ); g_free( self->private ); /* chain call to parent class */ G_OBJECT_CLASS( st_first_parent_class )->finalize( instance ); } void pwi_first_fn_a( PwiFirst *instance ) { g_debug( "pwi_first_fn_a: instance=%p", ( void * ) instance ); g_assert( PWI_IS_FIRST( instance )); PWI_FIRST_GET_CLASS( instance )->fn_a( instance ); } static void do_first_fn_a( PwiFirst *instance ) { g_debug( "do_first_fn_a: instance=%p", ( void * ) instance ); } void pwi_first_fn_b( PwiFirst *instance ) { g_debug( "pwi_first_fn_b: instance=%p", ( void * ) instance ); g_assert( PWI_IS_FIRST( instance )); PWI_FIRST_GET_CLASS( instance )->fn_b( instance ); } static void do_first_fn_b( PwiFirst *instance ) { g_debug( "do_first_fn_b: instance=%p", ( void * ) instance ); } void pwi_first_fn_c( PwiFirst *instance ) { g_debug( "pwi_first_fn_c: instance=%p", ( void * ) instance ); g_assert( PWI_IS_FIRST( instance )); PWI_FIRST_GET_CLASS( instance )->fn_c( instance ); } static void do_first_fn_c( PwiFirst *instance ) { g_debug( "do_first_fn_c: instance=%p", ( void * ) instance ); } struct PwiFirstSecondClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; struct PwiFirstSecondPrivate { void *empty; /* so that gcc -pedantic is happy */ }; static PwiFirstClass *st_first_second_parent_class = NULL; static GType first_second_register_type( void ); static void first_second_class_init( PwiFirstSecondClass *klass ); static void first_second_instance_init( GTypeInstance *instance, gpointer klass ); static void first_second_instance_dispose( GObject *application ); static void first_second_instance_finalize( GObject *application ); static void do_first_second_fn_a( PwiFirst *instance ); static void do_first_second_fn_b( PwiFirst *instance ); GType pwi_first_second_get_type( void ) { static GType type = 0; if( !type ){ type = first_second_register_type(); } return( type ); } static GType first_second_register_type( void ) { static const gchar *thisfn = "first_second_register_type"; static GTypeInfo info = { sizeof( PwiFirstSecondClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) first_second_class_init, NULL, NULL, sizeof( PwiFirstSecond ), 0, ( GInstanceInitFunc ) first_second_instance_init }; g_debug( "%s", thisfn ); return( g_type_register_static( PWI_FIRST_TYPE, "PwiFirstSecond", &info, 0 )); } static void first_second_class_init( PwiFirstSecondClass *klass ) { static const gchar *thisfn = "first_second_class_init"; GObjectClass *object_class; PwiFirstClass *first_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_first_second_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = first_second_instance_dispose; object_class->finalize = first_second_instance_finalize; klass->private = g_new0( PwiFirstSecondClassPrivate, 1 ); first_class = PWI_FIRST_CLASS( klass ); first_class->fn_a = do_first_second_fn_a; first_class->fn_b = do_first_second_fn_b; first_class->fn_c = NULL; } static void first_second_instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "first_second_instance_init"; PwiFirstSecond *self; g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) instance, ( void * ) klass ); g_assert( PWI_IS_FIRST_SECOND( instance )); self = PWI_FIRST_SECOND( instance ); self->private = g_new0( PwiFirstSecondPrivate, 1 ); } static void first_second_instance_dispose( GObject *instance ) { static const gchar *thisfn = "first_second_instance_dispose"; g_debug( "%s: instance=%p", thisfn, ( void * ) instance ); g_assert( PWI_IS_FIRST_SECOND( instance )); /* chain up to the parent class */ G_OBJECT_CLASS( st_first_second_parent_class )->dispose( instance ); } static void first_second_instance_finalize( GObject *instance ) { static const gchar *thisfn = "first_second_instance_finalize"; PwiFirstSecond *self; g_debug( "%s: instance=%p", thisfn, ( void * ) instance ); g_assert( PWI_IS_FIRST_SECOND( instance )); self = PWI_FIRST_SECOND( instance ); g_free( self->private ); /* chain call to parent class */ G_OBJECT_CLASS( st_first_second_parent_class )->finalize( instance ); } static void do_first_second_fn_a( PwiFirst *instance ) { g_debug( "do_first_second_fn_a: instance=%p", ( void * ) instance ); PWI_FIRST_CLASS( st_first_second_parent_class )->fn_a( instance ); } static void do_first_second_fn_b( PwiFirst *instance ) { g_debug( "do_first_second_fn_b: instance=%p", ( void * ) instance ); PWI_FIRST_CLASS( st_first_second_parent_class )->fn_b( instance ); } struct PwiFirstSecondThreeClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; struct PwiFirstSecondThreePrivate { void *empty; /* so that gcc -pedantic is happy */ }; static PwiFirstSecondClass *st_first_second_three_parent_class = NULL; static GType first_second_three_register_type( void ); static void first_second_three_class_init( PwiFirstSecondThreeClass *klass ); static void first_second_three_instance_init( GTypeInstance *instance, gpointer klass ); static void first_second_three_instance_dispose( GObject *application ); static void first_second_three_instance_finalize( GObject *application ); static void do_first_second_three_fn_a( PwiFirst *instance ); static void do_first_second_three_fn_c( PwiFirst *instance ); GType pwi_first_second_three_get_type( void ) { static GType type = 0; if( !type ){ type = first_second_three_register_type(); } return( type ); } static GType first_second_three_register_type( void ) { static const gchar *thisfn = "first_second_three_register_type"; static GTypeInfo info = { sizeof( PwiFirstSecondThreeClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) first_second_three_class_init, NULL, NULL, sizeof( PwiFirstSecondThree ), 0, ( GInstanceInitFunc ) first_second_three_instance_init }; g_debug( "%s", thisfn ); return( g_type_register_static( PWI_FIRST_SECOND_TYPE, "PwiFirstSecondThree", &info, 0 )); } static void first_second_three_class_init( PwiFirstSecondThreeClass *klass ) { static const gchar *thisfn = "first_second_three_class_init"; GObjectClass *object_class; PwiFirstClass *first_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_first_second_three_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = first_second_three_instance_dispose; object_class->finalize = first_second_three_instance_finalize; klass->private = g_new0( PwiFirstSecondThreeClassPrivate, 1 ); first_class = PWI_FIRST_CLASS( klass ); first_class->fn_a = do_first_second_three_fn_a; first_class->fn_b = NULL; first_class->fn_c = do_first_second_three_fn_c; } static void first_second_three_instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "first_second_three_instance_init"; PwiFirstSecondThree *self; g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) instance, ( void * ) klass ); g_assert( PWI_IS_FIRST_SECOND_THREE( instance )); self = PWI_FIRST_SECOND_THREE( instance ); self->private = g_new0( PwiFirstSecondThreePrivate, 1 ); } static void first_second_three_instance_dispose( GObject *instance ) { static const gchar *thisfn = "first_second_three_instance_dispose"; g_debug( "%s: instance=%p", thisfn, ( void * ) instance ); g_assert( PWI_IS_FIRST_SECOND_THREE( instance )); /* chain up to the parent class */ G_OBJECT_CLASS( st_first_second_three_parent_class )->dispose( instance ); } static void first_second_three_instance_finalize( GObject *instance ) { static const gchar *thisfn = "first_second_three_instance_finalize"; PwiFirstSecondThree *self; g_debug( "%s: instance=%p", thisfn, ( void * ) instance ); g_assert( PWI_IS_FIRST_SECOND_THREE( instance )); self = PWI_FIRST_SECOND_THREE( instance ); g_free( self->private ); /* chain call to parent class */ G_OBJECT_CLASS( st_first_second_three_parent_class )->finalize( instance ); } static void do_first_second_three_fn_a( PwiFirst *instance ) { g_debug( "do_first_second_three_fn_a: instance=%p", ( void * ) instance ); PWI_FIRST_CLASS( st_first_second_three_parent_class )->fn_a( instance ); } static void do_first_second_three_fn_c( PwiFirst *instance ) { g_debug( "do_first_second_three_fn_c: instance=%p", ( void * ) instance ); PWI_FIRST_CLASS( st_first_second_three_parent_class )->fn_c( instance ); } int main( int argc, char **argv ) { PwiFirst *a; PwiFirstSecond *b; PwiFirstSecondThree *c; #if !GLIB_CHECK_VERSION( 2,36, 0 ) g_type_init(); #endif a = g_object_new( PWI_FIRST_TYPE, NULL ); b = g_object_new( PWI_FIRST_SECOND_TYPE, NULL ); c = g_object_new( PWI_FIRST_SECOND_THREE_TYPE, NULL ); g_debug( "expected pwi_first_fn_a, do_first_fn_a" ); pwi_first_fn_a( PWI_FIRST( a )); g_debug( "expected pwi_first_fn_a, do_first_second_fn_a, do_first_fn_a" ); pwi_first_fn_a( PWI_FIRST( b )); g_debug( "expected pwi_first_fn_a, do_first_second_three_fn_a, do_first_second_fn_a, do_first_fn_a" ); pwi_first_fn_a( PWI_FIRST( c )); g_debug( "%s", "" ); g_debug( "expected pwi_first_fn_b, do_first_fn_b" ); pwi_first_fn_b( PWI_FIRST( a )); g_debug( "expected pwi_first_fn_b, do_first_second_fn_b, do_first_fn_b" ); pwi_first_fn_b( PWI_FIRST( b )); g_debug( "expected pwi_first_fn_b, do_first_second_fn_b, do_first_fn_b" ); /* NOT OK * segmentation fault after pwi_first_fn_b */ pwi_first_fn_b( PWI_FIRST( c )); g_debug( "%s", "" ); g_debug( "expected pwi_first_fn_c, do_first_fn_c" ); pwi_first_fn_c( PWI_FIRST( a )); g_debug( "expected pwi_first_fn_c, do_first_fn_c" ); pwi_first_fn_c( PWI_FIRST( b )); g_debug( "expected pwi_first_fn_c, do_first_second_three_fn_c, do_first_fn_c" ); pwi_first_fn_c( PWI_FIRST( c )); return( 0 ); } nautilus-actions-3.2.3/src/test/test-iface-derived.c0000644000175100017500000001532512212601376017327 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "test-iface-derived.h" #include "test-iface-iface.h" /* private class data */ struct TestDerivedClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct TestDerivedPrivate { gboolean dispose_has_run; }; static TestBaseClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( TestDerivedClass *klass ); static void iface_iface_init( TestDerivedClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static void iface_fna( TestIFace *object ); static void iface_fnb( TestIFace *object ); GType test_derived_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "test_iface_derived_register_type"; static GTypeInfo info = { sizeof( TestDerivedClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( TestDerived ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); return( g_type_register_static( TEST_BASE_TYPE, "TestDerived", &info, 0 )); } static void class_init( TestDerivedClass *klass ) { static const gchar *thisfn = "test_derived_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( TestDerivedClassPrivate, 1 ); /* there is no error message but this has no effect * event in a TestDerived object, these are TestBase functions which are called */ if( 0 ){ (( TestIFaceInterface * ) klass )->fna = iface_fna; (( TestIFaceInterface * ) klass )->fnb = iface_fnb; } /* idem */ if( 0 ){ (( TestIFaceInterface * ) st_parent_class )->fna = iface_fna; (( TestIFaceInterface * ) st_parent_class )->fnb = iface_fnb; } if( 1 ){ iface_iface_init( klass ); } } static void iface_iface_init( TestDerivedClass *klass ) { static const gchar *thisfn = "test_iface_derived_iface_iface_init"; /* this has the effect of totally overriding the interface api * and both TestBase and TestDerived objects will only call TestDerived functions */ /*GTypeInterface *iface; iface = g_type_interface_peek( klass, TEST_IFACE_TYPE ); g_debug( "%s: iface=%s at %p", thisfn, g_type_name( G_TYPE_FROM_INTERFACE( iface )), ( void * ) iface ); (( TestIFaceInterface * ) iface )->fna = iface_fna; (( TestIFaceInterface * ) iface )->fnb = iface_fnb;*/ /* this segfault */ /* GTypeInterface *iface; iface = g_type_interface_peek( klass, TEST_IFACE_TYPE ); g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); iface = g_type_interface_peek_parent( iface ); g_debug( "%s: iface=%p", thisfn, ( void * ) iface ); g_debug( "%s: iface=%s at %p", thisfn, g_type_name( G_TYPE_FROM_INTERFACE( iface )), ( void * ) iface ); (( TestIFaceInterface * ) iface )->fna = iface_fna; (( TestIFaceInterface * ) iface )->fnb = iface_fnb;*/ /* this has the effect of totally overriding the interface api * and both TestBase and TestDerived objects will only call TestDerived functions */ if( 0 ){ GTypeInterface *iface; iface = g_type_interface_peek( st_parent_class, TEST_IFACE_TYPE ); g_debug( "%s: iface=%s at %p", thisfn, g_type_name( G_TYPE_FROM_INTERFACE( iface )), ( void * ) iface ); (( TestIFaceInterface * ) iface )->fna = iface_fna; (( TestIFaceInterface * ) iface )->fnb = iface_fnb; } } static void instance_init( GTypeInstance *instance, gpointer klass ) { /*static const gchar *thisfn = "test_derived_instance_init";*/ TestDerived *self; /*g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) instance, ( void * ) klass );*/ g_assert( TEST_IS_DERIVED( instance )); self = TEST_DERIVED( instance ); self->private = g_new0( TestDerivedPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { /*static const gchar *thisfn = "test_derived_instance_dispose";*/ TestDerived *self; /*g_debug( "%s: object=%p", thisfn, ( void * ) object );*/ g_assert( TEST_IS_DERIVED( object )); self = TEST_DERIVED( object ); if( !self->private->dispose_has_run ){ self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { /*static const gchar *thisfn = "test_derived_instance_finalize";*/ TestDerived *self; /*g_debug( "%s: object=%p", thisfn, (void * ) object );*/ g_assert( TEST_IS_DERIVED( object )); self = ( TestDerived * ) object; g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } TestDerived * test_derived_new( void ) { TestDerived *object = g_object_new( TEST_DERIVED_TYPE, NULL ); return( object ); } static void iface_fna( TestIFace *object ) { static const gchar *thisfn = "test_iface_derived_iface_fna"; g_debug( "%s: %s at %p", thisfn, G_OBJECT_TYPE_NAME( object ), ( void * ) object ); } static void iface_fnb( TestIFace *object ) { static const gchar *thisfn = "test_iface_derived_iface_fnb"; g_debug( "%s: %s at %p", thisfn, G_OBJECT_TYPE_NAME( object ), ( void * ) object ); } nautilus-actions-3.2.3/src/test/Makefile.am0000644000175100017500000000635212212601376015553 00000000000000# Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) # Test programs are only relevant for the maintainer and his own tests # Do not build them in a release if NA_MAINTAINER_MODE noinst_PROGRAMS = \ test-reader \ test-iface \ test-iface2 \ test-parse-uris \ test-virtuals \ test-virtuals-without-test \ $(NULL) AM_CPPFLAGS += \ -I $(top_srcdir) \ -I $(top_srcdir)/src \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ -DPKGLIBDIR=\""$(pkglibdir)"\" \ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_TEST}\" \ $(NAUTILUS_ACTIONS_CFLAGS) \ $(NULL) test_reader_SOURCES = \ test-reader.c \ $(NULL) test_reader_LDADD = \ $(top_builddir)/src/core/libna-core.la \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) test_iface_SOURCES = \ test-iface.c \ test-iface-iface.c \ test-iface-iface.h \ test-iface-base.c \ test-iface-base.h \ test-iface-derived.c \ test-iface-derived.h \ $(NULL) test_iface_LDADD = \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) test_iface2_SOURCES = \ test-iface2.c \ $(NULL) test_iface2_LDADD = \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) if NA_MAINTAINER_MODE noinst_PROGRAMS += test-module pkglib_LTLIBRARIES = libtest_module_plugin.la test_module_SOURCES = \ test-module.c \ $(NULL) test_module_LDADD = \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libtest_module_plugin_la_SOURCES = \ test-module-plugin.c \ $(NULL) libtest_module_plugin_la_LIBADD = \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) libtest_module_plugin_la_LDFLAGS = \ -module \ -no-undefined \ -avoid-version \ $(NULL) endif test_parse_uris_SOURCES = \ test-parse-uris.c \ $(NULL) test_parse_uris_LDADD = \ $(top_builddir)/src/core/libna-core.la \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) test_virtuals_SOURCES = \ test-virtuals.c \ $(NULL) test_virtuals_LDADD = \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) test_virtuals_without_test_SOURCES = \ test-virtuals-without-test.c \ $(NULL) test_virtuals_without_test_LDADD = \ $(NAUTILUS_ACTIONS_LIBS) \ $(NULL) endif #if NA_MAINTAINER_MODE nautilus-actions-3.2.3/src/test/test-module.c0000755000175100017500000002635612212633542016136 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif /* this is a module to test how to use the GLib dynamic-loading functions * it tries to load, then unload, a test-module-plugin.so plugin * * more specifically, I am interested on releasing allocated resources */ #include #include #include #define PLUGIN_NAME "test_module_plugin" #if 0 /* this is first version */ static GModule *load_plugin( void ); static void call_plugin_fn( GModule *module ); static void unload_plugin( GModule *module ); int main( int argc, char **argv ) { GModule *module; #if !GLIB_CHECK_VERSION( 2,36, 0 ) g_type_init(); #endif /* dynamically load the module */ module = load_plugin(); if( module ){ /* call a function in the module */ call_plugin_fn( module ); /* unload the module */ unload_plugin( module ); } return( 0 ); } static GModule * load_plugin( void ) { gchar *module_path; GModule *module; module = NULL; if( g_module_supported()){ module_path = g_module_build_path( PKGLIBDIR, PLUGIN_NAME ); module = g_module_open( module_path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL ); if( !module ){ g_printerr( "%s: %s\n", module_path, g_module_error()); } g_free( module_path ); } return( module ); } static void call_plugin_fn( GModule *module ) { typedef void ( *PluginFn )( GModule *module ); PluginFn plugin_fn; if( !g_module_symbol( module, "say_hello", ( gpointer * ) &plugin_fn )){ g_printerr( "%s\n", g_module_error()); return; } if( !plugin_fn ){ g_printerr( "%s\n", g_module_error()); return; } plugin_fn( module ); } static void unload_plugin( GModule *module ) { if( !g_module_close( module )){ g_printerr( "%s\n", g_module_error()); } } #endif /* version 2 * Having the plugin register dynamic GTypes require a GTypeModule * This GTtypeModule is provided by the program as a GTypeModule-derived object * NAModule embeds the GModule * * Result: * * - the main program (the loader) should define a GTypeModule derived class * * - the GTypeModule derived class (here NAModule) embeds a GModule pointer * * - when loading plugins: * * > allocate a new GTypeModule derived object for each module * setup the path here * * > g_type_module_use() it * this triggers the on_load() virtual method on GTypeModule derived class * in on_load_derived(), g_module_open() the plugin and check the API * * on_load_derived() may return FALSE * while dynamic types have not been registered, we are always safe to unref * the allocated GTypeModule derived object * setup the GModule pointer on the loaded library * * so, if g_module_use() returns FALSE, just unref the object * * so, g_module_use() cannot be called from instance_init or * instance_constructed (which have no return value) * * At the end, it is impossible to release the GTypeModule objects. * But we can safely unuse their loaded libraries. * * The main program does not known which GType or GInterface the plugin * declares. * Nautilus defines a get_types() API, and then allocates an object for each * returned type. It is then easy to check if the object implements a given * interface. * Nautilus never release these objects. * We may also ask the plugin to just allocate itself its own management object, * returning it to the program (returning a pointer is possible because we are * in the same process). */ #define NA_TYPE_MODULE ( na_module_get_type()) #define NA_MODULE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_MODULE, NAModule )) #define NA_MODULE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_MODULE, NAModuleClass )) #define NA_IS_MODULE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_MODULE )) #define NA_IS_MODULE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_MODULE )) #define NA_MODULE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_MODULE, NAModuleClass )) typedef struct _NAModulePrivate NAModulePrivate; typedef struct _NAModuleClassPrivate NAModuleClassPrivate; typedef struct { /*< private >*/ GTypeModule parent; NAModulePrivate *private; } NAModule; typedef struct { /*< private >*/ GTypeModuleClass parent; NAModuleClassPrivate *private; } NAModuleClass; GType na_module_get_type ( void ); /* private class data */ struct _NAModuleClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NAModulePrivate { gboolean dispose_has_run; GModule *plugin; }; static GTypeModuleClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NAModuleClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *object ); static void instance_finalize( GObject *object ); static NAModule *load_plugin( void ); static gboolean on_module_load( GTypeModule *module ); static void call_plugin_fn( NAModule *module ); static void on_unload_plugin( GTypeModule *module ); GType na_module_get_type( void ) { static GType object_type = 0; if( !object_type ){ object_type = register_type(); } return( object_type ); } static GType register_type( void ) { static const gchar *thisfn = "na_module_register_type"; GType type; static GTypeInfo info = { sizeof( NAModuleClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NAModule ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_TYPE_MODULE, "NAModule", &info, 0 ); return( type ); } static void class_init( NAModuleClass *klass ) { static const gchar *thisfn = "na_module_class_init"; GObjectClass *object_class; GTypeModuleClass *module_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; module_class = G_TYPE_MODULE_CLASS( klass ); module_class->load = on_module_load; module_class->unload = on_unload_plugin; klass->private = g_new0( NAModuleClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "na_module_instance_init"; NAModule *self; g_return_if_fail( NA_IS_MODULE( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NA_MODULE( instance ); self->private = g_new0( NAModulePrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *object ) { static const gchar *thisfn = "na_module_instance_dispose"; NAModule *self; g_return_if_fail( NA_IS_MODULE( object )); self = NA_MODULE( object ); if( !self->private->dispose_has_run ){ g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self->private->dispose_has_run = TRUE; /* should trigger unload of the plugin */ /* refused by GLib * GLib-GObject-WARNING **: gtypemodule.c:111: unsolicitated invocation of g_object_dispose() on GTypeModule */ /*g_type_module_unuse( G_TYPE_MODULE( self ));*/ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( object ); } } } static void instance_finalize( GObject *object ) { static const gchar *thisfn = "na_module_instance_finalize"; NAModule *self; g_return_if_fail( NA_IS_MODULE( object )); g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object )); self = NA_MODULE( object ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( object ); } } int main( int argc, char **argv ) { NAModule *module; #if !GLIB_CHECK_VERSION( 2,36, 0 ) g_type_init(); #endif /* dynamically load the module */ module = load_plugin(); if( module ){ /* call a function in the module */ call_plugin_fn( module ); /* try to just unref the NAModule */ /* not ok */ /*g_object_unref( module );*/ /* try to unload the plugin */ g_type_module_unuse( G_TYPE_MODULE( module )); /* then unref the object */ /* not ok * it happens that releasing the GTypeModule after having registered a GType or a * GInterface is impossible * see http://git.gnome.org/browse/glib/tree/gobject/gtypemodule.c * and http://library.gnome.org/devel/gobject/unstable/GTypeModule.html#g-type-module-unuse */ /*g_object_unref( module );*/ } return( 0 ); } static NAModule * load_plugin( void ) { NAModule *module; module = NULL; if( g_module_supported()){ module = g_object_new( NA_TYPE_MODULE, NULL ); g_debug( "test_module_load_plugin: module=%p", ( void * ) module ); if( !g_type_module_use( G_TYPE_MODULE( module ))){ g_object_unref( module ); } } return( module ); } static gboolean on_module_load( GTypeModule *module ) { gboolean ok; gchar *module_path; NAModule *na_module = NA_MODULE( module ); g_debug( "test_module_on_module_load" ); ok = TRUE; module_path = g_module_build_path( PKGLIBDIR, PLUGIN_NAME ); g_debug( "test_module_on_module_load: opening the library" ); na_module->private->plugin = g_module_open( module_path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL ); if( !na_module->private->plugin ){ g_printerr( "%s: %s\n", module_path, g_module_error()); ok = FALSE; } g_free( module_path ); return( ok ); } static void call_plugin_fn( NAModule *module ) { typedef void ( *PluginInit )( NAModule *module ); PluginInit plugin_fn; if( !g_module_symbol( module->private->plugin, "plugin_init", ( gpointer * ) &plugin_fn )){ g_printerr( "%s\n", g_module_error()); return; } if( !plugin_fn ){ g_printerr( "%s\n", g_module_error()); return; } plugin_fn( module ); } static void on_unload_plugin( GTypeModule *module ) { g_debug( "test_module_on_unload_plugin" ); if( !g_module_close( NA_MODULE( module )->private->plugin )){ g_printerr( "%s\n", g_module_error()); } } nautilus-actions-3.2.3/src/test/test-virtuals.c0000755000175100017500000003164712212633542016521 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ /* We want test here what is the exact behavior of virtual functions in * derived classes, whether or not base class has implemented them or * not. * * We define three classes, and some virtual functions : * class 'first': fn_a, fn_b, fn_c * class 'second', derived from 'first', implements fn_a, fn_b * class 'three', derived from 'second': implements fn_a, fn_c * * Public entry points are defined in class 'first': we check that calling * public entry points with an object of each class actually calls the * relevant virtual function. * * Also we check if calling the parent class is possible even if the * parent class has not explicitely defined the virtual function. * * NOTE: this only works if we do _not_ set the virtual method to NULL * in intermediate classes. */ #include #include #define PWI_TYPE_FIRST ( pwi_first_get_type()) #define PWI_FIRST( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, PWI_TYPE_FIRST, PwiFirst )) #define PWI_FIRST_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, PWI_TYPE_FIRST, PwiFirstClass )) #define PWI_IS_FIRST( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, PWI_TYPE_FIRST )) #define PWI_IS_FIRST_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), PWI_TYPE_FIRST )) #define PWI_FIRST_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), PWI_TYPE_FIRST, PwiFirstClass )) typedef struct { void *empty; /* so that gcc -pedantic is happy */ } PwiFirstPrivate; typedef struct { GObject parent; PwiFirstPrivate *private; } PwiFirst; typedef struct { void *empty; /* so that gcc -pedantic is happy */ } PwiFirstClassPrivate; typedef struct { GObjectClass parent; PwiFirstClassPrivate *private; /* virtual functions */ void ( *fn_a )( PwiFirst *instance ); void ( *fn_b )( PwiFirst *instance ); void ( *fn_c )( PwiFirst *instance ); } PwiFirstClass; static GObjectClass *pwi_first_parent_class = NULL; static GType pwi_first_get_type( void ); static void pwi_first_class_init( PwiFirstClass *klass ); static void pwi_first_init( PwiFirst *instance, gpointer klass ); static GType pwi_first_register_type( void ) { static const gchar *thisfn = "first_register_type"; static GTypeInfo info = { sizeof( PwiFirstClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) pwi_first_class_init, NULL, NULL, sizeof( PwiFirst ), 0, ( GInstanceInitFunc ) pwi_first_init }; g_debug( "%s", thisfn ); return( g_type_register_static( G_TYPE_OBJECT, "PwiFirst", &info, 0 )); } static GType pwi_first_get_type( void ) { static GType type = 0; if( !type ){ type = pwi_first_register_type(); } return( type ); } static void do_first_fn_a( PwiFirst *instance ) { g_debug( "do_first_fn_a: instance=%p", ( void * ) instance ); } static void do_first_fn_b( PwiFirst *instance ) { g_debug( "do_first_fn_b: instance=%p", ( void * ) instance ); } static void do_first_fn_c( PwiFirst *instance ) { g_debug( "do_first_fn_c: instance=%p", ( void * ) instance ); } static void pwi_first_class_init( PwiFirstClass *klass ) { static const gchar *thisfn = "pwi_first_class_init"; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); pwi_first_parent_class = g_type_class_peek_parent( klass ); klass->private = g_new0( PwiFirstClassPrivate, 1 ); klass->fn_a = do_first_fn_a; klass->fn_b = do_first_fn_b; klass->fn_c = do_first_fn_c; } static void pwi_first_init( PwiFirst *self, gpointer klass ) { static const gchar *thisfn = "pwi_first_init"; g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) self, ( void * ) klass ); self->private = g_new0( PwiFirstPrivate, 1 ); } void pwi_first_fn_a( PwiFirst *instance ); void pwi_first_fn_b( PwiFirst *instance ); void pwi_first_fn_c( PwiFirst *instance ); void pwi_first_fn_a( PwiFirst *instance ) { g_debug( "pwi_first_fn_a: instance=%p", ( void * ) instance ); g_assert( PWI_IS_FIRST( instance )); if( PWI_FIRST_GET_CLASS( instance )->fn_a ){ PWI_FIRST_GET_CLASS( instance )->fn_a( instance ); } else { g_debug( "default to invoke do_first_fn_a()" ); do_first_fn_a( instance ); } } void pwi_first_fn_b( PwiFirst *instance ) { g_debug( "pwi_first_fn_b: instance=%p", ( void * ) instance ); g_assert( PWI_IS_FIRST( instance )); if( PWI_FIRST_GET_CLASS( instance )->fn_b ){ PWI_FIRST_GET_CLASS( instance )->fn_b( instance ); } else { g_debug( "default to invoke do_first_fn_b()" ); do_first_fn_b( instance ); } } void pwi_first_fn_c( PwiFirst *instance ) { g_debug( "pwi_first_fn_c: instance=%p", ( void * ) instance ); g_assert( PWI_IS_FIRST( instance )); if( PWI_FIRST_GET_CLASS( instance )->fn_c ){ PWI_FIRST_GET_CLASS( instance )->fn_c( instance ); } else { g_debug( "default to invoke do_first_fn_c()" ); do_first_fn_c( instance ); } } #define PWI_TYPE_SECOND ( pwi_second_get_type()) #define PWI_SECOND( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, PWI_TYPE_SECOND, PwiSecond )) #define PWI_SECOND_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, PWI_TYPE_SECOND, PwiSecondClass )) #define PWI_IS_SECOND( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, PWI_TYPE_SECOND )) #define PWI_IS_SECOND_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), PWI_TYPE_SECOND )) #define PWI_SECOND_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), PWI_TYPE_SECOND, PwiSecondClass )) typedef struct { void *empty; /* so that gcc -pedantic is happy */ } PwiSecondPrivate; typedef struct { PwiFirst parent; PwiSecondPrivate *private; } PwiSecond; typedef struct { void *empty; /* so that gcc -pedantic is happy */ } PwiSecondClassPrivate; typedef struct { PwiFirstClass parent; PwiSecondClassPrivate *private; } PwiSecondClass; static GObjectClass *pwi_second_parent_class = NULL; static GType pwi_second_get_type( void ); static void pwi_second_class_init( PwiSecondClass *klass ); static void pwi_second_init( PwiSecond *instance, gpointer klass ); static GType pwi_second_register_type( void ) { static const gchar *thisfn = "second_register_type"; static GTypeInfo info = { sizeof( PwiSecondClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) pwi_second_class_init, NULL, NULL, sizeof( PwiSecond ), 0, ( GInstanceInitFunc ) pwi_second_init }; g_debug( "%s", thisfn ); return( g_type_register_static( PWI_TYPE_FIRST, "PwiSecond", &info, 0 )); } static GType pwi_second_get_type( void ) { static GType type = 0; if( !type ){ type = pwi_second_register_type(); } return( type ); } static void do_second_fn_a( PwiFirst *instance ) { g_debug( "do_second_fn_a: instance=%p", ( void * ) instance ); if( PWI_FIRST_CLASS( pwi_second_parent_class )->fn_a ){ PWI_FIRST_CLASS( pwi_second_parent_class )->fn_a( instance ); } } static void do_second_fn_b( PwiFirst *instance ) { g_debug( "do_second_fn_b: instance=%p", ( void * ) instance ); if( PWI_FIRST_CLASS( pwi_second_parent_class )->fn_b ){ PWI_FIRST_CLASS( pwi_second_parent_class )->fn_b( instance ); } } static void pwi_second_class_init( PwiSecondClass *klass ) { static const gchar *thisfn = "pwi_second_class_init"; PwiFirstClass *parent_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); pwi_second_parent_class = g_type_class_peek_parent( klass ); klass->private = g_new0( PwiSecondClassPrivate, 1 ); parent_class = PWI_FIRST_CLASS( klass ); parent_class->fn_a = do_second_fn_a; parent_class->fn_b = do_second_fn_b; /*parent_class->fn_c = NULL;*/ } static void pwi_second_init( PwiSecond *self, gpointer klass ) { static const gchar *thisfn = "pwi_second_init"; g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) self, ( void * ) klass ); self->private = g_new0( PwiSecondPrivate, 1 ); } #define PWI_TYPE_THREE ( pwi_three_get_type()) #define PWI_THREE( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, PWI_TYPE_THREE, PwiThree )) #define PWI_THREE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, PWI_TYPE_THREE, PwiThreeClass )) #define PWI_IS_THREE( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, PWI_TYPE_THREE )) #define PWI_IS_THREE_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), PWI_TYPE_THREE )) #define PWI_THREE_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), PWI_TYPE_THREE, PwiThreeClass )) typedef struct { void *empty; /* so that gcc -pedantic is happy */ } PwiThreePrivate; typedef struct { PwiSecond parent; PwiThreePrivate *private; } PwiThree; typedef struct { void *empty; /* so that gcc -pedantic is happy */ } PwiThreeClassPrivate; typedef struct { PwiSecondClass parent; PwiThreeClassPrivate *private; } PwiThreeClass; static GObjectClass *pwi_three_parent_class = NULL; static GType pwi_three_get_type( void ); static void pwi_three_class_init( PwiThreeClass *klass ); static void pwi_three_init( PwiThree *instance, gpointer klass ); static GType pwi_three_register_type( void ) { static const gchar *thisfn = "three_register_type"; static GTypeInfo info = { sizeof( PwiThreeClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) pwi_three_class_init, NULL, NULL, sizeof( PwiThree ), 0, ( GInstanceInitFunc ) pwi_three_init }; g_debug( "%s", thisfn ); return( g_type_register_static( PWI_TYPE_SECOND, "PwiThree", &info, 0 )); } static GType pwi_three_get_type( void ) { static GType type = 0; if( !type ){ type = pwi_three_register_type(); } return( type ); } static void do_three_fn_a( PwiFirst *instance ) { g_debug( "do_three_fn_a: instance=%p", ( void * ) instance ); if( PWI_FIRST_CLASS( pwi_three_parent_class )->fn_a ){ PWI_FIRST_CLASS( pwi_three_parent_class )->fn_a( instance ); } } static void do_three_fn_c( PwiFirst *instance ) { g_debug( "do_three_fn_c: instance=%p", ( void * ) instance ); if( PWI_FIRST_CLASS( pwi_three_parent_class )->fn_c ){ PWI_FIRST_CLASS( pwi_three_parent_class )->fn_c( instance ); } } static void pwi_three_class_init( PwiThreeClass *klass ) { static const gchar *thisfn = "pwi_three_class_init"; PwiFirstClass *parent_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); pwi_three_parent_class = g_type_class_peek_parent( klass ); klass->private = g_new0( PwiThreeClassPrivate, 1 ); parent_class = PWI_FIRST_CLASS( klass ); parent_class->fn_a = do_three_fn_a; /*parent_class->fn_b = NULL;*/ parent_class->fn_c = do_three_fn_c; } static void pwi_three_init( PwiThree *self, gpointer klass ) { static const gchar *thisfn = "pwi_three_init"; g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) self, ( void * ) klass ); self->private = g_new0( PwiThreePrivate, 1 ); } int main( int argc, char **argv ) { PwiFirst *a; PwiSecond *b; PwiThree *c; #if !GLIB_CHECK_VERSION( 2,36, 0 ) g_type_init(); #endif a = g_object_new( PWI_TYPE_FIRST, NULL ); b = g_object_new( PWI_TYPE_SECOND, NULL ); c = g_object_new( PWI_TYPE_THREE, NULL ); g_debug( "%s", "" ); g_debug( "expected pwi_first_fn_a, do_first_fn_a" ); pwi_first_fn_a( PWI_FIRST( a )); g_debug( "expected pwi_first_fn_a, do_second_fn_a, do_first_fn_a" ); pwi_first_fn_a( PWI_FIRST( b )); g_debug( "expected pwi_first_fn_a, do_three_fn_a, do_second_fn_a, do_first_fn_a" ); pwi_first_fn_a( PWI_FIRST( c )); g_debug( "%s", "" ); g_debug( "expected pwi_first_fn_b, do_first_fn_b" ); pwi_first_fn_b( PWI_FIRST( a )); g_debug( "expected pwi_first_fn_b, do_second_fn_b, do_first_fn_b" ); pwi_first_fn_b( PWI_FIRST( b )); g_debug( "expected pwi_first_fn_b, do_second_fn_b, do_first_fn_b" ); /* NOT OK * result is pwi_first_fn_b, default to do_first_fn_b */ pwi_first_fn_b( PWI_FIRST( c )); g_debug( "%s", "" ); g_debug( "expected pwi_first_fn_c, do_first_fn_c" ); pwi_first_fn_c( PWI_FIRST( a )); g_debug( "expected pwi_first_fn_c, do_first_fn_c" ); pwi_first_fn_c( PWI_FIRST( b )); g_debug( "expected pwi_first_fn_c, do_three_fn_c, do_first_fn_c" ); /* NOT OK * result is pwi_first_fn_c, do_three_fn_c */ pwi_first_fn_c( PWI_FIRST( c )); return( 0 ); } nautilus-actions-3.2.3/src/test/Makefile.in0000644000175100017500000010505012220365303015553 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Nautilus-Actions # A Nautilus extension which offers configurable context menu actions. # # Copyright (C) 2005 The GNOME Foundation # Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) # Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) # # Nautilus-Actions is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # Nautilus-Actions 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Nautilus-Actions; see the file COPYING. If not, see # . # # Authors: # Frederic Ruaudel # Rodrigo Moya # Pierre Wieser # ... and many others (see AUTHORS) # Test programs are only relevant for the maintainer and his own tests # Do not build them in a release VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @NA_MAINTAINER_MODE_TRUE@noinst_PROGRAMS = test-reader$(EXEEXT) \ @NA_MAINTAINER_MODE_TRUE@ test-iface$(EXEEXT) \ @NA_MAINTAINER_MODE_TRUE@ test-iface2$(EXEEXT) \ @NA_MAINTAINER_MODE_TRUE@ test-parse-uris$(EXEEXT) \ @NA_MAINTAINER_MODE_TRUE@ test-virtuals$(EXEEXT) \ @NA_MAINTAINER_MODE_TRUE@ test-virtuals-without-test$(EXEEXT) \ @NA_MAINTAINER_MODE_TRUE@ test-module$(EXEEXT) @NA_MAINTAINER_MODE_TRUE@am__append_1 = \ @NA_MAINTAINER_MODE_TRUE@ -I $(top_srcdir) \ @NA_MAINTAINER_MODE_TRUE@ -I $(top_srcdir)/src \ @NA_MAINTAINER_MODE_TRUE@ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ @NA_MAINTAINER_MODE_TRUE@ -DPKGLIBDIR=\""$(pkglibdir)"\" \ @NA_MAINTAINER_MODE_TRUE@ -DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_TEST}\" \ @NA_MAINTAINER_MODE_TRUE@ $(NAUTILUS_ACTIONS_CFLAGS) \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) subdir = src/test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/na-check-for-gconf.m4 \ $(top_srcdir)/m4/na-check-for-gdbus.m4 \ $(top_srcdir)/m4/na-check-for-gtk.m4 \ $(top_srcdir)/m4/na-check-module.m4 \ $(top_srcdir)/m4/na-compiler-flags.m4 \ $(top_srcdir)/m4/na-default-io-provider.m4 \ $(top_srcdir)/m4/na-enable-manuals.m4 \ $(top_srcdir)/m4/na-log-domains.m4 \ $(top_srcdir)/m4/na-maintainer-mode.m4 \ $(top_srcdir)/m4/na-nautilus-extdir.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = @NA_MAINTAINER_MODE_TRUE@libtest_module_plugin_la_DEPENDENCIES = \ @NA_MAINTAINER_MODE_TRUE@ $(am__DEPENDENCIES_1) am__libtest_module_plugin_la_SOURCES_DIST = test-module-plugin.c @NA_MAINTAINER_MODE_TRUE@am_libtest_module_plugin_la_OBJECTS = \ @NA_MAINTAINER_MODE_TRUE@ test-module-plugin.lo libtest_module_plugin_la_OBJECTS = \ $(am_libtest_module_plugin_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libtest_module_plugin_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libtest_module_plugin_la_LDFLAGS) \ $(LDFLAGS) -o $@ @NA_MAINTAINER_MODE_TRUE@am_libtest_module_plugin_la_rpath = -rpath \ @NA_MAINTAINER_MODE_TRUE@ $(pkglibdir) PROGRAMS = $(noinst_PROGRAMS) am__test_iface_SOURCES_DIST = test-iface.c test-iface-iface.c \ test-iface-iface.h test-iface-base.c test-iface-base.h \ test-iface-derived.c test-iface-derived.h @NA_MAINTAINER_MODE_TRUE@am_test_iface_OBJECTS = test-iface.$(OBJEXT) \ @NA_MAINTAINER_MODE_TRUE@ test-iface-iface.$(OBJEXT) \ @NA_MAINTAINER_MODE_TRUE@ test-iface-base.$(OBJEXT) \ @NA_MAINTAINER_MODE_TRUE@ test-iface-derived.$(OBJEXT) test_iface_OBJECTS = $(am_test_iface_OBJECTS) @NA_MAINTAINER_MODE_TRUE@test_iface_DEPENDENCIES = \ @NA_MAINTAINER_MODE_TRUE@ $(am__DEPENDENCIES_1) am__test_iface2_SOURCES_DIST = test-iface2.c @NA_MAINTAINER_MODE_TRUE@am_test_iface2_OBJECTS = \ @NA_MAINTAINER_MODE_TRUE@ test-iface2.$(OBJEXT) test_iface2_OBJECTS = $(am_test_iface2_OBJECTS) @NA_MAINTAINER_MODE_TRUE@test_iface2_DEPENDENCIES = \ @NA_MAINTAINER_MODE_TRUE@ $(am__DEPENDENCIES_1) am__test_module_SOURCES_DIST = test-module.c @NA_MAINTAINER_MODE_TRUE@am_test_module_OBJECTS = \ @NA_MAINTAINER_MODE_TRUE@ test-module.$(OBJEXT) test_module_OBJECTS = $(am_test_module_OBJECTS) @NA_MAINTAINER_MODE_TRUE@test_module_DEPENDENCIES = \ @NA_MAINTAINER_MODE_TRUE@ $(am__DEPENDENCIES_1) am__test_parse_uris_SOURCES_DIST = test-parse-uris.c @NA_MAINTAINER_MODE_TRUE@am_test_parse_uris_OBJECTS = \ @NA_MAINTAINER_MODE_TRUE@ test-parse-uris.$(OBJEXT) test_parse_uris_OBJECTS = $(am_test_parse_uris_OBJECTS) @NA_MAINTAINER_MODE_TRUE@test_parse_uris_DEPENDENCIES = $(top_builddir)/src/core/libna-core.la \ @NA_MAINTAINER_MODE_TRUE@ $(am__DEPENDENCIES_1) am__test_reader_SOURCES_DIST = test-reader.c @NA_MAINTAINER_MODE_TRUE@am_test_reader_OBJECTS = \ @NA_MAINTAINER_MODE_TRUE@ test-reader.$(OBJEXT) test_reader_OBJECTS = $(am_test_reader_OBJECTS) @NA_MAINTAINER_MODE_TRUE@test_reader_DEPENDENCIES = $(top_builddir)/src/core/libna-core.la \ @NA_MAINTAINER_MODE_TRUE@ $(am__DEPENDENCIES_1) am__test_virtuals_SOURCES_DIST = test-virtuals.c @NA_MAINTAINER_MODE_TRUE@am_test_virtuals_OBJECTS = \ @NA_MAINTAINER_MODE_TRUE@ test-virtuals.$(OBJEXT) test_virtuals_OBJECTS = $(am_test_virtuals_OBJECTS) @NA_MAINTAINER_MODE_TRUE@test_virtuals_DEPENDENCIES = \ @NA_MAINTAINER_MODE_TRUE@ $(am__DEPENDENCIES_1) am__test_virtuals_without_test_SOURCES_DIST = \ test-virtuals-without-test.c @NA_MAINTAINER_MODE_TRUE@am_test_virtuals_without_test_OBJECTS = \ @NA_MAINTAINER_MODE_TRUE@ test-virtuals-without-test.$(OBJEXT) test_virtuals_without_test_OBJECTS = \ $(am_test_virtuals_without_test_OBJECTS) @NA_MAINTAINER_MODE_TRUE@test_virtuals_without_test_DEPENDENCIES = \ @NA_MAINTAINER_MODE_TRUE@ $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtest_module_plugin_la_SOURCES) $(test_iface_SOURCES) \ $(test_iface2_SOURCES) $(test_module_SOURCES) \ $(test_parse_uris_SOURCES) $(test_reader_SOURCES) \ $(test_virtuals_SOURCES) $(test_virtuals_without_test_SOURCES) DIST_SOURCES = $(am__libtest_module_plugin_la_SOURCES_DIST) \ $(am__test_iface_SOURCES_DIST) $(am__test_iface2_SOURCES_DIST) \ $(am__test_module_SOURCES_DIST) \ $(am__test_parse_uris_SOURCES_DIST) \ $(am__test_reader_SOURCES_DIST) \ $(am__test_virtuals_SOURCES_DIST) \ $(am__test_virtuals_without_test_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ $(am__append_1) AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DLLTOOL = @DLLTOOL@ DOC_USER_FORMATS = @DOC_USER_FORMATS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCONFTOOL = @GCONFTOOL@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ GDBUS_CFLAGS = @GDBUS_CFLAGS@ GDBUS_LIBS = @GDBUS_LIBS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK3_CFLAGS = @GTK3_CFLAGS@ GTK3_LIBS = @GTK3_LIBS@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTOP_CFLAGS = @GTOP_CFLAGS@ GTOP_LIBS = @GTOP_LIBS@ HELP_DIR = @HELP_DIR@ HTML_DIR = @HTML_DIR@ ICE_CFLAGS = @ICE_CFLAGS@ ICE_LIBS = @ICE_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAUTILUS_ACTIONS_CFLAGS = @NAUTILUS_ACTIONS_CFLAGS@ NAUTILUS_ACTIONS_LIBS = @NAUTILUS_ACTIONS_LIBS@ NAUTILUS_EXTENSIONS_DIR = @NAUTILUS_EXTENSIONS_DIR@ NAUTILUS_EXTENSION_CFLAGS = @NAUTILUS_EXTENSION_CFLAGS@ NAUTILUS_EXTENSION_LIBS = @NAUTILUS_EXTENSION_LIBS@ NA_LOGDOMAIN_CORE = @NA_LOGDOMAIN_CORE@ NA_LOGDOMAIN_IO_DESKTOP = @NA_LOGDOMAIN_IO_DESKTOP@ NA_LOGDOMAIN_IO_GCONF = @NA_LOGDOMAIN_IO_GCONF@ NA_LOGDOMAIN_IO_XML = @NA_LOGDOMAIN_IO_XML@ NA_LOGDOMAIN_NACT = @NA_LOGDOMAIN_NACT@ NA_LOGDOMAIN_PLUGIN_MENU = @NA_LOGDOMAIN_PLUGIN_MENU@ NA_LOGDOMAIN_PLUGIN_TRACKER = @NA_LOGDOMAIN_PLUGIN_TRACKER@ NA_LOGDOMAIN_TEST = @NA_LOGDOMAIN_TEST@ NA_LOGDOMAIN_UTILS = @NA_LOGDOMAIN_UTILS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OMF_DIR = @OMF_DIR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SM_CFLAGS = @SM_CFLAGS@ SM_LIBS = @SM_LIBS@ STRIP = @STRIP@ UNIQUE_CFLAGS = @UNIQUE_CFLAGS@ UNIQUE_LIBS = @UNIQUE_LIBS@ USE_NLS = @USE_NLS@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ WITH_DB2HTML = @WITH_DB2HTML@ WITH_GDT = @WITH_GDT@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_db2html = @with_db2html@ with_dblatex = @with_dblatex@ with_gdt = @with_gdt@ @NA_MAINTAINER_MODE_TRUE@test_reader_SOURCES = \ @NA_MAINTAINER_MODE_TRUE@ test-reader.c \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_reader_LDADD = \ @NA_MAINTAINER_MODE_TRUE@ $(top_builddir)/src/core/libna-core.la \ @NA_MAINTAINER_MODE_TRUE@ $(NAUTILUS_ACTIONS_LIBS) \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_iface_SOURCES = \ @NA_MAINTAINER_MODE_TRUE@ test-iface.c \ @NA_MAINTAINER_MODE_TRUE@ test-iface-iface.c \ @NA_MAINTAINER_MODE_TRUE@ test-iface-iface.h \ @NA_MAINTAINER_MODE_TRUE@ test-iface-base.c \ @NA_MAINTAINER_MODE_TRUE@ test-iface-base.h \ @NA_MAINTAINER_MODE_TRUE@ test-iface-derived.c \ @NA_MAINTAINER_MODE_TRUE@ test-iface-derived.h \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_iface_LDADD = \ @NA_MAINTAINER_MODE_TRUE@ $(NAUTILUS_ACTIONS_LIBS) \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_iface2_SOURCES = \ @NA_MAINTAINER_MODE_TRUE@ test-iface2.c \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_iface2_LDADD = \ @NA_MAINTAINER_MODE_TRUE@ $(NAUTILUS_ACTIONS_LIBS) \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@pkglib_LTLIBRARIES = libtest_module_plugin.la @NA_MAINTAINER_MODE_TRUE@test_module_SOURCES = \ @NA_MAINTAINER_MODE_TRUE@ test-module.c \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_module_LDADD = \ @NA_MAINTAINER_MODE_TRUE@ $(NAUTILUS_ACTIONS_LIBS) \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@libtest_module_plugin_la_SOURCES = \ @NA_MAINTAINER_MODE_TRUE@ test-module-plugin.c \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@libtest_module_plugin_la_LIBADD = \ @NA_MAINTAINER_MODE_TRUE@ $(NAUTILUS_ACTIONS_LIBS) \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@libtest_module_plugin_la_LDFLAGS = \ @NA_MAINTAINER_MODE_TRUE@ -module \ @NA_MAINTAINER_MODE_TRUE@ -no-undefined \ @NA_MAINTAINER_MODE_TRUE@ -avoid-version \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_parse_uris_SOURCES = \ @NA_MAINTAINER_MODE_TRUE@ test-parse-uris.c \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_parse_uris_LDADD = \ @NA_MAINTAINER_MODE_TRUE@ $(top_builddir)/src/core/libna-core.la \ @NA_MAINTAINER_MODE_TRUE@ $(NAUTILUS_ACTIONS_LIBS) \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_virtuals_SOURCES = \ @NA_MAINTAINER_MODE_TRUE@ test-virtuals.c \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_virtuals_LDADD = \ @NA_MAINTAINER_MODE_TRUE@ $(NAUTILUS_ACTIONS_LIBS) \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_virtuals_without_test_SOURCES = \ @NA_MAINTAINER_MODE_TRUE@ test-virtuals-without-test.c \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) @NA_MAINTAINER_MODE_TRUE@test_virtuals_without_test_LDADD = \ @NA_MAINTAINER_MODE_TRUE@ $(NAUTILUS_ACTIONS_LIBS) \ @NA_MAINTAINER_MODE_TRUE@ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libtest_module_plugin.la: $(libtest_module_plugin_la_OBJECTS) $(libtest_module_plugin_la_DEPENDENCIES) $(EXTRA_libtest_module_plugin_la_DEPENDENCIES) $(AM_V_CCLD)$(libtest_module_plugin_la_LINK) $(am_libtest_module_plugin_la_rpath) $(libtest_module_plugin_la_OBJECTS) $(libtest_module_plugin_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test-iface$(EXEEXT): $(test_iface_OBJECTS) $(test_iface_DEPENDENCIES) $(EXTRA_test_iface_DEPENDENCIES) @rm -f test-iface$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_iface_OBJECTS) $(test_iface_LDADD) $(LIBS) test-iface2$(EXEEXT): $(test_iface2_OBJECTS) $(test_iface2_DEPENDENCIES) $(EXTRA_test_iface2_DEPENDENCIES) @rm -f test-iface2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_iface2_OBJECTS) $(test_iface2_LDADD) $(LIBS) test-module$(EXEEXT): $(test_module_OBJECTS) $(test_module_DEPENDENCIES) $(EXTRA_test_module_DEPENDENCIES) @rm -f test-module$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_module_OBJECTS) $(test_module_LDADD) $(LIBS) test-parse-uris$(EXEEXT): $(test_parse_uris_OBJECTS) $(test_parse_uris_DEPENDENCIES) $(EXTRA_test_parse_uris_DEPENDENCIES) @rm -f test-parse-uris$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_parse_uris_OBJECTS) $(test_parse_uris_LDADD) $(LIBS) test-reader$(EXEEXT): $(test_reader_OBJECTS) $(test_reader_DEPENDENCIES) $(EXTRA_test_reader_DEPENDENCIES) @rm -f test-reader$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_reader_OBJECTS) $(test_reader_LDADD) $(LIBS) test-virtuals$(EXEEXT): $(test_virtuals_OBJECTS) $(test_virtuals_DEPENDENCIES) $(EXTRA_test_virtuals_DEPENDENCIES) @rm -f test-virtuals$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_virtuals_OBJECTS) $(test_virtuals_LDADD) $(LIBS) test-virtuals-without-test$(EXEEXT): $(test_virtuals_without_test_OBJECTS) $(test_virtuals_without_test_DEPENDENCIES) $(EXTRA_test_virtuals_without_test_DEPENDENCIES) @rm -f test-virtuals-without-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_virtuals_without_test_OBJECTS) $(test_virtuals_without_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iface-base.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iface-derived.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iface-iface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iface2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-module-plugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-module.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-parse-uris.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-reader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-virtuals-without-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-virtuals.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS clean-pkglibLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkglibLTLIBRARIES install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkglibLTLIBRARIES #if NA_MAINTAINER_MODE # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: nautilus-actions-3.2.3/src/nact/0000755000175100017500000000000012220365533013540 500000000000000nautilus-actions-3.2.3/src/nact/nact-icon-chooser.h0000644000175100017500000000521112212601376017142 00000000000000/* * Nautilus Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NACT_ICON_CHOOSER_H__ #define __NACT_ICON_CHOOSER_H__ /** * SECTION: nact_icon_chooser * @short_description: NactIconChooser dialog box * @include: nact/nact-icon-chooser.h * * This class is derived from BaseDialog. */ #include "base-dialog.h" G_BEGIN_DECLS #define NACT_TYPE_ICON_CHOOSER ( nact_icon_chooser_get_type()) #define NACT_ICON_CHOOSER( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_TYPE_ICON_CHOOSER, NactIconChooser )) #define NACT_ICON_CHOOSER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NACT_TYPE_ICON_CHOOSER, NactIconChooserClass )) #define NACT_IS_ICON_CHOOSER( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_TYPE_ICON_CHOOSER )) #define NACT_IS_ICON_CHOOSER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_TYPE_ICON_CHOOSER )) #define NACT_ICON_CHOOSER_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_TYPE_ICON_CHOOSER, NactIconChooserClass )) typedef struct _NactIconChooserPrivate NactIconChooserPrivate; typedef struct { /*< private >*/ BaseDialog parent; NactIconChooserPrivate *private; } NactIconChooser; typedef struct _NactIconChooserClassPrivate NactIconChooserClassPrivate; typedef struct { /*< private >*/ BaseDialogClass parent; NactIconChooserClassPrivate *private; } NactIconChooserClass; GType nact_icon_chooser_get_type( void ); gchar *nact_icon_chooser_choose_icon( BaseWindow *main_window, const gchar *icon_name ); G_END_DECLS #endif /* __NACT_ICON_CHOOSER_H__ */ nautilus-actions-3.2.3/src/nact/nact-icon-chooser.c0000644000175100017500000007023012212601376017140 00000000000000/* * Nautilus Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "base-keysyms.h" #include "nact-application.h" #include "base-gtk-utils.h" #include "nact-icon-chooser.h" /* private class data */ struct _NactIconChooserClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NactIconChooserPrivate { gboolean dispose_has_run; BaseWindow *main_window; const gchar *initial_icon; gchar *current_icon; GtkWidget *path_preview; }; #define VIEW_ICON_SIZE GTK_ICON_SIZE_DND #define VIEW_ICON_DEFAULT_WIDTH 32 /* width of the GTK_ICON_SIZE_DND icon size */ #define PREVIEW_ICON_SIZE GTK_ICON_SIZE_DIALOG #define PREVIEW_ICON_WIDTH 64 #define CURRENT_ICON_SIZE GTK_ICON_SIZE_DIALOG /* column ordering in the Stock model */ enum { STOCK_NAME_COLUMN = 0, STOCK_LABEL_COLUMN, STOCK_PIXBUF_COLUMN, STOCK_N_COLUMN }; /* column ordering in the ThemeContext model * this is the list store on the left which lets the user select the context */ enum { THEME_CONTEXT_LABEL_COLUMN = 0, THEME_CONTEXT_STORE_COLUMN, THEME_CONTEXT_LAST_SELECTED_COLUMN, THEME_CONTEXT_N_COLUMN }; /* column ordering in the ThemeIconView model * foreach selected context, we display in the icon view the list of * corresponding icons */ enum { THEME_ICON_LABEL_COLUMN = 0, THEME_ICON_PIXBUF_COLUMN, THEME_ICON_N_COLUMN }; static const gchar *st_xmlui_filename = PKGUIDIR "/nact-icon-chooser.ui"; static const gchar *st_toplevel_name = "IconChooserDialog"; static const gchar *st_wsp_name = NA_IPREFS_ICON_CHOOSER_WSP; static BaseDialogClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NactIconChooserClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_constructed( GObject *dialog ); static void instance_dispose( GObject *dialog ); static void instance_finalize( GObject *dialog ); static void on_base_initialize_gtk( NactIconChooser *editor, GtkDialog *toplevel, gpointer user_data ); static void do_initialize_themed_icons( NactIconChooser *editor ); static void do_initialize_icons_by_path( NactIconChooser *editor ); static void on_base_initialize_window( NactIconChooser *editor, gpointer user_data ); static void fillup_themed_icons( NactIconChooser *editor ); static void fillup_icons_by_path( NactIconChooser *editor ); static void on_base_show_widgets( NactIconChooser *editor, gpointer user_data ); static void on_cancel_clicked( GtkButton *button, NactIconChooser *editor ); static void on_ok_clicked( GtkButton *button, NactIconChooser *editor ); static void on_dialog_cancel( BaseDialog *dialog ); static void on_current_icon_changed( const NactIconChooser *editor ); static gboolean on_destroy( GtkWidget *widget, GdkEvent *event, void *foo ); static gboolean on_icon_view_button_press_event( GtkWidget *widget, GdkEventButton *event, NactIconChooser *editor ); static gboolean on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, NactIconChooser *editor ); static void on_themed_context_changed( GtkTreeSelection *selection, NactIconChooser *editor ); static void on_themed_icon_changed( GtkIconView *icon_view, NactIconChooser *editor ); static void on_themed_apply_button_clicked( GtkButton *button, NactIconChooser *editor ); static void on_themed_apply_triggered( NactIconChooser *editor ); static void on_path_selection_changed( GtkFileChooser *chooser, NactIconChooser *editor ); static void on_path_update_preview( GtkFileChooser *chooser, NactIconChooser *editor ); static void on_path_apply_button_clicked( GtkButton *button, NactIconChooser *editor ); static GtkListStore *theme_context_load_icons( NactIconChooser *editor, const gchar *context ); GType nact_icon_chooser_get_type( void ) { static GType dialog_type = 0; if( !dialog_type ){ dialog_type = register_type(); } return( dialog_type ); } static GType register_type( void ) { static const gchar *thisfn = "nact_icon_chooser_register_type"; GType type; static GTypeInfo info = { sizeof( NactIconChooserClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NactIconChooser ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( BASE_TYPE_DIALOG, "NactIconChooser", &info, 0 ); return( type ); } static void class_init( NactIconChooserClass *klass ) { static const gchar *thisfn = "nact_icon_chooser_class_init"; GObjectClass *object_class; BaseDialogClass *dialog_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->constructed = instance_constructed; object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NactIconChooserClassPrivate, 1 ); dialog_class = BASE_DIALOG_CLASS( klass ); dialog_class->cancel = on_dialog_cancel; } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "nact_icon_chooser_instance_init"; NactIconChooser *self; g_return_if_fail( NACT_IS_ICON_CHOOSER( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NACT_ICON_CHOOSER( instance ); self->private = g_new0( NactIconChooserPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_constructed( GObject *dialog ) { static const gchar *thisfn = "nact_icon_chooser_instance_constructed"; NactIconChooserPrivate *priv; g_return_if_fail( NACT_IS_ICON_CHOOSER( dialog )); priv = NACT_ICON_CHOOSER( dialog )->private; if( !priv->dispose_has_run ){ /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->constructed ){ G_OBJECT_CLASS( st_parent_class )->constructed( dialog ); } g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog )); base_window_signal_connect( BASE_WINDOW( dialog ), G_OBJECT( dialog ), BASE_SIGNAL_INITIALIZE_GTK, G_CALLBACK( on_base_initialize_gtk )); base_window_signal_connect( BASE_WINDOW( dialog ), G_OBJECT( dialog ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_window )); base_window_signal_connect( BASE_WINDOW( dialog ), G_OBJECT( dialog ), BASE_SIGNAL_SHOW_WIDGETS, G_CALLBACK( on_base_show_widgets )); } } static void instance_dispose( GObject *dialog ) { static const gchar *thisfn = "nact_icon_chooser_instance_dispose"; NactIconChooser *self; guint pos; GtkWidget *paned; g_return_if_fail( NACT_IS_ICON_CHOOSER( dialog )); self = NACT_ICON_CHOOSER( dialog ); if( !self->private->dispose_has_run ){ g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog )); self->private->dispose_has_run = TRUE; paned = base_window_get_widget( BASE_WINDOW( self ), "IconPaned" ); pos = gtk_paned_get_position( GTK_PANED( paned )); na_settings_set_uint( NA_IPREFS_ICON_CHOOSER_PANED, pos ); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( dialog ); } } } static void instance_finalize( GObject *dialog ) { static const gchar *thisfn = "nact_icon_chooser_instance_finalize"; NactIconChooser *self; g_return_if_fail( NACT_IS_ICON_CHOOSER( dialog )); g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog )); self = NACT_ICON_CHOOSER( dialog ); g_free( self->private->current_icon ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( dialog ); } } /** * nact_icon_chooser_choose_icon: * @parent: the #BaseWindow parent of this dialog. * @icon_name: the current icon at startup. * * Initializes and runs the dialog. * * This dialog lets the user choose an icon, either as the name of a * themed icon, or as the path of an image. * * Returns: the selected icon, as a new string which should be g_free() * by the caller. */ gchar * nact_icon_chooser_choose_icon( BaseWindow *parent, const gchar *icon_name ) { static const gchar *thisfn = "nact_icon_chooser_choose_icon"; NactIconChooser *editor; gchar *new_name; g_return_val_if_fail( BASE_IS_WINDOW( parent ), NULL ); g_debug( "%s: parent=%p, icon_name=%s", thisfn, ( void * ) parent, icon_name ); editor = g_object_new( NACT_TYPE_ICON_CHOOSER, BASE_PROP_PARENT, parent, BASE_PROP_XMLUI_FILENAME, st_xmlui_filename, BASE_PROP_TOPLEVEL_NAME, st_toplevel_name, BASE_PROP_WSP_NAME, st_wsp_name, NULL ); editor->private->main_window = parent; editor->private->initial_icon = icon_name; new_name = g_strdup( editor->private->initial_icon ); if( base_window_run( BASE_WINDOW( editor )) == GTK_RESPONSE_OK ){ g_free( new_name ); new_name = g_strdup( editor->private->current_icon ); } g_object_unref( editor ); return( new_name ); } static void on_base_initialize_gtk( NactIconChooser *editor, GtkDialog *toplevel, gpointer user_data ) { static const gchar *thisfn = "nact_icon_chooser_on_base_initialize_gtk"; g_return_if_fail( NACT_IS_ICON_CHOOSER( editor )); if( !editor->private->dispose_has_run ){ g_debug( "%s: dialog=%p, toplevel=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) toplevel, ( void * ) user_data ); /* initialize the notebook */ do_initialize_themed_icons( editor ); do_initialize_icons_by_path( editor ); /* destroy event * this is here that we are going to release our stores */ GtkDialog *dialog = GTK_DIALOG( base_window_get_gtk_toplevel( BASE_WINDOW( editor ))); g_signal_connect( G_OBJECT( dialog ), "destroy", G_CALLBACK( on_destroy ), NULL ); #if !GTK_CHECK_VERSION( 2,22,0 ) gtk_dialog_set_has_separator( toplevel, FALSE ); #endif } } /* * initialize the themed icon tab * first, the listview which handles the context list * each context carries a list store which handles the corresponding icons * this store is initialized the first time the context is selected */ static void do_initialize_themed_icons( NactIconChooser *editor ) { GtkTreeView *context_view; GtkTreeModel *context_model; GtkCellRenderer *text_cell; GtkTreeViewColumn *column; GtkIconView *icon_view; GtkTreeSelection *selection; GtkIconTheme *icon_theme; GList *theme_contexts, *it; const gchar *context_label; GtkTreeIter iter; context_view = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "ThemedTreeView" )); context_model = GTK_TREE_MODEL( gtk_list_store_new( THEME_CONTEXT_N_COLUMN, G_TYPE_STRING, G_TYPE_OBJECT, G_TYPE_STRING )); gtk_tree_view_set_model( context_view, context_model ); gtk_tree_view_set_headers_visible( context_view, FALSE ); text_cell = gtk_cell_renderer_text_new(); column = gtk_tree_view_column_new_with_attributes( "theme-context", text_cell, "text", THEME_CONTEXT_LABEL_COLUMN, NULL ); gtk_tree_view_append_column( context_view, column ); icon_view = GTK_ICON_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "ThemedIconView" )); gtk_icon_view_set_text_column( icon_view, THEME_ICON_LABEL_COLUMN ); gtk_icon_view_set_pixbuf_column( icon_view, THEME_ICON_PIXBUF_COLUMN ); gtk_icon_view_set_selection_mode( icon_view, GTK_SELECTION_BROWSE ); selection = gtk_tree_view_get_selection( context_view ); gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE ); icon_theme = gtk_icon_theme_get_default(); theme_contexts = g_list_sort( gtk_icon_theme_list_contexts( icon_theme ), ( GCompareFunc ) g_utf8_collate ); for( it = theme_contexts ; it ; it = it->next ){ context_label = ( const gchar *) it->data; gtk_list_store_append( GTK_LIST_STORE( context_model ), &iter ); gtk_list_store_set( GTK_LIST_STORE( context_model ), &iter, THEME_CONTEXT_LABEL_COLUMN, context_label, THEME_CONTEXT_STORE_COLUMN, NULL, -1 ); } g_list_foreach( theme_contexts, ( GFunc ) g_free, NULL ); g_list_free( theme_contexts ); g_object_unref( context_model ); } static void do_initialize_icons_by_path( NactIconChooser *editor ) { GtkFileChooser *file_chooser; file_chooser = GTK_FILE_CHOOSER( base_window_get_widget( BASE_WINDOW( editor ), "FileChooser" )); gtk_file_chooser_set_action( file_chooser, GTK_FILE_CHOOSER_ACTION_OPEN ); gtk_file_chooser_set_select_multiple( file_chooser, FALSE ); } static void on_base_initialize_window( NactIconChooser *editor, gpointer user_data ) { static const gchar *thisfn = "nact_icon_chooser_on_base_initialize_window"; guint pos; GtkWidget *paned; g_return_if_fail( NACT_IS_ICON_CHOOSER( editor )); if( !editor->private->dispose_has_run ){ g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data ); pos = na_settings_get_uint( NA_IPREFS_ICON_CHOOSER_PANED, NULL, NULL ); if( pos ){ paned = base_window_get_widget( BASE_WINDOW( editor ), "IconPaned" ); gtk_paned_set_position( GTK_PANED( paned ), pos ); } /* setup the initial icon */ editor->private->current_icon = g_strdup( editor->private->initial_icon ); on_current_icon_changed( editor ); /* fillup the icon stores */ fillup_themed_icons( editor ); fillup_icons_by_path( editor ); /* intercept Escape key: we do not quit on Esc. */ base_window_signal_connect( BASE_WINDOW( editor ), G_OBJECT( base_window_get_gtk_toplevel( BASE_WINDOW( editor ))), "key-press-event", G_CALLBACK( on_key_pressed_event )); /* OK/Cancel buttons */ base_window_signal_connect_by_name( BASE_WINDOW( editor ), "CancelButton", "clicked", G_CALLBACK( on_cancel_clicked )); base_window_signal_connect_by_name( BASE_WINDOW( editor ), "OKButton", "clicked", G_CALLBACK( on_ok_clicked )); } } static void fillup_themed_icons( NactIconChooser *editor ) { GtkTreeView *context_view; GtkTreeSelection *selection; GtkTreePath *path; GtkIconView *icon_view; icon_view = GTK_ICON_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "ThemedIconView" )); base_window_signal_connect( BASE_WINDOW( editor ), G_OBJECT( icon_view ), "selection-changed", G_CALLBACK( on_themed_icon_changed )); /* catch double-click */ base_window_signal_connect( BASE_WINDOW( editor ), G_OBJECT( icon_view ), "button-press-event", G_CALLBACK( on_icon_view_button_press_event )); context_view = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "ThemedTreeView" )); selection = gtk_tree_view_get_selection( context_view ); base_window_signal_connect( BASE_WINDOW( editor ), G_OBJECT( selection ), "changed", G_CALLBACK( on_themed_context_changed )); path = gtk_tree_path_new_first(); gtk_tree_selection_select_path( selection, path ); gtk_tree_path_free( path ); base_window_signal_connect_by_name( BASE_WINDOW( editor ), "ThemedApplyButton", "clicked", G_CALLBACK( on_themed_apply_button_clicked )); } static void fillup_icons_by_path( NactIconChooser *editor ) { GtkFileChooser *file_chooser; gchar *uri; file_chooser = GTK_FILE_CHOOSER( base_window_get_widget( BASE_WINDOW( editor ), "FileChooser" )); editor->private->path_preview = gtk_image_new(); gtk_file_chooser_set_preview_widget( file_chooser, editor->private->path_preview ); gtk_file_chooser_unselect_all( file_chooser ); uri = na_settings_get_string( NA_IPREFS_ICON_CHOOSER_URI, NULL, NULL ); if( uri ){ gtk_file_chooser_set_current_folder_uri( file_chooser, uri ); g_free( uri ); } else if( editor->private->current_icon ){ gtk_file_chooser_set_filename( file_chooser, editor->private->current_icon ); } base_window_signal_connect( BASE_WINDOW( editor ), G_OBJECT( file_chooser ), "selection-changed", G_CALLBACK( on_path_selection_changed )); base_window_signal_connect( BASE_WINDOW( editor ), G_OBJECT( file_chooser ), "update-preview", G_CALLBACK( on_path_update_preview )); base_window_signal_connect_by_name( BASE_WINDOW( editor ), "PathApplyButton", "clicked", G_CALLBACK( on_path_apply_button_clicked )); } static void on_base_show_widgets( NactIconChooser *editor, gpointer user_data ) { static const gchar *thisfn = "nact_icon_chooser_on_base_show_widgets"; GtkWidget *about_button; g_return_if_fail( NACT_IS_ICON_CHOOSER( editor )); if( !editor->private->dispose_has_run ){ g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data ); /* hide about button not used here */ about_button = base_window_get_widget( BASE_WINDOW( editor ), "AboutButton" ); gtk_widget_hide( about_button ); } } static void on_cancel_clicked( GtkButton *button, NactIconChooser *editor ) { GtkWindow *toplevel = base_window_get_gtk_toplevel( BASE_WINDOW( editor )); gtk_dialog_response( GTK_DIALOG( toplevel ), GTK_RESPONSE_CLOSE ); } static void on_ok_clicked( GtkButton *button, NactIconChooser *editor ) { GtkWindow *toplevel = base_window_get_gtk_toplevel( BASE_WINDOW( editor )); gtk_dialog_response( GTK_DIALOG( toplevel ), GTK_RESPONSE_OK ); } static void on_dialog_cancel( BaseDialog *dialog ) { static const gchar *thisfn = "nact_icon_chooser_on_dialog_cancel"; NactIconChooser *editor; g_return_if_fail( NACT_IS_ICON_CHOOSER( dialog )); editor = NACT_ICON_CHOOSER( dialog ); if( !editor->private->dispose_has_run ){ g_debug( "%s: dialog=%p", thisfn, ( void * ) dialog ); g_free( editor->private->current_icon ); editor->private->current_icon = g_strdup( editor->private->initial_icon ); } } /* * display at the top of the dialog the icon addressed in @icon * this is this icon which will be returned if the user validates * this dialog */ static void on_current_icon_changed( const NactIconChooser *editor ) { GtkImage *image; gchar *icon_label; GtkLabel *label; image = GTK_IMAGE( base_window_get_widget( BASE_WINDOW( editor ), "IconImage" )); base_gtk_utils_render( editor->private->current_icon, image, CURRENT_ICON_SIZE ); if( editor->private->current_icon ){ if( g_path_is_absolute( editor->private->current_icon )){ icon_label = g_filename_to_utf8( editor->private->current_icon, -1, NULL, NULL, NULL ); } else { icon_label = g_strdup( editor->private->current_icon ); } label = GTK_LABEL( base_window_get_widget( BASE_WINDOW( editor ), "IconLabel" )); gtk_label_set_label( label, icon_label ); g_free( icon_label ); } } static gboolean on_destroy( GtkWidget *widget, GdkEvent *event, void *foo ) { static const gchar *thisfn = "nact_icon_chooser_on_destroy"; GtkTreeView *context_view; GtkListStore *context_store; GtkTreeIter context_iter; GtkListStore *icon_store; gchar *context_label; g_debug( "%s: widget=%p", thisfn, ( void * ) widget ); /* clear the various models */ context_view = GTK_TREE_VIEW( na_gtk_utils_find_widget_by_name( GTK_CONTAINER( widget ), "ThemedTreeView" )); context_store = GTK_LIST_STORE( gtk_tree_view_get_model( context_view )); if( gtk_tree_model_get_iter_first( GTK_TREE_MODEL( context_store ), &context_iter )){ while( TRUE ){ gtk_tree_model_get( GTK_TREE_MODEL( context_store ), &context_iter, THEME_CONTEXT_LABEL_COLUMN, &context_label, THEME_CONTEXT_STORE_COLUMN, &icon_store, -1 ); if( icon_store ){ g_debug( "%s: context=%s, clearing store=%p", thisfn, context_label, ( void * ) icon_store ); gtk_list_store_clear( icon_store ); g_object_unref( icon_store ); } g_free( context_label ); if( !gtk_tree_model_iter_next( GTK_TREE_MODEL( context_store ), &context_iter )){ break; } } } gtk_list_store_clear( context_store ); /* let other handlers get this message */ return( FALSE ); } /* * mouse click on the themed icons icon view */ static gboolean on_icon_view_button_press_event( GtkWidget *widget, GdkEventButton *event, NactIconChooser *editor ) { gboolean stop = FALSE; /* double-click of left button * > triggers a 'Apply' action */ if( event->type == GDK_2BUTTON_PRESS && event->button == 1 ){ on_themed_apply_triggered( editor ); stop = TRUE; } return( stop ); } static gboolean on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, NactIconChooser *editor ) { gboolean stop = FALSE; g_return_val_if_fail( NACT_IS_ICON_CHOOSER( editor ), FALSE ); if( !editor->private->dispose_has_run ){ /* inhibit Escape key */ if( event->keyval == NACT_KEY_Escape ){ stop = TRUE; } } return( stop ); } static void on_themed_context_changed( GtkTreeSelection *selection, NactIconChooser *editor ) { GtkTreeModel *model; GtkTreeIter iter; GtkListStore *store; gchar *context, *last_path; GtkTreePath *path; GtkWidget *preview_image, *preview_label; if( gtk_tree_selection_get_selected( selection, &model, &iter )){ gtk_tree_model_get( model, &iter, THEME_CONTEXT_LABEL_COLUMN, &context, THEME_CONTEXT_STORE_COLUMN, &store, THEME_CONTEXT_LAST_SELECTED_COLUMN, &last_path, -1 ); if( !store ){ store = theme_context_load_icons( editor, context ); gtk_list_store_set( GTK_LIST_STORE( model ), &iter, THEME_CONTEXT_STORE_COLUMN, store, -1 ); } GtkIconView *iconview = GTK_ICON_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "ThemedIconView" )); gtk_icon_view_set_model( iconview, GTK_TREE_MODEL( store )); if( last_path ){ path = gtk_tree_path_new_from_string( last_path ); gtk_icon_view_select_path( iconview, path ); gtk_tree_path_free( path ); } else { preview_image = base_window_get_widget( BASE_WINDOW( editor ), "ThemedIconImage" ); gtk_image_set_from_pixbuf( GTK_IMAGE( preview_image ), NULL ); preview_label = base_window_get_widget( BASE_WINDOW( editor ), "ThemedIconName" ); gtk_label_set_text( GTK_LABEL( preview_label ), "" ); } g_free( last_path ); g_free( context ); g_object_unref( store ); } } static void on_themed_icon_changed( GtkIconView *icon_view, NactIconChooser *editor ) { GList *selected; GtkTreeModel *model; GtkTreeIter iter; gchar *label; GtkWidget *preview_image, *preview_label; GtkTreeView *context_view; GtkListStore *context_store; GtkTreeSelection *context_selection; GtkTreeIter context_iter; gchar *icon_path; selected = gtk_icon_view_get_selected_items( icon_view ); if( selected ){ model = gtk_icon_view_get_model( icon_view ); if( gtk_tree_model_get_iter( model, &iter, ( GtkTreePath * ) selected->data )){ gtk_tree_model_get( model, &iter, THEME_ICON_LABEL_COLUMN, &label, -1 ); preview_image = base_window_get_widget( BASE_WINDOW( editor ), "ThemedIconImage" ); base_gtk_utils_render( label, GTK_IMAGE( preview_image ), PREVIEW_ICON_SIZE ); preview_label = base_window_get_widget( BASE_WINDOW( editor ), "ThemedIconName" ); gtk_label_set_text( GTK_LABEL( preview_label ), label ); /* record in context tree view the path to the last selected icon */ context_view = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "ThemedTreeView" )); context_selection = gtk_tree_view_get_selection( context_view ); if( gtk_tree_selection_get_selected( context_selection, ( GtkTreeModel ** ) &context_store, &context_iter )){ icon_path = gtk_tree_model_get_string_from_iter( model, &iter ); gtk_list_store_set( context_store, &context_iter, THEME_CONTEXT_LAST_SELECTED_COLUMN, icon_path, -1 ); g_free( icon_path ); } g_free( label ); } g_list_foreach( selected, ( GFunc ) gtk_tree_path_free, NULL ); g_list_free( selected ); } } static void on_themed_apply_button_clicked( GtkButton *button, NactIconChooser *editor ) { on_themed_apply_triggered( editor ); } static void on_themed_apply_triggered( NactIconChooser *editor ) { GtkWidget *icon_label; const gchar *icon_name; icon_label = base_window_get_widget( BASE_WINDOW( editor ), "ThemedIconName" ); icon_name = gtk_label_get_text( GTK_LABEL( icon_label )); g_free( editor->private->current_icon ); editor->private->current_icon = g_strdup( icon_name ); on_current_icon_changed( editor ); } static void on_path_selection_changed( GtkFileChooser *file_chooser, NactIconChooser *editor ) { gchar *uri; uri = gtk_file_chooser_get_current_folder_uri( file_chooser ); if( uri ){ na_settings_set_string( NA_IPREFS_ICON_CHOOSER_URI, uri ); g_free( uri ); } } static void on_path_update_preview( GtkFileChooser *file_chooser, NactIconChooser *editor ) { static const gchar *thisfn = "nact_icon_chooser_on_path_update_preview"; char *filename; GdkPixbuf *pixbuf; gboolean have_preview; gint width, height; if( !gtk_icon_size_lookup( PREVIEW_ICON_SIZE, &width, &height )){ width = PREVIEW_ICON_WIDTH; height = PREVIEW_ICON_WIDTH; } have_preview = FALSE; filename = gtk_file_chooser_get_preview_filename( file_chooser ); g_debug( "%s: file_chooser=%p, editor=%p, filename=%s", thisfn, ( void * ) file_chooser, ( void * ) editor, filename ); if( filename ){ pixbuf = gdk_pixbuf_new_from_file_at_size( filename, width, height, NULL ); have_preview = ( pixbuf != NULL ); g_free( filename ); } if( have_preview ){ gtk_image_set_from_pixbuf( GTK_IMAGE( editor->private->path_preview ), pixbuf ); g_object_unref( pixbuf ); } gtk_file_chooser_set_preview_widget_active( file_chooser, TRUE ); } static void on_path_apply_button_clicked( GtkButton *button, NactIconChooser *editor ) { GtkFileChooser *file_chooser = GTK_FILE_CHOOSER( base_window_get_widget( BASE_WINDOW( editor ), "FileChooser" )); /* this is a filename in the character set specified by the G_FILENAME_ENCODING * environment variable */ g_free( editor->private->current_icon ); editor->private->current_icon = gtk_file_chooser_get_filename( file_chooser ); on_current_icon_changed( editor ); } static GtkListStore * theme_context_load_icons( NactIconChooser *editor, const gchar *context ) { static const gchar *thisfn = "nact_icon_chooser_theme_context_load_icons"; GtkTreeIter iter; GList *ic; GError *error; gint width, height; g_debug( "%s: editor=%p, context=%s", thisfn, ( void * ) editor, context ); GtkIconTheme *icon_theme = gtk_icon_theme_get_default(); GtkListStore *store = gtk_list_store_new( THEME_ICON_N_COLUMN, G_TYPE_STRING, GDK_TYPE_PIXBUF ); GList *icon_list = g_list_sort( gtk_icon_theme_list_icons( icon_theme, context ), ( GCompareFunc ) g_utf8_collate ); if( !gtk_icon_size_lookup( VIEW_ICON_SIZE, &width, &height )){ width = VIEW_ICON_DEFAULT_WIDTH; } g_debug( "%s: width=%d", thisfn, width ); for( ic = icon_list ; ic ; ic = ic->next ){ const gchar *icon_name = ( const gchar * ) ic->data; error = NULL; GdkPixbuf *pixbuf = gtk_icon_theme_load_icon( icon_theme, icon_name, width, GTK_ICON_LOOKUP_GENERIC_FALLBACK, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); } else { gtk_list_store_append( store, &iter ); gtk_list_store_set( store, &iter, THEME_ICON_LABEL_COLUMN, icon_name, THEME_ICON_PIXBUF_COLUMN, pixbuf, -1 ); g_object_unref( pixbuf ); } } g_debug( "%s: %d loaded icons in store=%p", thisfn, g_list_length( icon_list ), ( void * ) store ); g_list_foreach( icon_list, ( GFunc ) g_free, NULL ); g_list_free( icon_list ); return( store ); } nautilus-actions-3.2.3/src/nact/transparent.png0000644000175100017500000000026711367255360016543 00000000000000PNG  IHDRasRGBbKGD pHYs  tIME A.ItEXtCommentCreated with GIMPWIDAT8c``?rIENDB`nautilus-actions-3.2.3/src/nact/nact-icommand-tab.h0000644000175100017500000000463212212601376017113 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NACT_ICOMMAND_TAB_H__ #define __NACT_ICOMMAND_TAB_H__ /** * SECTION: nact_icommand_tab * @short_description: #NactICommandTab interface declaration. * @include: nact/nact-icommand-tab.h * * This interface implements all the widgets which define the * actual action to be executed (from NAObjectProfile). */ #include G_BEGIN_DECLS #define NACT_TYPE_ICOMMAND_TAB ( nact_icommand_tab_get_type()) #define NACT_ICOMMAND_TAB( instance ) ( G_TYPE_CHECK_INSTANCE_CAST( instance, NACT_TYPE_ICOMMAND_TAB, NactICommandTab )) #define NACT_IS_ICOMMAND_TAB( instance ) ( G_TYPE_CHECK_INSTANCE_TYPE( instance, NACT_TYPE_ICOMMAND_TAB )) #define NACT_ICOMMAND_TAB_GET_INTERFACE( instance ) ( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NACT_TYPE_ICOMMAND_TAB, NactICommandTabInterface )) typedef struct _NactICommandTab NactICommandTab; typedef struct _NactICommandTabInterfacePrivate NactICommandTabInterfacePrivate; typedef struct { /*< private >*/ GTypeInterface parent; NactICommandTabInterfacePrivate *private; } NactICommandTabInterface; GType nact_icommand_tab_get_type( void ); void nact_icommand_tab_init ( NactICommandTab *instance ); G_END_DECLS #endif /* __NACT_ICOMMAND_TAB_H__ */ nautilus-actions-3.2.3/src/nact/nact-add-capability-dialog.h0000644000175100017500000000600012212601376020653 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NACT_ADD_CAPABILITY_DIALOG_H__ #define __NACT_ADD_CAPABILITY_DIALOG_H__ /** * SECTION: nact_add_capability_dialog * @short_description: #NactAddCapabilityDialog class definition. * @include: nact/nact-add-capability-dialog.h * * The dialog let the user pick a capability from the default list * when adding a new capability to a profile (resp. an action, a menu). */ #include "base-dialog.h" G_BEGIN_DECLS #define NACT_TYPE_ADD_CAPABILITY_DIALOG ( nact_add_capability_dialog_get_type()) #define NACT_ADD_CAPABILITY_DIALOG( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_TYPE_ADD_CAPABILITY_DIALOG, NactAddCapabilityDialog )) #define NACT_ADD_CAPABILITY_DIALOG_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NACT_TYPE_ADD_CAPABILITY_DIALOG, NactAddCapabilityDialogClass )) #define NACT_IS_ADD_CAPABILITY_DIALOG( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_TYPE_ADD_CAPABILITY_DIALOG )) #define NACT_IS_ADD_CAPABILITY_DIALOG_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_TYPE_ADD_CAPABILITY_DIALOG )) #define NACT_ADD_CAPABILITY_DIALOG_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_TYPE_ADD_CAPABILITY_DIALOG, NactAddCapabilityDialogClass )) typedef struct _NactAddCapabilityDialogPrivate NactAddCapabilityDialogPrivate; typedef struct { /*< private >*/ BaseDialog parent; NactAddCapabilityDialogPrivate *private; } NactAddCapabilityDialog; typedef struct _NactAddCapabilityDialogClassPrivate NactAddCapabilityDialogClassPrivate; typedef struct { /*< private >*/ BaseDialogClass parent; NactAddCapabilityDialogClassPrivate *private; } NactAddCapabilityDialogClass; GType nact_add_capability_dialog_get_type( void ); gchar *nact_add_capability_dialog_run( BaseWindow *parent, GSList *capabilities ); G_END_DECLS #endif /* __NACT_ADD_CAPABILITY_DIALOG_H__ */ nautilus-actions-3.2.3/src/nact/base-isession.c0000644000175100017500000002756012212601376016401 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include "base-isession.h" #include "base-marshal.h" #include "egg-sm-client.h" /* private interface data */ struct _BaseISessionInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* pseudo-properties, set against the instance */ typedef struct { EggSMClient *sm_client; gulong sm_client_quit_handler_id; gulong sm_client_quit_requested_handler_id; } ISessionData; #define BASE_PROP_ISESSION_DATA "base-prop-isession-data" /* signals defined by the BaseISession interface */ enum { QUIT_REQUESTED, QUIT, LAST_SIGNAL }; static guint st_initializations = 0; /* interface initialisation count */ static gint st_signals[ LAST_SIGNAL ] = { 0 }; static GType register_type( void ); static void interface_base_init( BaseISessionInterface *klass ); static void interface_base_finalize( BaseISessionInterface *klass ); static ISessionData *get_isession_data( BaseISession *instance ); static void on_instance_finalized( gpointer user_data, BaseISession *instance ); static void client_quit_requested_cb( EggSMClient *client, BaseISession *instance ); static gboolean on_quit_requested_class_handler( BaseISession *instance, void *user_data ); static gboolean signal_accumulator_false_handled( GSignalInvocationHint *hint, GValue *return_accu, const GValue *handler_return, gpointer dummy); static void client_quit_cb( EggSMClient *client, BaseISession *instance ); static void on_quit_class_handler( BaseISession *instance, void *user_data ); GType base_isession_get_type( void ) { static GType iface_type = 0; if( !iface_type ){ iface_type = register_type(); } return( iface_type ); } static GType register_type( void ) { static const gchar *thisfn = "base_isession_register_type"; GType type; static const GTypeInfo info = { sizeof( BaseISessionInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "BaseISession", &info, 0 ); g_type_interface_add_prerequisite( type, G_TYPE_OBJECT ); return( type ); } static void interface_base_init( BaseISessionInterface *klass ) { static const gchar *thisfn = "base_isession_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); /** * base-signal-isession-quit-requested: * * The signal is emitted when the session is about to terminate, * to determine if all implementations are actually willing to quit. * * If the implementation is not willing to quit, then the user handler * should return %FALSE to stop the signal emission. * * Returning %TRUE will let the signal be emitted to other connected * handlers, eventually authorizing the application to terminate. * * Notes about GLib signals. * * If the signal is defined as G_SIGNAL_RUN_CLEANUP, then the object * handler does not participate to the return value of the signal * (accumulator is not called). More this object handler is triggered * unconditionnally, event if a user handler has returned %FALSE to * stop the emission. * * Contrarily, if the signal is defined as G_SIGNAL_RUN_LAST, then the * object handler returned value is taken into account by the accumulator, * and can participate to the return value for the signal. If a user * handler returns FALSE to stop the emission, then the object handler * will not be triggered. */ st_signals[ QUIT_REQUESTED ] = g_signal_new_class_handler( BASE_SIGNAL_QUIT_REQUESTED, G_TYPE_FROM_CLASS( klass ), G_SIGNAL_RUN_LAST, G_CALLBACK( on_quit_requested_class_handler ), ( GSignalAccumulator ) signal_accumulator_false_handled, NULL, base_cclosure_marshal_BOOLEAN__VOID, G_TYPE_BOOLEAN, 0 ); /** * base-signal-isession-quit: * * The signal is emitted when the session is about to terminate, * and no application has refused to abort then end of session * (all have accepted the end). It is time for the application * to terminate cleanly. */ st_signals[ QUIT ] = g_signal_new_class_handler( BASE_SIGNAL_QUIT, G_TYPE_FROM_CLASS( klass ), G_SIGNAL_RUN_LAST, G_CALLBACK( on_quit_class_handler ), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0 ); klass->private = g_new0( BaseISessionInterfacePrivate, 1 ); } st_initializations += 1; } static void interface_base_finalize( BaseISessionInterface *klass ) { static const gchar *thisfn = "base_isession_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } static ISessionData * get_isession_data( BaseISession *instance ) { ISessionData *data; data = ( ISessionData * ) g_object_get_data( G_OBJECT( instance ), BASE_PROP_ISESSION_DATA ); if( !data ){ data = g_new0( ISessionData, 1 ); g_object_set_data( G_OBJECT( instance ), BASE_PROP_ISESSION_DATA, data ); g_object_weak_ref( G_OBJECT( instance ), ( GWeakNotify ) on_instance_finalized, NULL ); } return( data ); } static void on_instance_finalized( gpointer user_data, BaseISession *instance ) { static const gchar *thisfn = "base_isession_on_instance_finalized"; ISessionData *data; g_debug( "%s: instance=%p, user_data=%p", thisfn, ( void * ) instance, ( void * ) user_data ); data = get_isession_data( instance ); if( data->sm_client_quit_handler_id && g_signal_handler_is_connected( data->sm_client, data->sm_client_quit_handler_id )){ g_signal_handler_disconnect( data->sm_client, data->sm_client_quit_handler_id ); } if( data->sm_client_quit_requested_handler_id && g_signal_handler_is_connected( data->sm_client, data->sm_client_quit_requested_handler_id )){ g_signal_handler_disconnect( data->sm_client, data->sm_client_quit_requested_handler_id ); } if( data->sm_client ){ g_object_unref( data->sm_client ); } g_free( data ); } void base_isession_init( BaseISession *instance ) { static const gchar *thisfn = "base_isession_init"; ISessionData *data; g_return_if_fail( BASE_IS_ISESSION( instance )); g_debug( "%s: instance=%p", thisfn, ( void * ) instance ); data = get_isession_data( instance ); /* initialize the session manager */ egg_sm_client_set_mode( EGG_SM_CLIENT_MODE_NO_RESTART ); data->sm_client = egg_sm_client_get(); egg_sm_client_startup(); g_debug( "%s: sm_client=%p", thisfn, ( void * ) data->sm_client ); data->sm_client_quit_handler_id = g_signal_connect( data->sm_client, "quit-requested", G_CALLBACK( client_quit_requested_cb ), instance ); data->sm_client_quit_requested_handler_id = g_signal_connect( data->sm_client, "quit", G_CALLBACK( client_quit_cb ), instance ); } /* * base_isession_is_willing_to_quit: * @instance: this #BaseISession instance. * * Returns: %TRUE if the implementation is willing to quit, %FALSE else. * * From the session management strict point of view, this function may be * just static and reserved for the own internal use of the interface. * We make it public because it is also useful for the application itself, * and we are so able to reuse both the signal and its handler mechanisms. */ gboolean base_isession_is_willing_to_quit( const BaseISession *instance ) { static const gchar *thisfn = "base_isession_is_willing_to_quit"; GValue instance_params = {0}; GValue return_value = {0}; g_return_val_if_fail( BASE_IS_ISESSION( instance ), TRUE ); g_debug( "%s: instance=%p (%s)", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); g_value_init( &instance_params, G_TYPE_FROM_INSTANCE( instance )); g_value_set_instance( &instance_params, ( gpointer ) instance ); g_value_init( &return_value, G_TYPE_BOOLEAN ); g_value_set_boolean( &return_value, TRUE ); g_signal_emitv( &instance_params, st_signals[ QUIT_REQUESTED ], 0, &return_value ); return( g_value_get_boolean( &return_value )); } /* * the session manager advertises us that the session is about to exit * * Returns: %TRUE if the application is willing to quit, %FALSE else. * * This function is called when the session manager detects the end of * session and thus asks its clients if they are willing to quit. */ static void client_quit_requested_cb( EggSMClient *client, BaseISession *instance ) { static const gchar *thisfn = "base_isession_client_quit_requested_cb"; gboolean willing_to; g_debug( "%s: client=%p, instance=%p (%s)", thisfn, ( void * ) client, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); willing_to = base_isession_is_willing_to_quit( instance ); egg_sm_client_will_quit( client, willing_to ); } /* * Handler of BASE_SIGNAL_QUIT_REQUESTED message * * Application should handle this signal in order to trap application * termination, returning %FALSE if it is not willing to quit. */ static gboolean on_quit_requested_class_handler( BaseISession *instance, void *user_data ) { static const gchar *thisfn = "base_isession_on_quit_requested_class_handler"; g_return_val_if_fail( BASE_IS_ISESSION( instance ), TRUE ); g_debug( "%s: instance=%p (%s), user_data=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) user_data ); return( TRUE ); } /* * the first handler which returns FALSE stops the emission * this is used on BASE_SIGNAL_QUIT_REQUESTED signal */ static gboolean signal_accumulator_false_handled( GSignalInvocationHint *hint, GValue *return_accu, const GValue *handler_return, gpointer dummy) { static const gchar *thisfn = "base_isession_signal_accumulator_false_handled"; gboolean continue_emission; gboolean willing_to_quit; willing_to_quit = g_value_get_boolean( handler_return ); g_value_set_boolean( return_accu, willing_to_quit ); continue_emission = willing_to_quit; g_debug( "%s: willing_to handler returns %s", thisfn, willing_to_quit ? "True":"False" ); return( continue_emission ); } /* * cleanly terminate the application when exiting the session * -> triggers the implementation */ static void client_quit_cb( EggSMClient *client, BaseISession *instance ) { static const gchar *thisfn = "base_isession_client_quit_cb"; g_return_if_fail( BASE_IS_ISESSION( instance )); g_debug( "%s: client=%p, instance=%p", thisfn, ( void * ) client, ( void * ) instance ); g_signal_emit_by_name( G_OBJECT( instance ), BASE_SIGNAL_QUIT, NULL ); } static void on_quit_class_handler( BaseISession *instance, void *user_data ) { static const gchar *thisfn = "base_isession_on_quit_class_handler"; g_return_if_fail( BASE_IS_ISESSION( instance )); g_debug( "%s: instance=%p (%s), user_data=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) user_data ); } nautilus-actions-3.2.3/src/nact/base-dialog.h0000644000175100017500000000601112212601376015775 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __BASE_DIALOG_H__ #define __BASE_DIALOG_H__ /** * SECTION: base-dialog * @title: BaseDialog * @short_description: The BaseDialog dialog base class definition * @include: base-dialog.h * * This class is derived from BaseWindow class, and serves as a base * class for all Nautilus-Actions dialogs. */ #include "base-window.h" G_BEGIN_DECLS #define BASE_TYPE_DIALOG ( base_dialog_get_type()) #define BASE_DIALOG( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, BASE_TYPE_DIALOG, BaseDialog )) #define BASE_DIALOG_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, BASE_TYPE_DIALOG, BaseDialogClass )) #define BASE_IS_DIALOG( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, BASE_TYPE_DIALOG )) #define BASE_IS_DIALOG_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), BASE_TYPE_DIALOG )) #define BASE_DIALOG_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), BASE_TYPE_DIALOG, BaseDialogClass )) typedef struct _BaseDialogPrivate BaseDialogPrivate; typedef struct { /*< private >*/ BaseWindow parent; BaseDialogPrivate *private; } BaseDialog; typedef struct _BaseDialogClassPrivate BaseDialogClassPrivate; /** * BaseDialogClass: * @cancel: the dialog box is not validated. * @ok: the dialog box is validated. * * This defines the virtual method a derived class may, should or must implement. */ typedef struct { /*< private >*/ BaseWindowClass parent; BaseDialogClassPrivate *private; /*< public >*/ /** * cancel: * @dialog: this #BaseDialog instance. * * Invoked when the dialog box is closed without having been validated. */ void ( *cancel )( BaseDialog *dialog ); /** * ok: * @dialog: this #BaseDialog instance. * * Invoked when the dialog box is validated. */ void ( *ok ) ( BaseDialog *dialog ); } BaseDialogClass; GType base_dialog_get_type( void ); G_END_DECLS #endif /* __BASE_DIALOG_H__ */ nautilus-actions-3.2.3/src/nact/nact-icon-chooser.ui0000644000175100017500000004310111674154536017344 00000000000000 6 Icon Chooser True center-on-parent True dialog True vertical 4 True vertical True 6 6 True True 6 0.5 in 1 True 6 6 gtk-missing-image 6 0 True 0 1 False 0 True True True True 6 vertical 6 True True True True True automatic automatic in True True False False False False False True True True automatic automatic in True True browse True True 0 True 10 vertical True True 0 True 0 gtk-missing-image 6 1 False end 1 0 True gtk-apply True True True True False end 1 False 1 True _Themed icons True False True True 6 vertical 6 True True vertical False 0 0 True gtk-apply True True True True False end 1 False 1 1 True Icons by _path True 1 False 1 1 True end gtk-about True True True True False False 0 True gtk-cancel True True True True False False 1 gtk-ok True True True True False False 2 False end 0 AboutButton CancelButton OKButton nautilus-actions-3.2.3/src/nact/main.c0000644000175100017500000000534712216620035014555 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include "nact-application.h" /* * The 'configure' script may define a NA_MAINTAINER_MODE variable when * the application is compiled for/in a development environment. When * this variable is defined, debug messages are printed on stdout. * * The NAUTILUS_ACTIONS_DEBUG environment variable may be defined at * execution time to display debug messages. Else, debug messages are only * displayed when in maintainer mode. */ static void set_log_handler( void ); static void log_handler( const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data ); static GLogFunc st_default_log_func = NULL; int main( int argc, char *argv[] ) { NactApplication *appli; int ret; set_log_handler(); /* pwi 2011-01-05 * run GConf migration tools before doing anything else * above all before allocating a new NAPivot */ na_gconf_migration_run(); /* create and run the application */ appli = nact_application_new(); ret = base_application_run_with_args( BASE_APPLICATION( appli ), argc, argv ); g_object_unref( appli ); return( ret ); } static void set_log_handler( void ) { st_default_log_func = g_log_set_default_handler(( GLogFunc ) log_handler, NULL ); } static void log_handler( const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data ) { #ifdef NA_MAINTAINER_MODE ( *st_default_log_func )( log_domain, log_level, message, user_data ); #else if( g_getenv( NAUTILUS_ACTIONS_DEBUG )){ ( *st_default_log_func )( log_domain, log_level, message, user_data ); } #endif } nautilus-actions-3.2.3/src/nact/nact-menubar-file.c0000644000175100017500000003717712212601376017133 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "nact-application.h" #include "nact-main-statusbar.h" #include "nact-main-tab.h" #include "nact-menubar-priv.h" #include "nact-tree-ieditable.h" static NATimeout st_autosave_prefs_timeout = { 0 }; static guint st_event_autosave = 0; static gchar *st_save_error = N_( "Save error" ); static gchar *st_save_warning = N_( "Some items may not have been saved" ); static gchar *st_level_zero_write = N_( "Unable to rewrite the level-zero items list" ); static gchar *st_delete_error = N_( "Some items have not been deleted" ); static gboolean save_item( BaseWindow *window, NAUpdater *updater, NAObjectItem *item, GSList **messages ); static void install_autosave( NactMenubar *bar ); static void on_autosave_prefs_changed( const gchar *group, const gchar *key, gconstpointer new_value, gpointer user_data ); static void on_autosave_prefs_timeout( NactMenubar *bar ); static gboolean autosave_callback( NactMenubar *bar ); static void autosave_destroyed( NactMenubar *bar ); /* * nact_menubar_file_initialize: * @bar: this #NactMenubar object. */ void nact_menubar_file_initialize( NactMenubar *bar ) { install_autosave( bar ); } /** * nact_menubar_file_on_update_sensitivities: * @bar: this #NactMenubar object. * * Update sensitivity of items of the File menu. */ void nact_menubar_file_on_update_sensitivities( const NactMenubar *bar ) { static const gchar *thisfn = "nact_menubar_file_on_update_sensitivities"; gboolean new_item_enabled; /* new menu / new action * new item will be inserted just before the beginning of selection * parent of the first selected row must be writable * we must have at least one writable provider */ new_item_enabled = bar->private->is_parent_writable && bar->private->has_writable_providers; g_debug( "%s: is_parent_writable=%s, has_writable_providers=%s, new_item_enabled=%s", thisfn, bar->private->is_parent_writable ? "True":"False", bar->private->has_writable_providers ? "True":"False", new_item_enabled ? "True":"False" ); nact_menubar_enable_item( bar, "NewMenuItem", new_item_enabled ); nact_menubar_enable_item( bar, "NewActionItem", new_item_enabled ); /* new profile enabled if selection is relative to only one writable action * i.e. contains profile(s) of the same action, or only contains one action * action must be writable */ nact_menubar_enable_item( bar, "NewProfileItem", bar->private->enable_new_profile && bar->private->is_action_writable ); /* save enabled if at least one item has been modified * or level-zero has been resorted and is writable */ nact_menubar_enable_item( bar, "SaveItem", ( bar->private->is_tree_modified )); /* quit always enabled */ } /** * nact_menubar_file_on_new_menu: * @gtk_action: the #GtkAction action. * @window: the #BaseWindow main window. * * Triggers File / New menu item. */ void nact_menubar_file_on_new_menu( GtkAction *gtk_action, BaseWindow *window ) { NAObjectMenu *menu; NactApplication *application; NAUpdater *updater; NactTreeView *items_view; GList *items; g_return_if_fail( GTK_IS_ACTION( gtk_action )); g_return_if_fail( NACT_IS_MAIN_WINDOW( window )); menu = na_object_menu_new_with_defaults(); na_object_check_status( menu ); application = NACT_APPLICATION( base_window_get_application( window )); updater = nact_application_get_updater( application ); na_updater_check_item_writability_status( updater, NA_OBJECT_ITEM( menu )); items = g_list_prepend( NULL, menu ); items_view = nact_main_window_get_items_view( NACT_MAIN_WINDOW( window )); nact_tree_ieditable_insert_items( NACT_TREE_IEDITABLE( items_view ), items, NULL ); na_object_free_items( items ); } /** * nact_menubar_file_on_new_action: * @gtk_action: the #GtkAction action. * @window: the #BaseWindow main window. * * Triggers File / New action item. */ void nact_menubar_file_on_new_action( GtkAction *gtk_action, BaseWindow *window ) { NAObjectAction *action; NactApplication *application; NAUpdater *updater; NactTreeView *items_view; GList *items; g_return_if_fail( GTK_IS_ACTION( gtk_action )); g_return_if_fail( NACT_IS_MAIN_WINDOW( window )); action = na_object_action_new_with_defaults(); na_object_check_status( action ); application = NACT_APPLICATION( base_window_get_application( window )); updater = nact_application_get_updater( application ); na_updater_check_item_writability_status( updater, NA_OBJECT_ITEM( action )); items = g_list_prepend( NULL, action ); items_view = nact_main_window_get_items_view( NACT_MAIN_WINDOW( window )); nact_tree_ieditable_insert_items( NACT_TREE_IEDITABLE( items_view ), items, NULL ); na_object_free_items( items ); } /** * nact_menubar_file_on_new_profile: * @gtk_action: the #GtkAction action. * @window: the #BaseWindow main window. * * Triggers File / New profile item. */ void nact_menubar_file_on_new_profile( GtkAction *gtk_action, BaseWindow *window ) { NAObjectAction *action; NAObjectProfile *profile; NactTreeView *items_view; GList *items; g_return_if_fail( GTK_IS_ACTION( gtk_action )); g_return_if_fail( NACT_IS_MAIN_WINDOW( window )); g_object_get( G_OBJECT( window ), MAIN_PROP_ITEM, &action, NULL ); profile = na_object_profile_new_with_defaults(); na_object_attach_profile( action, profile ); na_object_set_label( profile, _( "New profile" )); na_object_set_new_id( profile, action ); na_object_check_status( profile ); items = g_list_prepend( NULL, profile ); items_view = nact_main_window_get_items_view( NACT_MAIN_WINDOW( window )); nact_tree_ieditable_insert_items( NACT_TREE_IEDITABLE( items_view ), items, NULL ); na_object_free_items( items ); } /** * nact_menubar_file_on_save: * @gtk_action: the #GtkAction action. * @window: the #BaseWindow main window. * * Triggers File /Save item. * * Saving is not only saving modified items, but also saving hierarchy * (and order if alpha order is not set). * * This is the same function that nact_menubar_file_save_items(), just with * different arguments. */ void nact_menubar_file_on_save( GtkAction *gtk_action, BaseWindow *window ) { static const gchar *thisfn = "nact_menubar_file_on_save"; g_debug( "%s: gtk_action=%p, window=%p", thisfn, ( void * ) gtk_action, ( void * ) window ); g_return_if_fail( GTK_IS_ACTION( gtk_action )); g_return_if_fail( NACT_IS_MAIN_WINDOW( window )); nact_menubar_file_save_items( window ); } /** * nact_menubar_file_save_items: * @gtk_action: the #GtkAction action. * @window: the #BaseWindow main window. * * Save items. * This is the same function that nact_menubar_file_on_save(), just * with different arguments. * * Synopsis: * - rewrite the level-zero items list * - delete the items which are marked to be deleted * - rewrite (i.e. delete/write) updated items * * The difficulty here is that some sort of pseudo-transactionnal process * must be setup: * * - if the level-zero items list cannot be updated, then an error message * is displayed, and we abort the whole processus * * - if some items cannot be actually deleted, then an error message is * displayed, and the whole processus is aborted; * plus: * a/ items which have not been deleted must be restored (maybe marked * as deleted ?) -> so these items are modified * b/ the level-zero list must be updated with these restored items * and reset modified * * - idem if some items cannot be actually rewritten... */ void nact_menubar_file_save_items( BaseWindow *window ) { static const gchar *thisfn = "nact_menubar_file_save_items"; NactTreeView *items_view; GList *items, *it; GList *new_pivot; NAObjectItem *duplicate; GSList *messages; gchar *msg; BAR_WINDOW_VOID( window ); g_debug( "%s: window=%p", thisfn, ( void * ) window ); /* always write the level zero list of items as the first save phase * and reset the corresponding modification flag */ items_view = nact_main_window_get_items_view( NACT_MAIN_WINDOW( window )); items = nact_tree_view_get_items( items_view ); na_object_dump_tree( items ); messages = NULL; if( nact_tree_ieditable_is_level_zero_modified( NACT_TREE_IEDITABLE( items_view ))){ if( !na_iprefs_write_level_zero( items, &messages )){ if( g_slist_length( messages )){ msg = na_core_utils_slist_join_at_end( messages, "\n" ); } else { msg = g_strdup( gettext( st_level_zero_write )); } base_window_display_error_dlg( window, gettext( st_save_error ), msg ); g_free( msg ); na_core_utils_slist_free( messages ); messages = NULL; } } else { g_signal_emit_by_name( window, TREE_SIGNAL_LEVEL_ZERO_CHANGED, FALSE ); } /* remove deleted items * so that new actions with same id do not risk to be deleted later * not deleted items are reinserted in the tree */ if( !nact_tree_ieditable_remove_deleted( NACT_TREE_IEDITABLE( items_view ), &messages )){ if( g_slist_length( messages )){ msg = na_core_utils_slist_join_at_end( messages, "\n" ); } else { msg = g_strdup( gettext( st_delete_error )); } base_window_display_error_dlg( window, gettext( st_save_error ), msg ); g_free( msg ); na_core_utils_slist_free( messages ); messages = NULL; } else { na_object_free_items( items ); items = nact_tree_view_get_items( items_view ); } /* recursively save the modified items * check is useless here if item was not modified, but not very costly; * above all, it is less costly to check the status here, than to check * recursively each and every modified item */ new_pivot = NULL; for( it = items ; it ; it = it->next ){ save_item( window, bar->private->updater, NA_OBJECT_ITEM( it->data ), &messages ); duplicate = NA_OBJECT_ITEM( na_object_duplicate( it->data, DUPLICATE_REC )); na_object_reset_origin( it->data, duplicate ); na_object_check_status( it->data ); new_pivot = g_list_prepend( new_pivot, duplicate ); } if( g_slist_length( messages )){ msg = na_core_utils_slist_join_at_end( messages, "\n" ); base_window_display_error_dlg( window, gettext( st_save_warning ), msg ); g_free( msg ); na_core_utils_slist_free( messages ); messages = NULL; } na_pivot_set_new_items( NA_PIVOT( bar->private->updater ), g_list_reverse( new_pivot )); na_object_free_items( items ); nact_main_window_block_reload( NACT_MAIN_WINDOW( window )); g_signal_emit_by_name( window, TREE_SIGNAL_MODIFIED_STATUS_CHANGED, FALSE ); } /* * iterates here on each and every NAObjectItem row stored in the tree */ static gboolean save_item( BaseWindow *window, NAUpdater *updater, NAObjectItem *item, GSList **messages ) { static const gchar *thisfn = "nact_menubar_file_save_item"; gboolean ret; NAIOProvider *provider_before; NAIOProvider *provider_after; GList *subitems, *it; gchar *label; guint save_ret; g_return_val_if_fail( NACT_IS_MAIN_WINDOW( window ), FALSE ); g_return_val_if_fail( NA_IS_UPDATER( updater ), FALSE ); g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), FALSE ); ret = TRUE; if( NA_IS_OBJECT_MENU( item )){ subitems = na_object_get_items( item ); for( it = subitems ; it ; it = it->next ){ ret &= save_item( window, updater, NA_OBJECT_ITEM( it->data ), messages ); } } provider_before = na_object_get_provider( item ); if( na_object_is_modified( item )){ label = na_object_get_label( item ); g_debug( "%s: saving %p (%s) '%s'", thisfn, ( void * ) item, G_OBJECT_TYPE_NAME( item ), label ); g_free( label ); save_ret = na_updater_write_item( updater, item, messages ); ret = ( save_ret == NA_IIO_PROVIDER_CODE_OK ); if( ret ){ if( NA_IS_OBJECT_ACTION( item )){ na_object_reset_last_allocated( item ); } provider_after = na_object_get_provider( item ); if( provider_after != provider_before ){ g_signal_emit_by_name( window, MAIN_SIGNAL_ITEM_UPDATED, item, MAIN_DATA_PROVIDER ); } } else { g_warning( "%s: unable to write item: save_ret=%d", thisfn, save_ret ); } } return( ret ); } /** * nact_menubar_file_on_quit: * @gtk_action: the #GtkAction action. * @window: the #BaseWindow main window. * * Triggers the File / Quit item. */ void nact_menubar_file_on_quit( GtkAction *gtk_action, BaseWindow *window ) { static const gchar *thisfn = "nact_menubar_file_on_quit"; g_debug( "%s: item=%p, window=%p", thisfn, ( void * ) gtk_action, ( void * ) window ); g_return_if_fail( GTK_IS_ACTION( gtk_action ) || gtk_action == NULL ); nact_main_window_quit( NACT_MAIN_WINDOW( window )); } /* * nact_menubar_file_install_autosave: * @bar: this #NactMenubar instance. * * Setup the autosave feature and initialize its monitoring. */ static void install_autosave( NactMenubar *bar ) { st_autosave_prefs_timeout.timeout = 100; st_autosave_prefs_timeout.handler = ( NATimeoutFunc ) on_autosave_prefs_timeout; st_autosave_prefs_timeout.user_data = bar; na_settings_register_key_callback( NA_IPREFS_MAIN_SAVE_AUTO, G_CALLBACK( on_autosave_prefs_changed ), NULL ); na_settings_register_key_callback( NA_IPREFS_MAIN_SAVE_PERIOD, G_CALLBACK( on_autosave_prefs_changed ), NULL ); on_autosave_prefs_timeout( bar ); } static void on_autosave_prefs_changed( const gchar *group, const gchar *key, gconstpointer new_value, gpointer user_data ) { na_timeout_event( &st_autosave_prefs_timeout ); } static void on_autosave_prefs_timeout( NactMenubar *bar ) { static const gchar *thisfn = "nact_menubar_file_on_autosave_prefs_timeout"; gboolean autosave_on; guint autosave_period; g_return_if_fail( NACT_IS_MENUBAR( bar )); autosave_on = na_settings_get_boolean( NA_IPREFS_MAIN_SAVE_AUTO, NULL, NULL ); autosave_period = na_settings_get_uint( NA_IPREFS_MAIN_SAVE_PERIOD, NULL, NULL ); if( st_event_autosave ){ if( !g_source_remove( st_event_autosave )){ g_warning( "%s: unable to remove autosave event source", thisfn ); } st_event_autosave = 0; } if( autosave_on ){ st_event_autosave = g_timeout_add_seconds_full( G_PRIORITY_DEFAULT, autosave_period * 60, ( GSourceFunc ) autosave_callback, bar, ( GDestroyNotify ) autosave_destroyed ); } } static gboolean autosave_callback( NactMenubar *bar ) { const gchar *context = "autosave-context"; g_debug( "nact_menubar_file_autosave_callback" ); nact_main_statusbar_display_status( NACT_MAIN_WINDOW( bar->private->window ), context, _( "Automatically saving pending modifications..." )); nact_menubar_file_save_items( bar->private->window ); nact_main_statusbar_hide_status( NACT_MAIN_WINDOW( bar->private->window ), context ); return( TRUE ); } static void autosave_destroyed( NactMenubar *bar ) { g_debug( "nact_menubar_file_autosave_destroyed" ); } nautilus-actions-3.2.3/src/nact/base-marshal.c0000644000175100017500000000772612220365327016200 00000000000000#include "base-marshal.h" #include #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_schar (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #define g_marshal_value_peek_variant(v) g_value_get_variant (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* BOOLEAN:VOID (/home/pierre/data/eclipse/nautilus-actions/src/nact/base-marshal.def:2) */ void base_cclosure_marshal_BOOLEAN__VOID (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__VOID) (gpointer data1, gpointer data2); register GMarshalFunc_BOOLEAN__VOID callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 1); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__VOID) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, data2); g_value_set_boolean (return_value, v_return); } nautilus-actions-3.2.3/src/nact/nact-ibasenames-tab.c0000644000175100017500000002324312212601376017425 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "nact-main-tab.h" #include "base-gtk-utils.h" #include "nact-match-list.h" #include "nact-ibasenames-tab.h" /* private interface data */ struct _NactIBasenamesTabInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* the identifier of this notebook page in the Match dialog */ #define ITAB_NAME "basenames" /* data set against the instance */ typedef struct { gboolean on_selection_change; } IBasenamesData; #define IBASENAMES_TAB_PROP_DATA "nact-ibasenames-tab-data" static guint st_initializations = 0; /* interface initialization count */ static GType register_type( void ); static void interface_base_init( NactIBasenamesTabInterface *klass ); static void interface_base_finalize( NactIBasenamesTabInterface *klass ); static void on_base_initialize_gtk( NactIBasenamesTab *instance, GtkWindow *toplevel, gpointer user_data ); static void on_base_initialize_window( NactIBasenamesTab *instance, gpointer user_data ); static void on_main_selection_changed( NactIBasenamesTab *instance, GList *selected_items, gpointer user_data ); static void on_matchcase_toggled( GtkToggleButton *button, BaseWindow *window ); static GSList *get_basenames( void *context ); static void set_basenames( void *context, GSList *filters ); static IBasenamesData *get_ibasenames_data( NactIBasenamesTab *instance ); static void on_instance_finalized( gpointer user_data, NactIBasenamesTab *instance ); GType nact_ibasenames_tab_get_type( void ) { static GType iface_type = 0; if( !iface_type ){ iface_type = register_type(); } return( iface_type ); } static GType register_type( void ) { static const gchar *thisfn = "nact_ibasenames_tab_register_type"; GType type; static const GTypeInfo info = { sizeof( NactIBasenamesTabInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NactIBasenamesTab", &info, 0 ); g_type_interface_add_prerequisite( type, BASE_TYPE_WINDOW ); return( type ); } static void interface_base_init( NactIBasenamesTabInterface *klass ) { static const gchar *thisfn = "nact_ibasenames_tab_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); klass->private = g_new0( NactIBasenamesTabInterfacePrivate, 1 ); } st_initializations += 1; } static void interface_base_finalize( NactIBasenamesTabInterface *klass ) { static const gchar *thisfn = "nact_ibasenames_tab_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } /* * nact_ibasenames_tab_init: * @instance: this #NactIBasenamesTab instance. * * Initialize the interface * Connect to #BaseWindow signals */ void nact_ibasenames_tab_init( NactIBasenamesTab *instance ) { static const gchar *thisfn = "nact_ibasenames_tab_init"; IBasenamesData *data; g_return_if_fail( NACT_IS_IBASENAMES_TAB( instance )); g_debug( "%s: instance=%p (%s)", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_GTK, G_CALLBACK( on_base_initialize_gtk )); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_window )); nact_main_tab_init( NACT_MAIN_WINDOW( instance ), TAB_BASENAMES ); data = get_ibasenames_data( instance ); data->on_selection_change = FALSE; g_object_weak_ref( G_OBJECT( instance ), ( GWeakNotify ) on_instance_finalized, NULL ); } /* * on_base_initialize_gtk: * @window: this #NactIBasenamesTab instance. * * Initializes the tab widget at initial load. */ static void on_base_initialize_gtk( NactIBasenamesTab *instance, GtkWindow *toplevel, void *user_data ) { static const gchar *thisfn = "nact_ibasenames_tab_on_base_initialize_gtk"; g_return_if_fail( NACT_IS_IBASENAMES_TAB( instance )); g_debug( "%s: instance=%p (%s), toplevel=%p, user_data=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) toplevel, ( void * ) user_data ); nact_match_list_init_with_args( BASE_WINDOW( instance ), ITAB_NAME, TAB_BASENAMES, base_window_get_widget( BASE_WINDOW( instance ), "BasenamesTreeView" ), base_window_get_widget( BASE_WINDOW( instance ), "AddBasenameButton" ), base_window_get_widget( BASE_WINDOW( instance ), "RemoveBasenameButton" ), ( pget_filters ) get_basenames, ( pset_filters ) set_basenames, NULL, NULL, MATCH_LIST_MUST_MATCH_ONE_OF, _( "Basename filter" ), TRUE ); } /* * on_base_initialize_window: * @window: this #NactIBasenamesTab instance. * * Initializes the tab widget at each time the widget will be displayed. * Connect signals and setup runtime values. */ static void on_base_initialize_window( NactIBasenamesTab *instance, void *user_data ) { static const gchar *thisfn = "nact_ibasenames_tab_on_base_initialize_window"; GtkWidget *button; g_return_if_fail( NACT_IS_IBASENAMES_TAB( instance )); g_debug( "%s: instance=%p (%s), user_data=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) user_data ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( instance ), MAIN_SIGNAL_SELECTION_CHANGED, G_CALLBACK( on_main_selection_changed )); button = base_window_get_widget( BASE_WINDOW( instance ), "BasenamesMatchcaseButton" ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( button ), "toggled", G_CALLBACK( on_matchcase_toggled )); } static void on_main_selection_changed( NactIBasenamesTab *instance, GList *selected_items, gpointer user_data ) { NAIContext *context; gboolean editable; gboolean enable_tab; GtkToggleButton *matchcase_button; gboolean matchcase; IBasenamesData *data; g_object_get( G_OBJECT( instance ), MAIN_PROP_CONTEXT, &context, MAIN_PROP_EDITABLE, &editable, NULL ); enable_tab = ( context != NULL ); nact_main_tab_enable_page( NACT_MAIN_WINDOW( instance ), TAB_BASENAMES, enable_tab ); data = get_ibasenames_data( NACT_IBASENAMES_TAB( instance )); data->on_selection_change = TRUE; matchcase_button = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "BasenamesMatchcaseButton" )); matchcase = context ? na_object_get_matchcase( context ) : FALSE; gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( matchcase_button ), matchcase ); base_gtk_utils_set_editable( G_OBJECT( matchcase_button ), editable ); data->on_selection_change = FALSE; } static void on_matchcase_toggled( GtkToggleButton *button, BaseWindow *window ) { NAIContext *context; gboolean editable; gboolean matchcase; IBasenamesData *data; data = get_ibasenames_data( NACT_IBASENAMES_TAB( window )); if( !data->on_selection_change ){ g_object_get( G_OBJECT( window ), MAIN_PROP_CONTEXT, &context, MAIN_PROP_EDITABLE, &editable, NULL ); if( context ){ matchcase = gtk_toggle_button_get_active( button ); if( editable ){ na_object_set_matchcase( context, matchcase ); g_signal_emit_by_name( G_OBJECT( window ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, context, 0 ); } else { g_signal_handlers_block_by_func(( gpointer ) button, on_matchcase_toggled, window ); gtk_toggle_button_set_active( button, !matchcase ); g_signal_handlers_unblock_by_func(( gpointer ) button, on_matchcase_toggled, window ); } } } } static GSList * get_basenames( void *context ) { return( na_object_get_basenames( context )); } static void set_basenames( void *context, GSList *filters ) { na_object_set_basenames( context, filters ); } static IBasenamesData * get_ibasenames_data( NactIBasenamesTab *instance ) { IBasenamesData *data; data = ( IBasenamesData * ) g_object_get_data( G_OBJECT( instance ), IBASENAMES_TAB_PROP_DATA ); if( !data ){ data = g_new0( IBasenamesData, 1 ); g_object_set_data( G_OBJECT( instance ), IBASENAMES_TAB_PROP_DATA, data ); } return( data ); } static void on_instance_finalized( gpointer user_data, NactIBasenamesTab *instance ) { static const gchar *thisfn = "nact_ibasenames_tab_on_instance_finalized"; IBasenamesData *data; g_debug( "%s: instance=%p, user_data=%p", thisfn, ( void * ) instance, ( void * ) user_data ); data = get_ibasenames_data( instance ); g_free( data ); } nautilus-actions-3.2.3/src/nact/nact-assistant-export.c0000644000175100017500000007677312212601376020122 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "nact-application.h" #include "nact-main-window.h" #include "nact-assistant-export.h" #include "nact-export-ask.h" #include "nact-tree-view.h" /* Export Assistant * * pos. type title * --- ------- ------------------------------------ * 0 Intro Introduction * 1 Content Selection of the actions * 2 Content Selection of the target folder * 3 Content Selection of the export format * 4 Confirm Summary of the operations to be done * 5 Summary Export is done: summary of the done operations */ enum { ASSIST_PAGE_INTRO = 0, ASSIST_PAGE_ACTIONS_SELECTION, ASSIST_PAGE_FOLDER_SELECTION, ASSIST_PAGE_FORMAT_SELECTION, ASSIST_PAGE_CONFIRM, ASSIST_PAGE_DONE }; /* private class data */ struct _NactAssistantExportClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NactAssistantExportPrivate { gboolean dispose_has_run; NactTreeView *items_view; gboolean preferences_locked; gchar *uri; GList *selected_items; GList *results; }; typedef struct { NAObjectItem *item; GSList *msg; gchar *fname; gchar *format; } ExportStruct; static const gchar *st_xmlui_filename = PKGUIDIR "/nact-assistant-export.ui"; static const gchar *st_toplevel_name = "ExportAssistant"; static const gchar *st_wsp_name = NA_IPREFS_EXPORT_ASSISTANT_WSP; static BaseAssistantClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NactAssistantExportClass *klass ); static void ioptions_list_iface_init( NAIOptionsListInterface *iface, void *user_data ); static GList *ioptions_list_get_formats( const NAIOptionsList *instance, GtkWidget *container ); static void ioptions_list_free_formats( const NAIOptionsList *instance, GtkWidget *container, GList *formats ); static NAIOption *ioptions_list_get_ask_option( const NAIOptionsList *instance, GtkWidget *container ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_constructed( GObject *instance ); static void instance_dispose( GObject *instance ); static void instance_finalize( GObject *instance ); static void on_base_initialize_gtk_toplevel( NactAssistantExport *window, GtkAssistant *toplevel, gpointer user_data ); static void items_tree_view_initialize_gtk( NactAssistantExport *window, GtkAssistant *toplevel ); static void folder_chooser_initialize_gtk( NactAssistantExport *window ); static void format_tree_view_initialize_gtk( NactAssistantExport *window ); static void on_base_initialize_base_window( NactAssistantExport *window, gpointer user_data ); static void on_base_all_widgets_showed( NactAssistantExport *window, gpointer user_data ); static void on_items_tree_view_selection_changed( NactAssistantExport *window, GList *selected_items, gpointer user_data ); static void on_folder_chooser_selection_changed( GtkFileChooser *chooser, NactAssistantExport *window ); static void assistant_prepare( BaseAssistant *window, GtkAssistant *assistant, GtkWidget *page ); static void assist_prepare_confirm( NactAssistantExport *window, GtkAssistant *assistant, GtkWidget *page ); static void assistant_apply( BaseAssistant *window, GtkAssistant *assistant ); static void assist_prepare_exportdone( NactAssistantExport *window, GtkAssistant *assistant, GtkWidget *page ); static void free_results( GList *list ); GType nact_assistant_export_get_type( void ) { static GType window_type = 0; if( !window_type ){ window_type = register_type(); } return( window_type ); } static GType register_type( void ) { static const gchar *thisfn = "nact_assistant_export_register_type"; GType type; static GTypeInfo info = { sizeof( NactAssistantExportClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NactAssistantExport ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo ioptions_list_iface_info = { ( GInterfaceInitFunc ) ioptions_list_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( BASE_TYPE_ASSISTANT, "NactAssistantExport", &info, 0 ); g_type_add_interface_static( type, NA_TYPE_IOPTIONS_LIST, &ioptions_list_iface_info ); return( type ); } static void class_init( NactAssistantExportClass *klass ) { static const gchar *thisfn = "nact_assistant_export_class_init"; GObjectClass *object_class; BaseAssistantClass *assist_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->constructed = instance_constructed; object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NactAssistantExportClassPrivate, 1 ); assist_class = BASE_ASSISTANT_CLASS( klass ); assist_class->apply = assistant_apply; assist_class->prepare = assistant_prepare; } static void ioptions_list_iface_init( NAIOptionsListInterface *iface, void *user_data ) { static const gchar *thisfn = "nact_assistant_export_ioptions_list_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->get_options = ioptions_list_get_formats; iface->free_options = ioptions_list_free_formats; iface->get_ask_option = ioptions_list_get_ask_option; } static GList * ioptions_list_get_formats( const NAIOptionsList *instance, GtkWidget *container ) { NactAssistantExport *window; NactApplication *application; NAUpdater *updater; GList *formats; g_return_val_if_fail( NACT_IS_ASSISTANT_EXPORT( instance ), NULL ); window = NACT_ASSISTANT_EXPORT( instance ); application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window ))); updater = nact_application_get_updater( application ); formats = na_exporter_get_formats( NA_PIVOT( updater )); return( formats ); } static void ioptions_list_free_formats( const NAIOptionsList *instance, GtkWidget *container, GList *formats ) { na_exporter_free_formats( formats ); } static NAIOption * ioptions_list_get_ask_option( const NAIOptionsList *instance, GtkWidget *container ) { return( na_exporter_get_ask_option()); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "nact_assistant_export_instance_init"; NactAssistantExport *self; g_return_if_fail( NACT_IS_ASSISTANT_EXPORT( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NACT_ASSISTANT_EXPORT( instance ); self->private = g_new0( NactAssistantExportPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_constructed( GObject *window ) { static const gchar *thisfn = "nact_assistant_export_instance_constructed"; NactAssistantExportPrivate *priv; g_return_if_fail( NACT_IS_ASSISTANT_EXPORT( window )); priv = NACT_ASSISTANT_EXPORT( window )->private; if( !priv->dispose_has_run ){ /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->constructed ){ G_OBJECT_CLASS( st_parent_class )->constructed( window ); } g_debug( "%s: window=%p (%s)", thisfn, ( void * ) window, G_OBJECT_TYPE_NAME( window )); base_window_signal_connect( BASE_WINDOW( window ), G_OBJECT( window ), BASE_SIGNAL_INITIALIZE_GTK, G_CALLBACK( on_base_initialize_gtk_toplevel )); base_window_signal_connect( BASE_WINDOW( window ), G_OBJECT( window ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_base_window )); base_window_signal_connect( BASE_WINDOW( window ), G_OBJECT( window ), BASE_SIGNAL_SHOW_WIDGETS, G_CALLBACK( on_base_all_widgets_showed )); } } static void instance_dispose( GObject *window ) { static const gchar *thisfn = "nact_assistant_export_instance_dispose"; NactAssistantExport *self; GtkAssistant *assistant; GtkWidget *page; guint pos; GtkWidget *pane; g_return_if_fail( NACT_IS_ASSISTANT_EXPORT( window )); self = NACT_ASSISTANT_EXPORT( window ); if( !self->private->dispose_has_run ){ g_debug( "%s: window=%p (%s)", thisfn, ( void * ) window, G_OBJECT_TYPE_NAME( window )); self->private->dispose_has_run = TRUE; g_object_unref( self->private->items_view ); if( self->private->selected_items ){ self->private->selected_items = na_object_free_items( self->private->selected_items ); } assistant = GTK_ASSISTANT( base_window_get_gtk_toplevel( BASE_WINDOW( window ))); page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_ACTIONS_SELECTION ); pane = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p1-HPaned" ); pos = gtk_paned_get_position( GTK_PANED( pane )); na_settings_set_uint( NA_IPREFS_EXPORT_ASSISTANT_PANED, pos ); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( window ); } } } static void instance_finalize( GObject *window ) { static const gchar *thisfn = "nact_assistant_export_instance_finalize"; NactAssistantExport *self; g_return_if_fail( NACT_IS_ASSISTANT_EXPORT( window )); g_debug( "%s: window=%p (%s)", thisfn, ( void * ) window, G_OBJECT_TYPE_NAME( window )); self = NACT_ASSISTANT_EXPORT( window ); free_results( self->private->results ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( window ); } } /** * Run the assistant. * * @main: the main window of the application. */ void nact_assistant_export_run( BaseWindow *main_window ) { NactAssistantExport *assistant; gboolean esc_quit, esc_confirm; g_return_if_fail( NACT_IS_MAIN_WINDOW( main_window )); esc_quit = na_settings_get_boolean( NA_IPREFS_ASSISTANT_ESC_QUIT, NULL, NULL ); esc_confirm = na_settings_get_boolean( NA_IPREFS_ASSISTANT_ESC_CONFIRM, NULL, NULL ); assistant = g_object_new( NACT_TYPE_ASSISTANT_EXPORT, BASE_PROP_PARENT, main_window, BASE_PROP_HAS_OWN_BUILDER, TRUE, BASE_PROP_XMLUI_FILENAME, st_xmlui_filename, BASE_PROP_TOPLEVEL_NAME, st_toplevel_name, BASE_PROP_WSP_NAME, st_wsp_name, BASE_PROP_QUIT_ON_ESCAPE, esc_quit, BASE_PROP_WARN_ON_ESCAPE, esc_confirm, NULL ); base_window_run( BASE_WINDOW( assistant )); } static void on_base_initialize_gtk_toplevel( NactAssistantExport *window, GtkAssistant *assistant, gpointer user_data ) { static const gchar *thisfn = "nact_assistant_export_on_base_initialize_gtk_toplevel"; gboolean are_locked, mandatory; g_return_if_fail( NACT_IS_ASSISTANT_EXPORT( window )); if( !window->private->dispose_has_run ){ g_debug( "%s: window=%p, assistant=%p, user_data=%p", thisfn, ( void * ) window, ( void * ) assistant, ( void * ) user_data ); items_tree_view_initialize_gtk( window, assistant ); folder_chooser_initialize_gtk( window ); format_tree_view_initialize_gtk( window ); are_locked = na_settings_get_boolean( NA_IPREFS_ADMIN_PREFERENCES_LOCKED, NULL, &mandatory ); window->private->preferences_locked = are_locked && mandatory; #if !GTK_CHECK_VERSION( 3,0,0 ) guint padder = 8; /* selecting items */ GtkWidget *page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_ACTIONS_SELECTION ); GtkWidget *container = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p1-l2-alignment1" ); g_object_set( G_OBJECT( container ), "border_width", padder, NULL ); /* selecting target folder */ page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FOLDER_SELECTION ); container = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p2-l2-alignment1" ); g_object_set( G_OBJECT( container ), "top_padding", padder, NULL ); /* choosing export format */ page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FORMAT_SELECTION ); container = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p3-l2-alignment1" ); g_object_set( G_OBJECT( container ), "border_width", padder, NULL ); /* summary */ page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_CONFIRM ); container = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p4-l2-alignment1" ); g_object_set( G_OBJECT( container ), "border_width", padder, NULL ); /* import is done */ page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_DONE ); container = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p5-l2-alignment1" ); g_object_set( G_OBJECT( container ), "border_width", padder, NULL ); #endif } } static void items_tree_view_initialize_gtk( NactAssistantExport *window, GtkAssistant *assistant ) { static const gchar *thisfn = "nact_assistant_export_items_tree_view_initialize_gtk"; GtkWidget *page; g_debug( "%s: window=%p, assistant=%p", thisfn, ( void * ) window, ( void * ) assistant ); page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_ACTIONS_SELECTION ); window->private->items_view = nact_tree_view_new( BASE_WINDOW( window ), GTK_CONTAINER( page ), "ActionsList", TREE_MODE_SELECTION ); } static void folder_chooser_initialize_gtk( NactAssistantExport *window ) { static const gchar *thisfn = "nact_assistant_export_folder_chooser_initialize_gtk"; GtkAssistant *assistant; GtkWidget *page, *chooser; gchar *uri; g_debug( "%s: window=%p", thisfn, ( void * ) window ); assistant = GTK_ASSISTANT( base_window_get_gtk_toplevel( BASE_WINDOW( window ))); page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FOLDER_SELECTION ); chooser = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p2-ExportFolderChooser" ); gtk_file_chooser_set_action( GTK_FILE_CHOOSER( chooser ), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ); gtk_file_chooser_set_create_folders( GTK_FILE_CHOOSER( chooser ), TRUE ); gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( chooser ), FALSE ); uri = na_settings_get_string( NA_IPREFS_EXPORT_ASSISTANT_URI, NULL, NULL ); if( uri && strlen( uri )){ gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( chooser ), uri ); } g_free( uri ); base_window_signal_connect( BASE_WINDOW( window ), G_OBJECT( chooser ), "selection-changed", G_CALLBACK( on_folder_chooser_selection_changed )); } static void format_tree_view_initialize_gtk( NactAssistantExport *window ) { static const gchar *thisfn = "nact_assistant_export_on_format_tree_view_realized"; GtkAssistant *assistant; GtkWidget *page, *tree_view; g_debug( "%s: window=%p", thisfn, ( void * ) window ); assistant = GTK_ASSISTANT( base_window_get_gtk_toplevel( BASE_WINDOW( window ))); page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FORMAT_SELECTION ); tree_view = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p3-ExportFormatTreeView" ); na_ioptions_list_gtk_init( NA_IOPTIONS_LIST( window ), tree_view, TRUE ); gtk_assistant_set_page_complete( assistant, page, TRUE ); } static void on_base_initialize_base_window( NactAssistantExport *window, gpointer user_data ) { static const gchar *thisfn = "nact_assistant_export_on_base_initialize_base_window"; GtkAssistant *assistant; GtkWidget *page; guint pos; GtkWidget *pane; gchar *format; gboolean mandatory; GtkWidget *tree_view; g_return_if_fail( NACT_IS_ASSISTANT_EXPORT( window )); if( !window->private->dispose_has_run ){ g_debug( "%s: window=%p, user_data=%p", thisfn, ( void * ) window, ( void * ) user_data ); assistant = GTK_ASSISTANT( base_window_get_gtk_toplevel( BASE_WINDOW( window ))); /* intro page is always true */ page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_INTRO ); gtk_assistant_set_page_complete( assistant, page, TRUE ); /* set the slider position of the item selection page */ pos = na_settings_get_uint( NA_IPREFS_EXPORT_ASSISTANT_PANED, NULL, NULL ); if( pos ){ page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_ACTIONS_SELECTION ); pane = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p1-HPaned" ); gtk_paned_set_position( GTK_PANED( pane ), pos ); } /* initialize the export format tree view */ page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FORMAT_SELECTION ); tree_view = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p3-ExportFormatTreeView" ); format = na_settings_get_string( NA_IPREFS_EXPORT_PREFERRED_FORMAT, NULL, &mandatory ); na_ioptions_list_set_editable( NA_IOPTIONS_LIST( window ), tree_view, !mandatory && !window->private->preferences_locked ); na_ioptions_list_set_default( NA_IOPTIONS_LIST( window ), tree_view, format ); g_free( format ); } } static void on_base_all_widgets_showed( NactAssistantExport *window, gpointer user_data ) { static const gchar *thisfn = "nact_assistant_export_on_base_all_widgets_showed"; GtkAssistant *assistant; GtkWidget *page; NactMainWindow *main_window; NactTreeView *main_items_view; GList *items; GtkTreePath *path; g_return_if_fail( NACT_IS_ASSISTANT_EXPORT( window )); if( !window->private->dispose_has_run ){ g_debug( "%s: window=%p, user_data=%p", thisfn, ( void * ) window, ( void * ) user_data ); assistant = GTK_ASSISTANT( base_window_get_gtk_toplevel( BASE_WINDOW( window ))); /* fill up the items tree view */ main_window = NACT_MAIN_WINDOW( base_window_get_parent( BASE_WINDOW( window ))); main_items_view = nact_main_window_get_items_view( main_window ); items = nact_tree_view_get_items( main_items_view ); nact_tree_view_fill( window->private->items_view, items ); /* connect to the 'selection-changed' signal emitted by NactTreeView */ base_window_signal_connect( BASE_WINDOW( window ), G_OBJECT( window ), MAIN_SIGNAL_SELECTION_CHANGED, G_CALLBACK( on_items_tree_view_selection_changed )); /* select the first row */ path = gtk_tree_path_new_from_string( "0" ); nact_tree_view_select_row_at_path( window->private->items_view, path ); gtk_tree_path_free( path ); page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_ACTIONS_SELECTION ); gtk_widget_show_all( page ); page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FOLDER_SELECTION ); gtk_widget_show_all( page ); page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FORMAT_SELECTION ); gtk_widget_show_all( page ); } } static void on_items_tree_view_selection_changed( NactAssistantExport *window, GList *selected_items, gpointer user_data ) { static const gchar *thisfn = "nact_assistant_export_on_items_tree_view_selection_changed"; GtkAssistant *assistant; GtkWidget *page; gboolean enabled; g_return_if_fail( NACT_IS_ASSISTANT_EXPORT( window )); if( !window->private->dispose_has_run ){ g_debug( "%s: window=%p, selected_items=%p (count=%d), user_data=%p", thisfn, ( void * ) window, ( void * ) selected_items, g_list_length( selected_items ), ( void * ) user_data ); if( window->private->selected_items ){ window->private->selected_items = na_object_free_items( window->private->selected_items ); } enabled = ( g_list_length( selected_items ) > 0 ); window->private->selected_items = na_object_copyref_items( selected_items ); assistant = GTK_ASSISTANT( base_window_get_gtk_toplevel( BASE_WINDOW( window ))); page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_ACTIONS_SELECTION ); gtk_assistant_set_page_complete( assistant, page, enabled ); } } /* * we check the selected uri for writability * this is always subject to become invalid before actually writing * but this is better than nothing, doesn't ? * * NB: if the GtkFileChooser widget automatically opens on another mode that * 'file system' (e.g. search or recently used), it may be because of * ~/.config/gtk-2.0/gtkfilechooser.ini file -> to be checked * (maybe removed) */ static void on_folder_chooser_selection_changed( GtkFileChooser *chooser, NactAssistantExport *window ) { static const gchar *thisfn = "nact_assistant_export_on_folder_chooser_selection_changed"; GtkAssistant *assistant; GtkWidget *page; gchar *uri; gboolean enabled; g_return_if_fail( NACT_IS_ASSISTANT_EXPORT( window )); if( !window->private->dispose_has_run ){ g_debug( "%s: chooser=%p, window=%p", thisfn, ( void * ) chooser, ( void * ) window ); uri = gtk_file_chooser_get_current_folder_uri( chooser ); g_debug( "%s: uri=%s", thisfn, uri ); enabled = ( uri && strlen( uri ) && na_core_utils_dir_is_writable_uri( uri )); if( enabled ){ g_free( window->private->uri ); window->private->uri = g_strdup( uri ); na_settings_set_string( NA_IPREFS_EXPORT_ASSISTANT_URI, uri ); } g_free( uri ); assistant = GTK_ASSISTANT( base_window_get_gtk_toplevel( BASE_WINDOW( window ))); page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FOLDER_SELECTION ); gtk_assistant_set_page_complete( assistant, page, enabled ); } } static void assistant_prepare( BaseAssistant *window, GtkAssistant *assistant, GtkWidget *page ) { static const gchar *thisfn = "nact_assistant_export_on_prepare"; g_debug( "%s: window=%p, assistant=%p, page=%p", thisfn, window, assistant, page ); GtkAssistantPageType type = gtk_assistant_get_page_type( assistant, page ); switch( type ){ case GTK_ASSISTANT_PAGE_CONFIRM: assist_prepare_confirm( NACT_ASSISTANT_EXPORT( window ), assistant, page ); break; case GTK_ASSISTANT_PAGE_SUMMARY: assist_prepare_exportdone( NACT_ASSISTANT_EXPORT( window ), assistant, page ); break; default: break; } } static void assist_prepare_confirm( NactAssistantExport *window, GtkAssistant *assistant, GtkWidget *page ) { static const gchar *thisfn = "nact_assistant_export_prepare_confirm"; gchar *text, *tmp; gchar *label_item; gchar *format_label, *format_label2; gchar *format_description, *format_description2; gchar *format_id; GtkWidget *label; NAIOption *format; GList *it; GtkWidget *format_page, *tree_view; g_debug( "%s: window=%p, assistant=%p, page=%p", thisfn, ( void * ) window, ( void * ) assistant, ( void * ) page ); #if !GTK_CHECK_VERSION( 3,0,0 ) /* Note that, at least, in Gtk 2.20 (Ubuntu 10) and 2.22 (Fedora 14), GtkLabel * queues its resize (when the text is being set), but the actual resize does * not happen immediately - We have to wait until Gtk 3.0, most probably due * to the new width-for-height and height-for-width features... */ GtkWidget *vbox = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p4-ConfirmVBox" ); gtk_container_set_resize_mode( GTK_CONTAINER( vbox ), GTK_RESIZE_IMMEDIATE ); #endif /* display the items to be exported */ text = NULL; for( it = window->private->selected_items ; it ; it = it->next ){ label_item = na_object_get_label( it->data ); if( text ){ tmp = g_strdup_printf( "%s\n%s", text, label_item ); g_free( text ); text = tmp; } else { text = g_strdup( label_item ); } g_free( label_item ); } label = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p4-ConfirmItemsList" ); g_return_if_fail( GTK_IS_LABEL( label )); gtk_label_set_text( GTK_LABEL( label ), text ); g_free( text ); /* display the target folder */ g_return_if_fail( window->private->uri && strlen( window->private->uri )); label = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p4-ConfirmTargetFolder" ); g_return_if_fail( GTK_IS_LABEL( label )); gtk_label_set_text( GTK_LABEL( label ), window->private->uri ); /* display the export format and its description */ format_page = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_FORMAT_SELECTION ); tree_view = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( format_page ), "p3-ExportFormatTreeView" ); g_return_if_fail( GTK_IS_TREE_VIEW( tree_view )); format = na_ioptions_list_get_selected( NA_IOPTIONS_LIST( window ), tree_view ); g_return_if_fail( NA_IS_EXPORT_FORMAT( format )); format_label = na_ioption_get_label( format ); format_label2 = na_core_utils_str_remove_char( format_label, "_" ); text = g_strdup_printf( "%s:", format_label2 ); label = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p4-ConfirmExportFormat" ); g_return_if_fail( GTK_IS_LABEL( label )); gtk_label_set_text( GTK_LABEL( label ), text ); g_free( format_label ); g_free( format_label2 ); g_free( text ); format_description = na_ioption_get_description( format ); format_description2 = na_core_utils_str_remove_char( format_description, "_" ); label = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p4-ConfirmExportTooltip" ); g_return_if_fail( GTK_IS_LABEL( label )); gtk_label_set_text( GTK_LABEL( label ), format_description2 ); g_free( format_description ); g_free( format_description2 ); format_id = na_ioption_get_id( format ); na_settings_set_string( NA_IPREFS_EXPORT_PREFERRED_FORMAT, format_id ); g_free( format_id ); gtk_assistant_set_page_complete( assistant, page, TRUE ); } /* * As of 1.11, nact_gconf_writer doesn't return any error message. * An error is simply indicated by returning a null filename. * So we provide a general error message. */ static void assistant_apply( BaseAssistant *wnd, GtkAssistant *assistant ) { static const gchar *thisfn = "nact_assistant_export_on_apply"; NactAssistantExport *window; GList *ia; ExportStruct *str; NactApplication *application; NAUpdater *updater; gboolean first; g_return_if_fail( NACT_IS_ASSISTANT_EXPORT( wnd )); g_debug( "%s: window=%p, assistant=%p", thisfn, ( void * ) wnd, ( void * ) assistant ); window = NACT_ASSISTANT_EXPORT( wnd ); application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window ))); updater = nact_application_get_updater( application ); first = TRUE; g_return_if_fail( window->private->uri && strlen( window->private->uri )); for( ia = window->private->selected_items ; ia ; ia = ia->next ){ str = g_new0( ExportStruct, 1 ); window->private->results = g_list_append( window->private->results, str ); str->item = NA_OBJECT_ITEM( na_object_get_origin( NA_IDUPLICABLE( ia->data ))); str->format = na_settings_get_string( NA_IPREFS_EXPORT_PREFERRED_FORMAT, NULL, NULL ); g_return_if_fail( str->format && strlen( str->format )); if( !strcmp( str->format, EXPORTER_FORMAT_ASK )){ g_free( str->format ); str->format = nact_export_ask_user( BASE_WINDOW( wnd ), str->item, first ); g_return_if_fail( str->format && strlen( str->format )); if( !str->format || !strcmp( str->format, EXPORTER_FORMAT_NOEXPORT )){ str->msg = g_slist_append( NULL, g_strdup( _( "Export canceled due to user action." ))); } } if( strcmp( str->format, EXPORTER_FORMAT_NOEXPORT ) != 0 ){ str->fname = na_exporter_to_file( NA_PIVOT( updater ), str->item, window->private->uri, str->format, &str->msg ); } g_free( str->format ); first = FALSE; } } static void assist_prepare_exportdone( NactAssistantExport *window, GtkAssistant *assistant, GtkWidget *page ) { static const gchar *thisfn = "nact_assistant_export_prepare_exportdone"; gint errors; guint width; GtkWidget *vbox; GtkWidget *item_vbox; const gchar *color; gchar *item_label; gchar *text, *tmp; GtkWidget *label; GSList *is; GList *ir; ExportStruct *str; g_debug( "%s: window=%p, assistant=%p, page=%p", thisfn, ( void * ) window, ( void * ) assistant, ( void * ) page ); errors = 0; width = 15; vbox = na_gtk_utils_find_widget_by_name( GTK_CONTAINER( page ), "p5-SummaryVBox" ); g_return_if_fail( GTK_IS_BOX( vbox )); #if !GTK_CHECK_VERSION( 3,0,0 ) /* Note that, at least, in Gtk 2.20 (Ubuntu 10) and 2.22 (Fedora 14), GtkLabel * queues its resize (when the text is being set), but the actual resize does * not happen immediately - We have to wait until Gtk 3.0, most probably due * to the new width-for-height and height-for-width features... */ gtk_container_set_resize_mode( GTK_CONTAINER( vbox ), GTK_RESIZE_IMMEDIATE ); #endif /* for each item: * - display the item label * - display the export filename */ for( ir = window->private->results ; ir ; ir = ir->next ){ #if GTK_CHECK_VERSION( 3,0,0 ) item_vbox = gtk_box_new( GTK_ORIENTATION_VERTICAL, 4 ); #else item_vbox = gtk_vbox_new( FALSE, 4 ); #endif gtk_box_pack_start( GTK_BOX( vbox ), item_vbox, FALSE, FALSE, 0 ); /* display the item label */ str = ( ExportStruct * ) ir->data; color = str->fname ? "blue" : "red"; item_label = na_object_get_label( str->item ); text = g_markup_printf_escaped( "%s", color, item_label ); label = gtk_label_new( NULL ); gtk_label_set_markup( GTK_LABEL( label ), text ); g_free( item_label ); g_free( text ); g_object_set( G_OBJECT( label ), "xalign", 0, NULL ); g_object_set( G_OBJECT( label ), "xpad", width, NULL ); gtk_box_pack_start( GTK_BOX( item_vbox ), label, FALSE, FALSE, 0 ); /* display the process log */ text = NULL; if( str->fname ){ /* i18n: action as been successfully exported to */ text = g_strdup_printf( "%s %s", _( "Successfully exported as" ), str->fname ); } else if( strcmp( str->format, EXPORTER_FORMAT_NOEXPORT ) != 0 ){ errors += 1; } /* add messages if any */ for( is = str->msg ; is ; is = is->next ){ if( text ){ tmp = g_strdup_printf( "%s\n%s", text, ( gchar * ) is->data ); g_free( text ); text = tmp; } else { text = g_strdup(( gchar * ) is->data ); } } label = gtk_label_new( text ); g_free( text ); gtk_label_set_line_wrap( GTK_LABEL( label ), TRUE ); gtk_label_set_line_wrap_mode( GTK_LABEL( label ), PANGO_WRAP_WORD ); g_object_set( G_OBJECT( label ), "xalign", 0, NULL ); g_object_set( G_OBJECT( label ), "xpad", 2*width, NULL ); gtk_box_pack_start( GTK_BOX( item_vbox ), label, FALSE, FALSE, 0 ); } if( errors ){ text = g_strdup_printf( "%s", _( "You may not have write permissions on selected folder." )); label = gtk_label_new( text ); g_free( text ); gtk_label_set_line_wrap( GTK_LABEL( label ), TRUE ); gtk_label_set_line_wrap_mode( GTK_LABEL( label ), PANGO_WRAP_WORD ); g_object_set( G_OBJECT( label ), "xalign", 0, NULL ); g_object_set( G_OBJECT( label ), "xpad", width, NULL ); gtk_box_pack_start( GTK_BOX( item_vbox ), label, FALSE, FALSE, 0 ); } gtk_assistant_set_page_complete( assistant, page, TRUE ); g_object_set( G_OBJECT( window ), BASE_PROP_WARN_ON_ESCAPE, FALSE, NULL ); gtk_widget_show_all( page ); } static void free_results( GList *list ) { GList *ir; ExportStruct *str; for( ir = list ; ir ; ir = ir->next ){ str = ( ExportStruct * ) ir->data; g_free( str->fname ); na_core_utils_slist_free( str->msg ); } g_list_free( list ); } nautilus-actions-3.2.3/src/nact/egg-sm-client.h0000644000175100017500000001000011367255355016266 00000000000000/* eggsmclient.h * Copyright (C) 2007 Novell, Inc. * * This library 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 of the License, or (at your option) any later version. * * This library 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., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __EGG_SM_CLIENT_H__ #define __EGG_SM_CLIENT_H__ #include G_BEGIN_DECLS #define EGG_TYPE_SM_CLIENT (egg_sm_client_get_type ()) #define EGG_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT, EggSMClient)) #define EGG_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT, EggSMClientClass)) #define EGG_IS_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT)) #define EGG_IS_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT)) #define EGG_SM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT, EggSMClientClass)) typedef struct _EggSMClient EggSMClient; typedef struct _EggSMClientClass EggSMClientClass; typedef struct _EggSMClientPrivate EggSMClientPrivate; typedef enum { EGG_SM_CLIENT_END_SESSION_DEFAULT, EGG_SM_CLIENT_LOGOUT, EGG_SM_CLIENT_REBOOT, EGG_SM_CLIENT_SHUTDOWN } EggSMClientEndStyle; typedef enum { EGG_SM_CLIENT_MODE_DISABLED, EGG_SM_CLIENT_MODE_NO_RESTART, EGG_SM_CLIENT_MODE_NORMAL } EggSMClientMode; struct _EggSMClient { GObject parent; }; struct _EggSMClientClass { GObjectClass parent_class; /* signals */ void (*save_state) (EggSMClient *client, GKeyFile *state_file); void (*quit_requested) (EggSMClient *client); void (*quit_cancelled) (EggSMClient *client); void (*quit) (EggSMClient *client); /* virtual methods */ void (*startup) (EggSMClient *client, const char *client_id); void (*set_restart_command) (EggSMClient *client, int argc, const char **argv); void (*will_quit) (EggSMClient *client, gboolean will_quit); gboolean (*end_session) (EggSMClient *client, EggSMClientEndStyle style, gboolean request_confirmation); /* Padding for future expansion */ void (*_egg_reserved1) (void); void (*_egg_reserved2) (void); void (*_egg_reserved3) (void); void (*_egg_reserved4) (void); }; GType egg_sm_client_get_type (void) G_GNUC_CONST; GOptionGroup *egg_sm_client_get_option_group (void); /* Initialization */ void egg_sm_client_set_mode (EggSMClientMode mode); EggSMClientMode egg_sm_client_get_mode (void); EggSMClient *egg_sm_client_get (void); void egg_sm_client_startup (void); /* Resuming a saved session */ gboolean egg_sm_client_is_resumed (EggSMClient *client); GKeyFile *egg_sm_client_get_state_file (EggSMClient *client); /* Alternate means of saving state */ void egg_sm_client_set_restart_command (EggSMClient *client, int argc, const char **argv); /* Handling "quit_requested" signal */ void egg_sm_client_will_quit (EggSMClient *client, gboolean will_quit); /* Initiate a logout/reboot/shutdown */ gboolean egg_sm_client_end_session (EggSMClientEndStyle style, gboolean request_confirmation); G_END_DECLS #endif /* __EGG_SM_CLIENT_H__ */ nautilus-actions-3.2.3/src/nact/nact-iaction-tab.c0000644000175100017500000007475112212601376016756 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "base-window.h" #include "nact-application.h" #include "nact-main-statusbar.h" #include "base-gtk-utils.h" #include "nact-main-tab.h" #include "nact-iaction-tab.h" #include "nact-icon-chooser.h" /* private interface data */ struct _NactIActionTabInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* Context identifier, set against the menubar */ #define IACTION_TAB_CONTEXT "nact-iaction-tab-context" /* data set against the instance */ typedef struct { gboolean on_selection_change; } IActionData; #define IACTION_TAB_PROP_DATA "nact-iaction-tab-data" static guint st_initializations = 0; /* interface initialisation count */ static GType register_type( void ); static void interface_base_init( NactIActionTabInterface *klass ); static void interface_base_finalize( NactIActionTabInterface *klass ); static void on_base_initialize_gtk( NactIActionTab *instance, GtkWindow *toplevel, gpointer user_data ); static void on_base_initialize_window( NactIActionTab *instance, gpointer user_data ); static void on_tree_view_content_changed( NactIActionTab *instance, NAObject *object, gpointer user_data ); static void on_main_selection_changed( NactIActionTab *instance, GList *selected_items, gpointer user_data ); static void on_target_selection_toggled( GtkToggleButton *button, NactIActionTab *instance ); static void on_target_location_toggled( GtkToggleButton *button, NactIActionTab *instance ); static void check_for_label( NactIActionTab *instance, GtkEntry *entry, const gchar *label ); static void on_label_changed( GtkEntry *entry, NactIActionTab *instance ); static void set_label_label( NactIActionTab *instance, const gchar *color ); static void on_target_toolbar_toggled( GtkToggleButton *button, NactIActionTab *instance ); static void on_toolbar_same_label_toggled( GtkToggleButton *button, NactIActionTab *instance ); static void toolbar_same_label_set_sensitive( NactIActionTab *instance, NAObjectItem *item ); static void setup_toolbar_label( NactIActionTab *instance, NAObjectItem *item, const gchar *label ); static void on_toolbar_label_changed( GtkEntry *entry, NactIActionTab *instance ); static void toolbar_label_set_sensitive( NactIActionTab *instance, NAObjectItem *item ); static void on_tooltip_changed( GtkEntry *entry, NactIActionTab *instance ); static void on_icon_browse( GtkButton *button, NactIActionTab *instance ); static void on_icon_changed( GtkEntry *entry, NactIActionTab *instance ); static IActionData *get_iaction_data( NactIActionTab *instance ); static void on_instance_finalized( gpointer user_data, NactIActionTab *instance ); GType nact_iaction_tab_get_type( void ) { static GType iface_type = 0; if( !iface_type ){ iface_type = register_type(); } return( iface_type ); } static GType register_type( void ) { static const gchar *thisfn = "nact_iaction_tab_register_type"; GType type; static const GTypeInfo info = { sizeof( NactIActionTabInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NactIActionTab", &info, 0 ); g_type_interface_add_prerequisite( type, BASE_TYPE_WINDOW ); return( type ); } static void interface_base_init( NactIActionTabInterface *klass ) { static const gchar *thisfn = "nact_iaction_tab_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); klass->private = g_new0( NactIActionTabInterfacePrivate, 1 ); } st_initializations += 1; } static void interface_base_finalize( NactIActionTabInterface *klass ) { static const gchar *thisfn = "nact_iaction_tab_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } /** * nact_iaction_tab_init: * @instance: this #NactIActionTab instance. * * Initialize the interface * Connect to #BaseWindow signals */ void nact_iaction_tab_init( NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_init"; IActionData *data; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); g_debug( "%s: instance=%p (%s)", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_GTK, G_CALLBACK( on_base_initialize_gtk )); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( instance ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_window )); nact_main_tab_init( NACT_MAIN_WINDOW( instance ), TAB_ACTION ); data = get_iaction_data( instance ); data->on_selection_change = FALSE; g_object_weak_ref( G_OBJECT( instance ), ( GWeakNotify ) on_instance_finalized, NULL ); } /* * GTK_ICON_SIZE_MENU : 16x16 * GTK_ICON_SIZE_SMALL_TOOLBAR: 18x18 * GTK_ICON_SIZE_LARGE_TOOLBAR: 24x24 * GTK_ICON_SIZE_BUTTON : 20x20 * GTK_ICON_SIZE_DND : 32x32 * GTK_ICON_SIZE_DIALOG : 48x48 * * icon is rendered for GTK_ICON_SIZE_MENU (na_object_item_get_pixbuf) * * Starting with 3.0.3, the ComboBox is dynamically created into its container. * Starting with 3.1.0, the ComboBox is replaced with a GtkEntry (thanks to new * Icon Chooser). */ static void on_base_initialize_gtk( NactIActionTab *instance, GtkWindow *toplevel, void *user_data ) { static const gchar *thisfn = "nact_iaction_tab_on_base_initialize_gtk"; GtkFrame *frame; GtkButton *button; gint size; /* gtk_widget_size_request() is deprecated since Gtk+ 3.0 * see http://library.gnome.org/devel/gtk/unstable/GtkWidget.html#gtk-widget-render-icon * and http://git.gnome.org/browse/gtk+/commit/?id=07eeae15825403037b7df139acf9bfa104d5559d */ #if GTK_CHECK_VERSION( 2, 91, 7 ) GtkRequisition minimal_size, natural_size; #else GtkRequisition requisition; #endif g_return_if_fail( NACT_IS_IACTION_TAB( instance )); g_debug( "%s: instance=%p (%s), toplevel=%p, user_data=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) toplevel, ( void * ) user_data ); button = GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconBrowseButton" )); frame = GTK_FRAME( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconFrame" )); #if GTK_CHECK_VERSION( 2, 91, 7 ) gtk_widget_get_preferred_size( GTK_WIDGET( button ), &minimal_size, &natural_size ); size = MAX( minimal_size.height, natural_size.height ); #else gtk_widget_size_request( GTK_WIDGET( button ), &requisition ); size = requisition.height; #endif gtk_widget_set_size_request( GTK_WIDGET( frame ), size, size ); gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN ); } static void on_base_initialize_window( NactIActionTab *instance, void *user_data ) { static const gchar *thisfn = "nact_iaction_tab_on_base_initialize_window"; GtkWidget *label_widget, *tooltip_widget, *icon_entry; GtkWidget *button; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); g_debug( "%s: instance=%p (%s), user_data=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) user_data ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( instance ), MAIN_SIGNAL_SELECTION_CHANGED, G_CALLBACK( on_main_selection_changed )); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( instance ), MAIN_SIGNAL_ITEM_UPDATED, G_CALLBACK( on_tree_view_content_changed )); button = base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetSelectionButton" ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( button ), "toggled", G_CALLBACK( on_target_selection_toggled )); button = base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetLocationButton" ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( button ), "toggled", G_CALLBACK( on_target_location_toggled )); label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionMenuLabelEntry" ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( label_widget ), "changed", G_CALLBACK( on_label_changed )); button = base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetToolbarButton" ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( button ), "toggled", G_CALLBACK( on_target_toolbar_toggled )); button = base_window_get_widget( BASE_WINDOW( instance ), "ToolbarSameLabelButton" ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( button ), "toggled", G_CALLBACK( on_toolbar_same_label_toggled )); label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionToolbarLabelEntry" ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( label_widget ), "changed", G_CALLBACK( on_toolbar_label_changed )); tooltip_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionTooltipEntry" ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( tooltip_widget ), "changed", G_CALLBACK( on_tooltip_changed )); icon_entry = base_window_get_widget( BASE_WINDOW( instance ), "ActionIconEntry" ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( icon_entry ), "changed", G_CALLBACK( on_icon_changed )); button = base_window_get_widget( BASE_WINDOW( instance ), "ActionIconBrowseButton" ); base_window_signal_connect( BASE_WINDOW( instance ), G_OBJECT( button ), "clicked", G_CALLBACK( on_icon_browse )); } /** * nact_iaction_tab_has_label: * @window: this #NactIActionTab instance. * * An action or a menu can only be written if it has at least a label. * * Returns %TRUE if the label of the action or of the menu is not empty. */ gboolean nact_iaction_tab_has_label( NactIActionTab *instance ) { GtkWidget *label_widget; const gchar *label; gboolean has_label = FALSE; g_return_val_if_fail( NACT_IS_IACTION_TAB( instance ), FALSE ); label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionMenuLabelEntry" ); label = gtk_entry_get_text( GTK_ENTRY( label_widget )); has_label = ( g_utf8_strlen( label, -1 ) > 0 ); return( has_label ); } static void on_tree_view_content_changed( NactIActionTab *instance, NAObject *object, gpointer user_data ) { GtkWidget *label_widget; gchar *label; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); if( object && NA_IS_OBJECT_ITEM( object )){ label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionMenuLabelEntry" ); label = na_object_get_label( object ); gtk_entry_set_text( GTK_ENTRY( label_widget ), label ); g_free( label ); } } static void on_main_selection_changed( NactIActionTab *instance, GList *selected_items, gpointer user_data ) { static const gchar *thisfn = "nact_iaction_tab_on_main_selection_changed"; guint count_selected; gboolean enable_tab; NAObjectItem *item; gboolean editable; gboolean target_selection, target_location, target_toolbar; gboolean enable_label; gboolean same_label; GtkWidget *label_widget, *tooltip_widget, *icon_widget; gchar *label, *tooltip, *icon; GtkButton *icon_button; GtkToggleButton *toggle; IActionData *data; g_return_if_fail( BASE_IS_WINDOW( instance )); g_return_if_fail( NACT_IS_IACTION_TAB( instance )); count_selected = g_list_length( selected_items ); g_debug( "%s: instance=%p (%s), selected_items=%p (count=%u)", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) selected_items, count_selected ); enable_tab = ( count_selected == 1 ); nact_main_tab_enable_page( NACT_MAIN_WINDOW( instance ), TAB_ACTION, enable_tab ); data = get_iaction_data( instance ); data->on_selection_change = TRUE; g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, MAIN_PROP_EDITABLE, &editable, NULL ); target_selection = enable_tab && item != NULL && NA_IS_OBJECT_ACTION( item ) && na_object_is_target_selection( item ); target_location = enable_tab && item != NULL && NA_IS_OBJECT_ACTION( item ) && na_object_is_target_location( item ); target_toolbar = enable_tab && item != NULL && NA_IS_OBJECT_ACTION( item ) && na_object_is_target_toolbar( item ); toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetSelectionButton" )); gtk_toggle_button_set_active( toggle, target_selection || ( item && NA_IS_OBJECT_MENU( item ))); gtk_widget_set_sensitive( GTK_WIDGET( toggle ), item && NA_IS_OBJECT_ACTION( item )); base_gtk_utils_set_editable( G_OBJECT( toggle ), editable ); toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetLocationButton" )); gtk_toggle_button_set_active( toggle, target_location || ( item && NA_IS_OBJECT_MENU( item ))); gtk_widget_set_sensitive( GTK_WIDGET( toggle ), item && NA_IS_OBJECT_ACTION( item )); base_gtk_utils_set_editable( G_OBJECT( toggle ), editable ); enable_label = target_selection || target_location || ( item && NA_IS_OBJECT_MENU( item )); label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionMenuLabelEntry" ); label = item ? na_object_get_label( item ) : g_strdup( "" ); label = label ? label : g_strdup( "" ); gtk_entry_set_text( GTK_ENTRY( label_widget ), label ); if( item ){ check_for_label( instance, GTK_ENTRY( label_widget ), label ); } g_free( label ); gtk_widget_set_sensitive( label_widget, enable_label ); base_gtk_utils_set_editable( G_OBJECT( label_widget ), editable ); toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionTargetToolbarButton" )); gtk_toggle_button_set_active( toggle, target_toolbar ); gtk_widget_set_sensitive( GTK_WIDGET( toggle ), item && NA_IS_OBJECT_ACTION( item )); base_gtk_utils_set_editable( G_OBJECT( toggle ), editable ); toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ToolbarSameLabelButton" )); same_label = item && NA_IS_OBJECT_ACTION( item ) ? na_object_is_toolbar_same_label( item ) : FALSE; gtk_toggle_button_set_active( toggle, same_label ); gtk_widget_set_sensitive( GTK_WIDGET( toggle ), target_toolbar ); base_gtk_utils_set_editable( G_OBJECT( toggle ), editable ); label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionToolbarLabelEntry" ); label = item && NA_IS_OBJECT_ACTION( item ) ? na_object_get_toolbar_label( item ) : g_strdup( "" ); gtk_entry_set_text( GTK_ENTRY( label_widget ), label ); g_free( label ); gtk_widget_set_sensitive( label_widget, target_toolbar && !same_label ); base_gtk_utils_set_editable( G_OBJECT( label_widget ), editable ); label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionToolbarLabelLabel" ); gtk_widget_set_sensitive( label_widget, target_toolbar && !same_label ); tooltip_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionTooltipEntry" ); tooltip = item ? na_object_get_tooltip( item ) : g_strdup( "" ); tooltip = tooltip ? tooltip : g_strdup( "" ); gtk_entry_set_text( GTK_ENTRY( tooltip_widget ), tooltip ); g_free( tooltip ); base_gtk_utils_set_editable( G_OBJECT( tooltip_widget ), editable ); icon_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionIconEntry" ); icon = item ? na_object_get_icon( item ) : g_strdup( "" ); icon = icon ? icon : g_strdup( "" ); gtk_entry_set_text( GTK_ENTRY( icon_widget ), icon ); g_free( icon ); base_gtk_utils_set_editable( G_OBJECT( icon_widget ), editable ); icon_button = GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconBrowseButton" )); base_gtk_utils_set_editable( G_OBJECT( icon_button ), editable ); data->on_selection_change = FALSE; } static void on_target_selection_toggled( GtkToggleButton *button, NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_on_target_selection_toggled"; NAObjectItem *item; gboolean is_target; gboolean editable; IActionData *data; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); data = get_iaction_data( instance ); if( !data->on_selection_change ){ g_debug( "%s: button=%p, instance=%p (%s)", thisfn, ( void * ) button, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, MAIN_PROP_EDITABLE, &editable, NULL ); g_debug( "%s: item=%p (%s), editable=%s", thisfn, ( void * ) item, item ? G_OBJECT_TYPE_NAME( item ) : "null", editable ? "True":"False" ); if( item && NA_IS_OBJECT_ACTION( item )){ is_target = gtk_toggle_button_get_active( button ); if( editable ){ na_object_set_target_selection( item, is_target ); g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, item, 0 ); } else { g_signal_handlers_block_by_func(( gpointer ) button, on_target_selection_toggled, instance ); gtk_toggle_button_set_active( button, !is_target ); g_signal_handlers_unblock_by_func(( gpointer ) button, on_target_selection_toggled, instance ); } } } } static void on_target_location_toggled( GtkToggleButton *button, NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_on_target_location_toggled"; NAObjectItem *item; gboolean is_target; gboolean editable; IActionData *data; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); data = get_iaction_data( instance ); if( !data->on_selection_change ){ g_debug( "%s: button=%p, instance=%p (%s)", thisfn, ( void * ) button, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, MAIN_PROP_EDITABLE, &editable, NULL ); g_debug( "%s: item=%p (%s), editable=%s", thisfn, ( void * ) item, item ? G_OBJECT_TYPE_NAME( item ) : "null", editable ? "True":"False" ); if( item && NA_IS_OBJECT_ACTION( item )){ is_target = gtk_toggle_button_get_active( button ); if( editable ){ na_object_set_target_location( item, is_target ); g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, item, 0 ); } else { g_signal_handlers_block_by_func(( gpointer ) button, on_target_location_toggled, instance ); gtk_toggle_button_set_active( button, !is_target ); g_signal_handlers_unblock_by_func(( gpointer ) button, on_target_location_toggled, instance ); } } } } static void check_for_label( NactIActionTab *instance, GtkEntry *entry, const gchar *label ) { NAObjectItem *item; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); g_return_if_fail( GTK_IS_ENTRY( entry )); nact_main_statusbar_hide_status( NACT_MAIN_WINDOW( instance ), IACTION_TAB_CONTEXT ); set_label_label( instance, "black" ); g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, NULL ); if( item && g_utf8_strlen( label, -1 ) == 0 ){ /* i18n: status bar message when the action label is empty */ nact_main_statusbar_display_status( NACT_MAIN_WINDOW( instance ), IACTION_TAB_CONTEXT, _( "Caution: a label is mandatory for the action or the menu." )); set_label_label( instance, "red" ); } } static void on_label_changed( GtkEntry *entry, NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_on_label_changed"; NAObjectItem *item; const gchar *label; IActionData *data; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); data = get_iaction_data( instance ); if( !data->on_selection_change ){ g_debug( "%s: entry=%p, instance=%p (%s)", thisfn, ( void * ) entry, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, NULL ); if( item ){ label = gtk_entry_get_text( entry ); na_object_set_label( item, label ); check_for_label( instance, entry, label ); if( NA_IS_OBJECT_ACTION( item )){ setup_toolbar_label( instance, item, label ); } g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, item, MAIN_DATA_LABEL ); } } } static void set_label_label( NactIActionTab *instance, const gchar *color_str ) { GtkWidget *label; label = base_window_get_widget( BASE_WINDOW( instance ), "ActionMenuLabelLabel" ); /* gtk_widget_modify_fg() is deprecated as of Gtk+ 3.0 */ #if GTK_CHECK_VERSION( 2, 91, 7 ) GdkRGBA color; gdk_rgba_parse( &color, color_str ); gtk_widget_override_color( label, GTK_STATE_FLAG_ACTIVE, &color ); #else GdkColor color; gdk_color_parse( color_str, &color ); gtk_widget_modify_fg( label, GTK_STATE_NORMAL, &color ); #endif } static void on_target_toolbar_toggled( GtkToggleButton *button, NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_on_target_toolbar_toggled"; NAObjectAction *item; gboolean is_target; gboolean editable; IActionData *data; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); data = get_iaction_data( instance ); if( !data->on_selection_change ){ g_debug( "%s: button=%p, instance=%p (%s)", thisfn, ( void * ) button, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, MAIN_PROP_EDITABLE, &editable, NULL ); g_debug( "%s: item=%p (%s), editable=%s", thisfn, ( void * ) item, item ? G_OBJECT_TYPE_NAME( item ) : "null", editable ? "True":"False" ); if( item && NA_IS_OBJECT_ACTION( item )){ is_target = gtk_toggle_button_get_active( button ); if( editable ){ na_object_set_target_toolbar( item, is_target ); g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, item, 0 ); toolbar_same_label_set_sensitive( instance, NA_OBJECT_ITEM( item )); toolbar_label_set_sensitive( instance, NA_OBJECT_ITEM( item )); } else { g_signal_handlers_block_by_func(( gpointer ) button, on_target_toolbar_toggled, instance ); gtk_toggle_button_set_active( button, !is_target ); g_signal_handlers_unblock_by_func(( gpointer ) button, on_target_toolbar_toggled, instance ); } } } } static void on_toolbar_same_label_toggled( GtkToggleButton *button, NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_on_toolbar_same_label_toggled"; NAObjectItem *item; gboolean same_label; gboolean editable; gchar *label; GtkWidget *label_widget; IActionData *data; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); data = get_iaction_data( instance ); if( !data->on_selection_change ){ g_debug( "%s: button=%p, instance=%p (%s)", thisfn, ( void * ) button, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, MAIN_PROP_EDITABLE, &editable, NULL ); g_debug( "%s: item=%p (%s), editable=%s", thisfn, ( void * ) item, item ? G_OBJECT_TYPE_NAME( item ) : "null", editable ? "True":"False" ); if( item && NA_IS_OBJECT_ACTION( item )){ same_label = gtk_toggle_button_get_active( button ); if( editable ){ na_object_set_toolbar_same_label( NA_OBJECT_ACTION( item ), same_label ); if( same_label ){ label = na_object_get_label( item ); label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionToolbarLabelEntry" ); gtk_entry_set_text( GTK_ENTRY( label_widget ), label ); g_free( label ); } g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, item, 0 ); toolbar_same_label_set_sensitive( instance, NA_OBJECT_ITEM( item )); toolbar_label_set_sensitive( instance, NA_OBJECT_ITEM( item )); } else { g_signal_handlers_block_by_func(( gpointer ) button, on_toolbar_same_label_toggled, instance ); gtk_toggle_button_set_active( button, !same_label ); g_signal_handlers_unblock_by_func(( gpointer ) button, on_toolbar_same_label_toggled, instance ); } } } } static void toolbar_same_label_set_sensitive( NactIActionTab *instance, NAObjectItem *item ) { GtkToggleButton *toggle; gboolean target_toolbar; gboolean readonly; readonly = item ? na_object_is_readonly( item ) : FALSE; toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ToolbarSameLabelButton" )); target_toolbar = item && NA_IS_OBJECT_ACTION( item ) ? na_object_is_target_toolbar( NA_OBJECT_ACTION( item )) : FALSE; gtk_widget_set_sensitive( GTK_WIDGET( toggle ), target_toolbar && !readonly ); } /* * setup the label of the toolbar according to the toolbar_same_label flag */ static void setup_toolbar_label( NactIActionTab *instance, NAObjectItem *item, const gchar *label ) { GtkWidget *label_widget; if( item && NA_IS_OBJECT_ACTION( item )){ if( na_object_is_toolbar_same_label( item )){ label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionToolbarLabelEntry" ); gtk_entry_set_text( GTK_ENTRY( label_widget ), label ); } } } static void on_toolbar_label_changed( GtkEntry *entry, NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_on_toolbar_label_changed"; NAObjectItem *item; const gchar *label; IActionData *data; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); data = get_iaction_data( instance ); if( !data->on_selection_change ){ g_debug( "%s: entry=%p, instance=%p (%s)", thisfn, ( void * ) entry, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, NULL ); if( item && NA_IS_OBJECT_ACTION( item )){ label = gtk_entry_get_text( entry ); na_object_set_toolbar_label( NA_OBJECT_ACTION( item ), label ); g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, item, 0 ); } } } static void toolbar_label_set_sensitive( NactIActionTab *instance, NAObjectItem *item ) { gboolean is_action; gboolean same_label; GtkWidget *label_widget; is_action = item && NA_IS_OBJECT_ACTION( item ); same_label = is_action ? na_object_is_toolbar_same_label( NA_OBJECT_ACTION( item )) : FALSE; label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionToolbarLabelEntry" ); gtk_widget_set_sensitive( label_widget, is_action && !same_label ); } static void on_tooltip_changed( GtkEntry *entry, NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_on_tooltip_changed"; NAObjectItem *item; IActionData *data; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); data = get_iaction_data( instance ); if( !data->on_selection_change ){ g_debug( "%s: entry=%p, instance=%p (%s)", thisfn, ( void * ) entry, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, NULL ); if( item ){ na_object_set_tooltip( item, gtk_entry_get_text( entry )); g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, item, 0 ); } } } static void on_icon_browse( GtkButton *button, NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_on_icon_browse"; NAObjectItem *item; GtkWidget *icon_entry; gchar *icon_name; gchar *new_icon_name; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); g_debug( "%s: button=%p, instance=%p (%s)", thisfn, ( void * ) button, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, NULL ); if( item ){ icon_name = na_object_get_icon( item ); new_icon_name = nact_icon_chooser_choose_icon( BASE_WINDOW( instance ), icon_name ); if( g_utf8_collate( icon_name, new_icon_name ) != 0 ){ icon_entry = base_window_get_widget( BASE_WINDOW( instance ), "ActionIconEntry" ); gtk_entry_set_text( GTK_ENTRY( icon_entry ), new_icon_name ); } g_free( icon_name ); g_free( new_icon_name ); } } static void on_icon_changed( GtkEntry *icon_entry, NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_on_icon_changed"; GtkImage *image; NAObjectItem *item; gchar *icon_name; IActionData *data; g_return_if_fail( NACT_IS_IACTION_TAB( instance )); g_debug( "%s: icon_entry=%p, instance=%p (%s)", thisfn, ( void * ) icon_entry, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); icon_name = NULL; data = get_iaction_data( instance ); g_object_get( G_OBJECT( instance ), MAIN_PROP_ITEM, &item, NULL ); if( item ){ if( !data->on_selection_change ){ icon_name = g_strdup( gtk_entry_get_text( icon_entry )); na_object_set_icon( item, icon_name ); g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, item, MAIN_DATA_ICON ); } else { icon_name = na_object_get_icon( item ); } } /* icon_name may be null if there is no current item * in such a case, we blank the image */ image = GTK_IMAGE( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconImage" )); base_gtk_utils_render( icon_name, image, GTK_ICON_SIZE_SMALL_TOOLBAR ); g_free( icon_name ); } static IActionData * get_iaction_data( NactIActionTab *instance ) { IActionData *data; data = ( IActionData * ) g_object_get_data( G_OBJECT( instance ), IACTION_TAB_PROP_DATA ); if( !data ){ data = g_new0( IActionData, 1 ); g_object_set_data( G_OBJECT( instance ), IACTION_TAB_PROP_DATA, data ); } return( data ); } static void on_instance_finalized( gpointer user_data, NactIActionTab *instance ) { static const gchar *thisfn = "nact_iaction_tab_on_instance_finalized"; IActionData *data; g_debug( "%s: instance=%p, user_data=%p", thisfn, ( void * ) instance, ( void * ) user_data ); data = get_iaction_data( instance ); g_free( data ); } nautilus-actions-3.2.3/src/nact/nact-add-capability-dialog.c0000644000175100017500000004374012212601376020662 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "nact-add-capability-dialog.h" /* private class data */ struct _NactAddCapabilityDialogClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NactAddCapabilityDialogPrivate { gboolean dispose_has_run; GSList *already_used; gchar *capability; }; /* column ordering in the model */ enum { CAPABILITY_KEYWORD_COLUMN = 0, CAPABILITY_DESC_COLUMN, CAPABILITY_ALREADY_USED_COLUMN, CAPABILITY_N_COLUMN }; typedef struct { gchar *keyword; gchar *desc; } CapabilityTextStruct; static CapabilityTextStruct st_caps[] = { { "Owner", N_( "User is the owner of the item" ) }, { "Readable", N_( "Item is readable by the user" ) }, { "Writable", N_( "Item is writable by the user" ) }, { "Executable", N_( "Item is executable by the user" ) }, { "Local", N_( "Item is local" ) }, { NULL }, }; static const gchar *st_xmlui_filename = PKGUIDIR "/nact-add-capability.ui"; static const gchar *st_toplevel_name = "AddCapabilityDialog"; static const gchar *st_wsp_name = NA_IPREFS_CAPABILITY_ADD_CAPABILITY_WSP; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NactAddCapabilityDialogClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_constructed( GObject *dialog ); static void instance_dispose( GObject *dialog ); static void instance_finalize( GObject *dialog ); static void on_base_initialize_gtk( NactAddCapabilityDialog *editor, GtkDialog *toplevel, gpointer user_data ); static void on_base_initialize_window( NactAddCapabilityDialog *editor, gpointer user_data ); static void on_base_show_widgets( NactAddCapabilityDialog *editor, gpointer user_data ); static gboolean on_button_press_event( GtkWidget *widget, GdkEventButton *event, NactAddCapabilityDialog *editor ); static void on_cancel_clicked( GtkButton *button, NactAddCapabilityDialog *editor ); static void on_ok_clicked( GtkButton *button, NactAddCapabilityDialog *editor ); static void on_selection_changed( GtkTreeSelection *selection, BaseWindow *window ); static void display_keyword( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, BaseWindow *window ); static void display_description( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, BaseWindow *window ); static void display_label( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, BaseWindow *window, guint column_id ); static gboolean setup_values_iter( GtkTreeModel *model, GtkTreePath *path, GtkTreeIter* iter, GSList *capabilities ); static void try_for_send_ok( NactAddCapabilityDialog *dialog ); static void send_ok( NactAddCapabilityDialog *dialog ); static void on_dialog_ok( BaseDialog *dialog ); GType nact_add_capability_dialog_get_type( void ) { static GType dialog_type = 0; if( !dialog_type ){ dialog_type = register_type(); } return( dialog_type ); } static GType register_type( void ) { static const gchar *thisfn = "nact_add_capability_dialog_register_type"; GType type; static GTypeInfo info = { sizeof( NactAddCapabilityDialogClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NactAddCapabilityDialog ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( BASE_TYPE_DIALOG, "NactAddCapabilityDialog", &info, 0 ); return( type ); } static void class_init( NactAddCapabilityDialogClass *klass ) { static const gchar *thisfn = "nact_add_capability_dialog_class_init"; GObjectClass *object_class; BaseDialogClass *dialog_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->constructed = instance_constructed; object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NactAddCapabilityDialogClassPrivate, 1 ); dialog_class = BASE_DIALOG_CLASS( klass ); dialog_class->ok = on_dialog_ok; } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "nact_add_capability_dialog_instance_init"; NactAddCapabilityDialog *self; g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( instance )); g_debug( "%s: instance=%p, klass=%p", thisfn, ( void * ) instance, ( void * ) klass ); self = NACT_ADD_CAPABILITY_DIALOG( instance ); self->private = g_new0( NactAddCapabilityDialogPrivate, 1 ); self->private->dispose_has_run = FALSE; self->private->capability = NULL; } static void instance_constructed( GObject *dialog ) { static const gchar *thisfn = "nact_add_capability_dialog_instance_constructed"; NactAddCapabilityDialogPrivate *priv; g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( dialog )); priv = NACT_ADD_CAPABILITY_DIALOG( dialog )->private; if( !priv->dispose_has_run ){ /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->constructed ){ G_OBJECT_CLASS( st_parent_class )->constructed( dialog ); } g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog )); base_window_signal_connect( BASE_WINDOW( dialog ), G_OBJECT( dialog ), BASE_SIGNAL_INITIALIZE_GTK, G_CALLBACK( on_base_initialize_gtk )); base_window_signal_connect( BASE_WINDOW( dialog ), G_OBJECT( dialog ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_window )); base_window_signal_connect( BASE_WINDOW( dialog ), G_OBJECT( dialog ), BASE_SIGNAL_SHOW_WIDGETS, G_CALLBACK( on_base_show_widgets )); } } static void instance_dispose( GObject *dialog ) { static const gchar *thisfn = "nact_add_capability_dialog_instance_dispose"; NactAddCapabilityDialog *self; GtkTreeView *listview; GtkTreeModel *model; GtkTreeSelection *selection; g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( dialog )); self = NACT_ADD_CAPABILITY_DIALOG( dialog ); if( !self->private->dispose_has_run ){ g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog )); self->private->dispose_has_run = TRUE; listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "CapabilitiesTreeView" )); model = gtk_tree_view_get_model( listview ); selection = gtk_tree_view_get_selection( listview ); gtk_tree_selection_unselect_all( selection ); gtk_list_store_clear( GTK_LIST_STORE( model )); /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( dialog ); } } } static void instance_finalize( GObject *dialog ) { static const gchar *thisfn = "nact_add_capability_dialog_instance_finalize"; NactAddCapabilityDialog *self; g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( dialog )); g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog )); self = NACT_ADD_CAPABILITY_DIALOG( dialog ); na_core_utils_slist_free( self->private->already_used ); g_free( self->private->capability ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( dialog ); } } /** * nact_add_capability_dialog_run: * @parent: the BaseWindow parent of this dialog * (usually the NactMainWindow). * @capabilities: list of already used capabilities. * * Initializes and runs the dialog. * * Returns: the selected capability, as a newly allocated string which should * be g_free() by the caller, or NULL. */ gchar * nact_add_capability_dialog_run( BaseWindow *parent, GSList *capabilities ) { static const gchar *thisfn = "nact_add_capability_dialog_run"; NactAddCapabilityDialog *dialog; gchar *capability; g_debug( "%s: parent=%p", thisfn, ( void * ) parent ); g_return_val_if_fail( BASE_IS_WINDOW( parent ), NULL ); dialog = g_object_new( NACT_TYPE_ADD_CAPABILITY_DIALOG, BASE_PROP_PARENT, parent, BASE_PROP_XMLUI_FILENAME, st_xmlui_filename, BASE_PROP_TOPLEVEL_NAME, st_toplevel_name, BASE_PROP_WSP_NAME, st_wsp_name, NULL ); dialog->private->already_used = na_core_utils_slist_duplicate( capabilities ); capability = NULL; if( base_window_run( BASE_WINDOW( dialog )) == GTK_RESPONSE_OK ){ capability = g_strdup( dialog->private->capability ); } g_object_unref( dialog ); return( capability ); } static void on_base_initialize_gtk( NactAddCapabilityDialog *dialog, GtkDialog *toplevel, gpointer user_data ) { static const gchar *thisfn = "nact_add_capability_dialog_on_base_initialize_gtk"; GtkTreeView *listview; GtkTreeModel *model; GtkTreeViewColumn *column; GtkCellRenderer *text_cell; GtkTreeSelection *selection; g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( dialog )); if( !dialog->private->dispose_has_run ){ g_debug( "%s: dialog=%p, toplevel=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) toplevel, ( void * ) user_data ); listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "CapabilitiesTreeView" )); model = GTK_TREE_MODEL( gtk_list_store_new( CAPABILITY_N_COLUMN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN )); gtk_tree_view_set_model( listview, GTK_TREE_MODEL( model )); g_object_unref( model ); text_cell = gtk_cell_renderer_text_new(); column = gtk_tree_view_column_new_with_attributes( "capability-keyword", text_cell, "text", CAPABILITY_KEYWORD_COLUMN, NULL ); gtk_tree_view_append_column( listview, column ); gtk_tree_sortable_set_sort_column_id( GTK_TREE_SORTABLE( model ), CAPABILITY_KEYWORD_COLUMN, GTK_SORT_ASCENDING ); gtk_tree_view_column_set_cell_data_func( column, text_cell, ( GtkTreeCellDataFunc ) display_keyword, dialog, NULL ); text_cell = gtk_cell_renderer_text_new(); column = gtk_tree_view_column_new_with_attributes( "capability-description", text_cell, "text", CAPABILITY_DESC_COLUMN, NULL ); gtk_tree_view_append_column( listview, column ); gtk_tree_view_column_set_cell_data_func( column, text_cell, ( GtkTreeCellDataFunc ) display_description, dialog, NULL ); gtk_tree_view_set_headers_visible( listview, FALSE ); selection = gtk_tree_view_get_selection( listview ); gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE ); #if !GTK_CHECK_VERSION( 2,22,0 ) gtk_dialog_set_has_separator( toplevel, FALSE ); #endif } } static void on_base_initialize_window( NactAddCapabilityDialog *dialog, gpointer user_data ) { static const gchar *thisfn = "nact_add_capability_dialog_on_base_initialize_window"; GtkTreeView *listview; GtkListStore *model; GtkTreeIter row; guint i; g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( dialog )); if( !dialog->private->dispose_has_run ){ g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data ); listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "CapabilitiesTreeView" )); model = GTK_LIST_STORE( gtk_tree_view_get_model( listview )); for( i = 0 ; st_caps[i].keyword ; i = i+1 ){ gtk_list_store_append( model, &row ); gtk_list_store_set( model, &row, CAPABILITY_KEYWORD_COLUMN, st_caps[i].keyword, CAPABILITY_DESC_COLUMN, gettext( st_caps[i].desc ), CAPABILITY_ALREADY_USED_COLUMN, FALSE, -1 ); } gtk_tree_model_foreach( GTK_TREE_MODEL( model ), ( GtkTreeModelForeachFunc ) setup_values_iter, dialog->private->already_used ); /* catch double-click */ base_window_signal_connect( BASE_WINDOW( dialog ), G_OBJECT( listview ), "button-press-event", G_CALLBACK( on_button_press_event )); base_window_signal_connect( BASE_WINDOW( dialog ), G_OBJECT( gtk_tree_view_get_selection( listview )), "changed", G_CALLBACK( on_selection_changed )); base_window_signal_connect_by_name( BASE_WINDOW( dialog ), "CancelButton", "clicked", G_CALLBACK( on_cancel_clicked )); base_window_signal_connect_by_name( BASE_WINDOW( dialog ), "OKButton", "clicked", G_CALLBACK( on_ok_clicked )); } } static void on_base_show_widgets( NactAddCapabilityDialog *dialog, gpointer user_data ) { static const gchar *thisfn = "nact_add_capability_dialog_on_base_show_widgets"; GtkTreeView *listview; GtkTreePath *path; GtkTreeSelection *selection; g_return_if_fail( NACT_IS_ADD_CAPABILITY_DIALOG( dialog )); if( !dialog->private->dispose_has_run ){ g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) dialog, ( void * ) user_data ); listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( dialog ), "CapabilitiesTreeView" )); path = gtk_tree_path_new_first(); selection = gtk_tree_view_get_selection( listview ); gtk_tree_selection_select_path( selection, path ); gtk_tree_path_free( path ); } } static gboolean on_button_press_event( GtkWidget *widget, GdkEventButton *event, NactAddCapabilityDialog *dialog ) { gboolean stop = FALSE; /* double-click of left button */ if( event->type == GDK_2BUTTON_PRESS && event->button == 1 ){ try_for_send_ok( dialog ); stop = TRUE; } return( stop ); } static void on_cancel_clicked( GtkButton *button, NactAddCapabilityDialog *dialog ) { GtkWindow *toplevel = base_window_get_gtk_toplevel( BASE_WINDOW( dialog )); gtk_dialog_response( GTK_DIALOG( toplevel ), GTK_RESPONSE_CLOSE ); } static void on_ok_clicked( GtkButton *button, NactAddCapabilityDialog *dialog ) { send_ok( dialog ); } static void on_selection_changed( GtkTreeSelection *selection, BaseWindow *window ) { GList *rows; GtkTreeModel *model; GtkTreePath *path; GtkTreeIter iter; gboolean used; GtkWidget *button; rows = gtk_tree_selection_get_selected_rows( selection, &model ); used = FALSE; if( g_list_length( rows ) == 1 ){ path = ( GtkTreePath * ) rows->data; gtk_tree_model_get_iter( model, &iter, path ); gtk_tree_model_get( model, &iter, CAPABILITY_ALREADY_USED_COLUMN, &used, -1 ); } button = base_window_get_widget( window, "OKButton" ); gtk_widget_set_sensitive( button, !used ); } static void display_keyword( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, BaseWindow *window ) { display_label( column, cell, model, iter, window, CAPABILITY_KEYWORD_COLUMN ); } static void display_description( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, BaseWindow *window ) { display_label( column, cell, model, iter, window, CAPABILITY_DESC_COLUMN ); } static void display_label( GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, BaseWindow *window, guint column_id ) { gboolean used; gtk_tree_model_get( model, iter, CAPABILITY_ALREADY_USED_COLUMN, &used, -1 ); g_object_set( cell, "style-set", FALSE, NULL ); if( used ){ g_object_set( cell, "style", PANGO_STYLE_ITALIC, "style-set", TRUE, NULL ); } } static gboolean setup_values_iter( GtkTreeModel *model, GtkTreePath *path, GtkTreeIter* iter, GSList *capabilities ) { gchar *keyword; gchar *description, *new_description; gtk_tree_model_get( model, iter, CAPABILITY_KEYWORD_COLUMN, &keyword, CAPABILITY_DESC_COLUMN, &description, -1 ); if( na_core_utils_slist_find_negated( capabilities, keyword )){ /* i18n: add a comment when a capability is already used by current item */ new_description = g_strdup_printf( _( "%s (already inserted)"), description ); gtk_list_store_set( GTK_LIST_STORE( model ), iter, CAPABILITY_DESC_COLUMN, new_description, CAPABILITY_ALREADY_USED_COLUMN, TRUE, -1 ); g_free( new_description ); } g_free( description ); g_free( keyword ); return( FALSE ); /* don't stop looping */ } static void try_for_send_ok( NactAddCapabilityDialog *dialog ) { GtkWidget *button; gboolean is_sensitive; button = base_window_get_widget( BASE_WINDOW( dialog ), "OKButton" ); is_sensitive = gtk_widget_is_sensitive( button ); if( is_sensitive ){ send_ok( dialog ); } } static void send_ok( NactAddCapabilityDialog *dialog ) { GtkWindow *toplevel = base_window_get_gtk_toplevel( BASE_WINDOW( dialog )); gtk_dialog_response( GTK_DIALOG( toplevel ), GTK_RESPONSE_OK ); } static void on_dialog_ok( BaseDialog *dialog ) { NactAddCapabilityDialog *editor; GtkTreeView *listview; GtkTreeSelection *selection; GtkTreeModel *model; GList *rows; GtkTreePath *path; GtkTreeIter iter; editor = NACT_ADD_CAPABILITY_DIALOG( dialog ); listview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( editor ), "CapabilitiesTreeView" )); selection = gtk_tree_view_get_selection( listview ); rows = gtk_tree_selection_get_selected_rows( selection, &model ); if( g_list_length( rows ) == 1 ){ path = ( GtkTreePath * ) rows->data; gtk_tree_model_get_iter( model, &iter, path ); gtk_tree_model_get( model, &iter, CAPABILITY_KEYWORD_COLUMN, &editor->private->capability, -1 ); } } nautilus-actions-3.2.3/src/nact/nact-tree-model-priv.h0000644000175100017500000000663612212601376017601 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ /** * SECTION: nact_tree_model * @short_description: #NactTreeModel private data definition. * @include: nact/nact-tree-model-priv.h */ #ifndef __NACT_TREE_MODEL_PRIV_H__ #define __NACT_TREE_MODEL_PRIV_H__ #include "base-window.h" #include "egg-tree-multi-dnd.h" #include "nact-clipboard.h" G_BEGIN_DECLS /* private instance data */ struct _NactTreeModelPrivate { gboolean dispose_has_run; /* data set at instanciation time */ BaseWindow *window; GtkTreeView *treeview; guint mode; NactClipboard *clipboard; /* runtime data */ gboolean drag_has_profiles; gboolean drag_highlight; /* defined for on_drag_motion handler */ gboolean drag_drop; /* defined for on_drag_motion handler */ }; #define TREE_MODEL_STATUSBAR_CONTEXT "nact-tree-model-statusbar-context" gboolean nact_tree_model_dnd_idrag_dest_drag_data_received( GtkTreeDragDest *drag_dest, GtkTreePath *dest, GtkSelectionData *selection_data ); gboolean nact_tree_model_dnd_idrag_dest_row_drop_possible( GtkTreeDragDest *drag_dest, GtkTreePath *dest_path, GtkSelectionData *selection_data ); gboolean nact_tree_model_dnd_imulti_drag_source_drag_data_get( EggTreeMultiDragSource *drag_source, GdkDragContext *context, GtkSelectionData *selection_data, GList *path_list, guint info ); gboolean nact_tree_model_dnd_imulti_drag_source_drag_data_delete( EggTreeMultiDragSource *drag_source, GList *path_list ); GdkDragAction nact_tree_model_dnd_imulti_drag_source_get_drag_actions( EggTreeMultiDragSource *drag_source ); GtkTargetList *nact_tree_model_dnd_imulti_drag_source_get_format_list( EggTreeMultiDragSource *drag_source ); gboolean nact_tree_model_dnd_imulti_drag_source_row_draggable( EggTreeMultiDragSource *drag_source, GList *path_list ); void nact_tree_model_dnd_on_drag_begin( GtkWidget *widget, GdkDragContext *context, BaseWindow *window ); /*gboolean on_drag_motion( GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, BaseWindow *window );*/ /*gboolean on_drag_drop( GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, BaseWindow *window );*/ void nact_tree_model_dnd_on_drag_end( GtkWidget *widget, GdkDragContext *context, BaseWindow *window ); G_END_DECLS #endif /* __NACT_TREE_MODEL_PRIV_H__ */ nautilus-actions-3.2.3/src/nact/base-gtk-utils.h0000644000175100017500000000621512212601376016467 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __BASE_GTK_UTILS_H__ #define __BASE_GTK_UTILS_H__ /** * SECTION: base-gtk-utils * @title: BaseGtkUtils * @short_description: Gtk helper functions * @include: base-gtk-utils.h */ #include "base-window.h" G_BEGIN_DECLS /* window size and position */ void base_gtk_utils_restore_window_position( const BaseWindow *window, const gchar *wsp_name ); void base_gtk_utils_save_window_position ( const BaseWindow *window, const gchar *wsp_name ); /* widget status */ void base_gtk_utils_set_editable( GObject *widget, gboolean editable ); void base_gtk_utils_radio_set_initial_state ( GtkRadioButton *button, GCallback toggled_handler, void *user_data, gboolean editable, gboolean sensitive ); void base_gtk_utils_radio_reset_initial_state( GtkRadioButton *button, GCallback toggled_handler ); void base_gtk_utils_toggle_set_initial_state ( BaseWindow *window, const gchar *button_name, GCallback toggled_handler, gboolean active, gboolean editable, gboolean sensitive ); void base_gtk_utils_toggle_reset_initial_state( GtkToggleButton *button ); /* image utilities */ GdkPixbuf *base_gtk_utils_get_pixbuf( const gchar *name, GtkWidget *widget, GtkIconSize size ); void base_gtk_utils_render( const gchar *name, GtkImage *widget, GtkIconSize size ); /* standard dialog boxes */ void base_gtk_utils_select_file( BaseWindow *window, const gchar *title, const gchar *wsp_name, GtkWidget *entry, const gchar *entry_name ); void base_gtk_utils_select_file_with_preview( BaseWindow *window, const gchar *title, const gchar *wsp_name, GtkWidget *entry, const gchar *entry_name, GCallback update_preview_cb ); void base_gtk_utils_select_dir( BaseWindow *window, const gchar *title, const gchar *wsp_name, GtkWidget *entry, const gchar *entry_name ); /* try to dynamically convert a GtkTable to a GtkGrid */ void base_gtk_utils_table_to_grid( BaseWindow *window, const gchar *table_name ); G_END_DECLS #endif /* __BASE_GTK_UTILS_H__ */ nautilus-actions-3.2.3/src/nact/base-application.c0000644000175100017500000005154212212633226017044 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "base-application.h" #include "base-isession.h" #include "base-iunique.h" /* private class data */ struct _BaseApplicationClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _BaseApplicationPrivate { gboolean dispose_has_run; /* properties */ int argc; GStrv argv; GOptionEntry *options; gchar *application_name; gchar *description; gchar *icon_name; gchar *unique_app_name; int code; }; /* instance properties */ enum { BASE_PROP_0, BASE_PROP_ARGC_ID, BASE_PROP_ARGV_ID, BASE_PROP_OPTIONS_ID, BASE_PROP_APPLICATION_NAME_ID, BASE_PROP_DESCRIPTION_ID, BASE_PROP_ICON_NAME_ID, BASE_PROP_UNIQUE_NAME_ID, BASE_PROP_CODE_ID, BASE_PROP_N_PROPERTIES }; static GObjectClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( BaseApplicationClass *klass ); static void isession_iface_init( BaseISessionInterface *iface, void *user_data ); static void iunique_iface_init( BaseIUniqueInterface *iface, void *user_data ); static const gchar *iunique_get_application_name( const BaseIUnique *instance ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ); static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ); static void instance_dispose( GObject *application ); static void instance_finalize( GObject *application ); static gboolean init_i18n( BaseApplication *application ); static gboolean init_application_name( BaseApplication *application ); static gboolean init_gtk( BaseApplication *application ); static gboolean v_manage_options( BaseApplication *application ); static gboolean init_unique_manager( BaseApplication *application ); static gboolean init_session_manager( BaseApplication *application ); static gboolean init_icon_name( BaseApplication *application ); static gboolean v_init_application( BaseApplication *application ); static gboolean v_create_windows( BaseApplication *application ); /* * the BaseISessionInterface interface is registered here because * the interface requires its implementation to be of BaseApplication * type. So we have to first register the type class before trying to * register the type interface. */ GType base_application_get_type( void ) { static GType application_type = 0; if( !application_type ){ application_type = register_type(); } return( application_type ); } static GType register_type( void ) { static const gchar *thisfn = "base_application_register_type"; GType type; static GTypeInfo info = { sizeof( BaseApplicationClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( BaseApplication ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo isession_iface_info = { ( GInterfaceInitFunc ) isession_iface_init, NULL, NULL }; static const GInterfaceInfo iunique_iface_info = { ( GInterfaceInitFunc ) iunique_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); #if !GLIB_CHECK_VERSION( 2,36, 0 ) g_type_init(); #endif type = g_type_register_static( G_TYPE_OBJECT, "BaseApplication", &info, 0 ); g_type_add_interface_static( type, BASE_TYPE_ISESSION, &isession_iface_info ); g_type_add_interface_static( type, BASE_TYPE_IUNIQUE, &iunique_iface_info ); return( type ); } static void class_init( BaseApplicationClass *klass ) { static const gchar *thisfn = "base_application_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; object_class->get_property = instance_get_property; object_class->set_property = instance_set_property; g_object_class_install_property( object_class, BASE_PROP_ARGC_ID, g_param_spec_int( BASE_PROP_ARGC, _( "Arguments count" ), _( "The count of command-line arguments" ), 0, 65535, 0, G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, BASE_PROP_ARGV_ID, g_param_spec_boxed( BASE_PROP_ARGV, _( "Arguments" ), _( "The array of command-line arguments" ), G_TYPE_STRV, G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, BASE_PROP_OPTIONS_ID, g_param_spec_pointer( BASE_PROP_OPTIONS, _( "Option entries" ), _( "The array of command-line option definitions" ), G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, BASE_PROP_APPLICATION_NAME_ID, g_param_spec_string( BASE_PROP_APPLICATION_NAME, _( "Application name" ), _( "The name of the application" ), "", G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, BASE_PROP_DESCRIPTION_ID, g_param_spec_string( BASE_PROP_DESCRIPTION, _( "Description" ), _( "A short description to be displayed in the first line of --help output" ), "", G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, BASE_PROP_ICON_NAME_ID, g_param_spec_string( BASE_PROP_ICON_NAME, _( "Icon name" ), _( "The name of the icon of the application" ), "", G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, BASE_PROP_UNIQUE_NAME_ID, g_param_spec_string( BASE_PROP_UNIQUE_NAME, _( "UniqueApp name" ), _( "The Unique name of the application" ), "", G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); g_object_class_install_property( object_class, BASE_PROP_CODE_ID, g_param_spec_int( BASE_PROP_CODE, _( "Return code" ), _( "The return code of the application" ), -127, 127, 0, G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE )); klass->private = g_new0( BaseApplicationClassPrivate, 1 ); klass->manage_options = NULL; klass->init_application = NULL; klass->create_windows = NULL; } static void isession_iface_init( BaseISessionInterface *iface, void *user_data ) { static const gchar *thisfn = "base_application_isession_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); } static void iunique_iface_init( BaseIUniqueInterface *iface, void *user_data ) { static const gchar *thisfn = "base_application_iunique_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->get_application_name = iunique_get_application_name; } static const gchar * iunique_get_application_name( const BaseIUnique *instance ) { g_return_val_if_fail( BASE_IS_IUNIQUE( instance ), NULL ); g_return_val_if_fail( BASE_IS_APPLICATION( instance ), NULL ); return( BASE_APPLICATION( instance )->private->application_name ); } static void instance_init( GTypeInstance *application, gpointer klass ) { static const gchar *thisfn = "base_application_instance_init"; BaseApplication *self; g_return_if_fail( BASE_IS_APPLICATION( application )); g_debug( "%s: application=%p (%s), klass=%p", thisfn, ( void * ) application, G_OBJECT_TYPE_NAME( application ), ( void * ) klass ); self = BASE_APPLICATION( application ); self->private = g_new0( BaseApplicationPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec ) { BaseApplication *self; g_return_if_fail( BASE_IS_APPLICATION( object )); self = BASE_APPLICATION( object ); if( !self->private->dispose_has_run ){ switch( property_id ){ case BASE_PROP_ARGC_ID: g_value_set_int( value, self->private->argc ); break; case BASE_PROP_ARGV_ID: g_value_set_boxed( value, self->private->argv ); break; case BASE_PROP_OPTIONS_ID: g_value_set_pointer( value, self->private->options ); break; case BASE_PROP_APPLICATION_NAME_ID: g_value_set_string( value, self->private->application_name ); break; case BASE_PROP_DESCRIPTION_ID: g_value_set_string( value, self->private->description ); break; case BASE_PROP_ICON_NAME_ID: g_value_set_string( value, self->private->icon_name ); break; case BASE_PROP_UNIQUE_NAME_ID: g_value_set_string( value, self->private->unique_app_name ); break; case BASE_PROP_CODE_ID: g_value_set_int( value, self->private->code ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec ); break; } } } static void instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec ) { BaseApplication *self; g_return_if_fail( BASE_IS_APPLICATION( object )); self = BASE_APPLICATION( object ); if( !self->private->dispose_has_run ){ switch( property_id ){ case BASE_PROP_ARGC_ID: self->private->argc = g_value_get_int( value ); break; case BASE_PROP_ARGV_ID: if( self->private->argv ){ g_boxed_free( G_TYPE_STRV, self->private->argv ); } self->private->argv = g_value_dup_boxed( value ); break; case BASE_PROP_OPTIONS_ID: self->private->options = g_value_get_pointer( value ); break; case BASE_PROP_APPLICATION_NAME_ID: g_free( self->private->application_name ); self->private->application_name = g_value_dup_string( value ); break; case BASE_PROP_DESCRIPTION_ID: g_free( self->private->description ); self->private->description = g_value_dup_string( value ); break; case BASE_PROP_ICON_NAME_ID: g_free( self->private->icon_name ); self->private->icon_name = g_value_dup_string( value ); break; case BASE_PROP_UNIQUE_NAME_ID: g_free( self->private->unique_app_name ); self->private->unique_app_name = g_value_dup_string( value ); break; case BASE_PROP_CODE_ID: self->private->code = g_value_get_int( value ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec ); break; } } } static void instance_dispose( GObject *application ) { static const gchar *thisfn = "base_application_instance_dispose"; BaseApplication *self; g_return_if_fail( BASE_IS_APPLICATION( application )); self = BASE_APPLICATION( application ); if( !self->private->dispose_has_run ){ g_debug( "%s: application=%p (%s)", thisfn, ( void * ) application, G_OBJECT_TYPE_NAME( application )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( application ); } } } static void instance_finalize( GObject *application ) { static const gchar *thisfn = "base_application_instance_finalize"; BaseApplication *self; g_return_if_fail( BASE_IS_APPLICATION( application )); g_debug( "%s: application=%p (%s)", thisfn, ( void * ) application, G_OBJECT_TYPE_NAME( application )); self = BASE_APPLICATION( application ); g_free( self->private->application_name ); g_free( self->private->description ); g_free( self->private->icon_name ); g_free( self->private->unique_app_name ); g_strfreev( self->private->argv ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( application ); } } /** * base_application_run_with_args: * @application: this #BaseApplication -derived instance. * * Starts and runs the application. * Takes care of creating, initializing, and running the main window. * * All steps are implemented as virtual functions which provide some * suitable defaults, and may be overriden by a derived class. * * Returns: an %int code suitable as an exit code for the program. * * Though it is defined as a virtual function itself, it should be very * seldomly needed to override this in a derived class. */ int base_application_run_with_args( BaseApplication *application, int argc, GStrv argv ) { static const gchar *thisfn = "base_application_run_with_args"; BaseApplicationPrivate *priv; g_return_val_if_fail( BASE_IS_APPLICATION( application ), BASE_EXIT_CODE_PROGRAM ); priv = application->private; if( !priv->dispose_has_run ){ g_debug( "%s: application=%p (%s), argc=%d", thisfn, ( void * ) application, G_OBJECT_TYPE_NAME( application ), argc ); priv->argc = argc; priv->argv = g_strdupv( argv ); priv->code = BASE_EXIT_CODE_OK; if( init_i18n( application ) && init_application_name( application ) && init_gtk( application ) && v_manage_options( application ) && init_unique_manager( application ) && init_session_manager( application ) && init_icon_name( application ) && v_init_application( application ) && v_create_windows( application )){ g_debug( "%s: entering gtk_main", thisfn ); gtk_main(); } } return( priv->code ); } /* * i18n initialization * * Returns: %TRUE to continue the execution, %FALSE to terminate the program. * The program exit code will be taken from @code. */ static gboolean init_i18n( BaseApplication *application ) { static const gchar *thisfn = "base_application_init_i18n"; g_debug( "%s: application=%p", thisfn, ( void * ) application ); #ifdef ENABLE_NLS bindtextdomain( GETTEXT_PACKAGE, GNOMELOCALEDIR ); # ifdef HAVE_BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" ); # endif textdomain( GETTEXT_PACKAGE ); #endif return( TRUE ); } /* * From GLib Reference Manual: * Sets a human-readable name for the application. * This name should be localized if possible, and is intended for display to the user. * * This application name is supposed to have been set as a property when * the BaseApplication-derived has been instanciated. */ static gboolean init_application_name( BaseApplication *application ) { static const gchar *thisfn = "base_application_init_application_name"; gchar *name; gboolean ret; g_debug( "%s: application=%p", thisfn, ( void * ) application ); ret = TRUE; /* setup default Gtk+ application name * must have been set at instanciation time by the derived class */ name = base_application_get_application_name( application ); if( name && g_utf8_strlen( name, -1 )){ g_set_application_name( name ); } else { application->private->code = BASE_EXIT_CODE_APPLICATION_NAME; ret = FALSE; } g_free( name ); return( ret ); } /* * pre-gtk initialization */ static gboolean init_gtk( BaseApplication *application ) { static const gchar *thisfn = "base_application_init_gtk"; gboolean ret; char *parameter_string; GError *error; g_debug( "%s: application=%p", thisfn, ( void * ) application ); /* manage command-line arguments */ if( application->private->options ){ parameter_string = g_strdup( g_get_application_name()); error = NULL; ret = gtk_init_with_args( &application->private->argc, ( char *** ) &application->private->argv, parameter_string, application->private->options, GETTEXT_PACKAGE, &error ); if( error ){ g_warning( "%s: %s", thisfn, error->message ); g_error_free( error ); ret = FALSE; application->private->code = BASE_EXIT_CODE_ARGS; } g_free( parameter_string ); } else { ret = gtk_init_check( &application->private->argc, ( char *** ) &application->private->argv ); if( !ret ){ g_warning( "%s", _( "Unable to interpret command-line arguments" )); application->private->code = BASE_EXIT_CODE_ARGS; } } return( ret ); } static gboolean v_manage_options( BaseApplication *application ) { static const gchar *thisfn = "base_application_v_manage_options"; gboolean ret; g_debug( "%s: application=%p", thisfn, ( void * ) application ); ret = TRUE; if( BASE_APPLICATION_GET_CLASS( application )->manage_options ){ ret = BASE_APPLICATION_GET_CLASS( application )->manage_options( application ); } return( ret ); } /* * Initialize BaseIUnique interface for the instance */ static gboolean init_unique_manager( BaseApplication *application ) { static const gchar *thisfn = "base_application_init_unique_manager"; gboolean ret; g_debug( "%s: application=%p", thisfn, ( void * ) application ); ret = base_iunique_init_with_name( BASE_IUNIQUE( application ), application->private->unique_app_name ); if( !ret ){ application->private->code = BASE_EXIT_CODE_UNIQUE_APP; } return( ret ); } /* * Relying on session manager to have a chance to save the modifications * before exiting a session */ static gboolean init_session_manager( BaseApplication *application ) { static const gchar *thisfn = "base_application_init_session_manager"; g_debug( "%s: application=%p", thisfn, ( void * ) application ); base_isession_init( BASE_ISESSION( application )); return( TRUE ); } /* * From GTK+ Reference Manual: * Sets an icon to be used as fallback for windows that haven't had * gtk_window_set_icon_list() called on them from a named themed icon. * * This icon name is supposed to have been set as a property when * the BaseApplication-derived has been instanciated. */ static gboolean init_icon_name( BaseApplication *application ) { static const gchar *thisfn = "base_application_init_icon_name"; g_debug( "%s: application=%p", thisfn, ( void * ) application ); /* setup default application icon */ if( application->private->icon_name && g_utf8_strlen( application->private->icon_name, -1 )){ gtk_window_set_default_icon_name( application->private->icon_name ); } else { g_warning( "%s: no default icon name", thisfn ); } return( TRUE ); } static gboolean v_init_application( BaseApplication *application ) { static const gchar *thisfn = "base_application_v_init_application"; gboolean ret; g_debug( "%s: application=%p", thisfn, ( void * ) application ); ret = TRUE; if( BASE_APPLICATION_GET_CLASS( application )->init_application ){ ret = BASE_APPLICATION_GET_CLASS( application )->init_application( application ); } return( ret ); } static gboolean v_create_windows( BaseApplication *application ) { static const gchar *thisfn = "base_application_v_create_windows"; gboolean ret; g_debug( "%s: application=%p", thisfn, ( void * ) application ); ret = TRUE; if( BASE_APPLICATION_GET_CLASS( application )->create_windows ){ ret = BASE_APPLICATION_GET_CLASS( application )->create_windows( application ); } return( ret ); } /** * base_application_get_application_name: * @application: this #BaseApplication instance. * * Returns: the application name as a newly allocated string which should * be be g_free() by the caller. */ gchar * base_application_get_application_name( const BaseApplication *application ) { gchar *name = NULL; g_return_val_if_fail( BASE_IS_APPLICATION( application ), NULL ); if( !application->private->dispose_has_run ){ name = g_strdup( application->private->application_name ); } return( name ); } /** * base_application_is_willing_to_quit: * @application: this #BaseApplication instance. * * Returns: %TRUE if the application is willing to quit, %FALSE else. * * This function is typically called from the derived application, when * the user has required the termination, in order to let it handle * unsaved modifications. */ gboolean base_application_is_willing_to_quit( const BaseApplication *application ) { g_return_val_if_fail( BASE_IS_APPLICATION( application ), TRUE ); g_return_val_if_fail( BASE_IS_ISESSION( application ), TRUE ); return( base_isession_is_willing_to_quit( BASE_ISESSION( application ))); } nautilus-actions-3.2.3/src/nact/nact-tree-ieditable.c0000644000175100017500000011061212212601376017426 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "base-keysyms.h" #include "nact-application.h" #include "nact-main-window.h" #include "nact-tree-ieditable.h" #include "nact-tree-model.h" #include "nact-tree-view.h" /* private interface data */ struct _NactTreeIEditableInterfacePrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* data attached to the NactTreeView */ typedef struct { NAUpdater *updater; BaseWindow *window; GtkTreeView *treeview; NactTreeModel *model; gulong modified_handler_id; gulong valid_handler_id; guint count_modified; gboolean level_zero_changed; GList *deleted; guint count_deleted; } IEditableData; #define VIEW_DATA_IEDITABLE "view-data-ieditable" static guint st_initializations = 0; /* interface initialization count */ static GType register_type( void ); static void interface_base_init( NactTreeIEditableInterface *klass ); static void interface_base_finalize( NactTreeIEditableInterface *klass ); static gboolean on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, BaseWindow *window ); static void on_label_edited( GtkCellRendererText *renderer, const gchar *path_str, const gchar *text, BaseWindow *window ); static void on_main_selection_changed( BaseWindow *window, GList *selected_items, gpointer user_data ); static void on_object_modified_status_changed( NactTreeIEditable *view, NAObject *object, gboolean new_status, BaseWindow *window ); static void on_object_valid_status_changed( NactTreeIEditable *view, NAObject *object, gboolean new_status, BaseWindow *window ); static void on_tree_view_level_zero_changed( BaseWindow *window, gboolean is_modified, gpointer user_data ); static void on_tree_view_modified_status_changed( BaseWindow *window, gboolean is_modified, gpointer user_data ); static void add_to_deleted_rec( IEditableData *ied, NAObject *object ); static void decrement_counters( NactTreeIEditable *view, IEditableData *ialid, GList *items ); static GtkTreePath *do_insert_before( IEditableData *ied, GList *items, GtkTreePath *insert_path ); static GtkTreePath *do_insert_into( IEditableData *ied, GList *items, GtkTreePath *insert_path ); static void increment_counters( NactTreeIEditable *view, IEditableData *ied, GList *items ); static void check_level_zero_status( NactTreeIEditable *instance ); static gchar *get_items_id_list_str( GList *items_list ); static GtkTreePath *get_selection_first_path( GtkTreeView *treeview ); static gboolean get_modification_status( IEditableData *ied ); static IEditableData *get_instance_data( NactTreeIEditable *view ); static void inline_edition( BaseWindow *window ); GType nact_tree_ieditable_get_type( void ) { static GType iface_type = 0; if( !iface_type ){ iface_type = register_type(); } return( iface_type ); } static GType register_type( void ) { static const gchar *thisfn = "nact_tree_ieditable_register_type"; GType type; static const GTypeInfo info = { sizeof( NactTreeIEditableInterface ), ( GBaseInitFunc ) interface_base_init, ( GBaseFinalizeFunc ) interface_base_finalize, NULL, NULL, NULL, 0, 0, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( G_TYPE_INTERFACE, "NactTreeIEditable", &info, 0 ); g_type_interface_add_prerequisite( type, NACT_TYPE_TREE_VIEW ); return( type ); } static void interface_base_init( NactTreeIEditableInterface *klass ) { static const gchar *thisfn = "nact_tree_ieditable_interface_base_init"; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); klass->private = g_new0( NactTreeIEditableInterfacePrivate, 1 ); } st_initializations += 1; } static void interface_base_finalize( NactTreeIEditableInterface *klass ) { static const gchar *thisfn = "nact_tree_ieditable_interface_base_finalize"; st_initializations -= 1; if( !st_initializations ){ g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); g_free( klass->private ); } } /** * nact_tree_ieditable_initialize: * @instance: the #NactTreeView which implements this interface. * @treeview: the embedded #GtkTreeView tree view. * @window: the #BaseWindow which embeds the @instance. * * Initialize the interface, mainly connecting to signals of interest. */ void nact_tree_ieditable_initialize( NactTreeIEditable *instance, GtkTreeView *treeview, BaseWindow *window ) { static const gchar *thisfn = "nact_tree_ieditable_initialize"; IEditableData *ied; NactApplication *application; GtkTreeViewColumn *column; GList *renderers; g_return_if_fail( NACT_IS_TREE_IEDITABLE( instance )); g_debug( "%s: instance=%p (%s), treeview=%p, window=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) treeview, ( void * ) window ); ied = get_instance_data( instance ); ied->window = window; ied->treeview = treeview; ied->model = NACT_TREE_MODEL( gtk_tree_view_get_model( treeview )); application = NACT_APPLICATION( base_window_get_application( window )); ied->updater = nact_application_get_updater( application ); /* inline label edition with F2 */ base_window_signal_connect( window, G_OBJECT( treeview ), "key-press-event", G_CALLBACK( on_key_pressed_event )); /* label edition: inform the corresponding tab */ column = gtk_tree_view_get_column( treeview, TREE_COLUMN_LABEL ); renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column )); base_window_signal_connect( window, G_OBJECT( renderers->data ), "edited", G_CALLBACK( on_label_edited )); /* monitors status changes to refresh the display */ na_iduplicable_register_consumer( G_OBJECT( instance )); ied->modified_handler_id = base_window_signal_connect( window, G_OBJECT( instance ), IDUPLICABLE_SIGNAL_MODIFIED_CHANGED, G_CALLBACK( on_object_modified_status_changed )); ied->valid_handler_id = base_window_signal_connect( window, G_OBJECT( instance ), IDUPLICABLE_SIGNAL_VALID_CHANGED, G_CALLBACK( on_object_valid_status_changed )); /* monitors the reloading of the tree */ base_window_signal_connect( window, G_OBJECT( window ), TREE_SIGNAL_MODIFIED_STATUS_CHANGED, G_CALLBACK( on_tree_view_modified_status_changed )); /* monitors the level zero of the tree */ base_window_signal_connect( window, G_OBJECT( window ), TREE_SIGNAL_LEVEL_ZERO_CHANGED, G_CALLBACK( on_tree_view_level_zero_changed )); /* monitors the main selection */ base_window_signal_connect( window, G_OBJECT( window ), MAIN_SIGNAL_SELECTION_CHANGED, G_CALLBACK( on_main_selection_changed )); } /** * nact_tree_ieditable_terminate: * @instance: the #NactTreeView which implements this interface. * * Free the data when application quits. */ void nact_tree_ieditable_terminate( NactTreeIEditable *instance ) { static const gchar *thisfn = "nact_tree_ieditable_terminate"; IEditableData *ied; g_return_if_fail( NACT_IS_TREE_IEDITABLE( instance )); g_debug( "%s: instance=%p (%s)", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance )); ied = get_instance_data( instance ); na_object_free_items( ied->deleted ); base_window_signal_disconnect( ied->window, ied->modified_handler_id ); base_window_signal_disconnect( ied->window, ied->valid_handler_id ); g_free( ied ); g_object_set_data( G_OBJECT( instance ), VIEW_DATA_IEDITABLE, NULL ); } static gboolean on_key_pressed_event( GtkWidget *widget, GdkEventKey *event, BaseWindow *window ) { gboolean stop = FALSE; if( event->keyval == NACT_KEY_F2 ){ inline_edition( window ); stop = TRUE; } return( stop ); } /* * path: path of the edited row, as a string * text: new text * * - inform tabs so that they can update their fields * data = object_at_row + new_label */ static void on_label_edited( GtkCellRendererText *renderer, const gchar *path_str, const gchar *text, BaseWindow *window ) { NactTreeView *items_view; IEditableData *ied; NAObject *object; GtkTreePath *path; items_view = NACT_TREE_VIEW( g_object_get_data( G_OBJECT( window ), WINDOW_DATA_TREE_VIEW )); if( nact_tree_view_are_notify_allowed( items_view )){ ied = ( IEditableData * ) g_object_get_data( G_OBJECT( items_view ), VIEW_DATA_IEDITABLE ); path = gtk_tree_path_new_from_string( path_str ); object = nact_tree_model_object_at_path( ied->model, path ); na_object_set_label( object, text ); g_signal_emit_by_name( window, MAIN_SIGNAL_ITEM_UPDATED, object ); } } static void on_main_selection_changed( BaseWindow *window, GList *selected_items, gpointer user_data ) { NAObject *object; gboolean object_editable; NactTreeView *items_view; IEditableData *ied; GtkTreeViewColumn *column; GList *renderers; gboolean editable; g_object_get( window, MAIN_PROP_ITEM, &object, MAIN_PROP_EDITABLE, &object_editable, NULL ); editable = NA_IS_OBJECT( object ) && object_editable; items_view = NACT_TREE_VIEW( g_object_get_data( G_OBJECT( window ), WINDOW_DATA_TREE_VIEW )); ied = ( IEditableData * ) g_object_get_data( G_OBJECT( items_view ), VIEW_DATA_IEDITABLE ); column = gtk_tree_view_get_column( ied->treeview, TREE_COLUMN_LABEL ); renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column )); g_object_set( G_OBJECT( renderers->data ), "editable", editable, "editable-set", TRUE, NULL ); } /* * modification status of an edited object has changed * - refresh the display */ static void on_object_modified_status_changed( NactTreeIEditable *instance, NAObject *object, gboolean is_modified, BaseWindow *window ) { static const gchar *thisfn = "nact_tree_ieditable_on_object_modified_status_changed"; IEditableData *ied; gboolean prev_status, status; g_debug( "%s: instance=%p, object=%p (%s), is_modified=%s, window=%p", thisfn, ( void * ) instance, ( void * ) object, G_OBJECT_TYPE_NAME( object ), is_modified ? "True":"False", ( void * ) window ); ied = ( IEditableData * ) g_object_get_data( G_OBJECT( instance ), VIEW_DATA_IEDITABLE ); prev_status = get_modification_status( ied ); gtk_tree_model_filter_refilter( GTK_TREE_MODEL_FILTER( ied->model )); if( NA_IS_OBJECT_ITEM( object )){ if( is_modified ){ ied->count_modified += 1; } else { ied->count_modified -= 1; } } if( nact_tree_view_are_notify_allowed( NACT_TREE_VIEW( instance ))){ status = get_modification_status( ied ); if( status != prev_status ){ g_signal_emit_by_name( window, TREE_SIGNAL_MODIFIED_STATUS_CHANGED, status ); } } } /* * validity status of the edited object has changed * - refresh the display */ static void on_object_valid_status_changed( NactTreeIEditable *instance, NAObject *object, gboolean new_status, BaseWindow *window ) { static const gchar *thisfn = "nact_tree_ieditable_on_object_valid_status_changed"; IEditableData *ied; g_debug( "%s: instance=%p, new_status=%s, window=%p", thisfn, ( void * ) instance, new_status ? "True":"False", ( void * ) window ); ied = ( IEditableData * ) g_object_get_data( G_OBJECT( instance ), VIEW_DATA_IEDITABLE ); gtk_tree_model_filter_refilter( GTK_TREE_MODEL_FILTER( ied->model )); } /* * order or list of items at level zero of the tree has changed */ static void on_tree_view_level_zero_changed( BaseWindow *window, gboolean is_modified, gpointer user_data ) { NactTreeView *items_view; IEditableData *ied; gboolean prev_status, status; items_view = NACT_TREE_VIEW( g_object_get_data( G_OBJECT( window ), WINDOW_DATA_TREE_VIEW )); ied = get_instance_data( NACT_TREE_IEDITABLE( items_view )); prev_status = get_modification_status( ied ); ied->level_zero_changed = is_modified; if( nact_tree_view_are_notify_allowed( items_view )){ status = get_modification_status( ied ); if( prev_status != status ){ g_signal_emit_by_name( window, TREE_SIGNAL_MODIFIED_STATUS_CHANGED, status ); } } } /* * the tree has been reloaded */ static void on_tree_view_modified_status_changed( BaseWindow *window, gboolean is_modified, gpointer user_data ) { NactTreeView *items_view; IEditableData *ied; if( !is_modified ){ items_view = NACT_TREE_VIEW( g_object_get_data( G_OBJECT( window ), WINDOW_DATA_TREE_VIEW )); ied = get_instance_data( NACT_TREE_IEDITABLE( items_view )); ied->count_modified = 0; ied->deleted = na_object_free_items( ied->deleted ); ied->level_zero_changed = FALSE; } } /** * nact_tree_ieditable_delete: * @instance: this #NactTreeIEditable instance. * @list: list of #NAObject to be deleted. * @ope: whether the objects are actually to be deleted, or just moved * to another path of the tree. * * Deletes the specified list from the underlying tree store. * * If the items are to be actually deleted, then this function takes care * of repositionning a new selection if possible, and refilter the display * model. * Deleted NAObjectItems are added to the 'deleted' list attached to the * view, so that they will be actually deleted from the storage subsystem * on save. * Deleted NAObjectProfiles are not added to the list, because the deletion * will be recorded when saving the action. * * If the items are to be actually moved to another path of the tree, then * neither the 'deleted' list nor the 'count_modified' counter are modified. */ void nact_tree_ieditable_delete( NactTreeIEditable *instance, GList *items, TreeIEditableDeleteOpe ope ) { static const gchar *thisfn = "nact_tree_ieditable_delete"; IEditableData *ied; gboolean prev_status, status; GtkTreePath *path; GList *it; NAObjectItem *parent; g_return_if_fail( NACT_IS_TREE_IEDITABLE( instance )); g_debug( "%s: instance=%p, items=%p (count=%d), ope=%u", thisfn, ( void * ) instance, ( void * ) items, g_list_length( items ), ope ); nact_tree_view_set_notify_allowed( NACT_TREE_VIEW( instance ), FALSE ); ied = get_instance_data( instance ); prev_status = get_modification_status( ied ); decrement_counters( instance, ied, items ); path = NULL; for( it = items ; it ; it = it->next ){ if( path ){ gtk_tree_path_free( path ); } /* check the status of the parent of the deleted object * so potentially update the modification status */ parent = na_object_get_parent( it->data ); path = nact_tree_model_delete( ied->model, NA_OBJECT( it->data )); if( parent ){ na_object_check_status( parent ); } else { check_level_zero_status( instance ); } /* record the deleted item in the 'deleted' list, * incrementing the 'modified' count if the deleted item was not yet modified */ if( ope == TREE_OPE_DELETE ){ add_to_deleted_rec( ied, NA_OBJECT( it->data )); } g_debug( "%s: object=%p (%s, ref_count=%d)", thisfn, ( void * ) it->data, G_OBJECT_TYPE_NAME( it->data ), G_OBJECT( it->data )->ref_count ); } gtk_tree_model_filter_refilter( GTK_TREE_MODEL_FILTER( ied->model )); nact_tree_view_set_notify_allowed( NACT_TREE_VIEW( instance ), TRUE ); if( path ){ if( ope == TREE_OPE_DELETE ){ nact_tree_view_select_row_at_path( NACT_TREE_VIEW( instance ), path ); } gtk_tree_path_free( path ); } status = get_modification_status( ied ); if( status != prev_status ){ g_signal_emit_by_name( G_OBJECT( ied->window ), TREE_SIGNAL_MODIFIED_STATUS_CHANGED, status ); } } /** * add_to_deleted_rec: * @list: list of deleted objects. * @object: the object to be added from the list. * * Recursively adds to the 'deleted' list the NAObjectItem object currently being deleted. * * Increments the 'modified' count with the deleted items which were not modified. * * Only increments the 'deleted' count for items we may have to actually remove * from the backend, i.e. those who have a non-null provider. */ static void add_to_deleted_rec( IEditableData *ied, NAObject *object ) { GList *subitems, *it; if( NA_IS_OBJECT_ITEM( object )){ if( !g_list_find( ied->deleted, object )){ ied->deleted = g_list_prepend( ied->deleted, object ); if( na_object_is_modified( object )){ ied->count_modified -= 1; } if( na_object_get_provider( object )){ ied->count_deleted += 1; } } if( NA_IS_OBJECT_MENU( object )){ subitems = na_object_get_items( object ); for( it = subitems ; it ; it = it->next ){ add_to_deleted_rec( ied, it->data ); } } } } /* * update the total count of elements */ static void decrement_counters( NactTreeIEditable *view, IEditableData *ied, GList *items ) { static const gchar *thisfn = "nact_tree_editable_decrement_counters"; gint menus, actions, profiles; g_debug( "%s: view=%p, ied=%p, items=%p (count=%u)", thisfn, ( void * ) view, ( void * ) ied, ( void * ) items, g_list_length( items )); na_object_count_items( items, &menus, &actions, &profiles ); menus *= -1; actions *= -1; profiles *= -1; g_signal_emit_by_name( G_OBJECT( ied->window ), TREE_SIGNAL_COUNT_CHANGED, FALSE, menus, actions, profiles ); } /** * nact_tree_ieditable_remove_deleted: * @instance: this #NactTreeIEditable *instance. * @messages: a pointer to a #GSList of error messages. * * Actually removes the deleted items from the underlying I/O storage subsystem. * * @messages #GSList is only filled up in case of an error has occured. * If there is no error (nact_tree_ieditable_remove_deleted() returns %TRUE), * then the caller may safely assume that @messages is returned in the * same state that it has been provided. * * Returns: %TRUE if all candidate items have been successfully deleted, * %FALSE else. */ gboolean nact_tree_ieditable_remove_deleted( NactTreeIEditable *instance, GSList **messages ) { static const gchar *thisfn = "nact_tree_ieditable_remove_deleted"; gboolean delete_ok; IEditableData *ied; GList *it; NAObjectItem *item; GList *not_deleted; g_return_val_if_fail( NACT_IS_TREE_IEDITABLE( instance ), TRUE ); delete_ok = TRUE; ied = get_instance_data( instance ); not_deleted = NULL; for( it = ied->deleted ; it ; it = it->next ){ item = NA_OBJECT_ITEM( it->data ); g_debug( "%s: item=%p (%s)", thisfn, ( void * ) item, G_OBJECT_TYPE_NAME( item )); na_object_dump_norec( item ); if( na_updater_delete_item( ied->updater, item, messages ) != NA_IIO_PROVIDER_CODE_OK ){ not_deleted = g_list_prepend( not_deleted, na_object_ref( item )); delete_ok = FALSE; } } ied->deleted = na_object_free_items( ied->deleted ); /* items that we cannot delete are reinserted in the tree view * in the state they were when they were deleted * (i.e. possibly modified) */ if( not_deleted ){ nact_tree_ieditable_insert_items( instance, not_deleted, NULL ); na_object_free_items( not_deleted ); } return( delete_ok ); } /** * nact_tree_ieditable_get_deleted: * @instance: this #NactTreeIEditable *instance. * * Returns: a copy of the 'deleted' list, which should be na_object_free_items() * by the caller. */ GList * nact_tree_ieditable_get_deleted( NactTreeIEditable *instance ) { GList *deleted; IEditableData *ied; g_return_val_if_fail( NACT_IS_TREE_IEDITABLE( instance ), NULL ); ied = get_instance_data( instance ); deleted = na_object_copyref_items( ied->deleted ); return( deleted ); } /** * nact_tree_ieditable_insert_items: * @instance: this #NactTreeIEditable instance. * @items: a list of items to be inserted (e.g. from a paste). * @sibling: the #NAObject besides which the insertion should occurs; * this is mainly used for inserting duplicated items besides each of * original ones; may be %NULL. * * Inserts the provided @items list just before the @sibling object, * or at the current position in the treeview if @sibling is %NULL. * * The provided @items list is supposed to be homogeneous, i.e. referes * to only profiles, or only actions or menus. * * If the @items list contains profiles, they can only be inserted * into an action, or before another profile. * * If new item is a #NAObjectMenu or a #NAObjectAction, it will be inserted * before the current action or menu. * * This function takes care of repositionning a new selection (if possible) * on the lastly inserted item, and to refresh the display. */ void nact_tree_ieditable_insert_items( NactTreeIEditable *instance, GList *items, NAObject *sibling ) { static const gchar *thisfn = "nact_tree_ieditable_insert_items"; IEditableData *ied; GtkTreePath *insert_path; NAObject *object, *parent; g_return_if_fail( NACT_IS_TREE_IEDITABLE( instance )); g_return_if_fail( items ); g_debug( "%s: instance=%p, items=%p (count=%d), sibling=%p", thisfn, ( void * ) instance, ( void * ) items, g_list_length( items ), ( void * ) sibling ); insert_path = NULL; ied = get_instance_data( instance ); if( sibling ){ insert_path = nact_tree_model_object_to_path( ied->model, sibling ); } else { insert_path = get_selection_first_path( ied->treeview ); object = nact_tree_model_object_at_path( ied->model, insert_path ); g_debug( "%s: current object at insertion path is %p", thisfn, ( void * ) object ); /* as a particular case, insert a new profile _into_ current action */ if( NA_IS_OBJECT_ACTION( object ) && NA_IS_OBJECT_PROFILE( items->data )){ nact_tree_ieditable_insert_into( instance, items ); gtk_tree_path_free( insert_path ); return; } /* insert a new NAObjectItem before current NAObjectItem */ if( NA_IS_OBJECT_PROFILE( object ) && NA_IS_OBJECT_ITEM( items->data )){ parent = ( NAObject * ) na_object_get_parent( object ); gtk_tree_path_free( insert_path ); insert_path = nact_tree_model_object_to_path( ied->model, parent ); } } nact_tree_ieditable_insert_at_path( instance, items, insert_path ); gtk_tree_path_free( insert_path ); } /** * nact_tree_ieditable_insert_at_path: * @instance: this #NactTreeIEditable instance. * @items: a list of items to be inserted (e.g. from a paste). * @path: insertion path. * * Inserts the provided @items list in the treeview. * * This function takes care of repositionning a new selection if * possible, and refilter the display model. */ void nact_tree_ieditable_insert_at_path( NactTreeIEditable *instance, GList *items, GtkTreePath *insert_path ) { static const gchar *thisfn = "nact_tree_ieditable_insert_at_path"; IEditableData *ied; GtkTreePath *actual_path; gboolean prev_status, status; NAObjectItem *parent; GList *it; g_return_if_fail( NACT_IS_TREE_IEDITABLE( instance )); g_debug( "%s: instance=%p, items=%p (count=%d)", thisfn, ( void * ) instance, ( void * ) items, g_list_length( items )); nact_tree_view_set_notify_allowed( NACT_TREE_VIEW( instance ), FALSE ); ied = get_instance_data( instance ); prev_status = get_modification_status( ied ); actual_path = do_insert_before( ied, items, insert_path ); parent = na_object_get_parent( items->data ); if( parent ){ na_object_check_status( parent ); } else { for( it = items ; it ; it = it->next ){ na_object_check_status( it->data ); } g_signal_emit_by_name( ied->window, TREE_SIGNAL_LEVEL_ZERO_CHANGED, TRUE ); } /* post insertion */ status = get_modification_status( ied ); if( prev_status != status ){ g_signal_emit_by_name( ied->window, TREE_SIGNAL_MODIFIED_STATUS_CHANGED, status ); } nact_tree_view_set_notify_allowed( NACT_TREE_VIEW( instance ), TRUE ); increment_counters( instance, ied, items ); gtk_tree_model_filter_refilter( GTK_TREE_MODEL_FILTER( ied->model )); nact_tree_view_select_row_at_path( NACT_TREE_VIEW( instance ), actual_path ); gtk_tree_path_free( actual_path ); } /** * nact_tree_ieditable_insert_into: * @instance: this #NactTreeIEditable instance. * @items: a list of items to be inserted (e.g. from a paste). * * Inserts the provided @items list as first children of the current item. * * The provided @items list is supposed to be homogeneous, i.e. referes * to only profiles, or only actions or menus. * * If the @items list contains only profiles, they can only be inserted * into an action, and the profiles will eventually be renumbered. * * If new item is a #NAObjectMenu or a #NAObjectAction, it will be inserted * as first children of the current menu. * * This function takes care of repositionning a new selection as the * last inserted item, and refilter the display model. */ void nact_tree_ieditable_insert_into( NactTreeIEditable *instance, GList *items ) { static const gchar *thisfn = "nact_tree_ieditable_insert_into"; IEditableData *ied; GtkTreePath *insert_path; GtkTreePath *new_path; NAObjectItem *parent; g_return_if_fail( NACT_IS_TREE_IEDITABLE( instance )); g_debug( "%s: instance=%p, items=%p (count=%d)", thisfn, ( void * ) instance, ( void * ) items, g_list_length( items )); ied = get_instance_data( instance ); insert_path = get_selection_first_path( ied->treeview ); new_path = do_insert_into( ied, items, insert_path ); parent = na_object_get_parent( items->data ); na_object_check_status( parent ); /* post insertion */ increment_counters( instance, ied, items ); gtk_tree_model_filter_refilter( GTK_TREE_MODEL_FILTER( ied->model )); nact_tree_view_select_row_at_path( NACT_TREE_VIEW( instance ), new_path ); gtk_tree_path_free( new_path ); gtk_tree_path_free( insert_path ); } /* * inserting a list of objects at path is: * - for each item starting from the end, do * > insert the item at path * > recursively insert item children into the insertion path * * Returns the actual insertion path suitable for the next selection. * This path should be gtk_tree_path_free() by the caller. */ static GtkTreePath * do_insert_before( IEditableData *ied, GList *items, GtkTreePath *asked_path ) { static const gchar *thisfn = "nact_tree_ieditable_do_insert_before"; GList *reversed; GList *it; GtkTreePath *path; GtkTreePath *actual_path; reversed = g_list_reverse( items ); actual_path = NULL; for( it = reversed ; it ; it = it->next ){ if( actual_path ){ path = gtk_tree_path_copy( actual_path ); gtk_tree_path_free( actual_path ); } else { path = gtk_tree_path_copy( asked_path ); } actual_path = nact_tree_model_insert_before( ied->model, NA_OBJECT( it->data ), path ); gtk_tree_path_free( path ); g_debug( "%s: object=%p (%s, ref_count=%d)", thisfn, ( void * ) it->data, G_OBJECT_TYPE_NAME( it->data ), G_OBJECT( it->data )->ref_count ); /* recursively insert subitems */ if( NA_IS_OBJECT_ITEM( it->data )){ path = do_insert_into( ied, na_object_get_items( it->data ), actual_path ); gtk_tree_path_free( path ); } } /* an l-value here is useless, but makes gcc happy */ items = g_list_reverse( reversed ); return( actual_path ); } /* * inserting a list of objects into an object is as: * - inserting the last child into the object * - then inserting other children just before the last insertion path * * Returns the actual insertion path suitable for the next selection. * This path should be gtk_tree_path_free() by the caller. */ static GtkTreePath * do_insert_into( IEditableData *ied, GList *items, GtkTreePath *asked_path ) { GList *copy; GList *last; GtkTreePath *actual_path; GtkTreePath *insertion_path; actual_path = NULL; if( items ){ copy = g_list_copy( items ); last = g_list_last( copy ); copy = g_list_remove_link( copy, last ); /* insert the last child into the wished path * and recursively all its children */ actual_path = nact_tree_model_insert_into( ied->model, NA_OBJECT( last->data ), asked_path ); gtk_tree_view_expand_to_path( ied->treeview, actual_path ); if( NA_IS_OBJECT_ITEM( last->data )){ insertion_path = do_insert_into( ied, na_object_get_items( last->data ), actual_path ); gtk_tree_path_free( insertion_path ); } /* then insert other objects */ if( copy ){ insertion_path = do_insert_before( ied, copy, actual_path ); gtk_tree_path_free( actual_path ); actual_path = insertion_path; g_list_free( copy ); } } return( actual_path ); } /* * we pass here after each insertion operation (apart initial fill) */ static void increment_counters( NactTreeIEditable *view, IEditableData *ied, GList *items ) { static const gchar *thisfn = "nact_tree_ieditable_increment_counters"; gint menus, actions, profiles; g_debug( "%s: view=%p, ied=%p, items=%p (count=%d)", thisfn, ( void * ) view, ( void * ) ied, ( void * ) items, items ? g_list_length( items ) : 0 ); na_object_count_items( items, &menus, &actions, &profiles ); g_signal_emit_by_name( G_OBJECT( ied->window ), TREE_SIGNAL_COUNT_CHANGED, FALSE, menus, actions, profiles ); } /* * nact_tree_ieditable_set_items: * @instance: this #NactTreeIEditable *instance. * @items: a #GList of items to be set in the tree view. * * The provided list of @items will override the items already in the list * which have the same identifier. But: * - menus keep their children * - entering actions fully override existing ones. * * Items which would not been found are just ignored. * Items which are not of the same type are ignored. * * This feature is typically used when importing an item whose identifier * already exists, and the user have chosen to override existing item. * So we should be almost sure that each item actually exists in the view. */ void nact_tree_ieditable_set_items( NactTreeIEditable *instance, GList *items ) { static const gchar *thisfn = "nact_tree_ieditable_set_items"; IEditableData *ied; GList *it; NAObjectItem *new_item, *old_item; gchar *id; GtkTreePath *path, *insert_path; g_return_if_fail( NACT_IS_TREE_IEDITABLE( instance )); g_debug( "%s: instance=%p, items=%p (count=%d)", thisfn, ( void * ) instance, ( void * ) items, g_list_length( items )); ied = get_instance_data( instance ); for( it = items ; it ; it = it->next ){ new_item = NA_OBJECT_ITEM( it->data ); id = na_object_get_id( new_item ); old_item = nact_tree_view_get_item_by_id( NACT_TREE_VIEW( instance ), id ); if( !old_item ){ g_warning( "%s: id=%s: item not found - ignored", thisfn, id ); } else if( G_OBJECT_TYPE( old_item ) != G_OBJECT_TYPE( new_item )){ g_warning( "%s: id=%s: old is a %s while new is a %s - ignored", thisfn, id, G_OBJECT_TYPE_NAME( old_item ), G_OBJECT_TYPE_NAME( new_item )); } else if( NA_IS_OBJECT_MENU( old_item )){ /* hopefully, na_factory_object_copy only copy valuable properties * keeping dynamic variables as parent pointer, provider and provider * data, read-only status - notably children are not impacted by this * copy */ na_factory_object_copy( NA_IFACTORY_OBJECT( old_item ), NA_IFACTORY_OBJECT( new_item )); } else if( NA_IS_OBJECT_ACTION( old_item )){ /* na_factory_object is not a deep copy, which is fine for the menu * but not for the action - it appears more easier to just substitute * the old item with the new one * * only children of the old item are its own profiles, which are to be * replaced with the profiles provided by the new item */ path = nact_tree_model_delete( ied->model, NA_OBJECT( old_item )); insert_path = nact_tree_model_insert_before( ied->model, NA_OBJECT( new_item ), path ); gtk_tree_path_free( path ); gtk_tree_path_free( insert_path ); } else { g_warning( "%s: should not come here!", thisfn ); } g_free( id ); } } /** * nact_tree_ieditable_dump_modified: * @instance: this #NactTreeIEditable *instance. * * Dump informations about modified items. */ void nact_tree_ieditable_dump_modified( const NactTreeIEditable *instance ) { static const gchar *thisfn = "nact_tree_ieditable_dump_modified"; IEditableData *ied; g_return_if_fail( NACT_IS_TREE_IEDITABLE( instance )); ied = get_instance_data(( NactTreeIEditable * ) instance ); g_debug( "%s: count_deleted=%u", thisfn, g_list_length( ied->deleted )); g_debug( "%s: count_modified=%u", thisfn, ied->count_modified ); g_debug( "%s: level_zero_changed=%s", thisfn, ied->level_zero_changed ? "True":"False" ); } /** * nact_tree_ieditable_is_level_zero_modified: * @instance: this #NactTreeIEditable *instance. * * Returns: %TRUE if the level zero must be saved, %FALSE else. */ gboolean nact_tree_ieditable_is_level_zero_modified( const NactTreeIEditable *instance ) { IEditableData *ied; gboolean is_modified; g_return_val_if_fail( NACT_IS_TREE_IEDITABLE( instance ), FALSE ); ied = get_instance_data(( NactTreeIEditable * ) instance ); is_modified = ied->level_zero_changed; return( is_modified ); } static void check_level_zero_status( NactTreeIEditable *instance ) { static const gchar *thisfn = "nact_tree_ieditable_check_level_zero_status"; gboolean status; IEditableData *ied; GList *items; gchar *pivot_str, *view_str; ied = get_instance_data( instance ); items = na_pivot_get_items( NA_PIVOT( ied->updater )); pivot_str = get_items_id_list_str( items ); items = nact_tree_view_get_items( NACT_TREE_VIEW( instance )); view_str = get_items_id_list_str( items ); na_object_free_items( items ); status = ( g_utf8_collate( pivot_str, view_str ) != 0 ); g_debug( "%s: pivot_str='%s', view_str='%s', status=%s", thisfn, pivot_str, view_str, status ? "True":"False" ); g_free( pivot_str ); g_free( view_str ); g_signal_emit_by_name( ied->window, TREE_SIGNAL_LEVEL_ZERO_CHANGED, status ); } static gchar * get_items_id_list_str( GList *items_list ) { GList *it; gchar *id; GSList *slist; gchar *list_str; slist = NULL; for( it = items_list ; it ; it = it->next ){ id = na_object_get_id( it->data ); slist = g_slist_prepend( slist, id ); } slist = g_slist_reverse( slist ); list_str = na_core_utils_slist_join_at_end( slist, ";" ); na_core_utils_slist_free( slist ); return( list_str ); } static GtkTreePath * get_selection_first_path( GtkTreeView *treeview ) { GtkTreeSelection *selection; GList *selected; GtkTreePath *path; path = NULL; selection = gtk_tree_view_get_selection( treeview ); selected = gtk_tree_selection_get_selected_rows( selection, NULL ); if( selected ){ path = gtk_tree_path_copy(( GtkTreePath * ) selected->data ); } else { path = gtk_tree_path_new_from_string( "0" ); } g_list_foreach( selected, ( GFunc ) gtk_tree_path_free, NULL ); g_list_free( selected ); return( path ); } static gboolean get_modification_status( IEditableData *ied ) { static const gchar *thisfn = "nact_tree_ieditable_get_modification_status"; gboolean modified; modified = ( ied->count_modified > 0 || ied->count_deleted > 0 || ied->level_zero_changed ); g_debug( "%s: count_modified=%d, deleted=%d, level_zero_changed=%s, modified=%s", thisfn, ied->count_modified, ied->count_deleted, ied->level_zero_changed ? "True":"False", modified ? "True":"False" ); return( modified ); } static IEditableData * get_instance_data( NactTreeIEditable *view ) { IEditableData *ied; ied = ( IEditableData * ) g_object_get_data( G_OBJECT( view ), VIEW_DATA_IEDITABLE ); if( !ied ){ ied = g_new0( IEditableData, 1 ); g_object_set_data( G_OBJECT( view ), VIEW_DATA_IEDITABLE, ied ); } return( ied ); } /* * triggered by 'F2' key * let the label be edited */ static void inline_edition( BaseWindow *window ) { NactTreeView *items_view; IEditableData *ied; GtkTreeSelection *selection; GList *listrows; GtkTreeModel *model; GtkTreePath *path; GtkTreeViewColumn *column; items_view = NACT_TREE_VIEW( g_object_get_data( G_OBJECT( window ), WINDOW_DATA_TREE_VIEW )); ied = ( IEditableData * ) g_object_get_data( G_OBJECT( items_view ), VIEW_DATA_IEDITABLE ); selection = gtk_tree_view_get_selection( ied->treeview ); listrows = gtk_tree_selection_get_selected_rows( selection, &model ); if( g_list_length( listrows ) == 1 ){ path = ( GtkTreePath * ) listrows->data; column = gtk_tree_view_get_column( ied->treeview, TREE_COLUMN_LABEL ); gtk_tree_view_set_cursor( ied->treeview, path, column, TRUE ); } g_list_foreach( listrows, ( GFunc ) gtk_tree_path_free, NULL ); g_list_free( listrows ); } nautilus-actions-3.2.3/src/nact/base-dialog.c0000644000175100017500000001373712212601376016005 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include "base-dialog.h" /* private class data */ struct _BaseDialogClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _BaseDialogPrivate { gboolean dispose_has_run; }; static BaseWindowClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( BaseDialogClass *klass ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_dispose( GObject *application ); static void instance_finalize( GObject *application ); static int do_run( BaseWindow *window ); static gboolean terminate_dialog( BaseDialog *window, GtkDialog *toplevel, int *code ); static void dialog_cancel( BaseDialog *window ); static void dialog_ok( BaseDialog *window ); GType base_dialog_get_type( void ) { static GType dialog_type = 0; if( !dialog_type ){ dialog_type = register_type(); } return( dialog_type ); } static GType register_type( void ) { static const gchar *thisfn = "base_dialog_register_type"; GType type; static GTypeInfo info = { sizeof( BaseDialogClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( BaseDialog ), 0, ( GInstanceInitFunc ) instance_init }; g_debug( "%s", thisfn ); type = g_type_register_static( BASE_TYPE_WINDOW, "BaseDialog", &info, 0 ); return( type ); } static void class_init( BaseDialogClass *klass ) { static const gchar *thisfn = "base_dialog_class_init"; GObjectClass *object_class; BaseWindowClass *base_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; base_class = BASE_WINDOW_CLASS( klass ); base_class->run = do_run; klass->private = g_new0( BaseDialogClassPrivate, 1 ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "base_dialog_instance_init"; BaseDialog *self; g_return_if_fail( BASE_IS_DIALOG( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = BASE_DIALOG( instance ); self->private = g_new0( BaseDialogPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_dispose( GObject *window ) { static const gchar *thisfn = "base_dialog_instance_dispose"; BaseDialog *self; g_return_if_fail( BASE_IS_DIALOG( window )); self = BASE_DIALOG( window ); if( !self->private->dispose_has_run ){ g_debug( "%s: window=%p (%s)", thisfn, ( void * ) window, G_OBJECT_TYPE_NAME( window )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( window ); } } } static void instance_finalize( GObject *window ) { static const gchar *thisfn = "base_dialog_instance_finalize"; BaseDialog *self; g_return_if_fail( BASE_IS_DIALOG( window )); g_debug( "%s: window=%p (%s)", thisfn, ( void * ) window, G_OBJECT_TYPE_NAME( window )); self = BASE_DIALOG( window ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( window ); } } /* * returns the response ID of the dialog box */ static int do_run( BaseWindow *window ) { static const gchar *thisfn = "base_dialog_do_run"; int code; GtkWindow *toplevel; g_return_val_if_fail( BASE_IS_DIALOG( window ), BASE_EXIT_CODE_PROGRAM ); code = BASE_EXIT_CODE_INIT_WINDOW; if( !BASE_DIALOG( window )->private->dispose_has_run ){ g_debug( "%s: window=%p (%s), starting gtk_dialog_run", thisfn, ( void * ) window, G_OBJECT_TYPE_NAME( window )); toplevel = base_window_get_gtk_toplevel( window ); do { code = gtk_dialog_run( GTK_DIALOG( toplevel )); } while( !terminate_dialog( BASE_DIALOG( window ), GTK_DIALOG( toplevel ), &code )); } return( code ); } /* * returns %TRUE to quit the dialog loop */ static gboolean terminate_dialog( BaseDialog *window, GtkDialog *toplevel, int *code ) { gboolean quit = FALSE; switch( *code ){ case GTK_RESPONSE_NONE: case GTK_RESPONSE_DELETE_EVENT: case GTK_RESPONSE_CLOSE: case GTK_RESPONSE_CANCEL: dialog_cancel( window ); *code = GTK_RESPONSE_CANCEL; quit = TRUE; break; case GTK_RESPONSE_OK: dialog_ok( window ); quit = TRUE; break; } return( quit ); } static void dialog_cancel( BaseDialog *window ) { if( BASE_DIALOG_GET_CLASS( window )->cancel ){ BASE_DIALOG_GET_CLASS( window )->cancel( window ); } } static void dialog_ok( BaseDialog *window ) { if( BASE_DIALOG_GET_CLASS( window )->ok ){ BASE_DIALOG_GET_CLASS( window )->ok( window ); } } nautilus-actions-3.2.3/src/nact/nact-main-window.h0000644000175100017500000002431012212601376017004 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifndef __NACT_MAIN_WINDOW_H__ #define __NACT_MAIN_WINDOW_H__ /** * SECTION: main-window * @title: NactMainWindow * @short_description: The Main Window class definition * @include: nact-main-window.h * * This class is derived from NactWindow and manages the main window. * * It embeds: * - the menubar, * - the toolbar, * - a button bar with sort buttons, * - the hierarchical list of items, * - a notebook which displays the content of the current item, * - a status bar. * * NactApplication NactMainWindow NactTreeView NactTreeModel NactMenubar * | * +-> nact_main_window_new() * | | * | +-> NactMainWindow::instance_contructed() * | | | * | | +-> connect to base-init-gtk [window] * | | | base-init-window [window] * | | | base-show-widgets [window] * | | | pivot-items-changed [updater] * | | | tab-item-updated [window] * | | | * | | +-> nact_menubar_new() * | | | | * | | | +-> NactMenubar::nact_menubar_new() * | | | | | * | | | | +-> nact_sort_buttons_new() * | | | | +-> connect to base-init-window [window] * | | | | | * | | | | <- * | | | <- * | | | * | | +-> nact_clipboard_new() * | | | * | | +-> initialize each notebook tab * | | | * | | | NactMainWindow has connected to "base-init-window" signal _before_ * | | | other widgets have been created or initialized. We so are sure that * | | | the NactMainWindow handlers will be called first. * | | <- * | | * | +-> base_window_init() * | | | * | | +-> setup builder * | | +-> load gtk toplevel * | | +-> emit signal base-initialize-gtk * | | | * | | | [H]-> NactMainWindow::on_base_initialize_gtk() * | | | | * | | | +-> nact_tree_view_new() * | | | | | * | | | | +-> NactTreeView::instance_contructed() * | | | | | | * | | | | | +-> connect to base-init-window [window] * | | | | | | base-show-widgets [window] * | | | | | | * | | | | | +-> initialize_gtk() * | | | | | | | * | | | | | | +-> nact_tree_model_new() * | | | | | | | | * | | | | | | | +-> NactTreeModel::nact_tree_model_new() * | | | | | | | | * | | | | | | | <- * | | | | | | <- * | | | | | <- * | | | | <- * | | | | * | | | +-> nact_main_statusbar_initialize_load_toplevel() * | | | * | | | [H]-> NactIxxxxxxTab::on_base_initialize_gtk() * | | | * | | +-> emit signal base-initialize-window * | | | * | | | [H]-> NactMainWindow::on_base_initialize_base_window() * | | | | * | | | +-> connect to delete-event * | | | | base-quit-requested * | | | | * | | | +-> connect to tree-selection-changed * | | | | tree-modified-status-changed * | | | | * | | | | Because NactMainWindow was the first class to connect to * | | | | "base-initialize-window" signal, then this handler has been * | | | | the first to be called. And so the "tree-selection-changed" * | | | | signal handler will also the first to be called, and we can * | | | | safely rely on that. * | | | <- * | | | * | | | [H]-> NactIxxxxxxTab::on_base_initialize_window() * | | | * | | | [H]-> NactTreeView::on_base_initialize_view() * | | | | * | | | +-> monitors the selection in the tree * | | | | in order to be able to send the "tree-selection-changed" signal * | | | | * | | | +- nact_tree_ieditable_initialize() * | | | | * | | | <- * | | | * | | +-> emit signal base-show-widgets * | | | * | | | [H]-> NactMainWindow::on_base_show_widgets() * | | | | * | | | +-> load items from pivot * | | | * | | | [H]-> NactIxxxxxxTab::on_base_show_widgets() * | | | * | | +-> gtk_widget_show_all() * | | | * | | <- * | <- * | * +-> gtk_main() * | * [X] End of initialization process * * Some signals and their usages * ============================= * MAIN_SIGNAL_SELECTION_CHANGED * The signal is sent by the tree view on the BaseWindow each time the * selection has changed. By construction (cf. initialization process), * the main window handler is the first to be triggered by this signal: * it sets the 'current' main window properties to reflect this new * selection. * Args: * - the list of selected items, may be NULL. * Consumers: * - all tabs should take advantage of this signal to enable/disable * their page, setup the content of their widgets, and so on. * - the menubar updates its indicator depending of the current selection * * TAB_UPDATABLE_SIGNAL_ITEM_UPDATED * The signal is sent on the BaseWindow each time a widget is updated; the widget * callback must setup the edited object with the new value, and then should call * this signal with a flag indicating if the tree display should be refreshed now. * Args: * - an OR-ed list of modified flags, or 0 if not relevant * Consumers are: * - the main window checks the modification/validity status of the object * - if the 'refresh tree display' flag is set, then the tree model refreshes * the current row with current label and icon, then flags current row as * modified * * MAIN_SIGNAL_ITEM_UPDATED * The signal is sent on the BaseWindow after a data has been modified elsewhere * that in a tab: either the label has been edited inline in the tree view, * or a new i/o provider has been identified. The relevant NAObject has * been updated accordingly. * Args: * - an OR-ed list of modified flags, or 0 if not relevant * Consumers are: * - IActionTab and ICommandTab should update their label widgets * - IPropertiesTab updates its provider label * * MAIN_SIGNAL_CONTEXT_MENU * Opens the specified context menu. * * TREE_SIGNAL_FOCUS_IN * TREE_SIGNAL_FOCUS_OUT * TREE_SIGNAL_COUNT_CHANGED * TREE_SIGNAL_LEVEL_ZERO_CHANGED * TREE_SIGNAL_MODIFIED_STATUS_CHANGED * * TAB_UPDATABLE_SIGNAL_PROVIDER_CHANGED * * Object */ #include "nact-application.h" #include "nact-clipboard.h" #include "nact-tree-view.h" G_BEGIN_DECLS #define NACT_TYPE_MAIN_WINDOW ( nact_main_window_get_type()) #define NACT_MAIN_WINDOW( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NACT_TYPE_MAIN_WINDOW, NactMainWindow )) #define NACT_MAIN_WINDOW_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NACT_TYPE_MAIN_WINDOW, NactMainWindowClass )) #define NACT_IS_MAIN_WINDOW( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NACT_TYPE_MAIN_WINDOW )) #define NACT_IS_MAIN_WINDOW_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_TYPE_MAIN_WINDOW )) #define NACT_MAIN_WINDOW_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_TYPE_MAIN_WINDOW, NactMainWindowClass )) typedef struct _NactMainWindowPrivate NactMainWindowPrivate; typedef struct { /*< private >*/ BaseWindow parent; NactMainWindowPrivate *private; } NactMainWindow; typedef struct _NactMainWindowClassPrivate NactMainWindowClassPrivate; typedef struct { /*< private >*/ BaseWindowClass parent; NactMainWindowClassPrivate *private; } NactMainWindowClass; /** * Signals emitted by the main window */ #define MAIN_SIGNAL_ITEM_UPDATED "main-item-updated" #define MAIN_SIGNAL_SELECTION_CHANGED "main-selection-changed" #define MAIN_SIGNAL_CONTEXT_MENU "main-signal-open-popup" /** * The data which, when modified, should be redisplayed asap. * This is used by MAIN_SIGNAL_ITEM_UPDATED and TAB_UPDATABLE_SIGNAL_ITEM_UPDATED * signals. */ enum { MAIN_DATA_LABEL = 1<<0, MAIN_DATA_ICON = 1<<1, MAIN_DATA_PROVIDER = 1<<2, }; /** * Properties set against the main window */ #define MAIN_PROP_ITEM "main-current-item" #define MAIN_PROP_PROFILE "main-current-profile" #define MAIN_PROP_CONTEXT "main-current-context" #define MAIN_PROP_EDITABLE "main-editable" #define MAIN_PROP_REASON "main-reason" GType nact_main_window_get_type( void ); NactMainWindow *nact_main_window_new ( const NactApplication *application ); NactClipboard *nact_main_window_get_clipboard ( const NactMainWindow *window ); NactTreeView *nact_main_window_get_items_view( const NactMainWindow *window ); void nact_main_window_reload ( NactMainWindow *window ); void nact_main_window_block_reload( NactMainWindow *window ); gboolean nact_main_window_quit ( NactMainWindow *window ); G_END_DECLS #endif /* __NACT_MAIN_WINDOW_H__ */ nautilus-actions-3.2.3/src/nact/nact-menubar-tools.c0000644000175100017500000000460012212601376017335 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include "nact-assistant-export.h" #include "nact-assistant-import.h" #include "nact-menubar-priv.h" /** * nact_menubar_tools_on_update_sensitivities: * @bar: this #NactMenubar object. * * Update sensitivities on the Tools menu. */ void nact_menubar_tools_on_update_sensitivities( const NactMenubar *bar ) { /* import item enabled if at least one writable provider */ nact_menubar_enable_item( bar, "ImportItem", bar->private->has_writable_providers ); /* export item enabled if IActionsList store contains actions */ nact_menubar_enable_item( bar, "ExportItem", bar->private->have_exportables ); } /** * nact_menubar_tools_on_import: * @action: the #GtkAction of the item. * @window: the #BaseWindow main application window. * * Triggers the "Tools/Import assitant" item. */ void nact_menubar_tools_on_import( GtkAction *action, BaseWindow *window ) { nact_assistant_import_run( BASE_WINDOW( window )); } /** * nact_menubar_tools_on_export: * @action: the #GtkAction of the item. * @window: the #BaseWindow main application window. * * Triggers the "Tools/Export assistant" item. */ void nact_menubar_tools_on_export( GtkAction *action, BaseWindow *window ) { nact_assistant_export_run( BASE_WINDOW( window )); } nautilus-actions-3.2.3/src/nact/nautilus-actions-config-tool.ui0000644000175100017500000076176712213715015021563 00000000000000 False 5 End of session True nautilus-actions dialog True True False question User session is ending, but some modifications are still pending. <b>You want to save your modifications now, don't you ?</b> True True False 2 True False center _Save and quit True True True ImageLogoutSave True False False 0 _Quit without saving True True True ImageLogoutQuit True False False 1 gtk-cancel True True True True False False 2 False True end 0 SaveQuitButton QuitNoSaveButton CancelQuitButton True False gtk-find True False gtk-find True False gtk-quit True False gtk-save True False gtk-help True False gtk-find True False gtk-find True False gtk-find True False gtk-find False dialog True False 12 6 True False 6 True False gtk-help False False 0 True False 0 <span size="larger"><b>Parameter Legend</b></span> True True True 1 False False 0 True False False False 1 True False 22 2 2 6 True False 1 0 <b>%b</b> : True GTK_SHRINK | GTK_FILL True False 1 0 <b>%B</b> : True 1 2 GTK_SHRINK | GTK_FILL True False 1 0 <b>%c</b> : True 2 3 GTK_SHRINK | GTK_FILL True False 1 0 <b>%d</b> : True 3 4 GTK_SHRINK | GTK_FILL True False 1 0 <b>%D</b> : True 4 5 GTK_SHRINK | GTK_FILL True False 1 0 <b>%p</b> : True 13 14 GTK_SHRINK | GTK_FILL True False 1 0 <b>%s</b> : True 14 15 GTK_SHRINK | GTK_FILL True False 1 0 <b>%u</b> : True 15 16 GTK_SHRINK | GTK_FILL True False 1 0 <b>%U</b> : True 16 17 GTK_SHRINK | GTK_FILL True False 1 0 <b>%%</b> : True 21 22 GTK_SHRINK | GTK_FILL True False 0 0 (first) basename. 1 2 GTK_FILL True False 0 0 space-separated list of the basenames of the selected file(s)/folder(s). 1 2 1 2 GTK_FILL True False 0 0 count of selected item(s). 1 2 2 3 GTK_FILL True False 0 0 (first) base directory. 1 2 3 4 GTK_FILL True False 0 0 space-separated list of the base directories of the selected file(s)/folder(s). 1 2 4 5 GTK_FILL True False 0 0 port number of the (first) selected URI. 1 2 13 14 GTK_FILL True False 0 0 scheme of the (first) selected URI. 1 2 14 15 GTK_FILL True False 0 0 (first) URI. 1 2 15 16 GTK_FILL True False 0 0 space-separated list of the URIs of the selected file(s)/folder(s). 1 2 16 17 GTK_FILL True False 0 0 a percent sign. 1 2 21 22 GTK_FILL True False 1 <b>%f</b> : True 5 6 True False 0 (first) filename. 1 2 5 6 True False 1 <b>%F</b> : True 6 7 True False 0 space-separated list of the filenames of the selected file(s)/folder(s). 1 2 6 7 True False 1 <b>%h</b> : True 7 8 True False 0 hostname of the (first) selected URI. 1 2 7 8 True False 1 <b>%n</b> : True 10 11 True False 0 username of the (first) selected URI. 1 2 10 11 True False 0 (first) basename without the extension. 1 2 17 18 True False 0 space-separated list of the basenames without the extension. 1 2 18 19 True False 0 (first) extension. 1 2 19 20 True False 0 space-separated list of the extensions of the selected file(s)/folder(s). 1 2 20 21 True False 1 <b>%w</b> : True 17 18 True False 1 <b>%W</b> : True 18 19 True False 1 <b>%x</b> : True 19 20 True False 1 <b>%X</b> : True 20 21 True False 1 <b>%m</b> : True 8 9 True False 1 <b>%M</b> : True 9 10 True False 0 (first) mimetype. 1 2 8 9 True False 0 space-separated list of the mimetypes of the selected file(s)/folder(s). 1 2 9 10 True False 1 0 <b>%o</b> : True 11 12 GTK_SHRINK | GTK_FILL True False 1 0 <b>%O</b> : True 12 13 GTK_SHRINK | GTK_FILL True False 0 0 no-op operator which forces a singular form of execution. 1 2 11 12 GTK_FILL True False 0 0 no-op operator which forces a plural form of execution. 1 2 12 13 GTK_FILL False False 4 2 True False gtk-find False True False True False False True 0 True False True False True 1 True False True True True False True False True False 0 4 4 Items _list : True False True 0 True True True Sort the list in descending alphabetical order. True False gtk-go-down 1 False True end 1 True True True Do not sort the list, letting you manually reorder the items. True False gtk-index 1 False True end 2 True True True Sort the list in ascending alphabetical order. True False gtk-go-up 1 False True end 3 False True 0 True True in True True False True True True 1 False False True True True True False 0 0 True False 6 10 True False 0 in True False 0 0 6 6 12 6 True False 10 True False 3 2 6 Display item in _selection context menu True True False When checked, the item will be candidate to be displayed in the file manager context menu, with a non-empty selection. True 0.5 True 1 2 True True The label of the item in the file manager context menus. 1 2 2 3 True False 1 _Context label : True ActionMenuLabelEntry 2 3 GTK_FILL Display item in _location context menu True True False When checked, the item will be candidate to be displayed in the file manager context menu when the selection is empty. In this case, the defined conditions will be applied to the current displayed folder. True 0.5 True 1 2 1 2 True True 0 True False 3 2 6 Display item in the _toolbar True True False When checked, the item will be candidate to be displayed in the file manager toolbar. In this case, the defined conditions will be applied to the current folder, and do not depend of the possible current selection. True 0.5 True 1 2 Use s_ame label for icon in the toolbar True True False When checked, the label displayed in the toolbar will be the same that the one displayed in the context menus. True 0.5 True 1 2 1 2 True True The label displayed in the file manager toolbar. 1 2 2 3 True False 1 T_oolbar label : True ActionToolbarLabelEntry 2 3 GTK_FILL True True 2 True False 2 2 6 3 True False 1 Toolti_p : True ActionTooltipEntry GTK_FILL True False 1 _Icon : True 1 2 GTK_FILL True True The tooltip displayed in the file manager user interface. 1 2 True False The icon displayed in the file manager user interface. 6 True False 0 in False True False 2 2 gtk-stock-blank 2 False True 0 True True The name of a themed icon or the filename of an image. True True 1 _Browse... True True True ImageIconBrowse True False True 2 1 2 1 2 True True 3 True False 5 <b>Nautilus Item</b> True False False 0 True False This tab lets you determine the main characteristics of the currently selected item. _Action True False True False 0 0 True False 6 10 True False 0 in True False 0 0 6 6 12 6 True False Just a label to remind you why you have created this profile. 6 True False 1 _Label : True ProfileLabelEntry False True 0 True True True True 1 True False 5 <b>Profile</b> True False False 0 True False 0 in True False 0 0 6 6 12 6 True False 4 3 6 3 True False 1 _Path : True CommandPathEntry GTK_FILL True False 1 P_arameters : True CommandParametersEntry 1 2 GTK_FILL True True The path of the command. If this is not an absolute path, then the PATH environment variable at execution time will be considered. 1 2 GTK_EXPAND | GTK_SHRINK | GTK_FILL _Browse... True True True ImagePathBrowse True 2 3 True True The parameters of the command. 1 2 1 2 GTK_EXPAND | GTK_SHRINK | GTK_FILL Le_gend True True True ImageParametersLegend True 2 3 1 2 True False 1 _Working directory : True 3 4 GTK_FILL GTK_FILL True True The default working directory the command should be started in. 1 2 3 4 GTK_EXPAND | GTK_SHRINK | GTK_FILL B_rowse... True True True ImageWorkingDirectoryBrowse True 2 3 3 4 True True True True True False 0 0 True False 0 True True True False Example 1 2 2 3 GTK_EXPAND | GTK_SHRINK | GTK_FILL GTK_SHRINK True False 5 <b>Command</b> True False False 1 1 True False This tab lets you choose the command to be executed, along with its parameters. Defining several profiles lets you have several commands, each applying with a different set of conditions. _Command True 1 False True False 0 0 True False 6 10 True False 0 in True False 0 0 6 6 12 6 True False 4 2 6 _Normal True True False The command will be started as a standard graphical user interface. True 0.5 True True 1 2 GTK_FILL In a _terminal True True False The command will be started in the preferred terminal of the graphical environment. True 0.5 True ExecutionModeNormal 1 2 1 2 GTK_FILL _Embedded True True False This option makes use of a special feature of the file manager, which would allow a terminal to be ran inside of it. An acceptable fallback is running in the standard terminal. True 0.5 True ExecutionModeNormal 1 2 2 3 GTK_FILL _Display output True True False The command will be run in a terminal. The terminal will be closed at the end of the execution; standard error and output streams will be displayed. An acceptable fallback is running in the standard terminal. True 0.5 True ExecutionModeNormal 1 2 3 4 GTK_FILL True False GTK_FILL True False 5 <b>Execution mode</b> True False False 0 True False Note: this is not yet implemented in Nautilus-Actions. 0 in True False 0 0 6 6 12 6 True False 2 2 6 3 _Startup notify True True False When checked, it is known that the run command will send a "remove" message to the desktop environment. See the Startup Notification Protocol Specification for more details. Only relevant when chosen execution mode is Normal. True 0.5 True 1 2 True False 1 Startup Window Manager _class : True 1 2 GTK_FILL True True When specified, this should be the name of a WM class of at least one window of the run command. See the Startup Notification Protocol Specification for more details. Only relevant when chosen execution mode is Normal. 1 2 1 2 True False 5 <b>Startup mode</b> True False False 1 True False Note: this is not yet implemented in Nautilus-Actions. 0 in True False 0 0 6 6 12 6 True False 6 True False 1 Execute as _user : True False True 0 True True Enter here the user the command should be ran as. The user may be defined by his numeric UID or his login name. Leave the field empty to run the command as the current user. True True 1 True False 5 <b>Execute as user</b> True False False 2 2 True False This advanced tab lets you precisely define how your command will be executed. E_xecution True 2 False True False 6 10 True False 0 in True False 0 6 6 12 6 True False 10 True False 0 The current item will appear if the basename of each element of the selection matches one filter of the 'Must match one of' column, while not matching any of the filters of the 'Must not match any of' column. True False True 0 True False 6 True True This list lets you determine for which basenames the currently selected item will be displayed in the Nautilus context menu. Basenames may use '*' and '?' wildcards. Basenames may be negated to specify for which basenames your item must not appear. in True True False False True True 0 True False 6 True True True Click to add a new basename filter. True False gtk-add False False 0 True True True Click to remove the current basename filter. True False gtk-remove False False 1 False False 1 True True 1 Match _case True True False Click to define the above basename filters as case sensitive. True 0 True True False True 2 True False 5 <b>Basenames conditions</b> True True True 0 3 True False This tab lets you determine for which basenames the currently selected item will be displayed in the Nautilus context menu. Basenames may be negated to specify for which basenames your item must not appear. _Basenames True 3 False True False 6 10 True False 0 in True False 0 6 6 12 6 True False 10 True False 0 The current item will appear if the mimetype of each element of the selection matches one filter of the 'Must match one of' column, while not matching any of the filters of the 'Must not match any of' column. True False True 0 True False 6 True True This list lets you determine for which mimetypes the currently selected item will be displayed in the Nautilus context menu. Mimetypes may be specified as '*', '*/*', 'group/*' or 'group/subgroup'. Mimetypes may be negated to specify for which type of objects your item must not appear. in True True True True 0 True False 6 True True True Click to add a new mimetype filter. True False gtk-add False False 0 True True True Click to remove the current mimetype filter. True False gtk-remove False False 1 False False 1 True True 1 True False 5 <b>Mimetypes conditions</b> True True True 0 4 True False This tab lets you determine for which mimetypes the currently selected item will be displayed in the Nautilus context menu. Mimetypes may be specified as '*', '/*', 'group/*' or 'group/subgroup'. Mimetypes may be negated to specify for which type of objects your item must not appear. _Mimetypes True 4 False True False 6 10 True False 0 in True False 0 6 6 12 6 True False 10 True False 0 The current item will appear if the location of each element of the selection is one or inside one of the paths of the 'Must match one of' column, while not being one or inside one of the 'Must not match any of' column. True False True 0 True False 6 True True This list lets you determine where (in which folders) the currently selected files must be found in order for the item to be displayed in the Nautilus context menu. Folders may use '*' or '?' wildcards. Folder filters may be negated to specify for which folders your item must not appear. in True True True True 0 True False 12 True False 6 True True True Click to add a new folder filter. True False gtk-add False False 0 _Browse... True True True Click to browse the filesystem in order to select a new folder filter. FolderBrowseImage True False True 1 False False 0 True True True Click to remove the current folder filter. True False gtk-remove False False 1 False False 1 True True 1 True False 5 <b>Folders conditions</b> True True True 0 5 True False This tab lets you determine where (in which folders) the currently selected files must be found in order for the item to be displayed in the Nautilus context menu. Folder filters may be negated to specify for which folders your item must not appear. _Folders True 5 False True False 6 10 True False 0 in True False 0 6 6 12 6 True False 10 True False 0 The current item will appear if the scheme of each element of the selection matches one of the 'Must match one of' column, while not matching any of the 'Must not match any of' column. True False True 0 True False 6 True True This list lets you determine which schemes the currently selected files must satisfy in order for the item to be displayed in the Nautilus context menu. Filters may be negated to specify for which schemes your item must not appear. in True True False True False True True 0 True False 12 True False 6 True True True Click to add a new scheme filter. True False gtk-add False False 0 De_faults... True True True Click to select a new scheme filter among default schemes. SchemeBrowseImage True False True 1 False False 0 True True True Click to remove the current scheme filter. True False gtk-remove False False 1 False False 1 True True 1 True False 5 <b>Schemes conditions</b> True True True 0 6 True False This tab lets you determine which schemes the currently selected files must satisfy in order for the item to be displayed in the Nautilus context menu. Filters may be negated to specify for which schemes your item must not appear. _Schemes True 6 False True False 6 10 True False 0 in True False 0 6 6 12 6 True False 10 True False 0 The current item will appear if each element of the selection matches all capabilities of the 'Must match all of' column, while not matching any capability of the 'Must not match any of' column. True False True 0 True False 6 True True This list lets you determine which capabilities the currently selected files must satisfy in order for the item to be displayed in the Nautilus context menu. Capabilities may be negated to specify for which capabilities your item must not appear. in True True False True False True True 0 True False 6 True True True Click to add a new capability filter. True False gtk-add False True 0 True True True Click to remove the current capability. True False gtk-remove False True 1 False True 1 True True 1 True False 5 <b>Capabilities conditions</b> True True True 0 7 True False This tab lets you determine which capabilities the currently selected files must satisfy in order for the item to be displayed in the Nautilus context menu. Filters may be negated to specify for which capabilities your item must not appear. Ca_pabilities True 7 False True False 0 True False 6 10 True False 0 in True False 0 0 6 6 12 6 True False This is an advanced condition based on the count of the current selection. If the current selection does not match this condition, then the item will not be displayed in the file manager context menus or toolbar. 6 True False 1 _Count : True False True 0 True False False True 2 True True 5 False True 3 True False True True 4 True False 5 <b>Appears if selection contains</b> True False False 0 True False 0 in True False 6 6 12 6 True False This is an advanced condition based on the running desktop environment. First choose on the left if the item depends of a particular desktop environment, then select on the right the adequate desktop environment. 3 True False 0 Item may appear depending of the desktop environment. False True 1 True False 6 True False _Always appears True True False True 0.5 True True False True 0 _Only appears in selected environments True True False True 0.5 True ShowAlwaysButton False True 1 _Never appears in selected environments True True False True 0.5 True ShowAlwaysButton False True 2 False False 0 True True in True True False True False False True True 1 True True 2 True False 5 <b>Desktop environment</b> True True True 1 True False 0 in True False 0 0 6 6 12 6 True False 4 3 6 3 True False 1 Appears if the file is e_xecutable : True True True This is an advanced condition based on the presence of an executable file on the file system. This may be used for example to test for a prerequisite package. 1 2 Bro_wse... True True True ImageTryExecBrowse True 2 3 True False 1 Appears if the name is _registered on D-Bus : True 1 2 True True This is an advanced condition based on the presence of a particular service on the D-Bus system. This may be used for example for testing that a prerequisite service is currently available. 1 2 1 2 True False 1 Appears if the command outputs "_true" : True 2 3 True True This is an advanced condition based on a runtime result. Enter here a command which is able to display the exact "true" string on its standard output. This may be used for example for testing a complex condition. 1 2 2 3 True False 1 Appears if the _binary is running : True 3 4 True True This is an advanced condition based on the presence of a running binary. Note that only the basename of the binary is checked, not its dirname nor its parameters. This may be used for example for testing the presence of a prerequisite daemon. 1 2 3 4 Brow_se... True True True ImageRunningBrowse True 2 3 3 4 True False 5 <b>Execution environment</b> True False False 2 8 True False This tab lets you determine some advanced conditions the currently selected files must satisfy in order for the item to be displayed in the file manager context menu. _Environment True 8 False True False 0 0 True False 6 10 True False 0 in True False 0 6 6 12 6 True False 3 2 6 3 True False 1 0 _Description : True 1 2 GTK_FILL True True Enter here a free text which may be used (e.g. in a Web service or in a search tool) to describe your item. in True True 1 2 1 2 E_nabled True True False Check the box to enable this item. If unchecked, then the item will never appear in the file manager context menus or toolbar. True 0.5 True 1 2 True False 1 Suggested _shortcut : True 2 3 GTK_FILL True False None True True True Enter here the keyboard touch combination you suggest as a shortcut to your action. Note: this is not yet implemented in Nautilus-Actions. False True 0 1 2 2 3 True False 5 <b>Action editable properties</b> True True True 0 True False 0 in True False 0 0 6 6 12 6 True False 3 2 6 6 True False 0 1 2 1 2 GTK_FILL True False 1 Id. : 1 2 GTK_FILL True False 1 I/O provider : 2 3 GTK_FILL True False 0 1 2 2 3 Read-only item True True False This box is checked if the item cannot be edited. There may be multiple reasons for why an item cannot be edited. See your User's Manual. False 0.5 True 1 2 True False 5 <b>Read-only properties</b> True False False 1 9 True False This tab lets you edit some miscellaneous properties, and access some non-modifiable information. P_roperties True 9 False True True True True 0 True True 2 True False 2 True False 0 in False True False gnome-stock-blank 1 False True 4 2 False True 3 nautilus-actions-3.2.3/src/nact/nact-export-ask.c0000644000175100017500000003570312212601376016653 00000000000000/* * Nautilus-Actions * A Nautilus extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2013 Pierre Wieser and others (see AUTHORS) * * Nautilus-Actions is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Nautilus-Actions 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 * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Nautilus-Actions; see the file COPYING. If not, see * . * * Authors: * Frederic Ruaudel * Rodrigo Moya * Pierre Wieser * ... and many others (see AUTHORS) */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "nact-application.h" #include "nact-export-ask.h" #include "base-gtk-utils.h" /* private class data */ struct _NactExportAskClassPrivate { void *empty; /* so that gcc -pedantic is happy */ }; /* private instance data */ struct _NactExportAskPrivate { gboolean dispose_has_run; BaseWindow *parent; gboolean preferences_locked; NAObjectItem *item; gchar *format; gboolean format_mandatory; gboolean keep_last_choice; gboolean keep_last_choice_mandatory; }; static const gchar *st_xmlui_filename = PKGUIDIR "/nact-assistant-export.ui"; static const gchar *st_toplevel_name = "ExportAskDialog"; static const gchar *st_wsp_name = NA_IPREFS_EXPORT_ASK_USER_WSP; static BaseDialogClass *st_parent_class = NULL; static GType register_type( void ); static void class_init( NactExportAskClass *klass ); static void ioptions_list_iface_init( NAIOptionsListInterface *iface, void *user_data ); static GList *ioptions_list_get_formats( const NAIOptionsList *instance, GtkWidget *container ); static void ioptions_list_free_formats( const NAIOptionsList *instance, GtkWidget *container, GList *formats ); static void instance_init( GTypeInstance *instance, gpointer klass ); static void instance_constructed( GObject *dialog ); static void instance_dispose( GObject *dialog ); static void instance_finalize( GObject *dialog ); static void on_base_initialize_gtk( NactExportAsk *editor, GtkDialog *toplevel, gpointer user_data ); static void on_base_initialize_window( NactExportAsk *editor, gpointer user_data ); static void keep_choice_on_toggled( GtkToggleButton *button, NactExportAsk *editor ); static void on_cancel_clicked( GtkButton *button, NactExportAsk *editor ); static void on_ok_clicked( GtkButton *button, NactExportAsk *editor ); static gchar *get_export_format( NactExportAsk *editor ); GType nact_export_ask_get_type( void ) { static GType dialog_type = 0; if( !dialog_type ){ dialog_type = register_type(); } return( dialog_type ); } static GType register_type( void ) { static const gchar *thisfn = "nact_export_ask_register_type"; GType type; static GTypeInfo info = { sizeof( NactExportAskClass ), ( GBaseInitFunc ) NULL, ( GBaseFinalizeFunc ) NULL, ( GClassInitFunc ) class_init, NULL, NULL, sizeof( NactExportAsk ), 0, ( GInstanceInitFunc ) instance_init }; static const GInterfaceInfo ioptions_list_iface_info = { ( GInterfaceInitFunc ) ioptions_list_iface_init, NULL, NULL }; g_debug( "%s", thisfn ); type = g_type_register_static( BASE_TYPE_DIALOG, "NactExportAsk", &info, 0 ); g_type_add_interface_static( type, NA_TYPE_IOPTIONS_LIST, &ioptions_list_iface_info ); return( type ); } static void class_init( NactExportAskClass *klass ) { static const gchar *thisfn = "nact_export_ask_class_init"; GObjectClass *object_class; g_debug( "%s: klass=%p", thisfn, ( void * ) klass ); st_parent_class = g_type_class_peek_parent( klass ); object_class = G_OBJECT_CLASS( klass ); object_class->constructed = instance_constructed; object_class->dispose = instance_dispose; object_class->finalize = instance_finalize; klass->private = g_new0( NactExportAskClassPrivate, 1 ); } static void ioptions_list_iface_init( NAIOptionsListInterface *iface, void *user_data ) { static const gchar *thisfn = "nact_assistant_export_ioptions_list_iface_init"; g_debug( "%s: iface=%p, user_data=%p", thisfn, ( void * ) iface, ( void * ) user_data ); iface->get_options = ioptions_list_get_formats; iface->free_options = ioptions_list_free_formats; } static GList * ioptions_list_get_formats( const NAIOptionsList *instance, GtkWidget *container ) { NactExportAsk *window; NactApplication *application; NAUpdater *updater; GList *formats; g_return_val_if_fail( NACT_IS_EXPORT_ASK( instance ), NULL ); window = NACT_EXPORT_ASK( instance ); application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window ))); updater = nact_application_get_updater( application ); formats = na_exporter_get_formats( NA_PIVOT( updater )); return( formats ); } static void ioptions_list_free_formats( const NAIOptionsList *instance, GtkWidget *container, GList *formats ) { na_exporter_free_formats( formats ); } static void instance_init( GTypeInstance *instance, gpointer klass ) { static const gchar *thisfn = "nact_export_ask_instance_init"; NactExportAsk *self; g_return_if_fail( NACT_IS_EXPORT_ASK( instance )); g_debug( "%s: instance=%p (%s), klass=%p", thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass ); self = NACT_EXPORT_ASK( instance ); self->private = g_new0( NactExportAskPrivate, 1 ); self->private->dispose_has_run = FALSE; } static void instance_constructed( GObject *dialog ) { static const gchar *thisfn = "nact_export_ask_instance_constructed"; NactExportAskPrivate *priv; g_return_if_fail( NACT_IS_EXPORT_ASK( dialog )); priv = NACT_EXPORT_ASK( dialog )->private; if( !priv->dispose_has_run ){ /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->constructed ){ G_OBJECT_CLASS( st_parent_class )->constructed( dialog ); } g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog )); base_window_signal_connect( BASE_WINDOW( dialog ), G_OBJECT( dialog ), BASE_SIGNAL_INITIALIZE_GTK, G_CALLBACK( on_base_initialize_gtk )); base_window_signal_connect( BASE_WINDOW( dialog ), G_OBJECT( dialog ), BASE_SIGNAL_INITIALIZE_WINDOW, G_CALLBACK( on_base_initialize_window )); } } static void instance_dispose( GObject *dialog ) { static const gchar *thisfn = "nact_export_ask_instance_dispose"; NactExportAsk *self; g_return_if_fail( NACT_IS_EXPORT_ASK( dialog )); self = NACT_EXPORT_ASK( dialog ); if( !self->private->dispose_has_run ){ g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog )); self->private->dispose_has_run = TRUE; /* chain up to the parent class */ if( G_OBJECT_CLASS( st_parent_class )->dispose ){ G_OBJECT_CLASS( st_parent_class )->dispose( dialog ); } } } static void instance_finalize( GObject *dialog ) { static const gchar *thisfn = "nact_export_ask_instance_finalize"; NactExportAsk *self; g_return_if_fail( NACT_IS_EXPORT_ASK( dialog )); g_debug( "%s: dialog=%p (%s)", thisfn, ( void * ) dialog, G_OBJECT_TYPE_NAME( dialog )); self = NACT_EXPORT_ASK( dialog ); g_free( self->private->format ); g_free( self->private ); /* chain call to parent class */ if( G_OBJECT_CLASS( st_parent_class )->finalize ){ G_OBJECT_CLASS( st_parent_class )->finalize( dialog ); } } /** * nact_export_ask_user: * @parent: the NactAssistant parent of this dialog. * @item: the NAObjectItem to be exported. * @first: whether this is the first call of a serie. * On a first call, the user is really asked for his choice. * The next times, the 'keep-last-choice' flag will be considered. * * Initializes and runs the dialog. * * This is a small dialog which is to be ran during export operations, * when the set export format is 'Ask me'. Each exported file runs this * dialog, unless the user selects the 'keep same choice' box. * * Returns: the export format chosen by the user as a newly allocated * string which should be g_free() by the caller. * The function defaults to returning NA_IPREFS_DEFAULT_EXPORT_FORMAT. * * When the user selects 'Keep same choice without asking me', this choice * becomes his new preferred export format. */ gchar * nact_export_ask_user( BaseWindow *parent, NAObjectItem *item, gboolean first ) { static const gchar *thisfn = "nact_export_ask_user"; NactExportAsk *editor; gboolean are_locked, mandatory; gboolean keep, keep_mandatory; int code; gchar *format; g_return_val_if_fail( BASE_IS_WINDOW( parent ), NULL ); g_debug( "%s: parent=%p, item=%p (%s), first=%s", thisfn, ( void * ) parent, ( void * ) item, G_OBJECT_TYPE_NAME( item ), first ? "True":"False" ); format = na_settings_get_string( NA_IPREFS_EXPORT_ASK_USER_LAST_FORMAT, NULL, &mandatory ); keep = na_settings_get_boolean( NA_IPREFS_EXPORT_ASK_USER_KEEP_LAST_CHOICE, NULL, &keep_mandatory ); if( first || !keep ){ editor = g_object_new( NACT_TYPE_EXPORT_ASK, BASE_PROP_PARENT, parent, BASE_PROP_XMLUI_FILENAME, st_xmlui_filename, BASE_PROP_TOPLEVEL_NAME, st_toplevel_name, BASE_PROP_WSP_NAME, st_wsp_name, NULL ); editor->private->format = g_strdup( format ); editor->private->format_mandatory = mandatory; editor->private->keep_last_choice = keep; editor->private->keep_last_choice_mandatory = keep_mandatory; editor->private->parent = parent; editor->private->item = item; are_locked = na_settings_get_boolean( NA_IPREFS_ADMIN_PREFERENCES_LOCKED, NULL, &mandatory ); editor->private->preferences_locked = are_locked && mandatory; code = base_window_run( BASE_WINDOW( editor )); switch( code ){ case GTK_RESPONSE_OK: g_free( format ); format = get_export_format( editor ); break; case GTK_RESPONSE_CANCEL: /* base_dialog::do_run only returns OK or CANCEL */ default: g_free( format ); format = g_strdup( EXPORTER_FORMAT_NOEXPORT ); break; } g_object_unref( editor ); } return( format ); } static void on_base_initialize_gtk( NactExportAsk *editor, GtkDialog *toplevel, gpointer user_data ) { static const gchar *thisfn = "nact_export_ask_on_base_initialize_gtk"; GtkWidget *container; g_return_if_fail( NACT_IS_EXPORT_ASK( editor )); if( !editor->private->dispose_has_run ){ g_debug( "%s: dialog=%p, toplevel=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) toplevel, ( void * ) user_data ); container = base_window_get_widget( BASE_WINDOW( editor ), "ExportFormatAskVBox" ); na_ioptions_list_gtk_init( NA_IOPTIONS_LIST( editor ), container, FALSE ); #if !GTK_CHECK_VERSION( 2,22,0 ) gtk_dialog_set_has_separator( toplevel, FALSE ); #endif } } static void on_base_initialize_window( NactExportAsk *editor, gpointer user_data ) { static const gchar *thisfn = "nact_export_ask_on_base_initialize_window"; gchar *item_label, *label; GtkWidget *widget; NactExportAskPrivate *priv; g_return_if_fail( NACT_IS_EXPORT_ASK( editor )); priv = editor->private; if( !priv->dispose_has_run ){ g_debug( "%s: dialog=%p, user_data=%p", thisfn, ( void * ) editor, ( void * ) user_data ); item_label = na_object_get_label( priv->item ); if( NA_IS_OBJECT_ACTION( priv->item )){ /* i18n: The action