Initial Commit
[packages] / xemacs-packages / xwem / man / win.texi
1 @node Window, Client, Frame, Primitives
2 @section Window
3 @cindex window
4
5 In this chapter we will discuss thing related to XWEM's Windows.
6
7 @menu
8 * Basic Windows::               Basic information on Windows.
9 * Splitting Windows::           Splitting Window into two.
10 * Deleting Windows::            How you should delete Windows.
11 * Selecting Windows::           Selected Window.
12 * Cycling Windows::             Moving around Windows.
13 * Resizing Windows::            Changing size of Windows.
14 * Window Configurations::       Saving and restoring layout of Windows.
15 * Drawing Windows::             How Windows stuff are drawed.
16 * Window Expectances::          Window can wait for a particular client.
17 @end menu
18
19 @node Basic Windows, Splitting Windows, Window, Window
20 @comment  node-name,  next,  previous,  up
21 @subsection Basic Windows
22 @cindex basics
23
24 @dfn{Window} is subpart of Frame(@pxref{Frame}) that holds Clients
25 (@pxref{Client}).  Each Frame always contain at least one Window, but
26 you con divide it vertically or horizontally to obtain new Windows.
27 Windows never overlaps.  There is always selected Window in each Frame,
28 but it is not guaranties that Client in selected Window will have input
29 focus.
30
31 @defun xwem-init-win
32 Initilizes all stuff we will need.
33 @end defun
34
35 @defvar xwem-win-default-properties
36 Plist of default properties for newly created Windows.  Keys in list is
37 one of symbol:
38 @itemize
39 @item @code{dead} Window referenced but not workable.
40 @item @code{deleted} Deleted Windows have this non-@code{nil}.
41 @item @code{frame} Reference to XWEM Frame.
42 @item @code{next} Next window in windows double linked list.
43 @item @code{prev} Previous window in windows double linked list.
44 @item @code{hchild} Horizontal child.
45 @item @code{vchild} Vertical child.
46 @item @code{client} Link to XWEM Client that is in XWEM Window or @code{nil}.
47 @item @code{expectances} Expectances plist for XWEM Window.
48 @end itemize
49 @end defvar
50
51 @defun xwem-win-p win
52 Return non-@code{nil} if @var{win} is Window.
53 @end defun
54
55 @node Splitting Windows, Deleting Windows, Basic Windows, Window
56 @comment  node-name,  next,  previous,  up
57 @subsection Splitting Windows
58 @cindex splitting
59
60 Functions described here is used in way to split XWEM's window or get
61 information about split.
62
63 @defvar xwem-win-min-width
64 Minimal width in pixels that XWEM Window may have after spliting.
65
66 @example
67 xwem-win-min-width
68 @result{} 40
69 @end example
70 @end defvar
71
72 @defvar xwem-win-min-height
73 Minimal height in pixels that XWEM Window may have after spliting.
74
75 @example
76 xwem-win-min-height
77 @result{} 40
78 @end example
79 @end defvar
80
81 @defun xwem-win-split &optional window how new-size
82 Splits XWEM @var{window}, @var{how} is one of @code{vertical} or
83 @code{horizontal}(default is @code{horizontal}).  @var{new-size} is size
84 in pixels which should have @var{window} after split.
85 @end defun
86
87 @defun xwem-win-only-one-p &optional window
88 Returns non-@code{nil} if @var{window} is only one in XWEM Windows chain.
89 @end defun
90
91 @node Deleting Windows, Selecting Windows, Splitting Windows, Window
92 @comment  node-name,  next,  previous,  up
93 @subsection Deleting Windows
94 @cindex deleting
95
96 @defun xwem-window-delete &optional window
97 Deletes XWEM @var{window}. If ommited than @code{xwem-win-selected} will
98 be used.
99 @end defun
100
101 @defun xwem-window-delete-others &optional window
102 Deletes all XWEM Windows other then @var{window}.
103 @end defun
104
105 @defun xwem-win-delete-subwindows window
106 Mark all child of XWEM @var{window} as deleted.
107 @end defun
108
109 @defun xwem-win-mark-deleted window
110 @end defun
111
112 @node Selecting Windows, Cycling Windows, Deleting Windows, Window
113 @comment  node-name,  next,  previous,  up
114 @subsection Selecting Windows
115 @cindex selecting
116
117 Select a window means that client currently in than window receives
118 input focus.
119
120 @defvar xwem-win-switch-hook
121 Hooks that will be runned when selected window changes.  Functions in
122 should accept two arguments - @code{old-win} and @code{new-win}.
123
124 @example
125 xwem-win-switch-hook
126 @result{} (xwem-win-focus xwem-win-title)
127 @end example
128 @end defvar
129
130 @defun xwem-win-selected
131 Returns selected XWEM Window.
132 @end defun
133
134 @defun xwem-win-selected-p window
135 Return non-@code{nil} if @var{window} is selected.
136 @end defun
137
138 @defun xwem-window-select window
139 Select @var{window} as current XWEM Window. Runs @code{xwem-win-switch-hooks}.
140 @end defun
141
142 @node Cycling Windows, Resizing Windows, Selecting Windows, Window
143 @comment  node-name,  next,  previous,  up
144 @subsection Cycling Windows
145 @cindex cycling
146
147 @defun xwem-win-make-list-by-next window
148 Creates list of XWEM Windows using @code{next} property.
149 @end defun
150
151 @defun xwem-win-new props
152 Creates new XWEM Window using properties obtained after merging
153 @code{xwem-window-defprops} and @var{props} together.
154 @end defun
155
156 @defun xwem-win-replace oldw neww
157 Replace @var{oldw} XWEM Window with contents of @var{neww} XWEM Window.
158 @end defun
159
160 @defun xwem-win-make-parent window
161 Creates dummy parent XWEM Window for @var{window}.
162 @end defun
163
164 @defun xwem-window-next &optional window
165 Returns next XWEM Window after @var{window} in canonical ordering.
166 @end defun
167
168 @defun xwem-window-next-vertical &optional window
169 Returns XWEM Window which is vertically after @var{window}.
170 @end defun
171
172 @defun xwem-window-prev &optional window
173 Returns previous XWEM Window before @var{window} in canonical ordering
174 of XWEM Windows.
175 @end defun
176
177 @defun xwem-win-map fn &optional window
178 Apply @var{fn} function to @var{window} and each child of it. @var{fn}
179 will be called with an XWEM Window as argument.
180 @end defun
181
182 @defun xwem-win-count &optional window
183 Count childs in @var{window}.
184 @end defun
185
186 @defun xwem-window-list &optional frame
187 nil
188 @end defun
189
190 Here is somelike windmove package.
191
192 @defun xwem-winmove-left &optional arg
193 Move to the left.
194 TODO: describe @var{arg}.
195 @end defun
196
197 @defun xwem-winmove-right &optional arg
198 Move to the right.
199 TODO: describe @var{arg}.
200 @end defun
201
202 @defun xwem-winmove-up &optional arg
203 Move to the up.
204 TODO: describe @var{arg}.
205 @end defun
206
207 @defun xwem-winmove-down &optional arg
208 Move to the down.
209 TODO: describe @var{arg}.
210 @end defun
211
212 TODO: write me
213
214 @node Resizing Windows, Window Configurations, Cycling Windows, Window
215 @comment  node-name,  next,  previous,  up
216 @subsection Resizing Windows
217 @cindex resizing
218
219 Here functions that operations on window's sizes.
220
221 @defun xwem-window-set-pixsize window nsize nodelete is-height
222 Sets size of @var{window} to @var{nsize} in pixels.
223 If @var{is-height} is non-@code{nil} then nsize is new @var{window}
224 height.
225 @end defun
226
227 @defun xwem-window-change-size window delta height-p
228 Changes XWEM @var{window} size to old-size plus
229 @var{delta}. @var{height-p} is non-@code{nil} if height changes.
230 @end defun
231
232 TODO: add shrink and enlarge
233
234 @node Window Configurations, Drawing Windows, Resizing Windows, Window
235 @comment  node-name,  next,  previous,  up
236 @subsection Window Configurations
237 @cindex window configurations
238
239 @defun xwem-window-configuration &optional frame
240 Return current Windows configuration for @var{frame}.  You can restore
241 it than using @code{xwem-set-window-configuration}.
242 @end defun
243
244 @defun xwem-set-window-configuration win-config
245 Restore window configuration @var{win-config}, returned by
246 @code{xwem-window-configuration}.
247 @end defun
248
249 @node Drawing Windows, Window Expectances, Window Configurations, Window
250 @comment  node-name,  next,  previous,  up
251 @subsection Drawing Windows
252 @cindex drawing
253
254 @defvar xwem-win-delim-width
255 XWEM Window delimeter width in pixels, including shadow.
256 @end defvar
257
258 @defvar xwem-win-delim-shadow-thicksness
259 When drawing 3D shadows for XWEM Window delimeters, this variable used.
260 @end defvar
261
262 @defun xwem-win-draw-delims window
263 Draws delimeters in XWEM @var{window}.
264 @end defun
265
266 @node Window Expectances, , Drawing Windows, Window
267 @comment  node-name,  next,  previous,  up
268 @subsection Window Expectances
269 @cindex expectances
270
271 @dfn{Expectances} is thing describes which clients cirtain XWEM Window
272 wait to manage.
273
274 TODO: write me
275