Mercurial > pidgin.yaz
diff 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 |
line wrap: on
line diff
--- a/pidgin/gtkimhtml.c Thu Dec 02 20:17:37 2010 +0900 +++ b/pidgin/gtkimhtml.c Wed Dec 08 23:34:06 2010 +0900 @@ -762,7 +762,7 @@ GtkTextIter start, end, cur; int buf_x, buf_y; GdkRectangle visible_rect; - GdkGC *gc = gdk_gc_new(GDK_DRAWABLE(event->window)); + cairo_t *cr = gdk_cairo_create(GDK_DRAWABLE(event->window)); GdkColor gcolor; gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(widget), &visible_rect); @@ -780,16 +780,16 @@ if (GTK_IMHTML(widget)->edit.background) { gdk_color_parse(GTK_IMHTML(widget)->edit.background, &gcolor); - gdk_gc_set_rgb_fg_color(gc, &gcolor); + gdk_cairo_set_source_color(cr, &gcolor); } else { - gdk_gc_set_rgb_fg_color(gc, &(widget->style->base[GTK_WIDGET_STATE(widget)])); + gdk_cairo_set_source_color(cr, &(widget->style->base[GTK_WIDGET_STATE(widget)])); } - gdk_draw_rectangle(event->window, - gc, - TRUE, - visible_rect.x, visible_rect.y, visible_rect.width, visible_rect.height); - g_object_unref(G_OBJECT(gc)); + cairo_rectangle(cr, + visible_rect.x, visible_rect.y, + visible_rect.width, visible_rect.height); + cairo_fill(cr); + cairo_destroy(cr); if (GTK_WIDGET_CLASS (parent_class)->expose_event) return (* GTK_WIDGET_CLASS (parent_class)->expose_event) @@ -860,12 +860,12 @@ if (!gdk_color_parse(tmp, &gcolor)) gdk_color_parse("white", &gcolor); } - gdk_gc_set_rgb_fg_color(gc, &gcolor); - - gdk_draw_rectangle(event->window, - gc, - TRUE, - rect.x, rect.y, rect.width, rect.height); + gdk_cairo_set_source_color(cr, &gcolor); + + cairo_rectangle(cr, + rect.x, rect.y, + rect.width, rect.height); + cairo_fill(cr); gtk_text_iter_backward_char(&cur); /* go back one, in case the end is the begining is the end * note that above, we always moved cur ahead by at least * one character */ @@ -880,7 +880,7 @@ !gtk_text_iter_begins_tag(&cur, NULL)); } - g_object_unref(G_OBJECT(gc)); + cairo_destroy(cr); if (GTK_WIDGET_CLASS (parent_class)->expose_event) return (* GTK_WIDGET_CLASS (parent_class)->expose_event)