Mercurial > emacs
annotate oldXMenu/DelSel.c @ 75592:fa3660d23cc6
(Attribute Functions): Fix name and description of the UNDERLINE arg
of `set-face-underline-p'.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 01 Feb 2007 16:37:35 +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 * XMenuDeleteSelection - Deletes a selection from an XMenu object. | |
11 * | |
12 * Author: Tony Della Fera, DEC | |
13 * 20-Nov-85 | |
14 * | |
15 */ | |
16 | |
17 #include "XMenuInt.h" | |
18 | |
19 int | |
20 XMenuDeleteSelection(display, menu, p_num, s_num) | |
21 register Display *display; /* Previously opened display. */ | |
22 register XMenu *menu; /* Menu object to be modified. */ | |
23 register int p_num; /* Pane number to be deleted. */ | |
24 register int s_num; /* Selection number to be deleted. */ | |
25 { | |
26 register XMPane *p_ptr; /* Pointer to pane being deleted. */ | |
27 register XMSelect *s_ptr; /* Pointer to selections being deleted. */ | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
28 |
25858 | 29 /* |
30 * Find the right pane. | |
31 */ | |
32 p_ptr = _XMGetPanePtr(menu, p_num); | |
33 if (p_ptr == NULL) return(XM_FAILURE); | |
34 | |
35 /* | |
36 * Find the right selection. | |
37 */ | |
38 s_ptr = _XMGetSelectionPtr(p_ptr, s_num); | |
39 if (s_ptr == NULL) return(XM_FAILURE); | |
40 | |
41 /* | |
42 * Remove the selection from the association table. | |
43 */ | |
44 XDeleteAssoc(display, menu->assoc_tab, s_ptr->window); | |
45 | |
46 /* | |
47 * Remove the selection from the parent pane's selection | |
48 * list and update the selection count. | |
49 */ | |
50 emacs_remque(s_ptr); | |
51 p_ptr->s_count--; | |
52 | |
53 /* | |
54 * Destroy the selection transparency. | |
55 */ | |
56 if (s_ptr->window) XDestroyWindow(display, s_ptr->window); | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
57 |
25858 | 58 /* |
59 * Free the selection's XMSelect structure. | |
60 */ | |
61 free(s_ptr); | |
62 | |
63 /* | |
64 * Schedule a recompute. | |
65 */ | |
66 menu->recompute = 1; | |
67 | |
68 /* | |
69 * Return the selection number just deleted. | |
70 */ | |
71 _XMErrorCode = XME_NO_ERROR; | |
72 return(s_num); | |
73 } | |
52401 | 74 |
75 /* arch-tag: 24ca2bc7-8a37-471a-8095-e6363fc1ed10 | |
76 (do not change this comment) */ |