comparison src/xterm.c @ 91053:a0e466c4d599

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 887-889) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 116-121) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-268
author Miles Bader <miles@gnu.org>
date Mon, 15 Oct 2007 05:03:21 +0000
parents 35069180a991 4f6ca2fff62a
children 4bc33ffdda1a
comparison
equal deleted inserted replaced
91052:72adb6e72b67 91053:a0e466c4d599
1399 1399
1400 /* If first glyph of S has a left box line, start drawing the text 1400 /* If first glyph of S has a left box line, start drawing the text
1401 of S to the right of that box line. */ 1401 of S to the right of that box line. */
1402 if (s->face->box != FACE_NO_BOX 1402 if (s->face->box != FACE_NO_BOX
1403 && s->first_glyph->left_box_line_p) 1403 && s->first_glyph->left_box_line_p)
1404 x = s->x + abs (s->face->box_line_width); 1404 x = s->x + eabs (s->face->box_line_width);
1405 else 1405 else
1406 x = s->x; 1406 x = s->x;
1407 1407
1408 /* Draw characters of S as rectangles if S's font could not be 1408 /* Draw characters of S as rectangles if S's font could not be
1409 loaded. */ 1409 loaded. */
1501 1501
1502 /* If first glyph of S has a left box line, start drawing the text 1502 /* If first glyph of S has a left box line, start drawing the text
1503 of S to the right of that box line. */ 1503 of S to the right of that box line. */
1504 if (s->face && s->face->box != FACE_NO_BOX 1504 if (s->face && s->face->box != FACE_NO_BOX
1505 && s->first_glyph->left_box_line_p) 1505 && s->first_glyph->left_box_line_p)
1506 x = s->x + abs (s->face->box_line_width); 1506 x = s->x + eabs (s->face->box_line_width);
1507 else 1507 else
1508 x = s->x; 1508 x = s->x;
1509 1509
1510 /* S is a glyph string for a composition. S->gidx is the index of 1510 /* S is a glyph string for a composition. S->gidx is the index of
1511 the first character drawn for glyphs of this composition. 1511 the first character drawn for glyphs of this composition.
2355 /* The glyph that may have a right box line. */ 2355 /* The glyph that may have a right box line. */
2356 last_glyph = (s->cmp || s->img 2356 last_glyph = (s->cmp || s->img
2357 ? s->first_glyph 2357 ? s->first_glyph
2358 : s->first_glyph + s->nchars - 1); 2358 : s->first_glyph + s->nchars - 1);
2359 2359
2360 width = abs (s->face->box_line_width); 2360 width = eabs (s->face->box_line_width);
2361 raised_p = s->face->box == FACE_RAISED_BOX; 2361 raised_p = s->face->box == FACE_RAISED_BOX;
2362 left_x = s->x; 2362 left_x = s->x;
2363 right_x = (s->row->full_width_p && s->extends_to_end_of_line_p 2363 right_x = (s->row->full_width_p && s->extends_to_end_of_line_p
2364 ? last_x - 1 2364 ? last_x - 1
2365 : min (last_x, s->x + s->background_width) - 1); 2365 : min (last_x, s->x + s->background_width) - 1);
2401 /* If first glyph of S has a left box line, start drawing it to the 2401 /* If first glyph of S has a left box line, start drawing it to the
2402 right of that line. */ 2402 right of that line. */
2403 if (s->face->box != FACE_NO_BOX 2403 if (s->face->box != FACE_NO_BOX
2404 && s->first_glyph->left_box_line_p 2404 && s->first_glyph->left_box_line_p
2405 && s->slice.x == 0) 2405 && s->slice.x == 0)
2406 x += abs (s->face->box_line_width); 2406 x += eabs (s->face->box_line_width);
2407 2407
2408 /* If there is a margin around the image, adjust x- and y-position 2408 /* If there is a margin around the image, adjust x- and y-position
2409 by that margin. */ 2409 by that margin. */
2410 if (s->slice.x == 0) 2410 if (s->slice.x == 0)
2411 x += s->img->hmargin; 2411 x += s->img->hmargin;
2494 /* If first glyph of S has a left box line, start drawing it to the 2494 /* If first glyph of S has a left box line, start drawing it to the
2495 right of that line. */ 2495 right of that line. */
2496 if (s->face->box != FACE_NO_BOX 2496 if (s->face->box != FACE_NO_BOX
2497 && s->first_glyph->left_box_line_p 2497 && s->first_glyph->left_box_line_p
2498 && s->slice.x == 0) 2498 && s->slice.x == 0)
2499 x += abs (s->face->box_line_width); 2499 x += eabs (s->face->box_line_width);
2500 2500
2501 /* If there is a margin around the image, adjust x- and y-position 2501 /* If there is a margin around the image, adjust x- and y-position
2502 by that margin. */ 2502 by that margin. */
2503 if (s->slice.x == 0) 2503 if (s->slice.x == 0)
2504 x += s->img->hmargin; 2504 x += s->img->hmargin;
2511 thick = tool_bar_button_relief >= 0 ? tool_bar_button_relief : DEFAULT_TOOL_BAR_BUTTON_RELIEF; 2511 thick = tool_bar_button_relief >= 0 ? tool_bar_button_relief : DEFAULT_TOOL_BAR_BUTTON_RELIEF;
2512 raised_p = s->hl == DRAW_IMAGE_RAISED; 2512 raised_p = s->hl == DRAW_IMAGE_RAISED;
2513 } 2513 }
2514 else 2514 else
2515 { 2515 {
2516 thick = abs (s->img->relief); 2516 thick = eabs (s->img->relief);
2517 raised_p = s->img->relief > 0; 2517 raised_p = s->img->relief > 0;
2518 } 2518 }
2519 2519
2520 x0 = x - thick; 2520 x0 = x - thick;
2521 y0 = y - thick; 2521 y0 = y - thick;
2546 /* If first glyph of S has a left box line, start drawing it to the 2546 /* If first glyph of S has a left box line, start drawing it to the
2547 right of that line. */ 2547 right of that line. */
2548 if (s->face->box != FACE_NO_BOX 2548 if (s->face->box != FACE_NO_BOX
2549 && s->first_glyph->left_box_line_p 2549 && s->first_glyph->left_box_line_p
2550 && s->slice.x == 0) 2550 && s->slice.x == 0)
2551 x += abs (s->face->box_line_width); 2551 x += eabs (s->face->box_line_width);
2552 2552
2553 /* If there is a margin around the image, adjust x- and y-position 2553 /* If there is a margin around the image, adjust x- and y-position
2554 by that margin. */ 2554 by that margin. */
2555 if (s->slice.x == 0) 2555 if (s->slice.x == 0)
2556 x += s->img->hmargin; 2556 x += s->img->hmargin;
2646 2646
2647 static void 2647 static void
2648 x_draw_image_glyph_string (s) 2648 x_draw_image_glyph_string (s)
2649 struct glyph_string *s; 2649 struct glyph_string *s;
2650 { 2650 {
2651 int box_line_hwidth = abs (s->face->box_line_width); 2651 int box_line_hwidth = eabs (s->face->box_line_width);
2652 int box_line_vwidth = max (s->face->box_line_width, 0); 2652 int box_line_vwidth = max (s->face->box_line_width, 0);
2653 int height; 2653 int height;
2654 Pixmap pixmap = None; 2654 Pixmap pixmap = None;
2655 2655
2656 height = s->height; 2656 height = s->height;
4628 UNBLOCK_INPUT; 4628 UNBLOCK_INPUT;
4629 4629
4630 whole = 10000000; 4630 whole = 10000000;
4631 portion = shown < 1 ? top * whole : 0; 4631 portion = shown < 1 ? top * whole : 0;
4632 4632
4633 if (shown < 1 && (abs (top + shown - 1) < 1.0/height)) 4633 if (shown < 1 && (eabs (top + shown - 1) < 1.0/height))
4634 /* Some derivatives of Xaw refuse to shrink the thumb when you reach 4634 /* Some derivatives of Xaw refuse to shrink the thumb when you reach
4635 the bottom, so we force the scrolling whenever we see that we're 4635 the bottom, so we force the scrolling whenever we see that we're
4636 too close to the bottom (in x_set_toolkit_scroll_bar_thumb 4636 too close to the bottom (in x_set_toolkit_scroll_bar_thumb
4637 we try to ensure that we always stay two pixels away from the 4637 we try to ensure that we always stay two pixels away from the
4638 bottom). */ 4638 bottom). */
4669 /* Get the height of the scroll bar. */ 4669 /* Get the height of the scroll bar. */
4670 BLOCK_INPUT; 4670 BLOCK_INPUT;
4671 XtVaGetValues (widget, XtNheight, &height, NULL); 4671 XtVaGetValues (widget, XtNheight, &height, NULL);
4672 UNBLOCK_INPUT; 4672 UNBLOCK_INPUT;
4673 4673
4674 if (abs (position) >= height) 4674 if (eabs (position) >= height)
4675 part = (position < 0) ? scroll_bar_above_handle : scroll_bar_below_handle; 4675 part = (position < 0) ? scroll_bar_above_handle : scroll_bar_below_handle;
4676 4676
4677 /* If Xaw3d was compiled with ARROW_SCROLLBAR, 4677 /* If Xaw3d was compiled with ARROW_SCROLLBAR,
4678 it maps line-movement to call_data = max(5, height/20). */ 4678 it maps line-movement to call_data = max(5, height/20). */
4679 else if (xaw3d_arrow_scroll && abs (position) <= max (5, height / 20)) 4679 else if (xaw3d_arrow_scroll && eabs (position) <= max (5, height / 20))
4680 part = (position < 0) ? scroll_bar_up_arrow : scroll_bar_down_arrow; 4680 part = (position < 0) ? scroll_bar_up_arrow : scroll_bar_down_arrow;
4681 else 4681 else
4682 part = scroll_bar_move_ratio; 4682 part = scroll_bar_move_ratio;
4683 4683
4684 window_being_scrolled = bar->window; 4684 window_being_scrolled = bar->window;
9042 if (fuzzy) 9042 if (fuzzy)
9043 { 9043 {
9044 /* The left fuzz-factor is 10 pixels. The top fuzz-factor is 40 9044 /* The left fuzz-factor is 10 pixels. The top fuzz-factor is 40
9045 pixels. */ 9045 pixels. */
9046 9046
9047 if (abs (current_left - left) <= 10 && abs (current_top - top) <= 40) 9047 if (eabs (current_left - left) <= 10
9048 && eabs (current_top - top) <= 40)
9048 return; 9049 return;
9049 } 9050 }
9050 else if (current_left == left && current_top == top) 9051 else if (current_left == left && current_top == top)
9051 return; 9052 return;
9052 } 9053 }