[Pkg-wmaker-commits] [wmdrawer] 01/03: Imported Upstream version 0.10.5

Doug Torrance dtorrance-guest at moszumanska.debian.org
Fri Dec 16 04:21:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmdrawer.

commit a7044e1cb6b794c462c4011637a5488c5993774d
Author: Doug Torrance <dtorrance at piedmont.edu>
Date:   Thu Dec 15 23:17:07 2016 -0500

    Imported Upstream version 0.10.5
---
 AUTHORS                         |   64 +++
 COPYING                         |  340 +++++++++++++
 ChangeLog                       |  233 +++++++++
 INSTALL                         |   43 ++
 Makefile                        |   79 +++
 README                          |   66 +++
 TODO                            |   10 +
 config.c                        |  667 +++++++++++++++++++++++++
 config.h                        |   24 +
 doc/wmdrawer-it.sgml            |  232 +++++++++
 doc/wmdrawer.1x.gz              |  Bin 0 -> 3006 bytes
 doc/wmdrawer.sgml               |  296 ++++++++++++
 graphics.c                      |   75 +++
 graphics.h                      |   21 +
 images.c                        |  245 ++++++++++
 images.h                        |   29 ++
 pixmaps/defaultDockIcon.xpm     |  115 +++++
 pixmaps/defaultHighlightImg.xpm |   69 +++
 pixmaps/defaultIcon.xpm         |  125 +++++
 pixmaps/defaultIconsBg.xpm      |  198 ++++++++
 pixmaps/defaultIconsBg2.xpm     |  195 ++++++++
 pixmaps/defaultUp.xpm           |   53 ++
 types_defs.h                    |   94 ++++
 utils.c                         |   75 +++
 utils.h                         |   26 +
 wmdrawer-gentoo.ebuild          |   27 ++
 wmdrawer-redhat.spec            |   48 ++
 wmdrawer-slackware.spec         |   11 +
 wmdrawer.c                      | 1018 +++++++++++++++++++++++++++++++++++++++
 wmdrawerrc.example              |  105 ++++
 30 files changed, 4583 insertions(+)

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..3c0fe5c
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,64 @@
+Authors:
+-------
+Val�ry Febvre (aka valos/ckix) <vfebvre at vfebvre.lautre.net>
+	Main author: coding, docs and website.
+
+
+Contributors:
+------------
+Christopher W. Wesley <cwwesley at udlug.org>
+Initial manual page (English) author.
+
+Fabio Stumbo <f.stumbo at unife.it>
+Italian manual page author.
+
+Oliwier 'aLEczapKA' Ptak <aleczapka at gmx.net>
+A patch to add a new behavior : automatic opening of the drawer
+when the mouse enters the dockapp.
+This behavior can be control with option show_on_hover (0/1) in the
+configuration file.
+
+Konstantin Malakhanov <malakhanov at gmx.de>
+A patch to support absolute image paths in the configuration file.
+
+Franciso Jose Oviedo <foviedoa at teleline.es>
+A patch to improve the execution's process of commands.
+
+Scott Morgan <blumf at blumf.freeserve.co.uk>
+Send a patch which allows to launch several apps at once from the drawer.
+By holding down the key Shift, you can keep the drawer opened.
+
+Ed Goforth <e.goforth at computer.org>
+A patch which allows to set the client instance name (application name)
+so the window manager can differentiate between multiple instances.
+This behavior can be control with option instance_name in the
+configuration file or from command-line with -n option.
+A patch which add XSetCommand() so that the window manager can
+grab the command-line args wmdrawer was started with. This is helpful for
+WindowMaker so it won't have to ask you to type the command-line in when 
+docking.
+
+Christopher T King <squirrel at WPI.EDU>
+A patch which fixes a highlight bug for horizontal directions.
+
+Jan Gregor (aka pAmela) <pamela at rak.bb.euroweb.sk>
+A patch which allows ' ' or '\t' before comment characters, adds line number
+in warning/error messages, replaces last static arrays by dynamic arrays,
+replaces option dock_size by options dock_width & dock_height (dock can be
+now rectangular!).
+A patch which allows to set dock's size.
+This can be controlled with option dock_size in the configuration file.
+A patch which adds line number in error and warning messages of the
+config file parsing.
+
+Tomek Grzejszczyk <T.Grzejszczyk at elka.pw.edu.pl>
+A patch to fix a drawer animation speed problem with 2.6.x kernels.
+
+
+Packages maintainers:
+--------------------
+Debian i386 (unstable): Christopher W. Wesley <cwwesley at udlug.org>
+RedHat i386: Kevin Burtch <kburtch at worldnet.att.net>
+Slackware i386: Ed Goforth <e.goforth at computer.org>
+Solaris SPARC: Ed Goforth <e.goforth at computer.org>
+FreeBSD i386, Alpha: Josef El-Rayes <j.el-rayes at daemon.li>
\ No newline at end of file
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..eeb586b
--- /dev/null
+++ b/COPYING
@@ -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 --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..eaff49b
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,233 @@
+2004-06-09 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.10.5
+	* config.c: 2 minor bugs in config parsing were fixed.
+
+2004-06-03 Tomek Grzejszczyk <T.Grzejszczyk at elka.pw.edu.pl>
+	* wmdrawer.c: Fixed drawer animation speed problem with 2.6.x kernels.
+	
+2003-08-27 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.10.4.1 - Major bugfixe release
+	* config.c: Fixed a segfault which occurs when number of buttons was not
+	equal in all columns (memory dynamic allocation bug).
+
+2003-08-27 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.10.4
+	* images.c: Rewrite createAndResizePixmap() function.
+	Images can be fit now to a rectangular shape.
+	* config.c: Some code clean-up.
+
+2003-08-24 Jan Gregor <pamela at rak.bb.euroweb.sk>
+	* config.c: Possibility to add ' ' or '\t' before comment characters.
+	When notifying about warning/error in config file, number of line
+	on which warning/error happened is now printed.
+	All arrays have now dynamic length.
+	The dock can be now rectangular. Option dock_size was replaced by
+	2 new options: dock_width and dock_height.
+
+2003-08-23 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.10.3
+	* images.c: Add param resizeMask to createAndResizePixmap() function.
+	* config.c, wmdrawer.c: a new behavior, icons' auto-expand.
+	Allows icons' enlargement to fit them to buttons' size.
+	This behavior can be controlled with the option icons_expand (0/1).
+
+2003-08-21 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* config.c: Changed min and max values for dock_size and btns_size
+	to MIN_ICON_SIZE and MAX_ICON_SIZE (types_defs.h).
+	* images.c: the createAndResizePixmap() function now resizes the image
+	(greater or smaller) to fit exactly with dimension "dim x dim"
+	
+2003-08-20 Jan Gregor <pamela at rak.bb.euroweb.sk>
+	* config.c, wmdrawer.c: a new behavior, dock's size
+	This can be controlled with option dock_size in the configuration file.
+	
+2003-06-23 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* Makefile: a compilation problem on FreeBSD was fixed.
+
+2003-06-08 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* wmdrawer.c: a bug in the drawer's opening was fixed (windowed mode only).
+
+2003-06-04 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.10.2
+	* wmdrawer.c, config.c: the drawer's animation can now be disabled with
+	value 0 for option animation_speed in the configuration file.
+
+2003-05-24 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* wmdrawer.c: one more auto-hide bug was fixed (Thx to Joerg Desch for the bug report).
+
+2003-05-20 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.10.1
+	* wmdrawer.c: a new auto-hide bug was fixed. The last! I hope.
+	* images.c, Makefile: It's now possible to use Imlib as	image library (Makefile option).
+	* wmdrawer.c, images.c: Some minor improvements were made.
+
+2003-04-07 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.10.0
+	* config.c, wmdrawer.c: a new feature, tooltips for buttons
+	This feature can be controlled with the option tooltips (0/1) and
+	the tootlips' font can be changed with the option tooltips_font.
+
+2003-04-05 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* config.c, wmdrawer.c: events management and config file parsing codes
+	were partially rewritten.
+	Config file syntax was changed to support the future tooltips feature.
+
+2003-04-01 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* wmdrawer.c: a new auto-hide bug was fixed.
+	A sleep was removed in commands' execution process. So the applications
+	are now launched without delay.
+
+2003-03-29 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* config.c, Makefile: several modifications to solve compilation problems
+	under Solaris (openwin, getopt_long)
+
+2003-03-29 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* wmdrawer.c: the highlight was improved and an auto-hide bug was fixed.
+
+2003-03-28 Ed Goforth <e.goforth at computer.org>
+	* version: 0.9.17.1
+	* config.c: a bug in the config.imagesPaths dynamic allocation was fixed.
+
+2003-03-27 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.17
+
+2003-03-23 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* wmdrawer.c: an auto-hide bug fixed.
+	* config.c: support for long options in command line options added
+
+2003-03-19 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* wmdrawer.c: add XSetCommand() for dockIconWin
+	* config.c, wmdrawer.c: a new behavior, drawer's pseudo-transparency
+	This can be controlled with option transparency (0/1) in the configuration file.
+	* config.c, wmdrawer.c, graphics.c: a new highlight type, shading
+	This can be controlled with value 2 for option highlight in the configuration file.
+	This highlight has 2 associated options, highlight_tint and highlight_sh
+	highlight_sh   : icon's darkening level
+	highlight_tint : icon's tinting color
+	
+2003-03-16 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* config.c, wmdrawer.c: a large piece of code rewritten.
+	Now the code is a little bit easier and the app uses less memory.
+
+2003-03-10 Ed Goforth <e.goforth at computer.org>
+	* config.c, wmdrawer.c: a patch which allows to set the client
+	instance name (application name) so the window manager can differentiate between
+	multiple instances.
+	This behavior can be control with option instance_name in the configuration file
+	or from command-line with -n option.
+	* wmdrawer.c: another patch which add XSetCommand() so that the	window manager
+	can grab the command-line args wmdrawer was started with.
+	This is helpful for WindowMaker so it won't have to ask you to type the command-line
+	in when docking.
+
+2003-03-04 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* wmdrawer.c: highlight bug fixed (direction 1 and 3)
+	* wmdrawer.c: buttons' press/release animation improved
+	* config.c, wmdrawer.c: a new behavior, drawer's border size
+	This can be controlled with option border_size (pixels) in the configuration file.
+
+2003-02-27 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.16
+	* config.c, wmdrawer.c: cursor's choice extended to all X standard cursors.
+	* wmdrawer.c: buttons' press/release animation completely rewritten.
+
+2003-01-24 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.15
+	* wmdrawer.c: an auto-hide bug fixed.
+
+2003-01-23 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.14
+	* images.c: a bug with the gdk-pixbuf2 image loading library fixed.
+
+2003-01-11 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.13
+	* wmdrawer.c: a memory leak in buttons' highlight fixed.
+
+2002-11-27 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.12
+	* config.c, wmdrawer.c: a new feature, ability to launch several apps at once from the drawer.
+	By holding down the key Shift or by using mouse buttons middle or right
+	instead of left, you can keep the drawer opened.
+	* wmdrawer.c: Auto shifting of the drawer if it leaves the screen.
+
+2002-11-23 Scott Morgan <blumf at blumf.freeserve.co.uk>
+	* wmdrawer.c: a patch which allows to launch several apps at once from the drawer.
+	By holding down the key Shift, you can keep the drawer opened.
+
+2002-11-08 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.11 
+	* wmdrawer.c: a bug in 'show_on_hover' mode fixed.
+	* config.c, wmdrawer.c: a new behavior, highlight icon under cursor.
+	This can be controlled with option highlight (0/1) in the configuration file.
+	* config.c, wmdrawer.c: a new adjustment, choice of the drawer's hiding timeout.
+	This can be controlled with option hide_timeout (value in miliseconds, default 1000).
+
+2002-10-30 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.10 
+	* config.c, wmdrawer.c: a new adjustment: buttons' size
+	This can be changed with option btns_size (min=8, max=64) in the configuration file.
+
+2002-10-27 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.9
+	* config.c, wmdrawer.c: a new behavior, windowed mode
+	Use command line option -w or config file option windowed_mode.
+	Useful for AfterStep, Fvwm, Sawfish and KDE users
+	* wmdrawer.c: minor bugs fixes.
+
+2002-10-23 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.8
+	* config.c: Oops! This version only fixes a bug introduced into the version 0.9.7.
+	It was no longer possible to use long commands in the configuration file ([column] section).
+
+2002-10-23 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.7
+	* doc/wmdrawer.sgml: a first manpage version (english) added.
+	* config.c: improvement in the parsing of the config file.
+	* wmdrawer.c: minor bugs fixes.
+
+2002-10-21 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.6
+	* config.c, wmdrawer.c: automatic reloading of the config file if it changes.
+	* wmdrawer.c: the character '&' isn't necessary any more at the end of commands.
+
+2002-10-16 Franciso Jose Oviedo <foviedoa at teleline.es>
+	* wmdrawer.c: a patch to improve the commands' execution process.
+	
+2002-10-13 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.5
+	* wmdrawer.c: better management of mouse events.
+	* config.c, wmdrawer.c: a new adjustment, choice of the mouse cursor in the drawer.
+	This can be controlled with option cursor (0/1/2) in the configuration file.
+
+2002-10-08 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.4
+	* config.c, wmdrawer.c: a new behavior, automatic closing of the drawer when the mouse
+	leaves the drawer.
+	This can be controlled with option hide_on_out (0/1) in the configuration file.
+
+2002-10-01 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.3
+	* images.c: add ability to build wmDrawer with gdk-pixbuf-2.0 library
+	instead of gdk-pixbuf (Makefile option)
+	* config.c: one bug fixed, if several columns were defined and hadn't the same
+	number of buttons, a shift between buttons and commands could occur.
+
+2002-09-23 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.2
+	* config.c: multi-instances support with command line option -c <file>
+
+2002-09-23 Konstantin Malakhanov <malakhanov at gmx.de>
+	* images.c: support for absolute image paths in the configuration file
+
+2003-09-20 Oliwier 'aLEczapKA' Ptak <aleczapka at gmx.net>	
+	* config.c, wmdrawer.c: a new behavior, automatic opening of the drawer when the mouse
+	enters in the dockapp.
+	This can be controlled with option show_on_hover (0/1) in the configuration file.
+
+2002-09-16 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.1
+	* wmdrawer.c: some bugs in the drawer's animation fixed.
+	* wmdrawer.c: the problem with directions 0 and 3 was solved.
+
+2002-09-15 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+	* version: 0.9.0 First public release
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..c5af9e5
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,43 @@
+Requirements
+------------------------------------------------------
+	- glibc ( >= 2.1 )
+	- Xlib
+	- gdk-pixbuf OR gdk-pixbuf-2.0 OR Imlib
+	- root access for install
+
+
+Installation
+------------------------------------------------------
+1) Untar/gunzip sources
+	$ tar zxvf wmdrawer-x.x.x.tar.gz
+
+
+2) Edit Makefile
+   Choice the image library:
+	gdk-pixbuf     : uncomment USE_GDKPIXBUF = 1
+	gdk-pixbuf-2.0 : uncomment USE_GDKPIXBUF2 = 1
+	Imlib          : uncomment USE_IMLIB = 1
+
+   If you are running Solaris, comment lines :
+   	OS = -DLINUX
+   	OS = -DFREEBSD
+   and uncomment line : OS = -DSOLARIS
+   If you are running FreeBSD, comment lines :
+   	OS = -DLINUX
+   	OS = -DSOLARIS
+   and uncomment line : OS = -DFREEBSD
+
+
+3) Compilation
+	$ make
+	$ su -c 'make install'
+
+
+4) Config file creation and syntax
+   A configuration file is needed to launch wmdrawer.
+   Its default name is .wmdrawerrc and it must be copied
+   in your home directory. It's also possible to put this
+   file in another directory with a different name but in
+   this case, you must use the -c command line option.
+
+   Look at wmdrawerrc.example file for an example.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9f106a3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,79 @@
+SHELL = /bin/sh
+CC = gcc
+
+# Operating system
+OS = -DLINUX
+#OS = -DSOLARIS
+#OS = -DFREEBSD
+
+INSTALL = /usr/bin/install
+RM = rm -f
+
+DESTDIR =
+
+PREFIX = $(DESTDIR)/usr/local
+MANDIR = $(PREFIX)/man/man1
+DOCDIR = $(PREFIX)/share/doc
+
+# Image library
+USE_GDKPIXBUF = 1
+#USE_GDKPIXBUF2 = 1
+#USE_IMLIB = 1
+
+DEFS = $(OS)
+
+ifdef USE_GDKPIXBUF
+IMGLIB_DEF = -DUSE_GDKPIXBUF
+CFLAGS = -O3 -Wall `gdk-pixbuf-config --cflags`
+LDFLAGS = `gdk-pixbuf-config --libs` -lgdk_pixbuf_xlib
+endif
+
+ifdef USE_GDKPIXBUF2
+IMGLIB_DEF = -DUSE_GDKPIXBUF2
+CFLAGS = -O3 -Wall `pkg-config --cflags gdk-pixbuf-xlib-2.0` -I/usr/X11R6/include
+LDFLAGS = `pkg-config --libs gdk-pixbuf-xlib-2.0` -rdynamic -lX11 -lXi -lXext -L/usr/X11R6/lib
+endif
+
+ifdef USE_IMLIB
+IMGLIB_DEF = -DUSE_IMLIB
+CFLAGS = -O3 -Wall `imlib-config --cflags`
+LDFLAGS = `imlib-config --libs`
+endif
+
+DEFS += $(IMGLIB_DEF)
+
+ifeq ($(OS),-DSOLARIS)
+	LDFLAGS += -lposix4 -lz -ltiff -ljpeg
+	DEFS += -DUSE_GETOPT
+endif
+
+ifeq ($(OS),-DFREEBSD)
+	LDFLAGS += -lgnugetopt
+endif
+
+PRGS = wmdrawer
+SRCS = utils.c config.c graphics.c images.c wmdrawer.c
+OBJS = $(SRCS:.c=.o)
+
+all : $(PRGS)
+
+.c.o :
+	$(CC) $(CFLAGS) $(DEFS) -c $<
+
+wmdrawer : $(OBJS)
+	$(CC) $(LDFLAGS) -o $@ $(OBJS)
+	strip $@
+
+clean :
+	$(RM) *.o $(PRGS)
+
+install : wmdrawer
+	$(INSTALL) -m 755 wmdrawer $(PREFIX)/bin
+	$(INSTALL) -m 644 doc/wmdrawer.1x.gz $(MANDIR)
+	$(INSTALL) -d $(DOCDIR)/wmdrawer
+	$(INSTALL) -m 644 wmdrawerrc.example AUTHORS ChangeLog COPYING INSTALL README TODO $(DOCDIR)/wmdrawer
+
+uninstall: clean
+	$(RM) $(PREFIX)/bin/wmdrawer
+	$(RM) $(MANDIR)/wmdrawer.1x.gz
+	$(RM) -rf $(DOCDIR)/wmdrawer
diff --git a/README b/README
new file mode 100644
index 0000000..1d604e9
--- /dev/null
+++ b/README
@@ -0,0 +1,66 @@
+Description
+-------------------------------------------------------------
+wmDrawer is a dock application (dockapp) which provides a 
+drawer (retractable button bar) to launch applications.
+
+Homepage : http://people.easter-eggs.org/~valos/wmdrawer/
+IRC      : irc.freenode.net, #wmdrawer
+
+# The drawer is retractable and animated.
+# Several columns of buttons can be defined in the drawer.
+# The config file is automaticaly reloaded if it changes.
+# Multiple instances of the program can run at the same time.
+# The buttons can be highlighted under the mouse cursor.
+# A tooltip can be defined for each button.
+# The drawer can be transparent (need SHAPE extension).
+# Ability to launch several apps at once from the drawer.
+  By holding down the key Shift or by using mouse buttons
+  middle or right instead of left, you can keep the drawer
+  opened.
+# Adjustable behaviors:
+	- dock's image (logo)
+	- dock's width and height (for both min=12, max=128)
+	- automatic/manual opening and closing of the drawer
+	- timeout value in miliseconds if automatic closing selected
+	- drawer's opening direction and animation speed
+	- mouse cursor type in the drawer
+ 	- drawer's pseudo-transparency
+	- icons' background image (only if transparency isn't activated)
+	- buttons' size (min=12, max=128)
+	- buttons' highlight type (0:none, 1:target, 2:shading)
+	- image used as highlight (target type only)
+	- color and darkening level for highlight (shading type only)
+	- drawer's border size
+	- buttons' tooltips and tooltips' font
+
+Bugs
+-------------------------------------------------------------
+If you discover any bug in this software, please send a 
+bugreport to vfebvre at vfebvre.lautre.net and describe the problem with
+as many details as possible.
+
+Copyright
+-------------------------------------------------------------
+wmDrawer is Copyright (C) 2002-2004 by Valery Febvre, FRANCE
+
+wmDrawer is licensed through the GNU General Public License.
+Read the COPYING file for the complete GNU license.
+
+Usage
+-------------------------------------------------------------
+Simply launch wmdrawer binary:
+$ wmdrawer
+You need to write a config file (.wmdrawerrc) and put it in 
+your home directory (look at INSTALL and wmdrawerrc.example
+files for futher information).
+
+To launch wmDrawer with a specific configuration file (useful
+if you want to launch several instances of wmDrawer)
+$ wmdrawer -c config_file [-n instance_name]
+
+To launch wmDrawer in windowed mode (useful for AfterStep,
+Fvwm, Sawfish or KDE users)
+$ wmdrawer -w
+
+To display the version of wmDrawer
+$ wmdrawer -v
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..0174f0e
--- /dev/null
+++ b/TODO
@@ -0,0 +1,10 @@
+My ideas:
+---------
+* Translate the manpage
+* Add other button animations ?
+* Better drawer animation for directions 0 and 3 ?
+
+External suggestions:
+---------------------
+* Anti-aliasing on icons and fonts
+* ... all suggestions are welcome.
diff --git a/config.c b/config.c
new file mode 100644
index 0000000..0bb18b0
--- /dev/null
+++ b/config.c
@@ -0,0 +1,667 @@
+/* wmDrawer (c) 2002-2004 Valery Febvre <vfebvre at vfebvre.lautre.net>
+ *
+ * wmDrawer is a dock application (dockapp) which provides a
+ * drawer (button bar) to launch applications from.
+ *
+ * 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.
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined USE_GETOPT
+#include <unistd.h>
+#else
+#include <getopt.h>
+#endif
+
+#include "types_defs.h"
+#include "config.h"
+
+static void parseLine (char *line, int line_num);
+static void usage (void);
+static void freeUnusedMemory (void);
+
+enum section {
+  general,
+  images_paths,
+  column
+};
+
+drawerConfig config;
+drawerButton **entries;
+static char configFilePath[FILENAME_MAX];
+struct stat buf;
+static unsigned int currentSection;
+static unsigned int rowsCnt;
+static unsigned int *nbRowsPerCol;
+static char *line;
+unsigned int nbEntries, nbImagesPaths;
+unsigned int nbCols, nbRows;
+unsigned int useDefaultIconsBg, useDefaultDockIcon, useDefaultHighlightImg;
+unsigned int drawerOK;
+
+void parseConfig () {
+  FILE *f = NULL;
+  const char *home;
+  unsigned char c;
+  unsigned int col, row;
+  unsigned int line_num = 0;
+  unsigned int line_point = 0;
+  /* init vars */
+  currentSection = -1;
+  nbEntries = nbCols = rowsCnt = nbRows = nbImagesPaths = 0;
+  useDefaultIconsBg = useDefaultDockIcon = useDefaultHighlightImg = drawerOK = 1;
+  entries = NULL;
+  freeAllMemory ();
+
+  /* default adjustments */
+  config.iconsExpand    = 1;
+  config.transparency   = 0;
+  config.dockW          = 64;
+  config.dockH          = 64;
+  config.btnsSize       = 0;
+  config.direction      = -1;
+  config.animationSpeed = 1;
+  config.cursor         = 30; /* XC_hand2 / 2 */
+  config.borderSize     = 1;
+  config.showOnHover    = 0;
+  config.hideOnOut      = 0;
+  config.hideTimeout    = 800;
+  config.highlight      = 2;
+  config.highlightShading.shading = 60;
+  config.highlightShading.tintColor.red   = 255;
+  config.highlightShading.tintColor.green = 255;
+  config.highlightShading.tintColor.blue  = 255;
+  config.tooltips = 1;
+  config.tooltipsFont = (char *) malloc (6 * sizeof (char));
+  sprintf (config.tooltipsFont, "fixed");
+  
+  if (*configFilePath == '\0') {
+    if ((home = getenv ("HOME")) != NULL && *home != '\0')
+      sprintf (configFilePath, "%s/%s", home, ".wmdrawerrc");
+    else {
+      printf ("%s error: can't find HOME directory\n", PACKAGE);
+      exit (EXIT_FAILURE);
+    }
+  }
+  if ((f = fopen (configFilePath, "r")) == NULL) {
+    printf ("%s error: can't open config file %s\n", PACKAGE, configFilePath);
+    exit (EXIT_FAILURE);
+  }
+
+  if (stat (configFilePath, &buf) == 0) {
+    config.lastModif = buf.st_mtime;
+  }
+  
+  line = xcalloc (FILENAME_MAX, sizeof (char));
+  /* fgets ??? */
+  while (fscanf (f, "%c", &c) != EOF) {
+    if (c != '\n') {
+      line[line_point++] = c;
+    }
+    else {
+      line_num++;
+      parseLine (line, line_num);
+      free (line);
+      line_point = 0;
+      line = xcalloc (FILENAME_MAX, sizeof (char));
+    }
+  }
+  fclose (f);
+  if (config.direction < 0) {
+    freeUnusedMemory ();
+    exit (EXIT_FAILURE);
+  }
+  if (nbRows * nbCols > 0) {
+    /* create and alloc an (nbCols x nbRows) array */
+    config.entries = (drawerButton **) xcalloc (nbCols,
+						sizeof (drawerButton *));
+    for (col = 0; col < nbCols; col++)
+      config.entries[col] = (drawerButton *) xcalloc (nbRows,
+						      sizeof (drawerButton));
+    /* Add empty buttons to array entries */
+    for (col = 0; col < nbCols; col++) {
+      if (nbRowsPerCol[col] < nbRows) {
+	entries[col] = xrealloc (entries[col], sizeof (drawerButton) * nbRows);
+	for (row = nbRowsPerCol[col]; row < nbRows; row++) {
+	  /* alloc empty string for tooltip, image, command */
+	  entries[col][row].tooltip = (char *) malloc (sizeof (char));
+	  entries[col][row].image   = (char *) malloc (sizeof (char));
+	  entries[col][row].command = (char *) malloc (sizeof (char));
+	  entries[col][row].isEmpty = 1;
+	}
+      }
+    }
+    /* rotate array */
+    for (col = 0; col < nbCols; col++) {
+      for (row = 0; row < nbRows; row++) {
+	switch (config.direction) {
+	case leftToRight:
+	case topToBottom:
+	  config.entries[col][row].isEmpty = entries[col][row].isEmpty;
+	  config.entries[col][row].tooltip = (char *) malloc ((strlen (entries[col][row].tooltip)+1) * sizeof (char));
+	  sprintf (config.entries[col][row].tooltip, "%s", entries[col][row].tooltip);
+	  config.entries[col][row].image = (char *) malloc((strlen (entries[col][row].image)+1) * sizeof (char));
+	  sprintf (config.entries[col][row].image, "%s", entries[col][row].image);
+	  config.entries[col][row].command = (char *) malloc((strlen (entries[col][row].command)+1) * sizeof(char));
+	  sprintf (config.entries[col][row].command, "%s", entries[col][row].command);
+	  break;
+	case rightToLeft:
+	case bottomToTop:
+	  config.entries[col][row].isEmpty = entries[col][nbRows - row - 1].isEmpty;
+	  config.entries[col][row].tooltip = (char *) malloc ((strlen (entries[col][nbRows-row-1].tooltip)+1) * sizeof (char));
+	  sprintf (config.entries[col][row].tooltip, "%s", entries[col][nbRows-row-1].tooltip);
+	  config.entries[col][row].image = (char *) malloc((strlen (entries[col][nbRows-row-1].image)+1) * sizeof (char));
+	  sprintf (config.entries[col][row].image, "%s", entries[col][nbRows-row-1].image);
+	  config.entries[col][row].command = (char *) malloc((strlen (entries[col][nbRows-row-1].command)+1) * sizeof (char));
+	  sprintf (config.entries[col][row].command, "%s", entries[col][nbRows - row - 1].command);
+	  break;
+	}
+	dbg_msg (1, "(%d,%d) %s %s %s %d\n", col, row,
+		 config.entries[col][row].tooltip,
+		 config.entries[col][row].image,
+		 config.entries[col][row].command,
+		 config.entries[col][row].isEmpty);
+      }
+    }
+  }
+  else {
+    printf ("%s warning: any button defined !!!\n", PACKAGE);
+    drawerOK = nbCols = 0;
+  }
+  freeUnusedMemory ();
+}
+
+static void parseLine (char *line, int line_num) {
+  unsigned int i, empty, error = 0, flag = 0, cntc = 0, cnte = 0;
+  char c;
+  const char *regex_general = "^[[:space:]]*[a-z_]+[[:space:]]+.+$";
+  const char *regex_column  = "^[[:space:]]*\\(.*\\)[[:space:]]*\\(.*\\)[[:space:]]*\\(.*\\)[[:space:]]*$";
+  char *param, *field;
+  int field_point = 0;
+
+  /* detect comment lines and empty lines */
+  empty = 1;
+  for(i=0; i<strlen (line); i++) {
+    if (line[i] != ' ' && line[i] != '\t') {
+      empty = 0;
+      break;
+    }
+  }
+  if (line[i] == '#' || line[i] == '!' || line[i] == ';' || line[i] == '\0') {
+    return;
+  }
+  if (empty == 1) return;
+  /* detect comment lines and sections*/
+  if (strstr (line, "[general]") != NULL) {
+    currentSection = general;
+    return;
+  }
+  if (strstr (line, "[images_paths]") != NULL) {
+    currentSection = images_paths;
+    return;
+  }
+  if (strstr (line, "[column]") != NULL) {
+    currentSection = column;
+    nbCols++;
+    if (entries == NULL && nbCols == 1) {
+      /* alloc memory for first column */
+      entries = (drawerButton **) xcalloc (1, sizeof (drawerButton *));
+      nbRowsPerCol = (unsigned int *) xcalloc (1, sizeof (unsigned int));
+    }
+    else {
+      /* realloc memory for a new column */
+      entries = xrealloc (entries, sizeof (drawerButton *) * nbCols);
+      nbRowsPerCol = xrealloc (nbRowsPerCol, sizeof (unsigned int) * nbCols);
+    }
+    nbRowsPerCol[nbCols - 1] = 0;
+    rowsCnt = 0;
+    return;
+  }
+
+  param = (char *) malloc (strlen (line) * sizeof (char));
+  field = (char *) malloc (strlen (line) * sizeof (char));
+  switch (currentSection) {
+  case general:
+    /* first verify if line match regexp else it's skipped */
+    if (match_regex (line, regex_general) == 0) {
+      printf ("%s warning: line %d is invalid (skipped)\n", PACKAGE, line_num);
+      printf ("Line %d: %s\n", line_num, line);
+      break;
+    }
+    if (strstr (line, "dock_icon")) {
+      sscanf (line, "%s %s", param, field);
+      config.dockIcon = (char *) malloc ((strlen (field)+1) * sizeof (char));
+      sprintf(config.dockIcon, "%s", field);
+      useDefaultDockIcon = 0;
+      break;
+    }
+    else if (strstr (line, "icons_bg")) {
+      sscanf (line, "%s %s", param, field);
+      config.iconsBg = (char *) malloc ((strlen (field)+1) * sizeof (char));
+      sprintf(config.iconsBg, "%s", field); 
+      useDefaultIconsBg = 0;
+      break;
+    }
+    else if (strstr (line, "icons_expand")) {
+      sscanf (line, "%s %d", param, &(config.iconsExpand));
+      if (config.iconsExpand != 0 && config.iconsExpand != 1) {
+	printf ("%s error: bad value for 'icons_expand' param, it must be 0 or 1 (use default value: 1)\n", PACKAGE);
+	config.iconsExpand = 1;
+      }
+      break;
+    }
+    else if (strstr (line, "transparency")) {
+      sscanf (line, "%s %d", param, &(config.transparency));
+      if (config.transparency != 0 && config.transparency != 1) {
+	printf ("%s warning: bad value for 'transparency' param, it must be 0 or 1 (use default value: 0)\n", PACKAGE);
+	config.transparency = 0;
+      }
+      break;
+    }
+    else if (strstr (line, "dock_size")) {
+      printf ("%s warning: old option 'dock_size' found, use dock_width and dock_height instead\n", PACKAGE);
+      break;
+    }
+    else if (strstr (line, "dock_width")) {
+      sscanf (line, "%s %d", param, &(config.dockW));
+      if (config.dockW > MAX_ICON_SIZE) {
+	printf ("%s warning: bad value for 'dock_width' param, max=%d (use max value: %d)\n",
+		PACKAGE, MAX_ICON_SIZE, MAX_ICON_SIZE);
+	config.dockW = MAX_ICON_SIZE;
+      }
+      if (config.dockW < MIN_ICON_SIZE) {
+        printf ("%s warning: bad value for 'dock_width' param, min=%d (use min value: %d)\n",
+		PACKAGE, MIN_ICON_SIZE, MIN_ICON_SIZE);
+        config.dockW = MIN_ICON_SIZE;
+      }
+      break;
+    }
+    else if (strstr (line, "dock_height")) {
+      sscanf (line, "%s %d", param, &(config.dockH));
+      if (config.dockH > MAX_ICON_SIZE) {
+        printf ("%s warning: bad value for 'dock_height' param, max=%d (use max value: %d)\n",
+                PACKAGE, MAX_ICON_SIZE, MAX_ICON_SIZE);
+        config.dockH = MAX_ICON_SIZE;
+      }
+      if (config.dockH < MIN_ICON_SIZE) {
+        printf ("%s warning: bad value for 'dock_height' param, min=%d (use min value: %d)\n",
+                PACKAGE, MIN_ICON_SIZE, MIN_ICON_SIZE);
+        config.dockH = MIN_ICON_SIZE;
+      }
+      break;
+    }
+    else if (strstr (line, "btns_size")) {
+      sscanf (line, "%s %d", param, &(config.btnsSize));
+      if (config.btnsSize > MAX_ICON_SIZE) {
+	printf ("%s warning: bad value for 'btns_size' param, max=%d (use max value: %d)\n",
+		PACKAGE, MAX_ICON_SIZE, MAX_ICON_SIZE);
+	config.btnsSize = MAX_ICON_SIZE;
+      }
+      if (config.btnsSize < MIN_ICON_SIZE) {
+	printf ("%s warning: bad value for 'btns_size' param, min=%d (use min value: %d)\n",
+		PACKAGE, MIN_ICON_SIZE, MIN_ICON_SIZE);
+	config.btnsSize = MIN_ICON_SIZE;
+      }
+      break;
+    }
+    else if (strstr (line, "direction")) {
+      sscanf (line, "%s %d", param, &(config.direction));
+      if (config.direction < 0 || config.direction > 3) {
+	printf ("%s error: bad value for 'direction' param, it must be 0, 1, 2 or 3\n", PACKAGE);
+	config.direction = -1;
+      }
+      break;
+    }
+    else if (strstr (line, "animation_speed")) {
+      sscanf (line, "%s %d", param, &(config.animationSpeed));
+      if (config.animationSpeed < 0) {
+	printf ("%s warning: bad value for 'animation_speed' param, it must be 0, 1, 2, 3 or 4 (use default value: 1)\n", PACKAGE);
+	config.animationSpeed = 1;
+      }
+      if (config.animationSpeed > 4) {
+	printf ("%s warning: bad value for 'animation_speed' param, it must be 0, 1, 2, 3 or 4 (use max value: 4)\n", PACKAGE);
+	config.animationSpeed = 4;
+      }
+      break;
+    }
+    else if (strstr (line, "cursor")) {
+      sscanf (line, "%s %d", param, &(config.cursor));
+      if (config.cursor < 0 || config.cursor > 76) {
+	printf ("%s warning: bad value for 'cursor' param, it must be >= 0 and <= 76 (use default value: 30)\n", PACKAGE);
+	config.cursor = 30; /* XC_hand2 / 2 */
+      }
+      break;
+    }
+    else if (strstr (line, "border_size")) {
+      sscanf (line, "%s %d", param, &(config.borderSize));
+      if (config.borderSize < 0 || config.borderSize > 8) {
+	printf ("%s warning: bad value for 'border_size' param, it must be >= 0 and not too big (use default value: 1)\n", PACKAGE);
+	config.borderSize = 1;
+      }
+      break;
+    }
+    else if (strstr (line, "show_on_hover") || strstr (line, "show_on_over")) {
+      sscanf (line, "%s %d", param, &(config.showOnHover));
+      if (config.showOnHover != 0 && config.showOnHover != 1) {
+	printf ("%s warning: bad value for 'show_on_hover' param, it must be 0 or 1 (use default value: 0)\n", PACKAGE);
+	config.showOnHover = 0;
+      }
+      break;
+    }
+    else if (strstr (line, "hide_on_out")) {
+      sscanf (line, "%s %d", param, &(config.hideOnOut));
+      if (config.hideOnOut != 0 && config.hideOnOut != 1) {
+	printf ("%s warning: bad value for 'hide_on_out' param, it must be 0 or 1 (use default value: 0)\n", PACKAGE);
+	config.hideOnOut = 0;
+      }
+      break;
+    }
+    else if (strstr (line, "hide_timeout")) {
+      sscanf (line, "%s %d", param, &(config.hideTimeout));
+      if (config.hideTimeout < 0) {
+	printf ("%s warning: bad value for 'hide_timeout' param, it must be >= to 0 (use default value: 1000)\n", PACKAGE);
+	config.hideTimeout = 1000;
+      }
+      break;
+    }
+    else if (strstr (line, "windowed_mode")) {
+      if (config.windowedModeLocked == 0) {
+	sscanf (line, "%s %d", param, &(config.windowedMode));
+	if (config.windowedMode != 0 && config.windowedMode != 1) {
+	  printf ("%s warning: bad value for 'windowed_mode' param, it must be 0 or 1 (use default value: 0)\n", PACKAGE);
+	  config.windowedMode = 0;
+	}
+      }
+      break;
+    }
+    else if (strstr (line, "instance_name")) {
+      /* Ed Goforth <e.goforth at computer.org> */
+      /* Allow to specify instance name for multiple clients in their */
+      /* config file. This will override a -n given on the command line. */
+      sscanf (line, "%s %s", param, field);
+      config.instanceName = (char *) malloc ((strlen (field)+1)*sizeof (char));
+      sprintf(config.instanceName, "%s", field);
+      break;
+    }
+    else if (strstr (line, "highlight_img")) {
+      sscanf (line, "%s %s", param, field);
+      config.highlightImg = (char *) malloc ((strlen (field)+1)*sizeof (char));
+      sprintf(config.highlightImg, "%s", field);
+      useDefaultHighlightImg = 0;
+      break;
+    }
+    else if (strstr (line, "highlight_sh")) {
+      sscanf (line, "%s %d", param, &(config.highlightShading.shading));
+      if (config.highlightShading.shading < 0 ||
+	  config.highlightShading.shading > 100) {
+	printf ("%s warning: bad value for 'highlight_sh' param, it must be >= 0 and <= 100 (use default value: 60)\n", PACKAGE);
+	config.highlightShading.shading = 60;
+      }
+      break;
+    }
+    else if (strstr (line, "highlight_tint")) {
+      unsigned int r,g,b;
+      sscanf (line, "%s %c%02X%02X%02X", param, &c, &r, &g, &b);
+      if (c != '#') {
+	printf ("%s warning: bad value for 'highlight_tint' param (use default value: #ffffff)\n", PACKAGE);
+	config.highlightShading.tintColor.red   = 255;
+	config.highlightShading.tintColor.green = 255;
+	config.highlightShading.tintColor.blue  = 255;
+      }
+      else {
+	config.highlightShading.tintColor.red   = (unsigned short) r;
+	config.highlightShading.tintColor.green = (unsigned short) g;
+	config.highlightShading.tintColor.blue  = (unsigned short) b;
+      }
+      break;
+    }
+    else if (strstr (line, "highlight")) {
+      sscanf (line, "%s %d", param, &(config.highlight));
+      if (config.highlight < 0 || config.highlight > 2) {
+	printf ("%s warning: bad value for 'highlight' param, it must be 0, 1 or 2 (use default value: 2)\n", PACKAGE);
+	config.highlight = 2;
+      }
+      break;
+    }
+    else if (strstr (line, "tooltips_font")) {
+      free (config.tooltipsFont);
+      sscanf (line, "%s %s", param, field);
+      config.tooltipsFont = (char *) malloc ((strlen (field)+1)*sizeof (char));
+      sprintf(config.tooltipsFont, "%s", field);
+      break;
+    }
+    else if (strstr (line, "tooltips")) {
+      sscanf (line, "%s %d", param, &(config.tooltips));
+      if (config.tooltips != 0 && config.tooltips != 1) {
+	printf ("%s warning: bad value for 'tooltips' param, it must be 0 or 1 (use default value: 1)\n", PACKAGE);
+	config.tooltips = 1;
+      }
+      break;
+    }
+    break;
+  case images_paths:
+    nbImagesPaths++;
+    if (config.imagesPaths == NULL && nbImagesPaths == 1) {
+      config.imagesPaths = (char **) xcalloc (1, sizeof (char *));
+    }
+    else {
+      config.imagesPaths = (char **) xrealloc (config.imagesPaths, sizeof (char *) * nbImagesPaths);
+    }
+    config.imagesPaths[nbImagesPaths - 1] = (char *) xcalloc (strlen(line)+1,
+							      sizeof (char));
+    sscanf (line, "%s", config.imagesPaths[nbImagesPaths - 1]);
+    break;
+  case column:
+    /* if a line don't match regexp => it's skipped */
+    if (match_regex (line, regex_column) == 0) {
+      printf ("%s warning: line %d is invalid (skipped)\n", PACKAGE, line_num);
+      printf ("Line %d: %s\n", line_num, line);
+      break;
+    }
+    rowsCnt++;
+    if (rowsCnt == 1) {
+      /* alloc memory for first button */
+      entries[nbCols-1] = (drawerButton *) xcalloc (1, sizeof (drawerButton));
+    }
+    else {
+      /* realloc memory for new button */
+      entries[nbCols-1] = (drawerButton *) xrealloc (entries[nbCols - 1],
+						     sizeof (drawerButton) * rowsCnt);
+    }
+    /* parse entry line */
+    while (sscanf (line + cntc, "%c", &c)) {
+      switch (c) {
+      case '(':
+	flag = 1;
+	break;
+      case ')':
+	flag = 0;
+	field[field_point] = '\0';
+        switch (cnte++) {
+	case 0:
+	  entries[nbCols - 1][rowsCnt - 1].tooltip = (char *) xcalloc (strlen (field)+1, sizeof (char));
+	  sprintf (entries[nbCols - 1][rowsCnt - 1].tooltip, "%s", field);
+	  break;
+	case 1:
+	  entries[nbCols - 1][rowsCnt - 1].image = (char *) xcalloc (strlen (field)+1, sizeof (char));
+	  sprintf (entries[nbCols - 1][rowsCnt - 1].image, "%s", field);
+	  break;
+	case 2:
+	  entries[nbCols - 1][rowsCnt - 1].command = (char *) xcalloc (strlen (field)+1, sizeof (char));
+	  sprintf (entries[nbCols - 1][rowsCnt - 1].command, "%s", field);
+	  break;
+        }
+	field_point = 0;
+	break;
+      default:
+	if (flag == 1) {
+	  field[field_point++] = c;
+	  field[field_point] = '\0';
+	}
+	break;
+      }
+      cntc++;
+      dbg_msg (1, "%c %d %d %d %s\n", c, flag, cnte, cntc, field);
+      if (cnte == 3) {
+            dbg_msg (1, "%d %d %d | %s | %s | %s\n", flag, cnte, cntc,
+		     entries[nbCols - 1][rowsCnt - 1].tooltip,
+		     entries[nbCols - 1][rowsCnt - 1].image,
+		     entries[nbCols - 1][rowsCnt - 1].command);
+      }
+      if (cntc >= strlen (line)) break;
+    }
+    dbg_msg (1, "%s\t%s\t%s\n", entries[nbCols - 1][rowsCnt - 1].tooltip,
+	     entries[nbCols - 1][rowsCnt - 1].image,
+	     entries[nbCols - 1][rowsCnt - 1].command);
+    entries[nbCols - 1][rowsCnt - 1].isEmpty = 0;
+    /* we count the number of buttons per column */
+    nbRowsPerCol[nbCols - 1]++;
+    if (rowsCnt > nbRows) {
+      nbRows = rowsCnt;
+    }
+    break;
+  default:
+    error++;
+  }
+  free (field);
+  free (param);
+  if (error > 0) {
+    dbg_msg (1, "%s\n", line);
+    printf ("%s error: parsing error.\n", PACKAGE);
+    printf ("Line %d: %s\n", line_num, line);
+    freeAllMemory ();
+    exit (EXIT_FAILURE);
+  }
+}
+
+int configChanged (void) {
+  struct stat buf;
+
+  if (stat (configFilePath, &buf) == 0 && buf.st_mtime > config.lastModif) {
+    return 1;
+  }
+  else {
+    return 0;
+  }
+}
+
+static void usage (void) {
+#if defined USE_GETOPT
+  printf ("Usage: %s [OPTIONS]\n\n"
+	  "Valid options are:\n"
+	  "  -c FILE   config file to use (default ~/.wmdrawerrc)\n"
+	  "  -n NAME   set dock instance name\n"
+	  "  -w        runs the application in windowed mode\n"
+	  "  -v        show program version and exit\n"
+	  "  -h        show this help text and exit\n\n", PACKAGE);
+#else
+  printf ("Usage: %s [OPTIONS]\n\n"
+	  "Valid options are:\n"
+	  "  -c, --configfile=FILE     config file to use (default ~/.wmdrawerrc)\n"
+	  "  -n, --instancename=NAME   set dock instance name\n"
+	  "  -w, --windowed            runs the application in windowed mode\n"
+	  "  -v, --version             show program version and exit\n"
+	  "  -h, --help                show this help text and exit\n\n", PACKAGE);
+#endif
+}
+
+void parseOptions (int argc, char **argv) {
+  int opt;
+
+#if defined USE_GETOPT
+#else
+  int longopt_index = 0;
+  static struct option long_options[] = {
+    {"configfile",   1, NULL, 'c'},
+    {"help",         0, NULL, 'h'},
+    {"instancename", 1, NULL, 'n'},
+    {"version",      0, NULL, 'v'},
+    {"windowed",     0, NULL, 'w'},
+    {NULL, 0, NULL, 0} /* marks end-of-list */
+  };
+#endif
+
+  config.windowedMode = 0;
+  /* Ed Goforth <e.goforth at computer.org> */
+  /* use the package name as the default instance name */
+  config.instanceName=(char *)malloc((strlen(PACKAGE)+1)*sizeof(char));
+  sprintf (config.instanceName, "%s", PACKAGE);
+
+#if defined USE_GETOPT
+  while ((opt = getopt (argc, argv, "hvw?c:n:")) != EOF) {
+#else
+  while ((opt = getopt_long (argc, argv, "c:h?n:vw", long_options,
+			     &longopt_index)) > 0) {
+#endif
+    dbg_msg (1, "Between while & switch: opt = '%c'\n", opt);
+    switch (opt) {
+    case '?':
+    case 'h':
+      usage ();
+      exit (EXIT_SUCCESS);
+    case 'w':
+      config.windowedMode = 1;
+      config.windowedModeLocked = 1;
+      break;
+    case 'v':
+      printf ("Version %s, %s\n"
+	      "%s (c) 2002-2004 Val�ry Febvre <vfebvre at vfebvre.lautre.net>\n\n",
+	      VERSION, RELEASE_DATE, PACKAGE);
+      exit (EXIT_SUCCESS);
+    case 'c':
+      sprintf (configFilePath, "%s", optarg);
+      break;
+    case 'n':
+      /* Ed Goforth <e.goforth at computer.org> */
+      /* allow on command-line, but config file overrides it if given there */
+      config.instanceName = (char *) malloc ((strlen (optarg)+1)*sizeof(char));
+      sprintf (config.instanceName, "%s", optarg);
+      break;
+    }
+  }
+}
+
+void freeUnusedMemory (void) {
+  unsigned int i, j;
+
+  free (line);
+  free (nbRowsPerCol);
+  for (i=0; i<nbCols; i++) {
+    for (j=0; j<nbRows; j++) {
+      free (entries[i][j].tooltip);
+      free (entries[i][j].image);
+      free (entries[i][j].command);
+    }
+    free (entries[i]);
+  }
+  free (entries);
+}
+
+void freeAllMemory (void) {
+  unsigned int i;
+
+  for (i=0; i<nbImagesPaths; i++) {
+    free (config.imagesPaths[i]);
+  }
+  free (config.imagesPaths);
+  config.imagesPaths = NULL;
+  for (i=0; i<nbCols; i++) {
+    free (config.entries[i]);
+  }
+  free (config.entries);
+  config.entries = NULL;
+}
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..d0f4236
--- /dev/null
+++ b/config.h
@@ -0,0 +1,24 @@
+/* wmDrawer (c) 2002-2004 Valery Febvre <vfebvre at vfebvre.lautre.net>
+ *
+ * wmDrawer is a dock application (dockapp) which provides a
+ * drawer (button bar) to launch applications from.
+ *
+ * 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.
+ */
+
+void parseConfig ();
+int configChanged (void);
+void parseOptions (int argc, char **argv);
+void freeAllMemory (void);
diff --git a/doc/wmdrawer-it.sgml b/doc/wmdrawer-it.sgml
new file mode 100644
index 0000000..fadddf3
--- /dev/null
+++ b/doc/wmdrawer-it.sgml
@@ -0,0 +1,232 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+     page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
+     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+     less'.  A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+	docbook-to-man $< > $@
+
+    
+	The docbook-to-man binary is found in the docbook-to-man package.
+	Please remember that if you create the nroff version in one of the
+	debian/rules file targets (such as build), you will need to include
+	docbook-to-man in your Build-Depends control field.
+
+  -->
+
+  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+  <!ENTITY dhfirstname "<firstname>Chris</firstname>">
+  <!ENTITY dhsurname   "<surname>Wesley</surname>">
+  <!-- Please adjust the date whenever revising the manpage. -->
+  <!ENTITY dhdate      "<date>September 29, 2002</date>">
+  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+       allowed: see man(7), man(1). -->
+  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
+  <!ENTITY dhemail     "<email>chris at cwwesley.net</email>">
+  <!ENTITY dhusername  "Chris Wesley">
+  <!ENTITY dhucpackage "<refentrytitle>WMDRAWER</refentrytitle>">
+  <!ENTITY dhpackage   "wmdrawer">
+
+  <!ENTITY debian      "<productname>Debian</productname>">
+  <!ENTITY gnu         "<acronym>GNU</acronym>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &dhemail;
+    </address>
+    <author>
+      &dhfirstname;
+      &dhsurname;
+    </author>
+    <copyright>
+      <year>2002</year>
+      <holder>&dhusername;</holder>
+    </copyright>
+    &dhdate;
+  </refentryinfo>
+
+  <refmeta>
+    &dhucpackage;
+    &dhsection;
+  </refmeta>
+
+  <refnamediv>
+    <refname>&dhpackage;</refname>
+    <refpurpose>Applicazione per Window Maker che fornisce un "cassetto"</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+      <arg><option>-c <replaceable>config_file</replaceable></option></arg>
+      <arg><option>-w</option></arg>
+      <arg><option>-h</option></arg>
+      <arg><option>-v</option></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>DESCRIZIONE</title>
+    <para><command>&dhpackage;</command> � un'applicazione per WindowMaker
+    che fornisce un'icona-cassetto (men� rientrante) per lanciare
+    comodamente le applicazioni usate pi� frequentemente.
+    </para>
+    <para>Il cassetto � retraibile ed animato.</para>
+    <para>Nel cassetto possono essere definite pi� colonne di pulsanti.</para>
+    <para>Il file di configurazione � automaticamente riletto ogni volta si effettua una modifica.</para>
+    <para>Si possono eseguire istanze multiple del programma 
+    contemporaneamente.</para>
+    <para>Caratteristiche configurabili: apertura e chiusura manuale/automatica 
+    del cassetto, forma del cursore all'interno del cassetto, direzione di 
+    apertura e velocit� di animazione del cassetto, icona del cassetto 
+    ed immagine di sfondo delle icone.</para>
+  </refsect1>
+
+  <refsect1>
+    <title>OPZIONI</title>
+
+    <variablelist>
+      <varlistentry>
+        <term><option>-c <config_file></option>
+        </term>
+        <listitem>
+          <para>Usa  config_file come file di configurazione al posto del default (<filename>~/.wmdrawerrc</filename>)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-w</option>
+        </term>
+        <listitem>
+          <para>Esegui in una finestra. Utile per gli utenti di AfterStep, Fvwm2, Sawfish e KDE.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-h</option>
+        </term>
+        <listitem>
+          <para>Mostra l'elenco delle opzioni.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-v</option>
+        </term>
+        <listitem>
+          <para>Mostra la versione del programma.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
+  <refsect1>
+    <title>FILES</title>
+    <para><filename>~/.wmdrawerrc</filename> � il file di configurazione
+    di default per ogni utente. Ecco un esempio completamente commentato:
+    </para>
+<para><programlisting>
+# Esempio di file di configurazione per wmdrawer
+[general]
+# Icona dell'applicazione [opzionale]
+dock_icon       panel-drawer.png
+
+# Immagine usata per lo sfondo delle icone [opzionale]
+icons_bg        defaultTile.xpm
+
+# Direzione di apertura del cassetto
+# Dall'alto verso il basso = 0
+# Da destra verso sinistra = 1
+# Dal basso verso l'alto = 2
+# Da sinistra verso destra = 3
+direction       2
+
+# Velocit� di animazione del cassetto: 1, 2, 3, 4 [opzionale, default 1]
+animation_speed 1
+
+# Modo del cursore nel cassetto: 0, 1, 2 [opzionale, default 2]
+cursor          2
+
+# Apertura automatica del cassetto: 0, 1 [opzionale, default 0]
+show_on_hover   0
+
+# Chiusura automatica del cassetto: 0, 1 [opzionale, default 0]
+hide_on_out     0
+
+# Lancia l'applicazione in una finestra: 0, 1 [opzionale, default 0]
+# (Utile se si usa Fvwm2, AfterStep, Sawmill, KDE)
+windowed_mode   0
+
+# Cartelle delle icone
+[images_paths]
+/usr/share/pixmaps
+/usr/local/share/pixmaps/
+
+# Una prima colonna con 5 pulsanti
+# Ogni pulsante deve essere definito secondo la seguente sintassi:
+# immagine<SPAZIO e/o TABS>comando
+[column]
+gnome-term.png	     xterm
+galeon.xpm           galeon -s
+sylpheed-vanilla.xpm sylpheed
+xchat.png	     xchat
+gnome-multimedia.png mplayer
+
+# Una seconda colonna con 5 pulsanti
+[column]
+gnome-audio2.png xmms
+gnome-gimp.png   gimp
+gqview.png       gqview
+gnome-calc2.png  xcalc
+gftp.png         gftp
+</programlisting></para>
+    <para>
+    Una copia di questo esempio la si pu� trovare in <filename>/usr/share/doc/wmdrawer/wmdrawerrc.example</filename>.
+    </para>
+  </refsect1>
+
+  <refsect1>
+    <title>VEDERE ANCHE</title>
+    <para>wmaker (1)</para>
+  </refsect1>
+
+  <refsect1>
+    <title>AUTORI</title>
+    <para>Questo programma � scritto e mantenuto da Val�ry Febvre
+      (<email>vfebvre at vfebvre.lautre.net</email>).</para>
+    <para>Questa pagina di manuale � stata scritta da &dhusername; (&dhemail;)
+      per il sistema &debian; (ma pu� essere usata da altri).
+      � permessa la copia, la distribuzione e/o la modifica di questo
+      documento sotto i termini della <acronym>GNU</acronym> Free Documentation
+      License, Versione 1.1 o ogni versione successiva pubblicata dalla
+      Free Software Foundation; senza Invariant Sections,  Front-Cover
+      Texts e Back-Cover Texts.</para>
+    <para>La traduzione italiana � stata effettuata da Fabio Stumbo
+      (<email>fabio.stumbo at unife.it</email>).</para>
+  </refsect1>
+
+  <refsect1>
+    <title>ALTRE INFORMAZIONI</title>
+    <para>La webpage di  wmdrawer � http://people.easter-eggs.org/~valos/wmdrawer/wmdrawer.html.</para>
+    <para>Sul sito si possono trovare informazioni varie su wmdrawer e scaricare l'ultima versione.</para>
+  </refsect1>
+
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
diff --git a/doc/wmdrawer.1x.gz b/doc/wmdrawer.1x.gz
new file mode 100644
index 0000000..f45ce3e
Binary files /dev/null and b/doc/wmdrawer.1x.gz differ
diff --git a/doc/wmdrawer.sgml b/doc/wmdrawer.sgml
new file mode 100644
index 0000000..15367a3
--- /dev/null
+++ b/doc/wmdrawer.sgml
@@ -0,0 +1,296 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+     page: `docbook-to-man wmdrawer.sgml > wmdrawer.1x'.  You may view
+     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+     less'.  A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+	docbook-to-man $< > $@
+
+	The docbook-to-man binary is found in the docbook-to-man package.
+	Please remember that if you create the nroff version in one of the
+	debian/rules file targets (such as build), you will need to include
+	docbook-to-man in your Build-Depends control field.
+  -->
+
+  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+  <!ENTITY dhfirstname "<firstname>Chris</firstname>">
+  <!ENTITY dhsurname   "<surname>Wesley</surname>">
+  <!-- Please adjust the date whenever revising the manpage. -->
+  <!ENTITY dhdate      "<date>April 7, 2003</date>">
+  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+       allowed: see man(7), man(1). -->
+  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
+  <!ENTITY dhemail     "<email>chris at cwwesley.net</email>">
+  <!ENTITY dhusername  "Chris Wesley">
+  <!ENTITY dhucpackage "<refentrytitle>WMDRAWER</refentrytitle>">
+  <!ENTITY dhpackage   "wmdrawer">
+
+  <!ENTITY debian      "<productname>Debian</productname>">
+  <!ENTITY gnu         "<acronym>GNU</acronym>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &dhemail;
+    </address>
+    <author>
+      &dhfirstname;
+      &dhsurname;
+    </author>
+    <copyright>
+      <year>2002-2004</year>
+      <holder>&dhusername;</holder>
+    </copyright>
+    &dhdate;
+  </refentryinfo>
+
+  <refmeta>
+    &dhucpackage;
+    &dhsection;
+  </refmeta>
+
+  <refnamediv>
+    <refname>&dhpackage;</refname>
+    <refpurpose>a dockapp providing a drawer to launch applications</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+      <arg><option>-c, --configfile=<replaceable>FILE</replaceable></option> [<option>-n, --instancename=<replaceable>NAME</replaceable></option>]</arg>
+      <arg><option>-w, --windowed</option></arg>
+      <arg><option>-h, --help</option></arg>
+      <arg><option>-v, --version</option></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>DESCRIPTION</title>
+    <para><command>&dhpackage;</command> is a dock application (dockapp) that
+      provides a drawer (retractable button bar) to conveniently launch applications.
+    </para>
+    <para>The drawer is retractable and animated.</para>
+    <para>Several columns of buttons can been defined in the drawer.</para>
+    <para>The configuration file is automaticaly reloaded if it changes.</para>
+    <para>Multiple instances of the program can run at the same time.</para>
+    <para>The buttons can be highlighted under the mouse cursor.</para>
+    <para>A tooltip can be defined for each button.</para>
+    <para>The drawer can be transparent (need SHAPE extension).</para>
+    <para>Ability to launch several apps at once from the drawer.
+    By holding down the key Shift or by using mouse buttons
+    middle or right instead of left, you can keep the drawer opened.
+    </para>
+    <para>Adjustable behaviors:
+    dock's image (logo),
+    dock's width and height (for both min=12, max=128),
+    automatic/manual opening and closing of the drawer,
+    timeout value in miliseconds if automatic closing selected,
+    drawer's opening direction and animation speed,
+    mouse cursor type in the drawer,
+    drawer's pseudo-transparency,
+    icons' background image (only if transparency isn't activated),
+    buttons' size (min=12, max=128),
+    buttons' highlight type (0:none, 1:target, 2:shading),
+    image used as highlight (target type only),
+    color and darkening level for highlight (shading type only),
+    drawer's border size,
+    buttons' tooltips and tooltips' font
+   </para>
+  </refsect1>
+
+  <refsect1>
+    <title>OPTIONS</title>
+
+    <variablelist>
+      <varlistentry>
+        <term><option>-c, --configfile=<replaceable>FILE</replaceable> [-n, --instancename=<replaceable>NAME</replaceable>]</option>
+        </term>
+        <listitem>
+          <para>Use <replaceable>FILE</replaceable> as config file instead of the default (<filename>~/.wmdrawerrc</filename>) and optionaly set instance name.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-w, --windowed</option>
+        </term>
+        <listitem>
+          <para>Run in windowed mode. Useful for AfterStep, Fvwm, Sawfish and KDE users.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-h, --help</option>
+        </term>
+        <listitem>
+          <para>Show summary of options.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-v, --version</option>
+        </term>
+        <listitem>
+          <para>Show version of program.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
+  <refsect1>
+    <title>FILES</title>
+    <para><filename>~/.wmdrawerrc</filename> is the default per-user configuration file. Here is a completely commented example.
+    </para>
+<para><programlisting>
+# Config file example for wmdrawer
+[general]
+# Dock's icon [optional]
+#dock_icon	panel-drawer.png
+
+# Drawer's opening direction [required]
+# Top to bottom = 0
+# Right to Left = 1
+# Bottom to Top = 2
+# Left to Right = 3
+direction       2
+
+# Image used for icons' background [optional]
+#icons_bg	defaultTile.xpm
+
+# Allow icons' enlargement to fit them to buttons' size [optional, default 1]
+# 0 indicate that icons should never be larger than their original size.
+#icons_expand   1
+
+# Activate the drawer's pseudo-transparency [optional, default 0]
+# if you choose transparency, icons_bg will be ignored
+#transparency   0
+
+# dock's width: min=12, max=128 [optional, default=64]
+#dock_width     64
+
+# dock's height: min=12, max=128 [optional, default=64]
+#dock_height    64
+
+# buttons' size: min=12, max=128 [optional]
+# Useful for the people who want for example to have big icons
+# and to define several columns.
+#btns_size      32
+
+# Icon's highlight type: 0, 1 or 2 [optional, default 2]
+# 0 : no highlight
+# 1 : target (unavailable if transparency is activated)
+# 2 : shading
+#highlight      2
+
+# Image used as highlight [optional]
+# only used if you choice target type
+#highlight_img	 highlight.xpm
+
+# Tint icons by a specified color [optional, default #ffffff]
+# only used if you choice shading type
+#highlight_tint	#ffffff
+
+# Shade icons at a specified level [optional, default 60]
+# only used if you choice shading type
+#highlight_sh   60
+
+# Display buttons' tooltips [optional, default 1]
+#tooltips       1
+
+# Tooltips' font [optional, default fixed]
+#tooltips_font  fixed
+
+# Drawer's animation speed: 0, 1, 2, 3, 4 [optional, default 1]
+#animation_speed 1
+
+# Mouse cursor in drawer: 0, 1, ..., 76 [optional, default 30]
+#cursor	        30
+
+# Auto opening of the drawer: 0, 1 [optional, default 0]
+#show_on_hover  0
+
+# Auto closing of the drawer: 0, 1 [optional, default 0]
+#hide_on_out    0
+
+# drawer's hiding timeout in miliseconds [optional, default 1000]
+#hide_timeout   1000
+
+# Runs the dockapp in windowed mode: 0, 1 [optional, default 0]
+# Useful for AfterStep, Fvwm, Sawfish or KDE users.
+#windowed_mode  0
+
+# Instance name so window manager can distinguish between multiple copies
+#instance_name	distinguish_name
+
+# Drawer's border size in pixels [optional, default 1]
+#border_size    1
+
+# Images directories
+[images_paths]
+/usr/share/pixmaps
+/usr/local/share/pixmaps/
+
+# A first column with 5 buttons
+# Each button must be defined with this syntax:
+# (tooltip)  (image)  (command)
+[column]
+(X Terminal)	(gnome-term.png)	(xterm -bg black -fg wheat)
+(Galeon)	(galeon.xpm)		(galeon -s)
+(Sylpheed)	(sylpheed.png)		(sylpheed)
+(XChat)		(xchat.png)		(xchat)
+(MPlayer)	(gnome-multimedia.png)	(mplayer)
+
+# A second column with 5 buttons
+[column]
+(Xmms)		(gnome-audio2.png)	(xmms)
+(Gimp)		(gnome-gimp.png)	(gimp)
+(GQview)	(gqview.png)		(gqview)
+(Xcalc)		(gnome-calc3.png)	(xcalc)
+(GFtp)		(gftp.png)		(gftp)
+</programlisting></para>
+    <para>
+    Look at <filename>/usr/share/doc/wmdrawer/wmdrawerrc.example</filename> for a copy of this example.
+    </para>
+  </refsect1>
+
+  <refsect1>
+    <title>SEE ALSO</title>
+    <para>wmaker (1)</para>
+  </refsect1>
+
+  <refsect1>
+    <title>AUTHOR</title>
+    <para>This software is written and maintained by Valéry Febvre
+      (<email>vfebvre at vfebvre.lautre.net</email>).</para>
+    <para>This manual page was written by &dhusername; (&dhemail;) for
+      the &debian; system (but may be used by others).  Permission is
+      granted to copy, distribute and/or modify this document under
+      the terms of the <acronym>GNU</acronym> Free Documentation
+      License, 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.</para>
+  </refsect1>
+
+  <refsect1>
+    <title>OTHER INFO</title>
+    <para>wmDrawer's webpage is at http://people.easter-eggs.org/~valos/wmdrawer/.
+    Here you can find info about wmdrawer and download the latest version.</para>
+  </refsect1>
+
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
diff --git a/graphics.c b/graphics.c
new file mode 100644
index 0000000..c5fbe71
--- /dev/null
+++ b/graphics.c
@@ -0,0 +1,75 @@
+/* wmDrawer (c) 2002-2004 Valery Febvre <vfebvre at vfebvre.lautre.net>
+ *
+ * wmDrawer is a dock application (dockapp) which provides a
+ * drawer (button bar) to launch applications from.
+ *
+ * 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.
+ */
+
+#include "types_defs.h"
+#include "graphics.h"
+
+/* This function come from aterm 0.4.2 (src/ximage_utils.c)
+ *  Copyright (c) 2001 Ren� Scharfe     <l.s.r at web dot de>
+ *  Copyright (c) 2001,1999 Sasha Vasko <sashav at sprintmail dot com> */
+void ShadeXImage (Display *dpy, XImage* srcImage, ShadingInfo* shading) {
+  unsigned int int_rm, int_gm, int_bm ;
+  int shade = 0;
+  register unsigned long p, x;
+  unsigned long y;
+  unsigned int rb_mask, g_mask;
+  unsigned char r_shift=16, g_shift=8, b_shift;
+
+  Visual* visual = DefaultVisual(dpy, DefaultScreen(dpy));
+
+  if( visual->class != TrueColor || srcImage->format != ZPixmap ) return ;
+  if( srcImage->bits_per_pixel <= 8 ) return ;
+  if( shading->shading < 0 ) shade = 100-shading->shading ; /*we want to lighten instead of darken */
+  else shade = shading->shading ;
+  if( shade > 200 ) shade = 200 ;
+  int_rm = (shading->tintColor.red>>8)*shade/100;
+  int_gm = (shading->tintColor.green>>8)*shade/100;
+  int_bm = (shading->tintColor.blue>>8)*shade/100;
+  
+  g_mask = rb_mask = 0xf8 ;
+  b_shift = 3 ;
+  switch (srcImage->bits_per_pixel) {
+  case 15: r_shift = 7 ; g_shift = 2 ; break ;
+  case 16: g_mask = 0xfc ; r_shift = 8 ; g_shift = 3 ; break ;
+  case 32:
+  case 24: g_mask = rb_mask = 0xff ; r_shift = 16 ; g_shift = 8 ; break ;
+  }
+
+  if (srcImage->bits_per_pixel<=16) { /* for better speed we don't want to check for it inside the loop */
+    for (y = 0; y < srcImage->height; y++)
+      for (x = 0; x < srcImage->width; x++) {
+	p = XGetPixel(srcImage, x, y);
+	XPutPixel(srcImage, x, y,
+		  ((((((p>>r_shift)&rb_mask)*int_rm)/255)&rb_mask)<<r_shift)|
+		  ((((((p>>g_shift)&g_mask)*int_gm)/255)&g_mask)<<g_shift)|
+		  ((((((p<<b_shift)&rb_mask)*int_bm)/255)&rb_mask)>>b_shift));
+      }
+  }
+  else {
+    for (y = 0; y < srcImage->height; y++)
+      for (x = 0; x < srcImage->width; x++) {
+	p = XGetPixel(srcImage, x, y);
+	XPutPixel(srcImage, x, y,
+		  ((((((p>>r_shift)&rb_mask)*int_rm)/255)&rb_mask)<<r_shift)|
+		  ((((((p>>g_shift)&g_mask)*int_gm)/255)&g_mask)<<g_shift)|
+		  ((((p & rb_mask)*int_bm)/255)&rb_mask));
+      }
+  }
+}
diff --git a/graphics.h b/graphics.h
new file mode 100644
index 0000000..b457f84
--- /dev/null
+++ b/graphics.h
@@ -0,0 +1,21 @@
+/* wmDrawer (c) 2002-2004 Valery Febvre <vfebvre at vfebvre.lautre.net>
+ *
+ * wmDrawer is a dock application (dockapp) which provides a
+ * drawer (button bar) to launch applications from.
+ *
+ * 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.
+ */
+
+void ShadeXImage (Display *dpy, XImage* srcImage, ShadingInfo* shading);
diff --git a/images.c b/images.c
new file mode 100644
index 0000000..2878de7
--- /dev/null
+++ b/images.c
@@ -0,0 +1,245 @@
+/* wmDrawer (c) 2002-2004 Valery Febvre <vfebvre at vfebvre.lautre.net>
+ *
+ * wmDrawer is a dock application (dockapp) which provides a
+ * drawer (button bar) to launch applications from.
+ *
+ * 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.
+ */
+
+#include "types_defs.h"
+#include "images.h"
+
+#ifdef USE_GDKPIXBUF
+#include <gdk-pixbuf/gdk-pixbuf-xlib.h>
+#endif
+
+#ifdef USE_GDKPIXBUF2
+#include <gdk-pixbuf-xlib/gdk-pixbuf-xlib.h>
+#endif
+
+#ifdef USE_IMLIB
+#include <Imlib.h>
+ImlibData *id;
+#endif
+
+unsigned int imageLibIsInit = 0;
+extern Display *display;
+extern drawerConfig config;
+extern int nbImagesPaths;
+
+static int initImgLib (void) {
+  if (imageLibIsInit == 0) {
+#ifdef USE_GDKPIXBUF
+    gdk_pixbuf_xlib_init (display, DefaultScreen (display));
+    imageLibIsInit = 1;
+#endif
+#ifdef USE_GDKPIXBUF2
+    g_type_init ();
+    gdk_pixbuf_xlib_init (display, DefaultScreen (display));
+    imageLibIsInit = 1;
+#endif
+#ifdef USE_IMLIB
+    id = Imlib_init (display);
+    imageLibIsInit = 1;
+#endif
+  }
+  return imageLibIsInit;
+}
+
+static char *loadImageFromFile (char *file) {
+#ifdef USE_GDKPIXBUF
+  return (char *)gdk_pixbuf_new_from_file (file);
+#endif
+#ifdef USE_GDKPIXBUF2
+  GError *error = NULL;
+  return (char *)gdk_pixbuf_new_from_file (file, &error);
+#endif
+#ifdef USE_IMLIB
+  return (char *)Imlib_load_image (id, file);
+#endif
+}
+
+static char *loadImageFromXpmData (const char **data) {
+#ifdef USE_GDKPIXBUF
+  return (char *)gdk_pixbuf_new_from_xpm_data (data);
+#endif
+#ifdef USE_GDKPIXBUF2
+  return (char *)gdk_pixbuf_new_from_xpm_data (data);
+#endif
+#ifdef USE_IMLIB
+  return (char *)Imlib_create_image_from_xpm_data(id, (char **)data);
+#endif
+}
+
+static int getImageWidth (char *img) {
+#ifdef USE_GDKPIXBUF
+  return gdk_pixbuf_get_width ((GdkPixbuf *)img);
+#endif
+#ifdef USE_GDKPIXBUF2
+  return gdk_pixbuf_get_width ((GdkPixbuf *)img);
+#endif
+#ifdef USE_IMLIB
+  return ((ImlibImage *)img)->rgb_width;
+#endif
+}
+
+static int getImageHeight (char *img) {
+#ifdef USE_GDKPIXBUF
+  return gdk_pixbuf_get_height ((GdkPixbuf *)img);
+#endif
+#ifdef USE_GDKPIXBUF2
+  return gdk_pixbuf_get_height ((GdkPixbuf *)img);
+#endif
+#ifdef USE_IMLIB
+  return ((ImlibImage *)img)->rgb_height;
+#endif
+}
+
+static char *scaleImage (char *img, int w, int h) {
+#ifdef USE_GDKPIXBUF
+  return (char *)gdk_pixbuf_scale_simple ((GdkPixbuf *)img,
+					  w, h, GDK_INTERP_HYPER);
+#endif
+#ifdef USE_GDKPIXBUF2
+  return (char *)gdk_pixbuf_scale_simple ((GdkPixbuf *)img,
+					  w, h, GDK_INTERP_HYPER);
+#endif
+#ifdef USE_IMLIB
+  return (char *)Imlib_clone_scaled_image (id, (ImlibImage *)img, w, h);
+#endif
+}
+
+static void unrefImage (char *img) {
+#ifdef USE_GDKPIXBUF
+  gdk_pixbuf_unref ((GdkPixbuf *)img);
+#endif
+#ifdef USE_GDKPIXBUF2
+  g_object_unref ((GdkPixbuf *)img);
+#endif
+#ifdef USE_IMLIB
+  Imlib_kill_image (id, (ImlibImage *)img);
+#endif
+}
+
+static void createPixmapAndMask (char *img, Pixmap *pixmap, Pixmap *mask) {
+#ifdef USE_GDKPIXBUF
+  gdk_pixbuf_xlib_render_pixmap_and_mask ((GdkPixbuf *)img, pixmap, mask, 128);
+#endif
+#ifdef USE_GDKPIXBUF2
+  gdk_pixbuf_xlib_render_pixmap_and_mask ((GdkPixbuf *)img, pixmap, mask, 128);
+#endif
+#ifdef USE_IMLIB
+  Imlib_render (id, (ImlibImage *)img, ((ImlibImage *)img)->rgb_width,
+		((ImlibImage *)img)->rgb_height);
+  *pixmap = Imlib_move_image (id, (ImlibImage *)img);
+  *mask   = Imlib_move_mask (id, (ImlibImage *)img);
+#endif
+}
+
+/*
+  Create pixmap from image data and resize it to fit (dimW x dimH)
+  img        : image data
+  imgPix     : pixmap result
+  imgMask    : mask result
+  w          : pixmap width result
+  h          : pixmap height result
+  dimW       : max width allows
+  dimH       : max height allows
+  resizeMask : resize mask
+*/
+void createAndResizePixmap (char *img, Pixmap *imgPix, Pixmap *imgMask,
+			    int *w, int *h, int dimW, int dimH,
+			    unsigned long resizeMask) {
+  char *imgScaled = NULL;
+
+  *w = getImageWidth (img);
+  *h = getImageHeight (img);
+
+  if (resizeMask > 0) {
+    /* resize smaller ? */
+    if ((*w > dimW || *h > dimH) && ((resizeMask >> (RESIZE_SMALLER-1)) % 2)) {
+      if ((float) *w / (float) dimW > (float) *h / (float) dimH) {
+	*h = (int) ((*h * dimW) / *w);
+	*w = dimW;
+      }
+      else {
+	*w = (int) ((*w * dimH) / *h);
+	*h = dimH;
+      }
+    }
+    /* resize greater ? */
+    if ((*w < dimW && *h < dimH) && ((resizeMask >> (RESIZE_GREATER-1)) % 2)) {
+      if (*w >= *h) {
+	*h = (int) ((*h * dimW) / *w);
+	*w = dimW;
+      }
+      else {
+	*w = (int) ((*w * dimH) / *h);
+	*h = dimH;
+      }
+    }
+    /* ready for resizing */
+    imgScaled = scaleImage (img, *w, *h);
+    unrefImage (img);
+    img = imgScaled;
+  }
+  createPixmapAndMask (img, imgPix, imgMask);
+  unrefImage (img);
+}
+
+int createPixmapFromFile (char *file, Pixmap *imgPix, Pixmap *imgMask,
+			  int *w, int *h, int dimW, int dimH,
+			  unsigned long resizeMask) {
+  int i;
+  char *img;
+  char path[FILENAME_MAX];
+
+  if (initImgLib() == 0) {
+    printf ("%s warning: can't init image library.\n", PACKAGE);
+    return 0;
+  }
+  if (file == NULL) {
+    printf ("%s warning: a file path is (null)!\n", PACKAGE);
+    return 0;
+  }
+
+  /* quick test for absolute path */
+  img = loadImageFromFile (file);
+  if (file[0] != '/' || img == NULL) {
+    /* else try all paths */
+    for (i=0; i<nbImagesPaths; i++) {
+      sprintf(path, "%s/%s", config.imagesPaths[i], file);
+      img = loadImageFromFile (path);
+      if (img != NULL) break;
+    }
+  }
+  if (img == NULL) {
+    printf ("%s warning: can't load image %s\n", PACKAGE, file);
+    return 0;
+  }
+
+  createAndResizePixmap (img, imgPix, imgMask, w, h, dimW, dimH, resizeMask);
+  return 1;
+}
+
+void createPixmapFromData (const char **data, Pixmap *imgPix, Pixmap *imgMask,
+			   int *w, int *h, int dimW, int dimH,
+			   unsigned long resizeMask) {
+  char *img;
+
+  initImgLib();
+  img = loadImageFromXpmData (data);
+  createAndResizePixmap (img, imgPix, imgMask, w, h, dimW, dimH, resizeMask);
+}
diff --git a/images.h b/images.h
new file mode 100644
index 0000000..abdc3a3
--- /dev/null
+++ b/images.h
@@ -0,0 +1,29 @@
+/* wmDrawer (c) 2002-2004 Valery Febvre <vfebvre at vfebvre.lautre.net>
+ *
+ * wmDrawer is a dock application (dockapp) which provides a
+ * drawer (button bar) to launch applications from.
+ *
+ * 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.
+ */
+
+#define RESIZE_SMALLER (1UL << 0)
+#define RESIZE_GREATER (1UL << 1)
+
+int  createPixmapFromFile (char *file, Pixmap *imgPix, Pixmap *imgMask,
+			   int *w, int *h, int dimW, int dimH,
+			   unsigned long resizeMask);
+void createPixmapFromData (const char **data, Pixmap *imgPix, Pixmap *imgMask,
+			   int *w, int *h, int dimW, int dimH,
+			   unsigned long resizeMask);
diff --git a/pixmaps/defaultDockIcon.xpm b/pixmaps/defaultDockIcon.xpm
new file mode 100644
index 0000000..10b375e
--- /dev/null
+++ b/pixmaps/defaultDockIcon.xpm
@@ -0,0 +1,115 @@
+/* XPM */
+static char * defaultDockIcon_xpm[] = {
+"48 48 64 1",
+" 	c None",
+".	c #9E9A9E",
+"+	c #868286",
+"@	c #000000",
+"#	c #717171",
+"$	c #303030",
+"%	c #080808",
+"&	c #383838",
+"*	c #A6A2AE",
+"=	c #696969",
+"-	c #AEAAAE",
+";	c #515151",
+">	c #414141",
+",	c #181818",
+"'	c #413428",
+")	c #202020",
+"!	c #494949",
+"~	c #8E8A8E",
+"{	c #BEBABE",
+"]	c #281C10",
+"^	c #969296",
+"/	c #616161",
+"(	c #693C00",
+"_	c #8E5100",
+":	c #D77900",
+"<	c #282828",
+"[	c #594118",
+"}	c #F78E08",
+"|	c #101010",
+"1	c #080400",
+"2	c #C7C3C7",
+"3	c #595959",
+"4	c #A6A2A6",
+"5	c #DFD3DF",
+"6	c #D7D3D7",
+"7	c #101810",
+"8	c #B6B2B6",
+"9	c #C7C7C7",
+"0	c #181018",
+"a	c #E7E7E7",
+"b	c #FFFBFF",
+"c	c #F7F3F7",
+"d	c #EFEBEF",
+"e	c #D7DBD7",
+"f	c #F7F7F7",
+"g	c #282028",
+"h	c #CFCBCF",
+"i	c #717971",
+"j	c #202820",
+"k	c #DFDBDF",
+"l	c #797979",
+"m	c #414541",
+"n	c #868686",
+"o	c #EFE3EF",
+"p	c #595D59",
+"q	c #716D69",
+"r	c #96969E",
+"s	c #303830",
+"t	c #9E9E9E",
+"u	c #968A96",
+"v	c #616561",
+"w	c #515551",
+"x	c #514951",
+"y	c #797179",
+"                                                ",
+"                    .+++.                 @     ",
+"                  #$%@@@%&.              @@@    ",
+"                *=@@+-;@>>,.            @@@@@   ",
+"              +;'%)!~~{@]>$!           @@@@@@@  ",
+"          ^/'(_:_<$$.-+@@)&,.         @@@@@@@@@ ",
+"         #[:}}}:@|,))|@@@@<%#        @@@@@@@@@@@",
+"         [}:_(1@@@@@1@@@@@|%$                   ",
+"         ^;>](_@@@@@@@@@@@@@<                   ",
+"              =@@@@@@@@@@@@@)                   ",
+"               )@@@@@+23@@@@@#                  ",
+"              ^%,@@@456^@@@|&7.                 ",
+"              <=68+9666{@@@,;0;                 ",
+"             /,9abbcdad6~@%$;&7.                ",
+"             !=abbbbbbbe{@&;!>0!                ",
+"           .$%.fbbbbbbbb.%!<<!>@+               ",
+"           >g&*dbbbbbbbh||&1)&;0)               ",
+"          3)i>4abbbbbb+|%<)@@<;>@~              ",
+"         !ji;>4kbbbbb-@|>)@@@,>!@$              ",
+"        ;l{+);^5fbbbb)|!)@@@@@$;$%.             ",
+"       ~$6++)i+4kbbb-@&,@@@@@@|m!@/             ",
+"       <94++);+nhbbb;|$@@@@@@@@<;%|             ",
+"      #+2+++)>8{-obk@,|@@@@@p&@@;, at +            ",
+"      ;d++n+)=hkked{@@@@@@@@q/@@&&@$            ",
+"     +/2+++~|=eakkd~@@@@@@@@q~@@%!@@^           ",
+"     !.255^. at labffc+@@@@@@|g/r%@@,)@#           ",
+"     <hdbbh+s.abbbb+@@@@@@)^.^)@@@>@>           ",
+"     @bbbbkt&8kbbbb+@@@@@|#..t$@@@$%@           ",
+"    ~$bbbba{&4kbbbb+@@@@@$^^88;@@@%@@~          ",
+"    +>bbbke-<lkbbbb{@@@@@3^.6hi@@@@@@;          ",
+"    #/bbk6u+<q6cbbb{@@@@|#.266.7@@@@@>          ",
+"    ;>dkh#~ $!2abbbd|@@@|+^666{;@@@@@)          ",
+"    #;a5#.  ;>86bbbb>@@@<+-6666#@@@@@@.         ",
+"    .|d8+   ~,t6dbbb#@@@<+86666#@@@@@@+         ",
+"     %h^     |/heccb6@@@&^-6666n$@@@@@;         ",
+"     $.^     =)8665d63@@<~.66664m@@@@@<         ",
+"     ~;{      )l66e66{g@<.r6666-v|@@@@)         ",
+"      {       #%^6k666{gq-{6666h#)@@@@@         ",
+"               $'^66656666666666#$@@@@@.        ",
+"               ^%%~hk66666666666#!@@@@@+        ",
+"                +%%q!9663-66666{~3|@@,$=        ",
+"                 ;@>q#r^>,^26662+=>@@);,^       ",
+"             ~;;;$+>,w+x)@0i^8h{+l;$@@&!$#      ",
+"             ,vw/{2^~$7;3@@@7>w;><,@@@@@,@)~    ",
+"             =<w|+l#^*>/+4=y=;m//s^;)@@@@@@@+   ",
+"              ^;<))!gmpkkh{{{{-.+##  .+=;;;;.   ",
+"                 ..  ^;!!!!!!!))|<#             ",
+"                                                "};
diff --git a/pixmaps/defaultHighlightImg.xpm b/pixmaps/defaultHighlightImg.xpm
new file mode 100644
index 0000000..78b40d2
--- /dev/null
+++ b/pixmaps/defaultHighlightImg.xpm
@@ -0,0 +1,69 @@
+/* XPM */
+static char * defaultHighlightImg_xpm[] = {
+"64 64 2 1",
+" 	c None",
+".	c black",
+"                                                                ",
+" .............                                    ............. ",
+" ............                                      ............ ",
+" ...........                                        ........... ",
+" ....                                                      .... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ..                                                          .. ",
+" .                                                            . ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+"                                                                ",
+" .                                                            . ",
+" ..                                                          .. ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ...                                                        ... ",
+" ....                                                      .... ",
+" ...........                                        ........... ",
+" ............                                      ............ ",
+" .............                                    ............. ",
+"                                                                "};
diff --git a/pixmaps/defaultIcon.xpm b/pixmaps/defaultIcon.xpm
new file mode 100644
index 0000000..70b4f2a
--- /dev/null
+++ b/pixmaps/defaultIcon.xpm
@@ -0,0 +1,125 @@
+/* XPM */
+static char * defaultIcon_xpm[] = {
+"48 48 74 1",
+" 	c None",
+".	c #000000",
+"+	c #A27F3B",
+"@	c #B89243",
+"#	c #D8AB4E",
+"$	c #9D7D3A",
+"%	c #A6823C",
+"&	c #7C622D",
+"*	c #F7D899",
+"=	c #F7E2B8",
+"-	c #D8BA7B",
+";	c #BE9B53",
+">	c #F7C35A",
+",	c #F7DFAF",
+"'	c #F7E5C0",
+")	c #F7D48C",
+"!	c #F7CF7E",
+"~	c #D8B15F",
+"{	c #6E5526",
+"]	c #F7DCA5",
+"^	c #A8843D",
+"/	c #937435",
+"(	c #AA863E",
+"_	c #D8B66E",
+":	c #BEA363",
+"<	c #947536",
+"[	c #927335",
+"}	c #F7C96D",
+"|	c #80632D",
+"1	c #C39F57",
+"2	c #A38E55",
+"3	c #A48B5A",
+"4	c #D2A64D",
+"5	c #82662F",
+"6	c #654F24",
+"7	c #DCB463",
+"8	c #BE9544",
+"9	c #C3A466",
+"0	c #8C6D31",
+"a	c #D2B06C",
+"b	c #D8BE86",
+"c	c #715929",
+"d	c #B99344",
+"e	c #B38D40",
+"f	c #D8B56E",
+"g	c #D8AC58",
+"h	c #997A3B",
+"i	c #000001",
+"j	c #6B5527",
+"k	c #C39F55",
+"l	c #DCC494",
+"m	c #DAB872",
+"n	c #C9AC73",
+"o	c #BFA16A",
+"p	c #19150D",
+"q	c #876A31",
+"r	c #C9A45B",
+"s	c #C6A76A",
+"t	c #7F6941",
+"u	c #977737",
+"v	c #D8B165",
+"w	c #D8AC5B",
+"x	c #BEA272",
+"y	c #C09745",
+"z	c #D8B163",
+"A	c #927C52",
+"B	c #735F3B",
+"C	c #A68748",
+"D	c #1A1A1A",
+"E	c #393939",
+"F	c #221C12",
+"G	c #DDBC74",
+"H	c #D2A64C",
+"I	c #705627",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                   ........                     ",
+"                 ...+@#$%&...                   ",
+"                ..#**=*---;%...                 ",
+"               ..>,'*)>>>!-~%{..                ",
+"               .>,]>^//(>>!_~%..                ",
+"              .:*=><....[>>}~~|..               ",
+"              .}'!<..   .1>!#~%..               ",
+"             .2),#..    .3>}~#%..               ",
+"             .4!>%..    .3}}_#5..               ",
+"             .>!>%..    .3>__#6..               ",
+"             .7~85..    .9}-#%...               ",
+"             .......    0ab~#c..                ",
+"              .....    .d)b#8...                ",
+"                      .e}b##...                 ",
+"                     ..>)fgh..i                 ",
+"                     jklmnop..                  ",
+"                    .qafrst..                   ",
+"                    .u-vwx..                    ",
+"                    .y-zwA..                    ",
+"                    .#b~#B..                    ",
+"                    .;-#8..                     ",
+"                    .CC%|..                     ",
+"                    .DE...                      ",
+"                     ....                       ",
+"                                                ",
+"                     F....                      ",
+"                    .G!)8..                     ",
+"                    .!**#..                     ",
+"                    .))~8..                     ",
+"                    .)_#8..                     ",
+"                    .H~8I..                     ",
+"                     ......                     ",
+"                      ....                      ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                "};
diff --git a/pixmaps/defaultIconsBg.xpm b/pixmaps/defaultIconsBg.xpm
new file mode 100644
index 0000000..4714d93
--- /dev/null
+++ b/pixmaps/defaultIconsBg.xpm
@@ -0,0 +1,198 @@
+/* XPM */
+static char * defaultIconsBg_xpm[] = {
+"64 64 131 2",
+"  	c None",
+". 	c #FFFFFF",
+"+ 	c #A7A7B2",
+"@ 	c #A6A6B2",
+"# 	c #A6A6B1",
+"$ 	c #A5A5B0",
+"% 	c #A4A4B0",
+"& 	c #A4A4AF",
+"* 	c #A3A3AF",
+"= 	c #A3A3AE",
+"- 	c #A2A2AE",
+"; 	c #A1A1AD",
+"> 	c #A1A1AC",
+", 	c #A0A0AC",
+"' 	c #9F9FAB",
+") 	c #9E9EAA",
+"! 	c #9D9DAA",
+"~ 	c #9D9DA9",
+"{ 	c #9C9CA8",
+"] 	c #9B9BA7",
+"^ 	c #9A9AA7",
+"/ 	c #9A9AA6",
+"( 	c #9999A5",
+"_ 	c #9898A5",
+": 	c #9898A4",
+"< 	c #9797A4",
+"[ 	c #9797A3",
+"} 	c #9696A3",
+"| 	c #9595A2",
+"1 	c #9595A1",
+"2 	c #9494A1",
+"3 	c #9393A0",
+"4 	c #92929F",
+"5 	c #91919F",
+"6 	c #91919E",
+"7 	c #90909D",
+"8 	c #8F8F9C",
+"9 	c #8E8E9C",
+"0 	c #8E8E9B",
+"a 	c #8D8D9A",
+"b 	c #8C8C9A",
+"c 	c #8C8C99",
+"d 	c #8B8B99",
+"e 	c #8A8A98",
+"f 	c #898997",
+"g 	c #898996",
+"h 	c #888896",
+"i 	c #878795",
+"j 	c #868694",
+"k 	c #858594",
+"l 	c #858593",
+"m 	c #848492",
+"n 	c #838391",
+"o 	c #828291",
+"p 	c #828290",
+"q 	c #818190",
+"r 	c #474755",
+"s 	c #80808F",
+"t 	c #80808E",
+"u 	c #7F7F8E",
+"v 	c #7E7E8D",
+"w 	c #7D7D8C",
+"x 	c #A2A2AD",
+"y 	c #9B9BA8",
+"z 	c #8F8F9D",
+"A 	c #838392",
+"B 	c #81818F",
+"C 	c #7C7C8B",
+"D 	c #7B7B8A",
+"E 	c #7A7A89",
+"F 	c #797988",
+"G 	c #787887",
+"H 	c #9696A2",
+"I 	c #8D8D9B",
+"J 	c #8A8A97",
+"K 	c #7E7E8C",
+"L 	c #777787",
+"M 	c #777786",
+"N 	c #767686",
+"O 	c #757585",
+"P 	c #757584",
+"Q 	c #747484",
+"R 	c #747483",
+"S 	c #7A7A8A",
+"T 	c #767685",
+"U 	c #737383",
+"V 	c #727282",
+"W 	c #727281",
+"X 	c #717181",
+"Y 	c #707080",
+"Z 	c #6F6F7F",
+"` 	c #6E6E7F",
+" .	c #8B8B98",
+"..	c #848493",
+"+.	c #7F7F8D",
+"@.	c #787888",
+"#.	c #737382",
+"$.	c #6E6E7E",
+"%.	c #6D6D7D",
+"&.	c #6C6C7D",
+"*.	c #6C6C7C",
+"=.	c #6B6B7C",
+"-.	c #6B6B7B",
+";.	c #6A6A7A",
+">.	c #69697A",
+",.	c #888895",
+"'.	c #6A6A7B",
+").	c #696979",
+"!.	c #686879",
+"~.	c #676778",
+"{.	c #676777",
+"].	c #666677",
+"^.	c #656576",
+"/.	c #646475",
+"(.	c #636374",
+"_.	c #626273",
+":.	c #616172",
+"<.	c #606072",
+"[.	c #606071",
+"}.	c #5F5F70",
+"|.	c #797989",
+"1.	c #6D6D7E",
+"2.	c #686878",
+"3.	c #616173",
+"4.	c #5E5E70",
+"5.	c #5E5E6F",
+"6.	c #5D5D6F",
+"7.	c #5C5C6E",
+"8.	c #5C5C6D",
+"9.	c #5B5B6D",
+"0.	c #000000",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+". + + @ # $ % & * = - ; > , ' ) ) ! ~ { ] ] ^ / ( _ : < [ } | 1 2 3 4 4 5 6 7 8 8 9 0 a b c d e f f g h i j j k l m n n o p q r ",
+". + @ # $ % & * = - ; > , ' ) ) ! ~ { ] ] ^ / ( _ : < [ } | 1 2 3 4 4 5 6 7 8 8 9 0 a b c d e f f g h i j j k l m n n o p q r r ",
+". @ # $ % & * = - ; > , ' ) ) ! ~ { ] ] ^ / ( _ : < [ } | 1 2 3 4 4 5 6 7 8 8 9 0 a b c d e f f g h i j j k l m n n o p q s r r ",
+". # $ % & * = - ; > , ' ) ) ! ~ { ] ] ^ / ( _ : < [ } | 1 2 3 4 4 5 6 7 8 8 9 0 a b c d e f f g h i j j k l m n n o p q s t r r ",
+". $ % & * = - ; > , ' ) ) ! ~ { ] ] ^ / ( _ : < [ } | 1 2 3 4 4 5 6 7 8 8 9 0 a b c d e f f g h i j j k l m n n o p q s t u r r ",
+". % & * = - ; > , ' ) ) ! ~ { ] ] ^ / ( _ : < [ } | 1 2 3 4 4 5 6 7 8 8 9 0 a b c d e f f g h i j j k l m n n o p q s t u v r r ",
+". & * = - ; > , ' ) ) ! ~ { ] ] ^ / ( _ : < [ } | 1 2 3 4 4 5 6 7 8 8 9 0 a b c d e f f g h i j j k l m n n o p q s t u v w r r ",
+". * - x ; > , ' ) ) ~ { { y ] ^ / ( _ : < } | | 1 2 3 4 4 6 7 7 z 8 9 0 a b c d e f f g h i j j l m m A n o p B s t u v w w r r ",
+". - x ; > , ' ) ) ~ { { y ] ^ / ( _ : < } | | 1 2 3 4 4 6 7 7 z 8 9 0 a b c d e f f g h i j j l m m A n o p B s t u v w w C r r ",
+". x ; > , ' ) ) ~ { { y ] ^ / ( _ : < } | | 1 2 3 4 4 6 7 7 z 8 9 0 a b c d e f f g h i j j l m m A n o p B s t u v w w C D r r ",
+". ; > , ' ) ) ~ { { y ] ^ / ( _ : < } | | 1 2 3 4 4 6 7 7 z 8 9 0 a b c d e f f g h i j j l m m A n o p B s t u v w w C D D r r ",
+". > , ' ) ) ~ { { y ] ^ / ( _ : < } | | 1 2 3 4 4 6 7 7 z 8 9 0 a b c d e f f g h i j j l m m A n o p B s t u v w w C D D E r r ",
+". , ' ) ) ~ { { y ] ^ / ( _ : < } | | 1 2 3 4 4 6 7 7 z 8 9 0 a b c d e f f g h i j j l m m A n o p B s t u v w w C D D E E r r ",
+". ' ) ) ~ { { y ] ^ / ( _ : < } | | 1 2 3 4 4 6 7 7 z 8 9 0 a b c d e f f g h i j j l m m A n o p B s t u v w w C D D E E F r r ",
+". ) ) ~ { { y ] ^ / ( _ : < } | | 1 2 3 4 4 6 7 7 z 8 9 0 a b c d e f f g h i j j l m m A n o p B s t u v w w C D D E E F G r r ",
+". ) ~ { { y ] / ( ( _ : < } H | 2 3 3 4 4 6 7 7 z 8 0 I a b c d e J f h i i j j l m m A n o q B s t u v K w C D D E E F G G r r ",
+". ~ { { y ] / ( ( _ : < } H | 2 3 3 4 4 6 7 7 z 8 0 I a b c d e J f h i i j j l m m A n o q B s t u v K w C D D E E F G G L r r ",
+". { { y ] / ( ( _ : < } H | 2 3 3 4 4 6 7 7 z 8 0 I a b c d e J f h i i j j l m m A n o q B s t u v K w C D D E E F G G L M r r ",
+". { y ] / ( ( _ : < } H | 2 3 3 4 4 6 7 7 z 8 0 I a b c d e J f h i i j j l m m A n o q B s t u v K w C D D E E F G G L M N r r ",
+". y ] / ( ( _ : < } H | 2 3 3 4 4 6 7 7 z 8 0 I a b c d e J f h i i j j l m m A n o q B s t u v K w C D D E E F G G L M N O r r ",
+". ] / ( ( _ : < } H | 2 3 3 4 4 6 7 7 z 8 0 I a b c d e J f h i i j j l m m A n o q B s t u v K w C D D E E F G G L M N O P r r ",
+". / ( ( _ : < } H | 2 3 3 4 4 6 7 7 z 8 0 I a b c d e J f h i i j j l m m A n o q B s t u v K w C D D E E F G G L M N O P Q r r ",
+". ( ( _ : < } H | 2 3 3 4 4 6 7 7 z 8 0 I a b c d e J f h i i j j l m m A n o q B s t u v K w C D D E E F G G L M N O P Q R r r ",
+". ( _ : < } H | 2 3 3 4 6 6 7 7 z 8 0 I a b c d e J f h i i j l l m m A n p q B s u v v K w C D D S E F G G L M T O P Q U V r r ",
+". _ : < } H | 2 3 3 4 6 6 7 7 z 8 0 I a b c d e J f h i i j l l m m A n p q B s u v v K w C D D S E F G G L M T O P Q U V V r r ",
+". : < } H | 2 3 3 4 6 6 7 7 z 8 0 I a b c d e J f h i i j l l m m A n p q B s u v v K w C D D S E F G G L M T O P Q U V V W r r ",
+". < } H | 2 3 3 4 6 6 7 7 z 8 0 I a b c d e J f h i i j l l m m A n p q B s u v v K w C D D S E F G G L M T O P Q U V V W X r r ",
+". } H | 2 3 3 4 6 6 7 7 z 8 0 I a b c d e J f h i i j l l m m A n p q B s u v v K w C D D S E F G G L M T O P Q U V V W X Y r r ",
+". H | 2 3 3 4 6 6 7 7 z 8 0 I a b c d e J f h i i j l l m m A n p q B s u v v K w C D D S E F G G L M T O P Q U V V W X Y Z r r ",
+". | 2 3 3 4 6 6 7 7 z 8 0 I a b c d e J f h i i j l l m m A n p q B s u v v K w C D D S E F G G L M T O P Q U V V W X Y Z Z r r ",
+". 2 3 3 4 6 6 7 7 z 8 0 I a b c d e J f h i i j l l m m A n p q B s u v v K w C D D S E F G G L M T O P Q U V V W X Y Z Z ` r r ",
+". 3 3 4 6 6 7 7 z 8 0 I a b d  .e J f h i i j l l ..m A n p q B s u +.v K w C D D E F F @.G L M T O P Q U #.V X Y Y Z Z $.%.r r ",
+". 3 4 6 6 7 7 z 8 0 I a b d  .e J f h i i j l l ..m A n p q B s u +.v K w C D D E F F @.G L M T O P Q U #.V X Y Y Z Z $.%.%.r r ",
+". 4 6 6 7 7 z 8 0 I a b d  .e J f h i i j l l ..m A n p q B s u +.v K w C D D E F F @.G L M T O P Q U #.V X Y Y Z Z $.%.%.&.r r ",
+". 6 6 7 7 z 8 0 I a b d  .e J f h i i j l l ..m A n p q B s u +.v K w C D D E F F @.G L M T O P Q U #.V X Y Y Z Z $.%.%.&.*.r r ",
+". 6 7 7 z 8 0 I a b d  .e J f h i i j l l ..m A n p q B s u +.v K w C D D E F F @.G L M T O P Q U #.V X Y Y Z Z $.%.%.&.*.=.r r ",
+". 7 7 z 8 0 I a b d  .e J f h i i j l l ..m A n p q B s u +.v K w C D D E F F @.G L M T O P Q U #.V X Y Y Z Z $.%.%.&.*.=.-.r r ",
+". 7 z 8 0 I a b d  .e J f h i i j l l ..m A n p q B s u +.v K w C D D E F F @.G L M T O P Q U #.V X Y Y Z Z $.%.%.&.*.=.-.;.r r ",
+". z 8 0 I a b d  .e J f h i i j l l ..m A n p q B s u +.v K w C D D E F F @.G L M T O P Q U #.V X Y Y Z Z $.%.%.&.*.=.-.;.>.r r ",
+". 0 0 I a b d  .e f h h ,.i j l l ..m n p p q B s u +.v w C C D D E F F @.G M N T O P Q U #.V X Y Y Z Z $.%.%.&.*.-.'.;.>.).r r ",
+". 0 I a b d  .e f h h ,.i j l l ..m n p p q B s u +.v w C C D D E F F @.G M N T O P Q U #.V X Y Y Z Z $.%.%.&.*.-.'.;.>.).!.r r ",
+". I a b d  .e f h h ,.i j l l ..m n p p q B s u +.v w C C D D E F F @.G M N T O P Q U #.V X Y Y Z Z $.%.%.&.*.-.'.;.>.).!.~.r r ",
+". a b d  .e f h h ,.i j l l ..m n p p q B s u +.v w C C D D E F F @.G M N T O P Q U #.V X Y Y Z Z $.%.%.&.*.-.'.;.>.).!.~.{.r r ",
+". b d  .e f h h ,.i j l l ..m n p p q B s u +.v w C C D D E F F @.G M N T O P Q U #.V X Y Y Z Z $.%.%.&.*.-.'.;.>.).!.~.{.].r r ",
+". d  .e f h h ,.i j l l ..m n p p q B s u +.v w C C D D E F F @.G M N T O P Q U #.V X Y Y Z Z $.%.%.&.*.-.'.;.>.).!.~.{.].^.r r ",
+".  .e f h h ,.i j l l ..m n p p q B s u +.v w C C D D E F F @.G M N T O P Q U #.V X Y Y Z Z $.%.%.&.*.-.'.;.>.).!.~.{.].^./.r r ",
+". e f h h ,.i j l l ..m n p p q B s u +.v w C C D D E F F @.G M N T O P Q U #.V X Y Y Z Z $.%.%.&.*.-.'.;.>.).!.~.{.].^././.r r ",
+". f h h i j j l l ..m n o p q B t u +.v w C C D E E F F @.G M N T O P Q U #.V X Y Y Z $.$.%.%.&.*.-.'.;.>.!.~.~.{.].^././.(.r r ",
+". h h i j j l l ..m n o p q B t u +.v w C C D E E F F @.G M N T O P Q U #.V X Y Y Z $.$.%.%.&.*.-.'.;.>.!.~.~.{.].^././.(._.r r ",
+". h i j j l l ..m n o p q B t u +.v w C C D E E F F @.G M N T O P Q U #.V X Y Y Z $.$.%.%.&.*.-.'.;.>.!.~.~.{.].^././.(._._.r r ",
+". i j j l l ..m n o p q B t u +.v w C C D E E F F @.G M N T O P Q U #.V X Y Y Z $.$.%.%.&.*.-.'.;.>.!.~.~.{.].^././.(._._.:.r r ",
+". j j l l ..m n o p q B t u +.v w C C D E E F F @.G M N T O P Q U #.V X Y Y Z $.$.%.%.&.*.-.'.;.>.!.~.~.{.].^././.(._._.:.:.r r ",
+". j l l ..m n o p q B t u +.v w C C D E E F F @.G M N T O P Q U #.V X Y Y Z $.$.%.%.&.*.-.'.;.>.!.~.~.{.].^././.(._._.:.:.<.r r ",
+". l l ..m n o p q B t u +.v w C C D E E F F @.G M N T O P Q U #.V X Y Y Z $.$.%.%.&.*.-.'.;.>.!.~.~.{.].^././.(._._.:.:.<.[.r r ",
+". l ..m n o p q B t u +.v w C C D E E F F @.G M N T O P Q U #.V X Y Y Z $.$.%.%.&.*.-.'.;.>.!.~.~.{.].^././.(._._.:.:.<.[.}.r r ",
+". m n n o p q s t u +.v w C C D E E |.F G M M N T O Q R U #.V X Y Y Z $.$.1.%.*.-.-.'.;.>.!.2.~.{.].^././.(._._.3.:.<.[.}.4.r r ",
+". n n o p q s t u +.v w C C D E E |.F G M M N T O Q R U #.V X Y Y Z $.$.1.%.*.-.-.'.;.>.!.2.~.{.].^././.(._._.3.:.<.[.}.4.5.r r ",
+". n o p q s t u +.v w C C D E E |.F G M M N T O Q R U #.V X Y Y Z $.$.1.%.*.-.-.'.;.>.!.2.~.{.].^././.(._._.3.:.<.[.}.4.5.6.r r ",
+". o p q s t u +.v w C C D E E |.F G M M N T O Q R U #.V X Y Y Z $.$.1.%.*.-.-.'.;.>.!.2.~.{.].^././.(._._.3.:.<.[.}.4.5.6.7.r r ",
+". p q s t u +.v w C C D E E |.F G M M N T O Q R U #.V X Y Y Z $.$.1.%.*.-.-.'.;.>.!.2.~.{.].^././.(._._.3.:.<.[.}.4.5.6.7.8.r r ",
+". q s t u +.v w C C D E E |.F G M M N T O Q R U #.V X Y Y Z $.$.1.%.*.-.-.'.;.>.!.2.~.{.].^././.(._._.3.:.<.[.}.4.5.6.7.8.9.r r ",
+". r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r ",
+"0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0."};
diff --git a/pixmaps/defaultIconsBg2.xpm b/pixmaps/defaultIconsBg2.xpm
new file mode 100644
index 0000000..bb9768b
--- /dev/null
+++ b/pixmaps/defaultIconsBg2.xpm
@@ -0,0 +1,195 @@
+/* XPM */
+static char * defaultIconsBg_xpm[] = {
+"64 64 128 2",
+"  	c None",
+". 	c #000104",
+"+ 	c #383847",
+"@ 	c #636775",
+"# 	c #888C9B",
+"$ 	c #ADB1C0",
+"% 	c #DBE0E3",
+"& 	c #9B9FAE",
+"* 	c #757A88",
+"= 	c #C3C7D6",
+"- 	c #1D1E25",
+"; 	c #EFEEF3",
+"> 	c #4E525F",
+", 	c #9296A5",
+"' 	c #A3A7B7",
+") 	c #B8BCCC",
+"! 	c #818594",
+"~ 	c #17181E",
+"{ 	c #A6A6A9",
+"] 	c #6E7381",
+"^ 	c #AA9CA9",
+"/ 	c #979599",
+"( 	c #A09DAE",
+"_ 	c #8A8B94",
+": 	c #5B5D72",
+"< 	c #ADADB0",
+"[ 	c #94949E",
+"} 	c #FDFFFC",
+"| 	c #A8A9B3",
+"1 	c #82838C",
+"2 	c #B4B4B7",
+"3 	c #B1B2BC",
+"4 	c #D1D1DB",
+"5 	c #9BA3AB",
+"6 	c #7A7A83",
+"7 	c #46485C",
+"8 	c #6A6972",
+"9 	c #5E5F68",
+"0 	c #9D92A4",
+"a 	c #9794A5",
+"b 	c #8D869D",
+"c 	c #8A8AA0",
+"d 	c #7A7A90",
+"e 	c #CEC9C7",
+"f 	c #757377",
+"g 	c #C0B9C6",
+"h 	c #CCC9CE",
+"i 	c #71727B",
+"j 	c #ABA8B9",
+"k 	c #E3E7E9",
+"l 	c #29282E",
+"m 	c #47474F",
+"n 	c #8A829A",
+"o 	c #6B647A",
+"p 	c #000100",
+"q 	c #84849A",
+"r 	c #B6B0BB",
+"s 	c #B0A9B4",
+"t 	c #8F8994",
+"u 	c #A7A0AB",
+"v 	c #BFBEC2",
+"w 	c #67677C",
+"x 	c #999AA3",
+"y 	c #707085",
+"z 	c #5B5F6C",
+"A 	c #514F5F",
+"B 	c #B4B1C2",
+"C 	c #A6A3B4",
+"D 	c #D3D2D0",
+"E 	c #22232B",
+"F 	c #CDC6D2",
+"G 	c #A1A5B4",
+"H 	c #8D8A9A",
+"I 	c #90919B",
+"J 	c #9F9FA9",
+"K 	c #C0C1CB",
+"L 	c #858292",
+"M 	c #9A9AB0",
+"N 	c #D3D1D6",
+"O 	c #7B7F8D",
+"P 	c #7B7888",
+"Q 	c #676474",
+"R 	c #CACBD5",
+"S 	c #A3A4AD",
+"T 	c #89828D",
+"U 	c #5F5C6C",
+"V 	c #4E5255",
+"W 	c #AFABBD",
+"X 	c #99929D",
+"Y 	c #F1F3F0",
+"Z 	c #928F9F",
+"` 	c #B8B5C6",
+" .	c #807D8D",
+"..	c #BDB6C2",
+"+.	c #C6C6D0",
+"@.	c #1D1D20",
+"#.	c #979BAA",
+"$.	c #E6E4E8",
+"%.	c #464855",
+"&.	c #8D91A0",
+"*.	c #726E7E",
+"=.	c #B7B8C1",
+"-.	c #676C7A",
+";.	c #DDD7E3",
+">.	c #AAAEBD",
+",.	c #ACADB7",
+"'.	c #3F3F4C",
+").	c #242326",
+"!.	c #9E98A3",
+"~.	c #655E74",
+"{.	c #585564",
+"].	c #7F7F88",
+"^.	c #DDDCE1",
+"/.	c #958F9A",
+"(.	c #9C99AA",
+"_.	c #655F69",
+":.	c #767383",
+"<.	c #4E5259",
+"[.	c #898696",
+"}.	c #C6BFCB",
+"|.	c #6D6A7A",
+"1.	c #040107",
+"2.	c #78727C",
+"3.	c #BBBCC6",
+"4.	c #D4CDD9",
+"5.	c #ECE9EE",
+"6.	c #B3B7C6",
+"7.	c #868790",
+"} } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } Y D 2 ",
+"} } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } Y h < ",
+"} } } Y Y Y Y Y Y Y Y Y ; ; ; ; ; Y ; Y ; ; ; ; ; ; ; ; Y 5.5.k Y k 5.5.k k 5.5.5.5.5.$.k $.$.$.$.$.$.$.$.$.$.$.^.^.^.$.$.e / f ",
+"} } Y k % ^.^.% % % $.^.^.$.^.^.^.N % N N N N N 4 4 N N h N N h h h h N N h h h h +.K +.v K }.` ` ` ........r r r s s G S 1 m @.",
+"} } Y % N 4 N N ^.N N N 4 4.4.4.4.h R h F R +.+.+.) K +.v }.}.3.3.3.6.6.3.v 2 3 3 3 3 B | ' j j j j u u u ^ ^ 0 0 c 0 c ! 9 @.p ",
+"} } ; % R N 4 4 D 4 4 N h N 4 4 R 4.h F F }.+.+.= +.3.3.3.=.v g r ` B B =.3 ..r r B ,.,.,.' C ^ u S S S S G G & a Z # ! ! z E p ",
+"} } Y % R N N R 4 4 4 N h N h 4.R 4.R R F R v h v h v g g ..v g ..` ` B ` ` ..r 3 r 3 < < C C C u { { 5 { { J J x a Z c ! z l p ",
+"} } ; ;.= +.R 4 4 4 N R R +.R R F +.F F = K K v }.}.` g v =.` ..` ` B ` ` ` 3 3 r $ ,.,.| | j G | S 5 { 5 5 5 5 a I &.# ! Q E p ",
+"} } ; ;.4 R +.= 4 R N N R = +.h R = = }.F v K K K K 3.=.=.=.` B B ` ..` ` B B >.W W W r s s W S S S & & S S J x a X I # 1 9 ).p ",
+"} } Y ;.F R R 4.4.4.R R R F = R F F }.= K K v v 3.) K ` ` ` B B B B B ..B W W s ,.>.' | | ' u C S u ( ( & J x #.[ &.H H ! 8 l p ",
+"} } Y % +.R R R 4 N h 4.+.F = = = = K K ) K 3.3.v 3.3.3.` ` ` W B ..r r B B $ $ W W W s < | { G 5 S u 0 & & x x I &.Z [.].9 ).p ",
+"} } ; 4 R R R R N h R +.= = F = +.+.K ) K ) v v v v v 6.6.B B W r s W B W r B W W W j W j u ( J S J ( ( M & & &.&.Z # [.q z l p ",
+"} } Y N +.+.R R R R R F F = F = +.h v 3.3.6.=.=.6.6.r r B B ..W W W W r W j j ' j j S S | S J & & #.#.!.( , x I _ H # !  .z E p ",
+"} } ; ;.F +.v K R = F = = }.K K 3.3.K v v 3.) 6.=.=.6.B r W W W W W j W W W j C u u u u J S ( ( M (.!.x x !.a Z Z H L L d : E p ",
+"} } Y N +.+.h R R = +.+.K v v h v v g =.=...` ` ` B B W r r W W j j j ' j s C C u S { S J J x x #.#.#.x x !.!.X _ H ! 1 P U E p ",
+"} } ; 4 +.K +.v 4.R +.h v F K 3.v =.=.g ..r B B 6.=.$ r W W s j G j C ' s | s S 5 { 5 5 J J !.( !.!.!.!.!.x [ I _ _ 1  .* <.).p ",
+"} } Y 4 R K +.+.R R +.+.K }.v K v v 3.g ` ` W B ` ..B r j W j j S C | ' | S < { | | { 5 5 & !.x x x x #.#.#.x / 7.7.1 T P z ).p ",
+"} } 5.^.F }.= +.F +.+.+.K +.) 3.3.g g ` ` ` B ` B >.r W W j ' s ' | j C C j G { { { 5 G J S / !.#., , a a a &.# _ 7.].].6 _.E p ",
+"} } 5.N +.}.3.K F +.K K ) }.g ..=.=.=.` W ` W W B W W s W W j j G S | G & C s { S S 5 #.& & J x x &.&.a , &.&._ _ # O ].6 9 ).p ",
+"} } Y 4.}.v K +.= }.}.}.3.3.3.=.) =.6.` ` W ` $ W W j j ' j ' | s s S s | S & & 5 5 x J x , , , , , , &.Z a t # 1 1 1  .] <.E p ",
+"} } Y N K 3.3.v +.+.3.g g g g ..` ` W B B W B r W W j j ' ' G S { { S { S 5 5 & x J / J !.X Z a , [ [ [ /.Z H # ! L O d d > E p ",
+"} } 5.h g v v 3.}.g v v 3.=.=.=.` B $ B W 3 s W s j j G S j u S S S { S S { S x & x 5 x x , a &.a a I I &.Z t t 1 O  .* ] > - p ",
+"} } 5.R 6.=.}.3.v g 3.v g g ` =.6.B W r s B s ' s C C C u S S S S & S S & & J 5 x !.[ , , [ &.I H 0 H t [ Z H t T T P :.y > E p ",
+"} } ; = ) ` v ....=.v =.=.` ..` ` B r W W s ,.s S ' j ^ C G S J J 5 J J ( ( J / x , (.a , &.I # # c H &.Z Z t L T P 2.:.i <. at .p ",
+"} } 5.+.=...v g g 6.3.3.=.B B $ B >.>.W W s < | | C ' C ^ ^ & J & & & 5 J & & 5 !.X x , , &.I t _ t H # # Z [.O ]. .2.*.-.> - p ",
+"} } Y h =.=...=.=...3.=.` B ` ` $ W j W W W j s | | C C C ( ^ & & & & ( & J x x x , a Z Z &.# # _ _ # H c # # ! O 2.P ] 8 <. at .. ",
+"} } k }...=.g ` ....g g ` B B B W W W j s | ' s G G G G S S u u #.#.#.(.(.( !.x x , (., a &.&.# H [.c c c c [.q d P * ] @ > - p ",
+"} } 5.h 3 =.=.3.3.3.v =.g ` ` ` $ $ >.,.' s s G j ' G S | S & & & & (.M M #.(., x X , , , &.# # H b b n c H c L q d y y w > - p ",
+"} } k h ..=.g =.g g g 3.` ` B B W >.>.,.| | s u C G ' S S S J 5 #.& #.#.(.#.!.!.#.X a [ x &.# # t H H [.q [.c  . .P *.:.w > - p ",
+"} } Y h =.` =...v =.3.....r B W $ ,.< < | s C ' C C S 5 S J & ( & x { J ( M (., X [ [ [ Z I Z H # t [.q [.H 1 ! d  .y y -.%. at .. ",
+"} } 5.F =.$ 6.6.=.=.6.$ B W $ $ ,.,.,.,.| | j ' ^ C u & & J !.( & & / x x M (., X X [ [ /.H c H _ _ _ ! ! [.O 1 d * ] |.-.> - . ",
+"} } $.+.r =.=.=.g ` B ` B $ W ,.,.,.< < ' ' G C ' C & G u ( M ( (.!.#.x (.(.(., , I / I Z Z H H ! ! L 7.7.! L d * P i ] Q A @.p ",
+"} } $.F r 3 3 =...` W ) W 6.3 < < < ,.| s C G M C C ( & ( ( (.(.a !.a (.X X !.[ [ Z /._ /.Z c H _ ! [.! # # ! d y *.i ] w A - p ",
+"} } 5.) W ,.3 3 6.` $ $ $ W W >.,.,.| s G u C C ' M & M ( & !.!.!.a (.X , , , , [ [ _ Z H # ! # L T ! ! 1 O O  .P :.2.8 -.%.- p ",
+"} } $.K s ,.$ B 6.6.,.,.W W j | ' s S S S u u ^ C ( & #.(.(.x , x [ , , , a [ [ &.Z b c c # q ! 7.T 1 ! 1 T  .P P *.2._.@ m @.. ",
+"} } $.}.W j W W W W 3 ,.,.W s j S G G C u u ( & & J ( (.!.x , !.a , , x a [ [ I /.b H H H [.1 1 T ].T ].1 1 ].2.2.2.8 8 _.m - . ",
+"} } k 3.s j >.B $ W r W s W s j C C u G & ( ( !.( (.(.#.x !., , X [ Z [ I [ &.H &.Z c [.! ! ! O 1 O ].O O L  .2.2.2.8 8 8 m @.. ",
+"} } $.}.j j W >.>.>.j s | | | | u u ( ( ( J 5 M #.#.x x (., , [ , [ [ / [ [ I I H c H H t 7.1 ]. .O O  . .O 6 * -.-.|.@ z m - . ",
+"} } k v | C W W s >.>.W | s S ' C u ^ u (.(.& #.(.(.(.[ !.a a &., [ X [ /./.Z H H t t [.[.T ! ]. . .O O P d P 2.2.8 8 Q U m @.. ",
+"} } k 3.{ j W W $ W | | | | >.G G ( !.(.(.M M (.x x [ x a 0 a X /.[ &.I Z H H H # # ! t t 7.1 O O O O O O O P d ] ] Q 8 z '.- . ",
+"} } k 3.S C s W ,.W s s ' | | S | C ( ( (.( M M x x , [ [ a , [ I / /.I X Z Z H t t # [.[.T 7.T  . .O O P d * y y -.@ Q z m @.. ",
+"} } $.3.j j ' j W W W W s u ' ' C C C ( ( #.( J & x !.x #.a a [ / [ I X [ X &.Z # Z H t t 7.1 O O O  . .O O d * ] ] 8 8 9 %.- . ",
+"} } $.` j s < s W W j W >.| ' C C C C J u J & ( J x x / J !.[ x / X /./.I X I Z H H H # _ 7.1 1 O O O  .O ].O * *.*.8 8 _.m @.. ",
+"} } $.}.u S ' ' ,.W s j j C C S C ^ ( ( & & & x #.x J !.x , a Z I / [ X X t t _ # t # _ # 7.1  .O  . .O 6 * * P ] -.-.Q z m - . ",
+"} } k ) >.s ,.s ,.$ ,.s | | C C C ^ u u u ( & J J x x !.a a &.X I I I I Z Z H _ _ t t t t 7.1 T * O d O ].6 6 P y |.@ Q : m ~ . ",
+"} } $.K j | | >.W W s { s C j C C C ^ ( #.#.& #.#.(.& , x , a &.I / [ I [ I &.t ! ! 7._ ! T 1 ].O * O d * 6 * ] ] -.Q @ U '. at .p ",
+"} } $.` ^ s s | W W r s s u s G S G u 0 ( M M (.x x x a a , [ X /.I /.[ [ /.# H H [.[.t # T 1 T O O O d d O 6 i i ] w @ ~.%.- 1.",
+"} } $.` ' j | W ' ' j S s j G G G ( ^ & (.a (.!.x X !.[ , [ , &.Z /.&.&./.I Z # H H [.L T L L ].T T P * O * O ] ] -.-.Q _.'. at .. ",
+"} } $.` ( s < | s | s G G C ( ( u M 0 u x x , a x [ [ [ &.I /.Z H H H H H H Z _ T t [.T 1 T P P * 6 * P d d * ] -.|.@ z _.'. at .1.",
+"} } k =.S G ' j G G G j C M G & & ( ( , #.[ a a [ /.X /.X # # H c 0 H c b H [.7.# L T ! ].P  . .2.6 2.] * * * *.2.-.|.Q <.'. at .. ",
+"} } k 3 ( S | ' u ' S G G ( ( M #.M M (.a a a Z [ I I _ X Z # H c H _ t b c b 1 ! ! 1 T T P P P * * ] ] ] ] i *.8 _.8 _._.'. at .. ",
+"} } $.=.& M M j G ' ' G C & ( (.( #.( a , a &.a Z [ _ Z # # H c # H _ # H b q q ! 1 1 O  . .P ] ] ] :.:.:.i ] 8 2.8 _.U > '.~ . ",
+"} } $.=.& & ( ' G G C J J J x (.(.a (.a &.a &.&.I [ &._ H c [.q [.[.t ! ! L L  .O  .].O P 2.2.2.] *.y y y i -.@ Q Q _.U A '.~ . ",
+"} } k 6.& M & M M C & #.( x ( !.a (.a a [ [ [ [ &.# _ # 7.T q [.q q ! [.T 1 O d P 6 O P  .P 6 ] y -.Q o Q w |.Q z U : U A + ~ . ",
+"} } k ..& M #.( ( ( M , , [ [ !.0 Z Z Z _ I _ I # # _ ! ! T  . . .d O O O  .].P * 2.* * ] y 2.8 y w w o o -.|.w Q U : {.A + ~ . ",
+"} } % ,.a Z a (.& & (.a X [ Z c # H H [.H ! # [.T T  .L O *  .* P P d P  .6 P ] *.6 i ] ] ] w w Q Q Q w Q Q z U : {.{.{.7 + ~ . ",
+"} } ^.s Z c &., !.[ a &.Z &.H c H ! T L L d q ! d  .P P P 2.6 P 2.2.* ] :.i 2.i i i i |.|.|.o |.Q @ Q Q _._._.U ~.{.> A 7 + ~ . ",
+"} } $.u H H b Z &., c b c [.H L ! 1 !  .q  .d d ].P P d P * 2.2.] ] :.2.] :.i 8 8 |.|.8 8 w w : @ Q : : w @ z {.> {.A > 7 + ~ . ",
+"} } ^.( q q b H H H c [.b L q q q O  .P d O d d * P *.y *.*.*.*.*.-.] *.] |.-.Q @ @ -.-.Q Q o : z z Q ~.U z z U <.{.A A 7 + ~ . ",
+"} } k u L n q n c c b n L q L ! O  .O * O ] * ] P :.:.P *.y |.] -.] |.-.|.-.w @ @ Q U Q @ : : {.z U : : : : z > A > A 7 7 + ~ . ",
+"} } 5.& * P O 1 _ ! L  .O O O O O * 6 ] d ] i ] ] :.*.y |.w |.8 8 @ @ @ @ @ @ : : : : : : : {.A : {.{.{.{.: {.A A 7 7 7 7 + ~ . ",
+"D N < 6 z 9 _.z @ _._._._.z z z z <.z z > A _.V {.{.{.{.<.> > > m <.%.%.> m 7 %.%.7 7 7 7 '.'.'.'.'.'.'.'.'.7 + + + + '.+ E ~ 1.",
+"V V m l l l l ).l l E E E E l ).l ).- E ).- ).).E - ).E ).- - - @. at .@.- - @.- - ~ ~ ~ ~ - - ~ - - ~ @.~ ~ @. at .~ ~ ~ ~ ~ ~ ~ 1.1.",
+"p p p p . . p 1.p . p p p p . . p . p p 1.1.1.p p p . p 1.1.. . . . . p . . . . . . . 1.. . p p 1.1.. p p 1.1.p p p 1.1.1.1.p 1."};
diff --git a/pixmaps/defaultUp.xpm b/pixmaps/defaultUp.xpm
new file mode 100644
index 0000000..0e4f779
--- /dev/null
+++ b/pixmaps/defaultUp.xpm
@@ -0,0 +1,53 @@
+/* XPM */
+static char * defaultUp_xpm[] = {
+"48 48 2 1",
+" 	c None",
+".	c #000000",
+"                                                ",
+"                                          .     ",
+"                                         ...    ",
+"                                        .....   ",
+"                                       .......  ",
+"                                      ......... ",
+"                                     ...........",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                ",
+"                                                "};
diff --git a/types_defs.h b/types_defs.h
new file mode 100644
index 0000000..846dffb
--- /dev/null
+++ b/types_defs.h
@@ -0,0 +1,94 @@
+/* wmDrawer (c) 2002-2004 Valery Febvre <vfebvre at vfebvre.lautre.net>
+ *
+ * wmDrawer is a dock application (dockapp) which provides a
+ * drawer (button bar) to launch applications from.
+ *
+ * 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+#include "utils.h"
+
+#define PACKAGE "wmdrawer"
+#define VERSION "0.10.5"
+#define RELEASE_DATE "2004-06-14"
+
+#define MAX_ICON_SIZE 128
+#define MIN_ICON_SIZE 12
+
+#define DBG_LEVEL 0
+
+enum dir {
+  topToBottom,
+  rightToLeft,
+  bottomToTop,
+  leftToRight
+};
+
+typedef struct ShadingInfo {
+  XColor tintColor;
+  int shading;
+} ShadingInfo;
+
+typedef struct _drawingArea {
+  Window win;
+  Pixmap pixmap;
+  GC     gc;
+  XGCValues xgcv;
+  XSetWindowAttributes xswa;
+} drawingArea;
+
+typedef struct _drawerButton {
+  drawingArea da;
+  unsigned int isEmpty;
+  char *tooltip;
+  char *image;
+  char *command;
+} drawerButton;
+
+typedef struct _drawerConfig {
+  char *dockIcon;
+  char *iconsBg;
+  int  iconsExpand;
+  int  transparency;
+  int  dockW;
+  int  dockH;
+  int  btnsSize;
+  int  direction;
+  int  animationSpeed;
+  int  cursor;
+  int  borderSize;
+  int  showOnHover;
+  int  hideOnOut;
+  int  hideTimeout;
+  int  windowedMode;
+  int  windowedModeLocked;
+  char *instanceName;
+  int  highlight;
+  char *highlightImg;
+  ShadingInfo highlightShading;
+  int tooltips;
+  char *tooltipsFont;
+  time_t lastModif;  
+  char **imagesPaths;
+  drawerButton **entries;
+} drawerConfig;
diff --git a/utils.c b/utils.c
new file mode 100644
index 0000000..6fc929b
--- /dev/null
+++ b/utils.c
@@ -0,0 +1,75 @@
+/* wmDrawer (c) 2002-2004 Valery Febvre <vfebvre at vfebvre.lautre.net>
+ *
+ * wmDrawer is a dock application (dockapp) which provides a
+ * drawer (button bar) to launch applications from.
+ *
+ * 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.
+ */
+
+#include <assert.h>
+#include <sys/types.h>
+#include <regex.h>
+
+#include "types_defs.h"
+#include "utils.h"
+
+void dbg_msg (int level, const char *format, ...) {
+  if (level <= DBG_LEVEL) {
+    va_list va;
+    
+    assert (format != NULL);
+    va_start (va, format);
+    vprintf (format, va);
+    va_end (va);
+  }
+}
+
+void *xcalloc (size_t nmemb, size_t size) {
+  register void *value = calloc (nmemb, size);
+
+  if (value == 0) {
+    printf ("%s error: virtual memory exhausted\n", PACKAGE);
+  }
+  return value;
+}
+
+void *xrealloc (void *ptr, size_t size) {
+  register void *value = realloc (ptr, size);
+
+  if (value == 0) {
+    printf ("%s error: virtual memory exhausted\n", PACKAGE);
+  }
+  return value;
+}
+
+int match_regex (char *string, const char *regex) {
+  regex_t preg;
+  int res;
+  
+  /* compile regex */
+  res = regcomp (&preg, regex, REG_EXTENDED | REG_NOSUB);
+  if (res != 0) {
+    printf ("%s error: could not compile regex\n", PACKAGE);
+    exit (EXIT_FAILURE);
+  }
+  /* execute regex */
+  res = regexec (&preg, string, 0, NULL, 0);
+  /* free compiled regex */
+  regfree (&preg);
+  if (res == 0) {
+    return 1;
+  }
+  else return 0;
+}
diff --git a/utils.h b/utils.h
new file mode 100644
index 0000000..79ceb3d
--- /dev/null
+++ b/utils.h
@@ -0,0 +1,26 @@
+/* wmDrawer (c) 2002-2004 Valery Febvre <vfebvre at vfebvre.lautre.net>
+ *
+ * wmDrawer is a dock application (dockapp) which provides a
+ * drawer (button bar) to launch applications from.
+ *
+ * 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.
+ */
+
+#define MAX (a,b) ((a) > (b) ? (a) : (b))
+
+void dbg_msg (int level, const char *format, ...);
+void *xcalloc (size_t nmemb, size_t size);
+void *xrealloc (void *ptr, size_t size);
+int match_regex (char *string, const char *regex);
diff --git a/wmdrawer-gentoo.ebuild b/wmdrawer-gentoo.ebuild
new file mode 100644
index 0000000..cda8eb1
--- /dev/null
+++ b/wmdrawer-gentoo.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+
+IUSE=""
+S=${WORKDIR}/${P}
+
+DESCRIPTION="wmDrawer is a dock application (dockapp) which provides a drawer (retractable button bar) to launch applications"
+SRC_URI="http://people.easter-eggs.org/~valos/wmdrawer/${P}.tar.gz"
+HOMEPAGE="http://people.easter-eggs.org/~valos/wmdrawer/"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~x86"
+
+DEPEND="virtual/x11
+	media-libs/gdk-pixbuf"
+
+src_compile() {
+	emake || die "make failed!"
+}
+
+src_install() {
+	dobin wmdrawer
+	dodoc COPYING INSTALL README TODO AUTHORS ChangeLog wmdrawerrc.example 
+	gzip -cd doc/wmdrawer.1x.gz > wmdrawer.1
+	doman wmdrawer.1
+}
diff --git a/wmdrawer-redhat.spec b/wmdrawer-redhat.spec
new file mode 100644
index 0000000..82e3cf8
--- /dev/null
+++ b/wmdrawer-redhat.spec
@@ -0,0 +1,48 @@
+%define name wmdrawer
+%define version 0.10.5
+%define release 1
+
+Summary: Retractable button bar launcher dockapp
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Source: http://people.easter-eggs.org/~valos/wmdrawer/%{name}-%{version}.tar.gz
+License: GPL
+Group: X11/WindowMaker Applets
+URL: http://people.easter-eggs.org/~valos/wmdrawer/
+#Distribution: 
+BuildRoot: %{_tmppath}/%{name}-buildroot
+Prefix: %{_prefix}
+%description
+wmDrawer is a dock application (dockapp) which provides a drawer
+(retractable button bar) to launch applications.
+
+%prep
+rm -rf $RPM_BUILD_ROOT
+
+%setup
+
+%build
+make
+
+%install
+mkdir -p $RPM_BUILD_ROOT%{prefix}/bin
+mkdir -p $RPM_BUILD_ROOT%{prefix}/man/man1
+install -m 755 wmdrawer $RPM_BUILD_ROOT%{prefix}/bin
+install -m 644 doc/wmdrawer.1x.gz $RPM_BUILD_ROOT%{prefix}/man/man1
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,0755)
+%doc wmdrawerrc.example AUTHORS ChangeLog COPYING INSTALL README TODO
+%{prefix}/bin/*
+%{prefix}/man/man1/*
+
+%changelog
+* Mon Nov 11 2002 Kevin Burtch <kburtch at worldnet.att.net>
+- Created spec file (for RedHat 8.0, should work on others).
+
+* Fri Feb 7 2003 Val�ry Febvre <vfebvre at vfebvre.lautre.net>
+- Rename file CHANGES to Changelog
diff --git a/wmdrawer-slackware.spec b/wmdrawer-slackware.spec
new file mode 100644
index 0000000..5610319
--- /dev/null
+++ b/wmdrawer-slackware.spec
@@ -0,0 +1,11 @@
+wmdrawer: wmdrawer (WindowMaker dockapp)
+wmdrawer:
+wmdrawer: wmdrawer is a dock application (dockapp) which provides a drawer
+wmdrawer: (retractable button bar) to launch applications.
+wmdrawer:
+wmdrawer: wmdrawer requires gdk-pixbuf, gtk+ and glib.
+wmdrawer:
+wmdrawer: wmDrawer is Copyright (C) 2002-2004 by Valery Febvre, FRANCE
+wmdrawer:   <vfebvre at vfebvre.lautre.net>
+wmdrawer: Homepage : http://people.easter-eggs.org/~valos/wmdrawer/
+wmdrawer: Slackware packaging provided by Ed Goforth <e.goforth at computer.org>
diff --git a/wmdrawer.c b/wmdrawer.c
new file mode 100644
index 0000000..95786e8
--- /dev/null
+++ b/wmdrawer.c
@@ -0,0 +1,1018 @@
+/* wmDrawer (c) 2002-2004 Valery Febvre <vfebvre at vfebvre.lautre.net>
+ *
+ * wmDrawer is a dock application (dockapp) which provides a
+ * drawer (button bar) to launch applications from.
+ *
+ * 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.
+ */
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <time.h>
+#include <signal.h>
+
+#if defined SOLARIS
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#endif
+
+#include "types_defs.h"
+
+#include <X11/extensions/shape.h>
+#include <X11/cursorfont.h>
+
+#include "config.h"
+#include "graphics.h"
+#include "images.h"
+
+#include "pixmaps/defaultDockIcon.xpm"
+#include "pixmaps/defaultIconsBg.xpm"
+#include "pixmaps/defaultIcon.xpm"
+#include "pixmaps/defaultHighlightImg.xpm"
+
+static void signalHandler (int signum);
+static void quit (int status);
+static void xfreeAllMemory (void);
+static void buildDock (int argc, char *argv[]);
+static void setDockIcon (void);
+static void getDockPosition (void);
+static void getDrawerPosition (int *x, int *y);
+static void showDrawer (void);
+static void hideDrawer (void);
+static void buildDrawer (void);
+static void buildTooltip (void);
+static void highlightBtn (int col, int row);
+static void highlightBtnShading (int col, int row);
+static void highlightBtnTarget (int col, int row);
+static void unhighlightBtn (Window btnWin);
+static void rebuildApp (void);
+static void execCmd (const char *cmd);
+static void mySleep (unsigned long msec);
+static int  xEnterEventOrTimeout (XEvent *e, unsigned long msec);
+static void convertMCoordIntoBCoord (int mcol, int mrow, int *bcol, int *brow);
+static void eventLoop (void);
+
+Display *display;
+static Window dockWin, dockIconWin;
+static drawingArea drawer, subDrawer, tooltip;
+static XFontStruct *font;
+drawerButton **btns;
+static Cursor cursor;
+static Pixmap highlightImgPix, highlightImgMask;
+
+static unsigned int drawerOpened = 0;
+static unsigned int dpyWidth, dpyHeight;
+static unsigned int dockX, dockY;
+static unsigned int drawerW, drawerH;
+static unsigned int btnDim = 0;
+static int highlightCol, highlightRow;
+
+extern drawerConfig config;
+extern unsigned int nbRows, nbCols, drawerOK;
+extern unsigned int useDefaultIconsBg, useDefaultDockIcon, useDefaultHighlightImg;
+
+int main (int argc, char **argv) {
+  struct sigaction action;
+  
+  parseOptions (argc, argv);
+  parseConfig ();
+  buildDock (argc, argv);
+  setDockIcon ();
+  buildDrawer ();
+  buildTooltip ();
+  action.sa_handler = signalHandler;
+  sigemptyset (&action.sa_mask);
+  action.sa_flags = SA_NOCLDSTOP | SA_NODEFER; 
+  sigaction (SIGTERM, &action, NULL);
+  sigaction (SIGINT,  &action, NULL);
+  sigaction (SIGCHLD, &action, NULL);
+
+  eventLoop ();
+  return 0;
+}
+
+static void signalHandler (int signum) {
+  switch (signum) {
+  case SIGINT:
+  case SIGTERM:
+    quit (EXIT_SUCCESS);
+    break;
+  case SIGCHLD:
+    while (waitpid (-1, NULL, WNOHANG | WUNTRACED) > 0);
+    break;
+  default:
+    quit (EXIT_FAILURE);
+  }
+}
+
+static void quit (int status) {
+  printf ("Bye bye, thx to use %s\n", PACKAGE);
+  xfreeAllMemory ();
+  freeAllMemory ();
+  XCloseDisplay (display);
+  exit (status);
+}
+
+void xfreeAllMemory (void) {
+  unsigned int col, row;
+
+  /* free buttons' pixmap and GC */
+  for (col=0; col<nbCols; col++) {
+    for (row=0; row<nbRows; row++) {
+      XFreeGC (display, btns[col][row].da.gc);
+      if (btns[col][row].da.pixmap != None) {
+	XFreePixmap (display, btns[col][row].da.pixmap);
+      }
+    }
+  }
+  /* free tooltip GC and font */
+  XFreeGC (display, tooltip.gc);
+  XFreeFont (display, font);
+  /* destroy all windows and sub-windows */
+  if (drawerOK == 1) {
+    XDestroyWindow (display, drawer.win);
+    XDestroyWindow (display, tooltip.win);
+  }
+}
+
+static void buildDock (int argc, char *argv[]) {
+  XClassHint *classhint = NULL;
+  XWMHints *wmhints = NULL;
+  XSizeHints *sizehints = NULL;
+  int tmp;
+
+  display = XOpenDisplay ("");
+  if (!display) {
+    printf ("%s error: couldn't open display\n", PACKAGE);
+    exit (EXIT_FAILURE);
+  }
+
+  /* query SHAPE extension */
+  if (!XShapeQueryExtension (display, &tmp, &tmp) && config.transparency > 0) {
+    printf ("%s warning: SHAPE extension not supported\n", PACKAGE);
+    config.transparency = 0;
+  }
+
+  // create dock wins
+  dockWin = XCreateSimpleWindow (display, DefaultRootWindow (display),
+				 0, 0, config.dockW, config.dockH, 0, 0, 0);
+  dockIconWin = XCreateSimpleWindow (display, DefaultRootWindow (display),
+				     0, 0, config.dockW, config.dockH,
+				     0, 0, 0);
+
+  /* set ClassHint */
+  classhint = XAllocClassHint ();
+  if (!classhint) {
+    printf ("%s error: can't allocate memory for class hints!\n", PACKAGE);
+    exit (EXIT_FAILURE);
+  }
+  classhint->res_class = PACKAGE;
+  /* Ed Goforth <e.goforth at computer.org> */
+  /* Get the instanceName from the config file or command-line */
+  /* to set the client instance name (application name) */
+  /* so the window manager can differentiate between multiple instances. */
+  classhint->res_name = config.instanceName;
+  XSetClassHint (display, dockWin, classhint);
+  XSetClassHint (display, dockIconWin, classhint);
+  XFree (classhint);
+
+  // set name and icon name for dock wins
+  XStoreName (display, dockWin, PACKAGE);
+  XStoreName (display, dockIconWin, PACKAGE);
+  XSetIconName (display, dockWin, PACKAGE);
+  XSetIconName (display, dockIconWin, PACKAGE);
+
+  /* set WMHints */
+  wmhints = XAllocWMHints ();
+  if (!wmhints) {
+    printf ("%s error: can't allocate memory for wm hints!\n", PACKAGE);
+    exit (EXIT_FAILURE);
+  }
+  wmhints->flags = IconWindowHint | WindowGroupHint;
+  if (config.windowedMode == 0) {
+    wmhints->flags |= StateHint;
+    wmhints->initial_state = WithdrawnState;
+  }
+  wmhints->window_group = dockWin;
+  wmhints->icon_window = dockIconWin;
+  XSetWMHints (display, dockWin, wmhints);
+  XFree (wmhints);
+
+  /* set SizeHints */
+  sizehints = XAllocSizeHints ();
+  sizehints->flags = USSize;
+  if (config.windowedMode == 0) {
+    sizehints->flags |= USPosition;
+    sizehints->x = sizehints->y = 0;
+  }
+  else {
+    sizehints->flags |= PMinSize | PMaxSize;
+    sizehints->min_width  = sizehints->max_width  = config.dockW;
+    sizehints->min_height = sizehints->max_height = config.dockH;
+  }
+  sizehints->width = config.dockW;
+  sizehints->height = config.dockH;
+  XSetWMNormalHints (display, dockWin, sizehints);
+  XFree (sizehints);
+
+  /* Ed Goforth <e.goforth at computer.org> */
+  /* This allows window managers (such as WindowMaker) to pick up the */
+  /* command-line arguments that were used when the app was launched. */
+  /* This is particularly useful when docking. */
+  XSetCommand (display, dockWin, argv, argc);
+  XSetCommand (display, dockIconWin, argv, argc);
+
+#define INPUT_MASK ButtonPressMask | ButtonReleaseMask | ExposureMask | EnterWindowMask | LeaveWindowMask | StructureNotifyMask | SubstructureNotifyMask
+  XSelectInput (display, dockWin, INPUT_MASK);
+  XSelectInput (display, dockIconWin, INPUT_MASK);
+#undef INPUT_MASK
+}
+
+static void setDockIcon (void) {
+  Pixmap dockIconPix, dockIconMask, icon;
+  int dockIconW, dockIconH;
+  unsigned int dx, dy, res = 0;
+  GC gc;
+  XGCValues xgcv;
+
+  if (useDefaultDockIcon == 0)
+    res = createPixmapFromFile (config.dockIcon, &dockIconPix, &dockIconMask,
+				&dockIconW, &dockIconH, config.dockW, config.dockH,
+				RESIZE_SMALLER);
+  if (useDefaultDockIcon == 1 || res == 0)
+    createPixmapFromData ((const char **)defaultDockIcon_xpm, &dockIconPix,
+			  &dockIconMask, &dockIconW, &dockIconH,
+			  config.dockW, config.dockH, RESIZE_SMALLER);
+
+  dx = (config.dockW - dockIconW) / 2;
+  dy = (config.dockH - dockIconH) / 2;
+
+  XShapeCombineMask (display, dockIconWin,
+		     ShapeBounding, dx, dy, dockIconMask, ShapeSet);
+  XShapeCombineMask (display, dockWin,
+		     ShapeBounding, dx, dy, dockIconMask, ShapeSet);
+
+  icon = XCreatePixmap (display, dockWin, config.dockW, config.dockH,
+			(unsigned int)DefaultDepth (display, 0));
+  xgcv.clip_x_origin = dx;
+  xgcv.clip_y_origin = dy;
+  xgcv.clip_mask = dockIconMask; /* could be omitted */
+  xgcv.graphics_exposures = False;
+  gc = XCreateGC (display, dockWin,
+		  GCClipMask|GCClipXOrigin|GCClipYOrigin|GCGraphicsExposures,
+		  &xgcv);
+  XCopyArea (display, dockIconPix, icon, gc, 0, 0,
+	     dockIconW, dockIconH, dx, dy);
+
+  XSetWindowBackgroundPixmap (display, dockWin, icon);
+  XSetWindowBackgroundPixmap (display, dockIconWin, icon);
+  if (icon != None) XFreePixmap (display, icon);
+  XFreeGC (display, gc);
+
+  if (dockIconPix != None) XFreePixmap (display, dockIconPix);
+  if (dockIconMask != None) XFreePixmap (display, dockIconMask);
+
+  XMapWindow (display, dockWin);
+  XClearWindow (display, dockWin);
+  XClearWindow (display, dockIconWin);
+
+  XFlush (display);
+}
+
+static void getDockPosition (void) {
+  Window win, frame, parent, root, *children;
+  unsigned int nchildren;
+  XWindowAttributes waP, waC;
+
+  dpyWidth =  DisplayWidth  (display, XDefaultScreen (display));
+  dpyHeight = DisplayHeight (display, XDefaultScreen (display));
+
+  if (config.windowedMode == 1) {
+    win = dockWin;
+  }
+  else {
+    win = dockIconWin;
+  }
+  /* get frame win */
+  root = 0;
+  frame = parent = win;
+  while (parent != root) {
+    frame = parent;
+    XQueryTree (display, frame, &root, &parent, &children, &nchildren);
+    dbg_msg (1, "Parent win: 0x%x\n", parent);
+    if (children != None) XFree (children);
+  }
+
+  XGetWindowAttributes (display, frame, &waP);
+  XGetWindowAttributes (display, win, &waC);
+  dockX = waP.x + waC.x;
+  dockY = waP.y + waC.y;
+  dbg_msg (1, "Dock position: %d, %d\n", dockX, dockY);
+}
+
+static void getDrawerPosition (int *x, int *y) {
+  getDockPosition ();
+  switch (config.direction) {
+  case topToBottom:
+    *x = dockX - (int) (drawerW + config.borderSize*2 - config.dockW) / 2;
+    *y = dockY + config.dockH;
+    break;
+  case rightToLeft:
+    *x = dockX - (drawerW + config.borderSize*2);
+    *y = dockY - (int) (drawerH + config.borderSize*2 - config.dockH) / 2;
+    break;
+  case bottomToTop:
+    *x = dockX - (int) (drawerW + config.borderSize*2 - config.dockW) / 2;
+    *y = dockY - (drawerH + config.borderSize*2);
+    break;
+  case leftToRight:
+    *x = dockX + config.dockW;
+    *y = dockY - (int) (drawerH + config.borderSize*2 - config.dockH) / 2;
+    break;
+  }
+  if (*x < 0) *x = 0;
+  if (*x + drawerW + config.borderSize*2 > dpyWidth - 1) {
+    *x = dpyWidth - (drawerW + config.borderSize*2);
+  }
+  if (*y < 0) *y = 0;
+  if (*y + drawerH + config.borderSize*2 > dpyHeight - 1) {
+    *y = dpyHeight - (drawerH + config.borderSize*2);
+  }
+}
+
+static void showDrawer (void) {
+  int x, y;
+  unsigned int dw, dh, inc;
+  
+  if (!drawerOK)
+    return;
+  drawerOpened = 1;
+  highlightCol = highlightRow = -1;
+  getDrawerPosition(&x, &y);
+
+  // if no animation for drawer
+  if (config.animationSpeed == 0) {
+    XMoveResizeWindow (display, drawer.win, x, y, drawerW, drawerH);
+    XMapRaised (display, drawer.win);
+    return;
+  }
+
+  inc = (nbRows * btnDim) / ((5 - config.animationSpeed) * 4);
+  switch (config.direction) {
+  case topToBottom:
+    for (dh = inc; dh < drawerH+inc; dh = dh+inc) {
+      if (dh >= drawerH) {
+	XMoveResizeWindow (display, drawer.win, x, y, drawerW, drawerH);
+      }
+      else {
+	XMoveResizeWindow (display, drawer.win, x, y, drawerW, dh);
+      }
+      XMapRaised (display, drawer.win);
+      XClearWindow (display, subDrawer.win);
+      XSync (display, 0);
+      mySleep (15);
+    }
+    break;
+  case rightToLeft:
+    for (dw = inc; dw < drawerW+inc; dw = dw+inc) {
+      if (dw >= drawerW) {
+	XMoveResizeWindow (display, drawer.win, x, y, drawerW, drawerH);
+      }
+      else {
+	XMoveResizeWindow (display, drawer.win,
+			   dockX - dw - config.borderSize*2, y, dw, drawerH);
+      }
+      XMapRaised (display, drawer.win);
+      XClearWindow (display, subDrawer.win);
+      XSync (display, 0);
+      mySleep (15);
+    }
+    break;
+  case bottomToTop:
+    for (dh = inc; dh < drawerH+inc; dh = dh+inc) {
+      if (dh >= drawerH) {
+	XMoveResizeWindow (display, drawer.win, x, y, drawerW, drawerH);
+      }
+      else {
+	XMoveResizeWindow (display, drawer.win,
+			   x, dockY - dh - config.borderSize*2, drawerW, dh);
+      }
+      XMapRaised (display, drawer.win);
+      XClearWindow (display, subDrawer.win);
+      XSync (display, 0);
+      mySleep (15);
+    }
+    break;
+  case leftToRight:
+    for (dw = inc; dw < drawerW+inc; dw = dw+inc) {
+      if (dw >= drawerW) {
+	XMoveResizeWindow (display, drawer.win, x, y, drawerW, drawerH);
+      }
+      else {
+	XMoveResizeWindow (display, drawer.win, x, y, dw, drawerH);
+      }
+      XMapRaised (display, drawer.win);
+      XClearWindow (display, subDrawer.win);
+      XSync (display, 0);
+      mySleep (15);
+    }
+    break;
+  default:
+    XMapWindow (display, drawer.win);
+  }      
+}
+
+static void hideDrawer (void) {
+  int x, y;
+  unsigned int dw, dh, inc;
+
+  if (!drawerOK)
+    return;
+  drawerOpened = 0;
+  XUnmapWindow (display, tooltip.win);
+
+  // if no animation for drawer
+  if (config.animationSpeed == 0) {
+    XUnmapWindow (display, drawer.win);
+    return;
+  }
+
+  inc = (nbRows * btnDim) / ((5 - config.animationSpeed) * 4);
+  switch (config.direction) {
+  case topToBottom:
+    x = dockX - (int) (drawerW + config.borderSize*2 - config.dockW) / 2;
+    if (x + drawerW + config.borderSize*2 > dpyWidth - 1) {
+      x = dpyWidth - (drawerW + config.borderSize*2);
+    }
+    if (x < 0) x = 0;
+    for (dh = drawerH - inc; dh >= inc; dh=dh-inc) {
+      XMoveResizeWindow (display, drawer.win,
+			 x, dockY + config.dockH, drawerW, dh);
+      XMapRaised (display, drawer.win);
+      XSync (display, 0);
+      mySleep (15);
+   }
+    break;
+  case rightToLeft:
+    y = dockY - (int) (drawerH + config.borderSize*2 - config.dockH) / 2;
+    if (y + drawerH + config.borderSize*2 > dpyHeight - 1) {
+      y = dpyHeight - (drawerH + config.borderSize*2);
+    }
+    if (y < 0) y = 0;
+    for (dw = drawerW - inc; dw >= inc; dw=dw-inc) {
+      XMoveResizeWindow (display, drawer.win,
+			 dockX - dw - config.borderSize*2, y, dw, drawerH);
+      XMapRaised (display, drawer.win);
+      XSync (display, 0);
+      mySleep (15);
+    }
+    break;
+  case bottomToTop:
+    x = dockX - (int) (drawerW + config.borderSize*2 - config.dockW) / 2;
+    if (x + drawerW + config.borderSize*2 > dpyWidth - 1) {
+      x = dpyWidth - (drawerW + config.borderSize*2);
+    }
+    if (x < 0) x = 0;
+    for (dh = drawerH - inc; dh >= inc; dh = dh-inc) {
+      XMoveResizeWindow (display, drawer.win,
+			 x, dockY - dh - config.borderSize*2, drawerW, dh);
+      XMapRaised (display, drawer.win);
+      XSync (display, 0);
+      mySleep (15);
+    }
+    break;
+  case leftToRight:
+    y = dockY - (int) (drawerH + config.borderSize*2 - config.dockH) / 2;
+    if (y + drawerH + config.borderSize*2 > dpyHeight - 1) {
+      y = dpyHeight - (drawerH + config.borderSize*2);
+    }
+    if (y < 0) y = 0;
+    for (dw = drawerW - inc; dw >= inc; dw=dw-inc) {
+      XMoveResizeWindow (display, drawer.win,
+			 dockX + config.dockW, y, dw, drawerH);
+      XMapRaised (display, drawer.win);
+      XSync (display, 0);
+      mySleep (15);
+    }
+    break;
+  }
+  XUnmapWindow (display, drawer.win);
+}
+
+static void buildDrawer (void) {
+  /* XColor cursor_color; */
+  unsigned int res = 0, x, y, xr, yr, row, col;
+  int pixmapW, pixmapH;
+  unsigned long resizeMask;
+
+  Pixmap bgImgPix, bgImgMask;
+  Pixmap iconPix, iconMask;
+
+  if (!drawerOK)
+    return;
+  btns = config.entries;
+
+  resizeMask = RESIZE_SMALLER;
+  if (config.iconsExpand == 1)
+    resizeMask |= RESIZE_GREATER;
+
+  if (config.btnsSize == 0) {
+    btnDim = config.dockW / nbCols;
+    if (btnDim < MIN_ICON_SIZE) btnDim = MIN_ICON_SIZE;
+  }
+  else {
+    btnDim = config.btnsSize;
+  }
+
+  if (config.direction == leftToRight || config.direction == rightToLeft) {
+    drawerW = nbRows * btnDim;
+    drawerH = nbCols * btnDim;
+  }
+  else {
+    drawerW = nbCols * btnDim;
+    drawerH = nbRows * btnDim;
+  }
+  dbg_msg(1, "drawerW = %d, drawerH = %d, btn dim = %d\n",
+	  drawerW, drawerH, btnDim);
+
+  /* create drawer's root window */
+  drawer.win = XCreateSimpleWindow (display, DefaultRootWindow (display),
+				   0, 0, drawerW, drawerH,
+				   config.borderSize, 0, 0);
+  drawer.xswa.event_mask  = EnterWindowMask | LeaveWindowMask;
+  drawer.xswa.override_redirect = True;
+  XChangeWindowAttributes (display, drawer.win,
+			   CWEventMask | CWOverrideRedirect, &(drawer.xswa));
+  if (config.transparency == 1) {
+    XSetWindowBackgroundPixmap (display, drawer.win, ParentRelative);
+  }
+
+  /* create drawer's subwindow */
+  subDrawer.win = XCreateSimpleWindow (display, drawer.win,
+				       0, 0, drawerW, drawerH,
+				       0, 0, 0);
+  subDrawer.xswa.event_mask = ButtonPressMask|ButtonReleaseMask|PointerMotionMask;
+  subDrawer.xswa.override_redirect = False;
+  XChangeWindowAttributes (display, subDrawer.win,
+			   CWEventMask | CWOverrideRedirect, &(subDrawer.xswa));
+  if (config.transparency == 1) {
+    XSetWindowBackgroundPixmap (display, subDrawer.win, ParentRelative);
+  }
+  XMapWindow (display, subDrawer.win);
+
+  /* highlight mask pixmap */
+  if (useDefaultHighlightImg == 0) {
+    res = createPixmapFromFile (config.highlightImg,
+				&highlightImgPix, &highlightImgMask,
+				&pixmapW, &pixmapH, btnDim, btnDim, resizeMask);
+  }
+  if (useDefaultHighlightImg == 1 || res == 0) {
+    createPixmapFromData ((const char **)defaultHighlightImg_xpm,
+			  &highlightImgPix, &highlightImgMask,
+			  &pixmapW, &pixmapH, btnDim, btnDim, resizeMask);
+  }
+
+  /* btn's background pixmap */
+  if (useDefaultIconsBg == 0) {
+    res = createPixmapFromFile (config.iconsBg, &bgImgPix, &bgImgMask,
+				&pixmapW, &pixmapH, btnDim, btnDim, resizeMask);
+  }
+  if (useDefaultIconsBg == 1 || res == 0) {
+    createPixmapFromData ((const char **)defaultIconsBg_xpm,
+			  &bgImgPix, &bgImgMask,
+			  &pixmapW, &pixmapH, btnDim, btnDim, resizeMask);
+  }
+
+  /* Create boutons windows and set bg */
+  for (col=0; col<nbCols; col++) {
+    for (row=0; row<nbRows; row++) {
+      if (config.direction == leftToRight || config.direction == rightToLeft) {
+	x = row * btnDim;
+	y = col * btnDim;
+      }
+      else {
+	x = col * btnDim;
+	y = row * btnDim;
+      }
+      btns[col][row].da.win = XCreateSimpleWindow (display, subDrawer.win,
+						   x, y, btnDim, btnDim,
+						   0, 0, 0);
+      btns[col][row].da.pixmap = XCreatePixmap (display, btns[col][row].da.win,
+						btnDim, btnDim,
+						DefaultDepth (display, 0));
+      btns[col][row].da.gc = XCreateGC (display, btns[col][row].da.pixmap, 0,
+					&(btns[col][row].da.xgcv));
+      if (config.transparency == 0) {
+	XCopyArea (display, bgImgPix, btns[col][row].da.pixmap,
+		   btns[col][row].da.gc,
+		   0, 0, btnDim, btnDim, 0, 0);
+      }
+    }
+  }
+  if (bgImgPix != None) XFreePixmap (display, bgImgPix);
+  if (bgImgMask != None) XFreePixmap (display, bgImgMask);
+
+  /* Draw icons */
+  for (col=0; col<nbCols; col++) {
+    for (row=0; row<nbRows; row++) {
+      if (btns[col][row].isEmpty == 1) continue;
+      res = createPixmapFromFile (btns[col][row].image, &iconPix, &iconMask,
+				  &pixmapW, &pixmapH, btnDim, btnDim,
+				  resizeMask);
+      if (res == 0)
+	createPixmapFromData ((const char **)defaultIcon_xpm,
+			      &iconPix, &iconMask,
+			      &pixmapW, &pixmapH, btnDim, btnDim, resizeMask);
+      xr = (btnDim - pixmapW) / 2;
+      yr = (btnDim - pixmapH) / 2;
+      if (config.transparency == 1) {
+	XShapeCombineMask (display, btns[col][row].da.win, ShapeBounding, xr, yr,
+			   iconMask, ShapeSet);
+      }
+      btns[col][row].da.xgcv.clip_x_origin = xr;
+      btns[col][row].da.xgcv.clip_y_origin = yr;
+      btns[col][row].da.xgcv.clip_mask = iconMask;
+      XChangeGC (display, btns[col][row].da.gc,
+		 GCClipXOrigin | GCClipYOrigin | GCClipMask,
+		 &(btns[col][row].da.xgcv));
+      XCopyArea (display, iconPix, btns[col][row].da.pixmap,
+		 btns[col][row].da.gc, 0, 0, btnDim, btnDim, xr, yr);
+    }
+  }
+  if (iconPix != None) XFreePixmap (display, iconPix);
+  if (iconMask != None) XFreePixmap (display, iconMask);
+  
+  for (col=0; col<nbCols; col++) {
+    for (row=0; row<nbRows; row++) {
+      if (btns[col][row].isEmpty == 1 && config.transparency == 1) continue;
+      btns[col][row].da.xswa.event_mask = 0;
+      btns[col][row].da.xswa.background_pixmap = btns[col][row].da.pixmap;
+      btns[col][row].da.xswa.override_redirect = False;
+      XChangeWindowAttributes (display, btns[col][row].da.win,
+			       CWEventMask | CWBackPixmap | CWOverrideRedirect,
+			       &(btns[col][row].da.xswa));
+      XMapWindow (display, btns[col][row].da.win);
+    }
+  }
+
+  /* Cursor */
+  cursor = XCreateFontCursor (display, config.cursor * 2);
+  /* Red cursor, just for fun ? */
+  /*   cursor_color.red = 65535; */
+  /*   cursor_color.green = 0; */
+  /*   cursor_color.blue = 0; */
+  /*   XRecolorCursor(display, cursor, &cursor_color, */
+  /*     &WhitePixel (display, DefaultScreen (display))); */
+  XDefineCursor (display, drawer.win, cursor);
+  XFreeCursor (display, cursor);
+}
+
+static void buildTooltip (void) {
+  /* load font */
+  if ((font = XLoadQueryFont (display, config.tooltipsFont)) == NULL) {
+    printf("%s warning: cannot open font \"%s\" for tooltips\n",
+	   PACKAGE, config.tooltipsFont);
+    return;
+  }
+  /* build window */
+  tooltip.win = XCreateSimpleWindow (display, RootWindow(display, 0),
+				     0, 0, 1, 1, 1, 0,
+				     WhitePixel (display,
+						 DefaultScreen (display)));
+  tooltip.gc = XCreateGC (display, tooltip.win, 0, &(tooltip.xgcv));
+  XSetFont (display, tooltip.gc, font->fid);
+  XSetForeground (display, tooltip.gc,
+		  BlackPixel (display, DefaultScreen (display)));
+  XSetBackground (display, tooltip.gc,
+		  WhitePixel (display, DefaultScreen (display)));
+  tooltip.xswa.event_mask = 0;
+  tooltip.xswa.override_redirect = True;
+  XChangeWindowAttributes (display, tooltip.win,
+			   CWEventMask | CWOverrideRedirect, &(tooltip.xswa));
+}
+
+static void highlightBtn (int col, int row) {
+  /* if transparency = 1 (pseudo transparency), only highlight shading works */
+  if (config.transparency == 1 && config.highlight == 1) {
+    config.highlight = 2;
+  }
+  switch (config.highlight) {
+  case 1:
+    highlightBtnTarget (col, row);
+    break;
+  case 2:
+    highlightBtnShading (col, row);
+    break;
+  }
+}
+
+static void highlightBtnShading (int col, int row) {
+  XImage *img;
+  ShadingInfo shade;
+
+  img = XGetImage (display, btns[col][row].da.win,
+		   0, 0, btnDim, btnDim, AllPlanes, ZPixmap);
+  shade.shading = config.highlightShading.shading;
+  shade.tintColor.red   = config.highlightShading.tintColor.red * 256;
+  shade.tintColor.green = config.highlightShading.tintColor.green * 256;
+  shade.tintColor.blue  = config.highlightShading.tintColor.blue * 256;
+  ShadeXImage (display, img, &shade);
+  /* gc is OK, nothing to do */
+  XPutImage (display, btns[col][row].da.win,
+	     btns[col][row].da.gc, img, 0, 0, 0, 0, btnDim, btnDim);
+  XDestroyImage (img);
+  if( !XCopyArea (display, btns[col][row].da.win, btns[col][row].da.win,
+		  btns[col][row].da.gc, 0, 0, btnDim, btnDim, 0, 0)) {
+    XFillRectangle ( display, btns[col][row].da.win, btns[col][row].da.gc,
+		     0, 0, btnDim, btnDim);
+  }
+}
+
+static void highlightBtnTarget (int col, int row) {
+  XGCValues xgcv;
+  GC highlightGC;
+
+  xgcv.clip_mask = highlightImgMask;
+  highlightGC = XCreateGC (display, btns[col][row].da.win, GCClipMask, &xgcv);
+  XCopyArea (display, highlightImgPix, btns[col][row].da.win,
+	     highlightGC, 0, 0, btnDim, btnDim, 0, 0);
+  XFreeGC (display, highlightGC);
+}
+
+static void unhighlightBtn (Window btnWin) {
+  //XClearArea (display, btnWin, 0, 0, btnDim, btnDim, False);
+  XClearWindow (display, btnWin);
+}
+
+static void rebuildApp (void) {
+  if (configChanged ()) {
+    if (drawerOpened == 1) hideDrawer ();
+    /* restore mouse cursor */
+    XUndefineCursor (display, drawer.win);
+    xfreeAllMemory ();
+    freeAllMemory ();
+
+    parseConfig ();
+    XResizeWindow(display, dockWin, config.dockW, config.dockH);
+    XResizeWindow(display, dockIconWin, config.dockW, config.dockH);
+    setDockIcon ();
+    buildDrawer ();
+    buildTooltip ();
+  }
+}
+
+void execCmd (const char *cmd) {
+  int cpid;
+  
+  cpid = fork ();
+  if (cpid == -1) {
+    printf ("%s error: can't fork\n", PACKAGE);
+  }
+  else if (cpid == 0) {
+    setsid ();
+    execl ("/bin/sh", "/bin/sh", "-c", cmd, NULL);
+    exit (EXIT_SUCCESS);
+  }
+}
+
+/* msec is miliseconds, msec <= 999 */
+static void mySleep (unsigned long msec) {
+  struct timespec req, rem;
+
+  req.tv_sec = 0;
+  req.tv_nsec = msec * 1000000;
+  
+  while (nanosleep (&req, &rem) != 0) {
+    req = rem;
+  }
+}
+
+static int xEnterEventOrTimeout (XEvent *e, unsigned long msec) {
+  struct timeval timeout;
+  fd_set rset;
+  
+  dbg_msg (1, "Enter xNextEventOrTimeout function\n");
+
+  XSync (display, False);
+  if (XPending (display)) {
+    XNextEvent (display, e);
+    dbg_msg (1, "Event type = %d\n", e->type);
+    if (e->type == EnterNotify) return 1;
+  }
+
+  timeout.tv_sec  = msec / 1000;
+  timeout.tv_usec = (msec % 1000) * 1000;
+  FD_ZERO (&rset);
+  FD_SET (ConnectionNumber (display), &rset);
+  
+  if (select (ConnectionNumber (display)+1, &rset, NULL, NULL, &timeout) > 0) {
+    XNextEvent (display, e);
+    return 1;
+  }
+  return 0;
+}
+
+/* Convert mouse coordinate into button coordinate */
+static void convertMCoordIntoBCoord (int mcol, int mrow, int *bcol, int *brow) {
+  switch (config.direction) {
+  case topToBottom:
+  case bottomToTop:
+    *bcol = (int)((float)mcol / btnDim);
+    *brow = (int)((float)mrow / btnDim);
+    break;
+  case rightToLeft:
+  case leftToRight:
+    *bcol = (int)((float)mrow / btnDim);
+    *brow = (int)((float)mcol / btnDim);
+    break;
+  }
+}
+
+static void eventLoop (void) {
+  XEvent e;
+  int x, y, w ,h;
+  /* coord of btn pressed */
+  int prow = 0, pcol = 0;
+  /* btn's coord during motion */
+  int mrow = 0, mcol = 0; 
+  /* coord when btn released */
+  int rrow = 0, rcol = 0;
+  /* X btn's coord */
+  int xbtn = 0, ybtn = 0;
+  unsigned int delta, btnIsPressed = 0;
+
+  while (True) {
+    XNextEvent (display, &e);
+    rebuildApp ();
+    /* look at X.h & Xlib.h in /usr/X11R6/include/X11/ */
+    switch (e.type) {
+    case Expose:
+      dbg_msg (2, "Expose event: count = %d, win = 0x%x\n",
+	       e.xexpose.count, e.xexpose.window);
+      break;
+    case ReparentNotify :
+    case ConfigureNotify:
+      dbg_msg (1, "ConfigureNotify event\n");
+      if (drawerOpened == 1) {
+	getDrawerPosition (&x, &y);
+	XMoveWindow (display, drawer.win, x, y);
+      }
+      break;
+    case MotionNotify:
+      if (config.highlight == 0 || btnIsPressed == 1 || drawerOpened == 0) break;
+      convertMCoordIntoBCoord(e.xmotion.x, e.xmotion.y, &mcol, &mrow);
+      if (highlightCol == mcol && highlightRow == mrow) break;
+      dbg_msg (1, "Motion event: win=0x%x, subwin=0x%x, (%d, %d) (%d, %d)\n",
+	       e.xmotion.window, e.xmotion.subwindow,
+	       highlightCol, highlightRow, mcol, mrow);
+      if (mcol < 0 || mcol >= nbCols || mrow < 0 || mrow >= nbRows) break;
+      /* Ok, first raise drawer */
+      XRaiseWindow (display, drawer.win);
+      /* tooltips */
+      if (config.tooltips == 1) {
+	if (!btns[mcol][mrow].isEmpty && strlen (btns[mcol][mrow].tooltip) > 0) {
+	  getDrawerPosition (&x, &y);
+	  w = XTextWidth (font, btns[mcol][mrow].tooltip,
+			  strlen(btns[mcol][mrow].tooltip)) + 8;
+	  h = font->max_bounds.ascent + font->max_bounds.descent + 4;
+	  switch (config.direction) {
+	  case rightToLeft:
+	  case leftToRight:
+	    x = x + mrow * btnDim + btnDim / 2;
+	    y = y + mcol * btnDim - h - 4;
+	    break;
+	  case bottomToTop:
+	  case topToBottom:
+	    x = x + mcol * btnDim + btnDim / 2;
+	    y = y + mrow * btnDim - h - 4;
+	    break;
+	  }
+	  if (x < 0) x = 0;
+	  if (x + w + 2 > dpyWidth - 1) x = dpyWidth - (w + 2);
+	  XMoveResizeWindow (display, tooltip.win, x, y, w, h);
+	  XMapRaised (display, tooltip.win);
+	  XClearWindow (display, tooltip.win);
+	  XDrawString (display, tooltip.win, tooltip.gc,
+		       0 + 4, font->max_bounds.ascent + font->max_bounds.descent,
+		       btns[mcol][mrow].tooltip,
+		       strlen(btns[mcol][mrow].tooltip));
+	}
+	else {
+	  XUnmapWindow (display, tooltip.win);
+	}
+      }
+      /* highlight */
+      if (highlightCol >= 0 && highlightRow >= 0) {
+	if (btns[highlightCol][highlightRow].isEmpty == 0) { 
+	  unhighlightBtn (btns[highlightCol][highlightRow].da.win);
+	}
+      }
+      if (btns[mcol][mrow].isEmpty == 0) {
+	  highlightBtn (mcol, mrow);
+	  highlightCol = mcol;
+	  highlightRow = mrow;
+      }
+      else highlightCol = highlightRow = -1;
+      break;
+    case ButtonPress:
+      dbg_msg (1, "Button press event: win = 0x%x, cursor = (%d,%d)\n",
+	       e.xbutton.window, e.xbutton.y, e.xbutton.y);
+      if (drawerOpened == 0) {
+	showDrawer ();
+      }
+      else if (drawerOpened == 1 && e.xbutton.window != subDrawer.win) {
+	hideDrawer ();
+      }
+      else if (drawerOpened == 1 && e.xbutton.window == subDrawer.win) {
+        xbtn = e.xbutton.x / btnDim;
+        ybtn = e.xbutton.y / btnDim;
+	convertMCoordIntoBCoord (e.xbutton.x, e.xbutton.y, &pcol, &prow);
+	delta = 1;
+	if (btns[pcol][prow].isEmpty == 0) {
+	  btnIsPressed = 1;
+	  XMoveWindow (display, btns[pcol][prow].da.win,
+		       xbtn * btnDim + delta, ybtn * btnDim + delta);
+	  XMapRaised (display, btns[pcol][prow].da.win);
+	  XSync (display, 0);
+	}
+      }
+      break;
+    case ButtonRelease:
+      dbg_msg (1, "Button release event: win = 0x%x, cursor = (%d,%d)\n",
+	       e.xbutton.window, e.xbutton.y, e.xbutton.y);
+      btnIsPressed = 0;
+      if (drawerOpened == 1 && e.xbutton.window == subDrawer.win) {
+	convertMCoordIntoBCoord(e.xbutton.x, e.xbutton.y, &rcol, &rrow);
+	if (btns[pcol][prow].isEmpty == 0) {
+	  XMoveWindow (display, btns[pcol][prow].da.win,
+		       xbtn * btnDim, ybtn * btnDim);
+	  XMapRaised (display, btns[pcol][prow].da.win);
+	  XSync (display, False);
+	}
+	if (prow == rrow && pcol == rcol && btns[pcol][prow].isEmpty == 0) {
+	  /* if release coord = press coord => OK exec cmd */
+	  dbg_msg (1, "Command executed : %s (%d, %d)\n",
+		   btns[pcol][prow].command, pcol, prow);
+	  execCmd (btns[pcol][prow].command);
+	  if ((e.xbutton.state & ShiftMask) != 0 || e.xbutton.button != 1) {
+	    /* If Shift is down whilst selecting app keep the drawer open */
+	    /* or mouse button != 1 => nothing */
+	  }
+	  else {
+	    XUnmapWindow (display, tooltip.win);
+	    mySleep (500);
+	    hideDrawer ();
+	  }
+	}
+      }
+      break;
+    case EnterNotify:
+      dbg_msg (1, "Enter window: 0x%x 0x%x, mode=%d, detail=%d\n",
+	       (unsigned int)e.xcrossing.window,
+	       drawer.win, e.xcrossing.mode, e.xcrossing.detail);
+      /* mode != 2 to avoid EnterNotify event emit after ButtonRelease
+	 in windowed mode */
+      if (drawerOpened == 0 && config.showOnHover == 1 && e.xcrossing.mode != 2) {
+	showDrawer ();
+      }
+      break;
+    case LeaveNotify:
+      dbg_msg (1, "Leave window: win=0x%x, mode=%d, detail=%d\n",
+	       (unsigned int)e.xcrossing.window, e.xcrossing.mode,
+	       e.xcrossing.detail);
+      /* if we leave drawer => unhighlight the last button highlighted and
+	 unmap tooltip window */
+      if (config.highlight > 0 && btnIsPressed == 0 && drawerOpened == 1 &&
+	  e.xcrossing.window == drawer.win &&
+	  highlightCol >= 0 && highlightRow >= 0) {
+	XUnmapWindow (display, tooltip.win);
+	unhighlightBtn (btns[highlightCol][highlightRow].da.win);
+	highlightCol = highlightRow = -1;
+      }
+      /* mode = NotifyNormal:0, NotifyGrab:1, NotifyUngrab:2, NotifyWhileGrabbed:3
+	 mode != 1 to avoid LeaveNotify event emit before ButtonPress
+	 in windowed mode */
+      if (drawerOpened == 1 && config.hideOnOut == 1 && e.xcrossing.mode != 1) {
+	if (! xEnterEventOrTimeout (&e, config.hideTimeout)) {
+	  hideDrawer ();
+	}
+      }
+      break;
+    case DestroyNotify:
+      quit (EXIT_SUCCESS);
+    }
+  }
+}
diff --git a/wmdrawerrc.example b/wmdrawerrc.example
new file mode 100644
index 0000000..ce26c2a
--- /dev/null
+++ b/wmdrawerrc.example
@@ -0,0 +1,105 @@
+# Config file example for wmdrawer
+[general]
+# Dock's icon [optional]
+#dock_icon	panel-drawer.png
+
+# Drawer's opening direction [required]
+# Top to bottom = 0
+# Right to Left = 1
+# Bottom to Top = 2
+# Left to Right = 3
+direction	2
+
+# Image used for icons' background [optional]
+#icons_bg	defaultTile.xpm
+
+# Allow icons' enlargement to fit them to buttons' size [optional, default 1]
+# 0 indicate that icons should never be larger than their original size.
+#icons_expand	1
+
+# Activate the drawer's pseudo-transparency [optional, default 0]
+# if you choose transparency, icons_bg will be ignored
+#transparency	0
+
+# dock's width: min=12, max=128 [optional, default=64]
+#dock_width	64
+
+# dock's height: min=12, max=128 [optional, default=64]
+#dock_height	64
+
+# buttons' size: min=12, max=128 [optional]
+# Useful for the people who want for example to have big icons
+# and to define several columns.
+#btns_size	32
+
+# Icon's highlight type: 0, 1 or 2 [optional, default 2]
+# 0 : no highlight
+# 1 : target (unavailable if transparency is activated)
+# 2 : shading
+#highlight	2
+
+# Image used as highlight [optional]
+# only used if you choice target type
+#highlight_img	highlight.xpm
+
+# Tint icons by a specified color [optional, default #ffffff]
+# only used if you choice shading type
+#highlight_tint	#ffffff
+
+# Shade icons at a specified level [optional, default 60]
+# only used if you choice shading type
+#highlight_sh	60
+
+# Display buttons' tooltips [optional, default 1]
+#tooltips	1
+
+# Tooltips' font [optional, default fixed]
+#tooltips_font	fixed
+
+# Drawer's animation speed: 0, 1, 2, 3, 4 [optional, default 1]
+#animation_speed	1
+
+# Mouse cursor in drawer: 0, 1, ..., 76 [optional, default 30]
+#cursor		30
+
+# Auto opening of the drawer: 0, 1 [optional, default 0]
+#show_on_hover	0
+
+# Auto closing of the drawer: 0, 1 [optional, default 0]
+#hide_on_out	0
+
+# drawer's hiding timeout in miliseconds [optional, default 1000]
+#hide_timeout	1000
+
+# Runs the dockapp in windowed mode: 0, 1 [optional, default 0]
+# Useful for AfterStep, Fvwm, Sawfish or KDE users.
+#windowed_mode   0
+
+# Instance name so window manager can distinguish between multiple copies
+#instance_name	distinguish_name
+
+# Drawer's border size in pixels [optional, default 1]
+#border_size	1
+
+# Images directories
+[images_paths]
+/usr/share/pixmaps
+/usr/local/share/pixmaps/
+
+# A first column with 5 buttons
+# Each button must be defined with this syntax:
+# (tooltip)  (image)  (command)
+[column]
+(X Terminal)	(gnome-term.png)	(xterm -bg black -fg wheat)
+(Galeon)	(galeon.xpm)		(galeon -s)
+(Sylpheed)	(sylpheed.png)		(sylpheed)
+(XChat)		(xchat.png)		(xchat)
+(MPlayer)	(gnome-multimedia.png)	(mplayer)
+
+# A second column with 5 buttons
+[column]
+(Xmms)		(gnome-audio2.png)	(xmms)
+(Gimp)		(gnome-gimp.png)	(gimp)
+(GQview)	(gqview.png)		(gqview)
+(Xcalc)		(gnome-calc3.png)	(xcalc)
+(GFtp)		(gftp.png)		(gftp)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmdrawer.git



More information about the Pkg-wmaker-commits mailing list