Skip to content

Commit

Permalink
support clipboard delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Aug 31, 2024
1 parent 9594abd commit d7cd68a
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3023,6 +3023,7 @@ CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
ClipboardDelegate = @ClipboardDelegate@
ConvertDelegate = @ConvertDelegate@
DATA_DIR = @DATA_DIR@
DEFS = @DEFS@
Expand Down
2 changes: 2 additions & 0 deletions config/delegates.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
<delegate decode="pdf" encode="eps" mode="bi" command="&quot;@PSDelegate@&quot; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=@GSEPSDevice@&quot; &quot;-sPDFPassword=%a&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>
<delegate decode="pdf" encode="ps" mode="bi" command="&quot;@PSDelegate@&quot; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=@GSPSDevice@&quot; &quot;-sPDFPassword=%a&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>
<delegate decode="pnm" encode="trace" command="&quot;@TraceEncodeDelegate@&quot; --svg --output &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="png" encode="clipboard" command="&quot;@ClipboardDelegate@&quot; -selection clipboard -t image/png &quot;%i&quot;"/>
<delegate decode="clipboard" command="&quot;@ClipboardDelegate@&quot; -selection clipboard -o &gt; &quot;%o&quot;"/>
<delegate decode="png" encode="webp" command="&quot;@WebPEncodeDelegate@&quot; -quiet %Q &quot;%i&quot; -o &quot;%o&quot;"/>
<delegate decode="pnm" encode="ilbm" mode="encode" command="&quot;@ILBMEncodeDelegate@&quot; -24if &quot;%i&quot; &gt; &quot;%o&quot;"/>
<delegate decode="tiff" encode="jxr" command="@MVDelegate@ &quot;%i&quot; &quot;%i.tiff&quot;; &quot;@JXREncodeDelegate@&quot; -i &quot;%i.tiff&quot; -o &quot;%o.jxr&quot;; @MVDelegate@ &quot;%i.tiff&quot; &quot;%i&quot;; @MVDelegate@ &quot;%o.jxr&quot; &quot;%o&quot;"/>
Expand Down
61 changes: 58 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ ConvertDelegate
DVIDecodeDelegate
DOCDecodeDelegate
DNGDecodeDelegate
ClipboardDelegate
BrowseDelegate
BlenderDecodeDelegate
BPGEncodeDelegate
Expand Down Expand Up @@ -5142,7 +5143,7 @@ MAGICK_PATCHLEVEL_VERSION=16

MAGICK_VERSION=6.9.13-16

MAGICK_GIT_REVISION=b7dde5236:20240824
MAGICK_GIT_REVISION=9594abd29:20240828


# Substitute library versioning
Expand Down Expand Up @@ -5176,7 +5177,7 @@ PACKAGE_LIB_VERSION=0x69D

PACKAGE_LIB_VERSION_NUMBER=6,9,13,16

PACKAGE_RELEASE_DATE=2024-08-24
PACKAGE_RELEASE_DATE=2024-08-28


# Ensure that make can run correctly
Expand Down Expand Up @@ -34447,6 +34448,7 @@ BPGDecodeDelegateDefault='bpgdec'
BPGEncodeDelegateDefault='bpgenc'
BlenderDecodeDelegateDefault='blender'
BrowseDelegateDefault='xdg-open'
ClipboardDelegateDefault='xclip'
DNGDecodeDelegateDefault='darktable-cli'
DOCDecodeDelegateDefault='libreoffice'
GVCDecodeDelegateDefault='dot'
Expand Down Expand Up @@ -34626,7 +34628,7 @@ printf "%s\n" "no" >&6; }
fi


for ac_prog in "$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx
for ac_prog in "$BrowseDelegateDefault" brave-browser microsoft-edge google-chrome firefox konqueror lynx
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
Expand Down Expand Up @@ -34677,6 +34679,57 @@ fi
done
test -n "$BrowseDelegate" || BrowseDelegate=""$BrowseDelegateDefault""

for ac_prog in "$ClipboardDelegateDefault"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_ClipboardDelegate+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $ClipboardDelegate in
[\\/]* | ?:[\\/]*)
ac_cv_path_ClipboardDelegate="$ClipboardDelegate" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_ClipboardDelegate="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS

;;
esac
fi
ClipboardDelegate=$ac_cv_path_ClipboardDelegate
if test -n "$ClipboardDelegate"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ClipboardDelegate" >&5
printf "%s\n" "$ClipboardDelegate" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi


test -n "$ClipboardDelegate" && break
done
test -n "$ClipboardDelegate" || ClipboardDelegate=""$ClipboardDelegateDefault""

# Extract the first word of ""$DNGDecodeDelegateDefault"", so it can be a program name with args.
set dummy "$DNGDecodeDelegateDefault"; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Expand Down Expand Up @@ -36394,6 +36447,7 @@ if test "$with_frozenpaths" != 'yes'; then
BPGEncodeDelegate="$BPGEncodeDelegateDefault"
BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
BrowseDelegate="$BrowseDelegateDefault"
ClipboardDelegate="$ClipboardDelegateDefault"
ConvertDelegate="$ConvertDelegateDefault"
DisplayDelegate="$DisplayDelegateDefault"
DNGDecodeDelegate="$DNGDecodeDelegateDefault"
Expand Down Expand Up @@ -36457,6 +36511,7 @@ fi






