diff options
author | raveit65 <[email protected]> | 2015-09-01 23:18:42 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2015-09-06 13:08:31 +0200 |
commit | 9b6649abf3047657e9a95223e98acfb1455ef9e7 (patch) | |
tree | 816c5f5ac09716bbff91d79ac7e0f16e90294e7e /src | |
parent | a4ef374026fb32517922e3977ea4b9d7d1a0b621 (diff) | |
download | eom-9b6649abf3047657e9a95223e98acfb1455ef9e7.tar.bz2 eom-9b6649abf3047657e9a95223e98acfb1455ef9e7.tar.xz |
Gtk3: remove an unused variable + simplify the code
inspiriert from:
https://git.gnome.org/browse/eog/commit/?h=gnome-3-4&id=9ef7d86
Diffstat (limited to 'src')
-rw-r--r-- | src/eom-print-preview.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/eom-print-preview.c b/src/eom-print-preview.c index 0f5f484..5410ebb 100644 --- a/src/eom-print-preview.c +++ b/src/eom-print-preview.c @@ -559,26 +559,32 @@ eom_print_preview_new (void) #if GTK_CHECK_VERSION (3, 0, 0) static gboolean draw_cb (GtkDrawingArea *drawing_area, - cairo_t *cr, + cairo_t *cr, + gpointer user_data) +{ + update_relative_sizes (EOM_PRINT_PREVIEW (user_data)); + + eom_print_preview_draw (EOM_PRINT_PREVIEW (user_data), cr); + + if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) { + fprintf (stderr, "Cairo is unhappy: %s\n", + cairo_status_to_string (cairo_status (cr))); + } + return TRUE; +} #else static void expose_event_cb (GtkDrawingArea *drawing_area, GdkEventExpose *eev, -#endif gpointer user_data) { GtkWidget *widget; -#if !GTK_CHECK_VERSION (3, 0, 0) cairo_t *cr; -#endif widget = GTK_WIDGET (drawing_area); update_relative_sizes (EOM_PRINT_PREVIEW (user_data)); - -#if !GTK_CHECK_VERSION (3, 0, 0) cr = gdk_cairo_create (gtk_widget_get_window (widget)); -#endif eom_print_preview_draw (EOM_PRINT_PREVIEW (user_data), cr); @@ -586,17 +592,10 @@ expose_event_cb (GtkDrawingArea *drawing_area, fprintf (stderr, "Cairo is unhappy: %s\n", cairo_status_to_string (cairo_status (cr))); } - -#if !GTK_CHECK_VERSION (3, 0, 0) cairo_destroy (cr); - gdk_window_get_pointer (gtk_widget_get_window (widget), NULL, NULL, NULL); -#endif - -#if GTK_CHECK_VERSION (3, 0, 0) - return TRUE; -#endif } +#endif /** * get_current_image_coordinates: |