Mercurial > hg > xemacs-beta
comparison src/redisplay-msw.c @ 280:7df0dd720c89 r21-0b38
Import from CVS: tag r21-0b38
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:32:22 +0200 |
parents | 90d73dddcdc4 |
children | c42ec1d1cded |
comparison
equal
deleted
inserted
replaced
279:c20b2fb5bb0a | 280:7df0dd720c89 |
---|---|
69 static void mswindows_clear_region (Lisp_Object locale, face_index findex, | 69 static void mswindows_clear_region (Lisp_Object locale, face_index findex, |
70 int x, int y, int width, int height); | 70 int x, int y, int width, int height); |
71 static void mswindows_output_vertical_divider (struct window *w, int clear); | 71 static void mswindows_output_vertical_divider (struct window *w, int clear); |
72 static void mswindows_redraw_exposed_windows (Lisp_Object window, int x, | 72 static void mswindows_redraw_exposed_windows (Lisp_Object window, int x, |
73 int y, int width, int height); | 73 int y, int width, int height); |
74 static void mswindows_output_pixmap (struct window *w, struct display_line *dl, | |
75 Lisp_Object image_instance, int xpos, | |
76 int xoffset, int start_pixpos, int width, | |
77 face_index findex, int cursor_start, | |
78 int cursor_width, int cursor_height); | |
74 | 79 |
75 typedef struct textual_run | 80 typedef struct textual_run |
76 { | 81 { |
77 Lisp_Object charset; | 82 Lisp_Object charset; |
78 unsigned char *ptr; | 83 unsigned char *ptr; |
242 if (!NILP (fg)) | 247 if (!NILP (fg)) |
243 SetTextColor (hdc, COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (fg))); | 248 SetTextColor (hdc, COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (fg))); |
244 | 249 |
245 if (!NILP (bg)) | 250 if (!NILP (bg)) |
246 SetBkColor (hdc, COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (bg))); | 251 SetBkColor (hdc, COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (bg))); |
247 | |
248 #if 0 /* XXX Implement me */ | |
249 /* I expect that the Lisp_Image_Instance's data will point to a brush */ | |
250 if (IMAGE_INSTANCEP (bg_pmap) | |
251 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) | |
252 { | |
253 if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0) | |
254 { | |
255 gcv.fill_style = FillOpaqueStippled; | |
256 gcv.stipple = XIMAGE_INSTANCE_X_PIXMAP (bg_pmap); | |
257 mask |= (GCStipple | GCFillStyle); | |
258 } | |
259 else | |
260 { | |
261 gcv.fill_style = FillTiled; | |
262 gcv.tile = XIMAGE_INSTANCE_X_PIXMAP (bg_pmap); | |
263 mask |= (GCTile | GCFillStyle); | |
264 } | |
265 } | |
266 #endif | |
267 } | 252 } |
268 | 253 |
269 | 254 |
270 /***************************************************************************** | 255 /***************************************************************************** |
271 mswindows_output_hline | 256 mswindows_output_hline |
283 | 268 |
284 Output a blank by clearing the area it covers in the background color | 269 Output a blank by clearing the area it covers in the background color |
285 of its face. | 270 of its face. |
286 ****************************************************************************/ | 271 ****************************************************************************/ |
287 static void | 272 static void |
288 mswindows_output_blank (struct window *w, struct display_line *dl, struct rune *rb) | 273 mswindows_output_blank (struct window *w, struct display_line *dl, struct rune *rb, int start_pixpos) |
289 { | 274 { |
290 struct frame *f = XFRAME (w->frame); | 275 struct frame *f = XFRAME (w->frame); |
291 RECT rect = { rb->xpos, dl->ypos-dl->ascent, | 276 RECT rect = { rb->xpos, dl->ypos-dl->ascent, |
292 rb->xpos+rb->width, dl->ypos+dl->descent-dl->clip }; | 277 rb->xpos+rb->width, dl->ypos+dl->descent-dl->clip }; |
293 struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, rb->findex); | 278 struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, rb->findex); |
296 | 281 |
297 if (!IMAGE_INSTANCEP (bg_pmap) | 282 if (!IMAGE_INSTANCEP (bg_pmap) |
298 || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) | 283 || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) |
299 bg_pmap = Qnil; | 284 bg_pmap = Qnil; |
300 | 285 |
301 /* #### This deals only with solid colors */ | 286 if (!NILP(bg_pmap)) |
302 mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, | 287 { |
303 cachel->background, Qnil); | 288 mswindows_output_pixmap (w, dl, bg_pmap, |
304 ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); | 289 rb->xpos, rb->object.dglyph.xoffset, |
290 start_pixpos, rb->width, rb->findex, | |
291 0, 0, 0); | |
292 } | |
293 else | |
294 { | |
295 mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, | |
296 cachel->background, Qnil); | |
297 | |
298 ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE, | |
299 &rect, NULL, 0, NULL); | |
300 } | |
305 } | 301 } |
306 | 302 |
307 | 303 |
308 /***************************************************************************** | 304 /***************************************************************************** |
309 mswindows_output_cursor | 305 mswindows_output_cursor |
481 NILP(bg_pmap) ? cachel->background : Qnil, Qnil); | 477 NILP(bg_pmap) ? cachel->background : Qnil, Qnil); |
482 | 478 |
483 this_width = mswindows_text_width_single_run (hdc, cachel, runs + i); | 479 this_width = mswindows_text_width_single_run (hdc, cachel, runs + i); |
484 | 480 |
485 /* #### bg_pmap should be output here */ | 481 /* #### bg_pmap should be output here */ |
486 | 482 if (!NILP(bg_pmap)) |
483 { | |
484 mswindows_output_pixmap (w, dl, bg_pmap, | |
485 xpos, xoffset, | |
486 clip_start, width, findex, | |
487 0, 0, 0); | |
488 } | |
487 assert (runs[i].dimension == 1); /* XXX FIXME */ | 489 assert (runs[i].dimension == 1); /* XXX FIXME */ |
488 ExtTextOut (hdc, xpos, dl->ypos, | 490 ExtTextOut (hdc, xpos, dl->ypos, |
489 NILP(bg_pmap) ? ETO_CLIPPED | ETO_OPAQUE : ETO_CLIPPED, | 491 NILP(bg_pmap) ? ETO_CLIPPED | ETO_OPAQUE : ETO_CLIPPED, |
490 &rect, (char *) runs[i].ptr, runs[i].len, NULL); | 492 &rect, (char *) runs[i].ptr, runs[i].len, NULL); |
491 | 493 |
1059 } | 1061 } |
1060 } | 1062 } |
1061 else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE) | 1063 else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE) |
1062 { | 1064 { |
1063 if (rb->type == RUNE_BLANK) | 1065 if (rb->type == RUNE_BLANK) |
1064 mswindows_output_blank (w, dl, rb); | 1066 mswindows_output_blank (w, dl, rb, start_pixpos); |
1065 else | 1067 else |
1066 { | 1068 { |
1067 /* #### Our flagging of when we need to redraw the | 1069 /* #### Our flagging of when we need to redraw the |
1068 modeline shadows sucks. Since RUNE_HLINE is only used | 1070 modeline shadows sucks. Since RUNE_HLINE is only used |
1069 by the modeline at the moment it is a good bet | 1071 by the modeline at the moment it is a good bet |
1316 bcolor = FACE_BACKGROUND (Vdefault_face, locale); | 1318 bcolor = FACE_BACKGROUND (Vdefault_face, locale); |
1317 } | 1319 } |
1318 | 1320 |
1319 mswindows_update_dc (FRAME_MSWINDOWS_DC (f), | 1321 mswindows_update_dc (FRAME_MSWINDOWS_DC (f), |
1320 Qnil, fcolor, bcolor, background_pixmap); | 1322 Qnil, fcolor, bcolor, background_pixmap); |
1321 } | 1323 FillRect (FRAME_MSWINDOWS_DC(f), &rect, brush); |
1322 | 1324 } |
1323 /* XX FIXME: Get brush from background_pixmap here */ | 1325 else |
1324 assert(0); | 1326 { |
1325 FillRect (FRAME_MSWINDOWS_DC(f), &rect, brush); | 1327 assert(0); |
1328 } | |
1326 } | 1329 } |
1327 else | 1330 else |
1328 { | 1331 { |
1329 Lisp_Object color = (w ? WINDOW_FACE_CACHEL_BACKGROUND (w, findex) : | 1332 Lisp_Object color = (w ? WINDOW_FACE_CACHEL_BACKGROUND (w, findex) : |
1330 FACE_BACKGROUND (Vdefault_face, locale)); | 1333 FACE_BACKGROUND (Vdefault_face, locale)); |