2010-07-29 [holger] 3.7.6cvs23
authorHolger Berndt <hb@claws-mail.org>
Thu, 29 Jul 2010 16:37:50 +0000 (16:37 +0000)
committerHolger Berndt <hb@claws-mail.org>
Thu, 29 Jul 2010 16:37:50 +0000 (16:37 +0000)
* src/printing.c
Replace some gdk drawing with cairo, as the former
is going towards deprecation.

ChangeLog
PATCHSETS
configure.ac
src/printing.c

index bd345f35cc4d3214a4dbf20ca033b8ef22627230..9eba83d7677f13257c22b9ea2e156d6b140e6dec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-29 [holger]    3.7.6cvs23
+
+       * src/printing.c
+               Replace some gdk drawing with cairo, as the former
+               is going towards deprecation.
+
 2010-07-25 [colin]     3.7.6cvs22
 
        * src/common/utils.c
index a310cb5233006a9652d9d2c8485d48c959f42d9f..b2e01cf0341e0b2bc8c79051fc3e843d23053332 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.36.2.184 -r 1.36.2.185 src/common/utils.c;  ) > 3.7.6cvs20.patchset
 ( cvs diff -u -r 1.36.2.185 -r 1.36.2.186 src/common/utils.c;  ) > 3.7.6cvs21.patchset
 ( cvs diff -u -r 1.36.2.186 -r 1.36.2.187 src/common/utils.c;  ) > 3.7.6cvs22.patchset
+( cvs diff -u -r 1.1.2.29 -r 1.1.2.30 src/printing.c;  ) > 3.7.6cvs23.patchset
index 8988d14126b48b3ab6b5abbe6e3d12e5c710062c..c8b86074f701cf26d8d9ad4247fc3b80a8266d6b 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=22
+EXTRA_VERSION=23
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index ab8d2307630ab212548d88b6ac294ca8ebe94caa..acd25de69d077341c3fa8703996bbb36b2f3d742 100644 (file)
@@ -659,49 +659,31 @@ static gboolean cb_preview_expose(GtkWidget *widget, GdkEventExpose *event,
                                  gpointer data)
 {
        PreviewData *preview_data = data;
-       GdkGC *gc;
-       GdkColor white;
-       GdkColor black;
-       GdkColor gray;
        cairo_t *cr;
 
        debug_print("preview_expose (current %p)\n", preview_data->current_page);
-       gdk_window_clear(preview_data->area->window);
 
-       white.red   = 65535;
-       white.green = 65535;
-       white.blue  = 65535;
-       black.red   = 0;
-       black.green = 0;
-       black.blue  = 0;
-       gray.red   = 32700;
-       gray.green = 32700;
-       gray.blue  = 32700;
-
-       gc = gdk_gc_new(GDK_DRAWABLE(preview_data->area->window));
+       cr = gdk_cairo_create(preview_data->area->window);
 
        /* background */
-       gdk_gc_set_rgb_fg_color(gc, &gray);
-       gdk_draw_rectangle(preview_data->area->window, gc, TRUE, 0, 0,
-                          preview_data->area->allocation.width,
-                          preview_data->area->allocation.height);
+       cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
+       cairo_rectangle(cr, event->area.x, event->area.y, event->area.width, event->area.height);
+       cairo_fill(cr);
 
        /* shadow */
-       gdk_gc_set_rgb_fg_color(gc, &black);
-       gdk_draw_rectangle(preview_data->area->window, gc, TRUE,
-                          PREVIEW_SHADOW_OFFSET, PREVIEW_SHADOW_OFFSET,
-                          preview_data->page_width+PREVIEW_SHADOW_OFFSET,
-                          preview_data->page_height+PREVIEW_SHADOW_OFFSET);
+       cairo_set_source_rgb(cr, 0., 0., 0.);
+       cairo_rectangle(cr, PREVIEW_SHADOW_OFFSET, PREVIEW_SHADOW_OFFSET,
+           preview_data->page_width+PREVIEW_SHADOW_OFFSET,
+           preview_data->page_height+PREVIEW_SHADOW_OFFSET);
+       cairo_fill(cr);
 
        /* paper */
-       gdk_gc_set_rgb_fg_color(gc, &white);
-       gdk_draw_rectangle(preview_data->area->window, gc, TRUE, 0, 0,
-                          preview_data->page_width,
-                          preview_data->page_height);
+       cairo_set_source_rgb(cr, 1., 1., 1.);
+       cairo_rectangle(cr, 0, 0,
+           preview_data->page_width,
+           preview_data->page_height);
+       cairo_fill(cr);
 
-       g_object_unref(gc);
-
-       cr = gdk_cairo_create(preview_data->area->window);
        gtk_print_context_set_cairo_context(preview_data->context, cr, PREVIEW_SCALE, PREVIEW_SCALE);
        cairo_destroy(cr);
 
@@ -1460,4 +1442,3 @@ static void printing_preview_update_zoom_sensitivity(PreviewData *preview_data)
        else
                gtk_widget_set_sensitive(preview_data->zoom_out, TRUE);
 }
-