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="tex2html241"
48 HREF="node4.html">3. Basic configuration</A>
49 <B> Up:</B> <A NAME="tex2html235"
50 HREF="ionconf.html">Configuring and extending Ion3</A>
51 <B> Previous:</B> <A NAME="tex2html229"
52 HREF="node2.html">1. Introduction</A>
53 <B> <A NAME="tex2html237"
54 HREF="node1.html">Contents</A></B>
55 <B> <A NAME="tex2html239"
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="tex2html242"
65 HREF="node3.html#SECTION00310000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Modules</A>
66 <LI><A NAME="tex2html243"
67 HREF="node3.html#SECTION00320000000000000000"><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Class and object hierarchies</A>
69 <LI><A NAME="tex2html244"
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="tex2html245"
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="tex2html246"
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="tex2html247"
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="tex2html248"
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 dockapps.
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_mgmtmode</SPAN></STRONG></DT>
154 <DD>Support module for implementing ''management
155 modes'' with a XOR-frame similar to move/resize mode around selected
159 <DT><STRONG><SPAN CLASS="textit">mod_sm</SPAN></STRONG></DT>
160 <DD>Session management support module.
161 <SPAN CLASS="textit">Loaded automatically when needed!</SPAN>
166 So-called drawing engines are also implemented as a modules,
167 but they are not discussed here; see chapter <A HREF="node5.html#chap:gr">4</A>.
170 The stock configuration for the 'ion3' executable loads all of the modules
171 mentioned above except <SPAN CLASS="textit">mod_dock</SPAN> and filemod_mgmtmode.
172 The stock configuration for the 'pwm3' executable (which differs from the
173 'ion3' executable in a few configuration details, such as Xinerama usage)
174 loads another set of modules.
180 <H2><A NAME="SECTION00320000000000000000"></A>
181 <A NAME="sec:objects"></A>
183 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Class and object hierarchies
187 While Ion does not not have a truly object-oriented design
189 HREF="#foot306"><SUP><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A>,
190 things that appear on the computer screen are, however, quite
191 naturally expressed as such ''objects''. Therefore Ion implements
192 a rather primitive OO system for these screen objects and some
196 It is essential for the module writer to learn this object
197 system, but also people who write their own binding configuration files
198 necessarily come into contact with the class and object hierarchies
199 - you need to know which binding setup routines apply where,
200 and what functions can be used as handlers in which bindings.
201 It is the purpose of this section to attempt to explain these
202 hierarchies. If you do not wish the read the full section, at least
203 read the summary at the end of it, so that you understand the very
207 For simplicity we consider only the essential-for-basic-configuration
208 Ioncore, <SPAN CLASS="textit">mod_tiling</SPAN> and <SPAN CLASS="textit">mod_query</SPAN> classes.
209 See Appendix <A HREF="node9.html#app:fullhierarchy">B</A> for the full class hierachy visible
214 <H3><A NAME="SECTION00321000000000000000">
215 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Class hierarchy</A>
219 One of the most important principles of object-oriented design methodology
220 is inheritance; roughly how classes (objects are instances of classes)
221 extend on others' features. Inheritance gives rise to class hierarchy.
222 In the case of single-inheritance this hierarchy can be expressed as a
223 tree where the class at the root is inherited by all others below it
224 and so on. Figure <A HREF="#fig:classhierarchy">2.1</A> lists out the Ion class
225 hierarchy and below we explain what features of Ion the classes
230 <DIV ALIGN="CENTER"><A NAME="fig:classhierarchy"></A><A NAME="412"></A>
232 <CAPTION ALIGN="BOTTOM"><STRONG>Figure 2.1:</STRONG>
233 Partial Ioncore, <SPAN CLASS="textit">mod_tiling</SPAN> and <SPAN CLASS="textit">mod_query</SPAN>
234 class hierarchy.</CAPTION>
243 | | | |-->WRootWin
244 | | |-->WInput (mod_query)
245 | | |-->WEdln (mod_query)
246 | | |-->WMessage (mod_query)
250 | |-->WTiling (mod_tiling)
251 |-->WSplit (mod_tiling)
261 <DT><STRONG>Obj</STRONG></DT>
262 <DD><A NAME="418"></A>
263 Is the base of Ion's object system.
267 <DT><STRONG>WRegion</STRONG></DT>
268 <DD><A NAME="419"></A>
269 is the base class for everything corresponding to something on the
270 screen. Each object of type WRegion has a size and position
271 relative to the parent WRegion. While a big part of Ion
272 operates on these instead of more specialised classes, WRegion
273 is a ''virtual'' base class in that there are no objects of ''pure''
274 type WRegion; all concrete regions are objects of some class
275 that inherits WRegion.
279 <DT><STRONG>WClientWin</STRONG></DT>
280 <DD><A NAME="420"></A> is a class for
281 client window objects, the objects that window managers are
286 <DT><STRONG>WWindow</STRONG></DT>
287 <DD><A NAME="421"></A> is the base class for all
288 internal objects having an X window associated to them
289 (WClientWins also have X windows associated to them).
293 <DT><STRONG>WRootWin</STRONG></DT>
294 <DD><A NAME="422"></A> is the class for
295 root windows<A NAME="336"></A> of X screens<A NAME="337"></A>.
296 Note that an ''X screen'' or root window is not necessarily a
297 single physical screen<A NAME="338"></A> as a root window
298 may be split over multiple screens when hacks such as
299 Xinerama<A NAME="339"></A> are used. (Actually there can be only
300 one root window when Xinerama is used.)
304 <DT><STRONG>WMPlex</STRONG></DT>
305 <DD>is a base class for all regions that''multiplex''
306 other regions. This means that of the regions managed by the multiplexer,
307 only one can be displayed at a time. Classes that inhereit WMPlex
308 include screens and frames.
312 <DT><STRONG>WScreen</STRONG></DT>
313 <DD><A NAME="423"></A> is the class for objects
314 corresponding to physical screens. Screens may share a root
315 window when the Xinerama extension is used as explained above.
319 <DT><STRONG>WFrame</STRONG></DT>
320 <DD><A NAME="424"></A> is the class for frames.
321 While most Ion's objects have no graphical presentation, frames basically
322 add to WMPlexes the decorations around client windows
327 <DT><STRONG>WGroup</STRONG></DT>
328 <DD><A NAME="425"></A> is the base class for groups.
329 Particular types of groups are workspaces
330 (WGroupWS<A NAME="426"></A>)
331 and groups of client windows
332 (WGroupCW<A NAME="427"></A>).
337 Classes implemented by the <SPAN CLASS="textit">mod_tiling</SPAN> module:
341 <DT><STRONG>WTiling</STRONG></DT>
342 <DD><A NAME="429"></A> is the class for tilings
346 <DT><STRONG>WSplit</STRONG></DT>
347 <DD><A NAME="430"></A> (or, more specifically, classes
348 that inherit it) encode the WTiling tree structure.
353 Classes implemented by the <SPAN CLASS="textit">mod_query</SPAN> module:
357 <DT><STRONG>WInput</STRONG></DT>
358 <DD><A NAME="432"></A> is a virtual base class for the
362 <DT><STRONG>WEdln</STRONG></DT>
363 <DD><A NAME="433"></A> is the class for the ''queries'',
364 the text inputs that usually appear at bottoms of frames and sometimes
365 screens. Queries are the functional equivalent of ''mini buffers'' in
369 <DT><STRONG>WMessage</STRONG></DT>
370 <DD><A NAME="434"></A> implements the boxes for
371 warning and other messages that Ion may wish to display to the user.
372 These also usually appear at bottoms of frames.
377 There are also some other ''proxy'' classes that do not refer
378 to objects on the screen. The only important one of these for
379 basic configuration is WMoveresMode that is used for
380 binding callbacks in the move and resize mode.
384 <H3><A NAME="SECTION00322000000000000000">
385 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Object hierarchies: WRegion parents and managers</A>
390 <H4><A NAME="SECTION00322100000000000000">
391 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Parent-child relations</A>
393 Each object of type WRegion has a parent and possibly a manager
394 associated to it. The parent<A NAME="375"></A> for an object is always a
395 WWindow and for WRegion with an X window (WClientWin,
396 WWindow) the parent WWindow is given by the same relation of
397 the X windows. For other WRegions the relation is not as clear.
398 There is generally very few restrictions other than the above on the
399 parent--child relation but the most common is as described in
400 Figure <A HREF="#fig:parentship">2.2</A>.
404 <DIV ALIGN="CENTER"><A NAME="fig:parentship"></A><A NAME="386"></A>
406 <CAPTION ALIGN="BOTTOM"><STRONG>Figure 2.2:</STRONG>
407 Most common parent-child relations</CAPTION>
413 |-->WClientWins in full screen mode
417 |-->WFrames for transients
418 |-->a possible WEdln or WMessage
424 WRegions have very little control over their children as a parent.
425 The manager<A NAME="390"></A> WRegion has much more control over its
426 managed WRegions. Managers, for example, handle resize requests,
427 focusing and displaying of the managed regions. Indeed the manager--managed
428 relationship gives a better picture of the logical ordering of objects on
429 the screen. Again, there are generally few limits, but the most common
430 hierarchy is given in Figure <A HREF="#fig:managership">2.3</A>. Note that sometimes
431 the parent and manager are the same object and not all objects may have
432 a manager (e.g. the dock in the dock module at the time of writing this)
433 but all have a parent-a screen if not anything else.
437 <H4><A NAME="SECTION00322200000000000000">
438 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Manager-managed relations</A>
443 <DIV ALIGN="CENTER"><A NAME="fig:managership"></A><A NAME="398"></A>
445 <CAPTION ALIGN="BOTTOM"><STRONG>Figure 2.3:</STRONG>
446 Most common manager-managed relations</CAPTION>
450 |-->WGroupCWs for full screen WClientWins
452 | |-->WFrames for transients (dialogs)
454 |-->WGroupWSs for workspaces
456 | | |-->possibly a WEdln, WMessage or WMenu
458 | | |-->WGroupCWs (with contents as above)
459 | |-->WFrames for floating content
460 |-->WFrames for sticky stuff, such as the scratchpad
466 Note that a workspace can manage another workspace. This can be
467 achieved with the <A HREF="#fn:attach_new"><TT>attach_new</TT></A> function, and allows you to nest
468 workspaces as deep as you want.
472 <H3><A NAME="SECTION00323000000000000000">
473 <SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">3</SPAN> Summary</A>
477 In the standard setup, keeping queries, messages and menus out of
483 <LI>The top-level objects that matter are screens and they correspond
484 to physical screens. The class for screens is WScreen.
486 <LI>Screens contain (multiplex) groups (WGroup) and other
487 objects, such as WFrames. Some of these are mutually exclusive
488 to be viewed at a time.
490 <LI>Groups of the specific kind WGroupWS often contain a
491 WTiling tiling for tiling frames (WFrame), but
492 groups may also directly contain floating frames.
494 <LI>Frames are the objects with decorations such as tabs and borders.
495 Frames contain (multiplex) among others (groups of) client windows,
496 to each of which corresponds a tab in the frame's decoration. Only
497 one client window (or other object) can be shown at a time in each
498 frame. The class for client windows is WClientWin.
503 <BR><HR><H4>Footnotes</H4>
505 <DT><A NAME="foot306">... design</A><A
506 HREF="node3.html#tex2html3"><SUP><SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A></DT>
507 <DD>the author doesn't like such artificial designs
511 <DIV CLASS="navigation"><HR>
512 <!--Navigation Panel-->
513 <A NAME="tex2html240"
515 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
516 <A NAME="tex2html234"
518 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
519 <A NAME="tex2html228"
521 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
522 <A NAME="tex2html236"
524 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
525 <A NAME="tex2html238"
527 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
529 <B> Next:</B> <A NAME="tex2html241"
530 HREF="node4.html">3. Basic configuration</A>
531 <B> Up:</B> <A NAME="tex2html235"
532 HREF="ionconf.html">Configuring and extending Ion3</A>
533 <B> Previous:</B> <A NAME="tex2html229"
534 HREF="node2.html">1. Introduction</A>
535 <B> <A NAME="tex2html237"
536 HREF="node1.html">Contents</A></B>
537 <B> <A NAME="tex2html239"
538 HREF="node11.html">Index</A></B> </DIV>
539 <!--End of Navigation Panel-->