diff options
| -rw-r--r-- | src/window.h | 435 |
1 files changed, 406 insertions, 29 deletions
diff --git a/src/window.h b/src/window.h index c5da959c238..ab9469a2619 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */ | |||
| 24 | 24 | ||
| 25 | #include "dispextern.h" | 25 | #include "dispextern.h" |
| 26 | 26 | ||
| 27 | extern Lisp_Object Qleft, Qright; | ||
| 28 | |||
| 27 | /* Windows are allocated as if they were vectors, but then the | 29 | /* Windows are allocated as if they were vectors, but then the |
| 28 | Lisp data type is changed to Lisp_Window. They are garbage | 30 | Lisp data type is changed to Lisp_Window. They are garbage |
| 29 | collected along with the vectors. | 31 | collected along with the vectors. |
| @@ -108,11 +110,11 @@ struct window | |||
| 108 | Lisp_Object parent; | 110 | Lisp_Object parent; |
| 109 | /* The upper left corner coordinates of this window, | 111 | /* The upper left corner coordinates of this window, |
| 110 | as integers relative to upper left corner of frame = 0, 0 */ | 112 | as integers relative to upper left corner of frame = 0, 0 */ |
| 111 | Lisp_Object left; | 113 | Lisp_Object left_col; |
| 112 | Lisp_Object top; | 114 | Lisp_Object top_line; |
| 113 | /* The size of the window */ | 115 | /* The size of the window */ |
| 114 | Lisp_Object height; | 116 | Lisp_Object total_lines; |
| 115 | Lisp_Object width; | 117 | Lisp_Object total_cols; |
| 116 | /* The buffer displayed in this window */ | 118 | /* The buffer displayed in this window */ |
| 117 | /* Of the fields vchild, hchild and buffer, only one is non-nil. */ | 119 | /* Of the fields vchild, hchild and buffer, only one is non-nil. */ |
| 118 | Lisp_Object buffer; | 120 | Lisp_Object buffer; |
| @@ -160,8 +162,22 @@ struct window | |||
| 160 | 162 | ||
| 161 | /* Width of left and right marginal areas. A value of nil means | 163 | /* Width of left and right marginal areas. A value of nil means |
| 162 | no margin. */ | 164 | no margin. */ |
| 163 | Lisp_Object left_margin_width; | 165 | Lisp_Object left_margin_cols, right_margin_cols; |
| 164 | Lisp_Object right_margin_width; | 166 | |
| 167 | /* Width of left and right fringes. | ||
| 168 | A value of nil or t means use frame values. */ | ||
| 169 | Lisp_Object left_fringe_width, right_fringe_width; | ||
| 170 | |||
| 171 | /* Non-nil means fringes are drawn outside display margins; | ||
| 172 | othersize draw them between margin areas and text. */ | ||
| 173 | Lisp_Object fringes_outside_margins; | ||
| 174 | |||
| 175 | /* Pixel width of scroll bars. | ||
| 176 | A value of nil or t means use frame values. */ | ||
| 177 | Lisp_Object scroll_bar_width; | ||
| 178 | /* Type of vertical scroll bar. A value of nil means | ||
| 179 | no scroll bar. A value of t means use frame value. */ | ||
| 180 | Lisp_Object vertical_scroll_bar_type; | ||
| 165 | 181 | ||
| 166 | /* The rest are currently not used or only half used */ | 182 | /* The rest are currently not used or only half used */ |
| 167 | /* Frame coords of mark as of last time display completed */ | 183 | /* Frame coords of mark as of last time display completed */ |
| @@ -211,7 +227,7 @@ struct window | |||
| 211 | 227 | ||
| 212 | /* Original window height and top before mini-window was | 228 | /* Original window height and top before mini-window was |
| 213 | enlarged. */ | 229 | enlarged. */ |
| 214 | Lisp_Object orig_height, orig_top; | 230 | Lisp_Object orig_total_lines, orig_top_line; |
| 215 | 231 | ||
| 216 | /* No Lisp data may follow below this point without changing | 232 | /* No Lisp data may follow below this point without changing |
| 217 | mark_object in alloc.c. The member current_matrix must be the | 233 | mark_object in alloc.c. The member current_matrix must be the |
| @@ -281,40 +297,400 @@ struct window | |||
| 281 | 297 | ||
| 282 | #define MINI_WINDOW_P(W) (!NILP ((W)->mini_p)) | 298 | #define MINI_WINDOW_P(W) (!NILP ((W)->mini_p)) |
| 283 | 299 | ||
| 284 | /* Return the window column at which the text in window W starts. | 300 | /* General window layout: |
| 285 | This is different from the `left' field because it does not include | 301 | |
| 286 | a left-hand scroll bar if any. */ | 302 | LEFT_EDGE_COL RIGHT_EDGE_COL |
| 303 | | | | ||
| 304 | | | | ||
| 305 | | BOX_LEFT_EDGE_COL | | ||
| 306 | | | BOX_RIGHT_EDGE_COL | | ||
| 307 | | | | | | ||
| 308 | v v v v | ||
| 309 | <-><-><---><-----------><---><-><-> | ||
| 310 | ^ ^ ^ ^ ^ ^ ^ | ||
| 311 | | | | | | | | | ||
| 312 | | | | | | | +-- RIGHT_SCROLL_BAR_COLS | ||
| 313 | | | | | | +----- RIGHT_FRINGE_WIDTH | ||
| 314 | | | | | +--------- RIGHT_MARGIN_COLS | ||
| 315 | | | | | | ||
| 316 | | | | +------------------ TEXT_AREA_COLS | ||
| 317 | | | | | ||
| 318 | | | +--------------------------- LEFT_MARGIN_COLS | ||
| 319 | | +------------------------------- LEFT_FRINGE_WIDTH | ||
| 320 | +---------------------------------- LEFT_SCROLL_BAR_COLS | ||
| 321 | |||
| 322 | */ | ||
| 323 | |||
| 324 | |||
| 325 | /* A handy macro. */ | ||
| 326 | |||
| 327 | #define WINDOW_XFRAME(W) \ | ||
| 328 | (XFRAME (WINDOW_FRAME ((W)))) | ||
| 329 | |||
| 330 | /* Return the canonical column width of the frame of window W. */ | ||
| 331 | |||
| 332 | #define WINDOW_FRAME_COLUMN_WIDTH(W) \ | ||
| 333 | (FRAME_COLUMN_WIDTH (WINDOW_XFRAME ((W)))) | ||
| 334 | |||
| 335 | /* Return the canonical column width of the frame of window W. */ | ||
| 336 | |||
| 337 | #define WINDOW_FRAME_LINE_HEIGHT(W) \ | ||
| 338 | (FRAME_LINE_HEIGHT (WINDOW_XFRAME ((W)))) | ||
| 339 | |||
| 287 | 340 | ||
| 288 | #define WINDOW_LEFT_MARGIN(W) \ | 341 | /* Return the frame width in canonical column units. |
| 289 | (XFASTINT ((W)->left) \ | 342 | This includes scroll bars and fringes. */ |
| 290 | + FRAME_LEFT_SCROLL_BAR_WIDTH (XFRAME (WINDOW_FRAME (W)))) | ||
| 291 | 343 | ||
| 292 | /* Return the window column before which window W ends. | 344 | #define WINDOW_TOTAL_COLS(W) \ |
| 345 | (XFASTINT ((W)->total_cols)) | ||
| 346 | |||
| 347 | /* Return the frame height in canonical line units. | ||
| 348 | This includes header and mode lines, if any. */ | ||
| 349 | |||
| 350 | #define WINDOW_TOTAL_LINES(W) \ | ||
| 351 | (XFASTINT ((W)->total_lines)) | ||
| 352 | |||
| 353 | |||
| 354 | /* Return the total pixel width of window W. */ | ||
| 355 | |||
| 356 | #define WINDOW_TOTAL_WIDTH(W) \ | ||
| 357 | (WINDOW_TOTAL_COLS (W) * WINDOW_FRAME_COLUMN_WIDTH (W)) | ||
| 358 | |||
| 359 | /* Return the total pixel height of window W. */ | ||
| 360 | |||
| 361 | #define WINDOW_TOTAL_HEIGHT(W) \ | ||
| 362 | (WINDOW_TOTAL_LINES (W) * WINDOW_FRAME_LINE_HEIGHT (W)) | ||
| 363 | |||
| 364 | |||
| 365 | /* Return the canonical frame column at which window W starts. | ||
| 366 | This includes a left-hand scroll bar, if any. */ | ||
| 367 | |||
| 368 | #define WINDOW_LEFT_EDGE_COL(W) \ | ||
| 369 | (XFASTINT ((W)->left_col)) | ||
| 370 | |||
| 371 | /* Return the canonical frame column before which window W ends. | ||
| 293 | This includes a right-hand scroll bar, if any. */ | 372 | This includes a right-hand scroll bar, if any. */ |
| 294 | 373 | ||
| 295 | #define WINDOW_RIGHT_EDGE(W) \ | 374 | #define WINDOW_RIGHT_EDGE_COL(W) \ |
| 296 | (XFASTINT ((W)->left) + XFASTINT ((W)->width)) | 375 | (WINDOW_LEFT_EDGE_COL (W) + WINDOW_TOTAL_COLS (W)) |
| 297 | 376 | ||
| 298 | /* Return the window column before which the text in window W ends. | 377 | /* Return the canonical frame line at which window W starts. |
| 299 | This is different from WINDOW_RIGHT_EDGE because it does not include | 378 | This includes a header line, if any. */ |
| 300 | a scroll bar or window-separating line on the right edge. */ | 379 | |
| 380 | #define WINDOW_TOP_EDGE_LINE(W) \ | ||
| 381 | (XFASTINT ((W)->top_line)) | ||
| 382 | |||
| 383 | /* Return the canonical frame line before which window W ends. | ||
| 384 | This includes a mode line, if any. */ | ||
| 385 | |||
| 386 | #define WINDOW_BOTTOM_EDGE_LINE(W) \ | ||
| 387 | (WINDOW_TOP_EDGE_LINE (W) + WINDOW_TOTAL_LINES (W)) | ||
| 388 | |||
| 389 | |||
| 390 | /* Return the frame x-position at which window W starts. | ||
| 391 | This includes a left-hand scroll bar, if any. */ | ||
| 392 | |||
| 393 | #define WINDOW_LEFT_EDGE_X(W) \ | ||
| 394 | (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \ | ||
| 395 | + WINDOW_LEFT_EDGE_COL (W) * WINDOW_FRAME_COLUMN_WIDTH (W)) | ||
| 396 | |||
| 397 | /* Return the frame x- position before which window W ends. | ||
| 398 | This includes a right-hand scroll bar, if any. */ | ||
| 399 | |||
| 400 | #define WINDOW_RIGHT_EDGE_X(W) \ | ||
| 401 | (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \ | ||
| 402 | + WINDOW_RIGHT_EDGE_COL (W) * WINDOW_FRAME_COLUMN_WIDTH (W)) | ||
| 403 | |||
| 404 | /* Return the frame y-position at which window W starts. | ||
| 405 | This includes a header line, if any. */ | ||
| 406 | |||
| 407 | #define WINDOW_TOP_EDGE_Y(W) \ | ||
| 408 | (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \ | ||
| 409 | + WINDOW_TOP_EDGE_LINE (W) * WINDOW_FRAME_LINE_HEIGHT (W)) | ||
| 410 | |||
| 411 | /* Return the frame y-position before which window W ends. | ||
| 412 | This includes a mode line, if any. */ | ||
| 413 | |||
| 414 | #define WINDOW_BOTTOM_EDGE_Y(W) \ | ||
| 415 | (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \ | ||
| 416 | + WINDOW_BOTTOM_EDGE_LINE (W) * WINDOW_FRAME_LINE_HEIGHT (W)) | ||
| 301 | 417 | ||
| 302 | #define WINDOW_RIGHT_MARGIN(W) \ | ||
| 303 | (WINDOW_RIGHT_EDGE (W) \ | ||
| 304 | - (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (XFRAME (WINDOW_FRAME (W))) \ | ||
| 305 | ? FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (W))) \ | ||
| 306 | : 0)) | ||
| 307 | 418 | ||
| 308 | /* 1 if window W takes up the full width of its frame. */ | 419 | /* 1 if window W takes up the full width of its frame. */ |
| 309 | 420 | ||
| 310 | #define WINDOW_FULL_WIDTH_P(W) \ | 421 | #define WINDOW_FULL_WIDTH_P(W) \ |
| 311 | (XFASTINT ((W)->width) == FRAME_WINDOW_WIDTH (XFRAME (WINDOW_FRAME (W)))) | 422 | (WINDOW_TOTAL_COLS (W) == FRAME_TOTAL_COLS (WINDOW_XFRAME (W))) |
| 423 | |||
| 424 | /* 1 if window W's has no other windows to its left in its frame. */ | ||
| 425 | |||
| 426 | #define WINDOW_LEFTMOST_P(W) \ | ||
| 427 | (WINDOW_LEFT_EDGE_COL (W) == 0) | ||
| 312 | 428 | ||
| 313 | /* 1 if window W's has no other windows to its right in its frame. */ | 429 | /* 1 if window W's has no other windows to its right in its frame. */ |
| 314 | 430 | ||
| 315 | #define WINDOW_RIGHTMOST_P(W) \ | 431 | #define WINDOW_RIGHTMOST_P(W) \ |
| 316 | (WINDOW_RIGHT_EDGE (W) == FRAME_WINDOW_WIDTH (XFRAME (WINDOW_FRAME (W)))) | 432 | (WINDOW_RIGHT_EDGE_COL (W) == FRAME_TOTAL_COLS (WINDOW_XFRAME (W))) |
| 433 | |||
| 434 | |||
| 435 | /* Return the frame column at which the text (or left fringe) in | ||
| 436 | window W starts. This is different from the `LEFT_EDGE' because it | ||
| 437 | does not include a left-hand scroll bar if any. */ | ||
| 438 | |||
| 439 | #define WINDOW_BOX_LEFT_EDGE_COL(W) \ | ||
| 440 | (WINDOW_LEFT_EDGE_COL (W) \ | ||
| 441 | + WINDOW_LEFT_SCROLL_BAR_COLS (W)) | ||
| 442 | |||
| 443 | /* Return the window column before which the text in window W ends. | ||
| 444 | This is different from WINDOW_RIGHT_EDGE_COL because it does not | ||
| 445 | include a scroll bar or window-separating line on the right edge. */ | ||
| 446 | |||
| 447 | #define WINDOW_BOX_RIGHT_EDGE_COL(W) \ | ||
| 448 | (WINDOW_RIGHT_EDGE_COL (W) \ | ||
| 449 | - WINDOW_RIGHT_SCROLL_BAR_COLS (W)) | ||
| 450 | |||
| 451 | |||
| 452 | /* Return the frame position at which the text (or left fringe) in | ||
| 453 | window W starts. This is different from the `LEFT_EDGE' because it | ||
| 454 | does not include a left-hand scroll bar if any. */ | ||
| 455 | |||
| 456 | #define WINDOW_BOX_LEFT_EDGE_X(W) \ | ||
| 457 | (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \ | ||
| 458 | + WINDOW_BOX_LEFT_EDGE_COL (W) * WINDOW_FRAME_COLUMN_WIDTH (W)) | ||
| 459 | |||
| 460 | /* Return the window column before which the text in window W ends. | ||
| 461 | This is different from WINDOW_RIGHT_EDGE_COL because it does not | ||
| 462 | include a scroll bar or window-separating line on the right edge. */ | ||
| 463 | |||
| 464 | #define WINDOW_BOX_RIGHT_EDGE_X(W) \ | ||
| 465 | (FRAME_INTERNAL_BORDER_WIDTH (WINDOW_XFRAME (W)) \ | ||
| 466 | + WINDOW_BOX_RIGHT_EDGE_COL (W) * WINDOW_FRAME_COLUMN_WIDTH (W)) | ||
| 467 | |||
| 468 | |||
| 469 | /* Width of left margin area in columns. */ | ||
| 470 | |||
| 471 | #define WINDOW_LEFT_MARGIN_COLS(W) \ | ||
| 472 | (NILP ((W)->left_margin_cols) \ | ||
| 473 | ? 0 \ | ||
| 474 | : XINT ((W)->left_margin_cols)) | ||
| 475 | |||
| 476 | /* Width of right marginal area in columns. */ | ||
| 477 | |||
| 478 | #define WINDOW_RIGHT_MARGIN_COLS(W) \ | ||
| 479 | (NILP ((W)->right_margin_cols) \ | ||
| 480 | ? 0 \ | ||
| 481 | : XINT ((W)->right_margin_cols)) | ||
| 482 | |||
| 483 | /* Width of left margin area in pixels. */ | ||
| 484 | |||
| 485 | #define WINDOW_LEFT_MARGIN_WIDTH(W) \ | ||
| 486 | (NILP ((W)->left_margin_cols) \ | ||
| 487 | ? 0 \ | ||
| 488 | : (XINT ((W)->left_margin_cols) \ | ||
| 489 | * WINDOW_FRAME_COLUMN_WIDTH (W))) | ||
| 490 | |||
| 491 | /* Width of right marginal area in pixels. */ | ||
| 492 | |||
| 493 | #define WINDOW_RIGHT_MARGIN_WIDTH(W) \ | ||
| 494 | (NILP ((W)->right_margin_cols) \ | ||
| 495 | ? 0 \ | ||
| 496 | : (XINT ((W)->right_margin_cols) \ | ||
| 497 | * WINDOW_FRAME_COLUMN_WIDTH (W))) | ||
| 498 | |||
| 499 | /* Total width of fringes reserved for drawing truncation bitmaps, | ||
| 500 | continuation bitmaps and alike. The width is in canonical char | ||
| 501 | units of the frame. This must currently be the case because window | ||
| 502 | sizes aren't pixel values. If it weren't the case, we wouldn't be | ||
| 503 | able to split windows horizontally nicely. */ | ||
| 504 | |||
| 505 | #define WINDOW_FRINGE_COLS(W) \ | ||
| 506 | ((INTEGERP ((W)->left_fringe_width) \ | ||
| 507 | || INTEGERP ((W)->right_fringe_width)) \ | ||
| 508 | ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \ | ||
| 509 | + WINDOW_RIGHT_FRINGE_WIDTH (W) \ | ||
| 510 | + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ | ||
| 511 | / WINDOW_FRAME_COLUMN_WIDTH (W)) \ | ||
| 512 | : FRAME_FRINGE_COLS (WINDOW_XFRAME (W))) | ||
| 513 | |||
| 514 | /* Pixel-width of the left and right fringe. */ | ||
| 515 | |||
| 516 | #define WINDOW_LEFT_FRINGE_WIDTH(W) \ | ||
| 517 | (INTEGERP ((W)->left_fringe_width) \ | ||
| 518 | ? XFASTINT ((W)->left_fringe_width) \ | ||
| 519 | : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W))) | ||
| 520 | |||
| 521 | #define WINDOW_RIGHT_FRINGE_WIDTH(W) \ | ||
| 522 | (INTEGERP ((W)->right_fringe_width) \ | ||
| 523 | ? XFASTINT ((W)->right_fringe_width) \ | ||
| 524 | : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W))) | ||
| 525 | |||
| 526 | /* Total width of fringes in pixels. */ | ||
| 527 | |||
| 528 | #define WINDOW_TOTAL_FRINGE_WIDTH(W) \ | ||
| 529 | (WINDOW_LEFT_FRINGE_WIDTH (W) + WINDOW_RIGHT_FRINGE_WIDTH (W)) | ||
| 530 | |||
| 531 | /* Are fringes outside display margins in window W. */ | ||
| 532 | |||
| 533 | #define WINDOW_HAS_FRINGES_OUTSIDE_MARGINS(W) \ | ||
| 534 | (!NILP ((W)->fringes_outside_margins)) | ||
| 535 | |||
| 536 | /* Say whether scroll bars are currently enabled for window W, | ||
| 537 | and which side they are on. */ | ||
| 538 | |||
| 539 | #define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \ | ||
| 540 | (EQ ((w)->vertical_scroll_bar_type, Qt) \ | ||
| 541 | ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \ | ||
| 542 | : EQ ((w)->vertical_scroll_bar_type, Qleft) \ | ||
| 543 | ? vertical_scroll_bar_left \ | ||
| 544 | : EQ ((w)->vertical_scroll_bar_type, Qright) \ | ||
| 545 | ? vertical_scroll_bar_right \ | ||
| 546 | : vertical_scroll_bar_none) \ | ||
| 547 | |||
| 548 | #define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \ | ||
| 549 | (EQ ((w)->vertical_scroll_bar_type, Qt) \ | ||
| 550 | ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \ | ||
| 551 | : !NILP ((w)->vertical_scroll_bar_type)) | ||
| 552 | |||
| 553 | #define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \ | ||
| 554 | (EQ ((w)->vertical_scroll_bar_type, Qt) \ | ||
| 555 | ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \ | ||
| 556 | : EQ ((w)->vertical_scroll_bar_type, Qleft)) | ||
| 557 | |||
| 558 | #define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \ | ||
| 559 | (EQ ((w)->vertical_scroll_bar_type, Qt) \ | ||
| 560 | ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))\ | ||
| 561 | : EQ ((w)->vertical_scroll_bar_type, Qright)) | ||
| 562 | |||
| 563 | /* Width that a scroll bar in window W should have, if there is one. | ||
| 564 | Measured in pixels. If scroll bars are turned off, this is still | ||
| 565 | nonzero. */ | ||
| 566 | |||
| 567 | #define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \ | ||
| 568 | (INTEGERP ((w)->scroll_bar_width) \ | ||
| 569 | ? XFASTINT ((w)->scroll_bar_width) \ | ||
| 570 | : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w))) | ||
| 571 | |||
| 572 | /* Width that a scroll bar in window W should have, if there is one. | ||
| 573 | Measured in columns (characters). If scroll bars are turned off, | ||
| 574 | this is still nonzero. */ | ||
| 575 | |||
| 576 | #define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \ | ||
| 577 | (INTEGERP ((w)->scroll_bar_width) \ | ||
| 578 | ? ((XFASTINT ((w)->scroll_bar_width) \ | ||
| 579 | + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \ | ||
| 580 | / WINDOW_FRAME_COLUMN_WIDTH (w)) \ | ||
| 581 | : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w))) | ||
| 582 | |||
| 583 | /* Width of a scroll bar in window W, measured in columns (characters), | ||
| 584 | but only if scroll bars are on the left. If scroll bars are on | ||
| 585 | the right in this frame, or there are no scroll bars, value is 0. */ | ||
| 586 | |||
| 587 | #define WINDOW_LEFT_SCROLL_BAR_COLS(w) \ | ||
| 588 | (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ | ||
| 589 | ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w)) \ | ||
| 590 | : 0) | ||
| 591 | |||
| 592 | /* Width of a left scroll bar area in window W , measured in pixels. */ | ||
| 593 | |||
| 594 | #define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \ | ||
| 595 | (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ | ||
| 596 | ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ | ||
| 597 | : 0) | ||
| 598 | |||
| 599 | /* Width of a scroll bar in window W, measured in columns (characters), | ||
| 600 | but only if scroll bars are on the right. If scroll bars are on | ||
| 601 | the left in this frame, or there are no scroll bars, value is 0. */ | ||
| 602 | |||
| 603 | #define WINDOW_RIGHT_SCROLL_BAR_COLS(w) \ | ||
| 604 | (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \ | ||
| 605 | ? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \ | ||
| 606 | : 0) | ||
| 607 | |||
| 608 | /* Width of a left scroll bar area in window W , measured in pixels. */ | ||
| 609 | |||
| 610 | #define WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH(w) \ | ||
| 611 | (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \ | ||
| 612 | ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ | ||
| 613 | : 0) | ||
| 614 | |||
| 615 | |||
| 616 | /* Actual width of a scroll bar in window W, measured in columns. */ | ||
| 617 | |||
| 618 | #define WINDOW_SCROLL_BAR_COLS(w) \ | ||
| 619 | (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \ | ||
| 620 | ? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \ | ||
| 621 | : 0) | ||
| 622 | |||
| 623 | /* Width of a left scroll bar area in window W , measured in pixels. */ | ||
| 624 | |||
| 625 | #define WINDOW_SCROLL_BAR_AREA_WIDTH(w) \ | ||
| 626 | (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \ | ||
| 627 | ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ | ||
| 628 | : 0) | ||
| 629 | |||
| 630 | |||
| 631 | /* Return the frame position where the scroll bar of window W starts. */ | ||
| 632 | |||
| 633 | #define WINDOW_SCROLL_BAR_AREA_X(W) \ | ||
| 634 | (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (W) \ | ||
| 635 | ? WINDOW_BOX_RIGHT_EDGE_X (W) \ | ||
| 636 | : WINDOW_LEFT_EDGE_X (W)) | ||
| 637 | |||
| 638 | |||
| 639 | /* Height in pixels of the mode line. May be zero if W doesn't have a | ||
| 640 | mode line. */ | ||
| 641 | |||
| 642 | #define WINDOW_MODE_LINE_HEIGHT(W) \ | ||
| 643 | (WINDOW_WANTS_MODELINE_P ((W)) \ | ||
| 644 | ? CURRENT_MODE_LINE_HEIGHT (W) \ | ||
| 645 | : 0) | ||
| 646 | |||
| 647 | /* Height in pixels of the header line. Zero if W doesn't have a header | ||
| 648 | line. */ | ||
| 649 | |||
| 650 | #define WINDOW_HEADER_LINE_HEIGHT(W) \ | ||
| 651 | (WINDOW_WANTS_HEADER_LINE_P ((W)) \ | ||
| 652 | ? CURRENT_HEADER_LINE_HEIGHT (W) \ | ||
| 653 | : 0) | ||
| 654 | |||
| 655 | /* Pixel height of window W without mode line. */ | ||
| 656 | |||
| 657 | #define WINDOW_BOX_HEIGHT_NO_MODE_LINE(W) \ | ||
| 658 | (WINDOW_TOTAL_HEIGHT ((W)) \ | ||
| 659 | - WINDOW_MODE_LINE_HEIGHT ((W))) | ||
| 660 | |||
| 661 | /* Pixel height of window W without mode and header line. */ | ||
| 662 | |||
| 663 | #define WINDOW_BOX_TEXT_HEIGHT(W) \ | ||
| 664 | (WINDOW_TOTAL_HEIGHT ((W)) \ | ||
| 665 | - WINDOW_MODE_LINE_HEIGHT ((W)) \ | ||
| 666 | - WINDOW_HEADER_LINE_HEIGHT ((W))) | ||
| 667 | |||
| 668 | |||
| 669 | /* Convert window W relative pixel X to frame pixel coordinates. */ | ||
| 670 | |||
| 671 | #define WINDOW_TO_FRAME_PIXEL_X(W, X) \ | ||
| 672 | ((X) + WINDOW_BOX_LEFT_EDGE_X ((W))) | ||
| 673 | |||
| 674 | /* Convert window W relative pixel Y to frame pixel coordinates. */ | ||
| 675 | |||
| 676 | #define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \ | ||
| 677 | ((Y) + WINDOW_TOP_EDGE_Y ((W))) | ||
| 678 | |||
| 679 | /* Convert frame relative pixel X to window relative pixel X. */ | ||
| 680 | |||
| 681 | #define FRAME_TO_WINDOW_PIXEL_X(W, X) \ | ||
| 682 | ((X) - WINDOW_BOX_LEFT_EDGE_X ((W))) | ||
| 683 | |||
| 684 | /* Convert frame relative pixel Y to window relative pixel Y. */ | ||
| 685 | |||
| 686 | #define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \ | ||
| 687 | ((Y) - WINDOW_TOP_EDGE_Y ((W))) | ||
| 688 | |||
| 689 | /* Convert a text area relative x-position in window W to frame X | ||
| 690 | pixel coordinates. */ | ||
| 317 | 691 | ||
| 692 | #define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ | ||
| 693 | (window_box_left ((W), TEXT_AREA) + (X)) | ||
| 318 | 694 | ||
| 319 | /* This is the window in which the terminal's cursor should | 695 | /* This is the window in which the terminal's cursor should |
| 320 | be left when nothing is being done with it. This must | 696 | be left when nothing is being done with it. This must |
| @@ -368,7 +744,7 @@ extern Lisp_Object Vmouse_event; | |||
| 368 | EXFUN (Fnext_window, 3); | 744 | EXFUN (Fnext_window, 3); |
| 369 | EXFUN (Fselect_window, 2); | 745 | EXFUN (Fselect_window, 2); |
| 370 | EXFUN (Fdisplay_buffer, 3); | 746 | EXFUN (Fdisplay_buffer, 3); |
| 371 | EXFUN (Fset_window_buffer, 2); | 747 | EXFUN (Fset_window_buffer, 3); |
| 372 | EXFUN (Fset_window_hscroll, 2); | 748 | EXFUN (Fset_window_hscroll, 2); |
| 373 | EXFUN (Fwindow_hscroll, 1); | 749 | EXFUN (Fwindow_hscroll, 1); |
| 374 | EXFUN (Fset_window_vscroll, 2); | 750 | EXFUN (Fset_window_vscroll, 2); |
| @@ -379,7 +755,8 @@ EXFUN (Fset_window_point, 2); | |||
| 379 | extern Lisp_Object make_window P_ ((void)); | 755 | extern Lisp_Object make_window P_ ((void)); |
| 380 | extern void delete_window P_ ((Lisp_Object)); | 756 | extern void delete_window P_ ((Lisp_Object)); |
| 381 | extern Lisp_Object window_from_coordinates P_ ((struct frame *, int, int, | 757 | extern Lisp_Object window_from_coordinates P_ ((struct frame *, int, int, |
| 382 | enum window_part *, int)); | 758 | enum window_part *, |
| 759 | int *, int*, int)); | ||
| 383 | EXFUN (Fwindow_dedicated_p, 1); | 760 | EXFUN (Fwindow_dedicated_p, 1); |
| 384 | extern int window_height P_ ((Lisp_Object)); | 761 | extern int window_height P_ ((Lisp_Object)); |
| 385 | extern int window_width P_ ((Lisp_Object)); | 762 | extern int window_width P_ ((Lisp_Object)); |
| @@ -400,7 +777,7 @@ extern void shrink_mini_window P_ ((struct window *)); | |||
| 400 | it's not allowed. */ | 777 | it's not allowed. */ |
| 401 | 778 | ||
| 402 | void set_window_buffer P_ ((Lisp_Object window, Lisp_Object buffer, | 779 | void set_window_buffer P_ ((Lisp_Object window, Lisp_Object buffer, |
| 403 | int run_hooks_p)); | 780 | int run_hooks_p, int keep_margins_p)); |
| 404 | 781 | ||
| 405 | /* Prompt to display in front of the minibuffer contents. */ | 782 | /* Prompt to display in front of the minibuffer contents. */ |
| 406 | 783 | ||