Mercurial > emacs
annotate lib-src/b2m.c @ 1717:aa7d6d57504b
* frame.h (struct frame): New fields `can_have_scrollbars' and
`has_vertical_scrollbars'.
(FRAME_CAN_HAVE_SCROLLBARS, FRAME_HAS_VERTICAL_SCROLLBARS): New
accessors, for both the MULTI_FRAME and non-MULTI_FRAME.
(VERTICAL_SCROLLBAR_WIDTH, WINDOW_VERTICAL_SCROLLBAR,
WINDOW_VERTICAL_SCROLLBAR_COLUMN,
WINDOW_VERTICAL_SCROLLBAR_HEIGHT): New macros.
* window.h (struct window): New field `vertical_scrollbar'.
* xterm.h (struct x_display): vertical_scrollbars,
judge_timestamp, vertical_scrollbar_extra: New fields.
(struct scrollbar): New struct.
(VERTICAL_SCROLLBAR_PIXEL_WIDTH, VERTICAL_SCROLLBAR_PIXEL_HEIGHT,
VERTICAL_SCROLLBAR_LEFT_BORDER, VERTICAL_SCROLLBAR_RIGHT_BORDER,
VERTICAL_SCROLLBAR_TOP_BORDER, VERTICAL_SCROLLBAR_BOTTOM_BORDER,
CHAR_TO_PIXEL_WIDTH, CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_WIDTH,
PIXEL_TO_CHAR_HEIGHT): New accessors and macros.
* frame.c (make_frame): Initialize the `can_have_scrollbars' and
`has_vertical_scrollbars' fields of the frame.
* term.c (term_init): Note that TERMCAP terminals don't support
scrollbars.
(mouse_position_hook): Document new args.
(set_vertical_scrollbar_hook, condemn_scrollbars_hook,
redeem_scrollbar_hook, judge_scrollbars_hook): New hooks.
* termhooks.h: Declare and document them.
(enum scrollbar_part): New type.
(struct input_event): Describe the new form of the scrollbar_click
event type. Change `part' from a Lisp_Object to an enum
scrollbar_part. Add a new field `scrollbar'.
* keyboard.c (kbd_buffer_get_event): Pass appropriate new
parameters to *mouse_position_hook, and make_lispy_movement.
* xfns.c (x_set_vertical_scrollbar): New function.
(x_figure_window_size): Use new macros to calculate frame size.
(Fx_create_frame): Note that X Windows frames do support scroll
bars. Default to "yes".
* xterm.c: #include <X11/cursorfont.h> and "window.h".
(x_vertical_scrollbar_cursor): New variable.
(x_term_init): Initialize it.
(last_mouse_bar, last_mouse_bar_frame, last_mouse_part,
last_mouse_scroll_range_start, last_mouse_scroll_range_end): New
variables.
(XTmouse_position): Use them to return scrollbar movement events.
Take new arguments, for that purpose.
(x_window_to_scrollbar, x_scrollbar_create,
x_scrollbar_set_handle, x_scrollbar_remove, x_scrollbar_move,
XTset_scrollbar, XTcondemn_scrollbars, XTredeem_scrollbar,
XTjudge_scrollbars, x_scrollbar_expose,
x_scrollbar_background_expose, x_scrollbar_handle_click,
x_scrollbar_handle_motion): New functions to implement scrollbars.
(x_term_init): Set the termhooks.h hooks to point to them.
(x_set_window_size): Use new macros to calculate frame size. Set
vertical_scrollbar_extra field.
(x_make_frame_visible): Use the frame accessor
FRAME_HAS_VERTICAL_SCROLLBARS to decide if we need to map the
frame's subwindows as well.
(XTread_socket): Use new size-calculation macros from xterm.h when
processing ConfigureNotify events.
(x_wm_set_size_hint): Use PIXEL_TO_CHAR_WIDTH and
PIXEL_TO_CHAR_HEIGHT macros.
* ymakefile (xdisp.o): This now depends on termhooks.h.
(xterm.o): This now depends on window.h.
| author | Jim Blandy <jimb@redhat.com> |
|---|---|
| date | Thu, 24 Dec 1992 06:17:18 +0000 |
| parents | 61c6983219ff |
| children | df8249aa4901 |
| rev | line source |
|---|---|
| 440 | 1 /* |
| 2 * b2m - a filter for Babyl -> Unix mail files | |
| 3 * | |
| 4 * usage: b2m < babyl > mailbox | |
| 5 * | |
| 6 * I find this useful whenever I have to use a | |
| 7 * system which - shock horror! - doesn't run | |
| 8 * Gnu emacs. At least now I can read all my | |
| 9 * Gnumacs Babyl format mail files! | |
| 10 * | |
| 11 * it's not much but it's free! | |
| 12 * | |
| 13 * Ed Wilkinson | |
| 14 * E.Wilkinson@massey.ac.nz | |
| 15 * Mon Nov 7 15:54:06 PDT 1988 | |
| 16 */ | |
| 17 | |
| 18 #include <stdio.h> | |
| 19 #include <time.h> | |
| 998 | 20 |
| 21 #include "../src/config.h" | |
| 22 | |
| 23 #ifdef USG | |
| 24 #include <string.h> | |
| 25 #else | |
| 440 | 26 #include <strings.h> |
| 998 | 27 #endif |
| 440 | 28 |
| 29 /* BSD's strings.h does not declare the type of strtok. */ | |
| 30 extern char *strtok (); | |
| 31 | |
| 32 #define TRUE (1) | |
| 33 #define FALSE (0) | |
| 34 | |
| 35 int header = FALSE, printing; | |
| 36 long ltoday; | |
| 37 char from[256], labels[256], data[256], *p, *today; | |
| 38 | |
| 39 main(argc, argv) | |
| 40 char **argv; | |
| 41 { | |
| 42 ltoday = time(0); | |
| 43 today = ctime(<oday); | |
| 44 | |
| 45 if (gets(data)) | |
| 46 if (strcmp(data, "BABYL OPTIONS:")) { | |
| 47 fprintf(stderr, "b2m: not a Babyl mailfile!\n"); | |
| 48 exit(-1); | |
| 49 } else | |
| 50 printing = FALSE; | |
| 51 else | |
| 52 exit(-1); | |
| 53 if (printing) | |
| 54 puts(data); | |
| 55 | |
| 56 while (gets(data)) { | |
| 57 if (!strcmp(data, "")) | |
| 58 exit(0); | |
| 59 | |
| 60 if (!strcmp(data, "*** EOOH ***") && !printing) { | |
| 61 printing = header = TRUE; | |
| 62 printf("From b2m %s", today); | |
| 63 continue; | |
| 64 } | |
| 65 | |
| 66 if (!strcmp(data, "")) { | |
| 67 /* save labels */ | |
| 68 gets(data); | |
| 69 p = strtok(data, " ,\r\n\t"); | |
| 70 strcpy(labels, "X-Babyl-Labels: "); | |
| 71 | |
| 72 while (p = strtok(NULL, " ,\r\n\t")) { | |
| 73 strcat(labels, p); | |
| 74 strcat(labels, ", "); | |
| 75 } | |
| 76 | |
| 77 labels[strlen(labels) - 2] = '\0'; | |
| 78 printing = header = FALSE; | |
| 79 continue; | |
| 80 } | |
| 81 | |
| 82 if (!strlen(data) && header) { | |
| 83 header = FALSE; | |
| 84 if (strcmp(labels, "X-Babyl-Labels")) | |
| 85 puts(labels); | |
| 86 } | |
| 87 | |
| 88 if (printing) | |
| 89 puts(data); | |
| 90 } | |
| 91 } |
