#define MSWINDOWS_EOL_CURSOR_WIDTH 5
/*
- * Random forward declarations
+ * Random forward delarations
*/
static void mswindows_update_dc (HDC hdc, Lisp_Object font, Lisp_Object fg,
Lisp_Object bg, Lisp_Object bg_pmap);
+static void mswindows_clear_region (Lisp_Object locale, face_index findex,
+ int x, int y, int width, int height);
static void mswindows_output_vertical_divider (struct window *w, int clear);
static void mswindows_redraw_exposed_windows (Lisp_Object window, int x,
int y, int width, int height);
struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, rb->findex);
Lisp_Object bg_pmap = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, rb->findex);
-
+
if (!IMAGE_INSTANCEP (bg_pmap)
|| !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
bg_pmap = Qnil;
{
struct frame *f = XFRAME (w->frame);
struct device *d = XDEVICE (f->device);
- struct face_cachel *cachel=0;
+ struct face_cachel *cachel;
Lisp_Object font = Qnil;
int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
HDC hdc = FRAME_MSWINDOWS_DC (f);
xpos -= xoffset;
/* sort out the destination rectangle */
- height = DISPLAY_LINE_HEIGHT (dl);
+ height = dl->ascent + dl->descent - dl->clip;
rect.left = clip_start;
rect.top = dl->ypos - dl->ascent;
rect.right = clip_end;
int clear_end = min (xpos + this_width, clip_end);
{
- redisplay_clear_region (window, findex, clear_start,
+ mswindows_clear_region (window, findex, clear_start,
dl->ypos - dl->ascent,
clear_end - clear_start,
height);
int need_clipping = (clip_x || clip_y);
int yoffset=0;
int xoffset=0;
-
/* do we need to offset the pixmap vertically? this is necessary
for background pixmaps. */
if (offset_bitmap)
struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
Lisp_Object window;
- int lheight = DISPLAY_LINE_HEIGHT (dl);
+ int lheight = dl->ascent + dl->descent - dl->clip;
int pheight = ((int) IMAGE_INSTANCE_PIXMAP_HEIGHT (p) > lheight ? lheight :
IMAGE_INSTANCE_PIXMAP_HEIGHT (p));
int clip_x, clip_y, clip_width, clip_height;
}
if (!offset_bitmap) /* i.e. not a bg pixmap */
- redisplay_clear_region (window, findex, clear_x, clear_y,
+ mswindows_clear_region (window, findex, clear_x, clear_y,
clear_width, clear_height);
}
Given a display line, a block number for that start line, output all
runes between start and end in the specified display block.
- Ripped off with minimal thought from the corresponding X routine.
+ Ripped off with mininmal thought from the corresponding X routine.
****************************************************************************/
static void
mswindows_output_display_block (struct window *w, struct display_line *dl, int block,
else if (rb->object.chr.ch == '\n')
{
/* Clear in case a cursor was formerly here. */
- int height = DISPLAY_LINE_HEIGHT (dl);
+ int height = dl->ascent + dl->descent - dl->clip;
- redisplay_clear_region (window, findex, xpos, dl->ypos - dl->ascent,
+ mswindows_clear_region (window, findex, xpos, dl->ypos - dl->ascent,
rb->width, height);
elt++;
}
abort ();
case IMAGE_SUBWINDOW:
- case IMAGE_WIDGET:
- redisplay_output_subwindow (w, dl, instance, xpos,
- rb->object.dglyph.xoffset, start_pixpos,
- rb->width, findex, cursor_start,
- cursor_width, cursor_height);
- if (rb->cursor_type == CURSOR_ON)
- mswindows_output_cursor (w, dl, xpos, cursor_width,
- findex, 0, 1);
+ /* #### implement me */
break;
case IMAGE_NOTHING:
/* Draw a shadow around the divider */
if (shadow != 0)
{
- /* #### This will be fixed to support arbitrary thickness */
+ /* #### This will be fixed to support arbitrary thichkness */
InflateRect (&rect, abs_shadow, abs_shadow);
DrawEdge (FRAME_MSWINDOWS_DC (f), &rect,
shadow > 0 ? EDGE_RAISED : EDGE_SUNKEN, BF_RECT);
given face.
****************************************************************************/
static void
-mswindows_clear_region (Lisp_Object locale, struct device* d, struct frame* f,
- face_index findex, int x, int y,
- int width, int height, Lisp_Object fcolor, Lisp_Object bcolor,
- Lisp_Object background_pixmap)
+mswindows_clear_region (Lisp_Object locale, face_index findex, int x, int y,
+ int width, int height)
{
+ struct window *w;
+ struct frame *f;
+ Lisp_Object background_pixmap = Qunbound;
+ Lisp_Object temp;
RECT rect = { x, y, x+width, y+height };
- if (!NILP (background_pixmap))
+ if (!(width && height)) /* We often seem to get called with width==0 */
+ return;
+
+ if (WINDOWP (locale))
+ {
+ w = XWINDOW (locale);
+ f = XFRAME (w->frame);
+ }
+ else if (FRAMEP (locale))
+ {
+ w = NULL;
+ f = XFRAME (locale);
+ }
+ else
+ abort ();
+
+ if (w)
+ {
+ temp = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, findex);
+
+ if (IMAGE_INSTANCEP (temp)
+ && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
+ {
+ /* #### maybe we could implement such that a string
+ can be a background pixmap? */
+ background_pixmap = temp;
+ }
+ }
+ else
+ {
+ temp = FACE_BACKGROUND_PIXMAP (Vdefault_face, locale);
+
+ if (IMAGE_INSTANCEP (temp)
+ && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
+ {
+ background_pixmap = temp;
+ }
+ }
+
+ if (!UNBOUNDP (background_pixmap))
{
+ Lisp_Object fcolor, bcolor;
+
+ if (w)
+ {
+ fcolor = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
+ bcolor = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
+ }
+ else
+ {
+ fcolor = FACE_FOREGROUND (Vdefault_face, locale);
+ bcolor = FACE_BACKGROUND (Vdefault_face, locale);
+ }
+
mswindows_update_dc (FRAME_MSWINDOWS_DC (f),
Qnil, fcolor, bcolor, background_pixmap);
}
else
{
- mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, fcolor, Qnil);
- ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE,
- &rect, NULL, 0, NULL);
+ Lisp_Object color = (w ? WINDOW_FACE_CACHEL_BACKGROUND (w, findex) :
+ FACE_BACKGROUND (Vdefault_face, locale));
+ mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, color, Qnil);
+ ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
}
#ifdef HAVE_SCROLLBARS
if (WINDOWP (locale))
- mswindows_redisplay_deadbox_maybe (XWINDOW (locale), &rect);
+ mswindows_redisplay_deadbox_maybe (w, &rect);
#endif
}
XSETWINDOW (window, w);
if (window_is_leftmost (w))
- redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f),
+ mswindows_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f),
ypos1, FRAME_BORDER_WIDTH (f), height);
if (bounds.left_in - bounds.left_out > 0)
- redisplay_clear_region (window,
+ mswindows_clear_region (window,
get_builtin_face_cache_index (w, Vleft_margin_face),
bounds.left_out, ypos1,
bounds.left_in - bounds.left_out, height);
if (bounds.right_in - bounds.left_in > 0)
- redisplay_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1,
+ mswindows_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1,
bounds.right_in - bounds.left_in, height);
if (bounds.right_out - bounds.right_in > 0)
- redisplay_clear_region (window,
+ mswindows_clear_region (window,
get_builtin_face_cache_index (w, Vright_margin_face),
bounds.right_in, ypos1,
bounds.right_out - bounds.right_in, height);
if (window_is_rightmost (w))
- redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f),
+ mswindows_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f),
ypos1, FRAME_BORDER_WIDTH (f), height);
}