Commits

youngs  committed f4c4c73

2005-01-01 Steve Youngs <steve@youngs.au.com>

* Makefile (AUTHOR_VERSION): Bump.
(REQUIRES): Add elib, ilisp, and mail-lib.

This is the version 2.0 release. For details see
ChangeLog.upstream.

  • Participants
  • Parent commits 7484cd5

Comments (0)

Files changed (72)

+2005-01-01  Steve Youngs  <steve@youngs.au.com>
+
+	* Makefile (AUTHOR_VERSION): Bump.
+	(REQUIRES): Add elib, ilisp, and mail-lib.
+
+	This is the version 2.0 release.  For details see
+	ChangeLog.upstream. 
+
 2004-09-16  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.18 released.

File ChangeLog.upstream

+# do not edit -- automatically generated by arch changelog
+# non-id: automatic-ChangeLog--lg@xwem.org--2004/xwem--main--2.0
+#
+
+2005-01-01 02:30:16 GMT	Zajcev Evgeny <lg@xwem.org>	version-0
+
+    Summary:
+      Version 2.0 is released
+    Revision:
+      xwem--main--2.0--version-0
+
+
+    new files:
+     .arch-ids/README.id README
+
+
+2004-12-29 22:32:15 GMT	Zajcev Evgeny <lg@xwem.org>	patch-19
+
+    Summary:
+      xparent problem kind of fix, dedicated problem kind of fix
+    Revision:
+      xwem--main--2.0--patch-19
+
+    * lisp/xwem-clgen.el (on-kill): [fix?] Do not do XDestroyWindow
+    
+    * lisp/xwem-clients.el (xwem-clded-disassociate-frame): [fix] check
+      xwem-cl-win for validity before operating on it.
+    
+    
+
+    modified files:
+     lisp/xwem-clgen.el lisp/xwem-clients.el
+
+
+2004-12-23 22:26:45 GMT	Zajcev Evgeny <lg@xwem.org>	patch-18
+
+    Summary:
+      very tiny fixes
+    Revision:
+      xwem--main--2.0--patch-18
+
+    * lisp/xwem-icons.el (xwem-icons-list): [fix] Removed redundant .*
+    
+    * lisp/xwem-keymacro.el (xwem-misc): [addon] Require xwem-misc
+    
+    * lisp/xwem-manage.el (xwem-applications-alist): [fix] xemacs to match
+      GNU Emacs, XEmacs and SXEmacs.
+    
+    
+    
+
+    modified files:
+     lisp/xwem-icons.el lisp/xwem-keymacro.el lisp/xwem-manage.el
+
+
+2004-12-20 21:03:40 GMT	Zajcev Evgeny <lg@xwem.org>	patch-17
+
+    Summary:
+      Merged with 2004-w
+    Revision:
+      xwem--main--2.0--patch-17
+
+    Patches applied:
+    
+     * dev@xwem.org--2004-w/xwem--dev--2.0--patch-3
+       Merged with main, some fixes
+    
+
+    modified files:
+     Makefile lisp/xwem-keymacro.el lisp/xwem-minibuffer.el
+     lisp/xwem-misc.el man/Makefile
+
+    new patches:
+     dev@xwem.org--2004-w/xwem--dev--2.0--patch-3
+
+
+2004-12-19 22:45:44 GMT	Zajcev Evgeny <lg@xwem.org>	patch-16
+
+    Summary:
+      xwem tray fixes to support dockapp's map/unmap, osd fix
+    Revision:
+      xwem--main--2.0--patch-16
+
+    * lisp/xwem-keyboard.el (xwem-kbd-quit): [typo]
+    
+    * lisp/xwem-tray.el (xwem-tray-remove-dapp): [fix] check dapp state.
+    
+    * lisp/xwem-tray.el (xwem-tray-hide-dapp): [new]
+    
+    * lisp/xwem-tray.el (xwem-tray-show-dapp): [new]
+    
+    * lisp/xwem-tray.el (xwem-tray-get-proper-position): [fix] check dapp's
+      state.
+    
+    * lisp/xwem-tray.el (xwem-tray-new-dapp): [fix] change dapp's state after
+      XMapWindow.
+    
+    * lisp/xwem-tray.el (xwem-tray-init): [fix] Handle MapNotify/UnmapNotify
+      events.
+    
+    * lisp/xwem-tray.el (xwem-tray-handle-xevent): [fix] Handle
+      MapNotify/UnmapNotify events.
+    
+    * utils/xwem-osd.el (xwem-osd-rect-add): [Sem] Optional FILL-P argument
+      added.
+
+    modified files:
+     lisp/xwem-keyboard.el lisp/xwem-tray.el utils/xwem-osd.el
+
+
+2004-12-19 01:40:32 GMT	Zajcev Evgeny <lg@xwem.org>	patch-15
+
+    Summary:
+      compile custom-load.el 
+    Revision:
+      xwem--main--2.0--patch-15
+
+    * Makefile (EXTRA_OBJ): [addon] custom-load.elc
+    
+    * Makefile (distclean): [addon] remove .elc files expilicitely.
+
+    modified files:
+     Makefile
+
+
+2004-12-19 00:00:11 GMT	Zajcev Evgeny <lg@xwem.org>	patch-14
+
+    Summary:
+      typo fix
+    Revision:
+      xwem--main--2.0--patch-14
+
+    * lisp/xwem-keyboard.el (xwem-kbd-xksym->xkcode): [typo] fixed.
+
+    modified files:
+     lisp/xwem-keyboard.el
+
+
+2004-12-18 23:52:35 GMT	Zajcev Evgeny <lg@xwem.org>	patch-13
+
+    Summary:
+      xwem-icons-list fixed, keyboarding fixed
+    Revision:
+      xwem--main--2.0--patch-13
+
+    * lisp/xwem-icons.el (xwem-icons-list): [fix] ".Term" -> ".[tT]erm" to
+      work with eterm and kterm.
+    
+    * lisp/xwem-keyboard.el (xwem-kbd-xksym->xkcode): [rewritten] now should
+      work properly with multiple keyboard groups.  This is important for
+      multi kbd layout users, such as Russians.
+
+    modified files:
+     lisp/xwem-icons.el lisp/xwem-keyboard.el
+
+
+2004-12-18 21:31:38 GMT	Zajcev Evgeny <lg@xwem.org>	patch-12
+
+    Summary:
+      merge with dev@xwem.org--2004-w/xwem--dev--2.0
+    Revision:
+      xwem--main--2.0--patch-12
+
+    * Makefile: Dependances adding started.
+    
+    * lisp/xwem-clgen.el (xwem-clgen-other-client): [fix] skip iconified
+      clients.
+    
+    * lisp/xwem-clients.el (xwem-cl-other): [fix] skip iconified clients.
+    
+    * lisp/xwem-frame.el (xwem-dedicated-frame-defalut-properties): [new]
+      Default properties for dedicated frames.
+    
+    * lisp/xwem-frame.el (xwem-make-frame-1): [addon] properties merging
+      according to desktop type.
+    
+    * lisp/xwem-frame.el (xwem-frame-adjust-geom): [addon] Adjust geometry
+      according to current xwem minibuffer state.
+    
+    * lisp/xwem-frame.el (xwem-frame-configuration): [addon] Use
+      'initially-unmapped for currently unmapped frames.
+    
+    * lisp/xwem-frame.el (xwem-frame-goto): [addon] Support for negative N.
+    
+    * lisp/xwem-frame.el (xwem-frame-imove-internal): [fix] Disallowed for
+      embedded frames.
+    
+    * lisp/xwem-keyboard (xwem-self-insert-or-undefined): [fix] Do nothing if
+      selected client is dummy.
+    
+    * lisp/xwem-keydefs (xwem-global-map): `H-x o' added to execute
+      `xwem-other-window'
+    
+    * lisp/xwem-minibuffer (xwem-minib-focusin-outline): [rem] was commented
+      for long time.
+    
+    * lisp/xwem-minibuffer (xwem-minib-focusout-outline): [rem] was commented
+      for long time.
+    
+    * lisp/xwem-minibuffer (xwem-minibuffer-init): Use
+      `xwem-misc-merge-plists'.
+    
+    * lisp/xwem-misc.el (xwem-message-1): [addon] limit print level
+    
+    * lisp/xwem-misc.el (xwem-misc-make-screenshot): [addon] Do it in post
+      deferring hook, so screenshot will be made, after minibuffer
+      deactivation.
+    
+    * lisp/xwem-misc.el (xwem-debug): [addon] limit print level
+    
+    * lisp/xwem-report.el (xwem-report-debug): print-level set to 4
+    
+    * lisp/xwem-struct.el (xwem-frame-saved): [addon] selected-p added,
+      denotes is frame was selected at dump time.
+    
+    * lisp/xwem-theme.el: Continuing structuring, not yet in shape.
+    
+    * lisp/xwem-tray.el (xwem-tray): [addon] xgeom slot added.
+    
+    * lisp/xwem-tray.el (xwem-tray-move-dapp): [addon] allow to ommit NEW-X,
+      NEW-Y.
+    
+    * lisp/xwem-tray.el (xwem-dapp-handle-xevent): [new] general X Events
+      handler for dockapps.
+    
+    * lisp/xwem-tray.el (xwem-tray-handle-xevent): [new] general X Events
+      handler for systray.  Support for handling ConfigureNotify events
+      added.  All dockapps are vertically realligned when systray changes its
+      height.
+    
+    * lisp/xwem-win.el (xwem-other-window): [new] alias to fixed
+      `xwem-frame-goto-next'.
+    
+    * lisp/xwem-win.el (xwem-set-window-configuration): [fix] get rid of evil
+      xwem-win-config-current-window.
+    
+    * lisp/xwem-win.el (xwem-win-restore-win-params): [fix] Ditto.
+    
+
+    modified files:
+     Makefile lisp/xwem-clgen.el lisp/xwem-clients.el
+     lisp/xwem-frame.el lisp/xwem-keyboard.el lisp/xwem-keydefs.el
+     lisp/xwem-minibuffer.el lisp/xwem-misc.el lisp/xwem-report.el
+     lisp/xwem-struct.el lisp/xwem-theme.el lisp/xwem-tray.el
+     lisp/xwem-win.el {arch}/=tagging-method
+
+    new patches:
+     dev@xwem.org--2004-w/xwem--dev--2.0--patch-1
+     dev@xwem.org--2004-w/xwem--dev--2.0--patch-2
+
+
+2004-12-17 10:58:28 GMT	Evgeny Zajcev <lg@xwem.org>	patch-11
+
+    Summary:
+      some files moved from lisp/ to extra/
+    Revision:
+      xwem--main--2.0--patch-11
+
+    * lisp/xwem-gamma.el (moved): to extra
+    
+    * lisp/xwem-rooticon.el (moved): Ditto.
+    
+    * lisp/xwem-ratanot.el (moved): Ditto.
+    
+
+    renamed files:
+     lisp/.arch-ids/xwem-gamma.el.id
+       ==> extra/.arch-ids/xwem-gamma.el.id
+     lisp/.arch-ids/xwem-ratanot.el.id
+       ==> extra/.arch-ids/xwem-ratanot.el.id
+     lisp/.arch-ids/xwem-rooticon.el.id
+       ==> extra/.arch-ids/xwem-rooticon.el.id
+     lisp/xwem-gamma.el
+       ==> extra/xwem-gamma.el
+     lisp/xwem-ratanot.el
+       ==> extra/xwem-ratanot.el
+     lisp/xwem-rooticon.el
+       ==> extra/xwem-rooticon.el
+
+
+2004-12-17 00:53:20 GMT	Evgeny Zajcev <lg@xwem.org>	patch-10
+
+    Summary:
+      .arch-inventory fixes, xwem-edprops-mode fix
+    Revision:
+      xwem--main--2.0--patch-10
+
+    * extra/xwem-edprops.el (xwem-edprops-mode): [pbug] set default to nil.
+
+    modified files:
+     extra/xwem-edprops.el lisp/.arch-inventory man/.arch-inventory
+
+
+2004-12-15 20:47:34 GMT	Evgeny Zajcev <lg@xwem.org>	patch-9
+
+    Summary:
+      xwem-debug, popup menu fix, transpose win fix
+    Revision:
+      xwem--main--2.0--patch-9
+
+    * lisp/xwem-win.el (xwem-transpose-windows): [bug] fix.
+    
+    * lisp/xwem-misc.el (xwem-debug): [new] For debugging output.
+    
+    * lisp/xwem-keyboard.el (xwem-kbd-hack-mouse): [fixate] Use
+      `last-nonminibuf-frame' instead of `selected-frame'.
+    
+
+    modified files:
+     extra/xwem-edprops.el lisp/xwem-clients.el lisp/xwem-events.el
+     lisp/xwem-frame.el lisp/xwem-keyboard.el lisp/xwem-keymacro.el
+     lisp/xwem-main.el lisp/xwem-minibuffer.el lisp/xwem-misc.el
+     lisp/xwem-netwm.el lisp/xwem-root.el lisp/xwem-special.el
+     lisp/xwem-struct.el lisp/xwem-tray.el lisp/xwem-win.el
+     lpath.el
+
+
+2004-12-14 23:26:41 GMT	Evgeny Zajcev <lg@xwem.org>	patch-8
+
+    Summary:
+      emods->xmodmask fix, Xmask-or fix, alt-meta collision fix
+    Revision:
+      xwem--main--2.0--patch-8
+
+    * lisp/xwem-keyboard.el (xwem-kbd-xmodmask->emods): [fixate] Workaround
+      alt-meta collision
+    
+    * lisp/xwem-clients.el (dummy-client): [fix] Do XSelectInput, however
+      dunno why this is needed.
+    
+    * lisp/xwem-clients.el (xwem-clients-init): [fix] add-hook with append
+      argument.
+    
+    * lisp/xwem-frame.el (embedded): [fix] fixes to make embedded and
+      embedded-desktop to work.  However have problems with xwem-desktop.
+      xwem-desktop can't restore embedded frames properly.  Need to
+      investigate what happening.
+    
+    * Makefile (clarification): minor
+
+    modified files:
+     Makefile dockapp/xwem-framei.el lisp/xwem-clients.el
+     lisp/xwem-frame.el lisp/xwem-keyboard.el lisp/xwem-manage.el
+
+
+2004-12-13 23:11:14 GMT	Evgeny Zajcev <lg@xwem.org>	patch-7
+
+    Summary:
+      testing commit hooks
+    Revision:
+      xwem--main--2.0--patch-7
+
+    
+    
+
+    modified files:
+     Makefile
+
+
+2004-12-13 23:07:32 GMT	Evgeny Zajcev <lg@xwem.org>	patch-6
+
+    Summary:
+      Makefile fixes, some addons, little fixes, tec
+    Revision:
+      xwem--main--2.0--patch-6
+
+    *  Makefile (): clarification
+    
+    * xwem-custom-gen.el (New): custom-load.el generator.
+    
+    * lisp/xwem-minibuffer.el (xwem-minib-specifiers): [new] Specifiers to
+      set for xwem minibuffer.
+    
+    * lisp/xwem-misc.el (xwem-misc-rotate-data): [new] Helpful function to
+      rotate X images.
+    
+    * lisp/xwem-tabbing.el (title-layout): [addons] Support for title-layout
+      frame property added.
+    
+    * lisp/xwem-frame.el (title-layout): [new] New frame property.
+    
+    
+
+    new files:
+     .arch-ids/xwem-custom-gen.el.id xwem-custom-gen.el
+
+    modified files:
+     Makefile lisp/xwem-frame.el lisp/xwem-minibuffer.el
+     lisp/xwem-misc.el lisp/xwem-tabbing.el lisp/xwem-theme.el
+     lisp/xwem-win.el lpath.el man/Makefile
+
+
+2004-12-11 21:22:18 GMT	Evgeny Zajcev <lg@xwem.org>	patch-5
+
+    Summary:
+      hot fix
+    Revision:
+      xwem--main--2.0--patch-5
+
+
+    modified files:
+     Makefile lisp/xwem-clients.el lisp/xwem-main.el
+     lisp/xwem-minibuffer.el lisp/xwem-root.el
+
+
+2004-12-11 20:33:02 GMT	Evgeny Zajcev <lg@xwem.org>	patch-4
+
+    Summary:
+      Sync with CVS, some fixes.
+    Revision:
+      xwem--main--2.0--patch-4
+
+    lisp/xwem-clgen.el (xwem-withdraw-generic): [rem] Evil things removed to
+    avoid BadWindow X errors.
+    
+    lisp/xwem-keyboard.el (modifiers): [sch] Modifiers handling changed.  Alt
+    key should work, however not checked.
+    
+    lisp/xwem-clients.el (xwem-client-apply-state): [fix] Handle change to
+    withdrawn state specially to avoid BadWindow X errors.
+    
+    lisp/xwem-root.el (xwem-root-events-handler): [addon] X-MappingNotify
+    handler added.
+    
+    lisp/xwem-events.el (xwem-ev-reconfig): [fix] Do things more safely,
+    should fix opera issue.
+    
+    lisp/xwem-win.el (xwem-frame-set-win-config-frame-params): [fix] use
+    `xwem-frame-apply-xgeom-1'.
+    
+
+    modified files:
+     lisp/xwem-clgen.el lisp/xwem-clients.el lisp/xwem-events.el
+     lisp/xwem-keyboard.el lisp/xwem-main.el lisp/xwem-root.el
+     lisp/xwem-win.el
+
+
+2004-12-10 23:29:27 GMT	Evgeny Zajcev <lg@xwem.org>	patch-3
+
+    Summary:
+      merge from steve (build cleanup)
+    Revision:
+      xwem--main--2.0--patch-3
+
+    Patches applied:
+    
+     * steve@eicq.org--2004/xwem--steve--2.0--patch-4
+       sync to lg
+    
+     * steve@eicq.org--2004/xwem--steve--2.0--patch-5
+       fix some function foo not known to be defined warnings
+    
+
+    modified files:
+     lpath.el
+
+    new patches:
+     steve@eicq.org--2004/xwem--steve--2.0--patch-4
+     steve@eicq.org--2004/xwem--steve--2.0--patch-5
+
+
+2004-12-10 22:46:33 GMT	Evgeny Zajcev <lg@xwem.org>	patch-2
+
+    Summary:
+      makefile changes
+    Revision:
+      xwem--main--2.0--patch-2
+
+
+    modified files:
+     Makefile
+
+
+2004-12-10 21:51:10 GMT	Evgeny Zajcev <lg@xwem.org>	patch-1
+
+    Summary:
+      merge from steve
+    Revision:
+      xwem--main--2.0--patch-1
+
+    Patches applied:
+    
+     * steve@eicq.org--2004/xwem--steve--2.0--base-0
+       tag of lg@xwem.org--2004/xwem--main--2.0--base-0
+    
+     * steve@eicq.org--2004/xwem--steve--2.0--patch-1
+       Add some missing files to the repo
+    
+     * steve@eicq.org--2004/xwem--steve--2.0--patch-2
+       Introduce a tla-stlye version string, clean up the build
+    
+     * steve@eicq.org--2004/xwem--steve--2.0--patch-3
+       emergancy build fix
+    
+
+    new files:
+     .arch-ids/Makefile.id .arch-ids/xwem-loaddefs-gen.el.id
+     Makefile battery/.arch-ids/=id battery/.arch-ids/Makefile.id
+     battery/.arch-ids/battery.c.id battery/Makefile
+     battery/battery.c dockapp/.arch-ids/.arch-inventory.id
+     dockapp/.arch-ids/=id dockapp/.arch-ids/xwem-battery.el.id
+     dockapp/.arch-ids/xwem-framei.el.id
+     dockapp/.arch-ids/xwem-pager.el.id
+     dockapp/.arch-ids/xwem-time.el.id
+     dockapp/.arch-ids/xwem-weather.el.id dockapp/.arch-inventory
+     dockapp/xwem-battery.el dockapp/xwem-framei.el
+     dockapp/xwem-pager.el dockapp/xwem-time.el
+     dockapp/xwem-weather.el extra/.arch-ids/.arch-inventory.id
+     extra/.arch-ids/=id extra/.arch-ids/ixwem.el.id
+     extra/.arch-ids/xwem-edprops.el.id
+     extra/.arch-ids/xwem-frametrans.el.id
+     extra/.arch-ids/xwem-recover.el.id
+     extra/.arch-ids/xwem-smartmods.el.id
+     extra/.arch-ids/xwem-vert.el.id extra/.arch-inventory
+     extra/ixwem.el extra/xwem-edprops.el extra/xwem-frametrans.el
+     extra/xwem-recover.el extra/xwem-smartmods.el
+     extra/xwem-vert.el icons/.arch-ids/=id
+     icons/.arch-ids/README.id icons/.arch-ids/mini-acroread.xpm.id
+     icons/.arch-ids/mini-aim.xpm.id
+     icons/.arch-ids/mini-bitchx.xpm.id
+     icons/.arch-ids/mini-calc.xpm.id
+     icons/.arch-ids/mini-cd.xpm.id
+     icons/.arch-ids/mini-clock.xpm.id
+     icons/.arch-ids/mini-colors.xpm.id
+     icons/.arch-ids/mini-cross.xpm.id
+     icons/.arch-ids/mini-daemon.xpm.id
+     icons/.arch-ids/mini-ddd.xpm.id
+     icons/.arch-ids/mini-diag.xpm.id
+     icons/.arch-ids/mini-diskete.xpm.id
+     icons/.arch-ids/mini-diskete2.xpm.id
+     icons/.arch-ids/mini-diskette.xpm.id
+     icons/.arch-ids/mini-display.xpm.id
+     icons/.arch-ids/mini-doc1.xpm.id
+     icons/.arch-ids/mini-ethereal.xpm.id
+     icons/.arch-ids/mini-firefox.xpm.id
+     icons/.arch-ids/mini-font.xpm.id
+     icons/.arch-ids/mini-freedesk.xpm.id
+     icons/.arch-ids/mini-ftp.xpm.id
+     icons/.arch-ids/mini-gimp.xpm.id
+     icons/.arch-ids/mini-gnus.xpm.id
+     icons/.arch-ids/mini-graph.xpm.id
+     icons/.arch-ids/mini-gv.xpm.id icons/.arch-ids/mini-icq.xpm.id
+     icons/.arch-ids/mini-imagemagic.xpm.id
+     icons/.arch-ids/mini-info.xpm.id
+     icons/.arch-ids/mini-keyboard.xpm.id
+     icons/.arch-ids/mini-links.xpm.id
+     icons/.arch-ids/mini-lower.xpm.id
+     icons/.arch-ids/mini-measure.xpm.id
+     icons/.arch-ids/mini-mozilla.xpm.id
+     icons/.arch-ids/mini-mozilla1.xpm.id
+     icons/.arch-ids/mini-mozilla2.xpm.id
+     icons/.arch-ids/mini-mozilla3.xpm.id
+     icons/.arch-ids/mini-netscape.xpm.id
+     icons/.arch-ids/mini-netscape1.xpm.id
+     icons/.arch-ids/mini-netscape2.xpm.id
+     icons/.arch-ids/mini-pager.xpm.id
+     icons/.arch-ids/mini-penguin.xpm.id
+     icons/.arch-ids/mini-raise.xpm.id
+     icons/.arch-ids/mini-ray.xpm.id
+     icons/.arch-ids/mini-redhat.xpm.id
+     icons/.arch-ids/mini-sh1.xpm.id
+     icons/.arch-ids/mini-stroke.xpm.id
+     icons/.arch-ids/mini-term.xpm.id
+     icons/.arch-ids/mini-tex.xpm.id
+     icons/.arch-ids/mini-turn.xpm.id
+     icons/.arch-ids/mini-vnc.xpm.id icons/.arch-ids/mini-x.xpm.id
+     icons/.arch-ids/mini-x2.xpm.id
+     icons/.arch-ids/mini-xchat.xpm.id
+     icons/.arch-ids/mini-xchat1.xpm.id
+     icons/.arch-ids/mini-xdvi.xpm.id
+     icons/.arch-ids/mini-xemacs.xpm.id
+     icons/.arch-ids/mini-xemacs1.xpm.id
+     icons/.arch-ids/mini-xemacsC.xpm.id
+     icons/.arch-ids/mini-xemacsgnus.xpm.id
+     icons/.arch-ids/mini-xemacsinfo.xpm.id
+     icons/.arch-ids/mini-xemacspy.xpm.id
+     icons/.arch-ids/mini-xemacstex.xpm.id
+     icons/.arch-ids/mini-xfig.xpm.id
+     icons/.arch-ids/mini-xkeycaps.xpm.id
+     icons/.arch-ids/mini-xterm.xpm.id
+     icons/.arch-ids/mini-xterm1.xpm.id
+     icons/.arch-ids/mini-xv.xpm.id icons/.arch-ids/mini-xv1.xpm.id
+     icons/.arch-ids/mini-xwem.xpm.id
+     icons/.arch-ids/mini-zoom.xpm.id
+     icons/.arch-ids/mini32x32-help.xpm.id
+     icons/.arch-ids/root-icon.xpm.id icons/README
+     icons/mini-acroread.xpm icons/mini-aim.xpm
+     icons/mini-bitchx.xpm icons/mini-calc.xpm icons/mini-cd.xpm
+     icons/mini-clock.xpm icons/mini-colors.xpm
+     icons/mini-cross.xpm icons/mini-daemon.xpm icons/mini-ddd.xpm
+     icons/mini-diag.xpm icons/mini-diskete.xpm
+     icons/mini-diskete2.xpm icons/mini-diskette.xpm
+     icons/mini-display.xpm icons/mini-doc1.xpm
+     icons/mini-ethereal.xpm icons/mini-firefox.xpm
+     icons/mini-font.xpm icons/mini-freedesk.xpm icons/mini-ftp.xpm
+     icons/mini-gimp.xpm icons/mini-gnus.xpm icons/mini-graph.xpm
+     icons/mini-gv.xpm icons/mini-icq.xpm icons/mini-imagemagic.xpm
+     icons/mini-info.xpm icons/mini-keyboard.xpm
+     icons/mini-links.xpm icons/mini-lower.xpm
+     icons/mini-measure.xpm icons/mini-mozilla.xpm
+     icons/mini-mozilla1.xpm icons/mini-mozilla2.xpm
+     icons/mini-mozilla3.xpm icons/mini-netscape.xpm
+     icons/mini-netscape1.xpm icons/mini-netscape2.xpm
+     icons/mini-pager.xpm icons/mini-penguin.xpm
+     icons/mini-raise.xpm icons/mini-ray.xpm icons/mini-redhat.xpm
+     icons/mini-sh1.xpm icons/mini-stroke.xpm icons/mini-term.xpm
+     icons/mini-tex.xpm icons/mini-turn.xpm icons/mini-vnc.xpm
+     icons/mini-x.xpm icons/mini-x2.xpm icons/mini-xchat.xpm
+     icons/mini-xchat1.xpm icons/mini-xdvi.xpm
+     icons/mini-xemacs.xpm icons/mini-xemacs1.xpm
+     icons/mini-xemacsC.xpm icons/mini-xemacsgnus.xpm
+     icons/mini-xemacsinfo.xpm icons/mini-xemacspy.xpm
+     icons/mini-xemacstex.xpm icons/mini-xfig.xpm
+     icons/mini-xkeycaps.xpm icons/mini-xterm.xpm
+     icons/mini-xterm1.xpm icons/mini-xv.xpm icons/mini-xv1.xpm
+     icons/mini-xwem.xpm icons/mini-zoom.xpm
+     icons/mini32x32-help.xpm icons/root-icon.xpm
+     lisp/.arch-ids/.arch-inventory.id lisp/.arch-ids/=id
+     lisp/.arch-ids/xwem-clgen.el.id
+     lisp/.arch-ids/xwem-clients.el.id
+     lisp/.arch-ids/xwem-clswi.el.id
+     lisp/.arch-ids/xwem-compat.el.id
+     lisp/.arch-ids/xwem-desktop.el.id
+     lisp/.arch-ids/xwem-edmacro.el.id
+     lisp/.arch-ids/xwem-events.el.id
+     lisp/.arch-ids/xwem-faces.el.id
+     lisp/.arch-ids/xwem-focus.el.id
+     lisp/.arch-ids/xwem-frame.el.id
+     lisp/.arch-ids/xwem-gamma.el.id lisp/.arch-ids/xwem-help.el.id
+     lisp/.arch-ids/xwem-icons.el.id
+     lisp/.arch-ids/xwem-interactive.el.id
+     lisp/.arch-ids/xwem-keyboard.el.id
+     lisp/.arch-ids/xwem-keydefs.el.id
+     lisp/.arch-ids/xwem-keymacro.el.id
+     lisp/.arch-ids/xwem-launcher.el.id
+     lisp/.arch-ids/xwem-load.el.id lisp/.arch-ids/xwem-main.el.id
+     lisp/.arch-ids/xwem-manage.el.id
+     lisp/.arch-ids/xwem-minibuffer.el.id
+     lisp/.arch-ids/xwem-misc.el.id lisp/.arch-ids/xwem-modes.el.id
+     lisp/.arch-ids/xwem-mouse.el.id
+     lisp/.arch-ids/xwem-netwm.el.id
+     lisp/.arch-ids/xwem-ratanot.el.id
+     lisp/.arch-ids/xwem-register.el.id
+     lisp/.arch-ids/xwem-report.el.id
+     lisp/.arch-ids/xwem-root.el.id
+     lisp/.arch-ids/xwem-rooter.el.id
+     lisp/.arch-ids/xwem-rooticon.el.id
+     lisp/.arch-ids/xwem-selections.el.id
+     lisp/.arch-ids/xwem-sound.el.id
+     lisp/.arch-ids/xwem-special.el.id
+     lisp/.arch-ids/xwem-strokes.el.id
+     lisp/.arch-ids/xwem-struct.el.id
+     lisp/.arch-ids/xwem-tabbing.el.id
+     lisp/.arch-ids/xwem-theme.el.id
+     lisp/.arch-ids/xwem-transient.el.id
+     lisp/.arch-ids/xwem-tray.el.id lisp/.arch-ids/xwem-win.el.id
+     lisp/.arch-inventory lisp/xwem-clgen.el lisp/xwem-clients.el
+     lisp/xwem-clswi.el lisp/xwem-compat.el lisp/xwem-desktop.el
+     lisp/xwem-edmacro.el lisp/xwem-events.el lisp/xwem-faces.el
+     lisp/xwem-focus.el lisp/xwem-frame.el lisp/xwem-gamma.el
+     lisp/xwem-help.el lisp/xwem-icons.el lisp/xwem-interactive.el
+     lisp/xwem-keyboard.el lisp/xwem-keydefs.el
+     lisp/xwem-keymacro.el lisp/xwem-launcher.el lisp/xwem-load.el
+     lisp/xwem-main.el lisp/xwem-manage.el lisp/xwem-minibuffer.el
+     lisp/xwem-misc.el lisp/xwem-modes.el lisp/xwem-mouse.el
+     lisp/xwem-netwm.el lisp/xwem-ratanot.el lisp/xwem-register.el
+     lisp/xwem-report.el lisp/xwem-root.el lisp/xwem-rooter.el
+     lisp/xwem-rooticon.el lisp/xwem-selections.el
+     lisp/xwem-sound.el lisp/xwem-special.el lisp/xwem-strokes.el
+     lisp/xwem-struct.el lisp/xwem-tabbing.el lisp/xwem-theme.el
+     lisp/xwem-transient.el lisp/xwem-tray.el lisp/xwem-win.el
+     man/.arch-ids/.arch-inventory.id man/.arch-ids/=id
+     man/.arch-ids/Makefile.id man/.arch-ids/addons.texi.id
+     man/.arch-ids/client.texi.id man/.arch-ids/frame.texi.id
+     man/.arch-ids/help.texi.id man/.arch-ids/hooking.texi.id
+     man/.arch-ids/logging.texi.id man/.arch-ids/manda.texi.id
+     man/.arch-ids/minibuf.texi.id man/.arch-ids/overview.texi.id
+     man/.arch-ids/primitives.texi.id man/.arch-ids/start.texi.id
+     man/.arch-ids/subsystems.texi.id
+     man/.arch-ids/textspec.texi.id man/.arch-ids/tray.texi.id
+     man/.arch-ids/win.texi.id man/.arch-ids/xwem.texi.id
+     man/.arch-inventory man/Makefile man/addons.texi
+     man/client.texi man/frame.texi man/help.texi man/hooking.texi
+     man/logging.texi man/manda.texi man/minibuf.texi
+     man/overview.texi man/primitives.texi man/start.texi
+     man/subsystems.texi man/textspec.texi man/tray.texi
+     man/win.texi man/xwem.texi utils/.arch-ids/.arch-inventory.id
+     utils/.arch-ids/=id utils/.arch-ids/xwem-appcollect.el.id
+     utils/.arch-ids/xwem-diagram.el.id
+     utils/.arch-ids/xwem-holer.el.id
+     utils/.arch-ids/xwem-osd.el.id
+     utils/.arch-ids/xwem-worklog.el.id
+     utils/.arch-ids/xwem-xfig.el.id utils/.arch-inventory
+     utils/xwem-appcollect.el utils/xwem-diagram.el
+     utils/xwem-holer.el utils/xwem-osd.el utils/xwem-worklog.el
+     utils/xwem-xfig.el xwem-loaddefs-gen.el
+
+    modified files:
+     lpath.el package-info.in
+
+    renamed files:
+     .arch-ids/Makefile.id
+       ==> .arch-ids/Makfile.CVS.id
+     Makefile
+       ==> Makfile.CVS
+
+    new directories:
+     battery battery/.arch-ids dockapp dockapp/.arch-ids extra
+     extra/.arch-ids icons icons/.arch-ids lisp lisp/.arch-ids man
+     man/.arch-ids utils utils/.arch-ids
+
+    new patches:
+     steve@eicq.org--2004/xwem--steve--2.0--base-0
+     steve@eicq.org--2004/xwem--steve--2.0--patch-1
+     steve@eicq.org--2004/xwem--steve--2.0--patch-2
+     steve@eicq.org--2004/xwem--steve--2.0--patch-3
+
+
+2004-12-08 19:22:14 GMT	Evgeny Zajcev <lg@xwem.org>	base-0
+
+    Summary:
+      Initial import of xwem sources.
+    Revision:
+      xwem--main--2.0--base-0
+
+
+    new files:
+     ChangeLog.CVS Makefile TODO logo.xpm lpath.el package-info.in
+
+
 # Boston, MA 02111-1307, USA.
 
 VERSION = 1.18
-AUTHOR_VERSION = 0.2
+AUTHOR_VERSION = lg@xwem.org--2004/xwem--main--2.0--version-0
 MAINTAINER = Zajcev Evgeny <zevlg@yandex.ru>
 PACKAGE = xwem
 PKG_TYPE = regular
-REQUIRES = xwem xemacs-base xlib strokes edit-utils text-modes time slider
+REQUIRES = xwem xemacs-base xlib strokes edit-utils text-modes time slider \
+	elib ilisp mail-lib
 CATEGORY = standard
 
 DONTCOMPILE = lisp/_pkg.el lisp/auto-autoloads.el lisp/custom-load.el

File icons/README

       * "};" must be on its own line at the end of file.
 
       * ' ' must be used for None color.
+      
+      * Do not use ',' character to denote color.
+
+      * No trailing spaces in any line.
 
 
     Recommended, but not required:

File icons/mini-display.xpm

Old
Old image
New
New image

File icons/mini-graph.xpm

Old
Old image
New
New image

File icons/mini-xv.xpm

Old
Old image
New
New image

File lisp/ixwem.el

+;;; ixwem.el --- 
+
+;; Copyright (C) 2004 by Free Software Foundation, Inc.
+
+;; Author: Zajcev Evgeny <zevlg@yandex.ru>
+;; Created: Sat Sep 11 21:38:13 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:
+
+;; 
+
+;;; Code:
+
+
+;; Highlighting.
+;; TODO:
+;;   - font lock faces
+;;   -
+(require 'xwem-load)
+
+(defgroup ixwem nil
+  "Group to customize IXWEM."
+  :prefix "ixwem-"
+  :group 'xwem)
+
+(defcustom ixwem-name-length 32
+  "*Maximum length of xwem client name to display."
+  :type 'number
+  :group 'ixwem)
+
+;;; Internal variables
+
+(defvar ixwem-header-line
+  (concat " IMD Manda     Client                   Size     Frame    Uptime\n"
+          " --- -----     ------                   ----     -----    ------\n"))
+
+(defvar ixwem-local-map 
+  (let ((map (make-sparse-keymap)))
+    (define-key map ?q 'ixwem-quit)
+    map)
+  "Keymap used when in ixwem mode.")
+
+
+(defun ixwem-client-format (cl)
+  (format (format "    %%.%ds\n" ixwem-name-length)
+	  (xwem-client-name cl)))
+
+(defun ixwem-draw-tree (buf)
+  "Draw clients tree in buffer BUF."
+  (with-current-buffer buf
+    (erase-buffer buf)
+
+    (insert (concat "    Name" (make-string (- ixwem-name-length 3) ?\x20)
+		    "Size      " "Uptime      " "Recency\n"))
+    (insert (concat "    ----" (make-string (- ixwem-name-length 3) ?\x20)
+		    "----      " "------      " "-------\n"))
+    (mapc (lambda (ma)
+	    (insert (format "[%S]\n" (xwem-manda-name ma)))
+	    (cond ((eq (xwem-manda-name ma) 'generic)
+		   (mapc (lambda (fr)
+			   (insert (format "  {F%d: %s}\n"
+					   (xwem-frame-num fr) (xwem-frame-name fr)))
+			   (mapc (lambda (cl)
+				   (when (and (eq (xwem-cl-frame cl) fr)
+					      (eq (xwem-cl-manda cl) ma))
+				     (insert (ixwem-client-format cl))))
+				 xwem-clients))
+			 xwem-frames-list))
+		  (t (mapc (lambda (cl)
+			     (when (eq (xwem-cl-manda cl) ma)
+			       (insert (ixwem-client-format cl))))
+			   xwem-clients))))
+	  xwem-manda-list)
+    ))
+
+(defun ixwem-list-clients (buf)
+  "List xwem clients in BUF buffer."
+  (with-current-buffer buf
+    (erase-buffer)
+
+    ;; Display header
+    (insert ixwem-header-line)
+
+    ;; Display clients tree
+    (mapcar (lambda (cl)
+	      (let ((bstr (make-string 40 ?\x20)))
+		(insert
+		 (format "  *# %.9s %.24s %.8s %.8s %.20s\n"
+			 (concat (symbol-name (xwem-manda-name (xwem-cl-manda cl))) bstr)
+			 (concat (xwem-client-name cl) bstr)
+			 (concat (let ((gg (xwem-cl-get-usize cl)))
+				   (format "%dx%d" (car gg) (cdr gg)))
+				 bstr)
+			 (if (xwem-cl-frame cl)
+			     (concat (xwem-frame-name (xwem-cl-frame cl)) bstr)
+			   bstr)
+			 (concat (xwem-cl-get-uptime cl) bstr)))))
+	    xwem-clients)
+    ))
+
+(defun ixwem-mode ()
+  "Enter ixwem mode."
+  (setq major-mode 'ixwem)
+  (setq mode-name "IXWEM")
+  (use-local-map ixwem-local-map)
+  )
+
+;;;###autoload(autoload 'ixwem "ixwem" "" t)
+(define-xwem-command ixwem ()
+  "Interactive xwem clients browsing."
+  (xwem-interactive)
+
+  (let ((buf (get-buffer-create "*ixwem*")))
+    (switch-to-buffer buf)
+    (ixwem-draw-tree buf)
+;    (ixwem-list-clients buf)
+    (ixwem-mode)
+  ))
+
+(defun ixwem-quit ()
+  "Quit IXWEM."
+  (interactive)
+
+  (bury-buffer))
+
+
+(provide 'ixwem)
+
+;;; ixwem.el ends here

File lisp/xwem-appcollect.el

+;;; xwem-appcollect.el --- 
+
+;; Copyright (C) 2004 by Free Software Foundation, Inc.
+
+;; Author: Zajcev Evgeny <zevlg@yandex.ru>
+;; Created: Fri Oct 29 04:35:18 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:
+
+;; Helpfull util to create `xwem-applications-alist'.
+;; Usage:
+;; 
+;;     (xwem-appcollect '("xterm" "mozilla"))
+
+;;     (xwem-appcollect '("xterm" "mozilla") '(name class) 'or)
+
+;;     (xwem-appcollect '("xterm" "mozilla") '(command) 'or)
+
+;;; Code:
+
+(require 'xwem-load)
+(require 'xwem-manage)
+(require 'xwem-launcher)
+
+(define-xwem-method manage appcollect (cl)
+  "Manage method when collecting info about applications."
+  (declare (special xwem-app-collection))
+  (declare (special xwem-app-collect-wait))
+
+  (let ((app-name (xwem-cl-get-prop cl 'xwem-appcollect-app-name))
+        (op (xwem-cl-get-prop cl 'xwem-appcollect-op))
+        (params (xwem-cl-get-prop cl 'xwem-appcollect-params))
+        mspec)
+
+    (setq mspec (list op))
+    (mapc (lambda (par)
+            (cond ((eq par 'class)
+                   (push `(and (class-inst ,(concat "^" (car (xwem-hints-wm-class (xwem-cl-hints cl))) "$"))
+                               (class-name ,(concat "^" (cdr (xwem-hints-wm-class (xwem-cl-hints cl))) "$")))
+                         mspec))
+                  ((eq par 'name)
+                   (push `(name ,(concat "^" (xwem-hints-wm-name (xwem-cl-hints cl)) "$"))
+                         mspec))
+                  ((eq par 'command)
+                   (push `(command ,(concat "^" (xwem-hints-wm-command (xwem-cl-hints cl)) "$"))
+                         mspec))))
+          params)
+    (setq mspec (nreverse mspec))
+          
+    (setq xwem-app-collection (put-alist app-name (list mspec) xwem-app-collection))
+    (xwem-client-kill cl t)
+    (setq xwem-app-collect-wait nil)))
+
+;;;###xwem-autoload(autoload 'xwem-appcollect "xwem-appcollect" nil nil)
+(defun xwem-appcollect (app-names &optional params operation)
+  "Collect and return applications manage specs.
+APP-NAMES is a list of applications to collect.
+
+PARAMS is a list of elements where each element is one of:
+  `class'   - Include class-inst/class-name into mspec.
+  `name'    - Include app name into mspec.
+  `command' - Include command into mspec."
+  (let ((xwem-app-collection nil))
+    (declare (special xwem-app-collection))
+
+    (mapc (lambda (app)
+            (let ((cmd (xwem-launcher-normalize-cmd app))
+                  (xwem-app-collect-wait t))
+              (declare (special xwem-app-collect-wait))
+              (xwem-manda-add-expectance
+               `(appcollect (xwem-appcollect-op ,(or operation 'and) xwem-appcollect-params ,(or params '(class))
+                             xwem-appcollect-app-name ,app)
+                            (eval t)) 120)
+              (xwem-execute-program cmd)
+              (while xwem-app-collect-wait
+                (dispatch-event (next-event)))))
+          app-names)
+    
+    (nreverse xwem-app-collection)))
+
+
+(provide 'xwem-appcollect)
+
+;;; xwem-appcollect.el ends here

File lisp/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

File lisp/xwem-clgen.el

+;;; xwem-clgen.el --- Generic model to manage clients.
+
+;; Copyright (C) 2004 by Free Software Foundation, Inc.
+
+;; Author: Zajcev Evgeny <zevlg@yandex.ru>
+;;         Steve Youngs  <steve@youngs.au.com>
+;; Created: Sat Aug 28 14:31:39 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:
+
+;; Generic managing model.
+
+;;; Code:
+
+(require 'xwem-load)
+(require 'xwem-manage)
+
+;;; Customisation
+(defgroup xwem-clgen nil
+  "Group to customise management of generic clients."
+  :prefix "xwem-clgen-"
+  :group 'xwem-modes)
+
+(defcustom xwem-clgen-other-strategy 'samewin
+  "*Strategy used when searching for other client in window.
+Possible values are:
+  
+  `samewin'   - Search for client managed in window.
+
+  `sameframe-nonactive' - Search for nonactive client managed
+                          in window's frame.
+
+  `sameframe-any'       - Search for any client managed in window's
+                          frame.
+
+  `samemanda-nonactive' - Search for any nonactive client with same
+                          manage entry as other client.
+
+  `any-nonactive'       - Search for any nonactive client."
+  :type '(choice (const :tag "Same Window" samewin)
+                 (const :tag "Inactive in same frame" sameframe-nonactive)
+                 (const :tag "Any in same frame" sameframe-any)
+                 (const :tag "Inactive with same manda" samemanda-nonactive)
+                 (const :tag "Any inactive" any-nonactive))
+  :group 'xwem-clgen)
+
+(defcustom xwem-clgen-other-on-split t
+  "*Non-nil mean activate client in other window when doing window split."
+  :type 'boolean
+  :group 'xwem-clgen)
+
+(defcustom xwem-clgen-other-split-type 'vertical
+  "*Split type."
+  :type '(choice (const :tag "Vertical" vertical)
+                 (const :tag "Horizontal" horizontal))
+  :group 'xwem-clgen)
+
+(defcustom xwem-clgen-activate-new t
+  "*Non-nil mean newly managed generic clients are activated in their windows."
+  :type 'boolean
+  :group 'xwem-clgen)
+
+(defcustom xwem-clgen-select-new t
+  "*Non-nil mean, select new clients managed in selected window.
+This value overrides `xwem-clgen-activate-new' if window is selected."
+  :type 'boolean
+  :group 'xwem-clgen)
+
+(defcustom xwem-clgen-allow-make-frame t
+  "*Non-nil mean, clgen permited to make frame if there no frame where client can be managed."
+  :type 'boolean
+  :group 'xwem-clgen)
+
+;;; Internal variables
+
+;;;###autoload
+(defvar xwem-clgen-map 
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "H-c H-o") 'xwem-clgen-toggle-other-on-split)
+    map)
+  "Local keymap for generic clients.")
+
+;;; Macros
+(defmacro xwem-cl-xparent (cl)
+  `(xwem-cl-get-sys-prop ,cl 'parent-xwin))
+(defsetf xwem-cl-xparent (cl) (parent)
+  `(xwem-cl-put-sys-prop ,cl 'parent-xwin ,parent))
+
+(defun xwem-clgen-other-client (cl &optional clients-list visible)
+  "Search client other then CL in CLIENTS-LIST.
+Default CLIENTS-LIST is win's clients where CL managed.
+Note that at least one CL or CLIENTS-LIST should be non-nil, otherwise
+nil will be returned."
+  (when (or (and (xwem-cl-p cl) (xwem-win-p (xwem-cl-win cl)))
+            clients-list)
+    ;; XXX 
+    (unless clients-list
+      (setq clients-list (xwem-win-clients (xwem-cl-win cl))))
+      
+    ;; XXX sort clients by recency
+    (setq clients-list
+          (xwem-cl-list-sort-by-recency clients-list))
+
+    (let (rcl notgoodcl)
+      (while clients-list
+        (when (and (not (eq (car clients-list) cl)) ; skip ourself
+		   (not (eq (xwem-cl-state (car clients-list)) 'iconified))) ; skip iconfied
+          (if (and (not (xwem-dummy-client-p (car clients-list))) ; exclude dummy clients
+                   (or visible (not (xwem-win-cl-current-p (car clients-list)))))
+              (progn
+                (setq rcl (car clients-list))
+                (setq clients-list nil))
+
+            (when (and visible (null notgoodcl))
+              (setq notgoodcl (car clients-list)))))
+        (setq clients-list (cdr clients-list)))
+    
+      (or rcl notgoodcl))))
+
+(define-xwem-deffered xwem-clgen-activate-other (cl win)
+  "Activate other client in WIN.
+Clients list is either WIN's clients list or CL's win clients list if
+WIN's clients list is empty."
+  (when (and (xwem-win-alive-p win)
+             (not (xwem-cl-alive-p (xwem-win-cl win))))
+    ;; WIN is valid and no clients yet managed in WIN
+    (let ((ocl (xwem-clgen-other-client cl (xwem-win-clients win)))
+          (need-select (or (and (xwem-cl-selected-p cl)
+                                (not (xwem-cl-active-p cl)))
+                           (xwem-cl-selected-p (xwem-dummy-client)))))
+      (when (xwem-cl-alive-p ocl)
+        (xwem-win-set-cl win ocl)
+        (when (and (xwem-win-selected-p win) need-select)
+          (xwem-select-client ocl)))
+
+      ;; If OCL wasnt selected, try last or other client
+      (when (and (xwem-win-selected-p win)
+                 (not (xwem-cl-selected-p ocl))
+                 need-select)
+        (setq ocl (xwem-clgen-other-client
+                   cl (xwem-frame-clients (xwem-win-frame win)) t))
+        (if (xwem-cl-alive-p ocl)
+            (xwem-select-client ocl)
+          (xwem-select-some-client))))))
+  
+(defun xwem-clgen-other-on-split (sp-win nwin)
+  "NWIN has been created as a result of split.
+Probably we want to manage some client in newly created window."
+  (xwem-clgen-activate-other (xwem-cl-selected) nwin))
+
+;;; Othen-on-Split commands
+
+;;;###autoload(autoload 'xwem-clgen-turn-on-other-on-split "xwem-clgen" "" t)
+(define-xwem-command xwem-clgen-turn-on-other-on-split ()
+  "Turn on `xwem-clgen-other-on-split' minor mode."
+  (xwem-interactive)
+
+  (setq xwem-clgen-other-on-split t)
+  (add-hook 'xwem-win-split-hook 'xwem-clgen-other-on-split)
+
+  (xwem-message 'info "Other on split minor mode is ON."))
+
+;;;###autoload(autoload 'xwem-clgen-turn-off-other-on-split "xwem-clgen" "" t)
+(define-xwem-command xwem-clgen-turn-off-other-on-split ()
+  "Turn off `xwem-clgen-other-on-split' minor mode."
+  (xwem-interactive)
+
+  (setq xwem-clgen-other-on-split nil)
+  (remove-hook 'xwem-win-split-hook 'xwem-clgen-other-on-split)
+
+  (xwem-message 'info "Other on split minor mode is OFF."))
+
+;;;###autoload(autoload 'xwem-clgen-toggle-other-on-split "xwem-clgen" "" t)
+(define-xwem-command xwem-clgen-toggle-other-on-split (arg)
+  "Toggle `xwem-clgen-other-on-split' minor mode.
+Negative ARG turns it off, positive turns it on."
+  (xwem-interactive "P")
+
+  (if (numberp arg)
+      (if (> arg 0)
+	  (setq xwem-clgen-other-on-split nil)
+	(setq xwem-clgen-other-on-split t)))
+
+  (if xwem-clgen-other-on-split
+      (xwem-clgen-turn-off-other-on-split)
+    (xwem-clgen-turn-on-other-on-split)))
+
+;;; Initialisation stuff
+(defun xwem-clgen-init ()
+  "Initialise clgen stuff."
+  (xwem-message 'init "Initializing generic clients ...")
+
+  (add-hook 'xwem-win-split-hook 'xwem-clgen-other-on-split)
+
+  (xwem-message 'init "Initializing generic clients ... done"))
+
+;;;; ---- Generic methods ----
+(define-xwem-client-property expect-win generic
+  "Expectance window."
+  :type 'window
+  :get 'xwem-cl-get-sys-prop
+  :set 'xwem-cl-put-sys-prop)
+
+;;;###autoload
+(defun xwem-manage-generic (cl)
+  "Manage method for generic clients."
+
+  ;; Put this to notify `xwem-manage' that we will handle initial
+  ;; state.
+  (xwem-client-set-property cl 'skip-initial-state t)
+
+  (let ((dwin (and (xwem-cl-was-expected-p cl)
+                   (xwem-client-property cl 'expect-win))))
+    (if dwin
+        (xwem-client-set-property cl 'expect-win nil)
+      (if (xwem-frame-alive-p (xwem-frame-selected))
+          (setq dwin (xwem-win-selected))
+        (when xwem-clgen-allow-make-frame
+          ;; Selected window is kinda dead
+          (xwem-frame-fit-screen (xwem-make-frame-1 'desktop))
+          (setq dwin (xwem-win-selected)))))
+
+    (unless (xwem-win-alive-p dwin)
+      (error 'xwem-error "Can't manage in dead window"))
+
+    ;; Create parent window.
+    ;; NOTE:
+    ;;   Some applications, such as mozilla, when running with
+    ;;   -remote tries to find another mozilla instance to run
+    ;;   in it, it seaches lowerest client, but it is not
+    ;;   guarantied, because xwem frame holds many clients.
+    (unless (xwem-cl-xparent cl)
+      (setf (xwem-cl-xparent cl)
+            (XCreateWindow (xwem-dpy) nil 0 0 1 1 0 nil nil nil
+                           (make-X-Attr :override-redirect t :event-mask 0.0))))
+
+    ;; Set CL's window
+    (xwem-cl-set-win cl dwin)
+
+    ;; Install local keymap
+    (xwem-use-local-map xwem-clgen-map cl)
+
+    ;; Select newly managed client, if needed
+    (if (eql (xwem-cl-get-init-state cl) X-IconicState)
+        (xwem-iconify cl)
+
+      (when xwem-clgen-activate-new
+        (xwem-win-set-cl (xwem-cl-win cl) cl))
+      (when (and xwem-clgen-select-new
+                 (xwem-win-selected-p dwin))
+        (xwem-win-set-cl (xwem-cl-win cl) cl)
+        (xwem-select-client cl)))
+    ))
+
+(defun xwem-clgen-refit (cl)
+  "Refit generic client CL."
+  (let* ((xwem-win (xwem-cl-win cl))
+         (hthi (xwem-win-border-width xwem-win)))
+    (when (and (xwem-cl-new-xgeom cl)
+               (X-Geom-border-width (xwem-cl-new-xgeom cl)))
+      ;; Border width changed
+      (setf (X-Geom-border-width (xwem-cl-xgeom cl))
+            (X-Geom-border-width (xwem-cl-new-xgeom cl))))
+
+    (xwem-cl-correct-size-for-size cl
+       (make-X-Geom :x (+ (xwem-win-x xwem-win) hthi)
+                    :y (+ (xwem-win-y xwem-win) hthi)
+                    :width (- (xwem-win-width xwem-win) (* 2 hthi))
+                    :height (- (xwem-win-height xwem-win) (* 2 hthi))
+                    :border-width (X-Geom-border-width (xwem-cl-xgeom cl))))))
+  
+(defun xwem-refit-generic (cl)
+  "Refit method for generic client CL.
+Correct CL geometry to fit into CL's window."
+  (xwem-clgen-refit cl)
+  (xwem-cl-apply-xgeom cl))
+
+(define-xwem-deffered xwem-clgen-apply-state (cl)
+  "Apply CL's state to life for generic client CL."
+  (when (and (xwem-cl-p cl)
+             (eq (xwem-cl-manage-type cl) 'generic))
+    (cond ((eq (xwem-cl-state cl) 'active)
+           (xwem-clgen-refit cl)
+           (when (xwem-cl-frame cl)
+             (XReparentWindow (xwem-dpy) (xwem-cl-xwin cl)
+                              (xwem-frame-xwin (xwem-cl-frame cl))
+                              (X-Geom-x (xwem-cl-xgeom cl))
+                              (X-Geom-y (xwem-cl-xgeom cl))))
+           (xwem-cl-apply-xgeom-1 cl)
+           (XLowerWindow (xwem-dpy) (xwem-cl-xwin cl))
+           (XMapWindow (xwem-dpy) (xwem-cl-xwin cl)))
+
+          ((eq (xwem-cl-state cl) 'inactive)
+           (XReparentWindow (xwem-dpy) (xwem-cl-xwin cl) (xwem-cl-xparent cl) 0 0)
+           (XLowerWindow (xwem-dpy) (xwem-cl-xwin cl))
+           (XUnmapWindow (xwem-dpy) (xwem-cl-xwin cl)))
+
+          ((eq (xwem-cl-state cl) 'iconified)
+           (XReparentWindow (xwem-dpy) (xwem-cl-xwin cl) (xwem-cl-xparent cl) 0 0)
+           (XLowerWindow (xwem-dpy) (xwem-cl-xwin cl))
+           (XUnmapWindow (xwem-dpy) (xwem-cl-xwin cl))))
+    ))
+
+(defun xwem-activate-generic (cl &optional type)
+  "Activate method for CL."
+  (cond ((eq type 'select)
+         (xwem-select-window (xwem-cl-win cl)))
+
+        ((eq type 'activate)
+         (cond ((xwem-win-cl-current-p cl)
+                (xwem-clgen-apply-state cl))
+
+               ((xwem-win-alive-p (xwem-cl-win cl))
+                (xwem-client-change-state cl 'inactive)
+                (xwem-win-set-cl (xwem-cl-win cl) cl))))))
+
+(defun xwem-deactivate-generic (cl &optional type)
+  "Deactivate method for generic client CL."
+  (cond ((eq type 'deactivate)
+         (xwem-clgen-activate-other cl (xwem-cl-win cl))
+         (xwem-clgen-apply-state cl))))
+
+(defun xwem-iconify-generic (cl)
+  "Iconify method for generic client CL."
+  (xwem-win-rem-cl (xwem-cl-win cl) cl))
+
+(defun xwem-withdraw-generic (cl)
+  "Withdraw method for generic client CL."
+  (let ((win (xwem-cl-win cl)))
+    (when win
+      (xwem-win-rem-cl win cl)
+      (xwem-cl-set-win cl nil)
+
+      ;; Activate other client in CL's window WIN
+      ;; NOTE: Deffered
+      (xwem-clgen-activate-other nil win))))
+
+;;; Additional methods
+(define-xwem-method on-type-change generic (cl &optional new)
+  "Called when CL is about to change manda from generic."
+  (xwem-cl-set-win cl nil))
+
+(define-xwem-method on-kill generic (cl)
+  "Called when CL is killed."
+  (let ((win (xwem-cl-win cl)))
+    ;; Destroy parent window
+    (when (xwem-cl-xparent cl)
+;; This XDestroyWindow causes some problems
+;      (XDestroyWindow (xwem-dpy) (xwem-cl-xparent cl))
+      (setf (xwem-cl-xparent cl) nil))
+
+    ;; Activate other client in WIN
+    (xwem-clgen-activate-other cl win)
+
+    ;; Remove CL from WIN's clients list
+    (when (xwem-win-alive-p win)
+      (xwem-win-rem-cl win cl))
+    ))
+
+(define-xwem-method other-client generic (cl)
+  "Method to return xwem generic client other then CL."
+  (xwem-clgen-other-client cl))
+
+
+(provide 'xwem-clgen)
+
+;;;; On-load actions:
+;; Register generic manage type.  Use APPEND because 'generic manage
+;; type is most non-privileged and matches any client.
+(define-xwem-manage-model generic
+  "Generic manage model.
+Manage clients that no-one elso wants to manage."
+  :match-spec '(eval t)
+  :append t
+
+  :manage-method 'xwem-manage-generic
+  :activate-method 'xwem-activate-generic
+  :deactivate-method 'xwem-deactivate-generic
+  :refit-method 'xwem-refit-generic
+  :iconify-method 'xwem-iconify-generic
+  :withdraw-method 'xwem-withdraw-generic)
+
+(if xwem-started
+    (xwem-clgen-init)
+  (add-hook 'xwem-before-init-wins-hook 'xwem-clgen-init))
+
+;;; xwem-clgen.el ends here

File lisp/xwem-clients.el

 ;; Copyright (C) 2003 by Free Software Foundation, Inc.
 
 ;; Author: Zajcev Evgeny <zevlg@yandex.ru>
+;;         Steve Youngs  <steve@youngs.au.com>
+;;         Richard Klinda <ignotus@hixsplit.hu>
 ;; Created: 2 Mar 2003
 ;; Keywords: xlib, xwem
 ;; X-CVS: $Id$
 ;;
 ;; Client state(`xwem-cl-state') is one of:
 ;; 
-;;   'managed - Client has `xwem-cl-win' and in WIN's clients list, but
-;;              not current in WIN.
+;;   'active    - Client managed and activated.
 ;;   
-;;   'managed-current - As 'managed, but CL aslo current in WIN.
+;;   'inactive  - CL managed, but not viewable.
 ;;   
-;;   'demanaged - CL may have valid `xwem-cl-win', but not in WIN's
-;;                clients list and not current in any window.
-;;   
-;;   'iconified - Same as 'demanaged
+;;   'iconified - CL iconified, not viewable.
 ;;   
 ;;   'destroyed - CL's x window destroyed.
 ;;   
 ;;   `xwem-cl-state-change-hook' - Called when CL changes state to one
 ;;                                 described above.
 ;; 
-;;   `xwem-cl-manage-hook' - Called when CL just managed in some
-;;                           window.
+;;   `xwem-cl-manage-hook' - Called when CL just managed.
+;; 
+;;   `xwem-cl-activate-hook' - Called when CL is activated in its context.
 ;;
-;;   `xwem-cl-demanage-hook' - Called when CL just demanaged from some
-;;                             window.
+;;   `xwem-cl-deactivate-hook' - Called when CL is deactivated in its context.
+;; 
+;;   `xwem-cl-withdraw-hook' - Called when CL is about to move to withdrawn state.
 ;;
-;;   `xwem-cl-mark-hook' - Called when CL marked or unmarked.
+
+;; 
+;; Supported client properties:
+;; 
+;;   `noselect'  - Non-nil to make client non-selectable.
+
 
 ;;; Code:
 
 (eval-when-compile
   ;; Shutup compiler
-  (require 'xlib-xwin)
-  (require 'xwem-macros)
-  (require 'iswitchb)
+  (autoload 'subtract-time "time-date")
+  (defvar xwem-frame-ev-mask)
   )
-(require 'xwem-frame)
+
+(require 'xwem-load)
+(require 'xwem-manage)
+(require 'xwem-misc)
 
 ;;; Variables
 (defgroup xwem-cl nil
   :prefix "xwem-cl-"
   :group 'xwem)
 
+(defgroup xwem-modes nil
+  "Group to customize XWEM managing modes."
+  :prefix "xwem-"
+  :group 'xwem)
+
 (defcustom xwem-cl-use-parent-xwin t
   "*Non-nil mean that CL will use some X window, where it(CL) lowered.
-This is need to fullish some X applications, which accuire clients in such evil manner."
+This is need to fullish some X applications, which accuire clients in
+such evil manner."
   :type 'boolean
   :group 'xwem-cl)
 
+(defcustom xwem-cl-noname-name "<noname>"
+  "*Name for clients which does not have name."
+  :type 'string
+  :group 'xwem-cl)
+
+(defcustom xwem-cl-noicon-name "<noname>"
+  "*Icon name for clients which does not have their own."
+  :type 'string
+  :group 'xwem-cl)
+
 (defcustom xwem-cl-other-strategy 'samewin
   "*Strategy to be used to select other CL.
 One of 'any 'samewin 'sameframe.
 		 (const :tag "Any" any))
   :group 'xwem-cl)
 
-(defcustom xwem-cl-other-on-split t
-  "Non-nil mean manage other client when split occurs in new window.
-Minor mode."
+(defcustom xwem-frame-iresize-mode 'normal
+  "*Default type of drawing outlines when resizing frame interactively.
+It is not recommeded to use 'opaque resize mode."
+  :type '(choice (const :tag "Normal border" normal)
+                 (const :tag "Contiguous borders" contiguous)
+                 (const :tag "Outline Corners" corners)
+                 (const :tag "Grid" grid)
+                 (const :tag "Opaque" opaque)
+                 )
+  :group 'xwem-frame)
+
+(defcustom xwem-frame-imove-mode 'normal
+  "*Default type of drawing outlines when moving frame interactively."
+  :type '(choice (const :tag "Normal border" normal)
+                 (const :tag "Contiguous border" contiguous)
+                 (const :tag "Outline Corners" corners)
+                 (const :tag "Grid" grid)
+                 (const :tag "Opaque" opaque)
+                 )
+  :group 'xwem-frame)
+
+(defcustom xwem-imove-visible t
+  "*Non-nil mean `xwem-client-imove' will info you about new position."
   :type 'boolean
   :group 'xwem-cl)
 
-(defcustom xwem-cl-use-set-focus t
-  "*Non-nil mean that managed clients takes focus.
-NOTE: installs hook into `xwem-cl-manage-hook'."
+(defcustom xwem-iresize-visible t
+  "*Non-nil mean `xwem-client-iresize' will info you about new size."
   :type 'boolean
   :group 'xwem-cl)
 
-(defcustom xwem-cl-use-recent-cl-on-top nil
-  "*Non-nil mean that most recent client is on top in `xwem-clients' list."
-  :type 'boolean
+(define-xwem-face x-border-face
+  `(((selected) (:foreground "green"))
+    (t (:foreground "gray80")))
+  "Face for client's X border."
+  :group 'xwem-cl
+  :group 'xwem-faces)
+
+;;;###xwem-autoload
+(defcustom xwem-client-focusing 'advanced
+  "Clients focusing type.
+One of:
+
+  'advanced -  Any client can be selected, even if it has broken focus model.
+  'standard -  Strictly follow ICCCM, hoping everything will be ok.
+
+You should change default value only in very rare circumstances.  You
+should fully understand how focusing works in xwem to change default
+value."
+  :type '(choice (const :tag "Advanced" advanced)
+                 (const :tag "Standard" standard))
+  :group 'xwem-cl)
+
+;;;###autoload
+(defcustom xwem-client-default-properties
+  '(x-border-width 2)
+  "*Default properties for newly managed clients."
+  :type 'list
+  :group 'xwem-cl)
+
+(defcustom xwem-client-selected-border-color "green"
+  "*Border color when client is selected."
+  :type 'color
+  :group 'xwem-cl)
+
+(defcustom xwem-client-nonselected-border-color "gray"
+  "*Border color when client is not selected."
+  :type 'color
   :group 'xwem-cl)
 
 (defcustom xwem-cl-mark-ring-max 16
   :type 'number
   :group 'xwem-cl)
 
+;;;###autoload
 (defcustom xwem-cl-create-hook nil
   "Hook to call when creating new client."
   :type 'hook
   :group 'xwem-cl)
 
+;;;###autoload
 (defcustom xwem-cl-destroy-hook nil
   "Hooks called with one argument - cl, when cl destroyed.
 NOT USED YET."
   :type 'hook
   :group 'xwem-hooks)
 
-(defcustom xwem-cl-manage-hook nil
+;;;###autoload
+(defcustom xwem-cl-activate-hook nil
   "*Hooks to be called with just setuped CL as argument."
   :type 'hook
   :group 'xwem-hooks)
 
-(defcustom xwem-cl-demanage-hook nil
+;;;###autoload
+(defcustom xwem-cl-deactivate-hook nil
   "*Hooks to be called with just desetuped CL as argument."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-refit-hook nil
   "Hooks called when CL just refited."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-iconify-hook nil
   "Hooks called when CL just iconified."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
+(defcustom xwem-cl-withdraw-hook nil
+  "*Hooks to call when CL moved to withdrawn state."
+  :type 'hook
+  :group 'xwem-hooks)
+
+;;;###autoload
 (defcustom xwem-cl-change-hook nil
   "Hooks called when something changed in CL."
   :type 'hook
   :group 'xwem-hooks)
 
+;;;###autoload
 (defcustom xwem-cl-state-change-hook nil
   "*Hooks to run when state of client changes.
 Every hook called with three args - CL OLD-STATE NEW-STATE."
   :type 'hook
   :group 'xwem-hooks)
 
-(defcustom xwem-cl-mark-hook nil
-  "*Hooks to run when marking client.
-Hooks called with two args - CL STATE.
-Where STATE is one of 'mark or 'unmark."
-  :type 'hook
-  :group 'xwem-hooks)
-
-;;; CL property change hooks
-(defcustom xwem-cl-wmnh-change-hooks nil
-  "Hooks to be called when WM_NORMAL_HINTS changes."
-  :type 'hook
-  :group 'xwem-hooks)
-
-(defcustom xwem-cl-wmname-change-hooks nil
-  "Hooks to be called when WM_NAME changes."
-  :type 'hook
-  :group 'xwem-hooks)
-
-(defcustom xwem-cl-wmcommand-chage-hooks nil
-  "Hooks to be called when WM_COMMAND changes."
-  :type 'hook
-  :group 'xwem-hooks)
-
-(defcustom xwem-cl-wmclass-change-hooks nil
-  "Hooks to be called when WM_CLASS changes."
-  :type 'hook
-  :group 'xwem-hooks)
-
-(defcustom xwem-cl-wmh-change-hooks nil
-  "Hooks to be called when WM_HINTS changes."
+;;;###autoload
+(defcustom xwem-client-select-hook nil
+  "*Hooks called when new client just selected.
+It is pretty guarantied that `xwem-selected-client' is valid xwem-cl
+structure at time of hook execution."
   :type 'hook
   :group 'xwem-hooks)
 
 ;;;###autoload
-(defvar xwem-clients nil "Clients Windows list")
+(defcustom xwem-client-deselect-hook nil
+  "Hooks called with one arg - cl, when cl deselected.
+It is pretty guarantied that `xwem-selected-client' is valid xwem-cl
+structure at time of hook execution."
+  :type 'hook
+  :group 'xwem-hooks)
+
+;;; Internal variables
+
+
+(defconst xwem-client-ev-mask
+  (Xmask-or XM-ColormapChange XM-PropertyChange
+            XM-FocusChange XM-EnterWindow XM-LeaveWindow
+            XM-StructureNotify XM-ResizeRedirect)
+  "Event mask for xwem's client.")
+
+;;;###xwem-autoload
+(defvar xwem-clients nil
+  "List of all managed clients.")
+
+;;;###xwem-autoload
+(defvar xwem-current-cl nil
+  "Internal variable.
+Use `xwem-cl-selected' to get selected client.")
+
+;;;###xwem-autoload
+(defvar xwem-last-cl nil
+  "Last selected client.
+Use `(xwem-last-client)' to get last selected client.")
 
 ;;;###autoload
 (defvar xwem-cl-mark-ring nil
   "The list of marked clients.")