Hello community, here is the log from the commit of package perl-Prima for openSUSE:Factory checked in at Fri Apr 1 12:57:10 CEST 2011.
-------- --- perl-Prima/perl-Prima.changes 2010-10-19 10:32:49.000000000 +0200 +++ /mounts/work_src_done/STABLE/perl-Prima/perl-Prima.changes 2011-04-01 10:38:31.000000000 +0200 @@ -1,0 +2,9 @@ +Fri Apr 1 08:34:21 UTC 2011 - [email protected] + +- update to 1.29 + Support for 16-bit BMP files. Fixes for modern Xorg, macos, + and strawberry. + Optionally support truncated image files. + Fixes in documentation, Sliders, and key event handling. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- Prima-1.28.tar.gz New: ---- Prima-1.29.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Prima.spec ++++++ --- /var/tmp/diff_new_pack.kMtBAT/_old 2011-04-01 12:56:38.000000000 +0200 +++ /var/tmp/diff_new_pack.kMtBAT/_new 2011-04-01 12:56:38.000000000 +0200 @@ -1,7 +1,7 @@ # -# spec file for package perl-Prima (Version 1.28) +# spec file for package perl-Prima # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,8 +24,8 @@ Group: Development/Libraries/Perl AutoReqProv: on Requires: xorg-x11 -Version: 1.28 -Release: 6 +Version: 1.29 +Release: 1 Summary: A Perl toolkit for multi-platform GUI development Url: http://prima.eu.org Source: http://prima.eu.org/download/Prima-%{version}.tar.gz ++++++ Prima-1.28.tar.gz -> Prima-1.29.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/HISTORY new/Prima-1.29/HISTORY --- old/Prima-1.28/HISTORY 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/HISTORY 2011-01-12 20:07:32.000000000 +0100 @@ -1,3 +1,8 @@ +1.29 Support for 16-bit BMP files. Fixes for modern Xorg, macos, and strawberry. + Optionally support truncated image files. + +1.28 Fixes in documentation, Sliders, and key event handling. + 1.27 Support JPEG comments and metadata. Save multiframe images. 1.26 Abandond prigraph, adopt libjpeg/libpng/etc cohort instead. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/Makefile.PL new/Prima-1.29/Makefile.PL --- old/Prima-1.28/Makefile.PL 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/Makefile.PL 2011-01-12 20:07:31.000000000 +0100 @@ -24,7 +24,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: Makefile.PL,v 1.221 2008/11/08 23:19:02 dk Exp $ +# $Id: Makefile.PL,v 1.226 2011/01/10 21:59:20 dk Exp $ # BEGIN { @@ -164,6 +164,7 @@ %cache_find_files $binary_prereq $win32_use_dlltool + $compiler_version ); my $see_makefile_log = "(see also makefile.log for details)"; @@ -328,6 +329,34 @@ return( $rc == 0); } +sub compile_and_run +{ + my ( $text) = @_; + my $tmpsrc = qd( tempfile( "$TMPDIR/pmts%04d.c")); + my $tmpo = qd( tempfile( "$TMPDIR/pmts%04d$OBJ_EXT")); + my $tmpexe = qd( tempfile( "$TMPDIR/pmts%04d$EXE_EXT")); + my @tmpextras = ( $tmpsrc, $tmpsrc); + $tmpextras[0] =~ s/\.[^\.+]$/.ilk/; + $tmpextras[1] =~ s/\.[^\.+]$/.pdb/; + + open TMPSRC, ">$tmpsrc" or die "Creation of temporary file $tmpsrc failed $see_makefile_log"; + print TMPSRC $text; + close TMPSRC; + + null_output; + my @cc = grep !/^-W(all|error|\d)/i, cc_command_line( $tmpsrc, $tmpo, $tmpexe, 0); + print STDERR "@cc\n"; + my $rc = system("@cc"); + restore_output; + unlink $tmpsrc; + unlink $tmpo if -w $tmpo; + my $ret = `$tmpexe`; + chomp $ret; + unlink $tmpexe if -w $tmpexe; + unlink $_ for @tmpextras; + return $ret; +} + sub have_header { my $header = shift; @@ -849,7 +878,7 @@ setvar( 'INCPATH', ( "include", qd( "include/generic"), - $Config{installarchlib} . qd( "/CORE"), + $Config{archlib} . qd( "/CORE"), ( map { s/-I//; $_ } split ' ', $INC) )); my @libpaths = quoted_split( $Config{ libpth}); @@ -871,7 +900,10 @@ if ( $useGC) { push @libs, 'leak'; } - if ( $COMPILER eq 'gcc') { + if ( + $COMPILER eq 'gcc' and + $LD ne 'g++' # g++ and gcc together are weird kind - g++ does -lgcc itself + ) { push @libs, 'gcc'; } my @flibs; @@ -939,9 +971,15 @@ } if ( $COMPILER eq 'msvc') { - $DEFINES{_CRT_SECURE_NO_DEPRECATE} = 1; - # to be invoked on command line - $CFLAGS .= " -D_CRT_SECURE_NO_DEPRECATE"; + # crazy activestate/msvc stuff + if ( $compiler_version < 1400) { + $DEFINES{_CRT_SECURE_NO_DEPRECATE} = 1; + # to be invoked on command line + $CFLAGS .= " -D_CRT_SECURE_NO_DEPRECATE"; + } + if ( $compiler_version >= 1600 ) { + delete $DEFINES{_USE_32BIT_TIME_T}; + } } # find common denominator with installsitearch and installscript @@ -976,8 +1014,10 @@ # In Linux GNU make also has name 'make'. But Makefile been # generated by this script is compatible with it. If it named # 'gmake' then we force $MAKETYPE to contain 'make'. - $MAKETYPE = 'make' if $MAKETYPE =~ /^gmake|pmake$/; - die "Unknown make utility" unless $MAKETYPE =~ /^make|nmake|dmake$/; + $MAKETYPE = 'make' if $MAKETYPE =~ /gmake|pmake/; + die "Unknown make utility '$MAKETYPE'" unless $MAKETYPE =~ /(nmake|dmake|make)/; + $MAKETYPE = $1; + setvar( 'RM', $Config{ rm}); $OS2DLLF = 'Prima'; $OS2DLLF = &DynaLoader::mod2fname([$OS2DLLF]) if $OS2 && defined &DynaLoader::mod2fname; @@ -1031,6 +1071,18 @@ } EOF print "yes\n"; + + if ( $COMPILER eq 'msvc' ) { + print "Checking MSVC version... "; + $compiler_version = compile_and_run(<<'MSCVER'); +#include <stdio.h> +int main() { + printf("%d\n", _MSC_VER); + return 0; +} +MSCVER + print "$compiler_version\n"; + } } sub setup_X11 @@ -1112,7 +1164,9 @@ { if ( $Win32 || $cygwin || $OS2) { print "Checking for perl library... "; - my $libpath = find_lib( $Config{ libperl}, '', "", qd( "$Config{ archlib}/CORE")); + my $libperl = $Config{ libperl}; + $libperl =~ s/\.dll$//i if $cygwin; + my $libpath = find_lib( $libperl, '', "", qd( "$Config{ archlib}/CORE")); unless ( defined $libpath) { print "no\n"; die "Cannot find perl library $see_makefile_log\n" @@ -1121,7 +1175,7 @@ print ", in $libpath" if length($libpath); print "\n"; push @LIBPATH, $libpath if $libpath; - push @LIBS, $Config{ libperl}; + push @LIBS, $libperl; } } @@ -2585,6 +2639,6 @@ close MAKE; $packlist-> write('.packlist'); - print "\nAll done. Now you can run ${ MAKE}.\n"; + print "\nAll done. Now you can run $MAKETYPE.\n"; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/Prima/Classes.pm new/Prima-1.29/Prima/Classes.pm --- old/Prima-1.28/Prima/Classes.pm 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/Prima/Classes.pm 2011-01-12 20:07:32.000000000 +0100 @@ -27,7 +27,7 @@ # Anton Berezin <[email protected]> # Dmitry Karasik <[email protected]> # -# $Id: Classes.pm,v 1.105 2009/01/04 21:38:52 dk Exp $ +# $Id: Classes.pm,v 1.106 2009/09/22 13:48:25 dk Exp $ use Prima; use Prima::Const; @@ -239,6 +239,17 @@ return $component; } +sub find_component +{ + my ( $self, $name ) = @_; + my @q = $self-> get_components; + while ( my $x = shift @q ) { + return $x if $x-> name eq $name; + push @q, $x-> get_components; + } + return undef; +} + # class File package Prima::File; use vars qw(@ISA); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/Prima/Config.pm new/Prima-1.29/Prima/Config.pm --- old/Prima-1.28/Prima/Config.pm 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/Prima/Config.pm 2011-01-12 20:07:32.000000000 +0100 @@ -4,16 +4,16 @@ use vars qw(%Config %Config_inst); %Config_inst = ( - incpaths => [ '/usr/local/lib/perl/5.10.0/Prima/CORE','/usr/local/lib/perl/5.10.0/Prima/CORE/generic','/usr/lib/perl/5.10/CORE','/usr/local/include','/usr/include/freetype2','/usr/include/gtk-2.0','/usr/lib/gtk-2.0/include','/usr/include/atk-1.0','/usr/include/cairo','/usr/include/pango-1.0','/usr/include/glib-2.0','/usr/lib/glib-2.0/include','/usr/include/directfb','/usr/include/libpng12','/usr/include/pixman-1' ], - gencls => '/usr/bin/gencls', - tmlink => '/usr/bin/tmlink', - libname => '/usr/local/lib/perl/5.10.0/auto/Prima/Prima.a', - dlname => '/usr/local/lib/perl/5.10.0/auto/Prima/Prima.so', - ldpaths => ['/usr/local/lib','/lib','/usr/lib','/lib64','/usr/lib64','/usr/local/lib','/lib'], + incpaths => [ '/usr/local/lib/perl5/site_perl/5.8.9/mach/Prima/CORE','/usr/local/lib/perl5/site_perl/5.8.9/mach/Prima/CORE/generic','/usr/local/lib/perl5/5.8.9/mach/CORE','/usr/local/include','/usr/X11R6/include','/usr/X11R6/include/freetype2' ], + gencls => '/usr/local/bin/gencls', + tmlink => '/usr/local/bin/tmlink', + libname => '/usr/local/lib/perl5/site_perl/5.8.9/mach/auto/Prima/Prima.a', + dlname => '/usr/local/lib/perl5/site_perl/5.8.9/mach/auto/Prima/Prima.so', + ldpaths => ['/usr/lib','/usr/local/lib','/usr/local/lib','/lib'], libs => '', define => '-DHAVE_CONFIG_H=1', - inc => '-I/usr/local/lib/perl/5.10.0/Prima/CORE -I/usr/local/lib/perl/5.10.0/Prima/CORE/generic -I/usr/lib/perl/5.10/CORE -I/usr/local/include -I/usr/include/freetype2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/pixman-1', + inc => '-I/usr/local/lib/perl5/site_perl/5.8.9/mach/Prima/CORE -I/usr/local/lib/perl5/site_perl/5.8.9/mach/Prima/CORE/generic -I/usr/local/lib/perl5/5.8.9/mach/CORE -I/usr/local/include -I/usr/X11R6/include -I/usr/X11R6/include/freetype2', ); %Config = ( @@ -21,14 +21,14 @@ quote => '\'', platform => 'unix', compiler => 'gcc', - incpaths => [ '/home/dk/src/Prima/include','/home/dk/src/Prima/include/generic','/usr/lib/perl/5.10/CORE','/usr/local/include','/usr/include/freetype2','/usr/include/gtk-2.0','/usr/lib/gtk-2.0/include','/usr/include/atk-1.0','/usr/include/cairo','/usr/include/pango-1.0','/usr/include/glib-2.0','/usr/lib/glib-2.0/include','/usr/include/directfb','/usr/include/libpng12','/usr/include/pixman-1' ], - platform_path => '/home/dk/src/Prima/unix', - gencls => '\'/usr/bin/perl\' /home/dk/src/Prima/utils/gencls.pl', - tmlink => '\'/usr/bin/perl\' /home/dk/src/Prima/utils/tmlink.pl', + incpaths => [ '/usr/home/dk/src/Prima/include','/usr/home/dk/src/Prima/include/generic','/usr/local/lib/perl5/5.8.9/mach/CORE','/usr/local/include','/usr/X11R6/include','/usr/X11R6/include/freetype2' ], + platform_path => '/usr/home/dk/src/Prima/unix', + gencls => '\'/usr/local/bin/perl\' /usr/home/dk/src/Prima/utils/gencls.pl', + tmlink => '\'/usr/local/bin/perl\' /usr/home/dk/src/Prima/utils/tmlink.pl', scriptext => '', genclsoptions => '--tml --h --inc', cc => 'cc', - cflags => '-c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g ', + cflags => '-c -DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.9/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include -O2 -fno-strict-aliasing -pipe ', cdebugflags => '-g -O -Wall', cincflag => '-I', cobjflag => '-o ', @@ -39,27 +39,27 @@ liboutflag => '', libext => '.a', libprefix => '', - libname => '/home/dk/src/Prima/auto/Prima/Prima.a', - libs => '/home/dk/src/Prima/auto/Prima/Prima.a', - dlname => '/home/dk/src/Prima/auto/Prima/Prima.so', + libname => '/usr/home/dk/src/Prima/auto/Prima/Prima.a', + libs => '/usr/home/dk/src/Prima/auto/Prima/Prima.a', + dlname => '/usr/home/dk/src/Prima/auto/Prima/Prima.so', dlext => '.so', ld => 'cc', - ldflags => ' -shared -O2 -g -L/usr/local/lib ', + ldflags => ' -shared -L/usr/local/lib ', lddefflag => '', lddebugflags => '-g', ldoutflag => '-o ', ldlibflag => '-l', ldlibpathflag => '-L', - ldpaths => ['/usr/local/lib','/lib','/usr/lib','/lib64','/usr/lib64','/usr/local/lib','/lib'], - ldlibs => ['Xpm','ungif','tiff','png','jpeg','db','dl','m','pthread','c','crypt','gcc','X11','Xext','freetype','fontconfig','Xrender','Xft','gtk-x11-2.0','gdk-x11-2.0','atk-1.0','gdk_pixbuf-2.0','pangocairo-1.0','pango-1.0','cairo','gobject-2.0','gmodule-2.0','glib-2.0'], + ldpaths => ['/usr/lib','/usr/local/lib','/usr/local/lib','/lib'], + ldlibs => ['Xpm','ungif','tiff','png','jpeg','gdbm','m','crypt','util','gcc','X11','Xext','freetype','fontconfig','Xrender','Xft','iconv'], ldlibext =>'', inline => 'inline', - perl => '/usr/bin/perl', + perl => '/usr/local/bin/perl', dl_load_flags => 1, libs => '', define => '-DHAVE_CONFIG_H=1', - inc => '-I/usr/local/lib/perl/5.10.0/Prima/CORE -I/usr/local/lib/perl/5.10.0/Prima/CORE/generic -I/usr/lib/perl/5.10/CORE -I/usr/local/include -I/usr/include/freetype2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/pixman-1', + inc => '-I/usr/local/lib/perl5/site_perl/5.8.9/mach/Prima/CORE -I/usr/local/lib/perl5/site_perl/5.8.9/mach/Prima/CORE/generic -I/usr/local/lib/perl5/5.8.9/mach/CORE -I/usr/local/include -I/usr/X11R6/include -I/usr/X11R6/include/freetype2', ); 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/Prima/Image/AnimateGIF.pm new/Prima-1.29/Prima/Image/AnimateGIF.pm --- old/Prima-1.28/Prima/Image/AnimateGIF.pm 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/Prima/Image/AnimateGIF.pm 2011-01-12 20:07:32.000000000 +0100 @@ -22,7 +22,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: AnimateGIF.pm,v 1.2 2008/04/24 19:45:20 dk Exp $ +# $Id: AnimateGIF.pm,v 1.3 2010/02/09 18:10:22 dk Exp $ package Prima::Image::AnimateGIF; use strict; @@ -188,9 +188,9 @@ $self-> {images}-> [0]-> palette; my $i = $e-> {screenBackGroundColor} * 3; $self-> {bgColor} = ( - ($$cm[$i] || 0) | + ($$cm[$i+2] || 0) | (($$cm[$i+1] || 0) << 8) | - (($$cm[$i+2] || 0) << 16) + (($$cm[$i] || 0) << 16) ); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/Prima/Image/png.pm new/Prima-1.29/Prima/Image/png.pm --- old/Prima-1.28/Prima/Image/png.pm 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/Prima/Image/png.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,141 +0,0 @@ -# -# Copyright (c) 2008 Dmitry Karasik -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# Created by Dmitry Karasik <[email protected]> -# $Id$ -# - -use strict; -use Prima; -use Prima::Buttons; -use Prima::ComboBox; -use Prima::Edit; -use Prima::ImageViewer; -use Prima::Label; -use Prima::Sliders; -use Prima::Image::TransparencyControl; - -package Prima::Image::png; -use vars qw(@ISA); -@ISA = qw(Prima::Dialog); - -sub profile_default -{ - my $def = $_[ 0]-> SUPER::profile_default; - my %prf = ( - width => 480, - text => 'PNG filter', - height => 300, - centered => 1, - designScale => [ 7, 16], - ); - @$def{keys %prf} = values %prf; - return $def; -} - -sub init -{ - my $self = shift; - my %profile = $self-> SUPER::init(@_); - my $a = $self-> insert( qq(Prima::CheckBox) => - origin => [ 4, 261], - name => 'Transparent', - size => [ 133, 36], - text => '~Transparent', - delegations => ['Check'], - ); - my $b = $self-> insert( qq(Prima::CheckBox) => - origin => [ 144, 261], - name => 'Interlaced', - size => [ 100, 36], - text => '~Interlaced', - ); - $self-> insert( qq(Prima::Image::TransparencyControl) => - origin => [ 4, 100], - size => [ 364, 158], - text => '', - name => 'TC', - ); - $self-> insert( qq(Prima::Button) => - origin => [ 380, 259], - name => 'OK', - size => [ 96, 36], - text => '~OK', - default => 1, - modalResult => mb::OK, - delegations => ['Click'], - ); - $self-> insert( qq(Prima::Button) => - origin => [ 380, 213], - size => [ 96, 36], - text => 'Cancel', - modalResult => mb::Cancel, - ); - return %profile; -} - - -sub transparent -{ - my $self = $_[0]; - $self-> Transparent-> checked( $_[1]); - $self-> TC-> enabled( $_[1]); -} - -sub Transparent_Check -{ - my ( $self, $tr) = @_; - $self-> transparent( $tr-> checked); -} - -sub on_change -{ - my ( $self, $codec, $image) = @_; - $self-> {image} = $image; - return unless $image; - $self-> Interlaced-> checked( exists( $image-> {extras}-> {interlaced}) ? - $image-> {extras}-> {interlaced} : $codec-> {saveInput}-> {interlaced}); - $self-> transparent( $image-> {extras}-> {transparentColorIndex} ? 1 : 0); - $self-> TC-> image( $image); - $self-> TC-> index( exists( $image-> {extras}-> {transparentColorIndex}) ? - $image-> {extras}-> {transparentColorIndex} : 0); -} - -sub OK_Click -{ - my $self = $_[0]; - if ( $self-> Transparent-> checked) { - $self-> {image}-> {extras}-> {transparentColorIndex} = $self-> TC-> index; - } else { - delete $self-> {image}-> {extras}-> {transparentColorIndex}; - } - $self-> {image}-> {extras}-> {interlaced} = $self-> Interlaced-> checked; - delete $self-> {image}; - $self-> TC-> image( undef); -} - -sub save_dialog { Prima::Image::png-> create } - -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/Prima/ImageViewer.pm new/Prima-1.29/Prima/ImageViewer.pm --- old/Prima-1.28/Prima/ImageViewer.pm 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/Prima/ImageViewer.pm 2011-01-12 20:07:32.000000000 +0100 @@ -27,7 +27,7 @@ # Anton Berezin <[email protected]> # Dmitry Karasik <[email protected]> # -# $Id: ImageViewer.pm,v 1.35 2008/07/27 14:36:59 dk Exp $ +# $Id: ImageViewer.pm,v 1.36 2010/07/06 06:42:29 dk Exp $ # use strict; use Prima::ScrollWidget; @@ -431,7 +431,7 @@ $self-> image-> put_image_indirect( $image, $x, $y, $x, $y, $w, $h, $w, $h, rop::CopyPut); my @r = $self-> point2screen( $x, $y, $x + $w, $y + $h); - $self-> invalidate_rect( @r[0,1], map { int($_ + 0.5) } @r[2,3] ); + $self-> invalidate_rect( @r[0,1], map { int($_ + 1) } @r[2,3] ); $self-> update_view; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/Prima/Notebooks.pm new/Prima-1.29/Prima/Notebooks.pm --- old/Prima-1.28/Prima/Notebooks.pm 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/Prima/Notebooks.pm 2011-01-12 20:07:32.000000000 +0100 @@ -25,7 +25,7 @@ # # Created by Dmitry Karasik <[email protected]> # -# $Id: Notebooks.pm,v 1.32 2007/09/13 15:12:25 dk Exp $ +# $Id: Notebooks.pm,v 1.33 2010/04/03 13:30:37 dk Exp $ use strict; use Prima::Const; use Prima::Classes; @@ -703,11 +703,11 @@ $at = -1 unless defined $at; $at = $self-> {pageCount} - 1 if $at < 0 || $at >= $self-> {pageCount}; - my @r = splice( @{$self-> {widgets}}, $at, 1); + my $r = splice( @{$self-> {widgets}}, $at, 1); $self-> {pageCount}--; $self-> pageIndex( $self-> pageIndex); if ( $removeChildren) { - $$_[0]-> destroy for @{$r[0]}; + $_-> destroy for @$r; } } @@ -823,8 +823,8 @@ { my ( $self, $widget, $newPage) = @_; my ( $page, $number) = $self-> contains_widget( $widget); - return unless defined $page; - @{$self-> {widgets}-> [$newPage]} = splice( @{$self-> {widgets}-> [$page]}, $number, 1); + return unless defined $page and $page != $newPage; + push @{$self-> {widgets}-> [$newPage]}, splice( @{$self-> {widgets}-> [$page]}, $number, 1); $self-> repaint if $self-> {pageIndex} == $page || $self-> {pageIndex} == $newPage; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/Prima.pm new/Prima-1.29/Prima.pm --- old/Prima-1.28/Prima.pm 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/Prima.pm 2011-01-12 20:07:31.000000000 +0100 @@ -25,7 +25,7 @@ # # Created by Anton Berezin <[email protected]> # -# $Id: Prima.pm,v 1.89 2008/10/29 10:54:42 dk Exp $ +# $Id: Prima.pm,v 1.91 2011/01/06 10:02:20 dk Exp $ package Prima; @@ -34,7 +34,7 @@ use vars qw($VERSION @ISA $__import @preload); @ISA = qw(DynaLoader); sub dl_load_flags { 0x00 } -$VERSION = '1.28'; +$VERSION = '1.29'; bootstrap Prima $VERSION; unless ( UNIVERSAL::can('Prima', 'init')) { $::application = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/README new/Prima-1.29/README --- old/Prima-1.28/README 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/README 2011-01-12 20:07:31.000000000 +0100 @@ -20,9 +20,18 @@ - libtiff - libX11 - support for native X11 bitmap files -For Win32 and OS/2 platforms, libprigraph library can be used instead. The -library supports most of the popular image file formats, including BMP, PCX, -GIF, JPEG, TIFF, PNG, and is distributed in binary form for these platforms: +For Win32, CPAN contains binary distributions that can +be installed just for this purpose: + + http://search.cpan.org/~karasik/Prima-codecs-win32/ + +it should work for all MSVC and GCC compilers and for native, +cygwin, and mingw/strawberry perl runtimes. + +Alternatively, for Win32 and OS/2 platforms, libprigraph library can be used +instead. The library supports most of the popular image file formats, +including BMP, PCX, GIF, JPEG, TIFF, PNG, and is distributed in binary form for +these platforms: - Win32, native : http://www.prima.eu.org/download/gbm-bin-win32.zip. - Win32, cygwin : http://www.prima.eu.org/download/gbm-bin-cygwin.zip. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/img/codec_bmp.c new/Prima-1.29/img/codec_bmp.c --- old/Prima-1.28/img/codec_bmp.c 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/img/codec_bmp.c 2011-01-12 20:07:32.000000000 +0100 @@ -23,11 +23,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: codec_bmp.c,v 1.4 2008/10/24 08:15:04 dk Exp $ + * $Id: codec_bmp.c,v 1.6 2009/10/23 17:22:28 dk Exp $ */ /* -Copyright Andy Key +Copyright Andy Key, Heiko Nitzsche gbmbmp.c - OS/2 1.1, 1.2, 2.0 and Windows 3.0 support @@ -72,6 +72,7 @@ "ImportantColors", "XResolution", "YResolution", + "BitDepth", NULL }; @@ -161,7 +162,7 @@ #define BCA_UNCOMP 0x00000000L #define BCA_RLE8 0x00000001L #define BCA_RLE4 0x00000002L -#define BCA_HUFFFMAN1D 0x00000003L +#define BCA_BITFIELDS 0x00000003L #define BCA_RLE24 0x00000004L #define BCA_MAX BCA_RLE24 #define MSWCC_EOL 0 @@ -172,7 +173,7 @@ "Uncompressed", "RLE8", "RLE4", - "Huffman", + "Raw bits", "RLE24" }; @@ -189,6 +190,7 @@ #define outw(fd) { snprintf( fi-> errbuf, 256, "Write error:%s",strerror( req_error( fd))); return false; } #define outs(fd) { snprintf( fi-> errbuf, 256, "Seek error:%s",strerror( req_error( fd))); return false; } #define outcm(dd){ snprintf( fi-> errbuf, 256, "No enough memory (%d bytes)", (int)(dd)); return false;} +#define outcd(x,dd){ snprintf( fi-> errbuf, 256, x, (int)(dd)); return false;} #define BUFSIZE 16384 @@ -221,10 +223,14 @@ return ahead; } -static void +/* returns true on hard failure */ +static Bool destroy_ahead(AHEAD *ahead) { + Bool error = ahead-> error; free(ahead); + if (error & ahead-> fi-> wasTruncated) error = false; + return error; } static byte @@ -243,6 +249,8 @@ strerror( req_error( ahead-> fi-> req)) )); ahead-> error = 1; + if ( !ahead-> fi-> noIncomplete && ahead-> cnt >= 0) + ahead-> fi-> wasTruncated = true; return 0; } @@ -256,6 +264,12 @@ return ahead->buf[ahead->inx++]; } +typedef struct _RGBTriplet { + dword r; + dword g; + dword b; +} RGBTriplet; + typedef struct _LoadRec { size_t base; Bool windows; @@ -272,6 +286,9 @@ int passed; size_t passed_frame_offset; size_t file_start_offset; + RGBTriplet rgb_offset; + RGBTriplet rgb_mask; + RGBTriplet rgb_valid_bits; } LoadRec; @@ -362,6 +379,35 @@ return true; } +static dword +count_mask_bits(dword mask, dword * bitoffset) +{ + dword testmask = 1; /* start with the least significant bit */ + dword counter = 0; + dword index = 0; + + *bitoffset = 0; + + /* find offset of first bit */ + while (((mask & testmask) == 0) && (index < 31)) { + index++; + testmask <<= 1; + } + *bitoffset = index; + + /* count the bits set in the rest of the mask */ + while ((testmask <= mask) && (index < 31)) { + if (mask & testmask) { + counter++; + } + index++; + testmask <<= 1; + } + + return counter; +} + + static Bool read_bmp_header( PImgLoadFileInstance fi) { @@ -397,11 +443,11 @@ outr(fd); if ( cx == 0 || cy == 0 ) - outc("Bad size"); + outcm("Bad size"); if ( cPlanes != 1 ) - outc("Number of bitmap planes is not 1"); + outcd("Number of bitmap planes is %d, must be 1", cPlanes); if ( cBitCount != 1 && cBitCount != 4 && cBitCount != 8 && cBitCount != 24 ) - outc("Bit count not 1, 4, 8 or 24"); + outcd("Bit count is %d, must be 1, 4, 8 or 24", cBitCount); l-> w = (int) cx; l-> h = (int) cy; @@ -470,9 +516,16 @@ if ( ulWidth == 0L || ulHeight == 0L ) outc("Bad image size"); if ( cPlanes != 1 ) - outc("Number of bitmap planes is not 1"); - if ( cBitCount != 1 && cBitCount != 4 && cBitCount != 8 && cBitCount != 24 ) - outc("Bit count not 1, 4, 8 or 24"); + outcd("Number of bitmap planes is %d, must be 1", cPlanes); + if ( + cBitCount != 1 && + cBitCount != 4 && + cBitCount != 8 && + cBitCount != 16 && + cBitCount != 24 && + cBitCount != 32 + ) + outcd("Bit count is %d, must be 1, 4, 8, 16, 24 or 32", cBitCount); l-> w = (int) ulWidth; l-> h = (int) ulHeight; @@ -486,7 +539,77 @@ l-> resolution.y = ulYPelsPerMeter; } else outc("cbFix is bad"); + + if ( l-> bpp == 16 || l-> bpp == 32 ) { + switch ( l-> ulCompression) { + case BCA_UNCOMP: + l-> rgb_offset. b = 0; + l-> rgb_offset. g = (l->bpp == 16) ? 5 : 8; + l-> rgb_offset. r = (l->bpp == 16) ? 10 : 16; + + /* set color masks to either 16bpp (5,5,5) or 32bpp (8,8,8) */ + l-> rgb_mask. b = (l-> bpp == 16) ? 0x001f : 0x000000ff; + l-> rgb_mask. g = (l-> bpp == 16) ? 0x03e0 : 0x0000ff00; + l-> rgb_mask. r = (l-> bpp == 16) ? 0x7c00 : 0x00ff0000; + + l-> rgb_valid_bits. b = + l-> rgb_valid_bits. g = + l-> rgb_valid_bits. r = (l->bpp == 16) ? 5 : 8; + break; + + case BCA_BITFIELDS: { + Bool ok = 1; + RGBTriplet bytes; + + /* Read BI_BITFIELDS color masks from the header (where usually the palette is) */ + /* These are strangely stored as dwords in the order of R-G-B. */ + if ( req_seek(fd, (long) (l-> base + 14L + l-> cbFix), SEEK_SET) < 0) + outs(fd); + ok &= read_dword(fd, &l-> rgb_mask. r); + ok &= read_dword(fd, &l-> rgb_mask. g); + ok &= read_dword(fd, &l-> rgb_mask. b); + if ( !ok ) + outr(fd); + + /* count the bits used in each mask */ + l-> rgb_valid_bits. b = count_mask_bits( l-> rgb_mask. b, &l-> rgb_offset. b); + l-> rgb_valid_bits. g = count_mask_bits( l-> rgb_mask. g, &l-> rgb_offset. g); + l-> rgb_valid_bits. r = count_mask_bits( l-> rgb_mask. r, &l-> rgb_offset. r); + + /* Only up to 8 bit per mask are allowed */ + if ( + l-> rgb_valid_bits. b > 8 || + l-> rgb_valid_bits. g > 8 || + l-> rgb_valid_bits. r > 8 + ) + outc("Bad bit masks for non-24bits RGB data"); + + /* check for non-overlapping bits */ + if ( + l-> rgb_valid_bits. b + + l-> rgb_valid_bits. g + + l-> rgb_valid_bits. r > l-> bpp + ) + outc("Bad bit masks for non-24bits RGB data"); + + + if ( + l-> rgb_offset. b + l-> rgb_valid_bits. b > l-> rgb_offset. g || + l-> rgb_offset. g + l-> rgb_valid_bits. g > l-> rgb_offset. r || + l-> rgb_offset. r + l-> rgb_valid_bits. r > l-> bpp + ) + outc("Bad bit masks for non-24bits RGB data"); + + l-> rgb_valid_bits. r = 8 - l-> rgb_valid_bits. r; + l-> rgb_valid_bits. g = 8 - l-> rgb_valid_bits. g; + l-> rgb_valid_bits. b = 8 - l-> rgb_valid_bits. b; + break; + } + + default: + outcd("compression type is %d, expected 0 or 3", l->ulCompression); + }} return true; } @@ -506,8 +629,12 @@ ); if ( r < 0) outr( fi-> req); - if ( r == 0) - outc("Read error: unexpected end of file"); + if ( r == 0) { + if ( fi-> noIncomplete) + outc("Read error: unexpected end of file") + else + size = 0; + } read += r; size -= r; data += r; @@ -520,13 +647,73 @@ unsigned long r = req_read( fi-> req, size, data); if ( r < 0) outr( fi-> req); - if ( r != size) + if ( r != size && fi-> noIncomplete) outc( "Read error: unexpected end of file"); } return true; } +/* Read 16bpp data with compression BI_RGB or BI_BITFIELDS (will be mapped to 24bpp, lossless) */ +static Bool +read_16_32_bpp( PImgLoadFileInstance fi, PImage i, int bpp, unsigned long stride_dst) +{ + LoadRec * l = ( LoadRec *) fi-> instance; + int h, stride_src = ((i-> w * 16 + 31) / 32) * 4; + Byte *src, *dst; + + if ( !( src = (Byte*) malloc(stride_src))) + outcm(stride_src); + + dst = i-> data; /* write pointer */ + for (h = 0; h < i-> h; h++) { + int block_count = i-> w; + const word * src16 = (const word *) src; + const dword * src32 = (const dword *) src; + Byte * line = dst; + unsigned long r = req_read( fi-> req, stride_src, src); + + if ( r != stride_src ) { + free( src); + if ( r < 0) + outr( fi-> req); + if ( fi-> noIncomplete) + outc("Read error: unexpected end of file"); + h = i->h; + fi-> wasTruncated = true; + } + + /* Extract red, green, blue. */ + /* Encoding starts at least significant bit, then xB,yG,zR (most significant bit is unused). */ + /* Map these into 24bpp BGR. */ +#define GetX(X,SRC) (((SRC & l-> rgb_mask.X) >> l->rgb_offset.X) << l->rgb_valid_bits.X) + if ( bpp == 16 ) { + while (block_count > 0) { + register word data16 = *src16++; + *line++ = GetX(b,data16); + *line++ = GetX(g,data16); + *line++ = GetX(r,data16); + --block_count; + } + } else { + while (block_count > 0) { + register dword data32 = *src32++; + *line++ = GetX(b,data32); + *line++ = GetX(g,data32); + *line++ = GetX(r,data32); + --block_count; + } + } +#undef GetX + dst += stride_dst; + EVENT_TOPDOWN_SCANLINES_READY(fi, 1); + } + + free(src); + return true; +} + + static Bool load( PImgCodec instance, PImgLoadFileInstance fi) { @@ -535,6 +722,7 @@ PImgIORequest fd = fi-> req; PImage img; int cLinesWorth; /* bmp alignment and prima alignment are identical, by 4-byte boundary */ + int bpp; Byte * data; if ( !rewind_to_frame(fi)) @@ -543,18 +731,19 @@ return false; img = PImage( fi-> object); + bpp = ( l-> bpp == 16 || l-> bpp == 32 ) ? 24 : l-> bpp; if ( fi-> noImageData) { pset_i( width, l-> w); pset_i( height, l-> h); - CImage( fi-> object)-> create_empty( fi-> object, 1, 1, l-> bpp); + CImage( fi-> object)-> create_empty( fi-> object, 1, 1, bpp); } else { - CImage( fi-> object)-> create_empty( fi-> object, l-> w, l-> h, l-> bpp); + CImage( fi-> object)-> create_empty( fi-> object, l-> w, l-> h, bpp); EVENT_HEADER_READY( fi); } data = img-> data; /* read palette */ - if ( l-> bpp != 24) { + if ( bpp != 24) { int i; byte b[4]; PRGBColor pal; @@ -587,7 +776,7 @@ img-> palSize = 0; } - if ( l-> bpp == 1) + if ( bpp == 1) swap_pal( img-> palette); if ( fi-> loadExtras) { @@ -596,6 +785,7 @@ pset_i( OS2, 1); pset_i( XHotSpot, l-> xHotspot); pset_i( YHotSpot, l-> yHotspot); + pset_i( BitDepth, l-> bpp); c = ( l-> ulCompression < 0 || l-> ulCompression > BCA_MAX) ? "Unknown" : bca_sets[ l-> ulCompression]; @@ -611,7 +801,7 @@ return true; /* read data */ - cLinesWorth = ((l->bpp * l->w + 31) / 32) * 4; + cLinesWorth = ((bpp * l->w + 31) / 32) * 4; if ( l-> windows ) { if ( req_seek( fd, (long) l-> offBits, SEEK_SET) < 0) @@ -620,8 +810,25 @@ switch ( (int) l-> ulCompression ) { case BCA_UNCOMP: - if ( !req_read_big(fi, l-> h, cLinesWorth, data)) - return false; + switch ( l-> bpp) { + case 1: + case 4: + case 8: + case 24: + if ( !req_read_big(fi, l-> h, cLinesWorth, data)) + return false; + break; + case 16: + if ( !read_16_32_bpp(fi, PImage(fi-> object), 16, cLinesWorth)) + return false; + break; + case 32: + if ( !read_16_32_bpp(fi, PImage(fi-> object), 32, cLinesWorth)) + return false; + break; + default: + outc("Unsupported bit depth"); + } break; case BCA_RLE8: { @@ -690,7 +897,8 @@ break; } } - destroy_ahead(ahead); + if ( destroy_ahead(ahead)) + return false; } break; @@ -782,7 +990,22 @@ } } - destroy_ahead(ahead); + if ( destroy_ahead(ahead)) + return false; + } + break; + case BCA_BITFIELDS: + switch ( l-> bpp) { + case 16: + if ( !read_16_32_bpp(fi, PImage(fi-> object), 16, cLinesWorth)) + return false; + break; + case 32: + if ( !read_16_32_bpp(fi, PImage(fi-> object), 32, cLinesWorth)) + return false; + break; + default: + outcd("Unsupported bit depth %d, expected 16 or 32", l-> bpp); } break; default: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/img/codec_jpeg.c new/Prima-1.29/img/codec_jpeg.c --- old/Prima-1.28/img/codec_jpeg.c 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/img/codec_jpeg.c 2011-01-12 20:07:32.000000000 +0100 @@ -23,10 +23,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: codec_jpeg.c,v 1.23 2008/10/24 08:15:04 dk Exp $ + * $Id: codec_jpeg.c,v 1.24 2010/06/15 17:30:39 dk Exp $ * */ +#define USE_NO_MINGW_SETJMP_TWO_ARGS #include "img.h" #include "img_conv.h" #include "Image.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/img/codec_png.c new/Prima-1.29/img/codec_png.c --- old/Prima-1.28/img/codec_png.c 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/img/codec_png.c 2011-01-12 20:07:32.000000000 +0100 @@ -24,8 +24,9 @@ * SUCH DAMAGE. */ /* Created by Dmitry Karasik <[email protected]> */ -/* $Id: codec_png.c,v 1.18 2008/04/28 09:58:27 dk Exp $ */ +/* $Id: codec_png.c,v 1.19 2010/06/15 17:30:39 dk Exp $ */ +#define USE_NO_MINGW_SETJMP_TWO_ARGS #ifdef HAVE_CONFIG_H #include <generic/config.h> #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/img/codec_tiff.c new/Prima-1.29/img/codec_tiff.c --- old/Prima-1.28/img/codec_tiff.c 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/img/codec_tiff.c 2011-01-12 20:07:32.000000000 +0100 @@ -26,13 +26,13 @@ * Created by Dmitry Karasik <[email protected]> with great help * of tiff2png.c by Willem van Schaik and Greg Roelofs * - * $Id: codec_tiff.c,v 1.14 2008/04/26 11:19:58 dk Exp $ + * $Id: codec_tiff.c,v 1.15 2011/01/09 23:24:41 dk Exp $ */ #include "img.h" #include "img_conv.h" #include "Icon.h" -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1500 #define HAVE_INT32 #endif #include <tiff.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/img/img.c new/Prima-1.29/img/img.c --- old/Prima-1.28/img/img.c 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/img/img.c 2011-01-12 20:07:32.000000000 +0100 @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: img.c,v 1.33 2008/10/25 07:44:48 dk Exp $ + * $Id: img.c,v 1.35 2009/10/23 17:22:28 dk Exp $ * */ /* Created by Dmitry Karasik <[email protected]> */ @@ -234,6 +234,7 @@ Bool loadExtras = false, noImageData = false; Bool incrementalLoad = false; Bool iconUnmask = false; + Bool noIncomplete = false; char * baseClassName = "Prima::Image"; ImgIORequest sioreq; int load_mask; @@ -314,6 +315,9 @@ if ( pexist( iconUnmask) && pget_B( iconUnmask)) fi. iconUnmask = iconUnmask = true; + if ( pexist( noIncomplete) && pget_B( noIncomplete)) + fi. noIncomplete = noIncomplete = true; + if ( pexist( eventMask)) fi. eventMask = pget_i( eventMask); @@ -471,9 +475,11 @@ out("Frame index out of range"); } - fi. loadExtras = loadExtras; - fi. noImageData = noImageData; - fi. iconUnmask = iconUnmask; + fi. loadExtras = loadExtras; + fi. noImageData = noImageData; + fi. iconUnmask = iconUnmask; + fi. noIncomplete = noIncomplete; + fi. wasTruncated = false; /* query profile */ if ( profiles && ( i <= profiles_len)) { @@ -499,7 +505,7 @@ fi. iconUnmask = pget_B( iconUnmask); } } - } + } fi. jointFrame = ( fi. frame == lastFrame + 1); fi. profile = profile; @@ -548,7 +554,10 @@ } err = true; goto EXIT_NOW; - } + } + + if ( fi. loadExtras && fi. wasTruncated) + (void) hv_store( fi. frameProperties, "truncated", 9, newSViv(1), 0); /* checking for grayscale */ { @@ -674,6 +683,7 @@ fi. loadExtras = true; fi. noImageData = true; fi. iconUnmask = false; + fi. noIncomplete = false; fi. extras = newHV(); fi. fileProperties = newHV(); fi. frameCount = -1; @@ -1162,7 +1172,7 @@ EXIT_NOW:; free( fi. frameMap); - if ( ioreq == NULL && fi. req-> handle != NULL) + if ( ioreq == NULL && fi. req != NULL && fi. req-> handle != NULL) fclose(( FILE*) fi. req-> handle); if ( err && fileName) unlink( fileName); @@ -1304,10 +1314,11 @@ (void) hv_store( hv, "loadAll", 7, newSViv(0), 0); (void) hv_store( hv, "wantFrames", 10, newSViv(0), 0); } - (void) hv_store( hv, "loadExtras", 10, newSViv(0), 0); - (void) hv_store( hv, "noImageData", 11, newSViv(0), 0); - (void) hv_store( hv, "iconUnmask", 10, newSViv(0), 0); - (void) hv_store( hv, "className", 9, newSVpv("Prima::Image", 0), 0); + (void) hv_store( hv, "loadExtras", 10, newSViv(0), 0); + (void) hv_store( hv, "noImageData", 11, newSViv(0), 0); + (void) hv_store( hv, "iconUnmask", 10, newSViv(0), 0); + (void) hv_store( hv, "noIncomplete", 12, newSViv(0), 0); + (void) hv_store( hv, "className", 9, newSVpv("Prima::Image", 0), 0); } else hv = newHV(); pset_sv_noinc( loadInput, newRV_noinc(( SV *) hv)); @@ -1318,7 +1329,8 @@ av_push( av, newSVpv( "frames", 0)); av_push( av, newSVpv( "height", 0)); av_push( av, newSVpv( "width", 0)); - av_push( av, newSVpv( "codecID", 0)); + av_push( av, newSVpv( "codecID", 0)); + av_push( av, newSVpv( "truncated", 0)); } if ( c-> IOFlags & ( IMG_SAVE_TO_FILE|IMG_SAVE_TO_STREAM)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/include/img.h new/Prima-1.29/include/img.h --- old/Prima-1.28/include/img.h 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/include/img.h 2011-01-12 20:07:32.000000000 +0100 @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: img.h,v 1.14 2008/10/25 07:44:48 dk Exp $ + * $Id: img.h,v 1.15 2009/10/23 17:22:28 dk Exp $ */ /* Created by Dmitry Karasik <[email protected]> */ @@ -71,12 +71,14 @@ int frameCount; /* total frames in the file; can return -1 if unknown */ HV * fileProperties; /* specific file data */ void * instance; /* user instance */ + Bool wasTruncated; /* if codec can recover from EOF */ /* user-specified data - applied to whole file */ Bool loadExtras; Bool loadAll; Bool noImageData; Bool iconUnmask; + Bool noIncomplete; HV * extras; /* profile applied to all frames */ /* user-specified data - applied to every frame */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/pod/Prima/Image.pod new/Prima-1.29/pod/Prima/Image.pod --- old/Prima-1.28/pod/Prima/Image.pod 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/pod/Prima/Image.pod 2011-01-12 20:07:32.000000000 +0100 @@ -1,4 +1,4 @@ -=for rcs $Id: Image.pod,v 1.23 2008/09/03 11:31:40 dk Exp $ +=for rcs $Id: Image.pod,v 1.24 2009/10/07 08:42:01 dk Exp $ =head1 NAME @@ -311,7 +311,7 @@ TYPE is one of C<ict::XXX> constants: ict::None - no dithering - ict::Halftone - 8x8 ordered halftone dithering + ict::Ordered - 8x8 ordered halftone dithering ict::ErrorDiffusion - error diffusion dithering with static palette ict::Optimized - error diffusion dithering with optimized palette @@ -324,7 +324,7 @@ [ 0 0 0 0 ] [ 0 0 0 0 ] - ict::Halftone: + ict::Ordered: [ 0 0 0 0 ] [ 0 0 1 0 ] [ 0 0 0 0 ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/pod/Prima/Menu.pod new/Prima-1.29/pod/Prima/Menu.pod --- old/Prima-1.28/pod/Prima/Menu.pod 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/pod/Prima/Menu.pod 2011-01-12 20:07:32.000000000 +0100 @@ -1,4 +1,4 @@ -=for rcs $Id: Menu.pod,v 1.8 2007/09/13 15:12:25 dk Exp $ +=for rcs $Id: Menu.pod,v 1.9 2010/09/26 15:18:47 dk Exp $ =head1 NAME @@ -155,13 +155,20 @@ =item Action -Every non-separator and non-submenu item is destined to -perform an action. The action can be set either as -an anonymous sub, or as string with name of a method -on the owner of a menu object. Both have their niche of -usage, and both are supplied with three parameters, when called - -the owner of a menu object, the menu object itself and -the name of a menu item, that triggered the action. +Every non-separator and non-submenu item is destined to perform an action. The +action can be set either as an anonymous sub, or as string with name of a +method on the owner of a menu object. Both have their niche of usage, and both +are supplied with two parameters, when called - the owner of a menu object, and +the name of a menu item, that triggered the action: + + Prima::MainWindow-> new( + menuItems => [ + ['item', 'Test', + sub { + my ( $window, $item) = @_; # contain MainWindow and 'item' + }], + ] + ); Action scalar in menu item is accessible via C<::action> property. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/pod/Prima/Object.pod new/Prima-1.29/pod/Prima/Object.pod --- old/Prima-1.28/pod/Prima/Object.pod 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/pod/Prima/Object.pod 2011-01-12 20:07:32.000000000 +0100 @@ -1,4 +1,4 @@ -=for rcs $Id: Object.pod,v 1.16 2007/09/13 15:12:25 dk Exp $ +=for rcs $Id: Object.pod,v 1.17 2009/09/22 13:48:25 dk Exp $ =head1 NAME @@ -788,6 +788,8 @@ ... $owner-> Obj-> destroy; +See also: C<find_component> + =item can_event Returns true if the object event circulation is allowed. In general, the same @@ -829,6 +831,14 @@ The method is static, and can be called either with or without class or object as a first parameter. +=item find_component NAME + +Performs a depth-first search on children tree hierarchy, matching the object +that has name equal to NAME. Returns its reference on success, undef +otherwise. + +See also: C<bring> + =item get_components Returns array of the child objects. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/pod/Prima/faq.pod new/Prima-1.29/pod/Prima/faq.pod --- old/Prima-1.28/pod/Prima/faq.pod 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/pod/Prima/faq.pod 2011-01-12 20:07:32.000000000 +0100 @@ -1,4 +1,4 @@ -=for rcs $Id: faq.pod,v 1.10 2005/10/08 19:19:50 dk Exp $ +=for rcs $Id: faq.pod,v 1.11 2010/03/17 14:47:00 dk Exp $ =head1 NAME @@ -169,6 +169,16 @@ prigraph.dll ( and/or priz.dll on os2 ) are not found. If this is the case, try to copy these files into your PATH, for example in C:/WINNT . +=head2 Prima doesn't get installed using ppm (ActiveState) + +Prima uses a non-conventional build process, which is not picked up by +automated ActiveState ppm builder. So if you run "ppm install Prima" and +it succeeds but installs nothing, try this: + + ppm install --force http://cpan.uwinnipeg.ca/PPMPackages/10xx/Prima.ppd + +(Justin Allegakoen and Randy Kobes:thanks!) + =head2 Prima error: Can't open display This error happens when you've compiled Prima for X11, and no connection to X11 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/pod/Prima/gp-problems.pod new/Prima-1.29/pod/Prima/gp-problems.pod --- old/Prima-1.28/pod/Prima/gp-problems.pod 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/pod/Prima/gp-problems.pod 2011-01-12 20:07:32.000000000 +0100 @@ -1,4 +1,4 @@ -=for rcs $Id: gp-problems.pod,v 1.8 2007/09/13 15:12:25 dk Exp $ +=for rcs $Id: gp-problems.pod,v 1.9 2011/01/06 09:56:46 dk Exp $ =head1 NAME @@ -199,6 +199,12 @@ Dithering might be not used for line plotting. (Win9X) +=item Arcs and circles + +Drawing is dependent in X11 on an X servers - different X servers do different plotting +strategies on small (less than 3 pixels) diameters. Current version is adapted best to the +latest (2010) Xorg capabilities. See discussion on CPAN bug https://rt.cpan.org/Ticket/Display.html?id=62972 . + =back =head2 Fonts diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/pod/Prima/image-load.pod new/Prima-1.29/pod/Prima/image-load.pod --- old/Prima-1.28/pod/Prima/image-load.pod 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/pod/Prima/image-load.pod 2011-01-12 20:07:32.000000000 +0100 @@ -1,4 +1,4 @@ -=for rcs $Id: image-load.pod,v 1.15 2008/10/25 07:44:48 dk Exp $ +=for rcs $Id: image-load.pod,v 1.16 2009/10/23 17:22:28 dk Exp $ =head1 NAME @@ -124,8 +124,8 @@ The parameters that are accepted by load, are divided into several categories - first, those that apply to all loading process and those who apply only to a particular frame. Those who are defined by Prima, are -enumerated above - loadExtras, loadAll etc. Only loadExtras, noImageData -and iconUnmask are applicable to +enumerated above - loadExtras, loadAll etc. Only loadExtras, noImageData, +noIncomplete and iconUnmask are applicable to a frame, other govern the loading process. A codec may as well define its own parameters, however it is not possible to tell what parameter belongs to what group - this information is to be found in codec documentation; @@ -260,6 +260,16 @@ The latter technique is used by C<Prima::ImageViewer> when it is setup to monitor image loading progress. See L<Prima::ImageViewer/watch_load_progress> for details. +=head2 Truncated files + +By default, codecs are not specified whether they would fail on premature end +of file or omit the error and return truncated image. C<noIncomplete> boolean +flag tells that a codec must always fail if the image cannot be red in full. It +is off by default. If indeed the codec detected that the file was incomplete, +it sets C<truncated> boolean flag in the C<extras> profile, if C<loadExtras> +was requested. + + =head1 Saving =head2 Simple saving diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/unix/apc_event.c new/Prima-1.29/unix/apc_event.c --- old/Prima-1.28/unix/apc_event.c 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/unix/apc_event.c 2011-01-12 20:07:32.000000000 +0100 @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: apc_event.c,v 1.100 2008/04/28 09:58:27 dk Exp $ + * $Id: apc_event.c,v 1.101 2010/12/08 10:25:31 dk Exp $ */ /***********************************************************/ @@ -338,6 +338,13 @@ 0x20a8, 0x20a9, 0x20aa, 0x20ab, 0x20ac /* 0x20a8-0x20af */ }; +static unsigned short const keysym_to_unicode_ff00_ff1f[] = { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0xff00-0xff07 */ + 0x0008, 0x0009, 0x000a, 0x0000, 0x0000, 0x000d, 0x0000, 0x0000, /* 0xff08-0xff0f */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0xff10-0xff17 */ + 0x0000, 0x0000, 0x0000, 0x001b, 0x0000, 0x0000, 0x0000, 0x0000 /* 0xff18-0xff1f */ +}; + static unsigned short const keysym_to_unicode_ff80_ffbd[] = { 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0xff80-0xff87 */ 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x000D, 0x0000, 0x0000, /* 0xff88-0xff8f */ @@ -399,6 +406,8 @@ else if (keysym > 0x209f && keysym < 0x20ad) return keysym_to_unicode_20a0_20ac[keysym - 0x20a0]; /* added by dk */ + else if (keysym > 0xfeff && keysym < 0xff20) + return keysym_to_unicode_ff00_ff1f[keysym - 0xff00]; else if (keysym > 0xff80 && keysym < 0xffbe) return keysym_to_unicode_ff80_ffbd[keysym - 0xff80]; else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Prima-1.28/unix/apc_graphics.c new/Prima-1.29/unix/apc_graphics.c --- old/Prima-1.28/unix/apc_graphics.c 2009-02-24 14:03:45.000000000 +0100 +++ new/Prima-1.29/unix/apc_graphics.c 2011-01-12 20:07:32.000000000 +0100 @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: apc_graphics.c,v 1.123 2008/04/24 15:15:10 dk Exp $ + * $Id: apc_graphics.c,v 1.124 2010/12/07 12:54:21 dk Exp $ */ /***********************************************************/ @@ -746,6 +746,9 @@ { DEFXX; + if ( dX == 1 || dY == 1 ) /* Xorg bug */ + return apc_gp_rectangle( self, x - dX / 2, y - dY / 2, x + dX / 2, y + dY / 2); + if ( PObject( self)-> options. optInDrawInfo) return false; if ( !XF_IN_PAINT(XX)) return false; if ( dX <= 0 || dY <= 0) return false; @@ -804,6 +807,9 @@ DEFXX; int mix = 0; + if ( dX == 1 || dY == 1 ) /* Xorg bug */ + return apc_gp_bar( self, x - dX / 2, y - dY / 2, x + dX / 2, y + dY / 2); + if ( PObject( self)-> options. optInDrawInfo) return false; if ( !XF_IN_PAINT(XX)) return false; if ( dX <= 0 || dY <= 0) return false; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
