"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Gtk3.pm" between
Gtk3-0.035.tar.gz and Gtk3-0.036.tar.gz

About: gtk3-perl is a set of perl bindings for Gtk+ 3.that allows Perl developers to write Gtk and Gnome applications. Development version.

Gtk3.pm  (Gtk3-0.035):Gtk3.pm  (Gtk3-0.036)
package Gtk3; package Gtk3;
$Gtk3::VERSION = '0.035'; $Gtk3::VERSION = '0.036';
=encoding utf8 =encoding utf8
=head1 NAME =head1 NAME
Gtk3 - Perl interface to the 3.x series of the gtk+ toolkit Gtk3 - Perl interface to the 3.x series of the gtk+ toolkit
=head1 SYNOPSIS =head1 SYNOPSIS
use Gtk3 -init; use Gtk3 -init;
my $window = Gtk3::Window->new ('toplevel'); my $window = Gtk3::Window->new ('toplevel');
skipping to change at line 2124 skipping to change at line 2124
=cut =cut
sub Gtk3::Gdk::Pixbuf::get_pixels { sub Gtk3::Gdk::Pixbuf::get_pixels {
my $pixel_aref = Glib::Object::Introspection->invoke ( my $pixel_aref = Glib::Object::Introspection->invoke (
$_GDK_PIXBUF_BASENAME, 'Pixbuf', 'get_pixels', @_); $_GDK_PIXBUF_BASENAME, 'Pixbuf', 'get_pixels', @_);
return pack 'C*', @{$pixel_aref}; return pack 'C*', @{$pixel_aref};
} }
=item * C<Gtk3::Gdk::Pixbuf::new_from_data> is reimplemented in terms of =item * C<Gtk3::Gdk::Pixbuf::new_from_data> is reimplemented in terms of
C<new_from_inline> for correct memory management. No C<destroy_fn> and C<new_from_bytes> (with gdk-pixbuf >= 2.32) or C<new_from_inline> (with
gtk-pixbuf < 2.32) for correct memory management. No C<destroy_fn> and
C<destroy_fn_data> arguments are needed. C<destroy_fn_data> arguments are needed.
=cut =cut
sub Gtk3::Gdk::Pixbuf::new_from_data { sub Gtk3::Gdk::Pixbuf::new_from_data {
my ($class, $data, $colorspace, $has_alpha, $bits_per_sample, $width, $height, $rowstride) = @_; my ($class, $data, $colorspace, $has_alpha, $bits_per_sample, $width, $height, $rowstride) = @_;
die 'Only RGB is currently supported' unless $colorspace eq 'rgb'; if (Gtk3::Gdk::Pixbuf::CHECK_VERSION (2, 32, 0)) {
die 'Only 8 bits per pixel are currently supported' unless $bits_per_sample == my $packed_data = ref($data) eq 'ARRAY' ? pack 'C*', @$data : $data;
8; return Gtk3::Gdk::Pixbuf->new_from_bytes(
my $length = Gtk3::Gdk::PIXDATA_HEADER_LENGTH () + Glib::Bytes->new($packed_data),
$rowstride*$height; $colorspace, $has_alpha,
my $type = Gtk3::Gdk::PixdataType->new ([qw/sample_width_8 encoding_raw/]); $bits_per_sample, $width,
$type |= $has_alpha ? 'color_type_rgba' : 'color_type_rgb'; $height, $rowstride);
my @header_numbers = (0x47646b50, } else {
$length, die 'Only RGB is currently supported' unless $colorspace eq 'rgb';
$$type, # FIXME: This kind of breaks encapsulation. die 'Only 8 bits per pixel are currently supported'
$rowstride, unless $bits_per_sample == 8;
$width, my $length = Gtk3::Gdk::PIXDATA_HEADER_LENGTH () +
$height); $rowstride*$height;
# Convert to 8 bit unsigned chars, padding to 32 bit little-endian first. my $type = Gtk3::Gdk::PixdataType->new ([qw/sample_width_8 encoding_raw/])
my @header = map { unpack ("C*", pack ("N", $_)) } @header_numbers; ;
my $inline_data = _unpack_unless_array_ref ($data); $type |= $has_alpha ? 'color_type_rgba' : 'color_type_rgb';
unshift @$inline_data, @header; my @header_numbers = (0x47646b50,
return Gtk3::Gdk::Pixbuf->new_from_inline ($inline_data); $length,
$$type, # FIXME: This kind of breaks encapsulation.
$rowstride,
$width,
$height);
# Convert to 8 bit unsigned chars, padding to 32 bit little-endian first.
my @header = map { unpack ("C*", pack ("N", $_)) } @header_numbers;
my $inline_data = _unpack_unless_array_ref ($data);
unshift @$inline_data, @header;
return Gtk3::Gdk::Pixbuf->new_from_inline ($inline_data);
}
} }
=item * C<Gtk3::Gdk::Pixbuf::new_from_inline> does not take a C<copy_pixels> =item * C<Gtk3::Gdk::Pixbuf::new_from_inline> does not take a C<copy_pixels>
argument. It is always set to TRUE for correct memory management. argument. It is always set to TRUE for correct memory management.
=cut =cut
sub Gtk3::Gdk::Pixbuf::new_from_inline { sub Gtk3::Gdk::Pixbuf::new_from_inline {
my ($class, $data) = @_; my ($class, $data) = @_;
return Glib::Object::Introspection->invoke ( return Glib::Object::Introspection->invoke (
skipping to change at line 2389 skipping to change at line 2400
my ($rest) = @_; my ($rest) = @_;
local $@; local $@;
if (scalar @$rest == 1 && eval { defined $rest->[0]->[0] }) { if (scalar @$rest == 1 && eval { defined $rest->[0]->[0] }) {
return $rest->[0]; return $rest->[0];
} else { } else {
return $rest; return $rest;
} }
} }
package Gtk3::Gdk::EventMask; package Gtk3::Gdk::EventMask;
$Gtk3::Gdk::EventMask::VERSION = '0.035'; $Gtk3::Gdk::EventMask::VERSION = '0.036';
use overload use overload
'==' => \&eq, '==' => \&eq,
'>=' => \&ge; '>=' => \&ge;
use Scalar::Util qw/looks_like_number/; use Scalar::Util qw/looks_like_number/;
my $_convert_one = sub { my $_convert_one = sub {
return Glib::Object::Introspection->convert_flags_to_sv ( return Glib::Object::Introspection->convert_flags_to_sv (
'Gtk3::Gdk::EventMask', $_[0]); 'Gtk3::Gdk::EventMask', $_[0]);
}; };
 End of changes. 4 change blocks. 
21 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)