Anonymous avatar Anonymous committed 03f27cc

fixup commit for tag 'xwem-1_18'

Comments (0)

Files changed (19)

battery/Makefile

-CC=ellcc --mode=compile
-LD=ellcc --mode=link
-MI=ellcc --mode=init
-
-MODNAME=battery
-MODVER=0.1
-MODTITLE="APM battery status support"
-
-.ifndef XEMACS_SRC
-all:
-	@echo "- XEMACS_SRC not specified"
-	@echo "Use '$(MAKE) XEMACS_SRC=/path/to/xemacs/src' to build."
-.else
-all: $(MODNAME).ell
-.endif
-
-CFLAGS=-Wall -I$(XEMACS_SRC)
-
-.PHONY: clean
-clean:
-	rm -f $(MODNAME).ell $(MODNAME).o $(MODNAME)_init.o $(MODNAME)_init.c *~
-
-$(MODNAME).ell: $(MODNAME)_init.o $(MODNAME).o
-	$(LD) --mod-output=$(MODNAME).ell $(MODNAME).o $(MODNAME)_init.o
-
-$(MODNAME).o: $(MODNAME).c
-	$(CC) $(CFLAGS) -c $(MODNAME).c
-
-$(MODNAME)_init.o: $(MODNAME)_init.c
-$(MODNAME)_init.c: $(MODNAME).c
-	$(MI) --mod-name=$(MODNAME) --mod-version=$(MODVER) --mod-title=$(MODTITLE) --mod-output=$(MODNAME)_init.c $(MODNAME).c

battery/battery.c

-#include <emodules.h>
-
-Lisp_Object Qhigh, Qlow, Qcritical, Qcharging;
-
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-
-#include <err.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#ifdef __FreeBSD__
-#include <machine/apm_bios.h>
-
-#define APM_DEVICE "/dev/apm"
-
-int
-apm_int_getinfo(struct apm_info *ainfo)
-{
-        static int apm_fd = -1;
-
-        if (apm_fd == -1)
-                /* Initial open of APM device */
-                if ((apm_fd = open(APM_DEVICE, O_RDONLY)) < 0)
-                        return -1;
-        
-        if (ioctl(apm_fd, APMIO_GETINFO, ainfo) == -1) {
-                close(apm_fd);
-                apm_fd = -1;
-                return -1;
-        }
-        
-        return 0;
-}
-
-#else
-int
-apm_int_getinfo(struct apm_info *ainfo)
-{
-        apm_read(ainfo);
-        return 0;
-}
-#endif  /* __FreeBSD__ */
-
-DEFUN ("apm-battery", Fapm_battery, 0, 0, "FAPM battery percentage: ", /*
-Return current battery status.
-Return list where first element is AC-line status, second is battery
-status, one of `high', `low', `critical' or `charging'.
-*/
-       ())
-{
-        struct apm_info ainfo;
-        Lisp_Object bstat = Qnil;
-
-        if (apm_int_getinfo(&ainfo))
-                return Qnil;
-
-        switch (ainfo.ai_batt_stat) {
-        case 0:
-                bstat = Qhigh;
-                break;
-        case 1:
-                bstat = Qlow;
-                break;
-        case 2:
-                bstat = Qcritical;
-                break;
-        case 3:
-                bstat = Qcharging;
-                break;
-        }
-
-        return Fcons(EQ(bstat, Qcharging) ? Qt : Qnil,
-                     Fcons(bstat, Fcons(make_int(ainfo.ai_batt_life), Qnil)));
-}
-
-void
-syms_of_battery(void)
-{
-        DEFSUBR(Fapm_battery);
-
-        DEFSYMBOL(Qhigh);
-        DEFSYMBOL(Qlow);
-        DEFSYMBOL(Qcritical);
-        DEFSYMBOL(Qcharging);
-}
-
-void
-vars_of_battery(void)
-{
-}

dockapp/xwem-battery.el

