[perl-Gtk2] GdkDrawable: allow undef in a few places
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk2] GdkDrawable: allow undef in a few places
- Date: Sat, 24 Apr 2010 21:43:37 +0000 (UTC)
commit 02f128ac9451c6589906c663f63db3d5aa6fd3d1
Author: Quentin Sculo <squentin free fr>
Date: Thu Apr 22 21:39:21 2010 +0200
GdkDrawable: allow undef in a few places
draw_pixbuf : allow undef for gc
draw_layout_with_colors : allow undef for colors
draw_layout_line_with_colors : allow undef for 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]