Next: 3. Basic configuration
Up: Configuring and extending Ion3
Previous: 1. Introduction
Contents
Index
Subsections
2. Preliminaries: Key concepts and relations
The purpose of this chapter to explain some of key concepts and
relations you need to understand before reading the following
chapters. These include modules explained in section 2.1
and the Ion class and object hierarchies, section 2.2.
2.1 Modules
Ion has been designed so that the 'ion' executable only implements some
basic services on top of which very different kinds of window managers
could be build by loading the appropriate 'modules'. On modern system
these modules are simply dynamically loaded .so libraries. On
more primitive systems, or if you want to squeeze total size of the
executable and libraries, the modules can optionally be statically
linked to the main binary, but must nevertheless be loaded with the
dopath function. Modules may also include Lua code.
If no modules are loaded, all client windows appear in full screen mode.
To get better window management support, one or more workspace modules
should be loaded. Currently Ion provides the following workspace modules
- mod_ionws
- Tiled workspaces of the original Ion kind.
- mod_floatws
- Conventional workspaces with freely floating
frames of the PWM flavour.
- mod_panews
- Tiled workspaces with automatic tiling in a
template layout based on silly heuristics or winprop (see section
3.5).
Workspace modules alone don't yet make the WM very usable. At the least
the mod_query and mod_menu modules should be loaded for
better input capabilities. The full list of additional modules is as
follows
- mod_query
- Queries (for starting programs and so on)
and message boxes.
- mod_menu
- Support for menus, both pull-down and
keyboard-operated in-frame menus.
- mod_statusbar
- Module that implements a statusbar that
can be adaptively embedded in each workspace's layout.
- mod_dock
- Module for docking Window Maker dockapps.
The dock can both float and be embedded as the statusbar.
- mod_sp
- This module implements a scratchpad frame that can
be toggled on/off everywhere. Think of the 'console' in some
first-person shooters.
- mod_mgmtmode
- Support module for implementing ''management
modes'' with a XOR-frame similar to move/resize mode around selected
region.
- mod_sm
- Session management support module.
Loaded automatically when needed!
So-called drawing engines are also implemented as a modules,
but they are not discussed here; see chapter 4.
The stock configuration for the 'ion3' executable loads all of the modules
mentioned above except mod_dock and filemod_mgmtmode.
The stock configuration for the 'pwm3' executable (which differs from the
'ion3' executable in a few configuration details, such as Xinerama usage)
only load mod_floatws, mod_menu and mod_query.
2.2 Class and object hierarchies
While Ion does not not have a truly object-oriented design
2.1,
things that appear on the computer screen are, however, quite
naturally expressed as such ''objects''. Therefore Ion implements
a rather primitive OO system for these screen objects and some
other things.
It is essential for the module writer to learn this object
system, but also people who write their own binding configuration files
necessarily come into contact with the class and object hierarchies
- you need to know which binding setup routines apply where,
and what functions can be used as handlers in which bindings.
It is the purpose of this section to attempt to explain these
hierarchies. If you do not wish the read the full section, at least
read the summary at the end of it, so that you understand the very
basic relations.
For simplicity we consider only the essential-for-basic-configuration
Ioncore, mod_ionws and mod_query classes.
See Appendix B for the full class hierachy visible
to Lua side.
One of the most important principles of object-oriented design methodology
is inheritance; roughly how classes (objects are instances of classes)
extend on others' features. Inheritance gives rise to class hierarchy.
In the case of single-inheritance this hierarchy can be expressed as a
tree where the class at the root is inherited by all others below it
and so on. Figure 2.1 lists out the Ion class
hierarchy and below we explain what features of Ion the classes
implement.
Figure 2.1:
Ioncore, mod_ionws and mod_query class hierarchy.
Obj
|-->WRegion
| |-->WClientWin
| |-->WWindow
| | |-->WRootWin
| | |-->WMPlex
| | | |-->WScreen
| | | |-->WFrame
| | |-->WInput (mod_query)
| | |-->WEdln (mod_query)
| | |-->WMessage (mod_query)
| |-->WGenWS
| |-->WIonWS (mod_ionws)
|-->WSplit (mod_ionws)
|
The core classes:
- Obj
-
Is the base of Ion's object system.
- WRegion
-
is the base class for everything corresponding to something on the
screen. Each object of type WRegion has a size and position
relative to the parent WRegion. While a big part of Ion
operates on these instead of more specialised classes, WRegion
is a ''virtual'' base class in that there are no objects of ''pure''
type WRegion; all concrete regions are objects of some class
that inherits WRegion.
- WClientWin
- is a class for
client window objects, the objects that window managers are
supposed to manage.
- WWindow
- is the base class for all
internal objects having an X window associated to them
(WClientWins also have X windows associated to them).
- WRootWin
- is the class for
root windows of X screens.
Note that an ''X screen'' or root window is not necessarily a
single physical screen as a root window
may be split over multiple screens when multi-head extensions
such as Xinerama are used. (Actually there
can be only one WRootWin when Xinerama is used.)
- WMPlex
- is a base class for all regions that''multiplex''
other regions. This means that of the regions managed by the multiplexer,
only one can be displayed at a time. Classes that inhereit WMPlex
include screens and frames.
- WScreen
- is the class for objects
corresponding to physical screens. Screens may share a root
window when Xinerama multihead extensions are used as explained
above.
- WFrame
- is the class for frames.
While most Ion's objects have no graphical presentation, frames basically
add to WMPlexes the decorations around client windows
(borders, tabs).
- WGenWS
- is a light base class for
different types of workspaces.
Classes implemented by the ionws module:
- WIonWS
- is the class for the
usual tiled workspaces.
- WSplit
- (or, more specifically, classes
that inherit it) encode the WIonWS tree structure.
Classes implemented by the query module:
- WInput
- is a virtual base class for the
two classes below.
- WEdln
- is the class for the ''queries'',
the text inputs that usually appear at bottoms of frames and sometimes
screens. Queries are the functional equivalent of ''mini buffers'' in
many text editors.
- WMessage
- implements the boxes for
warning and other messages that Ion may wish to display to the user.
These also usually appear at bottoms of frames.
Each object of type WRegion has a parent and possibly a manager
associated to it. The parent for an object is always a
WWindow and for WRegion with an X window (WClientWin,
WWindow) the parent WWindow is given by the same relation of
the X windows. For other WRegions the relation is not as clear.
There is generally very few restrictions other than the above on the
parent--child relation but the most common is as described in
Figure 2.2.
Figure 2.2:
Most common parent-child relations
WRootWins
|-->WScreens
|-->WIonWSs
|-->WClientWins in full screen mode
|-->WFrames
|-->WClientWins, including transients
|-->a possible WEdln or WMessage
|
WRegions have very little control over their children as a parent.
The manager WRegion has much more control over its
managed WRegions. Managers, for example, handle resize requests,
focusing and displaying of the managed regions. Indeed the manager--managed
relationship gives a better picture of the logical ordering of objects on
the screen. Again, there are generally few limits, but the most common
hierarchy is given in Figure 2.3. Note that sometimes
the parent and manager are the same object and not all objects may have
a manager (e.g. the dock in the dock module at the time of writing this)
but all have a parent-a screen if not anything else.
Figure 2.3:
Most common manager-managed relations
WRootWins
|-->WScreens
|-->full screen WClientWins
| |-->transient WClientWins (dialogs)
|-->WScratchpad
|-->WIonWSs/WFloatWS/WPaneWS
|-->WFrames
| |-->WClientWins
| | |-->transient WClientWins (dialogs)
| |-->possibly a WEdln or WMessage
|-->WIonWSs/WFloatWS/WPaneWS
|
Note that a workspace can manage another workspace. This can be
achieved with the attach_new function, and allows you to nest
workspaces as deep as you want.
In the standard setup, keeping queries, messages and menus out of
consideration:
- The top-level objects that matter are screens and they correspond
to physical screens. The class for screens is WScreen.
- Screens contain (multiplex) workspaces and full screen client
windows. Only one of them can be viewed at a time.
Workspace classes are WIonWS and WFloatWS
for the two different types of workspaces (and WGenWS).
- Frames are managed by workspaces. Frames are the objects with
decorations such as tabs and borders.
- Frames contain (multiplex) client windows, to each of which
corresponds a tab in the frame's decoration. Only one client
window (or other object) can be shown at a time in each frame.
The class for client windows is WClientWin.
Footnotes
- ... design2.1
- the author doesn't like such artificial designs
Next: 3. Basic configuration
Up: Configuring and extending Ion3
Previous: 1. Introduction
Contents
Index