diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 03:13:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 03:13:10 +0000 |
commit | 3c57dd931145d43f2b0aef96c4d178135956bf91 (patch) | |
tree | 3de698981e9f0cc2c4f9569b19a5f3595e741f6b /libgimpmodule | |
parent | Initial commit. (diff) | |
download | gimp-3c57dd931145d43f2b0aef96c4d178135956bf91.tar.xz gimp-3c57dd931145d43f2b0aef96c4d178135956bf91.zip |
Adding upstream version 2.10.36.upstream/2.10.36
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libgimpmodule')
-rw-r--r-- | libgimpmodule/Makefile.am | 87 | ||||
-rw-r--r-- | libgimpmodule/Makefile.in | 1070 | ||||
-rw-r--r-- | libgimpmodule/gimpmodule.c | 536 | ||||
-rw-r--r-- | libgimpmodule/gimpmodule.def | 18 | ||||
-rw-r--r-- | libgimpmodule/gimpmodule.h | 250 | ||||
-rw-r--r-- | libgimpmodule/gimpmoduledb.c | 508 | ||||
-rw-r--r-- | libgimpmodule/gimpmoduledb.h | 84 | ||||
-rw-r--r-- | libgimpmodule/gimpmoduletypes.h | 47 |
8 files changed, 2600 insertions, 0 deletions
diff --git a/libgimpmodule/Makefile.am b/libgimpmodule/Makefile.am new file mode 100644 index 0000000..4a3bd5e --- /dev/null +++ b/libgimpmodule/Makefile.am @@ -0,0 +1,87 @@ +## Process this file with automake to produce Makefile.in + +libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la +libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la + +if PLATFORM_WIN32 +no_undefined = -no-undefined +endif + +if OS_WIN32 +gimpmodule_def = gimpmodule.def +libgimpmodule_export_symbols = -export-symbols $(srcdir)/gimpmodule.def + +install-libtool-import-lib: + $(INSTALL) .libs/libgimpmodule-$(GIMP_API_VERSION).dll.a $(DESTDIR)$(libdir) + $(INSTALL) $(srcdir)/gimpmodule.def $(DESTDIR)$(libdir) + +uninstall-libtool-import-lib: + -rm $(DESTDIR)$(libdir)/libgimpmodule-$(GIMP_API_VERSION).dll.a + -rm $(DESTDIR)$(libdir)/gimpmodule.def +else +install-libtool-import-lib: +uninstall-libtool-import-lib: +endif + +if MS_LIB_AVAILABLE +noinst_DATA = gimpmodule-$(GIMP_API_VERSION).lib + +install-ms-lib: + $(INSTALL) gimpmodule-$(GIMP_API_VERSION).lib $(DESTDIR)$(libdir) + +uninstall-ms-lib: + -rm $(DESTDIR)$(libdir)/gimpmodule-$(GIMP_API_VERSION).lib + +gimpmodule-@GIMP_API_VERSION@.lib: gimpmodule.def + lib -name:libgimpmodule-$(GIMP_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gimpmodule.def -out:$@ + +else +install-ms-lib: +uninstall-ms-lib: +endif + +libgimpmoduleincludedir = $(includedir)/gimp-$(GIMP_API_VERSION)/libgimpmodule + +AM_CPPFLAGS = \ + -DG_LOG_DOMAIN=\"LibGimpModule\" \ + -DGIMP_MODULE_COMPILATION \ + -I$(top_srcdir) \ + $(GIO_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(GMODULE_NO_EXPORT_CFLAGS) \ + -I$(includedir) + +EXTRA_DIST = \ + gimpmodule.def + +lib_LTLIBRARIES = libgimpmodule-@GIMP_API_VERSION@.la + +libgimpmodule_@GIMP_API_VERSION@_la_SOURCES = \ + gimpmoduletypes.h \ + gimpmodule.c \ + gimpmodule.h \ + gimpmoduledb.c \ + gimpmoduledb.h + +libgimpmoduleinclude_HEADERS = \ + gimpmoduletypes.h \ + gimpmodule.h \ + gimpmoduledb.h + +libgimpmodule_@GIMP_API_VERSION@_la_LDFLAGS = \ + -version-info $(LT_VERSION_INFO) \ + $(no_undefined) \ + $(libgimpmodule_export_symbols) + +EXTRA_libgimpmodule_@GIMP_API_VERSION@_la_DEPENDENCIES = $(gimpmodule_def) + +libgimpmodule_@GIMP_API_VERSION@_la_LIBADD = \ + $(libgimpbase) \ + $(libgimpconfig) \ + $(GMODULE_NO_EXPORT_LIBS) \ + $(GIO_LIBS) \ + $(GLIB_LIBS) + +install-data-local: install-ms-lib install-libtool-import-lib + +uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib diff --git a/libgimpmodule/Makefile.in b/libgimpmodule/Makefile.in new file mode 100644 index 0000000..6ac2f13 --- /dev/null +++ b/libgimpmodule/Makefile.in @@ -0,0 +1,1070 @@ +# Makefile.in generated by automake 1.16.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2020 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 = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +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@ +subdir = libgimpmodule +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/m4macros/alsa.m4 \ + $(top_srcdir)/m4macros/ax_compare_version.m4 \ + $(top_srcdir)/m4macros/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4macros/ax_gcc_func_attribute.m4 \ + $(top_srcdir)/m4macros/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4macros/ax_prog_perl_version.m4 \ + $(top_srcdir)/m4macros/detectcflags.m4 \ + $(top_srcdir)/m4macros/pythondev.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libgimpmoduleinclude_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/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)$(libdir)" \ + "$(DESTDIR)$(libgimpmoduleincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgimpmodule_@GIMP_API_VERSION@_la_DEPENDENCIES = $(libgimpbase) \ + $(libgimpconfig) $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libgimpmodule_@GIMP_API_VERSION@_la_OBJECTS = gimpmodule.lo \ + gimpmoduledb.lo +libgimpmodule_@GIMP_API_VERSION@_la_OBJECTS = \ + $(am_libgimpmodule_@GIMP_API_VERSION@_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 = +libgimpmodule_@GIMP_API_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) \ + --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ + $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libgimpmodule_@GIMP_API_VERSION@_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) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/gimpmodule.Plo \ + ./$(DEPDIR)/gimpmoduledb.Plo +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 = $(libgimpmodule_@GIMP_API_VERSION@_la_SOURCES) +DIST_SOURCES = $(libgimpmodule_@GIMP_API_VERSION@_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 = $(noinst_DATA) +HEADERS = $(libgimpmoduleinclude_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 +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +AA_LIBS = @AA_LIBS@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALL_LINGUAS = @ALL_LINGUAS@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +ALTIVEC_EXTRA_CFLAGS = @ALTIVEC_EXTRA_CFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPSTREAM_UTIL = @APPSTREAM_UTIL@ +AR = @AR@ +AS = @AS@ +ATK_CFLAGS = @ATK_CFLAGS@ +ATK_LIBS = @ATK_LIBS@ +ATK_REQUIRED_VERSION = @ATK_REQUIRED_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BABL_CFLAGS = @BABL_CFLAGS@ +BABL_LIBS = @BABL_LIBS@ +BABL_REQUIRED_VERSION = @BABL_REQUIRED_VERSION@ +BUG_REPORT_URL = @BUG_REPORT_URL@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ +BZIP2_LIBS = @BZIP2_LIBS@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PDF_CFLAGS = @CAIRO_PDF_CFLAGS@ +CAIRO_PDF_LIBS = @CAIRO_PDF_LIBS@ +CAIRO_PDF_REQUIRED_VERSION = @CAIRO_PDF_REQUIRED_VERSION@ +CAIRO_REQUIRED_VERSION = @CAIRO_REQUIRED_VERSION@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CC_VERSION = @CC_VERSION@ +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +CPP_FOR_BUILD = @CPP_FOR_BUILD@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DESKTOP_DATADIR = @DESKTOP_DATADIR@ +DESKTOP_FILE_VALIDATE = @DESKTOP_FILE_VALIDATE@ +DLLTOOL = @DLLTOOL@ +DOC_SHOOTER = @DOC_SHOOTER@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_AA = @FILE_AA@ +FILE_EXR = @FILE_EXR@ +FILE_HEIF = @FILE_HEIF@ +FILE_JP2_LOAD = @FILE_JP2_LOAD@ +FILE_JPEGXL = @FILE_JPEGXL@ +FILE_MNG = @FILE_MNG@ +FILE_PDF_SAVE = @FILE_PDF_SAVE@ +FILE_PS = @FILE_PS@ +FILE_WMF = @FILE_WMF@ +FILE_XMC = @FILE_XMC@ +FILE_XPM = @FILE_XPM@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_REQUIRED_VERSION = @FONTCONFIG_REQUIRED_VERSION@ +FREETYPE2_REQUIRED_VERSION = @FREETYPE2_REQUIRED_VERSION@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +GDBUS_CODEGEN = @GDBUS_CODEGEN@ +GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@ +GDK_PIXBUF_CSOURCE = @GDK_PIXBUF_CSOURCE@ +GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@ +GDK_PIXBUF_REQUIRED_VERSION = @GDK_PIXBUF_REQUIRED_VERSION@ +GEGL = @GEGL@ +GEGL_CFLAGS = @GEGL_CFLAGS@ +GEGL_LIBS = @GEGL_LIBS@ +GEGL_MAJOR_MINOR_VERSION = @GEGL_MAJOR_MINOR_VERSION@ +GEGL_REQUIRED_VERSION = @GEGL_REQUIRED_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GEXIV2_CFLAGS = @GEXIV2_CFLAGS@ +GEXIV2_LIBS = @GEXIV2_LIBS@ +GEXIV2_REQUIRED_VERSION = @GEXIV2_REQUIRED_VERSION@ +GIMP_API_VERSION = @GIMP_API_VERSION@ +GIMP_APP_VERSION = @GIMP_APP_VERSION@ +GIMP_BINARY_AGE = @GIMP_BINARY_AGE@ +GIMP_COMMAND = @GIMP_COMMAND@ +GIMP_DATA_VERSION = @GIMP_DATA_VERSION@ +GIMP_FULL_NAME = @GIMP_FULL_NAME@ +GIMP_INTERFACE_AGE = @GIMP_INTERFACE_AGE@ +GIMP_MAJOR_VERSION = @GIMP_MAJOR_VERSION@ +GIMP_MICRO_VERSION = @GIMP_MICRO_VERSION@ +GIMP_MINOR_VERSION = @GIMP_MINOR_VERSION@ +GIMP_MKENUMS = @GIMP_MKENUMS@ +GIMP_MODULES = @GIMP_MODULES@ +GIMP_PACKAGE_REVISION = @GIMP_PACKAGE_REVISION@ +GIMP_PKGCONFIG_VERSION = @GIMP_PKGCONFIG_VERSION@ +GIMP_PLUGINS = @GIMP_PLUGINS@ +GIMP_PLUGIN_VERSION = @GIMP_PLUGIN_VERSION@ +GIMP_REAL_VERSION = @GIMP_REAL_VERSION@ +GIMP_RELEASE = @GIMP_RELEASE@ +GIMP_SYSCONF_VERSION = @GIMP_SYSCONF_VERSION@ +GIMP_TOOL_VERSION = @GIMP_TOOL_VERSION@ +GIMP_UNSTABLE = @GIMP_UNSTABLE@ +GIMP_USER_VERSION = @GIMP_USER_VERSION@ +GIMP_VERSION = @GIMP_VERSION@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ +GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GIO_WINDOWS_CFLAGS = @GIO_WINDOWS_CFLAGS@ +GIO_WINDOWS_LIBS = @GIO_WINDOWS_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQUIRED_VERSION = @GLIB_REQUIRED_VERSION@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GS_LIBS = @GS_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_MAC_INTEGRATION_CFLAGS = @GTK_MAC_INTEGRATION_CFLAGS@ +GTK_MAC_INTEGRATION_LIBS = @GTK_MAC_INTEGRATION_LIBS@ +GTK_REQUIRED_VERSION = @GTK_REQUIRED_VERSION@ +GTK_UPDATE_ICON_CACHE = @GTK_UPDATE_ICON_CACHE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_REQUIRED_VERSION = @HARFBUZZ_REQUIRED_VERSION@ +HAVE_CXX14 = @HAVE_CXX14@ +HAVE_FINITE = @HAVE_FINITE@ +HAVE_ISFINITE = @HAVE_ISFINITE@ +HAVE_VFORK = @HAVE_VFORK@ +HOST_GLIB_COMPILE_RESOURCES = @HOST_GLIB_COMPILE_RESOURCES@ +HTML_DIR = @HTML_DIR@ +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_REQUIRED_VERSION = @INTLTOOL_REQUIRED_VERSION@ +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@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +ISO_CODES_LOCALEDIR = @ISO_CODES_LOCALEDIR@ +ISO_CODES_LOCATION = @ISO_CODES_LOCATION@ +JPEG_LIBS = @JPEG_LIBS@ +JSON_GLIB_CFLAGS = @JSON_GLIB_CFLAGS@ +JSON_GLIB_LIBS = @JSON_GLIB_LIBS@ +JXL_CFLAGS = @JXL_CFLAGS@ +JXL_LIBS = @JXL_LIBS@ +JXL_THREADS_CFLAGS = @JXL_THREADS_CFLAGS@ +JXL_THREADS_LIBS = @JXL_THREADS_LIBS@ +LCMS_CFLAGS = @LCMS_CFLAGS@ +LCMS_LIBS = @LCMS_LIBS@ +LCMS_REQUIRED_VERSION = @LCMS_REQUIRED_VERSION@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ +LIBBACKTRACE_LIBS = @LIBBACKTRACE_LIBS@ +LIBHEIF_CFLAGS = @LIBHEIF_CFLAGS@ +LIBHEIF_LIBS = @LIBHEIF_LIBS@ +LIBHEIF_REQUIRED_VERSION = @LIBHEIF_REQUIRED_VERSION@ +LIBJXL_REQUIRED_VERSION = @LIBJXL_REQUIRED_VERSION@ +LIBLZMA_REQUIRED_VERSION = @LIBLZMA_REQUIRED_VERSION@ +LIBMYPAINT_CFLAGS = @LIBMYPAINT_CFLAGS@ +LIBMYPAINT_LIBS = @LIBMYPAINT_LIBS@ +LIBMYPAINT_REQUIRED_VERSION = @LIBMYPAINT_REQUIRED_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBPNG_REQUIRED_VERSION = @LIBPNG_REQUIRED_VERSION@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ +LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ +LIBUNWIND_REQUIRED_VERSION = @LIBUNWIND_REQUIRED_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +LZMA_CFLAGS = @LZMA_CFLAGS@ +LZMA_LIBS = @LZMA_LIBS@ +MAIL = @MAIL@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MIME_INFO_CFLAGS = @MIME_INFO_CFLAGS@ +MIME_INFO_LIBS = @MIME_INFO_LIBS@ +MIME_TYPES = @MIME_TYPES@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MMX_EXTRA_CFLAGS = @MMX_EXTRA_CFLAGS@ +MNG_CFLAGS = @MNG_CFLAGS@ +MNG_LIBS = @MNG_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +MYPAINT_BRUSHES_CFLAGS = @MYPAINT_BRUSHES_CFLAGS@ +MYPAINT_BRUSHES_LIBS = @MYPAINT_BRUSHES_LIBS@ +NATIVE_GLIB_CFLAGS = @NATIVE_GLIB_CFLAGS@ +NATIVE_GLIB_LIBS = @NATIVE_GLIB_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENEXR_CFLAGS = @OPENEXR_CFLAGS@ +OPENEXR_LIBS = @OPENEXR_LIBS@ +OPENEXR_REQUIRED_VERSION = @OPENEXR_REQUIRED_VERSION@ +OPENJPEG_CFLAGS = @OPENJPEG_CFLAGS@ +OPENJPEG_LIBS = @OPENJPEG_LIBS@ +OPENJPEG_REQUIRED_VERSION = @OPENJPEG_REQUIRED_VERSION@ +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@ +PANGOCAIRO_CFLAGS = @PANGOCAIRO_CFLAGS@ +PANGOCAIRO_LIBS = @PANGOCAIRO_LIBS@ +PANGOCAIRO_REQUIRED_VERSION = @PANGOCAIRO_REQUIRED_VERSION@ +PATHSEP = @PATHSEP@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_REQUIRED_VERSION = @PERL_REQUIRED_VERSION@ +PERL_VERSION = @PERL_VERSION@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PNG_CFLAGS = @PNG_CFLAGS@ +PNG_LIBS = @PNG_LIBS@ +POFILES = @POFILES@ +POPPLER_CFLAGS = @POPPLER_CFLAGS@ +POPPLER_DATA_CFLAGS = @POPPLER_DATA_CFLAGS@ +POPPLER_DATA_LIBS = @POPPLER_DATA_LIBS@ +POPPLER_DATA_REQUIRED_VERSION = @POPPLER_DATA_REQUIRED_VERSION@ +POPPLER_LIBS = @POPPLER_LIBS@ +POPPLER_REQUIRED_VERSION = @POPPLER_REQUIRED_VERSION@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PYBIN_PATH = @PYBIN_PATH@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ +PYGIMP_EXTRA_CFLAGS = @PYGIMP_EXTRA_CFLAGS@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_CODEGEN = @PYGTK_CODEGEN@ +PYGTK_DEFSDIR = @PYGTK_DEFSDIR@ +PYGTK_LIBS = @PYGTK_LIBS@ +PYLINK_LIBS = @PYLINK_LIBS@ +PYTHON = @PYTHON@ +PYTHON2_REQUIRED_VERSION = @PYTHON2_REQUIRED_VERSION@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +RSVG_REQUIRED_VERSION = @RSVG_REQUIRED_VERSION@ +RT_LIBS = @RT_LIBS@ +SCREENSHOT_LIBS = @SCREENSHOT_LIBS@ +SED = @SED@ +SENDMAIL = @SENDMAIL@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +SSE2_EXTRA_CFLAGS = @SSE2_EXTRA_CFLAGS@ +SSE4_1_EXTRA_CFLAGS = @SSE4_1_EXTRA_CFLAGS@ +SSE_EXTRA_CFLAGS = @SSE_EXTRA_CFLAGS@ +STRIP = @STRIP@ +SVG_CFLAGS = @SVG_CFLAGS@ +SVG_LIBS = @SVG_LIBS@ +SYMPREFIX = @SYMPREFIX@ +TIFF_LIBS = @TIFF_LIBS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WEBKIT_CFLAGS = @WEBKIT_CFLAGS@ +WEBKIT_LIBS = @WEBKIT_LIBS@ +WEBKIT_REQUIRED_VERSION = @WEBKIT_REQUIRED_VERSION@ +WEBPDEMUX_CFLAGS = @WEBPDEMUX_CFLAGS@ +WEBPDEMUX_LIBS = @WEBPDEMUX_LIBS@ +WEBPMUX_CFLAGS = @WEBPMUX_CFLAGS@ +WEBPMUX_LIBS = @WEBPMUX_LIBS@ +WEBP_CFLAGS = @WEBP_CFLAGS@ +WEBP_LIBS = @WEBP_LIBS@ +WEBP_REQUIRED_VERSION = @WEBP_REQUIRED_VERSION@ +WEB_PAGE = @WEB_PAGE@ +WIN32_LARGE_ADDRESS_AWARE = @WIN32_LARGE_ADDRESS_AWARE@ +WINDRES = @WINDRES@ +WMF_CFLAGS = @WMF_CFLAGS@ +WMF_CONFIG = @WMF_CONFIG@ +WMF_LIBS = @WMF_LIBS@ +WMF_REQUIRED_VERSION = @WMF_REQUIRED_VERSION@ +XDG_EMAIL = @XDG_EMAIL@ +XFIXES_CFLAGS = @XFIXES_CFLAGS@ +XFIXES_LIBS = @XFIXES_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_REQUIRED_VERSION = @XGETTEXT_REQUIRED_VERSION@ +XMC_CFLAGS = @XMC_CFLAGS@ +XMC_LIBS = @XMC_LIBS@ +XMKMF = @XMKMF@ +XMLLINT = @XMLLINT@ +XMU_LIBS = @XMU_LIBS@ +XPM_LIBS = @XPM_LIBS@ +XSLTPROC = @XSLTPROC@ +XVFB_RUN = @XVFB_RUN@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +Z_LIBS = @Z_LIBS@ +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_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ +ac_ct_CXX = @ac_ct_CXX@ +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@ +gimpdatadir = @gimpdatadir@ +gimpdir = @gimpdir@ +gimplocaledir = @gimplocaledir@ +gimpplugindir = @gimpplugindir@ +gimpsysconfdir = @gimpsysconfdir@ +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@ +manpage_gimpdir = @manpage_gimpdir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +mypaint_brushes_dir = @mypaint_brushes_dir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la +libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la +@PLATFORM_WIN32_TRUE@no_undefined = -no-undefined +@OS_WIN32_TRUE@gimpmodule_def = gimpmodule.def +@OS_WIN32_TRUE@libgimpmodule_export_symbols = -export-symbols $(srcdir)/gimpmodule.def +@MS_LIB_AVAILABLE_TRUE@noinst_DATA = gimpmodule-$(GIMP_API_VERSION).lib +libgimpmoduleincludedir = $(includedir)/gimp-$(GIMP_API_VERSION)/libgimpmodule +AM_CPPFLAGS = \ + -DG_LOG_DOMAIN=\"LibGimpModule\" \ + -DGIMP_MODULE_COMPILATION \ + -I$(top_srcdir) \ + $(GIO_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(GMODULE_NO_EXPORT_CFLAGS) \ + -I$(includedir) + +EXTRA_DIST = \ + gimpmodule.def + +lib_LTLIBRARIES = libgimpmodule-@GIMP_API_VERSION@.la +libgimpmodule_@GIMP_API_VERSION@_la_SOURCES = \ + gimpmoduletypes.h \ + gimpmodule.c \ + gimpmodule.h \ + gimpmoduledb.c \ + gimpmoduledb.h + +libgimpmoduleinclude_HEADERS = \ + gimpmoduletypes.h \ + gimpmodule.h \ + gimpmoduledb.h + +libgimpmodule_@GIMP_API_VERSION@_la_LDFLAGS = \ + -version-info $(LT_VERSION_INFO) \ + $(no_undefined) \ + $(libgimpmodule_export_symbols) + +EXTRA_libgimpmodule_@GIMP_API_VERSION@_la_DEPENDENCIES = $(gimpmodule_def) +libgimpmodule_@GIMP_API_VERSION@_la_LIBADD = \ + $(libgimpbase) \ + $(libgimpconfig) \ + $(GMODULE_NO_EXPORT_LIBS) \ + $(GIO_LIBS) \ + $(GLIB_LIBS) + +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 libgimpmodule/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu libgimpmodule/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__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + 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-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || 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)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_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}; \ + } + +libgimpmodule-@GIMP_API_VERSION@.la: $(libgimpmodule_@GIMP_API_VERSION@_la_OBJECTS) $(libgimpmodule_@GIMP_API_VERSION@_la_DEPENDENCIES) $(EXTRA_libgimpmodule_@GIMP_API_VERSION@_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgimpmodule_@GIMP_API_VERSION@_la_LINK) -rpath $(libdir) $(libgimpmodule_@GIMP_API_VERSION@_la_OBJECTS) $(libgimpmodule_@GIMP_API_VERSION@_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gimpmodule.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gimpmoduledb.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.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 -o $@ $< + +.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 -o $@ `$(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-libgimpmoduleincludeHEADERS: $(libgimpmoduleinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libgimpmoduleinclude_HEADERS)'; test -n "$(libgimpmoduleincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libgimpmoduleincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libgimpmoduleincludedir)" || 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)$(libgimpmoduleincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libgimpmoduleincludedir)" || exit $$?; \ + done + +uninstall-libgimpmoduleincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libgimpmoduleinclude_HEADERS)'; test -n "$(libgimpmoduleincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libgimpmoduleincludedir)'; $(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: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(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) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libgimpmoduleincludedir)"; 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-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/gimpmodule.Plo + -rm -f ./$(DEPDIR)/gimpmoduledb.Plo + -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-data-local \ + install-libgimpmoduleincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +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 ./$(DEPDIR)/gimpmodule.Plo + -rm -f ./$(DEPDIR)/gimpmoduledb.Plo + -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-libLTLIBRARIES \ + uninstall-libgimpmoduleincludeHEADERS uninstall-local + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool 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-data-local install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-libgimpmoduleincludeHEADERS 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-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-libgimpmoduleincludeHEADERS uninstall-local + +.PRECIOUS: Makefile + + +@OS_WIN32_TRUE@install-libtool-import-lib: +@OS_WIN32_TRUE@ $(INSTALL) .libs/libgimpmodule-$(GIMP_API_VERSION).dll.a $(DESTDIR)$(libdir) +@OS_WIN32_TRUE@ $(INSTALL) $(srcdir)/gimpmodule.def $(DESTDIR)$(libdir) + +@OS_WIN32_TRUE@uninstall-libtool-import-lib: +@OS_WIN32_TRUE@ -rm $(DESTDIR)$(libdir)/libgimpmodule-$(GIMP_API_VERSION).dll.a +@OS_WIN32_TRUE@ -rm $(DESTDIR)$(libdir)/gimpmodule.def +@OS_WIN32_FALSE@install-libtool-import-lib: +@OS_WIN32_FALSE@uninstall-libtool-import-lib: + +@MS_LIB_AVAILABLE_TRUE@install-ms-lib: +@MS_LIB_AVAILABLE_TRUE@ $(INSTALL) gimpmodule-$(GIMP_API_VERSION).lib $(DESTDIR)$(libdir) + +@MS_LIB_AVAILABLE_TRUE@uninstall-ms-lib: +@MS_LIB_AVAILABLE_TRUE@ -rm $(DESTDIR)$(libdir)/gimpmodule-$(GIMP_API_VERSION).lib + +@MS_LIB_AVAILABLE_TRUE@gimpmodule-@GIMP_API_VERSION@.lib: gimpmodule.def +@MS_LIB_AVAILABLE_TRUE@ lib -name:libgimpmodule-$(GIMP_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gimpmodule.def -out:$@ + +@MS_LIB_AVAILABLE_FALSE@install-ms-lib: +@MS_LIB_AVAILABLE_FALSE@uninstall-ms-lib: + +install-data-local: install-ms-lib install-libtool-import-lib + +uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib + +# 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: diff --git a/libgimpmodule/gimpmodule.c b/libgimpmodule/gimpmodule.c new file mode 100644 index 0000000..83a5e90 --- /dev/null +++ b/libgimpmodule/gimpmodule.c @@ -0,0 +1,536 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * gimpmodule.c + * (C) 1999 Austin Donnelly <austin@gimp.org> + * + * 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 3 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, see + * <https://www.gnu.org/licenses/>. + */ + +#include "config.h" + +#include <string.h> + +#include <gio/gio.h> + +#include "libgimpbase/gimpbase.h" + +#include "gimpmodule.h" + +#include "libgimp/libgimp-intl.h" + + +/** + * SECTION: gimpmodule + * @title: GimpModule + * @short_description: A #GTypeModule subclass which implements module + * loading using #GModule. + * @see_also: #GModule, #GTypeModule + * + * A #GTypeModule subclass which implements module loading using #GModule. + **/ + + +enum +{ + MODIFIED, + LAST_SIGNAL +}; + + +static void gimp_module_finalize (GObject *object); + +static gboolean gimp_module_load (GTypeModule *module); +static void gimp_module_unload (GTypeModule *module); + +static gboolean gimp_module_open (GimpModule *module); +static gboolean gimp_module_close (GimpModule *module); +static void gimp_module_set_last_error (GimpModule *module, + const gchar *error_str); + + +G_DEFINE_TYPE (GimpModule, gimp_module, G_TYPE_TYPE_MODULE) + +#define parent_class gimp_module_parent_class + +static guint module_signals[LAST_SIGNAL]; + + +static void +gimp_module_class_init (GimpModuleClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS (klass); + + module_signals[MODIFIED] = + g_signal_new ("modified", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpModuleClass, modified), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + object_class->finalize = gimp_module_finalize; + + module_class->load = gimp_module_load; + module_class->unload = gimp_module_unload; + + klass->modified = NULL; +} + +static void +gimp_module_init (GimpModule *module) +{ + module->filename = NULL; + module->verbose = FALSE; + module->state = GIMP_MODULE_STATE_ERROR; + module->on_disk = FALSE; + module->load_inhibit = FALSE; + + module->module = NULL; + module->info = NULL; + module->last_module_error = NULL; + + module->query_module = NULL; + module->register_module = NULL; +} + +static void +gimp_module_finalize (GObject *object) +{ + GimpModule *module = GIMP_MODULE (object); + + g_clear_pointer (&module->info, gimp_module_info_free); + g_clear_pointer (&module->last_module_error, g_free); + g_clear_pointer (&module->filename, g_free); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static gboolean +gimp_module_load (GTypeModule *module) +{ + GimpModule *gimp_module = GIMP_MODULE (module); + gpointer func; + + g_return_val_if_fail (gimp_module->filename != NULL, FALSE); + g_return_val_if_fail (gimp_module->module == NULL, FALSE); + + if (gimp_module->verbose) + g_print ("Loading module '%s'\n", + gimp_filename_to_utf8 (gimp_module->filename)); + + if (! gimp_module_open (gimp_module)) + return FALSE; + + if (! gimp_module_query_module (gimp_module)) + return FALSE; + + /* find the gimp_module_register symbol */ + if (! g_module_symbol (gimp_module->module, "gimp_module_register", &func)) + { + gimp_module_set_last_error (gimp_module, + "Missing gimp_module_register() symbol"); + + g_message (_("Module '%s' load error: %s"), + gimp_filename_to_utf8 (gimp_module->filename), + gimp_module->last_module_error); + + gimp_module_close (gimp_module); + + gimp_module->state = GIMP_MODULE_STATE_ERROR; + + return FALSE; + } + + gimp_module->register_module = func; + + if (! gimp_module->register_module (module)) + { + gimp_module_set_last_error (gimp_module, + "gimp_module_register() returned FALSE"); + + g_message (_("Module '%s' load error: %s"), + gimp_filename_to_utf8 (gimp_module->filename), + gimp_module->last_module_error); + + gimp_module_close (gimp_module); + + gimp_module->state = GIMP_MODULE_STATE_LOAD_FAILED; + + return FALSE; + } + + gimp_module->state = GIMP_MODULE_STATE_LOADED; + + return TRUE; +} + +static void +gimp_module_unload (GTypeModule *module) +{ + GimpModule *gimp_module = GIMP_MODULE (module); + + g_return_if_fail (gimp_module->module != NULL); + + if (gimp_module->verbose) + g_print ("Unloading module '%s'\n", + gimp_filename_to_utf8 (gimp_module->filename)); + + gimp_module_close (gimp_module); +} + + +/* public functions */ + +/** + * gimp_module_new: + * @filename: The filename of a loadable module. + * @load_inhibit: Pass %TRUE to exclude this module from auto-loading. + * @verbose: Pass %TRUE to enable debugging output. + * + * Creates a new #GimpModule instance. + * + * Return value: The new #GimpModule object. + **/ +GimpModule * +gimp_module_new (const gchar *filename, + gboolean load_inhibit, + gboolean verbose) +{ + GimpModule *module; + + g_return_val_if_fail (filename != NULL, NULL); + + module = g_object_new (GIMP_TYPE_MODULE, NULL); + + module->filename = g_strdup (filename); + module->load_inhibit = load_inhibit ? TRUE : FALSE; + module->verbose = verbose ? TRUE : FALSE; + module->on_disk = TRUE; + + if (! module->load_inhibit) + { + if (gimp_module_load (G_TYPE_MODULE (module))) + gimp_module_unload (G_TYPE_MODULE (module)); + } + else + { + if (verbose) + g_print ("Skipping module '%s'\n", + gimp_filename_to_utf8 (filename)); + + module->state = GIMP_MODULE_STATE_NOT_LOADED; + } + + return module; +} + +/** + * gimp_module_query_module: + * @module: A #GimpModule. + * + * Queries the module without actually registering any of the types it + * may implement. After successful query, the @info field of the + * #GimpModule struct will be available for further inspection. + * + * Return value: %TRUE on success. + **/ +gboolean +gimp_module_query_module (GimpModule *module) +{ + const GimpModuleInfo *info; + gboolean close_module = FALSE; + gpointer func; + + g_return_val_if_fail (GIMP_IS_MODULE (module), FALSE); + + if (! module->module) + { + if (! gimp_module_open (module)) + return FALSE; + + close_module = TRUE; + } + + /* find the gimp_module_query symbol */ + if (! g_module_symbol (module->module, "gimp_module_query", &func)) + { + gimp_module_set_last_error (module, + "Missing gimp_module_query() symbol"); + + g_message (_("Module '%s' load error: %s"), + gimp_filename_to_utf8 (module->filename), + module->last_module_error); + + gimp_module_close (module); + + module->state = GIMP_MODULE_STATE_ERROR; + return FALSE; + } + + module->query_module = func; + + if (module->info) + { + gimp_module_info_free (module->info); + module->info = NULL; + } + + info = module->query_module (G_TYPE_MODULE (module)); + + if (! info || info->abi_version != GIMP_MODULE_ABI_VERSION) + { + gimp_module_set_last_error (module, + info ? + "module ABI version does not match" : + "gimp_module_query() returned NULL"); + + g_message (_("Module '%s' load error: %s"), + gimp_filename_to_utf8 (module->filename), + module->last_module_error); + + gimp_module_close (module); + + module->state = GIMP_MODULE_STATE_ERROR; + return FALSE; + } + + module->info = gimp_module_info_copy (info); + + if (close_module) + return gimp_module_close (module); + + return TRUE; +} + +/** + * gimp_module_modified: + * @module: A #GimpModule. + * + * Emits the "modified" signal. Call it whenever you have modified the module + * manually (which you shouldn't do). + **/ +void +gimp_module_modified (GimpModule *module) +{ + g_return_if_fail (GIMP_IS_MODULE (module)); + + g_signal_emit (module, module_signals[MODIFIED], 0); +} + +/** + * gimp_module_set_load_inhibit: + * @module: A #GimpModule. + * @load_inhibit: Pass %TRUE to exclude this module from auto-loading. + * + * Sets the @load_inhibit property if the module. Emits "modified". + **/ +void +gimp_module_set_load_inhibit (GimpModule *module, + gboolean load_inhibit) +{ + g_return_if_fail (GIMP_IS_MODULE (module)); + + if (load_inhibit != module->load_inhibit) + { + module->load_inhibit = load_inhibit ? TRUE : FALSE; + + gimp_module_modified (module); + } +} + +/** + * gimp_module_state_name: + * @state: A #GimpModuleState. + * + * Returns the translated textual representation of a #GimpModuleState. + * The returned string must not be freed. + * + * Return value: The @state's name. + **/ +const gchar * +gimp_module_state_name (GimpModuleState state) +{ + static const gchar * const statenames[] = + { + N_("Module error"), + N_("Loaded"), + N_("Load failed"), + N_("Not loaded") + }; + + g_return_val_if_fail (state >= GIMP_MODULE_STATE_ERROR && + state <= GIMP_MODULE_STATE_NOT_LOADED, NULL); + + return gettext (statenames[state]); +} + +/** + * gimp_module_register_enum: + * @module: a module + * @name: the name of the new enum type + * @const_static_values: the enum values + * + * This function is deprecated! Use g_type_module_register_enum() instead. + * + * Return value: a new enum #GType + **/ +GType +gimp_module_register_enum (GTypeModule *module, + const gchar *name, + const GEnumValue *const_static_values) +{ + return g_type_module_register_enum (module, name, const_static_values); +} + +/** + * gimp_module_error_quark: + * + * This function is never called directly. Use GIMP_MODULE_ERROR() instead. + * + * Return value: the #GQuark that defines the GIMP module error domain. + * + * Since: 2.8 + **/ +GQuark +gimp_module_error_quark (void) +{ + return g_quark_from_static_string ("gimp-module-error-quark"); +} + + +/* private functions */ + +static gboolean +gimp_module_open (GimpModule *module) +{ + module->module = g_module_open (module->filename, 0); + + if (! module->module) + { + module->state = GIMP_MODULE_STATE_ERROR; + gimp_module_set_last_error (module, g_module_error ()); + + g_message (_("Module '%s' load error: %s"), + gimp_filename_to_utf8 (module->filename), + module->last_module_error); + + return FALSE; + } + + return TRUE; +} + +static gboolean +gimp_module_close (GimpModule *module) +{ + g_module_close (module->module); /* FIXME: error handling */ + module->module = NULL; + module->query_module = NULL; + module->register_module = NULL; + + module->state = GIMP_MODULE_STATE_NOT_LOADED; + + return TRUE; +} + +static void +gimp_module_set_last_error (GimpModule *module, + const gchar *error_str) +{ + if (module->last_module_error) + g_free (module->last_module_error); + + module->last_module_error = g_strdup (error_str); +} + + +/* GimpModuleInfo functions */ + +/** + * gimp_module_info_new: + * @abi_version: The #GIMP_MODULE_ABI_VERSION the module was compiled against. + * @purpose: The module's general purpose. + * @author: The module's author. + * @version: The module's version. + * @copyright: The module's copyright. + * @date: The module's release date. + * + * Creates a newly allocated #GimpModuleInfo struct. + * + * Return value: The new #GimpModuleInfo struct. + **/ +GimpModuleInfo * +gimp_module_info_new (guint32 abi_version, + const gchar *purpose, + const gchar *author, + const gchar *version, + const gchar *copyright, + const gchar *date) +{ + GimpModuleInfo *info = g_slice_new0 (GimpModuleInfo); + + info->abi_version = abi_version; + info->purpose = g_strdup (purpose); + info->author = g_strdup (author); + info->version = g_strdup (version); + info->copyright = g_strdup (copyright); + info->date = g_strdup (date); + + return info; +} + +/** + * gimp_module_info_copy: + * @info: The #GimpModuleInfo struct to copy. + * + * Copies a #GimpModuleInfo struct. + * + * Return value: The new copy. + **/ +GimpModuleInfo * +gimp_module_info_copy (const GimpModuleInfo *info) +{ + g_return_val_if_fail (info != NULL, NULL); + + return gimp_module_info_new (info->abi_version, + info->purpose, + info->author, + info->version, + info->copyright, + info->date); +} + +/** + * gimp_module_info_free: + * @info: The #GimpModuleInfo struct to free + * + * Frees the passed #GimpModuleInfo. + **/ +void +gimp_module_info_free (GimpModuleInfo *info) +{ + g_return_if_fail (info != NULL); + + g_free (info->purpose); + g_free (info->author); + g_free (info->version); + g_free (info->copyright); + g_free (info->date); + + g_slice_free (GimpModuleInfo, info); +} diff --git a/libgimpmodule/gimpmodule.def b/libgimpmodule/gimpmodule.def new file mode 100644 index 0000000..7b69018 --- /dev/null +++ b/libgimpmodule/gimpmodule.def @@ -0,0 +1,18 @@ +EXPORTS + gimp_module_db_get_load_inhibit + gimp_module_db_get_type + gimp_module_db_load + gimp_module_db_new + gimp_module_db_refresh + gimp_module_db_set_load_inhibit + gimp_module_error_quark + gimp_module_get_type + gimp_module_info_copy + gimp_module_info_free + gimp_module_info_new + gimp_module_modified + gimp_module_new + gimp_module_query_module + gimp_module_register_enum + gimp_module_set_load_inhibit + gimp_module_state_name diff --git a/libgimpmodule/gimpmodule.h b/libgimpmodule/gimpmodule.h new file mode 100644 index 0000000..d19ba1f --- /dev/null +++ b/libgimpmodule/gimpmodule.h @@ -0,0 +1,250 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * gimpmodule.h + * (C) 1999 Austin Donnelly <austin@gimp.org> + * + * 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 3 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, see + * <https://www.gnu.org/licenses/>. + */ + +#ifndef __GIMP_MODULE_H__ +#define __GIMP_MODULE_H__ + +#include <gmodule.h> + +#define __GIMP_MODULE_H_INSIDE__ + +#include <libgimpmodule/gimpmoduletypes.h> + +#include <libgimpmodule/gimpmoduledb.h> + +#undef __GIMP_MODULE_H_INSIDE__ + +G_BEGIN_DECLS + + +/** + * GIMP_MODULE_ABI_VERSION: + * + * The version of the module system's ABI. Modules put this value into + * #GimpModuleInfo's @abi_version field so the code loading the modules + * can check if it was compiled against the same module ABI the modules + * are compiled against. + * + * GIMP_MODULE_ABI_VERSION is incremented each time one of the + * following changes: + * + * - the libgimpmodule implementation (if the change affects modules). + * + * - one of the classes implemented by modules (currently #GimpColorDisplay, + * #GimpColorSelector and #GimpController). + **/ +#define GIMP_MODULE_ABI_VERSION 0x0004 + + +/** + * GimpModuleState: + * @GIMP_MODULE_STATE_ERROR: Missing gimp_module_register() function + * or other error. + * @GIMP_MODULE_STATE_LOADED: An instance of a type implemented by + * this module is allocated. + * @GIMP_MODULE_STATE_LOAD_FAILED: gimp_module_register() returned %FALSE. + * @GIMP_MODULE_STATE_NOT_LOADED: There are no instances allocated of + * types implemented by this module. + * + * The possible states a #GimpModule can be in. + **/ +typedef enum +{ + GIMP_MODULE_STATE_ERROR, + GIMP_MODULE_STATE_LOADED, + GIMP_MODULE_STATE_LOAD_FAILED, + GIMP_MODULE_STATE_NOT_LOADED +} GimpModuleState; + + +#define GIMP_MODULE_ERROR (gimp_module_error_quark ()) + +GQuark gimp_module_error_quark (void) G_GNUC_CONST; + +/** + * GimpModuleError: + * @GIMP_MODULE_FAILED: Generic error condition + * + * Types of errors returned by modules + **/ +typedef enum +{ + GIMP_MODULE_FAILED +} GimpModuleError; + + +/** + * GimpModuleInfo: + * @abi_version: The #GIMP_MODULE_ABI_VERSION the module was compiled against. + * @purpose: The module's general purpose. + * @author: The module's author. + * @version: The module's version. + * @copyright: The module's copyright. + * @date: The module's release date. + * + * This structure contains information about a loadable module. + **/ +struct _GimpModuleInfo +{ + guint32 abi_version; + gchar *purpose; + gchar *author; + gchar *version; + gchar *copyright; + gchar *date; +}; + + +/** + * GimpModuleQueryFunc: + * @module: The #GimpModule responsible for this loadable module. + * @Returns: The #GimpModuleInfo struct describing the module. + * + * The signature of the query function a loadable GIMP module must + * implement. In the module, the function must be called + * gimp_module_query(). + * + * #GimpModule will copy the returned #GimpModuleInfo struct, so the + * module doesn't need to keep these values around (however in most + * cases the module will just return a pointer to a constant + * structure). + **/ +typedef const GimpModuleInfo * (* GimpModuleQueryFunc) (GTypeModule *module); + +/** + * GimpModuleRegisterFunc: + * @module: The #GimpModule responsible for this loadable module. + * @Returns: %TRUE on success, %FALSE otherwise. + * + * The signature of the register function a loadable GIMP module must + * implement. In the module, the function must be called + * gimp_module_register(). + * + * When this function is called, the module should register all the types + * it implements with the passed @module. + **/ +typedef gboolean (* GimpModuleRegisterFunc) (GTypeModule *module); + + +/* GimpModules have to implement these */ +G_MODULE_EXPORT const GimpModuleInfo * gimp_module_query (GTypeModule *module); +G_MODULE_EXPORT gboolean gimp_module_register (GTypeModule *module); + + +#define GIMP_TYPE_MODULE (gimp_module_get_type ()) +#define GIMP_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_MODULE, GimpModule)) +#define GIMP_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_MODULE, GimpModuleClass)) +#define GIMP_IS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_MODULE)) +#define GIMP_IS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_MODULE)) +#define GIMP_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_MODULE, GimpModuleClass)) + + +typedef struct _GimpModuleClass GimpModuleClass; + +/** + * GimpModule: + * @filename: + * @verbose: + * @state: + * @on_disk: + * @load_inhibit: + * @info: + * @last_module_error: + * + * #GimpModule is a generic mechanism to dynamically load modules into + * GIMP. It is a #GTypeModule subclass, implementing module loading + * using #GModule. #GimpModule does not know which functionality is + * implemented by the modules, it just provides a framework to get + * arbitrary #GType implementations loaded from disk. + **/ +struct _GimpModule +{ + GTypeModule parent_instance; + + /*< public >*/ + gchar *filename; /* path to the module */ + gboolean verbose; /* verbose error reporting */ + GimpModuleState state; /* what's happened to the module */ + gboolean on_disk; /* TRUE if file still exists */ + gboolean load_inhibit; /* user requests not to load at boot time */ + + /* stuff from now on may be NULL depending on the state the module is in */ + /*< private >*/ + GModule *module; /* handle on the module */ + + /*< public >*/ + GimpModuleInfo *info; /* returned values from module_query */ + gchar *last_module_error; + + /*< private >*/ + GimpModuleQueryFunc query_module; + GimpModuleRegisterFunc register_module; +}; + +struct _GimpModuleClass +{ + GTypeModuleClass parent_class; + + void (* modified) (GimpModule *module); + + /* Padding for future expansion */ + void (* _gimp_reserved1) (void); + void (* _gimp_reserved2) (void); + void (* _gimp_reserved3) (void); + void (* _gimp_reserved4) (void); +}; + + +GType gimp_module_get_type (void) G_GNUC_CONST; + +GimpModule * gimp_module_new (const gchar *filename, + gboolean load_inhibit, + gboolean verbose); + +gboolean gimp_module_query_module (GimpModule *module); + +void gimp_module_modified (GimpModule *module); +void gimp_module_set_load_inhibit (GimpModule *module, + gboolean load_inhibit); + +const gchar * gimp_module_state_name (GimpModuleState state); + +GIMP_DEPRECATED_FOR(g_type_module_register_enum) +GType gimp_module_register_enum (GTypeModule *module, + const gchar *name, + const GEnumValue *const_static_values); + + +/* GimpModuleInfo functions */ + +GimpModuleInfo * gimp_module_info_new (guint32 abi_version, + const gchar *purpose, + const gchar *author, + const gchar *version, + const gchar *copyright, + const gchar *date); +GimpModuleInfo * gimp_module_info_copy (const GimpModuleInfo *info); +void gimp_module_info_free (GimpModuleInfo *info); + + +G_END_DECLS + +#endif /* __GIMP_MODULE_H__ */ diff --git a/libgimpmodule/gimpmoduledb.c b/libgimpmodule/gimpmoduledb.c new file mode 100644 index 0000000..4bc1c73 --- /dev/null +++ b/libgimpmodule/gimpmoduledb.c @@ -0,0 +1,508 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * 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 3 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, see + * <https://www.gnu.org/licenses/>. + */ + +#include "config.h" + +#include <string.h> + +#include <gio/gio.h> + +#include "libgimpbase/gimpbase.h" +#include "libgimpconfig/gimpconfig.h" + +#include "gimpmoduletypes.h" + +#include "gimpmodule.h" +#include "gimpmoduledb.h" + + +/** + * SECTION: gimpmoduledb + * @title: GimpModuleDB + * @short_description: Keeps a list of #GimpModule's found in a given + * searchpath. + * + * Keeps a list of #GimpModule's found in a given searchpath. + **/ + + +enum +{ + ADD, + REMOVE, + MODULE_MODIFIED, + LAST_SIGNAL +}; + + +#define DUMP_DB FALSE + + +static void gimp_module_db_finalize (GObject *object); + +static void gimp_module_db_load_directory (GimpModuleDB *db, + GFile *directory); +static void gimp_module_db_load_module (GimpModuleDB *db, + GFile *file); + +static GimpModule * gimp_module_db_module_find_by_path (GimpModuleDB *db, + const char *fullpath); + +static void gimp_module_db_module_dump_func (gpointer data, + gpointer user_data); +static void gimp_module_db_module_on_disk_func (gpointer data, + gpointer user_data); +static void gimp_module_db_module_remove_func (gpointer data, + gpointer user_data); + +static void gimp_module_db_module_modified (GimpModule *module, + GimpModuleDB *db); + + +G_DEFINE_TYPE (GimpModuleDB, gimp_module_db, G_TYPE_OBJECT) + +#define parent_class gimp_module_db_parent_class + +static guint db_signals[LAST_SIGNAL] = { 0 }; + + +static void +gimp_module_db_class_init (GimpModuleDBClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + db_signals[ADD] = + g_signal_new ("add", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpModuleDBClass, add), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GIMP_TYPE_MODULE); + + db_signals[REMOVE] = + g_signal_new ("remove", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpModuleDBClass, remove), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GIMP_TYPE_MODULE); + + db_signals[MODULE_MODIFIED] = + g_signal_new ("module-modified", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpModuleDBClass, module_modified), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GIMP_TYPE_MODULE); + + object_class->finalize = gimp_module_db_finalize; + + klass->add = NULL; + klass->remove = NULL; +} + +static void +gimp_module_db_init (GimpModuleDB *db) +{ + db->modules = NULL; + db->load_inhibit = NULL; + db->verbose = FALSE; +} + +static void +gimp_module_db_finalize (GObject *object) +{ + GimpModuleDB *db = GIMP_MODULE_DB (object); + + if (db->modules) + { + GList *list; + + for (list = db->modules; list; list = g_list_next (list)) + { + g_signal_handlers_disconnect_by_func (list->data, + gimp_module_db_module_modified, + db); + } + + g_list_free (db->modules); + db->modules = NULL; + } + + if (db->load_inhibit) + { + g_free (db->load_inhibit); + db->load_inhibit = NULL; + } + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +/** + * gimp_module_db_new: + * @verbose: Pass %TRUE to enable debugging output. + * + * Creates a new #GimpModuleDB instance. The @verbose parameter will be + * passed to the created #GimpModule instances using gimp_module_new(). + * + * Return value: The new #GimpModuleDB instance. + **/ +GimpModuleDB * +gimp_module_db_new (gboolean verbose) +{ + GimpModuleDB *db; + + db = g_object_new (GIMP_TYPE_MODULE_DB, NULL); + + db->verbose = verbose ? TRUE : FALSE; + + return db; +} + +static gboolean +is_in_inhibit_list (const gchar *filename, + const gchar *inhibit_list) +{ + gchar *p; + gint pathlen; + const gchar *start; + const gchar *end; + + if (! inhibit_list || ! strlen (inhibit_list)) + return FALSE; + + p = strstr (inhibit_list, filename); + if (!p) + return FALSE; + + /* we have a substring, but check for colons either side */ + start = p; + while (start != inhibit_list && *start != G_SEARCHPATH_SEPARATOR) + start--; + + if (*start == G_SEARCHPATH_SEPARATOR) + start++; + + end = strchr (p, G_SEARCHPATH_SEPARATOR); + if (! end) + end = inhibit_list + strlen (inhibit_list); + + pathlen = strlen (filename); + + if ((end - start) == pathlen) + return TRUE; + + return FALSE; +} + +/** + * gimp_module_db_set_load_inhibit: + * @db: A #GimpModuleDB. + * @load_inhibit: A #G_SEARCHPATH_SEPARATOR delimited list of module + * filenames to exclude from auto-loading. + * + * Sets the @load_inhibit flag for all #GimpModule's which are kept + * by @db (using gimp_module_set_load_inhibit()). + **/ +void +gimp_module_db_set_load_inhibit (GimpModuleDB *db, + const gchar *load_inhibit) +{ + GList *list; + + g_return_if_fail (GIMP_IS_MODULE_DB (db)); + + if (db->load_inhibit) + g_free (db->load_inhibit); + + db->load_inhibit = g_strdup (load_inhibit); + + for (list = db->modules; list; list = g_list_next (list)) + { + GimpModule *module = list->data; + + gimp_module_set_load_inhibit (module, + is_in_inhibit_list (module->filename, + load_inhibit)); + } +} + +/** + * gimp_module_db_get_load_inhibit: + * @db: A #GimpModuleDB. + * + * Return the #G_SEARCHPATH_SEPARATOR delimited list of module filenames + * which are excluded from auto-loading. + * + * Return value: the @db's @load_inhibit string. + **/ +const gchar * +gimp_module_db_get_load_inhibit (GimpModuleDB *db) +{ + g_return_val_if_fail (GIMP_IS_MODULE_DB (db), NULL); + + return db->load_inhibit; +} + +/** + * gimp_module_db_load: + * @db: A #GimpModuleDB. + * @module_path: A #G_SEARCHPATH_SEPARATOR delimited list of directories + * to load modules from. + * + * Scans the directories contained in @module_path and creates a + * #GimpModule instance for every loadable module contained in the + * directories. + **/ +void +gimp_module_db_load (GimpModuleDB *db, + const gchar *module_path) +{ + g_return_if_fail (GIMP_IS_MODULE_DB (db)); + g_return_if_fail (module_path != NULL); + + if (g_module_supported ()) + { + GList *path; + GList *list; + + path = gimp_config_path_expand_to_files (module_path, NULL); + + for (list = path; list; list = g_list_next (list)) + { + gimp_module_db_load_directory (db, list->data); + } + + g_list_free_full (path, (GDestroyNotify) g_object_unref); + } + + if (DUMP_DB) + g_list_foreach (db->modules, gimp_module_db_module_dump_func, NULL); +} + +/** + * gimp_module_db_refresh: + * @db: A #GimpModuleDB. + * @module_path: A #G_SEARCHPATH_SEPARATOR delimited list of directories + * to load modules from. + * + * Does the same as gimp_module_db_load(), plus removes all #GimpModule + * instances whose modules have been deleted from disk. + * + * Note that the #GimpModule's will just be removed from the internal + * list and not freed as this is not possible with #GTypeModule + * instances which actually implement types. + **/ +void +gimp_module_db_refresh (GimpModuleDB *db, + const gchar *module_path) +{ + GList *kill_list = NULL; + + g_return_if_fail (GIMP_IS_MODULE_DB (db)); + g_return_if_fail (module_path != NULL); + + /* remove modules we don't have on disk anymore */ + g_list_foreach (db->modules, + gimp_module_db_module_on_disk_func, + &kill_list); + g_list_foreach (kill_list, + gimp_module_db_module_remove_func, + db); + g_list_free (kill_list); + + /* walk filesystem and add new things we find */ + gimp_module_db_load (db, module_path); +} + +static void +gimp_module_db_load_directory (GimpModuleDB *db, + GFile *directory) +{ + GFileEnumerator *enumerator; + + enumerator = g_file_enumerate_children (directory, + G_FILE_ATTRIBUTE_STANDARD_NAME "," + G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "," + G_FILE_ATTRIBUTE_STANDARD_TYPE, + G_FILE_QUERY_INFO_NONE, + NULL, NULL); + + if (enumerator) + { + GFileInfo *info; + + while ((info = g_file_enumerator_next_file (enumerator, NULL, NULL))) + { + GFileType file_type = g_file_info_get_file_type (info); + + if (file_type == G_FILE_TYPE_REGULAR && + ! g_file_info_get_is_hidden (info)) + { + GFile *child = g_file_enumerator_get_child (enumerator, info); + + gimp_module_db_load_module (db, child); + + g_object_unref (child); + } + + g_object_unref (info); + } + + g_object_unref (enumerator); + } +} + +static void +gimp_module_db_load_module (GimpModuleDB *db, + GFile *file) +{ + GimpModule *module; + gchar *path; + gboolean load_inhibit; + + if (! gimp_file_has_extension (file, "." G_MODULE_SUFFIX)) + return; + + path = g_file_get_path (file); + + /* don't load if we already know about it */ + if (gimp_module_db_module_find_by_path (db, path)) + { + g_free (path); + return; + } + + load_inhibit = is_in_inhibit_list (path, db->load_inhibit); + + module = gimp_module_new (path, + load_inhibit, + db->verbose); + + g_free (path); + + g_signal_connect (module, "modified", + G_CALLBACK (gimp_module_db_module_modified), + db); + + db->modules = g_list_append (db->modules, module); + + g_signal_emit (db, db_signals[ADD], 0, module); +} + +static GimpModule * +gimp_module_db_module_find_by_path (GimpModuleDB *db, + const char *fullpath) +{ + GList *list; + + for (list = db->modules; list; list = g_list_next (list)) + { + GimpModule *module = list->data; + + if (! strcmp (module->filename, fullpath)) + return module; + } + + return NULL; +} + +static void +gimp_module_db_module_dump_func (gpointer data, + gpointer user_data) +{ + GimpModule *module = data; + + g_print ("\n%s: %s\n", + gimp_filename_to_utf8 (module->filename), + gimp_module_state_name (module->state)); + + g_print (" module: %p lasterr: %s query: %p register: %p\n", + module->module, + module->last_module_error ? module->last_module_error : "NONE", + module->query_module, + module->register_module); + + if (module->info) + { + g_print (" purpose: %s\n" + " author: %s\n" + " version: %s\n" + " copyright: %s\n" + " date: %s\n", + module->info->purpose ? module->info->purpose : "NONE", + module->info->author ? module->info->author : "NONE", + module->info->version ? module->info->version : "NONE", + module->info->copyright ? module->info->copyright : "NONE", + module->info->date ? module->info->date : "NONE"); + } +} + +static void +gimp_module_db_module_on_disk_func (gpointer data, + gpointer user_data) +{ + GimpModule *module = data; + GList **kill_list = user_data; + gboolean old_on_disk; + + old_on_disk = module->on_disk; + + module->on_disk = g_file_test (module->filename, G_FILE_TEST_IS_REGULAR); + + /* if it's not on the disk, and it isn't in memory, mark it to be + * removed later. + */ + if (! module->on_disk && ! module->module) + { + *kill_list = g_list_append (*kill_list, module); + module = NULL; + } + + if (module && module->on_disk != old_on_disk) + gimp_module_modified (module); +} + +static void +gimp_module_db_module_remove_func (gpointer data, + gpointer user_data) +{ + GimpModule *module = data; + GimpModuleDB *db = user_data; + + g_signal_handlers_disconnect_by_func (module, + gimp_module_db_module_modified, + db); + + db->modules = g_list_remove (db->modules, module); + + g_signal_emit (db, db_signals[REMOVE], 0, module); +} + +static void +gimp_module_db_module_modified (GimpModule *module, + GimpModuleDB *db) +{ + g_signal_emit (db, db_signals[MODULE_MODIFIED], 0, module); +} diff --git a/libgimpmodule/gimpmoduledb.h b/libgimpmodule/gimpmoduledb.h new file mode 100644 index 0000000..c570cee --- /dev/null +++ b/libgimpmodule/gimpmoduledb.h @@ -0,0 +1,84 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * 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 3 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, see + * <https://www.gnu.org/licenses/>. + */ + +#if !defined (__GIMP_MODULE_H_INSIDE__) && !defined (GIMP_MODULE_COMPILATION) +#error "Only <libgimpmodule/gimpmodule.h> can be included directly." +#endif + +#ifndef __GIMP_MODULE_DB_H__ +#define __GIMP_MODULE_DB_H__ + +G_BEGIN_DECLS + + +#define GIMP_TYPE_MODULE_DB (gimp_module_db_get_type ()) +#define GIMP_MODULE_DB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_MODULE_DB, GimpModuleDB)) +#define GIMP_MODULE_DB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_MODULE_DB, GimpModuleDBClass)) +#define GIMP_IS_MODULE_DB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_MODULE_DB)) +#define GIMP_IS_MODULE_DB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_MODULE_DB)) +#define GIMP_MODULE_DB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_MODULE_DB, GimpModuleDBClass)) + + +typedef struct _GimpModuleDBClass GimpModuleDBClass; + +struct _GimpModuleDB +{ + GObject parent_instance; + + /*< private >*/ + GList *modules; + + gchar *load_inhibit; + gboolean verbose; +}; + +struct _GimpModuleDBClass +{ + GObjectClass parent_class; + + void (* add) (GimpModuleDB *db, + GimpModule *module); + void (* remove) (GimpModuleDB *db, + GimpModule *module); + void (* module_modified) (GimpModuleDB *db, + GimpModule *module); + + /* Padding for future expansion */ + void (* _gimp_reserved1) (void); + void (* _gimp_reserved2) (void); + void (* _gimp_reserved3) (void); + void (* _gimp_reserved4) (void); +}; + + +GType gimp_module_db_get_type (void) G_GNUC_CONST; +GimpModuleDB * gimp_module_db_new (gboolean verbose); + +void gimp_module_db_set_load_inhibit (GimpModuleDB *db, + const gchar *load_inhibit); +const gchar * gimp_module_db_get_load_inhibit (GimpModuleDB *db); + +void gimp_module_db_load (GimpModuleDB *db, + const gchar *module_path); +void gimp_module_db_refresh (GimpModuleDB *db, + const gchar *module_path); + + +G_END_DECLS + +#endif /* __GIMP_MODULE_DB_H__ */ diff --git a/libgimpmodule/gimpmoduletypes.h b/libgimpmodule/gimpmoduletypes.h new file mode 100644 index 0000000..416b3a9 --- /dev/null +++ b/libgimpmodule/gimpmoduletypes.h @@ -0,0 +1,47 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * 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 3 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 + * Library 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, see + * <https://www.gnu.org/licenses/>. + */ + +#ifndef __GIMP_MODULE_TYPES_H__ +#define __GIMP_MODULE_TYPES_H__ + + +#include <libgimpbase/gimpbasetypes.h> + + +G_BEGIN_DECLS + +/* For information look into the C source or the html documentation */ + + +#ifndef GIMP_DISABLE_DEPRECATED +/* + * GIMP_MODULE_PARAM_SERIALIZE is deprecated, use + * GIMP_CONFIG_PARAM_SERIALIZE instead. + */ +#define GIMP_MODULE_PARAM_SERIALIZE (1 << (0 + G_PARAM_USER_SHIFT)) +#endif + + +typedef struct _GimpModule GimpModule; +typedef struct _GimpModuleInfo GimpModuleInfo; +typedef struct _GimpModuleDB GimpModuleDB; + + +G_END_DECLS + +#endif /* __GIMP_MODULE_TYPES_H__ */ |