From: <man...@us...> - 2015-06-17 09:47:33
|
Revision: 5328 http://sourceforge.net/p/modplug/code/5328 Author: manxorist Date: 2015-06-17 09:47:25 +0000 (Wed, 17 Jun 2015) Log Message: ----------- [Mod] About Dialog: Redesign the whole thing. Encoding more and more possible build settings into a single small version string got really difficult. Provide more space to display the build features and requirements in a more readable way and add some more potentially useful information there. [Mod] About Dialog: Show the OpenMPT license. [Mod] About Dialog: Make the credits scroller optional. By default the information is now shown in multiple tabs with read-only multi-line edit controls. [Fix] About Dialog: Wine apparently only generates mouse events when the message queue is completely empty AND mouse hover tracking events have timed out. This causes the mouse cursor to stay invisible for really long periods of time even after leaving the window area of the animated logo. Invisible mouse cursor is evil. Just dont hide it on Wine. [Fix] About Dialog: Use a Timer for the animated ripple bitmap instead of hooking into the global idle processing. This especially avoids having to sleep in the main message loop. This also avoids a synchronous UpdateWindow call in the Animate() codepath. As we do not sleep anymore, we receive way more MouseMove events; appropriately rate-limit new ripple generation. Modified Paths: -------------- trunk/OpenMPT/common/mptCPU.cpp trunk/OpenMPT/common/mptCPU.h trunk/OpenMPT/common/mptOS.cpp trunk/OpenMPT/common/mptOS.h trunk/OpenMPT/common/version.cpp trunk/OpenMPT/common/version.h trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/mptrack/AboutDialog.cpp trunk/OpenMPT/mptrack/AboutDialog.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/resource.h Modified: trunk/OpenMPT/common/mptCPU.cpp =================================================================== --- trunk/OpenMPT/common/mptCPU.cpp 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/common/mptCPU.cpp 2015-06-17 09:47:25 UTC (rev 5328) @@ -124,11 +124,54 @@ #endif // MPT_COMPILER_MSVC && ENABLE_X86 -#else // !ENABLE_ASM +#endif // ENABLE_ASM + +#ifdef MODPLUG_TRACKER + + +int GetMinimumSSEVersion() +//------------------------ +{ + int minimumSSEVersion = 0; + #if MPT_COMPILER_MSVC + #if defined(_M_IX86_FP) + #if (_M_IX86_FP >= 2) + minimumSSEVersion = 2; + #elif (_M_IX86_FP == 1) + minimumSSEVersion = 1; + #endif + #endif + #endif + return minimumSSEVersion; +} + + +int GetMinimumAVXVersion() +//------------------------ +{ + int minimumAVXVersion = 0; + #if MPT_COMPILER_MSVC + #if defined(_M_IX86_FP) + #if defined(__AVX2__) + minimumAVXVersion = 2; + #elif defined(__AVX__) + minimumAVXVersion = 1; + #endif + #endif + #endif + return minimumAVXVersion; +} + + +#endif + + +#if !defined(MODPLUG_TRACKER) && !defined(ENABLE_ASM) + MPT_MSVC_WORKAROUND_LNK4221(mptCPU) -#endif // ENABLE_ASM +#endif OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/common/mptCPU.h =================================================================== --- trunk/OpenMPT/common/mptCPU.h 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/common/mptCPU.h 2015-06-17 09:47:25 UTC (rev 5328) @@ -31,4 +31,10 @@ #endif // ENABLE_ASM +#ifdef MODPLUG_TRACKER +int GetMinimumSSEVersion(); +int GetMinimumAVXVersion(); +#endif + + OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/common/mptOS.cpp =================================================================== --- trunk/OpenMPT/common/mptOS.cpp 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/common/mptOS.cpp 2015-06-17 09:47:25 UTC (rev 5328) @@ -118,6 +118,133 @@ } +mpt::ustring VersionToString(uint16 version) +//------------------------------------------ +{ + mpt::ustring result; + std::vector<std::pair<uint16, mpt::ustring> > versionMapNT; + versionMapNT.push_back(std::make_pair(static_cast<uint16>(mpt::Windows::Version::Win81), MPT_USTRING("Windows 8.1"))); + versionMapNT.push_back(std::make_pair(static_cast<uint16>(mpt::Windows::Version::Win8), MPT_USTRING("Windows 8"))); + versionMapNT.push_back(std::make_pair(static_cast<uint16>(mpt::Windows::Version::Win7), MPT_USTRING("Windows 7"))); + versionMapNT.push_back(std::make_pair(static_cast<uint16>(mpt::Windows::Version::WinVista), MPT_USTRING("Windows Vista"))); + versionMapNT.push_back(std::make_pair(static_cast<uint16>(mpt::Windows::Version::WinXP), MPT_USTRING("Windows XP"))); + versionMapNT.push_back(std::make_pair(static_cast<uint16>(mpt::Windows::Version::Win2000), MPT_USTRING("Windows 2000"))); + versionMapNT.push_back(std::make_pair(static_cast<uint16>(mpt::Windows::Version::WinNT4), MPT_USTRING("Windows NT4"))); + for(std::size_t i = 0; i < versionMapNT.size(); ++i) + { + if(version > versionMapNT[i].first) + { + result = MPT_USTRING("> ") + versionMapNT[i].second; + break; + } else if(version == versionMapNT[i].first) + { + result = versionMapNT[i].second; + break; + } + } + if(result.empty()) + { + result = MPT_UFORMAT("0x%1", mpt::ufmt::dec0<4>(version)); + } + return result; +} + + +mpt::ustring GetName() +//-------------------- +{ + mpt::ustring result; + if(mpt::Windows::Version::IsWine()) + { + result += MPT_USTRING("Wine"); + if(mpt::Wine::GetVersion()) + { + result += MPT_UFORMAT(" %1", mpt::ToUnicode(mpt::CharsetUTF8, mpt::Wine::VersionString(mpt::Wine::GetVersion()))); + } else + { + result += MPT_UFORMAT(" (unknown version: '%1')", mpt::ToUnicode(mpt::CharsetUTF8, mpt::Wine::RawGetVersion())); + } + } + if(mpt::Windows::Version::IsWine()) + { + result += MPT_USTRING(" ("); + } + if(mpt::Windows::Version::IsNT()) + { + if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::Win81)) + { + result += MPT_USTRING("Windows 8.1 (or newer)"); + } else if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::Win8)) + { + result += MPT_USTRING("Windows 8"); + } else if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::Win7)) + { + result += MPT_USTRING("Windows 7"); + } else if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::WinVista)) + { + result += MPT_USTRING("Windows Vista"); + } else if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::WinXP)) + { + result += MPT_USTRING("Windows XP"); + } else if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::Win2000)) + { + result += MPT_USTRING("Windows 2000"); + } else if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::WinNT4)) + { + result += MPT_USTRING("Windows NT4"); + } else + { + result += MPT_USTRING("Generic Windows NT"); + } + } else + { + if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::WinME)) + { + result += MPT_USTRING("Windows ME (or newer)"); + } else if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::Win98)) + { + result += MPT_USTRING("Windows 98"); + } else + { + result += MPT_USTRING("Generic Windows 9x"); + } + } + if(mpt::Windows::Version::IsWine()) + { + result += MPT_USTRING(")"); + } + return result; +} + + +uint16 GetMinimumKernelLevel() +//---------------------------- +{ + uint16 minimumKernelVersion = 0; + #if MPT_COMPILER_MSVC + #if MPT_MSVC_AT_LEAST(2012, 0) + minimumKernelVersion = std::max<uint16>(minimumKernelVersion, mpt::Windows::Version::WinVista); + #elif MPT_MSVC_AT_LEAST(2010, 0) + minimumKernelVersion = std::max<uint16>(minimumKernelVersion, mpt::Windows::Version::Win2000); + #elif MPT_MSVC_AT_LEAST(2008, 0) + minimumKernelVersion = std::max<uint16>(minimumKernelVersion, mpt::Windows::Version::Win98); + #endif + #endif + return minimumKernelVersion; +} + + +uint16 GetMinimumAPILevel() +//------------------------- +{ + uint16 minimumApiVersion = 0; + #if defined(_WIN32_WINNT) + minimumApiVersion = std::max<uint16>(minimumApiVersion, _WIN32_WINNT); + #endif + return minimumApiVersion; +} + + #else // !MODPLUG_TRACKER Modified: trunk/OpenMPT/common/mptOS.h =================================================================== --- trunk/OpenMPT/common/mptOS.h 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/common/mptOS.h 2015-06-17 09:47:25 UTC (rev 5328) @@ -61,6 +61,14 @@ bool IsOriginal(); bool IsWine(); +mpt::ustring VersionToString(uint16 version); + +mpt::ustring GetName(); + +uint16 GetMinimumKernelLevel(); + +uint16 GetMinimumAPILevel(); + #else // !MPT_OS_WINDOWS static inline void Init() { return; } @@ -76,6 +84,13 @@ static inline bool IsOriginal() { return false; } static inline bool IsWine() { return false; } +static inline mpt::ustring VersionToString(uint16 version) { return mpt::ufmt::hex0(<4>(version)); } + +static inline mpt::ustring GetName() { return MPT_USTRING(""); } + +static inline uint16 GetMinimumKernelLevel() { return 0; } +static inline uint16 GetMinimumAPILevel() { return 0; } + #endif // MPT_OS_WINDOWS #else // !MODPLUG_TRACKER Modified: trunk/OpenMPT/common/version.cpp =================================================================== --- trunk/OpenMPT/common/version.cpp 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/common/version.cpp 2015-06-17 09:47:25 UTC (rev 5328) @@ -254,12 +254,12 @@ std::string GetBuildFlagsString() { std::string retval; -#ifdef MODPLUG_TRACKER - if(IsTestBuild()) - { - retval += " TEST"; - } -#endif // MODPLUG_TRACKER + #ifdef MODPLUG_TRACKER + if(IsTestBuild()) + { + retval += " TEST"; + } + #endif // MODPLUG_TRACKER if(IsDebugBuild()) { retval += " DEBUG"; @@ -305,6 +305,10 @@ #endif #endif #ifdef MODPLUG_TRACKER + if(IsForOlderWindows()) + { + retval += " OLDWIN"; + } #ifdef NO_VST retval += " NO_VST"; #endif @@ -341,77 +345,56 @@ return result; } -std::string GetVersionStringExtended() +bool IsForOlderWindows() { + #ifdef MODPLUG_TRACKER + return true + && (GetMinimumSSEVersion() <= 0) + && (GetMinimumAVXVersion() <= 0) + && (mpt::Windows::Version::GetMinimumKernelLevel() < mpt::Windows::Version::WinXP) + && (mpt::Windows::Version::GetMinimumAPILevel() < mpt::Windows::Version::WinXP) + ; + #else + return false; + #endif +} + +static std::string GetVersionString(bool verbose) +{ std::string retval = MPT_VERSION_STR; if(IsDebugBuild() || IsTestBuild() || IsDirty() || HasMixedRevisions()) { retval += GetRevisionString(); } #ifdef MODPLUG_TRACKER - retval += MPT_FORMAT(" %1 bit", sizeof(void*) * 8); - int minimumSSEVersion = 0; - int minimumAVXVersion = 0; - #if MPT_COMPILER_MSVC - #if defined(_M_IX86_FP) - #if defined(__AVX2__) - retval += " AVX2"; - minimumSSEVersion = 2; - minimumAVXVersion = 2; - #elif defined(__AVX__) - retval += " AVX"; - minimumSSEVersion = 2; - minimumAVXVersion = 1; - #elif (_M_IX86_FP >= 2) - retval += " SSE2"; - minimumSSEVersion = 2; - #elif (_M_IX86_FP == 1) - retval += " SSE"; - minimumSSEVersion = 1; - #else - retval += " x87"; - #endif - #endif - #endif - uint16 minimumKernelVersion = 0; - #if MPT_COMPILER_MSVC - #if MPT_MSVC_AT_LEAST(2012, 0) - minimumKernelVersion = std::max<uint16>(minimumKernelVersion, mpt::Windows::Version::WinVista); - #elif MPT_MSVC_AT_LEAST(2010, 0) - minimumKernelVersion = std::max<uint16>(minimumKernelVersion, mpt::Windows::Version::Win2000); - #elif MPT_MSVC_AT_LEAST(2008, 0) - minimumKernelVersion = std::max<uint16>(minimumKernelVersion, mpt::Windows::Version::Win98); - #endif - #endif - uint16 minimumApiVersion = 0; - #if defined(_WIN32_WINNT) - minimumApiVersion = std::max<uint16>(minimumApiVersion, _WIN32_WINNT); - #endif - if((minimumSSEVersion <= 0) && (minimumAVXVersion <= 0) && (minimumKernelVersion < mpt::Windows::Version::WinXP) && (minimumApiVersion < mpt::Windows::Version::WinXP)) + if(verbose) { - if(IsDebugBuild() || IsTestBuild() || IsDirty() || HasMixedRevisions()) - { - retval += " OLD"; - } else - { - retval += " for older Windows"; - } + retval += MPT_FORMAT(" %1 bit", sizeof(void*) * 8); } - if(IsDebugBuild() || IsTestBuild() || IsDirty() || HasMixedRevisions()) - { - retval += MPT_FORMAT(" OS>=0x%1 API>=0x%2", mpt::fmt::hex0<4>(minimumKernelVersion), mpt::fmt::hex0<4>(minimumApiVersion)); - } #endif if(IsDebugBuild() || IsTestBuild() || IsDirty() || HasMixedRevisions()) { retval += GetBuildFlagsString(); - #ifdef MODPLUG_TRACKER + } + #ifdef MODPLUG_TRACKER + if(verbose) + { retval += GetBuildFeaturesString(); - #endif - } + } + #endif return retval; } +std::string GetVersionStringSimple() +{ + return GetVersionString(false); +} + +std::string GetVersionStringExtended() +{ + return GetVersionString(true); +} + std::string GetVersionUrlString() { if(GetRevision() == 0) @@ -433,22 +416,24 @@ std::string GetContactString() { - return "Contact / Discussion:\n" + return + "Contact / Discussion:\n" "http://forum.openmpt.org/\n" "\n" "Updates:\n" - "http://openmpt.org/download"; + "http://openmpt.org/download\n" + ; } std::string GetFullCreditsString() { return - "\n" #ifdef MODPLUG_TRACKER "OpenMPT / ModPlug Tracker\n" #else "libopenmpt (based on OpenMPT / ModPlug Tracker)\n" #endif + "\n" "Copyright \xC2\xA9 2004-2015 Contributors\n" "Copyright \xC2\xA9 1997-2003 Olivier Lapicque\n" "\n" @@ -566,7 +551,39 @@ "\n" #endif ; +} +std::string GetLicenseString() +{ + return + "The OpenMPT code is licensed under the BSD license." "\n" + "" "\n" + "Copyright (c) 2004-2015, OpenMPT contributors" "\n" + "Copyright (c) 1997-2003, Olivier Lapicque" "\n" + "All rights reserved." "\n" + "" "\n" + "Redistribution and use in source and binary forms, with or without" "\n" + "modification, are permitted provided that the following conditions are met:" "\n" + " * Redistributions of source code must retain the above copyright" "\n" + " notice, this list of conditions and the following disclaimer." "\n" + " * Redistributions in binary form must reproduce the above copyright" "\n" + " notice, this list of conditions and the following disclaimer in the" "\n" + " documentation and/or other materials provided with the distribution." "\n" + " * Neither the name of the OpenMPT project nor the" "\n" + " names of its contributors may be used to endorse or promote products" "\n" + " derived from this software without specific prior written permission." "\n" + "" "\n" + "THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY" "\n" + "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED" "\n" + "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE" "\n" + "DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY" "\n" + "DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES" "\n" + "(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;" "\n" + "LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND" "\n" + "ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT" "\n" + "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS" "\n" + "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." "\n" + ; } } // namespace MptVersion Modified: trunk/OpenMPT/common/version.h =================================================================== --- trunk/OpenMPT/common/version.h 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/common/version.h 2015-06-17 09:47:25 UTC (rev 5328) @@ -66,6 +66,9 @@ // Return whether the build was done from packaged source code (i.e. from the genertaed .zip or .tar source) bool IsPackage(); + // Returns true if the build will run on ancient Windows versions. + bool IsForOlderWindows(); + // Return a string decribing the working copy state (dirty and/or mixed revisions) (if built from a svn working copy and tsvn was available during build) std::string GetStateString(); // e.g. "" or "+mixed" or "+mixed+dirty" or "+dirty" @@ -81,7 +84,10 @@ // Return a string decribing the revision of the svn working copy and if it was dirty (+) or had mixed revisions (!) (if built from a svn working copy and tsvn was available during build) std::string GetRevisionString(); // e.g. "-r1234+" - // Returns MptVersion::str if the build is a clean release build straight from the repository or an extended strin otherwise (if built from a svn working copy and tsvn was available during build) + // Returns a simple version string + std::string GetVersionStringSimple(); // e.g. "1.17.02.08-r1234+ 32 bit" + + // Returns MptVersion::str if the build is a clean release build straight from the repository or an extended string otherwise (if built from a svn working copy and tsvn was available during build) std::string GetVersionStringExtended(); // e.g. "1.17.02.08-r1234+ 32 bit DEBUG" // Returns a string combining the repository url and the revision, suitable for checkout if the working copy was clean (if built from a svn working copy and tsvn was available during build) @@ -93,6 +99,9 @@ // Returns a multi-line string containing developer contact and community addresses std::string GetContactString(); + // Returns the OpenMPT license text + std::string GetLicenseString(); + } //namespace MptVersion Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2015-06-17 09:47:25 UTC (rev 5328) @@ -38,36 +38,6 @@ namespace version { -static const char * const license = -"The OpenMPT code is licensed under the BSD license." "\n" -" " "\n" -"Copyright (c) 2004-2015, OpenMPT contributors" "\n" -"Copyright (c) 1997-2003, Olivier Lapicque" "\n" -"All rights reserved." "\n" -"" "\n" -"Redistribution and use in source and binary forms, with or without" "\n" -"modification, are permitted provided that the following conditions are met:" "\n" -" * Redistributions of source code must retain the above copyright" "\n" -" notice, this list of conditions and the following disclaimer." "\n" -" * Redistributions in binary form must reproduce the above copyright" "\n" -" notice, this list of conditions and the following disclaimer in the" "\n" -" documentation and/or other materials provided with the distribution." "\n" -" * Neither the name of the OpenMPT project nor the" "\n" -" names of its contributors may be used to endorse or promote products" "\n" -" derived from this software without specific prior written permission." "\n" -"" "\n" -"THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY" "\n" -"EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED" "\n" -"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE" "\n" -"DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY" "\n" -"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES" "\n" -"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;" "\n" -"LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND" "\n" -"ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT" "\n" -"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS" "\n" -"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." "\n" -; - std::uint32_t get_library_version() { return OPENMPT_API_VERSION | ( MptVersion::GetRevision() & 0xffff ); } @@ -127,7 +97,7 @@ } static std::string get_license_string() { - return license; + return MptVersion::GetLicenseString(); } std::string get_string( const std::string & key ) { Modified: trunk/OpenMPT/mptrack/AboutDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/AboutDialog.cpp 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/mptrack/AboutDialog.cpp 2015-06-17 09:47:25 UTC (rev 5328) @@ -2,16 +2,16 @@ #include "resource.h" #include "AboutDialog.h" #include "PNG.h" +#include "Mptrack.h" +#include "TrackerSettings.h" #include "../common/version.h" OPENMPT_NAMESPACE_BEGIN -CRippleBitmap *CRippleBitmap::instance = nullptr; CAboutDlg *CAboutDlg::instance = nullptr; - BEGIN_MESSAGE_MAP(CRippleBitmap, CWnd) ON_WM_PAINT() ON_WM_ERASEBKGND() @@ -54,7 +54,6 @@ bi.biCompression = BI_RGB; bi.biSizeImage = bitmapSrc->width * bitmapSrc->height * 4; - instance = this; } @@ -67,13 +66,19 @@ } delete bitmapSrc; delete bitmapTarget; - if(instance == this) instance = nullptr; } void CRippleBitmap::OnMouseMove(UINT nFlags, CPoint point) //-------------------------------------------------------- { + + // Rate limit in order to avoid too may ripples. + DWORD now = timeGetTime(); + if(now - lastRipple < UPDATE_INTERVAL) + return; + lastRipple = now; + // Initiate ripples at cursor location Limit(point.x, 1, int(bitmapSrc->width) - 2); Limit(point.y, 2, int(bitmapSrc->height) - 3); @@ -91,10 +96,21 @@ damp = !(nFlags & MK_RBUTTON); activity = true; + // Wine will only ever generate MouseLeave message when the message + // queue is completely empty and the hover timeout has expired. + // This results in a hidden mouse cursor long after it had already left the + // control. + // Avoid hiding the mouse cursor on Wine. Interferring with the users input + // methods is an absolute no-go. + if(mpt::Windows::Version::IsWine()) + { + return; + } + TRACKMOUSEEVENT me; me.cbSize = sizeof(TRACKMOUSEEVENT); + me.hwndTrack = m_hWnd; me.dwFlags = TME_LEAVE | TME_HOVER; - me.hwndTrack = m_hWnd; me.dwHoverTime = 1500; if(TrackMouseEvent(&me) && showMouse) @@ -139,7 +155,7 @@ return false; DWORD now = timeGetTime(); - if(now - lastFrame < 15) + if(now - lastFrame < UPDATE_INTERVAL) return true; lastFrame = now; activity = false; @@ -198,23 +214,35 @@ frame = !frame; InvalidateRect(NULL, FALSE); - UpdateWindow(); - Sleep(10); //give away some CPU return true; } +CAboutDlg::CAboutDlg() +//-------------------- +{ + m_TimerID = 0; + +} + + CAboutDlg::~CAboutDlg() //--------------------- { instance = NULL; } + void CAboutDlg::OnOK() //-------------------- { instance = NULL; + if(m_TimerID != 0) + { + KillTimer(m_TimerID); + m_TimerID = 0; + } DestroyWindow(); delete this; } @@ -232,21 +260,185 @@ { CDialog::OnInitDialog(); + mpt::ustring app; + app += MPT_UFORMAT("OpenMPT %1 bit", sizeof(void*) * 8) + + (MptVersion::IsForOlderWindows() ? MPT_USTRING(" for older Windows") : MPT_USTRING("")) + + MPT_USTRING("\n"); + app += MPT_USTRING("Version ") + mpt::ToUnicode(mpt::CharsetUTF8, MptVersion::GetVersionStringSimple()) + MPT_USTRING("\n"); + app += MPT_USTRING("\n"); + app += MPT_USTRING("http://openmpt.org/\n"); + SetDlgItemText(IDC_EDIT3, mpt::ToCString(mpt::String::Replace(app, MPT_USTRING("\n"), MPT_USTRING("\r\n")))); + m_bmp.SubclassDlgItem(IDC_BITMAP1, this); - SetDlgItemText(IDC_EDIT2, mpt::ToCString(mpt::CharsetASCII, std::string("Build Date: ") + MptVersion::GetBuildDateString())); - SetDlgItemText(IDC_EDIT3, mpt::ToCString(mpt::CharsetASCII, std::string("OpenMPT ") + MptVersion::GetVersionStringExtended())); m_static.SubclassDlgItem(IDC_CREDITS, this); - m_static.SetCredits(mpt::ToCString(mpt::CharsetUTF8, mpt::String::Replace(MptVersion::GetFullCreditsString(), "\n", "|") + "|" + mpt::String::Replace(MptVersion::GetContactString(), "\n", "|" ) + "||||||")); - m_static.SetSpeed(DISPLAY_SLOW); - m_static.SetColor(BACKGROUND_COLOR, RGB(138, 165, 219)); // Background Colour - m_static.SetTransparent(); // Set parts of bitmaps with RGB(192,192,192) transparent - m_static.SetGradient(GRADIENT_LEFT_DARK); // Background goes from blue to black from left to right - // m_static.SetBkImage(IDB_BITMAP1); // Background image + m_static.SetSpeed(DISPLAY_MEDIUM); + m_static.SetColor(BACKGROUND_COLOR, RGB(83, 107, 163)); // Background Colour +// m_static.SetColor(BACKGROUND_COLOR, RGB(43, 69, 130)); // Background Colour + m_static.SetGradient(GRADIENT_RIGHT_DARK); // Background goes from blue to black from left to right + + m_Tab.SubclassDlgItem(IDC_TABABOUT, this); + + m_Tab.InsertItem(TCIF_TEXT, 0, _T("OpenMPT"), 0, 0, 0, 0); + m_Tab.InsertItem(TCIF_TEXT, 1, _T("Credits"), 0, 0, 0, 0); + m_Tab.InsertItem(TCIF_TEXT, 2, _T("License"), 0, 0, 0, 0); + m_Tab.InsertItem(TCIF_TEXT, 3, _T("Contact"), 0, 0, 0, 0); + m_Tab.SetCurSel(0); + + m_CheckScroll.SetCheck(TrackerSettings::Instance().MiscAboutScrollText ? BST_CHECKED : BST_UNCHECKED); + + OnTabChange(nullptr, nullptr); + OnCheckScroll(); + + mpt::ustring text; + text += GetTabText(0); + text += MPT_USTRING("\n\n\n"); + text += GetTabText(1); + text += MPT_USTRING("\n\n\n"); + text += GetTabText(3); + text += MPT_USTRING("\n\n\n"); + text += GetTabText(2); + text += MPT_USTRING("\n\n\n"); + m_static.SetCredits(mpt::ToCString(mpt::String::Replace(text, MPT_USTRING("\n"), MPT_USTRING("|")))); m_static.StartScrolling(); + + if(m_TimerID != 0) + { + KillTimer(m_TimerID); + m_TimerID = 0; + } + m_TimerID = SetTimer(TIMERID_ABOUT_DEFAULT, CRippleBitmap::UPDATE_INTERVAL, nullptr); + return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } +void CAboutDlg::OnTimer(UINT_PTR nIDEvent) +//---------------------------------------- +{ + if(nIDEvent == m_TimerID) + { + m_bmp.Animate(); + } +} + + +void CAboutDlg::OnCheckScroll() +{ + if(m_CheckScroll.GetCheck() == BST_CHECKED) + { + m_Tab.ShowWindow(SW_HIDE); + m_TabEdit.ShowWindow(SW_HIDE); + m_static.ShowWindow(SW_SHOW); + TrackerSettings::Instance().MiscAboutScrollText = true; + } else + { + m_Tab.ShowWindow(SW_SHOW); + m_TabEdit.ShowWindow(SW_SHOW); + m_static.ShowWindow(SW_HIDE); + TrackerSettings::Instance().MiscAboutScrollText = false; + } +} + + +void CAboutDlg::OnTabChange(NMHDR * /*pNMHDR*/ , LRESULT * /*pResult*/ ) +{ + m_TabEdit.SetWindowText(mpt::ToCString(mpt::String::Replace(GetTabText(m_Tab.GetCurSel()), MPT_USTRING("\n"), MPT_USTRING("\r\n")))); +} + + +mpt::ustring CAboutDlg::GetTabText(int tab) +{ + const mpt::ustring lf = MPT_USTRING("\n"); + mpt::ustring text; + switch(tab) + { + case 0: + text += MPT_USTRING("OpenMPT - Open ModPlug Tracker") + lf; + text += lf; + text += MPT_UFORMAT("Version: %1", mpt::ToUnicode(mpt::CharsetUTF8, MptVersion::GetVersionStringExtended())) + lf; + text += MPT_UFORMAT("Source Code URL: %1", mpt::ToUnicode(mpt::CharsetUTF8, MptVersion::GetUrl())) + lf; + text += MPT_UFORMAT("Build Date: %1", mpt::ToUnicode(mpt::CharsetUTF8, MptVersion::GetBuildDateString())) + lf; + text += MPT_UFORMAT("Required Windows Kernel Level: %1", mpt::Windows::Version::VersionToString(mpt::Windows::Version::GetMinimumKernelLevel())) + lf; + text += MPT_UFORMAT("Required Windows API Level: %1", mpt::Windows::Version::VersionToString(mpt::Windows::Version::GetMinimumAPILevel())) + lf; + { + text += MPT_USTRING("Required CPU features: "); + std::vector<mpt::ustring> features; + if(GetMinimumSSEVersion() <= 0 && GetMinimumAVXVersion() <= 0 ) features.push_back(MPT_USTRING("FPU")); + if(GetMinimumSSEVersion() >= 1) features.push_back(MPT_USTRING("SSE")); + if(GetMinimumSSEVersion() >= 2) features.push_back(MPT_USTRING("SSE2")); + if(GetMinimumAVXVersion() >= 1) features.push_back(MPT_USTRING("AVX")); + if(GetMinimumAVXVersion() >= 2) features.push_back(MPT_USTRING("AVX2")); + text += mpt::String::Combine(features, MPT_USTRING(" ")); + text += lf; + } + { + text += MPT_USTRING("Optional CPU features used: "); + std::vector<mpt::ustring> features; + #if MPT_COMPILER_MSVC && defined(ENABLE_ASM) + #if defined(ENABLE_X86) + features.push_back(MPT_USTRING("x86-32")); + #endif + #if defined(ENABLE_X64) + features.push_back(MPT_USTRING("x86-64")); + #endif + #if defined(ENABLE_MMX) + if(GetProcSupport() & PROCSUPPORT_MMX) features.push_back(MPT_USTRING("MMX")); + #endif + #if defined(ENABLE_SSE) + if(GetProcSupport() & PROCSUPPORT_SSE) features.push_back(MPT_USTRING("SSE")); + #endif + #if defined(ENABLE_SSE2) + if(GetProcSupport() & PROCSUPPORT_SSE2) features.push_back(MPT_USTRING("SSE2")); + #endif + #if defined(ENABLE_SSE3) + if(GetProcSupport() & PROCSUPPORT_SSE3) features.push_back(MPT_USTRING("SSE3")); + #endif + #if defined(ENABLE_X86_AMD) + if(GetProcSupport() & PROCSUPPORT_AMD_MMXEXT) features.push_back(MPT_USTRING("AMD-MMXEXT")); + if(GetProcSupport() & PROCSUPPORT_AMD_3DNOW) features.push_back(MPT_USTRING("AMD-3DNOW")); + if(GetProcSupport() & PROCSUPPORT_AMD_3DNOW2) features.push_back(MPT_USTRING("AMD-3DNOW2")); + #endif + #endif + text += mpt::String::Combine(features, MPT_USTRING(" ")); + text += lf; + } + text += lf; + text += MPT_UFORMAT("Operating System: %1", mpt::Windows::Version::GetName()) + lf; + text += lf; + text += MPT_UFORMAT("OpenMPT Path%2: %1", theApp.GetAppDirPath(), theApp.IsPortableMode() ? MPT_USTRING(" (portable)") : MPT_USTRING("")) + lf; + text += MPT_UFORMAT("Settings%2: %1", theApp.GetConfigFileName(), theApp.IsPortableMode() ? MPT_USTRING(" (portable)") : MPT_USTRING("")) + lf; + break; + case 1: + text += mpt::ToUnicode(mpt::CharsetUTF8, MptVersion::GetFullCreditsString()); + break; + case 2: + text += mpt::ToUnicode(mpt::CharsetUTF8, MptVersion::GetLicenseString()); + break; + case 3: + text += mpt::ToUnicode(mpt::CharsetUTF8, MptVersion::GetContactString()); + break; + } + return text; +} + + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Control(pDX, IDC_CHECK_ABOUTSCROLL, m_CheckScroll); + DDX_Control(pDX, IDC_TABABOUT, m_Tab); + DDX_Control(pDX, IDC_EDITABOUT, m_TabEdit); +} + + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) + ON_WM_TIMER() + ON_NOTIFY(TCN_SELCHANGE, IDC_TABABOUT, &CAboutDlg::OnTabChange) + ON_COMMAND(IDC_CHECK_ABOUTSCROLL, &CAboutDlg::OnCheckScroll) +END_MESSAGE_MAP() + + + OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/mptrack/AboutDialog.h =================================================================== --- trunk/OpenMPT/mptrack/AboutDialog.h 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/mptrack/AboutDialog.h 2015-06-17 09:47:25 UTC (rev 5328) @@ -10,19 +10,25 @@ class CRippleBitmap: public CWnd //=============================== { + +public: + + static const DWORD UPDATE_INTERVAL = 15; // milliseconds + protected: + BITMAPINFOHEADER bi; PNG::Bitmap *bitmapSrc, *bitmapTarget; std::vector<int32_t> offset1, offset2; int32_t *frontBuf, *backBuf; DWORD lastFrame; // Time of last frame + DWORD lastRipple; // Time of last added ripple bool frame; // Backbuffer toggle bool damp; // Ripple damping status bool activity; // There are actually some ripples bool showMouse; public: - static CRippleBitmap *instance; CRippleBitmap(); ~CRippleBitmap(); @@ -46,10 +52,16 @@ protected: CRippleBitmap m_bmp; CCreditStatic m_static; + CTabCtrl m_Tab; + CEdit m_TabEdit; + CButton m_CheckScroll; + UINT_PTR m_TimerID; + static const UINT_PTR TIMERID_ABOUT_DEFAULT = 3; public: static CAboutDlg *instance; + CAboutDlg(); ~CAboutDlg(); // Implementation @@ -57,6 +69,12 @@ virtual BOOL OnInitDialog(); virtual void OnOK(); virtual void OnCancel(); + DECLARE_MESSAGE_MAP(); + virtual void DoDataExchange(CDataExchange* pDX); + afx_msg void OnTabChange(NMHDR *pNMHDR, LRESULT *pResult); + void OnTimer(UINT_PTR nIDEvent); + void OnCheckScroll(); + mpt::ustring GetTabText(int tab); }; OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2015-06-17 09:47:25 UTC (rev 5328) @@ -1479,11 +1479,6 @@ CMainFrame::GetMainFrame()->IdleHandlerSounddevice(); } - if (CRippleBitmap::instance) - { - if (CRippleBitmap::instance->Animate()) return TRUE; - } - // Call plugins idle routine for open editor if (m_pPluginManager) { Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-06-17 09:47:25 UTC (rev 5328) @@ -221,6 +221,7 @@ , autoApplySmoothFT2Ramping(conf, "Misc", "SmoothFT2Ramping", false) , MiscITCompressionStereo(conf, "Misc", "ITCompressionStereo", 0) , MiscITCompressionMono(conf, "Misc", "ITCompressionMono", 0) + , MiscAboutScrollText(conf, "Misc", "AboutScrollText", false) // Sound Settings , m_SoundSampleRates(conf, "Sound Settings", "SampleRates", GetDefaultSampleRates()) , m_MorePortaudio(conf, "Sound Settings", "MorePortaudio", false) Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2015-06-17 09:47:25 UTC (rev 5328) @@ -526,6 +526,7 @@ Setting<bool> autoApplySmoothFT2Ramping; Setting<uint32> MiscITCompressionStereo; // Mask: bit0: IT, bit1: Compat IT, bit2: MPTM Setting<uint32> MiscITCompressionMono; // Mask: bit0: IT, bit1: Compat IT, bit2: MPTM + Setting<bool> MiscAboutScrollText; // Sound Settings Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/mptrack/mptrack.rc 2015-06-17 09:47:25 UTC (rev 5328) @@ -580,16 +580,18 @@ // Dialog // -IDD_ABOUTBOX DIALOGEX 0, 0, 267, 210 +IDD_ABOUTBOX DIALOGEX 0, 0, 340, 254 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "About OpenMPT" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - CONTROL "",IDC_BITMAP1,"Static",SS_BLACKRECT | SS_NOTIFY | SS_CENTERIMAGE,47,3,173,81,WS_EX_CLIENTEDGE - CTEXT "",IDC_CREDITS,5,116,256,72,0,WS_EX_STATICEDGE - DEFPUSHBUTTON "OK",IDOK,5,192,256,14,WS_GROUP - EDITTEXT IDC_EDIT2,6,100,252,12,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER - EDITTEXT IDC_EDIT3,6,87,252,12,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + DEFPUSHBUTTON "OK",IDOK,264,78,66,14,WS_GROUP + CONTROL "",IDC_BITMAP1,"Static",SS_BLACKRECT | SS_NOTIFY | SS_CENTERIMAGE,6,6,173,81,WS_EX_CLIENTEDGE + EDITTEXT IDC_EDIT3,186,12,144,60,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + CONTROL "",IDC_TABABOUT,"SysTabControl32",0x0,6,96,330,150 + EDITTEXT IDC_EDITABOUT,12,114,318,126,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL + CTEXT "",IDC_CREDITS,6,96,330,150,0,WS_EX_STATICEDGE + CONTROL "&Scroll Text",IDC_CHECK_ABOUTSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,192,78,54,12 END IDD_OPTIONS_PLAYER DIALOGEX 0, 0, 286, 281 @@ -1748,8 +1750,8 @@ BEGIN IDD_ABOUTBOX, DIALOG BEGIN - RIGHTMARGIN, 261 - BOTTOMMARGIN, 205 + RIGHTMARGIN, 334 + BOTTOMMARGIN, 249 END IDD_OPTIONS_PLAYER, DIALOG Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2015-06-17 08:27:46 UTC (rev 5327) +++ trunk/OpenMPT/mptrack/resource.h 2015-06-17 09:47:25 UTC (rev 5328) @@ -133,7 +133,7 @@ #define IDD_RESAMPLE 537 #define IDD_MISSINGSAMPLES 538 #define IDD_WECLOME 539 -#define IDD_TEMPO_SWING 540 +#define IDD_TEMPO_SWING 540 #define IDC_BUTTON1 1001 #define IDC_BUTTON2 1002 #define IDC_BUTTON3 1003 @@ -960,6 +960,9 @@ #define IDC_STATIC_CHANNELMAPPING 2480 #define IDC_STATIC_LATENCY 2481 #define IDC_STATIC_FORMAT 2482 +#define IDC_TABABOUT 2483 +#define IDC_EDITABOUT 2484 +#define IDC_CHECK_ABOUTSCROLL 2485 #define ID_FILE_NEWMOD 32771 #define ID_FILE_NEWXM 32772 #define ID_FILE_NEWS3M 32773 @@ -1258,7 +1261,7 @@ #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 541 #define _APS_NEXT_COMMAND_VALUE 44645 -#define _APS_NEXT_CONTROL_VALUE 2483 +#define _APS_NEXT_CONTROL_VALUE 2486 #define _APS_NEXT_SYMED_VALUE 901 #endif #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |