summaryrefslogtreecommitdiffstats
path: root/app/menus
diff options
context:
space:
mode:
Diffstat (limited to 'app/menus')
-rw-r--r--app/menus/Makefile.am34
-rw-r--r--app/menus/Makefile.in963
-rw-r--r--app/menus/dockable-menu.c34
-rw-r--r--app/menus/dockable-menu.h26
-rw-r--r--app/menus/file-menu.c120
-rw-r--r--app/menus/file-menu.h26
-rw-r--r--app/menus/filters-menu.c64
-rw-r--r--app/menus/filters-menu.h26
-rw-r--r--app/menus/image-menu.c52
-rw-r--r--app/menus/image-menu.h26
-rw-r--r--app/menus/menus-types.h25
-rw-r--r--app/menus/menus.c519
-rw-r--r--app/menus/menus.h38
-rw-r--r--app/menus/plug-in-menus.c574
-rw-r--r--app/menus/plug-in-menus.h26
-rw-r--r--app/menus/tool-options-menu.c161
-rw-r--r--app/menus/tool-options-menu.h26
-rw-r--r--app/menus/window-menu.c168
-rw-r--r--app/menus/window-menu.h27
-rw-r--r--app/menus/windows-menu.c440
-rw-r--r--app/menus/windows-menu.h26
21 files changed, 3401 insertions, 0 deletions
diff --git a/app/menus/Makefile.am b/app/menus/Makefile.am
new file mode 100644
index 0000000..32968bb
--- /dev/null
+++ b/app/menus/Makefile.am
@@ -0,0 +1,34 @@
+## Process this file with automake to produce Makefile.in
+
+AM_CPPFLAGS = \
+ -DG_LOG_DOMAIN=\"Gimp-Menus\" \
+ -I$(top_builddir) \
+ -I$(top_srcdir) \
+ -I$(top_builddir)/app \
+ -I$(top_srcdir)/app \
+ $(GEGL_CFLAGS) \
+ $(GTK_CFLAGS) \
+ -I$(includedir)
+
+noinst_LIBRARIES = libappmenus.a
+
+libappmenus_a_SOURCES = \
+ menus-types.h \
+ menus.c \
+ menus.h \
+ dockable-menu.c \
+ dockable-menu.h \
+ file-menu.c \
+ file-menu.h \
+ filters-menu.c \
+ filters-menu.h \
+ image-menu.c \
+ image-menu.h \
+ plug-in-menus.c \
+ plug-in-menus.h \
+ tool-options-menu.c \
+ tool-options-menu.h \
+ window-menu.c \
+ window-menu.h \
+ windows-menu.c \
+ windows-menu.h
diff --git a/app/menus/Makefile.in b/app/menus/Makefile.in
new file mode 100644
index 0000000..50da784
--- /dev/null
+++ b/app/menus/Makefile.in
@@ -0,0 +1,963 @@
+# 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 = app/menus
+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 $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libappmenus_a_AR = $(AR) $(ARFLAGS)
+libappmenus_a_LIBADD =
+am_libappmenus_a_OBJECTS = menus.$(OBJEXT) dockable-menu.$(OBJEXT) \
+ file-menu.$(OBJEXT) filters-menu.$(OBJEXT) \
+ image-menu.$(OBJEXT) plug-in-menus.$(OBJEXT) \
+ tool-options-menu.$(OBJEXT) window-menu.$(OBJEXT) \
+ windows-menu.$(OBJEXT)
+libappmenus_a_OBJECTS = $(am_libappmenus_a_OBJECTS)
+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)/dockable-menu.Po \
+ ./$(DEPDIR)/file-menu.Po ./$(DEPDIR)/filters-menu.Po \
+ ./$(DEPDIR)/image-menu.Po ./$(DEPDIR)/menus.Po \
+ ./$(DEPDIR)/plug-in-menus.Po ./$(DEPDIR)/tool-options-menu.Po \
+ ./$(DEPDIR)/window-menu.Po ./$(DEPDIR)/windows-menu.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+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 =
+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 = $(libappmenus_a_SOURCES)
+DIST_SOURCES = $(libappmenus_a_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
+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@
+AM_CPPFLAGS = \
+ -DG_LOG_DOMAIN=\"Gimp-Menus\" \
+ -I$(top_builddir) \
+ -I$(top_srcdir) \
+ -I$(top_builddir)/app \
+ -I$(top_srcdir)/app \
+ $(GEGL_CFLAGS) \
+ $(GTK_CFLAGS) \
+ -I$(includedir)
+
+noinst_LIBRARIES = libappmenus.a
+libappmenus_a_SOURCES = \
+ menus-types.h \
+ menus.c \
+ menus.h \
+ dockable-menu.c \
+ dockable-menu.h \
+ file-menu.c \
+ file-menu.h \
+ filters-menu.c \
+ filters-menu.h \
+ image-menu.c \
+ image-menu.h \
+ plug-in-menus.c \
+ plug-in-menus.h \
+ tool-options-menu.c \
+ tool-options-menu.h \
+ window-menu.c \
+ window-menu.h \
+ windows-menu.c \
+ windows-menu.h
+
+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 app/menus/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu app/menus/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):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+libappmenus.a: $(libappmenus_a_OBJECTS) $(libappmenus_a_DEPENDENCIES) $(EXTRA_libappmenus_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libappmenus.a
+ $(AM_V_AR)$(libappmenus_a_AR) libappmenus.a $(libappmenus_a_OBJECTS) $(libappmenus_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libappmenus.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dockable-menu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-menu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filters-menu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image-menu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menus.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plug-in-menus.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tool-options-menu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/window-menu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-menu.Po@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
+
+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 $(LIBRARIES)
+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 clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ./$(DEPDIR)/dockable-menu.Po
+ -rm -f ./$(DEPDIR)/file-menu.Po
+ -rm -f ./$(DEPDIR)/filters-menu.Po
+ -rm -f ./$(DEPDIR)/image-menu.Po
+ -rm -f ./$(DEPDIR)/menus.Po
+ -rm -f ./$(DEPDIR)/plug-in-menus.Po
+ -rm -f ./$(DEPDIR)/tool-options-menu.Po
+ -rm -f ./$(DEPDIR)/window-menu.Po
+ -rm -f ./$(DEPDIR)/windows-menu.Po
+ -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-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)/dockable-menu.Po
+ -rm -f ./$(DEPDIR)/file-menu.Po
+ -rm -f ./$(DEPDIR)/filters-menu.Po
+ -rm -f ./$(DEPDIR)/image-menu.Po
+ -rm -f ./$(DEPDIR)/menus.Po
+ -rm -f ./$(DEPDIR)/plug-in-menus.Po
+ -rm -f ./$(DEPDIR)/tool-options-menu.Po
+ -rm -f ./$(DEPDIR)/window-menu.Po
+ -rm -f ./$(DEPDIR)/windows-menu.Po
+ -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:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libtool clean-noinstLIBRARIES \
+ 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-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
+
+.PRECIOUS: Makefile
+
+
+# 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/app/menus/dockable-menu.c b/app/menus/dockable-menu.c
new file mode 100644
index 0000000..ccc6537
--- /dev/null
+++ b/app/menus/dockable-menu.c
@@ -0,0 +1,34 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl.h>
+#include <gtk/gtk.h>
+
+#include "menus-types.h"
+
+#include "dockable-menu.h"
+#include "window-menu.h"
+
+
+void
+dockable_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path)
+{
+ window_menu_setup (manager, "dock", ui_path);
+}
diff --git a/app/menus/dockable-menu.h b/app/menus/dockable-menu.h
new file mode 100644
index 0000000..1fd2483
--- /dev/null
+++ b/app/menus/dockable-menu.h
@@ -0,0 +1,26 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef __DOCKABLE_MENU_H__
+#define __DOCKABLE_MENU_H__
+
+
+void dockable_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path);
+
+
+#endif /* __DOCKABLE_MENU_H__ */
diff --git a/app/menus/file-menu.c b/app/menus/file-menu.c
new file mode 100644
index 0000000..019b6b0
--- /dev/null
+++ b/app/menus/file-menu.c
@@ -0,0 +1,120 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl.h>
+#include <gtk/gtk.h>
+
+#include "libgimpthumb/gimpthumb.h"
+
+#include "menus-types.h"
+
+#include "config/gimpguiconfig.h"
+
+#include "core/gimp.h"
+#include "core/gimpviewable.h"
+
+#include "widgets/gimpaction.h"
+#include "widgets/gimpactionimpl.h"
+#include "widgets/gimpuimanager.h"
+
+#include "file-menu.h"
+
+
+static gboolean file_menu_open_recent_query_tooltip (GtkWidget *widget,
+ gint x,
+ gint y,
+ gboolean keyboard_mode,
+ GtkTooltip *tooltip,
+ GimpAction *action);
+
+
+void
+file_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path)
+{
+ gint n_entries;
+ guint merge_id;
+ gint i;
+
+ g_return_if_fail (GIMP_IS_UI_MANAGER (manager));
+ g_return_if_fail (ui_path != NULL);
+
+ n_entries = GIMP_GUI_CONFIG (manager->gimp->config)->last_opened_size;
+
+ merge_id = gimp_ui_manager_new_merge_id (manager);
+
+ for (i = 0; i < n_entries; i++)
+ {
+ GtkWidget *widget;
+ gchar *action_name;
+ gchar *action_path;
+ gchar *full_path;
+
+ action_name = g_strdup_printf ("file-open-recent-%02d", i + 1);
+ action_path = g_strdup_printf ("%s/File/Open Recent/Files", ui_path);
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ action_path, action_name, action_name,
+ GTK_UI_MANAGER_MENUITEM,
+ FALSE);
+
+ full_path = g_strconcat (action_path, "/", action_name, NULL);
+
+ widget = gimp_ui_manager_get_widget (manager, full_path);
+
+ if (widget)
+ {
+ GimpAction *action;
+
+ action = gimp_ui_manager_find_action (manager, "file", action_name);
+
+ g_signal_connect_object (widget, "query-tooltip",
+ G_CALLBACK (file_menu_open_recent_query_tooltip),
+ action, 0);
+ }
+
+ g_free (action_name);
+ g_free (action_path);
+ g_free (full_path);
+ }
+}
+
+static gboolean
+file_menu_open_recent_query_tooltip (GtkWidget *widget,
+ gint x,
+ gint y,
+ gboolean keyboard_mode,
+ GtkTooltip *tooltip,
+ GimpAction *action)
+{
+ GimpActionImpl *impl = GIMP_ACTION_IMPL (action);
+ gchar *text;
+
+ text = gtk_widget_get_tooltip_text (widget);
+ gtk_tooltip_set_text (tooltip, text);
+ g_free (text);
+
+ gtk_tooltip_set_icon (tooltip,
+ gimp_viewable_get_pixbuf (impl->viewable,
+ impl->context,
+ GIMP_THUMB_SIZE_NORMAL,
+ GIMP_THUMB_SIZE_NORMAL));
+
+ return TRUE;
+}
diff --git a/app/menus/file-menu.h b/app/menus/file-menu.h
new file mode 100644
index 0000000..e439e8d
--- /dev/null
+++ b/app/menus/file-menu.h
@@ -0,0 +1,26 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef __FILE_MENU_H__
+#define __FILE_MENU_H__
+
+
+void file_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path);
+
+
+#endif /* __FILE_MENU_H__ */
diff --git a/app/menus/filters-menu.c b/app/menus/filters-menu.c
new file mode 100644
index 0000000..8ffbcc3
--- /dev/null
+++ b/app/menus/filters-menu.c
@@ -0,0 +1,64 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl.h>
+#include <gtk/gtk.h>
+
+#include "menus-types.h"
+
+#include "core/gimp.h"
+#include "core/gimp-filter-history.h"
+
+#include "widgets/gimpuimanager.h"
+
+#include "filters-menu.h"
+
+
+/* public functions */
+
+void
+filters_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path)
+{
+ guint merge_id;
+ gint i;
+
+ g_return_if_fail (GIMP_IS_UI_MANAGER (manager));
+ g_return_if_fail (ui_path != NULL);
+
+ merge_id = gimp_ui_manager_new_merge_id (manager);
+
+ for (i = 0; i < gimp_filter_history_size (manager->gimp); i++)
+ {
+ gchar *action_name;
+ gchar *action_path;
+
+ action_name = g_strdup_printf ("filters-recent-%02d", i + 1);
+ action_path = g_strdup_printf ("%s/Filters/Recently Used/Filters",
+ ui_path);
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ action_path, action_name, action_name,
+ GTK_UI_MANAGER_MENUITEM,
+ FALSE);
+
+ g_free (action_name);
+ g_free (action_path);
+ }
+}
diff --git a/app/menus/filters-menu.h b/app/menus/filters-menu.h
new file mode 100644
index 0000000..9c1a705
--- /dev/null
+++ b/app/menus/filters-menu.h
@@ -0,0 +1,26 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef __FILTERS_MENU_H__
+#define __FILTERS_MENU_H__
+
+
+void filters_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path);
+
+
+#endif /* __FILTERS_MENU_H__ */
diff --git a/app/menus/image-menu.c b/app/menus/image-menu.c
new file mode 100644
index 0000000..64bd9cd
--- /dev/null
+++ b/app/menus/image-menu.c
@@ -0,0 +1,52 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#include <gegl.h>
+#include <gtk/gtk.h>
+
+#include "menus-types.h"
+
+#include "file-menu.h"
+#include "filters-menu.h"
+#include "image-menu.h"
+#include "plug-in-menus.h"
+#include "window-menu.h"
+#include "windows-menu.h"
+
+
+void
+image_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path)
+{
+ gchar *path;
+
+ if (! strcmp (ui_path, "/dummy-menubar"))
+ ui_path = "/dummy-menubar/image-popup";
+
+ file_menu_setup (manager, ui_path);
+ windows_menu_setup (manager, ui_path);
+ plug_in_menus_setup (manager, ui_path);
+ filters_menu_setup (manager, ui_path);
+
+ path = g_strconcat (ui_path, "/View", NULL);
+ window_menu_setup (manager, "view", path);
+ g_free (path);
+}
diff --git a/app/menus/image-menu.h b/app/menus/image-menu.h
new file mode 100644
index 0000000..0ae5418
--- /dev/null
+++ b/app/menus/image-menu.h
@@ -0,0 +1,26 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef __IMAGE_MENU_H__
+#define __IMAGE_MENU_H__
+
+
+void image_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path);
+
+
+#endif /* __IMAGE_MENU_H__ */
diff --git a/app/menus/menus-types.h b/app/menus/menus-types.h
new file mode 100644
index 0000000..1c05529
--- /dev/null
+++ b/app/menus/menus-types.h
@@ -0,0 +1,25 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MENUS_TYPES_H__
+#define __MENUS_TYPES_H__
+
+
+#include "actions/actions-types.h"
+
+
+#endif /* __MENUS_TYPES_H__ */
diff --git a/app/menus/menus.c b/app/menus/menus.c
new file mode 100644
index 0000000..79a3f25
--- /dev/null
+++ b/app/menus/menus.c
@@ -0,0 +1,519 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl.h>
+#include <gtk/gtk.h>
+
+#include "libgimpbase/gimpbase.h"
+
+#include "menus-types.h"
+
+#include "config/gimpconfig-file.h"
+#include "config/gimpguiconfig.h"
+
+#include "core/gimp.h"
+
+#include "widgets/gimpactionfactory.h"
+#include "widgets/gimpdashboard.h"
+#include "widgets/gimpmenufactory.h"
+
+#include "dockable-menu.h"
+#include "image-menu.h"
+#include "menus.h"
+#include "plug-in-menus.h"
+#include "tool-options-menu.h"
+
+#include "gimp-intl.h"
+
+
+/* local function prototypes */
+
+static void menus_can_change_accels (GimpGuiConfig *config);
+static void menus_remove_accels (gpointer data,
+ const gchar *accel_path,
+ guint accel_key,
+ GdkModifierType accel_mods,
+ gboolean changed);
+
+
+/* global variables */
+
+GimpMenuFactory * global_menu_factory = NULL;
+
+
+/* private variables */
+
+static gboolean menurc_deleted = FALSE;
+
+
+/* public functions */
+
+void
+menus_init (Gimp *gimp,
+ GimpActionFactory *action_factory)
+{
+ g_return_if_fail (GIMP_IS_GIMP (gimp));
+ g_return_if_fail (GIMP_IS_ACTION_FACTORY (action_factory));
+ g_return_if_fail (global_menu_factory == NULL);
+
+ /* We need to make sure the property is installed before using it */
+ g_type_class_ref (GTK_TYPE_MENU);
+
+ menus_can_change_accels (GIMP_GUI_CONFIG (gimp->config));
+
+ g_signal_connect (gimp->config, "notify::can-change-accels",
+ G_CALLBACK (menus_can_change_accels), NULL);
+
+ global_menu_factory = gimp_menu_factory_new (gimp, action_factory);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Image>",
+ "file",
+ "context",
+ "debug",
+ "help",
+ "edit",
+ "select",
+ "view",
+ "image",
+ "drawable",
+ "layers",
+ "channels",
+ "vectors",
+ "tools",
+ "dialogs",
+ "windows",
+ "plug-in",
+ "filters",
+ "quick-mask",
+ NULL,
+ "/image-menubar",
+ "image-menu.xml", image_menu_setup,
+ "/dummy-menubar",
+ "image-menu.xml", image_menu_setup,
+ "/quick-mask-popup",
+ "quick-mask-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Toolbox>",
+ "file",
+ "context",
+ "help",
+ "edit",
+ "select",
+ "view",
+ "image",
+ "drawable",
+ "layers",
+ "channels",
+ "vectors",
+ "tools",
+ "windows",
+ "dialogs",
+ "plug-in",
+ "filters",
+ "quick-mask",
+ NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Dock>",
+ "file",
+ "context",
+ "edit",
+ "select",
+ "view",
+ "image",
+ "drawable",
+ "layers",
+ "channels",
+ "vectors",
+ "tools",
+ "windows",
+ "dialogs",
+ "plug-in",
+ "quick-mask",
+ "dock",
+ NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Layers>",
+ "layers",
+ "plug-in",
+ "filters",
+ NULL,
+ "/layers-popup",
+ "layers-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Channels>",
+ "channels",
+ "plug-in",
+ "filters",
+ NULL,
+ "/channels-popup",
+ "channels-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Vectors>",
+ "vectors",
+ "plug-in",
+ NULL,
+ "/vectors-popup",
+ "vectors-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Colormap>",
+ "colormap",
+ "plug-in",
+ NULL,
+ "/colormap-popup",
+ "colormap-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Dockable>",
+ "dockable",
+ "dock",
+ NULL,
+ "/dockable-popup",
+ "dockable-menu.xml", dockable_menu_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Brushes>",
+ "brushes",
+ "plug-in",
+ NULL,
+ "/brushes-popup",
+ "brushes-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Dynamics>",
+ "dynamics",
+ "plug-in",
+ NULL,
+ "/dynamics-popup",
+ "dynamics-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<MyPaintBrushes>",
+ "mypaint-brushes",
+ "plug-in",
+ NULL,
+ "/mypaint-brushes-popup",
+ "mypaint-brushes-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Patterns>",
+ "patterns",
+ "plug-in",
+ NULL,
+ "/patterns-popup",
+ "patterns-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Gradients>",
+ "gradients",
+ "plug-in",
+ NULL,
+ "/gradients-popup",
+ "gradients-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Palettes>",
+ "palettes",
+ "plug-in",
+ NULL,
+ "/palettes-popup",
+ "palettes-menu.xml", plug_in_menus_setup,
+ NULL);
+
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<ToolPresets>",
+ "tool-presets",
+ "plug-in",
+ NULL,
+ "/tool-presets-popup",
+ "tool-presets-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Fonts>",
+ "fonts",
+ "plug-in",
+ NULL,
+ "/fonts-popup",
+ "fonts-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Buffers>",
+ "buffers",
+ "plug-in",
+ NULL,
+ "/buffers-popup",
+ "buffers-menu.xml", plug_in_menus_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Documents>",
+ "documents",
+ NULL,
+ "/documents-popup",
+ "documents-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Templates>",
+ "templates",
+ NULL,
+ "/templates-popup",
+ "templates-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Images>",
+ "images",
+ NULL,
+ "/images-popup",
+ "images-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<BrushEditor>",
+ "brush-editor",
+ NULL,
+ "/brush-editor-popup",
+ "brush-editor-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<DynamicsEditor>",
+ "dynamics-editor",
+ NULL,
+ "/dynamics-editor-popup",
+ "dynamics-editor-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<GradientEditor>",
+ "gradient-editor",
+ NULL,
+ "/gradient-editor-popup",
+ "gradient-editor-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<PaletteEditor>",
+ "palette-editor",
+ NULL,
+ "/palette-editor-popup",
+ "palette-editor-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<ToolPresetEditor>",
+ "tool-preset-editor",
+ NULL,
+ "/tool-preset-editor-popup",
+ "tool-preset-editor-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Selection>",
+ "select",
+ "vectors",
+ NULL,
+ "/selection-popup",
+ "selection-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<NavigationEditor>",
+ "view",
+ NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Undo>",
+ "edit",
+ NULL,
+ "/undo-popup",
+ "undo-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<ErrorConsole>",
+ "error-console",
+ NULL,
+ "/error-console-popup",
+ "error-console-menu.xml", NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<ToolOptions>",
+ "tool-options",
+ NULL,
+ "/tool-options-popup",
+ "tool-options-menu.xml",
+ tool_options_menu_setup,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<TextEditor>",
+ "text-editor",
+ NULL,
+ "/text-editor-toolbar",
+ "text-editor-toolbar.xml",
+ NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<TextTool>",
+ "text-tool",
+ NULL,
+ "/text-tool-popup",
+ "text-tool-menu.xml",
+ NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<CursorInfo>",
+ "cursor-info",
+ NULL,
+ "/cursor-info-popup",
+ "cursor-info-menu.xml",
+ NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<SamplePoints>",
+ "sample-points",
+ NULL,
+ "/sample-points-popup",
+ "sample-points-menu.xml",
+ NULL,
+ NULL);
+
+ gimp_menu_factory_manager_register (global_menu_factory, "<Dashboard>",
+ "dashboard",
+ NULL,
+ "/dashboard-popup",
+ "dashboard-menu.xml", gimp_dashboard_menu_setup,
+ NULL);
+}
+
+void
+menus_exit (Gimp *gimp)
+{
+ g_return_if_fail (GIMP_IS_GIMP (gimp));
+ g_return_if_fail (global_menu_factory != NULL);
+
+ g_object_unref (global_menu_factory);
+ global_menu_factory = NULL;
+
+ g_signal_handlers_disconnect_by_func (gimp->config,
+ menus_can_change_accels,
+ NULL);
+}
+
+void
+menus_restore (Gimp *gimp)
+{
+ gchar *filename;
+
+ g_return_if_fail (GIMP_IS_GIMP (gimp));
+
+ filename = gimp_personal_rc_file ("menurc");
+
+ if (gimp->be_verbose)
+ g_print ("Parsing '%s'\n", gimp_filename_to_utf8 (filename));
+
+ gtk_accel_map_load (filename);
+ g_free (filename);
+}
+
+void
+menus_save (Gimp *gimp,
+ gboolean always_save)
+{
+ gchar *filename;
+
+ g_return_if_fail (GIMP_IS_GIMP (gimp));
+
+ if (menurc_deleted && ! always_save)
+ return;
+
+ filename = gimp_personal_rc_file ("menurc");
+
+ if (gimp->be_verbose)
+ g_print ("Writing '%s'\n", gimp_filename_to_utf8 (filename));
+
+ gtk_accel_map_save (filename);
+ g_free (filename);
+
+ menurc_deleted = FALSE;
+}
+
+gboolean
+menus_clear (Gimp *gimp,
+ GError **error)
+{
+ GFile *file;
+ GFile *source;
+ gboolean success = TRUE;
+ GError *my_error = NULL;
+
+ g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ file = gimp_directory_file ("menurc", NULL);
+ source = gimp_sysconf_directory_file ("menurc", NULL);
+
+ if (g_file_copy (source, file, G_FILE_COPY_OVERWRITE,
+ NULL, NULL, NULL, NULL))
+ {
+ menurc_deleted = TRUE;
+ }
+ else if (! g_file_delete (file, NULL, &my_error) &&
+ my_error->code != G_IO_ERROR_NOT_FOUND)
+ {
+ g_set_error (error, my_error->domain, my_error->code,
+ _("Deleting \"%s\" failed: %s"),
+ gimp_file_get_utf8_name (file), my_error->message);
+ success = FALSE;
+ }
+ else
+ {
+ menurc_deleted = TRUE;
+ }
+
+ g_clear_error (&my_error);
+ g_object_unref (source);
+ g_object_unref (file);
+
+ return success;
+}
+
+void
+menus_remove (Gimp *gimp)
+{
+ g_return_if_fail (GIMP_IS_GIMP (gimp));
+
+ gtk_accel_map_foreach (gimp, menus_remove_accels);
+}
+
+
+/* private functions */
+
+static void
+menus_can_change_accels (GimpGuiConfig *config)
+{
+ g_object_set (gtk_settings_get_for_screen (gdk_screen_get_default ()),
+ "gtk-can-change-accels", config->can_change_accels,
+ NULL);
+}
+
+static void
+menus_remove_accels (gpointer data,
+ const gchar *accel_path,
+ guint accel_key,
+ GdkModifierType accel_mods,
+ gboolean changed)
+{
+ gtk_accel_map_change_entry (accel_path, 0, 0, TRUE);
+}
diff --git a/app/menus/menus.h b/app/menus/menus.h
new file mode 100644
index 0000000..ba59045
--- /dev/null
+++ b/app/menus/menus.h
@@ -0,0 +1,38 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MENUS_H__
+#define __MENUS_H__
+
+
+extern GimpMenuFactory *global_menu_factory;
+
+
+void menus_init (Gimp *gimp,
+ GimpActionFactory *action_factory);
+void menus_exit (Gimp *gimp);
+
+void menus_restore (Gimp *gimp);
+void menus_save (Gimp *gimp,
+ gboolean always_save);
+
+gboolean menus_clear (Gimp *gimp,
+ GError **error);
+void menus_remove (Gimp *gimp);
+
+
+#endif /* __MENUS_H__ */
diff --git a/app/menus/plug-in-menus.c b/app/menus/plug-in-menus.c
new file mode 100644
index 0000000..8efdeb4
--- /dev/null
+++ b/app/menus/plug-in-menus.c
@@ -0,0 +1,574 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <gegl.h>
+
+#include "libgimpbase/gimpbase.h"
+
+#include "menus-types.h"
+
+#include "config/gimpcoreconfig.h"
+
+#include "core/gimp.h"
+
+#include "plug-in/gimppluginmanager.h"
+#include "plug-in/gimppluginmanager-locale-domain.h"
+#include "plug-in/gimppluginprocedure.h"
+
+#include "widgets/gimpuimanager.h"
+
+#include "plug-in-menus.h"
+
+#include "gimp-log.h"
+#include "gimp-intl.h"
+
+
+typedef struct _PlugInMenuEntry PlugInMenuEntry;
+
+struct _PlugInMenuEntry
+{
+ GimpPlugInProcedure *proc;
+ const gchar *menu_path;
+};
+
+
+/* local function prototypes */
+
+static void plug_in_menus_register_procedure (GimpPDB *pdb,
+ GimpProcedure *procedure,
+ GimpUIManager *manager);
+static void plug_in_menus_unregister_procedure (GimpPDB *pdb,
+ GimpProcedure *procedure,
+ GimpUIManager *manager);
+static void plug_in_menus_menu_path_added (GimpPlugInProcedure *plug_in_proc,
+ const gchar *menu_path,
+ GimpUIManager *manager);
+static void plug_in_menus_add_proc (GimpUIManager *manager,
+ const gchar *ui_path,
+ GimpPlugInProcedure *proc,
+ const gchar *menu_path);
+static void plug_in_menus_tree_insert (GTree *entries,
+ const gchar * path,
+ PlugInMenuEntry *entry);
+static gboolean plug_in_menus_tree_traverse (gpointer key,
+ PlugInMenuEntry *entry,
+ GimpUIManager *manager);
+static gchar * plug_in_menus_build_path (GimpUIManager *manager,
+ const gchar *ui_path,
+ guint merge_id,
+ const gchar *menu_path,
+ gboolean for_menu);
+static void plug_in_menu_entry_free (PlugInMenuEntry *entry);
+
+
+/* public functions */
+
+void
+plug_in_menus_setup (GimpUIManager *manager,
+ const gchar *ui_path)
+{
+ GimpPlugInManager *plug_in_manager;
+ GTree *menu_entries;
+ GSList *list;
+ guint merge_id;
+ gint i;
+
+ g_return_if_fail (GIMP_IS_UI_MANAGER (manager));
+ g_return_if_fail (ui_path != NULL);
+
+ plug_in_manager = manager->gimp->plug_in_manager;
+
+ merge_id = gimp_ui_manager_new_merge_id (manager);
+
+ for (i = 0; i < manager->gimp->config->filter_history_size; i++)
+ {
+ gchar *action_name;
+ gchar *action_path;
+
+ action_name = g_strdup_printf ("filter-recent-%02d", i + 1);
+ action_path = g_strdup_printf ("%s/Filters/Recently Used/Plug-ins",
+ ui_path);
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ action_path, action_name, action_name,
+ GTK_UI_MANAGER_MENUITEM,
+ FALSE);
+
+ g_free (action_name);
+ g_free (action_path);
+ }
+
+ menu_entries = g_tree_new_full ((GCompareDataFunc) strcmp, NULL,
+ g_free,
+ (GDestroyNotify) plug_in_menu_entry_free);
+
+ for (list = plug_in_manager->plug_in_procedures;
+ list;
+ list = g_slist_next (list))
+ {
+ GimpPlugInProcedure *plug_in_proc = list->data;
+
+ if (! plug_in_proc->file)
+ continue;
+
+ g_signal_connect_object (plug_in_proc, "menu-path-added",
+ G_CALLBACK (plug_in_menus_menu_path_added),
+ manager, 0);
+
+ if (plug_in_proc->menu_paths &&
+ ! plug_in_proc->file_proc)
+ {
+ GList *path;
+
+ for (path = plug_in_proc->menu_paths; path; path = g_list_next (path))
+ {
+ if (g_str_has_prefix (path->data, manager->name))
+ {
+ PlugInMenuEntry *entry = g_slice_new0 (PlugInMenuEntry);
+ GFile *file;
+ const gchar *locale_domain;
+
+ entry->proc = plug_in_proc;
+ entry->menu_path = path->data;
+
+ file = gimp_plug_in_procedure_get_file (plug_in_proc);
+
+ locale_domain =
+ gimp_plug_in_manager_get_locale_domain (plug_in_manager,
+ file, NULL);
+
+ if (plug_in_proc->menu_label)
+ {
+ gchar *menu;
+
+ menu = g_strconcat (dgettext (locale_domain,
+ path->data),
+ "/",
+ dgettext (locale_domain,
+ plug_in_proc->menu_label),
+ NULL);
+
+ plug_in_menus_tree_insert (menu_entries, menu, entry);
+ g_free (menu);
+ }
+ else
+ {
+ plug_in_menus_tree_insert (menu_entries,
+ dgettext (locale_domain,
+ path->data),
+ entry);
+ }
+ }
+ }
+ }
+ }
+
+ g_object_set_data (G_OBJECT (manager), "ui-path", (gpointer) ui_path);
+
+ g_tree_foreach (menu_entries,
+ (GTraverseFunc) plug_in_menus_tree_traverse,
+ manager);
+
+ g_object_set_data (G_OBJECT (manager), "ui-path", NULL);
+
+ g_tree_destroy (menu_entries);
+
+ g_signal_connect_object (manager->gimp->pdb, "register-procedure",
+ G_CALLBACK (plug_in_menus_register_procedure),
+ manager, 0);
+ g_signal_connect_object (manager->gimp->pdb, "unregister-procedure",
+ G_CALLBACK (plug_in_menus_unregister_procedure),
+ manager, 0);
+}
+
+
+/* private functions */
+
+static void
+plug_in_menus_register_procedure (GimpPDB *pdb,
+ GimpProcedure *procedure,
+ GimpUIManager *manager)
+{
+ if (GIMP_IS_PLUG_IN_PROCEDURE (procedure))
+ {
+ GimpPlugInProcedure *plug_in_proc = GIMP_PLUG_IN_PROCEDURE (procedure);
+
+ g_signal_connect_object (plug_in_proc, "menu-path-added",
+ G_CALLBACK (plug_in_menus_menu_path_added),
+ manager, 0);
+
+ if ((plug_in_proc->menu_label || plug_in_proc->menu_paths) &&
+ ! plug_in_proc->file_proc)
+ {
+ GList *list;
+
+
+ GIMP_LOG (MENUS, "register procedure: %s",
+ gimp_object_get_name (procedure));
+
+ for (list = plug_in_proc->menu_paths; list; list = g_list_next (list))
+ plug_in_menus_menu_path_added (plug_in_proc, list->data, manager);
+ }
+ }
+}
+
+static void
+plug_in_menus_unregister_procedure (GimpPDB *pdb,
+ GimpProcedure *procedure,
+ GimpUIManager *manager)
+{
+ if (GIMP_IS_PLUG_IN_PROCEDURE (procedure))
+ {
+ GimpPlugInProcedure *plug_in_proc = GIMP_PLUG_IN_PROCEDURE (procedure);
+
+ g_signal_handlers_disconnect_by_func (plug_in_proc,
+ plug_in_menus_menu_path_added,
+ manager);
+
+ if ((plug_in_proc->menu_label || plug_in_proc->menu_paths) &&
+ ! plug_in_proc->file_proc)
+ {
+ GList *list;
+
+ GIMP_LOG (MENUS, "unregister procedure: %s",
+ gimp_object_get_name (procedure));
+
+ for (list = plug_in_proc->menu_paths; list; list = g_list_next (list))
+ {
+ if (g_str_has_prefix (list->data, manager->name))
+ {
+ gchar *merge_key;
+ guint merge_id;
+
+ merge_key = g_strdup_printf ("%s-merge-id",
+ gimp_object_get_name (plug_in_proc));
+ merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager),
+ merge_key));
+ g_free (merge_key);
+
+ if (merge_id)
+ gimp_ui_manager_remove_ui (manager, merge_id);
+
+ break;
+ }
+ }
+ }
+ }
+}
+
+static void
+plug_in_menus_menu_path_added (GimpPlugInProcedure *plug_in_proc,
+ const gchar *menu_path,
+ GimpUIManager *manager)
+{
+ GIMP_LOG (MENUS, "menu path added: %s (%s)",
+ gimp_object_get_name (plug_in_proc), menu_path);
+
+ if (g_str_has_prefix (menu_path, manager->name))
+ {
+ if (! strcmp (manager->name, "<Image>"))
+ {
+ plug_in_menus_add_proc (manager, "/image-menubar",
+ plug_in_proc, menu_path);
+ plug_in_menus_add_proc (manager, "/dummy-menubar/image-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Layers>"))
+ {
+ plug_in_menus_add_proc (manager, "/layers-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Channels>"))
+ {
+ plug_in_menus_add_proc (manager, "/channels-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Vectors>"))
+ {
+ plug_in_menus_add_proc (manager, "/vectors-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Colormap>"))
+ {
+ plug_in_menus_add_proc (manager, "/colormap-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Brushes>"))
+ {
+ plug_in_menus_add_proc (manager, "/brushes-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Dynamics>"))
+ {
+ plug_in_menus_add_proc (manager, "/dynamics-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<MyPaintBrushes>"))
+ {
+ plug_in_menus_add_proc (manager, "/mypaint-brushes-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Gradients>"))
+ {
+ plug_in_menus_add_proc (manager, "/gradients-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Palettes>"))
+ {
+ plug_in_menus_add_proc (manager, "/palettes-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Patterns>"))
+ {
+ plug_in_menus_add_proc (manager, "/patterns-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<ToolPresets>"))
+ {
+ plug_in_menus_add_proc (manager, "/tool-presets-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Fonts>"))
+ {
+ plug_in_menus_add_proc (manager, "/fonts-popup",
+ plug_in_proc, menu_path);
+ }
+ else if (! strcmp (manager->name, "<Buffers>"))
+ {
+ plug_in_menus_add_proc (manager, "/buffers-popup",
+ plug_in_proc, menu_path);
+ }
+ }
+}
+
+static void
+plug_in_menus_add_proc (GimpUIManager *manager,
+ const gchar *ui_path,
+ GimpPlugInProcedure *proc,
+ const gchar *menu_path)
+{
+ gchar *path;
+ gchar *merge_key;
+ gchar *stripped_path;
+ gchar *action_path;
+ guint merge_id;
+ guint menu_merge_id;
+
+ g_return_if_fail (GIMP_IS_UI_MANAGER (manager));
+ g_return_if_fail (ui_path != NULL);
+ g_return_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc));
+
+ path = g_strdup (menu_path);
+
+ if (! proc->menu_label)
+ {
+ gchar *p;
+
+ if (! path)
+ return;
+
+ p = strrchr (path, '/');
+ if (! p)
+ {
+ g_free (path);
+ return;
+ }
+
+ *p = '\0';
+ }
+
+ merge_key = g_strdup_printf ("%s-merge-id", gimp_object_get_name (proc));
+
+ merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager),
+ merge_key));
+
+ if (! merge_id)
+ {
+ merge_id = gimp_ui_manager_new_merge_id (manager);
+ g_object_set_data (G_OBJECT (manager), merge_key,
+ GUINT_TO_POINTER (merge_id));
+ }
+
+ g_free (merge_key);
+
+ menu_merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager),
+ "plug-in-menu-merge-id"));
+
+ if (! menu_merge_id)
+ {
+ menu_merge_id = gimp_ui_manager_new_merge_id (manager);
+ g_object_set_data (G_OBJECT (manager), "plug-in-menu-merge-id",
+ GUINT_TO_POINTER (menu_merge_id));
+ }
+
+ stripped_path = gimp_strip_uline (path);
+ action_path = plug_in_menus_build_path (manager, ui_path, menu_merge_id,
+ stripped_path, FALSE);
+ g_free (stripped_path);
+
+ if (! action_path)
+ {
+ g_free (path);
+ return;
+ }
+
+ GIMP_LOG (MENUS, "adding menu item for '%s' (@ %s)",
+ gimp_object_get_name (proc), action_path);
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ action_path,
+ gimp_object_get_name (proc),
+ gimp_object_get_name (proc),
+ GTK_UI_MANAGER_MENUITEM,
+ FALSE);
+
+ g_free (action_path);
+ g_free (path);
+}
+
+static void
+plug_in_menus_tree_insert (GTree *entries,
+ const gchar *path,
+ PlugInMenuEntry *entry)
+{
+ gchar *strip = gimp_strip_uline (path);
+ gchar *key;
+
+ /* Append the procedure name to the menu path in order to get a unique
+ * key even if two procedures are installed to the same menu entry.
+ */
+ key = g_strconcat (strip, gimp_object_get_name (entry->proc), NULL);
+
+ g_tree_insert (entries, g_utf8_collate_key (key, -1), entry);
+
+ g_free (key);
+ g_free (strip);
+}
+
+static gboolean
+plug_in_menus_tree_traverse (gpointer key,
+ PlugInMenuEntry *entry,
+ GimpUIManager *manager)
+{
+ const gchar *ui_path = g_object_get_data (G_OBJECT (manager), "ui-path");
+
+ plug_in_menus_add_proc (manager, ui_path, entry->proc, entry->menu_path);
+
+ return FALSE;
+}
+
+static gchar *
+plug_in_menus_build_path (GimpUIManager *manager,
+ const gchar *ui_path,
+ guint merge_id,
+ const gchar *menu_path,
+ gboolean for_menu)
+{
+ gchar *action_path;
+
+ if (! strchr (menu_path, '/'))
+ {
+ action_path = g_strdup (ui_path);
+ goto make_placeholder;
+ }
+
+ action_path = g_strdup_printf ("%s%s", ui_path, strchr (menu_path, '/'));
+
+ if (! gimp_ui_manager_get_widget (manager, action_path))
+ {
+ gchar *parent_menu_path = g_strdup (menu_path);
+ gchar *parent_action_path = NULL;
+ gchar *menu_item_name;
+
+ menu_item_name = strrchr (parent_menu_path, '/');
+
+ if (menu_item_name)
+ {
+ *menu_item_name++ = '\0';
+
+ parent_action_path = plug_in_menus_build_path (manager,
+ ui_path, merge_id,
+ parent_menu_path, TRUE);
+ }
+
+ if (parent_action_path)
+ {
+ g_free (action_path);
+ action_path = g_strdup_printf ("%s/%s",
+ parent_action_path, menu_item_name);
+
+ if (! gimp_ui_manager_get_widget (manager, action_path))
+ {
+ GIMP_LOG (MENUS, "adding menu '%s' at path '%s' for action '%s'",
+ menu_item_name, action_path, menu_path);
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ parent_action_path, menu_item_name,
+ menu_path,
+ GTK_UI_MANAGER_MENU,
+ FALSE);
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ action_path, "Menus", NULL,
+ GTK_UI_MANAGER_PLACEHOLDER,
+ FALSE);
+ gimp_ui_manager_add_ui (manager, merge_id,
+ action_path, "Separator", NULL,
+ GTK_UI_MANAGER_SEPARATOR,
+ FALSE);
+ }
+
+ g_free (parent_action_path);
+ }
+ else
+ {
+ g_free (action_path);
+ action_path = NULL;
+ }
+
+ g_free (parent_menu_path);
+ }
+
+ make_placeholder:
+
+ if (action_path && for_menu)
+ {
+ gchar *placeholder_path = g_strdup_printf ("%s/%s", action_path, "Menus");
+
+ if (gimp_ui_manager_get_widget (manager, placeholder_path))
+ {
+ g_free (action_path);
+
+ return placeholder_path;
+ }
+
+ g_free (placeholder_path);
+ }
+
+ return action_path;
+}
+
+static void
+plug_in_menu_entry_free (PlugInMenuEntry *entry)
+{
+ g_slice_free (PlugInMenuEntry, entry);
+}
diff --git a/app/menus/plug-in-menus.h b/app/menus/plug-in-menus.h
new file mode 100644
index 0000000..4e07e2e
--- /dev/null
+++ b/app/menus/plug-in-menus.h
@@ -0,0 +1,26 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef __PLUG_IN_MENUS_H__
+#define __PLUG_IN_MENUS_H__
+
+
+void plug_in_menus_setup (GimpUIManager *manager,
+ const gchar *ui_path);
+
+
+#endif /* __PLUG_IN_MENUS_H__ */
diff --git a/app/menus/tool-options-menu.c b/app/menus/tool-options-menu.c
new file mode 100644
index 0000000..6ba21a1
--- /dev/null
+++ b/app/menus/tool-options-menu.c
@@ -0,0 +1,161 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl.h>
+#include <gtk/gtk.h>
+
+#include "libgimpwidgets/gimpwidgets.h"
+
+#include "menus-types.h"
+
+#include "core/gimp.h"
+#include "core/gimpcontext.h"
+#include "core/gimplist.h"
+#include "core/gimptoolinfo.h"
+
+#include "widgets/gimphelp-ids.h"
+#include "widgets/gimpuimanager.h"
+
+#include "tool-options-menu.h"
+
+
+/* local function prototypes */
+
+static void tool_options_menu_update (GimpUIManager *manager,
+ gpointer update_data,
+ const gchar *ui_path);
+static void tool_options_menu_update_after (GimpUIManager *manager,
+ gpointer update_data,
+ const gchar *ui_path);
+static void tool_options_menu_update_presets (GimpUIManager *manager,
+ guint merge_id,
+ const gchar *ui_path,
+ const gchar *menu_path,
+ const gchar *which_action,
+ GimpContainer *presets);
+
+
+/* public functions */
+
+void
+tool_options_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path)
+{
+ g_signal_connect (manager, "update",
+ G_CALLBACK (tool_options_menu_update),
+ (gpointer) ui_path);
+ g_signal_connect_after (manager, "update",
+ G_CALLBACK (tool_options_menu_update_after),
+ (gpointer) ui_path);
+}
+
+
+/* private functions */
+
+static void
+tool_options_menu_update (GimpUIManager *manager,
+ gpointer update_data,
+ const gchar *ui_path)
+{
+ guint merge_id;
+
+ merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager),
+ "tool-options-merge-id"));
+
+ if (merge_id)
+ {
+ gimp_ui_manager_remove_ui (manager, merge_id);
+
+ g_object_set_data (G_OBJECT (manager), "tool-options-merge-id",
+ GINT_TO_POINTER (0));
+
+ gimp_ui_manager_ensure_update (manager);
+ }
+}
+
+static void
+tool_options_menu_update_after (GimpUIManager *manager,
+ gpointer update_data,
+ const gchar *ui_path)
+{
+ GimpContext *context;
+ GimpToolInfo *tool_info;
+ guint merge_id;
+
+ context = gimp_get_user_context (manager->gimp);
+ tool_info = gimp_context_get_tool (context);
+
+ if (! tool_info->presets)
+ return;
+
+ merge_id = gimp_ui_manager_new_merge_id (manager);
+
+ g_object_set_data (G_OBJECT (manager), "tool-options-merge-id",
+ GUINT_TO_POINTER (merge_id));
+
+ tool_options_menu_update_presets (manager, merge_id, ui_path,
+ "Save", "save",
+ tool_info->presets);
+
+ tool_options_menu_update_presets (manager, merge_id, ui_path,
+ "Restore", "restore",
+ tool_info->presets);
+
+ tool_options_menu_update_presets (manager, merge_id, ui_path,
+ "Edit", "edit",
+ tool_info->presets);
+
+ tool_options_menu_update_presets (manager, merge_id, ui_path,
+ "Delete", "delete",
+ tool_info->presets);
+
+ gimp_ui_manager_ensure_update (manager);
+}
+
+static void
+tool_options_menu_update_presets (GimpUIManager *manager,
+ guint merge_id,
+ const gchar *ui_path,
+ const gchar *menu_path,
+ const gchar *which_action,
+ GimpContainer *presets)
+{
+ gint n_children;
+ gint i;
+
+ n_children = gimp_container_get_n_children (presets);
+
+ for (i = 0; i < n_children; i++)
+ {
+ gchar *action_name;
+ gchar *path;
+
+ action_name = g_strdup_printf ("tool-options-%s-preset-%03d",
+ which_action, i);
+ path = g_strdup_printf ("%s/%s", ui_path, menu_path);
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ path, action_name, action_name,
+ GTK_UI_MANAGER_MENUITEM,
+ FALSE);
+
+ g_free (action_name);
+ g_free (path);
+ }
+}
diff --git a/app/menus/tool-options-menu.h b/app/menus/tool-options-menu.h
new file mode 100644
index 0000000..9fbc291
--- /dev/null
+++ b/app/menus/tool-options-menu.h
@@ -0,0 +1,26 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef __TOOL_OPTIONS_MENU_H__
+#define __TOOL_OPTIONS_MENU_H__
+
+
+void tool_options_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path);
+
+
+#endif /* __TOOL_OPTIONS_MENU_H__ */
diff --git a/app/menus/window-menu.c b/app/menus/window-menu.c
new file mode 100644
index 0000000..7391e92
--- /dev/null
+++ b/app/menus/window-menu.c
@@ -0,0 +1,168 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl.h>
+#include <gtk/gtk.h>
+
+#include "menus-types.h"
+
+#include "config/gimpguiconfig.h"
+
+#include "core/gimp.h"
+
+#include "widgets/gimpuimanager.h"
+
+#include "window-menu.h"
+
+
+/* private functions */
+
+static void window_menu_display_opened (GdkDisplayManager *disp_manager,
+ GdkDisplay *display,
+ GimpUIManager *manager);
+static void window_menu_display_closed (GdkDisplay *display,
+ gboolean is_error,
+ GimpUIManager *manager);
+
+
+/* public functions */
+
+void
+window_menu_setup (GimpUIManager *manager,
+ const gchar *group_name,
+ const gchar *ui_path)
+{
+ GdkDisplayManager *disp_manager = gdk_display_manager_get ();
+ GSList *displays;
+ GSList *list;
+
+ g_return_if_fail (GIMP_IS_UI_MANAGER (manager));
+ g_return_if_fail (ui_path != NULL);
+
+ g_object_set_data_full (G_OBJECT (manager), "move-to-screen-group-name",
+ g_strdup (group_name),
+ (GDestroyNotify) g_free);
+ g_object_set_data_full (G_OBJECT (manager), "move-to-screen-ui-path",
+ g_strdup (ui_path),
+ (GDestroyNotify) g_free);
+
+ displays = gdk_display_manager_list_displays (disp_manager);
+
+ /* present displays in the order in which they were opened */
+ displays = g_slist_reverse (displays);
+
+ for (list = displays; list; list = g_slist_next (list))
+ {
+ window_menu_display_opened (disp_manager, list->data, manager);
+ }
+
+ g_slist_free (displays);
+
+ g_signal_connect_object (disp_manager, "display-opened",
+ G_CALLBACK (window_menu_display_opened),
+ G_OBJECT (manager), 0);
+}
+
+
+/* private functions */
+
+static void
+window_menu_display_opened (GdkDisplayManager *disp_manager,
+ GdkDisplay *display,
+ GimpUIManager *manager)
+{
+ const gchar *group_name;
+ const gchar *ui_path;
+ const gchar *display_name;
+ gchar *action_path;
+ gchar *merge_key;
+ guint merge_id;
+ gint n_screens;
+ gint i;
+
+ group_name = g_object_get_data (G_OBJECT (manager),
+ "move-to-screen-group-name");
+ ui_path = g_object_get_data (G_OBJECT (manager),
+ "move-to-screen-ui-path");
+
+ action_path = g_strdup_printf ("%s/Move to Screen", ui_path);
+
+ display_name = gdk_display_get_name (display);
+ if (! display_name)
+ display_name = "eek";
+
+ merge_key = g_strdup_printf ("%s-display-merge-id", display_name);
+
+ merge_id = gimp_ui_manager_new_merge_id (manager);
+ g_object_set_data (G_OBJECT (manager), merge_key,
+ GUINT_TO_POINTER (merge_id));
+
+ g_free (merge_key);
+
+ n_screens = gdk_display_get_n_screens (display);
+
+ for (i = 0; i < n_screens; i++)
+ {
+ GdkScreen *screen;
+ gchar *screen_name;
+ gchar *action_name;
+
+ screen = gdk_display_get_screen (display, i);
+
+ screen_name = gdk_screen_make_display_name (screen);
+ action_name = g_strdup_printf ("%s-move-to-screen-%s",
+ group_name, screen_name);
+ g_free (screen_name);
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ action_path, action_name, action_name,
+ GTK_UI_MANAGER_MENUITEM,
+ FALSE);
+
+ g_free (action_name);
+ }
+
+ g_free (action_path);
+
+ g_signal_connect_object (display, "closed",
+ G_CALLBACK (window_menu_display_closed),
+ G_OBJECT (manager), 0);
+}
+
+static void
+window_menu_display_closed (GdkDisplay *display,
+ gboolean is_error,
+ GimpUIManager *manager)
+{
+ const gchar *display_name;
+ gchar *merge_key;
+ guint merge_id;
+
+ display_name = gdk_display_get_name (display);
+ if (! display_name)
+ display_name = "eek";
+
+ merge_key = g_strdup_printf ("%s-display-merge-id", display_name);
+ merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager),
+ merge_key));
+ g_free (merge_key);
+
+ if (merge_id)
+ gimp_ui_manager_remove_ui (manager, merge_id);
+}
diff --git a/app/menus/window-menu.h b/app/menus/window-menu.h
new file mode 100644
index 0000000..acce261
--- /dev/null
+++ b/app/menus/window-menu.h
@@ -0,0 +1,27 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef __WINDOW_MENU_H__
+#define __WINDOW_MENU_H__
+
+
+void window_menu_setup (GimpUIManager *manager,
+ const gchar *group_name,
+ const gchar *ui_path);
+
+
+#endif /* __WINDOW_MENU_H__ */
diff --git a/app/menus/windows-menu.c b/app/menus/windows-menu.c
new file mode 100644
index 0000000..9e203e0
--- /dev/null
+++ b/app/menus/windows-menu.c
@@ -0,0 +1,440 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <gegl.h>
+#include <gtk/gtk.h>
+
+#include "libgimpthumb/gimpthumb.h"
+
+#include "menus-types.h"
+
+#include "config/gimpguiconfig.h"
+
+#include "core/gimp.h"
+#include "core/gimpimage.h"
+#include "core/gimplist.h"
+#include "core/gimpviewable.h"
+
+#include "widgets/gimpaction.h"
+#include "widgets/gimpactionimpl.h"
+#include "widgets/gimpdialogfactory.h"
+#include "widgets/gimpdock.h"
+#include "widgets/gimpdockwindow.h"
+#include "widgets/gimpsessioninfo.h"
+#include "widgets/gimpuimanager.h"
+
+#include "display/gimpdisplay.h"
+
+#include "dialogs/dialogs.h"
+
+#include "actions/windows-actions.h"
+
+#include "windows-menu.h"
+
+
+static void windows_menu_display_add (GimpContainer *container,
+ GimpDisplay *display,
+ GimpUIManager *manager);
+static void windows_menu_display_remove (GimpContainer *container,
+ GimpDisplay *display,
+ GimpUIManager *manager);
+static void windows_menu_display_reorder (GimpContainer *container,
+ GimpDisplay *display,
+ gint new_index,
+ GimpUIManager *manager);
+static void windows_menu_image_notify (GimpDisplay *display,
+ const GParamSpec *unused,
+ GimpUIManager *manager);
+static void windows_menu_dock_window_added (GimpDialogFactory *factory,
+ GimpDockWindow *dock_window,
+ GimpUIManager *manager);
+static void windows_menu_dock_window_removed (GimpDialogFactory *factory,
+ GimpDockWindow *dock_window,
+ GimpUIManager *manager);
+static gchar * windows_menu_dock_window_to_merge_id (GimpDockWindow *dock_window);
+static void windows_menu_recent_add (GimpContainer *container,
+ GimpSessionInfo *info,
+ GimpUIManager *manager);
+static void windows_menu_recent_remove (GimpContainer *container,
+ GimpSessionInfo *info,
+ GimpUIManager *manager);
+static gboolean windows_menu_display_query_tooltip (GtkWidget *widget,
+ gint x,
+ gint y,
+ gboolean keyboard_mode,
+ GtkTooltip *tooltip,
+ GimpAction *action);
+
+
+void
+windows_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path)
+{
+ GList *list;
+
+ g_return_if_fail (GIMP_IS_UI_MANAGER (manager));
+ g_return_if_fail (ui_path != NULL);
+
+ g_object_set_data (G_OBJECT (manager), "image-menu-ui-path",
+ (gpointer) ui_path);
+
+ g_signal_connect_object (manager->gimp->displays, "add",
+ G_CALLBACK (windows_menu_display_add),
+ manager, 0);
+ g_signal_connect_object (manager->gimp->displays, "remove",
+ G_CALLBACK (windows_menu_display_remove),
+ manager, 0);
+ g_signal_connect_object (manager->gimp->displays, "reorder",
+ G_CALLBACK (windows_menu_display_reorder),
+ manager, 0);
+
+ for (list = gimp_get_display_iter (manager->gimp);
+ list;
+ list = g_list_next (list))
+ {
+ GimpDisplay *display = list->data;
+
+ windows_menu_display_add (manager->gimp->displays, display, manager);
+ }
+
+ g_signal_connect_object (gimp_dialog_factory_get_singleton (), "dock-window-added",
+ G_CALLBACK (windows_menu_dock_window_added),
+ manager, 0);
+ g_signal_connect_object (gimp_dialog_factory_get_singleton (), "dock-window-removed",
+ G_CALLBACK (windows_menu_dock_window_removed),
+ manager, 0);
+
+ for (list = gimp_dialog_factory_get_open_dialogs (gimp_dialog_factory_get_singleton ());
+ list;
+ list = g_list_next (list))
+ {
+ GimpDockWindow *dock_window = list->data;
+
+ if (GIMP_IS_DOCK_WINDOW (dock_window))
+ windows_menu_dock_window_added (gimp_dialog_factory_get_singleton (),
+ dock_window,
+ manager);
+ }
+
+ g_signal_connect_object (global_recent_docks, "add",
+ G_CALLBACK (windows_menu_recent_add),
+ manager, 0);
+ g_signal_connect_object (global_recent_docks, "remove",
+ G_CALLBACK (windows_menu_recent_remove),
+ manager, 0);
+
+ for (list = g_list_last (GIMP_LIST (global_recent_docks)->queue->head);
+ list;
+ list = g_list_previous (list))
+ {
+ GimpSessionInfo *info = list->data;
+
+ windows_menu_recent_add (global_recent_docks, info, manager);
+ }
+}
+
+
+/* private functions */
+
+static void
+windows_menu_display_add (GimpContainer *container,
+ GimpDisplay *display,
+ GimpUIManager *manager)
+{
+ g_signal_connect_object (display, "notify::image",
+ G_CALLBACK (windows_menu_image_notify),
+ manager, 0);
+
+ if (gimp_display_get_image (display))
+ windows_menu_image_notify (display, NULL, manager);
+}
+
+static void
+windows_menu_display_remove (GimpContainer *container,
+ GimpDisplay *display,
+ GimpUIManager *manager)
+{
+ gchar *merge_key = g_strdup_printf ("windows-display-%04d-merge-id",
+ gimp_display_get_ID (display));
+ guint merge_id;
+
+ merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager),
+ merge_key));
+
+ if (merge_id)
+ gimp_ui_manager_remove_ui (manager, merge_id);
+
+ g_object_set_data (G_OBJECT (manager), merge_key, NULL);
+
+ g_free (merge_key);
+}
+
+static void
+windows_menu_display_reorder (GimpContainer *container,
+ GimpDisplay *display,
+ gint new_index,
+ GimpUIManager *manager)
+{
+ gint n_display = gimp_container_get_n_children (container);
+ gint i;
+
+ for (i = new_index; i < n_display; i++)
+ {
+ GimpObject *d = gimp_container_get_child_by_index (container, i);
+
+ windows_menu_display_remove (container, GIMP_DISPLAY (d), manager);
+ }
+
+ /* If I don't ensure the menu items are effectively removed, adding
+ * the same ones may simply cancel the effect of the removal, hence
+ * losing the menu reordering.
+ */
+ gimp_ui_manager_ensure_update (manager);
+
+ for (i = new_index; i < n_display; i++)
+ {
+ GimpObject *d = gimp_container_get_child_by_index (container, i);
+
+ windows_menu_display_add (container, GIMP_DISPLAY (d), manager);
+ }
+}
+
+static void
+windows_menu_image_notify (GimpDisplay *display,
+ const GParamSpec *unused,
+ GimpUIManager *manager)
+{
+ if (gimp_display_get_image (display))
+ {
+ gchar *merge_key = g_strdup_printf ("windows-display-%04d-merge-id",
+ gimp_display_get_ID (display));
+ guint merge_id;
+
+ merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager),
+ merge_key));
+
+ if (! merge_id)
+ {
+ GtkWidget *widget;
+ const gchar *ui_path;
+ gchar *action_name;
+ gchar *action_path;
+ gchar *full_path;
+
+ ui_path = g_object_get_data (G_OBJECT (manager),
+ "image-menu-ui-path");
+
+ action_name = gimp_display_get_action_name (display);
+ action_path = g_strdup_printf ("%s/Windows/Images", ui_path);
+
+ merge_id = gimp_ui_manager_new_merge_id (manager);
+
+ g_object_set_data (G_OBJECT (manager), merge_key,
+ GUINT_TO_POINTER (merge_id));
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ action_path, action_name, action_name,
+ GTK_UI_MANAGER_MENUITEM,
+ FALSE);
+
+ full_path = g_strconcat (action_path, "/", action_name, NULL);
+
+ widget = gimp_ui_manager_get_widget (manager, full_path);
+
+ if (widget)
+ {
+ GimpAction *action;
+
+ action = gimp_ui_manager_find_action (manager,
+ "windows", action_name);
+
+ g_signal_connect_object (widget, "query-tooltip",
+ G_CALLBACK (windows_menu_display_query_tooltip),
+ action, 0);
+ }
+
+ g_free (action_name);
+ g_free (action_path);
+ g_free (full_path);
+ }
+
+ g_free (merge_key);
+ }
+ else
+ {
+ windows_menu_display_remove (manager->gimp->displays, display, manager);
+ }
+}
+
+static void
+windows_menu_dock_window_added (GimpDialogFactory *factory,
+ GimpDockWindow *dock_window,
+ GimpUIManager *manager)
+{
+ const gchar *ui_path;
+ gchar *action_name;
+ gchar *action_path;
+ gchar *merge_key;
+ guint merge_id;
+
+ ui_path = g_object_get_data (G_OBJECT (manager), "image-menu-ui-path");
+
+ action_name = windows_actions_dock_window_to_action_name (dock_window);
+ action_path = g_strdup_printf ("%s/Windows/Docks",
+ ui_path);
+
+ merge_key = windows_menu_dock_window_to_merge_id (dock_window);
+ merge_id = gimp_ui_manager_new_merge_id (manager);
+
+ g_object_set_data (G_OBJECT (manager), merge_key,
+ GUINT_TO_POINTER (merge_id));
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ action_path, action_name, action_name,
+ GTK_UI_MANAGER_MENUITEM,
+ FALSE);
+
+ g_free (merge_key);
+ g_free (action_path);
+ g_free (action_name);
+}
+
+static void
+windows_menu_dock_window_removed (GimpDialogFactory *factory,
+ GimpDockWindow *dock_window,
+ GimpUIManager *manager)
+{
+ gchar *merge_key = windows_menu_dock_window_to_merge_id (dock_window);
+ guint merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager),
+ merge_key));
+ if (merge_id)
+ gimp_ui_manager_remove_ui (manager, merge_id);
+
+ g_object_set_data (G_OBJECT (manager), merge_key, NULL);
+
+ g_free (merge_key);
+}
+
+static gchar *
+windows_menu_dock_window_to_merge_id (GimpDockWindow *dock_window)
+{
+ return g_strdup_printf ("windows-dock-%04d-merge-id",
+ gimp_dock_window_get_id (dock_window));
+}
+
+static void
+windows_menu_recent_add (GimpContainer *container,
+ GimpSessionInfo *info,
+ GimpUIManager *manager)
+{
+ const gchar *ui_path;
+ gchar *action_name;
+ gchar *action_path;
+ gint info_id;
+ gchar *merge_key;
+ guint merge_id;
+
+ ui_path = g_object_get_data (G_OBJECT (manager), "image-menu-ui-path");
+
+ info_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (info),
+ "recent-action-id"));
+
+ action_name = g_strdup_printf ("windows-recent-%04d", info_id);
+ action_path = g_strdup_printf ("%s/Windows/Recently Closed Docks", ui_path);
+
+ merge_key = g_strdup_printf ("windows-recent-%04d-merge-id", info_id);
+ merge_id = gimp_ui_manager_new_merge_id (manager);
+
+ g_object_set_data (G_OBJECT (manager), merge_key,
+ GUINT_TO_POINTER (merge_id));
+
+ gimp_ui_manager_add_ui (manager, merge_id,
+ action_path, action_name, action_name,
+ GTK_UI_MANAGER_MENUITEM,
+ TRUE);
+
+ g_free (merge_key);
+ g_free (action_path);
+ g_free (action_name);
+}
+
+static void
+windows_menu_recent_remove (GimpContainer *container,
+ GimpSessionInfo *info,
+ GimpUIManager *manager)
+{
+ gint info_id;
+ gchar *merge_key;
+ guint merge_id;
+
+ info_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (info),
+ "recent-action-id"));
+
+ merge_key = g_strdup_printf ("windows-recent-%04d-merge-id", info_id);
+
+ merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (manager),
+ merge_key));
+
+ if (merge_id)
+ gimp_ui_manager_remove_ui (manager, merge_id);
+
+ g_object_set_data (G_OBJECT (manager), merge_key, NULL);
+
+ g_free (merge_key);
+}
+
+static gboolean
+windows_menu_display_query_tooltip (GtkWidget *widget,
+ gint x,
+ gint y,
+ gboolean keyboard_mode,
+ GtkTooltip *tooltip,
+ GimpAction *action)
+{
+ GimpActionImpl *impl = GIMP_ACTION_IMPL (action);
+ GimpImage *image = GIMP_IMAGE (impl->viewable);
+ gchar *text;
+ gdouble xres;
+ gdouble yres;
+ gint width;
+ gint height;
+
+ if (! image)
+ return FALSE;
+
+ text = gtk_widget_get_tooltip_text (widget);
+ gtk_tooltip_set_text (tooltip, text);
+ g_free (text);
+
+ gimp_image_get_resolution (image, &xres, &yres);
+
+ gimp_viewable_calc_preview_size (gimp_image_get_width (image),
+ gimp_image_get_height (image),
+ GIMP_VIEW_SIZE_HUGE, GIMP_VIEW_SIZE_HUGE,
+ FALSE, xres, yres,
+ &width, &height, NULL);
+
+ gtk_tooltip_set_icon (tooltip,
+ gimp_viewable_get_pixbuf (impl->viewable,
+ impl->context,
+ width, height));
+
+ return TRUE;
+}
diff --git a/app/menus/windows-menu.h b/app/menus/windows-menu.h
new file mode 100644
index 0000000..e57ac79
--- /dev/null
+++ b/app/menus/windows-menu.h
@@ -0,0 +1,26 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef __WINDOWS_MENU_H__
+#define __WINDOWS_MENU_H__
+
+
+void windows_menu_setup (GimpUIManager *manager,
+ const gchar *ui_path);
+
+
+#endif /* __WINDOWS_MENU_H__ */