Imported Upstream version 2.3.8
This commit is contained in:
@ -265,6 +265,7 @@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
|
||||
INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
|
||||
INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
|
||||
INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
|
||||
INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
|
||||
INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
|
||||
INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
|
||||
INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
|
||||
@ -358,7 +359,6 @@ PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
RSVG_REQUIRED_VERSION = @RSVG_REQUIRED_VERSION@
|
||||
RT_LIBS = @RT_LIBS@
|
||||
SCREENSHOT = @SCREENSHOT@
|
||||
SENDMAIL = @SENDMAIL@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
@ -374,6 +374,8 @@ SYMPREFIX = @SYMPREFIX@
|
||||
TIFF = @TIFF@
|
||||
URI_CFLAGS = @URI_CFLAGS@
|
||||
URI_LIBS = @URI_LIBS@
|
||||
USE_BINRELOC_FALSE = @USE_BINRELOC_FALSE@
|
||||
USE_BINRELOC_TRUE = @USE_BINRELOC_TRUE@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WINDRES = @WINDRES@
|
||||
|
||||
34
NEWS
34
NEWS
@ -3,10 +3,42 @@
|
||||
Development Branch
|
||||
------------------------------
|
||||
|
||||
This is the development branch of The GIMP. Here's where all the shiny
|
||||
This is the development branch of GIMP. Here's where all the shiny
|
||||
new stuff is being done that will one day be released as GIMP 2.4.
|
||||
|
||||
|
||||
Changes in GIMP 2.3.8
|
||||
=====================
|
||||
|
||||
- added new tile primitive Triangle to Mosaic plug-in
|
||||
- speed up Gaussian Blur plug-in
|
||||
- suppress redundant progress updates from plug-ins
|
||||
- changed some gimprc and sessionrc default values (window hints,
|
||||
fullscreen mode)
|
||||
- do not focus transform tool dialogs on map
|
||||
- renamed Magnify tool to Zoom tool and added some missing tool shortcuts
|
||||
- added a submenu with recently used plug-ins to the Filters menu
|
||||
- fixed look-up table used for Contrast adjustments
|
||||
- improved the user interface of the Animation Playback plug-in
|
||||
- added framework for describing menu entries in the statusbar
|
||||
- added lots of helpful blurbs to procedures and core actions
|
||||
- remove color from the Watercolor selector if Shift is being pressed
|
||||
- ported PDB internals to GParamSpec and GValue
|
||||
- speedup and UI improvements for the SIOX tool
|
||||
- added parasite getters and settors for vectors
|
||||
- made PSD load and save plug-ins 64bit clean
|
||||
- some string review
|
||||
- ported ellipse select tool to the new rectangle tool
|
||||
- added basic support for layer masks to the PSD save plug-in
|
||||
- avoid relocations by declaring more data as const
|
||||
- new application icons in more sizes and as a SVG
|
||||
- provide script-specific samples instead of hard-coding "Aa" for font preview
|
||||
- build the Screenshot plug-in on all platforms
|
||||
- allow to discard invisible layers when merging visible layers
|
||||
- nicer output from gimp-procedural-db-dump
|
||||
- bug fixes and code cleanup
|
||||
|
||||
|
||||
Changes in GIMP 2.3.7
|
||||
=====================
|
||||
|
||||
|
||||
251
aclocal.m4
vendored
251
aclocal.m4
vendored
@ -827,23 +827,26 @@ main ()
|
||||
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
|
||||
# serial 2 IT_PROG_INTLTOOL
|
||||
AC_DEFUN([IT_PROG_INTLTOOL],
|
||||
[
|
||||
[AC_PREREQ([2.50])dnl
|
||||
|
||||
case "$am__api_version" in
|
||||
1.[01234])
|
||||
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -n "$1"; then
|
||||
AC_MSG_CHECKING(for intltool >= $1)
|
||||
|
||||
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }'`
|
||||
INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $[2]; }' < ${ac_aux_dir}/intltool-update.in`
|
||||
changequote({{,}})
|
||||
INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split(${{2}}, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < ${ac_aux_dir}/intltool-update.in`
|
||||
changequote([,])
|
||||
|
||||
if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
|
||||
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
|
||||
else
|
||||
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found. Your intltool is too old. You need intltool $1 or later.])
|
||||
exit 1
|
||||
fi
|
||||
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 100 + $ 2; }'`
|
||||
INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
|
||||
[INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 100 + VERSION[2];}' ${ac_aux_dir}/intltool-update.in`
|
||||
]
|
||||
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
|
||||
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
|
||||
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
|
||||
fi
|
||||
|
||||
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
@ -863,6 +866,7 @@ INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcar
|
||||
INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
|
||||
|
||||
AC_SUBST(INTLTOOL_DESKTOP_RULE)
|
||||
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
|
||||
@ -881,16 +885,12 @@ AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
|
||||
AC_SUBST(INTLTOOL_CAVES_RULE)
|
||||
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
|
||||
AC_SUBST(INTLTOOL_THEME_RULE)
|
||||
AC_SUBST(INTLTOOL_SERVICE_RULE)
|
||||
|
||||
# Use the tools built into the package, not the ones that are installed.
|
||||
|
||||
INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
|
||||
INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
|
||||
INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
|
||||
|
||||
AC_SUBST(INTLTOOL_EXTRACT)
|
||||
AC_SUBST(INTLTOOL_MERGE)
|
||||
AC_SUBST(INTLTOOL_UPDATE)
|
||||
AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
|
||||
AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
|
||||
AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
|
||||
|
||||
AC_PATH_PROG(INTLTOOL_PERL, perl)
|
||||
if test -z "$INTLTOOL_PERL"; then
|
||||
@ -913,81 +913,98 @@ AC_PATH_PROG(INTLTOOL_MSGFMT, msgfmt, msgfmt)
|
||||
AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
|
||||
AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
|
||||
|
||||
# Remove file type tags (using []) from po/POTFILES.
|
||||
IT_PO_SUBDIR([po])
|
||||
|
||||
ifdef([AC_DIVERSION_ICMDS],[
|
||||
AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
|
||||
[mv -f po/POTFILES po/POTFILES.tmp
|
||||
sed -e '/[[]encoding.*]/d' -e 's/[[].*] *//' < po/POTFILES.tmp > po/POTFILES
|
||||
rm -f po/POTFILES.tmp
|
||||
]dnl
|
||||
AC_DIVERT_POP()
|
||||
],[
|
||||
ifdef([AC_CONFIG_COMMANDS_PRE],[
|
||||
AC_CONFIG_COMMANDS_PRE([
|
||||
[mv -f po/POTFILES po/POTFILES.tmp
|
||||
sed -e '/[[]encoding.*]/d' -e 's/[[].*] *//' < po/POTFILES.tmp > po/POTFILES
|
||||
rm -f po/POTFILES.tmp
|
||||
]dnl
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
# Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
|
||||
dnl The following is very similar to
|
||||
dnl
|
||||
dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
|
||||
dnl
|
||||
dnl with the following slight differences:
|
||||
dnl - the *.in files are in ac_aux_dir,
|
||||
dnl - if the file haven't changed upon reconfigure, it's not touched,
|
||||
dnl - the evaluation of the third parameter enables a hack which computes
|
||||
dnl the actual value of $libdir,
|
||||
dnl - the user sees "executing intltool commands", instead of
|
||||
dnl "creating intltool-extract" and such.
|
||||
dnl
|
||||
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
|
||||
dnl a reason for it.
|
||||
|
||||
AC_CONFIG_COMMANDS([intltool], [
|
||||
|
||||
intltool_edit="-e 's#@INTLTOOL_EXTRACT@#`pwd`/intltool-extract#g' \
|
||||
-e 's#@INTLTOOL_ICONV@#${INTLTOOL_ICONV}#g' \
|
||||
-e 's#@INTLTOOL_MSGFMT@#${INTLTOOL_MSGFMT}#g' \
|
||||
-e 's#@INTLTOOL_MSGMERGE@#${INTLTOOL_MSGMERGE}#g' \
|
||||
-e 's#@INTLTOOL_XGETTEXT@#${INTLTOOL_XGETTEXT}#g' \
|
||||
-e 's#@INTLTOOL_PERL@#${INTLTOOL_PERL}#g'"
|
||||
for file in intltool-extract intltool-merge intltool-update; do
|
||||
sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
|
||||
-e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
|
||||
-e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
|
||||
-e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
|
||||
-e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
|
||||
-e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
|
||||
-e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
|
||||
< ${ac_aux_dir}/${file}.in > ${file}.out
|
||||
if cmp -s ${file} ${file}.out 2>/dev/null; then
|
||||
rm -f ${file}.out
|
||||
else
|
||||
mv -f ${file}.out ${file}
|
||||
fi
|
||||
chmod ugo+x ${file}
|
||||
chmod u+w ${file}
|
||||
done
|
||||
|
||||
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-extract.in \
|
||||
> intltool-extract.out
|
||||
if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
|
||||
rm -f intltool-extract.out
|
||||
else
|
||||
mv -f intltool-extract.out intltool-extract
|
||||
fi
|
||||
chmod ugo+x intltool-extract
|
||||
chmod u+w intltool-extract
|
||||
|
||||
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-merge.in \
|
||||
> intltool-merge.out
|
||||
if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
|
||||
rm -f intltool-merge.out
|
||||
else
|
||||
mv -f intltool-merge.out intltool-merge
|
||||
fi
|
||||
chmod ugo+x intltool-merge
|
||||
chmod u+w intltool-merge
|
||||
|
||||
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-update.in \
|
||||
> intltool-update.out
|
||||
if cmp -s intltool-update intltool-update.out 2>/dev/null; then
|
||||
rm -f intltool-update.out
|
||||
else
|
||||
mv -f intltool-update.out intltool-update
|
||||
fi
|
||||
chmod ugo+x intltool-update
|
||||
chmod u+w intltool-update
|
||||
|
||||
], INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir=${ac_aux_dir}
|
||||
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' ICONV='${INTLTOOL_ICONV}'
|
||||
MSGFMT='${INTLTOOL_MSGFMT}' MSGMERGE='${INTLTOOL_MSGMERGE}'
|
||||
XGETTEXT='${INTLTOOL_XGETTEXT}')
|
||||
],
|
||||
[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
|
||||
prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir"
|
||||
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
|
||||
INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
|
||||
INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])
|
||||
|
||||
])
|
||||
|
||||
|
||||
# IT_PO_SUBDIR(DIRNAME)
|
||||
# ---------------------
|
||||
# All po subdirs have to be declared with this macro; the subdir "po" is
|
||||
# declared by IT_PROG_INTLTOOL.
|
||||
#
|
||||
AC_DEFUN([IT_PO_SUBDIR],
|
||||
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
|
||||
dnl
|
||||
dnl The following CONFIG_COMMANDS should be exetuted at the very end
|
||||
dnl of config.status.
|
||||
AC_CONFIG_COMMANDS_PRE([
|
||||
AC_CONFIG_COMMANDS([$1/stamp-it], [
|
||||
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
|
||||
>"$1/stamp-it.tmp"
|
||||
[sed '/^#/d
|
||||
s/^[[].*] *//
|
||||
/^[ ]*$/d
|
||||
'"s|^| $ac_top_srcdir/|" \
|
||||
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
|
||||
]
|
||||
if test ! -f "$1/Makefile"; then
|
||||
AC_MSG_ERROR([$1/Makefile is not ready.])
|
||||
fi
|
||||
mv "$1/Makefile" "$1/Makefile.tmp"
|
||||
[sed '/^POTFILES =/,/[^\\]$/ {
|
||||
/^POTFILES =/!d
|
||||
r $1/POTFILES
|
||||
}
|
||||
' "$1/Makefile.tmp" >"$1/Makefile"]
|
||||
rm -f "$1/Makefile.tmp"
|
||||
mv "$1/stamp-it.tmp" "$1/stamp-it"
|
||||
])
|
||||
])dnl
|
||||
])
|
||||
|
||||
|
||||
# deprecated macros
|
||||
AC_DEFUN([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL($@)])
|
||||
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
|
||||
# A hint is needed for aclocal from Automake <= 1.9.4:
|
||||
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
|
||||
|
||||
|
||||
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
|
||||
|
||||
# serial 48 Debian 1.5.22-2 AC_PROG_LIBTOOL
|
||||
# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL
|
||||
|
||||
|
||||
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
|
||||
@ -2371,18 +2388,6 @@ freebsd1*)
|
||||
dynamic_linker=no
|
||||
;;
|
||||
|
||||
kfreebsd*-gnu)
|
||||
version_type=linux
|
||||
need_lib_prefix=no
|
||||
need_version=no
|
||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
|
||||
soname_spec='${libname}${release}${shared_ext}$major'
|
||||
shlibpath_var=LD_LIBRARY_PATH
|
||||
shlibpath_overrides_runpath=no
|
||||
hardcode_into_libs=yes
|
||||
dynamic_linker='GNU ld.so'
|
||||
;;
|
||||
|
||||
freebsd* | dragonfly*)
|
||||
# DragonFly does not have aout. When/if they implement a new
|
||||
# versioning mechanism, adjust this.
|
||||
@ -2538,7 +2543,7 @@ linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
|
||||
# This must be Linux ELF.
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu)
|
||||
version_type=linux
|
||||
need_lib_prefix=no
|
||||
need_version=no
|
||||
@ -2579,18 +2584,6 @@ netbsdelf*-gnu)
|
||||
dynamic_linker='NetBSD ld.elf_so'
|
||||
;;
|
||||
|
||||
knetbsd*-gnu)
|
||||
version_type=linux
|
||||
need_lib_prefix=no
|
||||
need_version=no
|
||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
|
||||
soname_spec='${libname}${release}${shared_ext}$major'
|
||||
shlibpath_var=LD_LIBRARY_PATH
|
||||
shlibpath_overrides_runpath=no
|
||||
hardcode_into_libs=yes
|
||||
dynamic_linker='GNU ld.so'
|
||||
;;
|
||||
|
||||
netbsd*)
|
||||
version_type=sunos
|
||||
need_lib_prefix=no
|
||||
@ -3296,7 +3289,7 @@ darwin* | rhapsody*)
|
||||
lt_cv_deplibs_check_method=pass_all
|
||||
;;
|
||||
|
||||
freebsd* | kfreebsd*-gnu | dragonfly*)
|
||||
freebsd* | dragonfly*)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
|
||||
case $host_cpu in
|
||||
i*86 )
|
||||
@ -3350,11 +3343,11 @@ irix5* | irix6* | nonstopux*)
|
||||
;;
|
||||
|
||||
# This must be Linux ELF.
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu)
|
||||
lt_cv_deplibs_check_method=pass_all
|
||||
;;
|
||||
|
||||
netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
|
||||
netbsd* | netbsdelf*-gnu)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
|
||||
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
|
||||
else
|
||||
@ -4102,7 +4095,7 @@ case $host_os in
|
||||
freebsd-elf*)
|
||||
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
|
||||
;;
|
||||
freebsd* | kfreebsd*-gnu | dragonfly*)
|
||||
freebsd* | dragonfly*)
|
||||
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
|
||||
# conventions
|
||||
_LT_AC_TAGVAR(ld_shlibs, $1)=yes
|
||||
@ -4261,7 +4254,7 @@ case $host_os in
|
||||
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
|
||||
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
|
||||
;;
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu)
|
||||
case $cc_basename in
|
||||
KCC*)
|
||||
# Kuck and Associates, Inc. (KAI) C++ Compiler
|
||||
@ -4363,7 +4356,7 @@ case $host_os in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
|
||||
netbsd* | netbsdelf*-gnu)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
|
||||
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
|
||||
wlarc=
|
||||
@ -5628,7 +5621,7 @@ hpux*) # Its linker distinguishes data from code symbols
|
||||
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
|
||||
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
|
||||
;;
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu)
|
||||
if test "$host_cpu" = ia64; then
|
||||
symcode='[[ABCDGIRSTW]]'
|
||||
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
|
||||
@ -5901,7 +5894,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
freebsd* | kfreebsd*-gnu | dragonfly*)
|
||||
freebsd* | dragonfly*)
|
||||
# FreeBSD uses GNU C++
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
@ -5944,7 +5937,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu)
|
||||
case $cc_basename in
|
||||
KCC*)
|
||||
# KAI C++ Compiler
|
||||
@ -5987,7 +5980,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
|
||||
netbsd* | netbsdelf*-gnu)
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
case $cc_basename in
|
||||
@ -6198,7 +6191,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
|
||||
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
|
||||
;;
|
||||
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu)
|
||||
case $cc_basename in
|
||||
icc* | ecc*)
|
||||
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
|
||||
@ -6339,10 +6332,7 @@ ifelse([$1],[CXX],[
|
||||
cygwin* | mingw*)
|
||||
_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
|
||||
;;
|
||||
kfreebsd*-gnu)
|
||||
_LT_AC_TAGVAR(link_all_deplibs, $1)=no
|
||||
;;
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu)
|
||||
_LT_AC_TAGVAR(link_all_deplibs, $1)=no
|
||||
;;
|
||||
*)
|
||||
@ -6515,7 +6505,7 @@ EOF
|
||||
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||
;;
|
||||
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
tmp_addflag=
|
||||
case $cc_basename,$host_cpu in
|
||||
@ -6547,7 +6537,7 @@ EOF
|
||||
fi
|
||||
;;
|
||||
|
||||
netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
|
||||
netbsd* | netbsdelf*-gnu)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
|
||||
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
|
||||
wlarc=
|
||||
@ -6884,15 +6874,6 @@ _LT_EOF
|
||||
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
|
||||
;;
|
||||
|
||||
# GNU/kFreeBSD uses gcc -shared to do shared libraries.
|
||||
kfreebsd*-gnu)
|
||||
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
|
||||
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
|
||||
_LT_AC_TAGVAR(hardcode_direct, $1)=yes
|
||||
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
|
||||
_LT_AC_TAGVAR(link_all_deplibs, $1)=no
|
||||
;;
|
||||
|
||||
hpux9*)
|
||||
if test "$GCC" = yes; then
|
||||
_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
|
||||
@ -6988,7 +6969,7 @@ _LT_EOF
|
||||
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
|
||||
;;
|
||||
|
||||
netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
|
||||
netbsd* | netbsdelf*-gnu)
|
||||
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
|
||||
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
|
||||
else
|
||||
|
||||
@ -71,7 +71,7 @@ endif
|
||||
if OS_WIN32
|
||||
mwindows = -mwindows
|
||||
endif
|
||||
if OS_UNIX
|
||||
if USE_BINRELOC
|
||||
munix = -Wl,-rpath '-Wl,$$ORIGIN/../lib'
|
||||
endif
|
||||
|
||||
|
||||
@ -325,6 +325,7 @@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
|
||||
INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
|
||||
INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
|
||||
INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
|
||||
INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
|
||||
INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
|
||||
INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
|
||||
INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
|
||||
@ -418,7 +419,6 @@ PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
RSVG_REQUIRED_VERSION = @RSVG_REQUIRED_VERSION@
|
||||
RT_LIBS = @RT_LIBS@
|
||||
SCREENSHOT = @SCREENSHOT@
|
||||
SENDMAIL = @SENDMAIL@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
@ -434,6 +434,8 @@ SYMPREFIX = @SYMPREFIX@
|
||||
TIFF = @TIFF@
|
||||
URI_CFLAGS = @URI_CFLAGS@
|
||||
URI_LIBS = @URI_LIBS@
|
||||
USE_BINRELOC_FALSE = @USE_BINRELOC_FALSE@
|
||||
USE_BINRELOC_TRUE = @USE_BINRELOC_TRUE@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WINDRES = @WINDRES@
|
||||
@ -563,7 +565,7 @@ EXTRA_DIST = \
|
||||
@HAVE_GLIBC_REGEX_FALSE@REGEXREPL = $(top_builddir)/regexrepl/libregex.a
|
||||
@HAVE_GLIBC_REGEX_TRUE@REGEXREPL =
|
||||
@OS_WIN32_TRUE@mwindows = -mwindows
|
||||
@OS_UNIX_TRUE@munix = -Wl,-rpath '-Wl,$$ORIGIN/../lib'
|
||||
@USE_BINRELOC_TRUE@munix = -Wl,-rpath '-Wl,$$ORIGIN/../lib'
|
||||
@HAVE_WINDRES_TRUE@GIMPICONRC = gimprc.o
|
||||
AM_CPPFLAGS = \
|
||||
-DG_LOG_DOMAIN=\"Gimp\" \
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
_("GNU Image Manipulation Program")
|
||||
|
||||
#define GIMP_COPYRIGHT \
|
||||
_("Copyright (C) 1995-2006\n" \
|
||||
_("Copyright © 1995-2006\n" \
|
||||
"Spencer Kimball, Peter Mattis and the GIMP Development Team")
|
||||
|
||||
#define GIMP_LICENSE \
|
||||
|
||||
@ -281,6 +281,7 @@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
|
||||
INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
|
||||
INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
|
||||
INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
|
||||
INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
|
||||
INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
|
||||
INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
|
||||
INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
|
||||
@ -374,7 +375,6 @@ PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
RSVG_REQUIRED_VERSION = @RSVG_REQUIRED_VERSION@
|
||||
RT_LIBS = @RT_LIBS@
|
||||
SCREENSHOT = @SCREENSHOT@
|
||||
SENDMAIL = @SENDMAIL@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
@ -390,6 +390,8 @@ SYMPREFIX = @SYMPREFIX@
|
||||
TIFF = @TIFF@
|
||||
URI_CFLAGS = @URI_CFLAGS@
|
||||
URI_LIBS = @URI_LIBS@
|
||||
USE_BINRELOC_FALSE = @USE_BINRELOC_FALSE@
|
||||
USE_BINRELOC_TRUE = @USE_BINRELOC_TRUE@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WINDRES = @WINDRES@
|
||||
|
||||
@ -251,7 +251,7 @@ action_data_get_gimp (gpointer data)
|
||||
return NULL;
|
||||
|
||||
if (GIMP_IS_DISPLAY (data))
|
||||
return ((GimpDisplay *) data)->gimage->gimp;
|
||||
return ((GimpDisplay *) data)->image->gimp;
|
||||
else if (GIMP_IS_GIMP (data))
|
||||
return data;
|
||||
else if (GIMP_IS_DOCK (data))
|
||||
@ -280,7 +280,7 @@ action_data_get_context (gpointer data)
|
||||
return NULL;
|
||||
|
||||
if (GIMP_IS_DISPLAY (data))
|
||||
return gimp_get_user_context (((GimpDisplay *) data)->gimage->gimp);
|
||||
return gimp_get_user_context (((GimpDisplay *) data)->image->gimp);
|
||||
else if (GIMP_IS_GIMP (data))
|
||||
return gimp_get_user_context (data);
|
||||
else if (GIMP_IS_DOCK (data))
|
||||
@ -308,15 +308,15 @@ action_data_get_image (gpointer data)
|
||||
return NULL;
|
||||
|
||||
if (GIMP_IS_DISPLAY (data))
|
||||
return ((GimpDisplay *) data)->gimage;
|
||||
return ((GimpDisplay *) data)->image;
|
||||
else if (GIMP_IS_GIMP (data))
|
||||
context = gimp_get_user_context (data);
|
||||
else if (GIMP_IS_DOCK (data))
|
||||
context = ((GimpDock *) data)->context;
|
||||
else if (GIMP_IS_ITEM_TREE_VIEW (data))
|
||||
return ((GimpItemTreeView *) data)->gimage;
|
||||
return ((GimpItemTreeView *) data)->image;
|
||||
else if (GIMP_IS_IMAGE_EDITOR (data))
|
||||
return ((GimpImageEditor *) data)->gimage;
|
||||
return ((GimpImageEditor *) data)->image;
|
||||
else if (GIMP_IS_NAVIGATION_EDITOR (data))
|
||||
context = ((GimpNavigationEditor *) data)->context;
|
||||
|
||||
|
||||
@ -60,14 +60,14 @@ GimpObject * action_select_object (GimpActionSelectType select_type,
|
||||
if (! context) \
|
||||
return
|
||||
|
||||
#define return_if_no_image(gimage,data) \
|
||||
gimage = action_data_get_image (data); \
|
||||
if (! gimage) \
|
||||
#define return_if_no_image(image,data) \
|
||||
image = action_data_get_image (data); \
|
||||
if (! image) \
|
||||
return
|
||||
|
||||
#define return_if_no_display(gdisp,data) \
|
||||
gdisp = action_data_get_display (data); \
|
||||
if (! gdisp) \
|
||||
#define return_if_no_display(display,data) \
|
||||
display = action_data_get_display (data); \
|
||||
if (! display) \
|
||||
return
|
||||
|
||||
#define return_if_no_widget(widget,data) \
|
||||
@ -76,27 +76,27 @@ GimpObject * action_select_object (GimpActionSelectType select_type,
|
||||
return
|
||||
|
||||
|
||||
#define return_if_no_drawable(gimage,drawable,data) \
|
||||
return_if_no_image (gimage,data); \
|
||||
drawable = gimp_image_active_drawable (gimage); \
|
||||
#define return_if_no_drawable(image,drawable,data) \
|
||||
return_if_no_image (image,data); \
|
||||
drawable = gimp_image_active_drawable (image); \
|
||||
if (! drawable) \
|
||||
return
|
||||
|
||||
#define return_if_no_layer(gimage,layer,data) \
|
||||
return_if_no_image (gimage,data); \
|
||||
layer = gimp_image_get_active_layer (gimage); \
|
||||
#define return_if_no_layer(image,layer,data) \
|
||||
return_if_no_image (image,data); \
|
||||
layer = gimp_image_get_active_layer (image); \
|
||||
if (! layer) \
|
||||
return
|
||||
|
||||
#define return_if_no_channel(gimage,channel,data) \
|
||||
return_if_no_image (gimage,data); \
|
||||
channel = gimp_image_get_active_channel (gimage); \
|
||||
#define return_if_no_channel(image,channel,data) \
|
||||
return_if_no_image (image,data); \
|
||||
channel = gimp_image_get_active_channel (image); \
|
||||
if (! channel) \
|
||||
return
|
||||
|
||||
#define return_if_no_vectors(gimage,vectors,data) \
|
||||
return_if_no_image (gimage,data); \
|
||||
vectors = gimp_image_get_active_vectors (gimage); \
|
||||
#define return_if_no_vectors(image,vectors,data) \
|
||||
return_if_no_image (image,data); \
|
||||
vectors = gimp_image_get_active_vectors (image); \
|
||||
if (! vectors) \
|
||||
return
|
||||
|
||||
|
||||
@ -36,14 +36,14 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry brush_editor_actions[] =
|
||||
static const GimpActionEntry brush_editor_actions[] =
|
||||
{
|
||||
{ "brush-editor-popup", GIMP_STOCK_BRUSH,
|
||||
N_("Brush Editor Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_BRUSH_EDITOR_DIALOG }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry brush_editor_toggle_actions[] =
|
||||
static const GimpToggleActionEntry brush_editor_toggle_actions[] =
|
||||
{
|
||||
{ "brush-editor-edit-active", GIMP_STOCK_LINKED,
|
||||
N_("Edit Active Brush"), NULL, NULL,
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry brushes_actions[] =
|
||||
static const GimpActionEntry brushes_actions[] =
|
||||
{
|
||||
{ "brushes-popup", GIMP_STOCK_BRUSH,
|
||||
N_("Brushes Menu"), NULL, NULL, NULL,
|
||||
@ -80,7 +80,7 @@ static GimpActionEntry brushes_actions[] =
|
||||
GIMP_HELP_BRUSH_REFRESH }
|
||||
};
|
||||
|
||||
static GimpStringActionEntry brushes_edit_actions[] =
|
||||
static const GimpStringActionEntry brushes_edit_actions[] =
|
||||
{
|
||||
{ "brushes-edit", GTK_STOCK_EDIT,
|
||||
N_("_Edit Brush..."), NULL,
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry buffers_actions[] =
|
||||
static const GimpActionEntry buffers_actions[] =
|
||||
{
|
||||
{ "buffers-popup", GIMP_STOCK_BUFFER,
|
||||
N_("Buffers Menu"), NULL, NULL, NULL,
|
||||
|
||||
@ -135,33 +135,33 @@ buffers_paste (GimpBufferView *view,
|
||||
|
||||
if (buffer && gimp_container_have (container, GIMP_OBJECT (buffer)))
|
||||
{
|
||||
GimpDisplay *gdisp = gimp_context_get_display (context);
|
||||
GimpImage *gimage = NULL;
|
||||
gint x = -1;
|
||||
gint y = -1;
|
||||
gint width = -1;
|
||||
gint height = -1;
|
||||
GimpDisplay *display = gimp_context_get_display (context);
|
||||
GimpImage *image = NULL;
|
||||
gint x = -1;
|
||||
gint y = -1;
|
||||
gint width = -1;
|
||||
gint height = -1;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
if (display)
|
||||
{
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
gimp_display_shell_untransform_viewport (shell,
|
||||
&x, &y, &width, &height);
|
||||
|
||||
gimage = gdisp->gimage;
|
||||
image = display->image;
|
||||
}
|
||||
else
|
||||
{
|
||||
gimage = gimp_context_get_image (context);
|
||||
image = gimp_context_get_image (context);
|
||||
}
|
||||
|
||||
if (gimage)
|
||||
if (image)
|
||||
{
|
||||
gimp_edit_paste (gimage, gimp_image_active_drawable (gimage),
|
||||
buffer, paste_into, x, y, width, height);
|
||||
gimp_edit_paste (image, gimp_image_active_drawable (image),
|
||||
buffer, paste_into, x, y, width, height);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
}
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry channels_actions[] =
|
||||
static const GimpActionEntry channels_actions[] =
|
||||
{
|
||||
{ "channels-popup", GIMP_STOCK_CHANNELS,
|
||||
N_("Channels Menu"), NULL, NULL, NULL,
|
||||
@ -46,82 +46,82 @@ static GimpActionEntry channels_actions[] =
|
||||
|
||||
{ "channels-edit-attributes", GTK_STOCK_EDIT,
|
||||
N_("_Edit Channel Attributes..."), NULL,
|
||||
N_("Edit channel attributes"),
|
||||
N_("Edit the channel's name, color and opacity"),
|
||||
G_CALLBACK (channels_edit_attributes_cmd_callback),
|
||||
GIMP_HELP_CHANNEL_EDIT },
|
||||
|
||||
{ "channels-new", GTK_STOCK_NEW,
|
||||
N_("_New Channel..."), "",
|
||||
N_("New channel..."),
|
||||
N_("Create a new channel"),
|
||||
G_CALLBACK (channels_new_cmd_callback),
|
||||
GIMP_HELP_CHANNEL_NEW },
|
||||
|
||||
{ "channels-new-last-values", GTK_STOCK_NEW,
|
||||
N_("_New Channel"), "",
|
||||
N_("New channel with last values"),
|
||||
N_("Create a new channel with last used values"),
|
||||
G_CALLBACK (channels_new_last_vals_cmd_callback),
|
||||
GIMP_HELP_CHANNEL_NEW },
|
||||
|
||||
{ "channels-duplicate", GIMP_STOCK_DUPLICATE,
|
||||
N_("D_uplicate Channel"), NULL,
|
||||
N_("Duplicate channel"),
|
||||
N_("Create a duplicate of this channel and add it to the image"),
|
||||
G_CALLBACK (channels_duplicate_cmd_callback),
|
||||
GIMP_HELP_CHANNEL_DUPLICATE },
|
||||
|
||||
{ "channels-delete", GTK_STOCK_DELETE,
|
||||
N_("_Delete Channel"), "",
|
||||
N_("Delete channel"),
|
||||
N_("Delete this channel"),
|
||||
G_CALLBACK (channels_delete_cmd_callback),
|
||||
GIMP_HELP_CHANNEL_DELETE },
|
||||
|
||||
{ "channels-raise", GTK_STOCK_GO_UP,
|
||||
N_("_Raise Channel"), "",
|
||||
N_("Raise channel"),
|
||||
N_("Raise this channel one step in the channel stack"),
|
||||
G_CALLBACK (channels_raise_cmd_callback),
|
||||
GIMP_HELP_CHANNEL_RAISE },
|
||||
|
||||
{ "channels-raise-to-top", GTK_STOCK_GOTO_TOP,
|
||||
N_("Raise Channel to _Top"), "",
|
||||
N_("Raise channel to top"),
|
||||
N_("Raise this channel to the top of the channel stack"),
|
||||
G_CALLBACK (channels_raise_to_top_cmd_callback),
|
||||
GIMP_HELP_CHANNEL_RAISE_TO_TOP },
|
||||
|
||||
{ "channels-lower", GTK_STOCK_GO_DOWN,
|
||||
N_("_Lower Channel"), "",
|
||||
N_("Lower channel"),
|
||||
N_("Lower this channel one step in the channel stack"),
|
||||
G_CALLBACK (channels_lower_cmd_callback),
|
||||
GIMP_HELP_CHANNEL_LOWER },
|
||||
|
||||
{ "channels-lower-to-bottom", GTK_STOCK_GOTO_BOTTOM,
|
||||
N_("Lower Channel to _Bottom"), "",
|
||||
N_("Lower channel to bottom"),
|
||||
N_("Lower this channel to the bottom of the channel stack"),
|
||||
G_CALLBACK (channels_lower_to_bottom_cmd_callback),
|
||||
GIMP_HELP_CHANNEL_LOWER_TO_BOTTOM }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry channels_to_selection_actions[] =
|
||||
static const GimpEnumActionEntry channels_to_selection_actions[] =
|
||||
{
|
||||
{ "channels-selection-replace", GIMP_STOCK_SELECTION_REPLACE,
|
||||
N_("Channel to Sele_ction"), NULL,
|
||||
N_("Channel to selection"),
|
||||
N_("Replace the selection with this channel"),
|
||||
GIMP_CHANNEL_OP_REPLACE, FALSE,
|
||||
GIMP_HELP_CHANNEL_SELECTION_REPLACE },
|
||||
|
||||
{ "channels-selection-add", GIMP_STOCK_SELECTION_ADD,
|
||||
N_("_Add to Selection"), NULL,
|
||||
N_("Add"),
|
||||
N_("Add this channel to the current selection"),
|
||||
GIMP_CHANNEL_OP_ADD, FALSE,
|
||||
GIMP_HELP_CHANNEL_SELECTION_ADD },
|
||||
|
||||
{ "channels-selection-subtract", GIMP_STOCK_SELECTION_SUBTRACT,
|
||||
N_("_Subtract from Selection"), NULL,
|
||||
N_("Subtract"),
|
||||
N_("Subtract this channel from the current selection"),
|
||||
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
|
||||
GIMP_HELP_CHANNEL_SELECTION_SUBTRACT },
|
||||
|
||||
{ "channels-selection-intersect", GIMP_STOCK_SELECTION_INTERSECT,
|
||||
N_("_Intersect with Selection"), NULL,
|
||||
N_("Intersect"),
|
||||
N_("Intersect this channel with the current selection"),
|
||||
GIMP_CHANNEL_OP_INTERSECT, FALSE,
|
||||
GIMP_HELP_CHANNEL_SELECTION_INTERSECT }
|
||||
};
|
||||
@ -144,16 +144,16 @@ void
|
||||
channels_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpChannel *channel = NULL;
|
||||
gboolean fs = FALSE;
|
||||
gboolean component = FALSE;
|
||||
GList *next = NULL;
|
||||
GList *prev = NULL;
|
||||
|
||||
if (gimage)
|
||||
if (image)
|
||||
{
|
||||
fs = (gimp_image_floating_sel (gimage) != NULL);
|
||||
fs = (gimp_image_floating_sel (image) != NULL);
|
||||
|
||||
if (GIMP_IS_COMPONENT_EDITOR (data))
|
||||
{
|
||||
@ -162,13 +162,13 @@ channels_actions_update (GimpActionGroup *group,
|
||||
}
|
||||
else
|
||||
{
|
||||
channel = gimp_image_get_active_channel (gimage);
|
||||
channel = gimp_image_get_active_channel (image);
|
||||
|
||||
if (channel)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
list = g_list_find (GIMP_LIST (gimage->channels)->list, channel);
|
||||
list = g_list_find (GIMP_LIST (image->channels)->list, channel);
|
||||
|
||||
if (list)
|
||||
{
|
||||
@ -184,8 +184,8 @@ channels_actions_update (GimpActionGroup *group,
|
||||
|
||||
SET_SENSITIVE ("channels-edit-attributes", !fs && channel);
|
||||
|
||||
SET_SENSITIVE ("channels-new", !fs && gimage);
|
||||
SET_SENSITIVE ("channels-new-last-values", !fs && gimage);
|
||||
SET_SENSITIVE ("channels-new", !fs && image);
|
||||
SET_SENSITIVE ("channels-new-last-values", !fs && image);
|
||||
SET_SENSITIVE ("channels-duplicate", !fs && (channel || component));
|
||||
SET_SENSITIVE ("channels-delete", !fs && channel);
|
||||
|
||||
|
||||
@ -71,13 +71,13 @@ channels_edit_attributes_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
ChannelOptionsDialog *options;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpChannel *channel;
|
||||
GtkWidget *widget;
|
||||
return_if_no_channel (gimage, channel, data);
|
||||
return_if_no_channel (image, channel, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
options = channel_options_dialog_new (gimage,
|
||||
options = channel_options_dialog_new (image,
|
||||
action_data_get_context (data),
|
||||
channel,
|
||||
widget,
|
||||
@ -90,7 +90,7 @@ channels_edit_attributes_cmd_callback (GtkAction *action,
|
||||
GIMP_HELP_CHANNEL_EDIT,
|
||||
_("Edit Channel Color"),
|
||||
_("_Fill opacity:"),
|
||||
FALSE);
|
||||
FALSE);
|
||||
|
||||
g_signal_connect (options->dialog, "response",
|
||||
G_CALLBACK (channels_edit_channel_response),
|
||||
@ -104,12 +104,12 @@ channels_new_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
ChannelOptionsDialog *options;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
options = channel_options_dialog_new (gimage,
|
||||
options = channel_options_dialog_new (image,
|
||||
action_data_get_context (data),
|
||||
NULL,
|
||||
widget,
|
||||
@ -123,7 +123,7 @@ channels_new_cmd_callback (GtkAction *action,
|
||||
GIMP_HELP_CHANNEL_NEW,
|
||||
_("New Channel Color"),
|
||||
_("_Fill opacity:"),
|
||||
TRUE);
|
||||
TRUE);
|
||||
|
||||
g_signal_connect (options->dialog, "response",
|
||||
G_CALLBACK (channels_new_channel_response),
|
||||
@ -136,11 +136,11 @@ void
|
||||
channels_new_last_vals_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpChannel *new_channel;
|
||||
gint width, height;
|
||||
GimpRGB color;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
if (GIMP_IS_CHANNEL (GIMP_ACTION (action)->viewable))
|
||||
{
|
||||
@ -152,15 +152,15 @@ channels_new_last_vals_cmd_callback (GtkAction *action,
|
||||
}
|
||||
else
|
||||
{
|
||||
width = gimp_image_get_width (gimage);
|
||||
height = gimp_image_get_height (gimage);
|
||||
width = gimp_image_get_width (image);
|
||||
height = gimp_image_get_height (image);
|
||||
color = channel_color;
|
||||
}
|
||||
|
||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||
_("New Channel"));
|
||||
|
||||
new_channel = gimp_channel_new (gimage, width, height,
|
||||
new_channel = gimp_channel_new (image, width, height,
|
||||
channel_name ? channel_name :
|
||||
_("New Channel"), &color);
|
||||
|
||||
@ -168,66 +168,66 @@ channels_new_last_vals_cmd_callback (GtkAction *action,
|
||||
action_data_get_context (data),
|
||||
GIMP_TRANSPARENT_FILL);
|
||||
|
||||
gimp_image_add_channel (gimage, new_channel, -1);
|
||||
gimp_image_add_channel (image, new_channel, -1);
|
||||
|
||||
gimp_image_undo_group_end (gimage);
|
||||
gimp_image_undo_group_end (image);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
channels_raise_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpChannel *channel;
|
||||
return_if_no_channel (gimage, channel, data);
|
||||
return_if_no_channel (image, channel, data);
|
||||
|
||||
gimp_image_raise_channel (gimage, channel);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_raise_channel (image, channel);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
channels_raise_to_top_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpChannel *channel;
|
||||
return_if_no_channel (gimage, channel, data);
|
||||
return_if_no_channel (image, channel, data);
|
||||
|
||||
gimp_image_raise_channel_to_top (gimage, channel);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_raise_channel_to_top (image, channel);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
channels_lower_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpChannel *channel;
|
||||
return_if_no_channel (gimage, channel, data);
|
||||
return_if_no_channel (image, channel, data);
|
||||
|
||||
gimp_image_lower_channel (gimage, channel);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_lower_channel (image, channel);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
channels_lower_to_bottom_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpChannel *channel;
|
||||
return_if_no_channel (gimage, channel, data);
|
||||
return_if_no_channel (image, channel, data);
|
||||
|
||||
gimp_image_lower_channel_to_bottom (gimage, channel);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_lower_channel_to_bottom (image, channel);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
channels_duplicate_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpChannel *new_channel;
|
||||
|
||||
if (GIMP_IS_COMPONENT_EDITOR (data))
|
||||
@ -235,7 +235,7 @@ channels_duplicate_cmd_callback (GtkAction *action,
|
||||
GimpChannelType component;
|
||||
const gchar *desc;
|
||||
gchar *name;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
component = GIMP_COMPONENT_EDITOR (data)->clicked_component;
|
||||
|
||||
@ -244,7 +244,7 @@ channels_duplicate_cmd_callback (GtkAction *action,
|
||||
|
||||
name = g_strdup_printf (_("%s Channel Copy"), desc);
|
||||
|
||||
new_channel = gimp_channel_new_from_component (gimage, component,
|
||||
new_channel = gimp_channel_new_from_component (image, component,
|
||||
name, NULL);
|
||||
|
||||
/* copied components are invisible by default so subsequent copies
|
||||
@ -257,7 +257,7 @@ channels_duplicate_cmd_callback (GtkAction *action,
|
||||
else
|
||||
{
|
||||
GimpChannel *channel;
|
||||
return_if_no_channel (gimage, channel, data);
|
||||
return_if_no_channel (image, channel, data);
|
||||
|
||||
new_channel =
|
||||
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
|
||||
@ -265,20 +265,20 @@ channels_duplicate_cmd_callback (GtkAction *action,
|
||||
TRUE));
|
||||
}
|
||||
|
||||
gimp_image_add_channel (gimage, new_channel, -1);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_add_channel (image, new_channel, -1);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
channels_delete_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpChannel *channel;
|
||||
return_if_no_channel (gimage, channel, data);
|
||||
return_if_no_channel (image, channel, data);
|
||||
|
||||
gimp_image_remove_channel (gimage, channel);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_remove_channel (image, channel);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -287,32 +287,32 @@ channels_to_selection_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpChannelOps op;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
|
||||
op = (GimpChannelOps) value;
|
||||
|
||||
if (GIMP_IS_COMPONENT_EDITOR (data))
|
||||
{
|
||||
GimpChannelType component;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
component = GIMP_COMPONENT_EDITOR (data)->clicked_component;
|
||||
|
||||
gimp_channel_select_component (gimp_image_get_mask (gimage), component,
|
||||
gimp_channel_select_component (gimp_image_get_mask (image), component,
|
||||
op, FALSE, 0.0, 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
GimpChannel *channel;
|
||||
return_if_no_channel (gimage, channel, data);
|
||||
return_if_no_channel (image, channel, data);
|
||||
|
||||
gimp_channel_select_channel (gimp_image_get_mask (gimage),
|
||||
gimp_channel_select_channel (gimp_image_get_mask (image),
|
||||
_("Channel to Selection"),
|
||||
channel, 0, 0,
|
||||
op, FALSE, 0.0, 0.0);
|
||||
}
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
|
||||
@ -336,22 +336,22 @@ channels_new_channel_response (GtkWidget *widget,
|
||||
&channel_color);
|
||||
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (options->save_sel_checkbutton)))
|
||||
{
|
||||
GimpChannel *selection = gimp_image_get_mask (options->gimage);
|
||||
{
|
||||
GimpChannel *selection = gimp_image_get_mask (options->image);
|
||||
|
||||
new_channel =
|
||||
new_channel =
|
||||
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (selection),
|
||||
GIMP_TYPE_CHANNEL,
|
||||
FALSE));
|
||||
|
||||
gimp_object_set_name (GIMP_OBJECT (new_channel), channel_name);
|
||||
gimp_object_set_name (GIMP_OBJECT (new_channel), channel_name);
|
||||
gimp_channel_set_color (new_channel, &channel_color, FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
new_channel = gimp_channel_new (options->gimage,
|
||||
options->gimage->width,
|
||||
options->gimage->height,
|
||||
new_channel = gimp_channel_new (options->image,
|
||||
options->image->width,
|
||||
options->image->height,
|
||||
channel_name,
|
||||
&channel_color);
|
||||
|
||||
@ -360,8 +360,8 @@ channels_new_channel_response (GtkWidget *widget,
|
||||
GIMP_TRANSPARENT_FILL);
|
||||
}
|
||||
|
||||
gimp_image_add_channel (options->gimage, new_channel, -1);
|
||||
gimp_image_flush (options->gimage);
|
||||
gimp_image_add_channel (options->image, new_channel, -1);
|
||||
gimp_image_flush (options->image);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (options->dialog);
|
||||
@ -392,7 +392,7 @@ channels_edit_channel_response (GtkWidget *widget,
|
||||
color_changed = TRUE;
|
||||
|
||||
if (name_changed && color_changed)
|
||||
gimp_image_undo_group_start (options->gimage,
|
||||
gimp_image_undo_group_start (options->image,
|
||||
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
|
||||
_("Channel Attributes"));
|
||||
|
||||
@ -403,10 +403,10 @@ channels_edit_channel_response (GtkWidget *widget,
|
||||
gimp_channel_set_color (channel, &color, TRUE);
|
||||
|
||||
if (name_changed && color_changed)
|
||||
gimp_image_undo_group_end (options->gimage);
|
||||
gimp_image_undo_group_end (options->image);
|
||||
|
||||
if (name_changed || color_changed)
|
||||
gimp_image_flush (options->gimage);
|
||||
gimp_image_flush (options->image);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (options->dialog);
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry colormap_editor_actions[] =
|
||||
static const GimpActionEntry colormap_editor_actions[] =
|
||||
{
|
||||
{ "colormap-editor-popup", GIMP_STOCK_INDEXED_PALETTE,
|
||||
N_("Colormap Menu"), NULL, NULL, NULL,
|
||||
@ -50,17 +50,17 @@ static GimpActionEntry colormap_editor_actions[] =
|
||||
GIMP_HELP_INDEXED_PALETTE_EDIT }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry colormap_editor_add_color_actions[] =
|
||||
static const GimpEnumActionEntry colormap_editor_add_color_actions[] =
|
||||
{
|
||||
{ "colormap-editor-add-color-from-fg", GTK_STOCK_ADD,
|
||||
N_("_Add Color from FG"), "",
|
||||
N_("Add color from FG"),
|
||||
N_("Add current foreground color"),
|
||||
FALSE, FALSE,
|
||||
GIMP_HELP_INDEXED_PALETTE_ADD },
|
||||
|
||||
{ "colormap-editor-add-color-from-bg", GTK_STOCK_ADD,
|
||||
N_("_Add Color from BG"), "",
|
||||
N_("Add color from BG"),
|
||||
N_("Add current background color"),
|
||||
TRUE, FALSE,
|
||||
GIMP_HELP_INDEXED_PALETTE_ADD }
|
||||
};
|
||||
@ -83,17 +83,17 @@ void
|
||||
colormap_editor_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpContext *context = action_data_get_context (data);
|
||||
gboolean indexed = FALSE;
|
||||
gint num_colors = 0;
|
||||
GimpRGB fg;
|
||||
GimpRGB bg;
|
||||
|
||||
if (gimage)
|
||||
if (image)
|
||||
{
|
||||
indexed = gimp_image_base_type (gimage) == GIMP_INDEXED;
|
||||
num_colors = gimage->num_cols;
|
||||
indexed = gimp_image_base_type (image) == GIMP_INDEXED;
|
||||
num_colors = image->num_cols;
|
||||
}
|
||||
|
||||
if (context)
|
||||
@ -108,11 +108,11 @@ colormap_editor_actions_update (GimpActionGroup *group,
|
||||
gimp_action_group_set_action_color (group, action, color, FALSE);
|
||||
|
||||
SET_SENSITIVE ("colormap-editor-edit-color",
|
||||
gimage && indexed);
|
||||
image && indexed);
|
||||
SET_SENSITIVE ("colormap-editor-add-color-from-fg",
|
||||
gimage && indexed && num_colors < 256);
|
||||
image && indexed && num_colors < 256);
|
||||
SET_SENSITIVE ("colormap-editor-add-color-from-bg",
|
||||
gimage && indexed && num_colors < 256);
|
||||
image && indexed && num_colors < 256);
|
||||
|
||||
SET_COLOR ("colormap-editor-add-color-from-fg", context ? &fg : NULL);
|
||||
SET_COLOR ("colormap-editor-add-color-from-bg", context ? &bg : NULL);
|
||||
|
||||
@ -54,17 +54,17 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpColormapEditor *editor;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpRGB color;
|
||||
gchar *desc;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
editor = GIMP_COLORMAP_EDITOR (data);
|
||||
|
||||
gimp_rgba_set_uchar (&color,
|
||||
gimage->cmap[editor->col_index * 3],
|
||||
gimage->cmap[editor->col_index * 3 + 1],
|
||||
gimage->cmap[editor->col_index * 3 + 2],
|
||||
image->cmap[editor->col_index * 3],
|
||||
image->cmap[editor->col_index * 3 + 1],
|
||||
image->cmap[editor->col_index * 3 + 2],
|
||||
OPAQUE_OPACITY);
|
||||
|
||||
desc = g_strdup_printf (_("Edit colormap entry #%d"), editor->col_index);
|
||||
@ -72,7 +72,7 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action,
|
||||
if (! editor->color_dialog)
|
||||
{
|
||||
editor->color_dialog =
|
||||
gimp_color_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
gimp_color_dialog_new (GIMP_VIEWABLE (image),
|
||||
_("Edit Colormap Entry"),
|
||||
GIMP_STOCK_INDEXED_PALETTE,
|
||||
desc,
|
||||
@ -93,7 +93,7 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action,
|
||||
else
|
||||
{
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (editor->color_dialog),
|
||||
GIMP_VIEWABLE (gimage));
|
||||
GIMP_VIEWABLE (image));
|
||||
g_object_set (editor->color_dialog, "description", desc, NULL);
|
||||
gimp_color_dialog_set_color (GIMP_COLOR_DIALOG (editor->color_dialog),
|
||||
&color);
|
||||
@ -110,11 +110,11 @@ colormap_editor_add_color_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpContext *context;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
return_if_no_context (context, data);
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
if (gimage->num_cols < 256)
|
||||
if (image->num_cols < 256)
|
||||
{
|
||||
GimpRGB color;
|
||||
|
||||
@ -123,8 +123,8 @@ colormap_editor_add_color_cmd_callback (GtkAction *action,
|
||||
else
|
||||
gimp_context_get_foreground (context, &color);
|
||||
|
||||
gimp_image_add_colormap_entry (gimage, &color);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_add_colormap_entry (image, &color);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ colormap_editor_edit_color_update (GimpColorDialog *dialog,
|
||||
GimpColorDialogState state,
|
||||
GimpColormapEditor *editor)
|
||||
{
|
||||
GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage;
|
||||
GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
@ -145,8 +145,8 @@ colormap_editor_edit_color_update (GimpColorDialog *dialog,
|
||||
break;
|
||||
|
||||
case GIMP_COLOR_DIALOG_OK:
|
||||
gimp_image_set_colormap_entry (gimage, editor->col_index, color, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_set_colormap_entry (image, editor->col_index, color, TRUE);
|
||||
gimp_image_flush (image);
|
||||
/* Fall through */
|
||||
|
||||
case GIMP_COLOR_DIALOG_CANCEL:
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static GimpActionEntry context_actions[] =
|
||||
static const GimpActionEntry context_actions[] =
|
||||
{
|
||||
{ "context-menu", NULL, N_("_Context") },
|
||||
{ "context-colors-menu", GIMP_STOCK_DEFAULT_COLORS, N_("_Colors") },
|
||||
@ -62,17 +62,19 @@ static GimpActionEntry context_actions[] =
|
||||
{ "context-brush-angle-menu", NULL, N_("A_ngle") },
|
||||
|
||||
{ "context-colors-default", GIMP_STOCK_DEFAULT_COLORS,
|
||||
N_("_Default Colors"), "D", NULL,
|
||||
N_("_Default Colors"), "D",
|
||||
N_("Set foreground color to black, background color to white"),
|
||||
G_CALLBACK (context_colors_default_cmd_callback),
|
||||
GIMP_HELP_TOOLBOX_DEFAULT_COLORS },
|
||||
|
||||
{ "context-colors-swap", GIMP_STOCK_SWAP_COLORS,
|
||||
N_("S_wap Colors"), "X", NULL,
|
||||
N_("S_wap Colors"), "X",
|
||||
N_("Exchange foreground and background colors"),
|
||||
G_CALLBACK (context_colors_swap_cmd_callback),
|
||||
GIMP_HELP_TOOLBOX_SWAP_COLORS }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_foreground_red_actions[] =
|
||||
static const GimpEnumActionEntry context_foreground_red_actions[] =
|
||||
{
|
||||
{ "context-foreground-red-set", GIMP_STOCK_CHANNEL_RED,
|
||||
"Foreground Red Set", NULL, NULL,
|
||||
@ -104,7 +106,7 @@ static GimpEnumActionEntry context_foreground_red_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_foreground_green_actions[] =
|
||||
static const GimpEnumActionEntry context_foreground_green_actions[] =
|
||||
{
|
||||
{ "context-foreground-green-set", GIMP_STOCK_CHANNEL_GREEN,
|
||||
"Foreground Green Set", NULL, NULL,
|
||||
@ -136,7 +138,7 @@ static GimpEnumActionEntry context_foreground_green_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_foreground_blue_actions[] =
|
||||
static const GimpEnumActionEntry context_foreground_blue_actions[] =
|
||||
{
|
||||
{ "context-foreground-blue-set", GIMP_STOCK_CHANNEL_BLUE,
|
||||
"Foreground Blue Set", NULL, NULL,
|
||||
@ -168,7 +170,7 @@ static GimpEnumActionEntry context_foreground_blue_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_background_red_actions[] =
|
||||
static const GimpEnumActionEntry context_background_red_actions[] =
|
||||
{
|
||||
{ "context-background-red-set", GIMP_STOCK_CHANNEL_RED,
|
||||
"Background Red Set", NULL, NULL,
|
||||
@ -200,7 +202,7 @@ static GimpEnumActionEntry context_background_red_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_background_green_actions[] =
|
||||
static const GimpEnumActionEntry context_background_green_actions[] =
|
||||
{
|
||||
{ "context-background-green-set", GIMP_STOCK_CHANNEL_GREEN,
|
||||
"Background Green Set", NULL, NULL,
|
||||
@ -232,7 +234,7 @@ static GimpEnumActionEntry context_background_green_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_background_blue_actions[] =
|
||||
static const GimpEnumActionEntry context_background_blue_actions[] =
|
||||
{
|
||||
{ "context-background-blue-set", GIMP_STOCK_CHANNEL_BLUE,
|
||||
"Background Blue Set", NULL, NULL,
|
||||
@ -264,7 +266,7 @@ static GimpEnumActionEntry context_background_blue_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_foreground_hue_actions[] =
|
||||
static const GimpEnumActionEntry context_foreground_hue_actions[] =
|
||||
{
|
||||
{ "context-foreground-hue-set", GIMP_STOCK_TOOL_HUE_SATURATION,
|
||||
"Foreground Hue Set", NULL, NULL,
|
||||
@ -296,7 +298,7 @@ static GimpEnumActionEntry context_foreground_hue_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_foreground_saturation_actions[] =
|
||||
static const GimpEnumActionEntry context_foreground_saturation_actions[] =
|
||||
{
|
||||
{ "context-foreground-saturation-set", GIMP_STOCK_TOOL_HUE_SATURATION,
|
||||
"Foreground Saturation Set", NULL, NULL,
|
||||
@ -328,7 +330,7 @@ static GimpEnumActionEntry context_foreground_saturation_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_foreground_value_actions[] =
|
||||
static const GimpEnumActionEntry context_foreground_value_actions[] =
|
||||
{
|
||||
{ "context-foreground-value-set", GIMP_STOCK_TOOL_HUE_SATURATION,
|
||||
"Foreground Value Set", NULL, NULL,
|
||||
@ -360,7 +362,7 @@ static GimpEnumActionEntry context_foreground_value_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_background_hue_actions[] =
|
||||
static const GimpEnumActionEntry context_background_hue_actions[] =
|
||||
{
|
||||
{ "context-background-hue-set", GIMP_STOCK_TOOL_HUE_SATURATION,
|
||||
"Background Hue Set", NULL, NULL,
|
||||
@ -392,7 +394,7 @@ static GimpEnumActionEntry context_background_hue_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_background_saturation_actions[] =
|
||||
static const GimpEnumActionEntry context_background_saturation_actions[] =
|
||||
{
|
||||
{ "context-background-saturation-set", GIMP_STOCK_TOOL_HUE_SATURATION,
|
||||
"Background Saturation Set", NULL, NULL,
|
||||
@ -424,7 +426,7 @@ static GimpEnumActionEntry context_background_saturation_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_background_value_actions[] =
|
||||
static const GimpEnumActionEntry context_background_value_actions[] =
|
||||
{
|
||||
{ "context-background-value-set", GIMP_STOCK_TOOL_HUE_SATURATION,
|
||||
"Background Value Set", NULL, NULL,
|
||||
@ -456,7 +458,7 @@ static GimpEnumActionEntry context_background_value_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_opacity_actions[] =
|
||||
static const GimpEnumActionEntry context_opacity_actions[] =
|
||||
{
|
||||
{ "context-opacity-set", GIMP_STOCK_TRANSPARENCY,
|
||||
"Set Transparency", NULL, NULL,
|
||||
@ -488,7 +490,7 @@ static GimpEnumActionEntry context_opacity_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_paint_mode_actions[] =
|
||||
static const GimpEnumActionEntry context_paint_mode_actions[] =
|
||||
{
|
||||
{ "context-paint-mode-first", GIMP_STOCK_TOOL_PENCIL,
|
||||
"First Paint Mode", NULL, NULL,
|
||||
@ -508,7 +510,7 @@ static GimpEnumActionEntry context_paint_mode_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_tool_select_actions[] =
|
||||
static const GimpEnumActionEntry context_tool_select_actions[] =
|
||||
{
|
||||
{ "context-tool-select-set", GIMP_STOCK_TOOLS,
|
||||
"Select Tool by Index", NULL, NULL,
|
||||
@ -532,7 +534,7 @@ static GimpEnumActionEntry context_tool_select_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_brush_select_actions[] =
|
||||
static const GimpEnumActionEntry context_brush_select_actions[] =
|
||||
{
|
||||
{ "context-brush-select-set", GIMP_STOCK_BRUSH,
|
||||
"Select Brush by Index", NULL, NULL,
|
||||
@ -556,7 +558,7 @@ static GimpEnumActionEntry context_brush_select_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_pattern_select_actions[] =
|
||||
static const GimpEnumActionEntry context_pattern_select_actions[] =
|
||||
{
|
||||
{ "context-pattern-select-set", GIMP_STOCK_PATTERN,
|
||||
"Select Pattern by Index", NULL, NULL,
|
||||
@ -580,7 +582,7 @@ static GimpEnumActionEntry context_pattern_select_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_palette_select_actions[] =
|
||||
static const GimpEnumActionEntry context_palette_select_actions[] =
|
||||
{
|
||||
{ "context-palette-select-set", GIMP_STOCK_PALETTE,
|
||||
"Select Palette by Index", NULL, NULL,
|
||||
@ -604,7 +606,7 @@ static GimpEnumActionEntry context_palette_select_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_gradient_select_actions[] =
|
||||
static const GimpEnumActionEntry context_gradient_select_actions[] =
|
||||
{
|
||||
{ "context-gradient-select-set", GIMP_STOCK_GRADIENT,
|
||||
"Select Gradient by Index", NULL, NULL,
|
||||
@ -628,7 +630,7 @@ static GimpEnumActionEntry context_gradient_select_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_font_select_actions[] =
|
||||
static const GimpEnumActionEntry context_font_select_actions[] =
|
||||
{
|
||||
{ "context-font-select-set", GIMP_STOCK_FONT,
|
||||
"Select Font by Index", NULL, NULL,
|
||||
@ -652,7 +654,7 @@ static GimpEnumActionEntry context_font_select_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_brush_shape_actions[] =
|
||||
static const GimpEnumActionEntry context_brush_shape_actions[] =
|
||||
{
|
||||
{ "context-brush-shape-circle", GIMP_STOCK_BRUSH,
|
||||
"Circular Brush", NULL, NULL,
|
||||
@ -668,7 +670,7 @@ static GimpEnumActionEntry context_brush_shape_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_brush_radius_actions[] =
|
||||
static const GimpEnumActionEntry context_brush_radius_actions[] =
|
||||
{
|
||||
{ "context-brush-radius-set", GIMP_STOCK_BRUSH,
|
||||
"Set Brush Radius", NULL, NULL,
|
||||
@ -700,7 +702,7 @@ static GimpEnumActionEntry context_brush_radius_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_brush_spikes_actions[] =
|
||||
static const GimpEnumActionEntry context_brush_spikes_actions[] =
|
||||
{
|
||||
{ "context-brush-spikes-set", GIMP_STOCK_BRUSH,
|
||||
"Set Brush Spikes", NULL, NULL,
|
||||
@ -732,7 +734,7 @@ static GimpEnumActionEntry context_brush_spikes_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_brush_hardness_actions[] =
|
||||
static const GimpEnumActionEntry context_brush_hardness_actions[] =
|
||||
{
|
||||
{ "context-brush-hardness-set", GIMP_STOCK_BRUSH,
|
||||
"Set Brush Hardness", NULL, NULL,
|
||||
@ -764,7 +766,7 @@ static GimpEnumActionEntry context_brush_hardness_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_brush_aspect_actions[] =
|
||||
static const GimpEnumActionEntry context_brush_aspect_actions[] =
|
||||
{
|
||||
{ "context-brush-aspect-set", GIMP_STOCK_BRUSH,
|
||||
"Set Brush Aspect", NULL, NULL,
|
||||
@ -796,7 +798,7 @@ static GimpEnumActionEntry context_brush_aspect_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry context_brush_angle_actions[] =
|
||||
static const GimpEnumActionEntry context_brush_angle_actions[] =
|
||||
{
|
||||
{ "context-brush-angle-set", GIMP_STOCK_BRUSH,
|
||||
"Set Brush Angle", NULL, NULL,
|
||||
|
||||
@ -34,14 +34,14 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry cursor_info_actions[] =
|
||||
static const GimpActionEntry cursor_info_actions[] =
|
||||
{
|
||||
{ "cursor-info-popup", GIMP_STOCK_CURSOR,
|
||||
N_("Pointer Information Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_POINTER_INFO_DIALOG }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry cursor_info_toggle_actions[] =
|
||||
static const GimpToggleActionEntry cursor_info_toggle_actions[] =
|
||||
{
|
||||
{ "cursor-info-sample-merged", NULL,
|
||||
N_("_Sample Merged"), "",
|
||||
|
||||
@ -79,7 +79,7 @@ data_open_as_image_cmd_callback (GtkAction *action,
|
||||
|
||||
data = (GimpData *)
|
||||
gimp_context_get_by_type (context,
|
||||
view->factory->container->children_type);
|
||||
view->factory->container->children_type);
|
||||
|
||||
if (data && data->filename)
|
||||
{
|
||||
@ -128,13 +128,13 @@ data_new_cmd_callback (GtkAction *action,
|
||||
data = gimp_data_factory_data_new (view->factory, _("Untitled"));
|
||||
|
||||
if (data)
|
||||
{
|
||||
gimp_context_set_by_type (context,
|
||||
view->factory->container->children_type,
|
||||
GIMP_OBJECT (data));
|
||||
{
|
||||
gimp_context_set_by_type (context,
|
||||
view->factory->container->children_type,
|
||||
GIMP_OBJECT (data));
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->edit_button));
|
||||
}
|
||||
gtk_button_clicked (GTK_BUTTON (view->edit_button));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,23 +150,23 @@ data_duplicate_cmd_callback (GtkAction *action,
|
||||
|
||||
data = (GimpData *)
|
||||
gimp_context_get_by_type (context,
|
||||
view->factory->container->children_type);
|
||||
view->factory->container->children_type);
|
||||
|
||||
if (data && gimp_container_have (view->factory->container,
|
||||
GIMP_OBJECT (data)))
|
||||
GIMP_OBJECT (data)))
|
||||
{
|
||||
GimpData *new_data;
|
||||
|
||||
new_data = gimp_data_factory_data_duplicate (view->factory, data);
|
||||
|
||||
if (new_data)
|
||||
{
|
||||
gimp_context_set_by_type (context,
|
||||
view->factory->container->children_type,
|
||||
GIMP_OBJECT (new_data));
|
||||
{
|
||||
gimp_context_set_by_type (context,
|
||||
view->factory->container->children_type,
|
||||
GIMP_OBJECT (new_data));
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->edit_button));
|
||||
}
|
||||
gtk_button_clicked (GTK_BUTTON (view->edit_button));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ data_delete_cmd_callback (GtkAction *action,
|
||||
|
||||
data = (GimpData *)
|
||||
gimp_context_get_by_type (context,
|
||||
view->factory->container->children_type);
|
||||
view->factory->container->children_type);
|
||||
|
||||
if (data && data->deletable && gimp_container_have (view->factory->container,
|
||||
GIMP_OBJECT (data)))
|
||||
@ -277,7 +277,7 @@ data_edit_cmd_callback (GtkAction *action,
|
||||
|
||||
data = (GimpData *)
|
||||
gimp_context_get_by_type (context,
|
||||
view->factory->container->children_type);
|
||||
view->factory->container->children_type);
|
||||
|
||||
if (data && gimp_container_have (view->factory->container,
|
||||
GIMP_OBJECT (data)))
|
||||
|
||||
@ -29,9 +29,10 @@
|
||||
#include "debug-actions.h"
|
||||
#include "debug-commands.h"
|
||||
|
||||
|
||||
#ifdef ENABLE_DEBUG_MENU
|
||||
|
||||
static GimpActionEntry debug_actions[] =
|
||||
static const GimpActionEntry debug_actions[] =
|
||||
{
|
||||
{ "debug-menu", NULL, "D_ebug" },
|
||||
|
||||
|
||||
@ -150,26 +150,26 @@ debug_dump_menus_recurse_menu (GtkWidget *menu,
|
||||
menu_item = GTK_WIDGET (list->data);
|
||||
|
||||
if (GTK_IS_LABEL (GTK_BIN (menu_item)->child))
|
||||
{
|
||||
label = gtk_label_get_text (GTK_LABEL (GTK_BIN (menu_item)->child));
|
||||
full_path = g_strconcat (path, "/", label, NULL);
|
||||
{
|
||||
label = gtk_label_get_text (GTK_LABEL (GTK_BIN (menu_item)->child));
|
||||
full_path = g_strconcat (path, "/", label, NULL);
|
||||
|
||||
help_page = g_object_get_data (G_OBJECT (menu_item), "gimp-help-id");
|
||||
help_page = g_strdup (help_page);
|
||||
|
||||
format_str = g_strdup_printf ("%%%ds%%%ds %%-20s %%s\n",
|
||||
depth * 2, depth * 2 - 40);
|
||||
g_print (format_str,
|
||||
"", label, "", help_page ? help_page : "");
|
||||
g_free (format_str);
|
||||
g_free (help_page);
|
||||
format_str = g_strdup_printf ("%%%ds%%%ds %%-20s %%s\n",
|
||||
depth * 2, depth * 2 - 40);
|
||||
g_print (format_str,
|
||||
"", label, "", help_page ? help_page : "");
|
||||
g_free (format_str);
|
||||
g_free (help_page);
|
||||
|
||||
if (GTK_MENU_ITEM (menu_item)->submenu)
|
||||
debug_dump_menus_recurse_menu (GTK_MENU_ITEM (menu_item)->submenu,
|
||||
if (GTK_MENU_ITEM (menu_item)->submenu)
|
||||
debug_dump_menus_recurse_menu (GTK_MENU_ITEM (menu_item)->submenu,
|
||||
depth + 1, full_path);
|
||||
|
||||
g_free (full_path);
|
||||
}
|
||||
g_free (full_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry dialogs_actions[] =
|
||||
static const GimpActionEntry dialogs_actions[] =
|
||||
{
|
||||
{ "dialogs-menu", NULL, N_("_Dialogs") },
|
||||
{ "dialogs-new-dock-menu", NULL, N_("Create New Doc_k") },
|
||||
@ -59,7 +59,7 @@ static GimpActionEntry dialogs_actions[] =
|
||||
GIMP_HELP_TOOLBOX }
|
||||
};
|
||||
|
||||
GimpStringActionEntry dialogs_dockable_actions[] =
|
||||
const GimpStringActionEntry dialogs_dockable_actions[] =
|
||||
{
|
||||
{ "dialogs-tool-options", GIMP_STOCK_TOOL_OPTIONS,
|
||||
N_("Tool _Options"), NULL, N_("Tool Options"),
|
||||
@ -184,7 +184,7 @@ GimpStringActionEntry dialogs_dockable_actions[] =
|
||||
|
||||
gint n_dialogs_dockable_actions = G_N_ELEMENTS (dialogs_dockable_actions);
|
||||
|
||||
static GimpStringActionEntry dialogs_toplevel_actions[] =
|
||||
static const GimpStringActionEntry dialogs_toplevel_actions[] =
|
||||
{
|
||||
{ "dialogs-preferences", GTK_STOCK_PREFERENCES,
|
||||
N_("_Preferences"), NULL, NULL,
|
||||
|
||||
@ -25,8 +25,8 @@
|
||||
#error "widgets/gimpactiongroup.h must be included prior to dialog-actions.h"
|
||||
#endif
|
||||
|
||||
extern GimpStringActionEntry dialogs_dockable_actions[];
|
||||
extern gint n_dialogs_dockable_actions;
|
||||
extern const GimpStringActionEntry dialogs_dockable_actions[];
|
||||
extern gint n_dialogs_dockable_actions;
|
||||
|
||||
|
||||
void dialogs_actions_setup (GimpActionGroup *group);
|
||||
|
||||
@ -59,7 +59,7 @@ dialogs_show_toolbox_cmd_callback (GtkAction *action,
|
||||
void
|
||||
dialogs_create_toplevel_cmd_callback (GtkAction *action,
|
||||
const gchar *value,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
return_if_no_widget (widget, data);
|
||||
@ -73,7 +73,7 @@ dialogs_create_toplevel_cmd_callback (GtkAction *action,
|
||||
void
|
||||
dialogs_create_dockable_cmd_callback (GtkAction *action,
|
||||
const gchar *value,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry dock_actions[] =
|
||||
static const GimpActionEntry dock_actions[] =
|
||||
{
|
||||
{ "dock-move-to-screen-menu", GIMP_STOCK_MOVE_TO_SCREEN,
|
||||
N_("M_ove to Screen"), NULL, NULL, NULL,
|
||||
@ -54,7 +54,7 @@ static GimpActionEntry dock_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry dock_toggle_actions[] =
|
||||
static const GimpToggleActionEntry dock_toggle_actions[] =
|
||||
{
|
||||
{ "dock-show-image-menu", NULL,
|
||||
N_("_Show Image Selection"), NULL, NULL,
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry dockable_actions[] =
|
||||
static const GimpActionEntry dockable_actions[] =
|
||||
{
|
||||
{ "dockable-popup", NULL,
|
||||
N_("Dialogs Menu"), NULL, NULL, NULL,
|
||||
@ -59,7 +59,7 @@ static GimpActionEntry dockable_actions[] =
|
||||
G_CALLBACK (dockable_close_tab_cmd_callback),
|
||||
GIMP_HELP_DOCK_TAB_CLOSE },
|
||||
|
||||
{ "dockable-detach-tab", GTK_STOCK_CONVERT,
|
||||
{ "dockable-detach-tab", GIMP_STOCK_DETACH,
|
||||
N_("_Detach Tab"), "", NULL,
|
||||
G_CALLBACK (dockable_detach_tab_cmd_callback),
|
||||
GIMP_HELP_DOCK_TAB_DETACH }
|
||||
@ -76,7 +76,7 @@ static GimpActionEntry dockable_actions[] =
|
||||
(style), \
|
||||
GIMP_HELP_DOCK_TAB_STYLE }
|
||||
|
||||
static GimpRadioActionEntry dockable_view_size_actions[] =
|
||||
static const GimpRadioActionEntry dockable_view_size_actions[] =
|
||||
{
|
||||
VIEW_SIZE ("tiny", N_("_Tiny"), GIMP_VIEW_SIZE_TINY),
|
||||
VIEW_SIZE ("extra-small", N_("E_xtra Small"), GIMP_VIEW_SIZE_EXTRA_SMALL),
|
||||
@ -89,7 +89,7 @@ static GimpRadioActionEntry dockable_view_size_actions[] =
|
||||
VIEW_SIZE ("gigantic", N_("_Gigantic"), GIMP_VIEW_SIZE_GIGANTIC)
|
||||
};
|
||||
|
||||
static GimpRadioActionEntry dockable_tab_style_actions[] =
|
||||
static const GimpRadioActionEntry dockable_tab_style_actions[] =
|
||||
{
|
||||
TAB_STYLE ("icon", N_("_Icon"), GIMP_TAB_STYLE_ICON),
|
||||
TAB_STYLE ("preview", N_("Current _Status"), GIMP_TAB_STYLE_PREVIEW),
|
||||
@ -102,7 +102,7 @@ static GimpRadioActionEntry dockable_tab_style_actions[] =
|
||||
#undef TAB_STYLE
|
||||
|
||||
|
||||
static GimpToggleActionEntry dockable_toggle_actions[] =
|
||||
static const GimpToggleActionEntry dockable_toggle_actions[] =
|
||||
{
|
||||
{ "dockable-show-button-bar", NULL,
|
||||
N_("Show _Button Bar"), NULL, NULL,
|
||||
@ -111,7 +111,7 @@ static GimpToggleActionEntry dockable_toggle_actions[] =
|
||||
GIMP_HELP_DOCK_SHOW_BUTTON_BAR }
|
||||
};
|
||||
|
||||
static GimpRadioActionEntry dockable_view_type_actions[] =
|
||||
static const GimpRadioActionEntry dockable_view_type_actions[] =
|
||||
{
|
||||
{ "dockable-view-type-list", NULL,
|
||||
N_("View as _List"), NULL, NULL,
|
||||
@ -189,7 +189,7 @@ dockable_actions_update (GimpActionGroup *group,
|
||||
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (dockbook));
|
||||
|
||||
dockable = (GimpDockable *)
|
||||
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
|
||||
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dockbook), page_num);
|
||||
}
|
||||
else if (GIMP_IS_DOCKABLE (data))
|
||||
{
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry documents_actions[] =
|
||||
static const GimpActionEntry documents_actions[] =
|
||||
{
|
||||
{ "documents-popup", GTK_STOCK_OPEN,
|
||||
N_("Documents Menu"), NULL, NULL, NULL,
|
||||
|
||||
@ -303,16 +303,16 @@ documents_open_image (GimpContext *context,
|
||||
GimpImagefile *imagefile)
|
||||
{
|
||||
const gchar *uri;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpPDBStatusType status;
|
||||
GError *error = NULL;
|
||||
|
||||
uri = gimp_object_get_name (GIMP_OBJECT (imagefile));
|
||||
|
||||
gimage = file_open_with_display (context->gimp, context, NULL,
|
||||
image = file_open_with_display (context->gimp, context, NULL,
|
||||
uri, &status, &error);
|
||||
|
||||
if (! gimage && status != GIMP_PDB_CANCEL)
|
||||
if (! image && status != GIMP_PDB_CANCEL)
|
||||
{
|
||||
gchar *filename;
|
||||
|
||||
@ -329,15 +329,15 @@ static void
|
||||
documents_raise_display (gpointer data,
|
||||
gpointer user_data)
|
||||
{
|
||||
GimpDisplay *gdisp = data;
|
||||
GimpDisplay *display = data;
|
||||
RaiseClosure *closure = user_data;
|
||||
const gchar *uri;
|
||||
|
||||
uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
|
||||
uri = gimp_object_get_name (GIMP_OBJECT (display->image));
|
||||
|
||||
if (uri && ! strcmp (closure->name, uri))
|
||||
{
|
||||
closure->found = TRUE;
|
||||
gtk_window_present (GTK_WINDOW (gdisp->shell));
|
||||
gtk_window_present (GTK_WINDOW (display->shell));
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,76 +39,88 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry drawable_actions[] =
|
||||
static const GimpActionEntry drawable_actions[] =
|
||||
{
|
||||
{ "drawable-desaturate", GIMP_STOCK_CONVERT_GRAYSCALE,
|
||||
N_("_Desaturate..."), NULL, NULL,
|
||||
N_("_Desaturate..."), NULL,
|
||||
N_("Turn colors into shades of gray"),
|
||||
G_CALLBACK (drawable_desaturate_cmd_callback),
|
||||
GIMP_HELP_LAYER_DESATURATE },
|
||||
|
||||
{ "drawable-equalize", NULL,
|
||||
N_("_Equalize"), NULL, NULL,
|
||||
N_("_Equalize"), NULL,
|
||||
N_("Automatic contrast enhancement"),
|
||||
G_CALLBACK (drawable_equalize_cmd_callback),
|
||||
GIMP_HELP_LAYER_EQUALIZE },
|
||||
|
||||
{ "drawable-invert", GIMP_STOCK_INVERT,
|
||||
N_("In_vert"), NULL, NULL,
|
||||
N_("In_vert"), NULL,
|
||||
N_("Invert the colors"),
|
||||
G_CALLBACK (drawable_invert_cmd_callback),
|
||||
GIMP_HELP_LAYER_INVERT },
|
||||
|
||||
{ "drawable-levels-stretch", NULL,
|
||||
N_("_White Balance"), NULL, NULL,
|
||||
N_("_White Balance"), NULL,
|
||||
N_("Automatic white balance correction"),
|
||||
G_CALLBACK (drawable_levels_stretch_cmd_callback),
|
||||
GIMP_HELP_LAYER_WHITE_BALANCE},
|
||||
|
||||
{ "drawable-offset", NULL,
|
||||
N_("_Offset..."), "<control><shift>O", NULL,
|
||||
N_("_Offset..."), "<control><shift>O",
|
||||
N_("Shift the pixels, optionally wrapping them at the borders"),
|
||||
G_CALLBACK (drawable_offset_cmd_callback),
|
||||
GIMP_HELP_LAYER_OFFSET }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry drawable_toggle_actions[] =
|
||||
static const GimpToggleActionEntry drawable_toggle_actions[] =
|
||||
{
|
||||
{ "drawable-linked", GIMP_STOCK_LINKED,
|
||||
N_("_Linked"), NULL, NULL,
|
||||
N_("_Linked"), NULL,
|
||||
N_("Toggle the linked state"),
|
||||
G_CALLBACK (drawable_linked_cmd_callback),
|
||||
FALSE,
|
||||
GIMP_HELP_LAYER_LINKED },
|
||||
|
||||
{ "drawable-visible", GIMP_STOCK_VISIBLE,
|
||||
N_("_Visible"), NULL, NULL,
|
||||
N_("_Visible"), NULL,
|
||||
N_("Toggle visibility"),
|
||||
G_CALLBACK (drawable_visible_cmd_callback),
|
||||
FALSE,
|
||||
GIMP_HELP_LAYER_VISIBLE }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry drawable_flip_actions[] =
|
||||
static const GimpEnumActionEntry drawable_flip_actions[] =
|
||||
{
|
||||
{ "drawable-flip-horizontal", GIMP_STOCK_FLIP_HORIZONTAL,
|
||||
N_("Flip _Horizontally"), NULL, NULL,
|
||||
N_("Flip _Horizontally"), NULL,
|
||||
N_("Flip horizontally"),
|
||||
GIMP_ORIENTATION_HORIZONTAL, FALSE,
|
||||
GIMP_HELP_LAYER_FLIP_HORIZONTAL },
|
||||
|
||||
{ "drawable-flip-vertical", GIMP_STOCK_FLIP_VERTICAL,
|
||||
N_("Flip _Vertically"), NULL, NULL,
|
||||
N_("Flip _Vertically"), NULL,
|
||||
N_("Flip vertically"),
|
||||
GIMP_ORIENTATION_VERTICAL, FALSE,
|
||||
GIMP_HELP_LAYER_FLIP_VERTICAL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry drawable_rotate_actions[] =
|
||||
static const GimpEnumActionEntry drawable_rotate_actions[] =
|
||||
{
|
||||
{ "drawable-rotate-90", GIMP_STOCK_ROTATE_90,
|
||||
N_("Rotate 90 degrees _CW"), NULL, NULL,
|
||||
N_("Rotate 90° _clockwise"), NULL,
|
||||
N_("Rotate 90 degrees to the right"),
|
||||
GIMP_ROTATE_90, FALSE,
|
||||
GIMP_HELP_LAYER_ROTATE_90 },
|
||||
|
||||
{ "drawable-rotate-180", GIMP_STOCK_ROTATE_180,
|
||||
N_("Rotate _180 degrees"), NULL, NULL,
|
||||
N_("Rotate _180°"), NULL,
|
||||
N_("Turn upside-down"),
|
||||
GIMP_ROTATE_180, FALSE,
|
||||
GIMP_HELP_LAYER_ROTATE_180 },
|
||||
|
||||
{ "drawable-rotate-270", GIMP_STOCK_ROTATE_270,
|
||||
N_("Rotate 90 degrees CC_W"), NULL, NULL,
|
||||
N_("Rotate 90° counter-clock_wise"), NULL,
|
||||
N_("Rotate 90 degrees to the left"),
|
||||
GIMP_ROTATE_270, FALSE,
|
||||
GIMP_HELP_LAYER_ROTATE_270 }
|
||||
};
|
||||
@ -140,7 +152,7 @@ void
|
||||
drawable_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable = NULL;
|
||||
gboolean is_rgb = FALSE;
|
||||
gboolean is_gray = FALSE;
|
||||
@ -148,11 +160,11 @@ drawable_actions_update (GimpActionGroup *group,
|
||||
gboolean visible = FALSE;
|
||||
gboolean linked = FALSE;
|
||||
|
||||
gimage = action_data_get_image (data);
|
||||
image = action_data_get_image (data);
|
||||
|
||||
if (gimage)
|
||||
if (image)
|
||||
{
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
drawable = gimp_image_active_drawable (image);
|
||||
|
||||
if (drawable)
|
||||
{
|
||||
|
||||
@ -63,10 +63,10 @@ drawable_desaturate_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
DesaturateDialog *dialog;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
GtkWidget *widget;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
if (! gimp_drawable_is_rgb (drawable))
|
||||
@ -88,9 +88,9 @@ void
|
||||
drawable_equalize_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable))
|
||||
{
|
||||
@ -99,16 +99,16 @@ drawable_equalize_cmd_callback (GtkAction *action,
|
||||
}
|
||||
|
||||
gimp_drawable_equalize (drawable, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
drawable_invert_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable))
|
||||
{
|
||||
@ -117,17 +117,17 @@ drawable_invert_cmd_callback (GtkAction *action,
|
||||
}
|
||||
|
||||
gimp_drawable_invert (drawable);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
drawable_levels_stretch_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
GimpContext *context;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
return_if_no_context (context, data);
|
||||
|
||||
if (! gimp_drawable_is_rgb (drawable))
|
||||
@ -137,18 +137,18 @@ drawable_levels_stretch_cmd_callback (GtkAction *action,
|
||||
}
|
||||
|
||||
gimp_drawable_levels_stretch (drawable, context);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
drawable_offset_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = offset_dialog_new (drawable, widget);
|
||||
@ -160,10 +160,10 @@ void
|
||||
drawable_linked_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
gboolean linked;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
|
||||
linked = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -176,14 +176,14 @@ drawable_linked_cmd_callback (GtkAction *action,
|
||||
GimpUndo *undo;
|
||||
gboolean push_undo = TRUE;
|
||||
|
||||
undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
|
||||
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
|
||||
GIMP_UNDO_ITEM_LINKED);
|
||||
|
||||
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawable))
|
||||
push_undo = FALSE;
|
||||
|
||||
gimp_item_set_linked (GIMP_ITEM (drawable), linked, push_undo);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,10 +191,10 @@ void
|
||||
drawable_visible_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
gboolean visible;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
|
||||
visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -207,14 +207,14 @@ drawable_visible_cmd_callback (GtkAction *action,
|
||||
GimpUndo *undo;
|
||||
gboolean push_undo = TRUE;
|
||||
|
||||
undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
|
||||
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
|
||||
GIMP_UNDO_ITEM_VISIBILITY);
|
||||
|
||||
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawable))
|
||||
push_undo = FALSE;
|
||||
|
||||
gimp_item_set_visible (GIMP_ITEM (drawable), visible, push_undo);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,13 +224,13 @@ drawable_flip_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
GimpItem *item;
|
||||
GimpContext *context;
|
||||
gint off_x, off_y;
|
||||
gdouble axis = 0.0;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
return_if_no_context (context, data);
|
||||
|
||||
item = GIMP_ITEM (drawable);
|
||||
@ -252,7 +252,7 @@ drawable_flip_cmd_callback (GtkAction *action,
|
||||
}
|
||||
|
||||
if (gimp_item_get_linked (item))
|
||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
|
||||
GIMP_ITEM_GET_CLASS (item)->flip_desc);
|
||||
|
||||
gimp_item_flip (item, context, (GimpOrientationType) value, axis, FALSE);
|
||||
@ -261,10 +261,10 @@ drawable_flip_cmd_callback (GtkAction *action,
|
||||
{
|
||||
gimp_item_linked_flip (item, context, (GimpOrientationType) action, axis,
|
||||
FALSE);
|
||||
gimp_image_undo_group_end (gimage);
|
||||
gimp_image_undo_group_end (image);
|
||||
}
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -272,14 +272,14 @@ drawable_rotate_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
GimpContext *context;
|
||||
GimpItem *item;
|
||||
gint off_x, off_y;
|
||||
gdouble center_x, center_y;
|
||||
gboolean clip_result = FALSE;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
return_if_no_context (context, data);
|
||||
|
||||
item = GIMP_ITEM (drawable);
|
||||
@ -290,7 +290,7 @@ drawable_rotate_cmd_callback (GtkAction *action,
|
||||
center_y = ((gdouble) off_y + (gdouble) gimp_item_height (item) / 2.0);
|
||||
|
||||
if (gimp_item_get_linked (item))
|
||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
|
||||
GIMP_ITEM_GET_CLASS (item)->rotate_desc);
|
||||
|
||||
if (GIMP_IS_CHANNEL (item))
|
||||
@ -303,10 +303,10 @@ drawable_rotate_cmd_callback (GtkAction *action,
|
||||
{
|
||||
gimp_item_linked_rotate (item, context, (GimpRotationType) value,
|
||||
center_x, center_y, FALSE);
|
||||
gimp_image_undo_group_end (gimage);
|
||||
gimp_image_undo_group_end (image);
|
||||
}
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
/* private functions */
|
||||
@ -319,14 +319,14 @@ desaturate_response (GtkWidget *widget,
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
{
|
||||
GimpDrawable *drawable = dialog->drawable;
|
||||
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
/* remember for next invocation of the dialog */
|
||||
desaturate_mode = dialog->mode;
|
||||
|
||||
gimp_drawable_desaturate (drawable, desaturate_mode);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (dialog->dialog);
|
||||
|
||||
@ -56,7 +56,7 @@ static void edit_actions_pattern_changed (GimpContext *context,
|
||||
GimpActionGroup *group);
|
||||
|
||||
|
||||
static GimpActionEntry edit_actions[] =
|
||||
static const GimpActionEntry edit_actions[] =
|
||||
{
|
||||
{ "edit-menu", NULL, N_("_Edit") },
|
||||
{ "edit-paste-as-menu", NULL, N_("_Paste as") },
|
||||
@ -68,54 +68,61 @@ static GimpActionEntry edit_actions[] =
|
||||
|
||||
{ "edit-undo", GTK_STOCK_UNDO,
|
||||
N_("_Undo"), "<control>Z",
|
||||
N_("Undo"),
|
||||
N_("Undo the last operation"),
|
||||
G_CALLBACK (edit_undo_cmd_callback),
|
||||
GIMP_HELP_EDIT_UNDO },
|
||||
|
||||
{ "edit-redo", GTK_STOCK_REDO,
|
||||
N_("_Redo"), "<control>Y",
|
||||
N_("Redo"),
|
||||
N_("Redo the last operation that was undone"),
|
||||
G_CALLBACK (edit_redo_cmd_callback),
|
||||
GIMP_HELP_EDIT_REDO },
|
||||
|
||||
{ "edit-undo-clear", GTK_STOCK_CLEAR,
|
||||
N_("_Clear Undo History"), "",
|
||||
N_("Clear undo history"),
|
||||
N_("Remove all operations from the undo history"),
|
||||
G_CALLBACK (edit_undo_clear_cmd_callback),
|
||||
GIMP_HELP_EDIT_UNDO_CLEAR },
|
||||
|
||||
{ "edit-cut", GTK_STOCK_CUT,
|
||||
N_("Cu_t"), "<control>X", NULL,
|
||||
N_("Cu_t"), "<control>X",
|
||||
N_("Move the selected pixels to the clipboard"),
|
||||
G_CALLBACK (edit_cut_cmd_callback),
|
||||
GIMP_HELP_EDIT_CUT },
|
||||
|
||||
{ "edit-copy", GTK_STOCK_COPY,
|
||||
N_("_Copy"), "<control>C", NULL,
|
||||
N_("_Copy"), "<control>C",
|
||||
N_("Copy the selected pixels to the clipboard"),
|
||||
G_CALLBACK (edit_copy_cmd_callback),
|
||||
GIMP_HELP_EDIT_COPY },
|
||||
|
||||
{ "edit-copy-visible", NULL, /* GIMP_STOCK_COPY_VISIBLE, */
|
||||
N_("Copy _Visible"), "", NULL,
|
||||
N_("Copy _Visible"), "",
|
||||
N_("Copy the selected region to the clipboard"),
|
||||
G_CALLBACK (edit_copy_visible_cmd_callback),
|
||||
GIMP_HELP_EDIT_COPY_VISIBLE },
|
||||
|
||||
{ "edit-paste", GTK_STOCK_PASTE,
|
||||
N_("_Paste"), "<control>V", NULL,
|
||||
N_("_Paste"), "<control>V",
|
||||
N_("Paste the content of the clipboard"),
|
||||
G_CALLBACK (edit_paste_cmd_callback),
|
||||
GIMP_HELP_EDIT_PASTE },
|
||||
|
||||
{ "edit-paste-into", GIMP_STOCK_PASTE_INTO,
|
||||
N_("Paste _Into"), NULL, NULL,
|
||||
N_("Paste _Into"), NULL,
|
||||
N_("Paste the content of the clipboard into the current selection"),
|
||||
G_CALLBACK (edit_paste_into_cmd_callback),
|
||||
GIMP_HELP_EDIT_PASTE_INTO },
|
||||
|
||||
{ "edit-paste-as-new", GIMP_STOCK_PASTE_AS_NEW,
|
||||
N_("Paste as New"), NULL, NULL,
|
||||
N_("Paste as New"), NULL,
|
||||
N_("Create a new image from the content of the clipboard"),
|
||||
G_CALLBACK (edit_paste_as_new_cmd_callback),
|
||||
GIMP_HELP_EDIT_PASTE_AS_NEW },
|
||||
|
||||
{ "edit-paste-as-new-short", GIMP_STOCK_PASTE_AS_NEW,
|
||||
N_("_New Image"), NULL, NULL,
|
||||
N_("_New Image"), NULL,
|
||||
N_("Create a new image from the content of the clipboard"),
|
||||
G_CALLBACK (edit_paste_as_new_cmd_callback),
|
||||
GIMP_HELP_EDIT_PASTE_AS_NEW },
|
||||
|
||||
@ -140,25 +147,29 @@ static GimpActionEntry edit_actions[] =
|
||||
GIMP_HELP_BUFFER_PASTE },
|
||||
|
||||
{ "edit-clear", GTK_STOCK_CLEAR,
|
||||
N_("Cl_ear"), "Delete", NULL,
|
||||
N_("Cl_ear"), "Delete",
|
||||
N_("Clear the selected pixels"),
|
||||
G_CALLBACK (edit_clear_cmd_callback),
|
||||
GIMP_HELP_EDIT_CLEAR }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry edit_fill_actions[] =
|
||||
static const GimpEnumActionEntry edit_fill_actions[] =
|
||||
{
|
||||
{ "edit-fill-fg", GIMP_STOCK_TOOL_BUCKET_FILL,
|
||||
N_("Fill with _FG Color"), "<control>comma", NULL,
|
||||
N_("Fill with _FG Color"), "<control>comma",
|
||||
N_("Fill the selection using the foreground color"),
|
||||
GIMP_FOREGROUND_FILL, FALSE,
|
||||
GIMP_HELP_EDIT_FILL_FG },
|
||||
|
||||
{ "edit-fill-bg", GIMP_STOCK_TOOL_BUCKET_FILL,
|
||||
N_("Fill with B_G Color"), "<control>period", NULL,
|
||||
N_("Fill with B_G Color"), "<control>period",
|
||||
N_("Fill the selection using the background color"),
|
||||
GIMP_BACKGROUND_FILL, FALSE,
|
||||
GIMP_HELP_EDIT_FILL_BG },
|
||||
|
||||
{ "edit-fill-pattern", GIMP_STOCK_TOOL_BUCKET_FILL,
|
||||
N_("Fill with P_attern"), "<control>semicolon", NULL,
|
||||
N_("Fill with P_attern"), "<control>semicolon",
|
||||
N_("Fill the selection using the active pattern"),
|
||||
GIMP_PATTERN_FILL, FALSE,
|
||||
GIMP_HELP_EDIT_FILL_PATTERN }
|
||||
};
|
||||
@ -209,25 +220,25 @@ void
|
||||
edit_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpDrawable *drawable = NULL;
|
||||
gchar *undo_name = NULL;
|
||||
gchar *redo_name = NULL;
|
||||
gboolean undo_enabled = FALSE;
|
||||
|
||||
if (gimage)
|
||||
if (image)
|
||||
{
|
||||
GimpUndo *undo;
|
||||
GimpUndo *redo;
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
drawable = gimp_image_active_drawable (image);
|
||||
|
||||
undo_enabled = gimp_image_undo_is_enabled (gimage);
|
||||
undo_enabled = gimp_image_undo_is_enabled (image);
|
||||
|
||||
if (undo_enabled)
|
||||
{
|
||||
undo = gimp_undo_stack_peek (gimage->undo_stack);
|
||||
redo = gimp_undo_stack_peek (gimage->redo_stack);
|
||||
undo = gimp_undo_stack_peek (image->undo_stack);
|
||||
redo = gimp_undo_stack_peek (image->redo_stack);
|
||||
|
||||
if (undo)
|
||||
undo_name =
|
||||
@ -259,14 +270,14 @@ edit_actions_update (GimpActionGroup *group,
|
||||
|
||||
SET_SENSITIVE ("edit-cut", drawable);
|
||||
SET_SENSITIVE ("edit-copy", drawable);
|
||||
SET_SENSITIVE ("edit-copy-visible", gimage);
|
||||
SET_SENSITIVE ("edit-copy-visible", image);
|
||||
/* "edit-paste" is always enabled */
|
||||
SET_SENSITIVE ("edit-paste-into", gimage);
|
||||
SET_SENSITIVE ("edit-paste-into", image);
|
||||
|
||||
SET_SENSITIVE ("edit-named-cut", drawable);
|
||||
SET_SENSITIVE ("edit-named-copy", drawable);
|
||||
SET_SENSITIVE ("edit-named-copy-visible", drawable);
|
||||
SET_SENSITIVE ("edit-named-paste", gimage);
|
||||
SET_SENSITIVE ("edit-named-paste", image);
|
||||
|
||||
SET_SENSITIVE ("edit-clear", drawable);
|
||||
SET_SENSITIVE ("edit-fill-fg", drawable);
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void edit_paste (GimpDisplay *gdisp,
|
||||
static void edit_paste (GimpDisplay *display,
|
||||
gboolean paste_into);
|
||||
static void cut_named_buffer_callback (GtkWidget *widget,
|
||||
const gchar *name,
|
||||
@ -76,35 +76,35 @@ void
|
||||
edit_undo_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpImage *image;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
if (gimp_image_undo (gimage))
|
||||
gimp_image_flush (gimage);
|
||||
if (gimp_image_undo (image))
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
edit_redo_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpImage *image;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
if (gimp_image_redo (gimage))
|
||||
gimp_image_flush (gimage);
|
||||
if (gimp_image_redo (image))
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
edit_undo_clear_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *dialog;
|
||||
gchar *size;
|
||||
gint64 memsize;
|
||||
gint64 guisize;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = gimp_message_dialog_new (_("Clear Undo History"), GIMP_STOCK_WARNING,
|
||||
@ -128,17 +128,17 @@ edit_undo_clear_cmd_callback (GtkAction *action,
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
dialog, G_CONNECT_SWAPPED);
|
||||
|
||||
g_signal_connect_object (gimage, "disconnect",
|
||||
g_signal_connect_object (image, "disconnect",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
dialog, G_CONNECT_SWAPPED);
|
||||
|
||||
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
|
||||
_("Really clear image's undo history?"));
|
||||
|
||||
memsize = gimp_object_get_memsize (GIMP_OBJECT (gimage->undo_stack),
|
||||
memsize = gimp_object_get_memsize (GIMP_OBJECT (image->undo_stack),
|
||||
&guisize);
|
||||
memsize += guisize;
|
||||
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->redo_stack),
|
||||
memsize += gimp_object_get_memsize (GIMP_OBJECT (image->redo_stack),
|
||||
&guisize);
|
||||
memsize += guisize;
|
||||
|
||||
@ -151,9 +151,9 @@ edit_undo_clear_cmd_callback (GtkAction *action,
|
||||
|
||||
if (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK)
|
||||
{
|
||||
gimp_image_undo_disable (gimage);
|
||||
gimp_image_undo_enable (gimage);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_undo_disable (image);
|
||||
gimp_image_undo_enable (image);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
@ -163,45 +163,45 @@ void
|
||||
edit_cut_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
|
||||
if (gimp_edit_cut (gimage, drawable, action_data_get_context (data)))
|
||||
gimp_image_flush (gimage);
|
||||
if (gimp_edit_cut (image, drawable, action_data_get_context (data)))
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
edit_copy_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
|
||||
if (gimp_edit_copy (gimage, drawable, action_data_get_context (data)))
|
||||
gimp_image_flush (gimage);
|
||||
if (gimp_edit_copy (image, drawable, action_data_get_context (data)))
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
edit_copy_visible_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpImage *image;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
if (gimp_edit_copy_visible (gimage, action_data_get_context (data)))
|
||||
gimp_image_flush (gimage);
|
||||
if (gimp_edit_copy_visible (image, action_data_get_context (data)))
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
edit_paste_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp = action_data_get_display (data);
|
||||
GimpDisplay *display = action_data_get_display (data);
|
||||
|
||||
if (gdisp)
|
||||
edit_paste (gdisp, FALSE);
|
||||
if (display)
|
||||
edit_paste (display, FALSE);
|
||||
else
|
||||
edit_paste_as_new_cmd_callback (action, data);
|
||||
}
|
||||
@ -210,10 +210,10 @@ void
|
||||
edit_paste_into_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
return_if_no_display (gdisp, data);
|
||||
GimpDisplay *display;
|
||||
return_if_no_display (display, data);
|
||||
|
||||
edit_paste (gdisp, TRUE);
|
||||
edit_paste (display, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
@ -247,10 +247,10 @@ void
|
||||
edit_named_cut_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = gimp_query_string_box (_("Cut Named"), widget,
|
||||
@ -258,8 +258,8 @@ edit_named_cut_cmd_callback (GtkAction *action,
|
||||
GIMP_HELP_BUFFER_CUT,
|
||||
_("Enter a name for this buffer"),
|
||||
NULL,
|
||||
G_OBJECT (gimage), "disconnect",
|
||||
cut_named_buffer_callback, gimage);
|
||||
G_OBJECT (image), "disconnect",
|
||||
cut_named_buffer_callback, image);
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
@ -267,10 +267,10 @@ void
|
||||
edit_named_copy_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = gimp_query_string_box (_("Copy Named"), widget,
|
||||
@ -278,8 +278,8 @@ edit_named_copy_cmd_callback (GtkAction *action,
|
||||
GIMP_HELP_BUFFER_COPY,
|
||||
_("Enter a name for this buffer"),
|
||||
NULL,
|
||||
G_OBJECT (gimage), "disconnect",
|
||||
copy_named_buffer_callback, gimage);
|
||||
G_OBJECT (image), "disconnect",
|
||||
copy_named_buffer_callback, image);
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
@ -287,10 +287,10 @@ void
|
||||
edit_named_copy_visible_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = gimp_query_string_box (_("Copy Visible Named "), widget,
|
||||
@ -298,8 +298,8 @@ edit_named_copy_visible_cmd_callback (GtkAction *action,
|
||||
GIMP_HELP_BUFFER_COPY,
|
||||
_("Enter a name for this buffer"),
|
||||
NULL,
|
||||
G_OBJECT (gimage), "disconnect",
|
||||
copy_named_visible_buffer_callback, gimage);
|
||||
G_OBJECT (image), "disconnect",
|
||||
copy_named_visible_buffer_callback, image);
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
@ -319,12 +319,12 @@ void
|
||||
edit_clear_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
|
||||
gimp_edit_clear (gimage, drawable, action_data_get_context (data));
|
||||
gimp_image_flush (gimage);
|
||||
gimp_edit_clear (image, drawable, action_data_get_context (data));
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -332,36 +332,36 @@ edit_fill_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
GimpFillType fill_type;
|
||||
return_if_no_drawable (gimage, drawable, data);
|
||||
return_if_no_drawable (image, drawable, data);
|
||||
|
||||
fill_type = (GimpFillType) value;
|
||||
|
||||
gimp_edit_fill (gimage, drawable, action_data_get_context (data),
|
||||
gimp_edit_fill (image, drawable, action_data_get_context (data),
|
||||
fill_type);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
edit_paste (GimpDisplay *gdisp,
|
||||
edit_paste (GimpDisplay *display,
|
||||
gboolean paste_into)
|
||||
{
|
||||
gchar *svg;
|
||||
gsize svg_size;
|
||||
|
||||
svg = gimp_clipboard_get_svg (gdisp->gimage->gimp, &svg_size);
|
||||
svg = gimp_clipboard_get_svg (display->image->gimp, &svg_size);
|
||||
|
||||
if (svg)
|
||||
{
|
||||
if (gimp_vectors_import_buffer (gdisp->gimage, svg, svg_size,
|
||||
if (gimp_vectors_import_buffer (display->image, svg, svg_size,
|
||||
TRUE, TRUE, -1, NULL))
|
||||
{
|
||||
gimp_image_flush (gdisp->gimage);
|
||||
gimp_image_flush (display->image);
|
||||
}
|
||||
|
||||
g_free (svg);
|
||||
@ -370,22 +370,22 @@ edit_paste (GimpDisplay *gdisp,
|
||||
{
|
||||
GimpBuffer *buffer;
|
||||
|
||||
buffer = gimp_clipboard_get_buffer (gdisp->gimage->gimp);
|
||||
buffer = gimp_clipboard_get_buffer (display->image->gimp);
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
|
||||
gimp_display_shell_untransform_viewport (shell,
|
||||
&x, &y, &width, &height);
|
||||
|
||||
if (gimp_edit_paste (gdisp->gimage,
|
||||
gimp_image_active_drawable (gdisp->gimage),
|
||||
if (gimp_edit_paste (display->image,
|
||||
gimp_image_active_drawable (display->image),
|
||||
buffer, paste_into, x, y, width, height))
|
||||
{
|
||||
gimp_image_flush (gdisp->gimage);
|
||||
gimp_image_flush (display->image);
|
||||
}
|
||||
|
||||
g_object_unref (buffer);
|
||||
@ -398,10 +398,10 @@ cut_named_buffer_callback (GtkWidget *widget,
|
||||
const gchar *name,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = GIMP_IMAGE (data);
|
||||
GimpImage *image = GIMP_IMAGE (data);
|
||||
GimpDrawable *drawable;
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
drawable = gimp_image_active_drawable (image);
|
||||
|
||||
if (! drawable)
|
||||
{
|
||||
@ -412,22 +412,22 @@ cut_named_buffer_callback (GtkWidget *widget,
|
||||
if (! (name && strlen (name)))
|
||||
name = _("(Unnamed Buffer)");
|
||||
|
||||
if (gimp_edit_named_cut (gimage, name, drawable,
|
||||
gimp_get_user_context (gimage->gimp)))
|
||||
if (gimp_edit_named_cut (image, name, drawable,
|
||||
gimp_get_user_context (image->gimp)))
|
||||
{
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
copy_named_buffer_callback (GtkWidget *widget,
|
||||
const gchar *name,
|
||||
gpointer data)
|
||||
const gchar *name,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = GIMP_IMAGE (data);
|
||||
GimpImage *image = GIMP_IMAGE (data);
|
||||
GimpDrawable *drawable;
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
drawable = gimp_image_active_drawable (image);
|
||||
|
||||
if (! drawable)
|
||||
{
|
||||
@ -438,10 +438,10 @@ copy_named_buffer_callback (GtkWidget *widget,
|
||||
if (! (name && strlen (name)))
|
||||
name = _("(Unnamed Buffer)");
|
||||
|
||||
if (gimp_edit_named_copy (gimage, name, drawable,
|
||||
gimp_get_user_context (gimage->gimp)))
|
||||
if (gimp_edit_named_copy (image, name, drawable,
|
||||
gimp_get_user_context (image->gimp)))
|
||||
{
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -450,14 +450,14 @@ copy_named_visible_buffer_callback (GtkWidget *widget,
|
||||
const gchar *name,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = GIMP_IMAGE (data);
|
||||
GimpImage *image = GIMP_IMAGE (data);
|
||||
|
||||
if (! (name && strlen (name)))
|
||||
name = _("(Unnamed Buffer)");
|
||||
|
||||
if (gimp_edit_named_copy_visible (gimage, name,
|
||||
gimp_get_user_context (gimage->gimp)))
|
||||
if (gimp_edit_named_copy_visible (image, name,
|
||||
gimp_get_user_context (image->gimp)))
|
||||
{
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry error_console_actions[] =
|
||||
static const GimpActionEntry error_console_actions[] =
|
||||
{
|
||||
{ "error-console-popup", GIMP_STOCK_WARNING,
|
||||
N_("Error Console Menu"), NULL, NULL, NULL,
|
||||
@ -47,7 +47,7 @@ static GimpActionEntry error_console_actions[] =
|
||||
GIMP_HELP_ERRORS_CLEAR }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry error_console_save_actions[] =
|
||||
static const GimpEnumActionEntry error_console_save_actions[] =
|
||||
{
|
||||
{ "error-console-save-all", GTK_STOCK_SAVE_AS,
|
||||
N_("Save _All Errors to File..."), "",
|
||||
|
||||
@ -104,14 +104,14 @@ error_console_save_cmd_callback (GtkAction *action,
|
||||
gtk_window_set_role (GTK_WINDOW (chooser), "gimp-save-errors");
|
||||
|
||||
g_signal_connect (chooser, "response",
|
||||
G_CALLBACK (error_console_save_response),
|
||||
console);
|
||||
G_CALLBACK (error_console_save_response),
|
||||
console);
|
||||
g_signal_connect (chooser, "delete-event",
|
||||
G_CALLBACK (gtk_true),
|
||||
NULL);
|
||||
G_CALLBACK (gtk_true),
|
||||
NULL);
|
||||
|
||||
gimp_help_connect (GTK_WIDGET (chooser), gimp_standard_help_func,
|
||||
GIMP_HELP_ERRORS_DIALOG, NULL);
|
||||
GIMP_HELP_ERRORS_DIALOG, NULL);
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (chooser));
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ static void file_actions_close_all_update (GimpContainer *container,
|
||||
GimpActionGroup *group);
|
||||
|
||||
|
||||
static GimpActionEntry file_actions[] =
|
||||
static const GimpActionEntry file_actions[] =
|
||||
{
|
||||
{ "file-menu", NULL, N_("_File") },
|
||||
{ "file-open-recent-menu", NULL, N_("Open _Recent") },
|
||||
@ -101,22 +101,26 @@ static GimpActionEntry file_actions[] =
|
||||
GIMP_HELP_FILE_SAVE_A_COPY },
|
||||
|
||||
{ "file-save-as-template", NULL,
|
||||
N_("Save as _Template..."), NULL, NULL,
|
||||
N_("Save as _Template..."), NULL,
|
||||
N_("Create a new template from this image"),
|
||||
G_CALLBACK (file_save_template_cmd_callback),
|
||||
GIMP_HELP_FILE_SAVE_AS_TEMPLATE },
|
||||
|
||||
{ "file-revert", GTK_STOCK_REVERT_TO_SAVED,
|
||||
N_("Re_vert"), NULL, NULL,
|
||||
N_("Re_vert"), NULL,
|
||||
N_("Reload the image file from disk"),
|
||||
G_CALLBACK (file_revert_cmd_callback),
|
||||
GIMP_HELP_FILE_REVERT },
|
||||
|
||||
{ "file-close-all", GTK_STOCK_CLOSE,
|
||||
N_("Close all"), "<shift><control>W", NULL,
|
||||
N_("Close all"), "<shift><control>W",
|
||||
N_("Close all opened images"),
|
||||
G_CALLBACK (file_close_all_cmd_callback),
|
||||
GIMP_HELP_FILE_CLOSE_ALL },
|
||||
|
||||
{ "file-quit", GTK_STOCK_QUIT,
|
||||
N_("_Quit"), "<control>Q", NULL,
|
||||
N_("_Quit"), "<control>Q",
|
||||
N_("Quit the GNU Image Manipulation Program"),
|
||||
G_CALLBACK (file_quit_cmd_callback),
|
||||
GIMP_HELP_FILE_QUIT }
|
||||
};
|
||||
@ -147,7 +151,7 @@ file_actions_setup (GimpActionGroup *group)
|
||||
entries[i].name = g_strdup_printf ("file-open-recent-%02d",
|
||||
i + 1);
|
||||
entries[i].stock_id = GTK_STOCK_OPEN;
|
||||
entries[i].label = NULL;
|
||||
entries[i].label = "";
|
||||
entries[i].tooltip = NULL;
|
||||
entries[i].value = i;
|
||||
entries[i].value_variable = FALSE;
|
||||
@ -202,21 +206,21 @@ void
|
||||
file_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpDrawable *drawable = NULL;
|
||||
|
||||
if (gimage)
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
if (image)
|
||||
drawable = gimp_image_active_drawable (image);
|
||||
|
||||
#define SET_SENSITIVE(action,condition) \
|
||||
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
||||
|
||||
SET_SENSITIVE ("file-open-as-layer", gimage);
|
||||
SET_SENSITIVE ("file-save", gimage && drawable);
|
||||
SET_SENSITIVE ("file-save-as", gimage && drawable);
|
||||
SET_SENSITIVE ("file-save-a-copy", gimage && drawable);
|
||||
SET_SENSITIVE ("file-save-as-template", gimage);
|
||||
SET_SENSITIVE ("file-revert", gimage && GIMP_OBJECT (gimage)->name);
|
||||
SET_SENSITIVE ("file-open-as-layer", image);
|
||||
SET_SENSITIVE ("file-save", image && drawable);
|
||||
SET_SENSITIVE ("file-save-as", image && drawable);
|
||||
SET_SENSITIVE ("file-save-a-copy", image && drawable);
|
||||
SET_SENSITIVE ("file-save-as-template", image);
|
||||
SET_SENSITIVE ("file-revert", image && GIMP_OBJECT (image)->name);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
}
|
||||
|
||||
@ -62,21 +62,21 @@
|
||||
/* local function prototypes */
|
||||
|
||||
static void file_open_dialog_show (GtkWidget *parent,
|
||||
GimpImage *gimage,
|
||||
GimpImage *image,
|
||||
const gchar *uri,
|
||||
gboolean open_as_layer);
|
||||
static void file_save_dialog_show (GimpImage *gimage,
|
||||
static void file_save_dialog_show (GimpImage *image,
|
||||
GtkWidget *parent,
|
||||
const gchar *title,
|
||||
gboolean save_a_copy);
|
||||
static void file_save_dialog_destroyed (GtkWidget *dialog,
|
||||
GimpImage *gimage);
|
||||
GimpImage *image);
|
||||
static void file_new_template_callback (GtkWidget *widget,
|
||||
const gchar *name,
|
||||
gpointer data);
|
||||
static void file_revert_confirm_response (GtkWidget *dialog,
|
||||
gint response_id,
|
||||
GimpDisplay *gdisp);
|
||||
GimpDisplay *display);
|
||||
|
||||
|
||||
/* public functions */
|
||||
@ -112,14 +112,14 @@ void
|
||||
file_open_as_layer_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *widget;
|
||||
GimpImage *image;
|
||||
const gchar *uri;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
image = gdisp->gimage;
|
||||
image = display->image;
|
||||
uri = gimp_object_get_name (GIMP_OBJECT (image));
|
||||
|
||||
file_open_dialog_show (widget, image, uri, TRUE);
|
||||
@ -157,16 +157,16 @@ file_last_opened_cmd_callback (GtkAction *action,
|
||||
|
||||
if (imagefile)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpPDBStatusType status;
|
||||
GError *error = NULL;
|
||||
|
||||
gimage = file_open_with_display (gimp, action_data_get_context (data),
|
||||
image = file_open_with_display (gimp, action_data_get_context (data),
|
||||
NULL,
|
||||
GIMP_OBJECT (imagefile)->name,
|
||||
&status, &error);
|
||||
|
||||
if (! gimage && status != GIMP_PDB_CANCEL)
|
||||
if (! image && status != GIMP_PDB_CANCEL)
|
||||
{
|
||||
gchar *filename =
|
||||
file_utils_uri_display_name (GIMP_OBJECT (imagefile)->name);
|
||||
@ -184,27 +184,27 @@ void
|
||||
file_save_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpImage *gimage;
|
||||
return_if_no_display (gdisp, data);
|
||||
GimpDisplay *display;
|
||||
GimpImage *image;
|
||||
return_if_no_display (display, data);
|
||||
|
||||
gimage = gdisp->gimage;
|
||||
image = display->image;
|
||||
|
||||
if (! gimp_image_active_drawable (gimage))
|
||||
if (! gimp_image_active_drawable (image))
|
||||
return;
|
||||
|
||||
/* Only save if the gimage has been modified */
|
||||
if (gimage->dirty ||
|
||||
! GIMP_GUI_CONFIG (gimage->gimp->config)->trust_dirty_flag)
|
||||
/* Only save if the image has been modified */
|
||||
if (image->dirty ||
|
||||
! GIMP_GUI_CONFIG (image->gimp->config)->trust_dirty_flag)
|
||||
{
|
||||
const gchar *uri;
|
||||
PlugInProcDef *save_proc = NULL;
|
||||
const gchar *uri;
|
||||
GimpPlugInProcedure *save_proc = NULL;
|
||||
|
||||
uri = gimp_object_get_name (GIMP_OBJECT (gimage));
|
||||
save_proc = gimp_image_get_save_proc (gimage);
|
||||
uri = gimp_object_get_name (GIMP_OBJECT (image));
|
||||
save_proc = gimp_image_get_save_proc (image);
|
||||
|
||||
if (uri && ! save_proc)
|
||||
save_proc = file_utils_find_proc (gimage->gimp->save_procs, uri);
|
||||
save_proc = file_utils_find_proc (image->gimp->save_procs, uri);
|
||||
|
||||
if (! (uri && save_proc))
|
||||
{
|
||||
@ -224,8 +224,8 @@ file_save_cmd_callback (GtkAction *action,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
status = file_save (gimage, action_data_get_context (data),
|
||||
GIMP_PROGRESS (gdisp),
|
||||
status = file_save (image, action_data_get_context (data),
|
||||
GIMP_PROGRESS (display),
|
||||
uri, save_proc,
|
||||
GIMP_RUN_WITH_LAST_VALS, FALSE, &error);
|
||||
|
||||
@ -256,15 +256,15 @@ void
|
||||
file_save_as_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *widget;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
if (! gimp_image_active_drawable (gdisp->gimage))
|
||||
if (! gimp_image_active_drawable (display->image))
|
||||
return;
|
||||
|
||||
file_save_dialog_show (gdisp->gimage, widget,
|
||||
file_save_dialog_show (display->image, widget,
|
||||
_("Save Image"), FALSE);
|
||||
}
|
||||
|
||||
@ -272,15 +272,15 @@ void
|
||||
file_save_a_copy_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *widget;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
if (! gimp_image_active_drawable (gdisp->gimage))
|
||||
if (! gimp_image_active_drawable (display->image))
|
||||
return;
|
||||
|
||||
file_save_dialog_show (gdisp->gimage, widget,
|
||||
file_save_dialog_show (display->image, widget,
|
||||
_("Save a Copy of the Image"), TRUE);
|
||||
}
|
||||
|
||||
@ -288,18 +288,18 @@ void
|
||||
file_save_template_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
dialog = gimp_query_string_box (_("Create New Template"),
|
||||
gdisp->shell,
|
||||
display->shell,
|
||||
gimp_standard_help_func,
|
||||
GIMP_HELP_FILE_SAVE_AS_TEMPLATE,
|
||||
_("Enter a name for this template"),
|
||||
NULL,
|
||||
G_OBJECT (gdisp->gimage), "disconnect",
|
||||
file_new_template_callback, gdisp->gimage);
|
||||
G_OBJECT (display->image), "disconnect",
|
||||
file_new_template_callback, display->image);
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
@ -307,14 +307,14 @@ void
|
||||
file_revert_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *dialog;
|
||||
const gchar *uri;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage));
|
||||
uri = gimp_object_get_name (GIMP_OBJECT (display->image));
|
||||
|
||||
dialog = g_object_get_data (G_OBJECT (gdisp->gimage), REVERT_DATA_KEY);
|
||||
dialog = g_object_get_data (G_OBJECT (display->image), REVERT_DATA_KEY);
|
||||
|
||||
if (! uri)
|
||||
{
|
||||
@ -331,7 +331,7 @@ file_revert_cmd_callback (GtkAction *action,
|
||||
|
||||
dialog =
|
||||
gimp_message_dialog_new (_("Revert Image"), GIMP_STOCK_QUESTION,
|
||||
gdisp->shell, 0,
|
||||
display->shell, 0,
|
||||
gimp_standard_help_func, GIMP_HELP_FILE_REVERT,
|
||||
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
@ -344,13 +344,13 @@ file_revert_cmd_callback (GtkAction *action,
|
||||
GTK_RESPONSE_CANCEL,
|
||||
-1);
|
||||
|
||||
g_signal_connect_object (gdisp, "disconnect",
|
||||
g_signal_connect_object (display, "disconnect",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
dialog, G_CONNECT_SWAPPED);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (file_revert_confirm_response),
|
||||
gdisp);
|
||||
display);
|
||||
|
||||
basename = file_utils_uri_display_basename (uri);
|
||||
filename = file_utils_uri_display_name (uri);
|
||||
@ -366,7 +366,7 @@ file_revert_cmd_callback (GtkAction *action,
|
||||
"on disk, you will lose all changes, "
|
||||
"including all undo information."));
|
||||
|
||||
g_object_set_data (G_OBJECT (gdisp->gimage), REVERT_DATA_KEY, dialog);
|
||||
g_object_set_data (G_OBJECT (display->image), REVERT_DATA_KEY, dialog);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
@ -417,7 +417,7 @@ file_file_open_dialog (Gimp *gimp,
|
||||
|
||||
static void
|
||||
file_open_dialog_show (GtkWidget *parent,
|
||||
GimpImage *gimage,
|
||||
GimpImage *image,
|
||||
const gchar *uri,
|
||||
gboolean open_as_layer)
|
||||
{
|
||||
@ -435,12 +435,12 @@ file_open_dialog_show (GtkWidget *parent,
|
||||
if (open_as_layer)
|
||||
{
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), _("Open Image as Layer"));
|
||||
GIMP_FILE_DIALOG (dialog)->gimage = gimage;
|
||||
GIMP_FILE_DIALOG (dialog)->image = image;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), _("Open Image"));
|
||||
GIMP_FILE_DIALOG (dialog)->gimage = NULL;
|
||||
GIMP_FILE_DIALOG (dialog)->image = NULL;
|
||||
}
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
|
||||
@ -450,14 +450,14 @@ file_open_dialog_show (GtkWidget *parent,
|
||||
}
|
||||
|
||||
static void
|
||||
file_save_dialog_show (GimpImage *gimage,
|
||||
file_save_dialog_show (GimpImage *image,
|
||||
GtkWidget *parent,
|
||||
const gchar *title,
|
||||
gboolean save_a_copy)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = g_object_get_data (G_OBJECT (gimage), "gimp-file-save-dialog");
|
||||
dialog = g_object_get_data (G_OBJECT (image), "gimp-file-save-dialog");
|
||||
|
||||
if (! dialog)
|
||||
{
|
||||
@ -471,12 +471,12 @@ file_save_dialog_show (GimpImage *gimage,
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
||||
GTK_WINDOW (parent));
|
||||
|
||||
g_object_set_data_full (G_OBJECT (gimage),
|
||||
g_object_set_data_full (G_OBJECT (image),
|
||||
"gimp-file-save-dialog", dialog,
|
||||
(GDestroyNotify) gtk_widget_destroy);
|
||||
g_signal_connect (dialog, "destroy",
|
||||
G_CALLBACK (file_save_dialog_destroyed),
|
||||
gimage);
|
||||
image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -485,7 +485,7 @@ file_save_dialog_show (GimpImage *gimage,
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), title);
|
||||
|
||||
gimp_file_dialog_set_image (GIMP_FILE_DIALOG (dialog),
|
||||
gimage, save_a_copy);
|
||||
image, save_a_copy);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
@ -493,10 +493,10 @@ file_save_dialog_show (GimpImage *gimage,
|
||||
|
||||
static void
|
||||
file_save_dialog_destroyed (GtkWidget *dialog,
|
||||
GimpImage *gimage)
|
||||
GimpImage *image)
|
||||
{
|
||||
if (GIMP_FILE_DIALOG (dialog)->gimage == gimage)
|
||||
g_object_set_data (G_OBJECT (gimage), "gimp-file-save-dialog", NULL);
|
||||
if (GIMP_FILE_DIALOG (dialog)->image == image)
|
||||
g_object_set_data (G_OBJECT (image), "gimp-file-save-dialog", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -505,59 +505,57 @@ file_new_template_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpTemplate *template;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
|
||||
gimage = (GimpImage *) data;
|
||||
image = (GimpImage *) data;
|
||||
|
||||
if (! (name && strlen (name)))
|
||||
name = _("(Unnamed Template)");
|
||||
|
||||
template = gimp_template_new (name);
|
||||
gimp_template_set_from_image (template, gimage);
|
||||
gimp_container_add (gimage->gimp->templates, GIMP_OBJECT (template));
|
||||
gimp_template_set_from_image (template, image);
|
||||
gimp_container_add (image->gimp->templates, GIMP_OBJECT (template));
|
||||
g_object_unref (template);
|
||||
}
|
||||
|
||||
static void
|
||||
file_revert_confirm_response (GtkWidget *dialog,
|
||||
gint response_id,
|
||||
GimpDisplay *gdisp)
|
||||
GimpDisplay *display)
|
||||
{
|
||||
GimpImage *old_gimage = gdisp->gimage;
|
||||
GimpImage *old_image = display->image;
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
|
||||
g_object_set_data (G_OBJECT (old_gimage), REVERT_DATA_KEY, NULL);
|
||||
g_object_set_data (G_OBJECT (old_image), REVERT_DATA_KEY, NULL);
|
||||
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
{
|
||||
Gimp *gimp = old_gimage->gimp;
|
||||
GimpImage *new_gimage;
|
||||
Gimp *gimp = old_image->gimp;
|
||||
GimpImage *new_image;
|
||||
const gchar *uri;
|
||||
GimpPDBStatusType status;
|
||||
GError *error = NULL;
|
||||
|
||||
uri = gimp_object_get_name (GIMP_OBJECT (old_gimage));
|
||||
uri = gimp_object_get_name (GIMP_OBJECT (old_image));
|
||||
|
||||
new_gimage = file_open_image (gimp, gimp_get_user_context (gimp),
|
||||
GIMP_PROGRESS (gdisp),
|
||||
new_image = file_open_image (gimp, gimp_get_user_context (gimp),
|
||||
GIMP_PROGRESS (display),
|
||||
uri, uri, NULL,
|
||||
GIMP_RUN_INTERACTIVE,
|
||||
&status, NULL, &error);
|
||||
|
||||
if (new_gimage)
|
||||
if (new_image)
|
||||
{
|
||||
gimp_displays_reconnect (gimp, old_gimage, new_gimage);
|
||||
gimp_image_flush (new_gimage);
|
||||
gimp_displays_reconnect (gimp, old_image, new_image);
|
||||
gimp_image_flush (new_image);
|
||||
|
||||
/* the displays own the image now */
|
||||
g_object_unref (new_gimage);
|
||||
g_object_unref (new_image);
|
||||
}
|
||||
else if (status != GIMP_PDB_CANCEL)
|
||||
{
|
||||
gchar *filename;
|
||||
|
||||
filename = file_utils_uri_display_name (uri);
|
||||
gchar *filename = file_utils_uri_display_name (uri);
|
||||
|
||||
g_message (_("Reverting to '%s' failed:\n\n%s"),
|
||||
filename, error->message);
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry fonts_actions[] =
|
||||
static const GimpActionEntry fonts_actions[] =
|
||||
{
|
||||
{ "fonts-popup", GIMP_STOCK_FONT,
|
||||
N_("Fonts Menu"), NULL, NULL, NULL,
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry gradient_editor_actions[] =
|
||||
static const GimpActionEntry gradient_editor_actions[] =
|
||||
{
|
||||
{ "gradient-editor-popup", GIMP_STOCK_GRADIENT,
|
||||
N_("Gradient Editor Menu"), NULL, NULL, NULL,
|
||||
@ -115,7 +115,7 @@ static GimpActionEntry gradient_editor_actions[] =
|
||||
GIMP_HELP_GRADIENT_EDITOR_BLEND_OPACITY }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry gradient_editor_toggle_actions[] =
|
||||
static const GimpToggleActionEntry gradient_editor_toggle_actions[] =
|
||||
{
|
||||
{ "gradient-editor-edit-active", GIMP_STOCK_LINKED,
|
||||
N_("Edit Active Gradient"), NULL, NULL,
|
||||
@ -146,7 +146,7 @@ static GimpToggleActionEntry gradient_editor_toggle_actions[] =
|
||||
(magic), FALSE, \
|
||||
GIMP_HELP_GRADIENT_EDITOR_RIGHT_SAVE }
|
||||
|
||||
static GimpEnumActionEntry gradient_editor_load_left_actions[] =
|
||||
static const GimpEnumActionEntry gradient_editor_load_left_actions[] =
|
||||
{
|
||||
{ "gradient-editor-load-left-left-neighbor", NULL,
|
||||
N_("_Left Neighbor's Right Endpoint"), NULL, NULL,
|
||||
@ -159,12 +159,12 @@ static GimpEnumActionEntry gradient_editor_load_left_actions[] =
|
||||
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
|
||||
|
||||
{ "gradient-editor-load-left-fg", NULL,
|
||||
N_("_FG Color"), NULL, NULL,
|
||||
N_("_Foreground Color"), NULL, NULL,
|
||||
GRADIENT_EDITOR_COLOR_FOREGROUND, FALSE,
|
||||
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
|
||||
|
||||
{ "gradient-editor-load-left-bg", NULL,
|
||||
N_("_BG Color"), NULL, NULL,
|
||||
N_("_Background Color"), NULL, NULL,
|
||||
GRADIENT_EDITOR_COLOR_BACKGROUND, FALSE,
|
||||
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
|
||||
|
||||
@ -180,7 +180,7 @@ static GimpEnumActionEntry gradient_editor_load_left_actions[] =
|
||||
LOAD_LEFT_FROM ("10", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 9)
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry gradient_editor_save_left_actions[] =
|
||||
static const GimpEnumActionEntry gradient_editor_save_left_actions[] =
|
||||
{
|
||||
SAVE_LEFT_TO ("01", 0),
|
||||
SAVE_LEFT_TO ("02", 1),
|
||||
@ -194,7 +194,7 @@ static GimpEnumActionEntry gradient_editor_save_left_actions[] =
|
||||
SAVE_LEFT_TO ("10", 9)
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry gradient_editor_load_right_actions[] =
|
||||
static const GimpEnumActionEntry gradient_editor_load_right_actions[] =
|
||||
{
|
||||
{ "gradient-editor-load-right-right-neighbor", NULL,
|
||||
N_("_Right Neighbor's Left Endpoint"), NULL, NULL,
|
||||
@ -207,12 +207,12 @@ static GimpEnumActionEntry gradient_editor_load_right_actions[] =
|
||||
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
|
||||
|
||||
{ "gradient-editor-load-right-fg", NULL,
|
||||
N_("_FG Color"), NULL, NULL,
|
||||
N_("_Foreground Color"), NULL, NULL,
|
||||
GRADIENT_EDITOR_COLOR_FOREGROUND, FALSE,
|
||||
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
|
||||
|
||||
{ "gradient-editor-load-right-bg", NULL,
|
||||
N_("_BG Color"), NULL, NULL,
|
||||
N_("_Background Color"), NULL, NULL,
|
||||
GRADIENT_EDITOR_COLOR_BACKGROUND, FALSE,
|
||||
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
|
||||
|
||||
@ -228,7 +228,7 @@ static GimpEnumActionEntry gradient_editor_load_right_actions[] =
|
||||
LOAD_RIGHT_FROM ("10", GRADIENT_EDITOR_COLOR_FIRST_CUSTOM + 9)
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry gradient_editor_save_right_actions[] =
|
||||
static const GimpEnumActionEntry gradient_editor_save_right_actions[] =
|
||||
{
|
||||
SAVE_RIGHT_TO ("01", 0),
|
||||
SAVE_RIGHT_TO ("02", 1),
|
||||
@ -248,7 +248,7 @@ static GimpEnumActionEntry gradient_editor_save_right_actions[] =
|
||||
#undef SAVE_RIGHT_TO
|
||||
|
||||
|
||||
static GimpRadioActionEntry gradient_editor_blending_actions[] =
|
||||
static const GimpRadioActionEntry gradient_editor_blending_actions[] =
|
||||
{
|
||||
{ "gradient-editor-blending-linear", NULL,
|
||||
N_("_Linear"), NULL, NULL,
|
||||
@ -281,7 +281,7 @@ static GimpRadioActionEntry gradient_editor_blending_actions[] =
|
||||
GIMP_HELP_GRADIENT_EDITOR_BLENDING }
|
||||
};
|
||||
|
||||
static GimpRadioActionEntry gradient_editor_coloring_actions[] =
|
||||
static const GimpRadioActionEntry gradient_editor_coloring_actions[] =
|
||||
{
|
||||
{ "gradient-editor-coloring-rgb", NULL,
|
||||
N_("_RGB"), NULL, NULL,
|
||||
@ -304,7 +304,7 @@ static GimpRadioActionEntry gradient_editor_coloring_actions[] =
|
||||
GIMP_HELP_GRADIENT_EDITOR_COLORING }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry gradient_editor_zoom_actions[] =
|
||||
static const GimpEnumActionEntry gradient_editor_zoom_actions[] =
|
||||
{
|
||||
{ "gradient-editor-zoom-in", GTK_STOCK_ZOOM_IN,
|
||||
N_("Zoom In"), NULL,
|
||||
|
||||
@ -126,9 +126,9 @@ gradient_editor_load_left_cmd_callback (GtkAction *action,
|
||||
{
|
||||
case GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT:
|
||||
if (editor->control_sel_l->prev != NULL)
|
||||
seg = editor->control_sel_l->prev;
|
||||
seg = editor->control_sel_l->prev;
|
||||
else
|
||||
seg = gimp_gradient_segment_get_last (editor->control_sel_l);
|
||||
seg = gimp_gradient_segment_get_last (editor->control_sel_l);
|
||||
|
||||
color = seg->right_color;
|
||||
break;
|
||||
@ -230,9 +230,9 @@ gradient_editor_load_right_cmd_callback (GtkAction *action,
|
||||
{
|
||||
case GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT:
|
||||
if (editor->control_sel_r->next != NULL)
|
||||
seg = editor->control_sel_r->next;
|
||||
seg = editor->control_sel_r->next;
|
||||
else
|
||||
seg = gimp_gradient_segment_get_first (editor->control_sel_r);
|
||||
seg = gimp_gradient_segment_get_first (editor->control_sel_r);
|
||||
|
||||
color = seg->left_color;
|
||||
break;
|
||||
@ -413,8 +413,8 @@ gradient_editor_replicate_cmd_callback (GtkAction *action,
|
||||
gtk_widget_show (scale);
|
||||
|
||||
g_signal_connect (scale_data, "value-changed",
|
||||
G_CALLBACK (gimp_int_adjustment_update),
|
||||
&editor->replicate_times);
|
||||
G_CALLBACK (gimp_int_adjustment_update),
|
||||
&editor->replicate_times);
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
|
||||
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
|
||||
@ -513,8 +513,8 @@ gradient_editor_split_uniformly_cmd_callback (GtkAction *action,
|
||||
gtk_widget_show (scale);
|
||||
|
||||
g_signal_connect (scale_data, "value-changed",
|
||||
G_CALLBACK (gimp_int_adjustment_update),
|
||||
&editor->split_parts);
|
||||
G_CALLBACK (gimp_int_adjustment_update),
|
||||
&editor->split_parts);
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
|
||||
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
|
||||
@ -725,9 +725,9 @@ gradient_editor_save_selection (GimpGradientEditor *editor)
|
||||
*seg = *oseg; /* Copy everything */
|
||||
|
||||
if (prev == NULL)
|
||||
tmp = seg; /* Remember first segment */
|
||||
tmp = seg; /* Remember first segment */
|
||||
else
|
||||
prev->next = seg;
|
||||
prev->next = seg;
|
||||
|
||||
seg->prev = prev;
|
||||
seg->next = NULL;
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry gradients_actions[] =
|
||||
static const GimpActionEntry gradients_actions[] =
|
||||
{
|
||||
{ "gradients-popup", GIMP_STOCK_GRADIENT,
|
||||
N_("Gradients Menu"), NULL, NULL, NULL,
|
||||
@ -81,7 +81,7 @@ static GimpActionEntry gradients_actions[] =
|
||||
GIMP_HELP_GRADIENT_REFRESH }
|
||||
};
|
||||
|
||||
static GimpStringActionEntry gradients_edit_actions[] =
|
||||
static const GimpStringActionEntry gradients_edit_actions[] =
|
||||
{
|
||||
{ "gradients-edit", GTK_STOCK_EDIT,
|
||||
N_("_Edit Gradient..."), NULL,
|
||||
|
||||
@ -47,7 +47,7 @@ static void gradients_save_as_pov_ray_response (GtkWidget *dialog,
|
||||
|
||||
void
|
||||
gradients_save_as_pov_ray_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
|
||||
GimpContext *context;
|
||||
@ -63,7 +63,7 @@ gradients_save_as_pov_ray_cmd_callback (GtkAction *action,
|
||||
return;
|
||||
|
||||
title = g_strdup_printf (_("Save '%s' as POV-Ray"),
|
||||
GIMP_OBJECT (gradient)->name);
|
||||
GIMP_OBJECT (gradient)->name);
|
||||
|
||||
chooser = GTK_FILE_CHOOSER
|
||||
(gtk_file_chooser_dialog_new (title, NULL,
|
||||
@ -102,7 +102,7 @@ gradients_save_as_pov_ray_cmd_callback (GtkAction *action,
|
||||
G_CONNECT_SWAPPED);
|
||||
|
||||
gimp_help_connect (GTK_WIDGET (chooser), gimp_standard_help_func,
|
||||
GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL);
|
||||
GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL);
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (chooser));
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
|
||||
void gradients_save_as_pov_ray_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
|
||||
|
||||
#endif /* __GRADIENTS_COMMANDS_H__ */
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry help_actions[] =
|
||||
static const GimpActionEntry help_actions[] =
|
||||
{
|
||||
{ "help-menu", NULL, N_("_Help") },
|
||||
|
||||
|
||||
@ -30,14 +30,14 @@
|
||||
|
||||
void
|
||||
help_help_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
gimp_standard_help_func (NULL, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
help_context_help_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
@ -21,9 +21,9 @@
|
||||
|
||||
|
||||
void help_help_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
void help_context_help_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
|
||||
|
||||
#endif /* __HELP_COMMANDS_H__ */
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry image_actions[] =
|
||||
static const GimpActionEntry image_actions[] =
|
||||
{
|
||||
{ "toolbox-menubar", NULL,
|
||||
N_("Toolbox Menu"), NULL, NULL, NULL,
|
||||
@ -69,112 +69,131 @@ static GimpActionEntry image_actions[] =
|
||||
{ "colors-components-menu", NULL, N_("_Components") },
|
||||
|
||||
{ "image-new", GTK_STOCK_NEW,
|
||||
N_("_New..."), "<control>N", NULL,
|
||||
N_("_New..."), "<control>N",
|
||||
N_("Create a new image"),
|
||||
G_CALLBACK (image_new_cmd_callback),
|
||||
GIMP_HELP_FILE_NEW },
|
||||
|
||||
{ "image-new-from-image", GTK_STOCK_NEW,
|
||||
N_("_New..."), NULL, NULL,
|
||||
N_("_New..."), NULL,
|
||||
N_("Create a new image"),
|
||||
G_CALLBACK (image_new_from_image_cmd_callback),
|
||||
GIMP_HELP_FILE_NEW },
|
||||
|
||||
{ "image-resize", GIMP_STOCK_RESIZE,
|
||||
N_("Can_vas Size..."), NULL, NULL,
|
||||
N_("Can_vas Size..."), NULL,
|
||||
N_("Adjust the image dimensions"),
|
||||
G_CALLBACK (image_resize_cmd_callback),
|
||||
GIMP_HELP_IMAGE_RESIZE },
|
||||
|
||||
{ "image-resize-to-layers", NULL,
|
||||
N_("F_it Canvas to Layers"), NULL, NULL,
|
||||
N_("F_it Canvas to Layers"), NULL,
|
||||
N_("Resize the image to enclose all layers"),
|
||||
G_CALLBACK (image_resize_to_layers_cmd_callback),
|
||||
GIMP_HELP_IMAGE_RESIZE_TO_LAYERS },
|
||||
|
||||
{ "image-print-size", GIMP_STOCK_PRINT_RESOLUTION,
|
||||
N_("_Print Size..."), NULL, NULL,
|
||||
N_("_Print Size..."), NULL,
|
||||
N_("Adjust the print resolution"),
|
||||
G_CALLBACK (image_print_size_cmd_callback),
|
||||
GIMP_HELP_IMAGE_PRINT_SIZE },
|
||||
|
||||
{ "image-scale", GIMP_STOCK_SCALE,
|
||||
N_("_Scale Image..."), NULL, NULL,
|
||||
N_("_Scale Image..."), NULL,
|
||||
N_("Change the size of the image content"),
|
||||
G_CALLBACK (image_scale_cmd_callback),
|
||||
GIMP_HELP_IMAGE_SCALE },
|
||||
|
||||
{ "image-crop", GIMP_STOCK_TOOL_CROP,
|
||||
N_("_Crop Image"), NULL, NULL,
|
||||
N_("_Crop Image"), NULL,
|
||||
N_("Crop the image to the extents of the selection"),
|
||||
G_CALLBACK (image_crop_cmd_callback),
|
||||
GIMP_HELP_IMAGE_CROP },
|
||||
|
||||
{ "image-duplicate", GIMP_STOCK_DUPLICATE,
|
||||
N_("_Duplicate"), "<control>D", NULL,
|
||||
N_("_Duplicate"), "<control>D",
|
||||
N_("Create a duplicate of this image"),
|
||||
G_CALLBACK (image_duplicate_cmd_callback),
|
||||
GIMP_HELP_IMAGE_DUPLICATE },
|
||||
|
||||
{ "image-merge-layers", NULL,
|
||||
N_("Merge Visible _Layers..."), "<control>M", NULL,
|
||||
N_("Merge Visible _Layers..."), "<control>M",
|
||||
N_("Merge all visible layers into one layer"),
|
||||
G_CALLBACK (image_merge_layers_cmd_callback),
|
||||
GIMP_HELP_IMAGE_MERGE_LAYERS },
|
||||
|
||||
{ "image-flatten", NULL,
|
||||
N_("_Flatten Image"), NULL, NULL,
|
||||
N_("_Flatten Image"), NULL,
|
||||
N_("Merge all layers into one and remove transparency"),
|
||||
G_CALLBACK (image_flatten_image_cmd_callback),
|
||||
GIMP_HELP_IMAGE_FLATTEN },
|
||||
|
||||
{ "image-configure-grid", GIMP_STOCK_GRID,
|
||||
N_("Configure G_rid..."), NULL, NULL,
|
||||
N_("Configure G_rid..."), NULL,
|
||||
N_("Configure the grid for this image"),
|
||||
G_CALLBACK (image_configure_grid_cmd_callback),
|
||||
GIMP_HELP_IMAGE_GRID },
|
||||
|
||||
{ "image-properties", GTK_STOCK_INFO,
|
||||
N_("Image Properties"), NULL, NULL,
|
||||
N_("Image Properties"), NULL,
|
||||
N_("Display information about this image"),
|
||||
G_CALLBACK (image_properties_cmd_callback),
|
||||
GIMP_HELP_IMAGE_PROPERTIES }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry image_convert_actions[] =
|
||||
static const GimpEnumActionEntry image_convert_actions[] =
|
||||
{
|
||||
{ "image-convert-rgb", GIMP_STOCK_CONVERT_RGB,
|
||||
N_("_RGB"), NULL, NULL,
|
||||
N_("_RGB"), NULL,
|
||||
N_("Convert the image to the RGB colorspace"),
|
||||
GIMP_RGB, FALSE,
|
||||
GIMP_HELP_IMAGE_CONVERT_RGB },
|
||||
|
||||
{ "image-convert-grayscale", GIMP_STOCK_CONVERT_GRAYSCALE,
|
||||
N_("_Grayscale"), NULL, NULL,
|
||||
N_("_Grayscale"), NULL,
|
||||
N_("Convert the image to grayscale"),
|
||||
GIMP_GRAY, FALSE,
|
||||
GIMP_HELP_IMAGE_CONVERT_GRAYSCALE },
|
||||
|
||||
{ "image-convert-indexed", GIMP_STOCK_CONVERT_INDEXED,
|
||||
N_("_Indexed..."), NULL, NULL,
|
||||
N_("_Indexed..."), NULL,
|
||||
N_("Convert the image to indexed colors"),
|
||||
GIMP_INDEXED, FALSE,
|
||||
GIMP_HELP_IMAGE_CONVERT_INDEXED }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry image_flip_actions[] =
|
||||
static const GimpEnumActionEntry image_flip_actions[] =
|
||||
{
|
||||
{ "image-flip-horizontal", GIMP_STOCK_FLIP_HORIZONTAL,
|
||||
N_("Flip _Horizontally"), NULL, NULL,
|
||||
N_("Flip _Horizontally"), NULL,
|
||||
N_("Flip image horizontally"),
|
||||
GIMP_ORIENTATION_HORIZONTAL, FALSE,
|
||||
GIMP_HELP_IMAGE_FLIP_HORIZONTAL },
|
||||
|
||||
{ "image-flip-vertical", GIMP_STOCK_FLIP_VERTICAL,
|
||||
N_("Flip _Vertically"), NULL, NULL,
|
||||
N_("Flip _Vertically"), NULL,
|
||||
N_("Flip image vertically"),
|
||||
GIMP_ORIENTATION_VERTICAL, FALSE,
|
||||
GIMP_HELP_IMAGE_FLIP_VERTICAL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry image_rotate_actions[] =
|
||||
static const GimpEnumActionEntry image_rotate_actions[] =
|
||||
{
|
||||
{ "image-rotate-90", GIMP_STOCK_ROTATE_90,
|
||||
/* please use the degree symbol in the translation */
|
||||
N_("Rotate 90 degrees _CW"), NULL, NULL,
|
||||
N_("Rotate 90° _clockwise"), NULL,
|
||||
N_("Rotate the image 90 degrees to the right"),
|
||||
GIMP_ROTATE_90, FALSE,
|
||||
GIMP_HELP_IMAGE_ROTATE_90 },
|
||||
|
||||
{ "image-rotate-180", GIMP_STOCK_ROTATE_180,
|
||||
N_("Rotate _180 degrees"), NULL, NULL,
|
||||
N_("Rotate _180°"), NULL,
|
||||
N_("Turn the image upside-down"),
|
||||
GIMP_ROTATE_180, FALSE,
|
||||
GIMP_HELP_IMAGE_ROTATE_180 },
|
||||
|
||||
{ "image-rotate-270", GIMP_STOCK_ROTATE_270,
|
||||
N_("Rotate 90 degrees CC_W"), NULL, NULL,
|
||||
N_("Rotate 90° counter-clock_wise"), NULL,
|
||||
N_("Rotate the image 90 degrees to the left"),
|
||||
GIMP_ROTATE_270, FALSE,
|
||||
GIMP_HELP_IMAGE_ROTATE_270 }
|
||||
};
|
||||
@ -213,7 +232,7 @@ void
|
||||
image_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
gboolean is_rgb = FALSE;
|
||||
gboolean is_gray = FALSE;
|
||||
gboolean is_indexed = FALSE;
|
||||
@ -222,45 +241,45 @@ image_actions_update (GimpActionGroup *group,
|
||||
gboolean lp = FALSE;
|
||||
gboolean sel = FALSE;
|
||||
|
||||
if (gimage)
|
||||
if (image)
|
||||
{
|
||||
GimpImageBaseType base_type;
|
||||
|
||||
base_type = gimp_image_base_type (gimage);
|
||||
base_type = gimp_image_base_type (image);
|
||||
|
||||
is_rgb = (base_type == GIMP_RGB);
|
||||
is_gray = (base_type == GIMP_GRAY);
|
||||
is_indexed = (base_type == GIMP_INDEXED);
|
||||
|
||||
fs = (gimp_image_floating_sel (gimage) != NULL);
|
||||
aux = (gimp_image_get_active_channel (gimage) != NULL);
|
||||
lp = ! gimp_image_is_empty (gimage);
|
||||
sel = ! gimp_channel_is_empty (gimp_image_get_mask (gimage));
|
||||
fs = (gimp_image_floating_sel (image) != NULL);
|
||||
aux = (gimp_image_get_active_channel (image) != NULL);
|
||||
lp = ! gimp_image_is_empty (image);
|
||||
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
|
||||
}
|
||||
|
||||
#define SET_SENSITIVE(action,condition) \
|
||||
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
||||
|
||||
SET_SENSITIVE ("image-convert-rgb", gimage && ! is_rgb);
|
||||
SET_SENSITIVE ("image-convert-grayscale", gimage && ! is_gray);
|
||||
SET_SENSITIVE ("image-convert-indexed", gimage && ! is_indexed);
|
||||
SET_SENSITIVE ("image-convert-rgb", image && ! is_rgb);
|
||||
SET_SENSITIVE ("image-convert-grayscale", image && ! is_gray);
|
||||
SET_SENSITIVE ("image-convert-indexed", image && ! is_indexed);
|
||||
|
||||
SET_SENSITIVE ("image-flip-horizontal", gimage);
|
||||
SET_SENSITIVE ("image-flip-vertical", gimage);
|
||||
SET_SENSITIVE ("image-rotate-90", gimage);
|
||||
SET_SENSITIVE ("image-rotate-180", gimage);
|
||||
SET_SENSITIVE ("image-rotate-270", gimage);
|
||||
SET_SENSITIVE ("image-flip-horizontal", image);
|
||||
SET_SENSITIVE ("image-flip-vertical", image);
|
||||
SET_SENSITIVE ("image-rotate-90", image);
|
||||
SET_SENSITIVE ("image-rotate-180", image);
|
||||
SET_SENSITIVE ("image-rotate-270", image);
|
||||
|
||||
SET_SENSITIVE ("image-resize", gimage);
|
||||
SET_SENSITIVE ("image-resize-to-layers", gimage);
|
||||
SET_SENSITIVE ("image-print-size", gimage);
|
||||
SET_SENSITIVE ("image-scale", gimage);
|
||||
SET_SENSITIVE ("image-crop", gimage && sel);
|
||||
SET_SENSITIVE ("image-duplicate", gimage);
|
||||
SET_SENSITIVE ("image-merge-layers", gimage && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("image-flatten", gimage && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("image-configure-grid", gimage);
|
||||
SET_SENSITIVE ("image-properties", gimage);
|
||||
SET_SENSITIVE ("image-resize", image);
|
||||
SET_SENSITIVE ("image-resize-to-layers", image);
|
||||
SET_SENSITIVE ("image-print-size", image);
|
||||
SET_SENSITIVE ("image-scale", image);
|
||||
SET_SENSITIVE ("image-crop", image && sel);
|
||||
SET_SENSITIVE ("image-duplicate", image);
|
||||
SET_SENSITIVE ("image-merge-layers", image && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("image-flatten", image && !fs && !aux && lp);
|
||||
SET_SENSITIVE ("image-configure-grid", image);
|
||||
SET_SENSITIVE ("image-properties", image);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ typedef struct _ImageResizeOptions ImageResizeOptions;
|
||||
struct _ImageResizeOptions
|
||||
{
|
||||
GimpContext *context;
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
};
|
||||
|
||||
|
||||
@ -99,6 +99,7 @@ static void image_merge_layers_response (GtkWidget *widget,
|
||||
/* private variables */
|
||||
|
||||
static GimpMergeType image_merge_layers_type = GIMP_EXPAND_AS_NECESSARY;
|
||||
static gboolean image_merge_layers_discard_invisible = FALSE;
|
||||
|
||||
|
||||
/* public functions */
|
||||
@ -137,9 +138,9 @@ image_new_from_image_cmd_callback (GtkAction *action,
|
||||
|
||||
if (dialog)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
|
||||
image_new_dialog_set (dialog, gimage, NULL);
|
||||
image_new_dialog_set (dialog, image, NULL);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
@ -150,52 +151,52 @@ image_convert_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
GimpDisplay *gdisp;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpDisplay *display;
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
switch ((GimpImageBaseType) value)
|
||||
{
|
||||
case GIMP_RGB:
|
||||
case GIMP_GRAY:
|
||||
gimp_image_convert (gimage, (GimpImageBaseType) value,
|
||||
gimp_image_convert (image, (GimpImageBaseType) value,
|
||||
0, 0, FALSE, FALSE, 0, NULL, NULL);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
break;
|
||||
|
||||
case GIMP_INDEXED:
|
||||
gtk_widget_show (convert_dialog_new (gimage, widget,
|
||||
GIMP_PROGRESS (gdisp)));
|
||||
gtk_widget_show (convert_dialog_new (image, widget,
|
||||
GIMP_PROGRESS (display)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
image_resize_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
ImageResizeOptions *options;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *dialog;
|
||||
GimpUnit unit;
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
options = g_new0 (ImageResizeOptions, 1);
|
||||
|
||||
options->gdisp = gdisp;
|
||||
options->display = display;
|
||||
options->context = action_data_get_context (data);
|
||||
|
||||
unit = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (image),
|
||||
"scale-dialog-unit"));
|
||||
if (! unit)
|
||||
unit = GIMP_DISPLAY_SHELL (gdisp->shell)->unit;
|
||||
unit = GIMP_DISPLAY_SHELL (display->shell)->unit;
|
||||
|
||||
dialog = resize_dialog_new (GIMP_VIEWABLE (image),
|
||||
_("Set Image Canvas Size"), "gimp-image-resize",
|
||||
@ -205,12 +206,12 @@ image_resize_cmd_callback (GtkAction *action,
|
||||
image_resize_callback,
|
||||
options);
|
||||
|
||||
g_signal_connect_object (gdisp, "disconnect",
|
||||
g_signal_connect_object (display, "disconnect",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
dialog, G_CONNECT_SWAPPED);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (dialog),
|
||||
(GWeakNotify) g_free, options);
|
||||
(GWeakNotify) g_free, options);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
@ -219,22 +220,21 @@ void
|
||||
image_resize_to_layers_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpProgress *progress;
|
||||
return_if_no_display (display, data);
|
||||
|
||||
return_if_no_display (gdisp, data);
|
||||
|
||||
progress = gimp_progress_start (GIMP_PROGRESS (gdisp),
|
||||
progress = gimp_progress_start (GIMP_PROGRESS (display),
|
||||
_("Resizing"), FALSE);
|
||||
|
||||
gimp_image_resize_to_layers (gdisp->gimage,
|
||||
gimp_image_resize_to_layers (display->image,
|
||||
action_data_get_context (data),
|
||||
progress);
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
|
||||
gimp_image_flush (gdisp->gimage);
|
||||
gimp_image_flush (display->image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -242,12 +242,12 @@ image_print_size_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *widget;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = print_size_dialog_new (gdisp->gimage,
|
||||
dialog = print_size_dialog_new (display->image,
|
||||
_("Set Image Print Resolution"),
|
||||
"gimp-image-print-size",
|
||||
widget,
|
||||
@ -256,7 +256,7 @@ image_print_size_cmd_callback (GtkAction *action,
|
||||
image_print_size_callback,
|
||||
NULL);
|
||||
|
||||
g_signal_connect_object (gdisp, "disconnect",
|
||||
g_signal_connect_object (display, "disconnect",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
dialog, G_CONNECT_SWAPPED);
|
||||
|
||||
@ -265,20 +265,20 @@ image_print_size_cmd_callback (GtkAction *action,
|
||||
|
||||
void
|
||||
image_scale_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
ImageScaleDialog *dialog;
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *widget;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = image_scale_dialog_new (gdisp->gimage, gdisp,
|
||||
dialog = image_scale_dialog_new (display->image, display,
|
||||
action_data_get_context (data),
|
||||
widget,
|
||||
image_scale_callback);
|
||||
|
||||
g_signal_connect_object (gdisp, "disconnect",
|
||||
g_signal_connect_object (display, "disconnect",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
dialog->dialog, G_CONNECT_SWAPPED);
|
||||
|
||||
@ -290,20 +290,20 @@ image_flip_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpProgress *progress;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
progress = gimp_progress_start (GIMP_PROGRESS (gdisp),
|
||||
progress = gimp_progress_start (GIMP_PROGRESS (display),
|
||||
_("Flipping"), FALSE);
|
||||
|
||||
gimp_image_flip (gdisp->gimage, action_data_get_context (data),
|
||||
gimp_image_flip (display->image, action_data_get_context (data),
|
||||
(GimpOrientationType) value, progress);
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
|
||||
gimp_image_flush (gdisp->gimage);
|
||||
gimp_image_flush (display->image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -311,61 +311,61 @@ image_rotate_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpProgress *progress;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
progress = gimp_progress_start (GIMP_PROGRESS (gdisp),
|
||||
progress = gimp_progress_start (GIMP_PROGRESS (display),
|
||||
_("Rotating"), FALSE);
|
||||
|
||||
gimp_image_rotate (gdisp->gimage, action_data_get_context (data),
|
||||
gimp_image_rotate (display->image, action_data_get_context (data),
|
||||
(GimpRotationType) value, progress);
|
||||
|
||||
if (progress)
|
||||
gimp_progress_end (progress);
|
||||
|
||||
gimp_image_flush (gdisp->gimage);
|
||||
gimp_image_flush (display->image);
|
||||
}
|
||||
|
||||
void
|
||||
image_crop_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
gint x1, y1, x2, y2;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
if (! gimp_channel_bounds (gimp_image_get_mask (gimage),
|
||||
if (! gimp_channel_bounds (gimp_image_get_mask (image),
|
||||
&x1, &y1, &x2, &y2))
|
||||
{
|
||||
g_message (_("Cannot crop because the current selection is empty."));
|
||||
return;
|
||||
}
|
||||
|
||||
gimp_image_crop (gimage, action_data_get_context (data),
|
||||
gimp_image_crop (image, action_data_get_context (data),
|
||||
x1, y1, x2, y2, FALSE, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
image_duplicate_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
GimpImage *new_gimage;
|
||||
return_if_no_display (gdisp, data);
|
||||
GimpImage *new_image;
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
new_gimage = gimp_image_duplicate (gdisp->gimage);
|
||||
new_image = gimp_image_duplicate (display->image);
|
||||
|
||||
gimp_create_display (new_gimage->gimp,
|
||||
new_gimage,
|
||||
gimp_create_display (new_image->gimp,
|
||||
new_image,
|
||||
shell->unit,
|
||||
gimp_zoom_model_get_factor (shell->zoom));
|
||||
|
||||
g_object_unref (new_gimage);
|
||||
g_object_unref (new_image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -373,15 +373,16 @@ image_merge_layers_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
ImageMergeLayersDialog *dialog;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = image_merge_layers_dialog_new (gimage,
|
||||
dialog = image_merge_layers_dialog_new (image,
|
||||
action_data_get_context (data),
|
||||
widget,
|
||||
image_merge_layers_type);
|
||||
image_merge_layers_type,
|
||||
image_merge_layers_discard_invisible);
|
||||
|
||||
g_signal_connect (dialog->dialog, "response",
|
||||
G_CALLBACK (image_merge_layers_response),
|
||||
@ -394,31 +395,31 @@ void
|
||||
image_flatten_image_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpImage *image;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
gimp_image_flatten (gimage, action_data_get_context (data));
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flatten (image, action_data_get_context (data));
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
image_configure_grid_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
GimpImage *gimage;
|
||||
return_if_no_display (gdisp, data);
|
||||
GimpImage *image;
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
gimage = gdisp->gimage;
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
image = display->image;
|
||||
|
||||
if (! shell->grid_dialog)
|
||||
{
|
||||
shell->grid_dialog = grid_dialog_new (gdisp->gimage, gdisp->shell);
|
||||
shell->grid_dialog = grid_dialog_new (display->image, display->shell);
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (shell->grid_dialog),
|
||||
GTK_WINDOW (gdisp->shell));
|
||||
GTK_WINDOW (display->shell));
|
||||
gtk_window_set_destroy_with_parent (GTK_WINDOW (shell->grid_dialog),
|
||||
TRUE);
|
||||
|
||||
@ -433,19 +434,19 @@ void
|
||||
image_properties_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
gimage = gdisp->gimage;
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
image = display->image;
|
||||
|
||||
dialog = image_properties_dialog_new (gdisp->gimage, gdisp->shell);
|
||||
dialog = image_properties_dialog_new (display->image, display->shell);
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
||||
GTK_WINDOW (gdisp->shell));
|
||||
GTK_WINDOW (display->shell));
|
||||
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog),
|
||||
TRUE);
|
||||
|
||||
@ -471,7 +472,7 @@ image_resize_callback (GtkWidget *dialog,
|
||||
if (width > 0 && height > 0)
|
||||
{
|
||||
GimpImage *image = GIMP_IMAGE (viewable);
|
||||
GimpDisplay *gdisp = options->gdisp;
|
||||
GimpDisplay *display = options->display;
|
||||
GimpContext *context = options->context;
|
||||
GimpProgress *progress;
|
||||
|
||||
@ -484,7 +485,7 @@ image_resize_callback (GtkWidget *dialog,
|
||||
if (width == image->width && height == image->height)
|
||||
return;
|
||||
|
||||
progress = gimp_progress_start (GIMP_PROGRESS (gdisp),
|
||||
progress = gimp_progress_start (GIMP_PROGRESS (display),
|
||||
_("Resizing"), FALSE);
|
||||
|
||||
gimp_image_resize_with_layers (image,
|
||||
@ -535,7 +536,7 @@ image_print_size_callback (GtkWidget *dialog,
|
||||
static void
|
||||
image_scale_callback (ImageScaleDialog *dialog)
|
||||
{
|
||||
GimpImage *image = dialog->gimage;
|
||||
GimpImage *image = dialog->image;
|
||||
|
||||
if (dialog->width == image->width &&
|
||||
dialog->height == image->height &&
|
||||
@ -557,7 +558,7 @@ image_scale_callback (ImageScaleDialog *dialog)
|
||||
{
|
||||
GimpProgress *progress;
|
||||
|
||||
progress = gimp_progress_start (GIMP_PROGRESS (dialog->gdisp),
|
||||
progress = gimp_progress_start (GIMP_PROGRESS (dialog->display),
|
||||
_("Scaling"), FALSE);
|
||||
|
||||
gimp_image_scale (image,
|
||||
@ -588,12 +589,15 @@ image_merge_layers_response (GtkWidget *widget,
|
||||
{
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
{
|
||||
image_merge_layers_type = dialog->merge_type;
|
||||
image_merge_layers_type = dialog->merge_type;
|
||||
image_merge_layers_discard_invisible = dialog->discard_invisible;
|
||||
|
||||
gimp_image_merge_visible_layers (dialog->gimage,
|
||||
gimp_image_merge_visible_layers (dialog->image,
|
||||
dialog->context,
|
||||
image_merge_layers_type);
|
||||
gimp_image_flush (dialog->gimage);
|
||||
image_merge_layers_type,
|
||||
image_merge_layers_discard_invisible);
|
||||
|
||||
gimp_image_flush (dialog->image);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (widget);
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry images_actions[] =
|
||||
static const GimpActionEntry images_actions[] =
|
||||
{
|
||||
{ "images-popup", GIMP_STOCK_IMAGES,
|
||||
N_("Images Menu"), NULL, NULL, NULL,
|
||||
|
||||
@ -61,7 +61,7 @@ images_raise_views_cmd_callback (GtkAction *action,
|
||||
{
|
||||
GimpDisplay *display = list->data;
|
||||
|
||||
if (display->gimage == image)
|
||||
if (display->image == image)
|
||||
gtk_window_present (GTK_WINDOW (display->shell));
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry layers_actions[] =
|
||||
static const GimpActionEntry layers_actions[] =
|
||||
{
|
||||
{ "layers-popup", GIMP_STOCK_LAYERS,
|
||||
N_("Layers Menu"), NULL, NULL, NULL,
|
||||
@ -58,136 +58,150 @@ static GimpActionEntry layers_actions[] =
|
||||
{ "layers-mode-menu", GIMP_STOCK_TOOL_PENCIL, N_("Layer _Mode") },
|
||||
|
||||
{ "layers-text-tool", GIMP_STOCK_TOOL_TEXT,
|
||||
N_("Te_xt Tool"), NULL, NULL,
|
||||
N_("Te_xt Tool"), NULL,
|
||||
N_("Activate the text tool on this text layer"),
|
||||
G_CALLBACK (layers_text_tool_cmd_callback),
|
||||
GIMP_HELP_TOOL_TEXT },
|
||||
|
||||
{ "layers-edit-attributes", GTK_STOCK_EDIT,
|
||||
N_("_Edit Layer Attributes..."), NULL,
|
||||
N_("Edit layer attributes"),
|
||||
N_("Edit the layer's name"),
|
||||
G_CALLBACK (layers_edit_attributes_cmd_callback),
|
||||
GIMP_HELP_LAYER_EDIT },
|
||||
|
||||
{ "layers-new", GTK_STOCK_NEW,
|
||||
N_("_New Layer..."), "<control><shift>N",
|
||||
N_("New layer..."),
|
||||
N_("Create a new layer and add it to the image"),
|
||||
G_CALLBACK (layers_new_cmd_callback),
|
||||
GIMP_HELP_LAYER_NEW },
|
||||
|
||||
{ "layers-new-last-values", GTK_STOCK_NEW,
|
||||
N_("_New Layer"), "",
|
||||
N_("New layer with last values"),
|
||||
N_("Create a new layer with last used values"),
|
||||
G_CALLBACK (layers_new_last_vals_cmd_callback),
|
||||
GIMP_HELP_LAYER_NEW },
|
||||
|
||||
{ "layers-duplicate", GIMP_STOCK_DUPLICATE,
|
||||
N_("D_uplicate Layer"), "<control><shift>D",
|
||||
N_("Duplicate layer"),
|
||||
N_("Create a duplicate of the layer and add it to the image"),
|
||||
G_CALLBACK (layers_duplicate_cmd_callback),
|
||||
GIMP_HELP_LAYER_DUPLICATE },
|
||||
|
||||
{ "layers-delete", GTK_STOCK_DELETE,
|
||||
N_("_Delete Layer"), "",
|
||||
N_("Delete layer"),
|
||||
N_("Delete this layer"),
|
||||
G_CALLBACK (layers_delete_cmd_callback),
|
||||
GIMP_HELP_LAYER_DELETE },
|
||||
|
||||
{ "layers-raise", GTK_STOCK_GO_UP,
|
||||
N_("_Raise Layer"), "",
|
||||
N_("Raise layer"),
|
||||
N_("Raise this layer one step in the layer stack"),
|
||||
G_CALLBACK (layers_raise_cmd_callback),
|
||||
GIMP_HELP_LAYER_RAISE },
|
||||
|
||||
{ "layers-raise-to-top", GTK_STOCK_GOTO_TOP,
|
||||
N_("Layer to _Top"), "",
|
||||
N_("Raise layer to top"),
|
||||
N_("Move this layer to the top of the layer stack"),
|
||||
G_CALLBACK (layers_raise_to_top_cmd_callback),
|
||||
GIMP_HELP_LAYER_RAISE_TO_TOP },
|
||||
|
||||
{ "layers-lower", GTK_STOCK_GO_DOWN,
|
||||
N_("_Lower Layer"), "",
|
||||
N_("Lower layer"),
|
||||
N_("Lower this layer one step in the layer stack"),
|
||||
G_CALLBACK (layers_lower_cmd_callback),
|
||||
GIMP_HELP_LAYER_LOWER },
|
||||
|
||||
{ "layers-lower-to-bottom", GTK_STOCK_GOTO_BOTTOM,
|
||||
N_("Layer to _Bottom"), "",
|
||||
N_("Lower layer to bottom"),
|
||||
N_("Move this layer to the bottom of the layer stack"),
|
||||
G_CALLBACK (layers_lower_to_bottom_cmd_callback),
|
||||
GIMP_HELP_LAYER_LOWER_TO_BOTTOM },
|
||||
|
||||
{ "layers-anchor", GIMP_STOCK_ANCHOR,
|
||||
N_("_Anchor Layer"), "<control>H",
|
||||
N_("Anchor floating layer"),
|
||||
N_("Anchor the floating layer"),
|
||||
G_CALLBACK (layers_anchor_cmd_callback),
|
||||
GIMP_HELP_LAYER_ANCHOR },
|
||||
|
||||
{ "layers-merge-down", GIMP_STOCK_MERGE_DOWN,
|
||||
N_("Merge Do_wn"), NULL, NULL,
|
||||
N_("Merge Do_wn"), NULL,
|
||||
N_("Merge this layer with the one below it"),
|
||||
G_CALLBACK (layers_merge_down_cmd_callback),
|
||||
GIMP_HELP_LAYER_MERGE_DOWN },
|
||||
|
||||
{ "layers-merge-layers", NULL,
|
||||
N_("Merge _Visible Layers..."), NULL, NULL,
|
||||
N_("Merge _Visible Layers..."), NULL,
|
||||
N_("Merge all visible layers into one layer"),
|
||||
G_CALLBACK (image_merge_layers_cmd_callback),
|
||||
GIMP_HELP_IMAGE_MERGE_LAYERS },
|
||||
|
||||
{ "layers-flatten-image", NULL,
|
||||
N_("_Flatten Image"), NULL, NULL,
|
||||
N_("_Flatten Image"), NULL,
|
||||
N_("Merge all layers into one and remove transparency"),
|
||||
G_CALLBACK (image_flatten_image_cmd_callback),
|
||||
GIMP_HELP_IMAGE_FLATTEN },
|
||||
|
||||
{ "layers-text-discard", GIMP_STOCK_TOOL_TEXT,
|
||||
N_("_Discard Text Information"), NULL, NULL,
|
||||
N_("_Discard Text Information"), NULL,
|
||||
N_("Turn this text layer into a normal layer"),
|
||||
G_CALLBACK (layers_text_discard_cmd_callback),
|
||||
GIMP_HELP_LAYER_TEXT_DISCARD },
|
||||
|
||||
{ "layers-resize", GIMP_STOCK_RESIZE,
|
||||
N_("Layer B_oundary Size..."), NULL, NULL,
|
||||
N_("Layer B_oundary Size..."), NULL,
|
||||
N_("Adjust the layer dimensions"),
|
||||
G_CALLBACK (layers_resize_cmd_callback),
|
||||
GIMP_HELP_LAYER_RESIZE },
|
||||
|
||||
{ "layers-resize-to-image", GIMP_STOCK_LAYER_TO_IMAGESIZE,
|
||||
N_("Layer to _Image Size"), NULL, NULL,
|
||||
N_("Layer to _Image Size"), NULL,
|
||||
N_("Resize the layer to the size of the image"),
|
||||
G_CALLBACK (layers_resize_to_image_cmd_callback),
|
||||
GIMP_HELP_LAYER_RESIZE_TO_IMAGE },
|
||||
|
||||
{ "layers-scale", GIMP_STOCK_SCALE,
|
||||
N_("_Scale Layer..."), NULL, NULL,
|
||||
N_("_Scale Layer..."), NULL,
|
||||
N_("Change the size of the layer content"),
|
||||
G_CALLBACK (layers_scale_cmd_callback),
|
||||
GIMP_HELP_LAYER_SCALE },
|
||||
|
||||
{ "layers-crop", GIMP_STOCK_TOOL_CROP,
|
||||
N_("Cr_op Layer"), NULL, NULL,
|
||||
N_("Cr_op Layer"), NULL,
|
||||
N_("Crop the layer to the extents of the selection"),
|
||||
G_CALLBACK (layers_crop_cmd_callback),
|
||||
GIMP_HELP_LAYER_CROP },
|
||||
|
||||
{ "layers-mask-add", GIMP_STOCK_LAYER_MASK,
|
||||
N_("Add La_yer Mask..."), NULL, NULL,
|
||||
N_("Add La_yer Mask..."), NULL,
|
||||
N_("Add a mask that allows non-destructive editing of transparency"),
|
||||
G_CALLBACK (layers_mask_add_cmd_callback),
|
||||
GIMP_HELP_LAYER_MASK_ADD },
|
||||
|
||||
{ "layers-alpha-add", GIMP_STOCK_TRANSPARENCY,
|
||||
N_("Add Alpha C_hannel"), NULL, NULL,
|
||||
N_("Add Alpha C_hannel"), NULL,
|
||||
N_("Add transparency information to the layer"),
|
||||
G_CALLBACK (layers_alpha_add_cmd_callback),
|
||||
GIMP_HELP_LAYER_ALPHA_ADD },
|
||||
|
||||
{ "layers-alpha-remove", NULL,
|
||||
N_("_Remove Alpha Channel"), NULL, NULL,
|
||||
N_("_Remove Alpha Channel"), NULL,
|
||||
N_("Remove transparency information from the layer"),
|
||||
G_CALLBACK (layers_alpha_remove_cmd_callback),
|
||||
GIMP_HELP_LAYER_ALPHA_REMOVE }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry layers_toggle_actions[] =
|
||||
static const GimpToggleActionEntry layers_toggle_actions[] =
|
||||
{
|
||||
{ "layers-lock-alpha", GIMP_STOCK_TRANSPARENCY,
|
||||
N_("Lock Alph_a Channel"), NULL, NULL,
|
||||
N_("Lock Alph_a Channel"), NULL,
|
||||
N_("Keep transparency information on this layer from being modified"),
|
||||
G_CALLBACK (layers_lock_alpha_cmd_callback),
|
||||
FALSE,
|
||||
GIMP_HELP_LAYER_LOCK_ALPHA },
|
||||
|
||||
{ "layers-mask-edit", GTK_STOCK_EDIT,
|
||||
N_("_Edit Layer Mask"), NULL, NULL,
|
||||
N_("_Edit Layer Mask"), NULL,
|
||||
N_("Work on the layer mask"),
|
||||
G_CALLBACK (layers_mask_edit_cmd_callback),
|
||||
FALSE,
|
||||
GIMP_HELP_LAYER_MASK_EDIT },
|
||||
@ -199,72 +213,83 @@ static GimpToggleActionEntry layers_toggle_actions[] =
|
||||
GIMP_HELP_LAYER_MASK_SHOW },
|
||||
|
||||
{ "layers-mask-disable", NULL,
|
||||
N_("_Disable Layer Mask"), NULL, NULL,
|
||||
N_("_Disable Layer Mask"), NULL,
|
||||
N_("Dismiss the effect of the layer mask"),
|
||||
G_CALLBACK (layers_mask_disable_cmd_callback),
|
||||
FALSE,
|
||||
GIMP_HELP_LAYER_MASK_DISABLE }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry layers_mask_apply_actions[] =
|
||||
static const GimpEnumActionEntry layers_mask_apply_actions[] =
|
||||
{
|
||||
{ "layers-mask-apply", NULL,
|
||||
N_("Apply Layer _Mask"), NULL, NULL,
|
||||
N_("Apply Layer _Mask"), NULL,
|
||||
N_("Apply the effect of the layer mask and remove it"),
|
||||
GIMP_MASK_APPLY, FALSE,
|
||||
GIMP_HELP_LAYER_MASK_APPLY },
|
||||
|
||||
{ "layers-mask-delete", GTK_STOCK_DELETE,
|
||||
N_("Delete Layer Mas_k"), "", NULL,
|
||||
N_("Delete Layer Mas_k"), "",
|
||||
N_("Remove the layer mask and its effect"),
|
||||
GIMP_MASK_DISCARD, FALSE,
|
||||
GIMP_HELP_LAYER_MASK_DELETE }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry layers_mask_to_selection_actions[] =
|
||||
static const GimpEnumActionEntry layers_mask_to_selection_actions[] =
|
||||
{
|
||||
{ "layers-mask-selection-replace", GIMP_STOCK_SELECTION_REPLACE,
|
||||
N_("_Mask to Selection"), NULL, NULL,
|
||||
N_("_Mask to Selection"), NULL,
|
||||
N_("Replace the selection with the layer mask"),
|
||||
GIMP_CHANNEL_OP_REPLACE, FALSE,
|
||||
GIMP_HELP_LAYER_MASK_SELECTION_REPLACE },
|
||||
|
||||
{ "layers-mask-selection-add", GIMP_STOCK_SELECTION_ADD,
|
||||
N_("_Add to Selection"), NULL, NULL,
|
||||
N_("_Add to Selection"), NULL,
|
||||
N_("Add the layer mask to the current selection"),
|
||||
GIMP_CHANNEL_OP_ADD, FALSE,
|
||||
GIMP_HELP_LAYER_MASK_SELECTION_ADD },
|
||||
|
||||
{ "layers-mask-selection-subtract", GIMP_STOCK_SELECTION_SUBTRACT,
|
||||
N_("_Subtract from Selection"), NULL, NULL,
|
||||
N_("_Subtract from Selection"), NULL,
|
||||
N_("Subtract the layer mask from the current selection"),
|
||||
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
|
||||
GIMP_HELP_LAYER_MASK_SELECTION_SUBTRACT },
|
||||
|
||||
{ "layers-mask-selection-intersect", GIMP_STOCK_SELECTION_INTERSECT,
|
||||
N_("_Intersect with Selection"), NULL, NULL,
|
||||
N_("_Intersect with Selection"), NULL,
|
||||
N_("Intersect the layer mask with the current selection"),
|
||||
GIMP_CHANNEL_OP_INTERSECT, FALSE,
|
||||
GIMP_HELP_LAYER_MASK_SELECTION_INTERSECT }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry layers_alpha_to_selection_actions[] =
|
||||
static const GimpEnumActionEntry layers_alpha_to_selection_actions[] =
|
||||
{
|
||||
{ "layers-alpha-selection-replace", GIMP_STOCK_SELECTION_REPLACE,
|
||||
N_("Al_pha to Selection"), NULL, NULL,
|
||||
N_("Al_pha to Selection"), NULL,
|
||||
N_("Replace the selection with the layer's alpha channel"),
|
||||
GIMP_CHANNEL_OP_REPLACE, FALSE,
|
||||
GIMP_HELP_LAYER_ALPHA_SELECTION_REPLACE },
|
||||
|
||||
{ "layers-alpha-selection-add", GIMP_STOCK_SELECTION_ADD,
|
||||
N_("A_dd to Selection"), NULL, NULL,
|
||||
N_("A_dd to Selection"), NULL,
|
||||
N_("Add the layer's alpha channel to the current selection"),
|
||||
GIMP_CHANNEL_OP_ADD, FALSE,
|
||||
GIMP_HELP_LAYER_ALPHA_SELECTION_ADD },
|
||||
|
||||
{ "layers-alpha-selection-subtract", GIMP_STOCK_SELECTION_SUBTRACT,
|
||||
N_("_Subtract from Selection"), NULL, NULL,
|
||||
N_("_Subtract from Selection"), NULL,
|
||||
N_("Subtract the layer's alpha channel from the current selection"),
|
||||
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
|
||||
GIMP_HELP_LAYER_ALPHA_SELECTION_SUBTRACT },
|
||||
|
||||
{ "layers-alpha-selection-intersect", GIMP_STOCK_SELECTION_INTERSECT,
|
||||
N_("_Intersect with Selection"), NULL, NULL,
|
||||
N_("_Intersect with Selection"), NULL,
|
||||
N_("Intersect the layer's alpha channel with the current selection"),
|
||||
GIMP_CHANNEL_OP_INTERSECT, FALSE,
|
||||
GIMP_HELP_LAYER_ALPHA_SELECTION_INTERSECT }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry layers_select_actions[] =
|
||||
static const GimpEnumActionEntry layers_select_actions[] =
|
||||
{
|
||||
{ "layers-select-top", NULL,
|
||||
N_("Select _Top Layer"), "Home", NULL,
|
||||
@ -287,7 +312,7 @@ static GimpEnumActionEntry layers_select_actions[] =
|
||||
GIMP_HELP_LAYER_NEXT }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry layers_opacity_actions[] =
|
||||
static const GimpEnumActionEntry layers_opacity_actions[] =
|
||||
{
|
||||
{ "layers-opacity-set", GIMP_STOCK_TRANSPARENCY,
|
||||
N_("Set Opacity"), NULL, NULL,
|
||||
@ -319,7 +344,7 @@ static GimpEnumActionEntry layers_opacity_actions[] =
|
||||
GIMP_HELP_LAYER_OPACITY }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry layers_mode_actions[] =
|
||||
static const GimpEnumActionEntry layers_mode_actions[] =
|
||||
{
|
||||
{ "layers-mode-first", GIMP_STOCK_TOOL_PENCIL,
|
||||
"First Layer Mode", NULL, NULL,
|
||||
@ -386,7 +411,7 @@ void
|
||||
layers_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpLayer *layer = NULL;
|
||||
GimpLayerMask *mask = NULL; /* layer mask */
|
||||
gboolean fs = FALSE; /* floating sel */
|
||||
@ -399,14 +424,14 @@ layers_actions_update (GimpActionGroup *group,
|
||||
GList *next = NULL;
|
||||
GList *prev = NULL;
|
||||
|
||||
if (gimage)
|
||||
if (image)
|
||||
{
|
||||
fs = (gimp_image_floating_sel (gimage) != NULL);
|
||||
ac = (gimp_image_get_active_channel (gimage) != NULL);
|
||||
sel = ! gimp_channel_is_empty (gimp_image_get_mask (gimage));
|
||||
indexed = (gimp_image_base_type (gimage) == GIMP_INDEXED);
|
||||
fs = (gimp_image_floating_sel (image) != NULL);
|
||||
ac = (gimp_image_get_active_channel (image) != NULL);
|
||||
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
|
||||
indexed = (gimp_image_base_type (image) == GIMP_INDEXED);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
layer = gimp_image_get_active_layer (image);
|
||||
|
||||
if (layer)
|
||||
{
|
||||
@ -416,7 +441,7 @@ layers_actions_update (GimpActionGroup *group,
|
||||
lock_alpha = gimp_layer_get_lock_alpha (layer);
|
||||
alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
|
||||
|
||||
list = g_list_find (GIMP_LIST (gimage->layers)->list, layer);
|
||||
list = g_list_find (GIMP_LIST (image->layers)->list, layer);
|
||||
|
||||
if (list)
|
||||
{
|
||||
@ -439,8 +464,8 @@ layers_actions_update (GimpActionGroup *group,
|
||||
SET_VISIBLE ("layers-text-tool", text_layer && !ac);
|
||||
SET_SENSITIVE ("layers-edit-attributes", layer && !fs && !ac);
|
||||
|
||||
SET_SENSITIVE ("layers-new", gimage);
|
||||
SET_SENSITIVE ("layers-new-last-values", gimage);
|
||||
SET_SENSITIVE ("layers-new", image);
|
||||
SET_SENSITIVE ("layers-new-last-values", image);
|
||||
SET_SENSITIVE ("layers-duplicate", layer && !fs && !ac);
|
||||
SET_SENSITIVE ("layers-delete", layer && !ac);
|
||||
|
||||
|
||||
@ -146,11 +146,11 @@ void
|
||||
layers_text_tool_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GtkWidget *widget;
|
||||
GimpTool *active_tool;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
if (! gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
|
||||
@ -159,20 +159,20 @@ layers_text_tool_cmd_callback (GtkAction *action,
|
||||
return;
|
||||
}
|
||||
|
||||
active_tool = tool_manager_get_active (gimage->gimp);
|
||||
active_tool = tool_manager_get_active (image->gimp);
|
||||
|
||||
if (! GIMP_IS_TEXT_TOOL (active_tool))
|
||||
{
|
||||
GimpToolInfo *tool_info;
|
||||
|
||||
tool_info = (GimpToolInfo *)
|
||||
gimp_container_get_child_by_name (gimage->gimp->tool_info_list,
|
||||
gimp_container_get_child_by_name (image->gimp->tool_info_list,
|
||||
"gimp-text-tool");
|
||||
|
||||
if (GIMP_IS_TOOL_INFO (tool_info))
|
||||
{
|
||||
gimp_context_set_tool (action_data_get_context (data), tool_info);
|
||||
active_tool = tool_manager_get_active (gimage->gimp);
|
||||
active_tool = tool_manager_get_active (image->gimp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -182,13 +182,13 @@ layers_text_tool_cmd_callback (GtkAction *action,
|
||||
|
||||
void
|
||||
layers_edit_attributes_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
LayerOptionsDialog *dialog;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GtkWidget *widget;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = layer_options_dialog_new (gimp_item_get_image (GIMP_ITEM (layer)),
|
||||
@ -211,26 +211,26 @@ layers_edit_attributes_cmd_callback (GtkAction *action,
|
||||
|
||||
void
|
||||
layers_new_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
LayerOptionsDialog *dialog;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
GimpLayer *floating_sel;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
/* If there is a floating selection, the new command transforms
|
||||
* the current fs into a new layer
|
||||
*/
|
||||
if ((floating_sel = gimp_image_floating_sel (gimage)))
|
||||
if ((floating_sel = gimp_image_floating_sel (image)))
|
||||
{
|
||||
floating_sel_to_layer (floating_sel);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
return;
|
||||
}
|
||||
|
||||
dialog = layer_options_dialog_new (gimage, action_data_get_context (data),
|
||||
dialog = layer_options_dialog_new (image, action_data_get_context (data),
|
||||
NULL, widget,
|
||||
layer_name ? layer_name : _("New Layer"),
|
||||
layer_fill_type,
|
||||
@ -251,22 +251,22 @@ void
|
||||
layers_new_last_vals_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *floating_sel;
|
||||
GimpLayer *new_layer;
|
||||
gint width, height;
|
||||
gint off_x, off_y;
|
||||
gdouble opacity;
|
||||
GimpLayerModeEffects mode;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
/* If there is a floating selection, the new command transforms
|
||||
* the current fs into a new layer
|
||||
*/
|
||||
if ((floating_sel = gimp_image_floating_sel (gimage)))
|
||||
if ((floating_sel = gimp_image_floating_sel (image)))
|
||||
{
|
||||
floating_sel_to_layer (floating_sel);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -282,19 +282,19 @@ layers_new_last_vals_cmd_callback (GtkAction *action,
|
||||
}
|
||||
else
|
||||
{
|
||||
width = gimp_image_get_width (gimage);
|
||||
height = gimp_image_get_height (gimage);
|
||||
width = gimp_image_get_width (image);
|
||||
height = gimp_image_get_height (image);
|
||||
off_x = 0;
|
||||
off_y = 0;
|
||||
opacity = 1.0;
|
||||
mode = GIMP_NORMAL_MODE;
|
||||
}
|
||||
|
||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||
_("New Layer"));
|
||||
|
||||
new_layer = gimp_layer_new (gimage, width, height,
|
||||
gimp_image_base_type_with_alpha (gimage),
|
||||
new_layer = gimp_layer_new (image, width, height,
|
||||
gimp_image_base_type_with_alpha (image),
|
||||
layer_name ? layer_name : _("New Layer"),
|
||||
opacity, mode);
|
||||
|
||||
@ -303,11 +303,11 @@ layers_new_last_vals_cmd_callback (GtkAction *action,
|
||||
layer_fill_type);
|
||||
gimp_item_translate (GIMP_ITEM (new_layer), off_x, off_y, FALSE);
|
||||
|
||||
gimp_image_add_layer (gimage, new_layer, -1);
|
||||
gimp_image_add_layer (image, new_layer, -1);
|
||||
|
||||
gimp_image_undo_group_end (gimage);
|
||||
gimp_image_undo_group_end (image);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -315,141 +315,141 @@ layers_select_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpLayer *new_layer;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
layer = gimp_image_get_active_layer (gimage);
|
||||
layer = gimp_image_get_active_layer (image);
|
||||
|
||||
new_layer = (GimpLayer *) action_select_object ((GimpActionSelectType) value,
|
||||
gimage->layers,
|
||||
image->layers,
|
||||
(GimpObject *) layer);
|
||||
|
||||
if (new_layer && new_layer != layer)
|
||||
{
|
||||
gimp_image_set_active_layer (gimage, new_layer);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_set_active_layer (image, new_layer);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
layers_raise_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
gimp_image_raise_layer (gimage, layer);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_raise_layer (image, layer);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_raise_to_top_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
gimp_image_raise_layer_to_top (gimage, layer);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_raise_layer_to_top (image, layer);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_lower_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
gimp_image_lower_layer (gimage, layer);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_lower_layer (image, layer);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_lower_to_bottom_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
gimp_image_lower_layer_to_bottom (gimage, layer);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_lower_layer_to_bottom (image, layer);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_duplicate_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpLayer *new_layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
new_layer =
|
||||
GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
|
||||
G_TYPE_FROM_INSTANCE (layer),
|
||||
TRUE));
|
||||
gimp_image_add_layer (gimage, new_layer, -1);
|
||||
gimp_image_add_layer (image, new_layer, -1);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_anchor_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
if (gimp_layer_is_floating_sel (layer))
|
||||
{
|
||||
floating_sel_anchor (layer);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
layers_merge_down_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
gimp_image_merge_down (gimage, layer, action_data_get_context (data),
|
||||
gimp_image_merge_down (image, layer, action_data_get_context (data),
|
||||
GIMP_EXPAND_AS_NECESSARY);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_delete_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
if (gimp_layer_is_floating_sel (layer))
|
||||
floating_sel_remove (layer);
|
||||
else
|
||||
gimp_image_remove_layer (gimage, layer);
|
||||
gimp_image_remove_layer (image, layer);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_text_discard_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
if (GIMP_IS_TEXT_LAYER (layer))
|
||||
gimp_text_layer_discard (GIMP_TEXT_LAYER (layer));
|
||||
@ -457,9 +457,9 @@ layers_text_discard_cmd_callback (GtkAction *action,
|
||||
|
||||
void
|
||||
layers_resize_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GtkWidget *widget;
|
||||
@ -468,12 +468,12 @@ layers_resize_cmd_callback (GtkAction *action,
|
||||
return_if_no_layer (image, layer, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
gdisp = GIMP_IS_DISPLAY (data) ? data : NULL;
|
||||
display = GIMP_IS_DISPLAY (data) ? data : NULL;
|
||||
|
||||
unit = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (image),
|
||||
"scale-dialog-unit"));
|
||||
if (! unit)
|
||||
unit = gdisp ? GIMP_DISPLAY_SHELL (gdisp->shell)->unit : GIMP_UNIT_PIXEL;
|
||||
unit = display ? GIMP_DISPLAY_SHELL (display->shell)->unit : GIMP_UNIT_PIXEL;
|
||||
|
||||
dialog = resize_dialog_new (GIMP_VIEWABLE (layer),
|
||||
_("Set Layer Boundary Size"), "gimp-layer-resize",
|
||||
@ -488,35 +488,35 @@ layers_resize_cmd_callback (GtkAction *action,
|
||||
|
||||
void
|
||||
layers_resize_to_image_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
gimp_layer_resize_to_image (layer, action_data_get_context (data));
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_scale_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GtkWidget *widget;
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *dialog;
|
||||
GimpUnit unit;
|
||||
return_if_no_layer (image, layer, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
gdisp = action_data_get_display (data);
|
||||
display = action_data_get_display (data);
|
||||
|
||||
unit = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (image),
|
||||
"scale-dialog-unit"));
|
||||
if (! unit)
|
||||
unit = gdisp ? GIMP_DISPLAY_SHELL (gdisp->shell)->unit : GIMP_UNIT_PIXEL;
|
||||
unit = display ? GIMP_DISPLAY_SHELL (display->shell)->unit : GIMP_UNIT_PIXEL;
|
||||
|
||||
dialog = scale_dialog_new (GIMP_VIEWABLE (layer),
|
||||
_("Scale Layer"), "gimp-layer-scale",
|
||||
@ -524,7 +524,7 @@ layers_scale_cmd_callback (GtkAction *action,
|
||||
gimp_standard_help_func, GIMP_HELP_LAYER_SCALE,
|
||||
unit, image->gimp->config->interpolation_type,
|
||||
layers_scale_layer_callback,
|
||||
gdisp);
|
||||
display);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
@ -533,13 +533,13 @@ void
|
||||
layers_crop_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
gint x1, y1, x2, y2;
|
||||
gint off_x, off_y;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
if (! gimp_channel_bounds (gimp_image_get_mask (gimage),
|
||||
if (! gimp_channel_bounds (gimp_image_get_mask (image),
|
||||
&x1, &y1, &x2, &y2))
|
||||
{
|
||||
g_message (_("Cannot crop because the current selection is empty."));
|
||||
@ -551,15 +551,15 @@ layers_crop_cmd_callback (GtkAction *action,
|
||||
off_x -= x1;
|
||||
off_y -= y1;
|
||||
|
||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE,
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_RESIZE,
|
||||
_("Crop Layer"));
|
||||
|
||||
gimp_item_resize (GIMP_ITEM (layer), action_data_get_context (data),
|
||||
x2 - x1, y2 - y1, off_x, off_y);
|
||||
|
||||
gimp_image_undo_group_end (gimage);
|
||||
gimp_image_undo_group_end (image);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -567,10 +567,10 @@ layers_mask_add_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
LayerAddMaskDialog *dialog;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GtkWidget *widget;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = layer_add_mask_dialog_new (layer, widget,
|
||||
@ -588,17 +588,17 @@ layers_mask_apply_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpMaskApplyMode mode;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
mode = (GimpMaskApplyMode) value;
|
||||
|
||||
if (gimp_layer_get_mask (layer))
|
||||
{
|
||||
gimp_layer_apply_mask (layer, mode, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -606,10 +606,10 @@ void
|
||||
layers_mask_edit_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpLayerMask *mask;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
mask = gimp_layer_get_mask (layer);
|
||||
|
||||
@ -620,7 +620,7 @@ layers_mask_edit_cmd_callback (GtkAction *action,
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
gimp_layer_mask_set_edit (mask, active);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -628,10 +628,10 @@ void
|
||||
layers_mask_show_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpLayerMask *mask;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
mask = gimp_layer_get_mask (layer);
|
||||
|
||||
@ -642,7 +642,7 @@ layers_mask_show_cmd_callback (GtkAction *action,
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
gimp_layer_mask_set_show (mask, active, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -650,10 +650,10 @@ void
|
||||
layers_mask_disable_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpLayerMask *mask;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
mask = gimp_layer_get_mask (layer);
|
||||
|
||||
@ -664,7 +664,7 @@ layers_mask_disable_cmd_callback (GtkAction *action,
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
gimp_layer_mask_set_apply (mask, ! active, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -674,10 +674,10 @@ layers_mask_to_selection_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpChannelOps op;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpLayerMask *mask;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
op = (GimpChannelOps) value;
|
||||
|
||||
@ -689,12 +689,12 @@ layers_mask_to_selection_cmd_callback (GtkAction *action,
|
||||
|
||||
gimp_item_offsets (GIMP_ITEM (mask), &off_x, &off_y);
|
||||
|
||||
gimp_channel_select_channel (gimp_image_get_mask (gimage),
|
||||
gimp_channel_select_channel (gimp_image_get_mask (image),
|
||||
_("Layer Mask to Selection"),
|
||||
GIMP_CHANNEL (mask),
|
||||
off_x, off_y,
|
||||
op, FALSE, 0.0, 0.0);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -702,14 +702,14 @@ void
|
||||
layers_alpha_add_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
if (! gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
|
||||
{
|
||||
gimp_layer_add_alpha (layer);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -717,14 +717,14 @@ void
|
||||
layers_alpha_remove_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
|
||||
{
|
||||
gimp_layer_flatten (layer, action_data_get_context (data));
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -734,16 +734,16 @@ layers_alpha_to_selection_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpChannelOps op;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
op = (GimpChannelOps) value;
|
||||
|
||||
gimp_channel_select_alpha (gimp_image_get_mask (gimage),
|
||||
gimp_channel_select_alpha (gimp_image_get_mask (image),
|
||||
GIMP_DRAWABLE (layer),
|
||||
op, FALSE, 0.0, 0.0);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -751,14 +751,14 @@ layers_opacity_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
gdouble opacity;
|
||||
GimpUndo *undo;
|
||||
gboolean push_undo = TRUE;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
|
||||
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
|
||||
GIMP_UNDO_LAYER_OPACITY);
|
||||
|
||||
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer))
|
||||
@ -769,7 +769,7 @@ layers_opacity_cmd_callback (GtkAction *action,
|
||||
0.0, 1.0,
|
||||
0.01, 0.1, FALSE);
|
||||
gimp_layer_set_opacity (layer, opacity, push_undo);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -777,15 +777,15 @@ layers_mode_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
GimpLayerModeEffects layer_mode;
|
||||
gint index;
|
||||
GimpUndo *undo;
|
||||
gboolean push_undo = TRUE;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
|
||||
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
|
||||
GIMP_UNDO_LAYER_MODE);
|
||||
|
||||
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer))
|
||||
@ -798,17 +798,17 @@ layers_mode_cmd_callback (GtkAction *action,
|
||||
0, G_N_ELEMENTS (layer_modes) - 1,
|
||||
1.0, 1.0, FALSE);
|
||||
gimp_layer_set_mode (layer, layer_modes[index], push_undo);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
layers_lock_alpha_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpLayer *layer;
|
||||
gboolean lock_alpha;
|
||||
return_if_no_layer (gimage, layer, data);
|
||||
return_if_no_layer (image, layer, data);
|
||||
|
||||
lock_alpha = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -817,14 +817,14 @@ layers_lock_alpha_cmd_callback (GtkAction *action,
|
||||
GimpUndo *undo;
|
||||
gboolean push_undo = TRUE;
|
||||
|
||||
undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
|
||||
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
|
||||
GIMP_UNDO_LAYER_LOCK_ALPHA);
|
||||
|
||||
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer))
|
||||
push_undo = FALSE;
|
||||
|
||||
gimp_layer_set_lock_alpha (layer, lock_alpha, push_undo);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -854,10 +854,10 @@ layers_new_layer_response (GtkWidget *widget,
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (dialog->size_se),
|
||||
1));
|
||||
|
||||
layer = gimp_layer_new (dialog->gimage,
|
||||
layer = gimp_layer_new (dialog->image,
|
||||
dialog->xsize,
|
||||
dialog->ysize,
|
||||
gimp_image_base_type_with_alpha (dialog->gimage),
|
||||
gimp_image_base_type_with_alpha (dialog->image),
|
||||
layer_name,
|
||||
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
|
||||
|
||||
@ -866,9 +866,9 @@ layers_new_layer_response (GtkWidget *widget,
|
||||
gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer),
|
||||
dialog->context,
|
||||
layer_fill_type);
|
||||
gimp_image_add_layer (dialog->gimage, layer, -1);
|
||||
gimp_image_add_layer (dialog->image, layer, -1);
|
||||
|
||||
gimp_image_flush (dialog->gimage);
|
||||
gimp_image_flush (dialog->image);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -895,7 +895,7 @@ layers_edit_layer_response (GtkWidget *widget,
|
||||
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (layer))))
|
||||
{
|
||||
gimp_item_rename (GIMP_ITEM (layer), new_name);
|
||||
gimp_image_flush (dialog->gimage);
|
||||
gimp_image_flush (dialog->image);
|
||||
}
|
||||
|
||||
if (dialog->rename_toggle &&
|
||||
@ -919,13 +919,13 @@ layers_add_mask_response (GtkWidget *widget,
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
{
|
||||
GimpLayer *layer = dialog->layer;
|
||||
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer));
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
|
||||
GimpLayerMask *mask;
|
||||
|
||||
layer_add_mask_type = dialog->add_mask_type;
|
||||
layer_mask_invert = dialog->invert;
|
||||
|
||||
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_ADD_MASK,
|
||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_LAYER_ADD_MASK,
|
||||
_("Add Layer Mask"));
|
||||
|
||||
if (! gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
|
||||
@ -938,9 +938,9 @@ layers_add_mask_response (GtkWidget *widget,
|
||||
|
||||
gimp_layer_add_mask (layer, mask, TRUE);
|
||||
|
||||
gimp_image_undo_group_end (gimage);
|
||||
gimp_image_undo_group_end (image);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (dialog->dialog);
|
||||
@ -958,7 +958,7 @@ layers_scale_layer_callback (GtkWidget *dialog,
|
||||
GimpUnit resolution_unit,/* unused */
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp = GIMP_DISPLAY (data);
|
||||
GimpDisplay *display = GIMP_DISPLAY (data);
|
||||
|
||||
if (width > 0 && height > 0)
|
||||
{
|
||||
@ -975,9 +975,9 @@ layers_scale_layer_callback (GtkWidget *dialog,
|
||||
if (width == gimp_item_width (item) && height == gimp_item_height (item))
|
||||
return;
|
||||
|
||||
if (gdisp)
|
||||
if (display)
|
||||
{
|
||||
progress = GIMP_PROGRESS (gdisp);
|
||||
progress = GIMP_PROGRESS (display);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -25,6 +25,7 @@ all : \
|
||||
|
||||
OBJECTS = \
|
||||
actions.obj \
|
||||
brush-editor-actions.obj \
|
||||
brushes-actions.obj \
|
||||
buffers-actions.obj \
|
||||
buffers-commands.obj \
|
||||
@ -37,6 +38,7 @@ OBJECTS = \
|
||||
cursor-info-actions.obj \
|
||||
cursor-info-commands.obj \
|
||||
data-commands.obj \
|
||||
data-editor-commands.obj \
|
||||
debug-actions.obj \
|
||||
debug-commands.obj \
|
||||
dialogs-actions.obj \
|
||||
@ -95,6 +97,7 @@ OBJECTS = \
|
||||
view-actions.obj \
|
||||
view-commands.obj \
|
||||
window-actions.obj \
|
||||
window-commands.obj \
|
||||
|
||||
|
||||
$(PRJ_TOP)\config.h: $(PRJ_TOP)\config.h.win32
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry palette_editor_actions[] =
|
||||
static const GimpActionEntry palette_editor_actions[] =
|
||||
{
|
||||
{ "palette-editor-popup", GIMP_STOCK_PALETTE,
|
||||
N_("Palette Editor Menu"), NULL, NULL, NULL,
|
||||
@ -57,7 +57,7 @@ static GimpActionEntry palette_editor_actions[] =
|
||||
GIMP_HELP_PALETTE_EDITOR_DELETE }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry palette_editor_toggle_actions[] =
|
||||
static const GimpToggleActionEntry palette_editor_toggle_actions[] =
|
||||
{
|
||||
{ "palette-editor-edit-active", GIMP_STOCK_LINKED,
|
||||
N_("Edit Active Palette"), NULL, NULL,
|
||||
@ -66,22 +66,22 @@ static GimpToggleActionEntry palette_editor_toggle_actions[] =
|
||||
GIMP_HELP_PALETTE_EDITOR_EDIT_ACTIVE }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry palette_editor_new_actions[] =
|
||||
static const GimpEnumActionEntry palette_editor_new_actions[] =
|
||||
{
|
||||
{ "palette-editor-new-color-fg", GTK_STOCK_NEW,
|
||||
N_("New Color from _FG"), "",
|
||||
N_("New color from FG"),
|
||||
N_("New color from foreground color"),
|
||||
FALSE, FALSE,
|
||||
GIMP_HELP_PALETTE_EDITOR_NEW },
|
||||
|
||||
{ "palette-editor-new-color-bg", GTK_STOCK_NEW,
|
||||
N_("New Color from _BG"), "",
|
||||
N_("New color from BG"),
|
||||
N_("New color from background color"),
|
||||
TRUE, FALSE,
|
||||
GIMP_HELP_PALETTE_EDITOR_NEW }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry palette_editor_zoom_actions[] =
|
||||
static const GimpEnumActionEntry palette_editor_zoom_actions[] =
|
||||
{
|
||||
{ "palette-editor-zoom-in", GTK_STOCK_ZOOM_IN,
|
||||
N_("Zoom _In"), "",
|
||||
|
||||
@ -64,7 +64,7 @@ palette_editor_edit_color_cmd_callback (GtkAction *action,
|
||||
if (! editor->color_dialog)
|
||||
{
|
||||
editor->color_dialog =
|
||||
gimp_color_dialog_new (GIMP_VIEWABLE (palette),
|
||||
gimp_color_dialog_new (GIMP_VIEWABLE (palette),
|
||||
_("Edit Palette Color"),
|
||||
GIMP_STOCK_PALETTE,
|
||||
_("Edit Color Palette Entry"),
|
||||
@ -161,10 +161,10 @@ palette_editor_edit_color_update (GimpColorDialog *dialog,
|
||||
|
||||
case GIMP_COLOR_DIALOG_OK:
|
||||
if (editor->color)
|
||||
{
|
||||
editor->color->color = *color;
|
||||
gimp_data_dirty (GIMP_DATA (palette));
|
||||
}
|
||||
{
|
||||
editor->color->color = *color;
|
||||
gimp_data_dirty (GIMP_DATA (palette));
|
||||
}
|
||||
/* Fallthrough */
|
||||
|
||||
case GIMP_COLOR_DIALOG_CANCEL:
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry palettes_actions[] =
|
||||
static const GimpActionEntry palettes_actions[] =
|
||||
{
|
||||
{ "palettes-popup", GIMP_STOCK_PALETTE,
|
||||
N_("Palettes Menu"), NULL, NULL, NULL,
|
||||
@ -87,7 +87,7 @@ static GimpActionEntry palettes_actions[] =
|
||||
GIMP_HELP_PALETTE_REFRESH }
|
||||
};
|
||||
|
||||
static GimpStringActionEntry palettes_edit_actions[] =
|
||||
static const GimpStringActionEntry palettes_edit_actions[] =
|
||||
{
|
||||
{ "palettes-edit", GTK_STOCK_EDIT,
|
||||
N_("_Edit Palette..."), NULL,
|
||||
|
||||
@ -121,21 +121,21 @@ palettes_merge_callback (GtkWidget *widget,
|
||||
palette = (GimpPalette *) GIMP_VIEW (list_item->preview)->viewable;
|
||||
|
||||
if (palette)
|
||||
{
|
||||
for (cols = palette->colors; cols; cols = g_list_next (cols))
|
||||
{
|
||||
entry = (GimpPaletteEntry *) cols->data;
|
||||
{
|
||||
for (cols = palette->colors; cols; cols = g_list_next (cols))
|
||||
{
|
||||
entry = (GimpPaletteEntry *) cols->data;
|
||||
|
||||
gimp_palette_add_entry (new_palette,
|
||||
entry->name,
|
||||
&entry->color);
|
||||
}
|
||||
}
|
||||
gimp_palette_add_entry (new_palette,
|
||||
entry->name,
|
||||
&entry->color);
|
||||
}
|
||||
}
|
||||
|
||||
sel_list = sel_list->next;
|
||||
}
|
||||
|
||||
gimp_container_add (editor->view->container,
|
||||
GIMP_OBJECT (new_palette));
|
||||
GIMP_OBJECT (new_palette));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry patterns_actions[] =
|
||||
static const GimpActionEntry patterns_actions[] =
|
||||
{
|
||||
{ "patterns-popup", GIMP_STOCK_PATTERN,
|
||||
N_("Patterns Menu"), NULL, NULL, NULL,
|
||||
@ -80,7 +80,7 @@ static GimpActionEntry patterns_actions[] =
|
||||
GIMP_HELP_PATTERN_REFRESH }
|
||||
};
|
||||
|
||||
static GimpStringActionEntry patterns_edit_actions[] =
|
||||
static const GimpStringActionEntry patterns_edit_actions[] =
|
||||
{
|
||||
{ "patterns-edit", GTK_STOCK_EDIT,
|
||||
N_("_Edit Pattern..."), NULL,
|
||||
|
||||
@ -27,12 +27,17 @@
|
||||
|
||||
#include "actions-types.h"
|
||||
|
||||
#include "config/gimpcoreconfig.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "plug-in/plug-ins.h"
|
||||
#include "plug-in/plug-in-proc-def.h"
|
||||
#include "pdb/gimppluginprocedure.h"
|
||||
|
||||
#include "plug-in/plug-in-help-domain.h"
|
||||
#include "plug-in/plug-in-locale-domain.h"
|
||||
#include "plug-in/plug-in-menu-branch.h"
|
||||
|
||||
#include "widgets/gimpactiongroup.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
@ -57,9 +62,10 @@ static void plug_in_actions_build_path (GimpActionGroup *group,
|
||||
|
||||
/* private variables */
|
||||
|
||||
static GimpActionEntry plug_in_actions[] =
|
||||
static const GimpActionEntry plug_in_actions[] =
|
||||
{
|
||||
{ "plug-in-menu", NULL, N_("Filte_rs") },
|
||||
{ "plug-in-recent-menu", NULL, N_("Recently Used") },
|
||||
{ "plug-in-blur-menu", NULL, N_("_Blur") },
|
||||
{ "plug-in-noise-menu", NULL, N_("_Noise") },
|
||||
{ "plug-in-edge-detect-menu", NULL, N_("Edge-De_tect") },
|
||||
@ -78,21 +84,24 @@ static GimpActionEntry plug_in_actions[] =
|
||||
{ "plug-in-animation-menu", NULL, N_("An_imation") },
|
||||
|
||||
{ "plug-in-reset-all", GIMP_STOCK_RESET,
|
||||
N_("Reset all _Filters"), NULL, NULL,
|
||||
N_("Reset all _Filters"), NULL,
|
||||
N_("Set all plug-in to their default settings"),
|
||||
G_CALLBACK (plug_in_reset_all_cmd_callback),
|
||||
GIMP_HELP_FILTER_RESET_ALL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry plug_in_repeat_actions[] =
|
||||
static const GimpEnumActionEntry plug_in_repeat_actions[] =
|
||||
{
|
||||
{ "plug-in-repeat", GTK_STOCK_EXECUTE,
|
||||
N_("Re_peat Last"), "<control>F", NULL,
|
||||
FALSE, FALSE,
|
||||
N_("Re_peat Last"), "<control>F",
|
||||
N_("Rerun the last used plug-in using the same settings"),
|
||||
0, FALSE,
|
||||
GIMP_HELP_FILTER_REPEAT },
|
||||
|
||||
{ "plug-in-reshow", GIMP_STOCK_RESHOW_FILTER,
|
||||
N_("R_e-Show Last"), "<control><shift>F", NULL,
|
||||
TRUE, FALSE,
|
||||
N_("R_e-Show Last"), "<control><shift>F",
|
||||
N_("Show the last used plug-in dialog again"),
|
||||
0, FALSE,
|
||||
GIMP_HELP_FILTER_RESHOW }
|
||||
};
|
||||
|
||||
@ -102,7 +111,10 @@ static GimpEnumActionEntry plug_in_repeat_actions[] =
|
||||
void
|
||||
plug_in_actions_setup (GimpActionGroup *group)
|
||||
{
|
||||
GSList *list;
|
||||
GimpEnumActionEntry *entries;
|
||||
GSList *list;
|
||||
gint n_entries;
|
||||
gint i;
|
||||
|
||||
gimp_action_group_add_actions (group,
|
||||
plug_in_actions,
|
||||
@ -125,23 +137,51 @@ plug_in_actions_setup (GimpActionGroup *group)
|
||||
branch->menu_label);
|
||||
}
|
||||
|
||||
for (list = group->gimp->plug_in_proc_defs;
|
||||
for (list = group->gimp->plug_in_procedures;
|
||||
list;
|
||||
list = g_slist_next (list))
|
||||
{
|
||||
PlugInProcDef *proc_def = list->data;
|
||||
GimpPlugInProcedure *proc = list->data;
|
||||
|
||||
if (proc_def->prog &&
|
||||
proc_def->menu_paths &&
|
||||
! proc_def->extensions &&
|
||||
! proc_def->prefixes &&
|
||||
! proc_def->magics)
|
||||
if (proc->prog &&
|
||||
proc->menu_paths &&
|
||||
! proc->extensions &&
|
||||
! proc->prefixes &&
|
||||
! proc->magics)
|
||||
{
|
||||
plug_in_actions_add_proc (group, proc_def);
|
||||
plug_in_actions_add_proc (group, proc);
|
||||
}
|
||||
}
|
||||
|
||||
g_signal_connect_object (group->gimp, "last-plug-in-changed",
|
||||
n_entries = group->gimp->config->plug_in_history_size;
|
||||
|
||||
entries = g_new0 (GimpEnumActionEntry, n_entries);
|
||||
|
||||
for (i = 0; i < n_entries; i++)
|
||||
{
|
||||
entries[i].name = g_strdup_printf ("plug-in-recent-%02d",
|
||||
i + 1);
|
||||
entries[i].stock_id = GIMP_STOCK_RESHOW_FILTER;
|
||||
entries[i].label = "";
|
||||
entries[i].tooltip = NULL;
|
||||
entries[i].value = i;
|
||||
entries[i].value_variable = FALSE;
|
||||
entries[i].help_id = GIMP_HELP_FILTER_RESHOW;
|
||||
entries[i].accelerator = "";
|
||||
}
|
||||
|
||||
gimp_action_group_add_enum_actions (group, entries, n_entries,
|
||||
G_CALLBACK (plug_in_repeat_cmd_callback));
|
||||
|
||||
for (i = 0; i < n_entries; i++)
|
||||
{
|
||||
gimp_action_group_set_action_visible (group, entries[i].name, FALSE);
|
||||
g_free ((gchar *) entries[i].name);
|
||||
}
|
||||
|
||||
g_free (entries);
|
||||
|
||||
g_signal_connect_object (group->gimp, "last-plug-ins-changed",
|
||||
G_CALLBACK (plug_in_actions_last_changed),
|
||||
group, 0);
|
||||
|
||||
@ -152,40 +192,41 @@ void
|
||||
plug_in_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpImageType type = -1;
|
||||
GSList *list;
|
||||
gint i;
|
||||
|
||||
if (gimage)
|
||||
if (image)
|
||||
{
|
||||
GimpDrawable *drawable = gimp_image_active_drawable (gimage);
|
||||
GimpDrawable *drawable = gimp_image_active_drawable (image);
|
||||
|
||||
if (drawable)
|
||||
type = gimp_drawable_type (drawable);
|
||||
}
|
||||
|
||||
for (list = group->gimp->plug_in_proc_defs;
|
||||
for (list = group->gimp->plug_in_procedures;
|
||||
list;
|
||||
list = g_slist_next (list))
|
||||
{
|
||||
PlugInProcDef *proc_def = list->data;
|
||||
GimpPlugInProcedure *proc = list->data;
|
||||
|
||||
if (proc_def->menu_paths &&
|
||||
proc_def->image_types_val &&
|
||||
! proc_def->extensions &&
|
||||
! proc_def->prefixes &&
|
||||
! proc_def->magics)
|
||||
if (proc->menu_paths &&
|
||||
proc->image_types_val &&
|
||||
! proc->extensions &&
|
||||
! proc->prefixes &&
|
||||
! proc->magics)
|
||||
{
|
||||
gboolean sensitive = plug_in_proc_def_get_sensitive (proc_def, type);
|
||||
gboolean sensitive = gimp_plug_in_procedure_get_sensitive (proc, type);
|
||||
|
||||
gimp_action_group_set_action_sensitive (group,
|
||||
proc_def->db_info.name,
|
||||
GIMP_OBJECT (proc)->name,
|
||||
sensitive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (group->gimp->last_plug_in &&
|
||||
plug_in_proc_def_get_sensitive (group->gimp->last_plug_in, type))
|
||||
if (group->gimp->last_plug_ins &&
|
||||
gimp_plug_in_procedure_get_sensitive (group->gimp->last_plug_ins->data, type))
|
||||
{
|
||||
gimp_action_group_set_action_sensitive (group, "plug-in-repeat", TRUE);
|
||||
gimp_action_group_set_action_sensitive (group, "plug-in-reshow", TRUE);
|
||||
@ -195,37 +236,52 @@ plug_in_actions_update (GimpActionGroup *group,
|
||||
gimp_action_group_set_action_sensitive (group, "plug-in-repeat", FALSE);
|
||||
gimp_action_group_set_action_sensitive (group, "plug-in-reshow", FALSE);
|
||||
}
|
||||
|
||||
for (list = group->gimp->last_plug_ins, i = 0; list; list = list->next, i++)
|
||||
{
|
||||
GimpPlugInProcedure *proc = list->data;
|
||||
gchar *name = g_strdup_printf ("plug-in-recent-%02d",
|
||||
i + 1);
|
||||
gboolean sensitive;
|
||||
|
||||
sensitive = gimp_plug_in_procedure_get_sensitive (proc, type);
|
||||
|
||||
gimp_action_group_set_action_sensitive (group, name, sensitive);
|
||||
|
||||
g_free (name);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
plug_in_actions_add_proc (GimpActionGroup *group,
|
||||
PlugInProcDef *proc_def)
|
||||
plug_in_actions_add_proc (GimpActionGroup *group,
|
||||
GimpPlugInProcedure *proc)
|
||||
{
|
||||
GimpPlugInActionEntry entry;
|
||||
const gchar *progname;
|
||||
const gchar *locale_domain;
|
||||
const gchar *help_domain;
|
||||
const gchar *label_translated;
|
||||
const gchar *label;
|
||||
const gchar *tooltip = NULL;
|
||||
gchar *path_original = NULL;
|
||||
gchar *path_translated = NULL;
|
||||
|
||||
g_return_if_fail (GIMP_IS_ACTION_GROUP (group));
|
||||
g_return_if_fail (proc_def != NULL);
|
||||
g_return_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc));
|
||||
|
||||
progname = plug_in_proc_def_get_progname (proc_def);
|
||||
progname = gimp_plug_in_procedure_get_progname (proc);
|
||||
|
||||
locale_domain = plug_ins_locale_domain (group->gimp, progname, NULL);
|
||||
help_domain = plug_ins_help_domain (group->gimp, progname, NULL);
|
||||
locale_domain = plug_in_locale_domain (group->gimp, progname, NULL);
|
||||
help_domain = plug_in_help_domain (group->gimp, progname, NULL);
|
||||
|
||||
if (proc_def->menu_label)
|
||||
if (proc->menu_label)
|
||||
{
|
||||
label_translated = dgettext (locale_domain, proc_def->menu_label);
|
||||
label = dgettext (locale_domain, proc->menu_label);
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *p1, *p2;
|
||||
|
||||
path_original = proc_def->menu_paths->data;
|
||||
path_original = proc->menu_paths->data;
|
||||
path_translated = dgettext (locale_domain, path_original);
|
||||
|
||||
path_original = g_strdup (path_original);
|
||||
@ -241,20 +297,23 @@ plug_in_actions_add_proc (GimpActionGroup *group,
|
||||
*p1 = '\0';
|
||||
*p2 = '\0';
|
||||
|
||||
label_translated = p2 + 1;
|
||||
label = p2 + 1;
|
||||
}
|
||||
|
||||
entry.name = proc_def->db_info.name;
|
||||
entry.stock_id = plug_in_proc_def_get_stock_id (proc_def);
|
||||
entry.label = label_translated;
|
||||
if (GIMP_PROCEDURE (proc)->blurb)
|
||||
tooltip = dgettext (locale_domain, GIMP_PROCEDURE (proc)->blurb);
|
||||
|
||||
entry.name = GIMP_OBJECT (proc)->name;
|
||||
entry.stock_id = gimp_plug_in_procedure_get_stock_id (proc);
|
||||
entry.label = label;
|
||||
entry.accelerator = NULL;
|
||||
entry.tooltip = NULL;
|
||||
entry.proc_def = proc_def;
|
||||
entry.help_id = plug_in_proc_def_get_help_id (proc_def, help_domain);
|
||||
entry.tooltip = tooltip;
|
||||
entry.procedure = proc;
|
||||
entry.help_id = gimp_plug_in_procedure_get_help_id (proc, help_domain);
|
||||
|
||||
#if 0
|
||||
g_print ("adding plug-in action '%s' (%s)\n",
|
||||
proc_def->db_info.name, label_translated);
|
||||
GIMP_OBJECT (proc)->name, label);
|
||||
#endif
|
||||
|
||||
gimp_action_group_add_plug_in_actions (group, &entry, 1,
|
||||
@ -262,11 +321,11 @@ plug_in_actions_add_proc (GimpActionGroup *group,
|
||||
|
||||
g_free ((gchar *) entry.help_id);
|
||||
|
||||
if (proc_def->menu_label)
|
||||
if (proc->menu_label)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
for (list = proc_def->menu_paths; list; list = g_list_next (list))
|
||||
for (list = proc->menu_paths; list; list = g_list_next (list))
|
||||
{
|
||||
const gchar *original = list->data;
|
||||
const gchar *translated = dgettext (locale_domain, original);
|
||||
@ -287,21 +346,21 @@ plug_in_actions_add_proc (GimpActionGroup *group,
|
||||
}
|
||||
|
||||
void
|
||||
plug_in_actions_add_path (GimpActionGroup *group,
|
||||
PlugInProcDef *proc_def,
|
||||
const gchar *menu_path)
|
||||
plug_in_actions_add_path (GimpActionGroup *group,
|
||||
GimpPlugInProcedure *proc,
|
||||
const gchar *menu_path)
|
||||
{
|
||||
const gchar *progname;
|
||||
const gchar *locale_domain;
|
||||
const gchar *path_translated;
|
||||
|
||||
g_return_if_fail (GIMP_IS_ACTION_GROUP (group));
|
||||
g_return_if_fail (proc_def != NULL);
|
||||
g_return_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc));
|
||||
g_return_if_fail (menu_path != NULL);
|
||||
|
||||
progname = plug_in_proc_def_get_progname (proc_def);
|
||||
progname = gimp_plug_in_procedure_get_progname (proc);
|
||||
|
||||
locale_domain = plug_ins_locale_domain (group->gimp, progname, NULL);
|
||||
locale_domain = plug_in_locale_domain (group->gimp, progname, NULL);
|
||||
|
||||
path_translated = dgettext (locale_domain, menu_path);
|
||||
|
||||
@ -312,22 +371,22 @@ plug_in_actions_add_path (GimpActionGroup *group,
|
||||
}
|
||||
|
||||
void
|
||||
plug_in_actions_remove_proc (GimpActionGroup *group,
|
||||
PlugInProcDef *proc_def)
|
||||
plug_in_actions_remove_proc (GimpActionGroup *group,
|
||||
GimpPlugInProcedure *proc)
|
||||
{
|
||||
GtkAction *action;
|
||||
|
||||
g_return_if_fail (GIMP_IS_ACTION_GROUP (group));
|
||||
g_return_if_fail (proc_def != NULL);
|
||||
g_return_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc));
|
||||
|
||||
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
|
||||
proc_def->db_info.name);
|
||||
GIMP_OBJECT (proc)->name);
|
||||
|
||||
if (action)
|
||||
{
|
||||
#if 0
|
||||
g_print ("removing plug-in action '%s'\n",
|
||||
proc_def->db_info.name);
|
||||
GIMP_OBJECT (proc)->name);
|
||||
#endif
|
||||
|
||||
gtk_action_group_remove_action (GTK_ACTION_GROUP (group), action);
|
||||
@ -350,7 +409,7 @@ plug_in_actions_add_branch (GimpActionGroup *group,
|
||||
g_return_if_fail (menu_path != NULL);
|
||||
g_return_if_fail (menu_label != NULL);
|
||||
|
||||
locale_domain = plug_ins_locale_domain (group->gimp, progname, NULL);
|
||||
locale_domain = plug_in_locale_domain (group->gimp, progname, NULL);
|
||||
|
||||
path_translated = dgettext (locale_domain, menu_path);
|
||||
label_translated = dgettext (locale_domain, menu_label);
|
||||
@ -374,19 +433,22 @@ static void
|
||||
plug_in_actions_last_changed (Gimp *gimp,
|
||||
GimpActionGroup *group)
|
||||
{
|
||||
if (gimp->last_plug_in)
|
||||
GSList *list;
|
||||
const gchar *progname;
|
||||
const gchar *domain;
|
||||
gint i;
|
||||
|
||||
if (gimp->last_plug_ins)
|
||||
{
|
||||
PlugInProcDef *proc_def = gimp->last_plug_in;
|
||||
const gchar *progname;
|
||||
const gchar *domain;
|
||||
gchar *label;
|
||||
gchar *repeat;
|
||||
gchar *reshow;
|
||||
GimpPlugInProcedure *proc = gimp->last_plug_ins->data;
|
||||
gchar *label;
|
||||
gchar *repeat;
|
||||
gchar *reshow;
|
||||
|
||||
progname = plug_in_proc_def_get_progname (proc_def);
|
||||
domain = plug_ins_locale_domain (gimp, progname, NULL);
|
||||
progname = gimp_plug_in_procedure_get_progname (proc);
|
||||
domain = plug_in_locale_domain (gimp, progname, NULL);
|
||||
|
||||
label = plug_in_proc_def_get_label (proc_def, domain);
|
||||
label = gimp_plug_in_procedure_get_label (proc, domain);
|
||||
|
||||
repeat = g_strdup_printf (_("Re_peat \"%s\""), label);
|
||||
reshow = g_strdup_printf (_("R_e-Show \"%s\""), label);
|
||||
@ -407,7 +469,45 @@ plug_in_actions_last_changed (Gimp *gimp,
|
||||
_("Re-Show Last"));
|
||||
}
|
||||
|
||||
/* update sensitivity of the "plug-in-repeat" and "plug-in-reshow" actions */
|
||||
for (list = gimp->last_plug_ins, i = 0; list; list = list->next, i++)
|
||||
{
|
||||
GtkAction *action;
|
||||
GimpPlugInProcedure *proc = list->data;
|
||||
gchar *name = g_strdup_printf ("plug-in-recent-%02d",
|
||||
i + 1);
|
||||
gchar *label;
|
||||
|
||||
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), name);
|
||||
g_free (name);
|
||||
|
||||
progname = gimp_plug_in_procedure_get_progname (proc);
|
||||
domain = plug_in_locale_domain (gimp, progname, NULL);
|
||||
|
||||
label = gimp_plug_in_procedure_get_label (proc, domain);
|
||||
|
||||
g_object_set (action,
|
||||
"label", label,
|
||||
"visible", TRUE,
|
||||
"stock-id", gimp_plug_in_procedure_get_stock_id (proc),
|
||||
NULL);
|
||||
|
||||
g_free (label);
|
||||
}
|
||||
|
||||
for (; i < gimp->config->plug_in_history_size; i++)
|
||||
{
|
||||
GtkAction *action;
|
||||
gchar *name = g_strdup_printf ("plug-in-recent-%02d", i + 1);
|
||||
|
||||
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), name);
|
||||
g_free (name);
|
||||
|
||||
g_object_set (action,
|
||||
"visible", FALSE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* update sensitivity of the actions */
|
||||
plug_in_actions_update (group, gimp);
|
||||
}
|
||||
|
||||
|
||||
@ -20,22 +20,22 @@
|
||||
#define __PLUG_IN_ACTIONS_H__
|
||||
|
||||
|
||||
void plug_in_actions_setup (GimpActionGroup *group);
|
||||
void plug_in_actions_update (GimpActionGroup *group,
|
||||
gpointer data);
|
||||
void plug_in_actions_setup (GimpActionGroup *group);
|
||||
void plug_in_actions_update (GimpActionGroup *group,
|
||||
gpointer data);
|
||||
|
||||
void plug_in_actions_add_proc (GimpActionGroup *group,
|
||||
PlugInProcDef *proc_def);
|
||||
void plug_in_actions_add_path (GimpActionGroup *group,
|
||||
PlugInProcDef *proc_def,
|
||||
const gchar *menu_path);
|
||||
void plug_in_actions_remove_proc (GimpActionGroup *group,
|
||||
PlugInProcDef *proc_def);
|
||||
void plug_in_actions_add_proc (GimpActionGroup *group,
|
||||
GimpPlugInProcedure *proc);
|
||||
void plug_in_actions_add_path (GimpActionGroup *group,
|
||||
GimpPlugInProcedure *proc,
|
||||
const gchar *menu_path);
|
||||
void plug_in_actions_remove_proc (GimpActionGroup *group,
|
||||
GimpPlugInProcedure *proc);
|
||||
|
||||
void plug_in_actions_add_branch (GimpActionGroup *group,
|
||||
const gchar *progname,
|
||||
const gchar *menu_path,
|
||||
const gchar *menu_label);
|
||||
void plug_in_actions_add_branch (GimpActionGroup *group,
|
||||
const gchar *progname,
|
||||
const gchar *menu_path,
|
||||
const gchar *menu_label);
|
||||
|
||||
|
||||
#endif /* __PLUG_IN_ACTIONS_H__ */
|
||||
|
||||
@ -18,6 +18,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
@ -25,15 +27,16 @@
|
||||
#include "actions-types.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimp-utils.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpitem.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
#include "core/gimpprogress.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
#include "plug-in/plug-in-data.h"
|
||||
|
||||
#include "plug-in/plug-in-run.h"
|
||||
#include "plug-in/plug-in-proc-def.h"
|
||||
#include "pdb/gimpprocedure.h"
|
||||
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
#include "widgets/gimpmessagebox.h"
|
||||
@ -57,97 +60,85 @@ static void plug_in_reset_all_response (GtkWidget *dialog,
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
plug_in_run_cmd_callback (GtkAction *action,
|
||||
PlugInProcDef *proc_def,
|
||||
gpointer data)
|
||||
plug_in_run_cmd_callback (GtkAction *action,
|
||||
GimpPlugInProcedure *proc,
|
||||
gpointer data)
|
||||
{
|
||||
GimpProcedure *procedure = GIMP_PROCEDURE (proc);
|
||||
Gimp *gimp;
|
||||
ProcRecord *proc_rec;
|
||||
Argument *args;
|
||||
gint n_args = 0;
|
||||
GimpDisplay *gdisp = NULL;
|
||||
gint i;
|
||||
GValueArray *args;
|
||||
gint n_args = 0;
|
||||
GimpDisplay *display = NULL;
|
||||
return_if_no_gimp (gimp, data);
|
||||
|
||||
gimp = action_data_get_gimp (data);
|
||||
if (! gimp)
|
||||
return;
|
||||
|
||||
proc_rec = &proc_def->db_info;
|
||||
|
||||
/* construct the procedures arguments */
|
||||
args = g_new0 (Argument, proc_rec->num_args);
|
||||
|
||||
/* initialize the argument types */
|
||||
for (i = 0; i < proc_rec->num_args; i++)
|
||||
args[i].arg_type = proc_rec->args[i].arg_type;
|
||||
args = gimp_procedure_get_arguments (procedure);
|
||||
|
||||
/* initialize the first argument */
|
||||
args[n_args].value.pdb_int = GIMP_RUN_INTERACTIVE;
|
||||
g_value_set_int (&args->values[n_args], GIMP_RUN_INTERACTIVE);
|
||||
n_args++;
|
||||
|
||||
switch (proc_rec->proc_type)
|
||||
switch (procedure->proc_type)
|
||||
{
|
||||
case GIMP_EXTENSION:
|
||||
break;
|
||||
|
||||
case GIMP_PLUGIN:
|
||||
case GIMP_TEMPORARY:
|
||||
if (proc_rec->num_args > n_args &&
|
||||
proc_rec->args[n_args].arg_type == GIMP_PDB_IMAGE)
|
||||
if (args->n_values > n_args &&
|
||||
GIMP_VALUE_HOLDS_IMAGE_ID (&args->values[n_args]))
|
||||
{
|
||||
gdisp = action_data_get_display (data);
|
||||
display = action_data_get_display (data);
|
||||
|
||||
if (gdisp)
|
||||
if (display)
|
||||
{
|
||||
args[n_args].value.pdb_int = gimp_image_get_ID (gdisp->gimage);
|
||||
gimp_value_set_image (&args->values[n_args], display->image);
|
||||
n_args++;
|
||||
|
||||
if (proc_rec->num_args > n_args &&
|
||||
proc_rec->args[n_args].arg_type == GIMP_PDB_DRAWABLE)
|
||||
if (args->n_values > n_args &&
|
||||
GIMP_VALUE_HOLDS_DRAWABLE_ID (&args->values[n_args]));
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
drawable = gimp_image_active_drawable (display->image);
|
||||
|
||||
if (drawable)
|
||||
{
|
||||
args[n_args].value.pdb_int =
|
||||
gimp_item_get_ID (GIMP_ITEM (drawable));
|
||||
gimp_value_set_drawable (&args->values[n_args], drawable);
|
||||
n_args++;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Uh-oh, no active drawable for the plug-in!");
|
||||
g_free (args);
|
||||
return;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
g_error ("Unknown procedure type.");
|
||||
g_free (args);
|
||||
return;
|
||||
goto error;
|
||||
}
|
||||
|
||||
gimp_value_array_truncate (args, n_args);
|
||||
|
||||
/* run the plug-in procedure */
|
||||
plug_in_run (gimp, gimp_get_user_context (gimp),
|
||||
GIMP_PROGRESS (gdisp),
|
||||
proc_rec, args, n_args, FALSE, TRUE,
|
||||
gdisp ? gimp_display_get_ID (gdisp) : -1);
|
||||
gimp_procedure_execute_async (procedure, gimp, gimp_get_user_context (gimp),
|
||||
GIMP_PROGRESS (display), args,
|
||||
display ? gimp_display_get_ID (display) : -1);
|
||||
|
||||
/* remember only "standard" plug-ins */
|
||||
if (proc_rec->proc_type == GIMP_PLUGIN &&
|
||||
proc_rec->num_args >= 3 &&
|
||||
proc_rec->args[1].arg_type == GIMP_PDB_IMAGE &&
|
||||
proc_rec->args[2].arg_type == GIMP_PDB_DRAWABLE)
|
||||
if (procedure->proc_type == GIMP_PLUGIN &&
|
||||
procedure->num_args >= 3 &&
|
||||
GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->args[1]) &&
|
||||
GIMP_IS_PARAM_SPEC_DRAWABLE_ID (procedure->args[2]))
|
||||
{
|
||||
gimp_set_last_plug_in (gimp, proc_def);
|
||||
gimp_set_last_plug_in (gimp, proc);
|
||||
}
|
||||
|
||||
g_free (args);
|
||||
error:
|
||||
g_value_array_free (args);
|
||||
}
|
||||
|
||||
void
|
||||
@ -155,38 +146,50 @@ plug_in_repeat_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDrawable *drawable;
|
||||
gboolean interactive;
|
||||
GimpProcedure *procedure;
|
||||
Gimp *gimp;
|
||||
GimpDisplay *display;
|
||||
GimpDrawable *drawable;
|
||||
gboolean interactive = TRUE;
|
||||
return_if_no_gimp (gimp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
gdisp = action_data_get_display (data);
|
||||
if (! gdisp)
|
||||
return;
|
||||
|
||||
drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
drawable = gimp_image_active_drawable (display->image);
|
||||
if (! drawable)
|
||||
return;
|
||||
|
||||
interactive = value ? TRUE : FALSE;
|
||||
if (strcmp (gtk_action_get_name (action), "plug-in-repeat") == 0)
|
||||
interactive = FALSE;
|
||||
|
||||
plug_in_repeat (gdisp->gimage->gimp,
|
||||
gimp_get_user_context (gdisp->gimage->gimp),
|
||||
GIMP_PROGRESS (gdisp),
|
||||
gimp_display_get_ID (gdisp),
|
||||
gimp_image_get_ID (gdisp->gimage),
|
||||
gimp_item_get_ID (GIMP_ITEM (drawable)),
|
||||
interactive);
|
||||
procedure = g_slist_nth_data (gimp->last_plug_ins, value);
|
||||
|
||||
if (procedure)
|
||||
{
|
||||
GValueArray *args = gimp_procedure_get_arguments (procedure);
|
||||
|
||||
g_value_set_int (&args->values[0],
|
||||
interactive ?
|
||||
GIMP_RUN_INTERACTIVE : GIMP_RUN_WITH_LAST_VALS);
|
||||
gimp_value_set_image (&args->values[1], display->image);
|
||||
gimp_value_set_drawable (&args->values[2], drawable);
|
||||
|
||||
/* run the plug-in procedure */
|
||||
gimp_procedure_execute_async (procedure, gimp,
|
||||
gimp_get_user_context (gimp),
|
||||
GIMP_PROGRESS (display), args,
|
||||
gimp_display_get_ID (display));
|
||||
|
||||
g_value_array_free (args);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
plug_in_reset_all_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
Gimp *gimp = action_data_get_gimp (data);
|
||||
Gimp *gimp;
|
||||
GtkWidget *dialog;
|
||||
|
||||
if (! gimp)
|
||||
return;
|
||||
return_if_no_gimp (gimp, data);
|
||||
|
||||
dialog = gimp_message_dialog_new (_("Reset all Filters"), GIMP_STOCK_QUESTION,
|
||||
NULL, 0,
|
||||
@ -224,5 +227,5 @@ plug_in_reset_all_response (GtkWidget *dialog,
|
||||
gtk_widget_destroy (dialog);
|
||||
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
procedural_db_free_data (gimp);
|
||||
plug_in_data_free (gimp);
|
||||
}
|
||||
|
||||
@ -20,15 +20,15 @@
|
||||
#define __PLUG_IN_COMMANDS_H__
|
||||
|
||||
|
||||
void plug_in_run_cmd_callback (GtkAction *action,
|
||||
PlugInProcDef *proc_def,
|
||||
gpointer data);
|
||||
void plug_in_repeat_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data);
|
||||
void plug_in_run_cmd_callback (GtkAction *action,
|
||||
GimpPlugInProcedure *proc,
|
||||
gpointer data);
|
||||
void plug_in_repeat_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data);
|
||||
|
||||
void plug_in_reset_all_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void plug_in_reset_all_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
|
||||
|
||||
#endif /* __PLUG_IN_COMMANDS_H__ */
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry quick_mask_actions[] =
|
||||
static const GimpActionEntry quick_mask_actions[] =
|
||||
{
|
||||
{ "quick-mask-popup", NULL,
|
||||
N_("Quick Mask Menu"), NULL, NULL, NULL,
|
||||
@ -48,7 +48,7 @@ static GimpActionEntry quick_mask_actions[] =
|
||||
GIMP_HELP_QUICK_MASK_EDIT }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry quick_mask_toggle_actions[] =
|
||||
static const GimpToggleActionEntry quick_mask_toggle_actions[] =
|
||||
{
|
||||
{ "quick-mask-toggle", GIMP_STOCK_QUICK_MASK_ON,
|
||||
N_("Toggle _Quick Mask"), "<shift>Q", N_("Toggle Quick Mask"),
|
||||
@ -57,7 +57,7 @@ static GimpToggleActionEntry quick_mask_toggle_actions[] =
|
||||
GIMP_HELP_QUICK_MASK_TOGGLE }
|
||||
};
|
||||
|
||||
static GimpRadioActionEntry quick_mask_invert_actions[] =
|
||||
static const GimpRadioActionEntry quick_mask_invert_actions[] =
|
||||
{
|
||||
{ "quick-mask-invert-on", NULL,
|
||||
N_("Mask _Selected Areas"), NULL, NULL,
|
||||
@ -94,7 +94,7 @@ void
|
||||
quick_mask_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
|
||||
#define SET_SENSITIVE(action,sensitive) \
|
||||
gimp_action_group_set_action_sensitive (group, action, (sensitive) != 0)
|
||||
@ -103,21 +103,21 @@ quick_mask_actions_update (GimpActionGroup *group,
|
||||
#define SET_COLOR(action,color) \
|
||||
gimp_action_group_set_action_color (group, action, (color), FALSE)
|
||||
|
||||
SET_SENSITIVE ("quick-mask-toggle", gimage);
|
||||
SET_ACTIVE ("quick-mask-toggle", gimage && gimage->quick_mask_state);
|
||||
SET_SENSITIVE ("quick-mask-toggle", image);
|
||||
SET_ACTIVE ("quick-mask-toggle", image && image->quick_mask_state);
|
||||
|
||||
SET_SENSITIVE ("quick-mask-invert-on", gimage);
|
||||
SET_SENSITIVE ("quick-mask-invert-off", gimage);
|
||||
SET_SENSITIVE ("quick-mask-invert-on", image);
|
||||
SET_SENSITIVE ("quick-mask-invert-off", image);
|
||||
|
||||
if (gimage && gimage->quick_mask_inverted)
|
||||
if (image && image->quick_mask_inverted)
|
||||
SET_ACTIVE ("quick-mask-invert-on", TRUE);
|
||||
else
|
||||
SET_ACTIVE ("quick-mask-invert-off", TRUE);
|
||||
|
||||
SET_SENSITIVE ("quick-mask-configure", gimage);
|
||||
SET_SENSITIVE ("quick-mask-configure", image);
|
||||
|
||||
if (gimage)
|
||||
SET_COLOR ("quick-mask-configure", &gimage->quick_mask_color);
|
||||
if (image)
|
||||
SET_COLOR ("quick-mask-configure", &image->quick_mask_color);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
#undef SET_ACTIVE
|
||||
|
||||
@ -53,16 +53,16 @@ void
|
||||
quick_mask_toggle_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
gboolean active;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
if (active != gimp_image_get_quick_mask_state (gimage))
|
||||
if (active != gimp_image_get_quick_mask_state (image))
|
||||
{
|
||||
gimp_image_set_quick_mask_state (gimage, active);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_set_quick_mask_state (image, active);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,16 +71,16 @@ quick_mask_invert_cmd_callback (GtkAction *action,
|
||||
GtkAction *current,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
gint value;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
|
||||
|
||||
if (value != gimage->quick_mask_inverted)
|
||||
if (value != image->quick_mask_inverted)
|
||||
{
|
||||
gimp_image_quick_mask_invert (gimage);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_quick_mask_invert (image);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,15 +89,15 @@ quick_mask_configure_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
ChannelOptionsDialog *options;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
GimpRGB color;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
gimp_image_get_quick_mask_color (gimage, &color);
|
||||
gimp_image_get_quick_mask_color (image, &color);
|
||||
|
||||
options = channel_options_dialog_new (gimage,
|
||||
options = channel_options_dialog_new (image,
|
||||
action_data_get_context (data),
|
||||
NULL,
|
||||
widget,
|
||||
@ -110,7 +110,7 @@ quick_mask_configure_cmd_callback (GtkAction *action,
|
||||
GIMP_HELP_QUICK_MASK_EDIT,
|
||||
_("Edit Quick Mask Color"),
|
||||
_("_Mask opacity:"),
|
||||
FALSE);
|
||||
FALSE);
|
||||
|
||||
g_signal_connect (options->dialog, "response",
|
||||
G_CALLBACK (quick_mask_configure_response),
|
||||
@ -132,15 +132,15 @@ quick_mask_configure_response (GtkWidget *widget,
|
||||
GimpRGB old_color;
|
||||
GimpRGB new_color;
|
||||
|
||||
gimp_image_get_quick_mask_color (options->gimage, &old_color);
|
||||
gimp_image_get_quick_mask_color (options->image, &old_color);
|
||||
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
|
||||
&new_color);
|
||||
|
||||
if (gimp_rgba_distance (&old_color, &new_color) > 0.0001)
|
||||
{
|
||||
gimp_image_set_quick_mask_color (options->gimage, &new_color);
|
||||
gimp_image_set_quick_mask_color (options->image, &new_color);
|
||||
|
||||
gimp_image_flush (options->gimage);
|
||||
gimp_image_flush (options->image);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,14 +34,14 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry sample_point_editor_actions[] =
|
||||
static const GimpActionEntry sample_point_editor_actions[] =
|
||||
{
|
||||
{ "sample-point-editor-popup", GIMP_STOCK_SAMPLE_POINT,
|
||||
N_("Sample Point Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_SAMPLE_POINT_DIALOG }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry sample_point_editor_toggle_actions[] =
|
||||
static const GimpToggleActionEntry sample_point_editor_toggle_actions[] =
|
||||
{
|
||||
{ "sample-point-editor-sample-merged", NULL,
|
||||
N_("_Sample Merged"), "",
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry select_actions[] =
|
||||
static const GimpActionEntry select_actions[] =
|
||||
{
|
||||
{ "selection-editor-popup", GIMP_STOCK_TOOL_RECT_SELECT,
|
||||
N_("Selection Editor Menu"), NULL, NULL, NULL,
|
||||
@ -48,67 +48,73 @@ static GimpActionEntry select_actions[] =
|
||||
|
||||
{ "select-all", GIMP_STOCK_SELECTION_ALL,
|
||||
N_("_All"), "<control>A",
|
||||
N_("Select all"),
|
||||
N_("Select everything"),
|
||||
G_CALLBACK (select_all_cmd_callback),
|
||||
GIMP_HELP_SELECTION_ALL },
|
||||
|
||||
{ "select-none", GIMP_STOCK_SELECTION_NONE,
|
||||
N_("_None"), "<control><shift>A",
|
||||
N_("Select none"),
|
||||
N_("Dismiss the selection"),
|
||||
G_CALLBACK (select_none_cmd_callback),
|
||||
GIMP_HELP_SELECTION_NONE },
|
||||
|
||||
{ "select-invert", GIMP_STOCK_INVERT,
|
||||
N_("_Invert"), "<control>I",
|
||||
N_("Invert selection"),
|
||||
N_("Invert the selection"),
|
||||
G_CALLBACK (select_invert_cmd_callback),
|
||||
GIMP_HELP_SELECTION_INVERT },
|
||||
|
||||
{ "select-float", GIMP_STOCK_FLOATING_SELECTION,
|
||||
N_("_Float"), "<control><shift>L", NULL,
|
||||
N_("_Float"), "<control><shift>L",
|
||||
N_("Create a floating selection"),
|
||||
G_CALLBACK (select_float_cmd_callback),
|
||||
GIMP_HELP_SELECTION_FLOAT },
|
||||
|
||||
{ "select-feather", NULL,
|
||||
N_("Fea_ther..."), NULL, NULL,
|
||||
N_("Fea_ther..."), NULL,
|
||||
N_("Blur the selection border so that it fades out smoothly"),
|
||||
G_CALLBACK (select_feather_cmd_callback),
|
||||
GIMP_HELP_SELECTION_FEATHER },
|
||||
|
||||
{ "select-sharpen", NULL,
|
||||
N_("_Sharpen"), NULL, NULL,
|
||||
N_("_Sharpen"), NULL,
|
||||
N_("Remove fuzzyness from the selection"),
|
||||
G_CALLBACK (select_sharpen_cmd_callback),
|
||||
GIMP_HELP_SELECTION_SHARPEN },
|
||||
|
||||
{ "select-shrink", GIMP_STOCK_SELECTION_SHRINK,
|
||||
N_("S_hrink..."), NULL, NULL,
|
||||
N_("S_hrink..."), NULL,
|
||||
N_("Contract the selection"),
|
||||
G_CALLBACK (select_shrink_cmd_callback),
|
||||
GIMP_HELP_SELECTION_SHRINK },
|
||||
|
||||
{ "select-grow", GIMP_STOCK_SELECTION_GROW,
|
||||
N_("_Grow..."), NULL, NULL,
|
||||
N_("_Grow..."), NULL,
|
||||
N_("Enlarge the selection"),
|
||||
G_CALLBACK (select_grow_cmd_callback),
|
||||
GIMP_HELP_SELECTION_GROW },
|
||||
|
||||
{ "select-border", GIMP_STOCK_SELECTION_BORDER,
|
||||
N_("Bo_rder..."), NULL, NULL,
|
||||
N_("Bo_rder..."), NULL,
|
||||
N_("Replace the selection by its border"),
|
||||
G_CALLBACK (select_border_cmd_callback),
|
||||
GIMP_HELP_SELECTION_BORDER },
|
||||
|
||||
{ "select-save", GIMP_STOCK_SELECTION_TO_CHANNEL,
|
||||
N_("Save to _Channel"), NULL,
|
||||
N_("Save selection to channel"),
|
||||
N_("Save the selection to a channel"),
|
||||
G_CALLBACK (select_save_cmd_callback),
|
||||
GIMP_HELP_SELECTION_TO_CHANNEL },
|
||||
|
||||
{ "select-stroke", GIMP_STOCK_SELECTION_STROKE,
|
||||
N_("_Stroke Selection..."), NULL,
|
||||
N_("Stroke selection..."),
|
||||
N_("Paint along the selection outline"),
|
||||
G_CALLBACK (select_stroke_cmd_callback),
|
||||
GIMP_HELP_SELECTION_STROKE },
|
||||
|
||||
{ "select-stroke-last-values", GIMP_STOCK_SELECTION_STROKE,
|
||||
N_("_Stroke Selection"), NULL,
|
||||
N_("Stroke selection with last values"),
|
||||
N_("Stroke the selection with last used values"),
|
||||
G_CALLBACK (select_stroke_last_vals_cmd_callback),
|
||||
GIMP_HELP_SELECTION_STROKE }
|
||||
};
|
||||
@ -126,17 +132,17 @@ void
|
||||
select_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpDrawable *drawable = NULL;
|
||||
gboolean fs = FALSE;
|
||||
gboolean sel = FALSE;
|
||||
|
||||
if (gimage)
|
||||
if (image)
|
||||
{
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
drawable = gimp_image_active_drawable (image);
|
||||
|
||||
fs = (gimp_image_floating_sel (gimage) != NULL);
|
||||
sel = ! gimp_channel_is_empty (gimp_image_get_mask (gimage));
|
||||
fs = (gimp_image_floating_sel (image) != NULL);
|
||||
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
|
||||
}
|
||||
|
||||
#define SET_SENSITIVE(action,condition) \
|
||||
|
||||
@ -82,69 +82,69 @@ void
|
||||
select_invert_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpImage *image;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
gimp_channel_invert (gimp_image_get_mask (gimage), TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_channel_invert (gimp_image_get_mask (image), TRUE);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
select_all_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpImage *image;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
gimp_channel_all (gimp_image_get_mask (gimage), TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_channel_all (gimp_image_get_mask (image), TRUE);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
select_none_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpImage *image;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
select_float_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpImage *image;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
gimp_selection_float (gimp_image_get_mask (gimage),
|
||||
gimp_image_active_drawable (gimage),
|
||||
gimp_selection_float (gimp_image_get_mask (image),
|
||||
gimp_image_active_drawable (image),
|
||||
action_data_get_context (data),
|
||||
TRUE, 0, 0);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
select_feather_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
dialog = gimp_query_size_box (_("Feather Selection"),
|
||||
gdisp->shell,
|
||||
display->shell,
|
||||
gimp_standard_help_func,
|
||||
GIMP_HELP_SELECTION_FEATHER,
|
||||
_("Feather selection by"),
|
||||
select_feather_radius, 0, 32767, 3,
|
||||
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
||||
MIN (gdisp->gimage->xresolution,
|
||||
gdisp->gimage->yresolution),
|
||||
GIMP_DISPLAY_SHELL (display->shell)->unit,
|
||||
MIN (display->image->xresolution,
|
||||
display->image->yresolution),
|
||||
FALSE,
|
||||
G_OBJECT (gdisp->gimage), "disconnect",
|
||||
select_feather_callback, gdisp->gimage);
|
||||
G_OBJECT (display->image), "disconnect",
|
||||
select_feather_callback, display->image);
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
@ -152,34 +152,34 @@ void
|
||||
select_sharpen_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpImage *image;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
gimp_channel_sharpen (gimp_image_get_mask (gimage), TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_channel_sharpen (gimp_image_get_mask (image), TRUE);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
select_shrink_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *edge_lock;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
dialog = gimp_query_size_box (_("Shrink Selection"),
|
||||
gdisp->shell,
|
||||
display->shell,
|
||||
gimp_standard_help_func,
|
||||
GIMP_HELP_SELECTION_SHRINK,
|
||||
_("Shrink selection by"),
|
||||
select_shrink_pixels, 1, 32767, 0,
|
||||
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
||||
MIN (gdisp->gimage->xresolution,
|
||||
gdisp->gimage->yresolution),
|
||||
GIMP_DISPLAY_SHELL (display->shell)->unit,
|
||||
MIN (display->image->xresolution,
|
||||
display->image->yresolution),
|
||||
FALSE,
|
||||
G_OBJECT (gdisp->gimage), "disconnect",
|
||||
select_shrink_callback, gdisp->gimage);
|
||||
G_OBJECT (display->image), "disconnect",
|
||||
select_shrink_callback, display->image);
|
||||
|
||||
edge_lock = gtk_check_button_new_with_label (_("Shrink from image border"));
|
||||
|
||||
@ -198,22 +198,22 @@ void
|
||||
select_grow_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
dialog = gimp_query_size_box (_("Grow Selection"),
|
||||
gdisp->shell,
|
||||
display->shell,
|
||||
gimp_standard_help_func,
|
||||
GIMP_HELP_SELECTION_GROW,
|
||||
_("Grow selection by"),
|
||||
select_grow_pixels, 1, 32767, 0,
|
||||
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
||||
MIN (gdisp->gimage->xresolution,
|
||||
gdisp->gimage->yresolution),
|
||||
GIMP_DISPLAY_SHELL (display->shell)->unit,
|
||||
MIN (display->image->xresolution,
|
||||
display->image->yresolution),
|
||||
FALSE,
|
||||
G_OBJECT (gdisp->gimage), "disconnect",
|
||||
select_grow_callback, gdisp->gimage);
|
||||
G_OBJECT (display->image), "disconnect",
|
||||
select_grow_callback, display->image);
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
@ -221,22 +221,22 @@ void
|
||||
select_border_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
dialog = gimp_query_size_box (_("Border Selection"),
|
||||
gdisp->shell,
|
||||
display->shell,
|
||||
gimp_standard_help_func,
|
||||
GIMP_HELP_SELECTION_BORDER,
|
||||
_("Border selection by"),
|
||||
select_border_radius, 1, 32767, 0,
|
||||
GIMP_DISPLAY_SHELL (gdisp->shell)->unit,
|
||||
MIN (gdisp->gimage->xresolution,
|
||||
gdisp->gimage->yresolution),
|
||||
GIMP_DISPLAY_SHELL (display->shell)->unit,
|
||||
MIN (display->image->xresolution,
|
||||
display->image->yresolution),
|
||||
FALSE,
|
||||
G_OBJECT (gdisp->gimage), "disconnect",
|
||||
select_border_callback, gdisp->gimage);
|
||||
G_OBJECT (display->image), "disconnect",
|
||||
select_border_callback, display->image);
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
@ -244,13 +244,13 @@ void
|
||||
select_save_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
gimp_selection_save (gimp_image_get_mask (gimage));
|
||||
gimp_image_flush (gimage);
|
||||
gimp_selection_save (gimp_image_get_mask (image));
|
||||
gimp_image_flush (image);
|
||||
|
||||
gimp_dialog_factory_dialog_raise (global_dock_factory,
|
||||
gtk_widget_get_screen (widget),
|
||||
@ -261,14 +261,14 @@ void
|
||||
select_stroke_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpDrawable *drawable;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
drawable = gimp_image_active_drawable (image);
|
||||
|
||||
if (! drawable)
|
||||
{
|
||||
@ -276,7 +276,7 @@ select_stroke_cmd_callback (GtkAction *action,
|
||||
return;
|
||||
}
|
||||
|
||||
dialog = stroke_dialog_new (GIMP_ITEM (gimp_image_get_mask (gimage)),
|
||||
dialog = stroke_dialog_new (GIMP_ITEM (gimp_image_get_mask (image)),
|
||||
_("Stroke Selection"),
|
||||
GIMP_STOCK_SELECTION_STROKE,
|
||||
GIMP_HELP_SELECTION_STROKE,
|
||||
@ -328,7 +328,7 @@ select_feather_callback (GtkWidget *widget,
|
||||
GimpUnit unit,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = GIMP_IMAGE (data);
|
||||
GimpImage *image = GIMP_IMAGE (data);
|
||||
gdouble radius_x;
|
||||
gdouble radius_y;
|
||||
|
||||
@ -340,17 +340,17 @@ select_feather_callback (GtkWidget *widget,
|
||||
{
|
||||
gdouble factor;
|
||||
|
||||
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
||||
MIN (gimage->xresolution, gimage->yresolution));
|
||||
factor = (MAX (image->xresolution, image->yresolution) /
|
||||
MIN (image->xresolution, image->yresolution));
|
||||
|
||||
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
||||
if (image->xresolution == MIN (image->xresolution, image->yresolution))
|
||||
radius_y *= factor;
|
||||
else
|
||||
radius_x *= factor;
|
||||
}
|
||||
|
||||
gimp_channel_feather (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_channel_feather (gimp_image_get_mask (image), radius_x, radius_y, TRUE);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -359,7 +359,7 @@ select_border_callback (GtkWidget *widget,
|
||||
GimpUnit unit,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = GIMP_IMAGE (data);
|
||||
GimpImage *image = GIMP_IMAGE (data);
|
||||
gdouble radius_x;
|
||||
gdouble radius_y;
|
||||
|
||||
@ -371,17 +371,17 @@ select_border_callback (GtkWidget *widget,
|
||||
{
|
||||
gdouble factor;
|
||||
|
||||
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
||||
MIN (gimage->xresolution, gimage->yresolution));
|
||||
factor = (MAX (image->xresolution, image->yresolution) /
|
||||
MIN (image->xresolution, image->yresolution));
|
||||
|
||||
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
||||
if (image->xresolution == MIN (image->xresolution, image->yresolution))
|
||||
radius_y *= factor;
|
||||
else
|
||||
radius_x *= factor;
|
||||
}
|
||||
|
||||
gimp_channel_border (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_channel_border (gimp_image_get_mask (image), radius_x, radius_y, TRUE);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -390,7 +390,7 @@ select_grow_callback (GtkWidget *widget,
|
||||
GimpUnit unit,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = GIMP_IMAGE (data);
|
||||
GimpImage *image = GIMP_IMAGE (data);
|
||||
gdouble radius_x;
|
||||
gdouble radius_y;
|
||||
|
||||
@ -402,17 +402,17 @@ select_grow_callback (GtkWidget *widget,
|
||||
{
|
||||
gdouble factor;
|
||||
|
||||
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
||||
MIN (gimage->xresolution, gimage->yresolution));
|
||||
factor = (MAX (image->xresolution, image->yresolution) /
|
||||
MIN (image->xresolution, image->yresolution));
|
||||
|
||||
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
||||
if (image->xresolution == MIN (image->xresolution, image->yresolution))
|
||||
radius_y *= factor;
|
||||
else
|
||||
radius_x *= factor;
|
||||
}
|
||||
|
||||
gimp_channel_grow (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_channel_grow (gimp_image_get_mask (image), radius_x, radius_y, TRUE);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -421,7 +421,7 @@ select_shrink_callback (GtkWidget *widget,
|
||||
GimpUnit unit,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = GIMP_IMAGE (data);
|
||||
GimpImage *image = GIMP_IMAGE (data);
|
||||
gint radius_x;
|
||||
gint radius_y;
|
||||
|
||||
@ -437,16 +437,16 @@ select_shrink_callback (GtkWidget *widget,
|
||||
{
|
||||
gdouble factor;
|
||||
|
||||
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
||||
MIN (gimage->xresolution, gimage->yresolution));
|
||||
factor = (MAX (image->xresolution, image->yresolution) /
|
||||
MIN (image->xresolution, image->yresolution));
|
||||
|
||||
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
||||
if (image->xresolution == MIN (image->xresolution, image->yresolution))
|
||||
radius_y *= factor;
|
||||
else
|
||||
radius_x *= factor;
|
||||
}
|
||||
|
||||
gimp_channel_shrink (gimp_image_get_mask (gimage), radius_x, radius_y,
|
||||
gimp_channel_shrink (gimp_image_get_mask (image), radius_x, radius_y,
|
||||
select_shrink_edge_lock, TRUE);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry templates_actions[] =
|
||||
static const GimpActionEntry templates_actions[] =
|
||||
{
|
||||
{ "templates-popup", GIMP_STOCK_TEMPLATE,
|
||||
N_("Templates Menu"), NULL, NULL, NULL,
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry text_editor_actions[] =
|
||||
static const GimpActionEntry text_editor_actions[] =
|
||||
{
|
||||
{ "text-editor-toolbar", GTK_STOCK_EDIT,
|
||||
"Text Editor Toolbar", NULL, NULL, NULL,
|
||||
@ -53,7 +53,7 @@ static GimpActionEntry text_editor_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpRadioActionEntry text_editor_direction_actions[] =
|
||||
static const GimpRadioActionEntry text_editor_direction_actions[] =
|
||||
{
|
||||
{ "text-editor-direction-ltr", GIMP_STOCK_TEXT_DIR_LTR,
|
||||
N_("LTR"), "",
|
||||
|
||||
@ -50,7 +50,7 @@ static void tool_options_actions_update_presets (GimpActionGroup *group,
|
||||
|
||||
/* global variables */
|
||||
|
||||
static GimpActionEntry tool_options_actions[] =
|
||||
static const GimpActionEntry tool_options_actions[] =
|
||||
{
|
||||
{ "tool-options-popup", GIMP_STOCK_TOOL_OPTIONS,
|
||||
N_("Tool Options Menu"), NULL, NULL, NULL,
|
||||
|
||||
@ -94,15 +94,11 @@ tool_options_save_to_cmd_callback (GtkAction *action,
|
||||
|
||||
if (options)
|
||||
{
|
||||
gchar *name;
|
||||
|
||||
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (options)));
|
||||
gchar *name = g_strdup (gimp_object_get_name (GIMP_OBJECT (options)));
|
||||
|
||||
gimp_config_sync (G_OBJECT (tool_info->tool_options),
|
||||
G_OBJECT (options), 0);
|
||||
gimp_object_set_name (GIMP_OBJECT (options), name);
|
||||
|
||||
g_free (name);
|
||||
gimp_object_take_name (GIMP_OBJECT (options), name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,12 +238,12 @@ tool_options_save_callback (GtkWidget *widget,
|
||||
GimpToolInfo *tool_info = GIMP_TOOL_INFO (data);
|
||||
GimpConfig *copy;
|
||||
|
||||
if (! name || ! strlen (name))
|
||||
name = _("Saved Options");
|
||||
|
||||
copy = gimp_config_duplicate (GIMP_CONFIG (tool_info->tool_options));
|
||||
|
||||
gimp_object_set_name (GIMP_OBJECT (copy), name);
|
||||
if (name && strlen (name))
|
||||
gimp_object_set_name (GIMP_OBJECT (copy), name);
|
||||
else
|
||||
gimp_object_set_static_name (GIMP_OBJECT (copy), _("Saved Options"));
|
||||
|
||||
gimp_container_insert (tool_info->options_presets, GIMP_OBJECT (copy), -1);
|
||||
g_object_unref (copy);
|
||||
@ -260,8 +256,8 @@ tool_options_rename_callback (GtkWidget *widget,
|
||||
{
|
||||
GimpToolOptions *options = GIMP_TOOL_OPTIONS (data);
|
||||
|
||||
if (! name || ! strlen (name))
|
||||
name = _("Saved Options");
|
||||
|
||||
gimp_object_set_name (GIMP_OBJECT (options), name);
|
||||
if (name && strlen (name))
|
||||
gimp_object_set_name (GIMP_OBJECT (options), name);
|
||||
else
|
||||
gimp_object_set_static_name (GIMP_OBJECT (options), _("Saved Options"));
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry tools_actions[] =
|
||||
static const GimpActionEntry tools_actions[] =
|
||||
{
|
||||
{ "tools-popup", GIMP_STOCK_TOOLS,
|
||||
N_("Tools Menu"), NULL, NULL, NULL,
|
||||
@ -84,7 +84,7 @@ static GimpActionEntry tools_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry tools_toggle_actions[] =
|
||||
static const GimpToggleActionEntry tools_toggle_actions[] =
|
||||
{
|
||||
{ "tools-visibility", GIMP_STOCK_VISIBLE,
|
||||
N_("_Show in Toolbox"), NULL, NULL,
|
||||
@ -93,7 +93,7 @@ static GimpToggleActionEntry tools_toggle_actions[] =
|
||||
NULL /* FIXME */ }
|
||||
};
|
||||
|
||||
static GimpStringActionEntry tools_alternative_actions[] =
|
||||
static const GimpStringActionEntry tools_alternative_actions[] =
|
||||
{
|
||||
{ "tools-by-color-select-short", GIMP_STOCK_TOOL_BY_COLOR_SELECT,
|
||||
N_("_By Color"), NULL, NULL,
|
||||
@ -106,7 +106,7 @@ static GimpStringActionEntry tools_alternative_actions[] =
|
||||
GIMP_HELP_TOOL_ROTATE }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_color_average_radius_actions[] =
|
||||
static const GimpEnumActionEntry tools_color_average_radius_actions[] =
|
||||
{
|
||||
{ "tools-color-average-radius-set", GIMP_STOCK_TOOL_COLOR_PICKER,
|
||||
"Set Color Picker Radius", NULL, NULL,
|
||||
@ -140,7 +140,7 @@ static GimpEnumActionEntry tools_color_average_radius_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_ink_blob_size_actions[] =
|
||||
static const GimpEnumActionEntry tools_ink_blob_size_actions[] =
|
||||
{
|
||||
{ "tools-ink-blob-size-set", GIMP_STOCK_TOOL_INK,
|
||||
"Set Ink Blob Size", NULL, NULL,
|
||||
@ -172,7 +172,7 @@ static GimpEnumActionEntry tools_ink_blob_size_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
|
||||
static const GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
|
||||
{
|
||||
{ "tools-ink-blob-aspect-set", GIMP_STOCK_TOOL_INK,
|
||||
"Set Ink Blob Aspect", NULL, NULL,
|
||||
@ -204,7 +204,7 @@ static GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_ink_blob_angle_actions[] =
|
||||
static const GimpEnumActionEntry tools_ink_blob_angle_actions[] =
|
||||
{
|
||||
{ "tools-ink-blob-angle-set", GIMP_STOCK_TOOL_INK,
|
||||
"Set Ink Blob Angle", NULL, NULL,
|
||||
@ -236,7 +236,7 @@ static GimpEnumActionEntry tools_ink_blob_angle_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_value_1_actions[] =
|
||||
static const GimpEnumActionEntry tools_value_1_actions[] =
|
||||
{
|
||||
{ "tools-value-1-set", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Set Value 1", NULL, NULL,
|
||||
@ -268,7 +268,7 @@ static GimpEnumActionEntry tools_value_1_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_value_2_actions[] =
|
||||
static const GimpEnumActionEntry tools_value_2_actions[] =
|
||||
{
|
||||
{ "tools-value-2-set", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Set Value 2", NULL, NULL,
|
||||
@ -300,7 +300,7 @@ static GimpEnumActionEntry tools_value_2_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_value_3_actions[] =
|
||||
static const GimpEnumActionEntry tools_value_3_actions[] =
|
||||
{
|
||||
{ "tools-value-3-set", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Set Value 3", NULL, NULL,
|
||||
@ -332,7 +332,7 @@ static GimpEnumActionEntry tools_value_3_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_value_4_actions[] =
|
||||
static const GimpEnumActionEntry tools_value_4_actions[] =
|
||||
{
|
||||
{ "tools-value-4-set", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Set Value 4", NULL, NULL,
|
||||
@ -364,7 +364,7 @@ static GimpEnumActionEntry tools_value_4_actions[] =
|
||||
NULL },
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_object_1_actions[] =
|
||||
static const GimpEnumActionEntry tools_object_1_actions[] =
|
||||
{
|
||||
{ "tools-object-1-set", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Select Object 1 by Index", NULL, NULL,
|
||||
@ -388,7 +388,7 @@ static GimpEnumActionEntry tools_object_1_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry tools_object_2_actions[] =
|
||||
static const GimpEnumActionEntry tools_object_2_actions[] =
|
||||
{
|
||||
{ "tools-object-2-set", GIMP_STOCK_TOOL_OPTIONS,
|
||||
"Select Object 2 by Index", NULL, NULL,
|
||||
|
||||
@ -55,12 +55,12 @@ static void tools_activate_enum_action (const gchar *action_desc,
|
||||
void
|
||||
tools_select_cmd_callback (GtkAction *action,
|
||||
const gchar *value,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
Gimp *gimp;
|
||||
GimpToolInfo *tool_info;
|
||||
GimpContext *context;
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
gboolean rotate_layer = FALSE;
|
||||
return_if_no_gimp (gimp, data);
|
||||
|
||||
@ -92,10 +92,10 @@ tools_select_cmd_callback (GtkAction *action,
|
||||
gimp_context_tool_changed (context);
|
||||
}
|
||||
|
||||
gdisp = gimp_context_get_display (context);
|
||||
display = gimp_context_get_display (context);
|
||||
|
||||
if (gdisp)
|
||||
tool_manager_initialize_active (gimp, gdisp);
|
||||
if (display)
|
||||
tool_manager_initialize_active (gimp, display);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GimpActionEntry vectors_actions[] =
|
||||
static const GimpActionEntry vectors_actions[] =
|
||||
{
|
||||
{ "vectors-popup", GIMP_STOCK_PATHS,
|
||||
N_("Paths Menu"), NULL, NULL, NULL,
|
||||
@ -141,7 +141,7 @@ static GimpActionEntry vectors_actions[] =
|
||||
GIMP_HELP_PATH_IMPORT }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry vectors_toggle_actions[] =
|
||||
static const GimpToggleActionEntry vectors_toggle_actions[] =
|
||||
{
|
||||
{ "vectors-visible", GIMP_STOCK_VISIBLE,
|
||||
N_("_Visible"), NULL, NULL,
|
||||
@ -156,7 +156,7 @@ static GimpToggleActionEntry vectors_toggle_actions[] =
|
||||
GIMP_HELP_PATH_LINKED }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry vectors_to_selection_actions[] =
|
||||
static const GimpEnumActionEntry vectors_to_selection_actions[] =
|
||||
{
|
||||
{ "vectors-selection-replace", GIMP_STOCK_SELECTION_REPLACE,
|
||||
N_("Path to Sele_ction"), NULL,
|
||||
@ -188,7 +188,7 @@ static GimpEnumActionEntry vectors_to_selection_actions[] =
|
||||
GIMP_HELP_PATH_SELECTION_INTERSECT }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry vectors_selection_to_vectors_actions[] =
|
||||
static const GimpEnumActionEntry vectors_selection_to_vectors_actions[] =
|
||||
{
|
||||
{ "vectors-selection-to-vectors", GIMP_STOCK_SELECTION_TO_PATH,
|
||||
N_("Selecti_on to Path"), NULL,
|
||||
@ -235,7 +235,7 @@ void
|
||||
vectors_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpVectors *vectors = NULL;
|
||||
gint n_vectors = 0;
|
||||
gboolean mask_empty = TRUE;
|
||||
@ -245,13 +245,13 @@ vectors_actions_update (GimpActionGroup *group,
|
||||
GList *next = NULL;
|
||||
GList *prev = NULL;
|
||||
|
||||
if (gimage)
|
||||
if (image)
|
||||
{
|
||||
n_vectors = gimp_container_num_children (gimage->vectors);
|
||||
mask_empty = gimp_channel_is_empty (gimp_image_get_mask (gimage));
|
||||
n_vectors = gimp_container_num_children (image->vectors);
|
||||
mask_empty = gimp_channel_is_empty (gimp_image_get_mask (image));
|
||||
global_buf = FALSE;
|
||||
|
||||
vectors = gimp_image_get_active_vectors (gimage);
|
||||
vectors = gimp_image_get_active_vectors (image);
|
||||
|
||||
if (vectors)
|
||||
{
|
||||
@ -261,7 +261,7 @@ vectors_actions_update (GimpActionGroup *group,
|
||||
visible = gimp_item_get_visible (item);
|
||||
linked = gimp_item_get_linked (item);
|
||||
|
||||
list = g_list_find (GIMP_LIST (gimage->vectors)->list, vectors);
|
||||
list = g_list_find (GIMP_LIST (image->vectors)->list, vectors);
|
||||
|
||||
if (list)
|
||||
{
|
||||
@ -279,8 +279,8 @@ vectors_actions_update (GimpActionGroup *group,
|
||||
SET_SENSITIVE ("vectors-path-tool", vectors);
|
||||
SET_SENSITIVE ("vectors-edit-attributes", vectors);
|
||||
|
||||
SET_SENSITIVE ("vectors-new", gimage);
|
||||
SET_SENSITIVE ("vectors-new-last-values", gimage);
|
||||
SET_SENSITIVE ("vectors-new", image);
|
||||
SET_SENSITIVE ("vectors-new-last-values", image);
|
||||
SET_SENSITIVE ("vectors-duplicate", vectors);
|
||||
SET_SENSITIVE ("vectors-delete", vectors);
|
||||
SET_SENSITIVE ("vectors-merge-visible", n_vectors > 1);
|
||||
@ -291,9 +291,9 @@ vectors_actions_update (GimpActionGroup *group,
|
||||
SET_SENSITIVE ("vectors-lower-to-bottom", vectors && next);
|
||||
|
||||
SET_SENSITIVE ("vectors-copy", vectors);
|
||||
SET_SENSITIVE ("vectors-paste", gimage);
|
||||
SET_SENSITIVE ("vectors-paste", image);
|
||||
SET_SENSITIVE ("vectors-export", vectors);
|
||||
SET_SENSITIVE ("vectors-import", gimage);
|
||||
SET_SENSITIVE ("vectors-import", image);
|
||||
|
||||
SET_SENSITIVE ("vectors-visible", vectors);
|
||||
SET_SENSITIVE ("vectors-linked", vectors);
|
||||
@ -301,9 +301,9 @@ vectors_actions_update (GimpActionGroup *group,
|
||||
SET_ACTIVE ("vectors-visible", visible);
|
||||
SET_ACTIVE ("vectors-linked", linked);
|
||||
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors", gimage && !mask_empty);
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors-short", gimage && !mask_empty);
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors-advanced", gimage && !mask_empty);
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors", image && !mask_empty);
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors-short", image && !mask_empty);
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors-advanced", image && !mask_empty);
|
||||
SET_SENSITIVE ("vectors-stroke", vectors);
|
||||
SET_SENSITIVE ("vectors-stroke-last-values", vectors);
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
#include "actions-types.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimp-utils.h"
|
||||
#include "core/gimpchannel.h"
|
||||
#include "core/gimpchannel-select.h"
|
||||
#include "core/gimpcontainer.h"
|
||||
@ -35,13 +36,13 @@
|
||||
#include "core/gimpimage-merge.h"
|
||||
#include "core/gimpimage-undo.h"
|
||||
#include "core/gimpitemundo.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
#include "core/gimpprogress.h"
|
||||
#include "core/gimpstrokedesc.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "plug-in/plug-in-run.h"
|
||||
#include "pdb/gimp-pdb.h"
|
||||
#include "pdb/gimpprocedure.h"
|
||||
|
||||
#include "vectors/gimpvectors.h"
|
||||
#include "vectors/gimpvectors-export.h"
|
||||
@ -97,25 +98,25 @@ void
|
||||
vectors_vectors_tool_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
GimpTool *active_tool;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
active_tool = tool_manager_get_active (gimage->gimp);
|
||||
active_tool = tool_manager_get_active (image->gimp);
|
||||
|
||||
if (! GIMP_IS_VECTOR_TOOL (active_tool))
|
||||
{
|
||||
GimpToolInfo *tool_info;
|
||||
|
||||
tool_info = (GimpToolInfo *)
|
||||
gimp_container_get_child_by_name (gimage->gimp->tool_info_list,
|
||||
gimp_container_get_child_by_name (image->gimp->tool_info_list,
|
||||
"gimp-vector-tool");
|
||||
|
||||
if (GIMP_IS_TOOL_INFO (tool_info))
|
||||
{
|
||||
gimp_context_set_tool (action_data_get_context (data), tool_info);
|
||||
active_tool = tool_manager_get_active (gimage->gimp);
|
||||
active_tool = tool_manager_get_active (image->gimp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,13 +129,13 @@ vectors_edit_attributes_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
VectorsOptionsDialog *options;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
GtkWidget *widget;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
options = vectors_options_dialog_new (gimage,
|
||||
options = vectors_options_dialog_new (image,
|
||||
vectors,
|
||||
widget,
|
||||
gimp_object_get_name (GIMP_OBJECT (vectors)),
|
||||
@ -156,12 +157,12 @@ vectors_new_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
VectorsOptionsDialog *options;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
options = vectors_options_dialog_new (gimage,
|
||||
options = vectors_options_dialog_new (image,
|
||||
NULL,
|
||||
widget,
|
||||
vectors_name ? vectors_name :
|
||||
@ -183,105 +184,105 @@ void
|
||||
vectors_new_last_vals_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *new_vectors;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
new_vectors = gimp_vectors_new (gimage,
|
||||
new_vectors = gimp_vectors_new (image,
|
||||
vectors_name ? vectors_name : _("New Path"));
|
||||
|
||||
gimp_image_add_vectors (gimage, new_vectors, -1);
|
||||
gimp_image_add_vectors (image, new_vectors, -1);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
vectors_raise_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
gimp_image_raise_vectors (gimage, vectors);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_raise_vectors (image, vectors);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
vectors_raise_to_top_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
gimp_image_raise_vectors_to_top (gimage, vectors);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_raise_vectors_to_top (image, vectors);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
vectors_lower_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
gimp_image_lower_vectors (gimage, vectors);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_lower_vectors (image, vectors);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
vectors_lower_to_bottom_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
gimp_image_lower_vectors_to_bottom (gimage, vectors);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_lower_vectors_to_bottom (image, vectors);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
vectors_duplicate_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
GimpVectors *new_vectors;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
new_vectors =
|
||||
GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
|
||||
G_TYPE_FROM_INSTANCE (vectors),
|
||||
TRUE));
|
||||
gimp_image_add_vectors (gimage, new_vectors, -1);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_add_vectors (image, new_vectors, -1);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
vectors_delete_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
gimp_image_remove_vectors (gimage, vectors);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_remove_vectors (image, vectors);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
vectors_merge_visible_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
gimp_image_merge_visible_vectors (gimage);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_merge_visible_vectors (image);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -290,17 +291,17 @@ vectors_to_selection_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpChannelOps op;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
op = (GimpChannelOps) value;
|
||||
|
||||
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
|
||||
gimp_channel_select_vectors (gimp_image_get_mask (image),
|
||||
_("Path to Selection"),
|
||||
vectors,
|
||||
op, TRUE, FALSE, 0, 0);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
void
|
||||
@ -308,58 +309,54 @@ vectors_selection_to_vectors_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
ProcRecord *proc_rec;
|
||||
Argument *args;
|
||||
GimpDisplay *gdisp;
|
||||
return_if_no_image (gimage, data);
|
||||
GimpImage *image;
|
||||
GimpProcedure *procedure;
|
||||
GValueArray *args;
|
||||
GimpDisplay *display;
|
||||
return_if_no_image (image, data);
|
||||
|
||||
if (value)
|
||||
proc_rec = procedural_db_lookup (gimage->gimp,
|
||||
"plug-in-sel2path-advanced");
|
||||
procedure = gimp_pdb_lookup (image->gimp, "plug-in-sel2path-advanced");
|
||||
else
|
||||
proc_rec = procedural_db_lookup (gimage->gimp,
|
||||
"plug-in-sel2path");
|
||||
procedure = gimp_pdb_lookup (image->gimp, "plug-in-sel2path");
|
||||
|
||||
if (! proc_rec)
|
||||
if (! procedure)
|
||||
{
|
||||
g_message ("Selection to path procedure lookup failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
gdisp = gimp_context_get_display (action_data_get_context (data));
|
||||
display = gimp_context_get_display (action_data_get_context (data));
|
||||
|
||||
/* plug-in arguments as if called by <Image>/Filters/... */
|
||||
args = g_new (Argument, 3);
|
||||
args = gimp_procedure_get_arguments (procedure);
|
||||
gimp_value_array_truncate (args, 3);
|
||||
|
||||
args[0].arg_type = GIMP_PDB_INT32;
|
||||
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
|
||||
args[1].arg_type = GIMP_PDB_IMAGE;
|
||||
args[1].value.pdb_int = (gint32) gimp_image_get_ID (gimage);
|
||||
args[2].arg_type = GIMP_PDB_DRAWABLE;
|
||||
args[2].value.pdb_int = -1; /* unused */
|
||||
g_value_set_int (&args->values[0], GIMP_RUN_INTERACTIVE);
|
||||
gimp_value_set_image (&args->values[1], image);
|
||||
gimp_value_set_drawable (&args->values[2], NULL /* unused */);
|
||||
|
||||
plug_in_run (gimage->gimp, action_data_get_context (data),
|
||||
GIMP_PROGRESS (gdisp),
|
||||
proc_rec, args, 3, FALSE, TRUE,
|
||||
gdisp ? gimp_display_get_ID (gdisp) : 0);
|
||||
gimp_procedure_execute_async (procedure, image->gimp,
|
||||
action_data_get_context (data),
|
||||
GIMP_PROGRESS (display), args,
|
||||
display ? gimp_display_get_ID (display) : 0);
|
||||
|
||||
g_free (args);
|
||||
g_value_array_free (args);
|
||||
}
|
||||
|
||||
void
|
||||
vectors_stroke_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
GimpDrawable *drawable;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *dialog;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
drawable = gimp_image_active_drawable (image);
|
||||
|
||||
if (! drawable)
|
||||
{
|
||||
@ -414,16 +411,16 @@ void
|
||||
vectors_copy_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
gchar *svg;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
svg = gimp_vectors_export_string (gimage, vectors);
|
||||
svg = gimp_vectors_export_string (image, vectors);
|
||||
|
||||
if (svg)
|
||||
{
|
||||
gimp_clipboard_set_svg (gimage->gimp, svg);
|
||||
gimp_clipboard_set_svg (image->gimp, svg);
|
||||
g_free (svg);
|
||||
}
|
||||
}
|
||||
@ -432,18 +429,18 @@ void
|
||||
vectors_paste_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
gchar *svg;
|
||||
gsize svg_size;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
|
||||
svg = gimp_clipboard_get_svg (gimage->gimp, &svg_size);
|
||||
svg = gimp_clipboard_get_svg (image->gimp, &svg_size);
|
||||
|
||||
if (svg)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (! gimp_vectors_import_buffer (gimage, svg, svg_size,
|
||||
if (! gimp_vectors_import_buffer (image, svg, svg_size,
|
||||
TRUE, TRUE, -1, &error))
|
||||
{
|
||||
g_message (error->message);
|
||||
@ -451,7 +448,7 @@ vectors_paste_cmd_callback (GtkAction *action,
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
|
||||
g_free (svg);
|
||||
@ -463,13 +460,13 @@ vectors_export_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
VectorsExportDialog *dialog;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
GtkWidget *widget;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = vectors_export_dialog_new (gimage, widget,
|
||||
dialog = vectors_export_dialog_new (image, widget,
|
||||
vectors_export_active_only);
|
||||
|
||||
g_signal_connect (dialog->dialog, "response",
|
||||
@ -484,12 +481,12 @@ vectors_import_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
VectorsImportDialog *dialog;
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GtkWidget *widget;
|
||||
return_if_no_image (gimage, data);
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = vectors_import_dialog_new (gimage, widget,
|
||||
dialog = vectors_import_dialog_new (image, widget,
|
||||
vectors_import_merge,
|
||||
vectors_import_scale);
|
||||
|
||||
@ -504,10 +501,10 @@ void
|
||||
vectors_visible_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
gboolean visible;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -516,14 +513,14 @@ vectors_visible_cmd_callback (GtkAction *action,
|
||||
GimpUndo *undo;
|
||||
gboolean push_undo = TRUE;
|
||||
|
||||
undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
|
||||
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
|
||||
GIMP_UNDO_ITEM_VISIBILITY);
|
||||
|
||||
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (vectors))
|
||||
push_undo = FALSE;
|
||||
|
||||
gimp_item_set_visible (GIMP_ITEM (vectors), visible, push_undo);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -531,10 +528,10 @@ void
|
||||
vectors_linked_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpVectors *vectors;
|
||||
gboolean linked;
|
||||
return_if_no_vectors (gimage, vectors, data);
|
||||
return_if_no_vectors (image, vectors, data);
|
||||
|
||||
linked = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -543,14 +540,14 @@ vectors_linked_cmd_callback (GtkAction *action,
|
||||
GimpUndo *undo;
|
||||
gboolean push_undo = TRUE;
|
||||
|
||||
undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
|
||||
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
|
||||
GIMP_UNDO_ITEM_LINKED);
|
||||
|
||||
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (vectors))
|
||||
push_undo = FALSE;
|
||||
|
||||
gimp_item_set_linked (GIMP_ITEM (vectors), linked, push_undo);
|
||||
gimp_image_flush (gimage);
|
||||
gimp_image_flush (image);
|
||||
}
|
||||
}
|
||||
|
||||
@ -572,11 +569,11 @@ vectors_new_vectors_response (GtkWidget *widget,
|
||||
vectors_name =
|
||||
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
||||
|
||||
new_vectors = gimp_vectors_new (options->gimage, vectors_name);
|
||||
new_vectors = gimp_vectors_new (options->image, vectors_name);
|
||||
|
||||
gimp_image_add_vectors (options->gimage, new_vectors, -1);
|
||||
gimp_image_add_vectors (options->image, new_vectors, -1);
|
||||
|
||||
gimp_image_flush (options->gimage);
|
||||
gimp_image_flush (options->image);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (options->dialog);
|
||||
@ -597,7 +594,7 @@ vectors_edit_vectors_response (GtkWidget *widget,
|
||||
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (vectors))))
|
||||
{
|
||||
gimp_item_rename (GIMP_ITEM (vectors), new_name);
|
||||
gimp_image_flush (options->gimage);
|
||||
gimp_image_flush (options->image);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ static void view_actions_check_type_notify (GimpDisplayConfig *config,
|
||||
GimpActionGroup *group);
|
||||
|
||||
|
||||
static GimpActionEntry view_actions[] =
|
||||
static const GimpActionEntry view_actions[] =
|
||||
{
|
||||
{ "view-menu", NULL, N_("_View") },
|
||||
{ "view-zoom-menu", NULL, N_("_Zoom") },
|
||||
@ -70,65 +70,73 @@ static GimpActionEntry view_actions[] =
|
||||
GIMP_HELP_VIEW_CHANGE_SCREEN },
|
||||
|
||||
{ "view-new", GTK_STOCK_NEW,
|
||||
N_("_New View"), "", NULL,
|
||||
N_("_New View"), "",
|
||||
N_("Create another view on this image"),
|
||||
G_CALLBACK (view_new_cmd_callback),
|
||||
GIMP_HELP_VIEW_NEW },
|
||||
|
||||
{ "view-close", GTK_STOCK_CLOSE,
|
||||
N_( "_Close"), "<control>W", NULL,
|
||||
N_( "_Close"), "<control>W",
|
||||
N_("Close this image window"),
|
||||
G_CALLBACK (window_close_cmd_callback),
|
||||
GIMP_HELP_FILE_CLOSE },
|
||||
|
||||
{ "view-zoom-fit-in", GTK_STOCK_ZOOM_FIT,
|
||||
N_("_Fit Image in Window"), "<control><shift>E",
|
||||
N_("Fit image in window"),
|
||||
N_("Adjust the zoom ratio so that the image becomes fully visible"),
|
||||
G_CALLBACK (view_zoom_fit_in_cmd_callback),
|
||||
GIMP_HELP_VIEW_ZOOM_FIT_IN },
|
||||
|
||||
{ "view-zoom-fit-to", GTK_STOCK_ZOOM_FIT,
|
||||
N_("Fit Image _to Window"), NULL,
|
||||
N_("Fit image to window"),
|
||||
N_("Adjust the zoom ratio so that the window is used optimally"),
|
||||
G_CALLBACK (view_zoom_fit_to_cmd_callback),
|
||||
GIMP_HELP_VIEW_ZOOM_FIT_TO },
|
||||
|
||||
{ "view-navigation-window", GIMP_STOCK_NAVIGATION,
|
||||
N_("Na_vigation Window"), NULL, NULL,
|
||||
N_("Na_vigation Window"), NULL,
|
||||
N_("Show an overview window for this image"),
|
||||
G_CALLBACK (view_navigation_window_cmd_callback),
|
||||
GIMP_HELP_NAVIGATION_DIALOG },
|
||||
|
||||
{ "view-display-filters", GIMP_STOCK_DISPLAY_FILTER,
|
||||
N_("Display _Filters..."), NULL, NULL,
|
||||
N_("Display _Filters..."), NULL,
|
||||
N_("Configure filters applied to this view"),
|
||||
G_CALLBACK (view_display_filters_cmd_callback),
|
||||
GIMP_HELP_DISPLAY_FILTER_DIALOG },
|
||||
|
||||
{ "view-shrink-wrap", GTK_STOCK_ZOOM_FIT,
|
||||
N_("Shrink _Wrap"), "<control>E",
|
||||
N_("Shrink wrap"),
|
||||
N_("Reduce the image window to the size of the image display"),
|
||||
G_CALLBACK (view_shrink_wrap_cmd_callback),
|
||||
GIMP_HELP_VIEW_SHRINK_WRAP },
|
||||
|
||||
{ "view-open-display", NULL,
|
||||
N_("_Open Display..."), NULL, NULL,
|
||||
N_("_Open Display..."), NULL,
|
||||
N_("Connect to another display"),
|
||||
G_CALLBACK (window_open_display_cmd_callback),
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpToggleActionEntry view_toggle_actions[] =
|
||||
static const GimpToggleActionEntry view_toggle_actions[] =
|
||||
{
|
||||
{ "view-dot-for-dot", NULL,
|
||||
N_("_Dot for Dot"), NULL, NULL,
|
||||
N_("_Dot for Dot"), NULL,
|
||||
N_("A pixel on the screen represents an image pixel"),
|
||||
G_CALLBACK (view_dot_for_dot_cmd_callback),
|
||||
TRUE,
|
||||
GIMP_HELP_VIEW_DOT_FOR_DOT },
|
||||
|
||||
{ "view-show-selection", NULL,
|
||||
N_("Show _Selection"), "<control>T", NULL,
|
||||
N_("Show _Selection"), "<control>T",
|
||||
N_("Display the selection outline"),
|
||||
G_CALLBACK (view_toggle_selection_cmd_callback),
|
||||
TRUE,
|
||||
GIMP_HELP_VIEW_SHOW_SELECTION },
|
||||
|
||||
{ "view-show-layer-boundary", NULL,
|
||||
N_("Show _Layer Boundary"), NULL, NULL,
|
||||
N_("Show _Layer Boundary"), NULL,
|
||||
N_("Draw a border around the active layer"),
|
||||
G_CALLBACK (view_toggle_layer_boundary_cmd_callback),
|
||||
TRUE,
|
||||
GIMP_HELP_VIEW_SHOW_LAYER_BOUNDARY },
|
||||
@ -200,13 +208,14 @@ static GimpToggleActionEntry view_toggle_actions[] =
|
||||
GIMP_HELP_VIEW_SHOW_STATUSBAR },
|
||||
|
||||
{ "view-fullscreen", GTK_STOCK_FULLSCREEN,
|
||||
N_("Fullscr_een"), "F11", NULL,
|
||||
N_("Fullscr_een"), "F11",
|
||||
N_("Toggle fullscreen view"),
|
||||
G_CALLBACK (view_fullscreen_cmd_callback),
|
||||
FALSE,
|
||||
GIMP_HELP_VIEW_FULLSCREEN }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry view_zoom_actions[] =
|
||||
static const GimpEnumActionEntry view_zoom_actions[] =
|
||||
{
|
||||
{ "view-zoom", NULL,
|
||||
"Set zoom factor", NULL, NULL,
|
||||
@ -258,7 +267,7 @@ static GimpEnumActionEntry view_zoom_actions[] =
|
||||
GIMP_HELP_VIEW_ZOOM_IN }
|
||||
};
|
||||
|
||||
static GimpRadioActionEntry view_zoom_explicit_actions[] =
|
||||
static const GimpRadioActionEntry view_zoom_explicit_actions[] =
|
||||
{
|
||||
{ "view-zoom-16-1", NULL,
|
||||
N_("1_6:1 (1600%)"), NULL, NULL,
|
||||
@ -312,7 +321,7 @@ static GimpRadioActionEntry view_zoom_explicit_actions[] =
|
||||
GIMP_HELP_VIEW_ZOOM_OTHER }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry view_padding_color_actions[] =
|
||||
static const GimpEnumActionEntry view_padding_color_actions[] =
|
||||
{
|
||||
{ "view-padding-color-theme", NULL,
|
||||
N_("From _Theme"), NULL, NULL,
|
||||
@ -340,7 +349,7 @@ static GimpEnumActionEntry view_padding_color_actions[] =
|
||||
GIMP_HELP_VIEW_PADDING_COLOR }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry view_scroll_horizontal_actions[] =
|
||||
static const GimpEnumActionEntry view_scroll_horizontal_actions[] =
|
||||
{
|
||||
{ "view-scroll-horizontal", NULL,
|
||||
"Set horizontal scroll offset", NULL, NULL,
|
||||
@ -378,7 +387,7 @@ static GimpEnumActionEntry view_scroll_horizontal_actions[] =
|
||||
NULL }
|
||||
};
|
||||
|
||||
static GimpEnumActionEntry view_scroll_vertical_actions[] =
|
||||
static const GimpEnumActionEntry view_scroll_vertical_actions[] =
|
||||
{
|
||||
{ "view-scroll-vertical", NULL,
|
||||
"Set vertical scroll offset", NULL, NULL,
|
||||
@ -488,16 +497,14 @@ void
|
||||
view_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp = action_data_get_display (data);
|
||||
GimpDisplay *display = action_data_get_display (data);
|
||||
GimpDisplayShell *shell = NULL;
|
||||
GimpDisplayOptions *options = NULL;
|
||||
GimpImage *gimage = NULL;
|
||||
gboolean fullscreen = FALSE;
|
||||
|
||||
if (gdisp)
|
||||
if (display)
|
||||
{
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
gimage = gdisp->gimage;
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
fullscreen = gimp_display_shell_get_fullscreen (shell);
|
||||
|
||||
@ -515,47 +522,47 @@ view_actions_update (GimpActionGroup *group,
|
||||
#define SET_COLOR(action,color) \
|
||||
gimp_action_group_set_action_color (group, action, color, FALSE)
|
||||
|
||||
SET_SENSITIVE ("view-new", gdisp);
|
||||
SET_SENSITIVE ("view-close", gdisp);
|
||||
SET_SENSITIVE ("view-new", display);
|
||||
SET_SENSITIVE ("view-close", display);
|
||||
|
||||
SET_SENSITIVE ("view-dot-for-dot", gdisp);
|
||||
SET_ACTIVE ("view-dot-for-dot", gdisp && shell->dot_for_dot);
|
||||
SET_SENSITIVE ("view-dot-for-dot", display);
|
||||
SET_ACTIVE ("view-dot-for-dot", display && shell->dot_for_dot);
|
||||
|
||||
SET_SENSITIVE ("view-zoom-out", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-in", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-fit-in", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-fit-to", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-out", display);
|
||||
SET_SENSITIVE ("view-zoom-in", display);
|
||||
SET_SENSITIVE ("view-zoom-fit-in", display);
|
||||
SET_SENSITIVE ("view-zoom-fit-to", display);
|
||||
|
||||
SET_SENSITIVE ("view-zoom-16-1", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-8-1", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-4-1", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-2-1", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-1-1", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-1-2", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-1-4", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-1-8", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-1-16", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-other", gdisp);
|
||||
SET_SENSITIVE ("view-zoom-16-1", display);
|
||||
SET_SENSITIVE ("view-zoom-8-1", display);
|
||||
SET_SENSITIVE ("view-zoom-4-1", display);
|
||||
SET_SENSITIVE ("view-zoom-2-1", display);
|
||||
SET_SENSITIVE ("view-zoom-1-1", display);
|
||||
SET_SENSITIVE ("view-zoom-1-2", display);
|
||||
SET_SENSITIVE ("view-zoom-1-4", display);
|
||||
SET_SENSITIVE ("view-zoom-1-8", display);
|
||||
SET_SENSITIVE ("view-zoom-1-16", display);
|
||||
SET_SENSITIVE ("view-zoom-other", display);
|
||||
|
||||
if (gdisp)
|
||||
if (display)
|
||||
view_actions_set_zoom (group, shell);
|
||||
|
||||
SET_SENSITIVE ("view-navigation-window", gdisp);
|
||||
SET_SENSITIVE ("view-display-filters", gdisp);
|
||||
SET_SENSITIVE ("view-navigation-window", display);
|
||||
SET_SENSITIVE ("view-display-filters", display);
|
||||
|
||||
SET_SENSITIVE ("view-show-selection", gdisp);
|
||||
SET_ACTIVE ("view-show-selection", gdisp && options->show_selection);
|
||||
SET_SENSITIVE ("view-show-layer-boundary", gdisp);
|
||||
SET_ACTIVE ("view-show-layer-boundary", gdisp && options->show_layer_boundary);
|
||||
SET_ACTIVE ("view-show-guides", gdisp && options->show_guides);
|
||||
SET_ACTIVE ("view-show-grid", gdisp && options->show_grid);
|
||||
SET_ACTIVE ("view-show-sample-points", gdisp && options->show_sample_points);
|
||||
SET_ACTIVE ("view-snap-to-guides", gdisp && shell->snap_to_guides);
|
||||
SET_ACTIVE ("view-snap-to-grid", gdisp && shell->snap_to_grid);
|
||||
SET_ACTIVE ("view-snap-to-canvas", gdisp && shell->snap_to_canvas);
|
||||
SET_ACTIVE ("view-snap-to-vectors", gdisp && shell->snap_to_vectors);
|
||||
SET_SENSITIVE ("view-show-selection", display);
|
||||
SET_ACTIVE ("view-show-selection", display && options->show_selection);
|
||||
SET_SENSITIVE ("view-show-layer-boundary", display);
|
||||
SET_ACTIVE ("view-show-layer-boundary", display && options->show_layer_boundary);
|
||||
SET_ACTIVE ("view-show-guides", display && options->show_guides);
|
||||
SET_ACTIVE ("view-show-grid", display && options->show_grid);
|
||||
SET_ACTIVE ("view-show-sample-points", display && options->show_sample_points);
|
||||
SET_ACTIVE ("view-snap-to-guides", display && shell->snap_to_guides);
|
||||
SET_ACTIVE ("view-snap-to-grid", display && shell->snap_to_grid);
|
||||
SET_ACTIVE ("view-snap-to-canvas", display && shell->snap_to_canvas);
|
||||
SET_ACTIVE ("view-snap-to-vectors", display && shell->snap_to_vectors);
|
||||
|
||||
if (gdisp)
|
||||
if (display)
|
||||
{
|
||||
SET_COLOR ("view-padding-color-menu", &options->padding_color);
|
||||
|
||||
@ -572,24 +579,24 @@ view_actions_update (GimpActionGroup *group,
|
||||
}
|
||||
}
|
||||
|
||||
SET_SENSITIVE ("view-show-menubar", gdisp);
|
||||
SET_ACTIVE ("view-show-menubar", gdisp && options->show_menubar);
|
||||
SET_SENSITIVE ("view-show-rulers", gdisp);
|
||||
SET_ACTIVE ("view-show-rulers", gdisp && options->show_rulers);
|
||||
SET_SENSITIVE ("view-show-scrollbars", gdisp);
|
||||
SET_ACTIVE ("view-show-scrollbars", gdisp && options->show_scrollbars);
|
||||
SET_SENSITIVE ("view-show-statusbar", gdisp);
|
||||
SET_ACTIVE ("view-show-statusbar", gdisp && options->show_statusbar);
|
||||
SET_SENSITIVE ("view-show-menubar", display);
|
||||
SET_ACTIVE ("view-show-menubar", display && options->show_menubar);
|
||||
SET_SENSITIVE ("view-show-rulers", display);
|
||||
SET_ACTIVE ("view-show-rulers", display && options->show_rulers);
|
||||
SET_SENSITIVE ("view-show-scrollbars", display);
|
||||
SET_ACTIVE ("view-show-scrollbars", display && options->show_scrollbars);
|
||||
SET_SENSITIVE ("view-show-statusbar", display);
|
||||
SET_ACTIVE ("view-show-statusbar", display && options->show_statusbar);
|
||||
|
||||
SET_SENSITIVE ("view-shrink-wrap", gdisp);
|
||||
SET_SENSITIVE ("view-fullscreen", gdisp);
|
||||
SET_ACTIVE ("view-fullscreen", gdisp && fullscreen);
|
||||
SET_SENSITIVE ("view-shrink-wrap", display);
|
||||
SET_SENSITIVE ("view-fullscreen", display);
|
||||
SET_ACTIVE ("view-fullscreen", display && fullscreen);
|
||||
|
||||
if (GIMP_IS_DISPLAY (group->user_data) ||
|
||||
GIMP_IS_GIMP (group->user_data))
|
||||
{
|
||||
/* see view_actions_setup() */
|
||||
window_actions_update (group, gdisp ? gdisp->shell : NULL);
|
||||
window_actions_update (group, display ? display->shell : NULL);
|
||||
}
|
||||
|
||||
#undef SET_ACTIVE
|
||||
|
||||
@ -58,9 +58,9 @@
|
||||
gimp_ui_manager_get_action_group (manager, "view"); \
|
||||
gimp_action_group_set_action_active (group, action_name, active); }
|
||||
|
||||
#define IS_ACTIVE_DISPLAY(gdisp) \
|
||||
((gdisp) == \
|
||||
gimp_context_get_display (gimp_get_user_context ((gdisp)->gimage->gimp)))
|
||||
#define IS_ACTIVE_DISPLAY(display) \
|
||||
((display) == \
|
||||
gimp_context_get_display (gimp_get_user_context ((display)->image->gimp)))
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
@ -77,14 +77,14 @@ void
|
||||
view_new_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
gimp_create_display (gdisp->gimage->gimp,
|
||||
gdisp->gimage,
|
||||
gimp_create_display (display->image->gimp,
|
||||
display->image,
|
||||
shell->unit, gimp_zoom_model_get_factor (shell->zoom));
|
||||
}
|
||||
|
||||
@ -92,20 +92,20 @@ void
|
||||
view_zoom_fit_in_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
return_if_no_display (gdisp, data);
|
||||
GimpDisplay *display;
|
||||
return_if_no_display (display, data);
|
||||
|
||||
gimp_display_shell_scale_fit_in (GIMP_DISPLAY_SHELL (gdisp->shell));
|
||||
gimp_display_shell_scale_fit_in (GIMP_DISPLAY_SHELL (display->shell));
|
||||
}
|
||||
|
||||
void
|
||||
view_zoom_fit_to_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
return_if_no_display (gdisp, data);
|
||||
GimpDisplay *display;
|
||||
return_if_no_display (display, data);
|
||||
|
||||
gimp_display_shell_scale_fit_to (GIMP_DISPLAY_SHELL (gdisp->shell));
|
||||
gimp_display_shell_scale_fit_to (GIMP_DISPLAY_SHELL (display->shell));
|
||||
}
|
||||
|
||||
void
|
||||
@ -113,11 +113,11 @@ view_zoom_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
switch ((GimpActionSelectType) value)
|
||||
{
|
||||
@ -170,12 +170,12 @@ view_zoom_explicit_cmd_callback (GtkAction *action,
|
||||
GtkAction *current,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gint value;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
|
||||
|
||||
@ -190,11 +190,11 @@ void
|
||||
view_zoom_other_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
/* check if we are activated by the user or from
|
||||
* view_actions_set_zoom()
|
||||
@ -210,12 +210,12 @@ void
|
||||
view_dot_for_dot_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -226,7 +226,7 @@ view_dot_for_dot_cmd_callback (GtkAction *action,
|
||||
SET_ACTIVE (shell->menubar_manager, "view-dot-for-dot",
|
||||
shell->dot_for_dot);
|
||||
|
||||
if (IS_ACTIVE_DISPLAY (gdisp))
|
||||
if (IS_ACTIVE_DISPLAY (display))
|
||||
SET_ACTIVE (shell->popup_manager, "view-dot-for-dot",
|
||||
shell->dot_for_dot);
|
||||
}
|
||||
@ -237,12 +237,12 @@ view_scroll_horizontal_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gdouble offset;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
offset = action_select_value ((GimpActionSelectType) value,
|
||||
shell->hsbdata->value,
|
||||
@ -260,12 +260,12 @@ view_scroll_vertical_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gdouble offset;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
offset = action_select_value ((GimpActionSelectType) value,
|
||||
shell->vsbdata->value,
|
||||
@ -282,14 +282,14 @@ void
|
||||
view_navigation_window_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
gimp_dialog_factory_dialog_raise (global_dock_factory,
|
||||
gtk_widget_get_screen (gdisp->shell),
|
||||
gtk_widget_get_screen (display->shell),
|
||||
"gimp-navigation-view", -1);
|
||||
}
|
||||
|
||||
@ -297,11 +297,11 @@ void
|
||||
view_display_filters_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
if (! shell->filters_dialog)
|
||||
{
|
||||
@ -319,12 +319,12 @@ void
|
||||
view_toggle_selection_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -335,12 +335,12 @@ void
|
||||
view_toggle_layer_boundary_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -351,12 +351,12 @@ void
|
||||
view_toggle_menubar_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -367,12 +367,12 @@ void
|
||||
view_toggle_rulers_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -383,12 +383,12 @@ void
|
||||
view_toggle_scrollbars_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -399,12 +399,12 @@ void
|
||||
view_toggle_statusbar_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -415,12 +415,12 @@ void
|
||||
view_toggle_guides_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -431,12 +431,12 @@ void
|
||||
view_toggle_grid_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -447,12 +447,12 @@ void
|
||||
view_toggle_sample_points_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -463,12 +463,12 @@ void
|
||||
view_snap_to_guides_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -479,12 +479,12 @@ void
|
||||
view_snap_to_grid_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -495,12 +495,12 @@ void
|
||||
view_snap_to_canvas_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -511,12 +511,12 @@ void
|
||||
view_snap_to_vectors_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
@ -528,13 +528,13 @@ view_padding_color_cmd_callback (GtkAction *action,
|
||||
gint value,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
GimpDisplayOptions *options;
|
||||
gboolean fullscreen;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
fullscreen = gimp_display_shell_get_fullscreen (shell);
|
||||
|
||||
@ -565,18 +565,18 @@ view_padding_color_cmd_callback (GtkAction *action,
|
||||
|
||||
if (! color_dialog)
|
||||
{
|
||||
color_dialog = gimp_color_dialog_new (GIMP_VIEWABLE (gdisp->gimage),
|
||||
color_dialog = gimp_color_dialog_new (GIMP_VIEWABLE (display->image),
|
||||
_("Set Canvas Padding Color"),
|
||||
GTK_STOCK_SELECT_COLOR,
|
||||
_("Set Custom Canvas Padding Color"),
|
||||
gdisp->shell,
|
||||
display->shell,
|
||||
NULL, NULL,
|
||||
&options->padding_color,
|
||||
FALSE, FALSE);
|
||||
|
||||
g_signal_connect (color_dialog, "update",
|
||||
G_CALLBACK (view_padding_color_dialog_update),
|
||||
gdisp->shell);
|
||||
display->shell);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (shell), "padding-color-dialog",
|
||||
color_dialog,
|
||||
@ -594,7 +594,7 @@ view_padding_color_cmd_callback (GtkAction *action,
|
||||
GimpDisplayConfig *config;
|
||||
GimpDisplayOptions *default_options;
|
||||
|
||||
config = GIMP_DISPLAY_CONFIG (gdisp->gimage->gimp->config);
|
||||
config = GIMP_DISPLAY_CONFIG (display->image->gimp->config);
|
||||
|
||||
options->padding_mode_set = FALSE;
|
||||
|
||||
@ -615,22 +615,22 @@ void
|
||||
view_shrink_wrap_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
return_if_no_display (gdisp, data);
|
||||
GimpDisplay *display;
|
||||
return_if_no_display (display, data);
|
||||
|
||||
gimp_display_shell_scale_shrink_wrap (GIMP_DISPLAY_SHELL (gdisp->shell));
|
||||
gimp_display_shell_scale_shrink_wrap (GIMP_DISPLAY_SHELL (display->shell));
|
||||
}
|
||||
|
||||
void
|
||||
view_fullscreen_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplay *display;
|
||||
GimpDisplayShell *shell;
|
||||
gboolean active;
|
||||
return_if_no_display (gdisp, data);
|
||||
return_if_no_display (display, data);
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
|
||||
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
|
||||
|
||||
|
||||
@ -208,8 +208,8 @@ app_run (const gchar *full_prog_name,
|
||||
gimp_message_log_func, &gimp);
|
||||
|
||||
g_log_set_handler (NULL,
|
||||
G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL,
|
||||
gimp_error_log_func, &gimp);
|
||||
G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL,
|
||||
gimp_error_log_func, &gimp);
|
||||
|
||||
units_init (gimp);
|
||||
|
||||
@ -222,7 +222,7 @@ app_run (const gchar *full_prog_name,
|
||||
#ifndef GIMP_CONSOLE_COMPILATION
|
||||
if (no_interface)
|
||||
#endif
|
||||
{
|
||||
{
|
||||
const gchar *msg;
|
||||
|
||||
msg = _("GIMP is not properly installed for the current user.\n"
|
||||
@ -230,14 +230,14 @@ app_run (const gchar *full_prog_name,
|
||||
"To perform user installation, run the GIMP without the '--no-interface' flag.");
|
||||
|
||||
g_printerr ("%s\n\n", msg);
|
||||
}
|
||||
}
|
||||
#ifndef GIMP_CONSOLE_COMPILATION
|
||||
else
|
||||
{
|
||||
{
|
||||
user_install_dialog_run (alternate_system_gimprc,
|
||||
alternate_gimprc,
|
||||
be_verbose);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -318,16 +318,16 @@ app_run (const gchar *full_prog_name,
|
||||
}
|
||||
else
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpImage *image;
|
||||
GimpPDBStatusType status;
|
||||
|
||||
gimage = file_open_with_display (gimp,
|
||||
gimp_get_user_context (gimp),
|
||||
NULL,
|
||||
uri,
|
||||
&status, &error);
|
||||
image = file_open_with_display (gimp,
|
||||
gimp_get_user_context (gimp),
|
||||
NULL,
|
||||
uri,
|
||||
&status, &error);
|
||||
|
||||
if (! gimage && status != GIMP_PDB_CANCEL)
|
||||
if (! image && status != GIMP_PDB_CANCEL)
|
||||
{
|
||||
gchar *filename = file_utils_uri_to_utf8_filename (uri);
|
||||
|
||||
|
||||
@ -257,6 +257,7 @@ INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
|
||||
INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
|
||||
INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
|
||||
INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
|
||||
INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
|
||||
INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
|
||||
INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
|
||||
INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
|
||||
@ -350,7 +351,6 @@ PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
RSVG_REQUIRED_VERSION = @RSVG_REQUIRED_VERSION@
|
||||
RT_LIBS = @RT_LIBS@
|
||||
SCREENSHOT = @SCREENSHOT@
|
||||
SENDMAIL = @SENDMAIL@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
@ -366,6 +366,8 @@ SYMPREFIX = @SYMPREFIX@
|
||||
TIFF = @TIFF@
|
||||
URI_CFLAGS = @URI_CFLAGS@
|
||||
URI_LIBS = @URI_LIBS@
|
||||
USE_BINRELOC_FALSE = @USE_BINRELOC_FALSE@
|
||||
USE_BINRELOC_TRUE = @USE_BINRELOC_TRUE@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WINDRES = @WINDRES@
|
||||
|
||||
@ -142,6 +142,44 @@ gimp_layer_mode_effects_get_type (void)
|
||||
return type;
|
||||
}
|
||||
|
||||
GType
|
||||
gimp_hue_range_get_type (void)
|
||||
{
|
||||
static const GEnumValue values[] =
|
||||
{
|
||||
{ GIMP_ALL_HUES, "GIMP_ALL_HUES", "all-hues" },
|
||||
{ GIMP_RED_HUES, "GIMP_RED_HUES", "red-hues" },
|
||||
{ GIMP_YELLOW_HUES, "GIMP_YELLOW_HUES", "yellow-hues" },
|
||||
{ GIMP_GREEN_HUES, "GIMP_GREEN_HUES", "green-hues" },
|
||||
{ GIMP_CYAN_HUES, "GIMP_CYAN_HUES", "cyan-hues" },
|
||||
{ GIMP_BLUE_HUES, "GIMP_BLUE_HUES", "blue-hues" },
|
||||
{ GIMP_MAGENTA_HUES, "GIMP_MAGENTA_HUES", "magenta-hues" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static const GimpEnumDesc descs[] =
|
||||
{
|
||||
{ GIMP_ALL_HUES, "GIMP_ALL_HUES", NULL },
|
||||
{ GIMP_RED_HUES, "GIMP_RED_HUES", NULL },
|
||||
{ GIMP_YELLOW_HUES, "GIMP_YELLOW_HUES", NULL },
|
||||
{ GIMP_GREEN_HUES, "GIMP_GREEN_HUES", NULL },
|
||||
{ GIMP_CYAN_HUES, "GIMP_CYAN_HUES", NULL },
|
||||
{ GIMP_BLUE_HUES, "GIMP_BLUE_HUES", NULL },
|
||||
{ GIMP_MAGENTA_HUES, "GIMP_MAGENTA_HUES", NULL },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static GType type = 0;
|
||||
|
||||
if (! type)
|
||||
{
|
||||
type = g_enum_register_static ("GimpHueRange", values);
|
||||
gimp_enum_set_value_descriptions (type, descs);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
/* Generated data ends here */
|
||||
|
||||
|
||||
@ -96,6 +96,22 @@ typedef enum
|
||||
} GimpLayerModeEffects;
|
||||
|
||||
|
||||
#define GIMP_TYPE_HUE_RANGE (gimp_hue_range_get_type ())
|
||||
|
||||
GType gimp_hue_range_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_ALL_HUES,
|
||||
GIMP_RED_HUES,
|
||||
GIMP_YELLOW_HUES,
|
||||
GIMP_GREEN_HUES,
|
||||
GIMP_CYAN_HUES,
|
||||
GIMP_BLUE_HUES,
|
||||
GIMP_MAGENTA_HUES
|
||||
} GimpHueRange;
|
||||
|
||||
|
||||
/*
|
||||
* non-registered enums; register them if needed
|
||||
*/
|
||||
@ -107,17 +123,6 @@ typedef enum /*< skip >*/
|
||||
GIMP_NEGATIVE_CONVOL /* add 127 to values */
|
||||
} GimpConvolutionType;
|
||||
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
GIMP_ALL_HUES,
|
||||
GIMP_RED_HUES,
|
||||
GIMP_YELLOW_HUES,
|
||||
GIMP_GREEN_HUES,
|
||||
GIMP_CYAN_HUES,
|
||||
GIMP_BLUE_HUES,
|
||||
GIMP_MAGENTA_HUES
|
||||
} GimpHueRange;
|
||||
|
||||
typedef enum /*< pdb-skip, skip >*/
|
||||
{
|
||||
SIOX_REFINEMENT_NO_CHANGE = 0,
|
||||
|
||||
@ -74,7 +74,7 @@ typedef struct _PixelDataHandle PixelDataHandle;
|
||||
/* functions */
|
||||
|
||||
typedef void (* TileValidateProc) (TileManager *tm,
|
||||
Tile *tile);
|
||||
Tile *tile);
|
||||
|
||||
|
||||
#endif /* __BASE_TYPES_H__ */
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* for _getpid() */
|
||||
#include <process.h> /* for _getpid() */
|
||||
#include "libgimpbase/gimpwin32-io.h"
|
||||
#endif
|
||||
|
||||
@ -173,20 +173,20 @@ base_toast_old_swap_files (const gchar *swap_path)
|
||||
* we'll probably get it the next time around
|
||||
*/
|
||||
|
||||
gint pid = atoi (entry + 9);
|
||||
gint pid = atoi (entry + 9);
|
||||
|
||||
/* On Windows, you can't remove open files anyhow,
|
||||
* so no harm trying.
|
||||
*/
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill (pid, 0))
|
||||
if (kill (pid, 0))
|
||||
#endif
|
||||
{
|
||||
{
|
||||
gchar *filename = g_build_filename (dirname, entry, NULL);
|
||||
|
||||
g_unlink (filename);
|
||||
g_unlink (filename);
|
||||
g_free (filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_dir_close (dir);
|
||||
|
||||
@ -172,8 +172,8 @@ boundary_find (PixelRegion *maskPR,
|
||||
**/
|
||||
BoundSeg *
|
||||
boundary_sort (const BoundSeg *segs,
|
||||
gint num_segs,
|
||||
gint *num_groups)
|
||||
gint num_segs,
|
||||
gint *num_groups)
|
||||
{
|
||||
Boundary *boundary;
|
||||
gint i;
|
||||
@ -207,59 +207,59 @@ boundary_sort (const BoundSeg *segs,
|
||||
|
||||
/* find the index of a non-visited segment to start a group */
|
||||
for (i = 0; i < num_segs; i++)
|
||||
if (segs[i].visited == FALSE)
|
||||
{
|
||||
index = i;
|
||||
empty = FALSE;
|
||||
i = num_segs;
|
||||
}
|
||||
if (segs[i].visited == FALSE)
|
||||
{
|
||||
index = i;
|
||||
empty = FALSE;
|
||||
i = num_segs;
|
||||
}
|
||||
|
||||
if (! empty)
|
||||
{
|
||||
boundary_add_seg (boundary,
|
||||
{
|
||||
boundary_add_seg (boundary,
|
||||
segs[index].x1, segs[index].y1,
|
||||
segs[index].x2, segs[index].y2,
|
||||
segs[index].open);
|
||||
|
||||
((BoundSeg *) segs)[index].visited = TRUE;
|
||||
((BoundSeg *) segs)[index].visited = TRUE;
|
||||
|
||||
startx = segs[index].x1;
|
||||
starty = segs[index].y1;
|
||||
x = segs[index].x2;
|
||||
y = segs[index].y2;
|
||||
startx = segs[index].x1;
|
||||
starty = segs[index].y1;
|
||||
x = segs[index].x2;
|
||||
y = segs[index].y2;
|
||||
|
||||
while ((index = find_segment (segs, num_segs, x, y)) != -1)
|
||||
{
|
||||
/* make sure ordering is correct */
|
||||
if (x == segs[index].x1 && y == segs[index].y1)
|
||||
{
|
||||
boundary_add_seg (boundary,
|
||||
while ((index = find_segment (segs, num_segs, x, y)) != -1)
|
||||
{
|
||||
/* make sure ordering is correct */
|
||||
if (x == segs[index].x1 && y == segs[index].y1)
|
||||
{
|
||||
boundary_add_seg (boundary,
|
||||
segs[index].x1, segs[index].y1,
|
||||
segs[index].x2, segs[index].y2,
|
||||
segs[index].open);
|
||||
x = segs[index].x2;
|
||||
y = segs[index].y2;
|
||||
}
|
||||
else
|
||||
{
|
||||
boundary_add_seg (boundary,
|
||||
x = segs[index].x2;
|
||||
y = segs[index].y2;
|
||||
}
|
||||
else
|
||||
{
|
||||
boundary_add_seg (boundary,
|
||||
segs[index].x2, segs[index].y2,
|
||||
segs[index].x1, segs[index].y1,
|
||||
segs[index].open);
|
||||
x = segs[index].x1;
|
||||
y = segs[index].y1;
|
||||
}
|
||||
x = segs[index].x1;
|
||||
y = segs[index].y1;
|
||||
}
|
||||
|
||||
((BoundSeg *) segs)[index].visited = TRUE;
|
||||
}
|
||||
((BoundSeg *) segs)[index].visited = TRUE;
|
||||
}
|
||||
|
||||
if (x != startx || y != starty)
|
||||
g_warning ("sort_boundary(): Unconnected boundary group!");
|
||||
if (x != startx || y != starty)
|
||||
g_warning ("sort_boundary(): Unconnected boundary group!");
|
||||
|
||||
/* Mark the end of a group */
|
||||
*num_groups = *num_groups + 1;
|
||||
boundary_add_seg (boundary, -1, -1, -1, -1, 0);
|
||||
}
|
||||
/* Mark the end of a group */
|
||||
*num_groups = *num_groups + 1;
|
||||
boundary_add_seg (boundary, -1, -1, -1, -1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return boundary_free (boundary, FALSE);
|
||||
@ -419,15 +419,15 @@ boundary_add_seg (Boundary *boundary,
|
||||
|
||||
static void
|
||||
find_empty_segs (PixelRegion *maskPR,
|
||||
gint scanline,
|
||||
gint empty_segs[],
|
||||
gint max_empty,
|
||||
gint *num_empty,
|
||||
BoundaryType type,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
gint scanline,
|
||||
gint empty_segs[],
|
||||
gint max_empty,
|
||||
gint *num_empty,
|
||||
BoundaryType type,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
guchar threshold)
|
||||
{
|
||||
guchar *data;
|
||||
@ -457,11 +457,11 @@ find_empty_segs (PixelRegion *maskPR,
|
||||
if (type == BOUNDARY_WITHIN_BOUNDS)
|
||||
{
|
||||
if (scanline < y1 || scanline >= y2)
|
||||
{
|
||||
empty_segs[(*num_empty)++] = 0;
|
||||
empty_segs[(*num_empty)++] = G_MAXINT;
|
||||
return;
|
||||
}
|
||||
{
|
||||
empty_segs[(*num_empty)++] = 0;
|
||||
empty_segs[(*num_empty)++] = G_MAXINT;
|
||||
return;
|
||||
}
|
||||
|
||||
start = x1;
|
||||
end = x2;
|
||||
@ -471,7 +471,7 @@ find_empty_segs (PixelRegion *maskPR,
|
||||
start = maskPR->x;
|
||||
end = maskPR->x + maskPR->w;
|
||||
if (scanline < y1 || scanline >= y2)
|
||||
x2 = -1;
|
||||
x2 = -1;
|
||||
}
|
||||
|
||||
tilex = -1;
|
||||
@ -498,12 +498,12 @@ find_empty_segs (PixelRegion *maskPR,
|
||||
if (tile)
|
||||
tile_release (tile, FALSE);
|
||||
tile = tile_manager_get_tile (maskPR->tiles,
|
||||
x, scanline, TRUE, FALSE);
|
||||
x, scanline, TRUE, FALSE);
|
||||
data =
|
||||
(guchar *) tile_data_pointer (tile,
|
||||
x % TILE_WIDTH,
|
||||
scanline % TILE_HEIGHT) +
|
||||
(tile_bpp(tile) - 1);
|
||||
(guchar *) tile_data_pointer (tile,
|
||||
x % TILE_WIDTH,
|
||||
scanline % TILE_HEIGHT) +
|
||||
(tile_bpp(tile) - 1);
|
||||
|
||||
tilex = x / TILE_WIDTH;
|
||||
dstep = tile_bpp (tile);
|
||||
@ -514,42 +514,42 @@ find_empty_segs (PixelRegion *maskPR,
|
||||
}
|
||||
|
||||
if (type == BOUNDARY_IGNORE_BOUNDS && (endx > x1 || x < x2))
|
||||
{
|
||||
for (; x < endx; x++)
|
||||
{
|
||||
if (*data > threshold)
|
||||
if (x >= x1 && x < x2)
|
||||
val = -1;
|
||||
else
|
||||
val = 1;
|
||||
else
|
||||
val = -1;
|
||||
{
|
||||
for (; x < endx; x++)
|
||||
{
|
||||
if (*data > threshold)
|
||||
if (x >= x1 && x < x2)
|
||||
val = -1;
|
||||
else
|
||||
val = 1;
|
||||
else
|
||||
val = -1;
|
||||
|
||||
data += dstep;
|
||||
data += dstep;
|
||||
|
||||
if (last != val)
|
||||
empty_segs[l_num_empty++] = x;
|
||||
if (last != val)
|
||||
empty_segs[l_num_empty++] = x;
|
||||
|
||||
last = val;
|
||||
}
|
||||
}
|
||||
last = val;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (; x < endx; x++)
|
||||
{
|
||||
if (*data > threshold)
|
||||
val = 1;
|
||||
else
|
||||
val = -1;
|
||||
{
|
||||
for (; x < endx; x++)
|
||||
{
|
||||
if (*data > threshold)
|
||||
val = 1;
|
||||
else
|
||||
val = -1;
|
||||
|
||||
data += dstep;
|
||||
data += dstep;
|
||||
|
||||
if (last != val)
|
||||
empty_segs[l_num_empty++] = x;
|
||||
if (last != val)
|
||||
empty_segs[l_num_empty++] = x;
|
||||
|
||||
last = val;
|
||||
}
|
||||
}
|
||||
last = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*num_empty = l_num_empty;
|
||||
@ -566,10 +566,10 @@ find_empty_segs (PixelRegion *maskPR,
|
||||
static void
|
||||
process_horiz_seg (Boundary *boundary,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
gboolean open)
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
gboolean open)
|
||||
{
|
||||
/* This procedure accounts for any vertical segments that must be
|
||||
drawn to close in the horizontal segments. */
|
||||
@ -596,11 +596,11 @@ process_horiz_seg (Boundary *boundary,
|
||||
static void
|
||||
make_horiz_segs (Boundary *boundary,
|
||||
gint start,
|
||||
gint end,
|
||||
gint scanline,
|
||||
gint empty[],
|
||||
gint num_empty,
|
||||
gint top)
|
||||
gint end,
|
||||
gint scanline,
|
||||
gint empty[],
|
||||
gint num_empty,
|
||||
gint top)
|
||||
{
|
||||
gint empty_index;
|
||||
gint e_s, e_e; /* empty segment start and end values */
|
||||
@ -611,23 +611,23 @@ make_horiz_segs (Boundary *boundary,
|
||||
e_e = *empty++;
|
||||
|
||||
if (e_s <= start && e_e >= end)
|
||||
process_horiz_seg (boundary,
|
||||
process_horiz_seg (boundary,
|
||||
start, scanline, end, scanline, top);
|
||||
else if ((e_s > start && e_s < end) ||
|
||||
(e_e < end && e_e > start))
|
||||
process_horiz_seg (boundary,
|
||||
(e_e < end && e_e > start))
|
||||
process_horiz_seg (boundary,
|
||||
MAX (e_s, start), scanline,
|
||||
MIN (e_e, end), scanline, top);
|
||||
MIN (e_e, end), scanline, top);
|
||||
}
|
||||
}
|
||||
|
||||
static Boundary *
|
||||
generate_boundary (PixelRegion *PR,
|
||||
BoundaryType type,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
BoundaryType type,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
guchar threshold)
|
||||
{
|
||||
Boundary *boundary;
|
||||
@ -658,34 +658,34 @@ generate_boundary (PixelRegion *PR,
|
||||
|
||||
/* Find the empty segments for the previous and current scanlines */
|
||||
find_empty_segs (PR, start - 1, boundary->empty_segs_l,
|
||||
boundary->max_empty_segs, &num_empty_l,
|
||||
type, x1, y1, x2, y2,
|
||||
boundary->max_empty_segs, &num_empty_l,
|
||||
type, x1, y1, x2, y2,
|
||||
threshold);
|
||||
find_empty_segs (PR, start, boundary->empty_segs_c,
|
||||
boundary->max_empty_segs, &num_empty_c,
|
||||
type, x1, y1, x2, y2,
|
||||
boundary->max_empty_segs, &num_empty_c,
|
||||
type, x1, y1, x2, y2,
|
||||
threshold);
|
||||
|
||||
for (scanline = start; scanline < end; scanline++)
|
||||
{
|
||||
/* find the empty segment list for the next scanline */
|
||||
find_empty_segs (PR, scanline + 1, boundary->empty_segs_n,
|
||||
boundary->max_empty_segs, &num_empty_n,
|
||||
type, x1, y1, x2, y2,
|
||||
boundary->max_empty_segs, &num_empty_n,
|
||||
type, x1, y1, x2, y2,
|
||||
threshold);
|
||||
|
||||
/* process the segments on the current scanline */
|
||||
for (i = 1; i < num_empty_c - 1; i += 2)
|
||||
{
|
||||
make_horiz_segs (boundary,
|
||||
{
|
||||
make_horiz_segs (boundary,
|
||||
boundary->empty_segs_c [i],
|
||||
boundary->empty_segs_c [i+1],
|
||||
scanline, boundary->empty_segs_l, num_empty_l, 1);
|
||||
make_horiz_segs (boundary,
|
||||
scanline, boundary->empty_segs_l, num_empty_l, 1);
|
||||
make_horiz_segs (boundary,
|
||||
boundary->empty_segs_c [i],
|
||||
boundary->empty_segs_c [i+1],
|
||||
scanline + 1, boundary->empty_segs_n, num_empty_n, 0);
|
||||
}
|
||||
scanline + 1, boundary->empty_segs_n, num_empty_n, 0);
|
||||
}
|
||||
|
||||
/* get the next scanline of empty segments, swap others */
|
||||
tmp_segs = boundary->empty_segs_l;
|
||||
@ -703,16 +703,16 @@ generate_boundary (PixelRegion *PR,
|
||||
|
||||
static gint
|
||||
find_segment (const BoundSeg *segs,
|
||||
gint num_segs,
|
||||
gint x,
|
||||
gint y)
|
||||
gint num_segs,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
gint index;
|
||||
|
||||
for (index = 0; index < num_segs; index++)
|
||||
if (((segs[index].x1 == x && segs[index].y1 == y) ||
|
||||
(segs[index].x2 == x && segs[index].y2 == y)) &&
|
||||
segs[index].visited == FALSE)
|
||||
segs[index].visited == FALSE)
|
||||
return index;
|
||||
|
||||
return -1;
|
||||
|
||||
@ -43,16 +43,16 @@ struct _BoundSeg
|
||||
|
||||
|
||||
BoundSeg * boundary_find (PixelRegion *maskPR,
|
||||
BoundaryType type,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
BoundaryType type,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
guchar threshold,
|
||||
gint *num_segs);
|
||||
gint *num_segs);
|
||||
BoundSeg * boundary_sort (const BoundSeg *segs,
|
||||
gint num_segs,
|
||||
gint *num_groups);
|
||||
gint num_segs,
|
||||
gint *num_groups);
|
||||
BoundSeg * boundary_simplify (BoundSeg *sorted_segs,
|
||||
gint num_groups,
|
||||
gint *num_segs);
|
||||
|
||||
@ -21,11 +21,11 @@
|
||||
|
||||
|
||||
MaskBuf * brush_scale_mask (MaskBuf *brush_mask,
|
||||
gint dest_width,
|
||||
gint dest_height);
|
||||
gint dest_width,
|
||||
gint dest_height);
|
||||
MaskBuf * brush_scale_pixmap (MaskBuf *pixmap,
|
||||
gint dest_width,
|
||||
gint dest_height);
|
||||
gint dest_width,
|
||||
gint dest_height);
|
||||
|
||||
|
||||
#endif /* __BRUSH_SCALE_H__ */
|
||||
|
||||
@ -149,7 +149,7 @@ color_balance_create_lookup_tables (ColorBalance *cb)
|
||||
void
|
||||
color_balance (ColorBalance *cb,
|
||||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR)
|
||||
PixelRegion *destPR)
|
||||
{
|
||||
const guchar *src, *s;
|
||||
guchar *dest, *d;
|
||||
@ -170,32 +170,32 @@ color_balance (ColorBalance *cb,
|
||||
d = dest;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
r = s[RED_PIX];
|
||||
g = s[GREEN_PIX];
|
||||
b = s[BLUE_PIX];
|
||||
{
|
||||
r = s[RED_PIX];
|
||||
g = s[GREEN_PIX];
|
||||
b = s[BLUE_PIX];
|
||||
|
||||
r_n = cb->r_lookup[r];
|
||||
g_n = cb->g_lookup[g];
|
||||
b_n = cb->b_lookup[b];
|
||||
r_n = cb->r_lookup[r];
|
||||
g_n = cb->g_lookup[g];
|
||||
b_n = cb->b_lookup[b];
|
||||
|
||||
if (cb->preserve_luminosity)
|
||||
{
|
||||
gimp_rgb_to_hsl_int (&r_n, &g_n, &b_n);
|
||||
b_n = gimp_rgb_to_l_int (r, g, b);
|
||||
gimp_hsl_to_rgb_int (&r_n, &g_n, &b_n);
|
||||
}
|
||||
if (cb->preserve_luminosity)
|
||||
{
|
||||
gimp_rgb_to_hsl_int (&r_n, &g_n, &b_n);
|
||||
b_n = gimp_rgb_to_l_int (r, g, b);
|
||||
gimp_hsl_to_rgb_int (&r_n, &g_n, &b_n);
|
||||
}
|
||||
|
||||
d[RED_PIX] = r_n;
|
||||
d[GREEN_PIX] = g_n;
|
||||
d[BLUE_PIX] = b_n;
|
||||
d[RED_PIX] = r_n;
|
||||
d[GREEN_PIX] = g_n;
|
||||
d[BLUE_PIX] = b_n;
|
||||
|
||||
if (alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
if (alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
|
||||
s += srcPR->bytes;
|
||||
d += destPR->bytes;
|
||||
}
|
||||
s += srcPR->bytes;
|
||||
d += destPR->bytes;
|
||||
}
|
||||
|
||||
src += srcPR->rowstride;
|
||||
dest += destPR->rowstride;
|
||||
@ -213,12 +213,12 @@ color_balance_transfer_init (void)
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
highlights_add[i] =
|
||||
shadows_sub[255 - i] = (1.075 - 1 / ((gdouble) i / 16.0 + 1));
|
||||
shadows_sub[255 - i] = (1.075 - 1 / ((gdouble) i / 16.0 + 1));
|
||||
|
||||
midtones_add[i] =
|
||||
midtones_sub[i] = 0.667 * (1 - SQR (((gdouble) i - 127.0) / 127.0));
|
||||
midtones_sub[i] = 0.667 * (1 - SQR (((gdouble) i - 127.0) / 127.0));
|
||||
|
||||
shadows_add[i] =
|
||||
highlights_sub[i] = 0.667 * (1 - SQR (((gdouble) i - 127.0) / 127.0));
|
||||
highlights_sub[i] = 0.667 * (1 - SQR (((gdouble) i - 127.0) / 127.0));
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ void color_balance_range_reset (ColorBalance *cb,
|
||||
void color_balance_create_lookup_tables (ColorBalance *cb);
|
||||
void color_balance (ColorBalance *cb,
|
||||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR);
|
||||
PixelRegion *destPR);
|
||||
|
||||
|
||||
#endif /* __COLOR_BALANCE_H__ */
|
||||
|
||||
@ -97,7 +97,7 @@ colorize (Colorize *colorize,
|
||||
d = dest;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
{
|
||||
lum = (colorize->lum_red_lookup[s[RED_PIX]] +
|
||||
colorize->lum_green_lookup[s[GREEN_PIX]] +
|
||||
colorize->lum_blue_lookup[s[BLUE_PIX]]); /* luminosity */
|
||||
@ -117,12 +117,12 @@ colorize (Colorize *colorize,
|
||||
d[GREEN_PIX] = colorize->final_green_lookup[lum];
|
||||
d[BLUE_PIX] = colorize->final_blue_lookup[lum];
|
||||
|
||||
if (alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
if (alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
|
||||
s += srcPR->bytes;
|
||||
d += destPR->bytes;
|
||||
}
|
||||
s += srcPR->bytes;
|
||||
d += destPR->bytes;
|
||||
}
|
||||
|
||||
src += srcPR->rowstride;
|
||||
dest += destPR->rowstride;
|
||||
|
||||
@ -277,8 +277,8 @@ rgbxyzrgb_init(void)
|
||||
|
||||
static void
|
||||
xyz_to_rgb (double *inx_outr,
|
||||
double *iny_outg,
|
||||
double *inz_outb)
|
||||
double *iny_outg,
|
||||
double *inz_outb)
|
||||
{
|
||||
const double x = *inx_outr;
|
||||
const double y = *iny_outg;
|
||||
@ -292,8 +292,8 @@ xyz_to_rgb (double *inx_outr,
|
||||
|
||||
static void
|
||||
rgb_to_xyz (double *inr_outx,
|
||||
double *ing_outy,
|
||||
double *inb_outz)
|
||||
double *ing_outy,
|
||||
double *inb_outz)
|
||||
{
|
||||
const double r = *inr_outx;
|
||||
const double g = *ing_outy;
|
||||
@ -335,8 +335,8 @@ ffunc_inv(const double t)
|
||||
|
||||
static void
|
||||
xyz_to_lab (double *inx,
|
||||
double *iny,
|
||||
double *inz)
|
||||
double *iny,
|
||||
double *inz)
|
||||
{
|
||||
double L,a,b;
|
||||
double ffuncY;
|
||||
@ -347,24 +347,24 @@ xyz_to_lab (double *inx,
|
||||
if (Y > 0.0F)
|
||||
{
|
||||
if (Y > 0.008856F)
|
||||
{
|
||||
L = (116.0F * cbrt(Y)) - 16.0F;
|
||||
}
|
||||
{
|
||||
L = (116.0F * cbrt(Y)) - 16.0F;
|
||||
}
|
||||
else
|
||||
{
|
||||
L = (Y * 903.3F);
|
||||
}
|
||||
{
|
||||
L = (Y * 903.3F);
|
||||
}
|
||||
|
||||
#ifdef SANITY
|
||||
if (L < 0.0F)
|
||||
{
|
||||
g_printerr (" <eek1>%f \007",(float)L);
|
||||
}
|
||||
{
|
||||
g_printerr (" <eek1>%f \007",(float)L);
|
||||
}
|
||||
|
||||
if (L > 100.0F)
|
||||
{
|
||||
g_printerr (" <eek2>%f \007",(float)L);
|
||||
}
|
||||
{
|
||||
g_printerr (" <eek2>%f \007",(float)L);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -384,8 +384,8 @@ xyz_to_lab (double *inx,
|
||||
|
||||
static void
|
||||
lab_to_xyz (double *inl,
|
||||
double *ina,
|
||||
double *inb)
|
||||
double *ina,
|
||||
double *inb)
|
||||
{
|
||||
double X,Y,Z;
|
||||
double P;
|
||||
@ -413,19 +413,19 @@ lab_to_xyz (double *inl,
|
||||
if (X<-0.00000F)
|
||||
{
|
||||
if (X<-0.0001F)
|
||||
g_printerr ("{badX %f {%f,%f,%f}}",X,L,a,b);
|
||||
g_printerr ("{badX %f {%f,%f,%f}}",X,L,a,b);
|
||||
X = 0.0F;
|
||||
}
|
||||
if (Y<-0.00000F)
|
||||
{
|
||||
if (Y<-0.0001F)
|
||||
g_printerr ("{badY %f}",Y);
|
||||
g_printerr ("{badY %f}",Y);
|
||||
Y = 0.0F;
|
||||
}
|
||||
if (Z<-0.00000F)
|
||||
{
|
||||
if (Z<-0.1F)
|
||||
g_printerr ("{badZ %f}",Z);
|
||||
g_printerr ("{badZ %f}",Z);
|
||||
Z = 0.0F;
|
||||
}
|
||||
#endif
|
||||
@ -454,7 +454,7 @@ void
|
||||
cpercep_rgb_to_space (double inr,
|
||||
double ing,
|
||||
double inb,
|
||||
double *outr,
|
||||
double *outr,
|
||||
double *outg,
|
||||
double *outb)
|
||||
{
|
||||
@ -519,7 +519,7 @@ cpercep_rgb_to_space (double inr,
|
||||
if (inr < 0.0F || ing < 0.0F || inb < 0.0F)
|
||||
{
|
||||
g_printerr (" [BAD2 XYZ: %f,%f,%f]\007 ",
|
||||
inr,ing,inb);
|
||||
inr,ing,inb);
|
||||
}
|
||||
#endif /* SANITY */
|
||||
|
||||
@ -535,7 +535,7 @@ void
|
||||
cpercep_space_to_rgb (double inr,
|
||||
double ing,
|
||||
double inb,
|
||||
double *outr,
|
||||
double *outr,
|
||||
double *outg,
|
||||
double *outb)
|
||||
{
|
||||
@ -545,7 +545,7 @@ cpercep_space_to_rgb (double inr,
|
||||
if (inr<-0.0F || ing<-0.0F || inb<-0.0F)
|
||||
{
|
||||
g_printerr (" [BAD1 XYZ: %f,%f,%f]\007 ",
|
||||
inr,ing,inb);
|
||||
inr,ing,inb);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -588,7 +588,7 @@ cpercep_space_to_rgb (double inr,
|
||||
|
||||
const double
|
||||
xscaler(const double start, const double end,
|
||||
const double me, const double him)
|
||||
const double me, const double him)
|
||||
{
|
||||
return start + ((end-start) * him) / (me + him);
|
||||
}
|
||||
@ -596,9 +596,9 @@ xscaler(const double start, const double end,
|
||||
|
||||
void
|
||||
mix_colours (const double L1, const double a1, const double b1,
|
||||
const double L2, const double a2, const double b2,
|
||||
double *rtnL, double *rtna, double *rtnb,
|
||||
double mass1, double mass2)
|
||||
const double L2, const double a2, const double b2,
|
||||
double *rtnL, double *rtna, double *rtnb,
|
||||
double mass1, double mass2)
|
||||
{
|
||||
double w1, w2;
|
||||
|
||||
@ -622,7 +622,7 @@ mix_colours (const double L1, const double a1, const double b1,
|
||||
w2 <= 0.0)
|
||||
{
|
||||
*rtna =
|
||||
*rtnb = 0.0;
|
||||
*rtnb = 0.0;
|
||||
#ifdef SANITY
|
||||
/* g_printerr ("\007OUCH. "); */
|
||||
#endif
|
||||
|
||||
@ -56,7 +56,7 @@ void cpercep_space_to_rgb (double inr,
|
||||
/* This is in the header so that it can potentially be inlined. */
|
||||
static const double
|
||||
cpercep_distance_space (const double L1, const double a1, const double b1,
|
||||
const double L2, const double a2, const double b2)
|
||||
const double L2, const double a2, const double b2)
|
||||
{
|
||||
const double Ld = L1 - L2;
|
||||
const double ad = a1 - a2;
|
||||
|
||||
@ -79,7 +79,7 @@ enum
|
||||
ARCH_X86_INTEL_FEATURE_PNI = 1 << 0
|
||||
};
|
||||
|
||||
#if !defined(ARCH_X86_64) && defined(PIC)
|
||||
#if !defined(ARCH_X86_64) && (defined(PIC) || defined(__PIC__))
|
||||
#define cpuid(op,eax,ebx,ecx,edx) \
|
||||
__asm__ ("movl %%ebx, %%esi\n\t" \
|
||||
"cpuid\n\t" \
|
||||
|
||||
@ -118,31 +118,31 @@ curves_calculate_curve (Curves *curves,
|
||||
/* cycle through the curves */
|
||||
num_pts = 0;
|
||||
for (i = 0; i < CURVES_NUM_POINTS; i++)
|
||||
if (curves->points[channel][i][0] != -1)
|
||||
points[num_pts++] = i;
|
||||
if (curves->points[channel][i][0] != -1)
|
||||
points[num_pts++] = i;
|
||||
|
||||
/* Initialize boundary curve points */
|
||||
if (num_pts != 0)
|
||||
{
|
||||
for (i = 0; i < curves->points[channel][points[0]][0]; i++)
|
||||
curves->curve[channel][i] = curves->points[channel][points[0]][1];
|
||||
{
|
||||
for (i = 0; i < curves->points[channel][points[0]][0]; i++)
|
||||
curves->curve[channel][i] = curves->points[channel][points[0]][1];
|
||||
|
||||
for (i = curves->points[channel][points[num_pts - 1]][0];
|
||||
for (i = curves->points[channel][points[num_pts - 1]][0];
|
||||
i < 256;
|
||||
i++)
|
||||
curves->curve[channel][i] =
|
||||
curves->curve[channel][i] =
|
||||
curves->points[channel][points[num_pts - 1]][1];
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < num_pts - 1; i++)
|
||||
{
|
||||
p1 = (i == 0) ? points[i] : points[(i - 1)];
|
||||
p2 = points[i];
|
||||
p3 = points[i + 1];
|
||||
p4 = (i == (num_pts - 2)) ? points[num_pts - 1] : points[i + 2];
|
||||
{
|
||||
p1 = (i == 0) ? points[i] : points[(i - 1)];
|
||||
p2 = points[i];
|
||||
p3 = points[i + 1];
|
||||
p4 = (i == (num_pts - 2)) ? points[num_pts - 1] : points[i + 2];
|
||||
|
||||
curves_plot_curve (curves, channel, p1, p2, p3, p4);
|
||||
}
|
||||
curves_plot_curve (curves, channel, p1, p2, p3, p4);
|
||||
}
|
||||
|
||||
/* ensure that the control points are used exactly */
|
||||
for (i = 0; i < num_pts; i++)
|
||||
@ -159,9 +159,9 @@ curves_calculate_curve (Curves *curves,
|
||||
|
||||
gfloat
|
||||
curves_lut_func (Curves *curves,
|
||||
gint n_channels,
|
||||
gint channel,
|
||||
gfloat value)
|
||||
gint n_channels,
|
||||
gint channel,
|
||||
gfloat value)
|
||||
{
|
||||
gfloat f;
|
||||
gint index;
|
||||
@ -217,10 +217,10 @@ curves_lut_func (Curves *curves,
|
||||
static void
|
||||
curves_plot_curve (Curves *curves,
|
||||
gint channel,
|
||||
gint p1,
|
||||
gint p2,
|
||||
gint p3,
|
||||
gint p4)
|
||||
gint p1,
|
||||
gint p2,
|
||||
gint p3,
|
||||
gint p4)
|
||||
{
|
||||
CRMatrix geometry;
|
||||
CRMatrix tmp1, tmp2;
|
||||
@ -301,7 +301,7 @@ curves_plot_curve (Curves *curves,
|
||||
|
||||
/* if this point is different than the last one...then draw it */
|
||||
if ((lastx != newx) || (lasty != newy))
|
||||
curves->curve[channel][newx] = newy;
|
||||
curves->curve[channel][newx] = newy;
|
||||
|
||||
lastx = newx;
|
||||
lasty = newy;
|
||||
@ -310,8 +310,8 @@ curves_plot_curve (Curves *curves,
|
||||
|
||||
static void
|
||||
curves_CR_compose (CRMatrix a,
|
||||
CRMatrix b,
|
||||
CRMatrix ab)
|
||||
CRMatrix b,
|
||||
CRMatrix ab)
|
||||
{
|
||||
gint i, j;
|
||||
|
||||
|
||||
@ -35,9 +35,9 @@ void curves_channel_reset (Curves *curves,
|
||||
void curves_calculate_curve (Curves *curves,
|
||||
GimpHistogramChannel channel);
|
||||
gfloat curves_lut_func (Curves *curves,
|
||||
gint nchannels,
|
||||
gint channel,
|
||||
gfloat value);
|
||||
gint nchannels,
|
||||
gint channel,
|
||||
gfloat value);
|
||||
|
||||
|
||||
#endif /* __CURVES_H__ */
|
||||
|
||||
@ -86,8 +86,8 @@ gimp_histogram_free (GimpHistogram *histogram)
|
||||
|
||||
void
|
||||
gimp_histogram_calculate (GimpHistogram *histogram,
|
||||
PixelRegion *region,
|
||||
PixelRegion *mask)
|
||||
PixelRegion *region,
|
||||
PixelRegion *mask)
|
||||
{
|
||||
gint i;
|
||||
|
||||
@ -129,7 +129,7 @@ gimp_histogram_calculate (GimpHistogram *histogram,
|
||||
|
||||
gdouble
|
||||
gimp_histogram_get_maximum (GimpHistogram *histogram,
|
||||
GimpHistogramChannel channel)
|
||||
GimpHistogramChannel channel)
|
||||
{
|
||||
gdouble max = 0.0;
|
||||
gint x;
|
||||
@ -147,9 +147,9 @@ gimp_histogram_get_maximum (GimpHistogram *histogram,
|
||||
if (channel == GIMP_HISTOGRAM_RGB)
|
||||
for (x = 0; x < 256; x++)
|
||||
{
|
||||
max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, x));
|
||||
max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, x));
|
||||
max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, x));
|
||||
max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, x));
|
||||
max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, x));
|
||||
max = MAX (max, HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, x));
|
||||
}
|
||||
else
|
||||
for (x = 0; x < 256; x++)
|
||||
@ -162,8 +162,8 @@ gimp_histogram_get_maximum (GimpHistogram *histogram,
|
||||
|
||||
gdouble
|
||||
gimp_histogram_get_value (GimpHistogram *histogram,
|
||||
GimpHistogramChannel channel,
|
||||
gint bin)
|
||||
GimpHistogramChannel channel,
|
||||
gint bin)
|
||||
{
|
||||
g_return_val_if_fail (histogram != NULL, 0.0);
|
||||
|
||||
@ -193,8 +193,8 @@ gimp_histogram_get_value (GimpHistogram *histogram,
|
||||
|
||||
gdouble
|
||||
gimp_histogram_get_channel (GimpHistogram *histogram,
|
||||
GimpHistogramChannel channel,
|
||||
gint bin)
|
||||
GimpHistogramChannel channel,
|
||||
gint bin)
|
||||
{
|
||||
g_return_val_if_fail (histogram != NULL, 0.0);
|
||||
|
||||
@ -215,8 +215,8 @@ gimp_histogram_n_channels (GimpHistogram *histogram)
|
||||
gdouble
|
||||
gimp_histogram_get_count (GimpHistogram *histogram,
|
||||
GimpHistogramChannel channel,
|
||||
gint start,
|
||||
gint end)
|
||||
gint start,
|
||||
gint end)
|
||||
{
|
||||
gint i;
|
||||
gdouble count = 0.0;
|
||||
@ -230,9 +230,9 @@ gimp_histogram_get_count (GimpHistogram *histogram,
|
||||
if (channel == GIMP_HISTOGRAM_RGB)
|
||||
return (gimp_histogram_get_count (histogram,
|
||||
GIMP_HISTOGRAM_RED, start, end) +
|
||||
gimp_histogram_get_count (histogram,
|
||||
gimp_histogram_get_count (histogram,
|
||||
GIMP_HISTOGRAM_GREEN, start, end) +
|
||||
gimp_histogram_get_count (histogram,
|
||||
gimp_histogram_get_count (histogram,
|
||||
GIMP_HISTOGRAM_BLUE, start, end));
|
||||
|
||||
if (! histogram->values[0] ||
|
||||
@ -251,9 +251,9 @@ gimp_histogram_get_count (GimpHistogram *histogram,
|
||||
|
||||
gdouble
|
||||
gimp_histogram_get_mean (GimpHistogram *histogram,
|
||||
GimpHistogramChannel channel,
|
||||
gint start,
|
||||
gint end)
|
||||
GimpHistogramChannel channel,
|
||||
gint start,
|
||||
gint end)
|
||||
{
|
||||
gint i;
|
||||
gdouble mean = 0.0;
|
||||
@ -277,14 +277,14 @@ gimp_histogram_get_mean (GimpHistogram *histogram,
|
||||
if (channel == GIMP_HISTOGRAM_RGB)
|
||||
{
|
||||
for (i = start; i <= end; i++)
|
||||
mean += (i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, i) +
|
||||
i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, i) +
|
||||
i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, i));
|
||||
mean += (i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, i) +
|
||||
i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, i) +
|
||||
i * HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, i));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = start; i <= end; i++)
|
||||
mean += i * HISTOGRAM_VALUE (channel, i);
|
||||
mean += i * HISTOGRAM_VALUE (channel, i);
|
||||
}
|
||||
|
||||
count = gimp_histogram_get_count (histogram, channel, start, end);
|
||||
@ -297,9 +297,9 @@ gimp_histogram_get_mean (GimpHistogram *histogram,
|
||||
|
||||
gint
|
||||
gimp_histogram_get_median (GimpHistogram *histogram,
|
||||
GimpHistogramChannel channel,
|
||||
gint start,
|
||||
gint end)
|
||||
GimpHistogramChannel channel,
|
||||
gint start,
|
||||
gint end)
|
||||
{
|
||||
gint i;
|
||||
gdouble sum = 0.0;
|
||||
@ -325,20 +325,20 @@ gimp_histogram_get_median (GimpHistogram *histogram,
|
||||
if (channel == GIMP_HISTOGRAM_RGB)
|
||||
for (i = start; i <= end; i++)
|
||||
{
|
||||
sum += (HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, i) +
|
||||
HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, i) +
|
||||
HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, i));
|
||||
sum += (HISTOGRAM_VALUE (GIMP_HISTOGRAM_RED, i) +
|
||||
HISTOGRAM_VALUE (GIMP_HISTOGRAM_GREEN, i) +
|
||||
HISTOGRAM_VALUE (GIMP_HISTOGRAM_BLUE, i));
|
||||
|
||||
if (sum * 2 > count)
|
||||
return i;
|
||||
if (sum * 2 > count)
|
||||
return i;
|
||||
}
|
||||
else
|
||||
for (i = start; i <= end; i++)
|
||||
{
|
||||
sum += HISTOGRAM_VALUE (channel, i);
|
||||
sum += HISTOGRAM_VALUE (channel, i);
|
||||
|
||||
if (sum * 2 > count)
|
||||
return i;
|
||||
if (sum * 2 > count)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
@ -346,9 +346,9 @@ gimp_histogram_get_median (GimpHistogram *histogram,
|
||||
|
||||
gdouble
|
||||
gimp_histogram_get_std_dev (GimpHistogram *histogram,
|
||||
GimpHistogramChannel channel,
|
||||
gint start,
|
||||
gint end)
|
||||
GimpHistogramChannel channel,
|
||||
gint start,
|
||||
gint end)
|
||||
{
|
||||
gint i;
|
||||
gdouble dev = 0.0;
|
||||
@ -413,8 +413,8 @@ gimp_histogram_free_values (GimpHistogram *histogram)
|
||||
|
||||
static void
|
||||
gimp_histogram_calculate_sub_region (GimpHistogram *histogram,
|
||||
PixelRegion *region,
|
||||
PixelRegion *mask)
|
||||
PixelRegion *region,
|
||||
PixelRegion *mask)
|
||||
{
|
||||
const guchar *src, *msrc;
|
||||
const guchar *m, *s;
|
||||
@ -466,15 +466,15 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram,
|
||||
m = msrc;
|
||||
w = region->w;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
masked = m[0] / 255.0;
|
||||
while (w--)
|
||||
{
|
||||
masked = m[0] / 255.0;
|
||||
|
||||
VALUE (0, s[0]) += masked;
|
||||
VALUE (0, s[0]) += masked;
|
||||
|
||||
s += 1;
|
||||
m += 1;
|
||||
}
|
||||
s += 1;
|
||||
m += 1;
|
||||
}
|
||||
|
||||
src += region->rowstride;
|
||||
msrc += mask->rowstride;
|
||||
@ -488,16 +488,16 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram,
|
||||
m = msrc;
|
||||
w = region->w;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
masked = m[0] / 255.0;
|
||||
while (w--)
|
||||
{
|
||||
masked = m[0] / 255.0;
|
||||
|
||||
VALUE (0, s[0]) += masked;
|
||||
VALUE (1, s[1]) += masked;
|
||||
VALUE (0, s[0]) += masked;
|
||||
VALUE (1, s[1]) += masked;
|
||||
|
||||
s += 2;
|
||||
m += 1;
|
||||
}
|
||||
s += 2;
|
||||
m += 1;
|
||||
}
|
||||
|
||||
src += region->rowstride;
|
||||
msrc += mask->rowstride;
|
||||
@ -511,24 +511,24 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram,
|
||||
m = msrc;
|
||||
w = region->w;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
masked = m[0] / 255.0;
|
||||
while (w--)
|
||||
{
|
||||
masked = m[0] / 255.0;
|
||||
|
||||
VALUE (1, s[0]) += masked;
|
||||
VALUE (2, s[1]) += masked;
|
||||
VALUE (3, s[2]) += masked;
|
||||
VALUE (1, s[0]) += masked;
|
||||
VALUE (2, s[1]) += masked;
|
||||
VALUE (3, s[2]) += masked;
|
||||
|
||||
max = (s[0] > s[1]) ? s[0] : s[1];
|
||||
max = (s[0] > s[1]) ? s[0] : s[1];
|
||||
|
||||
if (s[2] > max)
|
||||
VALUE (0, s[2]) += masked;
|
||||
else
|
||||
VALUE (0, max) += masked;
|
||||
if (s[2] > max)
|
||||
VALUE (0, s[2]) += masked;
|
||||
else
|
||||
VALUE (0, max) += masked;
|
||||
|
||||
s += 3;
|
||||
m += 1;
|
||||
}
|
||||
s += 3;
|
||||
m += 1;
|
||||
}
|
||||
|
||||
src += region->rowstride;
|
||||
msrc += mask->rowstride;
|
||||
@ -542,31 +542,31 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram,
|
||||
m = msrc;
|
||||
w = region->w;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
masked = m[0] / 255.0;
|
||||
while (w--)
|
||||
{
|
||||
masked = m[0] / 255.0;
|
||||
|
||||
VALUE (1, s[0]) += masked;
|
||||
VALUE (2, s[1]) += masked;
|
||||
VALUE (3, s[2]) += masked;
|
||||
VALUE (4, s[3]) += masked;
|
||||
VALUE (1, s[0]) += masked;
|
||||
VALUE (2, s[1]) += masked;
|
||||
VALUE (3, s[2]) += masked;
|
||||
VALUE (4, s[3]) += masked;
|
||||
|
||||
max = (s[0] > s[1]) ? s[0] : s[1];
|
||||
max = (s[0] > s[1]) ? s[0] : s[1];
|
||||
|
||||
if (s[2] > max)
|
||||
VALUE (0, s[2]) += masked;
|
||||
else
|
||||
VALUE (0, max) += masked;
|
||||
if (s[2] > max)
|
||||
VALUE (0, s[2]) += masked;
|
||||
else
|
||||
VALUE (0, max) += masked;
|
||||
|
||||
s += 4;
|
||||
m += 1;
|
||||
}
|
||||
s += 4;
|
||||
m += 1;
|
||||
}
|
||||
|
||||
src += region->rowstride;
|
||||
msrc += mask->rowstride;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else /* no mask */
|
||||
{
|
||||
@ -580,12 +580,12 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram,
|
||||
s = src;
|
||||
w = region->w;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
VALUE (0, s[0]) += 1.0;
|
||||
|
||||
s += 1;
|
||||
}
|
||||
s += 1;
|
||||
}
|
||||
|
||||
src += region->rowstride;
|
||||
}
|
||||
@ -597,13 +597,13 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram,
|
||||
s = src;
|
||||
w = region->w;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
VALUE (0, s[0]) += 1.0;
|
||||
VALUE (1, s[1]) += 1.0;
|
||||
|
||||
s += 2;
|
||||
}
|
||||
s += 2;
|
||||
}
|
||||
|
||||
src += region->rowstride;
|
||||
}
|
||||
@ -615,21 +615,21 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram,
|
||||
s = src;
|
||||
w = region->w;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
VALUE (1, s[0]) += 1.0;
|
||||
VALUE (2, s[1]) += 1.0;
|
||||
VALUE (3, s[2]) += 1.0;
|
||||
|
||||
max = (s[0] > s[1]) ? s[0] : s[1];
|
||||
max = (s[0] > s[1]) ? s[0] : s[1];
|
||||
|
||||
if (s[2] > max)
|
||||
VALUE (0, s[2]) += 1.0;
|
||||
else
|
||||
VALUE (0, max) += 1.0;
|
||||
if (s[2] > max)
|
||||
VALUE (0, s[2]) += 1.0;
|
||||
else
|
||||
VALUE (0, max) += 1.0;
|
||||
|
||||
s += 3;
|
||||
}
|
||||
s += 3;
|
||||
}
|
||||
|
||||
src += region->rowstride;
|
||||
}
|
||||
@ -641,27 +641,27 @@ gimp_histogram_calculate_sub_region (GimpHistogram *histogram,
|
||||
s = src;
|
||||
w = region->w;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
VALUE (1, s[0]) += 1.0;
|
||||
VALUE (2, s[1]) += 1.0;
|
||||
VALUE (3, s[2]) += 1.0;
|
||||
VALUE (4, s[3]) += 1.0;
|
||||
|
||||
max = (s[0] > s[1]) ? s[0] : s[1];
|
||||
max = (s[0] > s[1]) ? s[0] : s[1];
|
||||
|
||||
if (s[2] > max)
|
||||
VALUE (0, s[2]) += 1.0;
|
||||
else
|
||||
VALUE (0, max) += 1.0;
|
||||
if (s[2] > max)
|
||||
VALUE (0, s[2]) += 1.0;
|
||||
else
|
||||
VALUE (0, max) += 1.0;
|
||||
|
||||
s += 4;
|
||||
}
|
||||
s += 4;
|
||||
}
|
||||
|
||||
src += region->rowstride;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MP
|
||||
|
||||
@ -55,9 +55,9 @@ gimp_lut_free (GimpLut *lut)
|
||||
|
||||
void
|
||||
gimp_lut_setup (GimpLut *lut,
|
||||
GimpLutFunc func,
|
||||
void *user_data,
|
||||
gint nchannels)
|
||||
GimpLutFunc func,
|
||||
void *user_data,
|
||||
gint nchannels)
|
||||
{
|
||||
guint i, v;
|
||||
gdouble val;
|
||||
@ -65,7 +65,7 @@ gimp_lut_setup (GimpLut *lut,
|
||||
if (lut->luts)
|
||||
{
|
||||
for (i = 0; i < lut->nchannels; i++)
|
||||
g_free (lut->luts[i]);
|
||||
g_free (lut->luts[i]);
|
||||
|
||||
g_free (lut->luts);
|
||||
}
|
||||
@ -78,29 +78,29 @@ gimp_lut_setup (GimpLut *lut,
|
||||
lut->luts[i] = g_new (guchar, 256);
|
||||
|
||||
for (v = 0; v < 256; v++)
|
||||
{
|
||||
/* to add gamma correction use func(v ^ g) ^ 1/g instead. */
|
||||
val = 255.0 * func (user_data, lut->nchannels, i, v/255.0) + 0.5;
|
||||
{
|
||||
/* to add gamma correction use func(v ^ g) ^ 1/g instead. */
|
||||
val = 255.0 * func (user_data, lut->nchannels, i, v/255.0) + 0.5;
|
||||
|
||||
lut->luts[i][v] = CLAMP (val, 0, 255);
|
||||
}
|
||||
lut->luts[i][v] = CLAMP (val, 0, 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* see comment in gimplut.h */
|
||||
void
|
||||
gimp_lut_setup_exact (GimpLut *lut,
|
||||
GimpLutFunc func,
|
||||
void *user_data,
|
||||
gint nchannels)
|
||||
GimpLutFunc func,
|
||||
void *user_data,
|
||||
gint nchannels)
|
||||
{
|
||||
gimp_lut_setup (lut, func, user_data, nchannels);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_lut_process (GimpLut *lut,
|
||||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR)
|
||||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR)
|
||||
{
|
||||
const guchar *src;
|
||||
guchar *dest;
|
||||
@ -132,48 +132,48 @@ gimp_lut_process (GimpLut *lut,
|
||||
while (h--)
|
||||
{
|
||||
switch (lut->nchannels)
|
||||
{
|
||||
case 1:
|
||||
while (width--)
|
||||
{
|
||||
*dest = lut0[*src];
|
||||
src++;
|
||||
dest++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
src += 2;
|
||||
dest += 2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
dest[2] = lut2[src[2]];
|
||||
src += 3;
|
||||
dest += 3;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
dest[2] = lut2[src[2]];
|
||||
dest[3] = lut3[src[3]];
|
||||
src += 4;
|
||||
dest += 4;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_warning ("gimplut: Error: nchannels = %d\n", lut->nchannels);
|
||||
}
|
||||
{
|
||||
case 1:
|
||||
while (width--)
|
||||
{
|
||||
*dest = lut0[*src];
|
||||
src++;
|
||||
dest++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
src += 2;
|
||||
dest += 2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
dest[2] = lut2[src[2]];
|
||||
src += 3;
|
||||
dest += 3;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
dest[2] = lut2[src[2]];
|
||||
dest[3] = lut3[src[3]];
|
||||
src += 4;
|
||||
dest += 4;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_warning ("gimplut: Error: nchannels = %d\n", lut->nchannels);
|
||||
}
|
||||
|
||||
width = srcPR->w;
|
||||
src += src_r_i;
|
||||
@ -183,7 +183,7 @@ gimp_lut_process (GimpLut *lut,
|
||||
|
||||
void
|
||||
gimp_lut_process_inline (GimpLut *lut,
|
||||
PixelRegion *srcPR)
|
||||
PixelRegion *srcPR)
|
||||
{
|
||||
guint h, width, src_r_i;
|
||||
guchar *src;
|
||||
@ -212,44 +212,44 @@ gimp_lut_process_inline (GimpLut *lut,
|
||||
while (h--)
|
||||
{
|
||||
switch (lut->nchannels)
|
||||
{
|
||||
case 1:
|
||||
while (width--)
|
||||
{
|
||||
*src = lut0[*src];
|
||||
src++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src += 2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src[2] = lut2[src[2]];
|
||||
src += 3;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src[2] = lut2[src[2]];
|
||||
src[3] = lut3[src[3]];
|
||||
src += 4;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_warning ("gimplut: Error: nchannels = %d\n", lut->nchannels);
|
||||
}
|
||||
{
|
||||
case 1:
|
||||
while (width--)
|
||||
{
|
||||
*src = lut0[*src];
|
||||
src++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src += 2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src[2] = lut2[src[2]];
|
||||
src += 3;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src[2] = lut2[src[2]];
|
||||
src[3] = lut3[src[3]];
|
||||
src += 4;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_warning ("gimplut: Error: nchannels = %d\n", lut->nchannels);
|
||||
}
|
||||
width = srcPR->w;
|
||||
src += src_r_i;
|
||||
}
|
||||
|
||||
@ -36,37 +36,37 @@ struct _GimpLut
|
||||
* and do no correction as this will be handled by gimp_lut_setup
|
||||
*/
|
||||
typedef gfloat (*GimpLutFunc) (gpointer user_data,
|
||||
gint nchannels,
|
||||
gint channel,
|
||||
gfloat value);
|
||||
gint nchannels,
|
||||
gint channel,
|
||||
gfloat value);
|
||||
|
||||
|
||||
GimpLut * gimp_lut_new (void);
|
||||
void gimp_lut_free (GimpLut *lut);
|
||||
|
||||
void gimp_lut_setup (GimpLut *lut,
|
||||
GimpLutFunc func,
|
||||
gpointer user_data,
|
||||
gint nchannels);
|
||||
GimpLutFunc func,
|
||||
gpointer user_data,
|
||||
gint nchannels);
|
||||
|
||||
/* gimp_lut_setup_exact is currently identical to gimp_lut_setup. It
|
||||
* however is guaranteed to never perform any interpolation or gamma
|
||||
* correction on the lut
|
||||
*/
|
||||
void gimp_lut_setup_exact (GimpLut *lut,
|
||||
GimpLutFunc func,
|
||||
gpointer user_data,
|
||||
gint nchannels);
|
||||
GimpLutFunc func,
|
||||
gpointer user_data,
|
||||
gint nchannels);
|
||||
|
||||
void gimp_lut_process (GimpLut *lut,
|
||||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR);
|
||||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR);
|
||||
|
||||
/* gimp_lut_process_inline is like gimp_lut_process except it uses a
|
||||
* single PixelRegion as both the source and destination
|
||||
*/
|
||||
void gimp_lut_process_inline (GimpLut *lut,
|
||||
PixelRegion *src_destPR);
|
||||
PixelRegion *src_destPR);
|
||||
|
||||
|
||||
#endif /* __GIMP_LUT_H__ */
|
||||
|
||||
@ -65,43 +65,43 @@ hue_saturation_calculate_transfers (HueSaturation *hs)
|
||||
for (hue = 0; hue < 6; hue++)
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
value = (hs->hue[0] + hs->hue[hue + 1]) * 255.0 / 360.0;
|
||||
if ((i + value) < 0)
|
||||
hs->hue_transfer[hue][i] = 255 + (i + value);
|
||||
else if ((i + value) > 255)
|
||||
hs->hue_transfer[hue][i] = i + value - 255;
|
||||
else
|
||||
hs->hue_transfer[hue][i] = i + value;
|
||||
value = (hs->hue[0] + hs->hue[hue + 1]) * 255.0 / 360.0;
|
||||
if ((i + value) < 0)
|
||||
hs->hue_transfer[hue][i] = 255 + (i + value);
|
||||
else if ((i + value) > 255)
|
||||
hs->hue_transfer[hue][i] = i + value - 255;
|
||||
else
|
||||
hs->hue_transfer[hue][i] = i + value;
|
||||
|
||||
/* Lightness */
|
||||
value = (hs->lightness[0] + hs->lightness[hue + 1]) * 127.0 / 100.0;
|
||||
value = CLAMP (value, -255, 255);
|
||||
/* Lightness */
|
||||
value = (hs->lightness[0] + hs->lightness[hue + 1]) * 127.0 / 100.0;
|
||||
value = CLAMP (value, -255, 255);
|
||||
|
||||
if (value < 0)
|
||||
hs->lightness_transfer[hue][i] = (guchar) ((i * (255 + value)) / 255);
|
||||
else
|
||||
hs->lightness_transfer[hue][i] = (guchar) (i + ((255 - i) * value) / 255);
|
||||
if (value < 0)
|
||||
hs->lightness_transfer[hue][i] = (guchar) ((i * (255 + value)) / 255);
|
||||
else
|
||||
hs->lightness_transfer[hue][i] = (guchar) (i + ((255 - i) * value) / 255);
|
||||
|
||||
/* Saturation */
|
||||
value = (hs->saturation[0] + hs->saturation[hue + 1]) * 255.0 / 100.0;
|
||||
value = CLAMP (value, -255, 255);
|
||||
/* Saturation */
|
||||
value = (hs->saturation[0] + hs->saturation[hue + 1]) * 255.0 / 100.0;
|
||||
value = CLAMP (value, -255, 255);
|
||||
|
||||
/* This change affects the way saturation is computed. With the
|
||||
old code (different code for value < 0), increasing the
|
||||
saturation affected muted colors very much, and bright colors
|
||||
less. With the new code, it affects muted colors and bright
|
||||
colors more or less evenly. For enhancing the color in photos,
|
||||
the new behavior is exactly what you want. It's hard for me
|
||||
to imagine a case in which the old behavior is better.
|
||||
*/
|
||||
hs->saturation_transfer[hue][i] = CLAMP ((i * (255 + value)) / 255, 0, 255);
|
||||
/* This change affects the way saturation is computed. With the
|
||||
old code (different code for value < 0), increasing the
|
||||
saturation affected muted colors very much, and bright colors
|
||||
less. With the new code, it affects muted colors and bright
|
||||
colors more or less evenly. For enhancing the color in photos,
|
||||
the new behavior is exactly what you want. It's hard for me
|
||||
to imagine a case in which the old behavior is better.
|
||||
*/
|
||||
hs->saturation_transfer[hue][i] = CLAMP ((i * (255 + value)) / 255, 0, 255);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
hue_saturation (HueSaturation *hs,
|
||||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR)
|
||||
PixelRegion *destPR)
|
||||
{
|
||||
const guchar *src, *s;
|
||||
guchar *dest, *d;
|
||||
@ -130,12 +130,12 @@ hue_saturation (HueSaturation *hs,
|
||||
d = dest;
|
||||
|
||||
while (w--)
|
||||
{
|
||||
{
|
||||
r = s[RED_PIX];
|
||||
g = s[GREEN_PIX];
|
||||
b = s[BLUE_PIX];
|
||||
|
||||
gimp_rgb_to_hsl_int (&r, &g, &b);
|
||||
gimp_rgb_to_hsl_int (&r, &g, &b);
|
||||
|
||||
hue = (r + (128 / 6)) / 6;
|
||||
|
||||
@ -186,18 +186,18 @@ hue_saturation (HueSaturation *hs,
|
||||
b = hs->lightness_transfer[hue][b];
|
||||
}
|
||||
|
||||
gimp_hsl_to_rgb_int (&r, &g, &b);
|
||||
gimp_hsl_to_rgb_int (&r, &g, &b);
|
||||
|
||||
d[RED_PIX] = r;
|
||||
d[GREEN_PIX] = g;
|
||||
d[BLUE_PIX] = b;
|
||||
d[RED_PIX] = r;
|
||||
d[GREEN_PIX] = g;
|
||||
d[BLUE_PIX] = b;
|
||||
|
||||
if (alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
if (alpha)
|
||||
d[ALPHA_PIX] = s[ALPHA_PIX];
|
||||
|
||||
s += srcPR->bytes;
|
||||
d += destPR->bytes;
|
||||
}
|
||||
s += srcPR->bytes;
|
||||
d += destPR->bytes;
|
||||
}
|
||||
|
||||
src += srcPR->rowstride;
|
||||
dest += destPR->rowstride;
|
||||
|
||||
@ -39,7 +39,7 @@ void hue_saturation_partition_reset (HueSaturation *hs,
|
||||
void hue_saturation_calculate_transfers (HueSaturation *hs);
|
||||
void hue_saturation (HueSaturation *hs,
|
||||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR);
|
||||
PixelRegion *destPR);
|
||||
|
||||
|
||||
#endif /* __HUE_SATURATION_H__ */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user