-;;; xwem-battery.el --- Dockapp APM battery monitor for XWEM.
-
-;; Copyright (C) 2004 by Free Software Foundation, Inc.
-
-;; Author: Zajcev Evgeny <zevlg@yandex.ru>
-;;         Steve Youngs  <steve@youngs.au.com>
-;; Created: Thu Sep  2 01:14:36 GMT 2004
-;; Keywords: xwem
-;; X-CVS: $Id$
-
-;; This file is part of XWEM.
-
-;; XWEM 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, or (at your option)
-;; any later version.
-
-;; XWEM 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 XEmacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-;; 02111-1307, USA.
-
-;;; Synched up with: Not in FSF
-
-;;; Commentary:
-
-;; APM battery status monitor dockapp for use under XWEM.
-
-;; It looks like:
-
-;;   normal    charching
-;;
-;;    ****        ****  
-;;  ********    *******/
-;;  *      *    *     //
-;;  *      *    *    //*
-;;  *      *    *   // *
-;;  ********    ***//***
-;;  *------*    *-//---*
-;;  *------*    *//----*
-;;  *------*    //-----*
-;;   ******      ****** 
-
-;; To start using it, just add:
-
-;;   (load-module <path-to-apm-battery-ell>)
-;;   (add-hook 'xwem-after-init-hook 'xwem-battery)
-
-;; to your xwemrc.el.
-
-;;; Code:
-
-(eval-when-compile
-  (require 'cl)
-  (autoload 'apm-battery "battery.ell" "Return current battery status."))
-
-(require 'xlib-xlib)
-(require 'xlib-xshape)
-
-(require 'xwem-load)
-
-;;; Customisation
-(defgroup xwem-batt nil
-  "Group to customise APM battery monitor."
-  :prefix "xwem-batt-"
-  :group 'xwem)
-
-(defcustom xwem-batt-update-interval 5
-  "*Apm battery dockapp update interval in seconds."
-  :type 'number
-  :group 'xwem-batt)
-
-(defcustom xwem-batt-height 24
-  "*Height of apm battery dockapp in pixels."
-  :type 'number
-  :group 'xwem-batt)
-
-(defcustom xwem-batt-width 10
-  "*Width of apm battery dockapp in pixels."
-  :type 'number
-  :group 'xwem-batt)
-
-(defcustom xwem-batt-percentage-colors
-  '((20 . "red3")
-    (30 . "red2")
-    (50 . "orange")
-    (60 . "yellow2")
-    (70 . "yellow3")
-    (80 . "green3")
-    (100 . "green2"))
-  "*Table to translate percentage to color."
-  :type '(repeat (cons (number :tag "Percents")
-                       (color :tag "Color")))
-  :group 'xwem-batt)
-
-(defcustom xwem-batt-ac-line-width 4
-  "*Width of ac-line."
-  :type 'number
-  :group 'xwem-batt)
-
-(defcustom xwem-batt-ac-line-color "blue"
-  "*Color used to display ac-line."
-  :type 'color
-  :group 'xwem-batt)
-
-;;; Internal variables
-
-
-(defun xwem-batt-init (xdpy)
-  "On display XDPY create and return APM battery monitor window."
-  (let (mgc tgc xwin xmask)
-    (setq xwin (XCreateWindow xdpy (XDefaultRootWindow xdpy)
-			      0 0 xwem-batt-width xwem-batt-height 0
-			      nil nil nil
-			      (make-X-Attr :backing-store X-WhenMapped
-					   :override-redirect t)))
-
-    ;; Create mask pixmap for xwin
-    (setq xmask (XCreatePixmap xdpy (make-X-Pixmap :dpy xdpy
-						   :id (X-Dpy-get-id xdpy))
-			       xwin 1 xwem-batt-width xwem-batt-height))
-    (setq mgc (XCreateGC xdpy xmask
-			 (make-X-Gc :dpy xdpy :id (X-Dpy-get-id xdpy)
-				    :graphics-exposures X-False
-				    :foreground 0.0
-				    :background 1.0)))
-    (setq tgc (XCreateGC xdpy xmask
-			 (make-X-Gc :dpy xdpy :id (X-Dpy-get-id xdpy)
-				    :graphics-exposures X-False
-				    :foreground 1.0
-				    :background 0.0)))
-
-    ;; XXX Draw mask
-    (XFillRectangle xdpy xmask mgc 0 0 xwem-batt-width xwem-batt-height)
-    (XFillRectangle xdpy xmask tgc 0 2 xwem-batt-width (- xwem-batt-height 3))
-    (XDrawSegments xdpy xmask tgc
-		   (list (cons (cons 3 0) (cons (- xwem-batt-width 4) 0))
-			 (cons (cons 1 1) (cons (- xwem-batt-width 2) 1))
-			 (cons (cons 1 (- xwem-batt-height 1))
-			       (cons (- xwem-batt-width 2) (- xwem-batt-height 1)))))
-
-    (XFreeGC xdpy mgc)
-    (XFreeGC xdpy tgc)
-
-    ;; Set mask
-    (X-XShapeMask xdpy xwin X-XShape-Bounding X-XShapeSet 0 0 xmask)
-    (X-Win-put-prop xwin 'xwem-batt-xmask xmask)
-
-    xwin))
-
-(defface xwem-batt-tmp-face
-  `((t (:foreground "black")))
-  "Temporary face used by apm battery dockapp.")
-
-(defun xwem-batt-win-update (xwin &optional force)
-  "Update contents of XWIN to reflect current APM battery state."
-  ;; TODO: write me
-  (let* ((xdpy (X-Win-dpy xwin))
-	 (as (apm-battery))
-	 (ac-line-p (car as))
-	 (cperc (caddr as))
-	 (perc-cols xwem-batt-percentage-colors)
-         dheight)
-
-    (when (> cperc 100)
-      (setq  cperc 100))
-
-    ;; Calculate displayed height
-    (setq dheight (round (/ (* cperc (- xwem-batt-height 5)) 100.0)))
-
-    (when (or force (not (eq dheight (X-Win-get-prop xwin 'old-dheight)))
-              (not (eq ac-line-p (X-Win-get-prop xwin 'old-ac-line-p))))
-      (XClearArea xdpy xwin 0 0 xwem-batt-width xwem-batt-height nil)
-      ;; Outline battery
-      (XFillRectangle xdpy xwin (XDefaultGC xdpy)
-                      0 0 xwem-batt-width xwem-batt-height)
-      (XDrawRectangle xdpy xwin (xwem-face-get-gc 'xwem-face-black)
-                      1 2 (- xwem-batt-width 3) (- xwem-batt-height 4))
-      (XDrawLine xdpy xwin (xwem-face-get-gc 'xwem-face-black)
-                 3 1 (- xwem-batt-width 4) 1)
-      (setq force t))
-
-    ;; Maybe redraw percentage
-    (when (or force (not (eq dheight (X-Win-get-prop xwin 'old-dheight))))
-      ;; Find appopriate color
-      (while (and perc-cols (> cperc (caar perc-cols)))
-        (setq perc-cols (cdr perc-cols)))
-      (setq perc-cols (cdar perc-cols))
-
-      (xwem-set-face-foreground 'xwem-batt-tmp-face perc-cols)
-      (XFillRectangle xdpy xwin (xwem-face-get-gc 'xwem-batt-tmp-face)
-                      2 (- xwem-batt-height 2 dheight)
-                      (- xwem-batt-width 4) dheight)
-      (when (< dheight (- xwem-batt-height 5))
-        (XDrawLine xdpy xwin (xwem-face-get-gc 'xwem-face-black)
-                   2 (- xwem-batt-height 2 dheight)
-                   (- xwem-batt-width 2) (- xwem-batt-height 2 dheight)))
-
-      ;; Save DHEIGHT
-      (X-Win-put-prop xwin 'old-dheight dheight))
-
-    ;; Maybe redraw ac-line status
-    (when (or force (not (eq ac-line-p (X-Win-get-prop xwin 'old-ac-line-p))))
-      (when ac-line-p
-        (xwem-set-face-foreground 'xwem-batt-tmp-face xwem-batt-ac-line-color)
-        (let ((acgc (xwem-face-get-gc 'xwem-batt-tmp-face)))
-          (setf (X-Gc-line-width acgc) xwem-batt-ac-line-width)
-          (XChangeGC xdpy acgc)
-          (XDrawLine xdpy xwin acgc
-                     xwem-batt-width xwem-batt-ac-line-width
-                     0 (- xwem-batt-height xwem-batt-ac-line-width))
-          (setf (X-Gc-line-width acgc) 0)
-          (XChangeGC xdpy acgc)))
-      (X-Win-put-prop xwin 'old-ac-line-p ac-line-p))
-    ))
-
-(defun xwem-batt-event-handler (xdpy win xev)
-  "Event handler for xwem battery monitor."
-  (X-Event-CASE xev
-    (:X-Expose
-     (xwem-batt-win-update win t))
-    (:X-DestroyNotify
-     (delete-itimer (X-Win-get-prop win 'xwem-batt-timer))
-     (XFreePixmap xdpy (X-Win-get-prop win 'xwem-batt-xmask))
-     (X-Win-rem-prop win 'xwem-batt-timer)
-     (X-Win-rem-prop win 'xwem-batt-xmask)
-
-     (X-Win-rem-prop win 'old-ac-line-p)
-     (X-Win-rem-prop win 'old-dheight))
-    (:X-ButtonPress
-     (multiple-value-bind (ac-line status perc)
-         (values-list (apm-battery))
-       (xwem-message 'info "APM Battery: AC-line: %s, Status: %S, Percentage: %d%%"
-		     (if ac-line "on" "off") status perc)))
-    ))
-
-;;;###autoload
-(defun xwem-battery (&optional dockip dockgroup dockalign)
-  "Start xwem apm battery monitor in system tray."
-  (unless (fboundp 'apm-battery)
-    (error "APM Battery module not loaded"))
-
-  (let ((bxwin (xwem-batt-init (xwem-dpy))))
-    (XSelectInput (xwem-dpy) bxwin
-		  (Xmask-or XM-Exposure XM-StructureNotify
-                            XM-ButtonPress XM-ButtonRelease))
-    (X-Win-EventHandler-add bxwin 'xwem-batt-event-handler nil
-			    (list X-Expose X-DestroyNotify
-                                  X-ButtonPress X-ButtonRelease))
-
-    (xwem-XTrayInit (xwem-dpy) bxwin dockip dockgroup dockalign)
-
-    (X-Win-put-prop bxwin 'xwem-batt-timer
-                    (start-itimer "xwem-batt"
-                                  `(lambda () (xwem-batt-win-update ,bxwin))
-                                  xwem-batt-update-interval xwem-batt-update-interval))
-    'started))
-
-
-;;;; In case there is no battery.ell
-(unless (fboundp 'apm-battery)
-  (defvar apm-program "apm")
-  (defvar apm-state-percent-arguments "-bl")
-  (defvar apm-status-alist
-    '((0 . high) (1 . low) (2 . critical) (3 . charging)))
-
-  (defun apm-battery ()
-    "Return battery status."
-    (let (state percents)
-      (with-temp-buffer
-        (call-process apm-program nil (current-buffer)
-                      nil apm-state-percent-arguments)
-        (goto-char (point-min))
-        (setq state (cdr (assq (string-to-int
-                                (buffer-substring (point-at-bol)
-                                                  (point-at-eol)))
-                               apm-status-alist)))
-        (forward-line)
-        (setq percents (string-to-int
-                        (buffer-substring (point-at-bol)
-                                          (point-at-eol)))))
-      (list (eq state 'charging) state percents))))
-
-
-(provide 'xwem-battery)
-
-;;; xwem-battery.el ends here

dockapp/xwem-framei.el

-;;; xwem-framei.el --- Frame indicator.
-
-;; Copyright (C) 2004 by Free Software Foundation, Inc.
-
-;; Author: Zajcev Evgeny <zevlg@yandex.ru>
-;;         Steve Youngs  <steve@youngs.au.com>
-;; Created: Tue Jan 27 08:01:43 MSK 2004
-;; Keywords: xwem
-;; X-CVS: $Id$
-
-;; This file is part of XWEM.
-
-;; XWEM 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, or (at your option)
-;; any later version.
-
-;; XWEM 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 XEmacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-;; 02111-1307, USA.
-
-;;; Synched up with: Not in FSF
-
-;;; Commentary:
-
-;; When switching frames indicate frame number using xwem-osd.
-;;
-;; Add something like this to your xwemrc.el to start using frame
-;; indicator:
-;;
-;;   (add-hook 'xwem-after-init-hook 'xwem-framei-init)
-;;
-
-;; To use framei dockapp add:
-
-;;   (add-hook 'xwem-after-init-hook 'xwem-framei-dockapp)
-
-;;; Code:
-
-(require 'xwem-load)
-(require 'xwem-frame)
-(require 'xwem-osd)
-
-;;; Customisation
-(defgroup xwem-framei nil
-  "*Group to customize xwem frame indicator."
-  :prefix "xwem-framei-"
-  :group 'xwem-frame)
-
-(defcustom xwem-framei-showtime 1
-  "Period of time in second while xwem framei is shown."
-  :type 'number
-  :group 'xwem-framei)
-
-(defcustom xwem-framei-xoffset 20
-  "*X Offset from top left frame corner in pixels, where to show framei."
-  :type 'number
-  :group 'xwem-framei)
-
-(defcustom xwem-framei-yoffset 20
-  "*Y Offset from top left frame corner in pixels, where to show framei."
-  :type 'number
-  :group 'xwem-framei)
-
-(define-xwem-face xwem-framei-face
-  `(((background dark desktop) (:foreground "magenta" :size 34 :family "helvetica"))
-    ((background desktop light) (:foreground "darkmagenta" :size 34 :family "helvetica"))
-    ((background dark embedded-desktop) (:foreground "magenta" :size 24 :family "helvetica"))
-    ((background embedded-desktop light) (:foreground "darkmagenta" :size 24 :family "helvetica"))
-    ((background dark dedicated) (:foreground "magenta" :size 20 :family "fixed"))
-    ((background dedicated light) (:foreground "darkmagenta" :size 20 :family "fixed"))
-    (t (:foreground "green2" :size 24 :family "helvetica")))
-  "*Face used to draw frame number."
-  :group 'xwem-framei)
-
-(defcustom xwem-framei-select-face-function 'xwem-framei-default-sff
-  "*Function called with one arg - frame and should return face, which
-will be used.  Function can look like this:
-
-(cond ((string= \"Devel\" (xwem-frame-name frame))
-       (get-face 'my-xwem-fi-devel-face))
-      ((string= \"Inet\" (xwem-frame-name frame))
-       (get-face 'my-xwem-fi-inet-face))
-      )
-
-To use different faces for different frames."
-  :type 'function
-  :group 'xwem-framei)
-
-(defcustom xwem-framei-format-function 'xwem-framei-default-format
-  "Function passed with one arg - frame, should return string to display."
-  :type 'funtion
-  :group 'xwem-framei)
-
-(define-xwem-face xwem-framei-dockapp-face
-  `(((desktop) (:foreground "magenta4" :bold t))
-    ((embedded-desktop) (:foreground "magenta4"))
-    ((dedicated) (:foreground "yellowgreen"))
-    (t (:foreground "magenta4" :bold t)))
-  "Face used to draw in framei dockapp."
-  :group 'xwem-faces)
-
-(defcustom xwem-framei-dockapp-format-function 'xwem-framei-dockapp-default-format
-  "Function passed with one arg - frame, should return string to display."
-  :type 'funtion
-  :group 'xwem-framei)
-
-;;; Internal variables
-
-(defun xwem-framei-default-format (frame)
-  "Default function used in `xwem-framei-format-function'.
-Return string in form \"NUM: NAME\""
-  (case (xwem-frame-type frame)
-    (dedicated
-     (if (xwem-frame-cl frame)
-         (format "%s" (xwem-client-name (xwem-frame-cl frame)))
-       "Unknown"))
-    (t
-     (format "[%d] %s" (xwem-frame-num frame) (xwem-frame-name frame)))))
-
-
-;;; Internal variables
-(defvar xwem-framei-osd nil
-  "OSD for frame indicator.")
-
-(defvar xwem-framei-itimer nil
-  "itimer for frame indicator.")
-
-(defun xwem-framei-hidder ()
-  (xwem-osd-hide xwem-framei-osd)
-  (setq xwem-framei-itimer nil)
-  )
-
-
-(defun xwem-framei-default-sff (frame)
-  "Default `xwem-framei-select-face-function'."
-  'xwem-framei-face)
-
-;;; Functions
-(defun xwem-framei-show-osd ()
-  "Show OSD for frame selected frame."
-  (let* ((frgeom (xwem-frame-xgeom (xwem-frame-selected)))
-         (fface (or (funcall xwem-framei-select-face-function
-                            (xwem-frame-selected))
-                    'xwem-framei-face))
-         (x (+ xwem-framei-xoffset (X-Geom-x frgeom)))
-         (y (+ xwem-framei-yoffset (X-Geom-y frgeom)))
-         (text (funcall xwem-framei-format-function
-                        (xwem-frame-selected)))
-         (bgmode (xwem-misc-xwin-background-mode (xwem-rootwin) x y))
-         (ftype (xwem-frame-type (xwem-frame-selected))))
-
-    (xwem-osd-move xwem-framei-osd x y)
-
-    ;; Change
-    (xwem-osd-set-color
-     xwem-framei-osd (xwem-face-foreground fface (list 'background bgmode ftype)))
-    (xwem-osd-set-font
-     xwem-framei-osd (xwem-face-font fface (list 'background bgmode ftype)))
-
-    (xwem-osd-text xwem-framei-osd text)
-    (xwem-osd-show xwem-framei-osd)
-
-    (when (itimerp xwem-framei-itimer)
-      (delete-itimer xwem-framei-itimer)
-      (setq xwem-framei-itimer nil))
-    (setq xwem-framei-itimer
-          (start-itimer "xwem-framei-timer"
-                        'xwem-framei-hidder xwem-framei-showtime))
-    ))
-
-(defun xwem-framei-on-select ()
-  "Handle frame switching."
-  (xwem-add-hook-post-deffering 'xwem-framei-show-osd))
-
-(defun xwem-framei-on-change (frame)
-  "Handle FRAME change.
-To be used in `xwem-frame-change-hook'."
-  (when (and (xwem-frame-selected-p frame)
-             (eq (xwem-osd-state xwem-framei-osd) 'shown))
-    ;; Update only if framei osd is shown on screen
-    (xwem-framei-on-select)))
-
-;;;###autoload
-(defun xwem-framei-init (&optional xdpy)
-  "Initialize xwem frame indicator on display XDPY."
-  (unless xdpy
-    (setq xdpy (xwem-dpy)))
-
-  (let ((xwem-osd-always-ontop nil)
-        (rgeom (XGetGeometry xdpy (XDefaultRootWindow xdpy))))
-    (setq xwem-framei-osd
-          (xwem-osd-create xdpy 0 0
-                           (X-Geom-width rgeom)
-                           (X-Geom-height rgeom))))
-
-  (add-hook 'xwem-frame-select-hook 'xwem-framei-on-select)
-  (add-hook 'xwem-frame-change-hook 'xwem-framei-on-change))
-
-(defun xwem-framei-stop ()
-  "Stop xwem-framei."
-  (remove-hook 'xwem-frame-select-hook 'xwem-framei-on-select)
-  (remove-hook 'xwem-frame-change-hook 'xwem-framei-on-change)
-  (when xwem-framei-itimer
-    (delete-itimer xwem-framei-itimer))
-
-  (when (xwem-osd-p xwem-framei-osd)
-    (xwem-osd-destroy xwem-framei-osd)))
-
-;;;; Frame indicator dockapp
-(defvar xwem-framei-dockapp-keymap
-  (let ((map (make-sparse-keymap)))
-    (set-keymap-default-binding map 'ignore)
-    (define-key map [button1] 'xwem-framei-dockapp-popup-menu)
-    (define-key map [button3] 'xwem-framei-dockapp-popup-alt-menu)
-    map)
-  "Keymap used for framei osd.")
-
-(defun xwem-framei-dockapp-default-format (frame)
-  "Default function used in `xwem-framei-dockapp-format-function'.
-Return string in form \"NUM: NAME\""
-  (case (xwem-frame-type frame)
-    (dedicated
-     (if (xwem-frame-cl frame)
-         (format "%s" (xwem-client-name (xwem-frame-cl frame)))
-       "Unknown"))
-    (t
-     (format "%d:%s" (xwem-frame-num frame) (xwem-frame-name frame)))))
-
-(defvar xwem-framei-dockapp-osd nil
-  "Framei's dockapp osd.")
-
-(defun xwem-framei-dockapp-update (&optional frame)
-  "To be used in `xwem-frame-select-hook'."
-  (if (not (xwem-osd-p xwem-framei-dockapp-osd))
-      ;; Hmm, why this?
-      (remove-hook 'xwem-frame-select-hook 'xwem-framei-dockapp-update)
-
-    (unless frame
-      (setq frame (xwem-frame-selected)))
-    (when (xwem-frame-selected-p frame)
-      (xwem-osd-set-font xwem-framei-dockapp-osd
-                         (xwem-face-font 'xwem-framei-dockapp-face
-                                         (list (xwem-frame-type frame))))
-      (xwem-osd-set-color xwem-framei-dockapp-osd
-                          (xwem-face-foreground 'xwem-framei-dockapp-face
-                                                (list (xwem-frame-type frame))))
-      (xwem-osd-text xwem-framei-dockapp-osd
-                     (funcall xwem-framei-dockapp-format-function frame)))))
-
-(define-xwem-command xwem-framei-stop-dockapp ()
-  "Stop framei dockapp, if any."
-  (xwem-interactive)
-
-  (remove-hook 'xwem-frame-select-hook 'xwem-framei-dockapp-on-select)
-  (remove-hook 'xwem-frame-change-hook 'xwem-framei-dockapp-on-change)
-
-  (when (xwem-osd-p xwem-framei-dockapp-osd)
-    (xwem-osd-destroy xwem-framei-dockapp-osd)))
-
-;;;###autoload
-(defun xwem-framei-dockapp (&optional dockid dockgroup dockalign)
-  "Start frame indicator dockapp."
-  (unless (xwem-osd-p xwem-framei-dockapp-osd)
-    (let ((width (* (face-width 'xwem-framei-dockapp-face) 8))
-          (height (face-height 'xwem-framei-dockapp-face)))
-
-      (setq xwem-framei-dockapp-osd
-            (xwem-osd-create-dock (xwem-dpy) width height
-                                  (list 'keymap xwem-framei-dockapp-keymap)))
-
-      ;; Try to display current frame
-      (xwem-framei-dockapp-update)
-
-      ;; Add frame hooks
-      (add-hook 'xwem-frame-select-hook 'xwem-framei-dockapp-update)
-      (add-hook 'xwem-frame-change-hook 'xwem-framei-dockapp-update))))
-    
-;; Commands
-;;;###autoload(autoload 'xwem-framei-dockapp-popup-menu "xwem-framei" nil t)
-(define-xwem-command xwem-framei-dockapp-popup-menu ()
-  "Popup frames menu."
-  (xwem-interactive)
-
-  (xwem-popup-menu
-   (list "XWEM Frames" :filter 
-         (lambda (not-used)
-           (nconc
-           (mapcar (lambda (frame)
-                     (vector
-                      (case (xwem-frame-type frame)
-                        (dedicated
-                         (if (xwem-frame-cl frame)
-                             (format "D[%d]: %s" (xwem-frame-num frame)
-                                     (xwem-client-name (xwem-frame-cl frame)))
-                           (format "D[%d]: <none>" (xwem-frame-num frame))))
-                        (t (format "%s %d: %s"
-                                   (capitalize (symbol-name (xwem-frame-type frame)))
-                                   (xwem-frame-num frame) (xwem-frame-name frame))))
-                      `(xwem-select-frame ,frame)))
-                   xwem-frames-list)
-           (list "---"
-                 (vector "Destroy" 'xwem-framei-stop-dockapp)))))))
-
-;;;###autoload(autoload 'xwem-framei-dockapp-popup-alt-menu "xwem-framei" nil t)
-(define-xwem-command xwem-framei-dockapp-popup-alt-menu ()
-  "Popup alternative menu."
-  (xwem-interactive)
-
-  (xwem-popup-menu
-   (nconc '("XWEM Frames")
-          (mapcar (lambda (type)
-                    (nconc (list (capitalize (symbol-name type)))
-                           (mapcar (lambda (frame)
-                                     (vector
-                                      (format "%d: %s"
-                                              (xwem-frame-num frame)
-                                              (case (xwem-frame-type frame)
-                                                (dedicated
-                                                 (if (xwem-frame-cl frame)
-                                                     (xwem-client-name (xwem-frame-cl frame))
-                                                   "<none>"))
-                                                (t (xwem-frame-name frame))))
-                                      `(xwem-select-frame ,frame)))
-                                   (xwem-frames-list type))))
-                  xwem-frame-types)
-          '("---" ["Destroy" xwem-framei-stop-dockapp]))))
-
-
-(provide 'xwem-framei)
-
-;;; xwem-framei.el ends here

dockapp/xwem-pager.el

-;;; xwem-pager.el --- Simple frame pager.
-
-;; Copyright (C) 2004 by Free Software Foundation, Inc.
-
-;; Author: Richard Klinda <ignotus@hixsplit.hu>
-;;         Zajcev Evgeny <zevlg@yandex.ru>
-;; Created: Wed Aug 18 08:05:09 MSD 2004
-;; Keywords: xwem
-;; X-CVS: $Id$
-
-;; This file is part of XWEM.
-
-;; XWEM 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, or (at your option)
-;; any later version.
-
-;; XWEM 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 XEmacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-;; 02111-1307, USA.
-
-;;; Synched up with: Not in FSF
-
-;;; Commentary:
-
-;; Simple dockapp to show xwem frames.  Somekind of extension of
-;; xwem-framei.el
-
-;;; Code:
-
-(require 'xwem-load)
-(require 'xlib-xshape)
-
-
-;; veryvery simple pager / 2d viewport support
-;; the code works, do the following:
-;; 
-;; add to XWEM-after-init-hook:
-;; 
-;;    (setq *pager-dockapp* (xwem-2dframes-start-dockapp))
-;; 
-;; ugly i know, that starts the dockapp
-;; 
-;;   (xwem-2dframes-make-frames)
-;; 
-;; that will create the frames
-;; 
-;; load this code, restart your XWEM and be happy.  If you want to try it
-;; out without restarting then MAKE SURE you have only 1 frame, load the
-;; code then:
-;; M-x xwem-2dframes-make-frames
-;; 
-;; eval (setq *pager-dockapp* (xwem-2dframes-start-dockapp))
-;; 
-;; change viewports / frames somehow so the dockapp gets updated
-;; 
-;; i know this code is hackis, but if you rename the variables / sturcture
-;; the code like you want it to be i'll work on it to make it full featured
-;; + add more comments / docstrings.
-
-;;; //////////////////////////////////////////////////////////////////////
-
-(defvar xwem-pager-xwin nil
-  "XWIN of xwem pager.")
-
-(defvar xwem-pager-background-active "grey30")
-(defvar xwem-pager-background-inactive "grey55")
-(defvar xwem-pager-border-shadow-active "grey55")
-(defvar xwem-pager-border-shadow-inactive "grey55")
-
-(defvar xwem-2dframes-dim '(4 . 4)
-  "X*Y viewports")
-
-
-;;; Functions
-(defun xwem-2dframes-make-frames ()
-  "Make the frames, call from XWEM-AFTER-INIT-HOOK!"
-  (let ((num (1- (* (car xwem-2dframes-dim)
-                    (cdr xwem-2dframes-dim)))))
-    (dotimes (i num)
-      (xwem-make-frame-1 'desktop :noselect t))))
-
-(define-xwem-command xwem-2dframes-move-up ()
-  "Move one viewport up."
-  (xwem-interactive)
-  (xwem-2dframes-move 'up))
-
-(define-xwem-command xwem-2dframes-move-down ()
-  "Move one viewport down."
-  (xwem-interactive)
-  (xwem-2dframes-move 'down))
-
-(define-xwem-command xwem-2dframes-move-left ()
-  "Move one viewport left."
-  (xwem-interactive)
-  (xwem-2dframes-move 'left))
-
-(define-xwem-command xwem-2dframes-move-right ()
-  "Move one viewport right."
-  (xwem-interactive)
-  (xwem-2dframes-move 'right))
-
-(defun xwem-2dframes-move (dir)
-  (case dir
-    ('up (xwem-frame-switch-nth (- (xwem-frame-num (xwem-frame-selected))
-                                   (car xwem-2dframes-dim))))
-    ('down (xwem-frame-switch-nth (+ (xwem-frame-num (xwem-frame-selected))
-                                     (car xwem-2dframes-dim))))
-    ('left (xwem-frame-switch-nth (1- (xwem-frame-num (xwem-frame-selected)))))
-    ('right (xwem-frame-switch-nth
-             (1+ (xwem-frame-num (xwem-frame-selected)))))))
-
-;;; //////////////////////////////////////////////////////////////////////
-
-;; bindings
-
-(xwem-global-set-key [(super h)] 'xwem-2dframes-move-left)
-(xwem-global-set-key [(super t)] 'xwem-2dframes-move-down)
-(xwem-global-set-key [(super n)] 'xwem-2dframes-move-up)
-(xwem-global-set-key [(super s)] 'xwem-2dframes-move-right)
-;(xwem-global-set-key [(alt left)] 'xwem-2dframes-move-left)
-;(xwem-global-set-key [(alt down)] 'xwem-2dframes-move-down)
-;(xwem-global-set-key [(alt up)] 'xwem-2dframes-move-up)
-;(xwem-global-set-key [(alt right)] 'xwem-2dframes-move-right)
-
-;;; //////////////////////////////////////////////////////////////////////
-
-;; simple pager
-
-(defvar xwem-2dframes-dockapp-size 8
-  "X*X pixel will represent one viewport.")
-
-(defvar xwem-2dframes-dockapp-grid-p t
-  "If you want a dark line separating the viewports, set this to T.")
-
-(defstruct xwem-2dframes-dockapp
-  win
-  update-itimer                         ; itimer to update worklog-dockapp
-
-  ;; dockapp and sector geometry
-  width height
-  sector-width)
-
-(defun xwem-2dframes-start-dockapp (&optional dockid dockgroup dockalign)
-  "Start xwem worklog dockapp put
-(setq *pager-dockapp* (xwem-2dframes-start-dockapp))
-onto XWEM-AFTER-INIT-HOOK!"
-  (let* ((w (+ (* (car xwem-2dframes-dim) xwem-2dframes-dockapp-size)
-               (if xwem-2dframes-dockapp-grid-p
-                  (- (car xwem-2dframes-dim) 1)
-                  0)))
-         (h (+ (* (cdr xwem-2dframes-dim) xwem-2dframes-dockapp-size)
-               (if xwem-2dframes-dockapp-grid-p
-                   (- (cdr xwem-2dframes-dim) 1)
-                   0)))
-         (sw 0)
-         (wd (make-xwem-2dframes-dockapp
-              :win (XCreateWindow (xwem-dpy) nil 0 0 (+ 1 w) (+ 1 h (* 2 sw))
-                                  0 nil nil nil
-                                  (make-X-Attr :override-redirect t
-                                               :background-pixel
-                                               (XAllocNamedColor (xwem-dpy) (XDefaultColormap (xwem-dpy))
-                                                                 (face-background-name 'default)) ; XXX
-                                               ))
-              :width w :height h :sector-width sw)))
-
-    (X-Win-put-prop (xwem-2dframes-dockapp-win wd) 'xwem-2dframes-dockapp wd)
-
-;    (XSelectInput (xwem-dpy) (xwem-2dframes-dockapp-win wd)
-;                  (apply 'Xmask-or xwem-2dframes-dockapp-event-mask))
-
-;    (X-Win-EventHandler-add (xwem-2dframes-dockapp-win wd) 'xwem-2dframes-dockapp-event-handler nil
-;			    (list X-Expose X-MapNotify X-ButtonPress X-ButtonRelease X-DestroyNotify))
-
-    ;; Initialize wd in sys tray
-    (xwem-XTrayInit (xwem-dpy) (xwem-2dframes-dockapp-win wd) dockid dockgroup dockalign)
-
-    ;; Start updater
-;    (setf (xwem-2dframes-dockapp-update-itimer wd)
-;          (start-itimer "xwem-2dframes-dockapp-updater"
-;                        `(lambda () (xwem-2dframes-dockapp-update ,wd))
-;                        (xwem-worklog-meaning-update-time)
-;                        (xwem-worklog-meaning-update-time)))
-
-;    (add-hook 'xwem-worklog-task-start-hook
-;                 `(lambda () (xwem-2dframes-dockapp-update ,wd)))
-    wd))
-
-;(setq *pager-dockapp* (xwem-2dframes-start-dockapp))
-
-(defun xwem-2dframes-positions (&optional frame)
-  (unless frame
-    (setq frame (xwem-frame-selected)))
-  (let* ((n (xwem-frame-num frame))
-         (row (truncate (/ n (car xwem-2dframes-dim))))
-	 (column (- n (* row (car xwem-2dframes-dim)))))
-    (list n column row)))
-(defvar *pager-dockapp* nil)
-;(xwem-2dframes-dockapp-update *pager-dockapp*)
-
-(defun xwem-2dframes-dockapp-update (dockapp)
-  "Update 2dframes dockapp."
-  (when (xwem-2dframes-dockapp-p dockapp)
-    (let* ((win (xwem-2dframes-dockapp-win dockapp))
-           (xdpy (X-Win-dpy win))
-           (w (xwem-2dframes-dockapp-width dockapp))
-           (h (xwem-2dframes-dockapp-height dockapp)))
-      (multiple-value-bind (num row column)
-          (values-list (xwem-2dframes-positions))
-
-        (setq num num)                  ; shutup compiler
-
-        ;(XClearArea xdpy win 0 0 (1+ w) (1+ h) t) ; doesnt work:-/
-        ;; clear
-        (xwem-set-face-foreground 'xwem-worklog-temp-face
-                                  "gray24")
-        (XFillRectangle xdpy win
-                        (xwem-face-get-gc 'xwem-worklog-temp-face)
-                        0 0 w h)
-
-        ;; grid
-        (when xwem-2dframes-dockapp-grid-p
-          (xwem-set-face-foreground 'xwem-worklog-temp-face
-                                    "gray13")
-          (dotimes (i (car xwem-2dframes-dim))
-            (XDrawLine xdpy win (xwem-face-get-gc 'xwem-worklog-temp-face)
-                       (+ (* i xwem-2dframes-dockapp-size)
-                          i)
-                       0
-                       (+ (* i xwem-2dframes-dockapp-size)
-                          i)
-                       h))
-          (dotimes (i (cdr xwem-2dframes-dim))
-            (XDrawLine xdpy win (xwem-face-get-gc 'xwem-worklog-temp-face)
-                       0
-                       (+ (* i xwem-2dframes-dockapp-size)
-                          i)
-                       w
-                       (+ (* i xwem-2dframes-dockapp-size)
-                          i))))
-
-        ;; active part
-        (xwem-set-face-foreground 'xwem-worklog-temp-face
-                                  "white")
-        (XFillRectangle xdpy win
-                        (xwem-face-get-gc 'xwem-worklog-temp-face)
-                        (+ (* row xwem-2dframes-dockapp-size)
-                           (if xwem-2dframes-dockapp-grid-p
-                               row
-                               0))
-                        (+ (* column xwem-2dframes-dockapp-size)
-                           (if xwem-2dframes-dockapp-grid-p
-                               column
-                               0))
-                        xwem-2dframes-dockapp-size
-                        xwem-2dframes-dockapp-size)))))
-
-(defun xwem-pager-init (&optional dockid dockgroup dockalign)
-  "Initialize xwem pager."
-  (xwem-2dframes-start-dockapp dockid dockgroup dockalign))
-
-
-(provide 'xwem-pager)
-
-;;; On-load actions
-(add-hook 'xwem-frame-select-hook
-          '(lambda nil
-	    (when *pager-dockapp*
-              (xwem-2dframes-dockapp-update *pager-dockapp*))))
-
-
-;;; xwem-pager.el ends here

dockapp/xwem-time.el

-;;; xwem-time.el --- Time Date Load and Mail display in tray.
-
-;; Copyright (C) 2003 by Free Software Foundation, Inc.
-
-;; Author: Zajcev Evgeny <zevlg@yandex.ru>
-;;         Steve Youngs  <steve@youngs.au.com>
-;; Created: Mon Dec  8 09:53:42 MSK 2003
-;; Keywords: xwem, xlib
-;; X-CVS: $Id$
-
-;; This file is part of XWEM.
-
-;; XWEM 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, or (at your option)
-;; any later version.
-
-;; XWEM 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 XEmacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-;; 02111-1307, USA.
-
-;;; Synched up with: Not in FSF
-
-;;; Commentary:
-
-;; `display-time' like application, which starts in system tray and
-;; shows current time, load average and mail status.
-;;
-;; To start using it, add:
-;;
-;;    (autoload 'xwem-time "xwem-time" "Start `display-time' like app in system tray.")
-;;    (add-hook 'xwem-after-init-hook 'xwem-time)
-;;
-;; to your xwemrc.
-
-;;; Code:
-
-(eval-when-compile
-  (require 'itimer))
-
-(require 'time)
-
-(require 'xlib-xshape)
-(require 'xlib-xpm)
-(require 'xlib-img)
-(require 'xlib-tray)
-
-(require 'xwem-load)
-
-;;; Customisation
-(defgroup xwem-time nil
-  "Group to customize XWEM time display."
-  :prefix "xwem-time-"
-  :group 'xwem)
-
-(defcustom xwem-time-display-time t
-  "*Non-nil mean display current time."
-  :type 'boolean
-  :group 'xwem-time)
-
-(defcustom xwem-time-display-load t
-  "*Non-nil mean display current CPU load."
-  :type 'boolean
-  :group 'xwem-time)
-
-(defcustom xwem-time-display-mail t
-  "*Non-nil mean display current mail box status."
-  :type 'boolean
-  :group 'xwem-time)
-
-(defcustom xwem-time-time-color "#CA1E1C"
-  "Foreground color to display time."
-  :type 'color
-  :group 'xwem-time)
-
-(defcustom xwem-time-load-list
-  (list 0.10 0.20 0.30 0.40 0.50 0.60 0.80 1.0 1.2 1.5 1.8)
-  "*A list giving six thresholds for the load
-which correspond to the six different icons to be displayed
-as a load indicator."
-  :type '(list (number :tag "Threshold 1")
-	       (number :tag "Threshold 2")
-	       (number :tag "Threshold 3")
-	       (number :tag "Threshold 4")
-	       (number :tag "Threshold 5")
-	       (number :tag "Threshold 6")
-	       (number :tag "Threshold 7")
-	       (number :tag "Threshold 8")
-	       (number :tag "Threshold 9")
-	       (number :tag "Threshold 10")
-	       (number :tag "Threshold 11"))
-  :group 'xwem-time)
-
-(defcustom xwem-time-time-interval 20
-  "*Seconds between updates of xwem time window."
-  :type 'integer
-  :group 'xwem-time)
-
-(defcustom xwem-time-load-interval 5
-  "*Seconds between load average updates."
-  :type 'integer
-  :group 'xwem-time)
-
-;;; Internal variables
-
-(defvar xwem-time-last-time nil
-  "Last saved time value.")
-(defvar xwem-time-last-load nil
-  "Last saved load value.")
-
-(defvar xwem-time-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [button1] 'xwem-time-show-current-time-and-date)
-    (define-key map [button3] 'xwem-time-popup-menu)
-    map)
-  "Keymap used when clicking time dockapp.")
-
-
-;;; Internal variables
-(defconst xwem-time-window-mask
-  (list XM-Exposure XM-StructureNotify XM-ButtonPress XM-ButtonRelease))
-
-;;; Icons
-(defvar xwem-time-xpm-time0 '(concat "/* XPM */\n"
-				     "static char *noname[] = {\n"
-				     "/* width height ncolors chars_per_pixel */\n"
-				     "\"9 13 2 1\",\n"
-				     "/* colors */\n"
-				     "\"`	c None    s ledbg\",\n"
-				     "\"a	c " xwem-time-time-color " s ledfg\",\n"
-				     "/* pixels */\n"
-				     "\"`````````\",\n"
-				     "\"````aaaaa\",\n"
-				     "\"```a````a\",\n"
-				     "\"```a````a\",\n"
-				     "\"``a````a`\",\n"
-				     "\"``a````a`\",\n"
-				     "\"`````````\",\n"
-				     "\"`a````a``\",\n"
-				     "\"`a````a``\",\n"
-				     "\"a````a```\",\n"
-				     "\"a````a```\",\n"
-				     "\"aaaaa````\",\n"
-				     "\"`````````\"\n"
-				     "};\n"))
-
-(defvar xwem-time-xpm-time1 '(concat "/* XPM */\n"
-				     "static char *noname[] = {\n"
-				     "/* width height ncolors chars_per_pixel */\n"
-				     "\"9 13 2 1\",\n"
-				     "/* colors */\n"
-				     "\"`	c None s ledbg\",\n"
-				     "\"a	c " xwem-time-time-color " s ledfg\",\n"
-				     "/* pixels */\n"
-				     "\"`````````\",\n"
-				     "\"`````````\",\n"
-				     "\"````````a\",\n"
-				     "\"````````a\",\n"
-				     "\"```````a`\",\n"
-				     "\"```````a`\",\n"
-				     "\"`````````\",\n"
-				     "\"``````a``\",\n"
-				     "\"``````a``\",\n"
-				     "\"`````a```\",\n"
-				     "\"`````a```\",\n"
-				     "\"`````````\",\n"
-				     "\"`````````\"\n"
-				     "};\n"))
-
-(defconst xwem-time-xpm-time2 '(concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"9 13 2 1\",\n"
-				       "/* colors */\n"
-				       "\"` c None    s ledbg\",\n"
-				       "\"a c " xwem-time-time-color " s ledfg\",\n"
-				       "/* pixels */\n"
-				       "\"`````````\",\n"
-				       "\"````aaaaa\",\n"
-				       "\"````````a\",\n"
-				       "\"````````a\",\n"
-				       "\"```````a`\",\n"
-				       "\"```````a`\",\n"
-				       "\"``aaaaa``\",\n"
-				       "\"`a```````\",\n"
-				       "\"`a```````\",\n"
-				       "\"a````````\",\n"
-				       "\"a````````\",\n"
-				       "\"aaaaa````\",\n"
-				       "\"`````````\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-time3 '(concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"9 13 2 1\",\n"
-				       "/* colors */\n"
-				       "\"` c None    s ledbg\",\n"
-				       "\"a c " xwem-time-time-color " s ledfg\",\n"
-				       "/* pixels */\n"
-				       "\"`````````\",\n"
-				       "\"````aaaaa\",\n"
-				       "\"````````a\",\n"
-				       "\"````````a\",\n"
-				       "\"```````a`\",\n"
-				       "\"```````a`\",\n"
-				       "\"``aaaaa``\",\n"
-				       "\"``````a``\",\n"
-				       "\"``````a``\",\n"
-				       "\"`````a```\",\n"
-				       "\"`````a```\",\n"
-				       "\"aaaaa````\",\n"
-				       "\"`````````\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-time4 '(concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"9 13 2 1\",\n"
-				       "/* colors */\n"
-				       "\"` c None    s ledbg\",\n"
-				       "\"a c " xwem-time-time-color " s ledfg\",\n"
-				       "/* pixels */\n"
-				       "\"`````````\",\n"
-				       "\"`````````\",\n"
-				       "\"```a````a\",\n"
-				       "\"```a````a\",\n"
-				       "\"``a````a`\",\n"
-				       "\"``a````a`\",\n"
-				       "\"``aaaaa``\",\n"
-				       "\"``````a``\",\n"
-				       "\"``````a``\",\n"
-				       "\"`````a```\",\n"
-				       "\"`````a```\",\n"
-				       "\"`````````\",\n"
-				       "\"`````````\"\n"
-				       "};\n"))
-
-
-(defconst xwem-time-xpm-time5 '(concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"9 13 2 1\",\n"
-				       "/* colors */\n"
-				       "\"` c None    s ledbg\",\n"
-				       "\"a c " xwem-time-time-color " s ledfg\",\n"
-				       "/* pixels */\n"
-				       "\"`````````\",\n"
-				       "\"````aaaaa\",\n"
-				       "\"```a`````\",\n"
-				       "\"```a`````\",\n"
-				       "\"``a``````\",\n"
-				       "\"``a``````\",\n"
-				       "\"``aaaaa``\",\n"
-				       "\"``````a``\",\n"
-				       "\"``````a``\",\n"
-				       "\"`````a```\",\n"
-				       "\"`````a```\",\n"
-				       "\"aaaaa````\",\n"
-				       "\"`````````\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-time6 '(concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"9 13 2 1\",\n"
-				       "/* colors */\n"
-				       "\"` c None    s ledbg\",\n"
-				       "\"a c " xwem-time-time-color " s ledfg\",\n"
-				       "/* pixels */\n"
-				       "\"`````````\",\n"
-				       "\"````aaaaa\",\n"
-				       "\"```a`````\",\n"
-				       "\"```a`````\",\n"
-				       "\"``a``````\",\n"
-				       "\"``a``````\",\n"
-				       "\"``aaaaa``\",\n"
-				       "\"`a````a``\",\n"
-				       "\"`a````a``\",\n"
-				       "\"a````a```\",\n"
-				       "\"a````a```\",\n"
-				       "\"aaaaa````\",\n"
-				       "\"`````````\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-time7 '(concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"9 13 2 1\",\n"
-				       "/* colors */\n"
-				       "\"` c None    s ledbg\",\n"
-				       "\"a c " xwem-time-time-color " s ledfg\",\n"
-				       "/* pixels */\n"
-				       "\"`````````\",\n"
-				       "\"````aaaaa\",\n"
-				       "\"````````a\",\n"
-				       "\"````````a\",\n"
-				       "\"```````a`\",\n"
-				       "\"```````a`\",\n"
-				       "\"`````````\",\n"
-				       "\"``````a``\",\n"
-				       "\"``````a``\",\n"
-				       "\"`````a```\",\n"
-				       "\"`````a```\",\n"
-				       "\"`````````\",\n"
-				       "\"`````````\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-time8 '(concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"9 13 2 1\",\n"
-				       "/* colors */\n"
-				       "\"` c None    s ledbg\",\n"
-				       "\"a c " xwem-time-time-color " s ledfg\",\n"
-				       "/* pixels */\n"
-				       "\"`````````\",\n"
-				       "\"````aaaaa\",\n"
-				       "\"```a````a\",\n"
-				       "\"```a````a\",\n"
-				       "\"``a````a`\",\n"
-				       "\"``a````a`\",\n"
-				       "\"``aaaaa``\",\n"
-				       "\"`a````a``\",\n"
-				       "\"`a````a``\",\n"
-				       "\"a````a```\",\n"
-				       "\"a````a```\",\n"
-				       "\"aaaaa````\",\n"
-				       "\"`````````\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-time9 '(concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"9 13 2 1\",\n"
-				       "/* colors */\n"
-				       "\"` c None    s ledbg\",\n"
-				       "\"a c " xwem-time-time-color " s ledfg\",\n"
-				       "/* pixels */\n"
-				       "\"`````````\",\n"
-				       "\"````aaaaa\",\n"
-				       "\"```a````a\",\n"
-				       "\"```a````a\",\n"
-				       "\"``a````a`\",\n"
-				       "\"``a````a`\",\n"
-				       "\"``aaaaa``\",\n"
-				       "\"``````a``\",\n"
-				       "\"``````a``\",\n"
-				       "\"`````a```\",\n"
-				       "\"`````a```\",\n"
-				       "\"aaaaa````\",\n"
-				       "\"`````````\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-am '(concat "/* XPM */\n"
-				    "static char *noname[] = {\n"
-				    "/* width height ncolors chars_per_pixel */\n"
-				    "\"4 13 2 1\",\n"
-				    "/* colors */\n"
-				    "\"` c None    s ledbg\",\n"
-				    "\"a c " xwem-time-time-color " s ledfg\",\n"
-				    "/* pixels */\n"
-				    "\"````\",\n"
-				    "\"``aa\",\n"
-				    "\"``aa\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\"\n"
-				    "};\n"))
-
-(defconst xwem-time-xpm-dp '(concat "/* XPM */\n"
-				    "static char *noname[] = {\n"
-				    "/* width height ncolors chars_per_pixel */\n"
-				    "\"9 13 2 1\",\n"
-				    "/* colors */\n"
-				    "\"` c None    s ledbg\",\n"
-				    "\"a c " xwem-time-time-color " s ledfg\",\n"
-				    "/* pixels */\n"
-				    "\"`````````\",\n"
-				    "\"`````````\",\n"
-				    "\"`````````\",\n"
-				    "\"`````````\",\n"
-				    "\"````a````\",\n"
-				    "\"````a````\",\n"
-				    "\"`````````\",\n"
-				    "\"```a`````\",\n"
-				    "\"```a`````\",\n"
-				    "\"`````````\",\n"
-				    "\"`````````\",\n"
-				    "\"`````````\",\n"
-				    "\"`````````\"\n"
-				    "};\n"))
-
-(defconst xwem-time-xpm-pm '(concat "/* XPM */\n"
-				    "static char *noname[] = {\n"
-				    "/* width height ncolors chars_per_pixel */\n"
-				    "\"4 13 2 1\",\n"
-				    "/* colors */\n"
-				    "\"` c None    s ledbg\",\n"
-				    "\"a c " xwem-time-time-color " s ledfg\",\n"
-				    "/* pixels */\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"````\",\n"
-				    "\"aa``\",\n"
-				    "\"aa``\",\n"
-				    "\"````\"\n"
-				    "};\n"))
-;; load icons
-(defconst xwem-time-xpm-load00 (concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 2 1\",\n"
-				       "/* colors */\n"
-				       "\"` s None c None\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"``````....\",\n"
-				       "\"``````....\",\n"
-				       "\"`````.....\",\n"
-				       "\"`````.....\",\n"
-				       "\"````......\",\n"
-				       "\"````......\",\n"
-				       "\"```.......\",\n"
-				       "\"```.......\",\n"
-				       "\"``........\",\n"
-				       "\"``........\",\n"
-				       "\"`.........\",\n"
-				       "\"`.........\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load05 (concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 3 1,\"\n"
-				       "\/* colors \*/\n"
-				       "\"` s None c None\",\n"
-				       "\"a c #0AB224\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"``````....\",\n"
-				       "\"``````....\",\n"
-				       "\"`````.....\",\n"
-				       "\"`````.....\",\n"
-				       "\"````......\",\n"
-				       "\"````......\",\n"
-				       "\"```.......\",\n"
-				       "\"```.......\",\n"
-				       "\"``........\",\n"
-				       "\"``........\",\n"
-				       "\"`.........\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load10 (concat "/* XPM */"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 3 1\",\n"
-				       "\/* colors \*/\n"
-				       "\"` s None c None\",\n"
-				       "\"a c #0AB224\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"``````....\",\n"
-				       "\"``````....\",\n"
-				       "\"`````.....\",\n"
-				       "\"`````.....\",\n"
-				       "\"````......\",\n"
-				       "\"````......\",\n"
-				       "\"```.......\",\n"
-				       "\"```.......\",\n"
-				       "\"``........\",\n"
-				       "\"``........\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load15 (concat "/* XPM */"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 3 1\",\n"
-				       "\/* colors \*/\n"
-				       "\"` s None c None\",\n"
-				       "\"a c #0AB224\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"``````....\",\n"
-				       "\"``````....\",\n"
-				       "\"`````.....\",\n"
-				       "\"`````.....\",\n"
-				       "\"````......\",\n"
-				       "\"````......\",\n"
-				       "\"```.......\",\n"
-				       "\"```.......\",\n"
-				       "\"``........\",\n"
-				       "\"``aaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load20 (concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 4 1\",\n"
-				       "/* colors */\n"
-				       "\"` s None c None\",\n"
-				       "\"a c #2AD244\",\n"
-				       "\"b c #DEE614\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"``````....\",\n"
-				       "\"``````....\",\n"
-				       "\"`````.....\",\n"
-				       "\"`````.....\",\n"
-				       "\"````......\",\n"
-				       "\"````......\",\n"
-				       "\"```.......\",\n"
-				       "\"```.......\",\n"
-				       "\"``aaaaaaaa\",\n"
-				       "\"``aaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load25 (concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 4 1\",\n"
-				       "/* colors */\n"
-				       "\"` s None c None\",\n"
-				       "\"a c #2AD244\",\n"
-				       "\"b c #DEE614\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"``````....\",\n"
-				       "\"``````....\",\n"
-				       "\"`````.....\",\n"
-				       "\"`````.....\",\n"
-				       "\"````......\",\n"
-				       "\"````......\",\n"
-				       "\"```.......\",\n"
-				       "\"```bbbbbbb\",\n"
-				       "\"``aaaaaaaa\",\n"
-				       "\"``aaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load30 (concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 4 1\",\n"
-				       "/* colors */\n"
-				       "\"` s None c None\",\n"
-				       "\"a c #0AB224\",\n"
-				       "\"b c #DEE614\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"``````....\",\n"
-				       "\"``````....\",\n"
-				       "\"`````.....\",\n"
-				       "\"`````.....\",\n"
-				       "\"````......\",\n"
-				       "\"````......\",\n"
-				       "\"```bbbbbbb\",\n"
-				       "\"```bbbbbbb\",\n"
-				       "\"``aaaaaaaa\",\n"
-				       "\"``aaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load35 (concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 4 1\",\n"
-				       "/* colors */\n"
-				       "\"` s None c None\",\n"
-				       "\"a c #0AB224\",\n"
-				       "\"b c #DEE614\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"``````....\",\n"
-				       "\"``````....\",\n"
-				       "\"`````.....\",\n"
-				       "\"`````.....\",\n"
-				       "\"````......\",\n"
-				       "\"````bbbbbb\",\n"
-				       "\"```bbbbbbb\",\n"
-				       "\"```bbbbbbb\",\n"
-				       "\"``aaaaaaaa\",\n"
-				       "\"``aaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"`aaaaaaaaa\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load40 (concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 5 1\",\n"
-				       "/* colors */\n"
-				       "\"a s None c None\",\n"
-				       "\"` c #FE0204\",\n"
-				       "\"b c #0AB224\",\n"
-				       "\"c c #DEE614\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"aaaaaa....\",\n"
-				       "\"aaaaaa....\",\n"
-				       "\"aaaaa.....\",\n"
-				       "\"aaaaa.....\",\n"
-				       "\"aaaacccccc\",\n"
-				       "\"aaaacccccc\",\n"
-				       "\"aaaccccccc\",\n"
-				       "\"aaaccccccc\",\n"
-				       "\"aabbbbbbbb\",\n"
-				       "\"aabbbbbbbb\",\n"
-				       "\"abbbbbbbbb\",\n"
-				       "\"abbbbbbbbb\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load45 (concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 5 1\",\n"
-				       "/* colors */\n"
-				       "\"a s None c None\",\n"
-				       "\"` c #FE0204\",\n"
-				       "\"b c #0AB224\",\n"
-				       "\"c c #DEE614\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"aaaaaa....\",\n"
-				       "\"aaaaaa....\",\n"
-				       "\"aaaaa.....\",\n"
-				       "\"aaaaa`````\",\n"
-				       "\"aaaacccccc\",\n"
-				       "\"aaaacccccc\",\n"
-				       "\"aaaccccccc\",\n"
-				       "\"aaaccccccc\",\n"
-				       "\"aabbbbbbbb\",\n"
-				       "\"aabbbbbbbb\",\n"
-				       "\"abbbbbbbbb\",\n"
-				       "\"abbbbbbbbb\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load50 (concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 5 1\",\n"
-				       "/* colors */\n"
-				       "\"a s None c None\",\n"
-				       "\"` c #FE0204\",\n"
-				       "\"b c #0AB224\",\n"
-				       "\"c c #DEE614\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"aaaaaa....\",\n"
-				       "\"aaaaaa....\",\n"
-				       "\"aaaaa`````\",\n"
-				       "\"aaaaa`````\",\n"
-				       "\"aaaacccccc\",\n"
-				       "\"aaaacccccc\",\n"
-				       "\"aaaccccccc\",\n"
-				       "\"aaaccccccc\",\n"
-				       "\"aabbbbbbbb\",\n"
-				       "\"aabbbbbbbb\",\n"
-				       "\"abbbbbbbbb\",\n"
-				       "\"abbbbbbbbb\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-(defconst xwem-time-xpm-load55 (concat "/* XPM */\n"
-				       "static char *noname[] = {\n"
-				       "/* width height ncolors chars_per_pixel */\n"
-				       "\"10 13 5 1\",\n"
-				       "/* colors */\n"
-				       "\"a s None c None\",\n"
-				       "\"` c #FE0204\",\n"
-				       "\"b c #0AB224\",\n"
-				       "\"c c #DEE614\",\n"
-				       "\". s pad-color c #606060\",\n"
-				       "/* pixels */\n"
-				       "\"aaaaaa....\",\n"
-				       "\"aaaaaa````\",\n"
-				       "\"aaaaa`````\",\n"
-				       "\"aaaaa`````\",\n"
-				       "\"aaaacccccc\",\n"
-				       "\"aaaacccccc\",\n"
-				       "\"aaaccccccc\",\n"
-				       "\"aaaccccccc\",\n"
-				       "\"aabbbbbbbb\",\n"
-				       "\"aabbbbbbbb\",\n"
-				       "\"abbbbbbbbb\",\n"
-				       "\"abbbbbbbbb\",\n"
-				       "\"..........\"\n"
-				       "};\n"))
-
-;; Mail icons
-(defconst xwem-time-xpm-letter (concat "/* XPM */\n"
-				       "static char * jmail_xpm[] = {\n"
-				       "\"18 13 4 1\",\n"
-				       "\" 	s None c None\",\n"
-				       "\".	c gray85\",\n"
-				       "\"X	c yellow\",\n"
-				       "\"o	c black\",\n"
-				       "\"                  \",\n"
-				       "\"                  \",\n"
-				       "\"   .XXXXXXXXXXX.  \",\n"
-				       "\"   XoXXXXXXXXXoXoo\",\n"
-				       "\"   XXoXXXXXXXoXXoo\",\n"
-				       "\"   XXXoXXXXXoXXXoo\",\n"
-				       "\"   XXX.oXXXo.XXXoo\",\n"
-				       "\"   XXXo.oXo.oXXXoo\",\n"
-				       "\"   XXoXXXoXXXoXXoo\",\n"
-				       "\"   XoXXXXXXXXXoXoo\",\n"
-				       "\"   .XXXXXXXXXXX.oo\",\n"
-				       "\"     ooooooooooooo\",\n"
-				       "\"     ooooooooooooo\"};\n"))
-
-(defconst xwem-time-xpm-no-letter (concat "/* XPM */\n"
-					  "static char * jmail_xpm[] = {\n"
-					  "\"18 13 4 1\",\n"
-					  "\" 	s None	c None\",\n"
-					  "\".	c gray55\",\n"
-					  "\"o	c black\",\n"
-					  "\"x	c gray95\",\n"
-					  "\"                  \",\n"
-					  "\"                  \",\n"
-					  "\"   ooooooooooooox \",\n"
-					  "\"   o.xxxxxxxxx.ox \",\n"
-					  "\"   oxox      oxox \",\n"
-					  "\"   ox ox    ox ox \",\n"
-					  "\"   ox  ox  ox  ox \",\n"
-					  "\"   ox oxoxoxox ox \",\n"
-					  "\"   oxox  ox  oxox \",\n"
-					  "\"   o.x        .ox \",\n"
-					  "\"   ooooooooooooox \",\n"
-					  "\"   xxxxxxxxxxxxxx \",\n"
-					  "\"                  \"};\n"))
-
-
-
-;;; Functions
-(defsubst xwem-time-get-image (win img-type img-name)
-  "In WIN's list of IMG-TYPE images get image with name IMG-NAME."
-  (plist-get (X-Win-get-prop win img-type) img-name))
-
-(defsubst xwem-time-get-mask (win mask-type mask-name)
-  "In WIN's list of MASK-TYPE masks get mask with name MASK-NAME."
-  (plist-get (X-Win-get-prop win mask-type) mask-name))
-
-(defsubst xwem-time-get-time-image (win name)
-  "In WIN's time images list get image with NAME."
-  (xwem-time-get-image win 'xwem-time-images name))
-
-(defsubst xwem-time-get-time-mask (win name)
-  "In WIN's time masks list get mask with NAME."
-  (xwem-time-get-mask win 'xwem-time-masks name))
-
-(defsubst xwem-time-get-load-image (win name)
-  "In WIN's load images list get image with NAME."
-  (xwem-time-get-image win 'xwem-load-images name))
-
-(defsubst xwem-time-get-load-mask (win name)
-  "In WIN's load masks list get mask with NAME."
-  (xwem-time-get-mask win 'xwem-load-masks name))
-
-(defsubst xwem-time-get-mail-image (win name)
-  "In WIN's mail images list get image with NAME."
-  (xwem-time-get-image win 'xwem-mail-images name))
-
-(defsubst xwem-time-get-mail-mask (win name)
-  "In WIN's mail masks list get mask with NAME."
-  (xwem-time-get-mask win 'xwem-mail-masks name))
-
-(defsubst xwem-time-put-image (win img-type img-name img-data)
-  (X-Win-put-prop win img-type
-		  (plist-put (X-Win-get-prop win img-type) img-name img-data)))
-  
-(defsubst xwem-time-put-time-image (win name img)
-  "In WIN's images list put parsed image with NAME.
-Parsed image is IMG."
-  (xwem-time-put-image win 'xwem-time-images name img))
-
-(defsubst xwem-time-put-load-image (win name img)
-  "In WIN's images list put parsed image with NAME.
-Parsed image is IMG."
-  (xwem-time-put-image win 'xwem-load-images name img))
-
-(defsubst xwem-time-put-mail-image (win name img)
-  "In WIN's images list put parsed image with NAME.
-Parsed image is IMG."
-  (xwem-time-put-image win 'xwem-mail-images name img))
-
-(defun xwem-time-clear-mask (win)
-  "Get WIN's mask pixmap and clear it's area."
-  (let ((xdpy (X-Win-dpy win))
-	(mask-pix (X-Win-get-prop win 'mask-pixmap))
-	mgc)
-    (setq mgc (XCreateGC xdpy mask-pix
-			 (make-X-Gc :dpy xdpy :id (X-Dpy-get-id xdpy)
-                                    :graphics-exposures X-False
-				    :foreground 0.0
-				    :background 1.0)))
-    (XFillRectangle xdpy mask-pix mgc 0 0 88 15)
-    (XFreeGC xdpy mgc)))
-
-(defun xwem-time-init (xdpy)
-  (let ((gc-cons-threshold most-positive-fixnum)	; inhibit gcing
-	win time-images load-images mail-images
-	time-masks load-masks mail-masks
-	mask-pix)
-    (setq win (XCreateWindow xdpy (XDefaultRootWindow xdpy)
-			     0 0 88 15 0 nil nil nil
-			     (make-X-Attr :background-pixel (XWhitePixel xdpy)
-					  :border-pixel (XBlackPixel xdpy)
-                                          :backing-store X-Always
-					  :override-redirect t)))
-
-    (setq time-images (list 'time0 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time0))
-			    'time1 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time1))
-			    'time2 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time2))
-			    'time3 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time3))
-			    'time4 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time4))
-			    'time5 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time5))
-			    'time6 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time6))
-			    'time7 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time7))
-			    'time8 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time8))
-			    'time9 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time9))
-			    'time-am (X:xpm-img-from-data xdpy (eval xwem-time-xpm-am))
-			    'time-pm (X:xpm-img-from-data xdpy (eval xwem-time-xpm-pm))
-			    'time-dp (X:xpm-img-from-data xdpy (eval xwem-time-xpm-dp))))
-    (setq load-images (list 'load00 (X:xpm-img-from-data xdpy xwem-time-xpm-load00)
-			    'load05 (X:xpm-img-from-data xdpy xwem-time-xpm-load05)
-			    'load10 (X:xpm-img-from-data xdpy xwem-time-xpm-load10)
-			    'load15 (X:xpm-img-from-data xdpy xwem-time-xpm-load15)
-			    'load20 (X:xpm-img-from-data xdpy xwem-time-xpm-load20)
-			    'load25 (X:xpm-img-from-data xdpy xwem-time-xpm-load25)
-			    'load30 (X:xpm-img-from-data xdpy xwem-time-xpm-load30)
-			    'load35 (X:xpm-img-from-data xdpy xwem-time-xpm-load35)
-			    'load40 (X:xpm-img-from-data xdpy xwem-time-xpm-load40)
-			    'load45 (X:xpm-img-from-data xdpy xwem-time-xpm-load45)
-			    'load50 (X:xpm-img-from-data xdpy xwem-time-xpm-load50)
-			    'load55 (X:xpm-img-from-data xdpy xwem-time-xpm-load55)))
-    (setq mail-images (list 'letter (X:xpm-img-from-data xdpy xwem-time-xpm-letter)
-			    'no-letter (X:xpm-img-from-data xdpy xwem-time-xpm-no-letter)))
-
-    (X-Win-put-prop win 'xwem-time-images time-images)
-    (X-Win-put-prop win 'xwem-load-images load-images)
-    (X-Win-put-prop win 'xwem-mail-images mail-images)
-
-    ;; Create masks
-    (setq time-masks (list 'time0 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time0) t)
-			   'time1 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time1) t)
-			   'time2 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time2) t)
-			   'time3 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time3) t)
-			   'time4 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time4) t)
-			   'time5 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time5) t)
-			   'time6 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time6) t)
-			   'time7 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time7) t)
-			   'time8 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time8) t)
-			   'time9 (X:xpm-img-from-data xdpy (eval xwem-time-xpm-time9) t)
-			   'time-am (X:xpm-img-from-data xdpy (eval xwem-time-xpm-am) t)
-			   'time-pm (X:xpm-img-from-data xdpy (eval xwem-time-xpm-pm) t)
-			   'time-dp (X:xpm-img-from-data xdpy (eval xwem-time-xpm-dp) t)))
-    (setq load-masks (list 'load00 (X:xpm-img-from-data xdpy xwem-time-xpm-load00 t)
-			   'load05 (X:xpm-img-from-data xdpy xwem-time-xpm-load05 t)
-			   'load10 (X:xpm-img-from-data xdpy xwem-time-xpm-load10 t)
-			   'load15 (X:xpm-img-from-data xdpy xwem-time-xpm-load15 t)
-			   'load20 (X:xpm-img-from-data xdpy xwem-time-xpm-load20 t)
-			   'load25 (X:xpm-img-from-data xdpy xwem-time-xpm-load25 t)
-			   'load30 (X:xpm-img-from-data xdpy xwem-time-xpm-load30 t)
-			   'load35 (X:xpm-img-from-data xdpy xwem-time-xpm-load35 t)
-			   'load40 (X:xpm-img-from-data xdpy xwem-time-xpm-load40 t)
-			   'load45 (X:xpm-img-from-data xdpy xwem-time-xpm-load45 t)
-			   'load50 (X:xpm-img-from-data xdpy xwem-time-xpm-load50 t)
-			   'load55 (X:xpm-img-from-data xdpy xwem-time-xpm-load55 t)))
-    (setq mail-masks (list 'letter (X:xpm-img-from-data xdpy xwem-time-xpm-letter t)
-			   'no-letter (X:xpm-img-from-data xdpy xwem-time-xpm-no-letter t)))
-
-    (X-Win-put-prop win 'xwem-time-masks time-masks)
-    (X-Win-put-prop win 'xwem-load-masks load-masks)
-    (X-Win-put-prop win 'xwem-mail-masks mail-masks)
-    
-    (setq mask-pix (XCreatePixmap xdpy (make-X-Pixmap :dpy xdpy :id (X-Dpy-get-id xdpy))
-				  win 1 88 15))
-    (X-Win-put-prop win 'mask-pixmap mask-pix)
-    (xwem-time-clear-mask win)
-
-    ;; Now create pixmaps
-    (let (depth gc mgc time-pix load-pix mail-pix)
-      (setq depth (XDefaultDepth xdpy))
-
-      (setq gc (XCreateGC xdpy win
-                          (make-X-Gc :dpy xdpy :id (X-Dpy-get-id xdpy)
-                                     :graphics-exposures X-False
-                                     :function X-GXCopy))
-            mgc (XCreateGC xdpy mask-pix
-                           (make-X-Gc :dpy xdpy :id (X-Dpy-get-id xdpy)
-                                      :function X-GXCopy
-                                      :graphics-exposures X-False
-                                      :foreground 1.0
-                                      :background 0.0)))
-      (X-Win-put-prop win 'time-gc gc)
-      (X-Win-put-prop win 'time-mask-gc mgc)
-
-      ;; Time
-      (setq time-pix (cons (XCreatePixmap xdpy (make-X-Pixmap :dpy xdpy :id (X-Dpy-get-id xdpy))
-					  win depth 107 13)
-			   (XCreatePixmap xdpy (make-X-Pixmap :dpy xdpy :id (X-Dpy-get-id xdpy))
-					  win 1 107 13)))
-      (XImagePut xdpy gc (car time-pix)	0 0 (xwem-time-get-time-image win 'time0))
-      (XImagePut xdpy gc (car time-pix)	9 0 (xwem-time-get-time-image win 'time1))
-      (XImagePut xdpy gc (car time-pix)	18 0 (xwem-time-get-time-image win 'time2))
-      (XImagePut xdpy gc (car time-pix)	27 0 (xwem-time-get-time-image win 'time3))
-      (XImagePut xdpy gc (car time-pix)	36 0 (xwem-time-get-time-image win 'time4))
-      (XImagePut xdpy gc (car time-pix)	45 0 (xwem-time-get-time-image win 'time5))
-      (XImagePut xdpy gc (car time-pix)	54 0 (xwem-time-get-time-image win 'time6))
-      (XImagePut xdpy gc (car time-pix)	63 0 (xwem-time-get-time-image win 'time7))
-      (XImagePut xdpy gc (car time-pix)	72 0 (xwem-time-get-time-image win 'time8))
-      (XImagePut xdpy gc (car time-pix)	81 0 (xwem-time-get-time-image win 'time9))
-      (XImagePut xdpy gc (car time-pix)	90 0 (xwem-time-get-time-image win 'time-dp))
-      (XImagePut xdpy gc (car time-pix)	99 0 (xwem-time-get-time-image win 'time-am)) ; 4 pixels width
-      (XImagePut xdpy gc (car time-pix)	103 0 (xwem-time-get-time-image win 'time-pm)) ; 4 pixels width
-
-      (XImagePut xdpy mgc (cdr time-pix) 0 0 (xwem-time-get-time-mask win 'time0))
-      (XImagePut xdpy mgc (cdr time-pix) 9 0 (xwem-time-get-time-mask win 'time1))
-      (XImagePut xdpy mgc (cdr time-pix) 18 0 (xwem-time-get-time-mask win 'time2))
-      (XImagePut xdpy mgc (cdr time-pix) 27 0 (xwem-time-get-time-mask win 'time3))
-      (XImagePut xdpy mgc (cdr time-pix) 36 0 (xwem-time-get-time-mask win 'time4))
-      (XImagePut xdpy mgc (cdr time-pix) 45 0 (xwem-time-get-time-mask win 'time5))
-      (XImagePut xdpy mgc (cdr time-pix) 54 0 (xwem-time-get-time-mask win 'time6))
-      (XImagePut xdpy mgc (cdr time-pix) 63 0 (xwem-time-get-time-mask win 'time7))
-      (XImagePut xdpy mgc (cdr time-pix) 72 0 (xwem-time-get-time-mask win 'time8))
-      (XImagePut xdpy mgc (cdr time-pix) 81 0 (xwem-time-get-time-mask win 'time9))
-      (XImagePut xdpy mgc (cdr time-pix) 90 0 (xwem-time-get-time-mask win 'time-dp))
-      (XImagePut xdpy mgc (cdr time-pix) 99 0 (xwem-time-get-time-mask win 'time-am)) ; 4 pixels width
-      (XImagePut xdpy mgc (cdr time-pix) 103 0 (xwem-time-get-time-mask win 'time-pm)) ; 4 pixels width
-      (X-Win-put-prop win 'time-pixmap time-pix)
-
-      ;; Load
-      (setq load-pix (cons (XCreatePixmap xdpy (make-X-Pixmap :dpy xdpy :id (X-Dpy-get-id xdpy))
-					  win depth 120 13)
-			   (XCreatePixmap xdpy (make-X-Pixmap :dpy xdpy :id (X-Dpy-get-id xdpy))
-					  win 1 120 13)))
-      (XImagePut xdpy gc (car load-pix)	0 0 (xwem-time-get-load-image win 'load00))
-      (XImagePut xdpy gc (car load-pix)	10 0 (xwem-time-get-load-image win 'load05))
-      (XImagePut xdpy gc (car load-pix)	20 0 (xwem-time-get-load-image win 'load10))
-      (XImagePut xdpy gc (car load-pix)	30 0 (xwem-time-get-load-image win 'load15))
-      (XImagePut xdpy gc (car load-pix)	40 0 (xwem-time-get-load-image win 'load20))
-      (XImagePut xdpy gc (car load-pix)	50 0 (xwem-time-get-load-image win 'load25))
-      (XImagePut xdpy gc (car load-pix)	60 0 (xwem-time-get-load-image win 'load30))
-      (XImagePut xdpy gc (car load-pix)	70 0 (xwem-time-get-load-image win 'load35))
-      (XImagePut xdpy gc (car load-pix)	80 0 (xwem-time-get-load-image win 'load40))
-      (XImagePut xdpy gc (car load-pix)	90 0 (xwem-time-get-load-image win 'load45))
-      (XImagePut xdpy gc (car load-pix)	100 0 (xwem-time-get-load-image win 'load50))
-      (XImagePut xdpy gc (car load-pix)	110 0 (xwem-time-get-load-image win 'load55))
-
-      (XImagePut xdpy mgc (cdr load-pix)	0 0 (xwem-time-get-load-mask win 'load00))
-      (XImagePut xdpy mgc (cdr load-pix)	10 0 (xwem-time-get-load-mask win 'load05))
-      (XImagePut xdpy mgc (cdr load-pix)	20 0 (xwem-time-get-load-mask win 'load10))
-      (XImagePut xdpy mgc (cdr load-pix)	30 0 (xwem-time-get-load-mask win 'load15))
-      (XImagePut xdpy mgc (cdr load-pix)	40 0 (xwem-time-get-load-mask win 'load20))
-      (XImagePut xdpy mgc (cdr load-pix)	50 0 (xwem-time-get-load-mask win 'load25))
-      (XImagePut xdpy mgc (cdr load-pix)	60 0 (xwem-time-get-load-mask win 'load30))
-      (XImagePut xdpy mgc (cdr load-pix)	70 0 (xwem-time-get-load-mask win 'load35))
-      (XImagePut xdpy mgc (cdr load-pix)	80 0 (xwem-time-get-load-mask win 'load40))
-      (XImagePut xdpy mgc (cdr load-pix)	90 0 (xwem-time-get-load-mask win 'load45))
-      (XImagePut xdpy mgc (cdr load-pix)	100 0 (xwem-time-get-load-mask win 'load50))
-      (XImagePut xdpy mgc (cdr load-pix)	110 0 (xwem-time-get-load-mask win 'load55))
-      (X-Win-put-prop win 'load-pixmap load-pix)
-
-      ;; Mail
-      (setq mail-pix (cons (XCreatePixmap xdpy (make-X-Pixmap :dpy xdpy :id (X-Dpy-get-id xdpy))
-					  win depth 36 13)
-			   (XCreatePixmap xdpy (make-X-Pixmap :dpy xdpy :id (X-Dpy-get-id xdpy))
-					  win 1 36 13)))
-      (XImagePut xdpy gc (car mail-pix) 0 0 (xwem-time-get-mail-image win 'letter))
-      (XImagePut xdpy gc (car mail-pix) 18 0 (xwem-time-get-mail-image win 'no-letter))
-
-      (XImagePut xdpy mgc (cdr mail-pix) 0 0 (xwem-time-get-mail-mask win 'letter))
-      (XImagePut xdpy mgc (cdr mail-pix) 18 0 (xwem-time-get-mail-mask win 'no-letter))
-      (X-Win-put-prop win 'mail-pixmap mail-pix)
-
-      )
-    
-    win))
-
-;; Offsets calculators
-(defsubst xwem-time-time-offset (num)
-  (* num 9))
-(defsubst xwem-time-timeam-offset ()
-  (* 10 9))
-(defsubst xwem-time-timepm-offset ()
-  (+ (* 10 9) 4))
-
-(defsubst xwem-time-load-offset (load)
-  (truncate (* load 20)))
-
-(defsubst xwem-time-mail-offset (letter-p)
-  (if letter-p 0 18))
-
-;; Showers
-(defun xwem-time-show (win x y type x-off y-off width height)
-  (let ((pixmap (X-Win-get-prop win type))
-	(mask-pixmap (X-Win-get-prop win 'mask-pixmap)))
-
-    (let* ((xdpy (X-Pixmap-dpy mask-pixmap)))
-      (XSelectInput xdpy win (apply 'Xmask-or (delete XM-Exposure xwem-time-window-mask)))
-
-      (XCopyArea xdpy (cdr pixmap) mask-pixmap
-                 (X-Win-get-prop win 'time-mask-gc)
-		 x-off y-off width height x y)
-      (X-XShapeMask xdpy win X-XShape-Bounding X-XShapeSet 0 0 mask-pixmap)
-      (XCopyArea (X-Win-dpy win) (car pixmap) win
-                 (X-Win-get-prop win 'time-gc)
-		 x-off y-off width height x y)
-
-      (XSelectInput xdpy win (apply 'Xmask-or xwem-time-window-mask))
-      )))
-
-(defsubst xwem-time-show-time0 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 0 0 9 13))
-
-(defsubst xwem-time-show-time1 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 9 0 9 13))
-
-(defsubst xwem-time-show-time2 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 18 0 9 13))
-
-(defsubst xwem-time-show-time3 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 27 0 9 13))
-
-(defsubst xwem-time-show-time4 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 36 0 9 13))
-
-(defsubst xwem-time-show-time5 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 45 0 9 13))
-
-(defsubst xwem-time-show-time6 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 54 0 9 13))
-
-(defsubst xwem-time-show-time7 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 63 0 9 13))
-
-(defsubst xwem-time-show-time8 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 72 0 9 13))
-
-(defsubst xwem-time-show-time9 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 81 0 9 13))
-
-(defsubst xwem-time-show-time-dp (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 90 0 9 13))
-
-(defsubst xwem-time-show-time-am (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 99 0 4 13))
-
-(defsubst xwem-time-show-time-pm (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'time-pixmap 103 0 4 13))
-
-(defsubst xwem-time-show-load-00 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 0 0 10 13))
-
-(defsubst xwem-time-show-load-05 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 10 0 10 13))
-
-(defsubst xwem-time-show-load-10 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 20 0 10 13))
-
-(defsubst xwem-time-show-load-15 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 30 0 10 13))
-
-(defsubst xwem-time-show-load-20 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 40 0 10 13))
-
-(defsubst xwem-time-show-load-25 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 50 0 10 13))
-
-(defsubst xwem-time-show-load-30 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 60 0 10 13))
-
-(defsubst xwem-time-show-load-35 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 70 0 10 13))
-
-(defsubst xwem-time-show-load-40 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 80 0 10 13))
-
-(defsubst xwem-time-show-load-45 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 90 0 10 13))
-
-(defsubst xwem-time-show-load-50 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 100 0 10 13))
-
-(defsubst xwem-time-show-load-55 (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'load-pixmap 110 0 10 13))
-
-(defsubst xwem-time-show-letter (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'mail-pixmap 00 0 18 13))
-
-(defsubst xwem-time-show-no-letter (win x y)
-  "Show 0 at WIN's X Y."
-  (xwem-time-show win x y 'mail-pixmap 18 0 18 13))
-
-(defun xwem-time-show-load (win x y load-number)
-  "In WIN at X Y show load average represented by LOAD-STRING.
-Return how many pixels used."
-  (let ((alist (list (cons "00" 0.0)
-		     (cons "05" (nth 0 xwem-time-load-list))
-		     (cons "10" (nth 1 xwem-time-load-list))
-		     (cons "15" (nth 2 xwem-time-load-list))
-		     (cons "20" (nth 3 xwem-time-load-list))
-		     (cons "25" (nth 4 xwem-time-load-list))
-		     (cons "30" (nth 5 xwem-time-load-list))
-		     (cons "35" (nth 6 xwem-time-load-list))
-		     (cons "40" (nth 7 xwem-time-load-list))
-		     (cons "45" (nth 8 xwem-time-load-list))
-		     (cons "50" (nth 9 xwem-time-load-list))
-		     (cons "55" (nth 10 xwem-time-load-list))
-		     (cons "100000" 100000)))
-	elem load-elem)
-    (while (>= load-number (cdr (setq elem (pop alist))))
-      (setq load-elem elem))
-    (funcall (intern-soft (concat "xwem-time-show-load-" (car load-elem))) win x y))
-  10)
-
-(defun xwem-time-show-time (win x y time-string)
-  "In WIN at X Y show time represented by TIME-STRING.
-Return how may pixels used."
-  (let ((off 0)
-	el)
-    (while (> (length time-string) 0)
-      (setq el (substring time-string 0 1))
-      (cond ((string= el ":")
-	     (xwem-time-show-time-dp win (+ x off) y)
-	     (setq off (+ off 9)))
-	    ((string= el "a")
-	     (xwem-time-show-time-am win (+ x off) y)
-	     (setq off (+ off 4)))
-	    ((string= el "p")
-	     (xwem-time-show-time-pm win (+ x off) y)
-	     (setq off (+ off 4)))
-	    ((string= el " ")
-	     (setq off (+ off 9)))
-	    (t (funcall (intern-soft (concat "xwem-time-show-time" el)) win (+ x off) y)
-	       (setq off (+ off 9))))
-      (setq time-string (substring time-string 1)))
-    off))
-