comparison src/redisplay.c @ 100:4be1180a9e89 r20-1b2

Import from CVS: tag r20-1b2
author cvs
date Mon, 13 Aug 2007 09:15:11 +0200
parents 1040fe1366ac
children 360340f9fd5f
comparison
equal deleted inserted replaced
99:2d83cbd90d8d 100:4be1180a9e89
3659 } 3659 }
3660 } 3660 }
3661 3661
3662 static Charcount 3662 static Charcount
3663 add_string_to_fstring_db_runes (pos_data *data, CONST Bufbyte *str, 3663 add_string_to_fstring_db_runes (pos_data *data, CONST Bufbyte *str,
3664 Charcount pos, Charcount min, Charcount max) 3664 Charcount pos, Charcount min_pos, Charcount max_pos)
3665 { 3665 {
3666 /* This function has been Mule-ized. */ 3666 /* This function has been Mule-ized. */
3667 Charcount end; 3667 Charcount end;
3668 CONST Bufbyte *cur_pos = str; 3668 CONST Bufbyte *cur_pos = str;
3669 struct display_block *db = data->db; 3669 struct display_block *db = data->db;
3672 while (Dynarr_length (db->runes) < pos) 3672 while (Dynarr_length (db->runes) < pos)
3673 add_blank_rune (data, NULL, 0); 3673 add_blank_rune (data, NULL, 0);
3674 3674
3675 end = (Dynarr_length (db->runes) + 3675 end = (Dynarr_length (db->runes) +
3676 bytecount_to_charcount (str, strlen ((CONST char *) str))); 3676 bytecount_to_charcount (str, strlen ((CONST char *) str)));
3677 if (max != -1) 3677 if (max_pos != -1)
3678 end = min (max, end); 3678 end = min (max_pos, end);
3679 3679
3680 while (pos < end && *cur_pos) 3680 while (pos < end && *cur_pos)
3681 { 3681 {
3682 CONST Bufbyte *old_cur_pos = cur_pos; 3682 CONST Bufbyte *old_cur_pos = cur_pos;
3683 int succeeded; 3683 int succeeded;
3691 data->modeline_charpos++; 3691 data->modeline_charpos++;
3692 data->bytepos += cur_pos - old_cur_pos; 3692 data->bytepos += cur_pos - old_cur_pos;
3693 } 3693 }
3694 } 3694 }
3695 3695
3696 while (Dynarr_length (db->runes) < min && 3696 while (Dynarr_length (db->runes) < min_pos &&
3697 (data->pixpos + data->blank_width <= data->max_pixpos)) 3697 (data->pixpos + data->blank_width <= data->max_pixpos))
3698 add_blank_rune (data, NULL, 0); 3698 add_blank_rune (data, NULL, 0);
3699 3699
3700 return Dynarr_length (db->runes); 3700 return Dynarr_length (db->runes);
3701 } 3701 }
3702 3702
3703 /* #### Urk! Should also handle begin-glyphs and end-glyphs in 3703 /* #### Urk! Should also handle begin-glyphs and end-glyphs in
3704 modeline extents. */ 3704 modeline extents. */
3705 static Charcount 3705 static Charcount
3706 add_glyph_to_fstring_db_runes (pos_data *data, Lisp_Object glyph, 3706 add_glyph_to_fstring_db_runes (pos_data *data, Lisp_Object glyph,
3707 Charcount pos, Charcount min, Charcount max) 3707 Charcount pos, Charcount min_pos, Charcount max_pos)
3708 { 3708 {
3709 /* This function has been Mule-ized. */ 3709 /* This function has been Mule-ized. */
3710 Charcount end; 3710 Charcount end;
3711 struct display_block *db = data->db; 3711 struct display_block *db = data->db;
3712 struct glyph_block gb; 3712 struct glyph_block gb;
3714 data->blank_width = space_width (XWINDOW (data->window)); 3714 data->blank_width = space_width (XWINDOW (data->window));
3715 while (Dynarr_length (db->runes) < pos) 3715 while (Dynarr_length (db->runes) < pos)
3716 add_blank_rune (data, NULL, 0); 3716 add_blank_rune (data, NULL, 0);
3717 3717
3718 end = Dynarr_length (db->runes) + 1; 3718 end = Dynarr_length (db->runes) + 1;
3719 if (max != -1) 3719 if (max_pos != -1)
3720 end = min (max, end); 3720 end = min (max_pos, end);
3721 3721
3722 gb.glyph = glyph; 3722 gb.glyph = glyph;
3723 gb.extent = Qnil; 3723 gb.extent = Qnil;
3724 add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, 0); 3724 add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, 0);
3725 pos++; 3725 pos++;
5534 d->size_changed = 0; 5534 d->size_changed = 0;
5535 5535
5536 return 0; 5536 return 0;
5537 } 5537 }
5538 5538
5539 #ifndef WINDOWSNT
5539 static Lisp_Object 5540 static Lisp_Object
5540 restore_profiling_redisplay_flag (Lisp_Object val) 5541 restore_profiling_redisplay_flag (Lisp_Object val)
5541 { 5542 {
5542 profiling_redisplay_flag = XINT (val); 5543 profiling_redisplay_flag = XINT (val);
5543 return Qnil; 5544 return Qnil;
5544 } 5545 }
5546 #endif
5545 5547
5546 /* Ensure that all windows on all frames on all devices are displaying 5548 /* Ensure that all windows on all frames on all devices are displaying
5547 the current contents of their respective buffers. */ 5549 the current contents of their respective buffers. */
5548 5550
5549 static void 5551 static void
5551 { 5553 {
5552 Lisp_Object devcons, concons; 5554 Lisp_Object devcons, concons;
5553 int size_change_failed = 0; 5555 int size_change_failed = 0;
5554 int count = specpdl_depth (); 5556 int count = specpdl_depth ();
5555 5557
5558 #ifndef WINDOWSNT
5556 if (profiling_active) 5559 if (profiling_active)
5557 { 5560 {
5558 record_unwind_protect (restore_profiling_redisplay_flag, 5561 record_unwind_protect (restore_profiling_redisplay_flag,
5559 make_int (profiling_redisplay_flag)); 5562 make_int (profiling_redisplay_flag));
5560 profiling_redisplay_flag = 1; 5563 profiling_redisplay_flag = 1;
5561 } 5564 }
5565 #endif
5562 5566
5563 if (asynch_device_change_pending) 5567 if (asynch_device_change_pending)
5564 handle_asynch_device_change (); 5568 handle_asynch_device_change ();
5565 5569
5566 if (!buffers_changed && !clip_changed && !extents_changed && !faces_changed 5570 if (!buffers_changed && !clip_changed && !extents_changed && !faces_changed