1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3 <!--Converted with LaTeX2HTML 2002-2-1 (1.71)
4 original version by: Nikos Drakos, CBLU, University of Leeds
5 * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
6 * with significant contributions from:
7 Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
10 <TITLE>2. Preliminaries: Key concepts and relations</TITLE>
11 <META NAME="description" CONTENT="2. Preliminaries: Key concepts and relations">
12 <META NAME="keywords" CONTENT="ionconf">
13 <META NAME="resource-type" CONTENT="document">
14 <META NAME="distribution" CONTENT="global">
16 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
17 <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
18 <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
20 <LINK REL="STYLESHEET" HREF="ionconf.css">
22 <LINK REL="next" HREF="node4.html">
23 <LINK REL="previous" HREF="node2.html">
24 <LINK REL="up" HREF="ionconf.html">
25 <LINK REL="next" HREF="node4.html">
30 <DIV CLASS="navigation"><!--Navigation Panel-->
33 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
36 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
39 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
42 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
45 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
47 <B> Next:</B> <A NAME="tex2html268"
48 HREF="node4.html">3. Basic configuration</A>
49 <B> Up:</B> <A NAME="tex2html262"
50 HREF="ionconf.html">Configuring and extending Ion3</A>
51 <B> Previous:</B> <A NAME="tex2html256"
52 HREF="node2.html">1. Introduction</A>
53 <B> <A NAME="tex2html264"
54 HREF="node1.html">Contents</A></B>
55 <B> <A NAME="tex2html266"
56 HREF="node11.html">Index</A></B>
59 <!--End of Navigation Panel-->
60 <!--Table of Child-Links-->
61 <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
63 <UL CLASS="ChildLinks">
64 <LI><A NAME="tex2html269"
65 HREF="node3.html#SECTION00310000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Modules</A>
66 <LI><A NAME="tex2html270"
67 HREF="node3.html#SECTION00320000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Class and object hierarchies</A>
69 <LI><A NAME="tex2html271"
70 HREF="node3.html#SECTION00321000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Class hierarchy</A>
71 <LI><A NAME="tex2html272"
72 HREF="node3.html#SECTION00322000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Object hierarchies: WRegion parents and managers</A>
74 <LI><A NAME="tex2html273"
75 HREF="node3.html#SECTION00322100000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Parent-child relations</A>
76 <LI><A NAME="tex2html274"
77 HREF="node3.html#SECTION00322200000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Manager-managed relations</A>
79 <LI><A NAME="tex2html275"
80 HREF="node3.html#SECTION00323000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">3</SPAN> Summary</A>
82 <!--End of Table of Child-Links-->
85 <H1><A NAME="SECTION00300000000000000000"></A>
86 <A NAME="chap:prelim"></A>
88 <SPAN CLASS="arabic">2</SPAN>. Preliminaries: Key concepts and relations
92 The purpose of this chapter to explain some of key concepts and
93 relations you need to understand before reading the following
94 chapters. These include modules explained in section <A HREF="#sec:modules">2.1</A>
95 and the Ion class and object hierarchies, section <A HREF="#sec:objects">2.2</A>.
99 <H2><A NAME="SECTION00310000000000000000"></A>
100 <A NAME="sec:modules"></A>
102 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Modules
106 Ion has been designed so that the 'ion' executable only implements some
107 basic services on top of which very different kinds of window managers
108 could be build by loading the appropriate 'modules'. On modern system
109 these modules are simply dynamically loaded <SPAN CLASS="textit">.so</SPAN> libraries. On
110 more primitive systems, or if you want to squeeze total size of the
111 executable and libraries, the modules can optionally be statically
112 linked to the main binary, but must nevertheless be loaded with the
113 <A HREF="#fn:dopath"><TT>dopath</TT></A> function. Modules may also include Lua code.
116 If no modules are loaded, all client windows appear in full screen mode.
117 To get better window management support, one or more workspace modules
118 should be loaded. Currently Ion provides the following modules:
122 <DT><STRONG><SPAN CLASS="textit">mod_tiling</SPAN></STRONG></DT>
123 <DD>Tilings for workspaces of the original tiled
127 <DT><STRONG><SPAN CLASS="textit">mod_query</SPAN></STRONG></DT>
128 <DD>Queries (for starting programs and so on)
132 <DT><STRONG><SPAN CLASS="textit">mod_menu</SPAN></STRONG></DT>
133 <DD>Support for menus, both pull-down and
134 keyboard-operated in-frame menus.
137 <DT><STRONG><SPAN CLASS="textit">mod_statusbar</SPAN></STRONG></DT>
138 <DD>Module that implements a statusbar that
139 can be adaptively embedded in each workspace's layout.
142 <DT><STRONG><SPAN CLASS="textit">mod_dock</SPAN></STRONG></DT>
143 <DD>Module for docking Window Maker dock-apps.
144 The dock can both float and be embedded as the statusbar.
147 <DT><STRONG><SPAN CLASS="textit">mod_sp</SPAN></STRONG></DT>
148 <DD>This module implements a scratchpad frame that can
149 be toggled on/off everywhere. Think of the 'console' in some
150 first-person shooters.
153 <DT><STRONG><SPAN CLASS="textit">mod_sm</SPAN></STRONG></DT>
154 <DD>Session management support module.
155 <SPAN CLASS="textit">Loaded automatically when needed!</SPAN>
160 So-called drawing engines are also implemented as a modules,
161 but they are not discussed here; see chapter <A HREF="node5.html#chap:gr">4</A>.
164 The stock configuration for the <SPAN CLASS="textit">ion3</SPAN> executable loads all of the
165 modules mentioned above except <SPAN CLASS="textit">mod_dock</SPAN>.
166 The stock configuration for the <SPAN CLASS="textit">pwm3</SPAN> executable (which differs
167 from the <SPAN CLASS="textit">ion3</SPAN> executable in a few configuration details)
168 loads another set of modules.
174 <H2><A NAME="SECTION00320000000000000000"></A>
175 <A NAME="sec:objects"></A>
177 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Class and object hierarchies
181 While Ion does not not have a truly object-oriented design
183 HREF="#foot297"><SUP><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A>,
184 things that appear on the computer screen are, however, quite
185 naturally expressed as such ``objects''. Therefore Ion implements
186 a rather primitive OO system for these screen objects and some
190 It is essential for the module writer to learn this object
191 system, but also people who write their own binding configuration files
192 necessarily come into contact with the class and object hierarchies
193 - you need to know which binding setup routines apply where,
194 and what functions can be used as handlers in which bindings.
195 It is the purpose of this section to attempt to explain these
196 hierarchies. If you do not wish the read the full section, at least
197 read the summary at the end of it, so that you understand the very
201 For simplicity we consider only the essential-for-basic-configuration
202 Ioncore, <SPAN CLASS="textit">mod_tiling</SPAN> and <SPAN CLASS="textit">mod_query</SPAN> classes.
203 See Appendix <A HREF="node9.html#app:fullhierarchy">B</A> for the full class hierarchy visible
208 <H3><A NAME="SECTION00321000000000000000">
209 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Class hierarchy</A>
213 One of the most important principles of object-oriented design methodology
214 is inheritance; roughly how classes (objects are instances of classes)
215 extend on others' features. Inheritance gives rise to class hierarchy.
216 In the case of single-inheritance this hierarchy can be expressed as a
217 tree where the class at the root is inherited by all others below it
218 and so on. Figure <A HREF="#fig:classhierarchy">2.1</A> lists out the Ion class
219 hierarchy and below we explain what features of Ion the classes
224 <DIV ALIGN="CENTER"><A NAME="fig:classhierarchy"></A><A NAME="404"></A>
226 <CAPTION ALIGN="BOTTOM"><STRONG>Figure 2.1:</STRONG>
227 Partial Ioncore, <SPAN CLASS="textit">mod_tiling</SPAN> and <SPAN CLASS="textit">mod_query</SPAN>
228 class hierarchy.</CAPTION>
237 | | | |-->WRootWin
238 | | |-->WInput (mod_query)
239 | | |-->WEdln (mod_query)
240 | | |-->WMessage (mod_query)
244 | |-->WTiling (mod_tiling)
245 |-->WSplit (mod_tiling)
255 <DT><STRONG>Obj</STRONG></DT>
256 <DD><A NAME="410"></A>
257 Is the base of Ion's object system.
261 <DT><STRONG>WRegion</STRONG></DT>
262 <DD><A NAME="411"></A>
263 is the base class for everything corresponding to something on the
264 screen. Each object of type WRegion has a size and position
265 relative to the parent WRegion. While a big part of Ion
266 operates on these instead of more specialised classes, WRegion
267 is a ``virtual'' base class in that there are no objects of ``pure''
268 type WRegion; all concrete regions are objects of some class
269 that inherits WRegion.
273 <DT><STRONG>WClientWin</STRONG></DT>
274 <DD><A NAME="412"></A> is a class for
275 client window objects, the objects that window managers are
280 <DT><STRONG>WWindow</STRONG></DT>
281 <DD><A NAME="413"></A> is the base class for all
282 internal objects having an X window associated to them
283 (WClientWins also have X windows associated to them).
287 <DT><STRONG>WMPlex</STRONG></DT>
288 <DD>is a base class for all regions that ``multiplex''
289 other regions. This means that of the regions managed by the multiplexer,
290 only one can be displayed at a time.
294 <DT><STRONG>WScreen</STRONG></DT>
295 <DD><A NAME="414"></A> is an instance of WMPlex
300 <DT><STRONG>WRootWin</STRONG></DT>
301 <DD><A NAME="415"></A> is the class for
302 root windows<A NAME="331"></A> of X screens<A NAME="332"></A>.
303 It is an instance of WScreen.
304 Note that an ``X screen'' or root window is not necessarily a
305 single physical screen<A NAME="334"></A> as a root window
306 may be split over multiple screens when ugly hacks such as
307 Xinerama<A NAME="335"></A> are used. (Actually there can be only
308 one root window when Xinerama is used.)
312 <DT><STRONG>WFrame</STRONG></DT>
313 <DD><A NAME="416"></A> is the class for frames.
314 While most Ion's objects have no graphical presentation, frames
315 basically add to WMPlexes the decorations around client
316 windows (borders, tabs).
320 <DT><STRONG>WGroup</STRONG></DT>
321 <DD><A NAME="417"></A> is the base class for groups.
322 Particular types of groups are workspaces
323 (WGroupWS<A NAME="418"></A>)
324 and groups of client windows
325 (WGroupCW<A NAME="419"></A>).
330 Classes implemented by the <SPAN CLASS="textit">mod_tiling</SPAN> module:
334 <DT><STRONG>WTiling</STRONG></DT>
335 <DD><A NAME="421"></A> is the class for tilings
339 <DT><STRONG>WSplit</STRONG></DT>
340 <DD><A NAME="422"></A> (or, more specifically, classes
341 that inherit it) encode the WTiling tree structure.
346 Classes implemented by the <SPAN CLASS="textit">mod_query</SPAN> module:
350 <DT><STRONG>WInput</STRONG></DT>
351 <DD><A NAME="424"></A> is a virtual base class for the
355 <DT><STRONG>WEdln</STRONG></DT>
356 <DD><A NAME="425"></A> is the class for the ``queries'',
357 the text inputs that usually appear at bottoms of frames and sometimes
358 screens. Queries are the functional equivalent of ``mini buffers'' in
362 <DT><STRONG>WMessage</STRONG></DT>
363 <DD><A NAME="426"></A> implements the boxes for
364 warning and other messages that Ion may wish to display to the user.
365 These also usually appear at bottoms of frames.
370 There are also some other ``proxy'' classes that do not refer
371 to objects on the screen. The only important one of these for
372 basic configuration is WMoveresMode that is used for
373 binding callbacks in the move and resize mode.
377 <H3><A NAME="SECTION00322000000000000000">
378 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Object hierarchies: WRegion parents and managers</A>
383 <H4><A NAME="SECTION00322100000000000000">
384 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Parent-child relations</A>
386 Each object of type WRegion has a parent and possibly a manager
387 associated to it. The parent<A NAME="367"></A> for an object is always a
388 WWindow and for WRegion with an X window (WClientWin,
389 WWindow) the parent WWindow is given by the same relation of
390 the X windows. For other WRegions the relation is not as clear.
391 There is generally very few restrictions other than the above on the
392 parent--child relation but the most common is as described in
393 Figure <A HREF="#fig:parentship">2.2</A>.
397 <DIV ALIGN="CENTER"><A NAME="fig:parentship"></A><A NAME="378"></A>
399 <CAPTION ALIGN="BOTTOM"><STRONG>Figure 2.2:</STRONG>
400 Most common parent-child relations</CAPTION>
406 |-->WClientWins in full screen mode
410 |-->WFrames for transients
411 |-->a possible WEdln or WMessage
417 WRegions have very little control over their children as a parent.
418 The manager<A NAME="382"></A> WRegion has much more control over its
419 managed WRegions. Managers, for example, handle resize requests,
420 focusing and displaying of the managed regions. Indeed the manager--managed
421 relationship gives a better picture of the logical ordering of objects on
422 the screen. Again, there are generally few limits, but the most common
423 hierarchy is given in Figure <A HREF="#fig:managership">2.3</A>. Note that sometimes
424 the parent and manager are the same object and not all objects may have
425 a manager (e.g. the dock in the dock module at the time of writing this)
426 but all have a parent-a screen if not anything else.
430 <H4><A NAME="SECTION00322200000000000000">
431 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Manager-managed relations</A>
436 <DIV ALIGN="CENTER"><A NAME="fig:managership"></A><A NAME="390"></A>
438 <CAPTION ALIGN="BOTTOM"><STRONG>Figure 2.3:</STRONG>
439 Most common manager-managed relations</CAPTION>
443 |-->WGroupCWs for full screen WClientWins
445 | |-->WFrames for transients (dialogs)
447 |-->WGroupWSs for workspaces
450 | | | |-->WGroupCWs (with contents as above)
451 | | |-->possibly a WStatusBar or WDock
452 | |-->WFrames for floating content
453 | |-->possibly a WEdln, WMessage or WMenu
454 | |-->possibly a WStatusBar or WDock (if no tiling)
455 |-->WFrames for sticky stuff, such as the scratchpad
461 Note that a workspace can manage another workspace. This can be
462 achieved with the <A HREF="#fn:attach_new"><TT>attach_new</TT></A> function, and allows you to nest
463 workspaces as deep as you want.
467 <H3><A NAME="SECTION00323000000000000000">
468 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">3</SPAN> Summary</A>
472 In the standard setup, keeping queries, messages and menus out of
478 <LI>The top-level objects that matter are screens and they correspond
479 to physical screens. The class for screens is WScreen.
481 <LI>Screens contain (multiplex) groups (WGroup) and other
482 objects, such as WFrames. Some of these are mutually exclusive
483 to be viewed at a time.
485 <LI>Groups of the specific kind WGroupWS often contain a
486 WTiling tiling for tiling frames (WFrame), but
487 groups may also directly contain floating frames.
489 <LI>Frames are the objects with decorations such as tabs and borders.
490 Frames contain (multiplex) among others (groups of) client windows,
491 to each of which corresponds a tab in the frame's decoration. Only
492 one client window (or other object) can be shown at a time in each
493 frame. The class for client windows is WClientWin.
498 <BR><HR><H4>Footnotes</H4>
500 <DT><A NAME="foot297">... design</A><A
501 HREF="node3.html#tex2html3"><SUP><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A></DT>
502 <DD>the author doesn't like such artificial designs
506 <DIV CLASS="navigation"><HR>
507 <!--Navigation Panel-->
508 <A NAME="tex2html267"
510 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
511 <A NAME="tex2html261"
513 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
514 <A NAME="tex2html255"
516 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
517 <A NAME="tex2html263"
519 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
520 <A NAME="tex2html265"
522 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
524 <B> Next:</B> <A NAME="tex2html268"
525 HREF="node4.html">3. Basic configuration</A>
526 <B> Up:</B> <A NAME="tex2html262"
527 HREF="ionconf.html">Configuring and extending Ion3</A>
528 <B> Previous:</B> <A NAME="tex2html256"
529 HREF="node2.html">1. Introduction</A>
530 <B> <A NAME="tex2html264"
531 HREF="node1.html">Contents</A></B>
532 <B> <A NAME="tex2html266"
533 HREF="node11.html">Index</A></B> </DIV>
534 <!--End of Navigation Panel-->