#
Expand Down
6 changes: 5 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3120,6 +3120,7 @@ BPGDecodeDelegateDefault='bpgdec'
BPGEncodeDelegateDefault='bpgenc'
BlenderDecodeDelegateDefault='blender'
BrowseDelegateDefault='xdg-open'
ClipboardDelegateDefault='xclip'
DNGDecodeDelegateDefault='darktable-cli'
DOCDecodeDelegateDefault='libreoffice'
GVCDecodeDelegateDefault='dot'
Expand Down Expand Up @@ -3164,7 +3165,8 @@ XPSDelegateDefault='gxps'
AC_PATH_PROG([BPGDecodeDelegate],["$BPGDecodeDelegateDefault"],["$BPGDecodeDelegateDefault"])
AC_PATH_PROG([BPGEncodeDelegate],["$BPGEncodeDelegateDefault"],["$BPGEncodeDelegateDefault"])
AC_PATH_PROG([BlenderDecodeDelegate],["$BlenderDecodeDelegateDefault"],["$BlenderDecodeDelegateDefault"])
AC_PATH_PROGS([BrowseDelegate],["$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx],["$BrowseDelegateDefault"])
AC_PATH_PROGS([BrowseDelegate],["$BrowseDelegateDefault" brave-browser microsoft-edge google-chrome firefox konqueror lynx],["$BrowseDelegateDefault"])
AC_PATH_PROGS([ClipboardDelegate],["$ClipboardDelegateDefault"],["$ClipboardDelegateDefault"])
AC_PATH_PROG([DNGDecodeDelegate],["$DNGDecodeDelegateDefault"],["$DNGDecodeDelegateDefault"])
AC_PATH_PROG([DOCDecodeDelegate],["$DOCDecodeDelegateDefault"],["$DOCDecodeDelegateDefault"])
AC_PATH_PROG([DVIDecodeDelegate],["$DVIDecodeDelegateDefault"],["$DVIDecodeDelegateDefault"])
Expand Down Expand Up @@ -3372,6 +3374,7 @@ if test "$with_frozenpaths" != 'yes'; then
BPGEncodeDelegate="$BPGEncodeDelegateDefault"
BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
BrowseDelegate="$BrowseDelegateDefault"
ClipboardDelegate="$ClipboardDelegateDefault"
ConvertDelegate="$ConvertDelegateDefault"
DisplayDelegate="$DisplayDelegateDefault"
DNGDecodeDelegate="$DNGDecodeDelegateDefault"
Expand Down Expand Up @@ -3410,6 +3413,7 @@ AC_SUBST([BPGDecodeDelegate])
AC_SUBST([BPGEncodeDelegate])
AC_SUBST([BlenderDecodeDelegate])
AC_SUBST([BrowseDelegate])
AC_SUBST([ClipboardDelegate])
AC_SUBST([ConvertDelegate])
AC_SUBST([GVCDecodeDelegate])
AC_SUBST([DVIDecodeDelegate])
Expand Down
2 changes: 2 additions & 0 deletions magick/delegate.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ static const char
" <delegate decode=\"pcl:mono\" stealth=\"True\" command=\"&quot;pcl6&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pbmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;\"/>"
" <delegate decode=\"pdf\" encode=\"eps\" mode=\"bi\" command=\"&quot;gs&quot; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sPDFPassword=&quot;%a&quot; &quot;-sDEVICE=eps2write&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;\"/>"
" <delegate decode=\"pdf\" encode=\"ps\" mode=\"bi\" command=\"&quot;gs&quot; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ps2write&quot; -sPDFPassword=&quot;%a&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;\"/>"
" <delegate decode=\"png\" encode=\"clipboard\" command=\"&quot;xclip&quot; -selection clipboard -t image/png &quot;%i&quot;\"/>"
" <delegate decode=\"clipboard\" command=\"&quot;xclip&quot; -selection clipboard -o &gt; &quot;%o&quot;\"/>"
" <delegate decode=\"png\" encode=\"webp\" command=\"&quot;cwebp&quot; -quiet -q %Q &quot;%i&quot; -o &quot;%o&quot;\"/>"
" <delegate decode=\"pnm\" encode=\"ilbm\" mode=\"encode\" command=\"&quot;ppmtoilbm&quot; -24if &quot;%i&quot; &gt; &quot;%o&quot;\"/>"
" <delegate decode=\"tiff\" encode=\"jxr\" command=\"mv &quot;%i&quot; &quot;%i.tiff&quot;; &quot;JxrEncApp&quot; -i &quot;%i.tiff&quot; -o &quot;%o.jxr&quot;; mv &quot;%i.tiff&quot; &quot;%i&quot;; mv &quot;%o.jxr&quot; &quot;%o&quot;\"/>"
Expand Down

0 comments on commit d7cd68a

Please sign in to comment.