]> git.decadent.org.uk Git - ion3.git/blob - doc/hookref.tex
[svn-inject] Installing original source of ion3
[ion3.git] / doc / hookref.tex
1
2 \begin{function}
3     \index{clientwin-do-manage-alt@\code{clientwin_do_manage_alt}}
4     \hookname{clientwin_do_manage_alt}
5     \hookparams{(WClientWin, table)}
6     \begin{funcdesc}
7       Called when we want to manage a new client window.
8       The table argument contains the following fields:
9       
10       \begin{tabularx}{\linewidth}{llX}
11           \tabhead{Field & Type & Description}
12           \var{switchto} & bool & Do we want to switch to the client window. \\
13           \var{jumpto} & bool & Do we want to jump to the client window. \\
14           \var{userpos} & bool & Geometry set by user. \\
15           \var{dockapp} & bool & Client window is a dockapp. \\
16           \var{maprq} & bool & Map request (and not initialisation scan). \\
17           \var{gravity} & number & Window gravity. \\
18           \var{geom} & table & Requested geometry; \var{x}, \var{y}, \var{w}, \var{h}.\\
19           \var{tfor} & WClientWin & Transient for window.
20       \end{tabularx}
21
22       This hook is not called in protected mode and can be used for
23       arbitrary placement policies (deciding in which workspace a new
24       \type{WClientWin} should go). In this case, you can call
25 \begin{verbatim}
26 reg:attach(cwin)
27 \end{verbatim}
28       where \var{reg} is the region where the window should go, and
29       \var{cwin} is the first argument of the function added to the
30       hook.
31     \end{funcdesc}
32 \end{function}
33
34
35 \begin{function}
36     \index{clientwin-mapped-hook@\code{clientwin_mapped_hook}}
37     \hookname{clientwin_mapped_hook}
38     \hookparams{WClientWin}
39     \begin{funcdesc}
40       Called when we have started to manage a client window.
41     \end{funcdesc}
42 \end{function}
43
44
45 \begin{function}
46     \index{clientwin-unmapped-hook@\code{clientwin_unmapped_hook}}
47     \hookname{clientwin_unmapped_hook}
48     \hookparams{number}
49     \begin{funcdesc}
50       Called when we no longer manage a client window. The parameter
51       is the X ID of the window; see \fnref{WClientWin.xid}.
52     \end{funcdesc}
53 \end{function}
54
55
56 \begin{function}
57     \index{frame-managed-changed-hook@\code{frame_managed_changed_hook}}
58     \hookname{frame_managed_changed_hook}
59     \hookparams{table}
60     \begin{funcdesc}
61       Called when there are changes in the objects managed by a frame
62       or their order. The table parameter has the following fields:
63
64       \begin{tabularx}{\linewidth}{llX}
65           \tabhead{Field & Type & Description}
66           \var{reg} & WFrame & The frame in question \\
67           \var{mode} & string & \var{"switchonly"}, \var{"reorder"},
68                                 \var{"add"} or \var{"remove"} \\
69           \var{sw} & bool & Switch occured \\
70           \var{sub} & WRegion & The managed region (primarily) affected \\
71       \end{tabularx}
72     \end{funcdesc}
73 \end{function}
74
75
76 \begin{function}
77     \index{ioncore-sigchld-hook@\code{ioncore_sigchld_hook}}
78     \hookname{ioncore_sigchld_hook}
79     \hookparams{integer}
80     \begin{funcdesc}
81       Called when a child process has exited. The parameter
82       is the PID of the process.
83     \end{funcdesc}
84 \end{function}
85
86 \begin{function}
87     \index{ioncore-deinit-hook@\code{ioncore_deinit_hook}}
88     \hookname{ioncore_deinit_hook}
89     \hookparams{()}
90     \begin{funcdesc}
91       Called when Ion is deinitialising and about to quit.
92     \end{funcdesc}
93 \end{function}
94
95 %ioncore_handle_event_alt -- not available to lua side
96
97 \begin{function}
98     \index{ioncore-post-layout-setup-hook@\code{ioncore_post_layout_setup_hook}}
99     \hookname{ioncore_post_layout_setup_hook}
100     \hookparams{()}
101     \begin{funcdesc}
102       Called when Ion has done all initialisation and is almost ready to
103       enter the mainloop, except no windows are yet being managed.
104     \end{funcdesc}
105 \end{function}
106
107
108 \begin{function}
109     \index{ioncore-snapshot-hook@\code{ioncore_snapshot_hook}}
110     \hookname{ioncore_snapshot_hook}
111     \hookparams{()}
112     \begin{funcdesc}
113       Called to signal scripts and modules to save their state (if any).
114     \end{funcdesc}
115 \end{function}
116
117
118 \begin{function}
119     \index{tiling-placement-alt@\code{tiling_placement_alt}}
120     \hookname{tiling_placement_alt}
121     \hookparams{table}
122     \begin{funcdesc}
123       Called when a client window is about to be managed by a \type{WTiling}
124       to allow for alternative placement policies. The table has the
125       following fields:
126       \begin{tabularx}{\linewidth}{llX}
127           \tabhead{Field & Type & Description}
128           \var{tiling} & \type{WTiling} & The tiling \\
129           \var{reg} & \type{WRegion} & The region (always a WClientWin at 
130               the moment) to be placed \\
131           \var{mp} & \type{table} & This table contains the same fields as
132             the parameter of \fnref{clientwin_do_manage_alt} \\
133           \var{res_frame} & \type{WFrame} & A succesfull handler should 
134             return the target frame here. \\
135       \end{tabularx}
136       This hook is just for placing within a given workspace after the
137       workspace has been decided by the default workspace selection
138       policy. It is called in protected mode. For arbitrary placement
139       policies, \fnref{clientwin_do_manage_alt} should be used; it
140       isn't called in protected mode,
141     \end{funcdesc}
142 \end{function}
143
144
145 %\begin{function}
146 %    \index{panews-init-layout-alt@\code{panews_init_layout_alt}}
147 %    \hookname{panews_init_layout_alt}
148 %    \hookparams{table}
149 %    \begin{funcdesc}
150 %      Called to initialise panews layout. The table parameter has
151 %      initially a single field \var{ws} pointing to the workspace,
152 %      but the succesfull handler should set the field \var{layout}
153 %      to a proper layout (as those saved in the layout savefiles).
154 %    \end{funcdesc}
155 %\end{function}
156
157
158 \begin{function}
159     \index{panews-make-placement-alt@\code{panews_make_placement_alt}}
160     \hookname{panews_make_placement_alt}
161     \hookparams{table}
162     \begin{funcdesc}
163       Called to make a placement on panews. The parameter table has
164       the following fields:
165       
166       \begin{tabularx}{\linewidth}{llX}
167           \tabhead{Field & Type & Description}
168           \var{ws} & \type{WPaneWS} & The workspace \\
169           \var{frame} & \type{WFrame} & A frame initially allocated for the
170               region to be placed \\
171           \var{reg} & \type{WRegion} & The region to be placed \\
172           \var{specifier} & \type{WRegion} & For drag\&drop on handling empty areas\\
173       \end{tabularx}
174       
175       The handler should set some of these fields on success:
176
177       \begin{tabularx}{\linewidth}{llX}
178           \tabhead{Field & Type & Description}
179           \var{res_node} & \type{WSplit} & Target split \\
180           \var{res_config} & \type{WFrame} &  New configuration for it, unless
181               \type{WSplitRegion} \\
182           \var{res_w} & integer & New width for target split (optional) \\
183           \var{res_h} & integer & New height for target split (optional) \\
184       \end{tabularx}
185     \end{funcdesc}
186 \end{function}
187
188
189 \begin{function}
190     \index{region-activated-hook@\code{region_activated_hook}}
191     \hookname{region_activated_hook}
192     \hookparams{WRegion}
193     \begin{funcdesc}
194       Signalled when a region or one of its children has received the focus.
195     \end{funcdesc}
196 \end{function}
197
198
199 \begin{function}
200     \index{region-activity-hook@\code{region_activity_hook}}
201     \hookname{region_activity_hook}
202     \hookparams{WRegion}
203     \begin{funcdesc}
204       This hook is triggered when the activity flag of the parameter 
205       region has been changed.
206     \end{funcdesc}
207 \end{function}
208
209
210 \begin{function}
211     \index{region-do-warp-alt@\code{region_do_warp_alt}}
212     \hookname{region_do_warp_alt}
213     \hookparams{WRegion}
214     \begin{funcdesc}
215       This alt-hook exist to allow for alternative pointer warping
216       implementations.
217     \end{funcdesc}
218 \end{function}
219
220
221 \begin{function}
222     \index{region-inactivated-hook@\code{region_inactivated_hook}}
223     \hookname{region_inactivated_hook}
224     \hookparams{WRegion}
225     \begin{funcdesc}
226       Signalled when the focus has moved from the parameter region or
227       one of its children to a non-child region of the parameter region.
228     \end{funcdesc}
229 \end{function}
230
231
232 \begin{function}
233     \index{screen-managed-changed-hook@\code{screen_managed_changed_hook}}
234     \hookname{screen_managed_changed_hook}
235     \hookparams{table}
236     \begin{funcdesc}
237       Called when there are changes in the objects managed by a screen
238       or their order. The table parameter is similar to that of
239       \fnref{frame_managed_changed_hook}.
240     \end{funcdesc}
241 \end{function}