Commit d67d1627 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

(w32_draw_fringe_bitmap): Remove unused local variable window.

parent 6c1b363d
......@@ -155,7 +155,7 @@ Lisp_Object Vx_toolkit_scroll_bars;
/* If a string, w32_read_socket generates an event to display that string.
(The display is done in read_char.) */
static Lisp_Object help_echo;
static Lisp_Object help_echo_window;
static Lisp_Object help_echo_object;
......@@ -415,7 +415,7 @@ static void x_erase_phys_cursor P_ ((struct window *));
void x_display_cursor P_ ((struct window *w, int, int, int, int, int));
void x_display_and_set_cursor P_ ((struct window *, int, int, int, int, int));
static void w32_draw_fringe_bitmap P_ ((struct window *, HDC hdc,
struct glyph_row *,
struct glyph_row *,
enum fringe_bitmap_type, int left_p));
static void w32_clip_to_row P_ ((struct window *, struct glyph_row *,
HDC, int));
......@@ -438,7 +438,7 @@ static Lisp_Object Qvendor_specific_keysyms;
/* This is a function useful for recording debugging information about
the sequence of occurrences in this file. */
struct record
struct record
{
char *locus;
int type;
......@@ -527,7 +527,7 @@ w32_draw_rectangle (HDC hdc, XGCValues *gc, int x, int y,
}
/* Draw a filled rectangle at the specified position. */
void
void
w32_fill_rect (f, hdc, pix, lprect)
FRAME_PTR f;
HDC hdc;
......@@ -541,7 +541,7 @@ w32_fill_rect (f, hdc, pix, lprect)
DeleteObject (hb);
}
void
void
w32_clear_window (f)
FRAME_PTR f;
{
......@@ -564,7 +564,7 @@ w32_clear_window (f)
/***********************************************************************
Starting and ending an update
***********************************************************************/
/* Start an update of frame F. This function is installed as a hook
for update_begin, i.e. it is called when update_begin is called.
This function is called prior to calls to x_update_window_begin for
......@@ -625,7 +625,7 @@ x_update_window_begin (w)
flag set. So, rows containing mouse-face glyphs are never
scrolled, and we don't have to switch the mouse highlight off
here to prevent it from being scrolled. */
/* Can we tell that this update does not affect the window
where the mouse highlight is? If so, no need to turn off.
Likewise, don't do anything if the frame is garbaged;
......@@ -658,7 +658,7 @@ x_draw_vertical_border (w)
struct window *w;
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
/* Redraw borders between horizontally adjacent windows. Don't
do it for frames with vertical scroll bars because either the
right scroll bar of a window, or the left scroll bar of its
......@@ -681,7 +681,7 @@ x_draw_vertical_border (w)
}
}
/* End update of window W (which is equal to updated_window).
Draw vertical borders between horizontally adjacent windows, and
......@@ -711,7 +711,7 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
x_display_and_set_cursor (w, 1, output_cursor.hpos,
output_cursor.vpos,
output_cursor.x, output_cursor.y);
x_draw_vertical_border (w);
UNBLOCK_INPUT;
}
......@@ -792,7 +792,7 @@ x_after_update_window_line (desired_row)
int width, height;
xassert (w);
if (!desired_row->mode_line_p && !w->pseudo_window_p)
{
BLOCK_INPUT;
......@@ -847,7 +847,6 @@ w32_draw_fringe_bitmap (w, hdc, row, which, left_p)
int left_p;
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
Window window = FRAME_W32_WINDOW (f);
HDC compat_hdc;
int x, y, wd, h, dy;
int b1, b2;
......@@ -873,13 +872,13 @@ w32_draw_fringe_bitmap (w, hdc, row, which, left_p)
h = left_height;
pixmap = left_bmp;
break;
case OVERLAY_ARROW_BITMAP:
wd = ov_width;
h = ov_height;
pixmap = ov_bmp;
break;
case RIGHT_TRUNCATION_BITMAP:
wd = right_width;
h = right_height;
......@@ -891,7 +890,7 @@ w32_draw_fringe_bitmap (w, hdc, row, which, left_p)
h = continued_height;
pixmap = continued_bmp;
break;
case CONTINUATION_LINE_BITMAP:
wd = continuation_width;
h = continuation_height;
......@@ -959,7 +958,7 @@ w32_draw_fringe_bitmap (w, hdc, row, which, left_p)
if (b1 >= 0)
{
int header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w);
w32_fill_area (f, hdc, face->background,
b1,
WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
......@@ -1087,7 +1086,7 @@ set_output_cursor (cursor)
HPOS and VPOS are column/row positions in a window glyph matrix. X
and Y are window text area relative pixel positions.
If this is done during an update, updated_window will contain the
window that is being updated and the position is the future output
cursor position for that window. If updated_window is null, use
......@@ -1385,7 +1384,7 @@ int w32_font_is_double_byte (XFontStruct *font)
}
static BOOL
static BOOL
w32_use_unicode_for_codepage (codepage)
int codepage;
{
......@@ -1449,11 +1448,11 @@ w32_encode_char (c, char2b, font_info, two_byte_p)
/* Fixed encoding scheme. See fontset.h for the meaning of the
encoding numbers. */
int enc = font_info->encoding[charset];
if ((enc == 1 || enc == 2)
&& CHARSET_DIMENSION (charset) == 2)
*char2b = BUILD_WCHAR_T (BYTE1 (*char2b) | 0x80, BYTE2 (*char2b));
if (enc == 1 || enc == 3
|| (enc == 4 && CHARSET_DIMENSION (charset) == 1))
*char2b = BUILD_WCHAR_T (BYTE1 (*char2b), BYTE2 (*char2b) | 0x80);
......@@ -1531,7 +1530,7 @@ x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p)
else
{
int c1, c2, charset;
/* Split characters into bytes. If c2 is -1 afterwards, C is
really a one-byte character so that byte1 is zero. */
SPLIT_CHAR (c, charset, c1, c2);
......@@ -1539,7 +1538,7 @@ x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p)
*char2b = BUILD_WCHAR_T (c1, c2);
else
*char2b = BUILD_WCHAR_T (0, c1);
/* Maybe encode the character in *CHAR2B. */
if (face->font != NULL)
{
......@@ -1553,7 +1552,7 @@ x_get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p)
/* Make sure X resources of the face are allocated. */
xassert (face != NULL);
PREPARE_FACE_FOR_DISPLAY (f, face);
return face;
}
......@@ -1595,7 +1594,7 @@ x_get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
else
{
int c1, c2, charset;
/* Split characters into bytes. If c2 is -1 afterwards, C is
really a one-byte character so that byte1 is zero. */
SPLIT_CHAR (glyph->u.ch, charset, c1, c2);
......@@ -1624,7 +1623,7 @@ x_get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
}
/* Store one glyph for IT->char_to_display in IT->glyph_row.
/* Store one glyph for IT->char_to_display in IT->glyph_row.
Called from x_produce_glyphs when IT->glyph_row is non-null. */
static INLINE void
......@@ -1633,10 +1632,10 @@ x_append_glyph (it)
{
struct glyph *glyph;
enum glyph_row_area area = it->area;
xassert (it->glyph_row);
xassert (it->char_to_display != '\n' && it->char_to_display != '\t');
glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
if (glyph < it->glyph_row->glyphs[area + 1])
{
......@@ -1659,7 +1658,7 @@ x_append_glyph (it)
}
}
/* Store one glyph for the composition IT->cmp_id in IT->glyph_row.
/* Store one glyph for the composition IT->cmp_id in IT->glyph_row.
Called from x_produce_glyphs when IT->glyph_row is non-null. */
static INLINE void
......@@ -1668,9 +1667,9 @@ x_append_composite_glyph (it)
{
struct glyph *glyph;
enum glyph_row_area area = it->area;
xassert (it->glyph_row);
glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
if (glyph < it->glyph_row->glyphs[area + 1])
{
......@@ -1741,7 +1740,7 @@ x_produce_image_glyph (it)
it->pixel_width = img->width + 2 * img->hmargin;
it->nglyphs = 1;
if (face->box != FACE_NO_BOX)
{
if (face->box_line_width > 0)
......@@ -1749,7 +1748,7 @@ x_produce_image_glyph (it)
it->ascent += face->box_line_width;
it->descent += face->box_line_width;
}
if (it->start_of_box_run_p)
it->pixel_width += abs (face->box_line_width);
if (it->end_of_box_run_p)
......@@ -1757,12 +1756,12 @@ x_produce_image_glyph (it)
}
take_vertical_position_into_account (it);
if (it->glyph_row)
{
struct glyph *glyph;
enum glyph_row_area area = it->area;
glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
if (glyph < it->glyph_row->glyphs[area + 1])
{
......@@ -1787,10 +1786,10 @@ x_produce_image_glyph (it)
/* Append a stretch glyph to IT->glyph_row. OBJECT is the source
of the glyph, WIDTH and HEIGHT are the width and height of the
stretch. ASCENT is the percentage/100 of HEIGHT to use for the
of the glyph, WIDTH and HEIGHT are the width and height of the
stretch. ASCENT is the percentage/100 of HEIGHT to use for the
ascent of the glyph (0 <= ASCENT <= 1). */
static void
x_append_stretch_glyph (it, object, width, height, ascent)
struct it *it;
......@@ -1802,7 +1801,7 @@ x_append_stretch_glyph (it, object, width, height, ascent)
enum glyph_row_area area = it->area;
xassert (ascent >= 0 && ascent <= 1);
glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
if (glyph < it->glyph_row->glyphs[area + 1])
{
......@@ -1832,7 +1831,7 @@ x_append_stretch_glyph (it, object, width, height, ascent)
being recognized:
1. `:width WIDTH' specifies that the space should be WIDTH *
canonical char width wide. WIDTH may be an integer or floating
canonical char width wide. WIDTH may be an integer or floating
point number.
2. `:relative-width FACTOR' specifies that the width of the stretch
......@@ -1842,7 +1841,7 @@ x_append_stretch_glyph (it, object, width, height, ascent)
3. `:align-to HPOS' specifies that the space should be wide enough
to reach HPOS, a value in canonical character units.
Exactly one of the above pairs must be present.
Exactly one of the above pairs must be present.
4. `:height HEIGHT' specifies that the height of the stretch produced
should be HEIGHT, measured in canonical character units.
......@@ -1880,7 +1879,7 @@ x_produce_stretch_glyph (it)
XFontStruct *font = face->font ? face->font : FRAME_FONT (it->f);
PREPARE_FACE_FOR_DISPLAY (it->f, face);
/* List should start with `space'. */
xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace));
plist = XCDR (it->object);
......@@ -1898,7 +1897,7 @@ x_produce_stretch_glyph (it)
property. */
struct it it2;
unsigned char *p = BYTE_POS_ADDR (IT_BYTEPOS (*it));
it2 = *it;
if (it->multibyte_p)
{
......@@ -1920,7 +1919,7 @@ x_produce_stretch_glyph (it)
else
/* Nothing specified -> width defaults to canonical char width. */
width = CANON_X_UNIT (it->f);
/* Compute height. */
if (prop = Fplist_get (plist, QCheight),
NUMVAL (prop) > 0)
......@@ -1931,7 +1930,7 @@ x_produce_stretch_glyph (it)
else
height = FONT_HEIGHT (font);
/* Compute percentage of height used for ascent. If
/* Compute percentage of height used for ascent. If
`:ascent ASCENT' is present and valid, use that. Otherwise,
derive the ascent from the font in use. */
if (prop = Fplist_get (plist, QCascent),
......@@ -1965,13 +1964,13 @@ x_produce_stretch_glyph (it)
it->ascent += face->box_line_width;
it->descent += face->box_line_width;
}
if (it->start_of_box_run_p)
it->pixel_width += abs (face->box_line_width);
if (it->end_of_box_run_p)
it->pixel_width += abs (face->box_line_width);
}
take_vertical_position_into_account (it);
}
......@@ -2063,7 +2062,7 @@ x_produce_glyphs (it)
face = FACE_FROM_ID (it->f, it->face_id);
}
}
/* Get font to use. Encode IT->char_to_display. */
x_get_char_face_and_encoding (it->f, it->char_to_display,
it->face_id, &char2b,
......@@ -2112,7 +2111,7 @@ x_produce_glyphs (it)
it->phys_descent = FONT_DESCENT (font) - boff;
it->pixel_width = FONT_WIDTH (font);
}
/* If this is a space inside a region of text with
`space-width' property, change its width. */
stretched_p = it->char_to_display == ' ' && !NILP (it->space_width);
......@@ -2125,7 +2124,7 @@ x_produce_glyphs (it)
if (face->box != FACE_NO_BOX)
{
int thick = face->box_line_width;
if (thick > 0)
{
it->ascent += thick;
......@@ -2133,7 +2132,7 @@ x_produce_glyphs (it)
}
else
thick = -thick;
if (it->start_of_box_run_p)
it->pixel_width += thick;
if (it->end_of_box_run_p)
......@@ -2146,7 +2145,7 @@ x_produce_glyphs (it)
it->ascent += 2;
take_vertical_position_into_account (it);
/* If we have to actually produce glyphs, do it. */
if (it->glyph_row)
{
......@@ -2156,7 +2155,7 @@ x_produce_glyphs (it)
into a stretch glyph. */
double ascent = (double) FONT_BASE (font)
/ FONT_HEIGHT (font);
x_append_stretch_glyph (it, it->object, it->pixel_width,
x_append_stretch_glyph (it, it->object, it->pixel_width,
it->ascent + it->descent, ascent);
}
else
......@@ -2176,7 +2175,7 @@ x_produce_glyphs (it)
it->nglyphs = 0;
it->ascent = it->phys_ascent = FONT_BASE (font) + boff;
it->descent = it->phys_descent = FONT_DESCENT (font) - boff;
if (face->box != FACE_NO_BOX
&& face->box_line_width > 0)
{
......@@ -2189,7 +2188,7 @@ x_produce_glyphs (it)
int tab_width = it->tab_width * CANON_X_UNIT (it->f);
int x = it->current_x + it->continuation_lines_width;
int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width;
/* If the distance from the current position to the next tab
stop is less than a canonical character width, use the
tab stop after that. */
......@@ -2200,15 +2199,15 @@ x_produce_glyphs (it)
it->nglyphs = 1;
it->ascent = it->phys_ascent = FONT_BASE (font) + boff;
it->descent = it->phys_descent = FONT_DESCENT (font) - boff;
if (it->glyph_row)
{
double ascent = (double) it->ascent / (it->ascent + it->descent);
x_append_stretch_glyph (it, it->object, it->pixel_width,
x_append_stretch_glyph (it, it->object, it->pixel_width,
it->ascent + it->descent, ascent);
}
}
else
else
{
/* A multi-byte character.
If we found a font, this font should give us the right
......@@ -2261,20 +2260,20 @@ x_produce_glyphs (it)
}
else
thick = - thick;
if (it->start_of_box_run_p)
it->pixel_width += thick;
if (it->end_of_box_run_p)
it->pixel_width += thick;
}
/* If face has an overline, add the height of the overline
(1 pixel) and a 1 pixel margin to the character height. */
if (face->overline_p)
it->ascent += 2;
take_vertical_position_into_account (it);
if (it->glyph_row)
x_append_glyph (it);
}
......@@ -2376,12 +2375,12 @@ x_produce_glyphs (it)
ascent = FONT_BASE (font);
descent = FONT_DESCENT (font);
}
rightmost = width;
lowest = - descent + boff;
highest = ascent + boff;
leftmost = 0;
if (font_info
&& font_info->default_ascent
&& CHAR_TABLE_P (Vuse_default_ascent)
......@@ -2549,20 +2548,20 @@ x_produce_glyphs (it)
}
else
thick = - thick;
if (it->start_of_box_run_p)
it->pixel_width += thick;
if (it->end_of_box_run_p)
it->pixel_width += thick;
}
/* If face has an overline, add the height of the overline
(1 pixel) and a 1 pixel margin to the character height. */
if (face->overline_p)
it->ascent += 2;
take_vertical_position_into_account (it);
if (it->glyph_row)
x_append_composite_glyph (it);
}
......@@ -2609,7 +2608,7 @@ x_estimate_mode_line_height (f, face_id)
height += 2 * face->box_line_width;
}
}
return height;
}
......@@ -2801,7 +2800,7 @@ static int x_fill_glyph_string P_ ((struct glyph_string *, int, int, int,
static void w32_init_glyph_string P_ ((struct glyph_string *, HDC hdc,
wchar_t *, struct window *,
struct glyph_row *,
enum glyph_row_area, int,
enum glyph_row_area, int,
enum draw_glyphs_face));
static int x_draw_glyphs P_ ((struct window *, int , struct glyph_row *,
enum glyph_row_area, int, int,
......@@ -2847,7 +2846,7 @@ static int x_fill_stretch_glyph_string P_ ((struct glyph_string *,
static void x_check_font P_ ((struct frame *, XFontStruct *));
#endif
/* Append the list of glyph strings with head H and tail T to the list
with head *HEAD and tail *TAIL. Set *HEAD and *TAIL to the result. */
......@@ -2956,11 +2955,11 @@ x_set_cursor_gc (s)
/* Set up S->gc of glyph string S for drawing text in mouse face. */
static void
x_set_mouse_face_gc (s)
struct glyph_string *s;
{
{
int face_id;
struct face *face;
......@@ -2969,7 +2968,7 @@ x_set_mouse_face_gc (s)
face = FACE_FROM_ID (s->f, face_id);
if (face == NULL)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
if (s->first_glyph->type == CHAR_GLYPH)
face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch);
else
......@@ -2986,20 +2985,20 @@ x_set_mouse_face_gc (s)
but font FONT. */
XGCValues xgcv;
unsigned long mask;
xgcv.background = s->face->background;
xgcv.foreground = s->face->foreground;
IF_DEBUG (x_check_font (s->f, s->font));
xgcv.font = s->font;
mask = GCForeground | GCBackground | GCFont;
if (FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc)
XChangeGC (NULL, FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc,
mask, &xgcv);
else
FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc
= XCreateGC (NULL, s->window, mask, &xgcv);
s->gc = FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc;
}
......@@ -3014,7 +3013,7 @@ x_set_mouse_face_gc (s)
static INLINE void
x_set_mode_line_face_gc (s)
struct glyph_string *s;
{
{
s->gc = s->face->gc;
}
......@@ -3028,7 +3027,7 @@ x_set_glyph_string_gc (s)
struct glyph_string *s;
{
PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
if (s->hl == DRAW_NORMAL_TEXT)
{
s->gc = s->face->gc;
......@@ -3079,7 +3078,7 @@ w32_get_glyph_string_clip_rect (s, r)
{
/* Draw full-width. X coordinates are relative to S->w->left. */
int canon_x = CANON_X_UNIT (s->f);
r->left = WINDOW_LEFT_MARGIN (s->w) * canon_x;
r_width = XFASTINT (s->w->width) * canon_x;
......@@ -3089,7 +3088,7 @@ w32_get_glyph_string_clip_rect (s, r)
if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (s->f))
r->left -= width;
}
r->left += FRAME_INTERNAL_BORDER_WIDTH (s->f);
/* Unless displaying a mode or menu bar line, which are always
......@@ -3168,7 +3167,7 @@ x_compute_glyph_string_overhangs (s)
/* Compute overhangs and x-positions for glyph string S and its
predecessors, or successors. X is the starting x-position for S.
BACKWARD_P non-zero means process predecessors. */
static void
x_compute_overhangs_and_x (s, x, backward_p)
struct glyph_string *s;
......@@ -3210,7 +3209,7 @@ w32_get_glyph_overhangs (hdc, glyph, f, left, right)
int *left, *right;
{
*left = *right = 0;
if (glyph->type == CHAR_GLYPH)
{
XFontStruct *font;
......@@ -3256,7 +3255,7 @@ x_left_overwritten (s)
struct glyph_string *s;
{
int k;
if (s->left_overhang)
{
int x = 0, i;
......@@ -3318,7 +3317,7 @@ x_right_overwritten (s)
struct glyph *glyphs = s->row->glyphs[s->area];
int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars);
int end = s->row->used[s->area];
for (i = first; i < end && s->right_overhang > x; ++i)
x += glyphs[i].pixel_width;
......@@ -3597,7 +3596,7 @@ w32_alloc_lighter_color (f, color, factor, delta)
double dimness = 1 - (double)bright / HIGHLIGHT_COLOR_DARK_BOOST_LIMIT;
/* The additive adjustment. */
int min_delta = delta * dimness * factor / 2;
if (factor < 1)
new = PALETTERGB (max (0, min (0xff, min_delta - GetRValue (*color))),
max (0, min (0xff, min_delta - GetGValue (*color))),
......@@ -3607,7 +3606,7 @@ w32_alloc_lighter_color (f, color, factor, delta)
max (0, min (0xff, min_delta + GetGValue (*color))),
max (0, min (0xff, min_delta + GetBValue (*color))));
}
if (new == *color)
new = PALETTERGB (max (0, min (0xff, delta + GetRValue (*color))),
max (0, min (0xff, delta + GetGValue (*color))),
......@@ -3631,7 +3630,7 @@ w32_alloc_lighter_color (f, color, factor, delta)
DELTA lighter or darker than the relief's background which is found
in S->f->output_data.x->relief_background. If such a color cannot
be allocated, use DEFAULT_PIXEL, instead. */
static void
w32_setup_relief_color (f, relief, factor, delta, default_pixel)
struct frame *f;
......@@ -3657,7 +3656,7 @@ w32_setup_relief_color (f, relief, factor, delta, default_pixel)
relief->allocated_p = 1;
xgcv.foreground = relief->pixel = pixel;
}
if (relief->gc == 0)
{
#if 0 /* TODO: stipple */
......@@ -3744,10 +3743,10 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
gc.foreground = f->output_data.w32->black_relief.gc->foreground;
else
gc.foreground = f->output_data.w32->white_relief.gc->foreground;
/* Bottom. */
for (i = 0; i < width; ++i)
w32_fill_area (f, hdc, gc.foreground,
w32_fill_area (f, hdc, gc.foreground,
left_x + i * left_p, bottom_y - i,
right_x - left_x - i * (left_p + right_p) + 1, 1);
......@@ -3759,7 +3758,7 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
bottom_y - top_y - 2 * i - 1);