Mercurial > pidgin.yaz
comparison pidgin/gtkwhiteboard.c @ 31443:33d2caadee60
So I only changed the obvious GdkGC use in the whiteboard. I think
this should cover the rest this time.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 30 Jul 2010 02:41:38 +0000 |
parents | 6ea43032df70 |
children | e898334364f7 |
comparison
equal
deleted
inserted
replaced
31442:25d93d273e9c | 31443:33d2caadee60 |
---|---|
351 #endif | 351 #endif |
352 | 352 |
353 static gboolean pidgin_whiteboard_configure_event(GtkWidget *widget, GdkEventConfigure *event, gpointer data) | 353 static gboolean pidgin_whiteboard_configure_event(GtkWidget *widget, GdkEventConfigure *event, gpointer data) |
354 { | 354 { |
355 PidginWhiteboard *gtkwb = (PidginWhiteboard*)data; | 355 PidginWhiteboard *gtkwb = (PidginWhiteboard*)data; |
356 | |
357 GdkPixmap *pixmap = gtkwb->pixmap; | 356 GdkPixmap *pixmap = gtkwb->pixmap; |
357 cairo_t *cr; | |
358 | 358 |
359 if(pixmap) | 359 if(pixmap) |
360 g_object_unref(pixmap); | 360 g_object_unref(pixmap); |
361 | 361 |
362 pixmap = gdk_pixmap_new(widget->window, | 362 pixmap = gdk_pixmap_new(widget->window, |
363 widget->allocation.width, | 363 widget->allocation.width, |
364 widget->allocation.height, | 364 widget->allocation.height, |
365 -1); | 365 -1); |
366 | |
367 gtkwb->pixmap = pixmap; | 366 gtkwb->pixmap = pixmap; |
368 | 367 |
369 gdk_draw_rectangle(pixmap, | 368 cr = gdk_cairo_create(GDK_DRAWABLE(pixmap)); |
370 widget->style->white_gc, | 369 gdk_cairo_set_source_color(cr, &widget->style->white); |
371 TRUE, | 370 cairo_rectangle(cr, |
372 0, 0, | 371 0, 0, |
373 widget->allocation.width, | 372 widget->allocation.width, widget->allocation.height); |
374 widget->allocation.height); | 373 cairo_fill(cr); |
374 cairo_destroy(cr); | |
375 | 375 |
376 return TRUE; | 376 return TRUE; |
377 } | 377 } |
378 | 378 |
379 static gboolean pidgin_whiteboard_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data) | 379 static gboolean pidgin_whiteboard_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data) |
380 { | 380 { |
381 PidginWhiteboard *gtkwb = (PidginWhiteboard*)(data); | 381 PidginWhiteboard *gtkwb = (PidginWhiteboard*)(data); |
382 GdkPixmap *pixmap = gtkwb->pixmap; | 382 GdkPixmap *pixmap = gtkwb->pixmap; |
383 | 383 cairo_t *cr; |
384 gdk_draw_drawable(widget->window, | 384 |
385 widget->style->fg_gc[GTK_WIDGET_STATE(widget)], | 385 cr = gdk_cairo_create(GDK_DRAWABLE(widget->window)); |
386 pixmap, | 386 gdk_cairo_set_source_pixmap(cr, pixmap, event->area.x, event->area.y); |
387 event->area.x, event->area.y, | 387 cairo_rectangle(cr, |
388 event->area.x, event->area.y, | 388 event->area.x, event->area.y, |
389 event->area.width, event->area.height); | 389 event->area.width, event->area.height); |
390 cairo_fill(cr); | |
391 cairo_destroy(cr); | |
390 | 392 |
391 return FALSE; | 393 return FALSE; |
392 } | 394 } |
393 | 395 |
394 static gboolean pidgin_whiteboard_brush_down(GtkWidget *widget, GdkEventButton *event, gpointer data) | 396 static gboolean pidgin_whiteboard_brush_down(GtkWidget *widget, GdkEventButton *event, gpointer data) |
708 static void pidgin_whiteboard_clear(PurpleWhiteboard *wb) | 710 static void pidgin_whiteboard_clear(PurpleWhiteboard *wb) |
709 { | 711 { |
710 PidginWhiteboard *gtkwb = wb->ui_data; | 712 PidginWhiteboard *gtkwb = wb->ui_data; |
711 GdkPixmap *pixmap = gtkwb->pixmap; | 713 GdkPixmap *pixmap = gtkwb->pixmap; |
712 GtkWidget *drawing_area = gtkwb->drawing_area; | 714 GtkWidget *drawing_area = gtkwb->drawing_area; |
713 | 715 cairo_t *cr = gdk_cairo_create(GDK_DRAWABLE(pixmap)); |
714 gdk_draw_rectangle(pixmap, | 716 |
715 drawing_area->style->white_gc, | 717 gdk_cairo_set_source_color(cr, &drawing_area->style->white); |
716 TRUE, | 718 cairo_rectangle(cr, |
717 0, 0, | 719 0, 0, |
718 drawing_area->allocation.width, | 720 drawing_area->allocation.width, |
719 drawing_area->allocation.height); | 721 drawing_area->allocation.height); |
722 cairo_fill(cr); | |
723 cairo_destroy(cr); | |
720 | 724 |
721 gtk_widget_queue_draw_area(drawing_area, | 725 gtk_widget_queue_draw_area(drawing_area, |
722 0, 0, | 726 0, 0, |
723 drawing_area->allocation.width, | 727 drawing_area->allocation.width, |
724 drawing_area->allocation.height); | 728 drawing_area->allocation.height); |