home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / doc / wool_ref.tex (.txt) < prev   
LaTeX Document  |  1995-07-03  |  158KB  |  3,257 lines

  1. %exemple begin at col 9, ==> at col 41
  2. \chapter{WOOL Reference manual}
  3. \sloppy
  4. \ITEMa{;}{{\WOOL} comment}
  5. {\usagefont\begin{verbatim}
  6. ; any text up to the end of line
  7. \end{verbatim}}\usageupspace
  8. Comments in {\WOOL} begin with a semicolon and end at the end
  9. of the line.
  10. \ITEMa{!}{executes a shell command}
  11. {\usagefont\begin{verbatim} 
  12. (! command arguments...)
  13. \end{verbatim}}\usageupspace 
  14. Executes (forks) the  command given in string with its given arguments, and
  15. does not wait for termination (So you don't need to add a  final ``\&''). For
  16. instance, to open a new ``xterm'' window on the machine where {\GWM} is
  17. running, execute \verb|(! "xterm")|. This is an interface to the
  18. \verb"execvp" call: the command is searched for in the \verb"PATH" variable,
  19. and executed via \verb"/bin/sh" if it is a command file, directly executed
  20. otherwise.
  21. {Examples:\exemplefont\upspace\begin{verbatim}
  22.         (! "xterm")                       ; machine-executable code
  23.         (! "rxterm" "foobar")             ; or shell script
  24.         (! "xterm" "-display" "bar:0.1")  ; with arguments
  25.         (! "/bin/sh" "-c" "for i in a b c;do xclock -display $i:0;done")
  26.                                           ; needs a shell for commands
  27. \end{verbatim}}
  28. \ITEMbi{\#}{nth}{accesses an element of a list}
  29. {\usagefont\begin{verbatim}
  30. (# n list [object])
  31. (# atom list [object])
  32. \end{verbatim}}\usageupspace
  33. Gets (or sets to \verb"object" if present) the n-th element of the list
  34. \verb"list" (starting with 0). Increases the list size if needed (with
  35. nils).  When    the first argument is an atom, this references the element
  36. just after the atom in the list, thus providing the ability to maintain
  37. classical Lisp ``property lists''.
  38. Note that this function does not do a physical replacement, and constructs a
  39. new list with the \verb"list" argument. \seesnp{replace-nth}
  40. {Examples:\exemplefont\upspace\begin{verbatim}
  41.         (# 2 '(a b c d))                ==>     c
  42.         (# 2 '(a b c d) 'foo)           ==>     (a b foo d)
  43.         (# 'x '(x 4 y 6))               ==>     4
  44.         (# 'y '(x 4 y 6) 8)             ==>     (x 4 y 8)
  45.         (# 'z '(x 4 y 6) 10)            ==>     (x 4 y 6 z 10)
  46.         (# 6 '(a b c d) 'foo)           ==>     (a b c d () () foo)
  47. \end{verbatim}}
  48. In fact the index can be any Lisp object, but as the list is scanned to find
  49. the {\bf same} object (EQ predicate), using atoms is the safest way.
  50. {\exemplefont\begin{verbatim} 
  51.         (# "foo" '("foo" 1))            ==>     ()
  52.         (progn (setq name "foo")
  53.                 (# name (list name 1))) ==>     1
  54. \end{verbatim}}
  55. {\bf Note:} The second argument can also be a:
  56. \begin{description}
  57. \item[wob] in which case the contents of the \verb"wob-property" is taken
  58. as the list.
  59. \item[symbol] which must evaluate to a list, which is then used by the
  60. function.
  61. \end{description}
  62. \ITEMbi{\#\#}{replace-nth}{physically replaces an element of a list\hfill{\bf EXPERT}}
  63. {\usagefont\begin{verbatim}
  64. (## n list object)
  65. (## atom list object)
  66. \end{verbatim}}\usageupspace
  67. This function physically replaces an element of the list, which is located
  68. as with the \verb"#" function. It returns the modified list. 
  69. This provides a way to implement variable-sized lists, such as linked lists,
  70. which are the real lists in the Lisp world, but should be used with care, as
  71. you are able to create circular references with it. To allow the {\WOOL}
  72. garbage collector to handle correctly circular lists, you should always
  73. explicitly set to () the fields of a circular cell before disposing of it.
  74. Example: a circular list with cells of the form \verb"(car cdr)"
  75. {\exemplefont\begin{verbatim}
  76.         (setq elt2 '(b ()))             ; second cell of list
  77.         (setq elt1 (list a elt2))       ; first one pointing to second
  78.         (## 1 elt2 elt1)                ; we make a circular list
  79. \end{verbatim}}
  80. Now, if we set elt1 and elt2 to \verb"()", their storage will not
  81. be freed!, we must do
  82. {\exemplefont\begin{verbatim}
  83.         (## 1 elt2 ())
  84. \end{verbatim}}
  85. before setting them to \verb"()".
  86. {\bf Note:} The second argument can also be a:
  87. \begin{description}
  88. \item[wob] in which case the contents of the \verb"wob-property" is taken
  89. as the list.
  90. \item[symbol] which must evaluate to a list, which is then used by the
  91. function.
  92. \end{description}
  93. This is the {\bf only} case where lists can be extended, by specifying 
  94. an atom which do not exist in the list. In this case, if the list is pointed
  95. to by many objects, the list is duplicated, and only the copy pointed to by
  96. the wob or atom argument is modified, e.g.:
  97. {\exemplefont\begin{verbatim}
  98.         (setq l '(a 1))
  99.         (setq l-bis l)                  ; l and l-bis points to the same list
  100.         (## 'b 'l 2)                    ; only l is modified in place
  101.         l                               ==> (a 1 b 2)
  102.         l-bis                           ==> (a 1)
  103. \end{verbatim}}
  104. \ITEMa{(}{list notation}
  105. {\usagefont\begin{verbatim}
  106. (elt1 elt2 ... eltN)
  107. \end{verbatim}}\usageupspace
  108. This notation is used to describe a {\bf list} of {\tt N} elements, as in
  109. other Lisp languages. Note that {\WOOL} is not a true Lisp dialect since lists
  110. are represented internally as arrays, allowing for a greater speed and a
  111. smaller memory usage in the kind of programs used in a window manager. If
  112. you are a die-hard Lisp addict, you can still use CONS, CAR and CDR
  113. if you want by defining them as:
  114. {\exemplefont\begin{verbatim}
  115.         (defun cons (e l) (+ (list e) l))
  116.         (defun car (l) (# 0 l))
  117.         (defun cdr (l) (sublist 1 (length l) l))
  118. \end{verbatim}}
  119. {\bf Note:} The {\WOOL} parser ignores extraneous closing parentheses,
  120. allowing you to close top-level expressions in a file by a handful of
  121. closing parentheses, such as:
  122. {\exemplefont\begin{verbatim}
  123.         (defun cons (e l) (+ (list e) l)))))))))))))
  124.         (setq x 1))))))))
  125. \end{verbatim}}
  126. \ITEMb{()}{nil}{the nil value}
  127. {\usagefont\begin{verbatim}
  128. \end{verbatim}}\usageupspace
  129. The nil value, backbone of every Lisp implementation. In Lisp an object is
  130. said to be true if it is not nil.
  131. \ITEMa{""}{string notation}
  132. {\usagefont\begin{verbatim}
  133. "string"
  134. \end{verbatim}}\usageupspace
  135. Strings are surrounded by double quotes. C-style escape sequences are
  136. allowed, that is: 
  137. \begin{center}\begin{tabular}{ll}
  138. {\bf Sequence} & {\bf stands for} \\ \hline
  139. \verb|\n| & newline (control-J)\\
  140. \verb|\r| & carriage return (control-M)\\
  141. \verb|\t| & tab (control-I)\\
  142. \verb|\e| & escape (control-[)\\
  143. \verb|\\| & the backslash character itself \verb|\|\\
  144. \verb|\"| & double quote\\
  145. \verb|\xNN| & the character of ascii code NN in hexadecimal\\ 
  146. \verb|\nnn| & the character of ascii code nnn in octal\\
  147. \verb|\c| & c if c is any other character.\\
  148. \end{tabular} \end{center} 
  149. Moreover, you can ignore end of lines in strings by prefixing them with
  150. \verb"\", as in:
  151. {\exemplefont\begin{verbatim}
  152.         (print "This is a very \
  153.         long string")            ==> This is a very long string
  154. \end{verbatim}}
  155. \ITEMb{'}{quote}{prevents evaluation}
  156.         
  157. {\usagefont\begin{verbatim}
  158. 'object
  159. (quote object)
  160. \end{verbatim}}\usageupspace
  161. Returns the object {\bf without evaluating} it. The form \verb"'foo" is
  162. not expanded into \verb"(quote foo)" during parsing, but in a
  163. ``quoted-expression'' {\WOOL} type for efficiency.
  164. \ITEMci{\%}{*}{/}{arithmetic operators}
  165.         
  166. {\usagefont\begin{verbatim}
  167. (% n1 n2)
  168. (* n1 n2)
  169. (/ n1 n2)
  170. \end{verbatim}}\usageupspace
  171. Returns respectively the modulo, product, and quotient of the integer
  172. arguments as a integer.
  173. \ITEMa{+}{adds or concatenates}
  174.         
  175. {\usagefont\begin{verbatim}
  176. (+ n1 n2 ... nN)
  177. (+ string1 string2 ... stringN)
  178. (+ list1 list2 ... listN)
  179. \end{verbatim}}\usageupspace
  180. Numerically add numbers, concatenate strings or, concatenate lists.
  181. Determines the type of the result as being the type of the first argument
  182. (\verb"()" is a list, \verb|""| is a string, \verb|0| is a number).
  183. \ITEMa{-}{arithmetic difference}
  184.         
  185. {\usagefont\begin{verbatim}
  186. (- n)
  187. (- n1 n2 ...)
  188. \end{verbatim}}\usageupspace
  189. Returns the arithmetic opposition or difference of numbers. 
  190. \verb"(- n1 n2 n3 n4)" is equivalent to \verb"(- n1 (+ n2 n3 n4))".
  191. \ITEMb{=}{equal}{tests equality of any two objects}
  192.         
  193. {\usagefont\begin{verbatim}
  194. (= obj1 obj2)
  195. (equal obj1 obj2)
  196. \end{verbatim}}\usageupspace
  197. Returns obj1 if obj1 is the same as obj2, nil otherwise. This is the
  198. traditional {\bf equal} predicate of Lisp.
  199. Equality of lists is tested by testing the equality of all their elements.
  200. \ITEMa{<}{tests for strict inferiority}
  201.         
  202. {\usagefont\begin{verbatim}
  203. (< n1 n2)
  204. (< string1 string2)
  205. \end{verbatim}}\usageupspace
  206. Compares two numbers or two strings and returns \verb"t" if argument 1 is
  207. inferior and not equal to argument 2 and \verb"nil" otherwise. Strings are
  208. compared alphabetically.
  209. \ITEMa{>}{tests for strict superiority}
  210.         
  211. {\usagefont\begin{verbatim}
  212. (> n1 n2)
  213. (> string1 string2)
  214. \end{verbatim}}\usageupspace
  215. Compares two numbers or two strings and returns \verb"t" if argument 1 is
  216. superior and not equal to argument 2 and \verb"nil" otherwise. Strings are
  217. compared alphabetically.
  218. \ITEMb{?}{print}{prints {\WOOL} objects}
  219.         
  220. {\usagefont\begin{verbatim}
  221. (? obj1 obj2 ... objN)
  222. \end{verbatim}}\usageupspace
  223. Prints the objects, without adding spaces or newlines. Output is flushed at
  224. the end of every call to this function. For now, output goes to the stdout
  225. stream.
  226. \ITEMa{active-label-make}{makes a label (text in a given font)}
  227.         
  228. {\usagefont\begin{verbatim}
  229. (active-label-make label [font])
  230. \end{verbatim}}\usageupspace
  231. Creates a label with string \verb|label| drawn
  232. in the font \verb"font". The text will be redrawn on each expose (The
  233. active label can also be used to paint a string on a pixmap, see
  234. \seep{pixmap-make}).
  235. \context{
  236. foreground &    color of the text string\\
  237. font &          font of the string if not given\\
  238. \ITEMa{allow-event-processing}{un-freezes the server after catching a
  239. replayable event}
  240. {\usagefont\begin{verbatim}
  241. (allow-event-processing)
  242. \end{verbatim}}\usageupspace
  243. When you set passive grabs on ``replayable'' events \seesnp{replayable-event},
  244. when such event is caught in a fsm, the grab is activated and the server is
  245. frozen, in such a way that pointer motions or button states is not tracked
  246. anymore. To be able to use a function such as \seensp{current-mouse-position}
  247. you must then allow the processing of events by calling this function.
  248. After the call, you will not be able to use
  249. \seensp{ungrab-server-and-replay-event} for the event.
  250. \ITEMa{alone}{specifies that no modifier key is used}
  251.         
  252. \usagetype{Constant}
  253. Specifies that no modifier is pressed for a button or key event for use in
  254. event descriptions.
  255. \ITEMa{and}{logical AND of expressions}
  256.         
  257. {\usagefont\begin{verbatim}
  258. (and obj1 obj2 ... objN)
  259. \end{verbatim}}\usageupspace
  260. Returns \verb"()" as soon as an argument is false (\verb"nil"),
  261. \verb"t" otherwise.
  262. \ITEMa{any}{matches any modifier or button}
  263.         
  264. \usagetype{Constant}
  265. Matches any modifier or button or key in events. It can be also used in many
  266. other functions with appropriate semantics.
  267. \ITEMa{atoi}{ascii string to integer conversion}
  268.         
  269. {\usagefont\begin{verbatim}
  270. (atoi string)
  271. \end{verbatim}}\usageupspace
  272. Returns the integer described by string (in base 10).
  273. {Example:\exemplefont\upspace\begin{verbatim}
  274.         (atoi "123")                    ==>     123
  275. \end{verbatim}}
  276. \ITEMa{atom}{makes an atom from a string}
  277.         
  278. {\usagefont\begin{verbatim}
  279. (atom string)
  280. \end{verbatim}}\usageupspace
  281. Returns the atom of name string. Useful to create atoms with special
  282. embedded characters, such as \verb"'" or blanks. The inverse function is not
  283. necessary since every {\WOOL} function expecting strings in arguments can
  284. accept atoms instead, and will take the string of their name.  
  285. This should be used when accessing property lists via the \verb|#| function.
  286. For instance if you store properties on machine names (which are strings),
  287. you would use the following call to retrieve the color of a xterm for a
  288. machine:
  289. {Examples:\exemplefont\upspace\begin{verbatim}
  290.         (# (atom machine-name) '(Maalea "Green" Honolua "Blue"))
  291. \end{verbatim}}
  292. \ITEMa{background}{color of the background}
  293.         
  294. \usagetyped{Numeric variable --- screen-relative}{color}
  295. The value of this global variable is used by many functions as the color of
  296. the background. It is a pixel value, such as returned by \verb"color-make",
  297. and is initially set to the pixel of the color \verb"White".  Note that
  298. a non-nil \verb"tile" context value overrides the background value.
  299. \ITEMa{bar-make}{makes a bar descriptor}
  300.         
  301. {\usagefont\begin{verbatim}
  302. (bar-make plug/bar1 plug/bar2 ... plug/barN)
  303. \end{verbatim}}\usageupspace
  304. Creates a bar of transversal width\footnote{Bars have their own width and a
  305. length which is adjusted to fit around the client window. For an horizontal
  306. bar, the width is their physical height and the length their physical width,
  307. and for a vertical one, it is the opposite} bounded by the current value
  308. of \verb"bar-min-width" and \verb"bar-max-width", and containing the {\tt N}
  309. plugs or bars, which are centered in the bar.  If a plug is \verb"()", it is
  310. considered extensible space, which is expanded when the bar stretches to its
  311. actual dimensions.  The plugs are clipped on the right if necessary.
  312. \context{
  313. fsm & the finite state machine of the bar \\
  314. borderwidth & the width of the bar's border in pixels \\
  315. borderpixel &  the color of the border \\
  316. bordertile & the pixmap used as the border pattern \\
  317. background & the color of the background \\
  318. plug-separator & the number of pixels between consecutive plugs \\
  319. tile & the pattern of its background (may be ()) \\
  320. menu & the default pop-up associated with it \\
  321. cursor & the cursor's shape when the cursor is in it \\
  322. property & the {\WOOL} property associated with the bar \\
  323. bar-min-width & the minimum width in pixels of the bar \\
  324. bar-max-width & the maximum width in pixels of the bar (width for vertical 
  325. bars, height for horizontal bars)\\
  326. Note that the plugs are evaluated a second time when the bar is physically
  327. created, allowing you to give expressions for plugs (quoted to evade the
  328. first evaluation of arguments of the \verb"bar-make" function itself)
  329. will evaluate to a plug on the realization of the wob.  
  330. For instance, to have the window name in a plug, the bar can be made by:
  331. {\exemplefont\begin{verbatim}
  332.         (bar-make '(plug-make (label-make window-name)))
  333. \end{verbatim}}
  334. If you don't quote the plug, all the bars will have the same name on the
  335. realization of the bar, the value of \verb"window-name" at the time of the
  336. call to bar-make.
  337. For each recursive level of sub-bars, the direction of the bar switches
  338. between horizontal and vertical. This means that to make a horizontal
  339. sub-bar inside a likewise horizontal parent bar, you need a construct like
  340. \verb|(bar-make (bar-make ...))|.
  341. \verb|(bar-make ())| means an {\bf explicitly}
  342.      adjustable length bar, which may actually in some situations adjust its
  343.      width too (see below). For example, left and right bars that have in this
  344.      sense {\bf explicitly} adjustable size are broadened to prevent
  345.      truncation of the title or bottom bars. 
  346. \begin{itemize}    
  347. \item  A bar has {\bf explicitly} adjustable length if it contains at least
  348.      one \verb|()| or an "adjustable width" bar.
  349. \item A bar has "adjustable width" if it contains {\bf only} (and at least
  350.      one of) \verb|()| and explicitly adjustable length bars. 
  351. \end{itemize} 
  352.    A bar which has adjustable width does not obey bar-min/max-width
  353.    any more. 
  354.    Also, watch out for making the left or right bar of a window have
  355.    adjustable width - they will try to adjust their width to prevent
  356.    truncation of the title or bottom bars. 
  357. Extra space will be equally divided between all \verb|()|s and sub-bars
  358.    with adjustable width. In case of too little space, truncation will
  359.    also start equally divided between all \verb|()| and adjustable sub-bars.
  360.    First when they have disappeared completely, truncation begins to
  361.    the right as usual.
  362.    This means that the \verb|(bar-make (bar-make ...))| construct can be
  363.    used to encapsulate things that are to be truncated
  364.    together. Actually, provided a borderwidth of zero, this construct
  365.    has no other physical effect than grouping things in this sense.
  366. If a plug is shaped, this will make a hole trough the whole bar (as
  367.    opposed to seeing the bar background behind the plug). Currently the
  368.    only way to create shaped plugs is with \verb|pixmap-load|.
  369. It is possible to have arbitrary shaped background tilings of a bar, with the
  370.    value of the global variable \verb|tile| being a shaped pixmap. The other
  371.    way is to make a completely transparent background "tiling". This is
  372.    achieved with the special construct of setting \verb|tile| to \verb|t| when
  373.    constructing the bar (perhaps unintuitive, but...)
  374. {Examples: A icon with a label undeneath can be designed as:
  375. \exemplefont\upspace\begin{verbatim}
  376.         (with (tile t                 ;; transparent tiling
  377.             borderwidth 0
  378.             inner-borderwidth 2)
  379.           (window-make ()
  380.                   (bar-make ())  ;; bar with adjustable width
  381.                   (bar-make ())
  382.                   (bar-make () label-plug ())
  383.                   center-plug))
  384. \end{verbatim}}
  385. \ITEMb{bar-min-width}{bar-max-width}{limits to the transversal width of a bar}
  386. \usagetyped{Numeric variable}{number}
  387. The values of these global variables are used by the constructors of bars to
  388. limit their transversal width, clipping the plugs if necessary.
  389. \verb"bar-min-width" defaults to 1 and \verb"bar-max-width" defaults to 1000.
  390. \ITEMa{bar-separator}{number of pixels between consecutive bars in menus}
  391.         
  392. \usagetyped{Numeric variable}{number}
  393. The value of this global variable is used by the constructors of menus to
  394. yield the number of pixels separating two contiguous bars.  Default is 4
  395. pixels. Used in  \verb"menu-make" function.
  396. \ITEMa{bell}{rings the keyboard bell}
  397. {\usagefont\begin{verbatim}
  398. (bell [percent])
  399. \end{verbatim}}\usageupspace
  400. Rings the bell on the keyboard, with volume set by the \verb"percent"
  401. numeric argument, which can take values ranging from -100 to 100 (defaults
  402. to 0). -100 means lowest volume, 0 means base volume, 100 means full volume.
  403. \ITEMc{bitwise-and}{bitwise-or}{bitwise-xor}{bitwise operators}
  404.         
  405. {\usagefont\begin{verbatim}
  406. (bitwise-op n1 n2 ... nN)
  407. \end{verbatim}}\usageupspace
  408. Returns the result of the bitwise operator on the N arguments.
  409. {Examples:\exemplefont\upspace\begin{verbatim}
  410.         (bitwise-or 1 4)                ==>     5
  411.         (bitwise-and 3 5)               ==>     1
  412.         (bitwise-xor 3 5)               ==>     6
  413. \end{verbatim}}
  414. \ITEMa{border-on-shaped}{keep borders on shaped windows}
  415. \usagetyped{Numeric variable}{number}
  416. Normally, if {\GWM} tries to decorate a non-rectangular (shaped) window, it
  417. automatically removes any border on the main window as it is almost always the
  418. intended look. But this variable when set overrides this behavior for the rare
  419. case where it could be needed.
  420. \ITEMa{borderpixel}{color of the border of a wob}
  421.         
  422. \usagetyped{Numeric variable --- screen relative}{color}
  423. The value of this global variable is used by the constructors of all wobs as
  424. the color of their border. It is a pixel value, such as returned by
  425. \verb"color-make", and is initially set to the pixel of the color
  426. \verb"Black". It is always overridden by the value of \verb"bordertile" if
  427. not nil.
  428. \ITEMa{bordertile}{pixmap to tile the border of a wob}
  429.         
  430. \usagetyped{Variable}{pixmap}
  431. The value of this global variable is used by the constructors of all wobs as
  432. the pixmap to display in their border. It is a pixmap object, such as
  433. returned by \verb"pixmap-make". If set to (), the borderpixel value is used.
  434. \ITEMa{borderwidth}{width in pixels of the border of a wob}
  435.         
  436. \usagetyped{Numeric variable}{number}
  437. The value of this global variable is used by the constructors of all wobs to
  438. set their border width in pixels. A value of 0 means no border.
  439. \ITEMa{boundp}{tests if an atom has already been defined}
  440.         
  441. {\usagefont\begin{verbatim}
  442. (boundp atom)
  443. \end{verbatim}}\usageupspace
  444. Returns the (evaluated) atom if it has been defined, () otherwise.
  445. {Examples:\exemplefont\upspace\begin{verbatim}
  446.         (setq foo 1)
  447.         (boundp 'foo)                   ==>     foo
  448.         (boundp 'bar)                   ==>     ()
  449. \end{verbatim}}
  450. \ITEMa{button}{makes a button event}
  451.         
  452. {\usagefont\begin{verbatim}
  453. (button number modifier)
  454. \end{verbatim}}\usageupspace
  455. Returns a button event matching the X event {\bf ButtonPress} of button
  456. number \verb"number", and will verify that
  457. the modifier argument was depressed during the click. This event will wait
  458. for the corresponding {\bf ButtonRelease} event before returning.  
  459. Number or modifier can take the value \verb"any", thus matching any of the
  460. values of the corresponding argument.  These button events can then be used
  461. in the matching part of the transitions of fsms or in the \verb"grabs"
  462. field of a window-make description.
  463. \exemples{Examples:}{
  464. (button 1 with-alt) & matches clicking left button of the mouse
  465.                                 while keeping the alt key depressed.\\
  466. (button any with-control) & matches control-clicking with any button\\
  467. \ITEMa{buttonpress}{makes a buttonpress event}
  468.         
  469. {\usagefont\begin{verbatim}
  470. (buttonpress number modifier)
  471. \end{verbatim}}\usageupspace
  472. Same as button, but does not wait for the buttonrelease, meaning that the
  473. buttonrelease is available for another transition.
  474. This can be used to trigger \verb"move-window", since this function waits for
  475. a button release to terminate.
  476. \ITEMa{buttonrelease}{makes a buttonrelease event}
  477.         
  478. {\usagefont\begin{verbatim}
  479. (buttonrelease number modifier)
  480. \end{verbatim}}\usageupspace
  481. Same as button, but only matches a button release. Useful when you cannot
  482. wait for a button event, for instance when iconifying a window, because if
  483. the window is iconified on a button press, the corresponding release event
  484. will be lost (in fact will go to the window underneath)
  485. \ITEMa{check-input-focus-flag}{follow input hint for setting focus}
  486.         
  487. \usagetyped{Numeric variable}{number}
  488. If this flag is set to {\bf 1}, which is the default, {\GWM} will refuse to
  489. set the keyboard focus via the \verb"set-focus" call to windows having
  490. declared that they didn't need the focus. This flag is provided so that you
  491. can use clients which set their input hint the wrong way.
  492. \ITEMb{circulate-windows-down}{circulate-windows-up}{circulates mapped windows}
  493.         
  494. {\usagefont\begin{verbatim}
  495. (circulate-windows-up)
  496. (circulate-windows-down)
  497. \end{verbatim}}\usageupspace
  498. Put the topmost window down, or the lowest window up respectively.
  499. \ITEMa{color-components}{gives RGB color decomposition of a pixel}
  500.         
  501. {\usagefont\begin{verbatim}
  502. (color-components pixel)
  503. \end{verbatim}}\usageupspace
  504. Given a pixel (integer, normally returned by \verb|color-make|), returns a
  505. list of 3 integers, the Red, Green, Blue components of the color. Each of this
  506. integer can take values between 0 and 65535.
  507. \ITEMa{color-free}{de-allocates a pixel}
  508.         
  509. {\usagefont\begin{verbatim}
  510. (color-free pixel)
  511. \end{verbatim}}\usageupspace
  512. Frees the entry \verb|pixel| in the default colormap. \verb|pixel| must have
  513. been the result of a previous \verb|color-make| call. This is a very dangerous
  514. function, since colors returned by \verb|color-make| can be shared with
  515. multiple applications.
  516. \ITEMa{color-make}{allocates a pixel color by name}
  517.         
  518. {\usagefont\begin{verbatim}
  519. (color-make color-name)
  520. \end{verbatim}}\usageupspace
  521. Takes a string \verb"color-name" describing the color by its english name (as
  522. found in the \verb"rgb.txt" system file), and allocates a new entry in the
  523. default colormap with a pixel of this color, and returns it if it wasn't
  524. allocated before, otherwise just returns the previously allocated pixel if an
  525. entry in the colormap already existed. Two consecutive calls with the same
  526. argument should then return the same value. A pixel is a number which is the
  527. index of the color in the colormap.
  528. This pixel can later be used as values for foreground and
  529. background, or in the \verb"pixmap-make" function.  If color is not found,
  530. prints a warning, and returns the pixel used for the black color.
  531. Colors can also be specified directly by their {\bf RGB}\footnote{Red,
  532. Green, Blue.} values, with the {\bf\#}-convention: if the \verb"color-name"
  533. string begins with a sharp sign, the following characters are taken as
  534. hexadecimal digits specifying the most significant part of the Red, Green
  535. and, Blue values, with the following syntax: (each letter stands for a digit)
  536. \begin{verbatim}
  537. #RRGGBB
  538. #RRRGGGBBB
  539. #RRRRGGGGBBBB
  540. \end{verbatim}
  541. Example:{\exemplefont\upspace\begin{verbatim}
  542.         (color-make "DarkSlateBlue")
  543.         (color-make "light grey")
  544.         (color-make "#f00")             ; pixel for red
  545.         (color-make "#300000a076be")
  546. \end{verbatim}}
  547. \ITEMa{color-make-rgb}{creates a color from RGB values}
  548. {\usagefont\begin{verbatim}
  549. (color-make-rgb red green blue)
  550. \end{verbatim}}\usageupspace
  551. This function takes three numeric arguments giving the values of the red,
  552. green and blue components of the color which will be returned. Components are
  553. scaled between 0 and 65535 (half brightness is 32767 and no light is 0).
  554. \ITEMa{compare}{ordering comparison}
  555. {\usagefont\begin{verbatim}
  556. (compare n1 n2)
  557. (compare string1 string2)
  558. \end{verbatim}}\usageupspace
  559. Compares two numbers or two strings and returns \verb"-1", \verb"0" or
  560. \verb"1" if its first argument is lesser than, equal to or, greater than the
  561. second.
  562. \ITEMa{cond}{conditional test}
  563.         
  564. {\usagefont\begin{verbatim}
  565. (cond (condition then) [(condition then) ...])
  566. \end{verbatim}}\usageupspace
  567. This is the classical ``cond'' Lisp function, returning the evaluation of the
  568. ``then'' part of the first true condition.
  569. {\exemplefont\begin{verbatim}
  570.         (defun fib (n)
  571.             (cond
  572.                 ((= n 0) 1)
  573.                 ((= n 1) 1)
  574.                 (t (+ (fib (- n 1)) 
  575.                         (fib (- n 2))))))
  576. \end{verbatim}}
  577. \ITEMa{confine-grabs}{cursor stays confined in grabbing wobs}
  578. \usagetyped{Numeric variable}{number}
  579. If set, during all grabs (either via \verb"pop-menu" or \verb"grab-server")
  580. will confine the pointer inside the grabbing wob during the duration of
  581. the grab.
  582. \ITEMa{confine-windows}{forces windows to stay on-screen}
  583. \usagetyped{Numeric variable}{number}
  584. If set, during all interactive moves or resizes, gwm will ensure that windows
  585. stay entirely within screen bounds.
  586. \ITEMb{context-save}{context-restore}{context management}
  587.         
  588. {\usagefont\begin{verbatim}
  589. (context-save context)
  590. (context-restore context)
  591. \end{verbatim}}\usageupspace
  592. A context is a kind of property list, it is an even-sized list whose even
  593. elements are atoms and whose odd ones are their values (see the \see{with}
  594. function), of the form {\tt (var{\it 1\/} val{\it 1\/} var{\it 2\/} val{\it 2\/} \ldots
  595. var{\it N\/} val{\it N\/})}. \verb"context-save" creates a new context
  596. where the {\tt val{\it i\/}} are the result of the evaluation of the
  597. {\tt var{\it i\/}} in the argument context, whereas context-restore does
  598. a {\tt (setq var{\it i\/} val{\it i\/})} for each of its variable/value pairs.
  599. {\bf Note:} the provided {\tt val{\it i}} serves as default for
  600. \verb"context-save" in the case where the corresponding {\tt var{\it i}} is
  601. undefined:
  602. {\exemplefont\begin{verbatim}
  603.         (setq my-context (list 'a 1 'b 2))
  604.         (setq a "foo")                     ; b is undefined
  605.         (print (context-save my-context))
  606.                                         ==>  (a foo b 2)
  607. \end{verbatim}}
  608. \ITEMa{copy}{copies a wool object\hfill{\bf EXPERT}}
  609. {\usagefont\begin{verbatim}
  610. (copy object)
  611. \end{verbatim}}\usageupspace
  612. Returns a copy of the \verb"object" argument, which can only be a list for
  613. now. This function is flagged as ``{\em Expert}\,'' because it is of use
  614. to people doing physical replacement functions, which are reserved to
  615. experts.
  616. \ITEMa{current-event-code}{code of the last event}
  617.         
  618. {\usagefont\begin{verbatim}
  619. (current-event-code)
  620. \end{verbatim}}\usageupspace
  621. Returns the code (button or keycode) of the {\bf last} event received (The
  622. one which triggered the transition you are in).
  623. \ITEMa{current-event-from-grab}{tests if last event was generated by a grab}
  624.         
  625. {\usagefont\begin{verbatim}
  626. (current-event-from-grab)
  627. \end{verbatim}}\usageupspace
  628. If the last event was a crossing or focus event consecutive to a grab set or
  629. removed, returns \verb"t".
  630. \ITEMa{current-event-modifier}{modifier of the last event}
  631.         
  632. {\usagefont\begin{verbatim}
  633. (current-event-modifier)
  634. \end{verbatim}}\usageupspace
  635. Returns the modifier (state of shift, control, alternate, \ldots ) keys that were
  636. depressed when the {\bf last} event occurred (The one which triggered the
  637. transition you are in).  Note that the combination of two modifiers is
  638. expressed by bitwise-{\bf or}ing the modifiers.
  639. \ITEMa{current-event-time}{time in milliseconds of the last event}
  640. {\usagefont\begin{verbatim}
  641. (current-event-time)
  642. \end{verbatim}}\usageupspace
  643. Returns the time at which occurred the last button, key, crossing, or focus 
  644. event. Time is expressed as a number of milliseconds.
  645. \ITEMa{current-event-window-coords}{relative position of the last event}
  646.         
  647. {\usagefont\begin{verbatim}
  648. (current-event-window-coords)
  649. \end{verbatim}}\usageupspace
  650. Returns the list of coordinates of the last event, if it was a
  651. pointer or a key event, relative to the current client window.
  652. This list has six elements:
  653. \desctable{Element}{Meaning}{
  654. 0       & x position in size increments \\
  655. 1 & y position in size increments \\
  656. \ & \multicolumn{1}{r}{\small\it (character positions for xterm)} \\
  657. 2 & same x position in pixels\\
  658. 3 & same y position in pixels\\
  659. 4 & x position in pixels relative to the decorating window\\
  660. 5 & y position in pixels relative to the decorating window\\
  661. {\bf WARNING:} The position in size increments do not work in the general
  662. case, but only for windows having the text widget flush to the bottom right
  663. corner of their main windows, like Xterm. There is no fix for it, but this
  664. function is a kind of a hack anyways.
  665. \ITEMd{current-event-x}{current-event-y}{current-event-relative-x}{current-event-relative-y}{position of the last event }
  666.         
  667. {\usagefont\begin{verbatim}
  668. (current-event-x)
  669. (current-event-y)
  670. (current-event-relative-x)
  671. (current-event-relative-y)
  672. \end{verbatim}}\usageupspace
  673. Returns the x or y coordinate (number)  of the mouse during the {\bf last}
  674. event, if it was a key or button event (The one which triggered the
  675. transition you are in).
  676. The first coordinates are relative to the root, whereas the last ones are
  677. relative to the wob where they occurred.
  678. \ITEMa{current-mouse-position}{queries server for mouse position}
  679.         
  680. {\usagefont\begin{verbatim}
  681. (current-mouse-position)
  682. \end{verbatim}}\usageupspace
  683. Queries the server for the mouse state and returns it as a list of
  684. four element where the first element is x, second is y, third is
  685. state of modifiers and buttons bitwise-{\bf or}ed, and fourth
  686. is the number of the screen where the pointer is.
  687. \ITEMa{current-user-event}{name of the last user event}
  688. {\usagefont\begin{verbatim}
  689. (current-user-event)
  690. \end{verbatim}}\usageupspace
  691. If the last event was an user event, returns the label of the event (the
  692. atom that was given as argument to the \verb"send-user-event" call).
  693. Triggers an error if the last event was not a user event.
  694. \ITEMa{cursor}{shape of the cursor in a wob}
  695.         
  696. \usagetyped{Variable}{cursor}
  697. The value of this global variable, which must be a cursor returned by a call
  698. to \verb"cursor-make", is used by the constructors of all wobs to set the
  699. appearance of the mouse cursor when the pointer is in the wob. If set to (),
  700. the cursor will not change when entering the wob.
  701. This is also used by functions like \verb"grab-server", \verb"move-window",
  702. and \verb"resize-window" to change the shape of the cursor during a function.
  703. \ITEMa{cursor-NW}{cursor shapes for the 8 directions}
  704. \usagetyped{Variables}{cursor}
  705. These values ({\tt cursor-NW, cursor-NE, cursor-N, cursor-SW, cursor-SE,
  706. cursor-S, cursor-E, cursor-W}) defines cursors to be used on the eight
  707. directions by some functions, such as resize-window with the mwm-like style
  708. (\seep{resize-style}). The eight corners are respectively: NorthWest,
  709. NorthEast, North, SouthWest, SouthEast, South, East and West.
  710. \ITEMa{cursor-make}{makes a cursor with a bitmap and a mask}
  711.         
  712. {\usagefont\begin{verbatim}
  713. (cursor-make foreground-bitmap-filename 
  714.              mask-bitmap-filename)
  715. (cursor-make cursor-name)
  716. (cursor-make number)
  717. \end{verbatim}}\usageupspace
  718. Constructs a mouse cursor with two bitmaps (strings containing the file
  719. names). This cursor can then be used in the cursor variable. The bitmaps are
  720. files searched for in the same path as in the \see{pixmap-make} function.
  721. \sloppy The convention in use for naming a cursor \verb"foo" is to name the
  722. foreground bitmap as \verb"foo-f.xbm" and the mask bitmap as
  723. \verb"foo-m.xbm". This convention is used in the calling of
  724. \verb"cursor-make" with one argument, so that \verb|(cursor-make "foo")| is
  725. equivalent to \verb|(cursor-make "foo-f" "foo-m")|.
  726. You can also define the cursor as one of the predefined ones in the server
  727. cursor font by giving its index in the font as the \verb"number" argument to
  728. cursor-make. See the Appendix B of the {\bf Xlib} manual for the list of
  729. available cursors. For instance, ``star trek'' cursor can be made by the
  730. call \verb"(cursor-make 142)".
  731. The symbolic names of these cursors are defined in the \verb"cursor-names.gwm"
  732. file. Once this file is loaded, you can for instance use the ``star trek''
  733. cursor by a \verb"(cursor-make XC_trek)".
  734. \ITEMa{cut-buffer}{contents of cut buffer 0}
  735.         
  736. \usagetyped{Active value}{string}
  737. Its value is the content of the X cut buffer 0, returned as a string.  When
  738. set, it takes the string argument and stores it in the same cut buffer. This
  739. can be used to communicate with clients still using this obsolete way to
  740. perform cut-and-paste operations, such as xterm. 
  741. \ITEMf{defun}{defunq}{lambda}{lambdaq}{de}{df}{defines a {\WOOL} function}
  742.         
  743. {\usagefont\begin{verbatim}
  744. (defun function-name (arg1 ... argn) instructions ...)
  745. (defunq function-name (arg1 ... argn) instructions ...)
  746. (lambda (arg1 arg2 ... argn) instructions ...)
  747. (lambdaq (arg1 arg2 ... argn) instructions ...)
  748. \end{verbatim}}\usageupspace
  749. Defines a Lisp function and returns the atom pointing to the function. The
  750. list of arguments must be present, even if ().  If defined by \verb"defun",
  751. the function will evaluate its arguments before executing, and will not
  752. evaluate them if defined by \verb"defunq". The return value of an execution
  753. of the function is the value returned by the last instruction of its body.
  754. \verb"de" and \verb"df" are just synonyms for \verb"defun" and
  755. \verb"defunq". The \verb"lambda" call, which evaluates its arguments,
  756. defines a function (without binding it to a name) while \verb"lambdaq"
  757. creates a function which does not evaluates its arguments. The two following
  758. expressions are equivalent:
  759. {\exemplefont\begin{verbatim} 
  760.         (defun foo(x) (+ x 1))
  761.         (setq foo (lambda (x) (+ x 1)))
  762. \end{verbatim}}
  763. When lists are evaluated, {\WOOL} applies the result of the evaluation of
  764. the CAR of the list to its CDR, like in the {\bf Scheme} language. Thus to
  765. apply a lambda function to its arguments, just eval the list constructed
  766. with the lambda construct and its arguments. The classic Lisp {\tt apply}
  767. function could thus be defined by:
  768. {\exemplefont\begin{verbatim}
  769.         (defun apply (function list-of-arguments)
  770.             (eval (+ (list function) list-of-arguments)))
  771. \end{verbatim}}
  772. Since functions are Lisp objects, to define a synonym of a function, you must
  773. use \verb"setq". Thus, you can change the meaning of a function easily, for
  774. instance to make \verb"move-window" always raise the window, you would say
  775. in your profile:
  776. {\exemplefont\begin{verbatim}
  777.         (setq original-move-window move-window)
  778.         (defun move-window () 
  779.                 (raise-window)
  780.                 (original-move-window))
  781. \end{verbatim}}
  782. This means also that an atom can only have one value, and {\tt (setq
  783. move-window 1)} will erase the definition of move-window if you didn't save
  784. it in another atom.
  785. Example:{\exemplefont\upspace\begin{verbatim}
  786.         (defunq incr (value delta)
  787.                 (set value (+ (eval value) (eval delta))))
  788.         (setq x 4)
  789.         (incr x 2)
  790.         (print x)                       ==>     6
  791. \end{verbatim}}
  792. Functions taking a variable number of arguments can be defined by
  793. providing a parameter name instead of a list of parameters. In the
  794. body of the function during its execution, this parameter will be set
  795. to the list of the parameters given to the function.
  796. {\exemplefont\begin{verbatim}
  797.         (defun max l
  798.             (with (max-val 0) 
  799.                 (for obj l (if (> obj max-val)
  800.                                   (setq max-val obj)))
  801.                 max-val))
  802.         (max)                           ==>     0
  803.         (max 34 65 34 12)               ==>    65
  804. \end{verbatim}}
  805. {\bf Note:} You are not allowed to redefine active values (such as
  806. \verb"window") or numeric variables (such as \verb"foreground"), or use
  807. them as names for the parameters to the function.
  808. {\exemplefont\begin{verbatim}
  809.         (defun window (a b) (+ a b))    ==>     ERROR!
  810.         (defun my-window (wob) 
  811.             (window wob))               ==>     ERROR!
  812. \end{verbatim}}
  813. \ITEMa{defname}{declares a name in a namespace}
  814. {\usagefont\begin{verbatim}
  815. (defname name namespace [value])
  816. \end{verbatim}}\usageupspace
  817. Defines the atom \verb"name" to be a name in the namespace. If the value is
  818. given, for each state of the namestate, a \verb"(set name (eval value))" is
  819. done, otherwise the value of name is left undefined in all the states.
  820. Suppose you want to have a variable \verb"dpi" giving the density of the
  821. screen in dots per inches for each screen:
  822. {\exemplefont\begin{verbatim}
  823.         (defname 'dpi screen.
  824.             (/ (* screen-width 254) 
  825.                 (* screen-widthMM 10)))
  826. \end{verbatim}}
  827. \ITEMa{delete-nth}{physically removes an element of a list\hfill{\bf EXPERT}}
  828. {\usagefont\begin{verbatim}
  829. (delete-nth index list)
  830. (delete-nth key list)
  831. \end{verbatim}}\usageupspace
  832. This function physically removes an element of a list and returns the list. 
  833. Elements are specified as for the \verb"#" function. 
  834. For property lists, the key and the value are deleted.
  835. {\exemplefont\begin{verbatim}
  836.         (setq l '(a 1 b 2 c 3 d 4))
  837.         (delete-nth 5 l)
  838.         l                               ==>     (a 1 b 2 c d 4)
  839.         (delete-nth 'b l)
  840.         l                               ==>     (a 1 c d 4)
  841. \end{verbatim}}
  842. \ITEMa{delete-read-properties}{flags to delete X properties after reading them}
  843. \usagetyped{Numeric variable}{number}
  844. If non-zero, all calls to \verb|get-x-property| deletes the X property after
  845. reading it.
  846. \ITEMa{delete-window}{asks client to delete one of its windows}
  847. {\usagefont\begin{verbatim}
  848. (delete-window [window])
  849. \end{verbatim}}\usageupspace
  850. This function will ask the client owning the argument \verb"window" (or the
  851. current window if none is given) to delete it. This is only possible if the
  852. client participates in the \verb"WM_DELETE_WINDOW" ICCC protocol, in which
  853. case the function returns \verb"t", otherwise \verb"()".
  854. This is different from the \verb"kill-window" call, which destroys the
  855. client and every top-level window owned by it, in that other windows should
  856. survive the call.
  857. \ITEMc{dimensions}{width}{height}{dimensions of a {\WOOL} object}
  858. {\usagefont\begin{verbatim}
  859. (dimensions object)
  860. (width object)
  861. (height object)
  862. \end{verbatim}}\usageupspace
  863. These functions return the width and height in pixels of any {\bf wob}, {\bf
  864. pixmap}, {\bf active label}, {\bf cursor}, or {\bf string}.  For wobs, the
  865. returned dimensions {\bf include} the borderwidth. For strings, these are the
  866. dimensions that such a string would take on the screen, if printed in the
  867. current {\tt font}, thus including the \verb"label-horizontal-margin" and
  868. \verb"label-vertical-margin".
  869. The \verb"dimensions" function returns a list of {\bf four} values: x, y,
  870. width, height. x and y being non-null only for wobs in which case they are
  871. the coordinates of the upper-left corner of the wob relative to the parent
  872. \ITEMa{direction}{direction of menus}
  873. \usagetyped{Numeric variable}{number}
  874. This variable controls the main direction of menus created by the
  875. \see{menu-make} constructor. Possible values are \verb"horizontal"
  876. or \verb"vertical".
  877. \ITEMa{describe-screen}{user function called to describe a screen}
  878.         
  879. {\usagefont\begin{verbatim}
  880. (describe-screen)
  881. \end{verbatim}}\usageupspace
  882. This function {\bf must} be provided by the user. 
  883. It must return the description of the screen (cursor, fsm, \ldots ), made with a
  884. window-make call. Of the window-make parameters, only the \verb"opening"
  885. (expression evaluated when all windows are decorated, just before entering
  886. the main loop of {\GWM}) and \verb"closing" (expression evaluated just before
  887. ending) parameters are used. 
  888. \context{
  889.   fsm  &  for the fsm of the root window \\
  890.   menu &  for the default menu of the root window \\
  891.   cursor &  for the shape of the cursor when in root \\
  892.   property &  for the initial value of the property field \\
  893.   tile &  for the pixmap to be tiled on the screen
  894.     (() means do not touch the existing screen) \\
  895. This function is called by {\GWM} for each managed screen once. In the
  896. current version, only one screen is managed. Before each invocation of this
  897. function, the screen characteristics (visual, depth, \ldots) are updated to
  898. reflect the characteristics of the corresponding screen.
  899. \ITEMa{describe-window}{user function called to decorate a new window}
  900.         
  901. {\usagefont\begin{verbatim}
  902. (describe-window)
  903. \end{verbatim}}\usageupspace
  904. When a new window must be decorated by {\GWM}, it calls this user-defined
  905. function with \verb"window" and \verb"wob" set to the new window. It must
  906. return a list of two window descriptors made with \see{window-make}
  907. describing respectively the window and the icon of the new client window.
  908. A recommended way to use \verb"describe-window"  is to store in advance all
  909. the window descriptions in the resource manager by \see{resource-put} calls
  910. and use a \see{resource-get} call in your \verb"describe-window" function to
  911. retrieve the appropriate description. But this is not mandatory and you are
  912. free to design the way to describe a window freely.  For instance with the
  913. following describe-window function:
  914. {\exemplefont\begin{verbatim}
  915.         (defun describe-window ()
  916.             (resource-get (+ window-client-class "." window-client-name)
  917.                     "any-client.any-client"))
  918.         (resource-put "any-client.any-client" any-window)
  919.         (resource-put "XTerm.xterm" xterm-window)
  920. \end{verbatim}}
  921. {\GWM} will decorate xterm windows by the description held in
  922. \verb"xterm-window", and will decorate the windows of any other client by
  923. the \verb"any-window" description.
  924. \ITEMa{display-name}{name of the X server}
  925.         
  926. \usagetyped{Variable}{string}
  927. This variable holds the name of the display on which {\GWM} is running.
  928. \ITEMb{double-button}{double-buttonpress}{makes a double-click button event}
  929.         
  930. {\usagefont\begin{verbatim}
  931. (double-button number modifier)
  932. (double-buttonpress number modifier)
  933. \end{verbatim}}\usageupspace
  934. These events look for an incoming X {\bf ButtonPress} event and matches it
  935. if the {\bf last} key or button event was on the same button, in the same
  936. wob, and not a key event, and happened less than \verb"double-click-delay"
  937. milliseconds before it.
  938. The button to be pressed is specified by the number \verb"number", and these
  939. events verify that the modifier argument was depressed during the click.
  940. \verb"double-button" waits for the corresponding {\bf ButtonRelease}
  941. event before returning, while \verb"double-buttonpress" returns
  942. immediately.  Number or modifier can take the value \verb"any", thus
  943. matching any of the values of the corresponding argument.  
  944. Note that handling double-click events this way implies that the action that
  945. is done on a simple click event is executed even for a double click event,
  946. just before the action associated with it. The recommended way to use
  947. double-clicks is to place the \verb"double-button" event {\bf before} the
  948. \verb"button" in the state of the fsm as in:
  949. {\exemplefont\begin{verbatim}
  950.         (on (double-button 1 any) (do-double-action))
  951.         (on (button 1 any) (do-simple-action))
  952. \end{verbatim}}
  953. {\bf Note:} The ``last'' event can be a {\bf ButtonRelease} event only if it
  954. is waited for explicitly by a {\GWM} \verb"buttonrelease" event, in which
  955. case the \verb"double-click-delay" is measured between the release of the
  956. first click and the press of the second. Otherwise (if the first click is
  957. awaited by a \verb"button" event) the delay is taken between the two
  958. ``presses'' of the button.
  959. \ITEMa{double-click-delay}{maximum time between double clicks}
  960. \usagetype{Numeric variable}
  961. If two buttonpress events are closer in time than \verb"double-click-delay"
  962. milliseconds then the second one can be matched by the \verb"double-button"
  963. and \verb"double-buttonpress" events.
  964. \ITEMa{draw-line}{draws a line in a pixmap}
  965.         
  966. {\usagefont\begin{verbatim}
  967. (draw-line pixmap x1 y1 x2 y2)
  968. \end{verbatim}}\usageupspace
  969. Draws a line (via the {\bf XDrawLine} X call) in a pixmap from point
  970. \verb"x1", \verb"y1" to point \verb"x2", \verb"y2" in the pixmap
  971. coordinates. 
  972. \contextdim{-2cm}{
  973. foreground & color of the line \\
  974. \ITEMa{draw-rectangle}{draws a (filled) rectangle in a pixmap}
  975.         
  976. {\usagefont\begin{verbatim}
  977. (draw-rectangle pixmap x1 y1 width height border style)
  978. \end{verbatim}}\usageupspace
  979. Draws a rectangle in the pixmap. Upper corner is placed at \verb|x1|,
  980. \verb|y1| coordinates in the pixmap, with the rectangle dimensions being
  981. \verb|width| and \verb|height|. \verb|border| is the border width. Note that a
  982. value of \verb|0| for \verb|border| does not means ``no border'' but a border
  983. drawn with 0-width lines, which in X means the default line width, usually 1.
  984. In the X tradition, the upper-left corner is taken inside the border, and the
  985. dimension do not include the border.
  986. \verb|style| tells which kind of rectangle to draw, namely:
  987. \desctabledim{1cm}{Value}{Style of rectangle}{
  988. 0 & nothing drawn\\
  989. 1 & only border is drawn\\
  990. 2 & only filled rectangle without border\\
  991. 3 & filled rectangle + border\\
  992. \contextdim{-2cm}{
  993. foreground & color of the border, if any \\
  994. background & color of the inside, if any \\
  995. \ITEMa{draw-text}{draws a string of characters in a pixmap}
  996.         
  997. {\usagefont\begin{verbatim}
  998. (draw-text pixmap x1 y1 font text)
  999. \end{verbatim}}\usageupspace
  1000. Draws a string of characters \verb|text| on font \verb|font| into the pixmap
  1001. \verb|pixmap|. Baseline of the string will start at coordinates \verb|x1|,
  1002. \verb|y1| in the pixmap.
  1003. \contextdim{-2cm}{
  1004. foreground & pen color \\
  1005. \ITEMa{elapsed-time}{gets running time of {\GWM}}
  1006. {\usagefont\begin{verbatim}
  1007. (elapsed-time)
  1008. \end{verbatim}}\usageupspace
  1009. Returns the time in milliseconds for which {\GWM} has been running.
  1010. \ITEMa{end}{terminates {\GWM}}
  1011.         
  1012. {\usagefont\begin{verbatim}
  1013. (end)
  1014. \end{verbatim}}\usageupspace
  1015. Terminates {\GWM}, de-iconifying all the windows, un-decorating them,
  1016. restoring their original borderwidth, and closing the display.
  1017. \ITEMb{enter-window}{leave-window}{events generated when the pointer crosses the border of a wob}
  1018.         
  1019. \usagetyped{Constant}{event}
  1020. This event is sent to the wob when the pointer crosses its border.
  1021. Note that no leave event is generated if the pointer goes over a child window
  1022. inside it.
  1023. \ITEMb{enter-window-not-from-grab}{leave-window-not-from-grab}{pointer
  1024. actually crosses the border of a wob}
  1025.         
  1026. \usagetyped{Constant}{event}
  1027. When the server is grabbed (for instance by {\GWM} when popping a menu or
  1028. moving/resizing a window), the cursor appears to leave the current window it
  1029. is in, and thus a \verb|leave-window| is sent to this window. These events
  1030. allow you to wait only for real crossing events, and not these grab-provoked
  1031. ones. This distinguishment is needed to code some tricky menu actions.
  1032. \ITEMa{eq}{tests strict equality of any two objects\hfill{\bf EXPERT}}
  1033. {\usagefont\begin{verbatim}
  1034. (eq object1 object2)
  1035. \end{verbatim}}\usageupspace
  1036. Returns true only if the two object are the same, i.e., if they are at the
  1037. same memory location.
  1038. Example:{\exemplefont\upspace\begin{verbatim}
  1039.         (setq l '(a b c))
  1040.         (setq lc '(a b c))
  1041.         (= l lc)                        ==>        t
  1042.         (eq l lc)                       ==>        ()
  1043.         (eq (# 1 l) (# 1 lc))           ==>        t
  1044. \end{verbatim}}
  1045. \ITEMa{error-occurred}{traps errors occurring in expressions}
  1046. {\usagefont\begin{verbatim}
  1047. (error-occurred expressions ...)
  1048. \end{verbatim}}\usageupspace
  1049. Executes the given expressions and returns \verb"()" if everything went
  1050. fine, but returns \verb"t" as soon as a {\WOOL} error occurred and does not
  1051. print the resulting error message.
  1052. \ITEMa{eval}{evaluates a {\WOOL} expression}
  1053.         
  1054. {\usagefont\begin{verbatim}
  1055. (eval wool-expression)
  1056. \end{verbatim}}\usageupspace
  1057. This function evaluates its argument. Note that there is a double evaluation,
  1058. since the argument is evaluated by Lisp before being evaluated by eval.
  1059. Example:{\exemplefont\upspace\begin{verbatim}
  1060.         (? (eval (+ '( + ) '(1 2))))     ==>     prints "3"
  1061. \end{verbatim}}
  1062. \ITEMa{execute-string}{executes a {\WOOL} string}
  1063.         
  1064. {\usagefont\begin{verbatim}
  1065. (execute-string string)
  1066. \end{verbatim}}\usageupspace
  1067. Parses the string argument as a {\WOOL} program text and evaluates the read
  1068. expressions. Returns \verb"()" if an error occurred in the evaluation,
  1069. \verb"t" otherwise. Very useful in conjunction with \see{cut-buffer},
  1070. to evaluate the current selection with:
  1071. {\exemplefont\begin{verbatim}
  1072.         (execute-string cut-buffer)
  1073. \end{verbatim}}
  1074. \ITEMb{focus-in}{focus-out}{events received when input focus changes on the client window}
  1075.         
  1076. \usagetyped{Constant}{event}
  1077. These events are sent to a wob when a child receives or loses the keyboard
  1078. focus, i.e., the fact that all input from the keyboard goes to that child
  1079. regardless of the pointer position. Only window wobs receive these events
  1080. when their client window gets the focus,
  1081. they must redispatch them to their sons (bar wobs) if they are expected to
  1082. respond to such events (a title bar might want to invert itself for instance)
  1083. by using the \verb"send-user-event" function.
  1084. \ITEMa{font}{default font}
  1085.         
  1086. \usagetyped{Numeric variable}{number}
  1087. This is the font ID used by default for the
  1088. constructors \verb"label-make" and \verb"active-label-make". Initialized to
  1089. ``fixed'' or your local implementor's choice.
  1090. It is also the font returned by \verb"font-make" when it fails to find a font.
  1091. \ITEMa{font-make}{loads a font}
  1092.         
  1093. {\usagefont\begin{verbatim}
  1094. (font-make font-name)
  1095. \end{verbatim}}\usageupspace
  1096. This function loads a font in memory, from the ones available on the server.
  1097. You can list the available fonts by the XLSFONTS(1) UNIX command. The function
  1098. returns the descriptor (number) of the loaded font. If it fails to find it,
  1099. it will issue a warning and return the default font found in the \verb"font"
  1100. global variable.
  1101. \ITEMb{for}{mapfor}{iterates through a list of values}
  1102.         
  1103. {\usagefont\begin{verbatim}
  1104. (for variable list-of-values inst1 inst2 ... instN)
  1105. (mapfor variable list-of-values inst1 inst2 ... instN)
  1106. \end{verbatim}}\usageupspace
  1107. This Lisp control structure affects successively the variable (not
  1108. evaluated) to each of the elements  of the evaluated list-of-values, and
  1109. executes the n instructions of the body of the for.  The variable is local
  1110. to the for body and will be reset to its previous value on exit.
  1111. \verb"for"  returns the value of the evaluation on \verb"instN" in
  1112. the last iteration, whereas \verb"mapfor" builds a list having for
  1113. values the successive values of \verb"instN" for the iterations.
  1114. Examples:{\exemplefont\upspace\begin{verbatim}
  1115.         (for window (list-of-windows)           ; will replace all windows
  1116.             (move-window 0 0))                  ; in the upper-left corner
  1117.         (for i '(a b 2 (1 2)) 
  1118.             (print i ","))              ==>     a,b,2,(1 2),
  1119.         (mapfor i '(a b 2 (1 2))
  1120.             (list i))                   ==>     ((a) (b) (2) ((1 2)))
  1121. \end{verbatim}}
  1122. \ITEMa{foreground}{color of the foreground}
  1123.         
  1124. \usagetyped{Numeric variable --- screen relative}{color}
  1125. The value of this global variable is used by the constructors of graphics
  1126. (labels and pixmaps) to paint the graphic. It is a pixel value, such as
  1127. returned by \verb"color-make", and is initially set to the pixel of the color
  1128. \verb"Black".
  1129. \ITEMa{freeze-server}{stops processing other clients during grabs}
  1130.         
  1131. \usagetyped{Numeric variable}{number}
  1132. If set to \verb"t" or 1, the X server is {\bf frozen}, i.e.\ it doesn't
  1133. process the requests for other clients during the \verb"move-window",
  1134. \verb"resize-window" and \verb"grab-server" operations, so that you cannot
  1135. have your pop-up menu masked by a newly mapped window, or you display
  1136. mangled when moving or resizing a window.
  1137. If set to () or 0, the processing of other clients requests are allowed so
  1138. that you can print in an xterm while popping a menu, for instance. (If the
  1139. server is frozen, {\GWM} tries to write on an xterm whose X output is blocked
  1140. and {\GWM} is deadlocked, forcing you to log on another system to kill it!).
  1141. This should happen only when debugging, though, so that the default for this
  1142. variable is \verb"t" (Menus are normally coded so that user actions are
  1143. triggered {\bf after} de-popping).
  1144. \ITEMa{fsm}{Finite State Machine of the wob}
  1145.         
  1146. \usagetyped{Variable}{fsm}
  1147. This global variable is used by all wob constructors to determine their future
  1148. behavior. Holds a fsm made with \verb"fsm-make", or \verb"()" (no behavior).
  1149. \ITEMa{fsm-make}{compiles an automaton}
  1150.         
  1151. {\usagefont\begin{verbatim}
  1152. (fsm-make state1 state2 ... stateN)
  1153. \end{verbatim}}\usageupspace
  1154. This function creates a finite state machine with {\tt N} states. Each wob
  1155. has an associated fsm, and a current state, which is the first state at
  1156. creation time. Each time a wob receives an event, its current state of its
  1157. fsm is searched for a transition which matches the event. If found, the
  1158. corresponding action is executed and the current state of the fsm becomes
  1159. the destination state of the transition. If no destination state was
  1160. specified for the transition (see the \verb"on" function), the current state
  1161. of the fsm does not change. See \verb"on" and \verb"state-make" functions.
  1162. \ITEMa{geometry-change}{event generated when window changes size}
  1163.         
  1164. \usagetyped{Constant}{event}
  1165. This event is sent to the window when its geometry changes by a resize
  1166. operation either from the client or from {\GWM}.
  1167. \ITEMa{get-wm-command}{gets the WM\_COMMAND property}
  1168. {\usagefont\begin{verbatim}
  1169. (get-wm-command)
  1170. \end{verbatim}}\usageupspace
  1171. Returns the command line that can be used to restart the application
  1172. which created the current window in its current state as a list of
  1173. strings.  (For instance, \verb|("xterm" "-bg" "Blue")|). See {\tt
  1174. save-yourself}, p~\pageref{save-yourself}.
  1175. \ITEMa{get-x-default}{gets a server default}
  1176. {\usagefont\begin{verbatim}
  1177. (get-x-default program-name option-name)
  1178. \end{verbatim}}\usageupspace
  1179. Calls the ``{\tt XGetDefault}'' Xlib function to
  1180. query the server defaults about an option for a program. This function
  1181. should be used to retrieve defaults set either by the obsolete {\tt
  1182. .Xdefaults} files or the XRDB client. It returns \verb"()" if no such
  1183. option was defined, or the option as a {\WOOL} string.
  1184. \ITEMa{get-x-property}{gets an X property on the client}
  1185.         
  1186. {\usagefont\begin{verbatim}
  1187. (get-x-property property-name)
  1188. \end{verbatim}}\usageupspace
  1189. Returns the value of the X11 property of name \verb"property-name" of
  1190. the current client window. It only knows how to handle the types STRING
  1191. and INTEGER\@. For instance, {\tt (window-name)} is equivalent to {\tt
  1192. (get-x-property "WM\_NAME")}.
  1193. The value of the global variable \verb|delete-read-properties| determines
  1194. whether the read property is deleted afterwards.
  1195. \ITEMa{getenv}{gets the value of a shell variable}
  1196.         
  1197. {\usagefont\begin{verbatim}
  1198. (getenv variable-name)
  1199. \end{verbatim}}\usageupspace
  1200. If variable-name (string) is the name of an exported shell variable, getenv
  1201. returns its value as a string, otherwise returns the nil string.
  1202. \ITEMa{grab-keyboard-also}{grab-server grabs also keyboard events}
  1203. \usagetyped{Numeric variable}{number}
  1204. If set, all grabs will also grab the keyboard, i.e.\ all keyboard events will
  1205. also be redirected to the grabbing wob, whereas if unset only the pointer
  1206. events get redirected.
  1207. \ITEMa{grab-server}{grabs the server}
  1208.         
  1209. {\usagefont\begin{verbatim}
  1210. (grab-server wob ['nochild])
  1211. \end{verbatim}}\usageupspace
  1212. Grab-server freezes the server, so that only requests from {\GWM} are
  1213. processed, and every event received by {\GWM} is sent to the wob (called the
  1214. ``grabbing'' wob) passed as argument, or to a child of it. Re-grabbing the
  1215. server afterwards just change the grabbing wob to the new one if it is not a
  1216. child of the wob currently grabbing the server, in which case the function
  1217. has no effect. Grabbing the server by a wob is a way to say that all events
  1218. happening for wobs which are not sons of the grabbing wob are to be
  1219. processed by it.
  1220. For instance, the pop-menu function uses \verb"grab-server" with the menu as
  1221. argument in order for the sons to be able to receive enter and leave window
  1222. events and to catch the release of the button even outside the pop-up.
  1223. Grabbing the server sets the mouse cursor to the value of \verb"cursor" if not
  1224. If the atom \verb"nochild" is given as optional argument, if an event
  1225. was sent to a child of the grabbing wob, it is redirected to the grabbing
  1226. wob as well (default not to redirect it).
  1227. \ITEMa{grid-color}{color to draw (xor) the grids with}
  1228.         
  1229. \usagetyped{Numeric variable --- screen relative}{color}
  1230. This is the color (as returned by color-make) that will be used to draw the
  1231. grid with (in XOR mode) on the display. Initially set to the
  1232. ``Black'' color.
  1233. \ITEMa{grabs}{passive grabs on a window}
  1234. \usagetyped{Variable}{list}
  1235. The events specified in this list are used by the \see{window-make}
  1236. constructor to specify on which events {\GWM} establishes passive
  1237. grabs on its window to which the client window gets reparented. Passive
  1238. grabbing means redirecting some events from a window (bars, plugs, client)
  1239. to the main window, ``stealing'' them from the application.
  1240. \ITEMa{gwm-quiet}{silent startup}
  1241.         
  1242. \usagetyped{Numeric variable}{0/1}
  1243. This variable evals to 1 if the users specified (by the \verb"-q" option) a
  1244. quiet startup. Your code should check for this variable before printing
  1245. information messages.
  1246. \ITEMa{hack}{raw access to {\GWM} internal structures\hfill{\bf EXPERT}}
  1247.         
  1248. {\usagefont\begin{verbatim}
  1249. (hack type memory-location)
  1250. \end{verbatim}}\usageupspace
  1251. {\bf WARNING:} Internal debug function: returns the {\WOOL} object constructed
  1252. from C data supposed present at memory-location (number). The type of the
  1253. type argument is used to know what to find: 
  1254. \begin{center}\begin{tabular}{lll}
  1255. {\bf type of type}&{\bf interpretation of pointer}&{\bf returns}\\ \hline
  1256.  number & pointer on integer & number \\
  1257.  string & C string & string \\
  1258.  () & object & object \\
  1259.  atom & pointer to an {\WOOL} object & number \\
  1260. \end{tabular}\end{center}
  1261. This function is {\bf not} intended for the normal user, it should be used
  1262. only as a temporary way to implement missing functionalities or for
  1263. debugging purposes.
  1264. \ITEMa{hashinfo}{statistics on atom storage}
  1265.         
  1266. {\usagefont\begin{verbatim}
  1267. (hashinfo)
  1268. \end{verbatim}}\usageupspace
  1269. Prints statistics on atom storage.
  1270. \ITEMb{horizontal}{vertical}{directions of menus}
  1271.         
  1272. \usagetyped{Constant}{number}
  1273. Used to specify orientation of menus in menu-make.
  1274. \ITEMa{hostname}{name of the machine on which GWM is running}
  1275. \usagetyped{Active value}{string --- not settable}
  1276. This string holds the name of the host {\GWM} is currently running on.
  1277. \ITEMa{iconify-window}{iconifies or de-iconifies a window}
  1278.         
  1279. {\usagefont\begin{verbatim}
  1280. (iconify-window)
  1281. \end{verbatim}}\usageupspace
  1282. Iconify the current window (or de-iconify it if it is already an icon). The
  1283. current window is then set to the new window. 
  1284. {\bf WARNING:} Never trigger this function with a \verb"button" event, but
  1285. with a \verb"buttonpress" or \verb"buttonrelease" event. If you trigger it
  1286. with a button event, the window being unmapped cannot receive the
  1287. corresponding release event and {\GWM} acts weird!
  1288. {\bf WARNING:} Due to the grab management of X, an unmapped window cannot
  1289. receive events, so a grab on this window is automatically lost.
  1290. \ITEMa{if}{conditional test}
  1291.         
  1292. {\usagefont\begin{verbatim}
  1293. (if condition then [condition then] ... [condition then]
  1294.               [else])
  1295. \end{verbatim}}\usageupspace
  1296. This is similar to \verb"cond" but with a level of parentheses suppressed.  It
  1297. executes the ``then'' part of the first true condition, or the else condition
  1298. (if present) if no previous condition is true.
  1299. {\exemplefont\begin{verbatim}
  1300.         (defun fib (n)
  1301.             (if (= n 0)
  1302.                     1
  1303.                 (= n 1) 
  1304.                     1
  1305.                     (+ (fib (- n 1) (- n 2)))))
  1306. \end{verbatim}}
  1307. \ITEMa{inner-borderwidth}{borderwidth of the client window}
  1308.         
  1309. \usagetyped{Numeric variable}{number}
  1310. When {\GWM} decorates a new window, it sets the width of the border of the
  1311. client window to the value of the \verb"inner-borderwidth" variable at the
  1312. time of the evaluation of the \verb"window-make" call.
  1313. If \verb"inner-borderwidth" has the value \verb"any", which is the default
  1314. value, the client window borderwidth is not changed.
  1315. \ITEMa{invert-color}{color to invert (xor) the wobs with}
  1316.         
  1317. \usagetyped{Numeric variable --- screen relative}{color}
  1318. This is the color (as returned by color-make) that will be used by 
  1319. \seeref{wob-invert} to quickly XOR the wob surface.
  1320. Initially set to the bitwise-xoring of Black and White colors for each
  1321. screen.
  1322. \ITEMa{invert-cursors}{inverts the bitmaps used for making cursors}
  1323.         
  1324. \usagetyped{Numeric variable}{number}
  1325. Due to many problems on different servers, you might try to set to 1 this
  1326. numerical global variable if your loaded cursors appear to be video
  1327. inverted. Defaults to 0 (no inversion).
  1328. \ITEMa{itoa}{integer to ascii string conversion}
  1329.         
  1330. {\usagefont\begin{verbatim}
  1331. (itoa number)
  1332. \end{verbatim}}\usageupspace
  1333. Integer to ASCII yields the base 10 representation of a number in a {\WOOL}
  1334. string.
  1335. {\exemplefont\begin{verbatim}
  1336.         (itoa 10)                       ==>     "10"
  1337. \end{verbatim}}
  1338. \ITEMc{key}{keypress}{keyrelease}{keyboard events}
  1339.         
  1340. {\usagefont\begin{verbatim}
  1341. (key keysym modifier)
  1342. (keypress keysym modifier)
  1343. (keyrelease keysym modifier)
  1344. \end{verbatim}}\usageupspace
  1345. Returns an event matching the press on a key of keysym code
  1346. \verb"keysym"\footnote{A keysym is a number representing the symbolic
  1347. meaning of a key. This can be a letter such as ``A'', or function keys, or
  1348. ``Backspace'', \ldots The list of keysyms can be found in the {\bf keysymdef.h}
  1349. file in the {\tt /usr/include/X11} directory.}, with the
  1350. modifier\footnote{See the list of modifiers at the \verb"with-alt" entry,
  1351. page~\pageref{with-alt}} key {\tt modifier} depressed. The \verb"key" event
  1352. will wait for the corresponding keyrelease event before returning, while the
  1353. \verb"keypress" event will return immediately. Number or modifier can take
  1354. the value \verb"any", thus matching any of the values of the corresponding
  1355. argument.
  1356. Keysyms can be given as numbers or as symbolic names.
  1357. Examples:{\exemplefont\upspace\begin{verbatim}
  1358.         (key 0xff08 with-alt)   ; matches typing Alternate-Backspace
  1359.         (key "BackSpace" with-alt)       ; same effect
  1360. \end{verbatim}}
  1361. {\bf Note:} These functions convert the keysym to the appropriate keycode
  1362. for the keyboard, so you should do any re-mapping of keys via the
  1363. \seeref{set-key-binding} function {\bf before} using any of them.
  1364. \ITEMa{key-make}{makes a key symbol out of a descriptive name}
  1365. {\usagefont\begin{verbatim}
  1366. (key-make keyname)
  1367. \end{verbatim}}\usageupspace
  1368. Returns a {\bf keysym} (number) associated with the symbolic name
  1369. \verb"keyname" (string), to be used with the \verb"key", \verb"keypress",
  1370. \verb"keyrelease" and \verb"send-key-to-window" functions. The list of
  1371. symbolic names for keys can be found in the include file
  1372. ``\verb"/usr/include/X11/keysymdef.h"''.
  1373. For instance, the backspace key is listed in \verb"keysymdef.h" as:
  1374. {\exemplefont\begin{verbatim}
  1375.         #define XK_BackSpace            0xFF08  /* back space, back char */
  1376. \end{verbatim}}
  1377. and you can specify the keysym for backspace with:
  1378. {\exemplefont\begin{verbatim}
  1379.         (key-make "BackSpace")          ==> 65288 (0xFF08)
  1380. \end{verbatim}}
  1381. \ITEMa{keycode-to-keysym}{converts a key code to its symbolic code}
  1382. {\usagefont\begin{verbatim}
  1383. (keycode-to-keysym code modifier)
  1384. \end{verbatim}}\usageupspace
  1385. This function returns the server-independent numeric code (the KeySym)
  1386. used to describe the key whose keyboard code is \verb"code" while the
  1387. modifier \verb"modifier" is down. 
  1388. {\bf Note:} Only know the \verb"alone" and \verb"with-shift" modifiers 
  1389. are meaningful in this {\bf X} function.
  1390. \ITEMa{keysym-to-keycode}{converts a symbolic code to a key code}
  1391. {\usagefont\begin{verbatim}
  1392. (keysym-to-keycode keysym)
  1393. \end{verbatim}}\usageupspace
  1394. This function returns the key code, i.e., the raw code sent by the displays
  1395. keyboard when the user depresses the key whose server-independent numeric
  1396. code is listed in the ``\verb"/usr/include/X11/keysymdef.h"'' include file
  1397. and given as a number as the \verb"keysym" argument.
  1398. \ITEMa{kill-window}{destroys a client}
  1399.         
  1400. {\usagefont\begin{verbatim}
  1401. (kill-window [window])
  1402. \end{verbatim}}\usageupspace
  1403. Calls XKillClient on the current window or \verb"window" if specified. This is
  1404. really a forceful way to kill a client, since all X resources opened by the
  1405. client owning the window are freed by the X server. If only you want to
  1406. remove a window of a client, use \seep{delete-window}.
  1407. \ITEMb{label-horizontal-margin}{label-vertical-margin}{margins around labels}
  1408.         
  1409. \usagetyped{Numeric variables}{number}
  1410. The value of these global variables are used by the \verb"label-make"
  1411. functions to add margins (given in pixels) around the string displayed.
  1412. \verb"label-horizontal-margin" defaults to 4 and
  1413. \verb"label-vertical-margin" to 2.
  1414. \ITEMa{label-make}{makes a pixmap by drawing a string}
  1415.         
  1416. {\usagefont\begin{verbatim}
  1417. (label-make label [font])
  1418. \end{verbatim}}\usageupspace
  1419. Creates a label with string \verb"label" drawn with \verb"foreground" color
  1420. in the font \verb"font" on a \verb"background" background. This function
  1421. builds a pixmap which is returned. 
  1422. Note that when used in a plug, the resulting pixmap is directly painted on
  1423. the background pixmap of the wob, speeding up the redisplay  since
  1424. re-exposure of the wob will be done directly by the server, but consuming a
  1425. small chunk of server memory to store the pixmap.
  1426. \contextdim{-2cm}{
  1427. foreground & color of the text string \\
  1428. background & color of the background \\
  1429. font & font of the string if not given \\
  1430. label-horizontal-margin &  \\
  1431. label-vertical-margin & margins around the string \\
  1432. \ITEMa{last-key}{last key pressed}
  1433.         
  1434. {\usagefont\begin{verbatim}
  1435. (last-key)
  1436. \end{verbatim}}\usageupspace
  1437. If the last event processed by a fsm was a key event, returns the string
  1438. generated by it. (Pressing on A yields the string \verb|"A"|). It uses 
  1439. {\bf XLookupString} to do the translation.
  1440. \ITEMa{length}{length of list or string}
  1441.         
  1442. {\usagefont\begin{verbatim}
  1443. (length list)
  1444. (length string)
  1445. \end{verbatim}}\usageupspace
  1446. Returns the number of elements of the list or the number of
  1447. characters of the string.
  1448. \ITEMa{list}{makes a list}
  1449.         
  1450. {\usagefont\begin{verbatim}
  1451. (list elt1 elt2 ... eltN)
  1452. \end{verbatim}}\usageupspace
  1453. Returns the list of its N evaluated arguments.
  1454. {\exemplefont\begin{verbatim}
  1455.         (list (+ 1 2) (+ "foo" "bar"))  ==>     (3 "foobar")
  1456. \end{verbatim}}
  1457. \ITEMa{list-make}{makes a list of a given size}
  1458. {\usagefont\begin{verbatim}
  1459. (list-make size elt1 elt2 ... eltN)
  1460. \end{verbatim}}\usageupspace
  1461. Returns the list of size \verb"size" (number) elements. The element of rank
  1462. \verb"i" is initialized to \verb"elt"$j$, where $j = i$ modulo $N$, if
  1463. elements are provided, \verb"()" otherwise.
  1464. {\exemplefont\begin{verbatim}
  1465.         (list-make 8 'a 'b 'c)          ==>     (a b c a b c a b)
  1466.         (list-make 3)                   ==>     (() () ())
  1467. \end{verbatim}}
  1468. \ITEMa{list-of-screens}{list of managed screens}
  1469. {\usagefont\begin{verbatim}
  1470. (list-of-screens)
  1471. \end{verbatim}}\usageupspace
  1472. Returns the list of screens actually managed by {\GWM}.
  1473. \ITEMa{list-of-windows}{returns the list of managed windows}
  1474.         
  1475. {\usagefont\begin{verbatim}
  1476. (list-of-windows ['window] ['icon] ['mapped]
  1477.     ['stacking-order])
  1478. \end{verbatim}}\usageupspace
  1479. Returns the list of all windows and icons managed by {\GWM}, mapped or not.
  1480. Called without arguments, this function returns the list of all windows (not
  1481. icons), mapped or not. It can take the following atoms as optional
  1482. arguments:
  1483. \begin{description}
  1484. \item[window] lists only main windows
  1485. \item[icon] lists only realized icons
  1486. \item[mapped] lists only currently mapped (visible) windows or icons
  1487. \item[stacking-order] lists windows in stacking order, from bottommost
  1488. (first) to topmost (last). This option is slower than the default which is
  1489. to list them by the order in which they were managed by {\GWM}, from the
  1490. the newest to the oldest.
  1491. \end{description}
  1492. The \verb"window" and \verb"icon" arguments are mutually exclusive.
  1493. {\bf Note:} The two following expressions do not return the same list:
  1494. {\exemplefont\begin{verbatim}
  1495.         (list-of-windows 'icon)
  1496.         (mapfor w (list-of-windows) window-icon)
  1497. \end{verbatim}}
  1498. The first one will return the list of all realized icons, that is only the
  1499. icons of windows that have already been iconified at least once, but the
  1500. second one will trigger the realization of the icons of {\bf all} the
  1501. managed windows, by the evaluation of \verb"window-icon", on all the
  1502. windows.
  1503. {\bf Note:} The main window of an application is always realized, even if
  1504. the application started as iconic.
  1505. \ITEMa{load}{loads and executes a {\WOOL} file}
  1506.         
  1507. {\usagefont\begin{verbatim}
  1508. (load filename)
  1509. \end{verbatim}}\usageupspace
  1510. Loads and executes the {\WOOL} file given in the filename string argument,
  1511. searching through the  path specified by the {\bf GWMPATH} variable or the
  1512. {\bf -p} command line switch. Defaults to \verb".:$HOME:$HOME/gwm:INSTDIR",
  1513. where \verb"INSTDIR" is your local {\GWM} library directory, which is normally
  1514. \verb"/usr/local/X11/gwm", but can be changed by your local installer.
  1515. On startup, {\GWM} does a \verb|(load ".gwmrc")|.
  1516. Returns the complete pathname of the file as a string if it was found, ()
  1517. otherwise but does not generate an error, only a warning message.
  1518. Searches first for \verb"filename.gwm" then \verb"filename" in each
  1519. directory in the path. If the filename includes a \verb"/" character, the
  1520. file is not searched through the path. If any error occurs while the file is
  1521. being read, {\WOOL} displays the error message and aborts the reading of
  1522. this file. This implies that you can't expect {\GWM} to run normally if
  1523. there has been an error in the .gwmrc. (You can turn off this behavior and
  1524. make {\GWM} continue reading a file after an error at your own risk, with
  1525. the {\bf -D} command line option).
  1526. \ITEMa{lower-window}{lowers window below another window}
  1527.         
  1528. {\usagefont\begin{verbatim}
  1529. (lower-window [window])
  1530. \end{verbatim}}\usageupspace
  1531. Lowers  the current window below all other top-level windows or, if the
  1532. \verb"window" argument is present, just below the window given as argument.
  1533. \ITEMa{make-string-usable-for-resource-key}{strips string from dots
  1534. and stars}
  1535. {\usagefont\begin{verbatim}
  1536. (make-string-usable-for-resource-key string)
  1537. \end{verbatim}}\usageupspace
  1538. Replaces all characters \verb*|.*& | (dots, stars, ampersand and spaces) in
  1539. the string
  1540. \verb"string" by underscores \verb"'_'". This function should be used
  1541. before using names for keys in the resource manager functions, as X
  1542. can go weird if you do not handle the good number of classes and names
  1543. to the resource manager \seesnp{resource-get}.
  1544. The string argument is not modified; if replacement is done, a new
  1545. string is returned.
  1546. \ITEMa{map-notify}{event sent when window is mapped}
  1547. \usagetyped{Constant}{event}
  1548. This event is sent to a window or icon just afterwards being actually mapped.
  1549. \ITEMa{map-on-raise}{should the window be mapped when raised?}
  1550. \usagetyped{Variable}{boolean}
  1551. This context variable is used in window decorations, and ,if set, will make
  1552. the window be mapped (and de-iconifed it it was iconified), when the client
  1553. raises it. 
  1554. This is mainly useful for buggy clients assuming that since they put up Motif
  1555. dialog boxes on the screen, they cannot be iconified since mwm doesn't provide
  1556. a way to do it. Setting this flag on FrameMaker v3.0 windows will allow
  1557. correct mapping of iconified dialog boxes.
  1558. \ITEMa{map-window}{maps window}
  1559.         
  1560. {\usagefont\begin{verbatim}
  1561. (map-window [window])
  1562. \end{verbatim}}\usageupspace
  1563. Maps (makes visible) the window (or current window). Does not raise it.
  1564. \ITEMa{match}{general regular expression matching package}
  1565.         
  1566. {\usagefont\begin{verbatim}
  1567. (match regular-expression string [number] ...)
  1568. \end{verbatim}}\usageupspace
  1569. This is the general function to match and extract substrings out of a {\WOOL}
  1570. string. This string is matched against the pattern in regular expression,
  1571. and returns () if the pattern could not be found in the string, and the
  1572. string otherwise.
  1573. If \verb"number" is given, match returns the sub-string 
  1574. matching the part of the
  1575. regular-expression enclosed in between the number-th open parenthesis and
  1576. the matching closing  parenthesis (first parenthesis is numbered 1). Do not
  1577. forget to escape twice the parentheses, once for {\GWM} parsing of strings, and
  1578. once for the regular expression, e.g., to extract ``bar'' from ``foo:bar'' you
  1579. must use: \verb|(match ":\\(.*\\)" "foo:bar" 1)|. If a match cannot be found,
  1580. returns the nil string \verb|""|.
  1581. If more than one \verb"number" argument is given, returns a list made of
  1582. of all the specified sub-strings in the same way as for a single \verb"number"
  1583. argument. If a sub-string wasn't matched, it is the null string.
  1584. For instance, to parse a X geometry such as \verb"80x24+100+150"
  1585. into a list \verb"(x y width height)", you can define the following function:
  1586. {\exemplefont\begin{verbatim}
  1587.         (defun parse-x-geometry (string)
  1588.           (mapfor dim                   
  1589.             (match "=*\\([0-9]*\\)x\\([0-9]*\\)\\([-+][0-9]*\\)\\([-+][0-9]*\\)" 
  1590.                    string 3 4 1 2)
  1591.             (atoi dim))
  1592.         
  1593.         (parse-x-geometry "80x24+100+150")  ==>  (100 150 80 24)
  1594. \end{verbatim}}
  1595. Note that this function returns an error if there is a syntax error in
  1596. the given regular expression.
  1597. The accepted regular-expressions are the same as for ED or GREP, viz:
  1598. \begin{enumerate}
  1599. \item  Any character except a special character matches itself.  Special
  1600. characters are the regular expression delimiter plus \verb|\ [ .| and
  1601. sometimes \verb|^ * $|.
  1602. \item  A \verb"." matches any character.
  1603. \item  A \verb|\| followed by any character except a digit or \verb|( )|
  1604. matches that character.
  1605. \item  A nonempty string \verb|s| bracketed \verb|[s]| (or \verb|[^s]|)
  1606. matches any character in (or not in) \verb|s|. In \verb|s|, \verb|\| has no
  1607. special meaning, and \verb|]| may only appear as the first letter. A
  1608. substring \verb|a-b|, with \verb|a| and \verb|b| in ascending ASCII order,
  1609. stands for the inclusive range of ASCII characters.
  1610. \item  A regular expression of form {\bf 1-4} followed by \verb|*| matches a
  1611. sequence of 0 or more matches of the regular expression.
  1612. \item  A regular expression, \verb"x", of form {\bf 1-8}, bracketed
  1613. \verb"\(x\)" matches what \verb"x" matches.
  1614. \item  A \verb"\" followed by a digit \verb|n| matches a copy of the string
  1615. that the bracketed regular expression beginning with the \verb|n|th
  1616. \verb|\(| matched.
  1617. \item  A regular expression of form {\bf 1-8}, \verb"x", followed by a
  1618. regular expression of form \verb"1-7", \verb"y" matches a match for \verb"x"
  1619. followed by a match for \verb"y", with the \verb"x" match being as long as
  1620. possible while still permitting a \verb"y" match.
  1621. \item  A regular expression of form {\bf 1-8} preceded by \verb"^" (or
  1622. followed by \verb"$"), is constrained to matches that begin at the left (or
  1623. end at the right) end of a line.
  1624. \item  A regular expression of form {\bf 1-9} picks out the longest among
  1625. the leftmost matches in a line.
  1626. \item  An empty regular expression stands for a copy of the last regular
  1627. expression encountered.
  1628. \end{enumerate}
  1629. \ITEMa{member}{position of element in list or in string}
  1630. {\usagefont\begin{verbatim}
  1631. (member element list)
  1632. (member substring string)
  1633. \end{verbatim}}\usageupspace
  1634. In the first form, scans the list (with the \verb"equal" predicate) to find
  1635. the object \verb"element". If found, returns its index in the list (starting
  1636. at 0), \verb"()" otherwise.
  1637. In the second form, looks for the first occurrence of the string
  1638. \verb"substring" in the string \verb"string", and returns the character
  1639. position at which it starts, or \verb"()" if not found.
  1640. \ITEMa{meminfo}{prints memory used}
  1641.         
  1642. {\usagefont\begin{verbatim}
  1643. (meminfo)
  1644. \end{verbatim}}\usageupspace
  1645. Prints the state of the malloc allocator of all dynamic memory used, by
  1646. {\WOOL} or by the Xlib. You will note that reloading your profile consumes
  1647. memory.  This is unavoidable.
  1648. \ITEMa{menu}{menu associated with wob}
  1649.         
  1650. \usagetyped{Variable}{menu}
  1651. The value of this global variable is used by the constructors of all wobs to
  1652. set the associated menu of the wob.  It should be set to a menu constructed
  1653. with \verb"menu-make" or ().  This menu is the default one used by the
  1654. \verb"pop-menu" and \verb"unpop-menu" functions.
  1655. \ITEMa{menu-make}{makes a menu}
  1656.         
  1657. {\usagefont\begin{verbatim}
  1658. (menu-make bar1 bar2 ... barN)
  1659. \end{verbatim}}\usageupspace
  1660. Creates a menu, vertical or horizontal depending on the value of the context
  1661. variable \verb"direction" ({\tt horizontal} or {\tt vertical}). This
  1662. function returns a menu descriptor and at the same time realize the
  1663. corresponding menu wob (to get the
  1664. wob, use the \verb"menu-wob" function below). Unlike the plug-make or
  1665. bar-make functions that return the {\WOOL} description to be used to create
  1666. different wob instances, this is the only {\WOOL} function which really
  1667. creates a wob (as an unmapped X window) on execution.
  1668. A vertical menu is composed of horizontal bars stacked on top of each other.
  1669. A horizontal menu is composed of vertical bars aligned from left to right.
  1670. The menu takes the width (or height) of the largest bar, then adjusts the
  1671. others accordingly in the limits defined by the values of 
  1672. \verb"menu-max-width" and \verb"menu-min-width".
  1673. \label{menu-max-width}\label{menu-min-width}
  1674. If a bar argument is \verb|()|, it is just skipped.
  1675. \context{
  1676. fsm & its finite state machine \\
  1677. direction & for the direction of the menu \\
  1678. borderwidth & the width of the menu's border in pixels \\
  1679. borderpixel & its color \\
  1680. bordertile & if it has a pixmap as border pattern \\
  1681. background & the color of the background \\
  1682. bar-separator & the number of pixels between consecutive bars \\
  1683. tile &  the pattern of its background (may be ()) \\
  1684. cursor & the cursor's shape when in it \\
  1685. property & the property associated with the menu \\
  1686. menu-min-width & minimum width of the menu, its bars are stretched to 
  1687.         fit in it\\
  1688. menu-max-width & maximum width of the menu, clipping its bars\\
  1689. \ITEMa{menu-wob}{returns wob associated with menu}
  1690. {\usagefont\begin{verbatim}
  1691. (menu-wob menu-descriptor)
  1692. \end{verbatim}}\usageupspace
  1693. Returns the wob representing the menu as given by the descriptor returned by
  1694. \verb"menu-make" and used in the context variable \verb"menu".
  1695. \ITEMa{meter}{sets meter attributes}
  1696. {\usagefont\begin{verbatim}
  1697. (meter [key value]...)
  1698. (meter list)
  1699. \end{verbatim}}\usageupspace
  1700. Sets the attributes of the current screen meter. The key must be an atom, and
  1701. the corresponding attribute is set to the value. If a \verb"list" is given,
  1702. it must be a list of keys and values.
  1703. \desc{horizontal-margin}{Key}{Value}{
  1704.  font & the font of the text displayed in the meter\\
  1705.  background & the background color of the meter, defaults to black\\
  1706.  foreground & the color the text will be drawn with, defaults to white\\
  1707.  horizontal-margin & in pixels between text and sides of meter\\
  1708.  vertical-margin & in pixels between text and top and bottom of meter\\
  1709.  x & x position of ``anchor''\\
  1710.  y & y position of ``anchor''\\
  1711.  gravity & which corner of the meter is put at the ``anchor''. Gravity is
  1712. a number from 1 to 9, default being 1 (NorthWest)\\
  1713.  borderwidth & the width in pixels of the border, defaults to 0 (no border)\\
  1714.  borderpixel & the color of the border, defaults to white\\
  1715. \verb"meter" returns a list of keys and values describing the previous values
  1716. of attributes that has been changed. This list can then be given as
  1717. argument to meter to restore the previous values.
  1718. Gravity is expressed as in X11 calls, i.e.\ by the numbers:
  1719. \centerline{\texpsfig{gravity.id}{78}{49}}
  1720. For instance, to set temporarily the meter on the lower right corner
  1721. of the screen:
  1722. {\exemplefont\begin{verbatim}
  1723.         (setq previous-meter-config
  1724.               (meter 'x screen-width 'y screen-height
  1725.                      'gravity 9))
  1726.                                          ; ==> (x 0 y 0 gravity 1)
  1727.         (my-code...)
  1728.         (meter previous-meter-config)
  1729. \end{verbatim}}
  1730. \ITEMa{meter-close}{unmaps the meter}
  1731.         
  1732. {\usagefont\begin{verbatim}
  1733. (meter-close)
  1734. \end{verbatim}}\usageupspace
  1735. Closes the meter (makes it disappear).
  1736. \ITEMa{meter-open}{displays the meter}
  1737.         
  1738. {\usagefont\begin{verbatim}
  1739. (meter-open x y string)
  1740. \end{verbatim}}\usageupspace
  1741. Displays the meter at location x,y. The string argument is only used to set
  1742. the minimum width of the meter, call meter-update to display a string in it.
  1743. \ITEMa{meter-update}{writes a string in the meter}
  1744.         
  1745. {\usagefont\begin{verbatim}
  1746. (meter-update string)
  1747. \end{verbatim}}\usageupspace
  1748. Change the string displayed in the meter to \verb"string". Updates the width
  1749. of the meter accordingly. Since the meter is generally used in a context
  1750. where speed is important, it is never shrunk, only expanded.
  1751. \ITEMb{move-grid-style}{resize-grid-style}{style of grid for move and resize}
  1752.         
  1753. \usagetyped{Numeric variables}{number}
  1754. These variables control the kind of grid which is displayed on move or
  1755. resize operations. Currently available grids are:
  1756. \desctabledim{1cm}{Value}{Style of grid}{
  1757. 0 &     outer rectangle of the window (default) \\
  1758. 1 &     outer rectangle divided in 9 (uwm-style) \\
  1759. 2 &     outer rectangle with center cross (X) inside \\
  1760. 3 &     outer rectangle + inner (client) outline \\
  1761. 4 &     styles 1 and 3 combined \\
  1762. 5 &     2 pixel wide outer rectangle\\
  1763. \ITEMb{move-meter}{resize-meter}{shows meter for move and resize}
  1764. \usagetyped{Numeric variables}{number}
  1765. If set to 1, the meter is shown during an interactive move,
  1766. displaying the coordinates of the moved window.
  1767. \ITEMa{move-window}{moves window interactively or not}
  1768.         
  1769. {\usagefont\begin{verbatim}
  1770. (move-window)
  1771. (move-window window)
  1772. (move-window x y)
  1773. (move-window window x y)
  1774. \end{verbatim}}\usageupspace
  1775. Moves the window. If coordinates are specified, moves directly the current
  1776. window (or \verb"window" argument if specified) to \verb"x,y" (upper-left
  1777. corner coordinates in pixels). If coordinates are not specified, moves the
  1778. window interactively, i.e., display the grid specified with the current
  1779. value of \verb"move-grid-style", and track the grid, waiting for a
  1780. buttonrelease for confirmation or a buttonpress for abort. If confirmed, the
  1781. window is moved to the latest grid position. The cursor will take the shape
  1782. defined by the variable \verb"cursor" if not ().  When move-window is called
  1783. on another event than buttonpress, there is no way to abort the move.
  1784. If you have a strange behavior on move or resize window, check if you
  1785. didn't trigger them with a \verb"button" event instead of a
  1786. \verb"buttonpress", since {\GWM} will wait for a release already eaten by
  1787. move-window!
  1788. When used interactively (first two forms), the return value can be one of:
  1789. \desctabledim{1cm}{Return}{Case}{
  1790. ()&     Ok\\
  1791. 0 &     X problem (window disappeared suddenly, other client 
  1792.         grabbing display, etc.)\\
  1793. 1 &     pointer was not in the window screen\\
  1794. 2 &     user aborted by pressing another button\\
  1795. 3 &     user released button before the function started\\
  1796. Also, when used interactively, if the context variable \verb|confine-windows|
  1797. is set, the window will stay confined to the screen.
  1798. \ITEMa{name-change}{event generated when window changes its name}
  1799.         
  1800. \usagetyped{Constant}{event}
  1801. This event is sent to the window when the client changes its name.  The
  1802. window should then warn the appropriate wobs, by a \see{send-user-event} if
  1803. needed. It is equivalent to the event made by the call 
  1804. \verb|(property-change "WM_NAME")|.
  1805. \ITEMa{namespace}{sets current state of a namespace}
  1806. {\usagefont\begin{verbatim}
  1807. (namespace namespace current-state-index)
  1808. \end{verbatim}}\usageupspace
  1809. Sets the current state of the namespace argument to the index returned
  1810. from the
  1811. \verb"namespace-add" function at the creation of the state. If the index is
  1812. out of bounds (like ``-1''), returns the current index.
  1813. \ITEMa{namespace-add}{adds a state to a namespace}
  1814. {\usagefont\begin{verbatim}
  1815. (namespace-add namespace)
  1816. \end{verbatim}}\usageupspace
  1817. Adds a new state to the argument namespace and returns the index (numeric
  1818. offset starting at 0) of the newly created state. This index should then be
  1819. used to set the current state of the namespace by the \verb"namespace"
  1820. function.
  1821. \ITEMa{namespace-make}{creates a namespace}
  1822. {\usagefont\begin{verbatim}
  1823. (namespace-make)
  1824. \end{verbatim}}\usageupspace
  1825. Creates a new {\bf namespace} and returns it. A namespace is a set of
  1826. variable names, called {\bf names}, that have different values for each
  1827. state in which the namespace can be. 
  1828. The special namespace \verb"screen." has as many spaces as there are
  1829. screens, and its current state is always updated to match the current screen
  1830. by {\GWM}. Other namespaces must switch states by the \verb"namespace"
  1831. function.
  1832. For instance, to define a namespace \verb"application." with a name
  1833. \verb"application.border" which will depend on the current application:
  1834. {\exemplefont\begin{verbatim}
  1835.         (setq application. (namespace-make))
  1836.         (setq application.clock (namespace-add application.))
  1837.         (setq application.load (namespace-add application.))
  1838.         (defname 'application.border application.)
  1839.         (namespace application. application.clock)
  1840.         (setq application.border 1)
  1841.         (namespace application. application.load)
  1842.         (setq application.border 2)
  1843.         (namespace application. application.clock)
  1844.         application.border                                ==>  1
  1845.         (namespace application. application.load)
  1846.         application.border                                ==>  2
  1847. \end{verbatim}}
  1848. \ITEMa{namespace-of}{returns namespace of the name}
  1849. {\usagefont\begin{verbatim}
  1850. (namespace-of name)
  1851. \end{verbatim}}\usageupspace
  1852. Returns the namespace where the name \verb"name" is declared in, otherwise
  1853. (if it is a plain atom or an active value) returns \verb"()".
  1854. \ITEMa{namespace-remove}{removes a state from a namespace}
  1855. {\usagefont\begin{verbatim}
  1856. (namespace-remove namespace state-index)
  1857. \end{verbatim}}\usageupspace
  1858. Destroys a state (made with \verb"namespace-add" of a namespace. The number
  1859. \verb"state-index" is the index returned by namespace-add at the creation of
  1860. the state.
  1861. \ITEMa{namespace-size}{number of states in the namespace}
  1862. {\usagefont\begin{verbatim}
  1863. (namespace-size namespace)
  1864. \end{verbatim}}\usageupspace
  1865. Returns the number of the states of the namespace, i.e., the number of
  1866. possible values for each name in this namespace. The legal values for the
  1867. index to be given to the \verb"namespace" function are in the range
  1868. from 0 to the return value - 1.
  1869. \ITEMa{never-warp-pointer}{disables any pointer warping}
  1870. \usagetyped{Numeric variable}{number}
  1871. If set, GWM will {\bf never} attempt to warp the pointer (move the pointer
  1872. without actual user mouse motion).
  1873. \ITEMa{not}{logical negation}
  1874.         
  1875. {\usagefont\begin{verbatim}
  1876. (not object)
  1877. \end{verbatim}}\usageupspace
  1878. Logical negation. Returns \verb"t" if \verb"object" is \verb"()",
  1879. \verb"()" otherwise.
  1880. \ITEMa{oblist}{prints all defined objects}
  1881.         
  1882. {\usagefont\begin{verbatim}
  1883. (oblist)
  1884. \end{verbatim}}\usageupspace
  1885. Prints the name and value of all currently defined {\WOOL} atoms.
  1886. \ITEMb{on}{on-eval}{triggers a transition on an event in a state of a fsm}
  1887.         
  1888. {\usagefont\begin{verbatim}
  1889. (on event [action [state]])
  1890. (on-eval event [action [state]])
  1891. \end{verbatim}}\usageupspace
  1892. This is the function used to build transitions in the states of the fsms.
  1893. The \verb"on" evaluates only its \verb"event" argument, so that it is not
  1894. necessary to quote the \verb"action" or \verb"state" arguments, whereas
  1895. \verb"on-eval" evaluates all its arguments.
  1896. When an event is handled by an fsm, it checks sequentially all the
  1897. transitions of the current state for one whose \verb"event" field matches
  1898. the incoming event. If found, it calls the {\WOOL} function found in the
  1899. \verb"action" field, which must be a function call, and makes the
  1900. state argument the current state of the fsm. If no  state is given, it is
  1901. taken as the same state of the fsm. If no action is given, no action is
  1902. performed.
  1903. The destination state is an atom which should have a state value defined in
  1904. the current fsm (i.e., set by setq of an atom 
  1905. with the result of a \verb"state-make") at
  1906. the time when the fsm is evaluated, which means that you can make forward
  1907. references to states, as in the following example.
  1908. Example: To define a behavior of a wob cycling through 3 states on the
  1909. click of any button, use this fsm:
  1910. {\exemplefont\begin{verbatim}
  1911.         (fsm-make 
  1912.                 (setq state1 (state-make
  1913.                         (on (button any any) (? 1) state2))
  1914.                 (setq state2 (state-make
  1915.                         (on (button any any) (? 2) state3)))
  1916.                 (setq state3 (state-make
  1917.                         (on (button any any) (? "3.\n") state1))))
  1918. \end{verbatim}}
  1919. \ITEMb{opening}{closing}{{\WOOL} hooks on creation and deletion of windows}
  1920. \usagetyped{Variables}{Wool}
  1921. The values of these global variables are used by the \see{window-make}
  1922. constructor to define {\WOOL} expressions which are evaluated just before
  1923. creating or just after destroying a window or an icon. 
  1924. {\bf Note:} The \verb"opening" field of a window is always evaluated on the
  1925. creation of this window, thus the \verb"opening" of an icon is only
  1926. executed on the first iconification of the icon.
  1927. \ITEMa{or}{logical OR of expressions}
  1928.         
  1929. {\usagefont\begin{verbatim}
  1930. (or object1 object2 ... objectN)
  1931. \end{verbatim}}\usageupspace
  1932. Logical OR\@. Returns the first non-() object or ().
  1933. \ITEMa{pixmap-load}{loads an XPM X pixmap from an ascii file}
  1934.         
  1935. {\usagefont\begin{verbatim}
  1936. (pixmap-load filename [symbolic-color-name color-value]...)
  1937. \end{verbatim}}\usageupspace
  1938. This function builds a pixmap by reading its description in the file
  1939. \verb"filename.xpm" or \verb"filename", searched in the directory path held
  1940. by the {\bf GWMPATH} shell variable \seesnp{GWMPATH}. 
  1941. In case of
  1942. error the default pixmap returned is the same as the one returned by the
  1943. \verb"pixmap-make" function.
  1944. The pixmap is expected to be described in the {\bf XPM} (for X PixMap)
  1945. format. XPM is a de-facto standard X pixmap format which can be found on
  1946. ftp.x.org or any of its mirrors, or koala.inria.fr, or by WWW at 
  1947. {\tt http://www.inria.fr/koala/lehors/xpm.html}.
  1948. XPM allows you to associate symbolic color names to pixels in the file, which
  1949. may be overrided by actual color to be used at load time. For instance, to use
  1950. an icon \verb|undo| defining the symbolic colors \verb|lit| \verb|dark|
  1951. \verb|pen| in a ``blue'' context, you may want to load it by a
  1952. {\exemplefont\begin{verbatim}
  1953.         (pixmap-load 'undo 'lit (color-make "LightBlue")
  1954.                            'dark (color-make "SteelBlue")
  1955.                            'pen black)
  1956. \end{verbatim}}
  1957. Whereas if you want to give it a pinkish look:
  1958. {\exemplefont\begin{verbatim}
  1959.         (pixmap-load 'undo 'lit (color-make "pink1")
  1960.                            'dark (color-make "pink4")
  1961.                            'pen (color-make "DeepPink4"))
  1962. \end{verbatim}}
  1963. {\bf Note:} a color can be specified as the string \verb|"none"|, and in which
  1964. case the pixels are transprent and the resulting pixmap can be used as tiles
  1965. to construct shaped (non-rectangular) decorations.
  1966. {\exemplefont\begin{verbatim}
  1967.         (pixmap-load 'undo 'lit (color-make "pink1")
  1968.                            'dark "none"
  1969.                            'pen (color-make "DeepPink4"))
  1970. \end{verbatim}}
  1971. \ITEMa{pixmap-make}{builds a pixmap (color image)}
  1972.         
  1973. {\usagefont\begin{verbatim}
  1974. (pixmap-make filename)
  1975. (pixmap-make width height)
  1976. (pixmap-make background-color file1 color1 
  1977.              file2 color2 ... )
  1978. \end{verbatim}}\usageupspace
  1979. With a single argument, loads the bitmap file given in the filename string
  1980. argument, searching through the bitmap path specified by the {\bf GWMPATH}
  1981. variable or the {\bf -p} command line switch \seesnp{GWMPATH}. 
  1982. Searches first for
  1983. \verb"filename.xbm" then \verb"filename" in each directory in the path. If
  1984. the filename includes a \verb"/" character, the file is not searched through
  1985. the path.
  1986. The pixmap is built by drawing the ``unset'' bits of the bitmap with the 
  1987. color held by the \verb"background" variable and  the ``set'' bits with
  1988. the color held by the \verb"foreground" variable.
  1989. When used with two arguments, \verb"pixmap-make" returns a newly
  1990. created pixmap of width \verb"width" and height \verb"height" filled with
  1991. the current \verb"foreground" color if the variable \verb"tile" is nil, or
  1992. filled with the pixmap pointed to by the \verb"tile" variable, if any.
  1993. When used with three or more arguments,
  1994. returns the pixmap constructed by using the bitmaps given as arguments to
  1995. paint only the ``set'' bits of bitmap in file file{\it i\/}
  1996. (searched along the same rules as for the first form) to the color{\it
  1997. i}.  The ``unset'' bits remain untouched. The pixmap is first painted with the
  1998. color given in the \verb"background-color" argument.
  1999. If the specified bitmap cannot be loaded, either because the file cannot be
  2000. found or does not contain a bitmap, a default built-in bitmap is used and a
  2001. warning is issued. The default is the MIT X Consortium logo as a 20x15 bitmap.
  2002. Bitmaps can be of any size, they will be centered in the resulting pixmap
  2003. which will be of the maximum size of its components.
  2004. The filename arguments can also be replaced by:
  2005. \begin{description} 
  2006. \item[active-labels] The string is centered on the bitmap, drawn in the
  2007. following color.
  2008. \item[pixmaps]      The pixmap is painted in the center, with its own
  2009. background color (note that \verb"label-make" returns a pixmap!). The
  2010. following color is then ignored, but {\bf must} be specified for consistency
  2011. purposes.
  2012. \end{description}
  2013. \ITEMa{place-menu}{maps a menu as a normal client window}
  2014.         
  2015. {\usagefont\begin{verbatim}
  2016. (place-menu name menu [x y])
  2017. \end{verbatim}}\usageupspace
  2018. Places a menu (made with \verb"menu-make") on the screen. This window is
  2019. then managed like any other client window. Its client class and,
  2020. client name are given by the context variables \verb"class-name" and
  2021. \verb"client-name", by default \verb"Gwm" and \verb"menu", and its 
  2022. window name is given by the parameter \verb"name".  The window is
  2023. placed at position {\tt x, y} if specified and at 0,0 otherwise (NB: It is
  2024. placed at last popped position if it was a popped menu). Returns the created
  2025. {\bf WARNING:} Be careful not to mix popup menus and placed ones, calling
  2026. \verb"pop-menu" on an already ``placed-menu'' will result in unpredictable
  2027. behavior. 
  2028. \context{
  2029. \label{class-name}   class-name & the client class of the window. Default 
  2030. \verb"Gwm".\\
  2031. \label{client-name}   client-name & the client name of the window. Default 
  2032. \verb"menu".\\
  2033. \label{icon-name}   icon-name & the name of the icon for the window. 
  2034. If () (default), uses {\tt name}.\\
  2035. \label{starts-iconic}   starts-iconic & if the menu will first appear as 
  2036. an icon\\
  2037. \ITEMa{plug-make}{makes a plug}
  2038.         
  2039. {\usagefont\begin{verbatim}
  2040. (plug-make pixmap)
  2041. (plug-make active-label)
  2042. \end{verbatim}}\usageupspace
  2043. This function builds a plug, the atomic wob object. It is composed of a
  2044. graphic object (either a pixmap, created with pixmap-make or label-make, or
  2045. another type of object such as an ``active-label''). The size of the
  2046. graphic object determines the size of the plug.  Thus if you change the
  2047. pixmap of the plug via \verb"wob-tile", the plug is resized
  2048. accordingly.
  2049. \context{
  2050.             fsm       &     its finite state machine \\
  2051.             borderwidth  &  the width of the plug's border in pixels \\
  2052.             borderpixel  &  its color \\
  2053.             bordertile   &  the pixmap to paint the border with \\
  2054.             background   &  the color of the background \\
  2055.             menu         &  the pop-up associated with it  \\
  2056.             cursor       &      the cursor's shape when in it \\
  2057.             property     &  the property associated with the plug \\
  2058. A plug can be shaped (non-rectangular) if made by {\tt pixmap-load}-ing an
  2059. {\tt XPM} file with some transparent color pixels (or color {\tt none} in XPM
  2060. terms. 
  2061. \ITEMa{plug-separator}{inter-plug space in bars}
  2062.         
  2063. \usagetyped{Numeric variable}{number}
  2064. The value of this global variable is used by the \verb"bar-make" function to
  2065. give the space in pixels between 2 consecutive plugs not separated by
  2066. extensible space.
  2067. \ITEMa{pop-menu}{pops a menu}
  2068.         
  2069. {\usagefont\begin{verbatim}
  2070. (pop-menu [menu] [position] ['here])
  2071. \end{verbatim}}\usageupspace
  2072. This function grabs the server (using the \see{grab-server} function), thus
  2073. preventing other client requests to be processed by the server, and maps the
  2074. given menu (or the menu associated with the current wob if menu
  2075. is not given or is set to ()). The menu is guaranteed to be on the screen
  2076. when this function returns.
  2077. The behavior of the menu is then determined by
  2078. the menu's fsm. The cursor will take the shape defined by the variable
  2079. \verb"cursor" if it is  non-nil.
  2080. The \verb"position" number is the item in which you want the cursor to appear
  2081. (centered), the first item is numbered 0.
  2082. If the atom \verb"fixed" is given, the menu is not moved under the current
  2083. position of the pointer, it stays at the last position it was. So to pop a
  2084. menu \verb"menu" at (67, 48), do:
  2085. {\exemplefont\begin{verbatim}
  2086.         (move-window (menu-wob menu) 67 48)
  2087.         (pop-menu menu 'here)
  2088. \end{verbatim}}
  2089. The current wob at the time of the call to \verb"pop-menu" becomes the
  2090. parent of the menu.
  2091. {\bf Note:} A menu is not a {\GWM} window, so when a menu is popped, 
  2092. the current
  2093. window becomes the window parent of the wob which has popped the menu.
  2094. {\bf Note:} The arguments to \verb"pop-menu" can be given in any order and
  2095. are all optional.
  2096. \ITEMa{print-errors-flag}{controls printing of error messages}
  2097. \usagetyped{Numeric variable}{number}
  2098. If nonzero, {\WOOL} error messages are printed on {\GWM} output device,
  2099. which is the default. \verb"error-occurred" sets this variable to 0 to
  2100. prevent printing errors.
  2101. \ITEMa{print-level}{controls printing depth of lists}
  2102. \usagetyped{Numeric variable}{number}
  2103. This variable controls the maximum depth at which the lists will be printed.
  2104. {\exemplefont\begin{verbatim}
  2105.         (setq print-level 2)
  2106.         '(1 (2 (3 (4 rest))))           ==>      (1 (2 (...)))
  2107. \end{verbatim}}
  2108. \ITEMa{process-events}{recursively process all pending events\hfill{\bf EXPERT}}
  2109. {\usagefont\begin{verbatim}
  2110. (process-events [sync])
  2111. \end{verbatim}}\usageupspace
  2112. This function reads the event queue and recursively processes all pending
  2113. events by re-entering the main {\GWM} loop. It returns when there are no
  2114. more pending events on the X event queue.
  2115. This functions allows a pseudo-multitasking capability for {\GWM}.
  2116. You can thus implement ``background jobs'' such as a general desktop space
  2117. cleaning routine, to be called after each move, opening, or closing function
  2118. that pauses by calling \verb"process-events" at regular intervals to let
  2119. {\GWM} do its other tasks. You should then take into account the fact that
  2120. the current function could be recursively called by another move operation
  2121. triggered by an event processed by \verb"process-events", however and thus
  2122. be re-entrant.
  2123. If a non-nil argument \verb"sync" is given, {\GWM} does a ``Sync'',
  2124. i.e.\ requests the server to send all its pending events, before
  2125. processing the events on the queue.
  2126. \ITEMa{process-exposes}{treats all pending expose events}
  2127.         
  2128. {\usagefont\begin{verbatim}
  2129. (process-exposes)
  2130. \end{verbatim}}\usageupspace
  2131. This function reads the event queue and processes all expose events it finds
  2132. for {\GWM} objects on the screen. It is used by pop-menu to be sure that the
  2133. menu is completely drawn before letting it react to user events.
  2134. \ITEMa{rotate-cut-buffers}{rotate server cut buffers}
  2135. {\usagefont\begin{verbatim}
  2136. (rotate-cut-buffers number)
  2137. \end{verbatim}}\usageupspace
  2138. Exchange the contents of the {\bf 8} cut buffers on the X server so that
  2139. buffer $n$ becomes buffer $n + $ \verb"number" modulo 8.
  2140. \ITEMa{send-current-event}{re-sends X event to the client of a window}
  2141. {\usagefont\begin{verbatim}
  2142. (send-current-event window)
  2143. \end{verbatim}}\usageupspace
  2144. Re-sends the last key or button event to the client of the \verb"window"
  2145. argument. If \verb"window" is \verb"()", it is taken as the current window.
  2146. \ITEMbi{\{\}}{progn}{sequence of instructions}
  2147.         
  2148. {\usagefont\begin{verbatim}
  2149. (progn inst1 inst2 ... instN)
  2150. {inst1 inst2 ... instN}
  2151. \end{verbatim}}\usageupspace
  2152. The classical Lisp \verb"progn" function, evaluating all its arguments and
  2153. returning the result of the last evaluation. Useful in places where
  2154. more then one Lisp instruction is expected, for instance in
  2155. \verb"then" fields of the \verb"if" instruction, or in the
  2156. \verb"action" field of the \verb"on" function. The brace notation is
  2157. just a shortcut for writing \verb"progn" sequences.
  2158. \ITEMa{property-change}{event generated when a client window changes a property}
  2159.         
  2160. {\usagefont\begin{verbatim}
  2161. (property-change property-name)
  2162. \end{verbatim}}\usageupspace
  2163. This event is sent when the property of name \verb"property-name" is changed
  2164. on the client window.
  2165. \ITEMa{raise-window}{raises window on top of other windows}
  2166.         
  2167. {\usagefont\begin{verbatim}
  2168. (raise-window [window])
  2169. \end{verbatim}}\usageupspace
  2170. Raises  the current window on top of all other top-level windows or, if the
  2171. \verb"window" argument if present, above the window given as argument.
  2172. \ITEMa{re-decorate-window}{re-decorates the client window by {\GWM}}
  2173.         
  2174. {\usagefont\begin{verbatim}
  2175. (re-decorate-window [window])
  2176. \end{verbatim}}\usageupspace
  2177. Un-decorate the client window and re-decorate it as if it had appeared on
  2178. the screen. Useful after a \verb|(load ".gwmrc")| to test quickly any
  2179. modifications to your profile.
  2180. \ITEMa{reenter-on-opening}{process events on the queue just before mapping a new window}
  2181.         
  2182. \usagetyped{Numeric variable}{number}
  2183. If nonzero (default), {\GWM} will process all events in the queue before
  2184. mapping a new window. This may pose re-entrancy problems ({\WOOL} code
  2185. may be called during a call to \verb"place-menu" for instance), and
  2186. thus can be turned off.
  2187. \ITEMa{refresh}{refreshes the screen}
  2188.         
  2189. {\usagefont\begin{verbatim}
  2190. (refresh [window])
  2191. \end{verbatim}}\usageupspace
  2192. If a window argument is provided, refreshes only this window, otherwise 
  2193. forces a redraw of the screen like XREFRESH(1). Refreshing is done by mapping
  2194. and unmapping a new window over the area to refresh.
  2195. \ITEMa{replayable-event}{makes a replayable event from a normal event}
  2196. {\usagefont\begin{verbatim}
  2197. (replayable-event event)
  2198. \end{verbatim}}\usageupspace
  2199. Makes the given button or key event replayable
  2200. \seesnp{ungrab-server-and-replay-event}. This is not the default for events
  2201. because replayable events freeze the server state for {\GWM} when a passive
  2202. grab is activated with them, which might not be desirable.
  2203. {\exemplefont\begin{verbatim}
  2204.         (set-grabs (replayable-event (button 1 alone)))
  2205. \end{verbatim}}
  2206. {\bf WARNING:} It is recommended to un-freeze the server if you are to do some
  2207. processing before the button or key is released, either by replaying the event
  2208. by {\tt ungrab-server-and-replay-event} or \seensp{allow-event-processing}.
  2209. \ITEMa{resize-style}{style of interactive resize}
  2210. \usagetyped{Numeric variable}{number}
  2211. This variable controls the way the interaction with the user is handled
  2212. during resizes, and can take the numeric values:
  2213. \desctabledim{1cm}{Value}{Style of Resize}{
  2214. 0 & is a {\tt Uwm}-like resize, i.e.\ the window is divided
  2215. in nine regions, and you are allowed to drag which side or corner of the
  2216. window you were in when the resize began.\\
  2217. 1 & \sloppy is a {\bf Mwm}-like resize, i.e.\ you resize the window by its
  2218. side or corner, the width of the corners being determined (in pixels) by the
  2219. value of the global variable 
  2220. \verb"mwm-resize-style-corner-size"\label{mwm-resize-style-corner-size}. 
  2221. If you are dragging the side of the window and you go at less than
  2222. \verb"mwm-resize-style-corner-size" of a corner, you then drag this corner,
  2223. if the global variable
  2224. \verb"mwm-resize-style-catch-corners"
  2225. \label{mwm-resize-style-catch-corners} is nonzero.
  2226. The corner or side dragged is reflected by the shape of the cursor you have
  2227. put in the global variables cursor-NW, cursor-NE, cursor-N, cursor-SW,
  2228. cursor-SE, cursor-S, cursor-E, cursor-W (see p~\pageref{cursor-NW}). While
  2229. you are not dragging anything, the cursor is still determined by the value
  2230. of {\tt cursor}
  2231. \ITEMa{resize-window}{resizes the window interactively or not}
  2232.         
  2233. {\usagefont\begin{verbatim}
  2234. (resize-window)
  2235. (resize-window window)
  2236. (resize-window width height)
  2237. (resize-window window width height)
  2238. \end{verbatim}}\usageupspace
  2239. Resizes the window. If the dimensions are specified, resizes directly the
  2240. current window (or the given \verb"window" argument) to the given size,
  2241. specified in pixels, rounded down to the allowed size increments (if you
  2242. want to resize by increments, use the \verb"window-size" active value). If
  2243. the dimensions are not specified, resizes the window interactively, i.e.,
  2244. display the grid specified with the current value of \verb"resize-grid-style",
  2245. and track the grid, waiting for a buttonrelease for confirmation or a
  2246. buttonpress for abort. If confirmed, the window is resized to the latest
  2247. grid position. The cursor will take the shape defined by the variable
  2248. \verb"cursor", if it is non-nil.
  2249. {\bf NOTE:} The dimensions given to resize-window are those of the outer
  2250. window, in pixels, including the {\GWM} decoration. Use the 
  2251. \verb"window-size" active value if you want to specify the client dimensions.
  2252. {\bf WARNING:} When resize-window is called on an event other than
  2253. buttonpress, there is no way to abort the resize.
  2254. The interactive resize interaction is set by the value of the global variable
  2255. \verb"resize-style"
  2256. When used interactively (first two forms), the return value can be one of:
  2257. \desctabledim{1cm}{Returns}{Case}{
  2258. ()&     Ok\\
  2259. 0 &     X problem (window disappeared suddenly, other client
  2260.         grabbing display, etc.)\\
  2261. 1 &     pointer was not in the window screen\\
  2262. 2 &     user aborted by pressing another button\\
  2263. 3 &     user released button before the function started\\
  2264. Also, when used interactively, if the context variable \verb|confine-windows|
  2265. is set, the window will stay confined to the screen.
  2266. \ITEMa{resource-get}{searches {\GWM} database for a resource}
  2267.         
  2268. {\usagefont\begin{verbatim}
  2269. (resource-get name class)
  2270. \end{verbatim}}\usageupspace
  2271. Calls the X11 resource manager for an object of name \verb"name" and
  2272. class \verb"class" (strings of dot-separated names) previously stored
  2273. by a call to \verb"resource-put" matching the description (See the
  2274. X11 documentation for precise description of the rule-matching
  2275. algorithm of the resource manager).
  2276. This is the recommended way to retrieve the window descriptions associated
  2277. with a client in the \verb"describe-window" function.
  2278. {\bf WARNING:} The \verb"name" and \verb"class" {\bf must} have the
  2279. same number of dots in them! \seesnp{make-string-usable-for-resource-key}.
  2280. \ITEMa{resource-put}{puts a resource in {\GWM} database}
  2281.         
  2282. {\usagefont\begin{verbatim}
  2283. (resource-put name value)
  2284. \end{verbatim}}\usageupspace
  2285. Puts the value in the {\GWM} resource database so that it can be retrieved by a
  2286. future call to resource-get. Names can use the same conventions as in the
  2287. .Xdefaults file for normal X11 clients.
  2288. This is the recommended way to store the window descriptions associated with a
  2289. client so that they can be retrieved later in the \verb"describe-window"
  2290. function.
  2291. \ITEMa{restart}{restarts {\GWM}}
  2292.         
  2293. {\usagefont\begin{verbatim}
  2294. (restart)
  2295. (restart "prog" "arg1" "arg2" ... "argn")
  2296. \end{verbatim}}\usageupspace
  2297. Without arguments, restarts {\GWM}, more precisely, it does an EXEC(2) of
  2298. {\GWM} with the same arguments that were given on startup.
  2299. With arguments, terminates {\GWM} and starts a new process with the given
  2300. command-line arguments. This useful to restart {\GWM} with another profile,
  2301. as in:
  2302. {\exemplefont\begin{verbatim}
  2303.         (restart "gwm" "-f" "another-profile")
  2304. \end{verbatim}}
  2305. \ITEMa{root-window}{the root window}
  2306.         
  2307. \usagetyped{Active value}{window id}
  2308. Holds the wob describing the root window of the current screen. 
  2309. For instance, to set the background
  2310. pixmap of the screen to the bitmap in file ``ingrid'', say:
  2311. {\exemplefont\begin{verbatim}
  2312.         (with (wob root-window) (setq wob-tile (pixmap-make "ingrid")))
  2313. \end{verbatim}}
  2314. When set to a root window wob, sets the current wob and window to it,
  2315. and screen to the screen it belongs to.
  2316. \ITEMa{save-yourself}{asks client to update its WM\_COMMAND property}
  2317. {\usagefont\begin{verbatim}
  2318. (save-yourself [window])
  2319. \end{verbatim}}\usageupspace
  2320. Sends to the current window's (or to given window's) client window 
  2321. the ICCC message \verb"WM_SAVE_YOURSELF", telling the
  2322. application to update its \verb"WM_COMMAND" X property to a command line
  2323. which should restart it in its current state.
  2324. This function returns \verb"t" if the window supported this protocol, and
  2325. hence is supposed to update its \verb"WM_COMMAND" property; \verb"()"
  2326. otherwise \seesp{get-wm-command}.
  2327. \ITEMa{screen}{current screen}
  2328. \usagetyped{Active value}{screen number}
  2329. Returns or sets the current screen as the screen number (the same number as
  2330. \verb"X" in \verb"DISPLAY=unix:0.X"). Setting the screen also sets the
  2331. active values \verb"wob" and \verb"window" to the root window of the screen.
  2332. See the warning about using {\tt screen} in {\tt with} constructs under the
  2333. {\tt window} entry, p~\pageref{window}.
  2334. \ITEMa{screen-count}{number of screens attached to the display}
  2335. \usagetyped{Constant}{number}
  2336. \sloppy The number of screens attached to the display. Not equal to
  2337. \verb"(length (list-of-screens))" if you excluded screens by the \verb"-x"
  2338. command line option.
  2339. \ITEMc{screen-depth}{screen-height}{screen-width}{screen dimensions}
  2340.         
  2341. \usagetyped{Constants}{number}
  2342. These numerical variables hold the size of the current screen in bitplanes
  2343. (\verb"screen-depth") and pixels (\verb"screen-width" and
  2344. \verb"screen-height"). A screen-depth of 1 means that you are on a
  2345. monochrome screen.
  2346. \ITEMb{screen-heightMM}{screen-widthMM}{actual screen size in millimeters}
  2347. \usagetyped{Constants}{number}
  2348. Hold the dimensions of the screen in millimeters.
  2349. \ITEMa{screen-type}{visual type of screen}
  2350. \usagetyped{Active value}{atom --- not settable}
  2351. Returns the screen visual type as an atom, which can be either \verb"color",
  2352. \verb"gray", or \verb"mono", if the screen is a color, gray scale, or
  2353. monochrome device.
  2354. \ITEMa{send-button-to-window}{sends button event to a client}
  2355.         
  2356. {\usagefont\begin{verbatim}
  2357. (send-button-to-window button modifier x y)
  2358. \end{verbatim}}\usageupspace
  2359. Sends a buttonpress and a buttonrelease X event to the client
  2360. application of the window. The event is generated as if the user
  2361. pressed on the button number {\tt button}, with the \verb"modifier"
  2362. keys down and at location {\tt x,y} in the client window coordinates
  2363. (in pixels). In particular, this means that the event is sent to the
  2364. smallest subwindow of the application containing {\tt x,y} and having
  2365. selected to receive button events.
  2366. \ITEMb{send-key-to-window}{send-keycode-to-window}{sends key event to a client}
  2367.         
  2368. {\usagefont\begin{verbatim}
  2369. (send-key-to-window keysym modifier)
  2370. (send-key-to-window string modifier)
  2371. (send-keycode-to-window keycode modifier)
  2372. \end{verbatim}}\usageupspace
  2373. These three functions are used to send key events to the client of the
  2374. current window, to define function keys in {\GWM}, or to implement mouse
  2375. positioning of the cursor in Emacs for instance. The third form sends the
  2376. keycode (as returned by current-event-code), the first the keysym as defined in
  2377. the include file ``keysymdef.h''. Both keysyms and keycodes must be {\bf
  2378. numbers}, not names. You can however specify the symbolic name of the key
  2379. with the \verb"key-make" function. The \verb"modifier" parameter indicates 
  2380. which
  2381. modifier keys or which buttons were supposed to be down for the event.
  2382. The second form sends each character of the string (this works for
  2383. ASCII characters only) with the modifier \verb"modifier" to the window. A
  2384. Shift modifier is automatically added to all uppercase characters.
  2385. \ITEMa{send-user-event}{sends a {\GWM} ``user'' event}
  2386.         
  2387. {\usagefont\begin{verbatim}
  2388. (send-user-event atom [wob [do-not-propagate?]])
  2389. \end{verbatim}}\usageupspace
  2390. This function sends a ``user'' event, to the current window, if no argument
  2391. is present, or to the wob specified as argument. A user event is a {\GWM}
  2392. concept and is {\bf NOT} an X event, i.e., it is not seen by the server and is
  2393. immediately processed before \verb"send-user-event" terminates. The
  2394. peculiarity of an user-event is that it recursively propagates downwards in
  2395. the wob tree from the destination wob, the event being sent first to the
  2396. child, then to the wob itself. That is, if you send an user-event to the window, all
  2397. its decorations will receive it. The atom, which is evaluated by the
  2398. function, and thus needs to be quoted, is used merely as a kind of label for
  2399. the event.
  2400. If you provide a non-nil third argument, the event is sent to the given wob,
  2401. but is not propagated to its sons.
  2402. Example: 
  2403. {\exemplefont\upspace\begin{verbatim}
  2404.         (send-user-event 'get-focus)
  2405. \end{verbatim}}
  2406. {\bf Note:} \verb"send-user-event" saves and restores the current wob,
  2407. window, screen, and event. Thus if a piece of code triggered in another fsm sets the
  2408. current wob to another one, it will be restored to its previous value on
  2409. exit of the calling \verb"send-user-event".
  2410. \ITEMa{set-acceleration}{sets mouse speed}
  2411.         
  2412. {\usagefont\begin{verbatim}
  2413. (set-acceleration numerator denominator)
  2414. \end{verbatim}}\usageupspace
  2415. Accelerates the mouse cursor movement by a ratio of numerator/denominator
  2416. (two numbers).
  2417. \ITEMa{set-colormap-focus}{sets the window whose colormap is installed}
  2418. {\usagefont\begin{verbatim}
  2419. (set-colormap-focus [window])
  2420. \end{verbatim}}\usageupspace
  2421. Installs the colormap of the current window (or the given \verb"window").
  2422. Once a window has the {\em colormap focus}, if the
  2423. client changes its colormap, the new colormap is automatically installed by
  2424. {\GWM}.
  2425. If the window has no declared colormap, the default colormap (the colormap
  2426. of the root window) is installed instead.
  2427. If the argument is \verb"()", the default colormap for the screen is
  2428. re-installed.
  2429. \ITEMa{set-focus}{sets input focus on a window}
  2430.         
  2431. {\usagefont\begin{verbatim}
  2432. (set-focus [window])
  2433. \end{verbatim}}\usageupspace
  2434. Sets the focus to the current window, or to the given \verb"window". The
  2435. keyboard input will then go to the client of this window, regardless of the
  2436. pointer position. If window is (), the focus is reset to {\bf PointerRoot}
  2437. mode, i.e., the focus is always on the window under the pointer.
  2438. If the client of the current window follows the ICCC
  2439. \verb"WM_TAKE_FOCUS" protocol, {\GWM} does not try to set the focus to the
  2440. window, it just sends the \verb"WM_TAKE_FOCUS" message to the client
  2441. which should then set the focus itself.
  2442. {\bf NOTE:} \verb"set-focus" will not set the focus on a client window that
  2443. does not need it, so that \verb"set-focus" on XCLOCK for instance has no
  2444. effect. This is the only case where \verb"set-focus" will return \verb"()";
  2445. it returns \verb"t" otherwise.
  2446. \ITEMb{set-grabs}{unset-grabs}{grabs events occurring in the window}
  2447. {\usagefont\begin{verbatim}
  2448. (set-grabs event1 event2 ... eventN)
  2449. (unset-grabs event1 event2 ... eventN)
  2450. \end{verbatim}}\usageupspace
  2451. {\tt set-grabs} establishes what is called a {\bf passive grab} on a button
  2452. or a key on the current window, i.e.; all events matching the given events
  2453. will be transmitted to the window itself, even if they have occurred on a
  2454. bar, plug, or client window of the window.
  2455. {\tt unset-grabs} removes events from the list of grabbed events. They do
  2456. not exit an existing active grab.
  2457. The {\tt set-grabs} call is used when decorating a window on the
  2458. \see{grabs} list.
  2459. Example:{\exemplefont\upspace\begin{verbatim}
  2460.         (set-grabs (button 3 alone) 
  2461.                    (buttonpress any with-alt)
  2462.                    (key (key-make "Delete") any))
  2463.         (unset-grabs (key any any))
  2464. \end{verbatim}}
  2465. \ITEMa{set-icon-sizes}{sets desired icon sizes}
  2466.         
  2467. {\usagefont\begin{verbatim}
  2468. (set-icon-sizes min-width min-height
  2469.                 max-width max-height
  2470.                 width-inc height-inc)
  2471. \end{verbatim}}\usageupspace
  2472. This function sets a property of name \verb"WM_ICON_SIZE" on the root window
  2473. which tells the clients which are the desirable size for their icon pixmaps
  2474. or icon windows, if they define any, as returned by 
  2475. \see{window-icon-pixmap} and \see{window-icon-window}.
  2476. \ITEMa{set-key-binding}{redefines keyboard for all applications}
  2477.         
  2478. {\usagefont\begin{verbatim}
  2479. (set-key-binding keycode keysym 
  2480.                  [keysym1 [keysym2 ... [keysymN]]])
  2481. \end{verbatim}}\usageupspace
  2482. This rebinds the keys on the server's keyboard. When the key of keycode
  2483. \verb"keycode" is pressed, it will be decoded as the keysym
  2484. \verb"keysym" if pressed alone, \verb"keysym1" if pressed with
  2485. \verb"modifier1",\ldots  \verb"keysymN" if pressed with modifier {\tt N}
  2486. (Modifiers are shift, control, lock, meta, etc.)
  2487. {\bf WARNING:} The storage used by this function is never released.
  2488. {\bf Note:} To obtain the list of current bindings of your server, use the
  2489. {\bf xprkbd} X11 utility.
  2490. \ITEMa{set-screen-saver}{sets screen-saver parameters}
  2491.         
  2492. {\usagefont\begin{verbatim}
  2493. (set-screen-saver timeout interval 
  2494.                   prefer-blanking allow-exposures)
  2495. \end{verbatim}}\usageupspace
  2496. Sets the way the screen-saver operates:
  2497. \begin{description}
  2498. \item[Timeout] is the time in seconds of no input after which the screen blanks
  2499.                 (0 means no screen saver, -1 = restore default)
  2500. \item[Interval] is the interval in seconds between random motion of the background
  2501.                 pattern (0 disables motion)
  2502. \item[Prefer-blanking] makes the screen go blank if 1
  2503. \item[Allow-exposures] if 0 means that the screen saver operation should not
  2504.                 generate exposures, even if this implies it cannot operate.
  2505. \end{description}
  2506. \ITEMa{set-subwindow-colormap-focus}{installs the colormap of a subwindow}
  2507. {\usagefont\begin{verbatim}
  2508. (set-subwindow-colormap-focus [number])
  2509. \end{verbatim}}\usageupspace
  2510. If the current window currently has the colormap focus, as set
  2511. by the \see{set-colormap-focus} function, and the client has set a
  2512. \verb"WM_COLORMAP_WINDOWS" property on its window which tells 
  2513. {\GWM} to install
  2514. the colormaps of its subwindows, calling \verb"set-subwindow-colormap-focus"
  2515. without an argument installs the next different colormap in the list of
  2516. subwindows whose colormaps must be installed.
  2517. If a numeric argument is given, it is taken as an offset in the list of
  2518. subwindows (modulo the size of the list), and the corresponding window's
  2519. colormap is installed. The main window is always at offset zero.
  2520. Calling \see{set-colormap-focus} on the window resets the current offset
  2521. to zero, for subsequent calls to \verb"set-subwindow-colormap-focus".
  2522. \ITEMa{set-threshold}{sets mouse acceleration threshold}
  2523.         
  2524. {\usagefont\begin{verbatim}
  2525. (set-threshold number)
  2526. \end{verbatim}}\usageupspace
  2527. Sets the minimum pointer movement in pixels before acceleration takes place
  2528. (See \see{mouse-acceleration}). The \verb"number" argument must not be 0.
  2529. \ITEMc{set}{setq}{:}{variable assignment}
  2530.         
  2531. {\usagefont\begin{verbatim}
  2532. (setq atom value)
  2533. (set object value)
  2534. \end{verbatim}}\usageupspace
  2535. This is the assignment function of all Lisp dialects. In the first form,
  2536. the first argument is not evaluated, in the second it is.
  2537. (Thus allowing non-standard atom names to be set via the atom constructor
  2538. \verb"atom", as in \verb|(set (atom "foo bar") 1)| ). Both forms evaluate 
  2539. their second
  2540. argument and sets the value of the first argument to the resulting
  2541. value. Setting active values
  2542. doesn't modify their value, but calls a predefined function on the value.
  2543. \verb":" is just a synonym for \verb"setq".
  2544. Example:{\exemplefont\upspace\begin{verbatim}
  2545.         (setq b 'c)
  2546.         (setq a (+ 1 2))
  2547.         (set  b 4)
  2548. \end{verbatim}}
  2549. yields a = 3 and c = 4.
  2550. \ITEMa{set-x-property}{sets an X property on a client window}
  2551.         
  2552. {\usagefont\begin{verbatim}
  2553. (set-x-property property-name value)
  2554. \end{verbatim}}\usageupspace
  2555. Sets the X11 property of name \verb"property-name" on  the current client
  2556. window.  The value currently must be a STRING (or atom) or an INTEGER\@.  For
  2557. instance, \verb|(window-name "foo")| is equivalent to 
  2558. \verb|(set-x-property "WM_NAME" "foo")|
  2559. This is the recommended way for communicating between {\GWM} and an X 
  2560. application.
  2561. \ITEMa{sort}{sorts a list in place\hfill{\bf EXPERT}}
  2562. {\usagefont\begin{verbatim}
  2563. (sort list comparison-function)
  2564. \end{verbatim}}\usageupspace
  2565. This function sorts (puts in ascending order)
  2566. in place the \verb"list" argument using the ``quicksort''
  2567. algorithm with the user-provided comparison function.
  2568. This function is called on pairs of elements and should return
  2569. \verb"-1", \verb"0" or \verb"1" if its first argument is lower than, equal
  2570. to, or greater than the second.
  2571. This function is flagged as ``{\em Expert}\,'' as it physically modifies the
  2572. list. For instance, to obtain a list of windows sorted by names, do:
  2573. {\exemplefont\begin{verbatim}
  2574.         (sort (list-of-windows) (lambda (w1 w2)
  2575.                 (compare (with (window w1) window-name)
  2576.                          (with (window w2) window-name))))
  2577. \end{verbatim}}
  2578. \ITEMa{stack-print-level}{number of stack frames printed on error}
  2579. \usagetyped{Numeric variable}{number}
  2580. On error, {\WOOL} prints a stack dump. The number of stack frames printed
  2581. is given by the value of this variable. Setting it to a negative number 
  2582. puts no limits on the depth of the dump.
  2583. \ITEMa{state-make}{makes a state of a fsm}
  2584.         
  2585. {\usagefont\begin{verbatim}
  2586. (state-make transition1 transition2 ... transitionN)
  2587. \end{verbatim}}\usageupspace
  2588. Makes a state of a fsm (see \verb"fsm-make" and \verb"on" functions) 
  2589. composed of the
  2590. transitions given in arguments. Returns the constructed state which can be
  2591. affected to a name via \verb"setq" to be used as the destination state in
  2592. transitions.
  2593. If an argument is itself a state, the new state will {\bf include} all the
  2594. transitions in the argument state.
  2595. \ITEMa{sublist}{extracts a sub-list out of a list}
  2596.         
  2597. {\usagefont\begin{verbatim}
  2598. (sublist from to list)
  2599. \end{verbatim}}\usageupspace
  2600. Returns the sublist starting at the from-th element and ending at the to-th
  2601. element of list \verb"list" (both from and to are numbers). \verb"from" is
  2602. inclusive and \verb"to" is exclusive, and if they are greater than the size
  2603. of the list, the elements are set to (). Elements are numbered starting at
  2604. \exemples{Examples:\upspace}{
  2605.                 (sublist 2 4 '(1 2 3 4))&                =={\tt >}  (3 4) \\
  2606.                 (sublist 5 9 ())        &       =={\tt >}       (() () () ()) \\
  2607.                 (sublist 10 -8 '(1 2)) &        =={\tt >} ()\\
  2608. \ITEMa{t}{the logical ``true'' value}
  2609.         
  2610. {\usagefont\begin{verbatim}
  2611. \end{verbatim}}\usageupspace
  2612. The ``true'' value, evaluates to itself.
  2613. \ITEMb{tag}{exit}{non-local goto}
  2614.         
  2615. {\usagefont\begin{verbatim}
  2616. (tag tag-name inst1 inst2 ... instN)
  2617. (exit tag-name inst1 inst2 ... instN)
  2618. \end{verbatim}}\usageupspace
  2619. The pair of functions tag/exit implements a non-local goto.  When \verb"tag"
  2620. is called, the non-evaluated tag-name becomes the label of the goto. The
  2621. instructions are then evaluated in \verb"progn" fashion. If a call to exit
  2622. with the same tag-name (non-evaluated) is made during these instructions, the
  2623. evaluation of the tag instructions is aborted and tag returns the
  2624. evaluation of the instructions of the exit call, evaluated like progn.
  2625. If \verb"exit" makes the flow of control exit from a
  2626. \verb"with" local variable declarations construct, the previous variable
  2627. values are restored.
  2628. {\bf WARNING:} Do not, when in a file being loaded by \see{load} do an
  2629. \verb"exit" with a \verb"tag" set outside the load call --- This breaks
  2630. {\GWM} in the current version.
  2631. \ITEMa{tile}{background pixmap}
  2632.         
  2633. \usagetyped{Variable}{pixmap}
  2634. The value (pixmap) of this global variable is used by the constructors of all
  2635. wobs to set their background pixmap. For now, it is only used in bars and
  2636. screens.
  2637. \ITEMa{together}{combines keyboard modifiers}
  2638.         
  2639. {\usagefont\begin{verbatim}
  2640. (together modifier1 modifier2 ... modifierN)
  2641. \end{verbatim}}\usageupspace
  2642. Used to indicate that the modifiers must be pressed simultaneously, 
  2643. {\exemplefont\begin{verbatim}
  2644.         (button 1 (together with-shift with-alt))
  2645. \end{verbatim}}
  2646. \ITEMb{trace}{trace-level}{traces {\WOOL} function calls}
  2647.         
  2648. \usagetyped{Active values}{\ }
  2649. This is a primitive debugging tool. When the trace value is set to a non-null
  2650. number (or \verb"t") every call to any {\WOOL} function is printed,
  2651. with the arguments and return value.  If set to an expression, this expression
  2652. will be evaluated before and after each list evaluation (Setting
  2653. \verb"trace" to \verb"1" instead of \verb"t" re-enables the evaluation of
  2654. the previous expression).
  2655. The trace level variable holds the
  2656. current indentation (stack depth) of the calls.  You might reset it to 0 if
  2657. you re-enable the tracing after disabling it at a non-0 level.
  2658. {\bf NOTE:} This is a primitive debugging tool, others will be added
  2659. in the future.
  2660. \ITEMa{trigger-error}{triggers a {\WOOL} error}
  2661.         
  2662. {\usagefont\begin{verbatim}
  2663. (trigger-error exprs...)
  2664. \end{verbatim}}\usageupspace
  2665. This will trigger an error, returning instantly to the toplevel (unless trapped
  2666. by a \seeref{error-occurred}). It will issue an error message, 
  2667. print all the given arguments \verb"exprs...", and append a newline.
  2668. \ITEMa{type}{type of a {\WOOL} object}
  2669.         
  2670. {\usagefont\begin{verbatim}
  2671. (type object)
  2672. \end{verbatim}}\usageupspace
  2673. Returns the {\WOOL} type of the object as an atom. Current types are:
  2674. \desctable{Atom}{Description}{
  2675. active & {\WOOL} active value atom \\
  2676. atom & {\WOOL} normal atom \\
  2677. bar & bar descriptor \\
  2678. client & window descriptor \\
  2679. collection & syntax tree node \\
  2680. cursor & X cursor \\
  2681. event & X event \\
  2682. fsm & finite state machine \\
  2683. fsm-state & state of a fsm \\
  2684. subr & built-in function \\
  2685. fsubr & non-evaluating built-in function \\
  2686. expr & user-made function (defun) \\
  2687. fexpr & non-evaluating user function (defunq) \\
  2688. label & active-label \\
  2689. list & {\WOOL} list \\
  2690. menu & menu used in pop-ups \\
  2691. number & number (used for fonts, wobs, colors,\ldots) \\
  2692. pixmap & X pixmap \\
  2693. plug & plug descriptor \\
  2694. pointer & atom pointing to a memory location \\
  2695. quoted-expr & quoted expression \\
  2696. state-arc & transition arc of a fsm state \\
  2697. string & character strings \\
  2698. \ITEMa{unbind}{undefines a symbol}
  2699.         
  2700. {\usagefont\begin{verbatim}
  2701. (unbind atom)
  2702. \end{verbatim}}\usageupspace
  2703. Undefine the (evaluated) atom in argument, so that a \verb"boundp" on it will
  2704. return nil.
  2705. \ITEMa{ungrab-server}{releases grab on the X server}
  2706.         
  2707. {\usagefont\begin{verbatim}
  2708. (ungrab-server [wob])
  2709. \end{verbatim}}\usageupspace
  2710. Ungrabs the server, allowing other client requests to be processed.
  2711. If an argument is given, ungrabs the server only if the argument was the
  2712. last wob to grab the server, otherwise does nothing. With no argument, 
  2713. unconditionally ungrab the server (keyboard and pointer).
  2714. \ITEMa{ungrab-server-and-replay-event}{releases grab on the X server and
  2715. replay grabbing event}
  2716. {\usagefont\begin{verbatim}
  2717. (ungrab-server-and-replay-event flag)
  2718. \end{verbatim}}\usageupspace
  2719. When the X server has been grabbed by a passive grab (a grab set on a
  2720. window by the \verb"grabs" context variable or by the \verb"set-grabs"
  2721. function), you can release the grab and make the X server replay the event
  2722. as if the grab didn't occur by calling this function.
  2723. You must set the \verb"flag" parameter to \verb"()" if the grab was on a
  2724. mouse button, and to a non-nil object if the grab was on a key.
  2725. This call is useful in {\em click to type\/} window managers, to re-send the
  2726. event which changed the current active window to the client window.
  2727. {\bf Note:} An event can only be replayed if it has been grabbed on a
  2728. {\bf replayable} event \seesnp{replayable-event}.
  2729. \ITEMa{unmap-window}{unmaps (make invisible) a window}
  2730.         
  2731. {\usagefont\begin{verbatim}
  2732. (unmap-window [window])
  2733. \end{verbatim}}\usageupspace
  2734. Unmaps (makes invisible) the window (or the current one).
  2735. \ITEMa{unpop-menu}{makes a popped menu disappear}
  2736.         
  2737. {\usagefont\begin{verbatim}
  2738. (unpop-menu [menu])
  2739. \end{verbatim}}\usageupspace
  2740. Removes the grab set by the menu (or menu affected to the current wob if no
  2741. argument is given) and unmaps it. The {\tt menu} argument can be either a
  2742. menu (as returned by the \verb"menu-make" function) or a wob (as provided by
  2743. the \verb"wob" active-value). This function synchronize {\GWM} with the
  2744. server, so the menu is guaranteed to be unmapped when it returns.
  2745. {\bf Warning:} The current-wob is not changed by this function. The wob
  2746. which triggered the menu can be accessed as the parent of the menu.
  2747. \ITEMa{user-event}{events internal to {\GWM}}
  2748.         
  2749. {\usagefont\begin{verbatim}
  2750. (user-event atom)
  2751. \end{verbatim}}\usageupspace
  2752. This function is used in transitions to match user-events of the given
  2753. (evaluated) atom (see \verb"send-user-event").
  2754. Example:
  2755. {\exemplefont\upspace\begin{verbatim}
  2756.         (on (user-event 'get-focus) (set-pixmap focus-pattern))
  2757. \end{verbatim}}
  2758. \ITEMc{visibility-fully-obscured}{visibility-partially-obscured}{visibility-unobscured}{events sent when window visibility changes}
  2759. \usagetyped{Constants}{event}
  2760. This events are sent to a window when its visibility changes, e.g.\ 
  2761. when it gets obscured by moving another window on top of it.
  2762. \ITEMa{warp-pointer}{warps the mouse pointer to a location\hfill{\bf EXPERT}}
  2763. {\usagefont\begin{verbatim}
  2764. (warp-pointer x y [window-relative-to])
  2765. \end{verbatim}}\usageupspace
  2766. Warps (sets) the mouse pointer to the position \verb"(x,y)", relative to
  2767. its current position if no third argument is given, or in the
  2768. coordinates of the given \verb"window-relative-to" if given.
  2769. For instance, to warp the pointer to the next screen at the same relative
  2770. location say:
  2771. {\exemplefont\begin{verbatim}
  2772.         (setq coordinates (current-mouse-position))
  2773.         (setq screen (% (+ (# 3 coordinates) 1) screen-count))
  2774.         (warp-pointer (# 0 coordinates) (# 1 coordinates) root-window)
  2775. \end{verbatim}}
  2776. {\bf WARNING:} Use this function just like you would use ``goto'' in
  2777. normal programming: never. \verb"warp-pointer" will ruin a window management policy
  2778. just as easily as  ``goto''s will ruin a program.
  2779. \ITEMa{while}{while loop}
  2780.         
  2781. {\usagefont\begin{verbatim}
  2782. (while condition inst1 inst2 ... instN)
  2783. \end{verbatim}}\usageupspace
  2784. Executes the N instructions in sequence until condition becomes ().  Returns
  2785. always ().      
  2786. \ITEMa{window}{current window id}
  2787.         
  2788. \usagetyped{Active value}{window id}
  2789. Returns or sets the descriptor of the current window as a {\WOOL} number. The
  2790. current window is the default for all window functions. Setting window
  2791. to a value sets also the current wob to this window.
  2792. {\bf WARNING:} A \verb"(with (window w)...)" call will modify the value of
  2793. the current wob:
  2794. {\exemplefont\begin{verbatim}
  2795.                                          ; window is A, wob is B
  2796.         (with (window C) (foo))          ; in foo, window is C, wob is C
  2797.                                          ; window is A, wob is A
  2798. \end{verbatim}}
  2799. So, if you want the previous call not to modify \verb"wob", do a 
  2800. \verb"(with (wob w)...)" call instead. The same remark holds for the 
  2801. \verb"screen" active value: a \verb"(with (screen s)...)" will set the value
  2802. of {\tt window} and {\tt wob} to the value of {\tt screen} before the 
  2803. {\tt with} call.
  2804. \ITEMa{window-client-class}{client application class}
  2805.         
  2806. \usagetyped{Active value}{string}
  2807. Returns a string containing the class of the client owning the window,
  2808. e.g., {\bf XTerm} for an xterm window.
  2809. \ITEMe{window-client-height}{window-client-width}{window-client-x}{window-client-y}{window-client-borderwidth}{inner window geometry in pixels}
  2810.         
  2811. \usagetyped{Active value}{number --- not settable}
  2812. Returns the dimensions in pixels of the client window, its position
  2813. inside the {\GWM} window frame, and the borderwidth of the client
  2814. window (i.e.\ the inner-borderwidth of the decorated window).
  2815. \ITEMa{window-client-name}{client application name}
  2816.         
  2817. \usagetyped{Active value}{string}
  2818. Returns a string containing the name of the client owning the window, e.g.,
  2819. {\bf xterm} for an xterm window.
  2820. \ITEMa{window-group}{manages groups of windows}
  2821.         
  2822. \usagetyped{Active value}{window id}
  2823. In X11, windows can be grouped with each window in the group bearing a
  2824. reference to a distinguished window, the {\em group leader}. {\GWM}
  2825. maintains such groups as a list of windows, the group leader being the first
  2826. one in the list. This active value returns () if the window does not belong
  2827. to a group, otherwise it returns 
  2828. the list of windows in the group.
  2829. The user can himself define groups of windows by setting the
  2830. \verb"window-group" active value to a window id, which is the group leader
  2831. to which the window should be grouped. The entire group (list) can also be
  2832. passed as argument, in which case the first element is taken as
  2833. the window to be grouped to.
  2834. To remove a window from a group, just assign \verb"()" to
  2835. \verb"window-group" for this window, it is removed from the group it
  2836. was in. If the window was a group leader, the group is broken and all
  2837. the windows in it are ungrouped.
  2838. {\bf Note:}  A window can only belong to one group.
  2839. \ITEMa{window-icon}{icon associated to window}
  2840.         
  2841. \usagetyped{Active value}{window id --- not settable}
  2842. Returns the icon associated with the current window. If the current window
  2843. is already an icon, returns the current window itself.
  2844. {\bf Note:} When {\GWM} decorates a window, it caches the {\WOOL}
  2845. description given for the icon, but does not create it. The icon is
  2846. physically created, (and its \verb"opening" field evaluated) on the first
  2847. access to the \verb"window-icon" active value or the first call to the
  2848. \see{iconify-window} function. To just check that the window has an associated
  2849. icon, without creating it if it didn't exist, use \verb|window-icon?|.
  2850. \ITEMa{window-icon?}{tests if icon has already been created}
  2851. {\usagefont\begin{verbatim}
  2852. (window-icon? [window])
  2853. \end{verbatim}}\usageupspace
  2854. Returns \verb|t| if the icon has already been created, \verb|()| if not,
  2855. without creating it.
  2856. \ITEMa{window-icon-name}{name of the icon}
  2857.         
  2858. \usagetyped{Active value}{string --- not settable}
  2859. Returns the name that the client of the current window has given to its icon.
  2860. \ITEMa{window-icon-pixmap}{pixmap to be used in icon}
  2861.         
  2862. \usagetyped{Active value}{pixmap --- not settable}
  2863. Returns the pixmap given as a hint by the current client to be used in its
  2864. icon, or () if no pixmap was specified. The bitmap specified by the
  2865. application is used to construct the returned pixmap by painting the unset
  2866. pixels with the \verb"background" color and the set pixels with the
  2867. \verb"foreground" color on the invocation of this function for each window.
  2868. Thus each time it is called a new pixmap is created. It is highly
  2869. recommended that you store the returned value instead of re-calling the
  2870. function another time.
  2871. Use it as the \verb"plug" argument of the \verb"window-make" function after
  2872. making a plug via \verb"plug-make".
  2873. \ITEMa{window-icon-pixmap-change}{pixmap to be used in icon has changed}
  2874.         
  2875. \usagetyped{Constant}{event}
  2876. When an application changes its pixmap to be used as its icon, this event is
  2877. generated. You should then use the \verb"window-icon-pixmap" function to
  2878. retrieve it if your icon style supports it.
  2879. \ITEMa{window-icon-pixmap-id}{X id of pixmap to be used in icon}
  2880.         
  2881. \usagetyped{Active value}{number --- not settable}
  2882. This id is used to know which bitmap the client provided, and if it has
  2883. changed since last time.
  2884. \ITEMa{window-icon-window}{window to be used as icon}
  2885.         
  2886. \usagetyped{Active value}{window id --- not settable}
  2887. Returns a descriptor (number) of the window provided by the current client
  2888. to be used as its icon, or () otherwise. Should {\em only\/} be used as the
  2889. \verb"plug" argument of the \verb"window-make" function.
  2890. \ITEMa{window-is-mapped}{tells if window is visible}
  2891.         
  2892. \usagetyped{Active value}{boolean --- not settable}
  2893. If the current window is mapped (visible) returns it, () otherwise.
  2894. \ITEMa{window-is-shaped}{tells if window has a non-rectangular shape}
  2895.         
  2896. \usagetyped{Active value}{boolean --- not settable}
  2897. If the current client window has a non-rectangular outline (on servers
  2898. supporting the {\bf shape} X11 extension), returns \verb"t", \verb"()"
  2899. otherwise.
  2900. \ITEMa{window-is-transient-for}{tells if window is transient}
  2901.         
  2902. \usagetyped{Active value}{window --- not settable}
  2903. If not (), the window is transient for another window, and thus you might
  2904. decide not to decorate it too much. (The window it is transient for is
  2905. returned.)
  2906. \ITEMb{window-is-valid}{wob-is-valid}{tests if gwm window ID is still valid}
  2907. {\usagefont\begin{verbatim}
  2908. (window-is-valid window)
  2909. (wob-is-valid wob)
  2910. \end{verbatim}}\usageupspace
  2911. Since in {\GWM}, windows and wobs are represented by reference, i.e.\ by
  2912. numbers meaning a pointer to some data, there is the risk of ``dangling
  2913. pointers'', i.e.\ accessing a memory containing a no longer valid window. To
  2914. test for these cases, two functions are provided. \verb|wob-is-valid| will
  2915. test if \verb|wob| is any valid (non closed) plug, bar, menu , window, icon,
  2916. or root window, whereas \verb|window-is-valid| will verify that \verb|window|
  2917. is actually only a window or icon. These functions are not strictly necessary,
  2918. but are useful for debugging purposes.
  2919. \ITEMa{window-machine-name}{name of host on which the client is running}
  2920.         
  2921. \usagetyped{Active value}{string --- not settable}
  2922. Returns the string containing the name of the machine on which the client
  2923. owning the window executes (Defaults to \verb|"machine"| if not set.)
  2924. \ITEMa{window-make}{makes a template to decorate a window with}
  2925.         
  2926. {\usagefont\begin{verbatim}
  2927. (window-make titlebar leftbar rightbar basebar plug)
  2928. \end{verbatim}}\usageupspace
  2929. \centerline{\texpsfig{window.id}{211}{154}}
  2930. Returns a description of a {\GWM} window to decorate a newly created X
  2931. window. This is also used to describe the associated icon and the screen.
  2932. The four bars are the ones that frame the client and are evaluated
  2933. another time when the window is physically created. This allows you to give
  2934. expressions for bars (quoted to evade the first evaluation of arguments of
  2935. the \verb"window-make" function itself) which evaluates to a bar on the
  2936. realization of the wob.  Any bar can be set to (), indicating that that no
  2937. corresponding bar should be created.
  2938. The fifth argument \verb"plug" is only used when describing an icon, 
  2939. to be used as the central window
  2940. around which the bars will be framed. You can give a plug (or an expression
  2941. which when evaluated gives a plug) or the value of
  2942. \verb"window-icon-window" for the window. 
  2943. If set to (), the icon has
  2944. the dimension of the longest side bar, or if they are also set to (), the
  2945. dimension of the longest top or base bar.
  2946. \centerline{\texpsfig{icons.id}{236}{91}}
  2947. \context{
  2948.      fsm &  the fsm of the window \\
  2949.      borderwidth & the width of its border \\
  2950.      borderpixel & the color of its border \\
  2951.      bordertile &  the pixmap tiling its border \\
  2952.      inner-borderwidth & the border width of the client window \\
  2953.      menu &  the default menu associated to the window \\
  2954.      cursor & the shape of the cursor when in the window 
  2955.  (in fact in the border, which is the only visible part) \\
  2956.      property &  the initial value of the property field \\
  2957.      grabs & events grabbed from all sons of the window\\
  2958.      opening & {\WOOL} code evaluated on the creation of the window\\
  2959.      closing & {\WOOL} code evaluated on the destruction of the window\\
  2960. \verb"grabs" is a list of \verb"button", \verb"buttonpress", \verb"key" or
  2961. \verb"keypress"  events which will be ``grabbed'' from the client window to
  2962. be sent to the {\GWM} window. This means that the event will be sent
  2963. directly to the {\GWM} window and {\bf not} to the client window.  For
  2964. instance, to implement a ``uwm'' move style (moving a window on
  2965. Alternate/right button anywhere in the window), the grab list should include
  2966. a \verb"(buttonpress 3 with-alt)", and the fsm of the window should have a
  2967. \verb"(on (buttonpress 3 with-alt) (move-window))" transition.
  2968. Events declared in the \verb"grabs" list are trapped on the whole surface of
  2969. the window, including the bars and the client window, and redirected to the
  2970. main window's fsm.
  2971. \verb"opening" and \verb"closing" are two Lisp expressions that are
  2972. evaluated when the window (or icon) is created and destroyed respectively,
  2973. just before being mapped or unmapped. This is the right place to position or
  2974. resize the window before it appears. For the screen, opening is evaluated
  2975. once all windows already on screen have been framed and closing is evaluated
  2976. when leaving {\GWM}.
  2977. When used for screen description, no arguments are used, only the context
  2978. values for grabs, opening, closing, fsm, menu, cursor, and property context
  2979. variables, with the additional context value:
  2980. \context{
  2981.             tile        & tiling the screen with a pixmap (if set
  2982.                                 to a pixmap) or defining the screen color
  2983.                                 (if set to a color). () means do not change
  2984.                                 the screen background. \\
  2985. \ITEMa{window-name}{name of the window}
  2986.         
  2987. \usagetyped{Active value}{string}
  2988. Returns the string containing the name of the window, as set by the client
  2989. owning it. Note that it is a transient property, and the event
  2990. \verb"name-change" is issued when it is changed by the client.  
  2991. When \verb"window-name" is set, the \verb|WM_NAME| X property on the
  2992. client window is updated accordingly, resulting in the X \verb"name-change"
  2993. event to be sent to the window by the X server.
  2994. {\bf Note:} All dots in the name are converted to underscores, so that you
  2995. can use the value of \verb"window-name" safely as an name for the X resource
  2996. manager.
  2997. \ITEMb{window-property}{wob-property}{{\WOOL} property associated to a wob}
  2998.         
  2999. \usagetype{Active value}
  3000. To each wob is associated a property, which is any Lisp object given by the
  3001. user. These active values return or set the stored property for the
  3002. current wob or window. When
  3003. creating a wob, the property is taken as the current value of the global
  3004. variable \verb"property".
  3005. \ITEMa{window-size}{client window size specified in resize increments}
  3006.         
  3007. \usagetyped{Active value}{list of two numbers}
  3008. Returns the size of the window expressed as a list of two numbers,
  3009. multiples of the minimal size (e.g.\ character positions for xterm).  When
  3010. set, the window is resized accordingly. This is the size of the inner
  3011. client window, to specify the outer dimensions, use \verb"resize-window".
  3012. \ITEMa{window-starts-iconic}{state in which window must first appear}
  3013.         
  3014. \usagetyped{Active value}{boolean}
  3015. If not (), the window appears as an icon on its first mapping or the
  3016. first time it is decorated by {\GWM}. This ``hint'' can thus be set either
  3017. by the application or the window manager.
  3018. \ITEMb{window-status}{wob-status}{state of the window}
  3019.         
  3020. \usagetyped{Active value}{atom --- not settable}
  3021. Returns the type of the current wob or window as an ATOM\@. Possible types
  3022. \desctable{Atom}{type of wob}{
  3023. window & main window around a client \\
  3024. icon & icon of a window \\
  3025. menu    &       menu created with \verb"menu-make" \\
  3026. root            &the root window \\
  3027. bar     &       a bar \\
  3028. plug &          a plug \\
  3029. Thus, to check if the current window is an icon, just say:
  3030. {\exemplefont\begin{verbatim} 
  3031.         (if (= window-status 'icon) ...)
  3032. \end{verbatim}}
  3033. \ITEMb{window-user-set-position}{window-user-set-size}{tells if user
  3034. explicitly specified the geometry}
  3035.         
  3036. \usagetyped{Active value}{boolean --- not settable}
  3037. Return \verb"t" if the position or size of the current window was set
  3038. explicitly by the user at creation time via command line switches, ()
  3039. otherwise. If called on an icon, tells if the user defined the initial icon
  3040. position.
  3041. \ITEMb{window-program-set-position}{window-program-set-size}{tells if program
  3042. explicitly specified the geometry}
  3043.         
  3044. \usagetyped{Active value}{boolean --- not settable}
  3045. Return \verb"t" if the position or size of the current window was set
  3046. by default by the program.
  3047. \ITEMb{window-to-client}{client-to-window}{client window Xid to Gwm wob
  3048. conversions}
  3049. {\usagefont\begin{verbatim}
  3050. (window-to-client gwm-window)
  3051. (client-to-window X-window-id)
  3052. \end{verbatim}}\usageupspace
  3053. Converts {\GWM} windows \verb|gwm-window| to and from actual decorated client
  3054. window Ids \verb|X-window-id| (numbers used by ``\verb|xwininfo|'' for
  3055. instance).
  3056. \ITEMa{window-was-on-screen}{tells if window was already on screen}
  3057.         
  3058. \usagetyped{Active value}{boolean --- not settable}
  3059. Returns \verb"t" if the window was already on the screen before {\GWM}.  You may test
  3060. its value to do certain actions only on newly created windows (if ()), such
  3061. as interactive placement.
  3062. \ITEMd{window-width}{window-height}{wob-height}{wob-width}{window dimensions in pixels}
  3063.         
  3064. \usagetyped{Active value}{number --- not settable}
  3065. These functions return the size of the current window (with decoration) or
  3066. wob in pixels.  These do not include the width of the border, following the
  3067. X11 conventions.
  3068. \ITEMa{window-window}{main window associated with an icon}
  3069.         
  3070. \usagetyped{Active value}{window id --- not settable}
  3071. Returns the window associated with the current window if it is an icon. If
  3072. the current window is not an icon, returns the current window itself.
  3073. \ITEMa{window-wm-state}{the WM\_STATE of a window}
  3074.         
  3075. \usagetyped{Active value}{atom --- not settable}
  3076. Returns an atom indicating which state the window is in, according to
  3077. the \verb"WM_STATE" property. The state of the window can be:
  3078. \begin{tabular}{|l|c|c|}
  3079. \hline
  3080. \vbox{\hbox{window}\hbox{icon}} & mapped & unmapped \\
  3081. \hline
  3082. mapped & {\bf normal} & {\bf iconic} \\
  3083. \hline
  3084. unmapped & {\bf normal} & {\bf withdrawn} \\
  3085. \hline
  3086. \end{tabular}
  3087. The atom \verb"window" is returned if the window is in the normal
  3088. state, the atom \verb"icon" is returned if it is iconic, and \verb|()|
  3089. is returned if it is withdrawn.
  3090. This state information is used by session managers and other window
  3091. managers, for instance {\GWM} itself will re-iconify the windows that were
  3092. previously iconified on a restart.
  3093. \ITEMa{window-wm-state-icon}{declares user icon for WM\_STATE}
  3094.         
  3095. \usagetyped{Active value}{window id}
  3096. {\GWM} manages automatically the \verb"WM_STATE" property on client windows.
  3097. However, if you implement in a {\WOOL} package your own icons which are not
  3098. the {\GWM} ones, which are managed by the 
  3099. \verb"window-icon" and \verb"iconify-window"
  3100. primitives, for instance by creating a window via the \verb"place-menu"
  3101. primitive, you need to declare which window must logically be
  3102. considered as the icon for your window. This is done by setting the
  3103. \verb"window-wm-state-icon" on the window to the icon.
  3104. Once you have declared that a window has a user-managed icon, {\GWM} no
  3105. longer updates the \verb"WM_STATE" property, so you should call
  3106. \verb"window-wm-state-update" each time you change the state of the window
  3107. \ITEMa{window-wm-state-update}{updates WM\_STATE property for windows with user icon}
  3108. {\usagefont\begin{verbatim}
  3109. (window-wm-state-update [state])
  3110. \end{verbatim}}\usageupspace
  3111. Once you have declared that a window has a user-managed icon, you should
  3112. update the \verb"WM_STATE" property by calling this function with the
  3113. \verb"window" global variable set to the managed window each time the state
  3114. of the window changes.
  3115. An optional argument \verb"window", \verb"icon" or \verb|()| forces
  3116. the \verb"WM_STATE" property to be set to {\bf normal}, {\bf iconic}
  3117. or {\bf withdrawn} respectively. This can be useful for example if
  3118. ``iconifying'' is done by unmapping the window.
  3119. \ITEMb{window-x}{window-y}{position of upper-left corner of window in root coordinates}
  3120.         
  3121. \usagetyped{Active value}{number --- not settable}
  3122. These functions return the coordinates of the upper-left corner of the
  3123. current window, including its decoration, in the root window. 
  3124. \ITEMb{with}{with-eval}{local variable declaration}
  3125.         
  3126. {\usagefont\begin{verbatim}
  3127. (with (var1 value1 ... varN valueN) instructions ...)
  3128. (with context instructions ...)
  3129. (with-eval expression instructions ...)
  3130. \end{verbatim}}\usageupspace
  3131. This is the construct used to declare and initialize variables local to a
  3132. group of instructions. Active-values and functions are handled as expected,
  3133. resetting their initial value after the execution of the body of the with.
  3134. The values are evaluated sequentially.
  3135. A context is a list of variables and associated values that can be re-used
  3136. in many \verb"with" functions (see \verb"context-save").
  3137. \verb"with-eval" first evaluates the expression and then uses it as a
  3138. context, so that the two following calls are equivalent:
  3139. {\exemplefont\begin{verbatim}
  3140.         (with (a 1 b 2) c)
  3141.         (with (+ '(a 1) '(b 2)) c)
  3142. \end{verbatim}}
  3143. Due to the structure of the {\WOOL} interpreter, \verb"with" works also with
  3144. \verb"active-values" and functions. 
  3145. For example the following call can be made to
  3146. move the window ``my-window'' in the upper left corner of the screen.
  3147. {\exemplefont\begin{verbatim}
  3148.         (with (window my-window move-ul (lambda () (move-window 0 0)))
  3149.                 (move-ul))
  3150. \end{verbatim}} 
  3151. Example: {\exemplefont\upspace\begin{verbatim}
  3152.         (setq bluegreen '(foreground green background blue))
  3153.         (with bluegreen (pixmap-make "Bull"))
  3154.         (with (a 2 b (+ a 1)) (print b))        ==>     3
  3155. \end{verbatim}}
  3156. \ITEMf{with-shift}
  3157.         {with-control}
  3158.         {with-alt}
  3159.         {with-lock}
  3160.         {with-modifier-N}
  3161.         {with-button-N}{modifier states}
  3162.         
  3163. \usagetyped{Constants}{number}
  3164. These numerical values describe what was in a ``down'' state (i.e., pressed)
  3165. when a key or button event was sent. You can combine them with the
  3166. \verb"together" function, for instance if you want shift {\bf and} control 
  3167. pressed.
  3168. {\bf N} can takes values 2 to 5 for modifiers and 1 to 5 for buttons, e.g.,
  3169. the \verb"with-modifier-5" and \verb"with-button-1" variables are defined.
  3170. \ITEMa{wob}{current wob}
  3171.         
  3172. \usagetyped{Active value}{wob id}
  3173. Returns the descriptor of the current wob (i.e., the wob which received the
  3174. event being processed) as a {\WOOL} number.  The current wob is the default for
  3175. all wob functions.  When set, the current wob is now the wob argument.
  3176. \ITEMa{wob-at-coords}{wob containing coordinates}
  3177. {\usagefont\begin{verbatim}
  3178. (wob-at-coords x y)
  3179. \end{verbatim}}\usageupspace
  3180. Returns the wob including the coordinates relative to the root. Returns () if
  3181. coordinates were off-screen.
  3182. \ITEMa{wob-background}{(solid) background color of wob}
  3183.         
  3184. \usagetyped{Active value}{color}
  3185. Returns or sets the (solid) background color of the wob. If set, discards the
  3186. tile of the wob (if there was one) to paint its background with a solid color.
  3187. Works only with bars and screens.
  3188. \ITEMa{wob-borderpixel}{color of border}
  3189.         
  3190. \usagetyped{Active value}{color or pixmap}
  3191. Get or set the solid color or pixmap of the border of the current wob.
  3192. \ITEMa{wob-borderwidth}{width of the border of a wob}
  3193.         
  3194. \usagetyped{Active value}{number}
  3195. Gets or sets the width in pixels of the border of the current wob.  If it is in
  3196. a composite wob, the father is then resized.
  3197. \ITEMa{wob-cursor}{cursor displayed when pointer is in a wob}
  3198. \usagetyped{Active value}{cursor}
  3199. This active value allows the user to get or modify the mouse cursor which
  3200. is displayed when the pointer is in the current wob.
  3201. \ITEMa{wob-fsm}{gets or sets the fsm associated with current wob}
  3202.         
  3203. \usagetyped{Active value}{fsm}
  3204. This active value allows the user to get or  modify the fsm associated with
  3205. a wob.  If you set the fsm of a wob, it is placed in the initial state.
  3206. This function is intended for debugging purposes, and its use should be
  3207. avoided in normal operation. Try using multiple-state fsms instead of
  3208. changing the fsm.
  3209. \ITEMa{wob-invert}{quick and dirty inversion of a wob}
  3210.         
  3211. {\usagefont\begin{verbatim}
  3212. (wob-invert)
  3213. \end{verbatim}}\usageupspace
  3214. Inverts the colors over the surface of the
  3215. current wob. This is just drawn on top of everything
  3216. else, and does not affect permanently the wob. This should only be used after
  3217. calling \verb"grab-server" and then \verb"process-exposes"
  3218. (Note that \verb"pop-menu" does that for you).
  3219. This is a ``lightweight'' function to be used on transient objects.
  3220. To invert a wob in a cleaner way, use \see{wob-tile}.
  3221. The wob is inverted by using the \verb"invert-color" color (screen relative).
  3222. This color should be chosen to be the {\bf bitwise-xor}ing of two colors
  3223. that will be inverted by this functions, the other colors being affected
  3224. in an unpredictable way.
  3225. \ITEMa{wob-menu}{gets or sets the menu associated with current wob}
  3226.         
  3227. \usagetyped{Active value}{menu}
  3228. This active value allows the user to get or 
  3229. modify the menu associated with a wob.
  3230. \ITEMa{wob-parent}{finds the parent of a wob}
  3231.         
  3232. \usagetyped{Active value}{wob id --- not settable}
  3233. Returns the parent of the current wob.  Note that the parent of a pop-up is
  3234. the wob which called the \verb"pop-menu" function. The parent of windows and
  3235. icons is the root window itself, and the parent of a root window is {\bf nil}.
  3236. \ITEMb{wob-tile}{wob-pixmap}{graphic displayed in a wob}
  3237.         
  3238. \usagetyped{Active value}{pixmap}
  3239. Returns or sets what is the current wob's pixmap background. For the screen
  3240. itself or a bar, this is its background tile; for a plug this is
  3241. the pixmap around which the plug is built. If you change the size of the
  3242. \verb"wob-tile" for a plug, it is automatically resized (but not a bar
  3243. or a screen). \verb"wob-pixmap" is just a synonym for \verb"wob-tile"
  3244. for backward compatibility purposes.
  3245. \ITEMb{wob-x}{wob-y}{absolute screen position in pixels of current wob}
  3246. \usagetyped{Active values}{wob id --- not settable}
  3247. Returns the position of the top left corner of the wob, including its border
  3248. as absolute pixel coordinates in its screen.
  3249. \ITEMa{xid-to-wob}{translates X ID to wob object}
  3250.         
  3251. {\usagefont\begin{verbatim}
  3252. (xid-to-wob id)
  3253. \end{verbatim}}\usageupspace
  3254. Returns the wob whose associated X window has the X ID \verb|id|. If no wob if
  3255. found, returns \verb|()|. The X ID is the identification of windows used by
  3256. all standard X tools such as {\sc xwininfo}.
  3257.