Here is basic overview of XWEM. What it is. Why it is needed. Why one should use it. etc
TODO: write me
You must provide some effort in way to make XWEM usable. Configuring XWEM splits to three tasks:
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 Emacs. All default commands in XWEM uses Hyper, it is not necessary, but recommended, so XWEM bindings will not overlaps with keybindings of other X application.
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
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 emacs is correct. So
instead of running afterstep for example you need to run emacs. 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.
Now we are almost ready to run XWEM. Add something like
(add-to-list 'load-path (expand-file-name "/path/to/xwem")) (require 'xwem-main) (xwem-init)
at the end of your ~/.emacs
(or whatever)(2).
TODO: write how you need to configure emacs, i.e. what to need to add in
~/.emacs
.
You may configure any of XWEM's subroutines using ~/.xwemrc.el
file. It will be evaluated at the top of xwem-init function.
Here is example of what you can do:
;; Since we are using `background' to start processes, customize it a ;; little. (setq background-show nil) ; do not show jobs buffers ;; Debugging stuff (when (getenv "XWEMDEBUGGING") (setq X-debugging t) (setq debug-on-error t)) ;; Add our GCs, it will be used to display gnus info (setq xwem-gc-bonus-gcs (list (xwem-gc-new 'my-titl1 'black 'black "-cronyx-courier-bold-r-normal--10-*-*-*-m-*-koi8-r" X-LineSolid 1) (xwem-gc-new 'my-titl2 'black 'black "-cronyx-courier-medium-r-normal--10-*-*-*-m-*-koi8-r" X-LineSolid 1) (xwem-gc-new 'my-titl3 'black 'black "-cronyx-courier-medium-o-normal--10-*-*-*-m-*-koi8-r" X-LineSolid 1) )) ;; We want gnus info in frame's title (require 'gnus) (defun myxwem-display-gnusinfo (frame) (let ((gnacin (gnus-active "mail.misc"))) (when gnacin (let* ((gntextsp (list (cons "Gnus: " (xwem-gc-get xwem-gcs-list 'my-titl2)) (cons (int-to-string (car gnacin)) (xwem-gc-get xwem-gcs-list 'my-titl1)) (cons (concat "/" (int-to-string (cdr gnacin))) (xwem-gc-get xwem-gcs-list 'my-titl2)))) (gnth (xwem-textsp-height gntextsp)) (gntw (xwem-textsp-width gntextsp))) (xwem-textsp-draw (xwem-dpy) (xwem-frame-win frame) (- (xwem-frame-get-prop frame 'width) (+ gntw 10)) gnth gntextsp))) )) (add-hook 'xwem-frame-after-title-hooks 'myxwem-display-gnusinfo) ;; TODO: add system tray configuration
TODO: what you may add to ~/.xwemrc.el
.
Here is introduction to XWEM primitives, such as frame, window, client, minibuffer, specials, etc.
Frame is general thing that used to hold XWEM windows(see section Window). Usually Frame have something like titlebar which is used to display information related to manager state, such as names for XWEM Clients(see section Client) or user defined information.
TODO: add some info about Frames properties, such as GCs list, root window, selected window, etc.
xwem-gc-syscolors
or in xwem-gc-bonus-colors
.
xwem-frame-backgroud => gray60
X-XC-
... variable.
(eq xwem-frame-cursor-shape X-XC-left_ptr) => t
NOTE: second vector(which defines background color) may be ommited.
xwem-frame-cursor-color => ([0 10000 0] [0 20000 0]) xwem-frame-cursor-color => ([0 0 20000])
title-height
- Height in pixels to be used for title bar.
border-width
- Width in pixels of XWEM Frame border.
title-thickness
- Used for 3D view of title bar.
xwem-frame-defprops => (root nil selected nil border t border-width 0 title t title-height 16 title-thickness 2 rw-border-width 0 attachable nil)
frame
symbol to refer to frame for which textspec is used.
See also see section Text.
xwem-frame-title-format
displayed. Functions in this variable
must accept one argument - frame
for which title
displayed. xwem-frame-after-title-hooks
variable should be used
to display additional information in XWEM Frame's title bar.
xwem-frame-after-title-hooks => xwem-my-display-gnus-info
xwem-current-frame
changes. It runs after
switching. Functions in xwem-frame-switch-hooks
must accept two
arguments - old-frame
and new-frame
.
xwem-frame-switch-hooks => (xwem-frame-focus xwem-frame-select-defhook)
nil
if frame is XWEM Frame.
(xwem-frame-p (xwem-frame-dummy)) => t
xwem-current-frame
).
nil
if frame is selected XWEM Frame.
xwem-frame-switch-hooks
if
frame is not already selected.
xwem-frame-defprops
and
props together properties.
'xwin
, 'win
or 'cl
and value of arg which
should be of appopriate type.
xwem-frame-list
.
NOTE: Actually each XWEM Frame should have his own exposes-counter.
xwem-frame-exposes-counter
is
equal to zero to not make same thing multiple times.
nil
then
XClearArea
window before drawing.
xwem-frame-after-title-hooks
.
xwem-frame-list
.
xwem-win-selected
in xwem-frame-selected
by n
pixels horizontally.
xwem-win-selected
in xwem-frame-selected
by n
pixels vertically.
Window is subpart of XWEM Frame(see section Frame) that holds XWEM Clients (see section Client). Each XWEM Frames always contain at least one XWEM Window, but you con divide it vertically or horizontally to obtain new XWEM Windows. XWEM Windows never overlaps. There is always selected XWEM Window in each XWEM Frame, but it is not guaranties that selected XWEM Window will have input focus.
xwem-win-min-width => 40
xwem-win-min-height => 40
'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
.
old-win
and new-win
.
xwem-win-switch-hooks => (xwem-win-focus xwem-win-title)
nil
if win is XWEM Window.
(eq (xwem-win-p (xwem-win-dummy))) => t
nil
if window is selected.
xwem-win-switch-hooks
.
'next
property.
xwem-window-defprops
and props together.
nil
then nsize is new window
height.
xwem-win-selected
will
be used.
nil
if window is only one in XWEM Windows chain.
xwem-set-win-config
.
xwem-curr-win-config
in frame.
'vertical
or
horizontal
(default is 'horizontal
). new-size is size
in pixels which should have window after split.
nil
if height changes.
Client is normal X11 application already managed by XWEM. All XWEM Clients manages according to XWEM Manage Database(see section Manage Database). Default behaviour is to enlarge each XWEM Client which have no override redirect flag ot XWEM Window used to hold that Client.
nil
if client is XWEM Client.
(xwem-cl-p (xwem-cl-dummy)) => t
Xwemcl-WM-NORMAL-HINTS
,
Xwemcl-WM-HINTS
, Xwemcl-WM-CLASS
,
Xwemcl-WM-COMMAND
, Xwemcl-WM-NAME
, Xwemcl-WM-TRANSIENT-FOR
.
xwem-clients
.
TODO: write me
XWEM minibuffer is global minibuffer(usually value of default-minibuffer-frame) used as minibuffer by all Emacs frames.
XWEM minibuffer is described in section Manage Database by default.
TODO: write me
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
Keyboard support in XWEM is much like how Emacs deals with keyboard i.e. keymap notation used to interpret key sequences to commands relation.
Keymaps used in xwem is:
TODO: write me
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.
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.
Text Specification is list of conses in form (lala-text . GC)
.
TODO: write me
Manage Database is list of some information about certain X11 application. It contain info about how to deal with that X11 application, how it should managed, demanaged, iconified, refited, etc.
TODO: write me
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 section 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!
nil
means that user want system tray support in XWEM.
'right
or 'left
specifies position in
XWEM's minibuffer where first dockapp appears.
X-XC-XXX
constants values. Default is value of X-XC-right_ptr
.
'([0 0 30000] [0 0 15000])
.
[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"])
(add-hook 'xwem-after-init-hooks (lambda () (xwem-tray-run-config xwem-tray-config)))
XWEM supports multiple hooks across each routines. Here is some basic hooks that you can use to alter XWEM behaviour.
TODO: describe xwem-xXXX hooks
XWEM support some logging facilities. To obtain some debug info you may want to make next:
(setq X-debugging t) (setenv "DISPLAY" "127.0.0.1:4")
and run xmond to listen 6004 port which corresponds to 4 display number.
TODO: write me
Xlib is powerfull Emacs interface to X server. It supports most of things specified in X protocol and some its extensions. It can handle X windows, X graphical contexts, X fonts and more.
TODO: write me
TODO: write me
TODO: write me
TODO: write me
TODO: write me
TODO: write me
TODO: write me
TODO: write me
I think there is must be GPL text.
Jump to: c - d - e - f - g - h - i - k - l - m - o - p - s - t - w - x
xev utility ships with X distribution and used to report X events and its description to user.
Note that XWEM is not yet works after compilation, so maybe there is need to remove any of .elc files from xwem's directiory.
This document was generated on 9 August 2003 using texi2html 1.56k.