Mercurial > emacs
annotate oldXMenu/InsSel.c @ 110781:664402ada542
Misc cleanup for doc/*/Makefiles.
* doc/misc/Makefile.in (SHELL): Set it.
(info): Move the mkdir dependency to the individual info files.
(mostlyclean): Tidy up.
(clean): Only delete the specific dvi and pdf files.
(maintainer-clean): Be more restrictive in what we delete.
* doc/lispref/Makefile.in: Rearrange to more closely resemble
doc/emacs/Makefile.
(INSTALL_INFO): Remove unused variable.
(mostlyclean, infoclean, dist): New rules.
(clean): Delete dvi and pdf files.
(maintainer-clean): Remove elisp.oaux, use infoclean.
* doc/lispintro/Makefile.in (SHELL): Use /bin/sh, like every other Makefile.in.
(INFO_SOURCES, INFO_TARGETS, DVI_TARGETS): Remove variables.
($(infodir), html, pdf, infoclean, dist): New rules.
(${infodir}/eintr): Ensure $infodir exists. Use $@.
(emacs-lisp-intro.dvi, emacs-lisp-intro.pdf, emacs-lisp-intro.html): Use $^.
(.PHONY): Declare clean rules.
(mostlyclean): Delete more temp files.
(clean): Delete specific dvi, pdf and html files.
(maintainer-clean): Use infoclean.
(.NOEXPORT): Remove, unused by any other Makefile.in.
* doc/emacs/Makefile.in (EMACS_XTRA): Add the main source file.
(emacs-xtra.dvi, emacs-xtra.pdf): Remove explicit emacs-xtra.texi.
(mostlyclean): No core files, reorder other files.
(clean): Delete specific dvi and pdf files.
(infoclean, dist): New rules.
(maintainer-clean): Use infoclean.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Tue, 05 Oct 2010 19:26:38 -0700 |
parents | 5cc91198ffb2 |
children | ef719132ddfa |
rev | line source |
---|---|
76174
fec5e03aaf59
Remove FSF copyright since file does not differ significantly from X11
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
1 /* Copyright Massachusetts Institute of Technology 1985 */ |
fec5e03aaf59
Remove FSF copyright since file does not differ significantly from X11
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
2 |
25858 | 3 #include "copyright.h" |
4 | |
5 | |
6 /* | |
7 * XMenu: MIT Project Athena, X Window system menu package | |
8 * | |
9 * XMenuInsertSelection - Inserts a selection into an XMenu object | |
10 * | |
11 * Author: Tony Della Fera, DEC | |
12 * 20-Nov-85 | |
13 * | |
14 */ | |
15 | |
16 #include <config.h> | |
17 #include "XMenuInt.h" | |
18 | |
19 int | |
109124
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
20 XMenuInsertSelection(register XMenu *menu, register int p_num, register int s_num, char *data, char *label, int active) |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
21 /* Menu object to be modified. */ |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
22 /* Pane number to be modified. */ |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
23 /* Selection number of new selection. */ |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
24 /* Data value. */ |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
25 /* Selection label. */ |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
26 /* Make selection active? */ |
25858 | 27 { |
28 register XMPane *p_ptr; /* XMPane pointer. */ | |
29 register XMSelect *s_ptr; /* XMSelect pointer. */ | |
30 | |
31 XMSelect *select; /* Newly created selection. */ | |
32 | |
33 int label_length; /* Label length in characters. */ | |
34 int label_width; /* Label width in pixels. */ | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
35 |
25858 | 36 /* |
37 * Check for NULL pointers! | |
38 */ | |
39 if (label == NULL) { | |
40 _XMErrorCode = XME_ARG_BOUNDS; | |
41 return(XM_FAILURE); | |
42 } | |
43 | |
44 /* | |
45 * Find the right pane. | |
46 */ | |
47 p_ptr = _XMGetPanePtr(menu, p_num); | |
48 if (p_ptr == NULL) return(XM_FAILURE); | |
49 | |
50 /* | |
51 * Find the selection number one less than the one specified since that | |
52 * is the selection after which the insertion will occur. | |
53 */ | |
54 s_ptr = _XMGetSelectionPtr(p_ptr, (s_num - 1)); | |
55 if (s_ptr == NULL) return(XM_FAILURE); | |
56 | |
57 /* | |
58 * Calloc the XMSelect structure. | |
59 */ | |
60 select = (XMSelect *)calloc(1, sizeof(XMSelect)); | |
61 if (select == NULL) { | |
62 _XMErrorCode = XME_CALLOC; | |
63 return(XM_FAILURE); | |
64 } | |
65 | |
66 /* | |
67 * Determine label size. | |
68 */ | |
69 label_length = strlen(label); | |
70 label_width = XTextWidth(menu->s_fnt_info, label, label_length); | |
71 | |
72 | |
73 /* | |
74 * Fill the XMSelect structure. | |
75 */ | |
76 if (!strcmp (label, "--") || !strcmp (label, "---")) | |
77 { | |
78 select->type = SEPARATOR; | |
79 select->active = 0; | |
80 } | |
81 else | |
82 { | |
83 select->type = SELECTION; | |
84 select->active = active; | |
85 } | |
86 | |
87 select->active = active; | |
88 select->serial = -1; | |
89 select->label = label; | |
90 select->label_width = label_width; | |
91 select->label_length = label_length; | |
92 select->data = data; | |
93 select->parent_p = p_ptr; | |
94 | |
95 /* | |
96 * Insert the selection after the selection with the selection | |
97 * number one less than the desired number for the new selection. | |
98 */ | |
99 emacs_insque(select, s_ptr); | |
100 | |
101 /* | |
102 * Update the selection count. | |
103 */ | |
104 p_ptr->s_count++; | |
105 | |
106 /* | |
107 * Schedule a recompute. | |
108 */ | |
109 menu->recompute = 1; | |
110 | |
111 /* | |
112 * Return the selection number just inserted. | |
113 */ | |
114 _XMErrorCode = XME_NO_ERROR; | |
115 return(s_num); | |
116 } | |
52401 | 117 |
118 /* arch-tag: 8398626f-81cb-4e13-8ebc-aac1b9237663 | |
119 (do not change this comment) */ |