>From 664b6e3a7c207a199e5a84551a6d8e66ad1e73b9 Mon Sep 17 00:00:00 2001 From: Quentin Sculo Date: Thu, 22 Apr 2010 21:39:21 +0200 Subject: [PATCH 1/3] GdkDrawable : allow undef as argument in 3 methods draw_pixbuf : allow undef as gc draw_layout_with_colors : allow undef as colors draw_layout_line_with_colors : allow undef as colors --- t/GdkDrawable.t | 5 +++++ xs/GdkDrawable.xs | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/t/GdkDrawable.t b/t/GdkDrawable.t index 897fa55..6bfc8f1 100644 --- a/t/GdkDrawable.t +++ b/t/GdkDrawable.t @@ -73,7 +73,9 @@ $win -> draw_polygon($gc, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6); $win -> draw_layout_line($gc, 10, 10, $layout -> get_line(0)); $win -> draw_layout($gc, 10, 10, $layout); $win -> draw_layout_line_with_colors($gc, 10, 10, $layout -> get_line(0), $black, $black); +$win -> draw_layout_line_with_colors($gc, 10, 10, $layout -> get_line(0), $black, undef); $win -> draw_layout_with_colors($gc, 10, 10, $layout, $black, $black); +$win -> draw_layout_with_colors($gc, 10, 10, $layout, undef, $black); $win -> draw_drawable($gc, $win, 5, 5, 5, 5, 10, 10); my $image = $win -> get_image(5, 5, 10, 10); @@ -91,6 +93,9 @@ SKIP: { unless Gtk2->CHECK_VERSION (2, 2, 0); $win -> draw_pixbuf($gc, Gtk2::Gdk::Pixbuf -> new("rgb", 0, 8, 10, 10), 0, 0, 0, 0, -1, -1, "none", 5, 5); + + #test with no gc + $win -> draw_pixbuf(undef, Gtk2::Gdk::Pixbuf -> new("rgb", 0, 8, 10, 10), 0, 0, 0, 0, -1, -1, "none", 5, 5); } SKIP: { diff --git a/xs/GdkDrawable.xs b/xs/GdkDrawable.xs index a79cd12..c6b8d71 100644 --- a/xs/GdkDrawable.xs +++ b/xs/GdkDrawable.xs @@ -252,7 +252,7 @@ gdk_draw_segments (drawable, gc, ...) void gdk_draw_pixbuf (drawable, gc, pixbuf, src_x, src_y, dest_x, dest_y, width, height, dither, x_dither, y_dither) GdkDrawable *drawable - GdkGC *gc + GdkGC_ornull *gc GdkPixbuf *pixbuf gint src_x gint src_y @@ -305,8 +305,8 @@ gdk_draw_layout_line_with_colors (drawable, gc, x, y, line, foreground, backgrou gint x gint y PangoLayoutLine *line - GdkColor *foreground - GdkColor *background + GdkColor_ornull *foreground + GdkColor_ornull *background ## void gdk_draw_layout_with_colors (GdkDrawable *drawable, GdkGC *gc, gint x, gint y, PangoLayout *layout, GdkColor *foreground, GdkColor *background) void @@ -316,8 +316,8 @@ gdk_draw_layout_with_colors (drawable, gc, x, y, layout, foreground, background) gint x gint y PangoLayout *layout - GdkColor *foreground - GdkColor *background + GdkColor_ornull *foreground + GdkColor_ornull *background ## The docs say that "[t]his is low level functionality used internally to ## implement rotated underlines and backgrouds when rendering a PangoLayout -- 1.6.4.4