diff -uiwr Win32-Clipboard-0.52\Clipboard.pm Win32-Clipboard-0.53-saved\Clipboard.pm --- Win32-Clipboard-0.52\Clipboard.pm Fri Sep 10 16:05:35 2004 +++ Win32-Clipboard-0.53-saved\Clipboard.pm Fri Oct 14 07:01:43 2005 @@ -3,10 +3,11 @@ # # Win32::Clipboard - Interaction with the Windows clipboard # -# Version: 0.52 +# Version: 0.53 # Author: Aldo Calpini # # Modified by: Hideyo Imazu +# BrowserUk@perlmonks 14 October 2005 Added SetFiles # ####################################################################### @@ -65,7 +66,7 @@ ####################################################################### # STATIC OBJECT PROPERTIES # -$VERSION = "0.52"; +$VERSION = "0.53"; ####################################################################### # FUNCTIONS diff -uiwr Win32-Clipboard-0.52\Clipboard.xs Win32-Clipboard-0.53-saved\Clipboard.xs --- Win32-Clipboard-0.52\Clipboard.xs Sat Jul 24 09:47:05 2004 +++ Win32-Clipboard-0.53-saved\Clipboard.xs Fri Oct 14 07:00:04 2005 @@ -3,12 +3,13 @@ # # Win32::Clipboard - Interaction with the Windows clipboard # -# Version: 0.52 +# Version: 0.53 # Created: 19 Nov 96 # Author: Aldo Calpini # # Modified: 24 Jul 2004 # By: Hideyo Imazu +# BrowserUk@perlmonks 14 October 2005 Added SetFiles # ####################################################################### */ @@ -630,6 +631,69 @@ } void +SetFiles(...) +PPCODE: + HANDLE myhandle; + HGLOBAL hGlobal; + LPTSTR szString; + SV* sv; + int leng = 16; // DROPFILES header + int index; + if(!items) { + XSRETURN_UNDEF; + } + for( index=1; index < items; index++ ) { + sv = ST(index); + leng += SvCUR( sv ); + } + leng += index * 2 +10; + if ( hGlobal = GlobalAlloc(GMEM_DDESHARE, (leng)*sizeof(char)) ) { + char* sz = szString = (char *) GlobalLock(hGlobal); + memset( szString, 0, leng );; + + *((INT*)szString) = 20l; // offset to start of list + szString += 20l; + + for( index=1; index META.yml $(NOECHO) $(ECHO) "#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#" >> META.yml $(NOECHO) $(ECHO) "name: Win32-Clipboard" >> META.yml - $(NOECHO) $(ECHO) "version: 0.52" >> META.yml + $(NOECHO) $(ECHO) "version: 0.53" >> META.yml $(NOECHO) $(ECHO) "version_from: Clipboard.pm" >> META.yml $(NOECHO) $(ECHO) "installdirs: site" >> META.yml $(NOECHO) $(ECHO) "requires:" >> META.yml @@ -824,7 +818,7 @@ # --- MakeMaker ppd section: # Creates a PPD (Perl Package Description) for a binary distribution. ppd: - $(NOECHO) $(ECHO) "" > $(DISTNAME).ppd + $(NOECHO) $(ECHO) "" > $(DISTNAME).ppd $(NOECHO) $(ECHO) " $(DISTNAME)" >> $(DISTNAME).ppd $(NOECHO) $(ECHO) " Interaction with the Windows clipboard" >> $(DISTNAME).ppd $(NOECHO) $(ECHO) " Aldo Calpini <dada@perl.it>" >> $(DISTNAME).ppd diff -uiwr Win32-Clipboard-0.52\META.yml Win32-Clipboard-0.53-saved\META.yml --- Win32-Clipboard-0.52\META.yml Fri Sep 10 16:08:05 2004 +++ Win32-Clipboard-0.53-saved\META.yml Thu Oct 13 19:32:49 2005 @@ -1,7 +1,7 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Win32-Clipboard -version: 0.52 +version: 0.53 version_from: Clipboard.pm installdirs: site requires: diff -uiwr Win32-Clipboard-0.52\t\test.t Win32-Clipboard-0.53-saved\t\test.t --- Win32-Clipboard-0.52\t\test.t Sat Mar 11 15:51:26 2000 +++ Win32-Clipboard-0.53-saved\t\test.t Fri Oct 14 04:45:34 2005 @@ -3,11 +3,11 @@ # `make test'. After `make install' it should work as `perl test.pl' use strict; -use vars qw( $loaded $clip $actual ); +use vars qw( $loaded $clip $actual @actual ); ######################### We start with some black magic to print on failure. -BEGIN { $| = 1; print "1..9\n"; } +BEGIN { $| = 1; print "1..10\n"; } END {print "not ok 1\n" unless $loaded;} use Win32::Clipboard; $loaded = 1; @@ -31,22 +31,27 @@ print "not " unless $clip->Get() eq ""; print "ok 5\n"; +$clip->SetFiles( qw[ 1.dat 2.dat 3.dat 4.dat 5.dat ] ); +@actual = $clip->GetFiles(); +print "not " unless "@actual" eq "1.dat 2.dat 3.dat 4.dat 5.dat"; +print "ok 6\n"; + undef $clip; tie $clip, 'Win32::Clipboard'; print "not" unless tied($clip) and ref(tied($clip)) =~ /Win32::Clipboard/; -print "ok 6\n"; +print "ok 7\n"; $clip = "Win32::Clipboard test"; $actual = $clip; print "not " unless $actual eq "Win32::Clipboard test"; -print "ok 7\n"; +print "ok 8\n"; tied($clip)->Empty(); print "not " unless $clip eq ""; -print "ok 8\n"; +print "ok 9\n"; $clip = "Win32::Clipboard test"; print "not " unless tied($clip)->IsText(); -print "ok 9\n"; \ No newline at end of file +print "ok 10\n";