diff -Nabur gnome-applets-diff/Makefile.am gnome-applets/Makefile.am
--- gnome-applets-diff/Makefile.am	2004-08-16 10:44:39.000000000 +0200
+++ gnome-applets/Makefile.am	2004-09-19 19:47:13.018277288 +0200
@@ -7,7 +7,8 @@
 
 vfs_applets = \
 	gtik	\
-	gweather 
+	gweather \
+	trashapplet
 if BUILD_GNOME_VFS_APPLETS
 vfs_SUBDIRS = $(vfs_applets)
 endif
@@ -85,7 +86,8 @@
 	accessx-status	\
 	stickynotes	\
 	libgswitchit	\
-	gswitchit
+	gswitchit	\
+	trashapplet
 
 EXTRA_DIST = \
 	COPYING-DOCS		\
diff -Nabur gnome-applets-diff/configure.in gnome-applets/configure.in
--- gnome-applets-diff/configure.in	2004-09-16 22:43:20.000000000 +0200
+++ gnome-applets/configure.in	2004-09-19 19:47:13.055271664 +0200
@@ -571,4 +571,8 @@
 gswitchit/Makefile
 gswitchit/help/Makefile
 gswitchit/help/C/Makefile
+trashapplet/Makefile
+trashapplet/src/Makefile
+trashapplet/docs/Makefile
+trashapplet/docs/C/Makefile
 ])
diff -Nabur gnome-applets-diff/po/POTFILES.in gnome-applets/po/POTFILES.in
--- gnome-applets-diff/po/POTFILES.in	2004-08-16 13:20:03.000000000 +0200
+++ gnome-applets/po/POTFILES.in	2004-09-19 19:48:01.495907568 +0200
@@ -250,3 +250,6 @@
 wireless/GNOME_WirelessApplet.xml
 wireless/wireless-applet.c
 wireless/wireless-applet.glade
