<BODY >
<DIV CLASS="navigation"><!--Navigation Panel-->
-<A NAME="tex2html328"
+<A NAME="tex2html362"
HREF="node7.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
-<A NAME="tex2html322"
+<A NAME="tex2html356"
HREF="ionconf.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
-<A NAME="tex2html316"
+<A NAME="tex2html350"
HREF="node5.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
-<A NAME="tex2html324"
+<A NAME="tex2html358"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
-<A NAME="tex2html326"
+<A NAME="tex2html360"
HREF="node11.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
<BR>
-<B> Next:</B> <A NAME="tex2html329"
+<B> Next:</B> <A NAME="tex2html363"
HREF="node7.html">6. Function reference</A>
-<B> Up:</B> <A NAME="tex2html323"
+<B> Up:</B> <A NAME="tex2html357"
HREF="ionconf.html">Configuring and extending Ion3</A>
-<B> Previous:</B> <A NAME="tex2html317"
+<B> Previous:</B> <A NAME="tex2html351"
HREF="node5.html">4. Graphical styles</A>
- <B> <A NAME="tex2html325"
+ <B> <A NAME="tex2html359"
HREF="node1.html">Contents</A></B>
- <B> <A NAME="tex2html327"
+ <B> <A NAME="tex2html361"
HREF="node11.html">Index</A></B>
<BR>
<BR></DIV>
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL CLASS="ChildLinks">
-<LI><A NAME="tex2html330"
+<LI><A NAME="tex2html364"
HREF="node6.html#SECTION00610000000000000000"><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">1</SPAN> Hooks</A>
-<LI><A NAME="tex2html331"
+<LI><A NAME="tex2html365"
HREF="node6.html#SECTION00620000000000000000"><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">2</SPAN> Referring to regions</A>
<UL>
-<LI><A NAME="tex2html332"
+<LI><A NAME="tex2html366"
HREF="node6.html#SECTION00621000000000000000"><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">1</SPAN> Direct object references</A>
-<LI><A NAME="tex2html333"
+<LI><A NAME="tex2html367"
HREF="node6.html#SECTION00622000000000000000"><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">2</SPAN>.<SPAN CLASS="arabic">2</SPAN> Name-based lookups</A>
</UL>
<BR>
-<LI><A NAME="tex2html334"
+<LI><A NAME="tex2html368"
HREF="node6.html#SECTION00630000000000000000"><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">3</SPAN> Alternative winprop selection criteria</A>
-<LI><A NAME="tex2html335"
+<LI><A NAME="tex2html369"
HREF="node6.html#SECTION00640000000000000000"><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN> Writing <TT>ion-statusd</TT> monitors</A>
</UL>
<!--End of Table of Child-Links-->
<P>
This chapter documents some additional features of the Ion configuration
and scripting interface that can be used for more advanced scripting than
-the basic configuration exlained in chapter <A HREF="node4.html#chap:config">3</A>.
+the basic configuration explained in chapter <A HREF="node4.html#chap:config">3</A>.
<P>
<P>
Hooks are lists of functions to be called when a certain event occurs.
-There are two types of them; normal and ''alternative'' hooks. Normal
+There are two types of them; normal and ``alternative'' hooks. Normal
hooks do not return anything, but alt-hooks should return a boolean
-indicating whether it handled its assigned task succesfully. In the case
+indicating whether it handled its assigned task successfully. In the case
that <TT>true</TT> is returned, remaining handlers are not called.
<P>
Hook handlers are registered by first finding the hook
-with <A HREF="#fn:ioncore.get_hook"><TT>ioncore.get_hook</TT></A> and then calling <A HREF="#fn:WHook.add"><TT>WHook.add</TT></A>
-on the (succesfull) result with the handler as parameter. Similarly
-handlers are unregistered with <A HREF="#fn:WHook.remove"><TT>WHook.remove</TT></A>. For example:
+with <A HREF="node7.html#fn:ioncore.get_hook"><TT>ioncore.get_hook</TT></A> and then calling <A HREF="node7.html#fn:WHook.add"><TT>WHook.add</TT></A>
+on the (successful) result with the handler as parameter. Similarly
+handlers are unregistered with <A HREF="node7.html#fn:WHook.remove"><TT>WHook.remove</TT></A>. For example:
<P>
<PRE>
<P>
In this example the hook handler has no parameters, but many hook
handlers do. The types of parameters for each hook are listed in
-the hook reference, section <A HREF="node7.html#sec:hookref">6.8</A>.
+the hook reference, section <A HREF="node7.html#sec:hookref">6.9</A>.
<P>
-Note that many of the hooks are called in ''protected mode'' and can not
-use any functions that modify Ion's internal state. TODO: More detailed
-documentation when this is final.
+Note that many of the hooks are called in ``protected mode'' and can not
+use any functions that modify Ion's internal state.
<P>
</H3>
<P>
-All Ion objects are passed to Lua scriptss as 'userdatas', and you may
+All Ion objects are passed to Lua scripts as 'userdatas', and you may
safely store such object references for future use. The C-side object
may be destroyed while Lua still refers to the object. All exported
functions gracefully fail in such a case, but if you need to explicitly
It is possible to write more complex winprop selection routines than
those described in section <A HREF="node4.html#sec:winprops">3.5</A>. To match a particular
winprop using whatever way you want to, just set the <TT>match</TT>
-field of the winprop to a function that receives the client window
-as its sole parameter, and that returns <TT>true</TT> if the winprop
-matches, and <TT>false</TT> otherwise.
+field of the winprop to a function that receives the as its parameters
+the triple <TT>(prop, cwin, id)</TT>, where <TT>prop</TT> is the table for
+the winprop itself, <TT>cwin</TT> is the client window object,
+and <TT>id</TT> is the <A HREF="node7.html#fn:WClientWin.get_ident"><TT>WClientWin.get_ident</TT></A> result.
+The function should return <TT>true</TT> if the winprop matches,
+and <TT>false</TT> otherwise. Note that the <TT>match</TT> function
+is only called after matching against class/role/instance.
<P>
-The class, instance and role properties can be obtained with
-<A HREF="node7.html#fn:WClientWin.get_ident"><TT>WClientWin.get_ident</TT></A>, and the title with <A HREF="node7.html#fn:WRegion.name"><TT>WRegion.name</TT></A>.
+The title of a client window can be obtained with <A HREF="node7.html#fn:WRegion.name"><TT>WRegion.name</TT></A>.
If you want to match against (almost) arbitrary window properties,
have a look at the documentation for the following functions, and
their standard Xlib counterparts: <A HREF="node7.html#fn:ioncore.x_intern_atom"><TT>ioncore.x_intern_atom</TT></A>
<P>
-<H2><A NAME="SECTION00640000000000000000">
-<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN> Writing <TT>ion-statusd</TT> monitors</A>
+<H2><A NAME="SECTION00640000000000000000"></A>
+<A NAME="sec:statusd"></A>
+<BR>
+<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN> Writing <TT>ion-statusd</TT> monitors
</H2>
<P>
go in the separate <TT>ion-statusd</TT> program.
<P>
-Whenever the user requests a meter <TT>%foo</TT> or <TT>%foo_bar</TT> to be
-inserted in a statusbar, <SPAN CLASS="textit">mod_statusbar</SPAN> asks <TT>ion-statusd</TT> to
-load <A HREF="#fn:statusd_foo.lua"><TT>statusd_foo.lua</TT></A> on its search path (same as that for Ion-side
+Whenever the user requests a meter `<TT>%foo</TT>' or `<TT>%foo_bar</TT>' to
+be inserted in a statusbar, <SPAN CLASS="textit">mod_statusbar</SPAN> asks <TT>ion-statusd</TT>
+to load <A HREF="#fn:statusd_foo.lua"><TT>statusd_foo.lua</TT></A> on its search path (same as that for Ion-side
scripts). This script should then supply all meters with the initial part
-'<TT>foo</TT>'.
+`<TT>foo</TT>'.
<P>
To provide this value, the script should simply call <TT>statusd.inform</TT>
facilitate expected width calculation by <SPAN CLASS="textit">mod_statusbar</SPAN>, and
may provide a 'hint' for colour-coding the value. The interpretation
of hints depends on the graphical style in use, and currently the
-stock styles support the <TT>normal</TT>, <TT>important</TT> and
-<TT>critical</TT> hints.
+stock styles support the `<TT>normal</TT>', `<TT>important</TT>' and
+`<TT>critical</TT>' hints.
<P>
-In our example of the 'foo monitor', at script init we might broadcast
+In our example of the 'foo monitor', at script initialisation we might broadcast
the template as follows:
<P>
<DIV CLASS="navigation"><HR>
<!--Navigation Panel-->
-<A NAME="tex2html328"
+<A NAME="tex2html362"
HREF="node7.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
-<A NAME="tex2html322"
+<A NAME="tex2html356"
HREF="ionconf.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
-<A NAME="tex2html316"
+<A NAME="tex2html350"
HREF="node5.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
-<A NAME="tex2html324"
+<A NAME="tex2html358"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
-<A NAME="tex2html326"
+<A NAME="tex2html360"
HREF="node11.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
<BR>
-<B> Next:</B> <A NAME="tex2html329"
+<B> Next:</B> <A NAME="tex2html363"
HREF="node7.html">6. Function reference</A>
-<B> Up:</B> <A NAME="tex2html323"
+<B> Up:</B> <A NAME="tex2html357"
HREF="ionconf.html">Configuring and extending Ion3</A>
-<B> Previous:</B> <A NAME="tex2html317"
+<B> Previous:</B> <A NAME="tex2html351"
HREF="node5.html">4. Graphical styles</A>
- <B> <A NAME="tex2html325"
+ <B> <A NAME="tex2html359"
HREF="node1.html">Contents</A></B>
- <B> <A NAME="tex2html327"
+ <B> <A NAME="tex2html361"
HREF="node11.html">Index</A></B> </DIV>
<!--End of Navigation Panel-->