This manual for XWEM project version
lg@xwem.org-2004/xwem-main-2.0-version-0.

   The manual was last updated May 25, 2003.

   Copyright (C) 2003 Free Software Foundation

   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 of the License, 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 this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

This manual is part of XWEM project.  This documentatin is very poor, so
you better look at .el files for technical stuff.

   TODO: write me

1 Overview
**********

XWEM is full-featured, self-documented, extensible window manager, that
works under XEmacs control.  XWEM does job other window managers do and
provides many features that other window managers not.  XWEM mostly
keyboard driven, but can handle mouse as well.

   If you are looking for very powerful tool to control X applications
or want to modify wm behaviour as you want, XWEM is for you.

   TODO: write me

2 Getting Started
*****************

You must provide some effort in way to make XWEM usable.  Configuring
XWEM splits to three tasks:

2.1 Configuring X
=================

First off all we need to configure keyboard to obtain control over XWEM.
XWEM expects that there is Hyper key setuped on your keyboard and that
Hyper key acts as modifier(i.e.  in X's modifiers list).  Hyper key for
XWEM is like Meta key for XEmacs.  All default commands in XWEM uses
Hyper.  But it is not necessary to use Hyper key, but recommended.  You
can control which modifier to use by 'xwem-hyper-modifier' variable
which default value is 'hyper'.

   There is two ways to configure Hyper key.  One is using XKB X
extension and the other(easier) is using xmodmap application.  Find a
key(keycode) to which you want bind Hyper, using 'xev'(1) utility.
Consider it is value 109.

     $ xmodmap -e "keycode 109 = Hyper_R"
     $ xmodmap -e "add mod3 = Hyper_R"

   or add following to your '~/.Xmodmap'(or whatever):

     keycode 109 = Hyper_R
     add mod3 = Hyper_R

   after that 'xev' should report that keycode 109 have corresponded
Hyper_R keysym.

   Now it is time to modify a little your '~/.xinitrc'.  Who will be
your window manager?  Of course your guess about XEmacs is correct.  So
instead of running for example afterstep or fvwm you need to run XEmacs.
Part of your '~/.xinitrc' should looks like:

     # exec afterstep
     exec xemacs

   You should run 'xinit', or 'startx' with -tcp-listen option,
otherwise xlib will not be able to connect to X server.

   ---------- Footnotes ----------

   (1) xev utility ships with X distribution and used to report X events
and its description to user.

2.2 Configuring Emacs
=====================

Now we are almost ready to run XWEM. Add something like
     (add-to-list 'load-path (expand-file-name "/path/to/xwem"))
     (require 'xwem-load)
     (xwem-init)
   at the end of your '~/.emacs'

   TODO: write how you need to configure emacs, i.e.  what to need to
add in '~/.emacs'.

2.3 Configuring XWEM
====================

You can configure any of XWEM's subroutines using '~/.xwem/xwemrc.el'
file.  It will be evaluated at the top of XWEM-INIT function.

   Here is example of what you can do:

     (setq X-use-queryfont t)		; speeds up things

     ;; We can recreate emacs frame, so there is no problems in deleting
     ;; last frame.
     (setq allow-deletion-of-last-visible-frame t)

     (setq special-display-frame-plist
           (plist-put special-display-frame-plist 'height 50))

     (defadvice kill-buffer (before delete-dedicated-frame activate)
       "Work around dedicated frame problem."
       (let ((frame (buffer-dedicated-frame
                     (get-buffer (or (ad-get-arg 0) (current-buffer))))))
         (when (framep frame)
           (delete-frame frame))))

     ;; Icons
     ;(setq xwem-icons-dir "~/prog/emacs/xwem/icons")
     (pushnew '([".*freebsd.*" "xterm" "XTerm"] . "mini-daemon.xpm")
        xwem-icons-alist)
     (pushnew '([".*xwem.*" "emacs" "Emacs"] . "mini-xwem.xpm")
        xwem-icons-alist)

     ;;; Customize XWEM variables
     (setq xwem-minibuffer-active-border-color "cyan2"
           xwem-default-focus-mode 'follow-mouse
           xwem-edmacro-can-edit-nonmacro t
           )

     (define-abbrev-table 'xwem-launcher-abbrev-table
       '(("gterm" "xterm -fg green -hc green4" nil 0)
         ("gfterm" "xterm -fg green -hc green4 -fn fixed" nil 0)
         ("aqterm" "xterm -fg aquamarine -hc aquamarine4" nil 0)
         ("aqfterm" "xterm -fg aqua -hc aqua4 -fn fixed" nil 0)
         ("gsterm" "xterm -fg darkseagreen1 -hc darkseagreen4" nil 0)
         ("gsfterm"
          "xterm -fg darkseagreen1 -hc darkseagreen4 -fn fixed" nil 0)
         ("oterm" "xterm -fg OliveDrab1 -hc OliveDrab4" nil 0)
         ("ofterm" "xterm -fg OliveDrab1 -hc OliveDrab4 -fn fixed" nil 0)
         ("orterm" "xterm -fg orange -hc orange4" nil 0)
         ("orfterm" "xterm -fg orange -hc orange4 -fn fixed" nil 0)
         ))

     ;; Add sounds, beeping type
     (xwem-sound-load-default t)

     ;;; Addons

     ;; Buqis like client switcher
     (xwem-clswi-enable)

     ;; `display-time' like stuff in system tray
     ;(add-hook 'xwem-after-init-hook 'xwem-time)

     ;; H-6, H-x /, H-x j bindings
     (require 'xwem-register)
     (xwem-register-install-bindings)

     ;; Nice frame indicator
     (autoload 'xwem-framei-init "xwem-framei")
     (add-hook 'xwem-after-init-hook 'xwem-framei-init)

     ;; Making holer in frames
     (require 'xwem-holer)
     (define-key xwem-global-map (xwem-kbd "H-x h") 'xwem-holer-prefix)

     ;; Nice rooter addon
     (require 'xwem-rooter)
     (xwem-rooter-add-client 'xwem-xclock-onroot "^xclock$")
     (xwem-rooter-add-client 'xwem-gkrellm-onroot "^gkrellm$")

     ;; Worklog
     (require 'xwem-worklog)
     (define-key xwem-global-map (xwem-kbd "H-w") 'xwem-worklog-prefix)

     ;; Fast frame switcher
     (defun my-xwem-switch-frame (key)
       "To be used by H-C-<digit> bindings."
       (interactive (list (event-key xwem-last-event)))
       (xwem-frame-switch-nth (- (char-to-int key) 48)))

     (define-key xwem-global-map (xwem-kbd "H-C-0") 'my-xwem-switch-frame)
     (define-key xwem-global-map (xwem-kbd "H-C-1") 'my-xwem-switch-frame)
     (define-key xwem-global-map (xwem-kbd "H-C-2") 'my-xwem-switch-frame)
     (define-key xwem-global-map (xwem-kbd "H-C-3") 'my-xwem-switch-frame)
     (define-key xwem-global-map (xwem-kbd "H-C-4") 'my-xwem-switch-frame)
     (define-key xwem-global-map (xwem-kbd "H-C-5") 'my-xwem-switch-frame)
     (define-key xwem-global-map (xwem-kbd "H-C-6") 'my-xwem-switch-frame)
     (define-key xwem-global-map (xwem-kbd "H-C-7") 'my-xwem-switch-frame)
     (define-key xwem-global-map (xwem-kbd "H-C-8") 'my-xwem-switch-frame)
     (define-key xwem-global-map (xwem-kbd "H-C-9") 'my-xwem-switch-frame)

   TODO: write me

3 Primitives
************

Here is introduction to XWEM primitives, such as Frame, Window, Client,
minibuffer, specials, etc.

3.1 Frame
=========

"Frame" is general thing that used to hold XWEM windows(see Window).
Usually Frame have something like titlebar which is used to display
information related to manager state, such as names for XWEM
Clients(see Client) or user defined information.

   TODO: add some info about Frames properties, such as GCs list, root
window, selected window, etc.

 -- Function: xwem-frame-p frame
     Returns non-'nil' if FRAME is XWEM Frame.

3.1.1 Basic Frames
------------------

TODO: write me

3.1.2 Creating Frames
---------------------

Here is describe functions which is used to create frames.  Also
describe default bindings to create frames.  Describe side by side
splits.

   TODO: write me

3.1.3 Frame Properties
----------------------

Each XWEM Frame have properties list, which is altered when creating
Frame.

   Here should be description of Frame's properties, default values,
etc.

   TODO: write me

3.1.4 Frame Title
-----------------

Description of Frame tabber.

   TODO: write me

3.1.5 Deleting Frames
---------------------

You may easily delete any of XWEM Frame.  All clients that have Frame as
parent window will be reparented to root window.

   Here is should be description for default keybindings for frame
deletion and functions description.

   TODO: write me

3.1.6 Frames Operations
-----------------------

Here is description about what you can do with Frame.  Switching,
linkage switching, etc.

   TODO: write me

3.1.7 Embedded Frames
---------------------

"Embedded Frame" is Frame and CL at the same time.

   Here is description on how to create embedded frames, how to unembed
them and so on.

   TODO: write me

3.1.8 Frames variables and functions
------------------------------------

 -- Variable: xwem-frame-background
     This is symbol specifies background color used in XWEM Frame.  This
     color should be in 'xwem-gc-syscolors' or in
     'xwem-gc-bonus-colors'.
          xwem-frame-backgroud
          => "gray60"

 -- Variable: xwem-frame-cursor-shape
     This specifies shape of cursor when pointer is over XWEM Frame.  It
     is value of one of 'X-XC-'... variable.

          (eq xwem-frame-cursor-shape 'X-XC-left_ptr)
          => t

 -- Variable: xwem-frame-cursor-foreground-color
     Specifies cursor's foreground color when pointer is over XWEM
     Frame.

          xwem-frame-cursor-foreground-color
          => "#002800"

 -- Variable: xwem-frame-cursor-background-color
     Cursor's background color when pointer over XWEM Frame.

 -- Variable: xwem-frame-defprops
     Plist which is used to define default properties for newly created
     XWEM Frames.  Keys in this plist is symbols, you can use one of:

     'title-height' - Height in pixels to be used for title bar.

     'inner-border-width' - Width in pixels of XWEM Frame's inner
     border.

     'otter-border-width' - Width in pixels of XWEM Frame's otter
     border.

     'title-thickness' - Used for 3D view of title bar.

          xwem-frame-defprops
          =>
          (inner-border-width 0
           otter-border-width 0
           title-height 17
           title-thickness 2)

 -- Variable: xwem-face-frame-selected-win-selected
     Face used to outline selected Window in selected Frame.

 -- Variable: xwem-face-frame-selected-win-nonselected
     Face used to outline non-selected Window in selected Frame.

 -- Variable: xwem-face-frame-nonselected-win-selected
     Face to outline selected Window in non-selected Frame.

 -- Variable: xwem-face-frame-nonselected-win-nonselected
     Face to outline non-selected Window in non-selected Frame.

 -- Variable: xwem-face-win-delimeter
     Face to draw Window delimeter.

 -- Variable: xwem-face-win-delimeter-shadow
     Face to draw shadow of Window delimeter.

 -- Variable: xwem-frame-rolling-switch
     Non-nil mean that 'xwem-frame-next' and 'xwem-frame-previous'
     commands will always switch, even if there no next or previous
     Frame.

 -- Variable: xwem-frame-switch-hook
     Hooks to be called when Frame switching occurs (i.e.
     'xwem-current-frame' changes).  Function will receive two arguments
     OLD-FRAME and NEW-FRAME.

 -- Variable: xwem-frame-keymap
     Keymap used in Frames.

 -- Variable: xwem-frames-list
     List of all Frames.

 -- Variable: xwem-current-frame
     Refers to currently selected Frame.

 -- Function: xwem-frame-p frame
     Return non-'nil' if FRAME is valid XWEM Frame.

          (xwem-frame-p t)
          => nil

 -- Function: xwem-frame-alive-p frame
     Return non-'nil' if FRAME is alive frame, i.e.  in
     'xwem-frames-list'.

 -- Function: xwem-frame-mapped-p frame
     Return non-'nil' if FRAME is mapped, i.e.  its contents shown.

 -- Function: xwem-frame-map frame
     Map FRAME, i.e show it contents.

 -- Function: xwem-frame-selected
     Return currently selected Frame.

 -- Function: xwem-frame-selected-p frame
     Return non-'nil' if FRAME is selected Frame.

 -- Function: xwem-frame-select frame &optional dnr-hooks
     Make FRAME to be selected.  Runs 'xwem-frame-switch-hooks' if FRAME
     is not already selected and DNR-HOOKS non-'nil'.

 -- Function: xwem-frame-select-defhook old-frame new-frame
     Default hook that present in 'xwem-frame-switch-hooks'.

   TODO: describe other functions ..

 -- Function: xwem-init-frames
     Initialise all stuff needed to manipulate with XWEM Frames.

 -- Function: xwem-make-frame props
     Creates new Frame with merged 'xwem-frame-defprops' and PROPS
     together properties.

 -- Function: xwem-find-frame xwin
     Find Frame by X Window XWIN

 -- Function: xwem-frame-find how arg
     Find Frame according to HOW and ARG.  HOW can be one of 'xwin',
     'win' or 'cl'.  ARG is X Window, XWEM Window or XWEM Client
     respectively.

 -- Function: xwem-frame-num frame
     Return index position of FRAME in 'xwem-frame-list'.

 -- Function: xwem-frame-draw frame fully
     Draw FRAME.  If FULLY is non-'nil' then 'XClearArea' Frame's X
     window before drawing.

 -- Function: xwem-frame-redraw frame
     Outlines Windows inside FRAME.

 -- Function: xwem-frame-switch-nth n
     Switch to N XWEM Frame in 'xwem-frame-list'.

 -- Function: xwem-frame-del-win &optional frame window
     Removes XWEM WINDOW from XWEM FRAME.

 -- Function: xwem-frame-del-others &optional frame window
     Removes all XWEM Windows from XWEM FRAME other then WINDOW.

 -- Function: xwem-frame-split-horiz &optional frame
     Splits XWEM FRAME horizontally.

 -- Function: xwem-frame-split-vert &optional frame
     Splits XWEM FRAME vertically.

 -- Function: xwem-frame-win-enlarge-hor n
     Enlarges 'xwem-win-selected' in 'xwem-frame-selected' by n pixels
     horizontally.

 -- Function: xwem-frame-win-enlarge-ver n
     Enlarges 'xwem-win-selected' in 'xwem-frame-selected' by n pixels
     vertically.

 -- Function: xwem-frame-goto direction &optional frame
     Go to next XWEM Window in FRAME in DIRECTION.

3.2 Window
==========

In this chapter we will discuss thing related to XWEM's Windows.

3.2.1 Basic Windows
-------------------

"Window" is subpart of Frame(see Frame) that holds Clients (see
Client).  Each Frame always contain at least one Window, but you con
divide it vertically or horizontally to obtain new Windows.  Windows
never overlaps.  There is always selected Window in each Frame, but it
is not guaranties that Client in selected Window will have input focus.

 -- Function: xwem-init-win
     Initilizes all stuff we will need.

 -- Variable: xwem-win-default-properties
     Plist of default properties for newly created Windows.  Keys in
     list is one of symbol:
        * 'dead' Window referenced but not workable.
        * 'deleted' Deleted Windows have this non-'nil'.
        * 'frame' Reference to XWEM Frame.
        * 'next' Next window in windows double linked list.
        * 'prev' Previous window in windows double linked list.
        * 'hchild' Horizontal child.
        * 'vchild' Vertical child.
        * 'client' Link to XWEM Client that is in XWEM Window or 'nil'.
        * 'expectances' Expectances plist for XWEM Window.

 -- Function: xwem-win-p win
     Return non-'nil' if WIN is Window.

3.2.2 Splitting Windows
-----------------------

Functions described here is used in way to split XWEM's window or get
information about split.

 -- Variable: xwem-win-min-width
     Minimal width in pixels that XWEM Window may have after spliting.

          xwem-win-min-width
          => 40

 -- Variable: xwem-win-min-height
     Minimal height in pixels that XWEM Window may have after spliting.

          xwem-win-min-height
          => 40

 -- Function: xwem-win-split &optional window how new-size
     Splits XWEM WINDOW, HOW is one of 'vertical' or
     'horizontal'(default is 'horizontal').  NEW-SIZE is size in pixels
     which should have WINDOW after split.

 -- Function: xwem-win-only-one-p &optional window
     Returns non-'nil' if WINDOW is only one in XWEM Windows chain.

3.2.3 Deleting Windows
----------------------

 -- Function: xwem-window-delete &optional window
     Deletes XWEM WINDOW.  If ommited than 'xwem-win-selected' will be
     used.

 -- Function: xwem-window-delete-others &optional window
     Deletes all XWEM Windows other then WINDOW.

 -- Function: xwem-win-delete-subwindows window
     Mark all child of XWEM WINDOW as deleted.

 -- Function: xwem-win-mark-deleted window

3.2.4 Selecting Windows
-----------------------

Select a window means that client currently in than window receives
input focus.

 -- Variable: xwem-win-switch-hook
     Hooks that will be runned when selected window changes.  Functions
     in should accept two arguments - 'old-win' and 'new-win'.

          xwem-win-switch-hook
          => (xwem-win-focus xwem-win-title)

 -- Function: xwem-win-selected
     Returns selected XWEM Window.

 -- Function: xwem-win-selected-p window
     Return non-'nil' if WINDOW is selected.

 -- Function: xwem-window-select window
     Select WINDOW as current XWEM Window.  Runs
     'xwem-win-switch-hooks'.

3.2.5 Cycling Windows
---------------------

 -- Function: xwem-win-make-list-by-next window
     Creates list of XWEM Windows using 'next' property.

 -- Function: xwem-win-new props
     Creates new XWEM Window using properties obtained after merging
     'xwem-window-defprops' and PROPS together.

 -- Function: xwem-win-replace oldw neww
     Replace OLDW XWEM Window with contents of NEWW XWEM Window.

 -- Function: xwem-win-make-parent window
     Creates dummy parent XWEM Window for WINDOW.

 -- Function: xwem-window-next &optional window
     Returns next XWEM Window after WINDOW in canonical ordering.

 -- Function: xwem-window-next-vertical &optional window
     Returns XWEM Window which is vertically after WINDOW.

 -- Function: xwem-window-prev &optional window
     Returns previous XWEM Window before WINDOW in canonical ordering of
     XWEM Windows.

 -- Function: xwem-win-map fn &optional window
     Apply FN function to WINDOW and each child of it.  FN will be
     called with an XWEM Window as argument.

 -- Function: xwem-win-count &optional window
     Count childs in WINDOW.

 -- Function: xwem-window-list &optional frame
     nil

   Here is somelike windmove package.

 -- Function: xwem-winmove-left &optional arg
     Move to the left.  TODO: describe ARG.

 -- Function: xwem-winmove-right &optional arg
     Move to the right.  TODO: describe ARG.

 -- Function: xwem-winmove-up &optional arg
     Move to the up.  TODO: describe ARG.

 -- Function: xwem-winmove-down &optional arg
     Move to the down.  TODO: describe ARG.

   TODO: write me

3.2.6 Resizing Windows
----------------------

Here functions that operations on window's sizes.

 -- Function: xwem-window-set-pixsize window nsize nodelete is-height
     Sets size of WINDOW to NSIZE in pixels.  If IS-HEIGHT is non-'nil'
     then nsize is new WINDOW height.

 -- Function: xwem-window-change-size window delta height-p
     Changes XWEM WINDOW size to old-size plus DELTA.  HEIGHT-P is
     non-'nil' if height changes.

   TODO: add shrink and enlarge

3.2.7 Window Configurations
---------------------------

 -- Function: xwem-window-configuration &optional frame
     Return current Windows configuration for FRAME.  You can restore it
     than using 'xwem-set-window-configuration'.

 -- Function: xwem-set-window-configuration win-config
     Restore window configuration WIN-CONFIG, returned by
     'xwem-window-configuration'.

3.2.8 Drawing Windows
---------------------

 -- Variable: xwem-win-delim-width
     XWEM Window delimeter width in pixels, including shadow.

 -- Variable: xwem-win-delim-shadow-thicksness
     When drawing 3D shadows for XWEM Window delimeters, this variable
     used.

 -- Function: xwem-win-draw-delims window
     Draws delimeters in XWEM WINDOW.

3.2.9 Window Expectances
------------------------

"Expectances" is thing describes which clients cirtain XWEM Window wait
to manage.

   TODO: write me

3.3 Client
==========

"Client" is normal X11 application already managed by XWEM. All XWEM
Clients manages according to XWEM Manage Database(see Manage Database).
Default behaviour is to enlarge each XWEM Client which
have no override redirect flag ot XWEM Window used to hold that Client.

3.3.1 Client Basics
-------------------

TODO: describe what is XWEM Client.

 -- Function: xwem-cl-p client
     Returns non-'nil' if CLIENT is Client.

3.3.2 Client Properties
-----------------------

Each Client in XWEM have some properties associated with it.

 -- Function: xwem-client-name cl &optional clist
     Return unique name for Client CL using CLIST as list of Clients.

3.3.3 Current Client
--------------------

"Current Client" is client in selected Window.

   TODO: describe things related to special XEmacs frames.

 -- Function: xwem-cl-selected
     Return selected Client.

3.3.4 Clients Lists
-------------------

TODO: describe client lists.

 -- Variable: xwem-clients
     List of all Clients.

3.3.5 Client Hooks
------------------

TODO: genaral overview of hooks used in Client processing.

 -- Variable: xwem-cl-setup-hooks
     List of hooks which is called after XWEM Client is managed.
     Functions in that list should accept one argument - XWEM Client.

 -- Variable: xwem-cl-manage-hook
     Functions to call when Client managed.  They are passed with one
     argument - 'cl'.

 -- Variable: xwem-cl-demanage-hook
     Functions to call when Cliend demanages.  Called with with one
     argument - 'cl'.

3.3.6 Operating on Clients
--------------------------

Here is some usefull functions you can use to operate on Clients.

 -- Function: xwem-find-client xwin-or-id
     Find Client by X window XWIN-OR-ID.

 -- Function: xwem-remove-client cl
     Remove CL from Clients list 'xwem-clients'.

   TODO: write me

3.4 XWEM Minibuffer
===================

"XWEM minibuffer" is global minibuffer(usually value of
DEFAULT-MINIBUFFER-FRAME) used as minibuffer by all XEmacs frames.

   TODO: write me

4 XWEM Subsystems
*****************

There many subsystems in XWEM. Such as keyboard operations, pointer
operations, text and graphical contexts operations, manage database
operations and so on.

   TODO: write me

4.1 Keyboard
============

Keyboard support in XWEM is much like how XEmacs deals with keyboard
i.e.  keymap notation used to interpret key sequences to commands
relation.

4.1.1 Keymaps
-------------

Keymaps used in XWEM is:

 -- Variable: xwem-global-map
     This is global XWEM keymap.

 -- Variable: xwem-help-map
     Keymap for help commands.

 -- Variable: xwem-hyp-x-map
     This keymap is for Hyper-X commands.

 -- Variable: xwem-hyp-x-4-map
     Keymap for Hyper-X-4 commands.

 -- Variable: xwem-hyp-x-5-map
     Keymap for Hyper-X-5 commands.

 -- Variable: xwem-hyp-x-7-map
     Keymap for Hyper-X-7 commands.

 -- Variable: xwem-launcher-map
     Keymap for XWEM launcher.

 -- Variable: xwem-launcher-other-win-map
     Keymap for launcher commands in other Window.

 -- Variable: xwem-launcher-other-frame-map
     Keymap for launcher commands in other Frame.

 -- Variable: xwem-user-macros-map
     Keymap for user's keyboard macros.

 -- Variable: xwem-hyp-resize-map
     Keymap for Window resize commands.

4.1.2 Keymap Operations
-----------------------

TODO: write me

4.1.3 Smart Modifiers
---------------------

"Smart modifier" is key which can act as modifier when it is used in
combination with some other key and as normal key when it is just
clicked i.e.  pressed and released.

   To use smart modifiers you must set '(setq xwem-use-smart-modifiers
t)', default is 'nil'.  And add items to 'xwem-key-smart-modifiers'.
Item is vector in form '[Modifier-keysym Key-Keysym nil nil]'.  Second
and third elements is used internally and it is no need to fill them.

   Example:
     (add-to-list 'xwem-key-smart-modifiers (vector XK-Control-R XK-Space nil
     nil))
             => add right control to active grabs and send space key
             when it is clicked.

4.2 Mouse
=========

When I was planning to write XWEM I thought that mouse support will be
minimal, but when I played a little with X11 stuff I realized where
mouse may be used to get really useful functionality.  Main mouse
feature over keyboard is that you can generate multiple movement or
button press/release events in a moment.  It can be used to interact
with Strokes.

   "Stroke" is some mouse motion which yields some command.

   TODO: xwem strokes description.

   TODO: popup menus description.

4.3 Text
========

"Text Specification" is list of conses in form '(lala-text . GC)'.

   TODO: write me

4.4 Manage Database
===================

"Manage Database" is list of some information about certain X11
applications.  It contain info about how to deal with that X11
application, how it should managed, demanaged, iconified, refited, etc.

   TODO: write me

4.5 System Tray
===============

"System Tray" is some area in your screen, that used to hold some X
applications called dock applications or dockapps in short.  XWEM's
system tray uses XWEM Minibuffer as that area, so you does not
lost it.  It is morden to implement system tray using XEMBED protocol,
which describes how dockapps and tray window should communicate.  XWEM's
system tray uses extended version of XEMBED protocol, which allow any
dockapp to run Emacs Lisp!

 -- Variable: xwem-tray-enabled
     Non-'nil' mean that System tray will be used by XWEM.

 -- Variable: xwem-tray-max-docks
     Maximum number of dockapps to be used in system tray.  If value is
     to much, than system tray may eat too much space in XWEM's
     minibuffer and you will not be able to comfortable interact with
     it.  Default value is 6.

 -- Variable: xwem-tray-minib-position
     Symbol that may be ''right' or ''left' specifies position in XWEM's
     minibuffer where first dockapp appears.

 -- Variable: xwem-tray-minib-posoffset
     Offset in pixels from XWEM's minibuffer edge.

 -- Variable: xwem-tray-minib-docoffset
     Offset in pixels between two dockapps.

 -- Variable: xwem-tray-cursor-shape
     Shape of cursor when pointer is over one of dockapp, see 'X-XC-XXX'
     constants values.  Default is value of 'X-XC-right_ptr'.

 -- Variable: xwem-tray-cursor-foreground-color
     Specifies foreground color of cursor, when pointer is over one of
     dockapp.

 -- Variable: xwem-tray-cursor-background-color
     Cursor's background color, when pointer over System tray.

 -- Variable: xwem-tray-config
     This is a list of vectors and each vector is in form '[type
     value]'.  Type is one of 'XWEM-TRAY-DOCK' or 'XWEM-TRAY-DELIM'.  If
     type is 'XWEM-TRAY-DOCK' than value is string and it specifies
     program and program's arguments you need to launch and put in
     system tray.  If type is 'XWEM-TRAY-DELIM' than value is integer,
     which specifies offset in pixels to be inserted in system tray.
          xwem-tray-config
          =>
          ([XWEM-TRAY-DOCK "/path/to/xwem-minitime -f 004400 -b bbbbbb"]
           [XWEM-TRAY-DOCK "/path/to/xwem-miniapm"]
           [XWEM-TRAY-DELIM 10]
           [XWEM-TRAY-DOCK "path/to/xwem-minilaunch
                            -l /path/to/icons/xterm.xpm xterm"]
           [XWEM-TRAY-DOCK "/path/to/xwem-minilaunch
                            -l /path/to/icons/xterm_big.xpm
                            xterm -fn 10x20"]
           [XWEM-TRAY-DOCK "/path/to/xwem-minilaunch
                            -e \"(make-frame)\"
                            /path/to/icons/xemacs.xpm emacs"]
           [XWEM-TRAY-DOCK "/path/to/xwem-minilaunch
                            -l /path/to/icons/netscape.xpm
                            netscape"])

 -- Function: xwem-tray-run-config &optional config
     This function takes CONFIG in format described above, and executes
     it.  See example of its usage.
          (add-hook 'xwem-after-init-hooks 'xwem-tray-run-config)

4.6 Help
========

Help subsysem in XWEM is much like XEmacs help subsystem.

   TODO: write me

5 Hooking
*********

XWEM supports multiple hooks across its routines.  Here is some basic
hooks that you can use to alter XWEM behaviour.

   TODO: write me

6 Addons
********

XWEM have some usefull packages in its distribution.

   * 'xwem-clswi.el' Buqis like client switching.

   * 'xwem-diagram.el' Diagram drawer for XWEM.
        - Bars diagrams.
        - Circle digrams.
        - Plain digrams.
        - 3D digrams.

   * 'xwem-edmacro.el' Addon to edit keyboard macros.

   * 'xwem-framei.el' Frame indicator.

   * 'xwem-gamma.el' Interactive gamma corrector.

   * 'xwem-holer.el' Create holes in Frames.

   * 'xwem-osd.el' On Screen Display for XWEM.

   * 'xwem-register.el' Registers for XWEM.

   * 'xwem-rooter.el' Handle Clients on root window.

   * 'xwem-time.el' 'display-time' like dockapp.

   * 'xwem-worklog.el' Keep track on what you are doing.

   * 'xwem-xfig.el' XFIG format.

   TODO: more packages description, tutorial on how to write XWEM
packages.

7 Logging
*********

XWEM support some logging facilities.  Add next to your
'~/.xwem/xwemrc.el':

     (setq xwem-debug t)

   If you want more debugging stuff, you can use 'xmond' utility.

   TODO: write me

8 Licenses
**********

I think there is must be GPL text.