[gimp-perl] Added ITEM support and allow tests to pass. Fix by Ed J for bug #722430.
- From: Kevin Cozens <kcozens src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp-perl] Added ITEM support and allow tests to pass. Fix by Ed J for bug #722430.
- Date: Sat, 18 Jan 2014 18:49:12 +0000 (UTC)
commit 5338be84c04ea1e4c673fb5a55a930dd3cfce24e
Author: Kevin Cozens <kevin ve3syb ca>
Date: Sat Jan 18 13:36:41 2014 -0500
Added ITEM support and allow tests to pass. Fix by Ed J for bug #722430.
Gimp.pm | 13 +++++++++----
Gimp/Lib.xs | 15 +++++----------
2 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/Gimp.pm b/Gimp.pm
index 04a3190..d833a2b 100644
--- a/Gimp.pm
+++ b/Gimp.pm
@@ -609,11 +609,11 @@ sub _pseudoclass {
push(@{"$class\::PREFIXES"} , @prefixes); @prefixes= {"$class\::PREFIXES"};
}
-_pseudoclass qw(Layer gimp_drawable_ gimp_layer_ gimp_floating_sel_ gimp_image_ gimp_ plug_in_
perl_fu_);
-_pseudoclass qw(Image gimp_image_ gimp_drawable_ gimp_ plug_in_ perl_fu_);
-_pseudoclass qw(Drawable gimp_drawable_ gimp_layer_ gimp_channel_ gimp_image_ gimp_ plug_in_ perl_fu_);
+_pseudoclass qw(Layer gimp_item_ gimp_layer_ gimp_floating_sel_ gimp_image_ gimp_ plug_in_
perl_fu_);
+_pseudoclass qw(Image gimp_image_ gimp_item_ gimp_ plug_in_ perl_fu_);
+_pseudoclass qw(Drawable gimp_item_ gimp_layer_ gimp_channel_ gimp_image_ gimp_ plug_in_ perl_fu_);
_pseudoclass qw(Selection gimp_selection_);
-_pseudoclass qw(Channel gimp_channel_ gimp_drawable_ gimp_selection_ gimp_image_ gimp_
plug_in_ perl_fu_);
+_pseudoclass qw(Channel gimp_channel_ gimp_item_ gimp_selection_ gimp_image_ gimp_ plug_in_
perl_fu_);
_pseudoclass qw(Display gimp_display_ gimp_);
_pseudoclass qw(Plugin plug_in_);
_pseudoclass qw(Gradient gimp_gradient_);
@@ -623,6 +623,11 @@ _pseudoclass qw(Progress gimp_progress_);
_pseudoclass qw(Region );
_pseudoclass qw(GimpParasite );
+push @Gimp::Drawable::ISA, qw(Gimp::Item);
+push @Gimp::Vector::ISA, qw(Gimp::Item);
+push @Gimp::Channel::ISA, qw(Gimp::Drawable);
+push @Gimp::Layer::ISA, qw(Gimp::Drawable);
+
# "C"-Classes
_pseudoclass qw(GimpDrawable gimp_drawable_);
_pseudoclass qw(PixelRgn gimp_pixel_rgn_);
diff --git a/Gimp/Lib.xs b/Gimp/Lib.xs
index 1fe37b1..6bc4001 100644
--- a/Gimp/Lib.xs
+++ b/Gimp/Lib.xs
@@ -43,6 +43,7 @@
#define PKG_COLOR GIMP_PKG "Color"
#define PKG_REGION GIMP_PKG "Region"
+#define PKG_ITEM GIMP_PKG "Item"
#define PKG_DISPLAY GIMP_PKG "Display"
#define PKG_IMAGE GIMP_PKG "Image"
#define PKG_LAYER GIMP_PKG "Layer"
@@ -645,7 +646,7 @@ autobless (SV *sv, int type)
return sv;
}
-/* return gint32 from object, wether iv or rv. */
+/* return gint32 from object, whether iv or rv. */
static gint32
unbless (SV *sv, char *type, char *croak_str)
{
@@ -922,25 +923,21 @@ convert_sv2gimp (char *croak_str, GimpParam *arg, SV *sv)
case GIMP_PDB_FLOAT: arg->data.d_float = sv2gimp_extract_noref (SvNV, "FLOAT");
case GIMP_PDB_STRING: arg->data.d_string = sv2gimp_extract_noref (SvPv, "STRING");
+ case GIMP_PDB_ITEM:
case GIMP_PDB_DISPLAY:
case GIMP_PDB_IMAGE:
case GIMP_PDB_LAYER:
case GIMP_PDB_CHANNEL:
case GIMP_PDB_DRAWABLE:
- case GIMP_PDB_SELECTION:
- case GIMP_PDB_BOUNDARY:
- case GIMP_PDB_PATH:
case GIMP_PDB_STATUS:
if (SvOK(sv))
switch (arg->type) {
+ case GIMP_PDB_ITEM: arg->data.d_item = unbless(sv, PKG_ITEM , croak_str);
break;
case GIMP_PDB_DISPLAY: arg->data.d_display = unbless(sv, PKG_DISPLAY , croak_str);
break;
case GIMP_PDB_LAYER: arg->data.d_layer = unbless(sv, PKG_ANYABLE , croak_str);
break;
case GIMP_PDB_CHANNEL: arg->data.d_channel = unbless(sv, PKG_ANYABLE , croak_str);
break;
case GIMP_PDB_DRAWABLE: arg->data.d_drawable = unbless(sv, PKG_ANYABLE , croak_str);
break;
- case GIMP_PDB_SELECTION: arg->data.d_selection = unbless(sv, PKG_SELECTION, croak_str);
break;
- case GIMP_PDB_BOUNDARY: arg->data.d_boundary = sv2gimp_extract_noref (SvIV, "BOUNDARY");
- case GIMP_PDB_PATH: arg->data.d_path = sv2gimp_extract_noref (SvIV,
"PATH");
case GIMP_PDB_STATUS: arg->data.d_status = sv2gimp_extract_noref (SvIV, "STATUS");
case GIMP_PDB_IMAGE:
{
@@ -965,13 +962,11 @@ convert_sv2gimp (char *croak_str, GimpParam *arg, SV *sv)
}
else
switch (arg->type) {
+ case GIMP_PDB_ITEM: arg->data.d_item = -1; break;
case GIMP_PDB_DISPLAY: arg->data.d_display = -1; break;
case GIMP_PDB_LAYER: arg->data.d_layer = -1; break;
case GIMP_PDB_CHANNEL: arg->data.d_channel = -1; break;
case GIMP_PDB_DRAWABLE: arg->data.d_drawable = -1; break;
- case GIMP_PDB_SELECTION: arg->data.d_selection = -1; break;
- case GIMP_PDB_BOUNDARY: arg->data.d_boundary = -1; break;
- case GIMP_PDB_PATH: arg->data.d_path = -1; break;
case GIMP_PDB_STATUS: arg->data.d_status = -1; break;
case GIMP_PDB_IMAGE: arg->data.d_image = -1; return 0; break;
default: abort ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]