cpw.qulogic.cairo: 00619cdb: Replace GdkGC in GtkIMHtml. Just in case...
qulogic at pidgin.im
qulogic at pidgin.im
Wed Jul 28 00:59:16 EDT 2010
----------------------------------------------------------------------
Revision: 00619cdb28e4ac0f2349bafff0011d6cf68eeccf
Parent: 18ad20d37405c4392ebe2846a94196ef2c81d368
Author: qulogic at pidgin.im
Date: 07/28/10 00:51:24
Branch: im.pidgin.cpw.qulogic.cairo
URL: http://d.pidgin.im/viewmtn/revision/info/00619cdb28e4ac0f2349bafff0011d6cf68eeccf
Changelog:
Replace GdkGC in GtkIMHtml. Just in case you were wondering, it's now
going away [1].
[1] http://blogs.gnome.org/otte/2010/07/27/rendering-cleanup/
Changes against parent 18ad20d37405c4392ebe2846a94196ef2c81d368
patched pidgin/gtkimhtml.c
-------------- next part --------------
============================================================
--- pidgin/gtkimhtml.c 9e71e4aad2a78354774e3eb6d67c3f8859ef3f90
+++ pidgin/gtkimhtml.c 19378ad24eb7ef51413d3384789d0439b5f99c61
@@ -756,7 +756,7 @@ gtk_imhtml_expose_event (GtkWidget
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);
@@ -774,16 +774,16 @@ gtk_imhtml_expose_event (GtkWidget
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)
@@ -854,12 +854,12 @@ gtk_imhtml_expose_event (GtkWidget
if (!gdk_color_parse(tmp, &gcolor))
gdk_color_parse("white", &gcolor);
}
- gdk_gc_set_rgb_fg_color(gc, &gcolor);
+ gdk_cairo_set_source_color(cr, &gcolor);
- gdk_draw_rectangle(event->window,
- gc,
- TRUE,
- rect.x, rect.y, rect.width, rect.height);
+ 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 */
@@ -874,7 +874,7 @@ gtk_imhtml_expose_event (GtkWidget
!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)
More information about the Commits
mailing list