summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/Makefile.am1
-rw-r--r--plugin/Makefile.in668
-rw-r--r--plugin/attachment_tool/Makefile.am20
-rw-r--r--plugin/attachment_tool/Makefile.in711
-rw-r--r--plugin/attachment_tool/README26
-rw-r--r--plugin/attachment_tool/attachment_tool.c302
-rw-r--r--plugin/test/Makefile.am20
-rw-r--r--plugin/test/Makefile.in710
-rw-r--r--plugin/test/README4
-rw-r--r--plugin/test/test.c306
-rw-r--r--plugin/test/test.h23
11 files changed, 2791 insertions, 0 deletions
diff --git a/plugin/Makefile.am b/plugin/Makefile.am
new file mode 100644
index 0000000..5f2ed52
--- /dev/null
+++ b/plugin/Makefile.am
@@ -0,0 +1 @@
SUBDIRS = attachment_tool test
diff --git a/plugin/Makefile.in b/plugin/Makefile.in
new file mode 100644
index 0000000..31d9655
--- /dev/null
+++ b/plugin/Makefile.in
@@ -0,0 +1,668 @@
1# Makefile.in generated by automake 1.14.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13# PARTICULAR PURPOSE.
14
15@SET_MAKE@
16VPATH = @srcdir@
17am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
18am__make_running_with_option = \
19 case $${target_option-} in \
20 ?) ;; \
21 *) echo "am__make_running_with_option: internal error: invalid" \
22 "target option '$${target_option-}' specified" >&2; \
23 exit 1;; \
24 esac; \
25 has_opt=no; \
26 sane_makeflags=$$MAKEFLAGS; \
27 if $(am__is_gnu_make); then \
28 sane_makeflags=$$MFLAGS; \
29 else \
30 case $$MAKEFLAGS in \
31 *\\[\ \ ]*) \
32 bs=\\; \
33 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
34 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
35 esac; \
36 fi; \
37 skip_next=no; \
38 strip_trailopt () \
39 { \
40 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
41 }; \
42 for flg in $$sane_makeflags; do \
43 test $$skip_next = yes && { skip_next=no; continue; }; \
44 case $$flg in \
45 *=*|--*) continue;; \
46 -*I) strip_trailopt 'I'; skip_next=yes;; \
47 -*I?*) strip_trailopt 'I';; \
48 -*O) strip_trailopt 'O'; skip_next=yes;; \
49 -*O?*) strip_trailopt 'O';; \
50 -*l) strip_trailopt 'l'; skip_next=yes;; \
51 -*l?*) strip_trailopt 'l';; \
52 -[dEDm]) skip_next=yes;; \
53 -[JT]) skip_next=yes;; \
54 esac; \
55 case $$flg in \
56 *$$target_option*) has_opt=yes; break;; \
57 esac; \
58 done; \
59 test $$has_opt = yes
60am__make_dryrun = (target_option=n; $(am__make_running_with_option))
61am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
62pkgdatadir = $(datadir)/@PACKAGE@
63pkgincludedir = $(includedir)/@PACKAGE@
64pkglibdir = $(libdir)/@PACKAGE@
65pkglibexecdir = $(libexecdir)/@PACKAGE@
66am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
67install_sh_DATA = $(install_sh) -c -m 644
68install_sh_PROGRAM = $(install_sh) -c
69install_sh_SCRIPT = $(install_sh) -c
70INSTALL_HEADER = $(INSTALL_DATA)
71transform = $(program_transform_name)
72NORMAL_INSTALL = :
73PRE_INSTALL = :
74POST_INSTALL = :
75NORMAL_UNINSTALL = :
76PRE_UNINSTALL = :
77POST_UNINSTALL = :
78build_triplet = @build@
79host_triplet = @host@
80target_triplet = @target@
81subdir = plugin
82DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
83 $(top_srcdir)/mkinstalldirs
84ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
85am__aclocal_m4_deps = $(top_srcdir)/ac/aclocal-include.m4 \
86 $(top_srcdir)/ac/gnupg-check-typedef.m4 \
87 $(top_srcdir)/configure.ac
88am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
89 $(ACLOCAL_M4)
90mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
91CONFIG_HEADER = $(top_builddir)/config.h
92CONFIG_CLEAN_FILES =
93CONFIG_CLEAN_VPATH_FILES =
94AM_V_P = $(am__v_P_@AM_V@)
95am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
96am__v_P_0 = false
97am__v_P_1 = :
98AM_V_GEN = $(am__v_GEN_@AM_V@)
99am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
100am__v_GEN_0 = @echo " GEN " $@;
101am__v_GEN_1 =
102AM_V_at = $(am__v_at_@AM_V@)
103am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
104am__v_at_0 = @
105am__v_at_1 =
106SOURCES =
107DIST_SOURCES =
108RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
109 ctags-recursive dvi-recursive html-recursive info-recursive \
110 install-data-recursive install-dvi-recursive \
111 install-exec-recursive install-html-recursive \
112 install-info-recursive install-pdf-recursive \
113 install-ps-recursive install-recursive installcheck-recursive \
114 installdirs-recursive pdf-recursive ps-recursive \
115 tags-recursive uninstall-recursive
116am__can_run_installinfo = \
117 case $$AM_UPDATE_INFO_DIR in \
118 n|no|NO) false;; \
119 *) (install-info --version) >/dev/null 2>&1;; \
120 esac
121RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
122 distclean-recursive maintainer-clean-recursive
123am__recursive_targets = \
124 $(RECURSIVE_TARGETS) \
125 $(RECURSIVE_CLEAN_TARGETS) \
126 $(am__extra_recursive_targets)
127AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
128 distdir
129am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
130# Read a list of newline-separated strings from the standard input,
131# and print each of them once, without duplicates. Input order is
132# *not* preserved.
133am__uniquify_input = $(AWK) '\
134 BEGIN { nonempty = 0; } \
135 { items[$$0] = 1; nonempty = 1; } \
136 END { if (nonempty) { for (i in items) print i; }; } \
137'
138# Make sure the list of sources is unique. This is necessary because,
139# e.g., the same source file might be shared among _SOURCES variables
140# for different programs/libraries.
141am__define_uniq_tagged_files = \
142 list='$(am__tagged_files)'; \
143 unique=`for i in $$list; do \
144 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
145 done | $(am__uniquify_input)`
146ETAGS = etags
147CTAGS = ctags
148DIST_SUBDIRS = $(SUBDIRS)
149DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
150am__relativize = \
151 dir0=`pwd`; \
152 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
153 sed_rest='s,^[^/]*/*,,'; \
154 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
155 sed_butlast='s,/*[^/]*$$,,'; \
156 while test -n "$$dir1"; do \
157 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
158 if test "$$first" != "."; then \
159 if test "$$first" = ".."; then \
160 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
161 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
162 else \
163 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
164 if test "$$first2" = "$$first"; then \
165 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
166 else \
167 dir2="../$$dir2"; \
168 fi; \
169 dir0="$$dir0"/"$$first"; \
170 fi; \
171 fi; \
172 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
173 done; \
174 reldir="$$dir2"
175ACLOCAL = @ACLOCAL@
176ALLOCA = @ALLOCA@
177AMTAR = @AMTAR@
178AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
179AR = @AR@
180AUTOCONF = @AUTOCONF@
181AUTOHEADER = @AUTOHEADER@
182AUTOMAKE = @AUTOMAKE@
183AWK = @AWK@
184BUILD_REVISION = @BUILD_REVISION@
185CATALOGS = @CATALOGS@
186CATOBJEXT = @CATOBJEXT@
187CC = @CC@
188CCDEPMODE = @CCDEPMODE@
189CFLAGS = @CFLAGS@
190CPP = @CPP@
191CPPFLAGS = @CPPFLAGS@
192CYGPATH_W = @CYGPATH_W@
193DATADIRNAME = @DATADIRNAME@
194DEFS = @DEFS@
195DEPDIR = @DEPDIR@
196DEVEL_VERSION = @DEVEL_VERSION@
197DLLTOOL = @DLLTOOL@
198DSYMUTIL = @DSYMUTIL@
199DUMPBIN = @DUMPBIN@
200ECHO_C = @ECHO_C@
201ECHO_N = @ECHO_N@
202ECHO_T = @ECHO_T@
203EGREP = @EGREP@
204EXEEXT = @EXEEXT@
205EXTRA_VERSION = @EXTRA_VERSION@
206FGREP = @FGREP@
207GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
208GLIB_CFLAGS = @GLIB_CFLAGS@
209GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
210GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
211GLIB_LIBS = @GLIB_LIBS@
212GLIB_MKENUMS = @GLIB_MKENUMS@
213GMOFILES = @GMOFILES@
214GMSGFMT = @GMSGFMT@
215GOBJECT_QUERY = @GOBJECT_QUERY@
216GPGME_CFLAGS = @GPGME_CFLAGS@
217GPGME_CONFIG = @GPGME_CONFIG@
218GPGME_LIBS = @GPGME_LIBS@
219GREP = @GREP@
220GTK_CFLAGS = @GTK_CFLAGS@
221GTK_LIBS = @GTK_LIBS@
222INSTALL = @INSTALL@
223INSTALL_DATA = @INSTALL_DATA@
224INSTALL_PROGRAM = @INSTALL_PROGRAM@
225INSTALL_SCRIPT = @INSTALL_SCRIPT@
226INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
227INSTOBJEXT = @INSTOBJEXT@
228INTLLIBS = @INTLLIBS@
229LD = @LD@
230LDAP_LIBS = @LDAP_LIBS@
231LDFLAGS = @LDFLAGS@
232LEX = @LEX@
233LEXLIB = @LEXLIB@
234LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
235LIBICONV = @LIBICONV@
236LIBOBJS = @LIBOBJS@
237LIBS = @LIBS@
238LIBSYLPH_CFLAGS = @LIBSYLPH_CFLAGS@
239LIBSYLPH_LIBS = @LIBSYLPH_LIBS@
240LIBTOOL = @LIBTOOL@
241LIPO = @LIPO@
242LN_S = @LN_S@
243LTLIBICONV = @LTLIBICONV@
244LTLIBOBJS = @LTLIBOBJS@
245LT_AGE = @LT_AGE@
246LT_CURRENT = @LT_CURRENT@
247LT_RELEASE = @LT_RELEASE@
248LT_REVISION = @LT_REVISION@
249MAINT = @MAINT@
250MAJOR_VERSION = @MAJOR_VERSION@
251MAKEINFO = @MAKEINFO@
252MANIFEST_TOOL = @MANIFEST_TOOL@
253MICRO_VERSION = @MICRO_VERSION@
254MINOR_VERSION = @MINOR_VERSION@
255MKDIR_P = @MKDIR_P@
256MKINSTALLDIRS = @MKINSTALLDIRS@
257MSGFMT = @MSGFMT@
258MSGFMT_OPTS = @MSGFMT_OPTS@
259NM = @NM@
260NMEDIT = @NMEDIT@
261OBJDUMP = @OBJDUMP@
262OBJEXT = @OBJEXT@
263OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
264OPENSSL_LIBS = @OPENSSL_LIBS@
265OTOOL = @OTOOL@
266OTOOL64 = @OTOOL64@
267PACKAGE = @PACKAGE@
268PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
269PACKAGE_NAME = @PACKAGE_NAME@
270PACKAGE_STRING = @PACKAGE_STRING@
271PACKAGE_TARNAME = @PACKAGE_TARNAME@
272PACKAGE_URL = @PACKAGE_URL@
273PACKAGE_VERSION = @PACKAGE_VERSION@
274PATH_SEPARATOR = @PATH_SEPARATOR@
275PKG_CONFIG = @PKG_CONFIG@
276PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
277PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
278POFILES = @POFILES@
279POSUB = @POSUB@
280PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
281PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
282RANLIB = @RANLIB@
283SED = @SED@
284SET_MAKE = @SET_MAKE@
285SHELL = @SHELL@
286STRIP = @STRIP@
287SYLPHEED_LIBS = @SYLPHEED_LIBS@
288USE_NLS = @USE_NLS@
289VERSION = @VERSION@
290WINDRES = @WINDRES@
291XGETTEXT = @XGETTEXT@
292YACC = @YACC@
293YFLAGS = @YFLAGS@
294abs_builddir = @abs_builddir@
295abs_srcdir = @abs_srcdir@
296abs_top_builddir = @abs_top_builddir@
297abs_top_srcdir = @abs_top_srcdir@
298ac_ct_AR = @ac_ct_AR@
299ac_ct_CC = @ac_ct_CC@
300ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
301am__include = @am__include@
302am__leading_dot = @am__leading_dot@
303am__quote = @am__quote@
304am__tar = @am__tar@
305am__untar = @am__untar@
306bindir = @bindir@
307build = @build@
308build_alias = @build_alias@
309build_cpu = @build_cpu@
310build_os = @build_os@
311build_vendor = @build_vendor@
312builddir = @builddir@
313datadir = @datadir@
314datarootdir = @datarootdir@
315docdir = @docdir@
316dvidir = @dvidir@
317exec_prefix = @exec_prefix@
318faqdir = @faqdir@
319host = @host@
320host_alias = @host_alias@
321host_cpu = @host_cpu@
322host_os = @host_os@
323host_vendor = @host_vendor@
324htmldir = @htmldir@
325includedir = @includedir@
326infodir = @infodir@
327install_sh = @install_sh@
328libdir = @libdir@
329libexecdir = @libexecdir@
330localedir = @localedir@
331localstatedir = @localstatedir@
332mandir = @mandir@
333manualdir = @manualdir@
334mkdir_p = @mkdir_p@
335oldincludedir = @oldincludedir@
336pdfdir = @pdfdir@
337plugindir = @plugindir@
338prefix = @prefix@
339program_transform_name = @program_transform_name@
340psdir = @psdir@
341sbindir = @sbindir@
342sharedstatedir = @sharedstatedir@
343srcdir = @srcdir@
344sysconfdir = @sysconfdir@
345target = @target@
346target_alias = @target_alias@
347target_cpu = @target_cpu@
348target_os = @target_os@
349target_vendor = @target_vendor@
350themedir = @themedir@
351top_build_prefix = @top_build_prefix@
352top_builddir = @top_builddir@
353top_srcdir = @top_srcdir@
354SUBDIRS = attachment_tool test
355all: all-recursive
356
357.SUFFIXES:
358$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
359 @for dep in $?; do \
360 case '$(am__configure_deps)' in \
361 *$$dep*) \
362 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
363 && { if test -f $@; then exit 0; else break; fi; }; \
364 exit 1;; \
365 esac; \
366 done; \
367 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugin/Makefile'; \
368 $(am__cd) $(top_srcdir) && \
369 $(AUTOMAKE) --foreign plugin/Makefile
370.PRECIOUS: Makefile
371Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
372 @case '$?' in \
373 *config.status*) \
374 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
375 *) \
376 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
377 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
378 esac;
379
380$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
381 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
382
383$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
384 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
385$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
386 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
387$(am__aclocal_m4_deps):
388
389mostlyclean-libtool:
390 -rm -f *.lo
391
392clean-libtool:
393 -rm -rf .libs _libs
394
395# This directory's subdirectories are mostly independent; you can cd
396# into them and run 'make' without going through this Makefile.
397# To change the values of 'make' variables: instead of editing Makefiles,
398# (1) if the variable is set in 'config.status', edit 'config.status'
399# (which will cause the Makefiles to be regenerated when you run 'make');
400# (2) otherwise, pass the desired values on the 'make' command line.
401$(am__recursive_targets):
402 @fail=; \
403 if $(am__make_keepgoing); then \
404 failcom='fail=yes'; \
405 else \
406 failcom='exit 1'; \
407 fi; \
408 dot_seen=no; \
409 target=`echo $@ | sed s/-recursive//`; \
410 case "$@" in \
411 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
412 *) list='$(SUBDIRS)' ;; \
413 esac; \
414 for subdir in $$list; do \
415 echo "Making $$target in $$subdir"; \
416 if test "$$subdir" = "."; then \
417 dot_seen=yes; \
418 local_target="$$target-am"; \
419 else \
420 local_target="$$target"; \
421 fi; \
422 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
423 || eval $$failcom; \
424 done; \
425 if test "$$dot_seen" = "no"; then \
426 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
427 fi; test -z "$$fail"
428
429ID: $(am__tagged_files)
430 $(am__define_uniq_tagged_files); mkid -fID $$unique
431tags: tags-recursive
432TAGS: tags
433
434tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
435 set x; \
436 here=`pwd`; \
437 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
438 include_option=--etags-include; \
439 empty_fix=.; \
440 else \
441 include_option=--include; \
442 empty_fix=; \
443 fi; \
444 list='$(SUBDIRS)'; for subdir in $$list; do \
445 if test "$$subdir" = .; then :; else \
446 test ! -f $$subdir/TAGS || \
447 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
448 fi; \
449 done; \
450 $(am__define_uniq_tagged_files); \
451 shift; \
452 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
453 test -n "$$unique" || unique=$$empty_fix; \
454 if test $$# -gt 0; then \
455 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
456 "$$@" $$unique; \
457 else \
458 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
459 $$unique; \
460 fi; \
461 fi
462ctags: ctags-recursive
463
464CTAGS: ctags
465ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
466 $(am__define_uniq_tagged_files); \
467 test -z "$(CTAGS_ARGS)$$unique" \
468 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
469 $$unique
470
471GTAGS:
472 here=`$(am__cd) $(top_builddir) && pwd` \
473 && $(am__cd) $(top_srcdir) \
474 && gtags -i $(GTAGS_ARGS) "$$here"
475cscopelist: cscopelist-recursive
476
477cscopelist-am: $(am__tagged_files)
478 list='$(am__tagged_files)'; \
479 case "$(srcdir)" in \
480 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
481 *) sdir=$(subdir)/$(srcdir) ;; \
482 esac; \
483 for i in $$list; do \
484 if test -f "$$i"; then \
485 echo "$(subdir)/$$i"; \
486 else \
487 echo "$$sdir/$$i"; \
488 fi; \
489 done >> $(top_builddir)/cscope.files
490
491distclean-tags:
492 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
493
494distdir: $(DISTFILES)
495 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
496 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
497 list='$(DISTFILES)'; \
498 dist_files=`for file in $$list; do echo $$file; done | \
499 sed -e "s|^$$srcdirstrip/||;t" \
500 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
501 case $$dist_files in \
502 */*) $(MKDIR_P) `echo "$$dist_files" | \
503 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
504 sort -u` ;; \
505 esac; \
506 for file in $$dist_files; do \
507 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
508 if test -d $$d/$$file; then \
509 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
510 if test -d "$(distdir)/$$file"; then \
511 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
512 fi; \
513 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
514 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
515 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
516 fi; \
517 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
518 else \
519 test -f "$(distdir)/$$file" \
520 || cp -p $$d/$$file "$(distdir)/$$file" \
521 || exit 1; \
522 fi; \
523 done
524 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
525 if test "$$subdir" = .; then :; else \
526 $(am__make_dryrun) \
527 || test -d "$(distdir)/$$subdir" \
528 || $(MKDIR_P) "$(distdir)/$$subdir" \
529 || exit 1; \
530 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
531 $(am__relativize); \
532 new_distdir=$$reldir; \
533 dir1=$$subdir; dir2="$(top_distdir)"; \
534 $(am__relativize); \
535 new_top_distdir=$$reldir; \
536 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
537 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
538 ($(am__cd) $$subdir && \
539 $(MAKE) $(AM_MAKEFLAGS) \
540 top_distdir="$$new_top_distdir" \
541 distdir="$$new_distdir" \
542 am__remove_distdir=: \
543 am__skip_length_check=: \
544 am__skip_mode_fix=: \
545 distdir) \
546 || exit 1; \
547 fi; \
548 done
549check-am: all-am
550check: check-recursive
551all-am: Makefile
552installdirs: installdirs-recursive
553installdirs-am:
554install: install-recursive
555install-exec: install-exec-recursive
556install-data: install-data-recursive
557uninstall: uninstall-recursive
558
559install-am: all-am
560 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
561
562installcheck: installcheck-recursive
563install-strip:
564 if test -z '$(STRIP)'; then \
565 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
566 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
567 install; \
568 else \
569 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
570 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
571 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
572 fi
573mostlyclean-generic:
574
575clean-generic:
576
577distclean-generic:
578 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
579 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
580
581maintainer-clean-generic:
582 @echo "This command is intended for maintainers to use"
583 @echo "it deletes files that may require special tools to rebuild."
584clean: clean-recursive
585
586clean-am: clean-generic clean-libtool mostlyclean-am
587
588distclean: distclean-recursive
589 -rm -f Makefile
590distclean-am: clean-am distclean-generic distclean-tags
591
592dvi: dvi-recursive
593
594dvi-am:
595
596html: html-recursive
597
598html-am:
599
600info: info-recursive
601
602info-am:
603
604install-data-am:
605
606install-dvi: install-dvi-recursive
607
608install-dvi-am:
609
610install-exec-am:
611
612install-html: install-html-recursive
613
614install-html-am:
615
616install-info: install-info-recursive
617
618install-info-am:
619
620install-man:
621
622install-pdf: install-pdf-recursive
623
624install-pdf-am:
625
626install-ps: install-ps-recursive
627
628install-ps-am:
629
630installcheck-am:
631
632maintainer-clean: maintainer-clean-recursive
633 -rm -f Makefile
634maintainer-clean-am: distclean-am maintainer-clean-generic
635
636mostlyclean: mostlyclean-recursive
637
638mostlyclean-am: mostlyclean-generic mostlyclean-libtool
639
640pdf: pdf-recursive
641
642pdf-am:
643
644ps: ps-recursive
645
646ps-am:
647
648uninstall-am:
649
650.MAKE: $(am__recursive_targets) install-am install-strip
651
652.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
653 check-am clean clean-generic clean-libtool cscopelist-am ctags \
654 ctags-am distclean distclean-generic distclean-libtool \
655 distclean-tags distdir dvi dvi-am html html-am info info-am \
656 install install-am install-data install-data-am install-dvi \
657 install-dvi-am install-exec install-exec-am install-html \
658 install-html-am install-info install-info-am install-man \
659 install-pdf install-pdf-am install-ps install-ps-am \
660 install-strip installcheck installcheck-am installdirs \
661 installdirs-am maintainer-clean maintainer-clean-generic \
662 mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
663 ps ps-am tags tags-am uninstall uninstall-am
664
665
666# Tell versions [3.59,3.63) of GNU make to not export all variables.
667# Otherwise a system limit (for SysV at least) may be exceeded.
668.NOEXPORT:
diff --git a/plugin/attachment_tool/Makefile.am b/plugin/attachment_tool/Makefile.am
new file mode 100644
index 0000000..81079b6
--- /dev/null
+++ b/plugin/attachment_tool/Makefile.am
@@ -0,0 +1,20 @@
1libdir = $(plugindir)
2
3lib_LTLIBRARIES = attachment_tool.la
4
5attachment_tool_la_SOURCES = attachment_tool.c
6attachment_tool_la_LDFLAGS = -module -no-undefined -avoid-version
7
8INCLUDES = \
9 -I$(top_srcdir) \
10 -I$(top_srcdir)/libsylph \
11 -I$(top_srcdir)/src \
12 $(GTK_CFLAGS)
13
14attachment_tool_la_LIBADD = \
15 $(GTK_LIBS) \
16 $(top_builddir)/src/libsylpheed-plugin-0.la \
17 $(top_builddir)/libsylph/libsylph-0.la
18
19install:
20install-plugin: install-am
diff --git a/plugin/attachment_tool/Makefile.in b/plugin/attachment_tool/Makefile.in
new file mode 100644
index 0000000..0cdead8
--- /dev/null
+++ b/plugin/attachment_tool/Makefile.in
@@ -0,0 +1,711 @@
1# Makefile.in generated by automake 1.14.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13# PARTICULAR PURPOSE.
14
15@SET_MAKE@
16
17VPATH = @srcdir@
18am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
19am__make_running_with_option = \
20 case $${target_option-} in \
21 ?) ;; \
22 *) echo "am__make_running_with_option: internal error: invalid" \
23 "target option '$${target_option-}' specified" >&2; \
24 exit 1;; \
25 esac; \
26 has_opt=no; \
27 sane_makeflags=$$MAKEFLAGS; \
28 if $(am__is_gnu_make); then \
29 sane_makeflags=$$MFLAGS; \
30 else \
31 case $$MAKEFLAGS in \
32 *\\[\ \ ]*) \
33 bs=\\; \
34 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
35 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
36 esac; \
37 fi; \
38 skip_next=no; \
39 strip_trailopt () \
40 { \
41 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
42 }; \
43 for flg in $$sane_makeflags; do \
44 test $$skip_next = yes && { skip_next=no; continue; }; \
45 case $$flg in \
46 *=*|--*) continue;; \
47 -*I) strip_trailopt 'I'; skip_next=yes;; \
48 -*I?*) strip_trailopt 'I';; \
49 -*O) strip_trailopt 'O'; skip_next=yes;; \
50 -*O?*) strip_trailopt 'O';; \
51 -*l) strip_trailopt 'l'; skip_next=yes;; \
52 -*l?*) strip_trailopt 'l';; \
53 -[dEDm]) skip_next=yes;; \
54 -[JT]) skip_next=yes;; \
55 esac; \
56 case $$flg in \
57 *$$target_option*) has_opt=yes; break;; \
58 esac; \
59 done; \
60 test $$has_opt = yes
61am__make_dryrun = (target_option=n; $(am__make_running_with_option))
62am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
63pkgdatadir = $(datadir)/@PACKAGE@
64pkgincludedir = $(includedir)/@PACKAGE@
65pkglibdir = $(libdir)/@PACKAGE@
66pkglibexecdir = $(libexecdir)/@PACKAGE@
67am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
68install_sh_DATA = $(install_sh) -c -m 644
69install_sh_PROGRAM = $(install_sh) -c
70install_sh_SCRIPT = $(install_sh) -c
71INSTALL_HEADER = $(INSTALL_DATA)
72transform = $(program_transform_name)
73NORMAL_INSTALL = :
74PRE_INSTALL = :
75POST_INSTALL = :
76NORMAL_UNINSTALL = :
77PRE_UNINSTALL = :
78POST_UNINSTALL = :
79build_triplet = @build@
80host_triplet = @host@
81target_triplet = @target@
82subdir = plugin/attachment_tool
83DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
84 $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp README
85ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
86am__aclocal_m4_deps = $(top_srcdir)/ac/aclocal-include.m4 \
87 $(top_srcdir)/ac/gnupg-check-typedef.m4 \
88 $(top_srcdir)/configure.ac
89am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
90 $(ACLOCAL_M4)
91mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
92CONFIG_HEADER = $(top_builddir)/config.h
93CONFIG_CLEAN_FILES =
94CONFIG_CLEAN_VPATH_FILES =
95am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
96am__vpath_adj = case $$p in \
97 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
98 *) f=$$p;; \
99 esac;
100am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
101am__install_max = 40
102am__nobase_strip_setup = \
103 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
104am__nobase_strip = \
105 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
106am__nobase_list = $(am__nobase_strip_setup); \
107 for p in $$list; do echo "$$p $$p"; done | \
108 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
109 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
110 if (++n[$$2] == $(am__install_max)) \
111 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
112 END { for (dir in files) print dir, files[dir] }'
113am__base_list = \
114 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
115 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
116am__uninstall_files_from_dir = { \
117 test -z "$$files" \
118 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
119 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
120 $(am__cd) "$$dir" && rm -f $$files; }; \
121 }
122am__installdirs = "$(DESTDIR)$(libdir)"
123LTLIBRARIES = $(lib_LTLIBRARIES)
124am__DEPENDENCIES_1 =
125attachment_tool_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
126 $(top_builddir)/src/libsylpheed-plugin-0.la \
127 $(top_builddir)/libsylph/libsylph-0.la
128am_attachment_tool_la_OBJECTS = attachment_tool.lo
129attachment_tool_la_OBJECTS = $(am_attachment_tool_la_OBJECTS)
130AM_V_lt = $(am__v_lt_@AM_V@)
131am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
132am__v_lt_0 = --silent
133am__v_lt_1 =
134attachment_tool_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
135 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
136 $(AM_CFLAGS) $(CFLAGS) $(attachment_tool_la_LDFLAGS) \
137 $(LDFLAGS) -o $@
138AM_V_P = $(am__v_P_@AM_V@)
139am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
140am__v_P_0 = false
141am__v_P_1 = :
142AM_V_GEN = $(am__v_GEN_@AM_V@)
143am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
144am__v_GEN_0 = @echo " GEN " $@;
145am__v_GEN_1 =
146AM_V_at = $(am__v_at_@AM_V@)
147am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
148am__v_at_0 = @
149am__v_at_1 =
150DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
151depcomp = $(SHELL) $(top_srcdir)/depcomp
152am__depfiles_maybe = depfiles
153am__mv = mv -f
154COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
155 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
156LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
157 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
158 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
159 $(AM_CFLAGS) $(CFLAGS)
160AM_V_CC = $(am__v_CC_@AM_V@)
161am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
162am__v_CC_0 = @echo " CC " $@;
163am__v_CC_1 =
164CCLD = $(CC)
165LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
166 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
167 $(AM_LDFLAGS) $(LDFLAGS) -o $@
168AM_V_CCLD = $(am__v_CCLD_@AM_V@)
169am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
170am__v_CCLD_0 = @echo " CCLD " $@;
171am__v_CCLD_1 =
172SOURCES = $(attachment_tool_la_SOURCES)
173DIST_SOURCES = $(attachment_tool_la_SOURCES)
174am__can_run_installinfo = \
175 case $$AM_UPDATE_INFO_DIR in \
176 n|no|NO) false;; \
177 *) (install-info --version) >/dev/null 2>&1;; \
178 esac
179am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
180# Read a list of newline-separated strings from the standard input,
181# and print each of them once, without duplicates. Input order is
182# *not* preserved.
183am__uniquify_input = $(AWK) '\
184 BEGIN { nonempty = 0; } \
185 { items[$$0] = 1; nonempty = 1; } \
186 END { if (nonempty) { for (i in items) print i; }; } \
187'
188# Make sure the list of sources is unique. This is necessary because,
189# e.g., the same source file might be shared among _SOURCES variables
190# for different programs/libraries.
191am__define_uniq_tagged_files = \
192 list='$(am__tagged_files)'; \
193 unique=`for i in $$list; do \
194 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
195 done | $(am__uniquify_input)`
196ETAGS = etags
197CTAGS = ctags
198DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
199ACLOCAL = @ACLOCAL@
200ALLOCA = @ALLOCA@
201AMTAR = @AMTAR@
202AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
203AR = @AR@
204AUTOCONF = @AUTOCONF@
205AUTOHEADER = @AUTOHEADER@
206AUTOMAKE = @AUTOMAKE@
207AWK = @AWK@
208BUILD_REVISION = @BUILD_REVISION@
209CATALOGS = @CATALOGS@
210CATOBJEXT = @CATOBJEXT@
211CC = @CC@
212CCDEPMODE = @CCDEPMODE@
213CFLAGS = @CFLAGS@
214CPP = @CPP@
215CPPFLAGS = @CPPFLAGS@
216CYGPATH_W = @CYGPATH_W@
217DATADIRNAME = @DATADIRNAME@
218DEFS = @DEFS@
219DEPDIR = @DEPDIR@
220DEVEL_VERSION = @DEVEL_VERSION@
221DLLTOOL = @DLLTOOL@
222DSYMUTIL = @DSYMUTIL@
223DUMPBIN = @DUMPBIN@
224ECHO_C = @ECHO_C@
225ECHO_N = @ECHO_N@
226ECHO_T = @ECHO_T@
227EGREP = @EGREP@
228EXEEXT = @EXEEXT@
229EXTRA_VERSION = @EXTRA_VERSION@
230FGREP = @FGREP@
231GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
232GLIB_CFLAGS = @GLIB_CFLAGS@
233GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
234GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
235GLIB_LIBS = @GLIB_LIBS@
236GLIB_MKENUMS = @GLIB_MKENUMS@
237GMOFILES = @GMOFILES@
238GMSGFMT = @GMSGFMT@
239GOBJECT_QUERY = @GOBJECT_QUERY@
240GPGME_CFLAGS = @GPGME_CFLAGS@
241GPGME_CONFIG = @GPGME_CONFIG@
242GPGME_LIBS = @GPGME_LIBS@
243GREP = @GREP@
244GTK_CFLAGS = @GTK_CFLAGS@
245GTK_LIBS = @GTK_LIBS@
246INSTALL = @INSTALL@
247INSTALL_DATA = @INSTALL_DATA@
248INSTALL_PROGRAM = @INSTALL_PROGRAM@
249INSTALL_SCRIPT = @INSTALL_SCRIPT@
250INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
251INSTOBJEXT = @INSTOBJEXT@
252INTLLIBS = @INTLLIBS@
253LD = @LD@
254LDAP_LIBS = @LDAP_LIBS@
255LDFLAGS = @LDFLAGS@
256LEX = @LEX@
257LEXLIB = @LEXLIB@
258LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
259LIBICONV = @LIBICONV@
260LIBOBJS = @LIBOBJS@
261LIBS = @LIBS@
262LIBSYLPH_CFLAGS = @LIBSYLPH_CFLAGS@
263LIBSYLPH_LIBS = @LIBSYLPH_LIBS@
264LIBTOOL = @LIBTOOL@
265LIPO = @LIPO@
266LN_S = @LN_S@
267LTLIBICONV = @LTLIBICONV@
268LTLIBOBJS = @LTLIBOBJS@
269LT_AGE = @LT_AGE@
270LT_CURRENT = @LT_CURRENT@
271LT_RELEASE = @LT_RELEASE@
272LT_REVISION = @LT_REVISION@
273MAINT = @MAINT@
274MAJOR_VERSION = @MAJOR_VERSION@
275MAKEINFO = @MAKEINFO@
276MANIFEST_TOOL = @MANIFEST_TOOL@
277MICRO_VERSION = @MICRO_VERSION@
278MINOR_VERSION = @MINOR_VERSION@
279MKDIR_P = @MKDIR_P@
280MKINSTALLDIRS = @MKINSTALLDIRS@
281MSGFMT = @MSGFMT@
282MSGFMT_OPTS = @MSGFMT_OPTS@
283NM = @NM@
284NMEDIT = @NMEDIT@
285OBJDUMP = @OBJDUMP@
286OBJEXT = @OBJEXT@
287OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
288OPENSSL_LIBS = @OPENSSL_LIBS@
289OTOOL = @OTOOL@
290OTOOL64 = @OTOOL64@
291PACKAGE = @PACKAGE@
292PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
293PACKAGE_NAME = @PACKAGE_NAME@
294PACKAGE_STRING = @PACKAGE_STRING@
295PACKAGE_TARNAME = @PACKAGE_TARNAME@
296PACKAGE_URL = @PACKAGE_URL@
297PACKAGE_VERSION = @PACKAGE_VERSION@
298PATH_SEPARATOR = @PATH_SEPARATOR@
299PKG_CONFIG = @PKG_CONFIG@
300PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
301PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
302POFILES = @POFILES@
303POSUB = @POSUB@
304PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
305PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
306RANLIB = @RANLIB@
307SED = @SED@
308SET_MAKE = @SET_MAKE@
309SHELL = @SHELL@
310STRIP = @STRIP@
311SYLPHEED_LIBS = @SYLPHEED_LIBS@
312USE_NLS = @USE_NLS@
313VERSION = @VERSION@
314WINDRES = @WINDRES@
315XGETTEXT = @XGETTEXT@
316YACC = @YACC@
317YFLAGS = @YFLAGS@
318abs_builddir = @abs_builddir@
319abs_srcdir = @abs_srcdir@
320abs_top_builddir = @abs_top_builddir@
321abs_top_srcdir = @abs_top_srcdir@
322ac_ct_AR = @ac_ct_AR@
323ac_ct_CC = @ac_ct_CC@
324ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
325am__include = @am__include@
326am__leading_dot = @am__leading_dot@
327am__quote = @am__quote@
328am__tar = @am__tar@
329am__untar = @am__untar@
330bindir = @bindir@
331build = @build@
332build_alias = @build_alias@
333build_cpu = @build_cpu@
334build_os = @build_os@
335build_vendor = @build_vendor@
336builddir = @builddir@
337datadir = @datadir@
338datarootdir = @datarootdir@
339docdir = @docdir@
340dvidir = @dvidir@
341exec_prefix = @exec_prefix@
342faqdir = @faqdir@
343host = @host@
344host_alias = @host_alias@
345host_cpu = @host_cpu@
346host_os = @host_os@
347host_vendor = @host_vendor@
348htmldir = @htmldir@
349includedir = @includedir@
350infodir = @infodir@
351install_sh = @install_sh@
352libdir = $(plugindir)
353libexecdir = @libexecdir@
354localedir = @localedir@
355localstatedir = @localstatedir@
356mandir = @mandir@
357manualdir = @manualdir@
358mkdir_p = @mkdir_p@
359oldincludedir = @oldincludedir@
360pdfdir = @pdfdir@
361plugindir = @plugindir@
362prefix = @prefix@
363program_transform_name = @program_transform_name@
364psdir = @psdir@
365sbindir = @sbindir@
366sharedstatedir = @sharedstatedir@
367srcdir = @srcdir@
368sysconfdir = @sysconfdir@
369target = @target@
370target_alias = @target_alias@
371target_cpu = @target_cpu@
372target_os = @target_os@
373target_vendor = @target_vendor@
374themedir = @themedir@
375top_build_prefix = @top_build_prefix@
376top_builddir = @top_builddir@
377top_srcdir = @top_srcdir@
378lib_LTLIBRARIES = attachment_tool.la
379attachment_tool_la_SOURCES = attachment_tool.c
380attachment_tool_la_LDFLAGS = -module -no-undefined -avoid-version
381INCLUDES = \
382 -I$(top_srcdir) \
383 -I$(top_srcdir)/libsylph \
384 -I$(top_srcdir)/src \
385 $(GTK_CFLAGS)
386
387attachment_tool_la_LIBADD = \
388 $(GTK_LIBS) \
389 $(top_builddir)/src/libsylpheed-plugin-0.la \
390 $(top_builddir)/libsylph/libsylph-0.la
391
392all: all-am
393
394.SUFFIXES:
395.SUFFIXES: .c .lo .o .obj
396$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
397 @for dep in $?; do \
398 case '$(am__configure_deps)' in \
399 *$$dep*) \
400 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
401 && { if test -f $@; then exit 0; else break; fi; }; \
402 exit 1;; \
403 esac; \
404 done; \
405 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugin/attachment_tool/Makefile'; \
406 $(am__cd) $(top_srcdir) && \
407 $(AUTOMAKE) --foreign plugin/attachment_tool/Makefile
408.PRECIOUS: Makefile
409Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
410 @case '$?' in \
411 *config.status*) \
412 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
413 *) \
414 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
415 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
416 esac;
417
418$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
419 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
420
421$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
422 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
423$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
424 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
425$(am__aclocal_m4_deps):
426
427install-libLTLIBRARIES: $(lib_LTLIBRARIES)
428 @$(NORMAL_INSTALL)
429 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
430 list2=; for p in $$list; do \
431 if test -f $$p; then \
432 list2="$$list2 $$p"; \
433 else :; fi; \
434 done; \
435 test -z "$$list2" || { \
436 echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
437 $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
438 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
439 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
440 }
441
442uninstall-libLTLIBRARIES:
443 @$(NORMAL_UNINSTALL)
444 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
445 for p in $$list; do \
446 $(am__strip_dir) \
447 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
448 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
449 done
450
451clean-libLTLIBRARIES:
452 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
453 @list='$(lib_LTLIBRARIES)'; \
454 locs=`for p in $$list; do echo $$p; done | \
455 sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
456 sort -u`; \
457 test -z "$$locs" || { \
458 echo rm -f $${locs}; \
459 rm -f $${locs}; \
460 }
461
462attachment_tool.la: $(attachment_tool_la_OBJECTS) $(attachment_tool_la_DEPENDENCIES) $(EXTRA_attachment_tool_la_DEPENDENCIES)
463 $(AM_V_CCLD)$(attachment_tool_la_LINK) -rpath $(libdir) $(attachment_tool_la_OBJECTS) $(attachment_tool_la_LIBADD) $(LIBS)
464
465mostlyclean-compile:
466 -rm -f *.$(OBJEXT)
467
468distclean-compile:
469 -rm -f *.tab.c
470
471@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attachment_tool.Plo@am__quote@
472
473.c.o:
474@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
475@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
476@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
477@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
478@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
479
480.c.obj:
481@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
482@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
483@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
484@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
485@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
486
487.c.lo:
488@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
489@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
490@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
491@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
492@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
493
494mostlyclean-libtool:
495 -rm -f *.lo
496
497clean-libtool:
498 -rm -rf .libs _libs
499
500ID: $(am__tagged_files)
501 $(am__define_uniq_tagged_files); mkid -fID $$unique
502tags: tags-am
503TAGS: tags
504
505tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
506 set x; \
507 here=`pwd`; \
508 $(am__define_uniq_tagged_files); \
509 shift; \
510 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
511 test -n "$$unique" || unique=$$empty_fix; \
512 if test $$# -gt 0; then \
513 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
514 "$$@" $$unique; \
515 else \
516 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
517 $$unique; \
518 fi; \
519 fi
520ctags: ctags-am
521
522CTAGS: ctags
523ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
524 $(am__define_uniq_tagged_files); \
525 test -z "$(CTAGS_ARGS)$$unique" \
526 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
527 $$unique
528
529GTAGS:
530 here=`$(am__cd) $(top_builddir) && pwd` \
531 && $(am__cd) $(top_srcdir) \
532 && gtags -i $(GTAGS_ARGS) "$$here"
533cscopelist: cscopelist-am
534
535cscopelist-am: $(am__tagged_files)
536 list='$(am__tagged_files)'; \
537 case "$(srcdir)" in \
538 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
539 *) sdir=$(subdir)/$(srcdir) ;; \
540 esac; \
541 for i in $$list; do \
542 if test -f "$$i"; then \
543 echo "$(subdir)/$$i"; \
544 else \
545 echo "$$sdir/$$i"; \
546 fi; \
547 done >> $(top_builddir)/cscope.files
548
549distclean-tags:
550 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
551
552distdir: $(DISTFILES)
553 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
554 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
555 list='$(DISTFILES)'; \
556 dist_files=`for file in $$list; do echo $$file; done | \
557 sed -e "s|^$$srcdirstrip/||;t" \
558 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
559 case $$dist_files in \
560 */*) $(MKDIR_P) `echo "$$dist_files" | \
561 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
562 sort -u` ;; \
563 esac; \
564 for file in $$dist_files; do \
565 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
566 if test -d $$d/$$file; then \
567 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
568 if test -d "$(distdir)/$$file"; then \
569 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
570 fi; \
571 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
572 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
573 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
574 fi; \
575 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
576 else \
577 test -f "$(distdir)/$$file" \
578 || cp -p $$d/$$file "$(distdir)/$$file" \
579 || exit 1; \
580 fi; \
581 done
582check-am: all-am
583check: check-am
584all-am: Makefile $(LTLIBRARIES)
585installdirs:
586 for dir in "$(DESTDIR)$(libdir)"; do \
587 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
588 done
589install-exec: install-exec-am
590install-data: install-data-am
591uninstall: uninstall-am
592
593install-am: all-am
594 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
595
596installcheck: installcheck-am
597install-strip:
598 if test -z '$(STRIP)'; then \
599 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
600 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
601 install; \
602 else \
603 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
604 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
605 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
606 fi
607mostlyclean-generic:
608
609clean-generic:
610
611distclean-generic:
612 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
613 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
614
615maintainer-clean-generic:
616 @echo "This command is intended for maintainers to use"
617 @echo "it deletes files that may require special tools to rebuild."
618clean: clean-am
619
620clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
621 mostlyclean-am
622
623distclean: distclean-am
624 -rm -rf ./$(DEPDIR)
625 -rm -f Makefile
626distclean-am: clean-am distclean-compile distclean-generic \
627 distclean-tags
628
629dvi: dvi-am
630
631dvi-am:
632
633html: html-am
634
635html-am:
636
637info: info-am
638
639info-am:
640
641install-data-am:
642
643install-dvi: install-dvi-am
644
645install-dvi-am:
646
647install-exec-am: install-libLTLIBRARIES
648
649install-html: install-html-am
650
651install-html-am:
652
653install-info: install-info-am
654
655install-info-am:
656
657install-man:
658
659install-pdf: install-pdf-am
660
661install-pdf-am:
662
663install-ps: install-ps-am
664
665install-ps-am:
666
667installcheck-am:
668
669maintainer-clean: maintainer-clean-am
670 -rm -rf ./$(DEPDIR)
671 -rm -f Makefile
672maintainer-clean-am: distclean-am maintainer-clean-generic
673
674mostlyclean: mostlyclean-am
675
676mostlyclean-am: mostlyclean-compile mostlyclean-generic \
677 mostlyclean-libtool
678
679pdf: pdf-am
680
681pdf-am:
682
683ps: ps-am
684
685ps-am:
686
687uninstall-am: uninstall-libLTLIBRARIES
688
689.MAKE: install-am install-strip
690
691.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
692 clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
693 ctags-am distclean distclean-compile distclean-generic \
694 distclean-libtool distclean-tags distdir dvi dvi-am html \
695 html-am info info-am install install-am install-data \
696 install-data-am install-dvi install-dvi-am install-exec \
697 install-exec-am install-html install-html-am install-info \
698 install-info-am install-libLTLIBRARIES install-man install-pdf \
699 install-pdf-am install-ps install-ps-am install-strip \
700 installcheck installcheck-am installdirs maintainer-clean \
701 maintainer-clean-generic mostlyclean mostlyclean-compile \
702 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
703 tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
704
705
706install:
707install-plugin: install-am
708
709# Tell versions [3.59,3.63) of GNU make to not export all variables.
710# Otherwise a system limit (for SysV at least) may be exceeded.
711.NOEXPORT:
diff --git a/plugin/attachment_tool/README b/plugin/attachment_tool/README
new file mode 100644
index 0000000..159a2af
--- /dev/null
+++ b/plugin/attachment_tool/README
@@ -0,0 +1,26 @@
1Attachment Tool Plug-in
2=======================
3
4This is a plug-in for handling messages with attached files.
5
6Currently, this plug-in can only remove data of attached files with file name.
7MIME structure will be retained, and users will see 0 byte files.
8
9This tool is available on local folders only.
10
11Requirement
12-----------
13
14This plug-in requires Sylpheed 3.1beta3 or later.
15
16Install
17-------
18
19This plugin will not be installed by 'make install'.
20To install this test plugin, type 'make install-plugin'.
21
22Usage
23-----
24
251. Select target messages in the summary view.
262. Select 'Tools - Remove attachments'.
diff --git a/plugin/attachment_tool/attachment_tool.c b/plugin/attachment_tool/attachment_tool.c
new file mode 100644
index 0000000..de299a2
--- /dev/null
+++ b/plugin/attachment_tool/attachment_tool.c
@@ -0,0 +1,302 @@
1/*
2 * Attachment Tool Plug-in -- an attachment processing plug-in for Sylpheed
3 * Copyright (C) 2010 Hiroyuki Yamamoto
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include "defs.h"
21
22#include <glib.h>
23#include <gtk/gtk.h>
24
25#include <stdio.h>
26#include <sys/stat.h>
27
28#include "sylmain.h"
29#include "plugin.h"
30#include "procmsg.h"
31#include "procmime.h"
32#include "utils.h"
33
34#include <glib/gi18n-lib.h>
35
36static SylPluginInfo info = {
37 "Attachment Tool Plug-in",
38 "0.1.0",
39 "Hiroyuki Yamamoto",
40 "Attachment processing plug-in for Sylpheed"
41};
42
43static void remove_attachment_cb(void);
44
45void plugin_load(void)
46{
47 debug_print("initializing attachment_tool plug-in\n");
48
49 syl_plugin_add_menuitem("/Tools", NULL, NULL, NULL);
50 syl_plugin_add_menuitem("/Tools", _("Remove attachments"), remove_attachment_cb, NULL);
51
52 debug_print("attachment_tool plug-in loading done.\n");
53}
54
55void plugin_unload(void)
56{
57 debug_print("attachment_tool plug-in unloaded.\n");
58}
59
60SylPluginInfo *plugin_info(void)
61{
62 return &info;
63}
64
65gint plugin_interface_version(void)
66{
67 return SYL_PLUGIN_INTERFACE_VERSION;
68}
69
70static gboolean remove_attachment_rec(MimeInfo *partinfo, FILE *fp, FILE *outfp)
71{
72 gchar buf[BUFFSIZE];
73 gchar *boundary = NULL;
74 gint boundary_len = 0;
75 gboolean err = FALSE;
76
77 while (partinfo) {
78 gboolean is_attach_part = FALSE;
79 gint count;
80
81 debug_print("------------------------------------------------- begin %s\n", partinfo->content_type);
82 debug_print("fpos = %ld\n", partinfo->fpos);
83 debug_print("content_type = %s\n", partinfo->content_type);
84
85 if (partinfo->filename || partinfo->name) {
86 is_attach_part = TRUE;
87 debug_print("skip this body\n");
88 }
89
90 if (fseek(fp, partinfo->fpos, SEEK_SET) < 0) {
91 perror("fseek");
92 err = TRUE;
93 break;
94 }
95 /* write part headers */
96 count = 0;
97 while (fgets(buf, sizeof(buf), fp) != NULL) {
98 count++;
99 fputs(buf, outfp);
100 if (buf[0] == '\r' || buf[0] == '\n') break;
101 }
102 debug_print("wrote header: %d lines\n", count);
103
104 /* write until first boundary */
105 count = 0;
106 if (partinfo->children && partinfo->boundary) {
107 boundary = partinfo->boundary;
108 boundary_len = strlen(boundary);
109 debug_print("write until %s\n", boundary);
110 while (fgets(buf, sizeof(buf), fp) != NULL) {
111 count++;
112 if (IS_BOUNDARY(buf, boundary, boundary_len)) {
113 fputs(buf, outfp);
114 debug_print("start boundary: %s", buf);
115 break;
116 } else {
117 fputs(buf, outfp);
118 }
119 }
120 debug_print("wrote %d lines\n", count);
121 }
122
123 if (partinfo->sub) {
124 debug_print("enter rfc822 -----------------------------\n");
125 err = !remove_attachment_rec(partinfo->sub, fp, outfp);
126 debug_print("leave rfc822 -----------------------------\n");
127 if (err)
128 break;
129 } else if (partinfo->children) {
130 debug_print("enter child -----------------------------\n");
131 err = !remove_attachment_rec
132 (partinfo->children, fp, outfp);
133 debug_print("leave child -----------------------------\n");
134 if (err)
135 break;
136 }
137
138 if (partinfo->parent && partinfo->parent->boundary) {
139 boundary = partinfo->parent->boundary;
140 boundary_len = strlen(boundary);
141 debug_print("boundary = %s\n", boundary);
142 } else {
143 boundary = NULL;
144 boundary_len = 0;
145 }
146
147 /* write (or skip) part body and end boundary */
148 if (boundary && !partinfo->main) {
149 count = 0;
150 debug_print("write until %s\n", boundary);
151 while (fgets(buf, sizeof(buf), fp) != NULL) {
152 if (IS_BOUNDARY(buf, boundary, boundary_len)) {
153 count++;
154 fputs(buf, outfp);
155 debug_print("end boundary: %s", buf);
156 break;
157 } else {
158 if (!is_attach_part)
159 count++;
160 if (!is_attach_part)
161 fputs(buf, outfp);
162 }
163 }
164 debug_print("wrote body: %d lines\n", count);
165 }
166
167 debug_print("------------------------------------------------- end %s\n", partinfo->content_type);
168
169 partinfo = partinfo->next;
170 }
171
172 return !err;
173}
174
175static gboolean has_attach_part(MimeInfo *mimeinfo)
176{
177 for (; mimeinfo != NULL; mimeinfo = procmime_mimeinfo_next(mimeinfo)) {
178 if (mimeinfo->filename || mimeinfo->name)
179 return TRUE;
180 }
181
182 return FALSE;
183}
184
185static gboolean remove_attachment(MsgInfo *msginfo)
186{
187 MimeInfo *mimeinfo;
188 FILE *fp, *outfp;
189 gchar *infile, *outfile;
190 gboolean err = FALSE;
191
192 mimeinfo = procmime_scan_message(msginfo);
193 g_return_val_if_fail(mimeinfo != NULL, FALSE);
194
195 if (!has_attach_part(mimeinfo)) {
196 debug_print("remove_attachment: this message doesn't have attachments\n");
197 procmime_mimeinfo_free_all(mimeinfo);
198 return TRUE;
199 }
200
201 if ((fp = procmsg_open_message(msginfo)) == NULL) {
202 procmime_mimeinfo_free_all(mimeinfo);
203 return FALSE;
204 }
205
206 infile = procmsg_get_message_file(msginfo);
207 outfile = g_strconcat(infile, ".tmp", NULL);
208 debug_print("infile: %s\n", infile);
209 debug_print("outfile: %s\n", outfile);
210
211 if ((outfp = g_fopen(outfile, "wb")) == NULL) {
212 g_free(outfile);
213 g_free(infile);
214 fclose(fp);
215 procmime_mimeinfo_free_all(mimeinfo);
216 return FALSE;
217 }
218
219 err = !remove_attachment_rec(mimeinfo, fp, outfp);
220
221 if (fclose(outfp) == EOF) {
222 FILE_OP_ERROR(outfile, "fclose");
223 err = TRUE;
224 }
225
226 fclose(fp);
227
228 if (!err) {
229 debug_print("overwriting original message file: %s\n", infile);
230 if (copy_file(outfile, infile, FALSE) == 0) {
231 GStatBuf s;
232 if (g_stat(infile, &s) == 0) {
233 msginfo->size = s.st_size;
234 msginfo->mtime = s.st_mtime;
235 }
236 if (msginfo->folder)
237 msginfo->folder->cache_dirty = TRUE;
238 } else
239 err = TRUE;
240 }
241
242 g_unlink(outfile);
243 g_free(outfile);
244 g_free(infile);
245 procmime_mimeinfo_free_all(mimeinfo);
246
247 return !err;
248}
249
250static void remove_attachment_cb(void)
251{
252 FolderItem *item;
253 GSList *mlist, *cur;
254 gint val;
255
256 debug_print("remove_attachment_cb\n");
257
258 if (syl_plugin_summary_is_locked())
259 return;
260
261 item = syl_plugin_summary_get_current_folder();
262 if (!item || !item->folder || FOLDER_TYPE(item->folder) != F_MH ||
263 item->stype == F_VIRTUAL) {
264 syl_plugin_alertpanel_message(_("Error"), _("This tool is available on local folders only."), 3);
265 return;
266 }
267
268 mlist = syl_plugin_summary_get_selected_msg_list();
269 if (!mlist)
270 return;
271
272 val = syl_plugin_alertpanel(_("Remove attachments"),
273 _("Do you really remove attached files from the selected messages?"),
274 GTK_STOCK_YES, GTK_STOCK_NO, NULL);
275 if (val != 0) {
276 g_slist_free(mlist);
277 return;
278 }
279
280 for (cur = mlist; cur != NULL; cur = cur->next) {
281 MsgInfo *msginfo = (MsgInfo *)cur->data;
282
283 if (!msginfo)
284 continue;
285 if (!MSG_IS_MIME(msginfo->flags)) {
286 debug_print("message %u is not multi-part. skipping.\n", msginfo->msgnum);
287 continue;
288 }
289 debug_print("Removing attachments of message: %u: %s\n", msginfo->msgnum, msginfo->subject ? msginfo->subject : "(No Subject)");
290
291 if (!remove_attachment(msginfo)) {
292 g_warning("Cannot remove attachments from %u: %s\n", msginfo->msgnum, msginfo->subject ? msginfo->subject : "(No Subject)");
293 break;
294 }
295
296 syl_plugin_summary_update_by_msgnum(msginfo->msgnum);
297 }
298
299 g_slist_free(mlist);
300
301 syl_plugin_summary_redisplay_msg();
302}
diff --git a/plugin/test/Makefile.am b/plugin/test/Makefile.am
new file mode 100644
index 0000000..dabf798
--- /dev/null
+++ b/plugin/test/Makefile.am
@@ -0,0 +1,20 @@
1libdir = $(plugindir)
2
3lib_LTLIBRARIES = test.la
4
5test_la_SOURCES = test.c test.h
6test_la_LDFLAGS = -module -no-undefined -avoid-version
7
8INCLUDES = \
9 -I$(top_srcdir) \
10 -I$(top_srcdir)/libsylph \
11 -I$(top_srcdir)/src \
12 $(GTK_CFLAGS)
13
14test_la_LIBADD = \
15 $(GTK_LIBS) \
16 $(top_builddir)/src/libsylpheed-plugin-0.la \
17 $(top_builddir)/libsylph/libsylph-0.la
18
19install:
20install-plugin: install-am
diff --git a/plugin/test/Makefile.in b/plugin/test/Makefile.in
new file mode 100644
index 0000000..e29bffe
--- /dev/null
+++ b/plugin/test/Makefile.in
@@ -0,0 +1,710 @@
1# Makefile.in generated by automake 1.14.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5
6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13# PARTICULAR PURPOSE.
14
15@SET_MAKE@
16
17VPATH = @srcdir@
18am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
19am__make_running_with_option = \
20 case $${target_option-} in \
21 ?) ;; \
22 *) echo "am__make_running_with_option: internal error: invalid" \
23 "target option '$${target_option-}' specified" >&2; \
24 exit 1;; \
25 esac; \
26 has_opt=no; \
27 sane_makeflags=$$MAKEFLAGS; \
28 if $(am__is_gnu_make); then \
29 sane_makeflags=$$MFLAGS; \
30 else \
31 case $$MAKEFLAGS in \
32 *\\[\ \ ]*) \
33 bs=\\; \
34 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
35 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
36 esac; \
37 fi; \
38 skip_next=no; \
39 strip_trailopt () \
40 { \
41 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
42 }; \
43 for flg in $$sane_makeflags; do \
44 test $$skip_next = yes && { skip_next=no; continue; }; \
45 case $$flg in \
46 *=*|--*) continue;; \
47 -*I) strip_trailopt 'I'; skip_next=yes;; \
48 -*I?*) strip_trailopt 'I';; \
49 -*O) strip_trailopt 'O'; skip_next=yes;; \
50 -*O?*) strip_trailopt 'O';; \
51 -*l) strip_trailopt 'l'; skip_next=yes;; \
52 -*l?*) strip_trailopt 'l';; \
53 -[dEDm]) skip_next=yes;; \
54 -[JT]) skip_next=yes;; \
55 esac; \
56 case $$flg in \
57 *$$target_option*) has_opt=yes; break;; \
58 esac; \
59 done; \
60 test $$has_opt = yes
61am__make_dryrun = (target_option=n; $(am__make_running_with_option))
62am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
63pkgdatadir = $(datadir)/@PACKAGE@
64pkgincludedir = $(includedir)/@PACKAGE@
65pkglibdir = $(libdir)/@PACKAGE@
66pkglibexecdir = $(libexecdir)/@PACKAGE@
67am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
68install_sh_DATA = $(install_sh) -c -m 644
69install_sh_PROGRAM = $(install_sh) -c
70install_sh_SCRIPT = $(install_sh) -c
71INSTALL_HEADER = $(INSTALL_DATA)
72transform = $(program_transform_name)
73NORMAL_INSTALL = :
74PRE_INSTALL = :
75POST_INSTALL = :
76NORMAL_UNINSTALL = :
77PRE_UNINSTALL = :
78POST_UNINSTALL = :
79build_triplet = @build@
80host_triplet = @host@
81target_triplet = @target@
82subdir = plugin/test
83DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
84 $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp README
85ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
86am__aclocal_m4_deps = $(top_srcdir)/ac/aclocal-include.m4 \
87 $(top_srcdir)/ac/gnupg-check-typedef.m4 \
88 $(top_srcdir)/configure.ac
89am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
90 $(ACLOCAL_M4)
91mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
92CONFIG_HEADER = $(top_builddir)/config.h
93CONFIG_CLEAN_FILES =
94CONFIG_CLEAN_VPATH_FILES =
95am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
96am__vpath_adj = case $$p in \
97 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
98 *) f=$$p;; \
99 esac;
100am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
101am__install_max = 40
102am__nobase_strip_setup = \
103 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
104am__nobase_strip = \
105 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
106am__nobase_list = $(am__nobase_strip_setup); \
107 for p in $$list; do echo "$$p $$p"; done | \
108 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
109 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
110 if (++n[$$2] == $(am__install_max)) \
111 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
112 END { for (dir in files) print dir, files[dir] }'
113am__base_list = \
114 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
115 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
116am__uninstall_files_from_dir = { \
117 test -z "$$files" \
118 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
119 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
120 $(am__cd) "$$dir" && rm -f $$files; }; \
121 }
122am__installdirs = "$(DESTDIR)$(libdir)"
123LTLIBRARIES = $(lib_LTLIBRARIES)
124am__DEPENDENCIES_1 =
125test_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
126 $(top_builddir)/src/libsylpheed-plugin-0.la \
127 $(top_builddir)/libsylph/libsylph-0.la
128am_test_la_OBJECTS = test.lo
129test_la_OBJECTS = $(am_test_la_OBJECTS)
130AM_V_lt = $(am__v_lt_@AM_V@)
131am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
132am__v_lt_0 = --silent
133am__v_lt_1 =
134test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
135 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
136 $(test_la_LDFLAGS) $(LDFLAGS) -o $@
137AM_V_P = $(am__v_P_@AM_V@)
138am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
139am__v_P_0 = false
140am__v_P_1 = :
141AM_V_GEN = $(am__v_GEN_@AM_V@)
142am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
143am__v_GEN_0 = @echo " GEN " $@;
144am__v_GEN_1 =
145AM_V_at = $(am__v_at_@AM_V@)
146am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
147am__v_at_0 = @
148am__v_at_1 =
149DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
150depcomp = $(SHELL) $(top_srcdir)/depcomp
151am__depfiles_maybe = depfiles
152am__mv = mv -f
153COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
154 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
155LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
156 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
157 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
158 $(AM_CFLAGS) $(CFLAGS)
159AM_V_CC = $(am__v_CC_@AM_V@)
160am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
161am__v_CC_0 = @echo " CC " $@;
162am__v_CC_1 =
163CCLD = $(CC)
164LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
165 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
166 $(AM_LDFLAGS) $(LDFLAGS) -o $@
167AM_V_CCLD = $(am__v_CCLD_@AM_V@)
168am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
169am__v_CCLD_0 = @echo " CCLD " $@;
170am__v_CCLD_1 =
171SOURCES = $(test_la_SOURCES)
172DIST_SOURCES = $(test_la_SOURCES)
173am__can_run_installinfo = \
174 case $$AM_UPDATE_INFO_DIR in \
175 n|no|NO) false;; \
176 *) (install-info --version) >/dev/null 2>&1;; \
177 esac
178am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
179# Read a list of newline-separated strings from the standard input,
180# and print each of them once, without duplicates. Input order is
181# *not* preserved.
182am__uniquify_input = $(AWK) '\
183 BEGIN { nonempty = 0; } \
184 { items[$$0] = 1; nonempty = 1; } \
185 END { if (nonempty) { for (i in items) print i; }; } \
186'
187# Make sure the list of sources is unique. This is necessary because,
188# e.g., the same source file might be shared among _SOURCES variables
189# for different programs/libraries.
190am__define_uniq_tagged_files = \
191 list='$(am__tagged_files)'; \
192 unique=`for i in $$list; do \
193 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
194 done | $(am__uniquify_input)`
195ETAGS = etags
196CTAGS = ctags
197DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
198ACLOCAL = @ACLOCAL@
199ALLOCA = @ALLOCA@
200AMTAR = @AMTAR@
201AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
202AR = @AR@
203AUTOCONF = @AUTOCONF@
204AUTOHEADER = @AUTOHEADER@
205AUTOMAKE = @AUTOMAKE@
206AWK = @AWK@
207BUILD_REVISION = @BUILD_REVISION@
208CATALOGS = @CATALOGS@
209CATOBJEXT = @CATOBJEXT@
210CC = @CC@
211CCDEPMODE = @CCDEPMODE@
212CFLAGS = @CFLAGS@
213CPP = @CPP@
214CPPFLAGS = @CPPFLAGS@
215CYGPATH_W = @CYGPATH_W@
216DATADIRNAME = @DATADIRNAME@
217DEFS = @DEFS@
218DEPDIR = @DEPDIR@
219DEVEL_VERSION = @DEVEL_VERSION@
220DLLTOOL = @DLLTOOL@
221DSYMUTIL = @DSYMUTIL@
222DUMPBIN = @DUMPBIN@
223ECHO_C = @ECHO_C@
224ECHO_N = @ECHO_N@
225ECHO_T = @ECHO_T@
226EGREP = @EGREP@
227EXEEXT = @EXEEXT@
228EXTRA_VERSION = @EXTRA_VERSION@
229FGREP = @FGREP@
230GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
231GLIB_CFLAGS = @GLIB_CFLAGS@
232GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
233GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
234GLIB_LIBS = @GLIB_LIBS@
235GLIB_MKENUMS = @GLIB_MKENUMS@
236GMOFILES = @GMOFILES@
237GMSGFMT = @GMSGFMT@
238GOBJECT_QUERY = @GOBJECT_QUERY@
239GPGME_CFLAGS = @GPGME_CFLAGS@
240GPGME_CONFIG = @GPGME_CONFIG@
241GPGME_LIBS = @GPGME_LIBS@
242GREP = @GREP@
243GTK_CFLAGS = @GTK_CFLAGS@
244GTK_LIBS = @GTK_LIBS@
245INSTALL = @INSTALL@
246INSTALL_DATA = @INSTALL_DATA@
247INSTALL_PROGRAM = @INSTALL_PROGRAM@
248INSTALL_SCRIPT = @INSTALL_SCRIPT@
249INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
250INSTOBJEXT = @INSTOBJEXT@
251INTLLIBS = @INTLLIBS@
252LD = @LD@
253LDAP_LIBS = @LDAP_LIBS@
254LDFLAGS = @LDFLAGS@
255LEX = @LEX@
256LEXLIB = @LEXLIB@
257LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
258LIBICONV = @LIBICONV@
259LIBOBJS = @LIBOBJS@
260LIBS = @LIBS@
261LIBSYLPH_CFLAGS = @LIBSYLPH_CFLAGS@
262LIBSYLPH_LIBS = @LIBSYLPH_LIBS@
263LIBTOOL = @LIBTOOL@
264LIPO = @LIPO@
265LN_S = @LN_S@
266LTLIBICONV = @LTLIBICONV@
267LTLIBOBJS = @LTLIBOBJS@
268LT_AGE = @LT_AGE@
269LT_CURRENT = @LT_CURRENT@
270LT_RELEASE = @LT_RELEASE@
271LT_REVISION = @LT_REVISION@
272MAINT = @MAINT@
273MAJOR_VERSION = @MAJOR_VERSION@
274MAKEINFO = @MAKEINFO@
275MANIFEST_TOOL = @MANIFEST_TOOL@
276MICRO_VERSION = @MICRO_VERSION@
277MINOR_VERSION = @MINOR_VERSION@
278MKDIR_P = @MKDIR_P@
279MKINSTALLDIRS = @MKINSTALLDIRS@
280MSGFMT = @MSGFMT@
281MSGFMT_OPTS = @MSGFMT_OPTS@
282NM = @NM@
283NMEDIT = @NMEDIT@
284OBJDUMP = @OBJDUMP@
285OBJEXT = @OBJEXT@
286OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
287OPENSSL_LIBS = @OPENSSL_LIBS@
288OTOOL = @OTOOL@
289OTOOL64 = @OTOOL64@
290PACKAGE = @PACKAGE@
291PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
292PACKAGE_NAME = @PACKAGE_NAME@
293PACKAGE_STRING = @PACKAGE_STRING@
294PACKAGE_TARNAME = @PACKAGE_TARNAME@
295PACKAGE_URL = @PACKAGE_URL@
296PACKAGE_VERSION = @PACKAGE_VERSION@
297PATH_SEPARATOR = @PATH_SEPARATOR@
298PKG_CONFIG = @PKG_CONFIG@
299PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
300PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
301POFILES = @POFILES@
302POSUB = @POSUB@
303PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
304PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
305RANLIB = @RANLIB@
306SED = @SED@
307SET_MAKE = @SET_MAKE@
308SHELL = @SHELL@
309STRIP = @STRIP@
310SYLPHEED_LIBS = @SYLPHEED_LIBS@
311USE_NLS = @USE_NLS@
312VERSION = @VERSION@
313WINDRES = @WINDRES@
314XGETTEXT = @XGETTEXT@
315YACC = @YACC@
316YFLAGS = @YFLAGS@
317abs_builddir = @abs_builddir@
318abs_srcdir = @abs_srcdir@
319abs_top_builddir = @abs_top_builddir@
320abs_top_srcdir = @abs_top_srcdir@
321ac_ct_AR = @ac_ct_AR@
322ac_ct_CC = @ac_ct_CC@
323ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
324am__include = @am__include@
325am__leading_dot = @am__leading_dot@
326am__quote = @am__quote@
327am__tar = @am__tar@
328am__untar = @am__untar@
329bindir = @bindir@
330build = @build@
331build_alias = @build_alias@
332build_cpu = @build_cpu@
333build_os = @build_os@
334build_vendor = @build_vendor@
335builddir = @builddir@
336datadir = @datadir@
337datarootdir = @datarootdir@
338docdir = @docdir@
339dvidir = @dvidir@
340exec_prefix = @exec_prefix@
341faqdir = @faqdir@
342host = @host@
343host_alias = @host_alias@
344host_cpu = @host_cpu@
345host_os = @host_os@
346host_vendor = @host_vendor@
347htmldir = @htmldir@
348includedir = @includedir@
349infodir = @infodir@
350install_sh = @install_sh@
351libdir = $(plugindir)
352libexecdir = @libexecdir@
353localedir = @localedir@
354localstatedir = @localstatedir@
355mandir = @mandir@
356manualdir = @manualdir@
357mkdir_p = @mkdir_p@
358oldincludedir = @oldincludedir@
359pdfdir = @pdfdir@
360plugindir = @plugindir@
361prefix = @prefix@
362program_transform_name = @program_transform_name@
363psdir = @psdir@
364sbindir = @sbindir@
365sharedstatedir = @sharedstatedir@
366srcdir = @srcdir@
367sysconfdir = @sysconfdir@
368target = @target@
369target_alias = @target_alias@
370target_cpu = @target_cpu@
371target_os = @target_os@
372target_vendor = @target_vendor@
373themedir = @themedir@
374top_build_prefix = @top_build_prefix@
375top_builddir = @top_builddir@
376top_srcdir = @top_srcdir@
377lib_LTLIBRARIES = test.la
378test_la_SOURCES = test.c test.h
379test_la_LDFLAGS = -module -no-undefined -avoid-version
380INCLUDES = \
381 -I$(top_srcdir) \
382 -I$(top_srcdir)/libsylph \
383 -I$(top_srcdir)/src \
384 $(GTK_CFLAGS)
385
386test_la_LIBADD = \
387 $(GTK_LIBS) \
388 $(top_builddir)/src/libsylpheed-plugin-0.la \
389 $(top_builddir)/libsylph/libsylph-0.la
390
391all: all-am
392
393.SUFFIXES:
394.SUFFIXES: .c .lo .o .obj
395$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
396 @for dep in $?; do \
397 case '$(am__configure_deps)' in \
398 *$$dep*) \
399 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
400 && { if test -f $@; then exit 0; else break; fi; }; \
401 exit 1;; \
402 esac; \
403 done; \
404 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugin/test/Makefile'; \
405 $(am__cd) $(top_srcdir) && \
406 $(AUTOMAKE) --foreign plugin/test/Makefile
407.PRECIOUS: Makefile
408Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
409 @case '$?' in \
410 *config.status*) \
411 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
412 *) \
413 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
414 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
415 esac;
416
417$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
418 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
419
420$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
421 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
422$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
423 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
424$(am__aclocal_m4_deps):
425
426install-libLTLIBRARIES: $(lib_LTLIBRARIES)
427 @$(NORMAL_INSTALL)
428 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
429 list2=; for p in $$list; do \
430 if test -f $$p; then \
431 list2="$$list2 $$p"; \
432 else :; fi; \
433 done; \
434 test -z "$$list2" || { \
435 echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
436 $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
437 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
438 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
439 }
440
441uninstall-libLTLIBRARIES:
442 @$(NORMAL_UNINSTALL)
443 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
444 for p in $$list; do \
445 $(am__strip_dir) \
446 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
447 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
448 done
449
450clean-libLTLIBRARIES:
451 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
452 @list='$(lib_LTLIBRARIES)'; \
453 locs=`for p in $$list; do echo $$p; done | \
454 sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
455 sort -u`; \
456 test -z "$$locs" || { \
457 echo rm -f $${locs}; \
458 rm -f $${locs}; \
459 }
460
461test.la: $(test_la_OBJECTS) $(test_la_DEPENDENCIES) $(EXTRA_test_la_DEPENDENCIES)
462 $(AM_V_CCLD)$(test_la_LINK) -rpath $(libdir) $(test_la_OBJECTS) $(test_la_LIBADD) $(LIBS)
463
464mostlyclean-compile:
465 -rm -f *.$(OBJEXT)
466
467distclean-compile:
468 -rm -f *.tab.c
469
470@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Plo@am__quote@
471
472.c.o:
473@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
474@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
475@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
476@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
477@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
478
479.c.obj:
480@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
481@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
482@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
483@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
484@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
485
486.c.lo:
487@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
488@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
489@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
490@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
491@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
492
493mostlyclean-libtool:
494 -rm -f *.lo
495
496clean-libtool:
497 -rm -rf .libs _libs
498
499ID: $(am__tagged_files)
500 $(am__define_uniq_tagged_files); mkid -fID $$unique
501tags: tags-am
502TAGS: tags
503
504tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
505 set x; \
506 here=`pwd`; \
507 $(am__define_uniq_tagged_files); \
508 shift; \
509 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
510 test -n "$$unique" || unique=$$empty_fix; \
511 if test $$# -gt 0; then \
512 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
513 "$$@" $$unique; \
514 else \
515 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
516 $$unique; \
517 fi; \
518 fi
519ctags: ctags-am
520
521CTAGS: ctags
522ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
523 $(am__define_uniq_tagged_files); \
524 test -z "$(CTAGS_ARGS)$$unique" \
525 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
526 $$unique
527
528GTAGS:
529 here=`$(am__cd) $(top_builddir) && pwd` \
530 && $(am__cd) $(top_srcdir) \
531 && gtags -i $(GTAGS_ARGS) "$$here"
532cscopelist: cscopelist-am
533
534cscopelist-am: $(am__tagged_files)
535 list='$(am__tagged_files)'; \
536 case "$(srcdir)" in \
537 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
538 *) sdir=$(subdir)/$(srcdir) ;; \
539 esac; \
540 for i in $$list; do \
541 if test -f "$$i"; then \
542 echo "$(subdir)/$$i"; \
543 else \
544 echo "$$sdir/$$i"; \
545 fi; \
546 done >> $(top_builddir)/cscope.files
547
548distclean-tags:
549 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
550
551distdir: $(DISTFILES)
552 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
553 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
554 list='$(DISTFILES)'; \
555 dist_files=`for file in $$list; do echo $$file; done | \
556 sed -e "s|^$$srcdirstrip/||;t" \
557 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
558 case $$dist_files in \
559 */*) $(MKDIR_P) `echo "$$dist_files" | \
560 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
561 sort -u` ;; \
562 esac; \
563 for file in $$dist_files; do \
564 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
565 if test -d $$d/$$file; then \
566 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
567 if test -d "$(distdir)/$$file"; then \
568 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
569 fi; \
570 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
571 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
572 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
573 fi; \
574 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
575 else \
576 test -f "$(distdir)/$$file" \
577 || cp -p $$d/$$file "$(distdir)/$$file" \
578 || exit 1; \
579 fi; \
580 done
581check-am: all-am
582check: check-am
583all-am: Makefile $(LTLIBRARIES)
584installdirs:
585 for dir in "$(DESTDIR)$(libdir)"; do \
586 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
587 done
588install-exec: install-exec-am
589install-data: install-data-am
590uninstall: uninstall-am
591
592install-am: all-am
593 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
594
595installcheck: installcheck-am
596install-strip:
597 if test -z '$(STRIP)'; then \
598 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
599 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
600 install; \
601 else \
602 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
603 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
604 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
605 fi
606mostlyclean-generic:
607
608clean-generic:
609
610distclean-generic:
611 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
612 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
613
614maintainer-clean-generic:
615 @echo "This command is intended for maintainers to use"
616 @echo "it deletes files that may require special tools to rebuild."
617clean: clean-am
618
619clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
620 mostlyclean-am
621
622distclean: distclean-am
623 -rm -rf ./$(DEPDIR)
624 -rm -f Makefile
625distclean-am: clean-am distclean-compile distclean-generic \
626 distclean-tags
627
628dvi: dvi-am
629
630dvi-am:
631
632html: html-am
633
634html-am:
635
636info: info-am
637
638info-am:
639
640install-data-am:
641
642install-dvi: install-dvi-am
643
644install-dvi-am:
645
646install-exec-am: install-libLTLIBRARIES
647
648install-html: install-html-am
649
650install-html-am:
651
652install-info: install-info-am
653
654install-info-am:
655
656install-man:
657
658install-pdf: install-pdf-am
659
660install-pdf-am:
661
662install-ps: install-ps-am
663
664install-ps-am:
665
666installcheck-am:
667
668maintainer-clean: maintainer-clean-am
669 -rm -rf ./$(DEPDIR)
670 -rm -f Makefile
671maintainer-clean-am: distclean-am maintainer-clean-generic
672
673mostlyclean: mostlyclean-am
674
675mostlyclean-am: mostlyclean-compile mostlyclean-generic \
676 mostlyclean-libtool
677
678pdf: pdf-am
679
680pdf-am:
681
682ps: ps-am
683
684ps-am:
685
686uninstall-am: uninstall-libLTLIBRARIES
687
688.MAKE: install-am install-strip
689
690.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
691 clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
692 ctags-am distclean distclean-compile distclean-generic \
693 distclean-libtool distclean-tags distdir dvi dvi-am html \
694 html-am info info-am install install-am install-data \
695 install-data-am install-dvi install-dvi-am install-exec \
696 install-exec-am install-html install-html-am install-info \
697 install-info-am install-libLTLIBRARIES install-man install-pdf \
698 install-pdf-am install-ps install-ps-am install-strip \
699 installcheck installcheck-am installdirs maintainer-clean \
700 maintainer-clean-generic mostlyclean mostlyclean-compile \
701 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
702 tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
703
704
705install:
706install-plugin: install-am
707
708# Tell versions [3.59,3.63) of GNU make to not export all variables.
709# Otherwise a system limit (for SysV at least) may be exceeded.
710.NOEXPORT:
diff --git a/plugin/test/README b/plugin/test/README
new file mode 100644
index 0000000..3ba9451
--- /dev/null
+++ b/plugin/test/README
@@ -0,0 +1,4 @@
1This is a test plugin for Sylpheed plug-in system.
2
3This plugin will not be installed by 'make install'.
4To install this test plugin, use 'make install-plugin'.
diff --git a/plugin/test/test.c b/plugin/test/test.c
new file mode 100644
index 0000000..3276f7a
--- /dev/null
+++ b/plugin/test/test.c
@@ -0,0 +1,306 @@
1/*
2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2013 Hiroyuki Yamamoto
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20#include <glib.h>
21#include <gtk/gtk.h>
22
23#include "sylmain.h"
24#include "plugin.h"
25#include "test.h"
26#include "folder.h"
27#include "procmsg.h"
28
29static SylPluginInfo info = {
30 "Test Plugin",
31 "3.4.0",
32 "Hiroyuki Yamamoto",
33 "Test plug-in for Sylpheed plug-in system"
34};
35
36static void init_done_cb(GObject *obj, gpointer data);
37static void app_exit_cb(GObject *obj, gpointer data);
38
39static void folderview_menu_popup_cb(GObject *obj, GtkItemFactory *ifactory,
40 gpointer data);
41static void summaryview_menu_popup_cb(GObject *obj, GtkItemFactory *ifactory,
42 gpointer data);
43
44static void textview_menu_popup_cb(GObject *obj, GtkMenu *menu,
45 GtkTextView *textview,
46 const gchar *uri,
47 const gchar *selected_text,
48 MsgInfo *msginfo);
49
50static void menu_selected_cb(void);
51
52static void compose_created_cb(GObject *obj, gpointer compose);
53static void compose_destroy_cb(GObject *obj, gpointer compose);
54static gboolean compose_send_cb(GObject *obj, gpointer compose,
55 gint compose_mode, gint send_mode,
56 const gchar *msg_file, GSList *to_list);
57static void messageview_show_cb(GObject *obj, gpointer msgview,
58 MsgInfo *msginfo, gboolean all_headers);
59static void inc_start_cb(GObject *obj, PrefsAccount *ac);
60static void inc_finished_cb(GObject *obj, gint new_messages);
61
62static void create_window(void);
63static void create_folderview_sub_widget(void);
64
65static gulong test_app_exit_handler_id = 0;
66
67void plugin_load(void)
68{
69 GList *list, *cur;
70 const gchar *ver;
71 gpointer mainwin;
72
73 g_print("test plug-in loaded!\n");
74
75 list = folder_get_list();
76 g_print("folder list = %p\n", list);
77 for (cur = list; cur != NULL; cur = cur->next) {
78 Folder *folder = FOLDER(cur->data);
79 gchar *id = folder_get_identifier(folder);
80 g_print("folder id = %s\n", id);
81 }
82
83 ver = syl_plugin_get_prog_version();
84 g_print("program ver: %s\n", ver);
85
86 mainwin = syl_plugin_main_window_get();
87 g_print("mainwin: %p\n", mainwin);
88 syl_plugin_main_window_popup(mainwin);
89
90 create_folderview_sub_widget();
91
92 syl_plugin_add_menuitem("/Tools", NULL, NULL, NULL);
93 syl_plugin_add_menuitem("/Tools", "Plugin test", create_window, NULL);
94
95 g_signal_connect_after(syl_app_get(), "init-done", G_CALLBACK(init_done_cb),
96 NULL);
97 test_app_exit_handler_id =
98 g_signal_connect(syl_app_get(), "app-exit", G_CALLBACK(app_exit_cb),
99 NULL);
100 syl_plugin_signal_connect("folderview-menu-popup",
101 G_CALLBACK(folderview_menu_popup_cb), NULL);
102 syl_plugin_signal_connect("summaryview-menu-popup",
103 G_CALLBACK(summaryview_menu_popup_cb), NULL);
104 syl_plugin_signal_connect("textview-menu-popup",
105 G_CALLBACK(textview_menu_popup_cb), NULL);
106 syl_plugin_signal_connect("compose-created",
107 G_CALLBACK(compose_created_cb), NULL);
108 syl_plugin_signal_connect("compose-destroy",
109 G_CALLBACK(compose_destroy_cb), NULL);
110 syl_plugin_signal_connect("compose-send",
111 G_CALLBACK(compose_send_cb), NULL);
112 syl_plugin_signal_connect("messageview-show",
113 G_CALLBACK(messageview_show_cb), NULL);
114 syl_plugin_signal_connect("inc-mail-start",
115 G_CALLBACK(inc_start_cb), NULL);
116 syl_plugin_signal_connect("inc-mail-finished",
117 G_CALLBACK(inc_finished_cb), NULL);
118
119 syl_plugin_add_factory_item("<SummaryView>", "/---", NULL, NULL);
120 syl_plugin_add_factory_item("<SummaryView>", "/Test Plug-in menu",
121 menu_selected_cb, NULL);
122
123 g_print("test plug-in loading done\n");
124}
125
126void plugin_unload(void)
127{
128 g_print("test plug-in unloaded!\n");
129 g_signal_handler_disconnect(syl_app_get(), test_app_exit_handler_id);
130}
131
132SylPluginInfo *plugin_info(void)
133{
134 return &info;
135}
136
137gint plugin_interface_version(void)
138{
139 return SYL_PLUGIN_INTERFACE_VERSION;
140}
141
142static void init_done_cb(GObject *obj, gpointer data)
143{
144 syl_plugin_update_check_set_check_url("http://localhost/version_pro.txt?");
145 syl_plugin_update_check_set_download_url("http://localhost/download.php?sno=123&ver=VER&os=win");
146 syl_plugin_update_check_set_jump_url("http://localhost/index.html");
147 syl_plugin_update_check_set_check_plugin_url("http://localhost/plugin_version.txt");
148 syl_plugin_update_check_set_jump_plugin_url("http://localhost/plugin.html");
149
150 syl_plugin_notification_window_open("Sylpheed app init done", "Normal text\n<b>Bold</b>\n<s>Strikethrough</s>\n<b>This is a long text and will be truncated:</b> ABCDEFGHIJKLMNOPQRSTUVWXYZ", 5);
151
152 g_print("test: %p: app init done\n", obj);
153}
154
155static void app_exit_cb(GObject *obj, gpointer data)
156{
157 g_print("test: %p: app will exit\n", obj);
158}
159
160static void folderview_menu_popup_cb(GObject *obj, GtkItemFactory *ifactory,
161 gpointer data)
162{
163 g_print("test: %p: folderview menu popup\n", obj);
164}
165
166static void summaryview_menu_popup_cb(GObject *obj, GtkItemFactory *ifactory,
167 gpointer data)
168{
169 GtkWidget *widget;
170
171 g_print("test: %p: summaryview menu popup\n", obj);
172 widget = gtk_item_factory_get_item(ifactory, "/Test Plug-in menu");
173 if (widget)
174 gtk_widget_set_sensitive(widget, TRUE);
175}
176
177static void activate_menu_cb(GtkMenuItem *menuitem, gpointer data)
178{
179 g_print("menu activated\n");
180}
181
182static void textview_menu_popup_cb(GObject *obj, GtkMenu *menu,
183 GtkTextView *textview,
184 const gchar *uri,
185 const gchar *selected_text,
186 MsgInfo *msginfo)
187{
188 GtkWidget *separator, *menuitem;
189
190 g_print("test: %p: textview menu popup\n", obj);
191 g_print("test: %p: uri: %s, text: %s\n", obj, uri ? uri : "(none)",
192 selected_text ? selected_text : "(none)");
193 g_print("test: %p: msg: %s\n", obj,
194 msginfo && msginfo->subject ? msginfo->subject : "");
195
196 separator = gtk_separator_menu_item_new();
197 gtk_menu_shell_append(GTK_MENU_SHELL(menu), separator);
198 gtk_widget_show(separator);
199
200 menuitem = gtk_menu_item_new_with_mnemonic("Test menu");
201 g_signal_connect(menuitem, "activate", G_CALLBACK(activate_menu_cb), NULL);
202 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
203 gtk_widget_show(menuitem);
204}
205
206static void menu_selected_cb(void)
207{
208 gint sel;
209 GSList *mlist;
210
211 g_print("test: summary menu selected\n");
212 sel = syl_plugin_summary_get_selection_type();
213 mlist = syl_plugin_summary_get_selected_msg_list();
214 g_print("test: selection type: %d\n", sel);
215 g_print("test: number of selected summary message: %d\n",
216 g_slist_length(mlist));
217 g_slist_free(mlist);
218}
219
220static void compose_created_cb(GObject *obj, gpointer compose)
221{
222 gchar *text;
223
224 g_print("test: %p: compose created (%p)\n", obj, compose);
225
226 text = syl_plugin_compose_entry_get_text(compose, 0);
227 g_print("test: compose To: %s\n", text);
228 g_free(text);
229#if 0
230 syl_plugin_compose_entry_set(compose, "test-plugin@test", 1);
231 syl_plugin_compose_entry_append(compose, "second@test", 1);
232#endif
233}
234
235static void compose_destroy_cb(GObject *obj, gpointer compose)
236{
237 g_print("test: %p: compose will be destroyed (%p)\n", obj, compose);
238}
239
240static gboolean compose_send_cb(GObject *obj, gpointer compose,
241 gint compose_mode, gint send_mode,
242 const gchar *msg_file, GSList *to_list)
243{
244 g_print("test: %p: composed message will be sent (%p)\n", obj, compose);
245 g_print("test: compose_mode: %d, send_mode: %d, file: %s\n",
246 compose_mode, send_mode, msg_file);
247
248 return FALSE; /* return TRUE to cancel sending */
249}
250
251static void messageview_show_cb(GObject *obj, gpointer msgview,
252 MsgInfo *msginfo, gboolean all_headers)
253{
254 g_print("test: %p: messageview_show (%p), all_headers: %d: %s\n",
255 obj, msgview, all_headers,
256 msginfo && msginfo->subject ? msginfo->subject : "");
257}
258
259static void inc_start_cb(GObject *obj, PrefsAccount *ac)
260{
261 if (ac)
262 g_print("test: receive start: account: %s\n", ac->account_name);
263 else
264 g_print("test: receive start: all accounts\n");
265}
266
267static void inc_finished_cb(GObject *obj, gint new_messages)
268{
269 g_print("test: received %d new messages\n", new_messages);
270}
271
272static void button_clicked(GtkWidget *widget, gpointer data)
273{
274 g_print("button_clicked\n");
275 /* syl_plugin_app_will_exit(TRUE); */
276}
277
278static void create_window(void)
279{
280 GtkWidget *window;
281 GtkWidget *button;
282
283 g_print("creating window\n");
284
285 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
286 button = gtk_button_new_with_label("Click this button");
287 gtk_window_set_default_size(GTK_WINDOW(window), 400, 200);
288 gtk_container_add(GTK_CONTAINER(window), button);
289 g_signal_connect(G_OBJECT(button), "clicked",
290 G_CALLBACK(button_clicked), NULL);
291 gtk_widget_show_all(window);
292}
293
294static void create_folderview_sub_widget(void)
295{
296 GtkWidget *vbox;
297 GtkWidget *button;
298
299 g_print("creating sub widget\n");
300
301 vbox = gtk_vbox_new(FALSE, 2);
302 button = gtk_button_new_with_label("Test");
303 gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
304 gtk_widget_show_all(vbox);
305 syl_plugin_folderview_add_sub_widget(vbox);
306}
diff --git a/plugin/test/test.h b/plugin/test/test.h
new file mode 100644
index 0000000..253c915
--- /dev/null
+++ b/plugin/test/test.h
@@ -0,0 +1,23 @@
1/*
2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2011 Hiroyuki Yamamoto
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20#ifndef __TEST_H__
21#define __TEST_H__
22
23#endif /* __TEST_H__ */