======
AZDock
======

:Author: Yen-Ju Chen <yjchenx at gmail>
:License: BSD license

AZDock is a dock for Etoile
It depends on XWindowServerKit 
and requires Azalea for tracking xwindow windows.

Behaviors
---------
Left-click on dock to raise windows on current desktop.
If there is no windows on current desktop, 
it will automatically change desktop to the one having windows.
COMMAND+Left-click will create new window for xwindow application,
but not GNUstep application.

In short, left-click to switch application and workspace if necessary.
COMMAND+left-click to create new application for xwindows.

User Defaults
-------------
Key: DockPosition
Value: 0 (Left side), 1 (Right side), 2 (Bottom side)
Key: AutoHidden
Value: YES or NO;

NOTE
----
If you have GWorkspace installed, GNUstep will try to use it automatically.
Therefore, whenever you start AZDock, GWorkspace will also start.
If you don't want this to happen, use
`defaults write NSGlobalDomain GSWorkspaceApplication NotExist.app` block it.

TODO
----
* Drag file on icon and call -application:openFile: ?
* Open new window if there is no one on current desktop.
  (Or should we switch back to the existing one ? )
* List all windows and documents on contextual menu.
* Use freedesktop spec to get icon of xwindow applications
  instead of caching our own.
* Drag-and-drop to organize icon
* Support docking regular file ? Or leave it to shelf ?.
* Figure out how to change icon according to app icon from GNUstep application.
  See AZGNUstepApp -acceptXWindow: for all options.

DESIGN
------
AZDock deal with many types of applications. Each one need special case.

* XWindow:
  AZDock listens to Azalea about the launch and termination fo XWindows.
  XWindow is window-based. It keeps all windows from the same program
  under a dock. 

* GNUstep: 
  AZDock use NSWorkspace to track GNUstep applications, 
  with notification from Azalea for abnormal termination. 
 
* WindowMaker Docklet:
  AZDock listens to Azalea for docklet. Docklet starts as unmapped xwindow. 
  Therefore, it is not treated as regular X window.
  It need to be launched automatically.
  Although docklet is older than other similar implementation,
  it is used to expriment reparenting X window onto NSWindow.

* System Trays:
  In FreeDesktop.org specification, system trays is where program can stay
  and send notification. Actually, it is very similar to GNUstep's app icon.
  Because XWindow is window-based, once window is closed, program terminates.
  Some programs need to stay running when their windows close, for example,
  instant messenger. Therefore, system tray is where it can stay.
  
