Mercurial > emacs
annotate oldXMenu/DelPane.c @ 70960:d876c40c06dd
* fileio.c (Fcopy_file): Delete argument MUSTBENEW. Incorporate
the exclusive file-opening functionality into the behavior when
OK-IF-ALREADY-EXISTS is nil.
(Frename_file): Call Fcopy_file without MUSTBENEW argument.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Fri, 26 May 2006 15:18:28 +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 * XMenuDeletePane - Deletes a pane 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 XMenuDeletePane(display, menu, p_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 { | |
25 register XMPane *p_ptr; /* Pointer to pane being deleted. */ | |
26 register XMSelect *s_ptr; /* Pointer to selections being deleted. */ | |
27 register XMSelect *s_next; /* Pointer to next selection to be 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 * Remove the pane from the association table. | |
37 */ | |
38 XDeleteAssoc(display, menu->assoc_tab, p_ptr->window); | |
39 | |
40 /* | |
41 * Remove the pane from the pane list and update | |
42 * the pane count. | |
43 */ | |
44 emacs_remque(p_ptr); | |
45 menu->p_count--; | |
46 | |
47 /* | |
48 * Remove all the selections in the pane from the | |
49 * association table and free their XMSelect structures. | |
50 */ | |
51 for ( | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
52 s_ptr = p_ptr->s_list->next; |
25858 | 53 s_ptr != p_ptr->s_list; |
54 s_ptr = s_next | |
55 ) { | |
56 XDeleteAssoc(display, menu->assoc_tab, s_ptr->window); | |
57 s_next = s_ptr->next; | |
58 free(s_ptr); | |
59 } | |
60 free(p_ptr->s_list); | |
61 | |
62 if (p_ptr->window) { | |
63 /* | |
64 * Destroy the selection transparencies. | |
65 */ | |
66 XDestroySubwindows(display, p_ptr->window); | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
67 |
25858 | 68 /* |
69 * Destroy the pane window. | |
70 */ | |
71 XDestroyWindow(display, p_ptr->window); | |
72 } | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
73 |
25858 | 74 /* |
75 * Free the pane's XMPane structure. | |
76 */ | |
77 free(p_ptr); | |
78 | |
79 /* | |
80 * Schedule a recompute. | |
81 */ | |
82 menu->recompute = 1; | |
83 | |
84 /* | |
85 * Return the pane number just deleted. | |
86 */ | |
87 _XMErrorCode = XME_NO_ERROR; | |
88 return(p_num); | |
89 } | |
52401 | 90 |
91 /* arch-tag: 32a5bfd4-4bac-4090-bb53-844110f4908e | |
92 (do not change this comment) */ |