comparison src/frame.h @ 215:1f0dabaa0855 r20-4b6

Import from CVS: tag r20-4b6
author cvs
date Mon, 13 Aug 2007 10:07:35 +0200
parents 3d6bfa290dbd
children d44af0c54775
comparison
equal deleted inserted replaced
214:c5d88c05e1e9 215:1f0dabaa0855
105 subtracted before the windows are arranged. Window and buffer 105 subtracted before the windows are arranged. Window and buffer
106 local toolbars overlay their windows. */ 106 local toolbars overlay their windows. */
107 Lisp_Object toolbar_size[4]; 107 Lisp_Object toolbar_size[4];
108 /* Visibility of the toolbars. This acts as a valve for toolbar_size. */ 108 /* Visibility of the toolbars. This acts as a valve for toolbar_size. */
109 Lisp_Object toolbar_visible_p[4]; 109 Lisp_Object toolbar_visible_p[4];
110 /* Thickness of the border around the toolbar. */
111 Lisp_Object toolbar_border_width[4];
110 #endif 112 #endif
111 113
112 /* A structure of auxiliary data specific to the device type. 114 /* A structure of auxiliary data specific to the device type.
113 struct x_frame is used for X window frames; defined in console-x.h */ 115 struct x_frame is used for X window frames; defined in console-x.h */
114 void *frame_data; 116 void *frame_data;
401 #ifdef HAVE_TOOLBARS 403 #ifdef HAVE_TOOLBARS
402 #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) \ 404 #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) \
403 (!NILP ((f)->toolbar_visible_p[pos])) 405 (!NILP ((f)->toolbar_visible_p[pos]))
404 #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) \ 406 #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) \
405 (XINT ((f)->toolbar_size[pos])) 407 (XINT ((f)->toolbar_size[pos]))
408 #define FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \
409 (XINT ((f)->toolbar_border_width[pos]))
406 #else 410 #else
407 #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) 0 411 #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) 0
408 #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) 0 412 #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) 0
413 #define FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) 0
409 #endif 414 #endif
410 415
411 #define FRAME_THEORETICAL_TOOLBAR_SIZE(f, pos) \ 416 #define FRAME_THEORETICAL_TOOLBAR_SIZE(f, pos) \
412 (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \ 417 (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \
413 ? FRAME_RAW_THEORETICAL_TOOLBAR_SIZE (f, pos) \ 418 ? FRAME_RAW_THEORETICAL_TOOLBAR_SIZE (f, pos) \
420 #define FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH(f) \ 425 #define FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH(f) \
421 FRAME_THEORETICAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR) 426 FRAME_THEORETICAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR)
422 #define FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH(f) \ 427 #define FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH(f) \
423 FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR) 428 FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR)
424 429
430 #define FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \
431 (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos) \
432 ? FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, pos) \
433 : 0)
434
435 #define FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH(f) \
436 FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR)
437 #define FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \
438 FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR)
439 #define FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \
440 FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR)
441 #define FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \
442 FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR)
443
425 /* This returns the window-local value rather than the frame-local value; 444 /* This returns the window-local value rather than the frame-local value;
426 that tells you about what's actually visible rather than what should 445 that tells you about what's actually visible rather than what should
427 be used when computing the frame size. */ 446 be used when computing the frame size. */
428 447
429 #ifdef HAVE_TOOLBARS 448 #ifdef HAVE_TOOLBARS
430 #define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) \ 449 #define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) \
431 (!NILP (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_visible_p[pos])) 450 (!NILP (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_visible_p[pos]))
451 #define FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \
452 (XINT (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_border_width[pos]))
432 #define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) \ 453 #define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) \
433 (XINT (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos])) 454 (XINT (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar_size[pos]))
434 #define FRAME_REAL_TOOLBAR(f, pos) \ 455 #define FRAME_REAL_TOOLBAR(f, pos) \
435 (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar[pos]) 456 (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->toolbar[pos])
436 #else 457 #else
437 #define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) 0 458 #define FRAME_RAW_REAL_TOOLBAR_VISIBLE(f, pos) 0
459 #define FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH(f, pos) 0
438 #define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) 0 460 #define FRAME_RAW_REAL_TOOLBAR_SIZE(f, pos) 0
439 #define FRAME_REAL_TOOLBAR(f, pos) Qnil 461 #define FRAME_REAL_TOOLBAR(f, pos) Qnil
440 #endif 462 #endif
441 463
442 /* Note to Chuck 464 /* Note to Chuck
465 #define FRAME_REAL_TOOLBAR_SIZE(f, pos) \ 487 #define FRAME_REAL_TOOLBAR_SIZE(f, pos) \
466 (FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \ 488 (FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \
467 && !NILP (FRAME_REAL_TOOLBAR (f, pos)) \ 489 && !NILP (FRAME_REAL_TOOLBAR (f, pos)) \
468 ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) \ 490 ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) \
469 : 0) 491 : 0)
492 #define FRAME_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \
493 (FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \
494 && !NILP (FRAME_REAL_TOOLBAR (f, pos)) \
495 ? FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH (f, pos) \
496 : 0)
470 497
471 #define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \ 498 #define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \
472 FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR) 499 FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR)
473 #define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \ 500 #define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \
474 FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR) 501 FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR)
475 #define FRAME_REAL_LEFT_TOOLBAR_WIDTH(f) \ 502 #define FRAME_REAL_LEFT_TOOLBAR_WIDTH(f) \
476 FRAME_REAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR) 503 FRAME_REAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR)
477 #define FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) \ 504 #define FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) \
478 FRAME_REAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR) 505 FRAME_REAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR)
479 506
507 #define FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH(f) \
508 FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR)
509 #define FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \
510 FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR)
511 #define FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \
512 FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR)
513 #define FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \
514 FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR)
515
480 #define FRAME_REAL_TOP_TOOLBAR_VISIBLE(f) \ 516 #define FRAME_REAL_TOP_TOOLBAR_VISIBLE(f) \
481 FRAME_REAL_TOOLBAR_VISIBLE (f, TOP_TOOLBAR) 517 FRAME_REAL_TOOLBAR_VISIBLE (f, TOP_TOOLBAR)
482 #define FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE(f) \ 518 #define FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE(f) \
483 FRAME_REAL_TOOLBAR_VISIBLE (f, BOTTOM_TOOLBAR) 519 FRAME_REAL_TOOLBAR_VISIBLE (f, BOTTOM_TOOLBAR)
484 #define FRAME_REAL_LEFT_TOOLBAR_VISIBLE(f) \ 520 #define FRAME_REAL_LEFT_TOOLBAR_VISIBLE(f) \
485 FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_TOOLBAR) 521 FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_TOOLBAR)
486 #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \ 522 #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \
487 FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR) 523 FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR)
488 524
489 #define FRAME_TOP_BORDER_START(f) (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f)) 525 #define FRAME_TOP_BORDER_START(f) \
526 (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + \
527 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f))
490 #define FRAME_TOP_BORDER_END(f) \ 528 #define FRAME_TOP_BORDER_END(f) \
491 (FRAME_TOP_BORDER_START (f) + FRAME_BORDER_HEIGHT (f)) 529 (FRAME_TOP_BORDER_START (f) + FRAME_BORDER_HEIGHT (f))
492 530
493 #define FRAME_BOTTOM_BORDER_START(f) \ 531 #define FRAME_BOTTOM_BORDER_START(f) \
494 (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) - \ 532 (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) - \
495 FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f)) 533 FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \
534 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f))
496 #define FRAME_BOTTOM_BORDER_END(f) \ 535 #define FRAME_BOTTOM_BORDER_END(f) \
497 (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f)) 536 (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \
498 537 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f))
499 #define FRAME_LEFT_BORDER_START(f) (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f)) 538
539 #define FRAME_LEFT_BORDER_START(f) \
540 (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + \
541 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f))
500 #define FRAME_LEFT_BORDER_END(f) \ 542 #define FRAME_LEFT_BORDER_END(f) \
501 (FRAME_LEFT_BORDER_START (f) + FRAME_BORDER_WIDTH (f)) 543 (FRAME_LEFT_BORDER_START (f) + FRAME_BORDER_WIDTH (f))
502 544
503 #define FRAME_RIGHT_BORDER_START(f) \ 545 #define FRAME_RIGHT_BORDER_START(f) \
504 (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) - \ 546 (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) - \
505 FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f)) 547 2 * FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f))
506 #define FRAME_RIGHT_BORDER_END(f) \ 548 #define FRAME_RIGHT_BORDER_END(f) \
507 (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f)) 549 (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - \
550 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f))
508 551
509 /* Equivalent in FSF Emacs: 552 /* Equivalent in FSF Emacs:
510 553
511 FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a 554 FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
512 `for' loop which iterates over the elements of Vframe_list. The 555 `for' loop which iterates over the elements of Vframe_list. The