Mercurial > emacs
annotate oldXMenu/AddPane.c @ 31404:f2ab9420390f
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el: (toplevel): Don't require `dired' at run-time.
(vc-dired-resynch-file): Remove autoload cookie.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
* vc.el: Made several backend functions optional.
(vc-default-responsible-p): New function.
(vc-merge): Use RET for first version to trigger merge-news, not
prefix arg.
(vc-annotate): Handle backends that do not support annotation.
(vc-default-merge-news): Removed. The existence of a merge-news
implementation is now checked on caller sites.
* vc-hooks.el (vc-default-mode-line-string): Removed CVS special
case.
* vc-cvs.el (vc-cvs-mode-line-string): New function, handles the
special case that has been removed from the default in vc-hooks.el.
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el (vc-log-edit): Properly handle the case where FILE is nil.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
* vc-hooks.el: Require vc during compilation.
(vc-file-setprop): Use `vc-touched-properties' if bound by the new
macro `with-vc-properties' in vc.el.
(vc-file-getprop): Doc fix.
(vc-after-save): Call `vc-dired-resynch-file' only if vc is loaded.
* vc.el: Require dired-aux during compilation.
(vc-name-assoc-file): Moved to vc-sccs.el.
(with-vc-properties): New macro.
(vc-checkin, vc-checkout, vc-revert, vc-cancel-version,
vc-finish-steal): Use it.
(vc-cancel-version): Moved RCS-specific code to vc-rcs.el. The call
to the backend-specific function is now supposed to do the checkout,
too.
(vc-log-edit): Handle FILE being nil and added a FIXME for log-edit.
* vc-cvs.el (vc-cvs-checkin, vc-cvs-checkout): Don't bother to
set file properties; that gets done in the generic code now.
* vc-rcs.el (vc-rcs-uncheck): Renamed to `vc-rcs-cancel-version'.
Changed parameter list, added code from vc.el that does the
checkout, possibly with a double-take.
* vc-sccs.el (vc-sccs-name-assoc-file): Moved here from vc.el.
(vc-sccs-add-triple, vc-sccs-rename-file, vc-sccs-lookup-triple): Use
the above under the new name.
(vc-sccs-uncheck): Renamed to `vc-sccs-cancel-version'. Changed
parameter list, added checkout command.
(vc-sccs-checkin, vc-sccs-checkout): Don't bother to set file
properties; that gets done in the generic code now.
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el: Docstring fixes (courtesy of checkdoc).
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
* vc.el (vc-checkout-writable-buffer-hook)
(vc-checkout-writable-buffer): Remove.
(vc-start-entry): Always call vc-log-edit, never vc-log-mode.
(vc-log-mode): Make it into a clean derived major mode.
(vc-log-edit): Mark buffer unmodified (as vc-log-mode did) and use
vc-log-mode if log-edit is not available.
(vc-dired-mode-map): Don't set-keymap-parent yet.
(vc-dired-mode): Do set-keymap-parent here.
(vc-dired-buffers-for-dir): Nop if dired is not loaded.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 05 Sep 2000 20:08:22 +0000 |
parents | bbce331da1be |
children | 23a1cea22d13 |
rev | line source |
---|---|
25858 | 1 #include "copyright.h" |
2 | |
3 /* $Header: /u/src/emacs/19.0/oldXMenu/RCS/AddPane.c,v 1.1 1992/04/11 22:10:17 jimb Exp $ */ | |
4 /* Copyright Massachusetts Institute of Technology 1985 */ | |
5 | |
6 /* | |
7 * XMenu: MIT Project Athena, X Window system menu package | |
8 * | |
9 * XMenuAddPane - Adds a pane to an XMenu object. | |
10 * | |
11 * Author: Tony Della Fera, DEC | |
12 * August, 1985 | |
13 * | |
14 */ | |
15 | |
16 #include <config.h> | |
17 #include "XMenuInt.h" | |
18 | |
19 int | |
20 XMenuAddPane(display, menu, label, active) | |
21 Display *display; | |
22 register XMenu *menu; /* Menu object to be modified. */ | |
23 register char *label; /* Selection label. */ | |
24 int active; /* Make selection active? */ | |
25 { | |
26 register XMPane *pane; /* Newly created pane. */ | |
27 register XMSelect *select; /* Initial selection for the new pane. */ | |
28 | |
29 int label_length; /* Label length in characters. */ | |
30 int label_width; /* Label width in pixels. */ | |
31 | |
32 /* | |
33 * Check for NULL pointers! | |
34 */ | |
35 if (label == NULL) { | |
36 _XMErrorCode = XME_ARG_BOUNDS; | |
37 return(XM_FAILURE); | |
38 } | |
39 | |
40 /* | |
41 * Calloc the XMPane structure and the initial XMSelect. | |
42 */ | |
43 pane = (XMPane *)calloc(1, sizeof(XMPane)); | |
44 if (pane == NULL) { | |
45 _XMErrorCode = XME_CALLOC; | |
46 return(XM_FAILURE); | |
47 } | |
48 select = (XMSelect *)calloc(1, sizeof(XMSelect)); | |
49 if (select == NULL) { | |
50 _XMErrorCode = XME_CALLOC; | |
51 return(XM_FAILURE); | |
52 } | |
53 | |
54 /* | |
55 * Determine label size. | |
56 */ | |
57 label_length = strlen(label); | |
58 label_width = XTextWidth(menu->p_fnt_info, | |
59 label, | |
60 label_length); | |
61 | |
62 /* | |
63 * Set up the initial selection. | |
64 * Values not explicitly set are zeroed by calloc. | |
65 */ | |
66 select->next = select; | |
67 select->prev = select; | |
68 select->type = SL_HEADER; | |
69 select->serial = -1; | |
70 select->parent_p = pane; | |
71 | |
72 /* | |
73 * Fill the XMPane structure. | |
74 * X and Y position are set to 0 since a recompute will follow. | |
75 */ | |
76 pane->type = PANE; | |
77 pane->active = active; | |
78 pane->serial = -1; | |
79 pane->label = label; | |
80 pane->label_width = label_width; | |
81 pane->label_length = label_length; | |
82 pane->s_list = select; | |
83 | |
84 /* | |
85 * Insert the pane at the end of the pane list. | |
86 */ | |
87 emacs_insque(pane, menu->p_list->prev); | |
88 | |
89 /* | |
90 * Update the pane count. | |
91 */ | |
92 menu->p_count++; | |
93 | |
94 /* | |
95 * Schedule a recompute. | |
96 */ | |
97 menu->recompute = 1; | |
98 | |
99 /* | |
100 * Return the pane number just added. | |
101 */ | |
102 _XMErrorCode = XME_NO_ERROR; | |
103 return((menu->p_count - 1)); | |
104 } |