Mercurial > pidgin
comparison src/gtkimhtml.c @ 10795:096c8a65d3fc
[gaim-migrate @ 12438]
ok, I hope this fixes the looping problems.
committer: Tailor Script <tailor@pidgin.im>
| author | Tim Ringenbach <marv@pidgin.im> |
|---|---|
| date | Fri, 08 Apr 2005 14:56:58 +0000 |
| parents | d34054fcab50 |
| children | 5335eb2b8b95 |
comparison
equal
deleted
inserted
replaced
| 10794:d34054fcab50 | 10795:096c8a65d3fc |
|---|---|
| 527 gtk_imhtml_expose_event (GtkWidget *widget, | 527 gtk_imhtml_expose_event (GtkWidget *widget, |
| 528 GdkEventExpose *event) | 528 GdkEventExpose *event) |
| 529 { | 529 { |
| 530 GtkTextIter start, end, cur; | 530 GtkTextIter start, end, cur; |
| 531 int buf_x, buf_y; | 531 int buf_x, buf_y; |
| 532 GSList *tags, *l; | |
| 533 GdkRectangle visible_rect; | 532 GdkRectangle visible_rect; |
| 534 GdkGC *gc = gdk_gc_new(GDK_DRAWABLE(event->window)); | 533 GdkGC *gc = gdk_gc_new(GDK_DRAWABLE(event->window)); |
| 535 GdkColor gcolor; | 534 GdkColor gcolor; |
| 536 | 535 |
| 537 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(widget), &visible_rect); | 536 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(widget), &visible_rect); |
| 575 | 574 |
| 576 | 575 |
| 577 cur = start; | 576 cur = start; |
| 578 | 577 |
| 579 while (gtk_text_iter_in_range(&cur, &start, &end)) { | 578 while (gtk_text_iter_in_range(&cur, &start, &end)) { |
| 580 tags = gtk_text_iter_get_tags(&cur); | 579 GSList *tags = gtk_text_iter_get_tags(&cur); |
| 580 GSList *l; | |
| 581 | 581 |
| 582 gaim_debug_info("gtkimhtml", "cur = %d, start = %d, end = %d\n", | 582 gaim_debug_info("gtkimhtml", "cur = %d, start = %d, end = %d\n", |
| 583 gtk_text_iter_get_offset(&cur), gtk_text_iter_get_offset(&start), | 583 gtk_text_iter_get_offset(&cur), gtk_text_iter_get_offset(&start), |
| 584 gtk_text_iter_get_offset(&end)); | 584 gtk_text_iter_get_offset(&end)); |
| 585 | 585 |
| 603 &tag_area.x, | 603 &tag_area.x, |
| 604 &tag_area.y); | 604 &tag_area.y); |
| 605 rect.x = visible_rect.x; | 605 rect.x = visible_rect.x; |
| 606 rect.y = tag_area.y; | 606 rect.y = tag_area.y; |
| 607 | 607 |
| 608 while (!gtk_text_iter_is_end(&cur) && gtk_text_iter_begins_tag(&cur, tag)) | 608 do |
| 609 gtk_text_iter_forward_to_tag_toggle(&cur, tag); | 609 gtk_text_iter_forward_to_tag_toggle(&cur, tag); |
| 610 while (!gtk_text_iter_is_end(&cur) && gtk_text_iter_begins_tag(&cur, tag)); | |
| 611 | |
| 610 gtk_text_view_get_iter_location(GTK_TEXT_VIEW(widget), &cur, &tag_area); | 612 gtk_text_view_get_iter_location(GTK_TEXT_VIEW(widget), &cur, &tag_area); |
| 611 gtk_text_view_buffer_to_window_coords(GTK_TEXT_VIEW(widget), | 613 gtk_text_view_buffer_to_window_coords(GTK_TEXT_VIEW(widget), |
| 612 GTK_TEXT_WINDOW_TEXT, | 614 GTK_TEXT_WINDOW_TEXT, |
| 613 tag_area.x, | 615 tag_area.x, |
| 614 tag_area.y, | 616 tag_area.y, |
| 632 gc, | 634 gc, |
| 633 TRUE, | 635 TRUE, |
| 634 rect.x, rect.y, rect.width, rect.height); | 636 rect.x, rect.y, rect.width, rect.height); |
| 635 gaim_debug_info("gtkimhtml", "drawing rect at %d,%d to %d,%d\n", | 637 gaim_debug_info("gtkimhtml", "drawing rect at %d,%d to %d,%d\n", |
| 636 rect.x, rect.y, rect.x+rect.width, rect.y+rect.height); | 638 rect.x, rect.y, rect.x+rect.width, rect.y+rect.height); |
| 637 gtk_text_iter_backward_char(&cur); | 639 gtk_text_iter_backward_char(&cur); /* go back one, in case the end is the begining is the end |
| 640 * note that above, we always moved cur ahead by at least | |
| 641 * one character */ | |
| 638 break; | 642 break; |
| 639 } | 643 } |
| 640 | 644 |
| 641 g_slist_free(tags); | 645 g_slist_free(tags); |
| 642 while (gtk_text_iter_forward_to_tag_toggle(&cur, NULL) && gtk_text_iter_begins_tag(&cur, NULL)); | 646 |
| 643 } | 647 /* loop until another tag begins, or no tag begins */ |
| 644 | 648 while (gtk_text_iter_forward_to_tag_toggle(&cur, NULL) && |
| 649 !gtk_text_iter_is_end(&cur) && | |
| 650 !gtk_text_iter_begins_tag(&cur, NULL)); | |
| 651 } | |
| 652 | |
| 645 gdk_gc_unref(gc); | 653 gdk_gc_unref(gc); |
| 646 | 654 |
| 647 if (GTK_WIDGET_CLASS (parent_class)->expose_event) | 655 if (GTK_WIDGET_CLASS (parent_class)->expose_event) |
| 648 return (* GTK_WIDGET_CLASS (parent_class)->expose_event) | 656 return (* GTK_WIDGET_CLASS (parent_class)->expose_event) |
| 649 (widget, event); | 657 (widget, event); |
