app/gui/about-dialog.c app/widgets/gimpimagefilepreview.c use

2003-02-21  Manish Singh  <yosh@gimp.org>

        * app/gui/about-dialog.c
        * app/widgets/gimpimagefilepreview.c
        * app/widgets/gimptoolbox-color-area.c: use gdk_draw_pixbuf with
        GTK+ 2.2 or higher instead of gdk_pixbuf_render_to_drawable.
        That function will be deprecated in GTK+ 2.4. We should remove the
        fallback at some point when we start depending on GTK+ 2.2 for other
        stuff.
This commit is contained in:
Manish Singh 2003-02-22 01:33:42 +00:00 committed by Manish Singh
parent 38e53219d7
commit 393fe155b9
5 changed files with 50 additions and 0 deletions

View File

@ -1,3 +1,13 @@
2003-02-21 Manish Singh <yosh@gimp.org>
* app/gui/about-dialog.c
* app/widgets/gimpimagefilepreview.c
* app/widgets/gimptoolbox-color-area.c: use gdk_draw_pixbuf with
GTK+ 2.2 or higher instead of gdk_pixbuf_render_to_drawable.
That function will be deprecated in GTK+ 2.4. We should remove the
fallback at some point when we start depending on GTK+ 2.2 for other
stuff.
2003-02-21 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplay-foreach.[ch]: added new function

View File

@ -334,6 +334,12 @@ about_dialog_load_logo (GtkWidget *window)
gc = gdk_gc_new (logo_pixmap);
/* FIXME: remove when we no longer support GTK 2.0.x */
#if GTK_CHECK_VERSION(2,2,0)
gdk_draw_pixbuf (GDK_DRAWABLE (logo_pixmap), gc, pixbuf,
0, 0, 0, 0, logo_width, logo_height,
GDK_RGB_DITHER_NORMAL, 0, 0);
#else
gdk_pixbuf_render_to_drawable (pixbuf,
GDK_DRAWABLE (logo_pixmap),
gc,
@ -343,6 +349,7 @@ about_dialog_load_logo (GtkWidget *window)
logo_height,
GDK_RGB_DITHER_NORMAL,
0, 0);
#endif
g_object_unref (gc);
g_object_unref (pixbuf);

View File

@ -334,6 +334,12 @@ about_dialog_load_logo (GtkWidget *window)
gc = gdk_gc_new (logo_pixmap);
/* FIXME: remove when we no longer support GTK 2.0.x */
#if GTK_CHECK_VERSION(2,2,0)
gdk_draw_pixbuf (GDK_DRAWABLE (logo_pixmap), gc, pixbuf,
0, 0, 0, 0, logo_width, logo_height,
GDK_RGB_DITHER_NORMAL, 0, 0);
#else
gdk_pixbuf_render_to_drawable (pixbuf,
GDK_DRAWABLE (logo_pixmap),
gc,
@ -343,6 +349,7 @@ about_dialog_load_logo (GtkWidget *window)
logo_height,
GDK_RGB_DITHER_NORMAL,
0, 0);
#endif
g_object_unref (gc);
g_object_unref (pixbuf);

View File

@ -131,6 +131,17 @@ gimp_imagefile_expose_event (GtkWidget *widget,
rect.y = (widget->allocation.height - rect.height) / 2;
if (gdk_rectangle_intersect (&rect, &event->area, &draw_rect))
/* FIXME: remove when we no longer support GTK 2.0.x */
#if GTK_CHECK_VERSION(2,2,0)
gdk_draw_pixbuf (GDK_DRAWABLE (widget->window),
widget->style->bg_gc[widget->state],
preview->no_preview_pixbuf,
draw_rect.x - rect.x, draw_rect.y - rect.y,
draw_rect.x, draw_rect.y,
draw_rect.width, draw_rect.height,
GDK_RGB_DITHER_NORMAL,
event->area.x, event->area.y);
#else
gdk_pixbuf_render_to_drawable (preview->no_preview_pixbuf,
GDK_DRAWABLE (widget->window),
widget->style->bg_gc[widget->state],
@ -140,6 +151,7 @@ gimp_imagefile_expose_event (GtkWidget *widget,
draw_rect.width, draw_rect.height,
GDK_RGB_DITHER_NORMAL,
event->area.x, event->area.y);
#endif
return FALSE;
}

View File

@ -319,10 +319,17 @@ color_area_draw (GimpContext *context)
GTK_ICON_SIZE_MENU, NULL);
w = gdk_pixbuf_get_width (pixbuf);
h = gdk_pixbuf_get_height (pixbuf);
/* FIXME: remove when we no longer support GTK 2.0.x */
#if GTK_CHECK_VERSION(2,2,0)
gdk_draw_pixbuf (color_area->window, NULL, pixbuf,
0, 0, 0, height - h, w, h,
GDK_RGB_DITHER_MAX, 0, 0);
#else
gdk_pixbuf_render_to_drawable_alpha (pixbuf, color_area->window,
0, 0, 0, height - h, w, h,
GDK_PIXBUF_ALPHA_FULL, 127,
GDK_RGB_DITHER_MAX, 0, 0);
#endif
g_object_unref (pixbuf);
/* draw the swap colors pixbuf */
@ -330,10 +337,17 @@ color_area_draw (GimpContext *context)
GTK_ICON_SIZE_MENU, NULL);
w = gdk_pixbuf_get_width (pixbuf);
h = gdk_pixbuf_get_height (pixbuf);
/* FIXME: remove when we no longer support GTK 2.0.x */
#if GTK_CHECK_VERSION(2,2,0)
gdk_draw_pixbuf (color_area->window, NULL, pixbuf,
0, 0, width - w, 0, w, h,
GDK_RGB_DITHER_MAX, 0, 0);
#else
gdk_pixbuf_render_to_drawable_alpha (pixbuf, color_area->window,
0, 0, width - w, 0, w, h,
GDK_PIXBUF_ALPHA_FULL, 127,
GDK_RGB_DITHER_MAX, 0, 0);
#endif
g_object_unref (pixbuf);
}