[Perl-win32-gui-cvscommit] Win32-GUI CHANGELOG,1.76,1.77 DC.xs,1.12,1.13 GUI.xs,1.53,1.54 GUI_Helpers.cpp,1.17,1.18 GUI_Options.cpp,1.13,1.14 Makefile.PL,1.18,1.19 TYPEMAP,1.7,1.8 TreeView.xs,1.7,1.8
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 - 1.53 --- GUI.xs 13 Apr 2006 22:17:07 - 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 { !
[Perl-win32-gui-cvscommit] Win32-GUI/t 05_NotifyIcon_01_Constructor.t,1.1,1.2
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 - 1.1 --- 05_NotifyIcon_01_Constructor.t 14 Apr 2006 01:52:29 - 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();
[Perl-win32-gui-cvscommit] Win32-GUI CHANGELOG,1.77,1.78 GUI.h,1.27,1.28 GUI.pm,1.40,1.41 GUI.xs,1.54,1.55
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 - 1.54 --- GUI.xs 14 Apr 2006 01:52:25 - 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&0x); + 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 - 1.27 --- GUI.h 14 Apr 2006 01:52:25 - 1.28 *** *** 18,21 --- 18,22 #include #include + #include #include 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 - 1.40 --- GUI.pm 14 Apr 2006 01:52:25 - 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 f
[Perl-win32-gui-cvscommit] Win32-GUI/samples NotifyIcon.pl,1.1,1.2
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 - 1.1 --- NotifyIcon.pl 14 Apr 2006 01:52:28 - 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;