]> git.decadent.org.uk Git - ion3-doc.git/blobdiff - ionconf/node6.html
[svn-upgrade] Integrating new upstream version, ion3-doc (20080103)
[ion3-doc.git] / ionconf / node6.html
index 8c985d1cb3fa2bed420c7114658bcb529fc9f1be..200471fca2d1391051b539c7480523b007e0dec4 100644 (file)
@@ -28,31 +28,31 @@ original version by:  Nikos Drakos, CBLU, University of Leeds
 <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>
- &nbsp; <B>  <A NAME="tex2html325"
+ &nbsp; <B>  <A NAME="tex2html359"
   HREF="node1.html">Contents</A></B> 
- &nbsp; <B>  <A NAME="tex2html327"
+ &nbsp; <B>  <A NAME="tex2html361"
   HREF="node11.html">Index</A></B> 
 <BR>
 <BR></DIV>
@@ -61,20 +61,20 @@ original version by:  Nikos Drakos, CBLU, University of Leeds
 <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-->
@@ -89,7 +89,7 @@ original version by:  Nikos Drakos, CBLU, University of Leeds
 <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>
 
@@ -101,16 +101,16 @@ the basic configuration exlained in chapter <A HREF="node4.html#chap:config">3</
 
 <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>
@@ -122,12 +122,11 @@ ioncore.get_hook("ioncore_snapshot_hook"):add(
 <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>
 
@@ -142,7 +141,7 @@ documentation when this is final.
 </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
@@ -202,13 +201,16 @@ region, use <A HREF="node7.html#fn:WRegion.set_name"><TT>WRegion.set_name</TT></
 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>
@@ -219,8 +221,10 @@ and <A HREF="node7.html#fn:ioncore.x_get_text_property"><TT>ioncore.x_get_text_p
 
 <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>
@@ -228,11 +232,11 @@ All statusbar meters that do not monitor the internal state of Ion should
 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>
@@ -241,11 +245,11 @@ Additionally the script should provide a 'template' for the meter to
 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>
@@ -319,31 +323,31 @@ local settings=table.join(statusd.get_config("foo"), defaults)
 
 <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>
- &nbsp; <B>  <A NAME="tex2html325"
+ &nbsp; <B>  <A NAME="tex2html359"
   HREF="node1.html">Contents</A></B> 
- &nbsp; <B>  <A NAME="tex2html327"
+ &nbsp; <B>  <A NAME="tex2html361"
   HREF="node11.html">Index</A></B> </DIV>
 <!--End of Navigation Panel-->