Mercurial > emacs
comparison src/frame.h @ 16051:ccf489f8596e
Removed support for !MULTI_FRAME.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sun, 01 Sep 1996 21:04:32 +0000 |
parents | d01198d2bc40 |
children | 4547dae187e9 |
comparison
equal
deleted
inserted
replaced
16050:c2805a244171 | 16051:ccf489f8596e |
---|---|
28 /* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by | 28 /* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by |
29 print. */ | 29 print. */ |
30 extern int message_buf_print; | 30 extern int message_buf_print; |
31 | 31 |
32 | 32 |
33 /* The structure representing a frame. | 33 /* The structure representing a frame. */ |
34 | |
35 We declare this even if MULTI_FRAME is not defined, because when | |
36 we lack multi-frame support, we use one instance of this structure | |
37 to represent the one frame we support. This is cleaner than | |
38 having miscellaneous random variables scattered about. */ | |
39 | 34 |
40 enum output_method | 35 enum output_method |
41 { output_termcap, output_x_window, output_msdos_raw, output_win32 }; | 36 { output_termcap, output_x_window, output_msdos_raw, output_win32 }; |
42 | 37 |
43 struct frame | 38 struct frame |
292 /* Nonzero if the mouse has moved on this display | 287 /* Nonzero if the mouse has moved on this display |
293 since the last time we checked. */ | 288 since the last time we checked. */ |
294 char mouse_moved; | 289 char mouse_moved; |
295 }; | 290 }; |
296 | 291 |
297 #ifdef MULTI_KBOARD /* Note that MULTI_KBOARD implies MULTI_FRAME */ | 292 #ifdef MULTI_KBOARD |
298 #define FRAME_KBOARD(f) ((f)->kboard) | 293 #define FRAME_KBOARD(f) ((f)->kboard) |
299 #else | 294 #else |
300 #define FRAME_KBOARD(f) (&the_only_kboard) | 295 #define FRAME_KBOARD(f) (&the_only_kboard) |
301 #endif | 296 #endif |
302 | |
303 #ifdef MULTI_FRAME | |
304 | 297 |
305 typedef struct frame *FRAME_PTR; | 298 typedef struct frame *FRAME_PTR; |
306 | 299 |
307 #define XFRAME(p) ((struct frame *) XPNTR (p)) | 300 #define XFRAME(p) ((struct frame *) XPNTR (p)) |
308 #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME)) | 301 #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME)) |
420 loop will set FRAME_VAR, a Lisp_Object, to each frame in | 413 loop will set FRAME_VAR, a Lisp_Object, to each frame in |
421 Vframe_list in succession and execute the statement. LIST_VAR | 414 Vframe_list in succession and execute the statement. LIST_VAR |
422 should be a Lisp_Object too; it is used to iterate through the | 415 should be a Lisp_Object too; it is used to iterate through the |
423 Vframe_list. | 416 Vframe_list. |
424 | 417 |
425 If MULTI_FRAME isn't defined, then this loop expands to something which | 418 This macro is a holdover from a time when multiple frames weren't always |
426 executes the statement once. */ | 419 supported. An alternate definition of the macro would expand to |
420 something which executes the statement once. */ | |
427 #define FOR_EACH_FRAME(list_var, frame_var) \ | 421 #define FOR_EACH_FRAME(list_var, frame_var) \ |
428 for ((list_var) = Vframe_list; \ | 422 for ((list_var) = Vframe_list; \ |
429 (CONSP (list_var) \ | 423 (CONSP (list_var) \ |
430 && (frame_var = XCONS (list_var)->car, 1)); \ | 424 && (frame_var = XCONS (list_var)->car, 1)); \ |
431 list_var = XCONS (list_var)->cdr) | 425 list_var = XCONS (list_var)->cdr) |
444 extern Lisp_Object Vframe_list; | 438 extern Lisp_Object Vframe_list; |
445 extern Lisp_Object Vdefault_frame_alist; | 439 extern Lisp_Object Vdefault_frame_alist; |
446 | 440 |
447 extern Lisp_Object Vterminal_frame; | 441 extern Lisp_Object Vterminal_frame; |
448 | 442 |
449 #else /* not MULTI_FRAME */ | 443 /* Device-independent scroll bar stuff. */ |
450 | |
451 /* These definitions are used in a single-frame version of Emacs. */ | |
452 | |
453 /* A frame we use to store all the data concerning the screen when we | |
454 don't have multiple frames. Remember, if you store any data in it | |
455 which needs to be protected from GC, you should staticpro that | |
456 element explicitly. */ | |
457 extern struct frame the_only_frame; | |
458 | |
459 typedef struct frame *FRAME_PTR; | |
460 #ifdef __GNUC__ | |
461 /* A function call for always getting 0 is overkill, so... */ | |
462 #define WINDOW_FRAME(w) ({ Lisp_Object tem; XSETFASTINT (tem, 0); tem; }) | |
463 #else | |
464 #define WINDOW_FRAME(w) (Fselected_frame ()) | |
465 #endif | |
466 #define XSETFRAME(p, v) (p = WINDOW_FRAME (***bogus***)) | |
467 #define XFRAME(frame) (&the_only_frame) | |
468 | |
469 extern FRAME_PTR selected_frame; | |
470 extern FRAME_PTR last_nonminibuf_frame; | |
471 | |
472 #define FRAME_LIVE_P(f) 1 | |
473 #define FRAME_MSDOS_P(f) 0 | |
474 #ifdef MSDOS | |
475 /* The following definitions could also be used in the non-MSDOS case, | |
476 but the constants below lead to better code. */ | |
477 #define FRAME_TERMCAP_P(f) (the_only_frame.output_method == output_termcap) | |
478 #define FRAME_X_P(f) (the_only_frame.output_method != output_termcap) | |
479 #else | |
480 #define FRAME_TERMCAP_P(f) 1 | |
481 #define FRAME_X_P(f) 0 | |
482 #endif | |
483 #define FRAME_WINDOW_P(f) FRAME_X_P (f) | |
484 #define FRAME_MINIBUF_ONLY_P(f) 0 | |
485 #define FRAME_HAS_MINIBUF_P(f) 1 | |
486 #define FRAME_CURRENT_GLYPHS(f) (the_only_frame.current_glyphs) | |
487 #define FRAME_DESIRED_GLYPHS(f) (the_only_frame.desired_glyphs) | |
488 #define FRAME_TEMP_GLYPHS(f) (the_only_frame.temp_glyphs) | |
489 #define FRAME_HEIGHT(f) (the_only_frame.height) | |
490 #define FRAME_WIDTH(f) (the_only_frame.width) | |
491 #define FRAME_NEW_HEIGHT(f) (the_only_frame.new_height) | |
492 #define FRAME_NEW_WIDTH(f) (the_only_frame.new_width) | |
493 #define FRAME_MENU_BAR_LINES(f) (the_only_frame.menu_bar_lines) | |
494 #define FRAME_CURSOR_X(f) (the_only_frame.cursor_x) | |
495 #define FRAME_CURSOR_Y(f) (the_only_frame.cursor_y) | |
496 #define FRAME_SET_VISIBLE(f,p) (p) | |
497 #define FRAME_VISIBLE_P(f) 1 | |
498 #define SET_FRAME_GARBAGED(f) (frame_garbaged = 1) | |
499 #define FRAME_GARBAGED_P(f) (frame_garbaged) | |
500 #define FRAME_NO_SPLIT_P(f) 0 | |
501 #define FRAME_WANTS_MODELINE_P(f) 1 | |
502 #define FRAME_ICONIFIED_P(f) 0 | |
503 #define FRAME_WINDOW_SIZES_CHANGED(f) the_only_frame.window_sizes_changed | |
504 #define FRAME_MINIBUF_WINDOW(f) (minibuf_window) | |
505 #define FRAME_ROOT_WINDOW(f) (the_only_frame.root_window) | |
506 #define FRAME_SELECTED_WINDOW(f) (selected_window) | |
507 #define SET_GLYPHS_FRAME(glyphs,frame) do ; while (0) | |
508 #define FRAME_INSERT_COST(frame) (the_only_frame.insert_line_cost) | |
509 #define FRAME_DELETE_COST(frame) (the_only_frame.delete_line_cost) | |
510 #define FRAME_INSERTN_COST(frame) (the_only_frame.insert_n_lines_cost) | |
511 #define FRAME_DELETEN_COST(frame) (the_only_frame.delete_n_lines_cost) | |
512 #define FRAME_MESSAGE_BUF(f) (the_only_frame.message_buf) | |
513 #define FRAME_SCROLL_BOTTOM_VPOS(f) (the_only_frame.scroll_bottom_vpos) | |
514 #define FRAME_FOCUS_FRAME(f) (Qnil) | |
515 #define FRAME_CAN_HAVE_SCROLL_BARS(f) (the_only_frame.can_have_scroll_bars) | |
516 #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \ | |
517 (the_only_frame.has_vertical_scroll_bars) | |
518 #define FRAME_SCROLL_BAR_PIXEL_WIDTH(f) (the_only_frame.scroll_bar_pixel_width) | |
519 #define FRAME_SCROLL_BAR_COLS(f) (the_only_frame.scroll_bar_cols) | |
520 #define FRAME_SCROLL_BARS(f) (the_only_frame.scroll_bars) | |
521 #define FRAME_CONDEMNED_SCROLL_BARS(f) (the_only_frame.condemned_scroll_bars) | |
522 #define FRAME_MENU_BAR_ITEMS(f) (the_only_frame.menu_bar_items) | |
523 #define FRAME_COST_BAUD_RATE(f) (the_only_frame.cost_calculation_baud_rate) | |
524 | |
525 /* See comments in definition above. */ | |
526 #define FRAME_SAMPLE_VISIBILITY(f) (0) | |
527 | |
528 #define CHECK_FRAME(x, i) do; while (0) | |
529 #define CHECK_LIVE_FRAME(x, y) do; while (0) | |
530 | |
531 /* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a | |
532 `for' loop which iterates over the elements of Vframe_list. The | |
533 loop will set FRAME_VAR, a Lisp_Object, to each frame in | |
534 Vframe_list in succession and execute the statement. LIST_VAR | |
535 should be a Lisp_Object too; it is used to iterate through the | |
536 Vframe_list. | |
537 | |
538 If MULTI_FRAME _is_ defined, then this loop expands to a real | |
539 `for' loop which traverses Vframe_list using LIST_VAR and | |
540 FRAME_VAR. */ | |
541 #define FOR_EACH_FRAME(list_var, frame_var) \ | |
542 for (list_var = Qt; frame_var = WINDOW_FRAME (***bogus***), ! NILP (list_var); list_var = Qnil) | |
543 | |
544 #endif /* not MULTI_FRAME */ | |
545 | |
546 | |
547 /* Device- and MULTI_FRAME-independent scroll bar stuff. */ | |
548 | 444 |
549 /* Return the starting column (zero-based) of the vertical scroll bar | 445 /* Return the starting column (zero-based) of the vertical scroll bar |
550 for window W. The column before this one is the last column we can | 446 for window W. The column before this one is the last column we can |
551 use for text. If the window touches the right edge of the frame, | 447 use for text. If the window touches the right edge of the frame, |
552 we have extra space allocated for it. Otherwise, the scroll bar | 448 we have extra space allocated for it. Otherwise, the scroll bar |