Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
99102fb62e
12 changed files with 63 additions and 64 deletions
  1. +0
    -3
      build/win32/platform_specific_code/juce_win32_AudioCDReader.cpp
  2. +5
    -7
      build/win32/platform_specific_code/juce_win32_Messaging.cpp
  3. +1
    -0
      build/win32/vc8/JUCE.vcproj
  4. +3
    -0
      extras/example projects/example_project_for_Win32/juce_application.vcproj
  5. +4
    -0
      extras/juce demo/build/win32_vc8/jucedemo.vcproj
  6. +1
    -1
      src/juce_appframework/gui/components/buttons/juce_Button.cpp
  7. +2
    -7
      src/juce_core/io/files/juce_FileInputStream.cpp
  8. +1
    -1
      src/juce_core/io/files/juce_FileInputStream.h
  9. +20
    -17
      src/juce_core/text/juce_LocalisedStrings.cpp
  10. +18
    -8
      src/juce_core/text/juce_LocalisedStrings.h
  11. +4
    -17
      src/juce_core/text/juce_String.cpp
  12. +4
    -3
      src/juce_core/text/juce_String.h

+ 0
- 3
build/win32/platform_specific_code/juce_win32_AudioCDReader.cpp View File

@@ -29,9 +29,6 @@
============================================================================== ==============================================================================
*/ */
#define WIN32_LEAN_AND_MEAN
#define STRICT
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning (disable: 4514) #pragma warning (disable: 4514)
#pragma warning (push) #pragma warning (push)


+ 5
- 7
build/win32/platform_specific_code/juce_win32_Messaging.cpp View File

