comparison src/frame.h @ 16270:4547dae187e9

(vertical_scroll_bar_type): Add enumerated none/left/right type for identifying vertical scroll bars. (struct frame): Use vertical_scroll_bar_type. (FRAME_HAS_VERTICAL_SCROLL_BARS): Use vertical scroll bar type. (FRAME_VERTICAL_SCROLL_BAR_TYPE): New macro. (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT): New macros. (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT): New macros. (FRAME_SCROLL_BAR_WIDTH, FRAME_LEFT_SCROLL_BAR_WIDTH): New macros. (FRAME_WINDOW_WIDTH, FRAME_WINDOW_WIDTH_ARG): New macros. (SET_FRAME_WIDTH): New macro. (WINDOW_VERTICAL_SCROLL_BAR_COLUMN): Modify to handle left-side croll bars too.
author Richard M. Stallman <rms@gnu.org>
date Sat, 21 Sep 1996 22:31:58 +0000
parents ccf489f8596e
children 91846d76268d
comparison
equal deleted inserted replaced
16269:79e6c47054c5 16270:4547dae187e9
32 32
33 /* The structure representing a frame. */ 33 /* The structure representing a frame. */
34 34
35 enum output_method 35 enum output_method
36 { output_termcap, output_x_window, output_msdos_raw, output_win32 }; 36 { output_termcap, output_x_window, output_msdos_raw, output_win32 };
37
38 enum vertical_scroll_bar_type
39 { vertical_scroll_bar_none, vertical_scroll_bar_left, vertical_scroll_bar_right };
37 40
38 struct frame 41 struct frame
39 { 42 {
40 EMACS_INT size; 43 EMACS_INT size;
41 struct Lisp_Vector *next; 44 struct Lisp_Vector *next;
245 support scroll bars. */ 248 support scroll bars. */
246 char can_have_scroll_bars; 249 char can_have_scroll_bars;
247 250
248 /* If can_have_scroll_bars is non-zero, this is non-zero if we should 251 /* If can_have_scroll_bars is non-zero, this is non-zero if we should
249 actually display them on this frame. */ 252 actually display them on this frame. */
250 char has_vertical_scroll_bars; 253 enum vertical_scroll_bar_type vertical_scroll_bar_type;
251 254
252 /* Non-0 means raise this frame to the top of the heap when selected. */ 255 /* Non-0 means raise this frame to the top of the heap when selected. */
253 char auto_raise; 256 char auto_raise;
254 257
255 /* Non-0 means lower this frame to the bottom of the stack when left. */ 258 /* Non-0 means lower this frame to the bottom of the stack when left. */
357 #define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost 360 #define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost
358 #define FRAME_MESSAGE_BUF(f) (f)->message_buf 361 #define FRAME_MESSAGE_BUF(f) (f)->message_buf
359 #define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos 362 #define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos
360 #define FRAME_FOCUS_FRAME(f) (f)->focus_frame 363 #define FRAME_FOCUS_FRAME(f) (f)->focus_frame
361 #define FRAME_CAN_HAVE_SCROLL_BARS(f) ((f)->can_have_scroll_bars) 364 #define FRAME_CAN_HAVE_SCROLL_BARS(f) ((f)->can_have_scroll_bars)
362 #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) ((f)->has_vertical_scroll_bars) 365 #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type)
366 #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
367 ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none)
368 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
369 ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
370 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
371 ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)
363 #define FRAME_SCROLL_BAR_PIXEL_WIDTH(f) ((f)->scroll_bar_pixel_width) 372 #define FRAME_SCROLL_BAR_PIXEL_WIDTH(f) ((f)->scroll_bar_pixel_width)
364 #define FRAME_SCROLL_BAR_COLS(f) ((f)->scroll_bar_cols) 373 #define FRAME_SCROLL_BAR_COLS(f) ((f)->scroll_bar_cols)
374 #define FRAME_LEFT_SCROLL_BAR_WIDTH(f) \
375 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
376 ? FRAME_SCROLL_BAR_COLS (f) \
377 : 0)
378 #define FRAME_SCROLL_BAR_WIDTH(f) \
379 (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
380 ? FRAME_SCROLL_BAR_COLS (f) \
381 : 0)
382 #define FRAME_WINDOW_WIDTH_ARG(f, width) \
383 ((width) + FRAME_SCROLL_BAR_WIDTH (f))
384 #define FRAME_WINDOW_WIDTH(f) ((f)->width + FRAME_SCROLL_BAR_WIDTH (f))
385 #define SET_FRAME_WIDTH(f,val) ((f)->width = (val))
365 #define FRAME_SCROLL_BARS(f) ((f)->scroll_bars) 386 #define FRAME_SCROLL_BARS(f) ((f)->scroll_bars)
366 #define FRAME_CONDEMNED_SCROLL_BARS(f) ((f)->condemned_scroll_bars) 387 #define FRAME_CONDEMNED_SCROLL_BARS(f) ((f)->condemned_scroll_bars)
367 #define FRAME_MENU_BAR_ITEMS(f) ((f)->menu_bar_items) 388 #define FRAME_MENU_BAR_ITEMS(f) ((f)->menu_bar_items)
368 #define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate) 389 #define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate)
369 390
446 for window W. The column before this one is the last column we can 467 for window W. The column before this one is the last column we can
447 use for text. If the window touches the right edge of the frame, 468 use for text. If the window touches the right edge of the frame,
448 we have extra space allocated for it. Otherwise, the scroll bar 469 we have extra space allocated for it. Otherwise, the scroll bar
449 takes over the window's rightmost columns. */ 470 takes over the window's rightmost columns. */
450 #define WINDOW_VERTICAL_SCROLL_BAR_COLUMN(w) \ 471 #define WINDOW_VERTICAL_SCROLL_BAR_COLUMN(w) \
451 (((XINT ((w)->left) + XINT ((w)->width)) \ 472 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (XFRAME (WINDOW_FRAME (w))) ? \
452 < FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \ 473 (((XINT ((w)->left) + XINT ((w)->width)) \
453 ? (XINT ((w)->left) + XINT ((w)->width) \ 474 < FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \
454 - FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (w)))) \ 475 ? (XINT ((w)->left) + XINT ((w)->width) \
455 : FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) 476 - FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (w)))) \
477 : FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \
478 : XINT ((w)->left))
456 479
457 /* Return the height in lines of the vertical scroll bar in w. If the 480 /* Return the height in lines of the vertical scroll bar in w. If the
458 window has a mode line, don't make the scroll bar extend that far. */ 481 window has a mode line, don't make the scroll bar extend that far. */
459 #define WINDOW_VERTICAL_SCROLL_BAR_HEIGHT(w) (window_internal_height (w)) 482 #define WINDOW_VERTICAL_SCROLL_BAR_HEIGHT(w) (window_internal_height (w))