annotate oldXMenu/Activate.c @ 47576:b31c8ab7336a

Sync with version 2.0.20. Lengthy ChangeLog follows: 2002-09-22 Kai Gro?ohann <grossjoh@ls6.informatik.uni-dortmund.de> Version 2.0.20 released. 2002-09-20 Kai Gro?ohann <grossjoh@ls6.informatik.uni-dortmund.de> * net/tramp.el (tramp-completion-function-alist): Escape open paren in docstring. (tramp-user-regexp, tramp-host-regexp): Allow empty strings. (tramp-handle-insert-file-contents): Call tramp-message-for-buffer instead of tramp-message. (tramp-open-connection-rsh): Handle empty string as user name. (tramp-open-connection-su): Handle empty string as host name. Handle nil user name. (tramp-handle-file-local-copy, tramp-handle-write-region) (tramp-completion-handle-file-name-all-completions) (tramp-open-connection-telnet, tramp-open-connection-rsh) (tramp-open-connection-su, tramp-post-connection) (tramp-maybe-open-connection, tramp-method-out-of-band-p) (tramp-get-connection-function, tramp-get-remote-sh) (tramp-get-rsh-program, tramp-get-rsh-args) (tramp-get-rcp-program, tramp-get-rcp-args) (tramp-get-rcp-keep-date-arg, tramp-get-su-program) (tramp-get-su-args, tramp-get-telnet-program) (tramp-get-telnet-args): Use `tramp-find-method', perhaps require additional args USER, HOST. (tramp-action-password, tramp-open-connection-telnet) (tramp-open-connection-su, tramp-open-connection-multi) (tramp-method-out-of-band-p): `tramp-method-out-of-band-p' now takes USER and HOST arguments, to be able to use `tramp-find-method'. Update callers. (tramp-find-method): New function. 2002-09-20 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-handle-insert-directory): Handle "--dired" in SWITCHES (by removing it). 2002-09-18 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-file-name-handler): Add `file-remote-p' property. 2002-09-17 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (top-level): Maybe autoload uudecode-decode-region. 2002-09-16 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-bug): Add tramp-methods. 2002-09-16 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-methods): Update docstring: tramp-encoding-command, tramp-decoding-command, tramp-encoding-function and tramp-decoding-function are not parameters anymore. (tramp-uuencode-region): Autoload it. 2002-09-13 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> Version 2.0.19 released. * net/tramp-uu.el: New file, implements uuencode in Lisp. * net/tramp.el (tramp-coding-commands): Use `tramp-uuencode-region' as local encoder for the uuencode based entries. 2002-09-13 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-handle-write-region): Wrong parens. 2002-09-13 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> Version 2.0.18 released. * net/tramp.el (tramp-perl-decode): Perl changes to accomodate older versions of Perl. Now tested with 5.004. Suggestion from Michael Albinus. 2002-09-12 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-find-inline-encoding): Call tramp-call-local-coding-command with nil for INPUT and OUTPUT. (tramp-call-local-coding-command): OUTPUT equals nil means to discard the output. INPUT equals nil means /dev/null. 2002-09-12 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-encoding-shell): Default to environment variable COMSPEC on Windows. (tramp-handle-write-region): More debugging output. (tramp-find-inline-encoding): Ditto. 2002-09-11 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-completion-handle-file-name-all-completions): Define `result1'. (tramp-parse-hosts-group): Discard IPv6 entries. 2002-09-11 Kai Gro?ohann <grossjoh@ls6.informatik.uni-dortmund.de> * net/tramp.el (tramp-post-connection): Only send Perl mime-encode/decode implementations when using inline method. (tramp-handle-file-local-copy) (tramp-handle-write-region, tramp-post-connection) (tramp-coding-commands, tramp-find-inline-encoding): For the inline encodings, distinguish between local and remote commands, instead of between commands and functions. (The local commands can be functions, too.) If the local host is a Windows machine, we can't expect the same commands to work there as on the remote host. (tramp-call-local-coding-command): New function for calling local encoding and decoding commands. (tramp-set-remote-encoding, tramp-get-remote-encoding) (tramp-set-remote-decoding, tramp-get-remote-decoding) (tramp-set-local-encoding, tramp-get-local-encoding) (tramp-set-local-decoding, tramp-get-local-decoding): New functions. (tramp-get-encoding-command, tramp-set-encoding-command) (tramp-get-decoding-command, tramp-set-decoding-command) (tramp-get-encoding-function, tramp-set-encoding-function) (tramp-get-decoding-function, tramp-set-decoding-function): Old functions, removed. 2002-09-10 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-open-connection-setup-interactive-shell): Change command to invoke /bin/sh slightly to make it compatible with the `rc' shell. Suggested by Daniel Pittman. 2002-09-10 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-handle-write-region): Added missing `)'. Hope it's the right place. 2002-09-09 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-open-connection-setup-interactive-shell): Do "exec env PS1='$ ' /bin/sh" instead of just "exec /bin/sh" in order to get a sane shell prompt. If people have ${CWD}, say, in their shell prompt, then the default login shell might display something harmless, but the /bin/sh will display a dollar sign which confused the subsequent prompt recognition. (tramp-multi-action-password): More debugging output. (tramp-encoding-shell): Renamed from tramp-sh-program. More documentation. Default to cmd.exe on Windows NT. (tramp-encoding-command-switch): New variable. Use instead of hard-wired "-c" which is only good for /bin/sh. (tramp-encoding-reads-stdin): New variable. If t, commands are called like "/bin/sh -c COMMAND <INPUT", if nil, they are called like "/bin/sh -c COMMAND INPUT", ie the input file is the last argument. (tramp-multi-sh-program): Always default to tramp-encoding-shell. (tramp-handle-file-local-copy, tramp-handle-write-region): Respect tramp-encoding-shell and friends. (tramp-find-inline-encoding): Use new-style calls for checking if the local commands work. 2002-09-07 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-methods): Remove `tramp-completion-function' entries. They are handled now by `tramp-completion-function-alist'. (tramp-completion-function): Defvar removed. I've never used it. Hmm. (tramp-get-completion-function) (tramp-get-completion-rsh, tramp-get-completion-ssh) (tramp-get-completion-telnet, tramp-get-completion-su): Functions removed as well. Not necessary any longer due to extended customization means. (tramp-completion-function-alist): New defcustom. Holds all FUNCTION FILE pairs used for user and host name completion relevant for METHOD. (tramp-completion-function-alist-rsh) (tramp-completion-function-alist-ssh) (tramp-completion-function-alist-telnet) (tramp-completion-function-alist-su): Defconst for initializing `tramp-completion-function-alist'. Unfortunately, mainly UNIX-like values are known for me until now. Needs to be completed for at least VMS++ like operating systems. (tramp-set-completion-function) (tramp-get-completion-function): New functions for configuration of `tramp-completion-function-alist'. The old definition of `tramp-get-completion-function' has been discarded. (tramp-completion-handle-file-name-all-completions): Change function call for user/host completion according to definition in `tramp-completion-function-alist'. (tramp-parse-passwd): Added exception handling for "root", because `tramp-get-completion-su' (the previous place for this stuff) doesn't exist any longer. 2002-09-07 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-enter-password): Use `tramp-password-end-of-line' to terminate the line. (tramp-bug): Include new variable `tramp-password-end-of-line'. (tramp-password-end-of-line): New variable. People who use plink under Windows might have to issue "\r\n" after the password, but they need to send just "\n" after the other commands. So this variable was introduced to complement `tramp-rsh-end-of-line'. (tramp-wait-for-output, tramp-post-connection): Allow "\r" at end of line of the output delimiter. 2002-09-06 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-handle-file-local-copy, tramp-find-shell) (tramp-open-connection-setup-interactive-shell): Add some comments about Douglas Grey Stephen's suggestions to make Tramp work better with plink under Windows. I'm not sure what to think of them, but now I have a guinea pig to try it out on. Said guinea pig is having other problems, though... Also remove some commented-out code. 2002-09-06 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-get-completion-methods): Algorithm slightly tuned. (tramp-get-completion-user-host): Accept user names as they are if typed until "@". (tramp-completion-mode): Replace `last-input-char' by modern `last-input-event'. Check for `event-modifiers'. 2002-09-06 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (file-expand-wildcards): Corrected check to see if advising is necessary. 2002-09-05 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-postfix-single-method-format) (tramp-postfix-multi-method-format) (tramp-postfix-multi-hop-format) (tramp-postfix-user-format): New format strings. (tramp-postfix-single-method-regexp) (tramp-postfix-multi-method-regexp) (tramp-postfix-multi-hop-regexp) (tramp-postfix-user-regexp) (tramp-make-multi-tramp-file-format) (tramp-make-tramp-file-name): Apply them. (tramp-completion-handle-file-name-all-completions): Fix for invoking ange-ftp in case of "/ftp:xxx" file names. 2002-09-04 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-prefix-format) (tramp-postfix-host-format): New format strings. (tramp-prefix-regexp, tramp-method-regexp) (tramp-postfix-single-method-regexp) (tramp-postfix-multi-method-regexp) (tramp-postfix-multi-hop-regexp) (tramp-user-regexp, tramp-postfix-user-regexp) (tramp-host-regexp, tramp-postfix-host-regexp) (tramp-path-regexp): New atomar regular expressions. If corresponding format strings exist, derived from them. (tramp-file-name-structure) (tramp-multi-file-name-structure) (tramp-multi-file-name-hop-structure) (tramp-make-multi-tramp-file-format) (tramp-completion-mode) (tramp-completion-dissect-file-name) (tramp-parse-rhosts-group) (tramp-parse-shosts-group) (tramp-parse-hosts-group) (tramp-parse-passwd-group): Apply these expressions. (tramp-file-name-structure-unified) (tramp-file-name-structure-separate) (tramp-make-tramp-file-format-unified) (tramp-make-tramp-file-format-separate) (tramp-make-tramp-file-format) (tramp-make-tramp-file-user-nil-format-unified) (tramp-make-tramp-file-user-nil-format-separate) (tramp-make-tramp-file-user-nil-format) (tramp-multi-file-name-structure-unified) (tramp-multi-file-name-structure-separate) (tramp-multi-file-name-hop-structure-unified) (tramp-multi-file-name-hop-structure-separate) (tramp-make-multi-tramp-file-format-unified) (tramp-make-multi-tramp-file-format-separate): Removed. (tramp-make-tramp-file-name): Allow partial tramp file names. Generate tramp file format on-the-fly depending on parameters. Apply atomar format strings resp expressions. (tramp-get-completion-methods) (tramp-get-completion-user-host): Apply `tramp-make-tramp-file-name'. (tramp-parse-hosts-group): Take all host names and IP addresses into account. (tramp-bug): Remove `tramp-make-tramp-file-format'. 2002-09-01 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-methods): Add `tramp-completion-function' for "su" and "sudo". (tramp-get-completion-telnet): Implement it. (tramp-parse-hosts) (tramp-parse-hosts-group) (tramp-get-completion-su) (tramp-parse-passwd) (tramp-parse-passwd-group): New functions. 2002-08-31 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-completion-mode): Check for `last-input-char'. (tramp-completion-file-name-handler-alist): Add handler for `file-exists-p. (tramp-completion-handle-file-exists-p): New function. (tramp-completion-handle-file-name-completion): Simplified. (tramp-completion-dissect-file-name): Regexp's reorganised. (tramp-completion-handle-file-name-all-completions): Call completion-function only if `user' or `host' is given. (tramp-get-completion-user-host): New function. (tramp-get-completion-rsh) (tramp-get-completion-ssh): Apply it. 2002-08-29 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-completion-file-name-handler-alist): Add handler for `expand-file-name'. (tramp-completion-handle-expand-file-name): New function. 2002-08-26 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-completion-mode): New function. (tramp-completion-handle-file-name-directory) (tramp-completion-handle-file-name-all-completions): Apply it. (tramp-methods): Remove double definition of `ssh1-old' and `ssh2-old'. (tramp-point-at-eol): New defalias. (tramp-parse-rhosts-group) (tramp-parse-shosts-group):: Apply it. 2002-08-25 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-get-completion-methods) (tramp-get-completion-rsh) (tramp-get-completion-ssh): Add "[" for Xemacs. (tramp-completion-file-name-regexp-separate): Expression adapted. (tramp-completion-file-name-handler-alist): Add handler for `file-name-directory' and `file-name-nondirectory'. (tramp-completion-handle-file-name-directory) (tramp-completion-handle-file-name-nondirectory) (tramp-completion-run-real-handler): New functions. (tramp-completion-file-name-handler) (tramp-completion-handle-file-name-all-completions): Apply `tramp-completion-run-real-handler'. (tramp-parse-rhosts) (tramp-parse-shosts): Use `with-temp-buffer'. `result? renamed to `res' (otherwise side effects in XEmacs). 2002-08-24 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-completion-file-name-regexp) (tramp-completion-file-name-handler-alist) (tramp-flatten-list) (tramp-completion-dissect-file-name) (tramp-get-completion-rsh) (tramp-parse-rhosts) (tramp-parse-rhosts-group) (tramp-get-completion-ssh): Doc string tuned. (tramp-methods): Doc string and custom type extended for `tramp-completion-function'. (tramp-completion-function): Variable added. Is it really used? Other variables like `tramp-completion-function' aren't used. (tramp-completion-file-name-handler-alist): Add handler for `file-name-completion'. (tramp-completion-handle-file-name-completion): New function. 2002-08-18 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-parse-rhosts) (tramp-parse-rhosts-group) (tramp-parse-shosts) (tramp-parse-shosts-group): New functions. 2002-08-17 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1): New functions. 2002-08-16 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-get-completion-function) (tramp-get-completion-rsh) (tramp-get-completion-ssh) (tramp-get-completion-telnet): New functions. (tramp-methods): Add `tramp-completion-function' for all methods. 2002-08-15 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-get-completion-methods): New function. (tramp-find-default-method): Allow host to be nil (like user). 2002-08-14 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate) (tramp-completion-file-name-regexp) (tramp-completion-file-name-handler-alist): New defcustoms. (tramp-completion-file-name-handler): New function. Add `tramp-completion-file-name-handler' to `file-name-handler-alist'. (tramp-run-real-handler): Add `tramp-completion-file-name-handler' to `inhibit-file-name-handlers'. (tramp-completion-handle-file-name-all-completions) (tramp-completion-handle-file-name-completion): New functions. 2002-08-12 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-invoke-ange-ftp): `tramp-disable-ange-ftp' must be called again after activating `ange-ftp'. (tramp-ange-ftp-file-name-p): Check for Xemacs. 2002-08-08 Michael Albinus <Michael.Albinus@alcatel.de> * net/tramp.el (tramp-do-copy-or-rename-file): Don't pass KEEP-DATE to tramp-invoke-ange-ftp 'rename. (tramp-handle-write-region): Don't pass LOCKNAME and CONFIRM to tramp-invoke-ange-ftp 'write-region. (tramp-handle-set-file-modes): Change order of FILENAME and MODE passing to tramp-invoke-ange-ftp 'set-file-modes. (tramp-flatten-list): New function. Maybe this functionality does exist already elsewhere in the libraries. (tramp-invoke-ange-ftp): Apply `tramp-flatten-list' to parameter list in order to avoid nested lists, f.e. when invoked from `tramp-handle-dired-call-process'. 2002-09-05 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-chunksize): New kluge variable. (tramp-send-region): If tramp-chunksize is non-nil, send region in parts and sleep 0.1 seconds between chunks. 2002-09-03 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-handle-insert-directory): Use `insert-buffer-substring' instead of `insert-buffer', which is not supposed to be used from Lisp. Remember old point in a variable instead of using `mark'. Suggestion from Stefan Monnier. (tramp-unified-filenames): New variable. Use it in default value of other filename variables. (file-expand-wildcards): Don't advise unless "[" and "]" are used in the filename format. 2002-09-01 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> * net/tramp.el (tramp-methods): Remove duplicate definition of ssh1-old and ssh2-old.
author Kai Großjohann <kgrossjo@eu.uu.net>
date Sun, 22 Sep 2002 13:23:36 +0000
parents 17275bfd5698
children 23a1cea22d13
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
44752
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
1 /* $Header: /cvsroot/emacs//emacs/oldXMenu/Activate.c,v 1.3 2000/07/21 14:36:24 gerd Exp $ */
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
2 /* Copyright Massachusetts Institute of Technology 1985 */
Dave Love <fx@gnu.org>
parents:
diff changeset
3
Dave Love <fx@gnu.org>
parents:
diff changeset
4 #include "copyright.h"
Dave Love <fx@gnu.org>
parents:
diff changeset
5
Dave Love <fx@gnu.org>
parents:
diff changeset
6 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
7 * XMenu: MIT Project Athena, X Window system menu package
Dave Love <fx@gnu.org>
parents:
diff changeset
8 *
Dave Love <fx@gnu.org>
parents:
diff changeset
9 * XMenuActivate - Maps a given menu to the display and activates
Dave Love <fx@gnu.org>
parents:
diff changeset
10 * the menu for user selection. The user is allowed to
Dave Love <fx@gnu.org>
parents:
diff changeset
11 * specify which pane and selection will be current,
Dave Love <fx@gnu.org>
parents:
diff changeset
12 * the X and Y location of the menu (relative to the
Dave Love <fx@gnu.org>
parents:
diff changeset
13 * parent window) and the mouse button event mask that
Dave Love <fx@gnu.org>
parents:
diff changeset
14 * will be used to identify a selection request.
Dave Love <fx@gnu.org>
parents:
diff changeset
15 *
Dave Love <fx@gnu.org>
parents:
diff changeset
16 * A menu selection is shown to be current by placing
Dave Love <fx@gnu.org>
parents:
diff changeset
17 * a highlight box around the selection as the mouse
Dave Love <fx@gnu.org>
parents:
diff changeset
18 * cursor enters its active region. Inactive selections
Dave Love <fx@gnu.org>
parents:
diff changeset
19 * will not be highlighted. As the mouse cursor moved
Dave Love <fx@gnu.org>
parents:
diff changeset
20 * from one menu pane to another menu pane the pane being
Dave Love <fx@gnu.org>
parents:
diff changeset
21 * entered is raised and made current and the pane being
Dave Love <fx@gnu.org>
parents:
diff changeset
22 * left is lowered.
Dave Love <fx@gnu.org>
parents:
diff changeset
23 *
Dave Love <fx@gnu.org>
parents:
diff changeset
24 * Anytime XMenuActivate returns, the p_num and
Dave Love <fx@gnu.org>
parents:
diff changeset
25 * s_num are left at their last known values (i.e.,
Dave Love <fx@gnu.org>
parents:
diff changeset
26 * the last known current pane and selection indices).
Dave Love <fx@gnu.org>
parents:
diff changeset
27 * The following are the defined return states:
Dave Love <fx@gnu.org>
parents:
diff changeset
28 *
Dave Love <fx@gnu.org>
parents:
diff changeset
29 * 1) If at any time an error occurs the data
Dave Love <fx@gnu.org>
parents:
diff changeset
30 * pointer is left untouched and XM_FAILURE
Dave Love <fx@gnu.org>
parents:
diff changeset
31 * is returned.
Dave Love <fx@gnu.org>
parents:
diff changeset
32 *
Dave Love <fx@gnu.org>
parents:
diff changeset
33 * 2) When a selection request is received (i.e.,
Dave Love <fx@gnu.org>
parents:
diff changeset
34 * when the specified mouse event occurs) the
Dave Love <fx@gnu.org>
parents:
diff changeset
35 * data pointer will be set to the data
Dave Love <fx@gnu.org>
parents:
diff changeset
36 * associated with the particular selection
Dave Love <fx@gnu.org>
parents:
diff changeset
37 * current at the time of the selection request
Dave Love <fx@gnu.org>
parents:
diff changeset
38 * and XM_SUCCESS is returned.
Dave Love <fx@gnu.org>
parents:
diff changeset
39 *
Dave Love <fx@gnu.org>
parents:
diff changeset
40 * 3) If no selection was current at the time a
Dave Love <fx@gnu.org>
parents:
diff changeset
41 * selection request is made the data pointer
Dave Love <fx@gnu.org>
parents:
diff changeset
42 * will be left untouched and XM_NO_SELECT will
Dave Love <fx@gnu.org>
parents:
diff changeset
43 * be returned.
Dave Love <fx@gnu.org>
parents:
diff changeset
44 *
Dave Love <fx@gnu.org>
parents:
diff changeset
45 * 4) If the selection that was current at the time
Dave Love <fx@gnu.org>
parents:
diff changeset
46 * a selection request is made is not an active
Dave Love <fx@gnu.org>
parents:
diff changeset
47 * selection the data pointer will be left
Dave Love <fx@gnu.org>
parents:
diff changeset
48 * untouched and XM_IA_SELECT will be returned.
Dave Love <fx@gnu.org>
parents:
diff changeset
49 *
Dave Love <fx@gnu.org>
parents:
diff changeset
50 * Since X processes events in an asynchronous manner
Dave Love <fx@gnu.org>
parents:
diff changeset
51 * it is likely that XMenuActivate will encounter
Dave Love <fx@gnu.org>
parents:
diff changeset
52 * a "foreign event" while it is executing. Foreign
Dave Love <fx@gnu.org>
parents:
diff changeset
53 * events are handled in one of three ways:
Dave Love <fx@gnu.org>
parents:
diff changeset
54 *
Dave Love <fx@gnu.org>
parents:
diff changeset
55 * 1) The event is discarded. This is the default
Dave Love <fx@gnu.org>
parents:
diff changeset
56 * mode and requires no action on the part of the
Dave Love <fx@gnu.org>
parents:
diff changeset
57 * application.
Dave Love <fx@gnu.org>
parents:
diff changeset
58 *
Dave Love <fx@gnu.org>
parents:
diff changeset
59 * 2) The application has identified an asynchronous
Dave Love <fx@gnu.org>
parents:
diff changeset
60 * event handler that will be called and the
Dave Love <fx@gnu.org>
parents:
diff changeset
61 * foreign event handed off to it. Note:
Dave Love <fx@gnu.org>
parents:
diff changeset
62 * AEQ mode disables this mode temporarily.
Dave Love <fx@gnu.org>
parents:
diff changeset
63 *
Dave Love <fx@gnu.org>
parents:
diff changeset
64 * 3) The application has enabled asynchronous event
Dave Love <fx@gnu.org>
parents:
diff changeset
65 * queuing mode. In this mode all foreign events
Dave Love <fx@gnu.org>
parents:
diff changeset
66 * will be queued up untill XMenuActivate
Dave Love <fx@gnu.org>
parents:
diff changeset
67 * terminates; at which time they will be
Dave Love <fx@gnu.org>
parents:
diff changeset
68 * returned to the X event queue. As long as
Dave Love <fx@gnu.org>
parents:
diff changeset
69 * AEQ mode is enabled any asynchronous event
Dave Love <fx@gnu.org>
parents:
diff changeset
70 * handler as temporarily disabled.
Dave Love <fx@gnu.org>
parents:
diff changeset
71 *
Dave Love <fx@gnu.org>
parents:
diff changeset
72 * Any events encountered while taking down the menu
Dave Love <fx@gnu.org>
parents:
diff changeset
73 * (i.e., exposure events from occluded windows) will
Dave Love <fx@gnu.org>
parents:
diff changeset
74 * automatically be returned to the X event queue after
Dave Love <fx@gnu.org>
parents:
diff changeset
75 * XMenuActivate has cleaned the queue of any of its own
Dave Love <fx@gnu.org>
parents:
diff changeset
76 * events that are no longer needed.
Dave Love <fx@gnu.org>
parents:
diff changeset
77 *
Dave Love <fx@gnu.org>
parents:
diff changeset
78 * Author: Tony Della Fera, DEC
Dave Love <fx@gnu.org>
parents:
diff changeset
79 * March 12, 1986
Dave Love <fx@gnu.org>
parents:
diff changeset
80 *
Dave Love <fx@gnu.org>
parents:
diff changeset
81 */
Dave Love <fx@gnu.org>
parents:
diff changeset
82
Dave Love <fx@gnu.org>
parents:
diff changeset
83 #include <config.h>
Dave Love <fx@gnu.org>
parents:
diff changeset
84 #include "XMenuInt.h"
Dave Love <fx@gnu.org>
parents:
diff changeset
85
44752
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
86 /* For debug, set this to 0 to not grab the keyboard on menu popup */
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
87 int x_menu_grab_keyboard = 1;
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
88
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
89 int
27457
bbfd0e676041 (XMenuActivate): Add parameter HELP_CALLBACK.
Gerd Moellmann <gerd@gnu.org>
parents: 25858
diff changeset
90 XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data,
bbfd0e676041 (XMenuActivate): Add parameter HELP_CALLBACK.
Gerd Moellmann <gerd@gnu.org>
parents: 25858
diff changeset
91 help_callback)
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
92 register Display *display; /* Display to put menu on. */
Dave Love <fx@gnu.org>
parents:
diff changeset
93 register XMenu *menu; /* Menu to activate. */
Dave Love <fx@gnu.org>
parents:
diff changeset
94 int *p_num; /* Pane number selected. */
Dave Love <fx@gnu.org>
parents:
diff changeset
95 int *s_num; /* Selection number selected. */
Dave Love <fx@gnu.org>
parents:
diff changeset
96 int x_pos; /* X coordinate of menu position. */
Dave Love <fx@gnu.org>
parents:
diff changeset
97 int y_pos; /* Y coordinate of menu position. */
Dave Love <fx@gnu.org>
parents:
diff changeset
98 unsigned int event_mask; /* Mouse button event mask. */
Dave Love <fx@gnu.org>
parents:
diff changeset
99 char **data; /* Pointer to return data value. */
27457
bbfd0e676041 (XMenuActivate): Add parameter HELP_CALLBACK.
Gerd Moellmann <gerd@gnu.org>
parents: 25858
diff changeset
100 void (* help_callback) (); /* Help callback. */
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
101 {
Dave Love <fx@gnu.org>
parents:
diff changeset
102 int status; /* X routine call status. */
Dave Love <fx@gnu.org>
parents:
diff changeset
103 int orig_x; /* Upper left menu origin X coord. */
Dave Love <fx@gnu.org>
parents:
diff changeset
104 int orig_y; /* Upper left menu origin Y coord. */
Dave Love <fx@gnu.org>
parents:
diff changeset
105 int ret_val; /* Return value. */
Dave Love <fx@gnu.org>
parents:
diff changeset
106
Dave Love <fx@gnu.org>
parents:
diff changeset
107 register XMPane *p_ptr; /* Current XMPane. */
Dave Love <fx@gnu.org>
parents:
diff changeset
108 register XMPane *event_xmp; /* Event XMPane pointer. */
Dave Love <fx@gnu.org>
parents:
diff changeset
109 register XMPane *cur_p; /* Current pane. */
Dave Love <fx@gnu.org>
parents:
diff changeset
110 register XMSelect *cur_s; /* Current selection. */
Dave Love <fx@gnu.org>
parents:
diff changeset
111 XMWindow *event_xmw; /* Event XMWindow pointer. */
Dave Love <fx@gnu.org>
parents:
diff changeset
112 XEvent event; /* X input event. */
Dave Love <fx@gnu.org>
parents:
diff changeset
113 XEvent peek_event; /* X input peek ahead event. */
Dave Love <fx@gnu.org>
parents:
diff changeset
114
Dave Love <fx@gnu.org>
parents:
diff changeset
115 Bool selection = False; /* Selection has been made. */
Dave Love <fx@gnu.org>
parents:
diff changeset
116 Bool forward = True; /* Moving forward in the pane list. */
Dave Love <fx@gnu.org>
parents:
diff changeset
117
Dave Love <fx@gnu.org>
parents:
diff changeset
118 Window root, child;
Dave Love <fx@gnu.org>
parents:
diff changeset
119 int root_x, root_y, win_x, win_y;
Dave Love <fx@gnu.org>
parents:
diff changeset
120 unsigned int mask;
Dave Love <fx@gnu.org>
parents:
diff changeset
121
Dave Love <fx@gnu.org>
parents:
diff changeset
122 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
123 * Define and allocate a foreign event queue to hold events
Dave Love <fx@gnu.org>
parents:
diff changeset
124 * that don't belong to XMenu. These events are later restored
Dave Love <fx@gnu.org>
parents:
diff changeset
125 * to the X event queue.
Dave Love <fx@gnu.org>
parents:
diff changeset
126 */
Dave Love <fx@gnu.org>
parents:
diff changeset
127 typedef struct _xmeventque {
Dave Love <fx@gnu.org>
parents:
diff changeset
128 XEvent event;
Dave Love <fx@gnu.org>
parents:
diff changeset
129 struct _xmeventque *next;
Dave Love <fx@gnu.org>
parents:
diff changeset
130 } XMEventQue;
Dave Love <fx@gnu.org>
parents:
diff changeset
131
Dave Love <fx@gnu.org>
parents:
diff changeset
132 XMEventQue *feq = NULL; /* Foreign event queue. */
Dave Love <fx@gnu.org>
parents:
diff changeset
133 XMEventQue *feq_tmp; /* Foreign event queue temporary. */
Dave Love <fx@gnu.org>
parents:
diff changeset
134
Dave Love <fx@gnu.org>
parents:
diff changeset
135 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
136 * If there are no panes in the menu then return failure
Dave Love <fx@gnu.org>
parents:
diff changeset
137 * because the menu is not initialized.
Dave Love <fx@gnu.org>
parents:
diff changeset
138 */
Dave Love <fx@gnu.org>
parents:
diff changeset
139 if (menu->p_count == 0) {
Dave Love <fx@gnu.org>
parents:
diff changeset
140 _XMErrorCode = XME_NOT_INIT;
Dave Love <fx@gnu.org>
parents:
diff changeset
141 return(XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
142 }
Dave Love <fx@gnu.org>
parents:
diff changeset
143
Dave Love <fx@gnu.org>
parents:
diff changeset
144 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
145 * Find the desired current pane.
Dave Love <fx@gnu.org>
parents:
diff changeset
146 */
Dave Love <fx@gnu.org>
parents:
diff changeset
147 cur_p = _XMGetPanePtr(menu, *p_num);
Dave Love <fx@gnu.org>
parents:
diff changeset
148 if (cur_p == NULL) {
Dave Love <fx@gnu.org>
parents:
diff changeset
149 return(XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
150 }
Dave Love <fx@gnu.org>
parents:
diff changeset
151 cur_p->activated = cur_p->active;
Dave Love <fx@gnu.org>
parents:
diff changeset
152
Dave Love <fx@gnu.org>
parents:
diff changeset
153 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
154 * Find the desired current selection.
Dave Love <fx@gnu.org>
parents:
diff changeset
155 * If the current selection index is out of range a null current selection
Dave Love <fx@gnu.org>
parents:
diff changeset
156 * will be assumed and the cursor will be placed in the current pane
Dave Love <fx@gnu.org>
parents:
diff changeset
157 * header.
Dave Love <fx@gnu.org>
parents:
diff changeset
158 */
Dave Love <fx@gnu.org>
parents:
diff changeset
159 cur_s = _XMGetSelectionPtr(cur_p, *s_num);
Dave Love <fx@gnu.org>
parents:
diff changeset
160
Dave Love <fx@gnu.org>
parents:
diff changeset
161 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
162 * Compute origin of menu so that cursor is in
Dave Love <fx@gnu.org>
parents:
diff changeset
163 * Correct pane and selection.
Dave Love <fx@gnu.org>
parents:
diff changeset
164 */
Dave Love <fx@gnu.org>
parents:
diff changeset
165 _XMTransToOrigin(display,
Dave Love <fx@gnu.org>
parents:
diff changeset
166 menu,
Dave Love <fx@gnu.org>
parents:
diff changeset
167 cur_p, cur_s,
Dave Love <fx@gnu.org>
parents:
diff changeset
168 x_pos, y_pos,
Dave Love <fx@gnu.org>
parents:
diff changeset
169 &orig_x, &orig_y);
Dave Love <fx@gnu.org>
parents:
diff changeset
170 menu->x_pos = orig_x; /* Store X and Y coords of menu. */
Dave Love <fx@gnu.org>
parents:
diff changeset
171 menu->y_pos = orig_y;
Dave Love <fx@gnu.org>
parents:
diff changeset
172
Dave Love <fx@gnu.org>
parents:
diff changeset
173 if (XMenuRecompute(display, menu) == XM_FAILURE) {
Dave Love <fx@gnu.org>
parents:
diff changeset
174 return(XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
175 }
Dave Love <fx@gnu.org>
parents:
diff changeset
176
Dave Love <fx@gnu.org>
parents:
diff changeset
177 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
178 * Flush the window creation queue.
Dave Love <fx@gnu.org>
parents:
diff changeset
179 * This batches all window creates since lazy evaluation
Dave Love <fx@gnu.org>
parents:
diff changeset
180 * is more efficient than individual evaluation.
Dave Love <fx@gnu.org>
parents:
diff changeset
181 * This routine also does an XFlush().
Dave Love <fx@gnu.org>
parents:
diff changeset
182 */
Dave Love <fx@gnu.org>
parents:
diff changeset
183 if (_XMWinQueFlush(display, menu, cur_p, cur_s) == _FAILURE) {
Dave Love <fx@gnu.org>
parents:
diff changeset
184 return(XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
185 }
Dave Love <fx@gnu.org>
parents:
diff changeset
186
Dave Love <fx@gnu.org>
parents:
diff changeset
187 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
188 * Make sure windows are in correct order (in case we were passed
Dave Love <fx@gnu.org>
parents:
diff changeset
189 * an already created menu in incorrect order.)
Dave Love <fx@gnu.org>
parents:
diff changeset
190 */
Dave Love <fx@gnu.org>
parents:
diff changeset
191 for(p_ptr = menu->p_list->next; p_ptr != cur_p; p_ptr = p_ptr->next)
Dave Love <fx@gnu.org>
parents:
diff changeset
192 XRaiseWindow(display, p_ptr->window);
Dave Love <fx@gnu.org>
parents:
diff changeset
193 for(p_ptr = menu->p_list->prev; p_ptr != cur_p->prev; p_ptr = p_ptr->prev)
Dave Love <fx@gnu.org>
parents:
diff changeset
194 XRaiseWindow(display, p_ptr->window);
Dave Love <fx@gnu.org>
parents:
diff changeset
195
Dave Love <fx@gnu.org>
parents:
diff changeset
196 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
197 * Make sure all selection windows are mapped.
Dave Love <fx@gnu.org>
parents:
diff changeset
198 */
Dave Love <fx@gnu.org>
parents:
diff changeset
199 for (
Dave Love <fx@gnu.org>
parents:
diff changeset
200 p_ptr = menu->p_list->next;
Dave Love <fx@gnu.org>
parents:
diff changeset
201 p_ptr != menu->p_list;
Dave Love <fx@gnu.org>
parents:
diff changeset
202 p_ptr = p_ptr->next
Dave Love <fx@gnu.org>
parents:
diff changeset
203 ){
Dave Love <fx@gnu.org>
parents:
diff changeset
204 XMapSubwindows(display, p_ptr->window);
Dave Love <fx@gnu.org>
parents:
diff changeset
205 }
Dave Love <fx@gnu.org>
parents:
diff changeset
206
Dave Love <fx@gnu.org>
parents:
diff changeset
207 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
208 * Synchronize the X buffers and the event queue.
Dave Love <fx@gnu.org>
parents:
diff changeset
209 * From here on, all events in the queue that don't belong to
Dave Love <fx@gnu.org>
parents:
diff changeset
210 * XMenu are sent back to the application via an application
Dave Love <fx@gnu.org>
parents:
diff changeset
211 * provided event handler or discarded if the application has
Dave Love <fx@gnu.org>
parents:
diff changeset
212 * not provided an event handler.
Dave Love <fx@gnu.org>
parents:
diff changeset
213 */
Dave Love <fx@gnu.org>
parents:
diff changeset
214 XSync(display, 0);
Dave Love <fx@gnu.org>
parents:
diff changeset
215
Dave Love <fx@gnu.org>
parents:
diff changeset
216 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
217 * Grab the mouse for menu input.
Dave Love <fx@gnu.org>
parents:
diff changeset
218 */
Dave Love <fx@gnu.org>
parents:
diff changeset
219
Dave Love <fx@gnu.org>
parents:
diff changeset
220 status = XGrabPointer(
Dave Love <fx@gnu.org>
parents:
diff changeset
221 display,
Dave Love <fx@gnu.org>
parents:
diff changeset
222 menu->parent,
Dave Love <fx@gnu.org>
parents:
diff changeset
223 True,
Dave Love <fx@gnu.org>
parents:
diff changeset
224 event_mask,
Dave Love <fx@gnu.org>
parents:
diff changeset
225 GrabModeAsync,
Dave Love <fx@gnu.org>
parents:
diff changeset
226 GrabModeAsync,
Dave Love <fx@gnu.org>
parents:
diff changeset
227 None,
Dave Love <fx@gnu.org>
parents:
diff changeset
228 menu->mouse_cursor,
Dave Love <fx@gnu.org>
parents:
diff changeset
229 CurrentTime
Dave Love <fx@gnu.org>
parents:
diff changeset
230 );
44752
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
231 if (status == Success && x_menu_grab_keyboard)
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
232 {
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
233 status = XGrabKeyboard (display,
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
234 menu->parent,
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
235 False,
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
236 GrabModeAsync,
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
237 GrabModeAsync,
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
238 CurrentTime);
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
239 if (status != Success)
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
240 XUngrabPointer(display, CurrentTime);
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
241 }
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
242
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
243 if (status == _X_FAILURE) {
Dave Love <fx@gnu.org>
parents:
diff changeset
244 _XMErrorCode = XME_GRAB_MOUSE;
Dave Love <fx@gnu.org>
parents:
diff changeset
245 return(XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
246 }
Dave Love <fx@gnu.org>
parents:
diff changeset
247
Dave Love <fx@gnu.org>
parents:
diff changeset
248 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
249 * Map the menu panes.
Dave Love <fx@gnu.org>
parents:
diff changeset
250 */
Dave Love <fx@gnu.org>
parents:
diff changeset
251 XMapWindow(display, cur_p->window);
Dave Love <fx@gnu.org>
parents:
diff changeset
252 for (p_ptr = menu->p_list->next;
Dave Love <fx@gnu.org>
parents:
diff changeset
253 p_ptr != cur_p;
Dave Love <fx@gnu.org>
parents:
diff changeset
254 p_ptr = p_ptr->next)
Dave Love <fx@gnu.org>
parents:
diff changeset
255 XMapWindow(display, p_ptr->window);
Dave Love <fx@gnu.org>
parents:
diff changeset
256 for (p_ptr = cur_p->next;
Dave Love <fx@gnu.org>
parents:
diff changeset
257 p_ptr != menu->p_list;
Dave Love <fx@gnu.org>
parents:
diff changeset
258 p_ptr = p_ptr->next)
Dave Love <fx@gnu.org>
parents:
diff changeset
259 XMapWindow(display, p_ptr->window);
Dave Love <fx@gnu.org>
parents:
diff changeset
260
Dave Love <fx@gnu.org>
parents:
diff changeset
261 XRaiseWindow(display, cur_p->window); /* Make sure current */
Dave Love <fx@gnu.org>
parents:
diff changeset
262 /* pane is on top. */
Dave Love <fx@gnu.org>
parents:
diff changeset
263
Dave Love <fx@gnu.org>
parents:
diff changeset
264 cur_s = NULL; /* Clear current selection. */
Dave Love <fx@gnu.org>
parents:
diff changeset
265
Dave Love <fx@gnu.org>
parents:
diff changeset
266 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
267 * Begin event processing loop.
Dave Love <fx@gnu.org>
parents:
diff changeset
268 */
Dave Love <fx@gnu.org>
parents:
diff changeset
269 while (1) {
Dave Love <fx@gnu.org>
parents:
diff changeset
270 XNextEvent(display, &event); /* Get next event. */
Dave Love <fx@gnu.org>
parents:
diff changeset
271 switch (event.type) { /* Dispatch on the event type. */
Dave Love <fx@gnu.org>
parents:
diff changeset
272 case Expose:
Dave Love <fx@gnu.org>
parents:
diff changeset
273 event_xmp = (XMPane *)XLookUpAssoc(display,
Dave Love <fx@gnu.org>
parents:
diff changeset
274 menu->assoc_tab,
Dave Love <fx@gnu.org>
parents:
diff changeset
275 event.xexpose.window);
Dave Love <fx@gnu.org>
parents:
diff changeset
276 if (event_xmp == NULL) {
Dave Love <fx@gnu.org>
parents:
diff changeset
277 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
278 * If AEQ mode is enabled then queue the event.
Dave Love <fx@gnu.org>
parents:
diff changeset
279 */
Dave Love <fx@gnu.org>
parents:
diff changeset
280 if (menu->aeq) {
Dave Love <fx@gnu.org>
parents:
diff changeset
281 feq_tmp = (XMEventQue *)malloc(sizeof(XMEventQue));
Dave Love <fx@gnu.org>
parents:
diff changeset
282 if (feq_tmp == NULL) {
Dave Love <fx@gnu.org>
parents:
diff changeset
283 _XMErrorCode = XME_CALLOC;
Dave Love <fx@gnu.org>
parents:
diff changeset
284 return(XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
285 }
Dave Love <fx@gnu.org>
parents:
diff changeset
286 feq_tmp->event = event;
Dave Love <fx@gnu.org>
parents:
diff changeset
287 feq_tmp->next = feq;
Dave Love <fx@gnu.org>
parents:
diff changeset
288 feq = feq_tmp;
Dave Love <fx@gnu.org>
parents:
diff changeset
289 }
Dave Love <fx@gnu.org>
parents:
diff changeset
290 else if (_XMEventHandler) (*_XMEventHandler)(&event);
Dave Love <fx@gnu.org>
parents:
diff changeset
291 break;
Dave Love <fx@gnu.org>
parents:
diff changeset
292 }
Dave Love <fx@gnu.org>
parents:
diff changeset
293 if (event_xmp->activated) {
Dave Love <fx@gnu.org>
parents:
diff changeset
294 XSetWindowBackground(display,
Dave Love <fx@gnu.org>
parents:
diff changeset
295 event_xmp->window,
Dave Love <fx@gnu.org>
parents:
diff changeset
296 menu->bkgnd_color);
Dave Love <fx@gnu.org>
parents:
diff changeset
297 }
Dave Love <fx@gnu.org>
parents:
diff changeset
298 else {
Dave Love <fx@gnu.org>
parents:
diff changeset
299 XSetWindowBackgroundPixmap(display,
Dave Love <fx@gnu.org>
parents:
diff changeset
300 event_xmp->window,
Dave Love <fx@gnu.org>
parents:
diff changeset
301 menu->inact_pixmap);
Dave Love <fx@gnu.org>
parents:
diff changeset
302 }
Dave Love <fx@gnu.org>
parents:
diff changeset
303 _XMRefreshPane(display, menu, event_xmp);
Dave Love <fx@gnu.org>
parents:
diff changeset
304 break;
Dave Love <fx@gnu.org>
parents:
diff changeset
305 case EnterNotify:
Dave Love <fx@gnu.org>
parents:
diff changeset
306 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
307 * First wait a small period of time, and see
Dave Love <fx@gnu.org>
parents:
diff changeset
308 * if another EnterNotify event follows hard on the
Dave Love <fx@gnu.org>
parents:
diff changeset
309 * heels of this one. i.e., the user is simply
Dave Love <fx@gnu.org>
parents:
diff changeset
310 * "passing through". If so, ignore this one.
Dave Love <fx@gnu.org>
parents:
diff changeset
311 */
Dave Love <fx@gnu.org>
parents:
diff changeset
312
Dave Love <fx@gnu.org>
parents:
diff changeset
313 event_xmw = (XMWindow *)XLookUpAssoc(display,
Dave Love <fx@gnu.org>
parents:
diff changeset
314 menu->assoc_tab,
Dave Love <fx@gnu.org>
parents:
diff changeset
315 event.xcrossing.window);
Dave Love <fx@gnu.org>
parents:
diff changeset
316 if (event_xmw == NULL) break;
Dave Love <fx@gnu.org>
parents:
diff changeset
317 if (event_xmw->type == SELECTION) {
Dave Love <fx@gnu.org>
parents:
diff changeset
318 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
319 * We have entered a selection.
Dave Love <fx@gnu.org>
parents:
diff changeset
320 */
Dave Love <fx@gnu.org>
parents:
diff changeset
321 /* if (XPending(display) == 0) usleep(150000); */
Dave Love <fx@gnu.org>
parents:
diff changeset
322 if (XPending(display) != 0) {
Dave Love <fx@gnu.org>
parents:
diff changeset
323 XPeekEvent(display, &peek_event);
Dave Love <fx@gnu.org>
parents:
diff changeset
324 if(peek_event.type == LeaveNotify) {
Dave Love <fx@gnu.org>
parents:
diff changeset
325 break;
Dave Love <fx@gnu.org>
parents:
diff changeset
326 }
Dave Love <fx@gnu.org>
parents:
diff changeset
327 }
Dave Love <fx@gnu.org>
parents:
diff changeset
328 cur_s = (XMSelect *)event_xmw;
30365
5eece465cb5d (XMenuActivate): Call help callback with two more
Gerd Moellmann <gerd@gnu.org>
parents: 27457
diff changeset
329 help_callback (cur_s->help_string,
5eece465cb5d (XMenuActivate): Call help callback with two more
Gerd Moellmann <gerd@gnu.org>
parents: 27457
diff changeset
330 cur_p->serial, cur_s->serial);
27457
bbfd0e676041 (XMenuActivate): Add parameter HELP_CALLBACK.
Gerd Moellmann <gerd@gnu.org>
parents: 25858
diff changeset
331
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
332 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
333 * If the pane we are in is active and the
Dave Love <fx@gnu.org>
parents:
diff changeset
334 * selection entered is active then activate
Dave Love <fx@gnu.org>
parents:
diff changeset
335 * the selection.
Dave Love <fx@gnu.org>
parents:
diff changeset
336 */
Dave Love <fx@gnu.org>
parents:
diff changeset
337 if (cur_p->active && cur_s->active > 0) {
Dave Love <fx@gnu.org>
parents:
diff changeset
338 cur_s->activated = 1;
Dave Love <fx@gnu.org>
parents:
diff changeset
339 _XMRefreshSelection(display, menu, cur_s);
Dave Love <fx@gnu.org>
parents:
diff changeset
340 }
Dave Love <fx@gnu.org>
parents:
diff changeset
341 }
Dave Love <fx@gnu.org>
parents:
diff changeset
342 else {
Dave Love <fx@gnu.org>
parents:
diff changeset
343 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
344 * We have entered a pane.
Dave Love <fx@gnu.org>
parents:
diff changeset
345 */
Dave Love <fx@gnu.org>
parents:
diff changeset
346 /* if (XPending(display) == 0) usleep(150000); */
Dave Love <fx@gnu.org>
parents:
diff changeset
347 if (XPending(display) != 0) {
Dave Love <fx@gnu.org>
parents:
diff changeset
348 XPeekEvent(display, &peek_event);
Dave Love <fx@gnu.org>
parents:
diff changeset
349 if (peek_event.type == EnterNotify) break;
Dave Love <fx@gnu.org>
parents:
diff changeset
350 }
Dave Love <fx@gnu.org>
parents:
diff changeset
351 XQueryPointer(display,
Dave Love <fx@gnu.org>
parents:
diff changeset
352 menu->parent,
Dave Love <fx@gnu.org>
parents:
diff changeset
353 &root, &child,
Dave Love <fx@gnu.org>
parents:
diff changeset
354 &root_x, &root_y,
Dave Love <fx@gnu.org>
parents:
diff changeset
355 &win_x, &win_y,
Dave Love <fx@gnu.org>
parents:
diff changeset
356 &mask);
Dave Love <fx@gnu.org>
parents:
diff changeset
357 event_xmp = (XMPane *)XLookUpAssoc(display,
Dave Love <fx@gnu.org>
parents:
diff changeset
358 menu->assoc_tab,
Dave Love <fx@gnu.org>
parents:
diff changeset
359 child);
Dave Love <fx@gnu.org>
parents:
diff changeset
360 if (event_xmp == NULL) break;
Dave Love <fx@gnu.org>
parents:
diff changeset
361 if (event_xmp == cur_p) break;
Dave Love <fx@gnu.org>
parents:
diff changeset
362 if (event_xmp->serial > cur_p->serial) forward = True;
Dave Love <fx@gnu.org>
parents:
diff changeset
363 else forward = False;
Dave Love <fx@gnu.org>
parents:
diff changeset
364 p_ptr = cur_p;
Dave Love <fx@gnu.org>
parents:
diff changeset
365 while (p_ptr != event_xmp) {
Dave Love <fx@gnu.org>
parents:
diff changeset
366 if (forward) p_ptr = p_ptr->next;
Dave Love <fx@gnu.org>
parents:
diff changeset
367 else p_ptr = p_ptr->prev;
Dave Love <fx@gnu.org>
parents:
diff changeset
368 XRaiseWindow(display, p_ptr->window);
Dave Love <fx@gnu.org>
parents:
diff changeset
369 }
Dave Love <fx@gnu.org>
parents:
diff changeset
370 if (cur_p->activated) {
Dave Love <fx@gnu.org>
parents:
diff changeset
371 cur_p->activated = False;
Dave Love <fx@gnu.org>
parents:
diff changeset
372 XSetWindowBackgroundPixmap(display,
Dave Love <fx@gnu.org>
parents:
diff changeset
373 cur_p->window,
Dave Love <fx@gnu.org>
parents:
diff changeset
374 menu->inact_pixmap);
Dave Love <fx@gnu.org>
parents:
diff changeset
375 _XMRefreshPane(display, menu, cur_p);
Dave Love <fx@gnu.org>
parents:
diff changeset
376 }
Dave Love <fx@gnu.org>
parents:
diff changeset
377 if (event_xmp->active) event_xmp->activated = True;
Dave Love <fx@gnu.org>
parents:
diff changeset
378 #if 1
Dave Love <fx@gnu.org>
parents:
diff changeset
379 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
380 * i suspect the we don't get an EXPOSE event when backing
Dave Love <fx@gnu.org>
parents:
diff changeset
381 * store is enabled; the menu windows content is probably
Dave Love <fx@gnu.org>
parents:
diff changeset
382 * not drawn in when it should be in that case.
Dave Love <fx@gnu.org>
parents:
diff changeset
383 * in that case, this is probably an ugly fix!
Dave Love <fx@gnu.org>
parents:
diff changeset
384 * i hope someone more familiar with this code would
Dave Love <fx@gnu.org>
parents:
diff changeset
385 * take it from here. -- caveh@eng.sun.com.
Dave Love <fx@gnu.org>
parents:
diff changeset
386 */
Dave Love <fx@gnu.org>
parents:
diff changeset
387 XSetWindowBackground(display,
Dave Love <fx@gnu.org>
parents:
diff changeset
388 event_xmp->window,
Dave Love <fx@gnu.org>
parents:
diff changeset
389 menu->bkgnd_color);
Dave Love <fx@gnu.org>
parents:
diff changeset
390 _XMRefreshPane(display, menu, event_xmp);
Dave Love <fx@gnu.org>
parents:
diff changeset
391 #endif
Dave Love <fx@gnu.org>
parents:
diff changeset
392 cur_p = event_xmp;
Dave Love <fx@gnu.org>
parents:
diff changeset
393 }
Dave Love <fx@gnu.org>
parents:
diff changeset
394 break;
Dave Love <fx@gnu.org>
parents:
diff changeset
395 case LeaveNotify:
Dave Love <fx@gnu.org>
parents:
diff changeset
396 event_xmw = (XMWindow *)XLookUpAssoc(
Dave Love <fx@gnu.org>
parents:
diff changeset
397 display,
Dave Love <fx@gnu.org>
parents:
diff changeset
398 menu->assoc_tab,
Dave Love <fx@gnu.org>
parents:
diff changeset
399 event.xcrossing.window
Dave Love <fx@gnu.org>
parents:
diff changeset
400 );
Dave Love <fx@gnu.org>
parents:
diff changeset
401 if (event_xmw == NULL) break;
Dave Love <fx@gnu.org>
parents:
diff changeset
402 if(cur_s == NULL) break;
Dave Love <fx@gnu.org>
parents:
diff changeset
403
Dave Love <fx@gnu.org>
parents:
diff changeset
404 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
405 * If the current selection was activated then
Dave Love <fx@gnu.org>
parents:
diff changeset
406 * deactivate it.
Dave Love <fx@gnu.org>
parents:
diff changeset
407 */
Dave Love <fx@gnu.org>
parents:
diff changeset
408 if (cur_s->activated) {
Dave Love <fx@gnu.org>
parents:
diff changeset
409 cur_s->activated = False;
Dave Love <fx@gnu.org>
parents:
diff changeset
410 _XMRefreshSelection(display, menu, cur_s);
Dave Love <fx@gnu.org>
parents:
diff changeset
411 }
Dave Love <fx@gnu.org>
parents:
diff changeset
412 cur_s = NULL;
Dave Love <fx@gnu.org>
parents:
diff changeset
413 break;
Dave Love <fx@gnu.org>
parents:
diff changeset
414
Dave Love <fx@gnu.org>
parents:
diff changeset
415 case ButtonPress:
Dave Love <fx@gnu.org>
parents:
diff changeset
416 case ButtonRelease:
Dave Love <fx@gnu.org>
parents:
diff changeset
417 *p_num = cur_p->serial;
Dave Love <fx@gnu.org>
parents:
diff changeset
418 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
419 * Check to see if there is a current selection.
Dave Love <fx@gnu.org>
parents:
diff changeset
420 */
Dave Love <fx@gnu.org>
parents:
diff changeset
421 if (cur_s != NULL) {
Dave Love <fx@gnu.org>
parents:
diff changeset
422 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
423 * Set the selection number to the current selection.
Dave Love <fx@gnu.org>
parents:
diff changeset
424 */
Dave Love <fx@gnu.org>
parents:
diff changeset
425 *s_num = cur_s->serial;
Dave Love <fx@gnu.org>
parents:
diff changeset
426 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
427 * If the current selection was activated then
Dave Love <fx@gnu.org>
parents:
diff changeset
428 * we have a valid selection otherwise we have
Dave Love <fx@gnu.org>
parents:
diff changeset
429 * an inactive selection.
Dave Love <fx@gnu.org>
parents:
diff changeset
430 */
Dave Love <fx@gnu.org>
parents:
diff changeset
431 if (cur_s->activated) {
Dave Love <fx@gnu.org>
parents:
diff changeset
432 *data = cur_s->data;
Dave Love <fx@gnu.org>
parents:
diff changeset
433 ret_val = XM_SUCCESS;
Dave Love <fx@gnu.org>
parents:
diff changeset
434 }
Dave Love <fx@gnu.org>
parents:
diff changeset
435 else {
Dave Love <fx@gnu.org>
parents:
diff changeset
436 ret_val = XM_IA_SELECT;
Dave Love <fx@gnu.org>
parents:
diff changeset
437 }
Dave Love <fx@gnu.org>
parents:
diff changeset
438 }
Dave Love <fx@gnu.org>
parents:
diff changeset
439 else {
Dave Love <fx@gnu.org>
parents:
diff changeset
440 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
441 * No selection was current.
Dave Love <fx@gnu.org>
parents:
diff changeset
442 */
Dave Love <fx@gnu.org>
parents:
diff changeset
443 ret_val = XM_NO_SELECT;
Dave Love <fx@gnu.org>
parents:
diff changeset
444 }
Dave Love <fx@gnu.org>
parents:
diff changeset
445 selection = True;
Dave Love <fx@gnu.org>
parents:
diff changeset
446 break;
Dave Love <fx@gnu.org>
parents:
diff changeset
447 default:
Dave Love <fx@gnu.org>
parents:
diff changeset
448 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
449 * If AEQ mode is enabled then queue the event.
Dave Love <fx@gnu.org>
parents:
diff changeset
450 */
Dave Love <fx@gnu.org>
parents:
diff changeset
451 if (menu->aeq) {
Dave Love <fx@gnu.org>
parents:
diff changeset
452 feq_tmp = (XMEventQue *)malloc(sizeof(XMEventQue));
Dave Love <fx@gnu.org>
parents:
diff changeset
453 if (feq_tmp == NULL) {
Dave Love <fx@gnu.org>
parents:
diff changeset
454 _XMErrorCode = XME_CALLOC;
Dave Love <fx@gnu.org>
parents:
diff changeset
455 return(XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
456 }
Dave Love <fx@gnu.org>
parents:
diff changeset
457 feq_tmp->event = event;
Dave Love <fx@gnu.org>
parents:
diff changeset
458 feq_tmp->next = feq;
Dave Love <fx@gnu.org>
parents:
diff changeset
459 feq = feq_tmp;
Dave Love <fx@gnu.org>
parents:
diff changeset
460 }
Dave Love <fx@gnu.org>
parents:
diff changeset
461 else if (_XMEventHandler) (*_XMEventHandler)(&event);
Dave Love <fx@gnu.org>
parents:
diff changeset
462 }
Dave Love <fx@gnu.org>
parents:
diff changeset
463 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
464 * If a selection has been made, break out of the event loop.
Dave Love <fx@gnu.org>
parents:
diff changeset
465 */
Dave Love <fx@gnu.org>
parents:
diff changeset
466 if (selection == True) break;
Dave Love <fx@gnu.org>
parents:
diff changeset
467 }
Dave Love <fx@gnu.org>
parents:
diff changeset
468
Dave Love <fx@gnu.org>
parents:
diff changeset
469 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
470 * Unmap the menu.
Dave Love <fx@gnu.org>
parents:
diff changeset
471 */
Dave Love <fx@gnu.org>
parents:
diff changeset
472 for ( p_ptr = menu->p_list->next;
Dave Love <fx@gnu.org>
parents:
diff changeset
473 p_ptr != menu->p_list;
Dave Love <fx@gnu.org>
parents:
diff changeset
474 p_ptr = p_ptr->next)
Dave Love <fx@gnu.org>
parents:
diff changeset
475 {
Dave Love <fx@gnu.org>
parents:
diff changeset
476 XUnmapWindow(display, p_ptr->window);
Dave Love <fx@gnu.org>
parents:
diff changeset
477 }
Dave Love <fx@gnu.org>
parents:
diff changeset
478
Dave Love <fx@gnu.org>
parents:
diff changeset
479 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
480 * Ungrab the mouse.
Dave Love <fx@gnu.org>
parents:
diff changeset
481 */
Dave Love <fx@gnu.org>
parents:
diff changeset
482 XUngrabPointer(display, CurrentTime);
44752
17275bfd5698 Add calls to GrabKeyboard to remove strange
Jan Djärv <jan.h.d@swipnet.se>
parents: 30365
diff changeset
483 XUngrabKeyboard(display, CurrentTime);
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
484
Dave Love <fx@gnu.org>
parents:
diff changeset
485 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
486 * Restore bits under where the menu was if we managed
Dave Love <fx@gnu.org>
parents:
diff changeset
487 * to save them and free the pixmap.
Dave Love <fx@gnu.org>
parents:
diff changeset
488 */
Dave Love <fx@gnu.org>
parents:
diff changeset
489
Dave Love <fx@gnu.org>
parents:
diff changeset
490 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
491 * If there is a current selection deactivate it.
Dave Love <fx@gnu.org>
parents:
diff changeset
492 */
Dave Love <fx@gnu.org>
parents:
diff changeset
493 if (cur_s != NULL) cur_s->activated = 0;
Dave Love <fx@gnu.org>
parents:
diff changeset
494
Dave Love <fx@gnu.org>
parents:
diff changeset
495 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
496 * Deactivate the current pane.
Dave Love <fx@gnu.org>
parents:
diff changeset
497 */
Dave Love <fx@gnu.org>
parents:
diff changeset
498 cur_p->activated = 0;
Dave Love <fx@gnu.org>
parents:
diff changeset
499 XSetWindowBackgroundPixmap(display, cur_p->window, menu->inact_pixmap);
Dave Love <fx@gnu.org>
parents:
diff changeset
500
Dave Love <fx@gnu.org>
parents:
diff changeset
501 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
502 * Synchronize the X buffers and the X event queue.
Dave Love <fx@gnu.org>
parents:
diff changeset
503 */
Dave Love <fx@gnu.org>
parents:
diff changeset
504 XSync(display, 0);
Dave Love <fx@gnu.org>
parents:
diff changeset
505
Dave Love <fx@gnu.org>
parents:
diff changeset
506 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
507 * Dispatch any events remaining on the queue.
Dave Love <fx@gnu.org>
parents:
diff changeset
508 */
Dave Love <fx@gnu.org>
parents:
diff changeset
509 while (QLength(display)) {
Dave Love <fx@gnu.org>
parents:
diff changeset
510 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
511 * Fetch the next event.
Dave Love <fx@gnu.org>
parents:
diff changeset
512 */
Dave Love <fx@gnu.org>
parents:
diff changeset
513 XNextEvent(display, &event);
Dave Love <fx@gnu.org>
parents:
diff changeset
514
Dave Love <fx@gnu.org>
parents:
diff changeset
515 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
516 * Discard any events left on the queue that belong to XMenu.
Dave Love <fx@gnu.org>
parents:
diff changeset
517 * All others are held and then returned to the event queue.
Dave Love <fx@gnu.org>
parents:
diff changeset
518 */
Dave Love <fx@gnu.org>
parents:
diff changeset
519 switch (event.type) {
Dave Love <fx@gnu.org>
parents:
diff changeset
520 case Expose:
Dave Love <fx@gnu.org>
parents:
diff changeset
521 case EnterNotify:
Dave Love <fx@gnu.org>
parents:
diff changeset
522 case LeaveNotify:
Dave Love <fx@gnu.org>
parents:
diff changeset
523 case ButtonPress:
Dave Love <fx@gnu.org>
parents:
diff changeset
524 case ButtonRelease:
Dave Love <fx@gnu.org>
parents:
diff changeset
525 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
526 * Does this event belong to one of XMenu's windows?
Dave Love <fx@gnu.org>
parents:
diff changeset
527 * If so, discard it and process the next event.
Dave Love <fx@gnu.org>
parents:
diff changeset
528 * If not fall through and treat it as a foreign event.
Dave Love <fx@gnu.org>
parents:
diff changeset
529 */
Dave Love <fx@gnu.org>
parents:
diff changeset
530 event_xmp = (XMPane *)XLookUpAssoc(
Dave Love <fx@gnu.org>
parents:
diff changeset
531 display,
Dave Love <fx@gnu.org>
parents:
diff changeset
532 menu->assoc_tab,
Dave Love <fx@gnu.org>
parents:
diff changeset
533 event.xbutton.window
Dave Love <fx@gnu.org>
parents:
diff changeset
534 );
Dave Love <fx@gnu.org>
parents:
diff changeset
535 if (event_xmp != NULL) continue;
Dave Love <fx@gnu.org>
parents:
diff changeset
536 default:
Dave Love <fx@gnu.org>
parents:
diff changeset
537 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
538 * This is a foreign event.
Dave Love <fx@gnu.org>
parents:
diff changeset
539 * Queue it for later return to the X event queue.
Dave Love <fx@gnu.org>
parents:
diff changeset
540 */
Dave Love <fx@gnu.org>
parents:
diff changeset
541 feq_tmp = (XMEventQue *)malloc(sizeof(XMEventQue));
Dave Love <fx@gnu.org>
parents:
diff changeset
542 if (feq_tmp == NULL) {
Dave Love <fx@gnu.org>
parents:
diff changeset
543 _XMErrorCode = XME_CALLOC;
Dave Love <fx@gnu.org>
parents:
diff changeset
544 return(XM_FAILURE);
Dave Love <fx@gnu.org>
parents:
diff changeset
545 }
Dave Love <fx@gnu.org>
parents:
diff changeset
546 feq_tmp->event = event;
Dave Love <fx@gnu.org>
parents:
diff changeset
547 feq_tmp->next = feq;
Dave Love <fx@gnu.org>
parents:
diff changeset
548 feq = feq_tmp;
Dave Love <fx@gnu.org>
parents:
diff changeset
549 }
Dave Love <fx@gnu.org>
parents:
diff changeset
550 }
Dave Love <fx@gnu.org>
parents:
diff changeset
551 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
552 * Return any foreign events that were queued to the X event queue.
Dave Love <fx@gnu.org>
parents:
diff changeset
553 */
Dave Love <fx@gnu.org>
parents:
diff changeset
554 while (feq != NULL) {
Dave Love <fx@gnu.org>
parents:
diff changeset
555 feq_tmp = feq;
Dave Love <fx@gnu.org>
parents:
diff changeset
556 XPutBackEvent(display, &feq_tmp->event);
Dave Love <fx@gnu.org>
parents:
diff changeset
557 feq = feq_tmp->next;
Dave Love <fx@gnu.org>
parents:
diff changeset
558 free((char *)feq_tmp);
Dave Love <fx@gnu.org>
parents:
diff changeset
559 }
Dave Love <fx@gnu.org>
parents:
diff changeset
560
Dave Love <fx@gnu.org>
parents:
diff changeset
561 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
562 * Return successfully.
Dave Love <fx@gnu.org>
parents:
diff changeset
563 */
Dave Love <fx@gnu.org>
parents:
diff changeset
564 _XMErrorCode = XME_NO_ERROR;
Dave Love <fx@gnu.org>
parents:
diff changeset
565 return(ret_val);
Dave Love <fx@gnu.org>
parents:
diff changeset
566
Dave Love <fx@gnu.org>
parents:
diff changeset
567 }