@@ -55,9 +55,9 @@ extern long improbableWindowNumber; // defined in windowing.cpp
//============================================================================== //==============================================================================
static LRESULT CALLBACK juce_MessageWndProc (HWND h, static LRESULT CALLBACK juce_MessageWndProc (HWND h,
UINT message,
WPARAM wParam,
LPARAM lParam) throw()
const UINT message,
const WPARAM wParam,
const LPARAM lParam) throw()
{ {
JUCE_TRY JUCE_TRY
{ {
@@ -93,15 +93,13 @@ static LRESULT CALLBACK juce_MessageWndProc (HWND h,
return 0; return 0;
} }
} }
return DefWindowProc (h, message, wParam, lParam);
} }
JUCE_CATCH_EXCEPTION JUCE_CATCH_EXCEPTION
return 0;
return DefWindowProc (h, message, wParam, lParam);
} }
bool juce_dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages)
bool juce_dispatchNextMessageOnSystemQueue (const bool returnIfNoPendingMessages)
{ {
MSG m; MSG m;


+ 1
- 0
build/win32/vc8/JUCE.vcproj View File

@@ -136,6 +136,7 @@
/> />
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
AdditionalOptions="/LTCG"
OutputFile="../../../bin/jucelib_static_$(PlatformName).lib" OutputFile="../../../bin/jucelib_static_$(PlatformName).lib"
IgnoreAllDefaultLibraries="true" IgnoreAllDefaultLibraries="true"
/> />


+ 3
- 0
extras/example projects/example_project_for_Win32/juce_application.vcproj View File

@@ -174,9 +174,12 @@
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../bin" AdditionalLibraryDirectories="../../bin"
GenerateManifest="false"
ProgramDatabaseFile=".\Release/juce_application.pdb" ProgramDatabaseFile=".\Release/juce_application.pdb"
SubSystem="2" SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="2"
OptimizeForWindows98="1"
LinkTimeCodeGeneration="1" LinkTimeCodeGeneration="1"
TargetMachine="1" TargetMachine="1"
/> />


+ 4
- 0
extras/juce demo/build/win32_vc8/jucedemo.vcproj View File

@@ -78,9 +78,13 @@
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../juce/bin" AdditionalLibraryDirectories="../../../juce/bin"
GenerateManifest="false"
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames=""
ProgramDatabaseFile=".\Release/jucedemo.pdb" ProgramDatabaseFile=".\Release/jucedemo.pdb"
SubSystem="2" SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1" TargetMachine="1"
/> />
<Tool <Tool


+ 1
- 1
src/juce_appframework/gui/components/buttons/juce_Button.cpp View File

@@ -690,7 +690,7 @@ void Button::repeatTimerCallback() throw()
class InternalButtonRepeatTimer : public Timer class InternalButtonRepeatTimer : public Timer
{ {
public: public:
InternalButtonRepeatTimer (Button& owner_)
InternalButtonRepeatTimer (Button& owner_) throw()
: owner (owner_) : owner (owner_)
{ {
} }


+ 2
- 7
src/juce_core/io/files/juce_FileInputStream.cpp View File

@@ -49,9 +49,9 @@ FileInputStream::FileInputStream (const File& f)
currentPosition (0), currentPosition (0),
needToSeek (true) needToSeek (true)
{ {
totalSize = file.getSize();
totalSize = f.getSize();
fileHandle = juce_fileOpen (file.getFullPathName(), false);
fileHandle = juce_fileOpen (f.getFullPathName(), false);
} }
FileInputStream::~FileInputStream() FileInputStream::~FileInputStream()
@@ -60,11 +60,6 @@ FileInputStream::~FileInputStream()
} }
//============================================================================== //==============================================================================
const File FileInputStream::getFile() const
{
return file;
}
int64 FileInputStream::getTotalLength() int64 FileInputStream::getTotalLength()
{ {
return totalSize; return totalSize;


+ 1
- 1
src/juce_core/io/files/juce_FileInputStream.h View File

@@ -57,7 +57,7 @@ public:
~FileInputStream(); ~FileInputStream();
//============================================================================== //==============================================================================
const File getFile() const;
const File& getFile() const throw() { return file; }
//============================================================================== //==============================================================================
int64 getTotalLength(); int64 getTotalLength();


+ 20
- 17
src/juce_core/text/juce_LocalisedStrings.cpp View File

@@ -38,46 +38,45 @@ BEGIN_JUCE_NAMESPACE
//============================================================================== //==============================================================================
LocalisedStrings::LocalisedStrings (const String& fileContents)
LocalisedStrings::LocalisedStrings (const String& fileContents) throw()
{ {
loadFromText (fileContents); loadFromText (fileContents);
} }
LocalisedStrings::LocalisedStrings (const File& fileToLoad)
LocalisedStrings::LocalisedStrings (const File& fileToLoad) throw()
{ {
loadFromText (fileToLoad.loadFileAsString()); loadFromText (fileToLoad.loadFileAsString());
} }
LocalisedStrings::~LocalisedStrings()
LocalisedStrings::~LocalisedStrings() throw()
{ {
} }
//============================================================================== //==============================================================================
const String LocalisedStrings::translate (const String& text) const
const String LocalisedStrings::translate (const String& text) const throw()
{ {
return translations.getValue (text, text); return translations.getValue (text, text);
} }
static int findCloseQuote (const String& text, int startPos)
static int findCloseQuote (const String& text, int startPos) throw()
{ {
bool lastCharWasSlash = false;
tchar lastChar = 0;
for (;;) for (;;)
{ {
const tchar c = text [startPos]; const tchar c = text [startPos];
if (c == 0 || (c == T('"') && ! lastCharWasSlash))
if (c == 0 || (c == T('"') && lastChar != T('\\')))
break; break;
lastCharWasSlash = (c == T('\\'));
lastChar = c;
++startPos; ++startPos;
} }
return startPos; return startPos;
} }
static const String unescapeString (const String& s)
static const String unescapeString (const String& s) throw()
{ {
return s.replace (T("\\\""), T("\"")) return s.replace (T("\\\""), T("\""))
.replace (T("\\\'"), T("\'")) .replace (T("\\\'"), T("\'"))
@@ -86,7 +85,7 @@ static const String unescapeString (const String& s)
.replace (T("\\n"), T("\n")); .replace (T("\\n"), T("\n"));
} }
void LocalisedStrings::loadFromText (const String& fileContents)
void LocalisedStrings::loadFromText (const String& fileContents) throw()
{ {
StringArray lines; StringArray lines;
lines.addLines (fileContents); lines.addLines (fileContents);
@@ -129,22 +128,20 @@ void LocalisedStrings::loadFromText (const String& fileContents)
static CriticalSection currentMappingsLock; static CriticalSection currentMappingsLock;
static LocalisedStrings* currentMappings = 0; static LocalisedStrings* currentMappings = 0;
void LocalisedStrings::setCurrentMappings (LocalisedStrings* newTranslations)
void LocalisedStrings::setCurrentMappings (LocalisedStrings* newTranslations) throw()
{ {
const ScopedLock sl (currentMappingsLock); const ScopedLock sl (currentMappingsLock);
if (currentMappings != 0)
delete currentMappings;
delete currentMappings;
currentMappings = newTranslations; currentMappings = newTranslations;
} }
LocalisedStrings* LocalisedStrings::getCurrentMappings()
LocalisedStrings* LocalisedStrings::getCurrentMappings() throw()
{ {
return currentMappings; return currentMappings;
} }
const String LocalisedStrings::translateWithCurrentMappings (const String& text)
const String LocalisedStrings::translateWithCurrentMappings (const String& text) throw()
{ {
const ScopedLock sl (currentMappingsLock); const ScopedLock sl (currentMappingsLock);
@@ -154,4 +151,10 @@ const String LocalisedStrings::translateWithCurrentMappings (const String& text)
return text; return text;
} }
const String LocalisedStrings::translateWithCurrentMappings (const char* text) throw()
{
return translateWithCurrentMappings (String (text));
}
END_JUCE_NAMESPACE END_JUCE_NAMESPACE

+ 18
- 8
src/juce_core/text/juce_LocalisedStrings.h View File

@@ -100,17 +100,17 @@ public:
When you create one of these, you can call setCurrentMappings() to make it When you create one of these, you can call setCurrentMappings() to make it
the set of mappings that the system's using. the set of mappings that the system's using.
*/ */
LocalisedStrings (const String& fileContents);
LocalisedStrings (const String& fileContents) throw();
/** Creates a set of translations from a file. /** Creates a set of translations from a file.
When you create one of these, you can call setCurrentMappings() to make it When you create one of these, you can call setCurrentMappings() to make it
the set of mappings that the system's using. the set of mappings that the system's using.
*/ */
LocalisedStrings (const File& fileToLoad);
LocalisedStrings (const File& fileToLoad) throw();
/** Destructor. */ /** Destructor. */
~LocalisedStrings();
~LocalisedStrings() throw();
//============================================================================== //==============================================================================
/** Selects the current set of mappings to be used by the system. /** Selects the current set of mappings to be used by the system.
@@ -123,14 +123,14 @@ public:
@see translateWithCurrentMappings @see translateWithCurrentMappings
*/ */
static void setCurrentMappings (LocalisedStrings* newTranslations);
static void setCurrentMappings (LocalisedStrings* newTranslations) throw();
/** Returns the currently selected set of mappings. /** Returns the currently selected set of mappings.
This is the object that was last passed to setCurrentMappings(). It may This is the object that was last passed to setCurrentMappings(). It may
be 0 if none has been created. be 0 if none has been created.
*/ */
static LocalisedStrings* getCurrentMappings();
static LocalisedStrings* getCurrentMappings() throw();
/** Tries to translate a string using the currently selected set of mappings. /** Tries to translate a string using the currently selected set of mappings.
@@ -141,15 +141,25 @@ public:
@see setCurrentMappings, getCurrentMappings @see setCurrentMappings, getCurrentMappings
*/ */
static const String translateWithCurrentMappings (const String& text);
static const String translateWithCurrentMappings (const String& text) throw();
/** Tries to translate a string using the currently selected set of mappings.
If no mapping has been set, or if the mapping doesn't contain a translation
for the string, this will just return the original string.
See also the TRANS() macro, which uses this method to do its translation.
@see setCurrentMappings, getCurrentMappings
*/
static const String translateWithCurrentMappings (const char* text) throw();
//============================================================================== //==============================================================================
/** Attempts to look up a string and return its localised version. /** Attempts to look up a string and return its localised version.
If the string isn't found in the list, the original string will be returned. If the string isn't found in the list, the original string will be returned.
*/ */
const String translate (const String& text) const;
const String translate (const String& text) const throw();
/** Returns the name of the language specified in the translation file. /** Returns the name of the language specified in the translation file.
@@ -179,7 +189,7 @@ private:
StringArray countryCodes; StringArray countryCodes;
StringPairArray translations; StringPairArray translations;
void loadFromText (const String& fileContents);
void loadFromText (const String& fileContents) throw();
}; };


+ 4
- 17
src/juce_core/text/juce_String.cpp View File

@@ -1892,20 +1892,7 @@ const String String::toHexString (const int64 number) throw()
const String String::toHexString (const short number) throw() const String String::toHexString (const short number) throw()
{ {
tchar buffer[32];
tchar* const end = buffer + 32;
tchar* t = end;
*--t = 0;
unsigned short v = (unsigned short) number;
do
{
*--t = hexDigits [v & 15];
v >>= 4;
} while (v != 0);
return String (t, (int) (((char*) end) - (char*) t));
return toHexString ((int) (unsigned short) number);
} }
const String String::toHexString (const unsigned char* data, const String String::toHexString (const unsigned char* data,
@@ -2048,7 +2035,7 @@ const String String::createStringFromData (const void* const data_,
} }
//============================================================================== //==============================================================================
const char* String::toUTF8() const
const char* String::toUTF8() const throw()
{ {
if (isEmpty()) if (isEmpty())
{ {
@@ -2074,7 +2061,7 @@ const char* String::toUTF8() const
} }
} }
int String::copyToUTF8 (uint8* buffer) const
int String::copyToUTF8 (uint8* const buffer) const throw()
{ {
#if JUCE_STRINGS_ARE_UNICODE #if JUCE_STRINGS_ARE_UNICODE
int num = 0, index = 0; int num = 0, index = 0;
@@ -2141,7 +2128,7 @@ int String::copyToUTF8 (uint8* buffer) const
#endif #endif
} }
const String String::fromUTF8 (const uint8* buffer, int bufferSizeBytes)
const String String::fromUTF8 (const uint8* const buffer, int bufferSizeBytes) throw()
{ {
if (buffer == 0) if (buffer == 0)
return empty; return empty;


+ 4
- 3
src/juce_core/text/juce_String.h View File

@@ -982,7 +982,7 @@ public:
the method just returns the number of bytes required the method just returns the number of bytes required
(including the terminating null character). (including the terminating null character).
*/ */
int copyToUTF8 (uint8* destBuffer) const;
int copyToUTF8 (uint8* const destBuffer) const throw();
/** Returns a pointer to a UTF-8 version of this string. /** Returns a pointer to a UTF-8 version of this string.
@@ -990,13 +990,14 @@ public:
that is returned must not be stored anywhere, as it can be deleted whenever the that is returned must not be stored anywhere, as it can be deleted whenever the
string changes. string changes.
*/ */
const char* toUTF8() const;
const char* toUTF8() const throw();
/** Creates a String from a UTF-8 encoded buffer. /** Creates a String from a UTF-8 encoded buffer.
If the size is < 0, it'll keep reading until it hits a zero. If the size is < 0, it'll keep reading until it hits a zero.
*/ */
static const String fromUTF8 (const uint8* utf8buffer, int bufferSizeBytes = -1);
static const String fromUTF8 (const uint8* const utf8buffer,
int bufferSizeBytes = -1) throw();
//============================================================================== //==============================================================================
/** Increases the string's internally allocated storage. /** Increases the string's internally allocated storage.


Loading…
Cancel
Save