\f
/* Fringe bitmaps. */
-static HBITMAP fringe_bmp[MAX_FRINGE_BITMAPS];
+static int max_fringe_bmp = 0;
+static HBITMAP *fringe_bmp = 0;
/* Non-nil means Emacs uses toolkit scroll bars. */
static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
enum text_cursor_kinds));
-static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, HDC));
+static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, int, HDC));
static Lisp_Object Qvendor_specific_keysyms;
output_cursor.vpos,
output_cursor.x, output_cursor.y);
- x_draw_vertical_border (w);
-
- draw_window_fringes (w);
+ if (draw_window_fringes (w, 1))
+ x_draw_vertical_border (w);
UNBLOCK_INPUT;
}
int oldVH = row->visible_height;
row->visible_height = p->h;
row->y -= rowY - p->y;
- w32_clip_to_row (w, row, hdc);
+ w32_clip_to_row (w, row, -1, hdc);
row->y = oldY;
row->visible_height = oldVH;
}
else
- w32_clip_to_row (w, row, hdc);
+ w32_clip_to_row (w, row, -1, hdc);
if (p->bx >= 0 && !p->overlay_p)
{
p->bx, p->by, p->nx, p->ny);
}
- if (p->which)
+ if (p->which && p->which < max_fringe_bmp)
{
HBITMAP pixmap = fringe_bmp[p->which];
HDC compat_hdc;
unsigned short *bits;
int h, wd;
{
+ if (which >= max_fringe_bmp)
+ {
+ int i = max_fringe_bmp;
+ max_fringe_bmp = which + 20;
+ fringe_bmp = (HBITMAP *) xrealloc (fringe_bmp, max_fringe_bmp * sizeof (HBITMAP));
+ while (i < max_fringe_bmp)
+ fringe_bmp[i++] = 0;
+ }
+
fringe_bmp[which] = CreateBitmap (wd, h, 1, 1, bits);
}
w32_destroy_fringe_bitmap (which)
int which;
{
+ if (which >= max_fringe_bmp)
+ return;
+
if (fringe_bmp[which])
DeleteObject (fringe_bmp[which]);
fringe_bmp[which] = 0;
}
-
static void x_set_glyph_string_clipping P_ ((struct glyph_string *));
static void x_set_glyph_string_gc P_ ((struct glyph_string *));
static void x_draw_glyph_string_background P_ ((struct glyph_string *,
}
-
/* Draw a relief around the image glyph string S. */
static void
}
else
{
- w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x,
+ w32_fill_area (s->f, s->hdc, s->face->overline_color, s->x,
s->y + dy, s->width, h);
}
}
/* If the dirty region is not what we expected, redraw the entire frame. */
if (!EqualRgn (combined, expect_dirty))
SET_FRAME_GARBAGED (f);
+
+ DeleteObject (dirty);
+ DeleteObject (combined);
}
UNBLOCK_INPUT;
+ DeleteObject (expect_dirty);
}
if (old_focus && old_focus->auto_lower)
x_lower_frame (old_focus);
-
-
-
-
-
-
-
-
if (dpyinfo->w32_focus_frame && dpyinfo->w32_focus_frame->auto_raise)
pending_autoraise_frame = dpyinfo->w32_focus_frame;
else
if (f)
x_new_focus_frame (dpyinfo, f);
-
dpyinfo->grabbed = 0;
check_visibility = 1;
break;
}
-
\f
/***********************************************************************
Text Cursor
mode lines must be clipped to the whole window. */
static void
-w32_clip_to_row (w, row, hdc)
+w32_clip_to_row (w, row, area, hdc)
struct window *w;
struct glyph_row *row;
+ int area;
HDC hdc;
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
RECT clip_rect;
- int window_y, window_width;
+ int window_x, window_y, window_width;
- window_box (w, -1, 0, &window_y, &window_width, 0);
+ window_box (w, area, &window_x, &window_y, &window_width, 0);
- clip_rect.left = WINDOW_TO_FRAME_PIXEL_X (w, 0);
+ clip_rect.left = window_x;
clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
clip_rect.top = max (clip_rect.top, window_y);
clip_rect.right = clip_rect.left + window_width;
rect.right = rect.left + wd;
hdc = get_frame_dc (f);
/* Set clipping, draw the rectangle, and reset clipping again. */
- w32_clip_to_row (w, row, hdc);
+ w32_clip_to_row (w, row, TEXT_AREA, hdc);
FrameRect (hdc, &rect, hb);
DeleteObject (hb);
w32_set_clip_rectangle (hdc, NULL);
hdc = get_frame_dc (f);
- w32_clip_to_row (w, row, hdc);
+ w32_clip_to_row (w, row, TEXT_AREA, hdc);
if (kind == BAR_CURSOR)
{
x_calc_absolute_position (f)
struct frame *f;
{
- POINT pt;
int flags = f->size_hint_flags;
- pt.x = pt.y = 0;
-
- /* Find the position of the outside upper-left corner of
- the inner window, with respect to the outer window.
- But do this only if we will need the results. */
- if (f->output_data.w32->parent_desc != FRAME_W32_DISPLAY_INFO (f)->root_window)
- {
- BLOCK_INPUT;
- MapWindowPoints (FRAME_W32_WINDOW (f),
- f->output_data.w32->parent_desc,
- &pt, 1);
- UNBLOCK_INPUT;
- }
-
- {
- RECT rt;
- rt.left = rt.right = rt.top = rt.bottom = 0;
-
- BLOCK_INPUT;
- AdjustWindowRect(&rt, f->output_data.w32->dwStyle,
- FRAME_EXTERNAL_MENU_BAR (f));
- UNBLOCK_INPUT;
-
- pt.x += (rt.right - rt.left);
- pt.y += (rt.bottom - rt.top);
- }
-
/* Treat negative positions as relative to the leftmost bottommost
position that fits on the screen. */
if (flags & XNegative)
f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width
- - 2 * f->border_width - pt.x
- FRAME_PIXEL_WIDTH (f)
+ f->left_pos);
if (flags & YNegative)
f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height
- - 2 * f->border_width - pt.y
- FRAME_PIXEL_HEIGHT (f)
+ f->top_pos);
/* The left_pos and top_pos