Mercurial > emacs
annotate oldXMenu/Post.c @ 75486:b477debfe297
Revert previous change while we figure out if it was correct.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sun, 28 Jan 2007 21:40:03 +0000 |
parents | 3d45362f1d38 |
children | fec5e03aaf59 b8d9a391daf3 95d0cdf160ea |
rev | line source |
---|---|
25858 | 1 #include "copyright.h" |
2 | |
3 /* Copyright Massachusetts Institute of Technology 1985 */ | |
74548 | 4 /* Copyright (C) 2001, 2002, 2003, 2004, 2005, |
75348 | 5 2006, 2007 Free Software Foundation, Inc. */ |
25858 | 6 |
7 /* | |
8 * XMenu: MIT Project Athena, X Window system menu package | |
9 * | |
10 * XMenuPost - Maps a given menu to the display and activates | |
11 * the menu for user selection. The user is allowed to | |
12 * specify the mouse button event mask that will be used | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27456
diff
changeset
|
13 * to identify a selection request. When a selection |
25858 | 14 * request is received (i.e., when the specified mouse |
15 * event occurs) the data returned will be either the | |
16 * data associated with the particular selection active | |
17 * at the time of the selection request or NULL if no | |
18 * selection was active. A menu selection is shown to | |
19 * be active by placing a highlight box around the | |
20 * selection as the mouse cursor enters its active | |
21 * region. Inactive selections will not be highlighted. | |
22 * As the mouse cursor moved from one menu pane | |
23 * to another menu pane the pane being entered is raised | |
24 * and activated and the pane being left is deactivated. | |
25 * If an error occurs NULL will be returned with the | |
26 * p_num set to POST_ERROR, s_num set to | |
27 * NO_SELECTION and _XMErrorCode set to an | |
28 * appropriate value. | |
29 * Every time the routine returns successfully the | |
30 * p_num and s_num indices will be set to indicate | |
31 * the currently active pane and/or selection. If the | |
32 * mouse was not in a selection window at the time | |
33 * s_num will be set to NO_SELECTION. | |
34 * | |
35 * Author: Tony Della Fera, DEC | |
36 * August, 1984 | |
37 * | |
38 */ | |
39 | |
40 #include "XMenuInt.h" | |
41 | |
42 char * | |
43 XMenuPost(display, menu, p_num, s_num, x_pos, y_pos, event_mask) | |
44 register Display *display; /* Previously opened display. */ | |
45 register XMenu *menu; /* Menu to post. */ | |
46 register int *p_num; /* Pane number selected. */ | |
47 register int *s_num; /* Selection number selected. */ | |
48 register int x_pos; /* X coordinate of menu position. */ | |
49 register int y_pos; /* Y coordinate of menu position. */ | |
50 int event_mask; /* Mouse button event mask. */ | |
51 { | |
52 register int stat; /* Routine call return status. */ | |
53 char *data; /* Return data. */ | |
54 | |
55 /* | |
56 * Set up initial pane and selection assumptions. | |
57 */ | |
58 | |
59 /* | |
60 * Make the procedure call. | |
61 */ | |
62 stat = XMenuActivate( | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27456
diff
changeset
|
63 display, |
25858 | 64 menu, |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27456
diff
changeset
|
65 p_num, s_num, |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27456
diff
changeset
|
66 x_pos, y_pos, |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27456
diff
changeset
|
67 event_mask, |
27456
4a9ea0d1735b
(XMenuPost): Pass null help callback to XMenuActivate.
Gerd Moellmann <gerd@gnu.org>
parents:
25858
diff
changeset
|
68 &data, 0); |
25858 | 69 |
70 /* | |
71 * Check the return value and return accordingly. | |
72 */ | |
73 switch (stat) { | |
74 case XM_FAILURE: | |
75 *p_num = POST_ERROR; | |
76 *s_num = NO_SELECTION; | |
77 return(NULL); | |
78 case XM_NO_SELECT: | |
79 case XM_IA_SELECT: | |
80 *s_num = NO_SELECTION; | |
81 return(NULL); | |
82 case XM_SUCCESS: | |
83 default: | |
84 return(data); | |
85 } | |
86 } | |
52401 | 87 |
88 /* arch-tag: 7b6104e5-fa32-4342-aa17-05296a30dd70 | |
89 (do not change this comment) */ |