Mercurial > pidgin.yaz
comparison pidgin/gtkimhtml.c @ 31463:62f6e6796e48
merged from im.pidgin.pidgin
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 08 Dec 2010 23:34:06 +0900 |
parents | 4635d84e3292 b91cd8c4e6e5 |
children | fa88dc1dcabb |
comparison
equal
deleted
inserted
replaced
31437:4635d84e3292 | 31463:62f6e6796e48 |
---|---|
760 GdkEventExpose *event) | 760 GdkEventExpose *event) |
761 { | 761 { |
762 GtkTextIter start, end, cur; | 762 GtkTextIter start, end, cur; |
763 int buf_x, buf_y; | 763 int buf_x, buf_y; |
764 GdkRectangle visible_rect; | 764 GdkRectangle visible_rect; |
765 GdkGC *gc = gdk_gc_new(GDK_DRAWABLE(event->window)); | 765 cairo_t *cr = gdk_cairo_create(GDK_DRAWABLE(event->window)); |
766 GdkColor gcolor; | 766 GdkColor gcolor; |
767 | 767 |
768 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(widget), &visible_rect); | 768 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(widget), &visible_rect); |
769 gtk_text_view_buffer_to_window_coords(GTK_TEXT_VIEW(widget), | 769 gtk_text_view_buffer_to_window_coords(GTK_TEXT_VIEW(widget), |
770 GTK_TEXT_WINDOW_TEXT, | 770 GTK_TEXT_WINDOW_TEXT, |
778 | 778 |
779 if (GTK_IMHTML(widget)->editable || GTK_IMHTML(widget)->wbfo) { | 779 if (GTK_IMHTML(widget)->editable || GTK_IMHTML(widget)->wbfo) { |
780 | 780 |
781 if (GTK_IMHTML(widget)->edit.background) { | 781 if (GTK_IMHTML(widget)->edit.background) { |
782 gdk_color_parse(GTK_IMHTML(widget)->edit.background, &gcolor); | 782 gdk_color_parse(GTK_IMHTML(widget)->edit.background, &gcolor); |
783 gdk_gc_set_rgb_fg_color(gc, &gcolor); | 783 gdk_cairo_set_source_color(cr, &gcolor); |
784 } else { | 784 } else { |
785 gdk_gc_set_rgb_fg_color(gc, &(widget->style->base[GTK_WIDGET_STATE(widget)])); | 785 gdk_cairo_set_source_color(cr, &(widget->style->base[GTK_WIDGET_STATE(widget)])); |
786 } | 786 } |
787 | 787 |
788 gdk_draw_rectangle(event->window, | 788 cairo_rectangle(cr, |
789 gc, | 789 visible_rect.x, visible_rect.y, |
790 TRUE, | 790 visible_rect.width, visible_rect.height); |
791 visible_rect.x, visible_rect.y, visible_rect.width, visible_rect.height); | 791 cairo_fill(cr); |
792 g_object_unref(G_OBJECT(gc)); | 792 cairo_destroy(cr); |
793 | 793 |
794 if (GTK_WIDGET_CLASS (parent_class)->expose_event) | 794 if (GTK_WIDGET_CLASS (parent_class)->expose_event) |
795 return (* GTK_WIDGET_CLASS (parent_class)->expose_event) | 795 return (* GTK_WIDGET_CLASS (parent_class)->expose_event) |
796 (widget, event); | 796 (widget, event); |
797 return FALSE; | 797 return FALSE; |
858 strncpy(&tmp[1], color, 7); | 858 strncpy(&tmp[1], color, 7); |
859 tmp[7] = '\0'; | 859 tmp[7] = '\0'; |
860 if (!gdk_color_parse(tmp, &gcolor)) | 860 if (!gdk_color_parse(tmp, &gcolor)) |
861 gdk_color_parse("white", &gcolor); | 861 gdk_color_parse("white", &gcolor); |
862 } | 862 } |
863 gdk_gc_set_rgb_fg_color(gc, &gcolor); | 863 gdk_cairo_set_source_color(cr, &gcolor); |
864 | 864 |
865 gdk_draw_rectangle(event->window, | 865 cairo_rectangle(cr, |
866 gc, | 866 rect.x, rect.y, |
867 TRUE, | 867 rect.width, rect.height); |
868 rect.x, rect.y, rect.width, rect.height); | 868 cairo_fill(cr); |
869 gtk_text_iter_backward_char(&cur); /* go back one, in case the end is the begining is the end | 869 gtk_text_iter_backward_char(&cur); /* go back one, in case the end is the begining is the end |
870 * note that above, we always moved cur ahead by at least | 870 * note that above, we always moved cur ahead by at least |
871 * one character */ | 871 * one character */ |
872 break; | 872 break; |
873 } | 873 } |
878 while (gtk_text_iter_forward_to_tag_toggle(&cur, NULL) && | 878 while (gtk_text_iter_forward_to_tag_toggle(&cur, NULL) && |
879 !gtk_text_iter_is_end(&cur) && | 879 !gtk_text_iter_is_end(&cur) && |
880 !gtk_text_iter_begins_tag(&cur, NULL)); | 880 !gtk_text_iter_begins_tag(&cur, NULL)); |
881 } | 881 } |
882 | 882 |
883 g_object_unref(G_OBJECT(gc)); | 883 cairo_destroy(cr); |
884 | 884 |
885 if (GTK_WIDGET_CLASS (parent_class)->expose_event) | 885 if (GTK_WIDGET_CLASS (parent_class)->expose_event) |
886 return (* GTK_WIDGET_CLASS (parent_class)->expose_event) | 886 return (* GTK_WIDGET_CLASS (parent_class)->expose_event) |
887 (widget, event); | 887 (widget, event); |
888 | 888 |