Mercurial > emacs
annotate oldXMenu/AddPane.c @ 83009:b2b37c85b00a
Numerous bugfixes and small improvements.
lisp/bindings.el (mode-line-frame-identification): Use %T, not %F.
lisp/faces.el (x-create-frame-with-faces): Added
frame-creation-function parameter.
(tty-create-frame-with-faces): Ditto.
lisp/frame.el (frame-creation-function): Make it frame-local.
(select-frame-set-input-focus): Use the window-system function, not
the variable.
lisp/server.el (server-handle-delete-tty): Make sure the client
process is removed from server-clients after the delete-process call.
It seems that the sentinel is not called. Added docs.
(server-process-filter): Immediately add the client to server-clients
when a new termcap frame is created. Fixed a case of `not' called
with two parameters. Ignore errors while sending the evaluation
result back to the client.
(server-kill-buffer-query-function): Don't ask the user if the server
process is already dead.
lisp/term/x-win.el: Don't change mode-line-frame-identification.
src/buffer.c (syms_of_buffer): Added %T to the docs of mode-line-format.
src/dispnew.c (init_display): Increment the reference count of the new
termcap display.
src/frame.c (make_terminal_frame): Set the old top frame's visibility
to `obscured'.
(Fmake_terminal_frame): Look at the current termcap display's name,
not just the similar frame parameter. Try to get the type from the
current display first, and only then from Vdefault_frame_alist.
src/keyboard.c (handle_interrupt): New function to separate the signal
handling from C-g processing.
(interrupt_signal): Call handle_interrupt to do the real work.
(kbd_buffer_store_event): Use handle_interrupt instead of interrupt_signal.
(cmd_error_internal): Use FRAME_INITIAL_P instead of ugly hacks.
src/termhooks.h (initial_display): New declaration.
src/xdisp.c (decode_mode_spec): Added '%T' (termcap-only frame name).
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-49
| author | Karoly Lorentey <lorentey@elte.hu> |
|---|---|
| date | Sat, 10 Jan 2004 12:56:22 +0000 |
| parents | f0eb34e60705 |
| children | 8e5779acd195 |
| rev | line source |
|---|---|
| 25858 | 1 #include "copyright.h" |
| 2 | |
|
53224
f0eb34e60705
tag of miles@gnu.org--gnu-2003/emacs--cvs-trunk--0--patch-137
Karoly Lorentey <lorentey@elte.hu>
parents:
52401
diff
changeset
|
3 /* $Header: /cvsroot/emacs/emacs/oldXMenu/AddPane.c,v 1.3 2003/09/01 15:45:47 miles Exp $ */ |
| 25858 | 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) | |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
21 Display *display; |
| 25858 | 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. */ | |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
28 |
| 25858 | 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 } | |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
53 |
| 25858 | 54 /* |
| 55 * Determine label size. | |
| 56 */ | |
| 57 label_length = strlen(label); | |
| 58 label_width = XTextWidth(menu->p_fnt_info, | |
| 59 label, | |
| 60 label_length); | |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
61 |
| 25858 | 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 /* | |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
90 * Update the pane count. |
| 25858 | 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 } | |
| 52401 | 105 |
| 106 /* arch-tag: 62a26021-f29d-48ba-96ef-3b6c4ebd6547 | |
| 107 (do not change this comment) */ |
