Mercurial > emacs
annotate oldXMenu/DelSel.c @ 71787:7e302766894f
(forw_comment): Also use EMACS_INT for buffer positions.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 11 Jul 2006 13:52:21 +0000 |
parents | e8a3fb527b77 |
children | ce127a46b1ca d04d8ccb3c41 c5406394f567 |
rev | line source |
---|---|
25858 | 1 #include "copyright.h" |
2 | |
3 /* Copyright Massachusetts Institute of Technology 1985 */ | |
68640
e8a3fb527b77
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65000
diff
changeset
|
4 /* Copyright (C) 2002, 2003, 2004, 2005, |
e8a3fb527b77
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
65000
diff
changeset
|
5 2006 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) */ |