mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-09 04:30:09 +00:00
changes for Wine compatibility
This commit is contained in:
parent
d02834dea6
commit
8d63747965
3 changed files with 32 additions and 5 deletions
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue