X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3-doc.git;a=blobdiff_plain;f=tricks.tex;h=3069d3caa6415083c75fce421c47db7a54d96805;hp=9cf86d1559bd8e3c56425f7de4cb141db76e9eac;hb=428266c577f55bd77cf036ed0d2af379613471e4;hpb=da1e04def26932e7f91a2106c885142e7fafe59b diff --git a/tricks.tex b/tricks.tex index 9cf86d1..3069d3c 100644 --- a/tricks.tex +++ b/tricks.tex @@ -30,10 +30,9 @@ 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 \ref{sec:hookref}. - 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. +use any functions that modify Ion's internal state. + \section{Referring to regions} @@ -87,12 +86,15 @@ region, use \fnref{WRegion.set_name}. It is possible to write more complex winprop selection routines than those described in section \ref{sec:winprops}. To match a particular winprop using whatever way you want to, just set the \var{match} -field of the winprop to a function that receives the client window -as its sole parameter, and that returns \code{true} if the winprop -matches, and \code{false} otherwise. - -The class, instance and role properties can be obtained with -\fnref{WClientWin.get_ident}, and the title with \fnref{WRegion.name}. +field of the winprop to a function that receives the as its parameters +the triple \var{(prop, cwin, id)}, where \var{prop} is the table for +the winprop itself, \code{cwin} is the client window object, +and \var{id} is the \fnref{WClientWin.get_ident} result. +The function should return \var{true} if the winprop matches, +and \code{false} otherwise. Note that the \var{match} function +is only called after matching against class/role/instance. + +The title of a client window can be obtained with \fnref{WRegion.name}. 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: \fnref{ioncore.x_intern_atom}