You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(31) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
|
Mar
(17) |
Apr
(17) |
May
(27) |
Jun
(67) |
Jul
(26) |
Aug
(15) |
Sep
(2) |
Oct
(24) |
Nov
(6) |
Dec
|
2007 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(28) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
(21) |
Feb
(45) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(3) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
(3) |
13
(1) |
14
(3) |
15
|
16
|
17
|
18
|
19
|
20
(1) |
21
|
22
|
23
|
24
|
25
(9) |
26
|
27
|
28
|
29
|
30
|
|
|
|
|
|
|
From: Robert M. <rob...@us...> - 2006-04-25 21:39:57
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3589 Added Files: 99_pod_coverage.t Log Message: Add Win32::GUI TODO test for POD Coverage --- NEW FILE: 99_pod_coverage.t --- #!perl -wT # Win32::GUI::DropFiles test suite. # $Id: 99_pod_coverage.t,v 1.1 2006/04/25 21:39:53 robertemay Exp $ # Check the POD covers all method calls use strict; use warnings; use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; plan tests => 1; TODO: { local $TODO = "Tests for Win32::GUI POD coverage not yet written"; fail("Win32::GUI POD Coverage tests"); } # all_pod_coverage_ok is not even close to what we need! # all_pod_coverage_ok(); |
From: Robert M. <rob...@us...> - 2006-04-25 21:38:28
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2364/Win32-GUI-DropFiles/demos Added Files: DropFilesDemo.pl Log Message: Add Win32::GUI::DropFiles --- NEW FILE: DropFilesDemo.pl --- #!perl -w use strict; use warnings; # $Id: DropFilesDemo.pl,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Demonstration of Win32::GUI::DropFiles functionality # # Note that even though Win32::GUI::DropFiles supports # Unicode filenames on WinNT and above, Win32::GUI::Listbox # does not, so filenames with unicode characters will appear # corrupted in this demo. use Win32::GUI(); use Win32::GUI::DropFiles(); my $mw = Win32::GUI::Window->new( -title => "Win32::GUI::DropFiles Demonstration", -pos => [100,100], -size => [400,300], -onResize => \&mwResize, ); $mw->AddLabel( -pos => [10,10], -text => "Drag files onto the Listbox below:", ); $mw->AddListbox( -name => 'LB', -pos => [10,30], -vscroll => 1, -acceptfiles => 1, -onDropFiles => \&gotDrop, ); $mw->Show(); Win32::GUI::Dialog(); $mw->Hide(); exit(0); sub gotDrop { my ($self, $dropObj) = @_; $self->Add($dropObj->GetDroppedFiles()); return 0; } sub mwResize { my $self = shift; $self->LB->Resize( $self->ScaleWidth()-20, $self->ScaleHeight()-40, ); return 1; } |
From: Robert M. <rob...@us...> - 2006-04-25 21:38:27
|
Update of /cvsroot/perl-win32-gui/Win32-GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2364 Modified Files: CHANGELOG MANIFEST Log Message: Add Win32::GUI::DropFiles Index: CHANGELOG =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** CHANGELOG 25 Apr 2006 21:24:51 -0000 1.80 --- CHANGELOG 25 Apr 2006 21:38:18 -0000 1.81 *************** *** 6,9 **** --- 6,13 ---- Win32-GUI ChangeLog =================== + + [Robert May] : 25 Apr 2006 - Add Win32::GUI::DropFiles + - add Win32-GUI-DropFiles directory and new files + - update MANIFEST + + [Robert May] : 25 Apr 2006 - Fix build under cygwin/MSVC7 - RichEdit.xs fix precedence warning under VC7 Index: MANIFEST =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/MANIFEST,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MANIFEST 16 Mar 2006 21:11:12 -0000 1.14 --- MANIFEST 25 Apr 2006 21:38:18 -0000 1.15 *************** *** 131,134 **** --- 131,135 ---- t/50_Richedit_GetCharFormat.t t/98_Pod.t + t/99_pod_coverage.t TabStrip.xs Textfield.xs *************** *** 141,143 **** --- 142,166 ---- UpDown.xs vsplit.cur + Win32-GUI-DropFiles/demos/DropFilesDemo.pl + Win32-GUI-DropFiles/DropFiles.pm + Win32-GUI-DropFiles/DropFiles.xs + Win32-GUI-DropFiles/DropFilesRC.PL + Win32-GUI-DropFiles/Makefile.PL + Win32-GUI-DropFiles/ppport.h + Win32-GUI-DropFiles/README + Win32-GUI-DropFiles/t/01_load.t + Win32-GUI-DropFiles/t/02_old_callback.t + Win32-GUI-DropFiles/t/03_new_callback.t + Win32-GUI-DropFiles/t/04_GetDroppedFiles.t + Win32-GUI-DropFiles/t/05_GetDroppedFile.t + Win32-GUI-DropFiles/t/06_GetDropPos.t + Win32-GUI-DropFiles/t/07_DragQueryFile.t + Win32-GUI-DropFiles/t/08_DragQueryPoint.t + Win32-GUI-DropFiles/t/09_DragFinish.t + Win32-GUI-DropFiles/t/10_Unicode.t + Win32-GUI-DropFiles/t/11_invalid_handles.t + Win32-GUI-DropFiles/t/98_pod.t + Win32-GUI-DropFiles/t/99_pod_coverage.t + Win32-GUI-DropFiles/t/DropTest.pm + Win32-GUI-DropFiles/TYPEMAP Window.xs |
From: Robert M. <rob...@us...> - 2006-04-25 21:38:27
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2364/Win32-GUI-DropFiles/t Added Files: 01_load.t 02_old_callback.t 03_new_callback.t 04_GetDroppedFiles.t 05_GetDroppedFile.t 06_GetDropPos.t 07_DragQueryFile.t 08_DragQueryPoint.t 09_DragFinish.t 10_Unicode.t 11_invalid_handles.t 98_pod.t 99_pod_coverage.t DropTest.pm Log Message: Add Win32::GUI::DropFiles --- NEW FILE: 99_pod_coverage.t --- #!perl -wT # Win32::GUI::DropFiles test suite. # $Id: 99_pod_coverage.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # Check the POD covers all method calls use strict; use warnings; use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; plan skip_all => "Pod Coverage tests for Win32::GUI::DropFiles done by core" if $ENV{W32G_CORE}; all_pod_coverage_ok(); --- NEW FILE: 10_Unicode.t --- #!perl -w # Win32::GUI::DropFiles test suite # $Id: 10_Unicode.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Test Win32::GUI::DropFiles Unicode support use strict; use warnings; BEGIN { $| = 1 } # Autoflush # We assume that 01_load.t has been run, so we know we have Test::More # and that Win32::GUI and Win32::GUI::DropFiles will load. use Test::More; BEGIN { #No unicode support before WinNT plan skip_all => "No Unicode filename support in Win95/98/ME" if Win32::GetOSVersion() < 2; eval "use Win32::API 0.41"; plan skip_all => "Win32::API 0.41 required for testing Uniocde Support" if $@; eval "use Unicode::String"; plan skip_all => "Unicode::String required for testing Unicode Support" if $@; } # Load our helpers use FindBin; use lib "$FindBin::Bin"; use DropTest; use Win32::GUI 1.03_02; use Win32::GUI::DropFiles; my @tests = ( # Ascii chars only [ "AB", "C", "Longer Name with spaces", ], # Simley face [ "\x{263A}", ], # Hello World - multi-lingual [ "Hello world", "\x{039A}\x{03B1}\x{03BB}\x{3B7}\x{03BC}\x{1F73}\x{03C1}\x{03B1}", "\x{03B1}\x{1F79}\x{03C3}\x{03BC}\x{03B5}, \x{30B3}\x{30F3}\x{30CB}\x{30C1}\x{30CF}", ], # Thai [ "\x{0E4F} \x{0E41}\x{0E1C}\x{0E48}\x{0E19}\x{0E14}\x{0E34}\x{0E19}\x{0E2E}\x{0E31}\x{0E48}\x{0E19}\x{0E40}\x{0E2A}\x{0E37}\x{0E48}\x{0E2D}\x{0E21}\x{0E42}\x{0E17}\x{0E23}\x{0E21}\x{0E41}\x{0E2A}\x{0E19}\x{0E2A}\x{0E31}\x{0E07}\x{0E40}\x{0E27}\x{0E0A}", "\x{0E1E}\x{0E23}\x{0E30}\x{0E1B}\x{0E01}\x{0E40}\x{0E01}\x{0E28}\x{0E01}\x{0E2D}\x{0E07}\x{0E1A}\x{0E39}\x{0E4A}\x{0E01}\x{0E39}\x{0E49}\x{0E02}\x{0E36}\x{0E49}\x{0E19}\x{0E43}\x{0E2B}\x{0E21}\x{0E48}", ], ); plan tests => 1 * scalar @tests; my $W = Win32::GUI::Window->new( -name => 'win', -title => "Win32::GUI DropFiles Test", -size => [400,300], -onDropFiles => \&drop, ); Win32::GUI::DoEvents(); my $files; while($files = shift @tests) { my $dt = DropTest->new(files => $files, wide => 1); $dt->PostDropMessage($W); Win32::GUI::Dialog(); } exit(0); sub drop { my ($self, $dropobj) = @_; my @f = $dropobj->GetDroppedFiles(); ok(eq_set($files,\@f), "Correct set of files found"); return -1; } --- NEW FILE: 98_pod.t --- #!perl -wT # Win32::GUI::DropFiles test suite. # $Id: 98_pod.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # Check that our pod documentation has valid syntax use strict; use warnings; BEGIN { $| = 1 } # Autoflush use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; plan skip_all => "Pod tests for Win32::GUI::DropFiles done by core" if $ENV{W32G_CORE}; all_pod_files_ok(); --- NEW FILE: 03_new_callback.t --- #!perl -w # Win32::GUI::DropFiles test suite # $Id: 03_new_callback.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Test Win32::GUI DropFiles callback after loading Win32::GUI::DropFiles # - check pre-requsites # - check both OEM and NEM callbacks # - check callback parameter types # - check that DragFinish is called use strict; use warnings; BEGIN { $| = 1 } # Autoflush # We assume that 01_load.t has been run, so we know we have Test::More # and that Win32::GUI and Win32::GUI::DropFiles will load. use Test::More; BEGIN { eval "use Win32::API 0.41"; plan skip_all => "Win32::API 0.41 required for testing New Callback API" if $@; } plan tests => 7; # Load our helpers use FindBin; use lib "$FindBin::Bin"; use DropTest; use Win32::GUI 1.03_02; use Win32::GUI::DropFiles; my $dropobj = DropTest->new(); my $W = Win32::GUI::Window->new( -name => 'win', -title => "Win32::GUI DropFiles Test", -size => [400,300], -onDropFiles => \&drop, -eventmodel => "byname", ); Win32::GUI::DoEvents(); # Do the OEM tests $dropobj->PostDropMessage($W); Win32::GUI::Dialog(); # Check that the receiver freed the handle ok($dropobj->Free(), "OEM frees the drop object"); # Now do the NEM tests: $W->Change(-eventmodel => "byref"); $dropobj->PostDropMessage($W); Win32::GUI::Dialog(); ok($dropobj->Free(), "NEM frees the drop object"); exit(0); sub win_DropFiles { my ($dropobj) = shift; ok(defined $dropobj, "OEM callback, dropobj defined"); isa_ok($dropobj, "Win32::GUI::DropFiles", "OEM dropobj is a Win32::GUI::DropFiles object"); return -1; } sub drop { my ($self, $dropobj) = @_; is($self, $W, "NEM callback gets window object"); ok(defined $dropobj, "NEM callback, dropobj defined"); isa_ok($dropobj, "Win32::GUI::DropFiles","NEM dropobj is a Win32::GUI::DropFiles object"); return -1; } --- NEW FILE: 07_DragQueryFile.t --- #!perl -w # Win32::GUI::DropFiles test suite # $Id: 07_DragQueryFile.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Test Win32::GUI::DropFiles DragQueryFile() function use strict; use warnings; BEGIN { $| = 1 } # Autoflush # We assume that 01_load.t has been run, so we know we have Test::More # and that Win32::GUI and Win32::GUI::DropFiles will load. use Test::More; BEGIN { eval "use Win32::API 0.41"; plan skip_all => "Win32::API 0.41 required for testing DragQueryFile()" if $@; } plan tests => 33; # Load our helpers use FindBin; use lib "$FindBin::Bin"; use DropTest; use Win32::GUI 1.03_02; use Win32::GUI::DropFiles; # Some Useful constants: sub EINVAL() {22} sub ERROR_INVALID_INDEX() {1413} # Cygwin doesn't provide Win32 extended errors, so $^E == $! my $EXPECTED_E = (lc $^O eq "cygwin") ? EINVAL : ERROR_INVALID_INDEX; my @files = ( "A", "B", "Longer Name with spaces" ); my $dropobj = DropTest->new( files => \@files, ); my $W = Win32::GUI::Window->new( -name => 'win', -title => "Win32::GUI DropFiles Test", -size => [400,300], -onDropFiles => \&drop, ); Win32::GUI::DoEvents(); $dropobj->PostDropMessage($W); Win32::GUI::Dialog(); exit(0); sub drop { my ($self, $dropobj) = @_; # DragQueryFile with no params returns the number of files is(Win32::GUI::DropFiles::DragQueryFile($dropobj), scalar @files, "Correct number of files when passed object"); is(Win32::GUI::DropFiles::DragQueryFile($dropobj->{-handle}), scalar @files, "Correct number of files when passed handle"); is($dropobj->DragQueryFile(), scalar @files, "Correct number of files when called as method"); # DragQueryFile with one param returns file name my $count = $dropobj->GetDroppedFiles(); { my @f; for (0..$count-1) { push @f, Win32::GUI::DropFiles::DragQueryFile($dropobj, $_); } ok(eq_set(\@files,\@f), "Correct set of files found when passed object"); # Test out of range indices for my $index (-1, $count, 1000) { my($r, $e); $!=$^E=0; $r = Win32::GUI::DropFiles::DragQueryFile($dropobj,$index); $e = $^E; # record value of $^E immediately is($r, undef , "Out of range index ($index) returns undef when passed object"); SKIP: { skip "Can't test error values if no error", 2 if defined $r; cmp_ok($!, '==', EINVAL, "errno set to EINVAL"); cmp_ok($^E, '==', $EXPECTED_E, "GetLastError returns ERROR_INVALID_INDEX"); } } } { my @f; for (0..$count-1) { push @f, Win32::GUI::DropFiles::DragQueryFile($dropobj->{-handle}, $_); } ok(eq_set(\@files,\@f), "Correct set of files found when passed handle"); # Test out of range indices for my $index (-1, $count, 1000) { my($r, $e); $!=$^E=0; $r = Win32::GUI::DropFiles::DragQueryFile($dropobj->{-handle},$index); $e = $^E; # record value of $^E immediately is($r, undef , "Out of range index ($index) returns undef when passed handle"); SKIP: { skip "Can't test error values if no error", 2 if defined $r; cmp_ok($!, '==', EINVAL, "errno set to EINVAL"); cmp_ok($^E, '==', $EXPECTED_E, "GetLastError returns ERROR_INVALID_INDEX"); } } } { my @f; for (0..$count-1) { push @f, $dropobj->DragQueryFile($_); } ok(eq_set(\@files,\@f), "Correct set of files found when called as method"); # Test out of range indices for my $index (-1, $count, 1000) { my($r, $e); $!=$^E=0; $r = $dropobj->DragQueryFile($index); $e = $^E; # record value of $^E immediately is($r, undef , "Out of range index ($index) returns undef when called as method"); SKIP: { skip "Can't test error values if no error", 2 if defined $r; cmp_ok($!, '==', EINVAL, "errno set to EINVAL"); cmp_ok($^E, '==', $EXPECTED_E, "GetLastError returns ERROR_INVALID_INDEX"); } } } return -1; } --- NEW FILE: 08_DragQueryPoint.t --- #!perl -w # Win32::GUI::DropFiles test suite # $Id: 08_DragQueryPoint.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Test Win32::GUI::DropFiles DragQueryPoint() function use strict; use warnings; BEGIN { $| = 1 } # Autoflush # We assume that 01_load.t has been run, so we know we have Test::More # and that Win32::GUI and Win32::GUI::DropFiles will load. use Test::More; BEGIN { eval "use Win32::API 0.41"; plan skip_all => "Win32::API 0.41 required for testing DragQueryPoint()" if $@; } # Load our helpers use FindBin; use lib "$FindBin::Bin"; use DropTest; use Win32::GUI 1.03_02; use Win32::GUI::DropFiles; my @testdata = ( { x => 100, y => 120, c => 1 }, { x => 1, y => -1, c => 0 }, ); my $numtests = scalar @testdata; plan tests => 9 * $numtests; my $W = Win32::GUI::Window->new( -name => 'win', -title => "Win32::GUI DropFiles Test", -size => [400,300], -onDropFiles => \&drop, ); Win32::GUI::DoEvents(); my $testnum; for (0..$numtests-1) { $testnum = $_; my $dropobj = DropTest->new( x => $testdata[$testnum]->{x}, y => $testdata[$testnum]->{y}, client => $testdata[$testnum]->{c}, ); $dropobj->PostDropMessage($W); Win32::GUI::Dialog(); } exit(0); sub drop { my ($self, $dropobj) = @_; # DragQueryPoint returns a list of x, y, client info { my ($x, $y, $c) = Win32::GUI::DropFiles::DragQueryPoint($dropobj); is($x, $testdata[$testnum]->{x}, "X-pos reported correctly when passed object"); is($y, $testdata[$testnum]->{y}, "Y-pos reported correctly when passed object"); is($c, $testdata[$testnum]->{c}, "client pos reported correctly when passed object"); } { my ($x, $y, $c) = Win32::GUI::DropFiles::DragQueryPoint($dropobj->{-handle}); is($x, $testdata[$testnum]->{x}, "X-pos reported correctly when passed handle"); is($y, $testdata[$testnum]->{y}, "Y-pos reported correctly when passed handle"); is($c, $testdata[$testnum]->{c}, "client pos reported correctly when passed handle"); } { my ($x, $y, $c) = $dropobj->DragQueryPoint(); is($x, $testdata[$testnum]->{x}, "X-pos reported correctly when called as method"); is($y, $testdata[$testnum]->{y}, "Y-pos reported correctly when called as method"); is($c, $testdata[$testnum]->{c}, "client pos reported correctly when called as method"); } return -1; } --- NEW FILE: 01_load.t --- #!perl -wT # Win32::GUI::DropFiles test suite # $Id: 01_load.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # - check pre-requsites # - check module loads # - check module has a version # - check we didn't import lots of constants from Win32::GUI use strict; use warnings; BEGIN { $| = 1 } # Autoflush # Pre-requisites: Bail out if we havent got Test::More eval "use Test::More"; if($@) { # As we haven't got Test::More, can't use diag() print "#\n# Test::More required to perform any Win32::GUI::DragDrop test\n"; chomp $@; $@ =~ s/^/# /gm; print "$@\n"; print "Bail Out! Test::More not available\n"; exit(1); } plan( tests => 4 ); # Pre-requisites: Check that we're on windows or cygwin # bail out if we're not if ( not ($^O =~ /MSwin32|cygwin/i)) { diag("\nWin32::GUI can only run on MSWin32 or cygwin, not '$^O'"); print "Bail out! Incompatible Operating System\n"; } pass("Correct OS: $^O"); # Check that Win32::GUI::DropFiles loads, and bail out of all # tests if it doesn't use_ok('Win32::GUI::DropFiles') or print STDOUT "Bail out! Can't load Win32::GUI::DropFiles"; # Check that Win32::GUI::DropFiles has a version ok(defined $Win32::GUI::DropFiles::VERSION, "Win32::GUI::DropFiles version check"); # Check that we didn't accidently import lots of constants from Win32::GUI ok(!defined &Win32::GUI::DropFiles::ES_WANTRETURN, "No Win32::GUI constants"); --- NEW FILE: 05_GetDroppedFile.t --- #!perl -w # Win32::GUI::DropFiles test suite # $Id: 05_GetDroppedFile.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Test Win32::GUI::DropFiles GetDroppedFile() method use strict; use warnings; BEGIN { $| = 1 } # Autoflush # We assume that 01_load.t has been run, so we know we have Test::More # and that Win32::GUI and Win32::GUI::DropFiles will load. use Test::More; BEGIN { eval "use Win32::API 0.41"; plan skip_all => "Win32::API 0.41 required for testing GetDroppedFile()" if $@; } plan tests => 10; # Load our helpers use FindBin; use lib "$FindBin::Bin"; use DropTest; use Win32::GUI 1.03_02; use Win32::GUI::DropFiles; # Some Useful constants: sub EINVAL() {22} sub ERROR_INVALID_INDEX() {1413} # Cygwin doesn't provide Win32 extended errors, so $^E == $! my $EXPECTED_E = (lc $^O eq "cygwin") ? EINVAL : ERROR_INVALID_INDEX; my @files = ( "A", "B", "Longer Name with spaces" ); my $dropobj = DropTest->new( files => \@files, ); my $W = Win32::GUI::Window->new( -name => 'win', -title => "Win32::GUI DropFiles Test", -size => [400,300], -onDropFiles => \&drop, ); Win32::GUI::DoEvents(); $dropobj->PostDropMessage($W); Win32::GUI::Dialog(); exit(0); sub drop { my ($self, $dropobj) = @_; # GetDroppedFiles in scalar context returns number of files my $count = $dropobj->GetDroppedFiles(); my @f; for (0..$count-1) { push @f, $dropobj->GetDroppedFile($_); } ok(eq_set(\@files,\@f), "Correct set of files found"); # Test out of range indices for my $index (-1, $count, 1000) { my($r, $e); $!=$^E=0; $r = $dropobj->GetDroppedFile($index); $e = $^E; # record value of $^E immediately is($r, undef , "Out of range index ($index) returns undef"); SKIP: { skip "Can't test error values if no error", 2 if defined $r; cmp_ok($!, '==', EINVAL, "errno set to EINVAL"); cmp_ok($^E, '==', $EXPECTED_E, "GetLastError returns ERROR_INVALID_INDEX"); } } return -1; } --- NEW FILE: 04_GetDroppedFiles.t --- #!perl -w # Win32::GUI::DropFiles test suite # $Id: 04_GetDroppedFiles.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Test Win32::GUI::DropFiles GetDroppedFiles() method use strict; use warnings; BEGIN { $| = 1 } # Autoflush # We assume that 01_load.t has been run, so we know we have Test::More # and that Win32::GUI and Win32::GUI::DropFiles will load. use Test::More; BEGIN { eval "use Win32::API 0.41"; plan skip_all => "Win32::API 0.41 required for testing GetDroppedFiles()" if $@; } # Load our helpers use FindBin; use lib "$FindBin::Bin"; use DropTest; use Win32::GUI 1.03_02; use Win32::GUI::DropFiles; my @tests = ( [ "A", "B", "Longer Name with spaces" ], [], # no files should never happen, but just in case ... ); plan tests => 2 * scalar @tests; my $W = Win32::GUI::Window->new( -name => 'win', -title => "Win32::GUI DropFiles Test", -size => [400,300], -onDropFiles => \&drop, ); Win32::GUI::DoEvents(); my $files; while($files = shift @tests) { my $dt = DropTest->new(files => $files); $dt->PostDropMessage($W); Win32::GUI::Dialog(); } exit(0); sub drop { my ($self, $dropobj) = @_; # GetDroppedFiles in scalar context returns number of files is(scalar $dropobj->GetDroppedFiles(), scalar @{$files}, "Correct number of files"); # GetDroppedFiles in list context returns the list of files my @f = $dropobj->GetDroppedFiles(); ok(eq_set($files,\@f), "Correct set of files found"); return -1; } --- NEW FILE: 11_invalid_handles.t --- #!perl -w # Win32::GUI::DropFiles test suite # $Id: 11_invalid_handles.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Test Win32::GUI::DropFiles win32 API doesn't barf with invalid handles use strict; use warnings; BEGIN { $| = 1 } # Autoflush # We assume that 01_load.t has been run, so we know we have Test::More # and that Win32::GUI::DropFiles will load. use Test::More; use Win32::GUI::DropFiles; my @handles = (0, int(rand(2**32)),); plan tests => 6 * scalar @handles; # Useful Constants: sub EINVAL() {22} sub ERROR_INVALID_HANDLE() {6} # On cygwin, $^E == $! (no OS extended errors) my $EXPECTED_E = ERROR_INVALID_HANDLE; if(lc $^O eq "cygwin") { $EXPECTED_E = EINVAL; } for my $h (@handles) { my ($r, $e); # DragQueryFile $!=0;$^E=0; $r = Win32::GUI::DropFiles::DragQueryFile($h); $e = $^E; # Record $^E immediately after call is($r , undef, "DragQueryFile: Invalid handle $h returns undef"); SKIP: { skip "DragQueryFiles: Can't test error codes if we didn't get an error", 2 if defined $r; cmp_ok($!, "==", EINVAL, "DragQueryFile: Errno set to EINVAL"); cmp_ok($e, "==", $EXPECTED_E, "DragQueryFile: LastError set to ERROR_INVALID_HANDLE"); } # DragQueryPoint $!=0;$^E=0; $r = Win32::GUI::DropFiles::DragQueryPoint($h); $e = $^E; # Record $^E immediately after call is($r, undef, "DragQueryPoint: Invalid handle $h returns undef"); SKIP: { skip "DragQueryPoint: Can't test error codes if we didn't get an error", 2 if defined $r; cmp_ok($!, "==", EINVAL, "DragQueryPoint: Errno set to EINVAL"); cmp_ok($^E, "==", $EXPECTED_E, "DragQueryPoint: LastError set to ERROR_INVALID_HANDLE"); } # DragFinish # DragFinish sets LastError inconsistently, using ERROR_INVALID_PARAMETER # on win98 and ERROR_INVALID_HANDLE on winNT. Also on WinNT, doesn't # consider 0 to be invalid. As there is no return value from DragFinish, # the user can't tell if there was an error or not, so doen't know if # $^E contains anything useful or not, so we don't need to do the test. } --- NEW FILE: 02_old_callback.t --- #!perl -w # Win32::GUI::DropFiles test suite # $Id: 02_old_callback.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Test Win32::GUI DropFiles callback without loading Win32::GUI::DropFiles # This is really a Win32::GUI test, not a Win32::GUI::Dropfiles test, # but is here for completeness # This old callback format is kept for backwards compatibility with # The GUI Loft's Win32::GUI::DragDrop package. # - check pre-requsites # - check both OEM and NEM callbacks # - check callback parameter types # - check that DragFinish is called use strict; use warnings; BEGIN { $| = 1 } # Autoflush # We assume that 01_load.t has been run, so we know we have Test::More # and that Win32::GUI and Win32::GUI::DropFiles will load. use Test::More; BEGIN { eval "use Win32::API 0.41"; plan skip_all => "Win32::API 0.41 required for testing Old Callack API" if $@; } plan tests => 7; # Load our helpers use FindBin; use lib "$FindBin::Bin"; use DropTest; use Win32::GUI 1.03_02; my $dropobj = DropTest->new(); my $W = Win32::GUI::Window->new( -name => 'win', -title => "Win32::GUI DropFiles Test", -size => [400,300], -onDropFiles => \&drop, -eventmodel => "byname", ); Win32::GUI::DoEvents(); # Do the OEM tests $dropobj->PostDropMessage($W); Win32::GUI::Dialog(); # Check that the receiver freed the handle ok($dropobj->Free(), "OEM frees the drop object"); # Now do the NEM tests: $W->Change(-eventmodel => "byref"); $dropobj->PostDropMessage($W); Win32::GUI::Dialog(); ok($dropobj->Free(), "NEM frees the drop object"); exit(0); sub win_DropFiles { my ($drophandle) = shift; ok(defined $drophandle, "OEM callback, drophandle defined"); is(ref($drophandle), "", "OEM drophandle is a scalar"); return -1; } sub drop { my ($self, $drophandle) = @_; is($self, $W, "NEM callback gets window object"); ok(defined $drophandle, "NEM callback, drophandle defined"); is(ref($drophandle), "", "NEM drophandle is a scalar"); return -1; } --- NEW FILE: DropTest.pm --- package DropTest; # $Id: DropTest.pm,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # package to hide away the complexity of generating a WM_DROPEVENT on a window. # Written by Robert May, April 2006 # # This would be an ideal candidate for implementing in XS within a Win32::GUI::Test # module # use strict; use warnings; use Win32(); use Win32::GUI(); use Win32::API(); Win32::API->Import('Kernel32', 'GlobalAlloc', 'LL', 'L') || die "No GlobalAlloc: $^E"; Win32::API->Import('Kernel32', 'GlobalLock', 'L', 'L') || die "No GlobalLock: $^E"; Win32::API->Import('Kernel32', 'GlobalUnlock', 'L', 'L') || die "No GlobalUnlock: $^E"; Win32::API->Import('Kernel32', 'GlobalFree', 'L', 'L') || die "No GlobalFree: $^E"; Win32::API->Import('Kernel32', 'GlobalFlags', 'L', 'L') || die "No GlobalFree: $^E"; Win32::API->Import("kernel32", "RtlMoveMemory", "LPI", "V") || die "No RtlMoveMemory: $^E"; sub WM_DROPFILES() {563} sub NO_ERROR() {0} sub GHND() {0x0042} # GHND = GMEM_MOVEABLE|GMEM_ZERO_INIT = 0x0042 sub GMEM_INVALID_HANDLE() {32768} sub new { my $class = shift; my %options = @_; $options{x} ||= 0; $options{y} ||= 0; $options{wide} ||= 0; $options{client} = 1 unless defined $options{client}; my $files = []; if(exists $options{files}) { if(ref($options{files}) eq "ARRAY") { for my $file (@{$options{files}}) { push @{$files}, $file; } } else { die("files option must be an array ref"); } } else { $files = ['File1', 'File2', 'File3',]; } if($options{wide}) { require Unicode::String; # use this in place of Encode, as Encode does not ship with Perl 5.6 for my $file (@{$files}) { $file = Unicode::String::utf8($file)->byteswap->ucs2; } } $options{files} = $files; return bless \%options, $class; } sub PostDropMessage { my ($self,$dest) = @_; # always create a new handle, as the receiver is supposed to free it. my $hdrop = $self->_create_new_drop_handle(); $dest->PostMessage(WM_DROPFILES, $hdrop, 0); # The recieving process should free the hdrop handle, # and the handle should be invalid sometime after this call # Check using isFree before calling PostDropMessage again return; } # return TRUE if the hdrop handle associated with the object is freed (invalid) # if not freed, free it and return false sub Free { my ($self) = @_; my $hdrop = $self->{hdrop}; return 1 unless $hdrop; my $locks = GlobalFlags($hdrop); delete $self->{hdrop}; return 1 if $locks == GMEM_INVALID_HANDLE; GlobalFree($hdrop); return 0; } sub _create_new_drop_handle { my ($self) = @_; # Free any previous handle, and warn us if it wasn't freed if(!$self->Free()) { warn "Old drop handle not freed - check for error"; } # DROPFILES struct: # typedef struct _DROPFILES { # DWORD pFiles; # POINT pt; # BOOL fNC; # BOOL fWide; # } DROPFILES, *LPDROPFILES; # followed by double NULL terminated string structure my $term = "x"; $term = "xx" if $self->{wide}; my $buffer = pack("LLLLL" . "a*$term" x @{$self->{files}} . $term, 20, # sizeof(DROPFILES) - string ptr offset $self->{x}, $self->{y}, $self->{client} ? 0 : 1, $self->{wide} ? 1 : 0, @{$self->{files}}, ); my $size = length($buffer); my $hdrop = GlobalAlloc(GHND, $size) or die "GlobalAlloc failed: $^E"; my $ptr = GlobalLock($hdrop) or die "GlobalLock failed: $^E"; RtlMoveMemory($ptr, $buffer, $size); GlobalUnlock($hdrop); return $self->{hdrop} = $hdrop; } sub dump { my $self = shift; if($self->{hdrop}) { my $hdrop = $self->{hdrop}; print "Dumping handle: $hdrop\n"; my $ptr = GlobalLock($hdrop); die "GlobalLock failed: $^E" unless $ptr; # Get the header (HROPFILES) structure my ($poff, $x, $y, $nc, $fwide) = unpack("LLLLL", unpack("P20", pack("L", $ptr))); print " poff:\t$poff\n"; print " x:\t$x\n"; print " y:\t$y\n"; print " nc:\t$nc\n"; print " wide:\t$fwide\n"; my $count = 0; $ptr += $poff; # This is probably hideously slow, but as it's only for debug ... my $pack_str = "C"; my $char_len = 1; if($fwide) { $pack_str = "v"; $char_len = 2; } my $last_char_null = 0; my $file = ""; while(1) { my $char = unpack($pack_str, unpack("P$char_len", pack("L", $ptr))); $ptr += $char_len; last if $last_char_null && $char == 0; if($char == 0) { $last_char_null = 1; printf " File $count: $file [%vx]\n", $file; $count++; $file = ""; next; } $last_char_null = 0; $file .= chr $char; } GlobalUnlock($hdrop); } else { print "No data to dump\n"; } return; } sub DESTROY { # free the handle if necessary $_[0]->Free(); } # Static function to determine if a drop handle is valid or not sub isValidHandle { my $handle = shift; my $locks = GlobalFlags($handle); return 0 if $locks == GMEM_INVALID_HANDLE; return 1; } 1; # End of DropTest.pm --- NEW FILE: 09_DragFinish.t --- #!perl -w # Win32::GUI::DropFiles test suite # $Id: 09_DragFinish.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Test Win32::GUI::DropFiles DragFinish() function use strict; use warnings; BEGIN { $| = 1 } # Autoflush # We assume that 01_load.t has been run, so we know we have Test::More # and that Win32::GUI and Win32::GUI::DropFiles will load. use Test::More; BEGIN { eval "use Win32::API 0.41"; plan skip_all => "Win32::API 0.41 required for testing DragFinish()" if $@; } plan tests => 1; # Load our helpers use FindBin; use lib "$FindBin::Bin"; use DropTest; use Win32::GUI 1.03_02; use Win32::GUI::DropFiles; my $dropobj = DropTest->new(); my $W = Win32::GUI::Window->new( -name => 'win', -title => "Win32::GUI DropFiles Test", -size => [400,300], -onDropFiles => \&drop, ); Win32::GUI::DoEvents(); $dropobj->PostDropMessage($W); Win32::GUI::Dialog(); exit(0); sub drop { my ($self, $dropobj) = @_; #Calling DragFinish should make the HDROP handle invalid Win32::GUI::DropFiles::DragFinish($dropobj->{-handle}); is(DropTest::isValidHandle($dropobj->{-handle}), 0, "handle invalidated"); return -1; } --- NEW FILE: 06_GetDropPos.t --- #!perl -w # Win32::GUI::DropFiles test suite # $Id: 06_GetDropPos.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $ # # Test Win32::GUI::DropFiles GetDropPos() method use strict; use warnings; BEGIN { $| = 1 } # Autoflush # We assume that 01_load.t has been run, so we know we have Test::More # and that Win32::GUI and Win32::GUI::DropFiles will load. use Test::More; BEGIN { eval "use Win32::API 0.41"; plan skip_all => "Win32::API 0.41 required for testing GetDropPos()" if $@; } # Load our helpers use FindBin; use lib "$FindBin::Bin"; use DropTest; use Win32::GUI 1.03_02; use Win32::GUI::DropFiles; my @testdata = ( { x => 100, y => 120, c => 1 }, { x => 1, y => -1, c => 0 }, ); my $numtests = scalar @testdata; plan tests => 6 * $numtests; my $W = Win32::GUI::Window->new( -name => 'win', -title => "Win32::GUI DropFiles Test", -size => [400,300], -onDropFiles => \&drop, ); Win32::GUI::DoEvents(); my $testnum; for (0..$numtests-1) { $testnum = $_; my $dropobj = DropTest->new( x => $testdata[$testnum]->{x}, y => $testdata[$testnum]->{y}, client => $testdata[$testnum]->{c}, ); $dropobj->PostDropMessage($W); Win32::GUI::Dialog(); } exit(0); sub drop { my ($self, $dropobj) = @_; # GetDropPos in scalar context returns client area or not is($dropobj->GetDropPos(), $testdata[$testnum]->{c}, "Correct client indication"); # In list context give x, y and client indicators: { my ($x, $y) = $dropobj->GetDropPos(); is($x, $testdata[$testnum]->{x}, "X-pos reported correctly"); is($y, $testdata[$testnum]->{y}, "Y-pos reported correctly"); } { my ($x, $y, $client) = $dropobj->GetDropPos(); is($x, $testdata[$testnum]->{x}, "X-pos reported correctly"); is($y, $testdata[$testnum]->{y}, "Y-pos reported correctly"); is($client, $testdata[$testnum]->{c}, "client pos reported correctly"); } return -1; } |
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2364/Win32-GUI-DropFiles Added Files: DropFiles.pm DropFiles.xs DropFilesRC.PL Makefile Makefile.PL README TYPEMAP ppport.h Log Message: Add Win32::GUI::DropFiles --- NEW FILE: DropFiles.xs --- #define WIN32_MEAN_AND_LEAN /* XS code for Win32::GUI::DropFiles * $Id: DropFiles.xs,v 1.1 2006/04/25 21:38:18 robertemay Exp $ * (c) Robert May, 2006 * Released under the same terms as Perl */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include "Windows.h" #include "shellapi.h" /* void newSVpvnW(SV* s, WCHAR* w, UINT c) * - s [OUT] pointer to SV. Will be set to point to a newly created SV, * with ref count 1. * - w [IN] pointer to WCHAR buffer. * - c [IN] number of characters (NOT bytes) to be copied from WCHAR. Do * not include any NULL termination. If c = -1, then length will be * calculated, assuming w is NULL terminated. */ /* TODO: This macro probably better written as a function that returns the * pointer to the SV, and it is more 'perl like' if c==0 indicates the length * should be calculated. It would be good to get rid of the duplicated SvPVX() calls. */ #define newSVpvnW(s, w, c) \ { UINT b = WideCharToMultiByte(CP_UTF8, 0, w, c, NULL, 0, NULL, NULL); \ s = newSV(b); SvPOK_on(s); SvUTF8_on(s); SvCUR_set(s,b); \ WideCharToMultiByte(CP_UTF8, 0, w, c, SvPVX(s), b, NULL, NULL); \ *(SvPVX(s) + b) = 0; sv_utf8_downgrade(s, 1); } /* BOOL INVALID_HANDLE(HDROP h) * Attempt to determine if a HDROP handle is valid * Returns TRUE if handle is invalid * Returns FALSE if handle is valid * TODO: can we do better than this? */ BOOL INVALID_HANDLE(HDROP h) { if(GlobalLock((HGLOBAL)h)) { GlobalUnlock((HGLOBAL)h); return 0; } return 1; } #ifndef W32G_NO_WIN9X /* BOOL IsWin9X() * Returns TRUE if OS Version is Win95/98/ME * Returns FLASE if OS Version is NT/2K/XP/2003 or higher */ /* TODO: Better to cache the value to prevent the overhead of * GetVersion() on each call. Eventually this needs extracting * somewhere central, so that we don't have repeat implementations * all over the place. ??Can we efficiently access the Win32::IsWin95 * function?? */ BOOL IsWin9X() { return (GetVersion() & 0x80000000); } #endif MODULE = Win32::GUI::DropFiles PACKAGE = Win32::GUI::DropFiles PROTOTYPES: ENABLE ########################################################################## # (@)WIN32API:DragQueryFile(HDROP, [ITEM]) # See Dropfiles.pm for documentation void DragQueryFile(handle, ...) HDROP handle PREINIT: UINT count, item, cch; SV* sv; PPCODE: /* Shell32.dll crashes if we pass an invalid handle * to DragQueryFile, so ensure we have one */ if(INVALID_HANDLE(handle)) { SetLastError(ERROR_INVALID_HANDLE); /* set $^E */ errno = EINVAL; /* set $! */ XSRETURN_UNDEF; /* and return undef */ } #ifndef W32G_NO_WIN9X if(IsWin9X()) count = DragQueryFileA(handle, 0xFFFFFFFF, NULL, 0); else #endif count = DragQueryFileW(handle, 0xFFFFFFFF, NULL, 0); if(items == 1) { mXPUSHu(count); XSRETURN(1); } else if (items == 2) { item = SvIV(ST(1)); if(item < count) { /* item is in range */ #ifndef W32G_NO_WIN9X if(IsWin9X()) { CHAR buffer[MAX_PATH]; cch = DragQueryFileA(handle, item, buffer, MAX_PATH); sv = newSVpvn(buffer,cch); } else { #endif WCHAR wbuffer[MAX_PATH]; cch = DragQueryFileW(handle, item, wbuffer, MAX_PATH); newSVpvnW(sv, wbuffer, cch); #ifndef W32G_NO_WIN9X } #endif XPUSHs(sv_2mortal(sv)); XSRETURN(1); } else { /* item is out of range */ SetLastError(ERROR_INVALID_INDEX); /* set $^E */ errno = EINVAL; /* set $! */ XSRETURN_UNDEF; /* and return undef */ } } else { croak("Usage: DragQueryHandle(handle);\n or: DragQueryHandle(handle, index);"); } ########################################################################## # (@)WIN32API:DragQueryPoint(HDROP) # See Dropfiles.pm for documentation void DragQueryPoint(handle) HDROP handle PREINIT: POINT pt; UV client; PPCODE: /* DragQueryPoint returns garbage if passed * an invalid handle, so ensure we have one */ if(INVALID_HANDLE(handle)) { SetLastError(ERROR_INVALID_HANDLE); /* set $^E */ errno = EINVAL; /* set $! */ XSRETURN_UNDEF; /* and return undef */ } client = (UV)DragQueryPoint(handle, &pt); mXPUSHi(pt.x); mXPUSHi(pt.y); mXPUSHu(client); XSRETURN(3); ########################################################################## # (@)WIN32API:DragFinish(HDROP) # See Dropfiles.pm for documentation void DragFinish(handle) HDROP handle --- NEW FILE: DropFilesRC.PL --- #!perl -w use strict; use warnings; use ExtUtils::MakeMaker; # $Id: DropFilesRC.PL,v 1.1 2006/04/25 21:38:18 robertemay Exp $ # perl script to produce the RC file for # Win32::GUI::DropFiles: create Resource # file with a VERSIONINFO section # The variables: my %info = ( Version => MM->parse_version('DropFiles.pm'), Dllname => 'DropFiles.dll', Years => '2006', Win32GUIVersion => MM->parse_version('../GUI.pm'), ); # Open the target file if ( @ARGV > 0 ) { my $file = $ARGV[0]; open(my $fh, '>', $file) or die qq(Failed to open '$file': $!); select $fh; } { my $fileVersion = $info{Version}; $fileVersion .= "_00" unless $fileVersion =~ m/_/; $info{FileVersion} = sprintf("%02d,%02d,%02d,00", $fileVersion =~ m/^(.*)\.([^_]*)_?(.*)$/); my $prodVersion = $info{Win32GUIVersion}; $prodVersion .= "_00" unless $prodVersion =~ m/_/; $info{ProductVersion} = sprintf("%02d,%02d,%02d,00", $prodVersion =~ m/^(.*)\.([^_]*)_?(.*)$/); } print <<"__RC"; #include "Winver.h" 1 VERSIONINFO FILEVERSION $info{FileVersion} PRODUCTVERSION $info{ProductVersion} FILEOS VOS__WINDOWS32 FILETYPE VFT_DLL { BLOCK "StringFileInfo" { BLOCK "040904E4" { VALUE "Comments" , "Win32::GUI::DropFiles, part of the perl Win32::GUI module." VALUE "CompanyName" , "perl-win32-gui.sourceforge.net" VALUE "FileDescription" , "Win32::GUI::DropFiles perl extension" VALUE "FileVersion" , "$info{Version}" VALUE "InternalName" , "$info{Dllname}" VALUE "LegalCopyright" , "Copyright © Robert May $info{Years}" VALUE "LegalTrademarks" , "GNU and Artistic licences" VALUE "OriginalFilename" , "$info{Dllname}" VALUE "ProductName" , "Win32::GUI perl extension" VALUE "ProductVersion" , "$info{Win32GUIVersion}" } } BLOCK "VarFileInfo" { VALUE "Translation", 0x0409, 0x04E4 } } __RC exit(0); __END__ --- NEW FILE: Makefile.PL --- #!perl -w use strict; use warnings; # Makefile.PL for Win32::GUI::DropFiles # $Id: Makefile.PL,v 1.1 2006/04/25 21:38:18 robertemay Exp $ use 5.006; use Config; use ExtUtils::MakeMaker; my %config = ( NAME => 'Win32::GUI::DropFiles', VERSION_FROM => 'DropFiles.pm', ABSTRACT_FROM => 'DropFiles.pm', AUTHOR => 'Robert May <rob...@us...>', PREREQ_PM => { 'Win32::GUI' => 1.04 }, #DEFINE => '-DW32G_no_WIN9X', PL_FILES => {'DropFilesRC.PL' => '$(BASEEXT).rc', }, OBJECT => '$(BASEEXT)$(OBJ_EXT) $(BASEEXT).res', macro => { RC => 'rc.exe', RCFLAGS => '', INST_DEMODIR => '$(INST_LIB)/Win32/GUI/demos/$(BASEEXT)', DEMOS => 'demos/DropFilesDemo.pl' }, clean => {FILES => '*.rc *.res', }, ); # if building using gcc (MinGW or cygwin) use windres # as the resource compiler if($Config{cc} =~ /gcc/i) { $config{macro}->{RC} = 'windres'; $config{macro}->{RCFLAGS} = '-O coff -o $*.res'; } # if building as part of the Win32::GUI core, then remove # the pre-req of Win32::GUI, as we may not have it until # we finish the build. { no warnings 'once'; delete $config{PREREQ_PM}->{'Win32::GUI'} if $main::W32G_CORE; } WriteMakefile(%config); package MY; # Add rule for .rc to .res conversion # Add rules to install demo scripts sub postamble { return <<'__POSTAMBLE'; .rc.res: $(RC) $(RCFLAGS) $< pure_all :: demo_to_blib $(NOECHO) $(NOOP) demo_to_blib: $(DEMOS) $(NOECHO) $(MKPATH) $(INST_DEMODIR) $(CP) $? $(INST_DEMODIR) $(NOECHO) $(TOUCH) demo_to_blib clean :: -$(RM_F) demo_to_blib __POSTAMBLE } --- NEW FILE: DropFiles.pm --- package Win32::GUI::DropFiles; # $Id: DropFiles.pm,v 1.1 2006/04/25 21:38:18 robertemay Exp $ # Win32::GUI::DropFiles, part of the Win32::GUI package # (c) Robert May, 2006 # released under the same terms as Perl. use 5.006; use strict; use warnings; use Win32::GUI 1.03_02,''; # Check Win32:GUI version, ensure import not called our $VERSION = '0.01'; require XSLoader; XSLoader::load('Win32::GUI::DropFiles', $VERSION); sub DESTROY { my $self = shift; $self->DragFinish(); } sub GetDroppedFiles { # void context - optional warning and do nothing if(!defined wantarray) { if(warnings::enabled('void')) { require Carp; Carp::carp('Useless use of GetDroppedFiles in void context'); } return; } my $self = shift; my $count = $self->DragQueryFile(); # scalar context - return number of files dropped return $count unless wantarray; my @files = (); for my $item (0..$count-1) { push @files, $self->DragQueryFile($item); } # list context - return list of files return(@files); } sub GetDroppedFile { # void context - optional warning and do nothing if(!defined wantarray) { if(warnings::enabled('void')) { require Carp; Carp::carp('Useless use of GetDroppedFile in void context'); } return; } my ($self, $item) = @_; $item ||= 0; # scalar context - return file name return $self->DragQueryFile($item); } sub GetDropPos { # void context - optional warning and do nothing if(!defined wantarray) { if(warnings::enabled('void')) { require Carp; Carp::carp('Useless use of GetDropPos in void context'); } return; } my $self = shift; my ($x, $y, $client) = $self->DragQueryPoint(); # scalar context - return boolean for whether drop is in # client area or not return $client unless wantarray; # list context - return x-pos, y-pos and boolean for # client area or not. return $x, $y, $client; } 1; # End of DropFiles.pm __END__ =head1 NAME Win32::GUI::DropFiles - Extension to Win32::GUI for shell Drag&Drop integration =head1 SYNOPSIS use Win32::GUI; use Win32::GUI::DropFiles; # Create droppable window: my $win = Win32::GUI::Window->new( -name => 'win', ... -acceptfiles => 1, -onDropFiles => \&dropfiles_callback, ... ); # Change the drop state of a window $win->AcceptFiles(1); $win->AcceptFiles(0); # In the DropFiles callback sub win_DropFiles { my ($self, $dropObj) = @_; # Get the number of dropped files my $count = $dropObj->GetDroppedFiles(); # Get a list of the dropped file names my @files = $dropObj->GetDroppedFiles(); # Get a particular file name (0 based index) my $file = $dropObj->GetDroppedFile($index); # determine if the drop happened in the client or # non-client area of the window my $clientarea = $dropObj->GetDropPos(); # get the mouse co-ordinates of the drop point, # in client co-ordinates my ($x, $y) = $dropObj->GetDropPos(); # get the drop point and (non-)client area information my ($x, $y, $client) = $dropObj->GetDropPos(); return 0; } =head1 DESCRIPTION Win32::GUI::DropFiles provides integration with the windows shell, allowing files to be dragged from the shell (e.g. explorer.exe), dropped onto a Win32::GUI window/control, and the path and filename of the dropped files to be retrieved. In order for a window to become a 'drop target' it must be created with the L<Win32::GUI::Reference::Options::acceptfiles|-acceptfiles> option set, or have called its L<Win32::GUI::Reference::Methods::AcceptFiles|AcceptFiles()> method. Once the window has been correctly initialised, then dropping a dragged file on the window results in a L<Win32::GUI::Reference::Events::DropFiles|DropFiles> event being triggered. The parameter to the event callback function is a Win32::GUI::DropFiles object that can be used to retrieve the names and paths of the dropped files. =head1 Drop Object Methods This section documents the public API for Win32::GUI::DropFiles objects. =head2 Constructor The constructor is not public: Win32::GUI creates Win32::GUI::DropFiles object when necessary, to pass to the DropFiles event handler subroutine. =head2 GetDroppedFiles my $count = $dropObj->GetDroppedFiles(); my @files = $dropObj->GetDroppedFiles(); In scalar context returns the number of files dropped. In list context returns a list of fully qualified path/filename for each dropped file. =head2 GetDroppedFile my $file = $dropObj->GetDroppedFile($index); returns the fully qualified path/filename for the file referenced by the zero-based C<index>. If C<index> is out of range, returns undef and sets C<$!> and C<$^E>. =head2 GetDropPos my $client = $dropObj->GetDropPos(); my ($x, $y, $client) = $dropObj->GetDropPos(); In scalar context returns a flag indicating whether the mouse was in the client or non-client area of the window when the files were dropped. In list context returns the x and y co-ordinates of the mouse when the files were dropped (in client co-ordinates), as well as a flag indicating whether the mouse was in the client or non-client area of the window. =head2 Destructor The destructor is called automatically when the object goes out of scope, and releases resources used by the system to store the filnames. Typically the object goes out of scope at the end of the DropFiles callback. Care should be taken to ensure that if a reference is taken to the object that does not go out of scope at that time, that it is eventually released, otherwise a memory leak will occur. =head1 Win32 API functions This section documents the Win32 API wrappers implemented by Win32::GUI::DropFiles. Although these APIs are available, their use is not recommended - the public Object Methods should provide better access to these APIs. See MSDN (L<http://msdn.microsoft.com/> for further details of the Win32 API functions. =head2 DragQueryFile Win32::GUI::DropFiles::DragQueryFile($dropHandle, [$item]); C<dropHandle> is a win32 C<HDROP> handle. C<item> is a zero-based index to the filename to be retrieved. Returns the number of files dropped if C<item> is omitted. Returns the filenmame if C<item> is provided. Returns undef and sets C<$!> and C<$^E> on error. =head2 DragQueryPoint Win32::GUI::DropFiles::DragQueryPoint($dropHandle); C<dropHandle> is a win32 C<HDROP> handle. Returns a 3 element list of the x-position and y-position (in client co-ordinates) and a flag that indicates whether the drop happened in the client or non-client area of the window. =head2 DragFinish Win32::GUI::DropFiles::DragFinish($dropHandle); C<dropHandle> is a win32 C<HDROP> handle. Releases the resources and invalidates C<dropHandle>. Does not return any value. =head1 Unicode filenmame support Supports unicode filenames under WinNT, Win2k, WinXP and higher. =head1 Backwards compatibility with Win32::GUI::DragDrop The GUI Loft includes a Win32::GUI::DragDrop module that exposes similar functionality. If you want to continue to use that module, then ensure that Win32::GUI::DropFiles is not used anywhere in your program (even by other modules that you use). Loading Win32::GUI::DropFiles changes the DropFiles event callback signature, and will result in Win32::GUI::DragDrop failing. It is recommended to upgrade to Win32::GUI::DropFiles. =head1 SEE ALSO MSDN L<http://msdn.microsoft.com> for more information on DragAcceptFiles, DragQueryFiles, DragQueryPos, DragFinish, WS_EX_ACCEPTFILES, WM_DROPFILES L<Win32::GUI|Win32::GUI> =head1 SUPPORT Homepage: L<http://perl-win32-gui.sourceforge.net/>. For further support join the users mailing list (C<per...@li...>) from the website at L<http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users>. There is a searchable list archive at L<http://sourceforge.net/mail/?group_id=16572> =head1 AUTHORS Robert May, E<lt>rob...@us...<gt> Reini Urban, E<lt>ru...@xr...<gt> =head1 COPYRIGHT AND LICENSE Copyright (C) 2006 by Robert May This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut --- NEW FILE: Makefile --- # This Makefile is for the Win32::GUI::DropFiles extension to perl. # # It was generated automatically by MakeMaker version # 6.17 (Revision: 1.133) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # # ANY CHANGES MADE HERE WILL BE LOST! # # MakeMaker ARGV: () # # MakeMaker Parameters: # ABSTRACT_FROM => q[DropFiles.pm] # AUTHOR => q[Robert May <rob...@us...>] # NAME => q[Win32::GUI::DropFiles] # OBJECT => q[$(BASEEXT)$(OBJ_EXT) $(BASEEXT).res] # PL_FILES => { DropFilesRC.PL=>q[$(BASEEXT).rc] } # PREREQ_PM => { } # VERSION_FROM => q[DropFiles.pm] # clean => { FILES=>q[*.rc *.res] } # macro => { DEMOS=>q[demos/DropFilesDemo.pl], INST_DEMODIR=>q[$(INST_LIB)/Win32/GUI/demos/$(BASEEXT)], RC=>q[rc.exe], RCFLAGS=>q[] } # --- MakeMaker post_initialize section: # --- MakeMaker const_config section: # These definitions are from config.sh (via C:/Perl/Perl587/lib/Config.pm) # They may have been overridden via Makefile.PL or on the command line AR = lib CC = cl CCCDLFLAGS = CCDLFLAGS = DLEXT = dll DLSRC = dl_win32.xs LD = link LDDLFLAGS = -dll -nologo -nodefaultlib -debug -opt:ref,icf -libpath:"C:\Perl\Perl587\lib\CORE" -machine:x86 LDFLAGS = -nologo -nodefaultlib -debug -opt:ref,icf -libpath:"C:\Perl\Perl587\lib\CORE" -machine:x86 LIBC = msvcrt.lib LIB_EXT = .lib OBJ_EXT = .obj OSNAME = MSWin32 OSVERS = 5.0 RANLIB = rem SITELIBEXP = C:\Perl\Perl587\site\lib SITEARCHEXP = C:\Perl\Perl587\site\lib SO = dll EXE_EXT = .exe FULL_AR = VENDORARCHEXP = VENDORLIBEXP = # --- MakeMaker constants section: AR_STATIC_ARGS = cr DIRFILESEP = ^\ NAME = Win32::GUI::DropFiles NAME_SYM = Win32_GUI_DropFiles VERSION = 0.01 VERSION_MACRO = VERSION VERSION_SYM = 0_01 DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" XS_VERSION = 0.01 XS_VERSION_MACRO = XS_VERSION XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" INST_ARCHLIB = ..\blib\arch INST_SCRIPT = ..\blib\script INST_BIN = ..\blib\bin INST_LIB = ..\blib\lib INST_MAN1DIR = ..\blib\man1 INST_MAN3DIR = ..\blib\man3 MAN1EXT = 1 MAN3EXT = 3 INSTALLDIRS = site DESTDIR = PREFIX = PERLPREFIX = C:\Perl\Perl587 SITEPREFIX = C:\Perl\Perl587\site VENDORPREFIX = INSTALLPRIVLIB = $(PERLPREFIX)\lib DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) INSTALLSITELIB = $(SITEPREFIX)\lib DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) INSTALLVENDORLIB = DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) INSTALLARCHLIB = $(PERLPREFIX)\lib DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) INSTALLSITEARCH = $(SITEPREFIX)\lib DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) INSTALLVENDORARCH = DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) INSTALLBIN = $(PERLPREFIX)\bin DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) INSTALLSITEBIN = C:\Perl\Perl587\bin DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) INSTALLVENDORBIN = DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) INSTALLSCRIPT = $(PERLPREFIX)\bin DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) INSTALLMAN1DIR = $(PERLPREFIX)\man\man1 DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) INSTALLSITEMAN1DIR = $(SITEPREFIX)\man\man1 DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) INSTALLVENDORMAN1DIR = DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) INSTALLMAN3DIR = $(PERLPREFIX)\man\man3 DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) INSTALLSITEMAN3DIR = $(SITEPREFIX)\man\man3 DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) INSTALLVENDORMAN3DIR = DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) PERL_LIB = C:\Perl\Perl587\lib PERL_ARCHLIB = C:\Perl\Perl587\lib LIBPERL_A = libperl.lib FIRST_MAKEFILE = Makefile MAKEFILE_OLD = $(FIRST_MAKEFILE).old MAKE_APERL_FILE = $(FIRST_MAKEFILE).aperl PERLMAINCC = $(CC) PERL_INC = C:\Perl\Perl587\lib\CORE PERL = C:\Perl\Perl587\bin\perl.exe FULLPERL = C:\Perl\Perl587\bin\perl.exe ABSPERL = $(PERL) PERLRUN = $(PERL) FULLPERLRUN = $(FULLPERL) ABSPERLRUN = $(ABSPERL) PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" PERL_CORE = 0 PERM_RW = 644 PERM_RWX = 755 MAKEMAKER = C:/Perl/Perl587/lib/ExtUtils/MakeMaker.pm MM_VERSION = 6.17 MM_REVISION = 1.133 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) # DLBASE = Basename part of dynamic library. May be just equal BASEEXT. FULLEXT = Win32\GUI\DropFiles BASEEXT = DropFiles PARENT_NAME = Win32::GUI DLBASE = $(BASEEXT) VERSION_FROM = DropFiles.pm OBJECT = $(BASEEXT)$(OBJ_EXT) $(BASEEXT).res LDFROM = $(OBJECT) LINKTYPE = dynamic # Handy lists of source code files: XS_FILES = DropFiles.xs C_FILES = DropFiles.c O_FILES = DropFiles.obj H_FILES = ppport.h MAN1PODS = MAN3PODS = DropFiles.pm # Where is the Config information that we are using/depend on CONFIGDEP = $(PERL_ARCHLIB)$(DIRFILESEP)Config.pm $(PERL_INC)$(DIRFILESEP)config.h # Where to build things INST_LIBDIR = $(INST_LIB)\Win32\GUI INST_ARCHLIBDIR = $(INST_ARCHLIB)\Win32\GUI INST_AUTODIR = $(INST_LIB)\auto\$(FULLEXT) INST_ARCHAUTODIR = $(INST_ARCHLIB)\auto\$(FULLEXT) INST_STATIC = $(INST_ARCHAUTODIR)\$(BASEEXT)$(LIB_EXT) INST_DYNAMIC = $(INST_ARCHAUTODIR)\$(DLBASE).$(DLEXT) INST_BOOT = $(INST_ARCHAUTODIR)\$(BASEEXT).bs # Extra linker info EXPORT_LIST = $(BASEEXT).def PERL_ARCHIVE = $(PERL_INC)\perl58.lib PERL_ARCHIVE_AFTER = TO_INST_PM = DropFiles.pm PM_TO_BLIB = DropFiles.pm \ $(INST_LIB)\Win32\GUI\DropFiles.pm # --- MakeMaker platform_constants section: MM_Win32_VERSION = 1.09 # --- MakeMaker tool_autosplit section: # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto AUTOSPLITFILE = $(PERLRUN) -e "use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)" # --- MakeMaker tool_xsubpp section: XSUBPPDIR = C:\Perl\Perl587\lib\ExtUtils XSUBPP = $(XSUBPPDIR)/xsubpp XSPROTOARG = XSUBPPDEPS = C:\Perl\Perl587\lib\ExtUtils\typemap typemap $(XSUBPP) XSUBPPARGS = -typemap C:\Perl\Perl587\lib\ExtUtils\typemap -typemap typemap XSUBPP_EXTRA_ARGS = # --- MakeMaker tools_other section: CHMOD = $(PERLRUN) -MExtUtils::Command -e chmod CP = $(PERLRUN) -MExtUtils::Command -e cp MV = $(PERLRUN) -MExtUtils::Command -e mv NOOP = rem NOECHO = @ RM_F = $(PERLRUN) -MExtUtils::Command -e rm_f RM_RF = $(PERLRUN) -MExtUtils::Command -e rm_rf TEST_F = $(PERLRUN) -MExtUtils::Command -e test_f TOUCH = $(PERLRUN) -MExtUtils::Command -e touch UMASK_NULL = umask 0 DEV_NULL = > NUL MKPATH = $(PERLRUN) "-MExtUtils::Command" -e mkpath EQUALIZE_TIMESTAMP = $(PERLRUN) "-MExtUtils::Command" -e eqtime ECHO = $(PERLRUN) -l -e "print qq{@ARGV}" ECHO_N = $(PERLRUN) -e "print qq{@ARGV}" UNINST = 0 VERBINST = 0 MOD_INSTALL = $(PERLRUN) -MExtUtils::Install -e "install({@ARGV}, '$(VERBINST)', 0, '$(UNINST)');" DOC_INSTALL = $(PERLRUN) "-MExtUtils::Command::MM" -e perllocal_install UNINSTALL = $(PERLRUN) "-MExtUtils::Command::MM" -e uninstall WARN_IF_OLD_PACKLIST = $(PERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist # --- MakeMaker makemakerdflt section: makemakerdflt: all $(NOECHO) $(NOOP) # --- MakeMaker dist section skipped. # --- MakeMaker macro section: DEMOS = demos/DropFilesDemo.pl INST_DEMODIR = $(INST_LIB)/Win32/GUI/demos/$(BASEEXT) RC = rc.exe RCFLAGS = # --- MakeMaker depend section: # --- MakeMaker cflags section: CCFLAGS = -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DBUILT_BY_ACTIVESTATE -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX OPTIMIZE = -MD -Zi -DNDEBUG -O1 PERLTYPE = MPOLLUTE = # --- MakeMaker const_loadlibs section: # Win32::GUI::DropFiles might depend on some other libraries: # See ExtUtils::Liblist for details # LDLOADLIBS = oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib LD_RUN_PATH = # --- MakeMaker const_cccmd section: CCCMD = $(CC) -c $(PASTHRU_INC) $(INC) \ $(CCFLAGS) $(OPTIMIZE) \ $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ $(XS_DEFINE_VERSION) # --- MakeMaker post_constants section: # --- MakeMaker pasthru section: PASTHRU = -nologo # --- MakeMaker special_targets section: .SUFFIXES: .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) .PHONY: all config static dynamic test linkext manifest # --- MakeMaker c_o section: .c.i: cl -nologo -E -c $(PASTHRU_INC) $(INC) \ $(CCFLAGS) $(OPTIMIZE) \ $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ $(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i .c.s: $(CCCMD) -S $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c .c$(OBJ_EXT): $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c .cpp$(OBJ_EXT): $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cpp .cxx$(OBJ_EXT): $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cxx .cc$(OBJ_EXT): $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cc # --- MakeMaker xs_c section: .xs.c: $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c # --- MakeMaker xs_o section: .xs$(OBJ_EXT): $(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c # --- MakeMaker top_targets section: all :: pure_all $(NOECHO) $(NOOP) pure_all :: config pm_to_blib subdirs linkext $(NOECHO) $(NOOP) subdirs :: $(MYEXTLIB) $(NOECHO) $(NOOP) config :: $(FIRST_MAKEFILE) $(INST_LIBDIR)$(DIRFILESEP).exists $(NOECHO) $(NOOP) config :: $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(NOECHO) $(NOOP) config :: $(INST_AUTODIR)$(DIRFILESEP).exists $(NOECHO) $(NOOP) $(INST_AUTODIR)\.exists :: C:\Perl\Perl587\lib\CORE\perl.h $(NOECHO) $(MKPATH) $(INST_AUTODIR) $(NOECHO) $(EQUALIZE_TIMESTAMP) C:\Perl\Perl587\lib\CORE\perl.h $(INST_AUTODIR)\.exists -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_AUTODIR) $(INST_LIBDIR)\.exists :: C:\Perl\Perl587\lib\CORE\perl.h $(NOECHO) $(MKPATH) $(INST_LIBDIR) $(NOECHO) $(EQUALIZE_TIMESTAMP) C:\Perl\Perl587\lib\CORE\perl.h $(INST_LIBDIR)\.exists -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_LIBDIR) $(INST_ARCHAUTODIR)\.exists :: C:\Perl\Perl587\lib\CORE\perl.h $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) $(NOECHO) $(EQUALIZE_TIMESTAMP) C:\Perl\Perl587\lib\CORE\perl.h $(INST_ARCHAUTODIR)\.exists -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_ARCHAUTODIR) config :: $(INST_MAN3DIR)$(DIRFILESEP).exists $(NOECHO) $(NOOP) $(INST_MAN3DIR)\.exists :: C:\Perl\Perl587\lib\CORE\perl.h $(NOECHO) $(MKPATH) $(INST_MAN3DIR) $(NOECHO) $(EQUALIZE_TIMESTAMP) C:\Perl\Perl587\lib\CORE\perl.h $(INST_MAN3DIR)\.exists -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_MAN3DIR) $(O_FILES): $(H_FILES) help: perldoc ExtUtils::MakeMaker # --- MakeMaker linkext section: linkext :: $(LINKTYPE) $(NOECHO) $(NOOP) # --- MakeMaker dlsyms section: DropFiles.def: Makefile.PL $(PERLRUN) -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Win32::GUI::DropFiles\", 'DLBASE' => '$(BASEEXT)', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" # --- MakeMaker dynamic section: dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT) $(NOECHO) $(NOOP) # --- MakeMaker dynamic_bs section: BOOTSTRAP = $(BASEEXT).bs # As Mkbootstrap might not write a file (if none is required) # we use touch to prevent make continually trying to remake it. # The DynaLoader only reads a non-empty file. $(BOOTSTRAP): $(FIRST_MAKEFILE) $(BOOTDEP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(NOECHO) $(ECHO) "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))" $(NOECHO) $(PERLRUN) \ "-MExtUtils::Mkbootstrap" \ -e "Mkbootstrap('$(BASEEXT)','$(BSLOADLIBS)');" $(NOECHO) $(TOUCH) $(BOOTSTRAP) $(CHMOD) $(PERM_RW) $@ $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(NOECHO) $(RM_RF) $(INST_BOOT) -$(CP) $(BOOTSTRAP) $(INST_BOOT) $(CHMOD) $(PERM_RW) $@ # --- MakeMaker dynamic_lib section: # This section creates the dynamically loadable $(INST_DYNAMIC) # from $(OBJECT) and possibly $(MYEXTLIB). OTHERLDFLAGS = INST_DYNAMIC_DEP = $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP) $(LD) -out:$@ $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST) $(CHMOD) $(PERM_RWX) $@ # --- MakeMaker static section: ## $(INST_PM) has been moved to the all: target. ## It remains here for awhile to allow for old usage: "make static" static :: $(FIRST_MAKEFILE) $(INST_STATIC) $(NOECHO) $(NOOP) # --- MakeMaker static_lib section: $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(RM_RF) $@ $(AR) -out:$@ $(OBJECT) $(CHMOD) $(PERM_RWX) $@ $(NOECHO) $(ECHO) "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld # --- MakeMaker manifypods section: POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" POD2MAN = $(POD2MAN_EXE) manifypods : pure_all \ DropFiles.pm \ DropFiles.pm $(NOECHO) $(POD2MAN) --section=3 --perm_rw=$(PERM_RW)\ DropFiles.pm $(INST_MAN3DIR)\Win32\GUI\DropFiles.$(MAN3EXT) # --- MakeMaker processPL section: all :: $(BASEEXT).rc $(NOECHO) $(NOOP) $(BASEEXT).rc :: DropFilesRC.PL $(PERLRUNINST) DropFilesRC.PL $(BASEEXT).rc # --- MakeMaker installbin section: # --- MakeMaker subdirs section: # none # --- MakeMaker clean_subdirs section: clean_subdirs : $(NOECHO)$(NOOP) # --- MakeMaker clean section: # Delete temporary files but do not touch installed files. We don't delete # the Makefile here so a later make realclean still has a makefile to use. clean :: clean_subdirs -$(RM_RF) DropFiles.c *.rc *.res ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all $(INST_ARCHAUTODIR)/extralibs.ld perlmain.c tmon.out mon.out so_locations pm_to_blib *$(OBJ_EXT) *$(LIB_EXT) perl.exe perl perl$(EXE_EXT) $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def lib$(BASEEXT).def $(BASEEXT).exp $(BASEEXT).x core core.*perl.*.? *perl.core core.[0-9] core.[0-9][0-9] core.[0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9][0-9] -$(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) clean :: -$(RM_F) *.pdb # --- MakeMaker realclean_subdirs section: realclean_subdirs : $(NOECHO)$(NOOP) # --- MakeMaker realclean section: # Delete temporary files (via clean) and also delete installed files realclean purge :: clean realclean_subdirs $(RM_RF) $(INST_AUTODIR) $(INST_ARCHAUTODIR) $(RM_RF) $(DISTVNAME) $(RM_F) $(INST_DYNAMIC) $(INST_BOOT) $(RM_F) $(INST_STATIC) $(RM_F) $(INST_LIB)\Win32\GUI\DropFiles.pm $(MAKEFILE_OLD) $(FIRST_MAKEFILE) # --- MakeMaker metafile section: metafile : $(NOECHO) $(ECHO) "# http://module-build.sourceforge.net/META-spec.html" > META.yml $(NOECHO) $(ECHO) "#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#" >> META.yml $(NOECHO) $(ECHO) "name: Win32-GUI-DropFiles" >> META.yml $(NOECHO) $(ECHO) "version: 0.01" >> META.yml $(NOECHO) $(ECHO) "version_from: DropFiles.pm" >> META.yml $(NOECHO) $(ECHO) "installdirs: site" >> META.yml $(NOECHO) $(ECHO) "requires:" >> META.yml $(NOECHO) $(ECHO) "" >> META.yml $(NOECHO) $(ECHO) "distribution_type: module" >> META.yml $(NOECHO) $(ECHO) "generated_by: ExtUtils::MakeMaker version 6.17" >> META.yml # --- MakeMaker metafile_addtomanifest section: metafile_addtomanifest: $(NOECHO) $(PERLRUN) -MExtUtils::Manifest=maniadd -e "eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } \ or print \"Could not add META.yml to MANIFEST: $${'@'}\n\"" # --- MakeMaker dist_basics section skipped. # --- MakeMaker dist_core section skipped. # --- MakeMaker distdir section skipped. # --- MakeMaker dist_test section skipped. # --- MakeMaker dist_ci section skipped. # --- MakeMaker install section skipped. # --- MakeMaker force section: # Phony target to force checking subdirectories. FORCE: $(NOECHO) $(NOOP) # --- MakeMaker perldepend section: PERL_HDRS = \ $(PERL_INC)/EXTERN.h \ $(PERL_INC)/INTERN.h \ $(PERL_INC)/XSUB.h \ $(PERL_INC)/av.h \ $(PERL_INC)/cc_runtime.h \ $(PERL_INC)/config.h \ $(PERL_INC)/cop.h \ $(PERL_INC)/cv.h \ $(PERL_INC)/dosish.h \ $(PERL_INC)/embed.h \ $(PERL_INC)/embedvar.h \ $(PERL_INC)/fakethr.h \ $(PERL_INC)/form.h \ $(PERL_INC)/gv.h \ $(PERL_INC)/handy.h \ $(PERL_INC)/hv.h \ $(PERL_INC)/intrpvar.h \ $(PERL_INC)/iperlsys.h \ $(PERL_INC)/keywords.h \ $(PERL_INC)/mg.h \ $(PERL_INC)/nostdio.h \ $(PERL_INC)/op.h \ $(PERL_INC)/opcode.h \ $(PERL_INC)/patchlevel.h \ $(PERL_INC)/perl.h \ $(PERL_INC)/perlio.h \ $(PERL_INC)/perlsdio.h \ $(PERL_INC)/perlsfio.h \ $(PERL_INC)/perlvars.h \ $(PERL_INC)/perly.h \ $(PERL_INC)/pp.h \ $(PERL_INC)/pp_proto.h \ $(PERL_INC)/proto.h \ $(PERL_INC)/regcomp.h \ $(PERL_INC)/regexp.h \ $(PERL_INC)/regnodes.h \ $(PERL_INC)/scope.h \ $(PERL_INC)/sv.h \ $(PERL_INC)/thrdvar.h \ $(PERL_INC)/thread.h \ $(PERL_INC)/unixish.h \ $(PERL_INC)/util.h $(OBJECT) : $(PERL_HDRS) DropFiles.c : $(XSUBPPDEPS) # --- MakeMaker makefile section: $(OBJECT) : $(FIRST_MAKEFILE) # We take a very conservative approach here, but it's worth it. # We move Makefile to Makefile.old here to avoid gnu make looping. $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." $(NOECHO) $(RM_F) $(MAKEFILE_OLD) $(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) -$(MAKE) -f $(MAKEFILE_OLD) clean $(DEV_NULL) || $(NOOP) $(PERLRUN) Makefile.PL $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" $(NOECHO) $(ECHO) "==> Please rerun the make command. <==" false # --- MakeMaker staticmake section: # --- MakeMaker makeaperl section --- MAP_TARGET = ..\perl FULLPERL = C:\Perl\Perl587\bin\perl.exe # --- MakeMaker test section: TEST_VERBOSE=0 TEST_TYPE=test_$(LINKTYPE) TEST_FILE = test.pl TEST_FILES = t\01_load.t t\02_old_callback.t t\03_new_callback.t t\04_GetDroppedFiles.t t\05_GetDroppedFile.t t\06_GetDropPos.t t\07_DragQueryFile.t t\08_DragQueryPoint.t t\09_DragFinish.t t\10_Unicode.t t\11_invalid_handles.t t\98_pod.t t\99_pod_coverage.t TESTDB_SW = -d testdb :: testdb_$(LINKTYPE) test :: $(TEST_TYPE) test_dynamic :: pure_all $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_dynamic :: pure_all $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) test_ : test_dynamic test_static :: pure_all $(MAP_TARGET) ./$(MAP_TARGET) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_static :: pure_all $(MAP_TARGET) ./$(MAP_TARGET) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) # --- MakeMaker ppd section: # Creates a PPD (Perl Package Description) for a binary distribution. ppd: $(NOECHO) $(ECHO) "<SOFTPKG NAME=\"$(DISTNAME)\" VERSION=\"0,01,0,0\">" > $(DISTNAME).ppd $(NOECHO) $(ECHO) " <TITLE>$(DISTNAME)</TITLE>" >> $(DISTNAME).ppd $(NOECHO) $(ECHO) " <ABSTRACT>Extension to Win32::GUI for shell Drag&Drop integration</ABSTRACT>" >> $(DISTNAME).ppd $(NOECHO) $(ECHO) " <AUTHOR>Robert May <rob...@us...></AUTHOR>" >> $(DISTNAME).ppd $(NOECHO) $(ECHO) " <IMPLEMENTATION>" >> $(DISTNAME).ppd $(NOECHO) $(ECHO) " <OS NAME=\"$(OSNAME)\" />" >> $(DISTNAME).ppd $(NOECHO) $(ECHO) " <ARCHITECTURE NAME=\"MSWin32-x86-multi-thread-5.8\" />" >> $(DISTNAME).ppd $(NOECHO) $(ECHO) " <CODEBASE HREF=\"\" />" >> $(DISTNAME).ppd $(NOECHO) $(ECHO) " </IMPLEMENTATION>" >> $(DISTNAME).ppd $(NOECHO) $(ECHO) "</SOFTPKG>" >> $(DISTNAME).ppd # --- MakeMaker pm_to_blib section: pm_to_blib: $(TO_INST_PM) $(NOECHO) $(PERLRUN) -MExtUtils::Install -e "pm_to_blib({@ARGV}, '$(INST_LIB)\auto', '$(PM_FILTER)')"\ DropFiles.pm $(INST_LIB)\Win32\GUI\DropFiles.pm $(NOECHO) $(TOUCH) $@ # --- MakeMaker selfdocument section: # --- MakeMaker postamble section: .rc.res: $(RC) $(RCFLAGS) $< pure_all :: demo_to_blib $(NOECHO) $(NOOP) demo_to_blib: $(DEMOS) $(NOECHO) $(MKPATH) $(INST_DEMODIR) $(CP) $? $(INST_DEMODIR) $(NOECHO) $(TOUCH) demo_to_blib clean :: -$(RM_F) demo_to_blib # End. --- NEW FILE: ppport.h --- #if 0 <<'SKIP'; #endif /* ---------------------------------------------------------------------- ppport.h -- Perl/Pollution/Portability Version 3.06 Automatically created by Devel::PPPort running under perl 5.008007 on Fri Mar 17 15:01:07 2006. Do NOT edit this file directly! -- Edit PPPort_pm.PL and the includes in parts/inc/ instead. Use 'perldoc ppport.h' to view the documentation below. ---------------------------------------------------------------------- SKIP [...4855 lines suppressed...] #ifdef NO_XSLOCKS # ifdef dJMPENV # define dXCPT dJMPENV; int rEtV = 0 # define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0) # define XCPT_TRY_END JMPENV_POP; # define XCPT_CATCH if (rEtV != 0) # define XCPT_RETHROW JMPENV_JUMP(rEtV) # else # define dXCPT Sigjmp_buf oldTOP; int rEtV = 0 # define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0) # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf); # define XCPT_CATCH if (rEtV != 0) # define XCPT_RETHROW Siglongjmp(top_env, rEtV) # endif #endif #endif /* _P_P_PORTABILITY_H_ */ /* End of File ppport.h */ --- NEW FILE: README --- Win32-GUI-DropFiles =================== Win32::GUI::DropFiles provides integration with the windows shell for Win32::GUI applications, allowing retrieval of the filenames of files dragged from the shell (e.g. explorer) to the application window. INSTALLATION - from source As a source distribution this module is bundled with Win32::GUI, and will be built while makeing Win32::GUI itself. It is possible to build and install this module stand alone: perl Makefile.PL make make test make install INSTALLATION - binary distribution This module will be distributed in binary form (ActiveState PPM) as part of the Win32::GUI module. See the Win32-GUI module README for further details. DEPENDENCIES This module requires these other modules and libraries: perl 5.6.0 or higher (5.8.6 or higher recommended) Win32::GUI 1.04 or higher To fully test this module the following modules and libraries are required. Some tests will be skipped if these modules are not available: Win32::API 0.41 or higher Test::Pod 1.14 or higher Test::Pod::Coverage 1.04 or higher Unicode::String COPYRIGHT AND LICENCE Copyright (C) 2006 by Robert May This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. ---------------------------------------------------------------------- $Id: README,v 1.1 2006/04/25 21:38:18 robertemay Exp $ --- NEW FILE: TYPEMAP --- # $Id: TYPEMAP,v 1.1 2006/04/25 21:38:18 robertemay Exp $ # TYPEMAP for Win32::GUI::DropFiles TYPEMAP HDROP T_HANDLE BOOL T_UV ################################################################################ INPUT T_HANDLE if(SvROK($arg)) { SV** out=hv_fetch((HV*)SvRV($arg), \"-handle\", 7, 0); if(out != NULL) $var = INT2PTR($type,SvIV(*out)); else $var = NULL; } else $var = INT2PTR($type,SvIV($arg)); ################################################################################ OUTPUT |
From: Robert M. <rob...@us...> - 2006-04-25 21:29:45
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28229/demos Log Message: Directory /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/demos added to the repository |
From: Robert M. <rob...@us...> - 2006-04-25 21:29:33
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28112/t Log Message: Directory /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/t added to the repository |
From: Robert M. <rob...@us...> - 2006-04-25 21:27:08
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26065/Win32-GUI-DropFiles Log Message: Directory /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles added to the repository |
From: Robert M. <rob...@us...> - 2006-04-25 21:24:59
|
Update of /cvsroot/perl-win32-gui/Win32-GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24444 Modified Files: CHANGELOG Makefile.PL RichEdit.xs Log Message: Fix build under cygwin Index: RichEdit.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/RichEdit.xs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RichEdit.xs 11 Jan 2006 21:26:16 -0000 1.7 --- RichEdit.xs 25 Apr 2006 21:24:52 -0000 1.8 *************** *** 294,298 **** EXTEND(SP, 2); XST_mPV(si++, "-bold"); ! XST_mIV(si++, cf.dwEffects & CFE_BOLD > 0); } if(dwMask & CFM_COLOR) { --- 294,298 ---- EXTEND(SP, 2); XST_mPV(si++, "-bold"); ! XST_mIV(si++, (cf.dwEffects & CFE_BOLD) ? 1 : 0); } if(dwMask & CFM_COLOR) { *************** *** 309,313 **** EXTEND(SP, 2); XST_mPV(si++, "-italic"); ! XST_mIV(si++, cf.dwEffects & CFE_ITALIC > 0); } if(dwMask & CFM_SIZE) { --- 309,313 ---- EXTEND(SP, 2); XST_mPV(si++, "-italic"); ! XST_mIV(si++, (cf.dwEffects & CFE_ITALIC) ? 1 : 0); } if(dwMask & CFM_SIZE) { *************** *** 319,328 **** EXTEND(SP, 2); XST_mPV(si++, "-strikeout"); ! XST_mIV(si++, cf.dwEffects & CFE_STRIKEOUT > 0); } if(dwMask & CFM_UNDERLINE) { EXTEND(SP, 2); XST_mPV(si++, "-underline"); ! XST_mIV(si++, cf.dwEffects & CFE_UNDERLINE > 0); } XSRETURN(si); --- 319,328 ---- EXTEND(SP, 2); XST_mPV(si++, "-strikeout"); ! XST_mIV(si++, (cf.dwEffects & CFE_STRIKEOUT) ? 1 : 0); } if(dwMask & CFM_UNDERLINE) { EXTEND(SP, 2); XST_mPV(si++, "-underline"); ! XST_mIV(si++, (cf.dwEffects & CFE_UNDERLINE) ? 1 : 0); } XSRETURN(si); Index: Makefile.PL =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Makefile.PL,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Makefile.PL 13 Apr 2006 22:17:07 -0000 1.19 --- Makefile.PL 25 Apr 2006 21:24:52 -0000 1.20 *************** *** 3,7 **** use File::Spec(); ! use ExtUtils::MakeMaker; use Config; --- 3,10 ---- use File::Spec(); ! # Bug in ExUtils::MakeMaker 5.45 that ships with ActiveState Perl ! # 5.6.1, writes the subdirs target with dmake syntax, that breaks ! # nmake. Fixed in EU::MM 5.47 ! use ExtUtils::MakeMaker 5.47; use Config; *************** *** 203,207 **** NAME => 'Win32::GUI', VERSION_FROM => 'GUI.pm', ! LIBS => [':nosearch -lcomctl32 -lcomdlg32 -lshell32 -lgdi32 -luser32'], PREREQ_PM => { 'Test::More' => 0, --- 206,210 ---- NAME => 'Win32::GUI', VERSION_FROM => 'GUI.pm', ! LIBS => [':nosearch -lcomctl32 -lcomdlg32 -lshell32 -lgdi32 -luser32 -lversion'], PREREQ_PM => { 'Test::More' => 0, *************** *** 243,247 **** if ($main::BUILDENV eq "cygwin") { ! $MakefileArgs{'LIBS'} = ['-L/usr/lib/w32api -lcomctl32 -lcomdlg32 -lshell32 -lgdi32 -luser32']; $MakefileArgs{'DEFINE'} = '-UWIN32'; $MakefileArgs{'MYEXTLIB'} = './libcyg.a'; --- 246,250 ---- if ($main::BUILDENV eq "cygwin") { ! $MakefileArgs{'LIBS'} = ['-L/usr/lib/w32api -lcomctl32 -lcomdlg32 -lshell32 -lgdi32 -luser32 -lversion']; $MakefileArgs{'DEFINE'} = '-UWIN32'; $MakefileArgs{'MYEXTLIB'} = './libcyg.a'; *************** *** 259,263 **** sub pasthru { my $inherited = shift->SUPER::pasthru(@_); ! return "$inherited W32G_CORE=1"; } --- 262,268 ---- sub pasthru { my $inherited = shift->SUPER::pasthru(@_); ! chomp $inherited; ! $inherited .= "\\\n\tW32G_CORE=1"; ! return $inherited; } Index: CHANGELOG =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** CHANGELOG 20 Apr 2006 22:20:20 -0000 1.79 --- CHANGELOG 25 Apr 2006 21:24:51 -0000 1.80 *************** *** 6,9 **** --- 6,14 ---- Win32-GUI ChangeLog =================== + + [Robert May] : 25 Apr 2006 - Fix build under cygwin/MSVC7 + - RichEdit.xs fix precedence warning under VC7 + - Makefile.PL fix LIBS under cygwin (add -lversion); fix + pasthru target under cygwin + + [Robert May] : 20 Apr 2006 - Fix build under MinGW - GUI.xs correct typo in type definition (LPCTSTR vs LPTSTR); |
From: Robert M. <rob...@us...> - 2006-04-20 22:20:26
|
Update of /cvsroot/perl-win32-gui/Win32-GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25185 Modified Files: CHANGELOG GUI.xs Log Message: Fix MinGW build errors and warnings Index: GUI.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.xs,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** GUI.xs 14 Apr 2006 01:52:25 -0000 1.55 --- GUI.xs 20 Apr 2006 22:20:20 -0000 1.56 *************** *** 5586,5595 **** void GetDllVersion(filename) ! LPCTSTR filename PREINIT: HINSTANCE hinstDll; ! DWORD major = -1; ! DWORD minor = -1; ! DWORD build = -1; PPCODE: hinstDll = LoadLibrary(filename); --- 5586,5595 ---- void GetDllVersion(filename) ! LPTSTR filename PREINIT: HINSTANCE hinstDll; ! DWORD major = 0xFFFFFFFF; ! DWORD minor = 0xFFFFFFFF; ! DWORD build = 0xFFFFFFFF; PPCODE: hinstDll = LoadLibrary(filename); *************** *** 5618,5622 **** } ! if(major == -1) { DWORD size; DWORD handle; --- 5618,5622 ---- } ! if(major == 0xFFFFFFFF) { DWORD size; DWORD handle; *************** *** 5642,5646 **** } ! if(major == -1) { XSRETURN_UNDEF; } --- 5642,5646 ---- } ! if(major == 0xFFFFFFFF) { XSRETURN_UNDEF; } Index: CHANGELOG =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** CHANGELOG 14 Apr 2006 01:52:25 -0000 1.78 --- CHANGELOG 20 Apr 2006 22:20:20 -0000 1.79 *************** *** 6,9 **** --- 6,14 ---- Win32-GUI ChangeLog =================== + + [Robert May] : 20 Apr 2006 - Fix build under MinGW + - GUI.xs correct typo in type definition (LPCTSTR vs LPTSTR); + use 0xFFFFFFFF instead of -1 to avoid gcc warning when assigning + to UINT. + + [Robert May] : 14 Apr 2006 - Fix build/test on Perl 5.6.1 - GUI.h GUI.xs add GetDllVersion call to replace use of |
From: Robert M. <rob...@us...> - 2006-04-14 01:52:33
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28625/samples Modified Files: NotifyIcon.pl Log Message: Fix build/test on Perl 5.6.1 Index: NotifyIcon.pl =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/samples/NotifyIcon.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NotifyIcon.pl 11 Jan 2006 21:26:16 -0000 1.1 --- NotifyIcon.pl 14 Apr 2006 01:52:28 -0000 1.2 *************** *** 18,22 **** use warnings; ! use Win32; use Win32::GUI 1.03_02, qw(MB_OK MB_ICONHAND ES_WANTRETURN WS_CLIPCHILDREN WS_EX_TOPMOST); use Win32::GUI::BitmapInline(); --- 18,22 ---- use warnings; ! use Win32(); use Win32::GUI 1.03_02, qw(MB_OK MB_ICONHAND ES_WANTRETURN WS_CLIPCHILDREN WS_EX_TOPMOST); use Win32::GUI::BitmapInline(); *************** *** 52,56 **** icon => undef, ni => undef, ! v5 => ($Win32::GUI::NotifyIcon::SHELLDLL_VERSION >= 5), events => [], max_events => 100, --- 52,56 ---- icon => undef, ni => undef, ! 'v5' => ($Win32::GUI::NotifyIcon::SHELLDLL_VERSION >= 5), events => [], max_events => 100, *************** *** 129,133 **** $mw->AddLabel( ! -text => "shell32.dll\t\t" . Win32::GetFileVersion("shell32"), -left => $col1_ctrl_left, -top => $row1_gb_top + (4 * $padding), --- 129,133 ---- $mw->AddLabel( ! -text => "shell32.dll\t\t" . Win32::GUI::GetDllVersion("shell32"), -left => $col1_ctrl_left, -top => $row1_gb_top + (4 * $padding), *************** *** 401,404 **** --- 401,405 ---- Win32::GUI::Dialog(); $mw->Hide(); + undef $mw; exit(0); *************** *** 574,586 **** } ! { ! my $text=''; ! for my $e (@{$cfg{events}}) { ! $text .= "$e\r\n"; ! } ! ! $win->ETF->SetSel(0,-1); ! $win->ETF->ReplaceSel($text); ! } return; --- 575,580 ---- } ! $win->ETF->SetSel(0,-1); ! $win->ETF->ReplaceSel(join("\r\n", @{$cfg{events}})); return; |
From: Robert M. <rob...@us...> - 2006-04-14 01:52:31
|
Update of /cvsroot/perl-win32-gui/Win32-GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28625 Modified Files: CHANGELOG GUI.h GUI.pm GUI.xs Log Message: Fix build/test on Perl 5.6.1 Index: GUI.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.xs,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** GUI.xs 13 Apr 2006 22:17:07 -0000 1.54 --- GUI.xs 14 Apr 2006 01:52:25 -0000 1.55 *************** *** 5577,5580 **** --- 5577,5665 ---- RETVAL + + ########################################################################### + # (@)INTERNAL:GetDllVersion(DLLNAME) + # Replacement for Win32::GetFileVersion, which doesn't exist in perl 5.6 or + # cygwin perl 5.8 + # In scalar contect returns dotted string of dll version + # In list context returns major version, minor version, build + void + GetDllVersion(filename) + LPCTSTR filename + PREINIT: + HINSTANCE hinstDll; + DWORD major = -1; + DWORD minor = -1; + DWORD build = -1; + PPCODE: + hinstDll = LoadLibrary(filename); + + if(hinstDll) { + DLLGETVERSIONPROC pDllGetVersion; + pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hinstDll,"DllGetVersion"); + + if(pDllGetVersion) { + DLLVERSIONINFO dvi; + HRESULT hr; + + ZeroMemory(&dvi, sizeof(dvi)); + dvi.cbSize = sizeof(dvi); + + hr = (*pDllGetVersion)(&dvi); + + if(SUCCEEDED(hr)) { + major = dvi.dwMajorVersion; + minor = dvi.dwMinorVersion; + build = dvi.dwBuildNumber; + } + } + + FreeLibrary(hinstDll); + } + + if(major == -1) { + DWORD size; + DWORD handle; + char *data; + + size = GetFileVersionInfoSize(filename, &handle); + if(size) { + New(0, data, size, char); + if(data) { + if(GetFileVersionInfo(filename, handle, size, data)) { + VS_FIXEDFILEINFO *info; + UINT len; + if(VerQueryValue(data, "\\", (void**)&info, &len)) { + major = (info->dwFileVersionMS>>16); + minor = (info->dwFileVersionMS&0xffff); + build = (info->dwFileVersionLS>>16); + } + } + + Safefree(data); + } + } + } + + if(major == -1) { + XSRETURN_UNDEF; + } + + if (GIMME_V == G_ARRAY) { + EXTEND(SP, 3); + XST_mIV(0, major); + XST_mIV(1, minor); + XST_mIV(2, build); + items = 3; + } + else { + char version[50]; + sprintf(version, "%d.%d.%d", major, minor, build); + XST_mPV(0, version); + items = 1; + } + XSRETURN(items); + + ########################################################################### # (@)PACKAGE:Win32::GUI::Menu Index: GUI.h =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** GUI.h 16 Mar 2006 21:11:11 -0000 1.27 --- GUI.h 14 Apr 2006 01:52:25 -0000 1.28 *************** *** 18,21 **** --- 18,22 ---- #include <richedit.h> #include <shellapi.h> + #include <shlwapi.h> #include <shlobj.h> Index: GUI.pm =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.pm,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** GUI.pm 12 Apr 2006 20:00:05 -0000 1.40 --- GUI.pm 14 Apr 2006 01:52:25 -0000 1.41 *************** *** 469,472 **** --- 469,474 ---- } + bootstrap Win32::GUI; + ############################################################################### # PUBLIC METHODS *************** *** 2785,2793 **** # has been loaded. package Win32::GUI::NotifyIcon; ! use Win32(); ! our $SHELLDLL_VERSION; ! BEGIN { ! $SHELLDLL_VERSION = (Win32::GetFileVersion('shell32'))[0]; ! } ########################################################################### --- 2787,2791 ---- # has been loaded. package Win32::GUI::NotifyIcon; ! our $SHELLDLL_VERSION = (Win32::GUI::GetDllVersion('shell32'))[0]; ########################################################################### *************** *** 3559,3563 **** package Win32::GUI; ! bootstrap Win32::GUI; bootstrap_subpackage 'Animation'; --- 3557,3563 ---- package Win32::GUI; ! # Need to bootstrap Win32::GUI early, so that we can call ! # Win32::GUI::GetDllVersion during use/compile time ! #bootstrap Win32::GUI; bootstrap_subpackage 'Animation'; Index: CHANGELOG =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** CHANGELOG 13 Apr 2006 22:17:07 -0000 1.77 --- CHANGELOG 14 Apr 2006 01:52:25 -0000 1.78 *************** *** 6,9 **** --- 6,21 ---- Win32-GUI ChangeLog =================== + + [Robert May] : 14 Apr 2006 - Fix build/test on Perl 5.6.1 + - GUI.h GUI.xs add GetDllVersion call to replace use of + Win32::GetFileVersion that is not available in perl 5.6 (or + cygwin perl 5.8) + - GUI.pm Change use of Win32::GetFileVersion to + Win32::GUI::GetDllVersion. Change position of bootstrap for + Win32::GUI so that we can call Win32::GUI::GetDllVersion + - t/05_NotifyIcon_01_Constructor.t add test to ensure that + $Win32::GUI::NotifyIcon::SHELLDLL_VERSION is set + - samples/NotifyIcon.pl Use new Win32::GUI::GetDllVersion and + a couple of minor bug-fixes under perl 5.6 + + [Robert May] : 13 Apr 2006 - Clean build under Cygwin - TYPEMAP corrected various entries to use INT2PTR and PTR2INT |
From: Robert M. <rob...@us...> - 2006-04-14 01:52:31
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28625/t Modified Files: 05_NotifyIcon_01_Constructor.t Log Message: Fix build/test on Perl 5.6.1 Index: 05_NotifyIcon_01_Constructor.t =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/t/05_NotifyIcon_01_Constructor.t,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 05_NotifyIcon_01_Constructor.t 11 Jan 2006 21:26:16 -0000 1.1 --- 05_NotifyIcon_01_Constructor.t 14 Apr 2006 01:52:29 -0000 1.2 *************** *** 10,18 **** BEGIN { $| = 1 } # Autoflush ! use Test::More tests => 15; use Win32::GUI(); use Win32::GUI::BitmapInline(); my $icon = geticon(); --- 10,21 ---- BEGIN { $| = 1 } # Autoflush ! use Test::More tests => 16; use Win32::GUI(); use Win32::GUI::BitmapInline(); + # Test that $Win32::GUI::NotifyIcon::SHELLDLL_VERSION is set + ok(defined $Win32::GUI::NotifyIcon::SHELLDLL_VERSION, "SHELLDLL is set"); + my $icon = geticon(); |
From: Robert M. <rob...@us...> - 2006-04-13 22:17:14
|
Update of /cvsroot/perl-win32-gui/Win32-GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1621 Modified Files: CHANGELOG DC.xs GUI.xs GUI_Helpers.cpp GUI_Options.cpp Makefile.PL TYPEMAP TreeView.xs Log Message: Clean build under Cygwin Index: GUI.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.xs,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** GUI.xs 12 Apr 2006 19:49:21 -0000 1.53 --- GUI.xs 13 Apr 2006 22:17:07 -0000 1.54 *************** *** 478,482 **** if(strcmp(option, "-instance") == 0) { next_i = i + 1; ! hInstance = (HINSTANCE) SvIV(ST(next_i)); } if(strcmp(option, "-data") == 0) { --- 478,482 ---- if(strcmp(option, "-instance") == 0) { next_i = i + 1; ! hInstance = INT2PTR(HINSTANCE,SvIV(ST(next_i))); } if(strcmp(option, "-data") == 0) { *************** *** 705,709 **** t = hv_fetch_mg(NOTXSCALL perlcs.hvParent, "-tooltip", 8, 0); if(t != NULL && SvOK( *t )) { ! perlcs.hTooltip = (HWND) SvIV(*t); } } --- 705,709 ---- t = hv_fetch_mg(NOTXSCALL perlcs.hvParent, "-tooltip", 8, 0); if(t != NULL && SvOK( *t )) { ! perlcs.hTooltip = INT2PTR(HWND,SvIV(*t)); } } *************** *** 1434,1440 **** --- 1434,1443 ---- bitmap = (HBITMAP) LoadImage((HINSTANCE) moduleHandle, filename, iType, iX, iY, LR_DEFAULTCOLOR); // Try OEM ressource + /* Can't use filename (a string pointer) as a resource id - should be able to use + * a filename like '#1' to get resource from EXE - TODO: test this if(bitmap == NULL) { bitmap = (HBITMAP) LoadImage((HINSTANCE) NULL, MAKEINTRESOURCE(filename), iType, iX, iY, LR_DEFAULTCOLOR); } + */ if(bitmap == NULL) { // Ok, that failed. So attempt to load from file: *************** *** 3695,3699 **** RETVAL = -1; } else { ! hdc = (HDC) SvIV(*tmp); if(hmeta = GetEnhMetaFile(filename)) { GetClientRect(handle, &rect); --- 3698,3702 ---- RETVAL = -1; } else { ! hdc = INT2PTR(HDC,SvIV(*tmp)); if(hmeta = GetEnhMetaFile(filename)) { GetClientRect(handle, &rect); *************** *** 3779,3783 **** RETVAL = 0; } else { ! hdc = (HDC) SvIV(*tmp); iWidthMM = GetDeviceCaps(hdc, HORZSIZE); iHeightMM = GetDeviceCaps(hdc, VERTSIZE); --- 3782,3786 ---- RETVAL = 0; } else { ! hdc = INT2PTR(HDC,SvIV(*tmp)); iWidthMM = GetDeviceCaps(hdc, HORZSIZE); iHeightMM = GetDeviceCaps(hdc, VERTSIZE); *************** *** 3921,3925 **** RETVAL = -1; } else { ! hdc = (HDC) SvIV(*tmp); textlen = strlen(text); RETVAL = (long) TextOut(hdc, x, y, text, textlen); --- 3924,3928 ---- RETVAL = -1; } else { ! hdc = INT2PTR(HDC,SvIV(*tmp)); textlen = strlen(text); RETVAL = (long) TextOut(hdc, x, y, text, textlen); *************** *** 3942,3946 **** RETVAL = -1; } else { ! hdc = (HDC) SvIV(*tmp); RETVAL = SetTextColor(hdc, color); } --- 3945,3949 ---- RETVAL = -1; } else { ! hdc = INT2PTR(HDC,SvIV(*tmp)); RETVAL = SetTextColor(hdc, color); } *************** *** 3961,3965 **** RETVAL = -1; } else { ! hdc = (HDC) SvIV(*tmp); RETVAL = GetTextColor(hdc); } --- 3964,3968 ---- RETVAL = -1; } else { ! hdc = INT2PTR(HDC,SvIV(*tmp)); RETVAL = GetTextColor(hdc); } *************** *** 3981,3985 **** RETVAL = -1; } else { ! hdc = (HDC) SvIV(*tmp); RETVAL = (long) SetBkMode(hdc, mode); } --- 3984,3988 ---- RETVAL = -1; } else { ! hdc = INT2PTR(HDC,SvIV(*tmp)); RETVAL = (long) SetBkMode(hdc, mode); } *************** *** 4000,4004 **** RETVAL = -1; } else { ! hdc = (HDC) SvIV(*tmp); RETVAL = GetBkMode(hdc); } --- 4003,4007 ---- RETVAL = -1; } else { ! hdc = INT2PTR(HDC,SvIV(*tmp)); RETVAL = GetBkMode(hdc); } *************** *** 4021,4025 **** RETVAL = -1; } else { ! hdc = (HDC) SvIV(*tmp); RETVAL = MoveToEx(hdc, x, y, NULL); } --- 4024,4028 ---- RETVAL = -1; } else { ! hdc = INT2PTR(HDC,SvIV(*tmp)); RETVAL = MoveToEx(hdc, x, y, NULL); } *************** *** 4044,4048 **** RETVAL = -1; } else { ! hdc = (HDC) SvIV(*tmp); if(height == -1) { width *= 2; --- 4047,4051 ---- RETVAL = -1; } else { ! hdc = INT2PTR(HDC,SvIV(*tmp)); if(height == -1) { width *= 2; *************** *** 4070,4074 **** RETVAL = -1; } else { ! hdc = (HDC) SvIV(*tmp); RETVAL = LineTo(hdc, x, y); } --- 4073,4077 ---- RETVAL = -1; } else { ! hdc = INT2PTR(HDC,SvIV(*tmp)); RETVAL = LineTo(hdc, x, y); } *************** *** 4108,4112 **** char tmprgb[16]; self = (HV*) SvRV(ST(0)); ! hwnd = (HWND) SvIV(*hv_fetch(self, "-handle", 7, 0)); if(hwnd) { if(hdc = BeginPaint(hwnd, &ps)) { --- 4111,4115 ---- char tmprgb[16]; self = (HV*) SvRV(ST(0)); ! hwnd = INT2PTR(HWND,SvIV(*hv_fetch(self, "-handle", 7, 0))); if(hwnd) { if(hdc = BeginPaint(hwnd, &ps)) { *************** *** 4147,4154 **** tmp = hv_fetch(self, "-handle", 7, 0); if(tmp == NULL) XSRETURN_NO; ! hwnd = (HWND) SvIV(*tmp); tmp = hv_fetch(self, "-ps.hdc", 7, 0); if(tmp == NULL) XSRETURN_NO; ! ps.hdc = (HDC) SvIV(*tmp); tmp = hv_fetch(self, "-ps.fErase", 10, 0); if(tmp == NULL) XSRETURN_NO; --- 4150,4157 ---- tmp = hv_fetch(self, "-handle", 7, 0); if(tmp == NULL) XSRETURN_NO; ! hwnd = INT2PTR(HWND,SvIV(*tmp)); tmp = hv_fetch(self, "-ps.hdc", 7, 0); if(tmp == NULL) XSRETURN_NO; ! ps.hdc = INT2PTR(HDC,SvIV(*tmp)); tmp = hv_fetch(self, "-ps.fErase", 10, 0); if(tmp == NULL) XSRETURN_NO; *************** *** 5083,5087 **** next_i = i + 1; if(SvIOK(ST(next_i))) { ! bi.pidlRoot = (LPCITEMIDLIST) SvIV(ST(next_i)); } else { SHGetDesktopFolder(&pDesktopFolder); --- 5086,5090 ---- next_i = i + 1; if(SvIOK(ST(next_i))) { ! bi.pidlRoot = INT2PTR(LPCITEMIDLIST,SvIV(ST(next_i))); } else { SHGetDesktopFolder(&pDesktopFolder); *************** *** 5682,5686 **** parentmenu = hv_fetch((HV*)SvRV((ST(0))), "-menu", 5, 0); if(parentmenu != NULL) { ! hMenu = (HMENU) SvIV(*parentmenu); myItem = SvIV(*(hv_fetch((HV*)SvRV(ST(0)), "-id", 3, 0))); } else { --- 5685,5689 ---- parentmenu = hv_fetch((HV*)SvRV((ST(0))), "-menu", 5, 0); if(parentmenu != NULL) { ! hMenu = INT2PTR(HMENU,SvIV(*parentmenu)); myItem = SvIV(*(hv_fetch((HV*)SvRV(ST(0)), "-id", 3, 0))); } else { *************** *** 5724,5728 **** parentmenu = hv_fetch((HV*)SvRV((ST(0))), "-menu", 5, 0); if(parentmenu != NULL) { ! hMenu = (HMENU) SvIV(*parentmenu); myItem = SvIV(*(hv_fetch((HV*)SvRV(ST(0)), "-id", 3, 0))); i = 1; --- 5727,5731 ---- parentmenu = hv_fetch((HV*)SvRV((ST(0))), "-menu", 5, 0); if(parentmenu != NULL) { ! hMenu = INT2PTR(HMENU,SvIV(*parentmenu)); myItem = SvIV(*(hv_fetch((HV*)SvRV(ST(0)), "-id", 3, 0))); i = 1; *************** *** 5771,5775 **** parentmenu = hv_fetch((HV*)SvRV((ST(0))), "-menu", 5, 0); if(parentmenu != NULL) { ! hMenu = (HMENU) SvIV(*parentmenu); myItem = SvIV(*(hv_fetch((HV*)SvRV(ST(0)), "-id", 3, 0))); i = 1; --- 5774,5778 ---- parentmenu = hv_fetch((HV*)SvRV((ST(0))), "-menu", 5, 0); if(parentmenu != NULL) { ! hMenu = INT2PTR(HMENU,SvIV(*parentmenu)); myItem = SvIV(*(hv_fetch((HV*)SvRV(ST(0)), "-id", 3, 0))); i = 1; Index: Makefile.PL =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Makefile.PL,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Makefile.PL 12 Apr 2006 20:00:06 -0000 1.18 --- Makefile.PL 13 Apr 2006 22:17:07 -0000 1.19 *************** *** 375,378 **** --- 375,382 ---- $(NOECHO) $(PERL) -I$(BUILD_TOOLS) $(BUILD_TOOLS)/doHTMLDocs.pl + demos: + $(MKPATH) $(INST_DEMO) + -$(CP) samples/* $(INST_DEMO) + all:: poddocs demos *************** *** 387,394 **** # -- Win32::GUI ppm section -- - demos: - $(MKPATH) $(INST_DEMO) - $(CP) samples/* $(INST_DEMO) - ppmdist: all htmldocs $(TAR) --exclude="*.pod" -$(TARFLAGS) $(DISTNAME).tar blib --- 391,394 ---- Index: CHANGELOG =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** CHANGELOG 12 Apr 2006 20:00:05 -0000 1.76 --- CHANGELOG 13 Apr 2006 22:17:07 -0000 1.77 *************** *** 6,9 **** --- 6,19 ---- Win32-GUI ChangeLog =================== + + [Robert May] : 13 Apr 2006 - Clean build under Cygwin + - TYPEMAP corrected various entries to use INT2PTR and PTR2INT + macros to eliminate warnings of casting to/from pointers with + different sizes. + - DC.xs, GUI.xs, GUI_Helpers.cpp, GUI_Options.cpp, TreeView.xs + used INT2PTR and PTR2INT wherever necessary to silence + compiler warnings. + - Makefile.PL corrected location of demos target, so that demos + are installed under cygwin + + [Robert May] : 12 Apr 2006 - Start of DropFiles integration - GUI.pm Add Acceptfiles method and documentation. Index: GUI_Helpers.cpp =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_Helpers.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** GUI_Helpers.cpp 16 Mar 2006 21:11:11 -0000 1.17 --- GUI_Helpers.cpp 13 Apr 2006 22:17:07 -0000 1.18 *************** *** 166,173 **** pHv = hv_fetch_mg(NOTXSCALL (HV*) SvRV(pSv), "-handle", 7, 0); if(pHv != NULL) { ! hReturn = (HWND) SvIV(*pHv); } } else { ! hReturn = (HWND) SvIV(pSv); } } --- 166,173 ---- pHv = hv_fetch_mg(NOTXSCALL (HV*) SvRV(pSv), "-handle", 7, 0); if(pHv != NULL) { ! hReturn = INT2PTR(HWND,SvIV(*pHv)); } } else { ! hReturn = INT2PTR(HWND,SvIV(pSv)); } } *************** *** 210,214 **** wndproc = hv_fetch_mg(NOTXSCALL hash, (char*) Name, strlen(Name), FALSE); if(wndproc == NULL) return NULL; ! return (WNDPROC) SvIV(*wndproc); } --- 210,214 ---- wndproc = hv_fetch_mg(NOTXSCALL hash, (char*) Name, strlen(Name), FALSE); if(wndproc == NULL) return NULL; ! return INT2PTR(WNDPROC,SvIV(*wndproc)); } *************** *** 294,298 **** t = hv_fetch_mg(NOTXSCALL parent, "-handle", 7, 0); if(t != NULL) { ! hParent = (HWND) SvIV(*t); } else { return NULL; --- 294,298 ---- t = hv_fetch_mg(NOTXSCALL parent, "-handle", 7, 0); if(t != NULL) { ! hParent = INT2PTR(HWND,SvIV(*t)); } else { return NULL; *************** *** 431,435 **** handle = hv_fetch(hash, temp, strlen(temp), FALSE); if(handle == NULL) return NULL; ! return (HMENU) SvIV(*handle); } --- 431,435 ---- handle = hv_fetch(hash, temp, strlen(temp), FALSE); if(handle == NULL) return NULL; ! return INT2PTR(HMENU,SvIV(*handle)); } Index: TreeView.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/TreeView.xs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TreeView.xs 16 Mar 2006 21:11:12 -0000 1.7 --- TreeView.xs 13 Apr 2006 22:17:07 -0000 1.8 *************** *** 1101,1105 **** else RETVAL = TreeView_Expand(handle, ! (HTREEITEM) SvIV(ST(1)), TVE_COLLAPSE | TVE_COLLAPSERESET); OUTPUT: --- 1101,1105 ---- else RETVAL = TreeView_Expand(handle, ! INT2PTR(HTREEITEM,SvIV(ST(1))), TVE_COLLAPSE | TVE_COLLAPSERESET); OUTPUT: Index: GUI_Options.cpp =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_Options.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GUI_Options.cpp 12 Apr 2006 20:00:06 -0000 1.13 --- GUI_Options.cpp 13 Apr 2006 22:17:07 -0000 1.14 *************** *** 181,185 **** } else if(strcmp(option, "-instance") == 0) { next_i = i + 1; ! perlcs->cs.hInstance = (HINSTANCE) SvIV(ST(next_i)); } else if(strcmp(option, "-name") == 0) { next_i = i + 1; --- 181,185 ---- } else if(strcmp(option, "-instance") == 0) { next_i = i + 1; ! perlcs->cs.hInstance = INT2PTR(HINSTANCE,SvIV(ST(next_i))); } else if(strcmp(option, "-name") == 0) { next_i = i + 1; *************** *** 760,764 **** } else if(strcmp(option, "-hinst") == 0) { next_i = i + 1; ! ti->hinst = (HINSTANCE) SvIV(ST(next_i)); } else if(strcmp(option, "-flags") == 0) { next_i = i + 1; --- 760,764 ---- } else if(strcmp(option, "-hinst") == 0) { next_i = i + 1; ! ti->hinst = INT2PTR(HINSTANCE,SvIV(ST(next_i))); } else if(strcmp(option, "-flags") == 0) { next_i = i + 1; Index: TYPEMAP =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/TYPEMAP,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TYPEMAP 16 Mar 2006 21:11:12 -0000 1.7 --- TYPEMAP 13 Apr 2006 22:17:07 -0000 1.8 *************** *** 13,17 **** HPEN T_HANDLE HRGN T_HANDLE ! HTREEITEM T_IV LONG T_IV LPCTSTR T_PV --- 13,17 ---- HPEN T_HANDLE HRGN T_HANDLE ! HTREEITEM T_PTR LONG T_IV LPCTSTR T_PV *************** *** 23,33 **** LPARAM T_LPARAM LRESULT T_IV ! HINSTANCE T_IV COLORREF T_COLOR LPCSTR T_PV ! HENHMETAFILE T_IV FLOAT T_FLOAT LPVOID T_PV ! HACCEL T_IV ################################################################################ --- 23,33 ---- LPARAM T_LPARAM LRESULT T_IV ! HINSTANCE T_PTR COLORREF T_COLOR LPCSTR T_PV ! HENHMETAFILE T_PTR FLOAT T_FLOAT LPVOID T_PV ! HACCEL T_PTR ################################################################################ *************** *** 37,45 **** SV** out=hv_fetch((HV*)SvRV($arg), \"-handle\", 7, 0); if(out != NULL) ! $var = ($type) SvIV(*out); else $var = NULL; } else ! $var = ($type) SvIV($arg); T_COLOR --- 37,45 ---- SV** out=hv_fetch((HV*)SvRV($arg), \"-handle\", 7, 0); if(out != NULL) ! $var = INT2PTR($type,SvIV(*out)); else $var = NULL; } else ! $var = INT2PTR($type,SvIV($arg)); T_COLOR *************** *** 53,57 **** OUTPUT T_HANDLE ! sv_setiv($arg, (IV) $var); T_COLOR sv_setiv($arg, (IV) $var); --- 53,57 ---- OUTPUT T_HANDLE ! sv_setiv($arg, PTR2IV($var)); T_COLOR sv_setiv($arg, (IV) $var); Index: DC.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/DC.xs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** DC.xs 25 Aug 2005 19:30:17 -0000 1.12 --- DC.xs 13 Apr 2006 22:17:07 -0000 1.13 *************** *** 949,953 **** window = hv_fetch_mg(NOTXSCALL self, "-window", 7, 0); if(window != NULL) { ! hwnd = (HWND) SvIV(*window); } else { XSRETURN_UNDEF; --- 949,953 ---- window = hv_fetch_mg(NOTXSCALL self, "-window", 7, 0); if(window != NULL) { ! hwnd = INT2PTR(HWND,SvIV(*window)); } else { XSRETURN_UNDEF; *************** *** 1003,1007 **** window = hv_fetch_mg(NOTXSCALL self, szKey, strlen(szKey), 0); if(window != NULL) { ! hwnd = (HWND) SvIV(*window); } else { XSRETURN_NO; --- 1003,1007 ---- window = hv_fetch_mg(NOTXSCALL self, szKey, strlen(szKey), 0); if(window != NULL) { ! hwnd = INT2PTR(HWND,SvIV(*window)); } else { XSRETURN_NO; |
From: Robert M. <rob...@us...> - 2006-04-12 20:00:22
|
Update of /cvsroot/perl-win32-gui/Win32-GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22924 Modified Files: CHANGELOG GUI.pm GUI_Events.cpp GUI_MessageLoops.cpp GUI_Options.cpp Makefile.PL Log Message: Start of DropFiles Integration Index: Makefile.PL =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Makefile.PL,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Makefile.PL 16 Mar 2006 21:11:12 -0000 1.17 --- Makefile.PL 12 Apr 2006 20:00:06 -0000 1.18 *************** *** 6,9 **** --- 6,10 ---- use Config; + our $W32G_CORE = 1; $main::USERESOURCE = 1; $main::BUILDENV = ''; *************** *** 256,259 **** --- 257,265 ---- use warnings; + sub pasthru { + my $inherited = shift->SUPER::pasthru(@_); + return "$inherited W32G_CORE=1"; + } + sub xs_c { my $inherited = shift->SUPER::xs_c(@_); Index: GUI.pm =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.pm,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** GUI.pm 16 Mar 2006 21:11:11 -0000 1.39 --- GUI.pm 12 Apr 2006 20:00:05 -0000 1.40 *************** *** 610,613 **** --- 610,632 ---- } + ########################################################################### + # (@)METHOD:AcceptFiles([FLAG]) + # Gets/sets the L<Win32::GUI::Reference::Options\-acceptfiles|-acceptfiles> + # options on a window. If C<FLAG> is not provided, returns the current + # state. If FLAG is provided it sets or unsets the state, returning the + # previous state. + sub AcceptFiles { + my $win = shift; + my $accept = shift; + + my $old_accept = $win->GetWindowLong(GWL_EXSTYLE) & WS_EX_ACCEPTFILES() ? 1 : 0; + + if(defined $accept) { + $win->Change(-acceptfiles => $accept); + } + + return $old_accept; + } + ############################################################################### # SUB-PACKAGES Index: CHANGELOG =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** CHANGELOG 12 Apr 2006 19:49:21 -0000 1.75 --- CHANGELOG 12 Apr 2006 20:00:05 -0000 1.76 *************** *** 6,9 **** --- 6,20 ---- Win32-GUI ChangeLog =================== + + [Robert May] : 12 Apr 2006 - Start of DropFiles integration + - GUI.pm Add Acceptfiles method and documentation. + - GUI_Events.cpp Fix OEM callback to allow passing SV. + - GUI_MessageLoops.cpp modify WM_DROPFILES handling to pass + a Win32::GUI::DropFiles object, and update event documentation. + - GUI_Options.cpp Add -acceptfiles option for windows + - Makefile.PL set up W32G_CORE variable so that sub directories + can know if they arebeing called from a higher level Makefile, + and so that tests know how they are being run. + - docs/GUI/Reference/Options.pod added -acceptfiles documentation + + [Robert May] : 12 Apr 2006 - Fix GetKeyState - GUI.xs Changed stack macros in GetKeyStae to those that exist Index: GUI_Options.cpp =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_Options.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GUI_Options.cpp 16 Mar 2006 21:11:11 -0000 1.12 --- GUI_Options.cpp 12 Apr 2006 20:00:06 -0000 1.13 *************** *** 313,316 **** --- 313,317 ---- } else BitmaskOption("-hscroll", perlcs->cs.style, WS_HSCROLL) } else BitmaskOption("-vscroll", perlcs->cs.style, WS_VSCROLL) + } else BitmaskOption("-acceptfiles", perlcs->cs.dwExStyle, WS_EX_ACCEPTFILES) } else BitmaskOption("-container", perlcs->dwPlStyle, PERLWIN32GUI_CONTAINER) } Index: GUI_Events.cpp =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_Events.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GUI_Events.cpp 16 Mar 2006 21:11:11 -0000 1.12 --- GUI_Events.cpp 12 Apr 2006 20:00:06 -0000 1.13 *************** *** 142,145 **** --- 142,148 ---- XPUSHs(sv_2mortal(newSVpv(va_arg( args, char * ), 0))); break; + case PERLWIN32GUI_ARGTYPE_SV: + XPUSHs(va_arg( args, SV *)); + break; default: warn("Win32::GUI: WARNING! unknown argument type (%d) to event '%s'", argtype, Name); Index: GUI_MessageLoops.cpp =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_MessageLoops.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** GUI_MessageLoops.cpp 16 Mar 2006 21:11:11 -0000 1.19 --- GUI_MessageLoops.cpp 12 Apr 2006 20:00:06 -0000 1.20 *************** *** 627,637 **** case WM_DROPFILES: /* ! * (@)EVENT:DropFiles(DROP_HANDLE) ! * Sent when the window receives dropped files. * (@)APPLIES_TO:* */ ! PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, "DropFiles", ! PERLWIN32GUI_ARGTYPE_LONG, (LONG) wParam, -1); break; } --- 627,653 ---- case WM_DROPFILES: /* ! * (@)EVENT:DropFiles(DROP) ! * Sent when the window receives dropped files. To enable a window to ! * be a target for files dragged from a shell window, you must set the ! * window's L<-acceptfiles|Win32::GUI::Reference::Options\-acceptfiles> ! * option or call C<< $win->AcceptFiles(1) >> on the window (See ! * L<Win32::GUI::AcceptFiles|AccepFiles()>). The DROP parameter is either ! * a Win32 drop handle (see MSDN) or a ! * L<Win32::GUI::DropFiles|Win32::GUI::DropFiles> object if you have done ! * C<use Win32::GUI::DropFiles;> somewhere in your code. * (@)APPLIES_TO:* */ ! { HV *dropfiles_stash = gv_stashpv("Win32::GUI::DropFiles", 0); ! if(dropfiles_stash) { /* Win32::GUI::DropFiles is available */ ! PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, "DropFiles", ! PERLWIN32GUI_ARGTYPE_SV, CreateObjectWithHandle(NOTXSCALL "Win32::GUI::DropFiles", (HWND)wParam), -1); + } else { /* Win32::GUI::DropFiles is not available */ + PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, "DropFiles", + PERLWIN32GUI_ARGTYPE_LONG, wParam, + -1); + DragFinish((HDROP)wParam); + } + } break; } *************** *** 966,972 **** break; case WM_DROPFILES: ! PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, "DropFiles", ! PERLWIN32GUI_ARGTYPE_LONG, (LONG) wParam, -1); } --- 982,997 ---- break; case WM_DROPFILES: ! { HV *dropfiles_stash = gv_stashpv("Win32::GUI::DropFiles", 0); ! if(dropfiles_stash) { /* Win32::GUI::DropFiles is available */ ! PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, "DropFiles", ! PERLWIN32GUI_ARGTYPE_SV, CreateObjectWithHandle(NOTXSCALL "Win32::GUI::DropFiles", (HWND)wParam), -1); + } else { /* Win32::GUI::DropFiles is not available */ + PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, "DropFiles", + PERLWIN32GUI_ARGTYPE_LONG, wParam, + -1); + DragFinish((HDROP)wParam); + } + } } |
From: Robert M. <rob...@us...> - 2006-04-12 20:00:16
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/docs/GUI/Reference In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22924/docs/GUI/Reference Modified Files: Options.pod Log Message: Start of DropFiles Integration Index: Options.pod =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/docs/GUI/Reference/Options.pod,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Options.pod 3 Aug 2005 21:45:59 -0000 1.2 --- Options.pod 12 Apr 2006 20:00:06 -0000 1.3 *************** *** 20,23 **** --- 20,34 ---- =head1 OPTIONS + =head2 -acceptfiles + + =over + + =item B<-acceptfiles> => 0/1 + + =back + + Allow the window or control to act as a drop target for files + dragged from the shell. + =head2 -addexstyle |
From: Robert M. <rob...@us...> - 2006-04-12 19:49:28
|
Update of /cvsroot/perl-win32-gui/Win32-GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14839 Modified Files: CHANGELOG GUI.xs Log Message: Fix GetKeyState for Perl 5.6 compatability Index: GUI.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.xs,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** GUI.xs 16 Mar 2006 23:14:31 -0000 1.52 --- GUI.xs 12 Apr 2006 19:49:21 -0000 1.53 *************** *** 79,91 **** result = (USHORT)GetKeyState(key); if(GIMME_V == G_ARRAY) { ! /* list context */ ! mXPUSHu((result & 0x8000) >> 15); ! mXPUSHu(result & 0x0001); ! XSRETURN(2); } else { ! /* scalar(and void) context */ ! mXPUSHu((result & 0x8000) >> 15); ! XSRETURN(1); } --- 79,91 ---- result = (USHORT)GetKeyState(key); if(GIMME_V == G_ARRAY) { ! /* list context */ ! EXTEND(SP, 2); ! XST_mIV(0, (UV) ((result & 0x8000) >> 15)); ! XST_mIV(1, (UV) (result & 0x0001)); ! XSRETURN(2); } else { ! /* scalar(and void) context */ ! XSRETURN_IV((UV) ((result & 0x8000) >> 15)); } Index: CHANGELOG =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** CHANGELOG 16 Mar 2006 23:14:31 -0000 1.74 --- CHANGELOG 12 Apr 2006 19:49:21 -0000 1.75 *************** *** 6,9 **** --- 6,13 ---- Win32-GUI ChangeLog =================== + + [Robert May] : 12 Apr 2006 - Fix GetKeyState + - GUI.xs Changed stack macros in GetKeyStae to those that exist + in Perl 5.6 + + [Robert May] : 16 Mar 2006 - Changes from Reini Urban - GUI.xs Add more options to DoEvents(). Add SetWindowPos(). |