Browse Source

changes for Wine compatibility

tags/2021-05-28
jules 18 years ago
parent
commit
8d63747965
3 changed files with 32 additions and 5 deletions
  1. +15
    -3
      build/win32/platform_specific_code/juce_win32_Fonts.cpp
  2. +11
    -0
      build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp
  3. +6
    -2
      build/win32/platform_specific_code/juce_win32_Windowing.cpp

+ 15
- 3
build/win32/platform_specific_code/juce_win32_Fonts.cpp View File

@@ -239,13 +239,25 @@ const StringArray Font::findAllTypefaceNames() throw()
return results;
}
extern bool juce_IsRunningInWine() throw();
void Font::getDefaultFontNames (String& defaultSans,
String& defaultSerif,
String& defaultFixed) throw()
{
defaultSans = "Verdana";
defaultSerif = "Times";
defaultFixed = "Lucida Console";
if (juce_IsRunningInWine())
{
// If we're running in Wine, then use fonts that might be available on Linux..
defaultSans = "Bitstream Vera Sans";
defaultSerif = "Bitstream Vera Serif";
defaultFixed = "Bitstream Vera Sans Mono";
}
else
{
defaultSans = "Verdana";
defaultSerif = "Times";
defaultFixed = "Lucida Console";
}
}
//==============================================================================


+ 11
- 0
build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp View File

@@ -300,6 +300,17 @@ void PlatformUtilities::deleteRegistryKey (const String& regKeyPath)
}
}
bool juce_IsRunningInWine() throw()
{
HKEY key;
if (RegOpenKeyEx (HKEY_CURRENT_USER, _T("Software\\Wine"), 0, KEY_READ, &key) == ERROR_SUCCESS)
{
RegCloseKey (key);
return true;
}
return false;
}
//==============================================================================
static void* currentModuleHandle = 0;


+ 6
- 2
build/win32/platform_specific_code/juce_win32_Windowing.cpp View File

@@ -93,6 +93,7 @@ BEGIN_JUCE_NAMESPACE
extern void juce_repeatLastProcessPriority() throw(); // in juce_win32_Threads.cpp
extern void juce_CheckCurrentlyFocusedTopLevelWindow() throw(); // in juce_TopLevelWindow.cpp
extern bool juce_IsRunningInWine() throw();
const int juce_windowIsSemiTransparentFlag = (1 << 31); // also in component.cpp
@@ -121,8 +122,11 @@ bool Desktop::canUseSemiTransparentWindows() throw()
{
if (updateLayeredWindow == 0)
{
HMODULE user32Mod = GetModuleHandle (_T("user32.dll"));
updateLayeredWindow = (UpdateLayeredWinFunc) GetProcAddress (user32Mod, "UpdateLayeredWindow");
if (! juce_IsRunningInWine())
{
HMODULE user32Mod = GetModuleHandle (_T("user32.dll"));
updateLayeredWindow = (UpdateLayeredWinFunc) GetProcAddress (user32Mod, "UpdateLayeredWindow");
}
}
return updateLayeredWindow != 0;


Loading…
Cancel
Save