mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
This commit is contained in:
parent
548e59d24f
commit
8dd2db73d2
11 changed files with 3640 additions and 3571 deletions
|
|
@ -370,18 +370,18 @@ const File File::getSpecialLocation (const SpecialLocationType type)
|
|||
homeDir = pw->pw_dir;
|
||||
}
|
||||
|
||||
return File (String (homeDir));
|
||||
return File (String::fromUTF8 ((const uint8*) homeDir));
|
||||
}
|
||||
|
||||
case userDocumentsDirectory:
|
||||
case userMusicDirectory:
|
||||
case userMoviesDirectory:
|
||||
case userApplicationDataDirectory:
|
||||
return File ("~");
|
||||
|
||||
case userDesktopDirectory:
|
||||
return File ("~/Desktop");
|
||||
|
||||
case userApplicationDataDirectory:
|
||||
return File ("~");
|
||||
|
||||
case commonApplicationDataDirectory:
|
||||
return File ("/var");
|
||||
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ void WaitableEvent::signal() const throw()
|
|||
|
||||
pthread_mutex_lock (&es->mutex);
|
||||
es->triggered = true;
|
||||
pthread_cond_signal (&es->condition);
|
||||
pthread_cond_broadcast (&es->condition);
|
||||
pthread_mutex_unlock (&es->mutex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -612,36 +612,49 @@ bool File::isOnHardDisk() const throw()
|
|||
//==============================================================================
|
||||
const File File::getSpecialLocation (const SpecialLocationType type)
|
||||
{
|
||||
const char* resultPath = 0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case userHomeDirectory:
|
||||
{
|
||||
const char* homeDir = getenv ("HOME");
|
||||
resultPath = getenv ("HOME");
|
||||
|
||||
if (homeDir == 0)
|
||||
if (resultPath == 0)
|
||||
{
|
||||
struct passwd* const pw = getpwuid (getuid());
|
||||
if (pw != 0)
|
||||
homeDir = pw->pw_dir;
|
||||
resultPath = pw->pw_dir;
|
||||
}
|
||||
|
||||
return File (PlatformUtilities::convertToPrecomposedUnicode (homeDir));
|
||||
}
|
||||
break;
|
||||
|
||||
case userDocumentsDirectory:
|
||||
return File ("~/Documents");
|
||||
resultPath = "~/Documents";
|
||||
break;
|
||||
|
||||
case userDesktopDirectory:
|
||||
return File ("~/Desktop");
|
||||
resultPath = "~/Desktop";
|
||||
break;
|
||||
|
||||
case userApplicationDataDirectory:
|
||||
return File ("~/Library");
|
||||
resultPath = "~/Library";
|
||||
break;
|
||||
|
||||
case commonApplicationDataDirectory:
|
||||
return File ("/Library");
|
||||
resultPath = "/Library";
|
||||
break;
|
||||
|
||||
case globalApplicationsDirectory:
|
||||
return File ("/Applications");
|
||||
resultPath = "/Applications";
|
||||
break;
|
||||
|
||||
case userMusicDirectory:
|
||||
resultPath = "~/Music";
|
||||
break;
|
||||
|
||||
case userMoviesDirectory:
|
||||
resultPath = "~/Movies";
|
||||
break;
|
||||
|
||||
case tempDirectory:
|
||||
{
|
||||
|
|
@ -668,6 +681,9 @@ const File File::getSpecialLocation (const SpecialLocationType type)
|
|||
break;
|
||||
}
|
||||
|
||||
if (resultPath != 0)
|
||||
return File (PlatformUtilities::convertToPrecomposedUnicode (resultPath));
|
||||
|
||||
return File::nonexistent;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ void WaitableEvent::signal() const throw()
|
|||
|
||||
pthread_mutex_lock (&es->mutex);
|
||||
es->triggered = true;
|
||||
pthread_cond_signal (&es->condition);
|
||||
pthread_cond_broadcast (&es->condition);
|
||||
pthread_mutex_unlock (&es->mutex);
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -569,23 +569,38 @@ static const File juce_getSpecialFolderPath (int type) throw()
|
|||
|
||||
const File JUCE_CALLTYPE File::getSpecialLocation (const SpecialLocationType type)
|
||||
{
|
||||
int csidlType = 0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case userHomeDirectory:
|
||||
case userDocumentsDirectory:
|
||||
return juce_getSpecialFolderPath (CSIDL_PERSONAL);
|
||||
csidlType = CSIDL_PERSONAL;
|
||||
break;
|
||||
|
||||
case userDesktopDirectory:
|
||||
return juce_getSpecialFolderPath (CSIDL_DESKTOP);
|
||||
csidlType = CSIDL_DESKTOP;
|
||||
break;
|
||||
|
||||
case userApplicationDataDirectory:
|
||||
return juce_getSpecialFolderPath (CSIDL_APPDATA);
|
||||
csidlType = CSIDL_APPDATA;
|
||||
break;
|
||||
|
||||
case commonApplicationDataDirectory:
|
||||
return juce_getSpecialFolderPath (CSIDL_COMMON_APPDATA);
|
||||
csidlType = CSIDL_COMMON_APPDATA;
|
||||
break;
|
||||
|
||||
case globalApplicationsDirectory:
|
||||
return juce_getSpecialFolderPath (CSIDL_PROGRAM_FILES);
|
||||
csidlType = CSIDL_PROGRAM_FILES;
|
||||
break;
|
||||
|
||||
case userMusicDirectory:
|
||||
csidlType = CSIDL_MYMUSIC;
|
||||
break;
|
||||
|
||||
case userMoviesDirectory:
|
||||
csidlType = CSIDL_MYVIDEO;
|
||||
break;
|
||||
|
||||
case tempDirectory:
|
||||
#if JUCE_ENABLE_WIN98_COMPATIBILITY
|
||||
|
|
@ -643,10 +658,10 @@ const File JUCE_CALLTYPE File::getSpecialLocation (const SpecialLocationType typ
|
|||
|
||||
default:
|
||||
jassertfalse // unknown type?
|
||||
break;
|
||||
return File::nonexistent;
|
||||
}
|
||||
|
||||
return File::nonexistent;
|
||||
return juce_getSpecialFolderPath (csidlType);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2191,7 +2191,6 @@ private:
|
|||
case WM_DISPLAYCHANGE:
|
||||
InvalidateRect (h, 0, 0);
|
||||
createPaletteIfNeeded = true;
|
||||
handleScreenSizeChange();
|
||||
// intentional fall-through...
|
||||
case WM_SETTINGCHANGE: // note the fall-through in the previous case!
|
||||
doSettingChange();
|
||||
|
|
|
|||
|
|
@ -7961,3 +7961,4 @@ static const unsigned char temp17[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61
|
|||
110,100,77,97,110,97,103,101,114,42,32,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,13,10,123,13,10,32,32,32,32,114,101,116,117,114,
|
||||
110,32,110,101,119,32,87,105,100,103,101,116,115,68,101,109,111,32,40,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,59,13,10,125,13,10,0,0};
|
||||
const char* BinaryData::widgetsdemo_cpp = (const char*) temp17;
|
||||
|
||||
|
|
|
|||
|
|
@ -911,3 +911,4 @@ static const unsigned char temp4[] = {137,80,78,71,13,10,26,10,0,0,0,13,73,72,68
|
|||
0,98,28,9,155,95,0,2,104,68,236,11,1,8,160,17,225,73,128,0,3,0,120,52,172,151,198,78,252,63,0,0,0,0,73,69,78,68,174,66,
|
||||
96,130,0,0};
|
||||
const char* BinaryData::prefs_misc_png = (const char*) temp4;
|
||||
|
||||
|
|
|
|||
|
|
@ -77,12 +77,26 @@ Desktop& JUCE_CALLTYPE Desktop::getInstance() throw()
|
|||
//==============================================================================
|
||||
void Desktop::refreshMonitorSizes() throw()
|
||||
{
|
||||
const Array <Rectangle> oldClipped (monitorCoordsClipped);
|
||||
const Array <Rectangle> oldUnclipped (monitorCoordsUnclipped);
|
||||
|
||||
monitorCoordsClipped.clear();
|
||||
monitorCoordsUnclipped.clear();
|
||||
juce_updateMultiMonitorInfo (monitorCoordsClipped, true);
|
||||
juce_updateMultiMonitorInfo (monitorCoordsUnclipped, false);
|
||||
jassert (monitorCoordsClipped.size() > 0
|
||||
&& monitorCoordsClipped.size() == monitorCoordsUnclipped.size());
|
||||
|
||||
if (oldClipped != monitorCoordsClipped
|
||||
|| oldUnclipped != monitorCoordsUnclipped)
|
||||
{
|
||||
for (int i = ComponentPeer::getNumPeers(); --i >= 0;)
|
||||
{
|
||||
ComponentPeer* const p = ComponentPeer::getPeer (i);
|
||||
if (p != 0)
|
||||
p->handleScreenSizeChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Desktop::getNumDisplayMonitors() const throw()
|
||||
|
|
|
|||
|
|
@ -759,7 +759,15 @@ public:
|
|||
So on windows, this would be something like "c:\program files", on the
|
||||
Mac "/Applications", or "/usr" on linux.
|
||||
*/
|
||||
globalApplicationsDirectory
|
||||
globalApplicationsDirectory,
|
||||
|
||||
/** The most likely place where a user might store their music files.
|
||||
*/
|
||||
userMusicDirectory,
|
||||
|
||||
/** The most likely place where a user might store their movie files.
|
||||
*/
|
||||
userMoviesDirectory,
|
||||
};
|
||||
|
||||
/** Finds the location of a special type of file or directory, such as a home folder or
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue