aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann1999-08-17 22:44:47 +0000
committerGerd Moellmann1999-08-17 22:44:47 +0000
commitfbad6f9a2810fb084c5adc69f50f8e8998398f1d (patch)
tree495456742f2d8955bff69e3ee7800747d61e1ed8 /src
parent0b5791c4a024e66c0c90b1f2437d51ce6b381086 (diff)
downloademacs-fbad6f9a2810fb084c5adc69f50f8e8998398f1d.tar.gz
emacs-fbad6f9a2810fb084c5adc69f50f8e8998398f1d.zip
(Fcoordinates_in_window_p): Return `left-bitmap-area'
and `right-bitmap-area' if position is in the bitmap areas. This avoids an error when clicking on the bitmap areas. Instead, they are currently treated like clicks inside the window. (coordinates_in_window): Return 5 and 6 for bitmap areas. (Qleft_bitmap_area, Qright_bitmap_area): New. (syms_of_window): Initialize new symbols.
Diffstat (limited to 'src')
-rw-r--r--src/window.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c
index 92608175247..c18566dd841 100644
--- a/src/window.c
+++ b/src/window.c
@@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */
43 43
44 44
45Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p; 45Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p;
46Lisp_Object Qfixed_window_size; 46Lisp_Object Qfixed_window_size, Qleft_bitmap_area, Qright_bitmap_area;
47extern Lisp_Object Qheight, Qwidth; 47extern Lisp_Object Qheight, Qwidth;
48 48
49static struct window *decode_window P_ ((Lisp_Object)); 49static struct window *decode_window P_ ((Lisp_Object));
@@ -423,7 +423,7 @@ and BOTTOM is one more than the bottommost row used by WINDOW\n\
423 Qnil)))); 423 Qnil))));
424} 424}
425 425
426/* Test if the character at column *x, row *y is within window *w. 426/* Test if the character at column *X, row *Y is within window W.
427 If it is not, return 0; 427 If it is not, return 0;
428 if it is in the window's text area, 428 if it is in the window's text area,
429 set *x and *y to its location relative to the upper left corner 429 set *x and *y to its location relative to the upper left corner
@@ -433,6 +433,8 @@ and BOTTOM is one more than the bottommost row used by WINDOW\n\
433 if it is on the border between the window and its right sibling, 433 if it is on the border between the window and its right sibling,
434 return 3. 434 return 3.
435 if it is on the window's top line, return 4; 435 if it is on the window's top line, return 4;
436 if it is in the bitmap area to the left/right of the window,
437 return 5 or 6, and convert *X and *Y to window-relative corrdinates.
436 438
437 X and Y are frame relative pixel coordinates. */ 439 X and Y are frame relative pixel coordinates. */
438 440
@@ -478,9 +480,15 @@ coordinates_in_window (w, x, y)
478 /* On the top line. */ 480 /* On the top line. */
479 return 4; 481 return 4;
480 else if (*x < left_x || *x >= right_x) 482 else if (*x < left_x || *x >= right_x)
481 /* Other lines than the mode line don't include flags areas and 483 {
482 scroll bars on the left. */ 484 /* Other lines than the mode line don't include flags areas and
483 return 0; 485 scroll bars on the left. */
486
487 /* Convert X and Y to window-relative pixel coordinates. */
488 *x -= left_x;
489 *y -= top_y;
490 return *x < left_x ? 5 : 6;
491 }
484 else if (!w->pseudo_window_p 492 else if (!w->pseudo_window_p
485 && !WINDOW_RIGHTMOST_P (w) 493 && !WINDOW_RIGHTMOST_P (w)
486 && *x >= right_x - CANON_X_UNIT (f)) 494 && *x >= right_x - CANON_X_UNIT (f))
@@ -507,6 +515,9 @@ If COORDINATES are in the text portion of WINDOW,\n\
507 the coordinates relative to the window are returned.\n\ 515 the coordinates relative to the window are returned.\n\
508If they are in the mode line of WINDOW, `mode-line' is returned.\n\ 516If they are in the mode line of WINDOW, `mode-line' is returned.\n\
509If they are in the top mode line of WINDOW, `top-line' is returned.\n\ 517If they are in the top mode line of WINDOW, `top-line' is returned.\n\
518If they are in the bitmap-area to the left of the window,\n\
519 `left-bitmap-area' is returned, if they are in the area on the right of\n\
520 the window, `right-bitmap-area' is returned.\n\
510If they are on the border between WINDOW and its right sibling,\n\ 521If they are on the border between WINDOW and its right sibling,\n\
511 `vertical-line' is returned.") 522 `vertical-line' is returned.")
512 (coordinates, window) 523 (coordinates, window)
@@ -549,6 +560,12 @@ If they are on the border between WINDOW and its right sibling,\n\
549 case 4: 560 case 4:
550 return Qtop_line; 561 return Qtop_line;
551 562
563 case 5:
564 return Qleft_bitmap_area;
565
566 case 6:
567 return Qright_bitmap_area;
568
552 default: 569 default:
553 abort (); 570 abort ();
554 } 571 }
@@ -4801,6 +4818,11 @@ init_window_once ()
4801void 4818void
4802syms_of_window () 4819syms_of_window ()
4803{ 4820{
4821 Qleft_bitmap_area = intern ("left-bitmap-area");
4822 staticpro (&Qleft_bitmap_area);
4823 Qright_bitmap_area = intern ("right-bitmap-area");
4824 staticpro (&Qright_bitmap_area);
4825
4804 Qfixed_window_size = intern ("fixed-window-size"); 4826 Qfixed_window_size = intern ("fixed-window-size");
4805 staticpro (&Qfixed_window_size); 4827 staticpro (&Qfixed_window_size);
4806 4828