# HG changeset patch # User Elliott Sales de Andrade # Date 1280291775 0 # Node ID 6ea43032df7071ef795b6195a7ffef1f580ea3fe # Parent 4458f98f42ba2fe6b3f3a46a865cc9f9b3073eff Replace GdkGC in whiteboard stuff. But I don't have Yahoo!, so don't know if it really works. diff -r 4458f98f42ba -r 6ea43032df70 pidgin/gtkwhiteboard.c --- a/pidgin/gtkwhiteboard.c Wed Jul 28 04:15:35 2010 +0000 +++ b/pidgin/gtkwhiteboard.c Wed Jul 28 04:36:15 2010 +0000 @@ -586,21 +586,13 @@ GtkWidget *widget = gtkwb->drawing_area; GdkPixmap *pixmap = gtkwb->pixmap; - GdkRectangle update_rect; - - GdkGC *gfx_con = gdk_gc_new(pixmap); + cairo_t *gfx_con = gdk_cairo_create(GDK_DRAWABLE(pixmap)); GdkColor col; - update_rect.x = x - size / 2; - update_rect.y = y - size / 2; - update_rect.width = size; - update_rect.height = size; - /* Interpret and convert color */ pidgin_whiteboard_rgb24_to_rgb48(color, &col); - gdk_gc_set_rgb_fg_color(gfx_con, &col); - /* gdk_gc_set_rgb_bg_color(gfx_con, &col); */ + gdk_cairo_set_source_color(gfx_con, &col); /* NOTE 5 is a size constant for now... this is because of how poorly the * gdk_draw_arc draws small circles @@ -608,28 +600,26 @@ if(size < 5) { /* Draw a rectangle/square */ - gdk_draw_rectangle(pixmap, - gfx_con, - TRUE, - update_rect.x, update_rect.y, - update_rect.width, update_rect.height); + cairo_rectangle(gfx_con, + x - size / 2, y - size / 2, + size, size); + cairo_fill(gfx_con); } else { /* Draw a circle */ - gdk_draw_arc(pixmap, - gfx_con, - TRUE, - update_rect.x, update_rect.y, - update_rect.width, update_rect.height, - 0, FULL_CIRCLE_DEGREES); + cairo_arc(gfx_con, + x, y, + size / 2.0, + 0.0, 2.0 * M_PI); + cairo_fill(gfx_con); } gtk_widget_queue_draw_area(widget, - update_rect.x, update_rect.y, - update_rect.width, update_rect.height); + x - size / 2, y - size / 2, + size, size); - g_object_unref(G_OBJECT(gfx_con)); + cairo_destroy(gfx_con); } /* Uses Bresenham's algorithm (as provided by Wikipedia) */