+trashapplet/GNOME_Panel_TrashApplet.xml
+trashapplet/GNOME_Panel_TrashApplet.server.in.in
+trashapplet/src/trashapplet.c
diff -Nabur gnome-applets-diff/trashapplet/.cvsignore gnome-applets/trashapplet/.cvsignore
--- gnome-applets-diff/trashapplet/.cvsignore	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/.cvsignore	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,37 @@
+ABOUT-NLS
+Makefile
+Makefile.in
+aclocal.m4
+config.cache
+autom4te.cache
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.scan
+intl
+libtool
+ltconfig
+ltmain.sh
+missing
+mkinstalldirs
+install-sh
+stamp-h
+stamp-h1
+stamp-h.in
+version.h
+intl
+INSTALL
+intltool-extract.in
+intltool-extract
+intltool-merge.in
+intltool-merge
+intltool-update.in
+intltool-update
+xmldocs.make
+omf.make
+GNOME_Panel_TrashApplet.server
+GNOME_Panel_TrashApplet.server.in
diff -Nabur gnome-applets-diff/trashapplet/AUTHORS gnome-applets/trashapplet/AUTHORS
--- gnome-applets-diff/trashapplet/AUTHORS	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/AUTHORS	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,4 @@
+Michiel Sikkes <michiel@eyesopened.nl>
+Emmanuele Bassi <ebassi@gmail.com>
+Sebastian Bacher <seb128@canonical.com>
+James Henstridge <james.henstridge@canonical.com>
diff -Nabur gnome-applets-diff/trashapplet/COPYING gnome-applets/trashapplet/COPYING
--- gnome-applets-diff/trashapplet/COPYING	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/COPYING	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff -Nabur gnome-applets-diff/trashapplet/ChangeLog gnome-applets/trashapplet/ChangeLog
--- gnome-applets-diff/trashapplet/ChangeLog	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/ChangeLog	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,116 @@
+2004-09-19  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* configure.in: Removed eel pkg-config check.
+	* src/Makefile.am: Added eel-extension files to sources.
+	* src/eel-extension.c: Added, copied eel_gtk_button_* from libeel.
+	* src/eel-extension.h: Added, copied EEL_TRASH_URI and
+	eel_gtk_button_* from libeel.
+	* src/trashapplet.c: Removed libeel include. Added gconf-client
+	include. Changed 'nautilus' to 'gnome-open' for opening the trash.
+
+2004-09-19  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* po/POTFILES.in: files is .in.in not only .in. Fixes bug in the
+	buildsystem.
+
+2004-09-19  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* GNOME_Panel_TrashApplet.server.in.in: Set to other icon.
+	* configure.in: Added French and German.
+	* po/de.po: Added
+	* po/fr.po: Added
+	* src/trashapplet.c: (get_dir_count),
+	(trash_applet_update_item_count), (trash_applet_items_count),
+	(trash_applet_is_empty), (trash_applet_update_icon),
+	(confirm_empty_trash), (trash_applet_do_empty),
+	(trash_applet_open_folder), (trash_applet_show_help),
+	(update_icon_cb), (drag_motion_cb), (drag_leave_cb),
+	(changed_orient_cb), (changed_background_cb), (changed_size_cb),
+	(trash_monitor_cb), (trash_applet_fill): Applied the patches by James
+	and Sebastian.
+	* src/trashapplet.h: Applied the patches by James and Sebastian.
+
+2004-07-30  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* Makefile.am: Added EXTRA_DIST files.
+	* src/trashapplet.c: (trash_applet_update_tip),
+	(trash_applet_show_help), (trash_applet_fill): Small fixes. Nicer
+	messages for trash tooltip.
+
+2004-07-30  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* GNOME_Panel_TrashApplet.server.in.in: Made applet category
+	translatable.
+	* configure.in: Added scrollkeeper and help stuff
+	* help/C/Makefile.am: Added scrollkeeper and help stuff
+	* help/C/legal.xml: Added scrollkeeper and help stuff
+	* help/C/trashapplet-C.omf: Added scrollkeeper and help stuff
+	* help/C/trashapplet.xml: Added scrollkeeper and help stuff
+	* src/trashapplet.c: (trash_applet_show_help),
+	(trash_applet_show_about): Added documenters and made help to show
+	trashapplet help.
+
+2004-07-29  Michiel Sikkes <michiel@eyesopened.nl>
+
+	* Makefile.am: Added first piece of help system.
+	* autogen.sh: Changed to gnome-autogen.sh support.
+	* configure.ac: Renamed this...
+	* configure.in: ... to this.
+	* help/C/Makefile.am: Help system
+	* help/C/trashapplet-C.omf: Helpsystem
+	* help/Makefile.am: Helpsystem
+	* src/trashapplet.c: (update_icon_cb), (trash_applet_fill): Icon is
+	now updated on icon theme change.
+
+2004-07-29  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* GNOME_Panel_TrashApplet.xml: Added help item.
+	* po/nl.po: Updated translation.
+	* src/trashapplet.c: (error_dialog),
+	(trash_applet_get_main_trash_directory_uri), (get_dir_count),
+	(trash_applet_items_count), (trash_applet_update_icon),
+	(update_transfer_callback), (trash_applet_do_empty),
+	(trash_applet_open_folder), (trash_applet_show_help),
+	(trash_applet_show_about), (destroy_cb), (drag_data_received_cb),
+	(changed_orient_cb), (changed_background_cb), (changed_size_cb),
+	(trash_monitor_cb), (trash_applet_fill): Applied all the cool patches
+	by Emmanuele Bassi <ebassi@gmail.com>.
+	* src/trashapplet.h: Applied all the cool patches by Emmanuele Bassi
+	<ebassi@gmail.com>.
+
+2004-07-29  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* GNOME_Panel_TrashApplet.server.in.in: Changed icon.. broken now.
+	* po/nl.po: Updated translation.
+
+2004-07-29  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* GNOME_Panel_TrashApplet.xml: Added mnemonics for menu.
+
+2004-07-29  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* src/trashapplet.c: (trash_applet_about): Added the about window.
+
+2004-07-29  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* GNOME_Panel_TrashApplet.server.in: Added .in for the file name
+	(i18n reasons)
+	* GNOME_Panel_TrashApplet.server.in.in: See above :-)
+	* Makefile.am: i18n changes
+	* po/nl.po: String updates
+	* src/Makefile.am: Removed @INTLTOOL_SERVER_RULES@, wasn't neccesary
+	in this makefile
+
+2004-07-29  Michiel Sikkes  <michiel@eyesopened.nl>
+
+	* GNOME_Panel_TrashApplet.server.in: Set some strings translatable
+	* GNOME_Panel_TrashApplet.xml: Added this file
+	* Makefile.am: Added XML menu file to the buildsystem
+	* configure.ac: i18n changes
+	* po/POTFILES.in: Added the server and xml files.
+	* po/nl.po: String updates
+	* src/Makefile.am: i18n additions
+	* src/trashapplet.c: added config.h to include (trash_applet_fill):
+	changed applet menu to external xml file
+	* src/trashapplet.h: i18n changes, added config.h include
+
diff -Nabur gnome-applets-diff/trashapplet/GNOME_Panel_TrashApplet.server.in.in gnome-applets/trashapplet/GNOME_Panel_TrashApplet.server.in.in
--- gnome-applets-diff/trashapplet/GNOME_Panel_TrashApplet.server.in.in	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/GNOME_Panel_TrashApplet.server.in.in	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,27 @@
+<oaf_info>
+<oaf_server iid="OAFIID:GNOME_Panel_TrashApplet_Factory" type="exe"
+            location="@LIBEXECDIR@/trashapplet">
+
+        <oaf_attribute name="repo_ids" type="stringv">
+                <item value="IDL:Bonobo/GenericFactory:1.0"/>
+                <item value="IDL:Bonobo/Unknown:1.0"/>
+        </oaf_attribute>
+        <oaf_attribute name="name" type="string" value="Trash Applet Factory"/>
+        <oaf_attribute name="description" type="string" value="Trash Applet Factory"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:GNOME_Panel_TrashApplet" type="factory"
+            location="OAFIID:GNOME_Panel_TrashApplet_Factory">
+
+        <oaf_attribute name="repo_ids" type="stringv">
+                <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
+                <item value="IDL:Bonobo/Control:1.0"/>
+                <item value="IDL:Bonobo/Unknown:1.0"/>
+        </oaf_attribute>
+        <oaf_attribute name="name" type="string" _value="Trash Applet"/>
+        <oaf_attribute name="description" type="string" _value="Put Trash on the panel"/>
+        <oaf_attribute name="panel:category" type="string" _value="Accessories"/>
+	<oaf_attribute name="panel:icon" type="string" value="gnome-fs-trash-full"/>
+</oaf_server>
+</oaf_info>
+      
diff -Nabur gnome-applets-diff/trashapplet/GNOME_Panel_TrashApplet.xml gnome-applets/trashapplet/GNOME_Panel_TrashApplet.xml
--- gnome-applets-diff/trashapplet/GNOME_Panel_TrashApplet.xml	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/GNOME_Panel_TrashApplet.xml	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,10 @@
+<Root>
+  <popups>
+    <popup name="button3">
+      <menuitem name="Empty Trash Item" verb="EmptyTrash" _label="_Empty Trash"/>
+      <menuitem name="Open Trash Item" verb="OpenTrash" _label="_Open Trash folder"/>
+      <menuitem name="Open Help Item" verb="HelpTrash" _label="_Help" pixtype="stock" pixname="gtk-help"/>
+      <menuitem name="About Item" verb="AboutTrash" _label="_About..." pixtype="stock" pixname="gnome-stock-about"/>
+    </popup>
+  </popups>
+</Root>
diff -Nabur gnome-applets-diff/trashapplet/Makefile.am gnome-applets/trashapplet/Makefile.am
--- gnome-applets-diff/trashapplet/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/Makefile.am	2004-09-19 18:41:13.000000000 +0200
@@ -0,0 +1,19 @@
+SUBDIRS = src docs
+
+serverdir = $(libdir)/bonobo/servers
+server_in_files = GNOME_Panel_TrashApplet.server.in
+server_DATA = $(server_in_files:.server.in=.server)
+
+$(server_in_files): $(server_in_files:.server.in=.server.in.in)
+	sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@
+
+@INTLTOOL_SERVER_RULE@
+
+uidir = $(datadir)/gnome-2.0/ui
+ui_DATA = GNOME_Panel_TrashApplet.xml
+
+EXTRA_DIST = \
+	$(ui_DATA) \
+	GNOME_Panel_TrashApplet.server.in.in
+
+CLEANFILES = $(server_in_files) $(server_DATA)
diff -Nabur gnome-applets-diff/trashapplet/README gnome-applets/trashapplet/README
--- gnome-applets-diff/trashapplet/README	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/README	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,2 @@
+This is the GNOME Trash Applet. You can drag items from Nautilus onto this
+applet to move them to your trash folder.
diff -Nabur gnome-applets-diff/trashapplet/docs/.cvsignore gnome-applets/trashapplet/docs/.cvsignore
--- gnome-applets-diff/trashapplet/docs/.cvsignore	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/docs/.cvsignore	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -Nabur gnome-applets-diff/trashapplet/docs/C/.cvsignore gnome-applets/trashapplet/docs/C/.cvsignore
--- gnome-applets-diff/trashapplet/docs/C/.cvsignore	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/docs/C/.cvsignore	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,4 @@
+*.out
+Makefile
+Makefile.in
+omf_timestamp
diff -Nabur gnome-applets-diff/trashapplet/docs/C/Makefile.am gnome-applets/trashapplet/docs/C/Makefile.am
--- gnome-applets-diff/trashapplet/docs/C/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/docs/C/Makefile.am	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,6 @@
+docname = trashapplet
+lang = C
+omffile = trashapplet-C.omf
+entities = legal.xml
+include $(top_srcdir)/xmldocs.make
+dist-hook: app-dist-hook
diff -Nabur gnome-applets-diff/trashapplet/docs/C/legal.xml gnome-applets/trashapplet/docs/C/legal.xml
--- gnome-applets-diff/trashapplet/docs/C/legal.xml	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/docs/C/legal.xml	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<legalnotice id="legalnotice">
+<para>
+Permission is granted to copy, distribute and/or modify this document under the 
+terms of the GNU Free DocumentationLicense (GFDL), Version 1.1 or any later 
+version published by the Free Software Foundation with no Invariant Sections, 	  no Front-Cover Texts, and
+no Back-Cover Texts. You can find a copy of the GFDL at this 
+
+		<ulink url="ghelp:fdl" type="help">link</ulink> 
+
+or in the file COPYING-DOCS distributed with this manual.</para>
+<para> 
+This manual is part of a collection of GNOME documents distributed under the 
+GFDL. If you want to distribute this manual separately from the collection, 
+you can do so by adding a copy of the license to the document, as described in 
+section 6 of the license. 	
+</para>
+<para>
+Many of the names used by companies to distinguish their products
+and services are claimed as trademarks. Where those names appear in any
+GNOME documentation, and the members of the GNOME Documentation Project
+are made aware of those trademarks, then the names are in capital letters
+or initial capital letters. 
+</para>
+<para>
+DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE TERMS OF 
+THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING THAT:  	  
+<orderedlist><listitem>
+<para>
+DOCUMENT IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER 
+EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE 
+DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS FREE OF DEFECTS MERCHANTABLE,
+FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE 
+QUALITY, ACCURACY, AND PERFORMANCE OF THE DOCUMENT OR MODIFIED VERSION OF THE 
+DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT,                     YOU (NOT THE INITIAL
+WRITER, AUTHOR OR ANY CONTRIBUTOR) ASSUME THE COST OF
+ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS    
+LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED              
+VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER                    
+EXCEPT UNDER THIS DISCLAIMER; AND
+</para>
+</listitem>
+<listitem>
+<para>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER
+IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE,
+SHALL THE AUTHOR, INITIAL WRITER, ANY CONTRIBUTOR,
+OR ANY DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION
+ OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH   
+PARTIES, BE LIABLE TO ANY PERSON FOR ANY             
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR         
+CONSEQUENTIAL DAMAGES OF ANY CHARACTER                     
+  INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
+GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION,
+OR ANY AND ALL OTHER DAMAGES OR LOSSES ARISING OUT
+OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED
+VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL
+HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES.
+</para>
+</listitem>
+</orderedlist> 	
+</para>
+</legalnotice>
+
diff -Nabur gnome-applets-diff/trashapplet/docs/C/trashapplet-C.omf gnome-applets/trashapplet/docs/C/trashapplet-C.omf
--- gnome-applets-diff/trashapplet/docs/C/trashapplet-C.omf	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/docs/C/trashapplet-C.omf	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<omf>
+  <resource>
+    <creator>
+      michiel@eyesopened.nl (Michiel Sikkes)
+    </creator>
+    <maintainer>
+      michiel@eyesopened.nl (Michiel Sikkes)
+    </maintainer>
+    <title>
+      Trash Applet Manual 0.2
+    </title>
+    <date>
+      2004-07-29
+    </date>
+    <version identifier="0.2" date="2004-07-29" description="Updated for GNOME FIXME, program version 0.2"/>
+    <subject category="GNOME|Applets|Accessories"/>
+    <description>
+      User manual for the Trash applet. 
+    </description>
+    <type>
+      user's guide
+    </type>
+    <format mime="text/xml" dtd="-//OASIS//DTD DocBook XML V4.1.2//EN"/>
+    <identifier url="trashapplet.xml"/>
+    <language code="C"/>
+    <rights type="GNU FDL" license.version="1.1" holder="Michiel Sikkes"/>
+   </resource>
+</omf>
diff -Nabur gnome-applets-diff/trashapplet/docs/C/trashapplet.xml gnome-applets/trashapplet/docs/C/trashapplet.xml
--- gnome-applets-diff/trashapplet/docs/C/trashapplet.xml	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/docs/C/trashapplet.xml	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,129 @@
+<?xml version="1.0"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+  <!ENTITY legal SYSTEM "legal.xml">
+  <!ENTITY appletversion "0.2">
+  <!ENTITY manrevision "0.2">
+  <!ENTITY date "July 2004">
+  <!ENTITY applet "Trash">
+]>
+
+<article id="index" lang="en">
+<!-- please do not change the id; for translations, change lang to -->
+<!-- appropriate code -->
+  <articleinfo> 
+	 <title>&applet; Applet Manual V&manrevision;</title> 
+	 <copyright> 
+		<year>2004</year>
+		<holder>Michiel Sikkes</holder> 
+	 </copyright> 
+<!-- translators: uncomment this:
+
+  <copyright>
+   <year>2002</year>
+   <holder>ME-THE-TRANSLATOR (Latin translation)</holder>
+  </copyright>
+
+   -->
+<!-- An address can be added to the publisher information.  If a role is 
+     not specified, the publisher/author is the same for all versions of the 
+     document.  -->
+	 <publisher> 
+		<publishername> GNOME Documentation Project </publishername> 
+	 </publisher> 
+
+&legal;
+<!-- This file  contains link to license for the documentation (GNU FDL), and 
+     other legal stuff such as "NO WARRANTY" statement. Please do not change 
+     any of this. -->
+
+	 <authorgroup> 
+		<author> 
+		  <firstname>Michiel</firstname> 
+		  <surname>Sikkes</surname> 
+		  <affiliation> 
+			 <orgname>GNOME Documentation Project</orgname> 
+			 <address> <email>michiel@eyesopened.nl</email> </address> 
+		  </affiliation> 
+		</author> 
+      <!-- This is appropriate place for other contributors: translators,
+           maintainers,  etc. Commented out by default.
+           <othercredit role="translator">
+	     <firstname>Michiel</firstname> 
+	     <surname>Sikkes</surname> 
+	     <affiliation> 
+	       <orgname>Latin Translation Team</orgname> 
+	       <address> <email>translator@gnome.org</email> </address> 
+	     </affiliation>
+	     <contrib>Latin translation</contrib>
+           </othercredit>
+-->
+	 </authorgroup>
+	 <revhistory>
+		<revision> 
+		  <revnumber>&applet; Applet Manual V&manrevision;</revnumber> 
+		  <date>&date;</date> 
+		  <revdescription> 
+			 <para role="author">Michiel Sikkes</para> 
+			 <para role="publisher">GNOME Documentation Project</para> 
+		  </revdescription> 
+		</revision>
+	  </revhistory>
+	 <releaseinfo> This manual describes version &appletversion; of the &applet; applet.
+		</releaseinfo>
+	 <legalnotice> 
+		<title>Feedback</title> 
+		<para> To report a bug or make a suggestion regarding the &applet; applet or this manual, follow the directions in the <ulink url="ghelp:gnome-feedback" type="help">GNOME Feedback Page</ulink>. </para>
+		
+	 </legalnotice> 
+  </articleinfo>
+  <indexterm> 
+	 <primary>Trash</primary> 
+  </indexterm>
+
+  <sect1 id="trash-introduction"> 
+	 <title>Introduction</title> 
+<para>
+The <application>&applet;</application> applet lets you manage your Trash from the panel.
+</para>
+
+<sect2 id="clock-introduction-add">       
+<title>To Add &applet; to a Panel</title> 
+<para>
+To add the <application>&applet;</application> applet to a panel, right-click on the panel, then choose
+   <menuchoice>
+    <guimenu>Add to Panel</guimenu>
+    <guisubmenu>Accessories</guisubmenu>
+    <guimenuitem>Trash</guimenuitem>
+   </menuchoice>.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="trash-usage">
+	<title>Usage</title>
+
+	<sect2 id="trash-usage-moving">
+	<title>Moving files to Trash</title>
+	<para>Select one or more files or folders in the file manager and drag them onto the picture of the trashbin.</para>
+	</sect2>
+
+	<sect2 id="trash-usage-emptying">
+	<title>Emptying Trash</title>
+	<para>To empty Trash, right-click on the applet, then choose
+		<menuchoice>
+		  <guimenuitem>Empty Trash</guimenuitem>
+		</menuchoice>
+	</para>
+	</sect2>
+
+	<sect2 id="trash-usage-opening">
+	<title>Opening Trash</title>
+	<para>To open Trash, right-clik on the applet, then choose
+		<menuchoice>
+		  <guimenuitem>Open Trash folder</guimenuitem>
+		</menuchoice>
+	</para>
+	</sect2>
+</sect1>
+</article>
diff -Nabur gnome-applets-diff/trashapplet/docs/Makefile.am gnome-applets/trashapplet/docs/Makefile.am
--- gnome-applets-diff/trashapplet/docs/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/docs/Makefile.am	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1 @@
+SUBDIRS = C
diff -Nabur gnome-applets-diff/trashapplet/src/.cvsignore gnome-applets/trashapplet/src/.cvsignore
--- gnome-applets-diff/trashapplet/src/.cvsignore	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/src/.cvsignore	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,6 @@
+trashapplet
+trashapplet.o
+Makefile
+Makefile.in
+.deps
+.libs
diff -Nabur gnome-applets-diff/trashapplet/src/Makefile.am gnome-applets/trashapplet/src/Makefile.am
--- gnome-applets-diff/trashapplet/src/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/src/Makefile.am	2004-09-19 19:15:39.649113152 +0200
@@ -0,0 +1,14 @@
+INCLUDES = -I$(top_srcdir)						\
+	   $(GNOME_APPLETS_CFLAGS) \
+	   $(GNOME_VFS_APPLETS_CFLAGS) \
+	   -DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
+
+libexec_PROGRAMS = trashapplet
+
+trashapplet_SOURCES = \
+	trashapplet.c \
+	trashapplet.h \
+	eel-extension.h \
+	eel-extension.c
+
+trashapplet_LDADD = $(GNOME_APPLETS_LIBS) $(GNOME_VFS_APPLETS_LIBS)
diff -Nabur gnome-applets-diff/trashapplet/src/eel-extension.c gnome-applets/trashapplet/src/eel-extension.c
--- gnome-applets-diff/trashapplet/src/eel-extension.c	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/src/eel-extension.c	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,54 @@
+/* eel-extension.h - Copy & paste code from libeel
+ *
+ * Copyright (c) 2004  Michiel Sikkes <michiel@eyesopened.nl>,
+ *               2004  Emmanuele Bassi <ebassi@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License VERSION 2 as
+ * published by the Free Software Foundation.  You are not allowed to
+ * use any other version of the license; unless you got the explicit
+ * permission from the author to do so.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <gtk/gtk.h>
+
+/**
+ * eel_gtk_button_new_with_stock_icon:
+ *
+ * @label: the button label, which may include a mnemonic accelerator.
+ * @stock_id: the stock icon to use.
+ *
+ * Creates a GtkButton with a mnemonic label and a stock icon.
+ *
+ * Return value: a new GtkButton widget.
+ **/
+GtkWidget*
+eel_gtk_button_new_with_stock_icon (const gchar *label, const gchar *stock_id)
+{
+        GtkWidget *button, *l, *image, *hbox, *align;
+
+        /* This is mainly copied from gtk_button_construct_child(). */
+        button = gtk_button_new ();
+        l = gtk_label_new_with_mnemonic (label);
+        gtk_label_set_mnemonic_widget (GTK_LABEL (l), GTK_WIDGET (button));
+        image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
+        hbox = gtk_hbox_new (FALSE, 2);
+        align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+        gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+        gtk_box_pack_end (GTK_BOX (hbox), l, FALSE, FALSE, 0);
+        gtk_container_add (GTK_CONTAINER (button), align);
+        gtk_container_add (GTK_CONTAINER (align), hbox);
+        gtk_widget_show_all (align);
+
+        return button;
+}
+
diff -Nabur gnome-applets-diff/trashapplet/src/eel-extension.h gnome-applets/trashapplet/src/eel-extension.h
--- gnome-applets-diff/trashapplet/src/eel-extension.h	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/src/eel-extension.h	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,28 @@
+/* eel-extension.h - Copy & paste code from libeel
+ *
+ * Copyright (c) 2004  Michiel Sikkes <michiel@eyesopened.nl>,
+ *               2004  Emmanuele Bassi <ebassi@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License VERSION 2 as
+ * published by the Free Software Foundation.  You are not allowed to
+ * use any other version of the license; unless you got the explicit
+ * permission from the author to do so.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#define EEL_TRASH_URI "trash:"
+
+/* GtkButton */
+GtkWidget*            eel_gtk_button_new_with_stock_icon              (const gchar          *label,
+                                                                       const gchar          *stock_id);
+void                  eel_gtk_button_set_padding                      (GtkButton            *button,
+                                                                       int              pad_amount);
diff -Nabur gnome-applets-diff/trashapplet/src/trashapplet.c gnome-applets/trashapplet/src/trashapplet.c
--- gnome-applets-diff/trashapplet/src/trashapplet.c	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/src/trashapplet.c	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,917 @@
+/* trashapplet.c
+ *
+ * Copyright (c) 2004  Michiel Sikkes <michiel@eyesopened.nl>,
+ *               2004  Emmanuele Bassi <ebassi@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License VERSION 2 as
+ * published by the Free Software Foundation.  You are not allowed to
+ * use any other version of the license; unless you got the explicit
+ * permission from the author to do so.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#include <gtk/gtktooltips.h>
+#include <gtk/gtkimage.h>
+#include <gtk/gtkstock.h>
+#include <gtk/gtkmessagedialog.h>
+#include <gconf/gconf-client.h>
+#include <libgnome/libgnome.h>
+#include <libgnomeui/libgnomeui.h>
+
+#include "eel-extension.h"
+#include "trashapplet.h"
+
+static void	trash_applet_do_empty 	(BonoboUIComponent *component,
+					 TrashApplet *ta,
+					 const gchar *cname);
+static void	trash_applet_show_about	(BonoboUIComponent *component,
+					 TrashApplet *ta,
+					 const gchar *cname);
+static void	trash_applet_open_folder (BonoboUIComponent *component,
+					  TrashApplet *ta,
+					  const gchar *cname);
+static void	trash_applet_show_help (BonoboUIComponent *component,
+					TrashApplet *ta,
+					const gchar *cname);
+
+static gboolean		trash_applet_is_empty	(TrashApplet *trash_applet);
+static void		trash_applet_update_icon (TrashApplet *trash_applet);
+static void 		trash_applet_update_tip (TrashApplet *trash_applet);
+
+static const BonoboUIVerb trash_applet_menu_verbs [] = {
+	BONOBO_UI_UNSAFE_VERB ("EmptyTrash", trash_applet_do_empty),
+	BONOBO_UI_UNSAFE_VERB ("OpenTrash", trash_applet_open_folder),
+	BONOBO_UI_UNSAFE_VERB ("AboutTrash", trash_applet_show_about),
+	BONOBO_UI_UNSAFE_VERB ("HelpTrash", trash_applet_show_help),
+	BONOBO_UI_VERB_END
+};
+
+static GtkTargetEntry drop_types[] =
+{
+	{ "text/uri-list", 0, 0 }
+};
+
+static gint n_drop_types = sizeof (drop_types) / sizeof (drop_types[0]);
+
+static GConfClient *client = NULL;
+
+/* TODO - Must HIGgify this dialog */
+static void
+error_dialog (TrashApplet *ta, const gchar *error, ...)
+{
+	va_list args;
+	gchar *error_string;
+	GtkWidget *dialog;
+
+	g_return_if_fail (error != NULL);
+
+	va_start (args, error);
+	error_string = g_strdup_vprintf (error, args);
+	va_end (args);
+
+	dialog = gtk_message_dialog_new (NULL,
+			GTK_DIALOG_MODAL,
+			GTK_MESSAGE_ERROR,
+			GTK_BUTTONS_OK,
+			"%s",
+			error_string);
+
+	g_signal_connect (G_OBJECT (dialog), "response",
+			G_CALLBACK (gtk_widget_destroy),
+			NULL);
+
+	gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+	gtk_window_set_screen (GTK_WINDOW(dialog),
+			gtk_widget_get_screen (GTK_WIDGET (ta->applet)));
+	gtk_widget_show (dialog);
+
+	g_free (error_string);
+}
+
+static GnomeVFSURI *
+trash_applet_get_main_trash_directory_uri (void)
+{
+	GnomeVFSResult trash_check;
+	GnomeVFSURI *retval;
+
+	trash_check = gnome_vfs_find_directory (NULL,
+			GNOME_VFS_DIRECTORY_KIND_TRASH,
+			&retval,
+			FALSE,
+			FALSE,
+			0);
+
+	if (trash_check != GNOME_VFS_OK) {
+		g_warning (_("Unable to find the Trash directory: %s"),
+				gnome_vfs_result_to_string (trash_check));
+		return NULL;
+	}
+
+	return retval;
+}
+
+static guint
+get_dir_count (const GnomeVFSURI *path_uri)
+{
+	GnomeVFSResult res;
+	GList *dirlist, *tmp;
+	gchar *path;
+	guint retval = 0;
+
+	g_return_val_if_fail (path_uri != NULL, 0);
+
+	path = gnome_vfs_uri_to_string (path_uri, GNOME_VFS_URI_HIDE_NONE);
+
+	res = gnome_vfs_directory_list_load (&dirlist, path,
+			GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
+	if (res != GNOME_VFS_OK) {
+		g_warning (_("GNOME VFS Error: %s"), gnome_vfs_result_to_string (res));
+		g_free(path);
+		return 0;
+	}
+
+	for (tmp = g_list_first (dirlist); tmp != NULL; tmp = g_list_next (tmp)) {
+		GnomeVFSFileInfo *info = (GnomeVFSFileInfo *) tmp->data;
+		
+		/* FIXME - I don't know how to make this portable; this should
+		 * be portable enought on each system on which GNOME runs,
+		 * though.
+		 */
+		if ((0 == strcmp (info->name, ".")) ||
+		    (0 == strcmp (info->name, "..")))
+			continue;
+
+		retval++;
+	}
+
+	gnome_vfs_file_info_list_free (dirlist);
+
+	g_free (path);
+
+	return retval;
+}
+
+static void
+trash_applet_update_item_count (TrashApplet *trash_applet)
+{
+	GnomeVFSURI *trash_dir;
+	BonoboUIComponent *popup_component;
+
+	g_return_if_fail (trash_applet != NULL);
+	
+	trash_dir = trash_applet_get_main_trash_directory_uri ();
+	trash_applet->item_count = get_dir_count (trash_dir);
+
+	gnome_vfs_uri_unref (trash_dir);
+
+	trash_applet->is_empty = (trash_applet->item_count == 0);
+
+	/* set sensitivity on the "empty trash" context menu item */
+	popup_component = panel_applet_get_popup_component (trash_applet->applet);
+	bonobo_ui_component_set_prop (popup_component,
+				      "/commands/EmptyTrash",
+				      "sensitive",
+				      trash_applet->is_empty ? "0" : "1",
+				      NULL);
+}
+
+static guint
+trash_applet_items_count (TrashApplet *trash_applet)
+{
+	g_return_val_if_fail (trash_applet != NULL, 0);
+
+	return trash_applet->item_count;
+}
+
+
+static gboolean
+trash_applet_is_empty (TrashApplet *trash_applet)
+{
+	g_return_val_if_fail (trash_applet != NULL, FALSE);
+
+	return trash_applet->is_empty;
+}
+
+static void
+trash_applet_update_icon (TrashApplet *trash_applet)
+{
+	TrashState new_state = TRASH_STATE_UNKNOWN;
+	gchar *icon_name = NULL;
+	GdkPixbuf *new_icon;
+	
+	g_return_if_fail (trash_applet != NULL);
+
+	if (trash_applet->icon == NULL)
+		return;
+
+	if (trash_applet->drag_hover) {
+		new_state = TRASH_STATE_ACCEPT;
+		icon_name = TRASH_ICON_EMPTY_ACCEPT;
+	} else if (trash_applet->is_empty) {
+		new_state = TRASH_STATE_EMPTY;
+		icon_name = TRASH_ICON_EMPTY;
+	} else {
+		new_state = TRASH_STATE_FULL;
+		icon_name = TRASH_ICON_FULL;
+	}
+
+	/* if the icon is up to date, return */
+	if (trash_applet->icon && trash_applet->icon_state == new_state)
+		return;
+
+	new_icon = gtk_icon_theme_load_icon (trash_applet->icon_theme,
+					     icon_name,
+					     trash_applet->size,
+					     0,
+					     NULL);
+
+	/* Handle themes that do not have a -accept icon variant */
+	if (!new_icon && new_state == TRASH_STATE_ACCEPT) {
+		icon_name = trash_applet->is_empty
+			? TRASH_ICON_EMPTY : TRASH_ICON_FULL;
+		new_icon = gtk_icon_theme_load_icon (trash_applet->icon_theme,
+						     icon_name,
+						     trash_applet->size,
+						     0,
+						     NULL);
+	}
+
+	if (trash_applet->icon)
+		g_object_unref (G_OBJECT (trash_applet->icon));
+
+	trash_applet->icon = new_icon;
+	trash_applet->icon_state = new_state;
+	
+	gtk_image_set_from_pixbuf (GTK_IMAGE (trash_applet->image), trash_applet->icon);
+	
+	return;
+}
+
+static void
+trash_applet_update_tip (TrashApplet *trash_applet)
+{
+	gchar *tip_text;
+	guint items;
+
+	items = trash_applet_items_count (trash_applet);
+	switch (items) {
+		case 0:
+			tip_text = g_strdup (_("No Items in Trash"));
+			break;
+		case 1:
+			tip_text = g_strdup (_("1 Item in Trash"));
+			break;
+		default:
+			tip_text = g_strdup_printf (_("%d Items in Trash"), 
+							items);
+	}
+
+	gtk_tooltips_set_tip (GTK_TOOLTIPS (trash_applet->tooltips),
+			     GTK_WIDGET (trash_applet->applet),
+			     tip_text,
+			     NULL);
+
+	g_free (tip_text);
+}
+
+static gint
+update_transfer_callback (GnomeVFSAsyncHandle *handle,
+                         GnomeVFSXferProgressInfo *progress_info,
+                         gpointer user_data)
+{
+       /* UI updates here */
+       TrashApplet *ta = (TrashApplet *) user_data;
+
+       return 1;
+}
+
+
+/* this function is based on the one with the same name in
+   libnautilus-private/nautilus-file-operations.c */
+#define NAUTILUS_PREFERENCES_CONFIRM_TRASH    "/apps/nautilus/preferences/confirm_trash"
+static gboolean
+confirm_empty_trash (GtkWidget *parent_view)
+{
+	GtkWidget *dialog;
+	int response;
+	GtkWidget *hbox, *vbox, *image, *label, *button;
+	gchar     *str;
+	GdkScreen *screen;
+
+	/* Just Say Yes if the preference says not to confirm. */
+	if (!gconf_client_get_bool (client,
+				    NAUTILUS_PREFERENCES_CONFIRM_TRASH,
+				    NULL)) {
+		return TRUE;
+	}
+	
+	screen = gtk_widget_get_screen (parent_view);
+
+	dialog = gtk_dialog_new ();
+	gtk_window_set_screen (GTK_WINDOW (dialog), screen);
+	atk_object_set_role (gtk_widget_get_accessible (dialog), ATK_ROLE_ALERT);
+	gtk_window_set_title (GTK_WINDOW (dialog), "");
+	gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+	gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
+	gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+	gtk_window_set_wmclass (GTK_WINDOW (dialog), "empty_trash",
+				"Nautilus");
+
+	/* Make transient for the window group */
+        gtk_widget_realize (dialog);
+	gdk_window_set_transient_for (GTK_WIDGET (dialog)->window,
+				      gdk_screen_get_root_window (screen));
+	gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+	
+	gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
+
+	hbox = gtk_hbox_new (FALSE, 12);
+	gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
+	gtk_widget_show (hbox);
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+			    FALSE, FALSE, 0);
+
+	image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION,
+					  GTK_ICON_SIZE_DIALOG);
+	gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+	gtk_widget_show (image);
+	gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+
+	vbox = gtk_vbox_new (FALSE, 12);
+	gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
+	gtk_widget_show (vbox);
+
+	str = g_strconcat ("<span weight=\"bold\" size=\"larger\">", 
+		_("Are you sure you want to empty "
+		"all of the items from the trash?"), 
+		"</span>", 
+		NULL);
+		
+	label = gtk_label_new (str);  
+	gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+	gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+	gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+	gtk_widget_show (label);
+	g_free (str);
+
+	label = gtk_label_new (_("If you empty the trash, items "
+		"will be permanently deleted."));
+	
+	gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+	gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+	gtk_widget_show (label);
+
+	gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL,
+			       GTK_RESPONSE_CANCEL);
+
+	button = eel_gtk_button_new_with_stock_icon (_("_Empty"),
+						     GTK_STOCK_DELETE);
+	gtk_widget_show (button);
+	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+
+	gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button,
+				      GTK_RESPONSE_YES);
+
+	gtk_dialog_set_default_response (GTK_DIALOG (dialog),
+					 GTK_RESPONSE_YES);
+
+	response = gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_object_destroy (GTK_OBJECT (dialog));
+
+	return response == GTK_RESPONSE_YES;
+}
+
+static void
+trash_applet_do_empty (BonoboUIComponent *component,
+		    TrashApplet *ta,
+		    const gchar *cname)
+{
+       GnomeVFSURI *trash_dir, *file_uri;
+       GnomeVFSAsyncHandle *hnd;
+       GnomeVFSResult res;
+       GList *dir_list, *uri_list, *l;
+       gchar *path;
+
+       g_return_if_fail (PANEL_IS_APPLET (ta->applet));
+
+       if (trash_applet_is_empty (ta))
+               return;
+
+       if (!confirm_empty_trash (GTK_WIDGET (ta->applet)))
+	       return;
+
+       trash_dir = trash_applet_get_main_trash_directory_uri ();
+       path = gnome_vfs_uri_to_string (trash_dir, GNOME_VFS_URI_HIDE_NONE);
+
+       res = gnome_vfs_directory_list_load (&dir_list, path,
+                       GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
+       if (res != GNOME_VFS_OK) {
+               g_warning ("GNOME VFS Error: %s", gnome_vfs_result_to_string (res));
+               g_free (path);
+               return;
+       }
+
+       /* First pass: we build the URI list... */
+       uri_list = NULL;
+       for (l = g_list_first (dir_list); l; l = g_list_next (l)) {
+               GnomeVFSFileInfo *file_info = (GnomeVFSFileInfo *) l->data;
+
+               if ((0 == strcmp (file_info->name, ".")) ||
+                   (0 == strcmp (file_info->name, "..")))
+                       continue;
+
+               file_uri = gnome_vfs_uri_append_file_name (trash_dir, file_info->name);
+
+               uri_list = g_list_prepend (uri_list, file_uri);
+       }
+
+       /* ... Then we feed it to the xfer function; we use an async method,
+        * since the trash might be arbitrarly big, and we don't want the
+        * emptying to block; the callback is used to update a progress
+        * window a-la-Nautilus.
+        */
+       gnome_vfs_async_xfer (&hnd, uri_list, NULL,
+                               GNOME_VFS_XFER_DELETE_ITEMS | GNOME_VFS_XFER_RECURSIVE,
+                               GNOME_VFS_XFER_ERROR_MODE_ABORT,
+                               GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
+                               GNOME_VFS_PRIORITY_DEFAULT,
+                               update_transfer_callback, ta,
+                               NULL, NULL);
+
+       /* cleanup */
+       gnome_vfs_file_info_list_free (dir_list);
+       gnome_vfs_uri_list_free (uri_list);
+       gnome_vfs_uri_unref (trash_dir);
+}
+
+static void
+trash_applet_open_folder (BonoboUIComponent *component,
+			  TrashApplet *ta,
+			  const gchar *cname)
+{
+	/* Open the "trash:" URI with gnome-open */
+	gchar *argv[] = { "gnome-open", EEL_TRASH_URI, NULL };
+	GError *err = NULL;
+	gboolean res;	
+
+        g_return_if_fail (PANEL_IS_APPLET (ta->applet));
+
+	res = g_spawn_async (NULL,
+			     argv, NULL,
+			     G_SPAWN_SEARCH_PATH,
+			     NULL, NULL,
+			     NULL,
+			     &err);
+	
+	if (! res) {
+		error_dialog (ta, _("Error while spawing nautilus:\n%s"), err->message);
+		g_error_free (err);
+	}
+}
+
+static void
+trash_applet_show_help (BonoboUIComponent *component,
+                  TrashApplet *ta,
+                  const gchar *cname)
+{
+        GError *error = NULL;
+
+        g_return_if_fail (PANEL_IS_APPLET (ta->applet));
+
+       /* FIXME - Actually, we need a user guide */
+        gnome_help_display_desktop_on_screen (
+                NULL, "trashapplet", "trashapplet", NULL,
+                gtk_widget_get_screen (GTK_WIDGET (ta->applet)),
+               &error);
+
+        if (error) {
+        	error_dialog (ta, _("There was an error displaying help: %s"), error->message);
+        	g_error_free (error);
+        }
+}
+
+
+static void
+trash_applet_show_about (BonoboUIComponent *component,
+		    TrashApplet *ta,
+		    const gchar *cname)
+{
+	GtkWidget *about;
+	gchar *translator_credits = _("translator_credits");
+	static const char *authors[] = {
+		"Michiel Sikkes <michiel@eyesopened.nl>",
+		"Emmanuele Bassi <ebassi@gmail.com>",
+		"Sebastian Bacher <seb128@canonical.com>",
+		"James Henstridge <james.henstridge@canonical.com>",
+		NULL
+	};
+
+	static const char *documenters[] = {
+		"Michiel Sikkes <michiel@eyesopened.nl>",
+		NULL
+	};
+
+	about = gnome_about_new ("Trash Applet", VERSION,
+			_("Copyright (c) 2004 Michiel Sikkes"),
+			_("The GNOME Trash Applet"),
+			authors,
+			documenters,
+			strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL,
+			NULL);
+
+	gtk_widget_show(about);
+
+}
+
+static void 
+update_icon_cb (GtkWidget *applet, gpointer data)
+{
+	TrashApplet *trash_applet = (TrashApplet *) data;
+
+	trash_applet->icon_state = TRASH_STATE_UNKNOWN;
+	trash_applet_update_icon(trash_applet);
+}
+
+static gboolean 
+button_press_cb (GtkWidget *applet, GdkEventButton *event, TrashApplet *ta)
+{
+  if (event->button == 1)
+    trash_applet_open_folder(NULL, ta, NULL);
+
+  return FALSE;
+}
+
+static void
+destroy_cb (GtkWidget *applet, gpointer data)
+{
+	TrashApplet *trash_applet = (TrashApplet *) data;
+	
+	if (trash_applet) {
+               gnome_vfs_monitor_cancel (trash_applet->trash_monitor);
+
+               g_object_unref (trash_applet->icon);
+               g_object_unref (trash_applet->tooltips);
+
+               g_free (trash_applet);
+	}
+}
+
+static void
+drag_data_received_cb (GtkWidget *applet, GdkDragContext *context,
+		       gint x, gint y,
+		       GtkSelectionData *selection_data,
+		       guint info, guint time, gpointer data)
+{
+  	GList	*list, *scan;
+	GnomeVFSResult trash_check;
+	GnomeVFSURI *trash_uri;
+	TrashApplet *trash_applet = (TrashApplet *) data;
+
+	trash_uri = trash_applet_get_main_trash_directory_uri ();
+	if (trash_uri == NULL)
+		return;
+
+	list = gnome_vfs_uri_list_parse (selection_data->data);
+
+	for (scan = g_list_first (list); scan; scan = g_list_next (scan)) {
+		const GnomeVFSURI *source_uri = scan->data;
+		const GnomeVFSURI *target_uri;
+		gboolean is_local;
+		gchar *source_basename;
+		GnomeVFSResult result;
+
+		is_local = gnome_vfs_uri_is_local (source_uri);
+		if (! is_local) {
+			continue;
+		} 
+
+		source_basename = gnome_vfs_uri_extract_short_name
+			(source_uri);
+
+		target_uri = gnome_vfs_uri_append_file_name(trash_uri,
+				source_basename);
+
+		result = gnome_vfs_xfer_uri (source_uri, target_uri,
+				GNOME_VFS_XFER_REMOVESOURCE | GNOME_VFS_XFER_RECURSIVE,
+				GNOME_VFS_XFER_ERROR_MODE_ABORT,
+				GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
+				NULL, data);
+
+		if (result != GNOME_VFS_OK) {
+                       error_dialog (trash_applet, _("Unable to move to trash:\n%s"),
+                                       gnome_vfs_result_to_string (result));
+
+		}
+		
+		g_free (source_basename);
+
+	}
+
+	gnome_vfs_uri_list_free(list);
+}
+
+static gboolean
+drag_motion_cb (GtkWidget      *applet,
+		GdkDragContext *context,
+		gint            x,
+		gint            y,
+		guint           time,
+		TrashApplet    *trash_applet)
+{
+	if (!trash_applet->drag_hover) {
+		trash_applet->drag_hover = TRUE;
+		trash_applet_update_icon (trash_applet);
+	}
+	gdk_drag_status (context, context->suggested_action, time);
+	return TRUE;
+}
+
+static void
+drag_leave_cb (GtkWidget      *applet,
+	       GdkDragContext *context,
+	       guint           time,
+	       TrashApplet    *trash_applet)
+{
+	if (trash_applet->drag_hover) {
+		trash_applet->drag_hover = FALSE;
+		trash_applet_update_icon (trash_applet);
+	}
+}
+
+static void
+changed_orient_cb (GtkWidget         *applet,
+                  PanelAppletOrient orient,
+                  TrashApplet       *trash_applet)
+{
+       GtkOrientation new_orient;
+       switch (orient) {
+               case PANEL_APPLET_ORIENT_LEFT:
+               case PANEL_APPLET_ORIENT_RIGHT:
+                       new_orient = GTK_ORIENTATION_VERTICAL;
+                       break;
+               case PANEL_APPLET_ORIENT_UP:
+               case PANEL_APPLET_ORIENT_DOWN:
+               default:
+                       new_orient = GTK_ORIENTATION_HORIZONTAL;
+                       break;
+       }
+       if (new_orient == trash_applet->orient)
+               return;
+       trash_applet->orient = new_orient;
+       trash_applet->icon_state = TRASH_STATE_UNKNOWN;
+       trash_applet_update_icon (trash_applet);
+}
+
+static void
+changed_background_cb (PanelApplet               *applet,
+                      PanelAppletBackgroundType  type,
+                      GdkColor                  *color,
+                      const gchar               *pixmap,
+                      TrashApplet               *trash_applet)
+{
+       if (type == PANEL_NO_BACKGROUND ||
+	   type == PANEL_PIXMAP_BACKGROUND) {
+               GtkRcStyle *rc_style;
+
+               rc_style = gtk_rc_style_new ();
+
+               gtk_widget_modify_style (GTK_WIDGET (trash_applet->applet), rc_style);
+	       gtk_widget_modify_style (GTK_WIDGET (trash_applet->image), rc_style);
+               g_object_unref (rc_style);
+       } else if (type == PANEL_COLOR_BACKGROUND) {
+               gtk_widget_modify_bg (GTK_WIDGET (trash_applet->applet),
+                                     GTK_STATE_NORMAL,
+                                     color);
+               gtk_widget_modify_bg (GTK_WIDGET (trash_applet->image),
+                                     GTK_STATE_NORMAL,
+                                     color);
+       }
+}
+
+static void
+changed_size_cb (PanelApplet *applet,
+                guint       size,
+                gpointer    data)
+{
+       TrashApplet *trash_applet = (TrashApplet *) data;
+
+       if (trash_applet->size == size)
+               return;
+
+       trash_applet->size = size;
+       trash_applet->icon_state = TRASH_STATE_UNKNOWN;
+
+       trash_applet_update_icon (trash_applet);
+       trash_applet_update_tip (trash_applet);
+}
+
+static void
+trash_monitor_cb (GnomeVFSMonitorHandle    *handle,
+                 const gchar              *monitor_uri,
+                 const gchar              *info_uri,
+                 GnomeVFSMonitorEventType  type,
+                 TrashApplet              *trash_applet)
+{
+       trash_applet_update_item_count (trash_applet);
+
+       trash_applet_update_icon (trash_applet);
+       trash_applet_update_tip (trash_applet);
+}
+    
+
+static gboolean
+trash_applet_fill (PanelApplet *applet)
+{
+	GtkWidget *box;
+	guint size;
+	TrashApplet *ta;
+        gchar *trash_dir;
+        GnomeVFSResult res;
+        GnomeVFSURI *trash_dir_uri;
+        GnomeVFSMonitorHandle *hnd;
+
+	/* get default gconf client */
+	if (!client)
+		client = gconf_client_get_default ();
+
+	panel_applet_set_flags (applet, PANEL_APPLET_EXPAND_MINOR);
+	
+	ta = g_new0 (TrashApplet, 1);
+	
+	/* init applet data */
+	ta->applet = applet;
+
+        ta->size = panel_applet_get_size (ta->applet);
+        switch (panel_applet_get_orient (ta->applet)) {
+                case PANEL_APPLET_ORIENT_LEFT:
+                case PANEL_APPLET_ORIENT_RIGHT:
+                        ta->orient = GTK_ORIENTATION_VERTICAL;
+                        break;
+                case PANEL_APPLET_ORIENT_UP:
+                case PANEL_APPLET_ORIENT_DOWN:
+                default:
+                        ta->orient = GTK_ORIENTATION_HORIZONTAL;
+                        break;
+        }
+
+	ta->item_count = 0;
+	ta->is_empty = TRUE;
+	ta->drag_hover = FALSE;
+
+	trash_dir = g_build_filename (g_get_home_dir (), ".Trash", NULL);
+	if (!g_file_test (trash_dir, G_FILE_TEST_EXISTS))
+	  mkdir (trash_dir, 0700);
+
+	g_free(trash_dir);
+	trash_dir = NULL;	  
+	  
+	trash_dir_uri = trash_applet_get_main_trash_directory_uri ();
+	if (trash_dir_uri != NULL)
+	  trash_dir = gnome_vfs_uri_to_string (trash_dir_uri, GNOME_VFS_URI_HIDE_NONE);
+
+        /* VFS monitor for directory changes */
+        res = gnome_vfs_monitor_add (&hnd,
+                                     trash_dir, GNOME_VFS_MONITOR_DIRECTORY,
+                                     (GnomeVFSMonitorCallback) trash_monitor_cb,                                     ta);
+        if (res != GNOME_VFS_OK) {
+                error_dialog (ta, _("Unable to acquire monitor of the Trash directory"));
+                return FALSE;
+        }
+
+        gnome_vfs_uri_unref (trash_dir_uri);
+        g_free (trash_dir);
+
+        ta->trash_monitor = hnd;
+
+        /* fetch the icon theme */
+        ta->icon_theme = gtk_icon_theme_get_default ();
+	ta->icon_state = TRASH_STATE_UNKNOWN;
+			
+ 
+        /* use the trash icon from the icon theme */
+        if (ta->icon == NULL) {
+                ta->icon = gtk_icon_theme_load_icon (ta->icon_theme,
+                                (trash_applet_is_empty (ta) ?
+                                 TRASH_ICON_EMPTY : TRASH_ICON_FULL),
+                                ta->size,
+                                0,
+                                NULL);
+        }
+
+        if (ta->icon) {
+                ta->image = gtk_image_new_from_pixbuf (ta->icon);
+        } else {
+                ta->image = gtk_image_new_from_stock (GTK_STOCK_MISSING_IMAGE,
+                                                      GTK_ICON_SIZE_SMALL_TOOLBAR);
+        }
+ 
+        ta->tooltips = gtk_tooltips_new ();
+ 
+        box = gtk_hbox_new(TRUE, 0);
+
+        gtk_box_pack_start (GTK_BOX(box), ta->image, TRUE, TRUE, 0);
+
+        gtk_drag_dest_set (GTK_WIDGET (ta->applet),
+                           GTK_DEST_DEFAULT_ALL,
+                           drop_types, n_drop_types,
+                           GDK_ACTION_MOVE | GDK_ACTION_COPY);
+
+        g_signal_connect (G_OBJECT (ta->applet),
+                          "destroy",
+                          G_CALLBACK (destroy_cb),
+                          ta);
+        g_signal_connect (G_OBJECT (ta->applet),
+                          "drag_data_received",
+                          G_CALLBACK (drag_data_received_cb),
+                          ta);
+	g_signal_connect (G_OBJECT (ta->applet),
+			  "drag_motion",
+			  G_CALLBACK (drag_motion_cb),
+			  ta);
+	g_signal_connect (G_OBJECT (ta->applet),
+			  "drag_leave",
+			  G_CALLBACK (drag_leave_cb),
+			  ta);
+        g_signal_connect (G_OBJECT (ta->applet),
+                          "change_orient",
+                          G_CALLBACK (changed_orient_cb),
+                          ta);
+        g_signal_connect (G_OBJECT (ta->applet),
+                          "change_size",
+                          G_CALLBACK (changed_size_cb),
+			  ta);
+
+        g_signal_connect (G_OBJECT (ta->applet),
+                          "change_background",
+                          G_CALLBACK (changed_background_cb),
+                          ta);
+        g_signal_connect (G_OBJECT (ta->applet),
+                          "button-press-event",
+                          G_CALLBACK (button_press_cb),
+                          ta);
+	g_signal_connect (G_OBJECT (ta->icon_theme),
+			"changed",
+			G_CALLBACK(update_icon_cb),
+			ta);
+ 
+        gtk_container_add (GTK_CONTAINER(ta->applet), box);
+	
+	/* Set up the menu */
+	panel_applet_setup_menu_from_file (ta->applet,
+			NULL,
+			"GNOME_Panel_TrashApplet.xml",
+			NULL,
+			trash_applet_menu_verbs,
+			ta);
+
+        /* update display */
+	trash_applet_update_item_count (ta);
+        trash_applet_update_icon (ta);
+        trash_applet_update_tip (ta);
+
+	gtk_widget_show_all (GTK_WIDGET(ta->applet));
+
+	return TRUE;
+}	
+
+static gboolean
+trash_applet_factory (PanelApplet *applet,
+                      const gchar *iid,
+		      gpointer     data)
+{
+	gboolean retval = FALSE;
+
+  	if (!strcmp (iid, "OAFIID:GNOME_Panel_TrashApplet"))
+    		retval = trash_applet_fill (applet);
+
+  	return retval;
+}
+
+PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_Panel_TrashApplet_Factory",
+		PANEL_TYPE_APPLET,
+		"trashapplet",
+		"0",
+		trash_applet_factory,
+		NULL);
diff -Nabur gnome-applets-diff/trashapplet/src/trashapplet.h gnome-applets/trashapplet/src/trashapplet.h
--- gnome-applets-diff/trashapplet/src/trashapplet.h	1970-01-01 01:00:00.000000000 +0100
+++ gnome-applets/trashapplet/src/trashapplet.h	2004-09-19 18:31:51.000000000 +0200
@@ -0,0 +1,60 @@
+/* trashapplet.h
+ *
+ * Copyright (c) 2004  Michiel Sikkes <michiel@eyesopened.nl>,
+ *               2004  Emmanuele Bassi <ebassi@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify  
+ * it under the terms of the GNU General Public License VERSION 2 as
+ * published by the Free Software Foundation.  You are not allowed to
+ * use any other version of the license; unless you got the explicit  
+ * permission from the author to do so.  
+ * 
+ * This program is distributed in the hope that it will be useful,  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of  
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License  
+ * along with this program; if not, write to the Free Software  
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __TRASH_APPLET_H__
+#define __TRASH_APPLET_H__
+
+#include <panel-applet.h>
+#include <gnome.h>
+#include <libgnomevfs/gnome-vfs.h>
+
+#define TRASH_ICON_EMPTY	"gnome-fs-trash-empty"
+#define TRASH_ICON_EMPTY_ACCEPT "gnome-fs-trash-empty-accept"
+#define TRASH_ICON_FULL		"gnome-fs-trash-full"
+
+typedef enum {
+	TRASH_STATE_UNKNOWN,
+	TRASH_STATE_EMPTY,
+	TRASH_STATE_FULL,
+	TRASH_STATE_ACCEPT
+} TrashState;
+
+typedef struct _TrashApplet	TrashApplet;
+struct _TrashApplet
+{
+	PanelApplet *applet;
+	PanelAppletOrient orient;
+
+	GtkIconTheme *icon_theme;
+	TrashState icon_state;
+	GdkPixbuf *icon;
+	GtkWidget *image;
+	GtkTooltips *tooltips;
+
+	guint size;
+	gint item_count;
+	gboolean is_empty;
+	gboolean drag_hover;
+
+	GnomeVFSMonitorHandle *trash_monitor;
+};
+
+#endif /* __TRASH_APPLET_H__ */
