diff --git a/extras/Jucer (experimental)/Source/jucer_Main.cpp b/extras/Jucer (experimental)/Source/jucer_Main.cpp index 1d2f804730..075507c929 100644 --- a/extras/Jucer (experimental)/Source/jucer_Main.cpp +++ b/extras/Jucer (experimental)/Source/jucer_Main.cpp @@ -53,7 +53,7 @@ public: ImageCache::setCacheTimeout (30 * 1000); if (commandLine.trim().isNotEmpty() - && ! commandLine.trim().startsWithChar (T('-'))) + && ! commandLine.trim().startsWithChar ('-')) anotherInstanceStarted (commandLine); theMainWindow->reloadLastProject(); diff --git a/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.cpp b/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.cpp index 23ed5fd2c2..aed4f45f0d 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_NewFileWizard.cpp @@ -220,7 +220,7 @@ void NewFileWizard::showFailedToWriteMessage (const File& file) const File NewFileWizard::askUserToChooseNewFile (const String& suggestedFilename, const String& wildcard, const Project::Item& projectGroupToAddTo) { - FileChooser fc (T("Select File to Create"), + FileChooser fc ("Select File to Create", projectGroupToAddTo.determineGroupFolder() .getChildFile (suggestedFilename) .getNonexistentSibling(), diff --git a/extras/Jucer (experimental)/Source/model/jucer_Project.cpp b/extras/Jucer (experimental)/Source/model/jucer_Project.cpp index f099ef12eb..5f1a581bc7 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_Project.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_Project.cpp @@ -417,7 +417,7 @@ Project::Item Project::createNewItem (const File& file) Item item (*this, ValueTree (Tags::file)); item.createUIDIfMissing(); item.getName() = file.getFileName(); - item.getShouldCompileValue() = file.hasFileExtension (T("cpp;mm;c;m")); + item.getShouldCompileValue() = file.hasFileExtension ("cpp;mm;c;m"); item.getShouldAddToResourceValue() = shouldBeAddedToBinaryResourcesByDefault (file); return item; } @@ -845,7 +845,7 @@ void Project::BuildConfiguration::createPropertyEditors (Array 0) - settings.add ("OTHER_LDFLAGS = \"" + linkerFlags.joinIntoString (T(" ")) + "\""); + settings.add ("OTHER_LDFLAGS = \"" + linkerFlags.joinIntoString (" ") + "\""); if (librarySearchPaths.size() > 0) { @@ -489,19 +489,19 @@ private: if (iPhone) { - s.addTokens (T("UIKit Foundation CoreGraphics AudioToolbox"), false); + s.addTokens ("UIKit Foundation CoreGraphics AudioToolbox", false); if ((int) project.getJuceConfigFlag ("JUCE_OPENGL").getValue() == 1) - s.addTokens (T("QuartzCore OpenGLES"), false); + s.addTokens ("QuartzCore OpenGLES", false); } else { - s.addTokens (T("Cocoa Carbon IOKit CoreAudio CoreMIDI WebKit DiscRecording OpenGL QuartzCore QTKit QuickTime"), false); + s.addTokens ("Cocoa Carbon IOKit CoreAudio CoreMIDI WebKit DiscRecording OpenGL QuartzCore QTKit QuickTime", false); if (isAU()) - s.addTokens (T("AudioUnit CoreAudioKit AudioToolbox"), false); + s.addTokens ("AudioUnit CoreAudioKit AudioToolbox", false); else if ((int) project.getJuceConfigFlag ("JUCE_PLUGINHOST_AU").getValue() == 1) - s.addTokens (T("AudioUnit CoreAudioKit"), false); + s.addTokens ("AudioUnit CoreAudioKit", false); } for (int i = 0; i < s.size(); ++i) @@ -536,8 +536,8 @@ private: String val (o.getProperty (name).toString()); if (val.isEmpty() || (val.containsAnyOf (T(" \t;<>()=,-\r\n")) - && ! (val.trimStart().startsWithChar (T('(')) - || val.trimStart().startsWithChar (T('{'))))) + && ! (val.trimStart().startsWithChar ('(') + || val.trimStart().startsWithChar ('{')))) val = val.quoted(); output << name.name << " = " << val << "; "; @@ -602,20 +602,20 @@ private: static const String getFileType (const RelativePath& file) { - if (file.hasFileExtension (T(".cpp"))) return "sourcecode.cpp.cpp"; - else if (file.hasFileExtension (T(".mm"))) return "sourcecode.cpp.objcpp"; - else if (file.hasFileExtension (T(".m"))) return "sourcecode.c.objc"; - else if (file.hasFileExtension (T(".h;.hpp"))) return "sourcecode.c.h"; - else if (file.hasFileExtension (T(".framework"))) return "wrapper.framework"; - else if (file.hasFileExtension (T(".jpeg;.jpg"))) return "image.jpeg"; - else if (file.hasFileExtension (T("png;gif"))) return "image" + file.getFileExtension(); - else if (file.hasFileExtension (T("html;htm"))) return "text.html"; - else if (file.hasFileExtension (T("txt;rtf"))) return "text" + file.getFileExtension(); - else if (file.hasFileExtension (T("plist"))) return "text.plist.xml"; - else if (file.hasFileExtension (T("app"))) return "wrapper.application"; - else if (file.hasFileExtension (T("component;vst;plugin"))) return "wrapper.cfbundle"; - else if (file.hasFileExtension (T("xcodeproj"))) return "wrapper.pb-project"; - else if (file.hasFileExtension (T("a"))) return "archive.ar"; + if (file.hasFileExtension (".cpp")) return "sourcecode.cpp.cpp"; + else if (file.hasFileExtension (".mm")) return "sourcecode.cpp.objcpp"; + else if (file.hasFileExtension (".m")) return "sourcecode.c.objc"; + else if (file.hasFileExtension (".h;.hpp")) return "sourcecode.c.h"; + else if (file.hasFileExtension (".framework")) return "wrapper.framework"; + else if (file.hasFileExtension (".jpeg;.jpg")) return "image.jpeg"; + else if (file.hasFileExtension ("png;gif")) return "image" + file.getFileExtension(); + else if (file.hasFileExtension ("html;htm")) return "text.html"; + else if (file.hasFileExtension ("txt;rtf")) return "text" + file.getFileExtension(); + else if (file.hasFileExtension ("plist")) return "text.plist.xml"; + else if (file.hasFileExtension ("app")) return "wrapper.application"; + else if (file.hasFileExtension ("component;vst;plugin")) return "wrapper.cfbundle"; + else if (file.hasFileExtension ("xcodeproj")) return "wrapper.pb-project"; + else if (file.hasFileExtension ("a")) return "archive.ar"; return "file" + file.getFileExtension(); } @@ -869,7 +869,7 @@ private: return " "; return "\n\t\t\t\t" + list.joinIntoString (separator + "\n\t\t\t\t") - + (separator == T(";") ? separator : String::empty); + + (separator == ";" ? separator : String::empty); } const String createID (const RelativePath& path) const @@ -896,7 +896,7 @@ private: bool shouldFileBeCompiledByDefault (const RelativePath& file) const { - return file.hasFileExtension (T("cpp;mm;c;m")); + return file.hasFileExtension ("cpp;mm;c;m"); } //============================================================================== diff --git a/extras/Jucer (experimental)/Source/model/jucer_ProjectSaver.h b/extras/Jucer (experimental)/Source/model/jucer_ProjectSaver.h index 514c260fbc..a3e06ab1af 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ProjectSaver.h +++ b/extras/Jucer (experimental)/Source/model/jucer_ProjectSaver.h @@ -296,7 +296,7 @@ private: static int countMaxPluginChannels (const String& configString, bool isInput) { StringArray configs; - configs.addTokens (configString, T(", {}"), String::empty); + configs.addTokens (configString, ", {}", String::empty); configs.trim(); configs.removeEmptyStrings(); jassert ((configs.size() & 1) == 0); // looks like a syntax error in the configs? @@ -311,7 +311,7 @@ private: static const String createVersionCode (const String& version) { StringArray configs; - configs.addTokens (version, T(",."), String::empty); + configs.addTokens (version, ",.", String::empty); configs.trim(); configs.removeEmptyStrings(); diff --git a/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.cpp b/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.cpp index 9f6ed76583..69c521c5ad 100644 --- a/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.cpp +++ b/extras/Jucer (experimental)/Source/model/jucer_ResourceFile.cpp @@ -44,7 +44,7 @@ ResourceFile::~ResourceFile() bool ResourceFile::isResourceFile (const File& file) { - if (file.hasFileExtension (T("cpp;h"))) + if (file.hasFileExtension ("cpp;h")) { ScopedPointer in (file.createInputStream()); diff --git a/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.cpp b/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.cpp index 1000bd8043..0a2764aad2 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_DocumentEditorComponent.cpp @@ -82,21 +82,21 @@ void DocumentEditorComponent::getCommandInfo (const CommandID commandID, Applica result.setInfo ("Save" + name, "Saves the current document", CommandCategories::general, 0); - result.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier, 0)); + result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier, 0)); break; case CommandIDs::saveDocumentAs: result.setInfo ("Save" + name + " As...", "Saves the current document to a different filename", CommandCategories::general, 0); - result.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); + result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); break; case CommandIDs::closeDocument: result.setInfo ("Close" + name, "Closes the current document", CommandCategories::general, 0); - result.defaultKeypresses.add (KeyPress (T('w'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); + result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); break; default: diff --git a/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.cpp b/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.cpp index 678fe26811..aa8f62458a 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_MainWindow.cpp @@ -273,7 +273,7 @@ const PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex, PopupMenu recentFiles; StoredSettings::getInstance()->recentFiles.createPopupMenuItems (recentFiles, 100, true, true); - menu.addSubMenu (T("Open recent file"), recentFiles); + menu.addSubMenu ("Open recent file", recentFiles); menu.addSeparator(); menu.addCommandItem (commandManager, CommandIDs::closeDocument); @@ -415,36 +415,36 @@ void MainWindow::getCommandInfo (const CommandID commandID, ApplicationCommandIn switch (commandID) { case CommandIDs::newProject: - result.setInfo (T("New Project..."), - T("Creates a new Jucer project"), + result.setInfo ("New Project...", + "Creates a new Jucer project", CommandCategories::general, 0); - result.defaultKeypresses.add (KeyPress (T('o'), ModifierKeys::commandModifier, 0)); + result.defaultKeypresses.add (KeyPress ('o', ModifierKeys::commandModifier, 0)); break; case CommandIDs::open: - result.setInfo (T("Open..."), - T("Opens a Jucer project"), + result.setInfo ("Open...", + "Opens a Jucer project", CommandCategories::general, 0); - result.defaultKeypresses.add (KeyPress (T('o'), ModifierKeys::commandModifier, 0)); + result.defaultKeypresses.add (KeyPress ('o', ModifierKeys::commandModifier, 0)); break; case CommandIDs::showPrefs: - result.setInfo (T("Preferences..."), - T("Shows the preferences panel."), + result.setInfo ("Preferences...", + "Shows the preferences panel.", CommandCategories::general, 0); - result.defaultKeypresses.add (KeyPress (T(','), ModifierKeys::commandModifier, 0)); + result.defaultKeypresses.add (KeyPress (',', ModifierKeys::commandModifier, 0)); break; case CommandIDs::closeAllDocuments: - result.setInfo (T("Close All Documents"), - T("Closes all open documents"), + result.setInfo ("Close All Documents", + "Closes all open documents", CommandCategories::general, 0); result.setActive (OpenDocumentManager::getInstance()->getNumOpenDocuments() > 0); break; case CommandIDs::saveAll: - result.setInfo (T("Save All"), - T("Saves all open documents"), + result.setInfo ("Save All", + "Saves all open documents", CommandCategories::general, 0); result.setActive (OpenDocumentManager::getInstance()->anyFilesNeedSaving()); break; diff --git a/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.cpp b/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.cpp index 736c012bd4..bd40f80e03 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_OpenDocumentManager.cpp @@ -270,7 +270,7 @@ FileBasedDocument::SaveResult OpenDocumentManager::saveIfNeededAndUserAgrees (Op const int r = AlertWindow::showYesNoCancelBox (AlertWindow::QuestionIcon, TRANS("Closing document..."), TRANS("Do you want to save the changes to \"") - + doc->getName() + T("\"?"), + + doc->getName() + "\"?", TRANS("save"), TRANS("discard changes"), TRANS("cancel")); diff --git a/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.cpp b/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.cpp index 850933faed..be263385f7 100644 --- a/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.cpp +++ b/extras/Jucer (experimental)/Source/ui/jucer_ProjectContentComponent.cpp @@ -204,53 +204,53 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica switch (commandID) { case CommandIDs::saveProject: - result.setInfo (T("Save Project"), - T("Saves the current project"), + result.setInfo ("Save Project", + "Saves the current project", CommandCategories::general, 0); result.setActive (project != 0); - result.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier, 0)); + result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier, 0)); break; case CommandIDs::saveProjectAs: - result.setInfo (T("Save Project As..."), - T("Saves the current project to a different filename"), + result.setInfo ("Save Project As...", + "Saves the current project to a different filename", CommandCategories::general, 0); result.setActive (project != 0); - result.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); + result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); break; case CommandIDs::closeProject: - result.setInfo (T("Close Project"), - T("Closes the current project"), + result.setInfo ("Close Project", + "Closes the current project", CommandCategories::general, 0); result.setActive (project != 0); - result.defaultKeypresses.add (KeyPress (T('w'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); + result.defaultKeypresses.add (KeyPress ('w', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); break; case CommandIDs::openProjectInIDE: #if JUCE_MAC - result.setInfo (T("Save Project and Open in XCode..."), + result.setInfo ("Save Project and Open in XCode...", #elif JUCE_WINDOWS - result.setInfo (T("Save Project and Open in Visual Studio..."), + result.setInfo ("Save Project and Open in Visual Studio...", #else - result.setInfo (T("Save Project and Open as a Makefile..."), + result.setInfo ("Save Project and Open as a Makefile...", #endif - T("Saves the project and launches it in an external IDE"), + "Saves the project and launches it in an external IDE", CommandCategories::general, 0); result.setActive (project != 0); - result.defaultKeypresses.add (KeyPress (T('l'), ModifierKeys::commandModifier, 0)); + result.defaultKeypresses.add (KeyPress ('l', ModifierKeys::commandModifier, 0)); break; case CommandIDs::showProjectSettings: - result.setInfo (T("Show Project Build Settings"), - T("Shows the build options for the project"), + result.setInfo ("Show Project Build Settings", + "Shows the build options for the project", CommandCategories::general, 0); result.setActive (project != 0); - result.defaultKeypresses.add (KeyPress (T('i'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); + result.defaultKeypresses.add (KeyPress ('i', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); break; case StandardApplicationCommandIDs::del: - result.setInfo (T("Delete"), String::empty, CommandCategories::general, 0); + result.setInfo ("Delete", String::empty, CommandCategories::general, 0); result.setActive (projectTree != 0); result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0)); break; diff --git a/extras/Jucer (experimental)/Source/utility/jucer_ColourEditorComponent.h b/extras/Jucer (experimental)/Source/utility/jucer_ColourEditorComponent.h index c80c9bda6b..463f911cdf 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_ColourEditorComponent.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_ColourEditorComponent.h @@ -115,7 +115,7 @@ private: if (canResetToDefault) { - addAndMakeVisible (defaultButton = new TextButton (T("Reset to Default"))); + addAndMakeVisible (defaultButton = new TextButton ("Reset to Default")); defaultButton->addButtonListener (this); } } diff --git a/extras/Jucer (experimental)/Source/utility/jucer_RelativePath.h b/extras/Jucer (experimental)/Source/utility/jucer_RelativePath.h index 70c910c232..5a3057d502 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_RelativePath.h +++ b/extras/Jucer (experimental)/Source/utility/jucer_RelativePath.h @@ -71,13 +71,13 @@ public: const RelativePath withFileExtension (const String& extension) const { - return RelativePath (path.upToLastOccurrenceOf (T("."), ! extension.startsWithChar (T('.')), false) + extension, root); + return RelativePath (path.upToLastOccurrenceOf (T("."), ! extension.startsWithChar ('.'), false) + extension, root); } const RelativePath getParentDirectory() const { String p (path); - if (path.endsWithChar (T('/'))) + if (path.endsWithChar ('/')) p = p.dropLastCharacters (1); return RelativePath (p.upToLastOccurrenceOf (T("/"), false, false), root); @@ -89,7 +89,7 @@ public: return RelativePath (subpath, root); String p (toUnixStyle()); - if (! p.endsWithChar (T('/'))) + if (! p.endsWithChar ('/')) p << '/'; return RelativePath (p + subpath, root); @@ -116,9 +116,9 @@ private: static bool isAbsolute (const String& path) { return File::isAbsolutePath (path) - || path.startsWithChar (T('$')) - || path.startsWithChar (T('~')) - || (CharacterFunctions::isLetter (path[0]) && path[1] == T(':')); + || path.startsWithChar ('$') + || path.startsWithChar ('~') + || (CharacterFunctions::isLetter (path[0]) && path[1] == ':'); } }; diff --git a/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.cpp b/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.cpp index c366c5db54..1fbd87a623 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.cpp +++ b/extras/Jucer (experimental)/Source/utility/jucer_StoredSettings.cpp @@ -54,26 +54,26 @@ void StoredSettings::flush() { if (props != 0) { - props->setValue (T("recentFiles"), recentFiles.toString()); + props->setValue ("recentFiles", recentFiles.toString()); - props->removeValue (T("keyMappings")); + props->removeValue ("keyMappings"); ScopedPointer keys (commandManager->getKeyMappings()->createXml (true)); if (keys != 0) - props->setValue (T("keyMappings"), (XmlElement*) keys); + props->setValue ("keyMappings", (XmlElement*) keys); } deleteAndZero (props); - props = PropertiesFile::createDefaultAppPropertiesFile (T("Jucer2"), - T("settings"), + props = PropertiesFile::createDefaultAppPropertiesFile ("Jucer2", + "settings", String::empty, false, 3000, PropertiesFile::storeAsXML); // recent files... - recentFiles.restoreFromString (props->getValue (T("recentFiles"))); + recentFiles.restoreFromString (props->getValue ("recentFiles")); recentFiles.removeNonExistentFiles(); } diff --git a/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp b/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp index 802c982bbe..4396c4a676 100644 --- a/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp +++ b/extras/Jucer (experimental)/Source/utility/jucer_UtilityFunctions.cpp @@ -150,27 +150,27 @@ const String createGUID (const String& seed) const String unixStylePath (const String& path) { - return path.replaceCharacter (T('\\'), T('/')); + return path.replaceCharacter ('\\', '/'); } const String windowsStylePath (const String& path) { - return path.replaceCharacter (T('/'), T('\\')); + return path.replaceCharacter ('/', '\\'); } const String appendPath (const String& path, const String& subpath) { if (File::isAbsolutePath (subpath) - || subpath.startsWithChar (T('$')) - || subpath.startsWithChar (T('~')) - || (CharacterFunctions::isLetter (subpath[0]) && subpath[1] == T(':'))) - return subpath.replaceCharacter (T('\\'), T('/')); + || subpath.startsWithChar ('$') + || subpath.startsWithChar ('~') + || (CharacterFunctions::isLetter (subpath[0]) && subpath[1] == ':')) + return subpath.replaceCharacter ('\\', '/'); - String path1 (path.replaceCharacter (T('\\'), T('/'))); - if (! path1.endsWithChar (T('/'))) + String path1 (path.replaceCharacter ('\\', '/')); + if (! path1.endsWithChar ('/')) path1 << '/'; - return path1 + subpath.replaceCharacter (T('\\'), T('/')); + return path1 + subpath.replaceCharacter ('\\', '/'); } bool shouldPathsBeRelative (String path1, String path2) @@ -275,34 +275,34 @@ const String replaceCEscapeChars (const String& s) switch (c) { case '\t': - r << T("\\t"); + r << "\\t"; lastWasHexEscapeCode = false; break; case '\r': - r << T("\\r"); + r << "\\r"; lastWasHexEscapeCode = false; break; case '\n': - r << T("\\n"); + r << "\\n"; lastWasHexEscapeCode = false; break; case '\\': - r << T("\\\\"); + r << "\\\\"; lastWasHexEscapeCode = false; break; case '\'': - r << T("\\\'"); + r << "\\\'"; lastWasHexEscapeCode = false; break; case '\"': - r << T("\\\""); + r << "\\\""; lastWasHexEscapeCode = false; break; default: if (c < 128 && ! (lastWasHexEscapeCode - && String (T("0123456789abcdefABCDEF")).containsChar (c))) // (have to avoid following a hex escape sequence with a valid hex digit) + && String ("0123456789abcdefABCDEF").containsChar (c))) // (have to avoid following a hex escape sequence with a valid hex digit) { r << c; lastWasHexEscapeCode = false; @@ -310,7 +310,7 @@ const String replaceCEscapeChars (const String& s) else { lastWasHexEscapeCode = true; - r << T("\\x") << String::toHexString ((int) c); + r << "\\x" << String::toHexString ((int) c); } break; @@ -339,12 +339,12 @@ const String makeValidCppIdentifier (String s, && ! CharacterFunctions::isUpperCase (s[i - 1])) s = s.substring (0, i) + T(" ") + s.substring (i); - String allowedChars (T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ 0123456789")); + String allowedChars ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ 0123456789"); if (allowTemplates) - allowedChars += T("<>"); + allowedChars += "<>"; if (! removeColons) - allowedChars += T(":"); + allowedChars += ":"; StringArray words; words.addTokens (s.retainCharacters (allowedChars), false); @@ -365,7 +365,7 @@ const String makeValidCppIdentifier (String s, } if (CharacterFunctions::isDigit (n[0])) - n = T("_") + n; + n = "_" + n; // make sure it's not a reserved c++ keyword.. static const tchar* const reservedWords[] = @@ -417,7 +417,7 @@ const String doubleToCode (const double v) const String boolToCode (const bool b) { - return b ? T("true") : T("false"); + return b ? "true" : "false"; } const String colourToCode (const Colour& col) @@ -441,9 +441,9 @@ const String colourToCode (const Colour& col) for (int i = 0; i < numElementsInArray (colourNames) - 1; ++i) if (col == colours[i]) - return T("Colours::") + String (colourNames[i]); + return "Colours::" + String (colourNames[i]); - return T("Colour (0x") + hexString8Digits ((int) col.getARGB()) + T(')'); + return "Colour (0x" + hexString8Digits ((int) col.getARGB()) + T(')'); } const String justificationToCode (const Justification& justification) @@ -469,7 +469,7 @@ const String justificationToCode (const Justification& justification) default: jassertfalse; break; } - return T("Justification (") + String (justification.getFlags()) + T(")"); + return "Justification (" + String (justification.getFlags()) + ")"; } const String castToFloat (const String& expression) @@ -479,12 +479,12 @@ const String castToFloat (const String& expression) String s (expression.getFloatValue()); if (s.containsChar (T('.'))) - return s + T("f"); + return s + "f"; - return s + T(".0f"); + return s + ".0f"; } - return T("(float) (") + expression + T(")"); + return "(float) (" + expression + ")"; } const String indentCode (const String& code, const int numSpaces) @@ -506,7 +506,7 @@ const String indentCode (const String& code, const int numSpaces) lines.set (i, s); } - return lines.joinIntoString (T("\n")); + return lines.joinIntoString ("\n"); } int indexOfLineStartingWith (const StringArray& lines, const String& text, int startIndex) diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index aa118de493..b24a5cecf4 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -925,7 +925,7 @@ void FileLogger::logMessage (const String& message) DBG (message); const ScopedLock sl (logLock); - (*logStream) << message << T("\r\n"); + (*logStream) << message << "\r\n"; logStream->flush(); } } @@ -1236,7 +1236,7 @@ const String RelativeTime::getDescription (const String& returnValueForZeroTime) String result; if (seconds < 0) - result = T("-"); + result = "-"; int fieldsShown = 0; int n = abs ((int) inWeeks()); @@ -2872,7 +2872,7 @@ const String BigInteger::toString (const int base, const int minimumNumCharacter if (base == 2 || base == 8 || base == 16) { const int bits = (base == 2) ? 1 : (base == 8 ? 3 : 4); - static const juce_wchar* const hexDigits = T("0123456789abcdef"); + static const char* const hexDigits = "0123456789abcdef"; for (;;) { @@ -2909,7 +2909,7 @@ const String BigInteger::toString (const int base, const int minimumNumCharacter s = s.paddedLeft ('0', minimumNumCharacters); - return isNegative() ? T("-") + s : s; + return isNegative() ? "-" + s : s; } void BigInteger::parseString (const String& text, const int base) @@ -2945,10 +2945,10 @@ void BigInteger::parseString (const String& text, const int base) { const juce_wchar c = *t++; - if (c >= T('0') && c <= T('9')) + if (c >= '0' && c <= '9') { operator*= (ten); - operator+= ((int) (c - T('0'))); + operator+= ((int) (c - '0')); } else if (c == 0) { @@ -2957,7 +2957,7 @@ void BigInteger::parseString (const String& text, const int base) } } - setNegative (text.trimStart().startsWithChar (T('-'))); + setNegative (text.trimStart().startsWithChar ('-')); } const MemoryBlock BigInteger::toMemoryBlock() const @@ -3259,19 +3259,19 @@ void MemoryBlock::loadFromHexString (const String& hex) throw() { const juce_wchar c = hex [i++]; - if (c >= T('0') && c <= T('9')) + if (c >= '0' && c <= '9') { - byte |= c - T('0'); + byte |= c - '0'; break; } - else if (c >= T('a') && c <= T('z')) + else if (c >= 'a' && c <= 'z') { - byte |= c - (T('a') - 10); + byte |= c - ('a' - 10); break; } - else if (c >= T('A') && c <= T('Z')) + else if (c >= 'A' && c <= 'Z') { - byte |= c - (T('A') - 10); + byte |= c - ('A' - 10); break; } else if (c == 0) @@ -3298,7 +3298,7 @@ const String MemoryBlock::toBase64Encoding() const throw() destString.preallocateStorage (initialLen + 2 + numChars); tchar* d = const_cast (((const tchar*) destString) + initialLen); - *d++ = T('.'); + *d++ = '.'; for (size_t i = 0; i < numChars; ++i) *d++ = encodingTable [getBitRange (i * 6, 6)]; @@ -3310,7 +3310,7 @@ const String MemoryBlock::toBase64Encoding() const throw() bool MemoryBlock::fromBase64Encoding (const String& s) throw() { - const int startPos = s.indexOfChar (T('.')) + 1; + const int startPos = s.indexOfChar ('.') + 1; if (startPos <= 0) return false; @@ -3498,7 +3498,7 @@ void PropertySet::setValue (const String& keyName, const double value) throw() void PropertySet::setValue (const String& keyName, const bool value) throw() { - setValue (keyName, String ((value) ? T("1") : T("0"))); + setValue (keyName, String (value ? "1" : "0")); } void PropertySet::setValue (const String& keyName, const XmlElement* const xml) @@ -3527,8 +3527,8 @@ XmlElement* PropertySet::createXml (const String& nodeName) const throw() for (int i = 0; i < properties.getAllKeys().size(); ++i) { XmlElement* const e = xml->createNewChildElement ("VALUE"); - e->setAttribute (T("name"), properties.getAllKeys()[i]); - e->setAttribute (T("val"), properties.getAllValues()[i]); + e->setAttribute ("name", properties.getAllKeys()[i]); + e->setAttribute ("val", properties.getAllValues()[i]); } return xml; @@ -3539,13 +3539,13 @@ void PropertySet::restoreFromXml (const XmlElement& xml) throw() const ScopedLock sl (lock); clear(); - forEachXmlChildElementWithTagName (xml, e, T("VALUE")) + forEachXmlChildElementWithTagName (xml, e, "VALUE") { - if (e->hasAttribute (T("name")) - && e->hasAttribute (T("val"))) + if (e->hasAttribute ("name") + && e->hasAttribute ("val")) { - properties.set (e->getStringAttribute (T("name")), - e->getStringAttribute (T("val"))); + properties.set (e->getStringAttribute ("name"), + e->getStringAttribute ("val")); } } @@ -3718,7 +3718,7 @@ const String var::toString() const { case voidType: return String::empty; case intType: return String (value.intValue); - case boolType: return value.boolValue ? T("1") : T("0"); + case boolType: return String::charToString (value.boolValue ? '1' : '0'); case doubleType: return String (value.doubleValue); case stringType: return *(value.stringValue); case objectType: return "Object 0x" + String::toHexString ((int) (pointer_sized_int) value.objectValue); @@ -4903,7 +4903,7 @@ RSAKey::RSAKey() RSAKey::RSAKey (const String& s) { - if (s.containsChar (T(','))) + if (s.containsChar (',')) { part1.parseString (s.upToFirstOccurrenceOf (T(","), false, false), 16); part2.parseString (s.fromFirstOccurrenceOf (T(","), false, false), 16); @@ -5524,7 +5524,7 @@ DirectoryIterator::DirectoryIterator (const File& directory, bool isDirectory, isHidden; void* const handle = juce_findFileStart (path, - isRecursive ? T("*") : wc, + isRecursive ? "*" : wc, filename, &isDirectory, &isHidden, 0, 0, 0, 0); if (handle != 0) @@ -5697,7 +5697,7 @@ static const String parseAbsolutePath (String path) #if JUCE_WINDOWS // Windows.. - path = path.replaceCharacter (T('/'), T('\\')); + path = path.replaceCharacter ('/', '\\'); if (path.startsWithChar (File::separator)) { @@ -5715,7 +5715,7 @@ static const String parseAbsolutePath (String path) path = File::getCurrentWorkingDirectory().getFullPathName().substring (0, 2) + path; } } - else if (path.indexOfChar (T(':')) < 0) + else if (path.indexOfChar (':') < 0) { if (path.isEmpty()) return String::empty; @@ -5733,9 +5733,9 @@ static const String parseAbsolutePath (String path) } #else // Mac or Linux.. - path = path.replaceCharacter (T('\\'), T('/')); + path = path.replaceCharacter ('\\', '/'); - if (path.startsWithChar (T('~'))) + if (path.startsWithChar ('~')) { const char* homeDir = 0; @@ -6004,7 +6004,7 @@ int64 File::hashCode64() const const String File::getFileNameWithoutExtension() const { const int lastSlash = fullPath.lastIndexOfChar (separator) + 1; - const int lastDot = fullPath.lastIndexOfChar (T('.')); + const int lastDot = fullPath.lastIndexOfChar ('.'); if (lastDot > lastSlash) return fullPath.substring (lastSlash, lastDot); @@ -6039,11 +6039,11 @@ bool File::isAChildOf (const File& potentialParent) const bool File::isAbsolutePath (const String& path) { - return path.startsWithChar (T('/')) || path.startsWithChar (T('\\')) + return path.startsWithChar ('/') || path.startsWithChar ('\\') #if JUCE_WINDOWS - || (path.isNotEmpty() && ((const String&) path)[1] == T(':')); + || (path.isNotEmpty() && path[1] == ':'); #else - || path.startsWithChar (T('~')); + || path.startsWithChar ('~'); #endif } @@ -6059,16 +6059,16 @@ const File File::getChildFile (String relativePath) const // it's relative, so remove any ../ or ./ bits at the start. String path (fullPath); - if (relativePath[0] == T('.')) + if (relativePath[0] == '.') { #if JUCE_WINDOWS - relativePath = relativePath.replaceCharacter (T('/'), T('\\')).trimStart(); + relativePath = relativePath.replaceCharacter ('/', '\\').trimStart(); #else - relativePath = relativePath.replaceCharacter (T('\\'), T('/')).trimStart(); + relativePath = relativePath.replaceCharacter ('\\', '/').trimStart(); #endif - while (relativePath[0] == T('.')) + while (relativePath[0] == '.') { - if (relativePath[1] == T('.')) + if (relativePath[1] == '.') { if (relativePath [2] == 0 || relativePath[2] == separator) { @@ -6348,7 +6348,7 @@ bool File::containsSubDirectories() const String filename; bool itemIsDirectory, itemIsHidden; void* const handle = juce_findFileStart (juce_addTrailingSeparator (fullPath), - T("*"), filename, + "*", filename, &itemIsDirectory, &itemIsHidden, 0, 0, 0, 0); if (handle != 0) @@ -6382,12 +6382,12 @@ const File File::getNonexistentChildFile (const String& prefix_, String prefix (prefix_); // remove any bracketed numbers that may already be on the end.. - if (prefix.trim().endsWithChar (T(')'))) + if (prefix.trim().endsWithChar (')')) { putNumbersInBrackets = true; - const int openBracks = prefix.lastIndexOfChar (T('(')); - const int closeBracks = prefix.lastIndexOfChar (T(')')); + const int openBracks = prefix.lastIndexOfChar ('('); + const int closeBracks = prefix.lastIndexOfChar (')'); if (openBracks > 0 && closeBracks > openBracks @@ -6405,7 +6405,7 @@ const File File::getNonexistentChildFile (const String& prefix_, do { if (putNumbersInBrackets) - f = getChildFile (prefix + T('(') + String (num++) + T(')') + suffix); + f = getChildFile (prefix + '(' + String (num++) + ')' + suffix); else f = getChildFile (prefix + String (num++) + suffix); @@ -6436,7 +6436,7 @@ const String File::getFileExtension() const if (! isDirectory()) { - const int indexOfDot = fullPath.lastIndexOfChar (T('.')); + const int indexOfDot = fullPath.lastIndexOfChar ('.'); if (indexOfDot > fullPath.lastIndexOfChar (separator)) ext = fullPath.substring (indexOfDot); @@ -6448,9 +6448,9 @@ const String File::getFileExtension() const bool File::hasFileExtension (const String& possibleSuffix) const { if (possibleSuffix.isEmpty()) - return fullPath.lastIndexOfChar (T('.')) <= fullPath.lastIndexOfChar (separator); + return fullPath.lastIndexOfChar ('.') <= fullPath.lastIndexOfChar (separator); - const int semicolon = possibleSuffix.indexOfChar (0, T(';')); + const int semicolon = possibleSuffix.indexOfChar (0, ';'); if (semicolon >= 0) { @@ -6461,13 +6461,13 @@ bool File::hasFileExtension (const String& possibleSuffix) const { if (fullPath.endsWithIgnoreCase (possibleSuffix)) { - if (possibleSuffix.startsWithChar (T('.'))) + if (possibleSuffix.startsWithChar ('.')) return true; const int dotPos = fullPath.length() - possibleSuffix.length() - 1; if (dotPos >= 0) - return fullPath [dotPos] == T('.'); + return fullPath [dotPos] == '.'; } } @@ -6481,11 +6481,11 @@ const File File::withFileExtension (const String& newExtension) const String filePart (getFileName()); - int i = filePart.lastIndexOfChar (T('.')); + int i = filePart.lastIndexOfChar ('.'); if (i >= 0) filePart = filePart.substring (0, i); - if (newExtension.isNotEmpty() && ! newExtension.startsWithChar (T('.'))) + if (newExtension.isNotEmpty() && ! newExtension.startsWithChar ('.')) filePart << '.'; return getSiblingFile (filePart + newExtension); @@ -6572,7 +6572,7 @@ const String File::createLegalPathName (const String& original) String s (original); String start; - if (s[1] == T(':')) + if (s[1] == ':') { start = s.substring (0, 2); s = s.substring (2); @@ -6591,7 +6591,7 @@ const String File::createLegalFileName (const String& original) if (len > maxLength) { - const int lastDot = s.lastIndexOfChar (T('.')); + const int lastDot = s.lastIndexOfChar ('.'); if (lastDot > jmax (0, len - 12)) { @@ -6652,9 +6652,9 @@ const String File::getRelativePathFrom (const File& dir) const while (dirPath.isNotEmpty()) { #if JUCE_WINDOWS - thisPath = T("..\\") + thisPath; + thisPath = "..\\" + thisPath; #else - thisPath = T("../") + thisPath; + thisPath = "../" + thisPath; #endif const int sep = dirPath.indexOfChar (separator); @@ -6693,7 +6693,7 @@ int File::getVolumeSerialNumber() const const File File::createTempFile (const String& fileNameEnding) { const File tempFile (getSpecialLocation (tempDirectory) - .getChildFile (T("temp_") + String (Random::getSystemRandom().nextInt())) + .getChildFile ("temp_" + String (Random::getSystemRandom().nextInt())) .withFileExtension (fileNameEnding)); if (tempFile.exists()) @@ -6915,7 +6915,7 @@ FileSearchPath& FileSearchPath::operator= (const String& path) void FileSearchPath::init (const String& path) { directories.clear(); - directories.addTokens (path, T(";"), T("\"")); + directories.addTokens (path, ";", "\""); directories.trim(); directories.removeEmptyStrings(); @@ -6937,10 +6937,10 @@ const String FileSearchPath::toString() const { StringArray directories2 (directories); for (int i = directories2.size(); --i >= 0;) - if (directories2[i].containsChar (T(';'))) + if (directories2[i].containsChar (';')) directories2.set (i, directories2[i].quoted()); - return directories2.joinIntoString (T(";")); + return directories2.joinIntoString (";"); } void FileSearchPath::add (const File& dir, const int insertIndex) @@ -7083,7 +7083,7 @@ BEGIN_JUCE_NAMESPACE TemporaryFile::TemporaryFile (const String& suffix, const int optionFlags) { createTempFile (File::getSpecialLocation (File::tempDirectory), - T("temp_") + String (Random::getSystemRandom().nextInt()), + "temp_" + String (Random::getSystemRandom().nextInt()), suffix, optionFlags); } @@ -7095,7 +7095,7 @@ TemporaryFile::TemporaryFile (const File& targetFile_, const int optionFlags) jassert (targetFile != File::nonexistent); createTempFile (targetFile.getParentDirectory(), - targetFile.getFileNameWithoutExtension() + T("_temp") + String (Random::getSystemRandom().nextInt()), + targetFile.getFileNameWithoutExtension() + "_temp" + String (Random::getSystemRandom().nextInt()), targetFile.getFileExtension(), optionFlags); } @@ -7104,7 +7104,7 @@ void TemporaryFile::createTempFile (const File& parentDirectory, String name, const String& suffix, const int optionFlags) { if ((optionFlags & useHiddenFile) != 0) - name = T(".") + name; + name = "." + name; temporaryFile = parentDirectory.getNonexistentChildFile (name, suffix, (optionFlags & putNumbersInBrackets) != 0); } @@ -7606,7 +7606,7 @@ StreamingSocket* StreamingSocket::waitForNextConnection() const bool StreamingSocket::isLocal() const throw() { - return hostName == T("127.0.0.1"); + return hostName == "127.0.0.1"; } DatagramSocket::DatagramSocket (const int localPortNumber, const bool allowBroadcast_) @@ -7739,7 +7739,7 @@ int DatagramSocket::write (const void* sourceBuffer, const int numBytesToWrite) bool DatagramSocket::isLocal() const throw() { - return hostName == T("127.0.0.1"); + return hostName == "127.0.0.1"; } END_JUCE_NAMESPACE @@ -7756,14 +7756,14 @@ URL::URL() URL::URL (const String& url_) : url (url_) { - int i = url.indexOfChar (T('?')); + int i = url.indexOfChar ('?'); if (i >= 0) { do { - const int nextAmp = url.indexOfChar (i + 1, T('&')); - const int equalsPos = url.indexOfChar (i + 1, T('=')); + const int nextAmp = url.indexOfChar (i + 1, '&'); + const int equalsPos = url.indexOfChar (i + 1, '='); if (equalsPos > i + 1) { @@ -7818,10 +7818,10 @@ static const String getMangledParameters (const StringPairArray& parameters) for (int i = 0; i < parameters.size(); ++i) { if (i > 0) - p += T("&"); + p += '&'; p << URL::addEscapeChars (parameters.getAllKeys() [i], true) - << T("=") + << '=' << URL::addEscapeChars (parameters.getAllValues() [i], true); } @@ -7831,7 +7831,7 @@ static const String getMangledParameters (const StringPairArray& parameters) const String URL::toString (const bool includeGetParameters) const { if (includeGetParameters && parameters.size() > 0) - return url + T("?") + getMangledParameters (parameters); + return url + "?" + getMangledParameters (parameters); else return url; } @@ -7850,17 +7850,17 @@ static int findStartOfDomain (const String& url) || CharacterFunctions::indexOfChar (T("+-."), url[i], false) >= 0) ++i; - return url[i] == T(':') ? i + 1 : 0; + return url[i] == ':' ? i + 1 : 0; } const String URL::getDomain() const { int start = findStartOfDomain (url); - while (url[start] == T('/')) + while (url[start] == '/') ++start; - const int end1 = url.indexOfChar (start, T('/')); - const int end2 = url.indexOfChar (start, T(':')); + const int end1 = url.indexOfChar (start, '/'); + const int end2 = url.indexOfChar (start, ':'); const int end = (end1 < 0 || end2 < 0) ? jmax (end1, end2) : jmin (end1, end2); @@ -7871,10 +7871,10 @@ const String URL::getDomain() const const String URL::getSubPath() const { int start = findStartOfDomain (url); - while (url[start] == T('/')) + while (url[start] == '/') ++start; - const int startOfPath = url.indexOfChar (start, T('/')) + 1; + const int startOfPath = url.indexOfChar (start, '/') + 1; return startOfPath <= 0 ? String::empty : url.substring (startOfPath); @@ -7888,20 +7888,20 @@ const String URL::getScheme() const const URL URL::withNewSubPath (const String& newPath) const { int start = findStartOfDomain (url); - while (url[start] == T('/')) + while (url[start] == '/') ++start; - const int startOfPath = url.indexOfChar (start, T('/')) + 1; + const int startOfPath = url.indexOfChar (start, '/') + 1; URL u (*this); if (startOfPath > 0) u.url = url.substring (0, startOfPath); - if (! u.url.endsWithChar (T('/'))) + if (! u.url.endsWithChar ('/')) u.url << '/'; - if (newPath.startsWithChar (T('/'))) + if (newPath.startsWithChar ('/')) u.url << newPath.substring (1); else u.url << newPath; @@ -7916,19 +7916,19 @@ bool URL::isProbablyAWebsiteURL (const String& possibleURL) return true; if (possibleURL.startsWithIgnoreCase (T("file:")) - || possibleURL.containsChar (T('@')) - || possibleURL.endsWithChar (T('.')) - || (! possibleURL.containsChar (T('.')))) + || possibleURL.containsChar ('@') + || possibleURL.endsWithChar ('.') + || (! possibleURL.containsChar ('.'))) return false; if (possibleURL.startsWithIgnoreCase (T("www.")) - && possibleURL.substring (5).containsChar (T('.'))) + && possibleURL.substring (5).containsChar ('.')) return true; const char* commonTLDs[] = { "com", "net", "org", "uk", "de", "fr", "jp" }; for (int i = 0; i < numElementsInArray (commonTLDs); ++i) - if ((possibleURL + T("/")).containsIgnoreCase (T(".") + String (commonTLDs[i]) + T("/"))) + if ((possibleURL + "/").containsIgnoreCase ("." + String (commonTLDs[i]) + "/")) return true; return false; @@ -7936,11 +7936,11 @@ bool URL::isProbablyAWebsiteURL (const String& possibleURL) bool URL::isProbablyAnEmailAddress (const String& possibleEmailAddress) { - const int atSign = possibleEmailAddress.indexOfChar (T('@')); + const int atSign = possibleEmailAddress.indexOfChar ('@'); return atSign > 0 - && possibleEmailAddress.lastIndexOfChar (T('.')) > (atSign + 1) - && (! possibleEmailAddress.endsWithChar (T('.'))); + && possibleEmailAddress.lastIndexOfChar ('.') > (atSign + 1) + && (! possibleEmailAddress.endsWithChar ('.')); } void* juce_openInternetFile (const String& url, @@ -7980,7 +7980,7 @@ public: headers += extraHeaders; - if (! headers.endsWithChar (T('\n'))) + if (! headers.endsWithChar ('\n')) headers << "\r\n"; handle = juce_openInternetFile (server, headers, postData, isPost, @@ -8289,13 +8289,7 @@ const String URL::addEscapeChars (const String& s, const bool isParameter) else { const int v = (int) (uint8) c; - - if (v < 0x10) - result << T("%0"); - else - result << T('%'); - - result << String::toHexString (v); + result << (v < 0x10 ? "%0" : "%") << String::toHexString (v); } } @@ -8900,19 +8894,19 @@ Uuid& Uuid::operator= (const String& uuidString) { const tchar c = uuidString [i++]; - if (c >= T('0') && c <= T('9')) + if (c >= '0' && c <= '9') { - byte |= c - T('0'); + byte |= c - '0'; break; } - else if (c >= T('a') && c <= T('z')) + else if (c >= 'a' && c <= 'z') { - byte |= c - (T('a') - 10); + byte |= c - ('a' - 10); break; } - else if (c >= T('A') && c <= T('Z')) + else if (c >= 'A' && c <= 'Z') { - byte |= c - (T('A') - 10); + byte |= c - ('A' - 10); break; } else if (c == 0) @@ -9294,7 +9288,7 @@ void ZipFile::uncompressTo (const File& targetDirectory, const File targetFile (targetDirectory.getChildFile (zei.filename)); - if (zei.filename.endsWithChar (T('/'))) + if (zei.filename.endsWithChar ('/')) { targetFile.createDirectory(); // (entry is a directory, not a file) } @@ -9684,7 +9678,7 @@ int CharacterFunctions::getIntValue (const juce_wchar* s) throw() while (isWhitespace (*s)) ++s; - const bool isNeg = *s == T('-'); + const bool isNeg = *s == '-'; if (isNeg) ++s; @@ -9692,8 +9686,8 @@ int CharacterFunctions::getIntValue (const juce_wchar* s) throw() { const wchar_t c = *s++; - if (c >= T('0') && c <= T('9')) - v = v * 10 + (int) (c - T('0')); + if (c >= '0' && c <= '9') + v = v * 10 + (int) (c - '0'); else break; } @@ -9714,7 +9708,7 @@ int64 CharacterFunctions::getInt64Value (const char* s) throw() while (isWhitespace (*s)) ++s; - const bool isNeg = *s == T('-'); + const bool isNeg = *s == '-'; if (isNeg) ++s; @@ -9742,7 +9736,7 @@ int64 CharacterFunctions::getInt64Value (const juce_wchar* s) throw() while (isWhitespace (*s)) ++s; - const bool isNeg = *s == T('-'); + const bool isNeg = *s == '-'; if (isNeg) ++s; @@ -9750,8 +9744,8 @@ int64 CharacterFunctions::getInt64Value (const juce_wchar* s) throw() { const juce_wchar c = *s++; - if (c >= T('0') && c <= T('9')) - v = v * 10 + (int64) (c - T('0')); + if (c >= '0' && c <= '9') + v = v * 10 + (int64) (c - '0'); else break; } @@ -10018,7 +10012,7 @@ bool CharacterFunctions::isLowerCase (const juce_wchar character) throw() bool CharacterFunctions::isWhitespace (const char character) throw() { - return character == T(' ') || (character <= 13 && character >= 9); + return character == ' ' || (character <= 13 && character >= 9); } bool CharacterFunctions::isWhitespace (const juce_wchar character) throw() @@ -10105,7 +10099,7 @@ static int findCloseQuote (const String& text, int startPos) { const tchar c = text [startPos]; - if (c == 0 || (c == T('"') && lastChar != T('\\'))) + if (c == 0 || (c == '"' && lastChar != '\\')) break; lastChar = c; @@ -10133,7 +10127,7 @@ void LocalisedStrings::loadFromText (const String& fileContents) { String line (lines[i].trim()); - if (line.startsWithChar (T('"'))) + if (line.startsWithChar ('"')) { int closeQuote = findCloseQuote (line, 1); @@ -10205,8 +10199,8 @@ END_JUCE_NAMESPACE /*** Start of inlined file: juce_String.cpp ***/ #ifdef _MSC_VER - #pragma warning (disable: 4514) #pragma warning (push) + #pragma warning (disable: 4514) #endif #include @@ -10235,7 +10229,7 @@ public: static juce_wchar* create (const size_t numChars) { - StringHolder* const s = reinterpret_cast (juce_malloc (sizeof (StringHolder) + numChars * sizeof (juce_wchar))); + StringHolder* const s = reinterpret_cast (new char [sizeof (StringHolder) + numChars * sizeof (juce_wchar)]); s->refCount = 0; s->allocatedNumChars = numChars; return &(s->text[0]); @@ -10254,7 +10248,7 @@ public: static inline void release (StringHolder* const b) throw() { if (Atomic::decrementAndReturn (b->refCount) == -1 && b != &empty) - juce_free (b); + delete[] reinterpret_cast (b); } static void release (juce_wchar* const text) throw() @@ -10452,8 +10446,10 @@ String::String (const juce_wchar* const t, const size_t maxChars) const String String::charToString (const juce_wchar character) { - juce_wchar temp[] = { character, 0 }; - return String (temp); + String result ((size_t) 1, (int) 0); + result.text[0] = character; + result.text[1] = 0; + return result; } namespace NumberToStringConverters @@ -10466,13 +10462,13 @@ namespace NumberToStringConverters do { - *--t = (juce_wchar) (T('0') + (int) (v % 10)); + *--t = (juce_wchar) ('0' + (int) (v % 10)); v /= 10; } while (v > 0); if (n < 0) - *--t = T('-'); + *--t = '-'; return t; } @@ -10483,7 +10479,7 @@ namespace NumberToStringConverters do { - *--t = (juce_wchar) (T('0') + (int) (v % 10)); + *--t = (juce_wchar) ('0' + (int) (v % 10)); v /= 10; } while (v > 0); @@ -10501,13 +10497,13 @@ namespace NumberToStringConverters do { - *--t = (juce_wchar) (T('0') + (v % 10)); + *--t = (juce_wchar) ('0' + (v % 10)); v /= 10; } while (v > 0); if (n < 0) - *--t = T('-'); + *--t = '-'; return t; } @@ -10518,7 +10514,7 @@ namespace NumberToStringConverters do { - *--t = (juce_wchar) (T('0') + (v % 10)); + *--t = (juce_wchar) ('0' + (v % 10)); v /= 10; } while (v > 0); @@ -10550,14 +10546,14 @@ namespace NumberToStringConverters if (numDecPlaces == 0) *--t = getDecimalPoint(); - *--t = (juce_wchar) (T('0') + (v % 10)); + *--t = (juce_wchar) ('0' + (v % 10)); v /= 10; --numDecPlaces; } if (n < 0) - *--t = T('-'); + *--t = '-'; len = end - t - 1; return t; @@ -11216,7 +11212,7 @@ static int indexOfMatch (const juce_wchar* const wildcard, if (wc == c || (ignoreCase && CharacterFunctions::toLowerCase (wc) == CharacterFunctions::toLowerCase (c)) - || (wc == T('?') && c != 0)) + || (wc == '?' && c != 0)) { if (wc == 0) return start; @@ -11225,10 +11221,10 @@ static int indexOfMatch (const juce_wchar* const wildcard, } else { - if (wc == T('*') && (wildcard [i + 1] == 0 - || indexOfMatch (wildcard + i + 1, - test + start + i, - ignoreCase) >= 0)) + if (wc == '*' && (wildcard [i + 1] == 0 + || indexOfMatch (wildcard + i + 1, + test + start + i, + ignoreCase) >= 0)) { return start; } @@ -11254,7 +11250,7 @@ bool String::matchesWildcard (const juce_wchar* wildcard, const bool ignoreCase) if (wc == c || (ignoreCase && CharacterFunctions::toLowerCase (wc) == CharacterFunctions::toLowerCase (c)) - || (wc == T('?') && c != 0)) + || (wc == '?' && c != 0)) { if (wc == 0) return true; @@ -11263,10 +11259,10 @@ bool String::matchesWildcard (const juce_wchar* wildcard, const bool ignoreCase) } else { - return wc == T('*') && (wildcard [i + 1] == 0 - || indexOfMatch (wildcard + i + 1, - text + i, - ignoreCase) >= 0); + return wc == '*' && (wildcard [i + 1] == 0 + || indexOfMatch (wildcard + i + 1, + text + i, + ignoreCase) >= 0); } } } @@ -11622,21 +11618,21 @@ bool String::isQuotedString() const { const String trimmed (trimStart()); - return trimmed[0] == T('"') - || trimmed[0] == T('\''); + return trimmed[0] == '"' + || trimmed[0] == '\''; } const String String::unquoted() const { String s (*this); - if (s.text[0] == T('"') || s.text[0] == T('\'')) + if (s.text[0] == '"' || s.text[0] == '\'') s = s.substring (1); const int lastCharIndex = s.length() - 1; if (lastCharIndex >= 0 - && (s [lastCharIndex] == T('"') || s[lastCharIndex] == T('\''))) + && (s [lastCharIndex] == '"' || s[lastCharIndex] == '\'')) s [lastCharIndex] = 0; return s; @@ -11871,7 +11867,14 @@ const String String::formatted (const juce_wchar* const pf, ... ) const int num = (int) vswprintf (result.text, bufferSize - 1, pf, tempArgs); va_end (tempArgs); #elif JUCE_WINDOWS + #ifdef _MSC_VER + #pragma warning (push) + #pragma warning (disable: 4996) + #endif const int num = (int) _vsnwprintf (result.text, bufferSize - 1, pf, args); + #ifdef _MSC_VER + #pragma warning (pop) + #endif #else const int num = (int) vswprintf (result.text, bufferSize - 1, pf, args); #endif @@ -11907,13 +11910,13 @@ int String::getTrailingIntValue() const throw() if (! CharacterFunctions::isDigit (c)) { - if (c == T('-')) + if (c == '-') n = -n; break; } - n += mult * (c - T('0')); + n += mult * (c - '0'); mult *= 10; } @@ -12000,7 +12003,7 @@ const String String::toHexString (const unsigned char* data, ++data; if (groupSize > 0 && (i % groupSize) == (groupSize - 1) && i < (size - 1)) - *d++ = T(' '); + *d++ = ' '; } *d = 0; @@ -12722,16 +12725,16 @@ int StringArray::addLines (const String& sourceText) while (*text != 0) { - if (*text == T('\r')) + if (*text == '\r') { ++text; - if (*text == T('\n')) + if (*text == '\n') ++text; break; } - if (*text == T('\n')) + if (*text == '\n') { ++text; break; @@ -12741,10 +12744,10 @@ int StringArray::addLines (const String& sourceText) } const juce_wchar* endOfLine = text; - if (endOfLine > startOfLine && (*(endOfLine - 1) == T('\r') || *(endOfLine - 1) == T('\n'))) + if (endOfLine > startOfLine && (*(endOfLine - 1) == '\r' || *(endOfLine - 1) == '\n')) --endOfLine; - if (endOfLine > startOfLine && (*(endOfLine - 1) == T('\r') || *(endOfLine - 1) == T('\n'))) + if (endOfLine > startOfLine && (*(endOfLine - 1) == '\r' || *(endOfLine - 1) == '\n')) --endOfLine; add (String (startOfLine, jmax (0, (int) (endOfLine - startOfLine)))); @@ -12921,9 +12924,9 @@ const String StringPairArray::getDescription() const for (int i = 0; i < keys.size(); ++i) { - s << keys[i] << T(" = ") << values[i]; + s << keys[i] << " = " << values[i]; if (i < keys.size()) - s << T(", "); + s << ", "; } return s; @@ -12970,10 +12973,7 @@ void XmlDocument::setEmptyTextElementsIgnored (const bool shouldBeIgnored) throw bool XmlDocument::isXmlIdentifierCharSlow (const juce_wchar c) throw() { return CharacterFunctions::isLetterOrDigit (c) - || c == T('_') - || c == T('-') - || c == T(':') - || c == T('.'); + || c == '_' || c == '-' || c == ':' || c == '.'; } inline bool XmlDocument::isXmlIdentifierChar (const juce_wchar c) const throw() @@ -13125,9 +13125,9 @@ void XmlDocument::skipHeader() if (outOfData) return; - if (c == T('<')) + if (c == '<') ++n; - else if (c == T('>')) + else if (c == '>') --n; } @@ -13149,11 +13149,11 @@ void XmlDocument::skipNextWhiteSpace() outOfData = true; break; } - else if (c == T('<')) + else if (c == '<') { - if (input[1] == T('!') - && input[2] == T('-') - && input[3] == T('-')) + if (input[1] == '!' + && input[2] == '-' + && input[3] == '-') { const juce_wchar* const closeComment = CharacterFunctions::find (input, T("-->")); @@ -13166,7 +13166,7 @@ void XmlDocument::skipNextWhiteSpace() input = closeComment + 3; continue; } - else if (input[1] == T('?')) + else if (input[1] == '?') { const juce_wchar* const closeBracket = CharacterFunctions::find (input, T("?>")); @@ -13196,7 +13196,7 @@ void XmlDocument::readQuotedString (String& result) if (c == quote) break; - if (c == T('&')) + if (c == '&') { --input; readEntity (result); @@ -13217,7 +13217,7 @@ void XmlDocument::readQuotedString (String& result) return; } - else if (character == T('&')) + else if (character == '&') { result.append (start, (int) (input - start)); break; @@ -13275,14 +13275,14 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements) const juce_wchar c = *input; // empty tag.. - if (c == T('/') && input[1] == T('>')) + if (c == '/' && input[1] == '>') { input += 2; break; } // parse the guts of the element.. - if (c == T('>')) + if (c == '>') { ++input; skipNextWhiteSpace(); @@ -13305,13 +13305,13 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements) skipNextWhiteSpace(); - if (readNextChar() == T('=')) + if (readNextChar() == '=') { skipNextWhiteSpace(); const juce_wchar nextChar = *input; - if (nextChar == T('"') || nextChar == T('\'')) + if (nextChar == '"' || nextChar == '\'') { XmlElement::XmlAttributeNode* const newAtt = new XmlElement::XmlAttributeNode (String (attNameStart, attNameLen), @@ -13358,23 +13358,23 @@ void XmlDocument::readChildElements (XmlElement* parent) break; } - if (*input == T('<')) + if (*input == '<') { - if (input[1] == T('/')) + if (input[1] == '/') { // our close tag.. input = CharacterFunctions::find (input, T(">")); ++input; break; } - else if (input[1] == T('!') - && input[2] == T('[') - && input[3] == T('C') - && input[4] == T('D') - && input[5] == T('A') - && input[6] == T('T') - && input[7] == T('A') - && input[8] == T('[')) + else if (input[1] == '!' + && input[2] == '[' + && input[3] == 'C' + && input[4] == 'D' + && input[5] == 'A' + && input[6] == 'T' + && input[7] == 'A' + && input[8] == '[') { input += 9; const juce_wchar* const inputStart = input; @@ -13389,9 +13389,9 @@ void XmlDocument::readChildElements (XmlElement* parent) outOfData = true; break; } - else if (input[0] == T(']') - && input[1] == T(']') - && input[2] == T('>')) + else if (input[0] == ']' + && input[1] == ']' + && input[2] == '>') { input += 3; break; @@ -13449,7 +13449,7 @@ void XmlDocument::readChildElements (XmlElement* parent) { const juce_wchar c = *input; - if (c == T('<')) + if (c == '<') break; if (c == 0) @@ -13459,12 +13459,12 @@ void XmlDocument::readChildElements (XmlElement* parent) return; } - if (c == T('&')) + if (c == '&') { String entity; readEntity (entity); - if (entity.startsWithChar (T('<')) && entity [1] != 0) + if (entity.startsWithChar ('<') && entity [1] != 0) { const juce_wchar* const oldInput = input; const bool oldOutOfData = outOfData; @@ -13504,7 +13504,7 @@ void XmlDocument::readChildElements (XmlElement* parent) { const juce_wchar nextChar = *input; - if (nextChar == T('<') || nextChar == T('&')) + if (nextChar == '<' || nextChar == '&') { break; } @@ -13538,39 +13538,39 @@ void XmlDocument::readEntity (String& result) if (CharacterFunctions::compareIgnoreCase (input, T("amp;"), 4) == 0) { input += 4; - result += T("&"); + result += '&'; } else if (CharacterFunctions::compareIgnoreCase (input, T("quot;"), 5) == 0) { input += 5; - result += T("\""); + result += '"'; } else if (CharacterFunctions::compareIgnoreCase (input, T("apos;"), 5) == 0) { input += 5; - result += T("\'"); + result += '\''; } else if (CharacterFunctions::compareIgnoreCase (input, T("lt;"), 3) == 0) { input += 3; - result += T("<"); + result += '<'; } else if (CharacterFunctions::compareIgnoreCase (input, T("gt;"), 3) == 0) { input += 3; - result += T(">"); + result += '>'; } - else if (*input == T('#')) + else if (*input == '#') { int charCode = 0; ++input; - if (*input == T('x') || *input == T('X')) + if (*input == 'x' || *input == 'X') { ++input; int numChars = 0; - while (input[0] != T(';')) + while (input[0] != ';') { const int hexValue = CharacterFunctions::getHexDigitValue (input[0]); @@ -13586,11 +13586,11 @@ void XmlDocument::readEntity (String& result) ++input; } - else if (input[0] >= T('0') && input[0] <= T('9')) + else if (input[0] >= '0' && input[0] <= '9') { int numChars = 0; - while (input[0] != T(';')) + while (input[0] != ';') { if (++numChars > 12) { @@ -13598,7 +13598,7 @@ void XmlDocument::readEntity (String& result) break; } - charCode = charCode * 10 + (input[0] - T('0')); + charCode = charCode * 10 + (input[0] - '0'); ++input; } @@ -13607,7 +13607,7 @@ void XmlDocument::readEntity (String& result) else { setLastError ("illegal escape sequence", true); - result += T("&"); + result += '&'; return; } @@ -13621,7 +13621,7 @@ void XmlDocument::readEntity (String& result) if (closingSemiColon == 0) { outOfData = true; - result += T("&"); + result += '&'; } else { @@ -13636,30 +13636,30 @@ void XmlDocument::readEntity (String& result) const String XmlDocument::expandEntity (const String& ent) { if (ent.equalsIgnoreCase (T("amp"))) - return T("&"); + return String::charToString ('&'); if (ent.equalsIgnoreCase (T("quot"))) - return T("\""); + return String::charToString ('"'); if (ent.equalsIgnoreCase (T("apos"))) - return T("\'"); + return String::charToString ('\''); if (ent.equalsIgnoreCase (T("lt"))) - return T("<"); + return String::charToString ('<'); if (ent.equalsIgnoreCase (T("gt"))) - return T(">"); + return String::charToString ('>'); - if (ent[0] == T('#')) + if (ent[0] == '#') { - if (ent[1] == T('x') || ent[1] == T('X')) + if (ent[1] == 'x' || ent[1] == 'X') return String::charToString (static_cast (ent.substring (2).getHexValue32())); - if (ent[1] >= T('0') && ent[1] <= T('9')) + if (ent[1] >= '0' && ent[1] <= '9') return String::charToString (static_cast (ent.substring (1).getIntValue())); setLastError ("illegal escape sequence", false); - return T("&"); + return String::charToString ('&'); } return expandExternalEntity (ent); @@ -13671,7 +13671,7 @@ const String XmlDocument::expandExternalEntity (const String& entity) { if (dtdText.isNotEmpty()) { - while (dtdText.endsWithChar (T('>'))) + while (dtdText.endsWithChar ('>')) dtdText = dtdText.dropLastCharacters (1); tokenisedDTD.addTokens (dtdText, true); @@ -13687,11 +13687,11 @@ const String XmlDocument::expandExternalEntity (const String& entity) else { tokenisedDTD.clear(); - const int openBracket = dtdText.indexOfChar (T('[')); + const int openBracket = dtdText.indexOfChar ('['); if (openBracket > 0) { - const int closeBracket = dtdText.lastIndexOfChar (T(']')); + const int closeBracket = dtdText.lastIndexOfChar (']'); if (closeBracket > openBracket) tokenisedDTD.addTokens (dtdText.substring (openBracket + 1, @@ -13701,8 +13701,8 @@ const String XmlDocument::expandExternalEntity (const String& entity) for (int i = tokenisedDTD.size(); --i >= 0;) { - if (tokenisedDTD[i].startsWithChar (T('%')) - && tokenisedDTD[i].endsWithChar (T(';'))) + if (tokenisedDTD[i].startsWithChar ('%') + && tokenisedDTD[i].endsWithChar (';')) { const String parsed (getParameterEntity (tokenisedDTD[i].substring (1, tokenisedDTD[i].length() - 1))); StringArray newToks; @@ -13727,13 +13727,13 @@ const String XmlDocument::expandExternalEntity (const String& entity) { String ent (tokenisedDTD [i + 1]); - while (ent.endsWithChar (T('>'))) + while (ent.endsWithChar ('>')) ent = ent.dropLastCharacters (1); ent = ent.trim().unquoted(); // check for sub-entities.. - int ampersand = ent.indexOfChar (T('&')); + int ampersand = ent.indexOfChar ('&'); while (ampersand >= 0) { @@ -13751,7 +13751,7 @@ const String XmlDocument::expandExternalEntity (const String& entity) + resolved + ent.substring (semiColon + 1); - ampersand = ent.indexOfChar (semiColon + 1, T('&')); + ampersand = ent.indexOfChar (semiColon + 1, '&'); } return ent; @@ -13770,19 +13770,19 @@ const String XmlDocument::getParameterEntity (const String& entity) { if (tokenisedDTD[i] == entity) { - if (tokenisedDTD [i - 1] == T("%") + if (tokenisedDTD [i - 1] == "%" && tokenisedDTD [i - 2].equalsIgnoreCase (T("'))) + while (ent.endsWithChar ('>')) ent = ent.dropLastCharacters (1); if (ent.equalsIgnoreCase (T("system"))) { String filename (tokenisedDTD [i + 2]); - while (filename.endsWithChar (T('>'))) + while (filename.endsWithChar ('>')) filename = filename.dropLastCharacters (1); return getFileContents (filename); @@ -14332,11 +14332,11 @@ bool XmlElement::getBoolAttribute (const String& attributeName, const bool defau if (CharacterFunctions::isWhitespace (firstChar)) firstChar = att->value.trimStart() [0]; - return firstChar == T('1') - || firstChar == T('t') - || firstChar == T('y') - || firstChar == T('T') - || firstChar == T('Y'); + return firstChar == '1' + || firstChar == 't' + || firstChar == 'y' + || firstChar == 'T' + || firstChar == 'Y'; } att = att->next; @@ -14375,9 +14375,9 @@ void XmlElement::setAttribute (const String& attributeName, const String& value) while (*t != 0) { jassert (CharacterFunctions::isLetterOrDigit (*t) - || *t == T('_') - || *t == T('-') - || *t == T(':')); + || *t == '_' + || *t == '-' + || *t == ':'); ++t; } #endif @@ -15317,7 +15317,7 @@ class ThreadPool::ThreadPoolThread : public Thread { public: ThreadPoolThread (ThreadPool& pool_) - : Thread (T("Pool")), + : Thread ("Pool"), pool (pool_), busy (false) { @@ -16770,7 +16770,7 @@ void JUCEApplication::getCommandInfo (const CommandID commandID, ApplicationComm "Application", 0); - result.defaultKeypresses.add (KeyPress (T('q'), ModifierKeys::commandModifier, 0)); + result.defaultKeypresses.add (KeyPress ('q', ModifierKeys::commandModifier, 0)); } } @@ -18042,7 +18042,7 @@ bool FileBasedDocument::loadFrom (const File& newFile, TRANS("Failed to open file..."), TRANS("There was an error while trying to load the file:\n\n") + newFile.getFullPathName() - + T("\n\n") + + "\n\n" + error); } @@ -18129,7 +18129,7 @@ FileBasedDocument::SaveResult FileBasedDocument::saveAs (const File& newFile, + getDocumentTitle() + TRANS("\" to the file:\n\n") + newFile.getFullPathName() - + T("\n\n") + + "\n\n" + error); } @@ -18144,7 +18144,7 @@ FileBasedDocument::SaveResult FileBasedDocument::saveIfNeededAndUserAgrees() const int r = AlertWindow::showYesNoCancelBox (AlertWindow::QuestionIcon, TRANS("Closing document..."), TRANS("Do you want to save the changes to \"") - + getDocumentTitle() + T("\"?"), + + getDocumentTitle() + "\"?", TRANS("save"), TRANS("discard changes"), TRANS("cancel")); @@ -18200,9 +18200,9 @@ FileBasedDocument::SaveResult FileBasedDocument::saveAsInteractive (const bool w { if (! AlertWindow::showOkCancelBox (AlertWindow::WarningIcon, TRANS("File already exists"), - TRANS("There's already a file called:\n\n") - + chosen.getFullPathName() - + T("\n\nAre you sure you want to overwrite it?"), + TRANS("There's already a file called:") + + "\n\n" + chosen.getFullPathName() + + "\n\n" + TRANS("Are you sure you want to overwrite it?"), TRANS("overwrite"), TRANS("cancel"))) { @@ -18320,7 +18320,7 @@ int RecentlyOpenedFilesList::createPopupMenuItems (PopupMenu& menuToAddTo, const String RecentlyOpenedFilesList::toString() const { - return files.joinIntoString (T("\n")); + return files.joinIntoString ("\n"); } void RecentlyOpenedFilesList::restoreFromString (const String& stringifiedVersion) @@ -19462,7 +19462,7 @@ void AudioCDReader::refreshTrackLengths() { tracks.clear(); trackStartSamples.clear(); - volumeDir.findChildFiles (tracks, File::findFiles | File::ignoreHiddenFiles, false, T("*.aiff")); + volumeDir.findChildFiles (tracks, File::findFiles | File::ignoreHiddenFiles, false, "*.aiff"); tracks.sort (*this); @@ -20198,8 +20198,8 @@ AudioFormat* AudioFormatManager::getDefaultFormat() const AudioFormat* AudioFormatManager::findFormatForFileExtension (const String& fileExtension) const { String e (fileExtension); - if (! e.startsWithChar (T('.'))) - e = T(".") + e; + if (! e.startsWithChar ('.')) + e = "." + e; for (int i = 0; i < getNumKnownFormats(); ++i) if (getKnownFormat(i)->getFileExtensions().contains (e, true)) @@ -20222,15 +20222,15 @@ const String AudioFormatManager::getWildcardForAllFormats() const String s; for (i = 0; i < allExtensions.size(); ++i) { - s << T('*'); + s << '*'; - if (! allExtensions[i].startsWithChar (T('.'))) - s << T('.'); + if (! allExtensions[i].startsWithChar ('.')) + s << '.'; s << allExtensions[i]; if (i < allExtensions.size() - 1) - s << T(';'); + s << ';'; } return s; @@ -20881,7 +20881,7 @@ struct ThumbnailCacheEntry }; AudioThumbnailCache::AudioThumbnailCache (const int maxNumThumbsToStore_) - : TimeSliceThread (T("thumb cache")), + : TimeSliceThread ("thumb cache"), maxNumThumbsToStore (maxNumThumbsToStore_) { startThread (2); @@ -23231,7 +23231,7 @@ void ChannelRemappingAudioSource::getNextAudioBlock (const AudioSourceChannelInf XmlElement* ChannelRemappingAudioSource::createXml() const throw() { - XmlElement* e = new XmlElement (T("MAPPINGS")); + XmlElement* e = new XmlElement ("MAPPINGS"); String ins, outs; int i; @@ -23239,28 +23239,28 @@ XmlElement* ChannelRemappingAudioSource::createXml() const throw() const ScopedLock sl (lock); for (i = 0; i < remappedInputs.size(); ++i) - ins << remappedInputs.getUnchecked(i) << T(' '); + ins << remappedInputs.getUnchecked(i) << ' '; for (i = 0; i < remappedOutputs.size(); ++i) - outs << remappedOutputs.getUnchecked(i) << T(' '); + outs << remappedOutputs.getUnchecked(i) << ' '; - e->setAttribute (T("inputs"), ins.trimEnd()); - e->setAttribute (T("outputs"), outs.trimEnd()); + e->setAttribute ("inputs", ins.trimEnd()); + e->setAttribute ("outputs", outs.trimEnd()); return e; } void ChannelRemappingAudioSource::restoreFromXml (const XmlElement& e) throw() { - if (e.hasTagName (T("MAPPINGS"))) + if (e.hasTagName ("MAPPINGS")) { const ScopedLock sl (lock); clearAllMappings(); StringArray ins, outs; - ins.addTokens (e.getStringAttribute (T("inputs")), false); - outs.addTokens (e.getStringAttribute (T("outputs")), false); + ins.addTokens (e.getStringAttribute ("inputs"), false); + outs.addTokens (e.getStringAttribute ("outputs"), false); int i; for (i = 0; i < ins.size(); ++i) @@ -23895,7 +23895,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, numInputChansNeeded = numInputChannelsNeeded; numOutputChansNeeded = numOutputChannelsNeeded; - if (e != 0 && e->hasTagName (T("DEVICESETUP"))) + if (e != 0 && e->hasTagName ("DEVICESETUP")) { lastExplicitSettings = new XmlElement (*e); @@ -23905,18 +23905,18 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, if (preferredSetupOptions != 0) setup = *preferredSetupOptions; - if (e->getStringAttribute (T("audioDeviceName")).isNotEmpty()) + if (e->getStringAttribute ("audioDeviceName").isNotEmpty()) { setup.inputDeviceName = setup.outputDeviceName - = e->getStringAttribute (T("audioDeviceName")); + = e->getStringAttribute ("audioDeviceName"); } else { - setup.inputDeviceName = e->getStringAttribute (T("audioInputDeviceName")); - setup.outputDeviceName = e->getStringAttribute (T("audioOutputDeviceName")); + setup.inputDeviceName = e->getStringAttribute ("audioInputDeviceName"); + setup.outputDeviceName = e->getStringAttribute ("audioOutputDeviceName"); } - currentDeviceType = e->getStringAttribute (T("deviceType")); + currentDeviceType = e->getStringAttribute ("deviceType"); if (currentDeviceType.isEmpty()) { AudioIODeviceType* const type = findType (setup.inputDeviceName, setup.outputDeviceName); @@ -23927,20 +23927,20 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, currentDeviceType = availableDeviceTypes[0]->getTypeName(); } - setup.bufferSize = e->getIntAttribute (T("audioDeviceBufferSize")); - setup.sampleRate = e->getDoubleAttribute (T("audioDeviceRate")); + setup.bufferSize = e->getIntAttribute ("audioDeviceBufferSize"); + setup.sampleRate = e->getDoubleAttribute ("audioDeviceRate"); - setup.inputChannels.parseString (e->getStringAttribute (T("audioDeviceInChans"), T("11")), 2); - setup.outputChannels.parseString (e->getStringAttribute (T("audioDeviceOutChans"), T("11")), 2); + setup.inputChannels.parseString (e->getStringAttribute ("audioDeviceInChans", "11"), 2); + setup.outputChannels.parseString (e->getStringAttribute ("audioDeviceOutChans", "11"), 2); - setup.useDefaultInputChannels = ! e->hasAttribute (T("audioDeviceInChans")); - setup.useDefaultOutputChannels = ! e->hasAttribute (T("audioDeviceOutChans")); + setup.useDefaultInputChannels = ! e->hasAttribute ("audioDeviceInChans"); + setup.useDefaultOutputChannels = ! e->hasAttribute ("audioDeviceOutChans"); error = setAudioDeviceSetup (setup, true); midiInsFromXml.clear(); - forEachXmlChildElementWithTagName (*e, c, T("MIDIINPUT")) - midiInsFromXml.add (c->getStringAttribute (T("name"))); + forEachXmlChildElementWithTagName (*e, c, "MIDIINPUT") + midiInsFromXml.add (c->getStringAttribute ("name")); const StringArray allMidiIns (MidiInput::getDevices()); @@ -23951,7 +23951,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, error = initialise (numInputChannelsNeeded, numOutputChannelsNeeded, 0, false, preferredDefaultDeviceName); - setDefaultMidiOutput (e->getStringAttribute (T("defaultMidiOutput"))); + setDefaultMidiOutput (e->getStringAttribute ("defaultMidiOutput")); return error; } @@ -24742,7 +24742,7 @@ END_JUCE_NAMESPACE /*** Start of inlined file: juce_AudioIODeviceType.cpp ***/ BEGIN_JUCE_NAMESPACE -AudioIODeviceType::AudioIODeviceType (const tchar* const name) +AudioIODeviceType::AudioIODeviceType (const String& name) : typeName (name) { } @@ -26068,13 +26068,13 @@ END_JUCE_NAMESPACE /*** Start of inlined file: juce_IIRFilter.cpp ***/ BEGIN_JUCE_NAMESPACE -IIRFilter::IIRFilter() throw() +IIRFilter::IIRFilter() : active (false) { reset(); } -IIRFilter::IIRFilter (const IIRFilter& other) throw() +IIRFilter::IIRFilter (const IIRFilter& other) : active (other.active) { const ScopedLock sl (other.processLock); @@ -26082,7 +26082,7 @@ IIRFilter::IIRFilter (const IIRFilter& other) throw() reset(); } -IIRFilter::~IIRFilter() throw() +IIRFilter::~IIRFilter() { } @@ -28891,8 +28891,8 @@ void KnownPluginList::removeType (const int index) throw() static Time getFileModTime (const String& fileOrIdentifier) throw() { - if (fileOrIdentifier.startsWithChar (T('/')) - || fileOrIdentifier[1] == T(':')) + if (fileOrIdentifier.startsWithChar ('/') + || fileOrIdentifier[1] == ':') { return File (fileOrIdentifier).getLastModificationTime(); } @@ -29024,9 +29024,9 @@ public: else if (method == KnownPluginList::sortByManufacturer) diff = first->manufacturerName.compareLexicographically (second->manufacturerName); else if (method == KnownPluginList::sortByFileSystemLocation) - diff = first->fileOrIdentifier.replaceCharacter (T('\\'), T('/')) + diff = first->fileOrIdentifier.replaceCharacter ('\\', '/') .upToLastOccurrenceOf (T("/"), false, false) - .compare (second->fileOrIdentifier.replaceCharacter (T('\\'), T('/')) + .compare (second->fileOrIdentifier.replaceCharacter ('\\', '/') .upToLastOccurrenceOf (T("/"), false, false)); if (diff == 0) @@ -29050,7 +29050,7 @@ void KnownPluginList::sort (const SortMethod method) XmlElement* KnownPluginList::createXml() const { - XmlElement* const e = new XmlElement (T("KNOWNPLUGINS")); + XmlElement* const e = new XmlElement ("KNOWNPLUGINS"); for (int i = 0; i < types.size(); ++i) e->addChildElement (types.getUnchecked(i)->createXml()); @@ -29062,7 +29062,7 @@ void KnownPluginList::recreateFromXml (const XmlElement& xml) { clear(); - if (xml.hasTagName (T("KNOWNPLUGINS"))) + if (xml.hasTagName ("KNOWNPLUGINS")) { forEachXmlChildElement (xml, e) { @@ -29138,10 +29138,10 @@ public: for (int i = 0; i < allPlugins.size(); ++i) { String path (allPlugins.getUnchecked(i) - ->fileOrIdentifier.replaceCharacter (T('\\'), T('/')) + ->fileOrIdentifier.replaceCharacter ('\\', '/') .upToLastOccurrenceOf (T("/"), false, false)); - if (path.substring (1, 2) == T(":")) + if (path.substring (1, 2) == ":") path = path.substring (2); addPlugin (allPlugins.getUnchecked(i), path); @@ -29203,7 +29203,7 @@ void KnownPluginList::addToMenu (PopupMenu& menu, const SortMethod sortMethod) c : pd->manufacturerName); if (! thisSubMenuName.containsNonWhitespaceChars()) - thisSubMenuName = T("Other"); + thisSubMenuName = "Other"; if (thisSubMenuName != lastSubMenuName) { @@ -29305,44 +29305,44 @@ bool PluginDescription::isDuplicateOf (const PluginDescription& other) const const String PluginDescription::createIdentifierString() const throw() { return pluginFormatName - + T("-") + name - + T("-") + String::toHexString (fileOrIdentifier.hashCode()) - + T("-") + String::toHexString (uid); + + "-" + name + + "-" + String::toHexString (fileOrIdentifier.hashCode()) + + "-" + String::toHexString (uid); } XmlElement* PluginDescription::createXml() const { - XmlElement* const e = new XmlElement (T("PLUGIN")); - e->setAttribute (T("name"), name); - e->setAttribute (T("format"), pluginFormatName); - e->setAttribute (T("category"), category); - e->setAttribute (T("manufacturer"), manufacturerName); - e->setAttribute (T("version"), version); - e->setAttribute (T("file"), fileOrIdentifier); - e->setAttribute (T("uid"), String::toHexString (uid)); - e->setAttribute (T("isInstrument"), isInstrument); - e->setAttribute (T("fileTime"), String::toHexString (lastFileModTime.toMilliseconds())); - e->setAttribute (T("numInputs"), numInputChannels); - e->setAttribute (T("numOutputs"), numOutputChannels); + XmlElement* const e = new XmlElement ("PLUGIN"); + e->setAttribute ("name", name); + e->setAttribute ("format", pluginFormatName); + e->setAttribute ("category", category); + e->setAttribute ("manufacturer", manufacturerName); + e->setAttribute ("version", version); + e->setAttribute ("file", fileOrIdentifier); + e->setAttribute ("uid", String::toHexString (uid)); + e->setAttribute ("isInstrument", isInstrument); + e->setAttribute ("fileTime", String::toHexString (lastFileModTime.toMilliseconds())); + e->setAttribute ("numInputs", numInputChannels); + e->setAttribute ("numOutputs", numOutputChannels); return e; } bool PluginDescription::loadFromXml (const XmlElement& xml) { - if (xml.hasTagName (T("PLUGIN"))) + if (xml.hasTagName ("PLUGIN")) { - name = xml.getStringAttribute (T("name")); - pluginFormatName = xml.getStringAttribute (T("format")); - category = xml.getStringAttribute (T("category")); - manufacturerName = xml.getStringAttribute (T("manufacturer")); - version = xml.getStringAttribute (T("version")); - fileOrIdentifier = xml.getStringAttribute (T("file")); - uid = xml.getStringAttribute (T("uid")).getHexValue32(); - isInstrument = xml.getBoolAttribute (T("isInstrument"), false); - lastFileModTime = Time (xml.getStringAttribute (T("fileTime")).getHexValue64()); - numInputChannels = xml.getIntAttribute (T("numInputs")); - numOutputChannels = xml.getIntAttribute (T("numOutputs")); + name = xml.getStringAttribute ("name"); + pluginFormatName = xml.getStringAttribute ("format"); + category = xml.getStringAttribute ("category"); + manufacturerName = xml.getStringAttribute ("manufacturer"); + version = xml.getStringAttribute ("version"); + fileOrIdentifier = xml.getStringAttribute ("file"); + uid = xml.getStringAttribute ("uid").getHexValue32(); + isInstrument = xml.getBoolAttribute ("isInstrument", false); + lastFileModTime = Time (xml.getStringAttribute ("fileTime").getHexValue64()); + numInputChannels = xml.getIntAttribute ("numInputs"); + numOutputChannels = xml.getIntAttribute ("numOutputs"); return true; } @@ -29780,7 +29780,7 @@ static const tchar* auIdentifierPrefix = T("AudioUnit:"); static const String createAUPluginIdentifier (const ComponentDescription& desc) { - jassert (osTypeToString ('abcd') == T("abcd")); // agh, must have got the endianness wrong.. + jassert (osTypeToString ('abcd') == "abcd"); // agh, must have got the endianness wrong.. jassert (stringToOSType ("abcd") == (OSType) 'abcd'); // ditto String s (auIdentifierPrefix); @@ -29846,11 +29846,11 @@ static bool getComponentDescFromIdentifier (const String& fileOrIdentifier, Comp if (fileOrIdentifier.startsWithIgnoreCase (auIdentifierPrefix)) { - String s (fileOrIdentifier.substring (jmax (fileOrIdentifier.lastIndexOfChar (T(':')), - fileOrIdentifier.lastIndexOfChar (T('/'))) + 1)); + String s (fileOrIdentifier.substring (jmax (fileOrIdentifier.lastIndexOfChar (':'), + fileOrIdentifier.lastIndexOfChar ('/')) + 1)); StringArray tokens; - tokens.addTokens (s, T(","), String::empty); + tokens.addTokens (s, ",", String::empty); tokens.trim(); tokens.removeEmptyStrings(); @@ -30052,7 +30052,7 @@ AudioUnitPluginInstance::AudioUnitPluginInstance (const String& fileOrIdentifier { ++insideCallback; - log (T("Opening AU: ") + fileOrIdentifier); + log ("Opening AU: " + fileOrIdentifier); if (getComponentDescFromFile (fileOrIdentifier)) { @@ -30097,7 +30097,7 @@ bool AudioUnitPluginInstance::getComponentDescFromFile (const String& fileOrIden return true; const File file (fileOrIdentifier); - if (! file.hasFileExtension (T(".component"))) + if (! file.hasFileExtension (".component")) return false; const char* const utf8 = fileOrIdentifier.toUTF8(); @@ -30170,7 +30170,7 @@ void AudioUnitPluginInstance::initialise() if (initialised || audioUnit == 0) return; - log (T("Initialising AU: ") + pluginName); + log ("Initialising AU: " + pluginName); parameterIds.clear(); @@ -30705,7 +30705,7 @@ private: HIViewRef attachView (WindowRef windowRef, HIViewRef rootView) { - log (T("Opening AU GUI: ") + owner->plugin.getName()); + log ("Opening AU GUI: " + owner->plugin.getName()); AudioUnitCarbonView viewComponent = owner->getViewComponent(); @@ -30730,7 +30730,7 @@ private: void removeView (HIViewRef) { - log (T("Closing AU GUI: ") + owner->plugin.getName()); + log ("Closing AU GUI: " + owner->plugin.getName()); owner->closeViewComponent(); } @@ -30952,7 +30952,7 @@ void AudioUnitPluginInstance::changeProgramName (int index, const String& newNam const String AudioUnitPluginInstance::getInputChannelName (const int index) const { if (((unsigned int) index) < (unsigned int) getNumInputChannels()) - return T("Input ") + String (index + 1); + return "Input " + String (index + 1); return String::empty; } @@ -30968,7 +30968,7 @@ bool AudioUnitPluginInstance::isInputChannelStereoPair (int index) const const String AudioUnitPluginInstance::getOutputChannelName (const int index) const { if (((unsigned int) index) < (unsigned int) getNumOutputChannels()) - return T("Output ") + String (index + 1); + return "Output " + String (index + 1); return String::empty; } @@ -31136,7 +31136,7 @@ bool AudioUnitPluginFormat::fileMightContainThisPluginType (const String& fileOr const File f (fileOrIdentifier); - return f.hasFileExtension (T(".component")) + return f.hasFileExtension (".component") && f.isDirectory(); } @@ -31739,7 +31739,7 @@ public: bool ok = false; const String filename (file.getFullPathName()); - if (file.hasFileExtension (T(".vst"))) + if (file.hasFileExtension (".vst")) { const char* const utf8 = filename.toUTF8(); CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*) utf8, @@ -32078,7 +32078,7 @@ VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr pluginName; - log (T("Creating VST instance: ") + name); + log ("Creating VST instance: " + name); #if JUCE_MAC if (module->resFileId != 0) @@ -32161,7 +32161,7 @@ void VSTPluginInstance::initialise() if (initialised || effect == 0) return; - log (T("Initialising VST: ") + module->pluginName); + log ("Initialising VST: " + module->pluginName); initialised = true; dispatch (effIdentify, 0, 0, 0, 0); @@ -32686,7 +32686,7 @@ private: if (isOpen || getWindowHandle() == 0) return; - log (T("Opening VST UI: ") + plugin.name); + log ("Opening VST UI: " + plugin.name); isOpen = true; ERect* rect = 0; @@ -32800,7 +32800,7 @@ private: { if (isOpen) { - log (T("Closing VST UI: ") + plugin.getName()); + log ("Closing VST UI: " + plugin.getName()); isOpen = false; dispatch (effEditClose, 0, 0, 0, 0); @@ -34150,7 +34150,7 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti const File f (fileOrIdentifier); #if JUCE_MAC - if (f.isDirectory() && f.hasFileExtension (T(".vst"))) + if (f.isDirectory() && f.hasFileExtension (".vst")) return true; #if JUCE_PPC @@ -34173,10 +34173,10 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti return false; #elif JUCE_WIN32 return f.existsAsFile() - && f.hasFileExtension (T(".dll")); + && f.hasFileExtension (".dll"); #elif JUCE_LINUX return f.existsAsFile() - && f.hasFileExtension (T(".so")); + && f.hasFileExtension (".so"); #endif } @@ -39957,7 +39957,7 @@ static const var::identifier getColourPropertyId (const int colourId) { String s; s.preallocateStorage (18); - s << T("jcclr_") << String::toHexString (colourId); + s << "jcclr_" << String::toHexString (colourId); return s; } @@ -43209,12 +43209,12 @@ public: while (t[pos] != 0) { - if (t[pos] == T('\r')) + if (t[pos] == '\r') { ++numNewLineChars; ++pos; - if (t[pos] == T('\n')) + if (t[pos] == '\n') { ++numNewLineChars; ++pos; @@ -43223,7 +43223,7 @@ public: break; } - if (t[pos] == T('\n')) + if (t[pos] == '\n') { ++numNewLineChars; ++pos; @@ -43712,7 +43712,7 @@ bool CodeDocument::writeToStream (OutputStream& stream) void CodeDocument::setNewLineCharacters (const String& newLine) throw() { - jassert (newLine == T("\r\n") || newLine == T("\n") || newLine == T("\r")); + jassert (newLine == "\r\n" || newLine == "\n" || newLine == "\r"); newLineChars = newLine; } @@ -43761,8 +43761,8 @@ const CodeDocument::Position CodeDocument::findWordBreakAfter (const Position& p while (i < maxDistance && CharacterFunctions::isWhitespace (p.getCharacter()) - && (i == 0 || (p.getCharacter() != T('\n') - && p.getCharacter() != T('\r')))) + && (i == 0 || (p.getCharacter() != '\n' + && p.getCharacter() != '\r'))) { ++i; p.moveBy (1); @@ -43780,8 +43780,8 @@ const CodeDocument::Position CodeDocument::findWordBreakAfter (const Position& p while (i < maxDistance && CharacterFunctions::isWhitespace (p.getCharacter()) - && (i == 0 || (p.getCharacter() != T('\n') - && p.getCharacter() != T('\r')))) + && (i == 0 || (p.getCharacter() != '\n' + && p.getCharacter() != '\r'))) { ++i; p.moveBy (1); @@ -43802,7 +43802,7 @@ const CodeDocument::Position CodeDocument::findWordBreakBefore (const Position& { const tchar c = p.movedBy (-1).getCharacter(); - if (c == T('\r') || c == T('\n')) + if (c == '\r' || c == '\n') { stoppedAtLineStart = true; @@ -44303,7 +44303,7 @@ private: for (;;) { - int tabPos = t.text.indexOfChar (T('\t')); + int tabPos = t.text.indexOfChar ('\t'); if (tabPos < 0) break; @@ -44322,7 +44322,7 @@ private: int col = 0; for (int i = 0; i < index; ++i) { - if (line[i] != T('\t')) + if (line[i] != '\t') ++col; else col += spacesPerTab - (col % spacesPerTab); @@ -44690,7 +44690,7 @@ void CodeEditorComponent::insertTabAtCaret() } else { - insertTextAtCaret (T("\t")); + insertTextAtCaret ("\t"); } } @@ -45003,28 +45003,28 @@ bool CodeEditorComponent::keyPressed (const KeyPress& key) { deleteForward (moveInWholeWordSteps); } - else if (key == KeyPress (T('c'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('c', ModifierKeys::commandModifier, 0)) { copy(); } - else if (key == KeyPress (T('x'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('x', ModifierKeys::commandModifier, 0)) { copyThenCut(); } - else if (key == KeyPress (T('v'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('v', ModifierKeys::commandModifier, 0)) { paste(); } - else if (key == KeyPress (T('z'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('z', ModifierKeys::commandModifier, 0)) { undo(); } - else if (key == KeyPress (T('y'), ModifierKeys::commandModifier, 0) - || key == KeyPress (T('z'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)) + else if (key == KeyPress ('y', ModifierKeys::commandModifier, 0) + || key == KeyPress ('z', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)) { redo(); } - else if (key == KeyPress (T('a'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('a', ModifierKeys::commandModifier, 0)) { selectAll(); } @@ -45140,7 +45140,7 @@ int CodeEditorComponent::indexToColumn (int lineNum, int index) const throw() int col = 0; for (int i = 0; i < index; ++i) { - if (line[i] != T('\t')) + if (line[i] != '\t') ++col; else col += getTabSize() - (col % getTabSize()); @@ -45157,7 +45157,7 @@ int CodeEditorComponent::columnToIndex (int lineNum, int column) const throw() int i, col = 0; for (i = 0; i < lineLength; ++i) { - if (line[i] != T('\t')) + if (line[i] != '\t') ++col; else col += getTabSize() - (col % getTabSize()); @@ -45172,7 +45172,7 @@ int CodeEditorComponent::columnToIndex (int lineNum, int column) const throw() void CodeEditorComponent::setFont (const Font& newFont) { font = newFont; - charWidth = font.getStringWidthFloat (T("0")); + charWidth = font.getStringWidthFloat ("0"); lineHeight = roundToInt (font.getHeight()); resized(); } @@ -45301,14 +45301,14 @@ namespace CppTokeniser static bool isIdentifierStart (const tchar c) throw() { return CharacterFunctions::isLetter (c) - || c == T('_') || c == T('@'); + || c == '_' || c == '@'; } static bool isIdentifierBody (const tchar c) throw() { return CharacterFunctions::isLetter (c) || CharacterFunctions::isDigit (c) - || c == T('_') || c == T('@'); + || c == '_' || c == '@'; } static int parseIdentifier (CodeDocument::Iterator& source) throw() @@ -45569,7 +45569,7 @@ static void skipComment (CodeDocument::Iterator& source) throw() { const juce_wchar c = source.nextChar(); - if (c == 0 || (c == T('/') && lastWasStar)) + if (c == 0 || (c == '/' && lastWasStar)) break; lastWasStar = (c == '*'); @@ -45591,20 +45591,20 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source) source.skip(); break; - case T('0'): - case T('1'): - case T('2'): - case T('3'): - case T('4'): - case T('5'): - case T('6'): - case T('7'): - case T('8'): - case T('9'): + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': result = CppTokeniser::parseNumber (source); break; - case T('.'): + case '.': result = CppTokeniser::parseNumber (source); if (result == tokenType_error) @@ -45612,41 +45612,41 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source) break; - case T(','): - case T(';'): - case T(':'): + case ',': + case ';': + case ':': source.skip(); result = tokenType_punctuation; break; - case T('('): - case T(')'): - case T('{'): - case T('}'): - case T('['): - case T(']'): + case '(': + case ')': + case '{': + case '}': + case '[': + case ']': source.skip(); result = tokenType_bracket; break; - case T('"'): - case T('\''): + case '"': + case '\'': CppTokeniser::skipQuotedString (source); result = tokenType_stringLiteral; break; - case T('+'): + case '+': result = tokenType_operator; source.skip(); - if (source.peekNextChar() == T('+')) + if (source.peekNextChar() == '+') source.skip(); - else if (source.peekNextChar() == T('=')) + else if (source.peekNextChar() == '=') source.skip(); break; - case T('-'): + case '-': source.skip(); result = CppTokeniser::parseNumber (source); @@ -45654,39 +45654,39 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source) { result = tokenType_operator; - if (source.peekNextChar() == T('-')) + if (source.peekNextChar() == '-') source.skip(); - else if (source.peekNextChar() == T('=')) + else if (source.peekNextChar() == '=') source.skip(); } break; - case T('*'): - case T('%'): - case T('='): - case T('!'): + case '*': + case '%': + case '=': + case '!': result = tokenType_operator; source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); break; - case T('/'): + case '/': result = tokenType_operator; source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('/')) + else if (source.peekNextChar() == '/') { result = tokenType_comment; source.skipToEndOfLine(); } - else if (source.peekNextChar() == T('*')) + else if (source.peekNextChar() == '*') { source.skip(); result = tokenType_comment; @@ -45695,103 +45695,103 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source) break; - case T('?'): - case T('~'): + case '?': + case '~': source.skip(); result = tokenType_operator; break; - case T('<'): + case '<': source.skip(); result = tokenType_operator; - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('<')) + else if (source.peekNextChar() == '<') { source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); } break; - case T('>'): + case '>': source.skip(); result = tokenType_operator; - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('<')) + else if (source.peekNextChar() == '<') { source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); } break; - case T('|'): + case '|': source.skip(); result = tokenType_operator; - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('|')) + else if (source.peekNextChar() == '|') { source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); } break; - case T('&'): + case '&': source.skip(); result = tokenType_operator; - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('&')) + else if (source.peekNextChar() == '&') { source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); } break; - case T('^'): + case '^': source.skip(); result = tokenType_operator; - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('^')) + else if (source.peekNextChar() == '^') { source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); } break; - case T('#'): + case '#': result = tokenType_preprocessor; source.skipToEndOfLine(); break; @@ -47588,7 +47588,7 @@ bool ListBox::keyPressed (const KeyPress& key) if (model != 0) model->deleteKeyPressed (lastRowSelected); } - else if (multiple && key == KeyPress (T('a'), ModifierKeys::commandModifier, 0)) + else if (multiple && key == KeyPress ('a', ModifierKeys::commandModifier, 0)) { selectRangeOfRows (0, std::numeric_limits::max()); } @@ -47863,7 +47863,7 @@ void ProgressBar::paint (Graphics& g) if (displayPercentage) { if (currentValue >= 0 && currentValue <= 1.0) - text << roundToInt (currentValue * 100.0) << T("%"); + text << roundToInt (currentValue * 100.0) << '%'; } else { @@ -48519,7 +48519,7 @@ double Slider::getValueFromText (const String& text) if (t.endsWith (textSuffix)) t = t.substring (0, t.length() - textSuffix.length()); - while (t.startsWithChar (T('+'))) + while (t.startsWithChar ('+')) t = t.substring (1).trimStart(); return t.initialSectionContainingOnly (T("0123456789.,-")) @@ -50735,7 +50735,7 @@ struct TextAtom uint16 numChars; bool isWhitespace() const { return CharacterFunctions::isWhitespace (atomText[0]); } - bool isNewLine() const { return atomText[0] == T('\r') || atomText[0] == T('\n'); } + bool isNewLine() const { return atomText[0] == '\r' || atomText[0] == '\n'; } const String getText (const tchar passwordCharacter) const { @@ -50970,30 +50970,30 @@ private: // create a whitespace atom unless it starts with non-ws if (CharacterFunctions::isWhitespace (text[i]) - && text[i] != T('\r') - && text[i] != T('\n')) + && text[i] != '\r' + && text[i] != '\n') { while (i < len && CharacterFunctions::isWhitespace (text[i]) - && text[i] != T('\r') - && text[i] != T('\n')) + && text[i] != '\r' + && text[i] != '\n') { ++i; } } else { - if (text[i] == T('\r')) + if (text[i] == '\r') { ++i; - if ((i < len) && (text[i] == T('\n'))) + if ((i < len) && (text[i] == '\n')) { ++start; ++i; } } - else if (text[i] == T('\n')) + else if (text[i] == '\n') { ++i; } @@ -52248,7 +52248,7 @@ void TextEditor::insertTextAtCaret (const String& newText_) if (allowedCharacters.isNotEmpty()) newText = newText.retainCharacters (allowedCharacters); - if ((! returnKeyStartsNewLine) && newText == T("\n")) + if ((! returnKeyStartsNewLine) && newText == "\n") { returnPressed(); return; @@ -52507,7 +52507,7 @@ void TextEditor::mouseDoubleClick (const MouseEvent& e) { while (tokenEnd < totalLength) { - if (t [tokenEnd] != T('\r') && t [tokenEnd] != T('\n')) + if (t [tokenEnd] != '\r' && t [tokenEnd] != '\n') ++tokenEnd; else break; @@ -52515,7 +52515,7 @@ void TextEditor::mouseDoubleClick (const MouseEvent& e) while (tokenStart > 0) { - if (t [tokenStart - 1] != T('\r') && t [tokenStart - 1] != T('\n')) + if (t [tokenStart - 1] != '\r' && t [tokenStart - 1] != '\n') --tokenStart; else break; @@ -52535,7 +52535,7 @@ void TextEditor::mouseWheelMove (const MouseEvent& e, float wheelIncrementX, flo bool TextEditor::keyPressed (const KeyPress& key) { - if (isReadOnly() && key != KeyPress (T('c'), ModifierKeys::commandModifier, 0)) + if (isReadOnly() && key != KeyPress ('c', ModifierKeys::commandModifier, 0)) return false; const bool moveInWholeWordSteps = key.getModifiers().isCtrlDown() || key.getModifiers().isAltDown(); @@ -52630,35 +52630,35 @@ bool TextEditor::keyPressed (const KeyPress& key) cut(); } - else if (key == KeyPress (T('c'), ModifierKeys::commandModifier, 0) + else if (key == KeyPress ('c', ModifierKeys::commandModifier, 0) || key == KeyPress (KeyPress::insertKey, ModifierKeys::ctrlModifier, 0)) { newTransaction(); copy(); } - else if (key == KeyPress (T('x'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('x', ModifierKeys::commandModifier, 0)) { newTransaction(); copy(); cut(); } - else if (key == KeyPress (T('v'), ModifierKeys::commandModifier, 0) + else if (key == KeyPress ('v', ModifierKeys::commandModifier, 0) || key == KeyPress (KeyPress::insertKey, ModifierKeys::shiftModifier, 0)) { newTransaction(); paste(); } - else if (key == KeyPress (T('z'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('z', ModifierKeys::commandModifier, 0)) { newTransaction(); doUndoRedo (false); } - else if (key == KeyPress (T('y'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('y', ModifierKeys::commandModifier, 0)) { newTransaction(); doUndoRedo (true); } - else if (key == KeyPress (T('a'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('a', ModifierKeys::commandModifier, 0)) { newTransaction(); moveCursorTo (getTotalNumChars(), false); @@ -52667,7 +52667,7 @@ bool TextEditor::keyPressed (const KeyPress& key) else if (key == KeyPress::returnKey) { newTransaction(); - insertTextAtCaret (T("\n")); + insertTextAtCaret ("\n"); } else if (key.isKeyCode (KeyPress::escapeKey)) { @@ -53644,10 +53644,10 @@ void Toolbar::setStyle (const ToolbarItemStyle& newStyle) const String Toolbar::toString() const { - String s (T("TB:")); + String s ("TB:"); for (int i = 0; i < getNumItems(); ++i) - s << getItemId(i) << T(' '); + s << getItemId(i) << ' '; return s.trimEnd(); } @@ -54999,7 +54999,7 @@ XmlElement* TreeView::getOpennessState (const bool alsoIncludeScrollPosition) co e = rootItem->getOpennessState(); if (e != 0 && alsoIncludeScrollPosition) - e->setAttribute (T("scrollPos"), viewport->getViewPositionY()); + e->setAttribute ("scrollPos", viewport->getViewPositionY()); } return e; @@ -55011,9 +55011,9 @@ void TreeView::restoreOpennessState (const XmlElement& newState) { rootItem->restoreOpennessState (newState); - if (newState.hasAttribute (T("scrollPos"))) + if (newState.hasAttribute ("scrollPos")) viewport->setViewPosition (viewport->getViewPositionX(), - newState.getIntAttribute (T("scrollPos"))); + newState.getIntAttribute ("scrollPos")); } } @@ -56108,7 +56108,7 @@ const String TreeViewItem::getItemIdentifierString() const if (parentItem != 0) s = parentItem->getItemIdentifierString(); - return s + T("/") + getUniqueName().replaceCharacter (T('/'), T('\\')); + return s + "/" + getUniqueName().replaceCharacter ('/', '\\'); } TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifierString) @@ -56118,7 +56118,7 @@ TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifi if (uid == identifierString) return this; - if (identifierString.startsWith (uid + T("/"))) + if (identifierString.startsWith (uid + "/")) { const String remainingPath (identifierString.substring (uid.length() + 1)); @@ -56141,17 +56141,17 @@ TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifi void TreeViewItem::restoreOpennessState (const XmlElement& e) throw() { - if (e.hasTagName (T("CLOSED"))) + if (e.hasTagName ("CLOSED")) { setOpen (false); } - else if (e.hasTagName (T("OPEN"))) + else if (e.hasTagName ("OPEN")) { setOpen (true); forEachXmlChildElement (e, n) { - const String id (n->getStringAttribute (T("id"))); + const String id (n->getStringAttribute ("id")); for (int i = 0; i < subItems.size(); ++i) { @@ -56177,17 +56177,17 @@ XmlElement* TreeViewItem::getOpennessState() const throw() if (isOpen()) { - e = new XmlElement (T("OPEN")); + e = new XmlElement ("OPEN"); for (int i = 0; i < subItems.size(); ++i) e->addChildElement (subItems.getUnchecked(i)->getOpennessState()); } else { - e = new XmlElement (T("CLOSED")); + e = new XmlElement ("CLOSED"); } - e->setAttribute (T("id"), name); + e->setAttribute ("id", name); return e; } @@ -56350,7 +56350,7 @@ void DirectoryContentsList::refresh() jassert (fileFindHandle == 0); - fileFindHandle = juce_findFileStart (path, T("*"), fileFound, + fileFindHandle = juce_findFileStart (path, "*", fileFound, &fileFoundIsDir, &isHidden, &fileSize, @@ -56492,8 +56492,8 @@ bool DirectoryContentsList::addFile (const String& filename, const Time& creationTime, const bool isReadOnly) { - if (filename == T("..") - || filename == T(".") + if (filename == ".." + || filename == "." || (ignoreHiddenFiles && isHidden)) return false; @@ -56823,7 +56823,7 @@ void FileBrowserComponent::selectionChanged() } if (newFilenames.size() > 0) - filenameBox->setText (newFilenames.joinIntoString (T(", ")), false); + filenameBox->setText (newFilenames.joinIntoString (", "), false); sendListenerChangeMessage(); } @@ -57003,7 +57003,7 @@ const BigInteger FileBrowserComponent::getRoots (StringArray& rootNames, StringA { const File& volume = volumes.getReference(i); - if (volume.isDirectory() && ! volume.getFileName().startsWithChar (T('.'))) + if (volume.isDirectory() && ! volume.getFileName().startsWithChar ('.')) { rootPaths.add (volume.getFullPathName()); rootNames.add (volume.getFileName()); @@ -57044,7 +57044,7 @@ FileChooser::FileChooser (const String& chooserBoxTitle, #endif if (! fileFilters.containsNonWhitespaceChars()) - filters = T("*"); + filters = "*"; } FileChooser::~FileChooser() @@ -57242,9 +57242,9 @@ void FileChooserDialogBox::buttonClicked (Button* button) { if (! AlertWindow::showOkCancelBox (AlertWindow::WarningIcon, TRANS("File already exists"), - TRANS("There's already a file called:\n\n") - + content->chooserComponent->getSelectedFile(0).getFullPathName() - + T("\n\nAre you sure you want to overwrite it?"), + TRANS("There's already a file called:") + + "\n\n" + content->chooserComponent->getSelectedFile(0).getFullPathName() + + "\n\n" + TRANS("Are you sure you want to overwrite it?"), TRANS("overwrite"), TRANS("cancel"))) { @@ -57511,7 +57511,7 @@ private: { if (icon == 0) { - const int hashCode = (file.getFullPathName() + T("_iconCacheSalt")).hashCode(); + const int hashCode = (file.getFullPathName() + "_iconCacheSalt").hashCode(); Image* im = ImageCache::getFromHashCode (hashCode); if (im == 0 && ! onlyUpdateIfCached) @@ -57597,14 +57597,14 @@ FilenameComponent::FilenameComponent (const String& name, wildcard (fileBrowserWildcard), enforcedSuffix (enforcedSuffix_) { - addAndMakeVisible (filenameBox = new ComboBox (T("fn"))); + addAndMakeVisible (filenameBox = new ComboBox ("fn")); filenameBox->setEditableText (canEditFilename); filenameBox->addListener (this); filenameBox->setTextWhenNothingSelected (textWhenNothingSelected); filenameBox->setTextWhenNoChoicesAvailable (TRANS("(no recently seleced files)")); browseButton = 0; - setBrowseButtonText (T("...")); + setBrowseButtonText ("..."); setCurrentFile (currentFile, true); } @@ -57918,7 +57918,7 @@ void FileSearchPathListComponent::deleteKeyPressed (int row) void FileSearchPathListComponent::returnKeyPressed (int row) { - FileChooser chooser (TRANS("Change folder..."), path [row], T("*")); + FileChooser chooser (TRANS("Change folder..."), path [row], "*"); if (chooser.browseForDirectory()) { @@ -57999,7 +57999,7 @@ void FileSearchPathListComponent::buttonClicked (Button* button) if (start == File::nonexistent) start = File::getCurrentWorkingDirectory(); - FileChooser chooser (TRANS("Add a folder..."), start, T("*")); + FileChooser chooser (TRANS("Add a folder..."), start, "*"); if (chooser.browseForDirectory()) { @@ -58212,7 +58212,7 @@ private: { if (icon == 0) { - const int hashCode = (file.getFullPathName() + T("_iconCacheSalt")).hashCode(); + const int hashCode = (file.getFullPathName() + "_iconCacheSalt").hashCode(); Image* im = ImageCache::getFromHashCode (hashCode); if (im == 0 && ! onlyUpdateIfCached) @@ -58379,7 +58379,7 @@ WildcardFileFilter::WildcardFileFilter (const String& fileWildcardPatterns, const String& directoryWildcardPatterns, const String& description_) : FileFilter (description_.isEmpty() ? fileWildcardPatterns - : (description_ + T(" (") + fileWildcardPatterns + T(")"))) + : (description_ + " (" + fileWildcardPatterns + ")")) { parse (fileWildcardPatterns, fileWildcards); parse (directoryWildcardPatterns, directoryWildcards); @@ -58401,7 +58401,7 @@ bool WildcardFileFilter::isDirectorySuitable (const File& file) const void WildcardFileFilter::parse (const String& pattern, StringArray& result) throw() { - result.addTokens (pattern.toLowerCase(), T(";,"), T("\"'")); + result.addTokens (pattern.toLowerCase(), ";,", "\"'"); result.trim(); result.removeEmptyStrings(); @@ -58409,8 +58409,8 @@ void WildcardFileFilter::parse (const String& pattern, StringArray& result) thro // special case for *.*, because people use it to mean "any file", but it // would actually ignore files with no extension. for (int i = result.size(); --i >= 0;) - if (result[i] == T("*.*")) - result.set (i, T("*")); + if (result[i] == "*.*") + result.set (i, "*"); } bool WildcardFileFilter::match (const File& file, const StringArray& wildcards) throw() @@ -58850,7 +58850,7 @@ bool KeyMappingEditorComponent::mightContainSubItems() const String KeyMappingEditorComponent::getUniqueName() const { - return T("keys"); + return "keys"; } void KeyMappingEditorComponent::setColours (const Colour& mainBackground, @@ -59108,36 +59108,39 @@ bool KeyPress::isCurrentlyDown() const throw() == (mods.getRawFlags() & ModifierKeys::allKeyboardModifiers); } -struct KeyNameAndCode +namespace KeyPressHelpers { - const char* name; - int code; -}; + struct KeyNameAndCode + { + const char* name; + int code; + }; -static const KeyNameAndCode keyNameTranslations[] = -{ - { "spacebar", KeyPress::spaceKey }, - { "return", KeyPress::returnKey }, - { "escape", KeyPress::escapeKey }, - { "backspace", KeyPress::backspaceKey }, - { "cursor left", KeyPress::leftKey }, - { "cursor right", KeyPress::rightKey }, - { "cursor up", KeyPress::upKey }, - { "cursor down", KeyPress::downKey }, - { "page up", KeyPress::pageUpKey }, - { "page down", KeyPress::pageDownKey }, - { "home", KeyPress::homeKey }, - { "end", KeyPress::endKey }, - { "delete", KeyPress::deleteKey }, - { "insert", KeyPress::insertKey }, - { "tab", KeyPress::tabKey }, - { "play", KeyPress::playKey }, - { "stop", KeyPress::stopKey }, - { "fast forward", KeyPress::fastForwardKey }, - { "rewind", KeyPress::rewindKey } -}; + static const KeyNameAndCode translations[] = + { + { "spacebar", KeyPress::spaceKey }, + { "return", KeyPress::returnKey }, + { "escape", KeyPress::escapeKey }, + { "backspace", KeyPress::backspaceKey }, + { "cursor left", KeyPress::leftKey }, + { "cursor right", KeyPress::rightKey }, + { "cursor up", KeyPress::upKey }, + { "cursor down", KeyPress::downKey }, + { "page up", KeyPress::pageUpKey }, + { "page down", KeyPress::pageDownKey }, + { "home", KeyPress::homeKey }, + { "end", KeyPress::endKey }, + { "delete", KeyPress::deleteKey }, + { "insert", KeyPress::insertKey }, + { "tab", KeyPress::tabKey }, + { "play", KeyPress::playKey }, + { "stop", KeyPress::stopKey }, + { "fast forward", KeyPress::fastForwardKey }, + { "rewind", KeyPress::rewindKey } + }; -static const tchar* const numberPadPrefix = T("numpad "); + static const String numberPadPrefix() { return "numpad "; } +} const KeyPress KeyPress::createFromDescription (const String& desc) throw() { @@ -59162,11 +59165,11 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw() int key = 0; - for (int i = 0; i < numElementsInArray (keyNameTranslations); ++i) + for (int i = 0; i < numElementsInArray (KeyPressHelpers::translations); ++i) { - if (desc.containsWholeWordIgnoreCase (String (keyNameTranslations[i].name))) + if (desc.containsWholeWordIgnoreCase (String (KeyPressHelpers::translations[i].name))) { - key = keyNameTranslations[i].code; + key = KeyPressHelpers::translations[i].code; break; } } @@ -59174,23 +59177,23 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw() if (key == 0) { // see if it's a numpad key.. - if (desc.containsIgnoreCase (numberPadPrefix)) + if (desc.containsIgnoreCase (KeyPressHelpers::numberPadPrefix())) { const tchar lastChar = desc.trimEnd().getLastCharacter(); - if (lastChar >= T('0') && lastChar <= T('9')) - key = numberPad0 + lastChar - T('0'); - else if (lastChar == T('+')) + if (lastChar >= '0' && lastChar <= '9') + key = numberPad0 + lastChar - '0'; + else if (lastChar == '+') key = numberPadAdd; - else if (lastChar == T('-')) + else if (lastChar == '-') key = numberPadSubtract; - else if (lastChar == T('*')) + else if (lastChar == '*') key = numberPadMultiply; - else if (lastChar == T('/')) + else if (lastChar == '/') key = numberPadDivide; - else if (lastChar == T('.')) + else if (lastChar == '.') key = numberPadDecimalPoint; - else if (lastChar == T('=')) + else if (lastChar == '=') key = numberPadEquals; else if (desc.endsWith (T("separator"))) key = numberPadSeparator; @@ -59202,7 +59205,7 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw() { // see if it's a function key.. for (int i = 1; i <= 12; ++i) - if (desc.containsWholeWordIgnoreCase (T("f") + String (i))) + if (desc.containsWholeWordIgnoreCase ("f" + String (i))) key = F1Key + i - 1; if (key == 0) @@ -59232,7 +59235,7 @@ const String KeyPress::getTextDescription() const throw() { // some keyboard layouts use a shift-key to get the slash, but in those cases, we // want to store it as being a slash, not shift+whatever. - if (textCharacter == T('/')) + if (textCharacter == '/') return "/"; if (mods.isCtrlDown()) @@ -59254,30 +59257,30 @@ const String KeyPress::getTextDescription() const throw() desc << "alt + "; #endif - for (int i = 0; i < numElementsInArray (keyNameTranslations); ++i) - if (keyCode == keyNameTranslations[i].code) - return desc + keyNameTranslations[i].name; + for (int i = 0; i < numElementsInArray (KeyPressHelpers::translations); ++i) + if (keyCode == KeyPressHelpers::translations[i].code) + return desc + KeyPressHelpers::translations[i].name; if (keyCode >= F1Key && keyCode <= F16Key) desc << 'F' << (1 + keyCode - F1Key); else if (keyCode >= numberPad0 && keyCode <= numberPad9) - desc << numberPadPrefix << (keyCode - numberPad0); + desc << KeyPressHelpers::numberPadPrefix() << (keyCode - numberPad0); else if (keyCode >= 33 && keyCode < 176) desc += CharacterFunctions::toUpperCase ((tchar) keyCode); else if (keyCode == numberPadAdd) - desc << numberPadPrefix << '+'; + desc << KeyPressHelpers::numberPadPrefix() << '+'; else if (keyCode == numberPadSubtract) - desc << numberPadPrefix << '-'; + desc << KeyPressHelpers::numberPadPrefix() << '-'; else if (keyCode == numberPadMultiply) - desc << numberPadPrefix << '*'; + desc << KeyPressHelpers::numberPadPrefix() << '*'; else if (keyCode == numberPadDivide) - desc << numberPadPrefix << '/'; + desc << KeyPressHelpers::numberPadPrefix() << '/'; else if (keyCode == numberPadSeparator) - desc << numberPadPrefix << "separator"; + desc << KeyPressHelpers::numberPadPrefix() << "separator"; else if (keyCode == numberPadDecimalPoint) - desc << numberPadPrefix << '.'; + desc << KeyPressHelpers::numberPadPrefix() << '.'; else if (keyCode == numberPadDelete) - desc << numberPadPrefix << "delete"; + desc << KeyPressHelpers::numberPadPrefix() << "delete"; else desc << '#' << String::toHexString (keyCode); } @@ -59488,9 +59491,9 @@ void KeyPressMappingSet::invokeCommand (const CommandID commandID, bool KeyPressMappingSet::restoreFromXml (const XmlElement& xmlVersion) { - if (xmlVersion.hasTagName (T("KEYMAPPINGS"))) + if (xmlVersion.hasTagName ("KEYMAPPINGS")) { - if (xmlVersion.getBoolAttribute (T("basedOnDefaults"), true)) + if (xmlVersion.getBoolAttribute ("basedOnDefaults", true)) { // if the XML was created as a set of differences from the default mappings, // (i.e. by calling createXml (true)), then we need to first restore the defaults. @@ -59505,17 +59508,17 @@ bool KeyPressMappingSet::restoreFromXml (const XmlElement& xmlVersion) forEachXmlChildElement (xmlVersion, map) { - const CommandID commandId = map->getStringAttribute (T("commandId")).getHexValue32(); + const CommandID commandId = map->getStringAttribute ("commandId").getHexValue32(); if (commandId != 0) { - const KeyPress key (KeyPress::createFromDescription (map->getStringAttribute (T("key")))); + const KeyPress key (KeyPress::createFromDescription (map->getStringAttribute ("key"))); - if (map->hasTagName (T("MAPPING"))) + if (map->hasTagName ("MAPPING")) { addKeyPress (commandId, key); } - else if (map->hasTagName (T("UNMAPPING"))) + else if (map->hasTagName ("UNMAPPING")) { if (containsMapping (commandId, key)) removeKeyPress (key); @@ -59539,9 +59542,9 @@ XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefault defaultSet->resetToDefaultMappings(); } - XmlElement* const doc = new XmlElement (T("KEYMAPPINGS")); + XmlElement* const doc = new XmlElement ("KEYMAPPINGS"); - doc->setAttribute (T("basedOnDefaults"), saveDifferencesFromDefaultSet); + doc->setAttribute ("basedOnDefaults", saveDifferencesFromDefaultSet); int i; for (i = 0; i < mappings.size(); ++i) @@ -59555,9 +59558,9 @@ XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefault { XmlElement* const map = doc->createNewChildElement ("MAPPING"); - map->setAttribute (T("commandId"), String::toHexString ((int) cm->commandID)); - map->setAttribute (T("description"), commandManager->getDescriptionOfCommand (cm->commandID)); - map->setAttribute (T("key"), cm->keypresses.getReference (j).getTextDescription()); + map->setAttribute ("commandId", String::toHexString ((int) cm->commandID)); + map->setAttribute ("description", commandManager->getDescriptionOfCommand (cm->commandID)); + map->setAttribute ("key", cm->keypresses.getReference (j).getTextDescription()); } } } @@ -59574,9 +59577,9 @@ XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefault { XmlElement* const map = doc->createNewChildElement ("UNMAPPING"); - map->setAttribute (T("commandId"), String::toHexString ((int) cm->commandID)); - map->setAttribute (T("description"), commandManager->getDescriptionOfCommand (cm->commandID)); - map->setAttribute (T("key"), cm->keypresses.getReference (j).getTextDescription()); + map->setAttribute ("commandId", String::toHexString ((int) cm->commandID)); + map->setAttribute ("description", commandManager->getDescriptionOfCommand (cm->commandID)); + map->setAttribute ("key", cm->keypresses.getReference (j).getTextDescription()); } } } @@ -63247,15 +63250,6 @@ static const Colour createBaseColour (const Colour& buttonColour, return baseColour; } -static String defaultSansName, defaultSerifName, defaultFixedName; - -void clearUpDefaultFontNames() throw() -{ - defaultSansName = String::empty; - defaultSerifName = String::empty; - defaultFixedName = String::empty; -} - LookAndFeel::LookAndFeel() { /* if this fails it means you're trying to create a LookAndFeel object before @@ -63392,6 +63386,8 @@ LookAndFeel::LookAndFeel() for (int i = 0; i < numElementsInArray (standardColours); i += 2) setColour (standardColours [i], Colour (standardColours [i + 1])); + static String defaultSansName, defaultSerifName, defaultFixedName; + if (defaultSansName.isEmpty()) Font::getPlatformDefaultFontNames (defaultSansName, defaultSerifName, defaultFixedName); @@ -65507,7 +65503,7 @@ Button* LookAndFeel::createTabBarExtrasButton() overImage.insertDrawable (ellipse); overImage.insertDrawable (dp); - DrawableButton* db = new DrawableButton (T("tabs"), DrawableButton::ImageFitted); + DrawableButton* db = new DrawableButton ("tabs", DrawableButton::ImageFitted); db->setImages (&normalImage, &overImage, 0); return db; } @@ -67468,7 +67464,7 @@ class PopupMenu::Window : public Component, public: Window() - : Component (T("menu")), + : Component ("menu"), owner (0), currentChild (0), activeSubMenu (0), @@ -70947,7 +70943,7 @@ void PropertyPanel::setSectionEnabled (const int sectionIndex, const bool should XmlElement* PropertyPanel::getOpennessState() const { - XmlElement* const xml = new XmlElement (T("PROPERTYPANELSTATE")); + XmlElement* const xml = new XmlElement ("PROPERTYPANELSTATE"); xml->setAttribute ("scrollPos", viewport->getViewPositionY()); @@ -70968,14 +70964,14 @@ XmlElement* PropertyPanel::getOpennessState() const void PropertyPanel::restoreOpennessState (const XmlElement& xml) { - if (xml.hasTagName (T("PROPERTYPANELSTATE"))) + if (xml.hasTagName ("PROPERTYPANELSTATE")) { const StringArray sections (getSectionNames()); - forEachXmlChildElementWithTagName (xml, e, T("SECTION")) + forEachXmlChildElementWithTagName (xml, e, "SECTION") { - setSectionOpen (sections.indexOf (e->getStringAttribute (T("name"))), - e->getBoolAttribute (T("open"))); + setSectionOpen (sections.indexOf (e->getStringAttribute ("name")), + e->getBoolAttribute ("open")); } viewport->setViewPosition (viewport->getViewPositionX(), @@ -71539,7 +71535,7 @@ public: if (error.isNotEmpty()) { AlertWindow::showMessageBox (AlertWindow::WarningIcon, - T("Error when trying to open audio device!"), + "Error when trying to open audio device!", error); } } @@ -71697,7 +71693,7 @@ public: for (int i = 0; i < numRates; ++i) { const int rate = roundToInt (currentDevice->getSampleRate (i)); - sampleRateDropDown->addItem (String (rate) + T(" Hz"), rate); + sampleRateDropDown->addItem (String (rate) + " Hz", rate); } sampleRateDropDown->setSelectedId (roundToInt (currentDevice->getCurrentSampleRate()), true); @@ -71729,9 +71725,9 @@ public: { const int bs = currentDevice->getBufferSizeSamples (i); bufferSizeDropDown->addItem (String (bs) - + T(" samples (") + + " samples (" + String (bs * 1000.0 / currentRate, 1) - + T(" ms)"), + + " ms)", bs); } @@ -73056,7 +73052,7 @@ void ColourSelector::paint (Graphics& g) for (int i = 4; --i >= 0;) { if (sliders[i]->isVisible()) - g.drawText (sliders[i]->getName() + T(":"), + g.drawText (sliders[i]->getName() + ":", 0, sliders[i]->getY(), sliders[i]->getX() - 8, sliders[i]->getHeight(), Justification::centredRight, false); @@ -73372,10 +73368,7 @@ void DropShadower::updateShadows() { // keep a cached version of the image to save doing the gaussian too often String imageId; - imageId << shadowEdge << T(',') - << xOffset << T(',') - << yOffset << T(',') - << alpha; + imageId << shadowEdge << ',' << xOffset << ',' << yOffset << ',' << alpha; const int hash = imageId.hashCode(); @@ -73470,12 +73463,8 @@ void DropShadower::updateShadows() bringShadowWindowsToFront(); } -void DropShadower::setShadowImage (Image* const src, - const int num, - const int w, - const int h, - const int sx, - const int sy) +void DropShadower::setShadowImage (Image* const src, const int num, const int w, const int h, + const int sx, const int sy) { shadowImageSections[num] = new Image (Image::ARGB, w, h, true); @@ -75158,7 +75147,7 @@ public: void returnPressed() { // pass these up the component hierarchy to be trigger the buttons - getParentComponent()->keyPressed (KeyPress (KeyPress::returnKey, 0, T('\n'))); + getParentComponent()->keyPressed (KeyPress (KeyPress::returnKey, 0, '\n')); } void escapePressed() @@ -75187,7 +75176,7 @@ AlertWindow::AlertWindow (const String& title, associatedComponent (associatedComponent_) { if (message.isEmpty()) - text = T(" "); // to force an update if the message is empty + text = " "; // to force an update if the message is empty setMessage (message); @@ -75234,7 +75223,7 @@ void AlertWindow::setMessage (const String& message) font.setHeight (15.0f); Font titleFont (font.getHeight() * 1.1f, Font::bold); - textLayout.setText (getName() + T("\n\n"), titleFont); + textLayout.setText (getName() + "\n\n", titleFont); textLayout.appendText (text, font); @@ -76670,7 +76659,7 @@ void DocumentWindow::lookAndFeelChanged() if (getCloseButton() != 0) { #if JUCE_MAC - getCloseButton()->addShortcut (KeyPress (T('w'), ModifierKeys::commandModifier, 0)); + getCloseButton()->addShortcut (KeyPress ('w', ModifierKeys::commandModifier, 0)); #else getCloseButton()->addShortcut (KeyPress (KeyPress::F4Key, ModifierKeys::altModifier, 0)); #endif @@ -82742,7 +82731,7 @@ Drawable* Drawable::createFromImageData (const void* data, const size_t numBytes XmlDocument doc (asString); ScopedPointer outer (doc.getDocumentElement (true)); - if (outer != 0 && outer->hasTagName (T("svg"))) + if (outer != 0 && outer->hasTagName ("svg")) { ScopedPointer svg (doc.getDocumentElement()); @@ -82943,7 +82932,7 @@ Drawable* DrawableComposite::createCopy() const ValueTree DrawableComposite::createValueTree() const throw() { - ValueTree v (T("Group")); + ValueTree v ("Group"); if (getName().isNotEmpty()) v.setProperty ("id", getName(), 0); @@ -83128,7 +83117,7 @@ Drawable* DrawableImage::createCopy() const ValueTree DrawableImage::createValueTree() const throw() { - ValueTree v (T("Image")); + ValueTree v ("Image"); if (getName().isNotEmpty()) v.setProperty ("id", getName(), 0); @@ -83321,12 +83310,12 @@ static ValueTree createTreeForFillType (const String& tagName, const FillType& f if (fillType.isColour()) { - v.setProperty ("type", T("solid"), 0); + v.setProperty ("type", "solid", 0); v.setProperty ("colour", String::toHexString ((int) fillType.colour.getARGB()), 0); } else if (fillType.isGradient()) { - v.setProperty ("type", T("gradient"), 0); + v.setProperty ("type", "gradient", 0); v.setProperty ("x1", fillType.gradient->x1, 0); v.setProperty ("y1", fillType.gradient->y1, 0); v.setProperty ("x2", fillType.gradient->x2, 0); @@ -83350,19 +83339,19 @@ static ValueTree createTreeForFillType (const String& tagName, const FillType& f ValueTree DrawablePath::createValueTree() const throw() { - ValueTree v (T("Path")); + ValueTree v ("Path"); - v.addChild (createTreeForFillType (T("fill"), mainFill), -1, 0); - v.addChild (createTreeForFillType (T("stroke"), strokeFill), -1, 0); + v.addChild (createTreeForFillType ("fill", mainFill), -1, 0); + v.addChild (createTreeForFillType ("stroke", strokeFill), -1, 0); if (getName().isNotEmpty()) v.setProperty ("id", getName(), 0); v.setProperty ("strokeWidth", (double) strokeType.getStrokeThickness(), 0); v.setProperty ("jointStyle", strokeType.getJointStyle() == PathStrokeType::mitered - ? T("miter") : (strokeType.getJointStyle() == PathStrokeType::curved ? T("curved") : T("bevel")), 0); + ? "miter" : (strokeType.getJointStyle() == PathStrokeType::curved ? "curved" : "bevel"), 0); v.setProperty ("capStyle", strokeType.getEndStyle() == PathStrokeType::butt - ? T("butt") : (strokeType.getEndStyle() == PathStrokeType::square ? T("square") : T("round")), 0); + ? "butt" : (strokeType.getEndStyle() == PathStrokeType::square ? "square" : "round"), 0); v.setProperty ("path", path.toString(), 0); return v; @@ -83376,8 +83365,8 @@ DrawablePath* DrawablePath::createFromValueTree (const ValueTree& tree) throw() DrawablePath* p = new DrawablePath(); p->setName (tree ["id"]); - p->mainFill = readFillTypeFromTree (tree.getChildWithName (T("fill"))); - p->strokeFill = readFillTypeFromTree (tree.getChildWithName (T("stroke"))); + p->mainFill = readFillTypeFromTree (tree.getChildWithName ("fill")); + p->strokeFill = readFillTypeFromTree (tree.getChildWithName ("stroke")); const String jointStyle (tree ["jointStyle"].toString()); const String endStyle (tree ["capStyle"].toString()); @@ -83462,7 +83451,7 @@ Drawable* DrawableText::createCopy() const ValueTree DrawableText::createValueTree() const throw() { - ValueTree v (T("Text")); + ValueTree v ("Text"); if (getName().isNotEmpty()) v.setProperty ("id", getName(), 0); @@ -83510,26 +83499,26 @@ public: Drawable* parseSVGElement (const XmlElement& xml) { - if (! xml.hasTagName (T("svg"))) + if (! xml.hasTagName ("svg")) return 0; DrawableComposite* const drawable = new DrawableComposite(); - drawable->setName (xml.getStringAttribute (T("id"))); + drawable->setName (xml.getStringAttribute ("id")); SVGState newState (*this); - if (xml.hasAttribute (T("transform"))) + if (xml.hasAttribute ("transform")) newState.addTransform (xml); - newState.elementX = getCoordLength (xml.getStringAttribute (T("x"), String (newState.elementX)), viewBoxW); - newState.elementY = getCoordLength (xml.getStringAttribute (T("y"), String (newState.elementY)), viewBoxH); - newState.width = getCoordLength (xml.getStringAttribute (T("width"), String (newState.width)), viewBoxW); - newState.height = getCoordLength (xml.getStringAttribute (T("height"), String (newState.height)), viewBoxH); + newState.elementX = getCoordLength (xml.getStringAttribute ("x", String (newState.elementX)), viewBoxW); + newState.elementY = getCoordLength (xml.getStringAttribute ("y", String (newState.elementY)), viewBoxH); + newState.width = getCoordLength (xml.getStringAttribute ("width", String (newState.width)), viewBoxW); + newState.height = getCoordLength (xml.getStringAttribute ("height", String (newState.height)), viewBoxH); - if (xml.hasAttribute (T("viewBox"))) + if (xml.hasAttribute ("viewBox")) { - const String viewParams (xml.getStringAttribute (T("viewBox"))); + const String viewParams (xml.getStringAttribute ("viewBox")); int i = 0; float vx, vy, vw, vh; @@ -83543,7 +83532,7 @@ public: int placementFlags = 0; - const String aspect (xml.getStringAttribute (T("preserveAspectRatio"))); + const String aspect (xml.getStringAttribute ("preserveAspectRatio")); if (aspect.containsIgnoreCase (T("none"))) { @@ -83604,29 +83593,29 @@ private: { Drawable* d = 0; - if (e->hasTagName (T("g"))) + if (e->hasTagName ("g")) d = parseGroupElement (*e); - else if (e->hasTagName (T("svg"))) + else if (e->hasTagName ("svg")) d = parseSVGElement (*e); - else if (e->hasTagName (T("path"))) + else if (e->hasTagName ("path")) d = parsePath (*e); - else if (e->hasTagName (T("rect"))) + else if (e->hasTagName ("rect")) d = parseRect (*e); - else if (e->hasTagName (T("circle"))) + else if (e->hasTagName ("circle")) d = parseCircle (*e); - else if (e->hasTagName (T("ellipse"))) + else if (e->hasTagName ("ellipse")) d = parseEllipse (*e); - else if (e->hasTagName (T("line"))) + else if (e->hasTagName ("line")) d = parseLine (*e); - else if (e->hasTagName (T("polyline"))) + else if (e->hasTagName ("polyline")) d = parsePolygon (*e, true); - else if (e->hasTagName (T("polygon"))) + else if (e->hasTagName ("polygon")) d = parsePolygon (*e, false); - else if (e->hasTagName (T("text"))) + else if (e->hasTagName ("text")) d = parseText (*e); - else if (e->hasTagName (T("switch"))) + else if (e->hasTagName ("switch")) d = parseSwitch (*e); - else if (e->hasTagName (T("style"))) + else if (e->hasTagName ("style")) parseCSSStyle (*e); parentDrawable->insertDrawable (d); @@ -83635,7 +83624,7 @@ private: DrawableComposite* parseSwitch (const XmlElement& xml) { - const XmlElement* const group = xml.getChildByName (T("g")); + const XmlElement* const group = xml.getChildByName ("g"); if (group != 0) return parseGroupElement (*group); @@ -83647,9 +83636,9 @@ private: { DrawableComposite* const drawable = new DrawableComposite(); - drawable->setName (xml.getStringAttribute (T("id"))); + drawable->setName (xml.getStringAttribute ("id")); - if (xml.hasAttribute (T("transform"))) + if (xml.hasAttribute ("transform")) { SVGState newState (*this); newState.addTransform (xml); @@ -83666,10 +83655,10 @@ private: Drawable* parsePath (const XmlElement& xml) const { - const String d (xml.getStringAttribute (T("d")).trimStart()); + const String d (xml.getStringAttribute ("d").trimStart()); Path path; - if (getStyleAttribute (&xml, T("fill-rule")).trim().equalsIgnoreCase (T("evenodd"))) + if (getStyleAttribute (&xml, "fill-rule").trim().equalsIgnoreCase (T("evenodd"))) path.setUsingNonZeroWinding (false); int index = 0; @@ -83679,7 +83668,7 @@ private: bool isRelative = true; bool carryOn = true; - const String validCommandChars (T("MmLlHhVvCcSsQqTtAaZz")); + const String validCommandChars ("MmLlHhVvCcSsQqTtAaZz"); for (;;) { @@ -83693,10 +83682,10 @@ private: switch (lastCommandChar) { - case T('M'): - case T('m'): - case T('L'): - case T('l'): + case 'M': + case 'm': + case 'L': + case 'l': if (parseCoords (d, x, y, index, false)) { if (isRelative) @@ -83705,7 +83694,7 @@ private: y += lastY; } - if (lastCommandChar == T('M') || lastCommandChar == T('m')) + if (lastCommandChar == 'M' || lastCommandChar == 'm') path.startNewSubPath (x, y); else path.lineTo (x, y); @@ -83722,8 +83711,8 @@ private: break; - case T('H'): - case T('h'): + case 'H': + case 'h': if (parseCoord (d, x, index, false, true)) { if (isRelative) @@ -83740,8 +83729,8 @@ private: } break; - case T('V'): - case T('v'): + case 'V': + case 'v': if (parseCoord (d, y, index, false, false)) { if (isRelative) @@ -83758,8 +83747,8 @@ private: } break; - case T('C'): - case T('c'): + case 'C': + case 'c': if (parseCoords (d, x, y, index, false) && parseCoords (d, x2, y2, index, false) && parseCoords (d, x3, y3, index, false)) @@ -83787,8 +83776,8 @@ private: } break; - case T('S'): - case T('s'): + case 'S': + case 's': if (parseCoords (d, x, y, index, false) && parseCoords (d, x3, y3, index, false)) { @@ -83815,8 +83804,8 @@ private: } break; - case T('Q'): - case T('q'): + case 'Q': + case 'q': if (parseCoords (d, x, y, index, false) && parseCoords (d, x2, y2, index, false)) { @@ -83841,8 +83830,8 @@ private: } break; - case T('T'): - case T('t'): + case 'T': + case 't': if (parseCoords (d, x, y, index, false)) { if (isRelative) @@ -83866,8 +83855,8 @@ private: } break; - case T('A'): - case T('a'): + case 'A': + case 'a': if (parseCoords (d, x, y, index, false)) { String num; @@ -83926,8 +83915,8 @@ private: break; - case T('Z'): - case T('z'): + case 'Z': + case 'z': path.closeSubPath(); while (CharacterFunctions::isWhitespace (d [index])) ++index; @@ -83950,31 +83939,31 @@ private: { Path rect; - const bool hasRX = xml.hasAttribute (T("rx")); - const bool hasRY = xml.hasAttribute (T("ry")); + const bool hasRX = xml.hasAttribute ("rx"); + const bool hasRY = xml.hasAttribute ("ry"); if (hasRX || hasRY) { - float rx = getCoordLength (xml.getStringAttribute (T("rx")), viewBoxW); - float ry = getCoordLength (xml.getStringAttribute (T("ry")), viewBoxH); + float rx = getCoordLength (xml.getStringAttribute ("rx"), viewBoxW); + float ry = getCoordLength (xml.getStringAttribute ("ry"), viewBoxH); if (! hasRX) rx = ry; else if (! hasRY) ry = rx; - rect.addRoundedRectangle (getCoordLength (xml.getStringAttribute (T("x")), viewBoxW), - getCoordLength (xml.getStringAttribute (T("y")), viewBoxH), - getCoordLength (xml.getStringAttribute (T("width")), viewBoxW), - getCoordLength (xml.getStringAttribute (T("height")), viewBoxH), + rect.addRoundedRectangle (getCoordLength (xml.getStringAttribute ("x"), viewBoxW), + getCoordLength (xml.getStringAttribute ("y"), viewBoxH), + getCoordLength (xml.getStringAttribute ("width"), viewBoxW), + getCoordLength (xml.getStringAttribute ("height"), viewBoxH), rx, ry); } else { - rect.addRectangle (getCoordLength (xml.getStringAttribute (T("x")), viewBoxW), - getCoordLength (xml.getStringAttribute (T("y")), viewBoxH), - getCoordLength (xml.getStringAttribute (T("width")), viewBoxW), - getCoordLength (xml.getStringAttribute (T("height")), viewBoxH)); + rect.addRectangle (getCoordLength (xml.getStringAttribute ("x"), viewBoxW), + getCoordLength (xml.getStringAttribute ("y"), viewBoxH), + getCoordLength (xml.getStringAttribute ("width"), viewBoxW), + getCoordLength (xml.getStringAttribute ("height"), viewBoxH)); } return parseShape (xml, rect); @@ -83984,9 +83973,9 @@ private: { Path circle; - const float cx = getCoordLength (xml.getStringAttribute (T("cx")), viewBoxW); - const float cy = getCoordLength (xml.getStringAttribute (T("cy")), viewBoxH); - const float radius = getCoordLength (xml.getStringAttribute (T("r")), viewBoxW); + const float cx = getCoordLength (xml.getStringAttribute ("cx"), viewBoxW); + const float cy = getCoordLength (xml.getStringAttribute ("cy"), viewBoxH); + const float radius = getCoordLength (xml.getStringAttribute ("r"), viewBoxW); circle.addEllipse (cx - radius, cy - radius, radius * 2.0f, radius * 2.0f); @@ -83997,10 +83986,10 @@ private: { Path ellipse; - const float cx = getCoordLength (xml.getStringAttribute (T("cx")), viewBoxW); - const float cy = getCoordLength (xml.getStringAttribute (T("cy")), viewBoxH); - const float radiusX = getCoordLength (xml.getStringAttribute (T("rx")), viewBoxW); - const float radiusY = getCoordLength (xml.getStringAttribute (T("ry")), viewBoxH); + const float cx = getCoordLength (xml.getStringAttribute ("cx"), viewBoxW); + const float cy = getCoordLength (xml.getStringAttribute ("cy"), viewBoxH); + const float radiusX = getCoordLength (xml.getStringAttribute ("rx"), viewBoxW); + const float radiusY = getCoordLength (xml.getStringAttribute ("ry"), viewBoxH); ellipse.addEllipse (cx - radiusX, cy - radiusY, radiusX * 2.0f, radiusY * 2.0f); @@ -84011,10 +84000,10 @@ private: { Path line; - const float x1 = getCoordLength (xml.getStringAttribute (T("x1")), viewBoxW); - const float y1 = getCoordLength (xml.getStringAttribute (T("y1")), viewBoxH); - const float x2 = getCoordLength (xml.getStringAttribute (T("x2")), viewBoxW); - const float y2 = getCoordLength (xml.getStringAttribute (T("y2")), viewBoxH); + const float x1 = getCoordLength (xml.getStringAttribute ("x1"), viewBoxW); + const float y1 = getCoordLength (xml.getStringAttribute ("y1"), viewBoxH); + const float x2 = getCoordLength (xml.getStringAttribute ("x2"), viewBoxW); + const float y2 = getCoordLength (xml.getStringAttribute ("y2"), viewBoxH); line.startNewSubPath (x1, y1); line.lineTo (x2, y2); @@ -84024,7 +84013,7 @@ private: Drawable* parsePolygon (const XmlElement& xml, const bool isPolyline) const { - const String points (xml.getStringAttribute (T("points"))); + const String points (xml.getStringAttribute ("points")); Path path; int index = 0; @@ -84055,7 +84044,7 @@ private: Drawable* parseShape (const XmlElement& xml, Path& path, const bool shouldParseTransform = true) const { - if (shouldParseTransform && xml.hasAttribute (T("transform"))) + if (shouldParseTransform && xml.hasAttribute ("transform")) { SVGState newState (*this); newState.addTransform (xml); @@ -84064,7 +84053,7 @@ private: } DrawablePath* dp = new DrawablePath(); - dp->setName (xml.getStringAttribute (T("id"))); + dp->setName (xml.getStringAttribute ("id")); dp->setFill (FillType (Colours::transparentBlack)); path.applyTransform (transform); @@ -84083,19 +84072,19 @@ private: } dp->setFill (getPathFillType (path, - getStyleAttribute (&xml, T("fill")), - getStyleAttribute (&xml, T("fill-opacity")), - getStyleAttribute (&xml, T("opacity")), + getStyleAttribute (&xml, "fill"), + getStyleAttribute (&xml, "fill-opacity"), + getStyleAttribute (&xml, "opacity"), containsClosedSubPath ? Colours::black : Colours::transparentBlack)); - const String strokeType (getStyleAttribute (&xml, T("stroke"))); + const String strokeType (getStyleAttribute (&xml, "stroke")); - if (strokeType.isNotEmpty() && ! strokeType.equalsIgnoreCase (T("none"))) + if (strokeType.isNotEmpty() && ! strokeType.equalsIgnoreCase ("none")) { dp->setStrokeFill (getPathFillType (path, strokeType, - getStyleAttribute (&xml, T("stroke-opacity")), - getStyleAttribute (&xml, T("opacity")), + getStyleAttribute (&xml, "stroke-opacity"), + getStyleAttribute (&xml, "opacity"), Colours::transparentBlack)); dp->setStrokeType (getStrokeFor (&xml)); @@ -84106,9 +84095,9 @@ private: const XmlElement* findLinkedElement (const XmlElement* e) const { - const String id (e->getStringAttribute (T("xlink:href"))); + const String id (e->getStringAttribute ("xlink:href")); - if (! id.startsWithChar (T('#'))) + if (! id.startsWithChar ('#')) return 0; return findElementForId (topLevelXml, id.substring (1)); @@ -84119,17 +84108,17 @@ private: if (fillXml == 0) return; - forEachXmlChildElementWithTagName (*fillXml, e, T("stop")) + forEachXmlChildElementWithTagName (*fillXml, e, "stop") { int index = 0; - Colour col (parseColour (getStyleAttribute (e, T("stop-color")), index, Colours::black)); + Colour col (parseColour (getStyleAttribute (e, "stop-color"), index, Colours::black)); - const String opacity (getStyleAttribute (e, T("stop-opacity"), T("1"))); + const String opacity (getStyleAttribute (e, "stop-opacity", "1")); col = col.withMultipliedAlpha (jlimit (0.0f, 1.0f, opacity.getFloatValue())); - double offset = e->getDoubleAttribute (T("offset")); + double offset = e->getDoubleAttribute ("offset"); - if (e->getStringAttribute (T("offset")).containsChar (T('%'))) + if (e->getStringAttribute ("offset").containsChar ('%')) offset *= 0.01; cg.addColour (jlimit (0.0, 1.0, offset), col); @@ -84158,8 +84147,8 @@ private: const XmlElement* const fillXml = findElementForId (topLevelXml, id); if (fillXml != 0 - && (fillXml->hasTagName (T("linearGradient")) - || fillXml->hasTagName (T("radialGradient")))) + && (fillXml->hasTagName ("linearGradient") + || fillXml->hasTagName ("radialGradient"))) { const XmlElement* inheritedFrom = findLinkedElement (fillXml); @@ -84184,14 +84173,14 @@ private: jassert (gradient.getNumColours() > 0); - gradient.isRadial = fillXml->hasTagName (T("radialGradient")); + gradient.isRadial = fillXml->hasTagName ("radialGradient"); float width = viewBoxW; float height = viewBoxH; float dx = 0.0f; float dy = 0.0f; - const bool userSpace = fillXml->getStringAttribute (T("gradientUnits")).equalsIgnoreCase (T("userSpaceOnUse")); + const bool userSpace = fillXml->getStringAttribute ("gradientUnits").equalsIgnoreCase (T("userSpaceOnUse")); if (! userSpace) { @@ -84204,10 +84193,10 @@ private: if (gradient.isRadial) { - gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute (T("cx"), T("50%")), width); - gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute (T("cy"), T("50%")), height); + gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("cx", "50%"), width); + gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("cy", "50%"), height); - const float radius = getCoordLength (fillXml->getStringAttribute (T("r"), T("50%")), width); + const float radius = getCoordLength (fillXml->getStringAttribute ("r", "50%"), width); gradient.x2 = gradient.x1 + radius; gradient.y2 = gradient.y1; @@ -84216,18 +84205,18 @@ private: } else { - gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute (T("x1"), T("0%")), width); - gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute (T("y1"), T("0%")), height); + gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("x1", "0%"), width); + gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("y1", "0%"), height); - gradient.x2 = dx + getCoordLength (fillXml->getStringAttribute (T("x2"), T("100%")), width); - gradient.y2 = dy + getCoordLength (fillXml->getStringAttribute (T("y2"), T("0%")), height); + gradient.x2 = dx + getCoordLength (fillXml->getStringAttribute ("x2", "100%"), width); + gradient.y2 = dy + getCoordLength (fillXml->getStringAttribute ("y2", "0%"), height); if (gradient.x1 == gradient.x2 && gradient.y1 == gradient.y2) return Colour (gradient.getColour (gradient.getNumColours() - 1)); } FillType type (gradient); - type.transform = parseTransform (fillXml->getStringAttribute (T("gradientTransform"))) + type.transform = parseTransform (fillXml->getStringAttribute ("gradientTransform")) .followedBy (transform); return type; } @@ -84243,9 +84232,9 @@ private: const PathStrokeType getStrokeFor (const XmlElement* const xml) const { - const String width (getStyleAttribute (xml, T("stroke-width"))); - const String cap (getStyleAttribute (xml, T("stroke-linecap"))); - const String join (getStyleAttribute (xml, T("stroke-linejoin"))); + const String width (getStyleAttribute (xml, "stroke-width")); + const String cap (getStyleAttribute (xml, "stroke-linecap")); + const String join (getStyleAttribute (xml, "stroke-linejoin")); //const String mitreLimit (getStyleAttribute (xml, T("stroke-miterlimit"))); //const String dashArray (getStyleAttribute (xml, T("stroke-dasharray"))); @@ -84277,10 +84266,10 @@ private: { Array xCoords, yCoords, dxCoords, dyCoords; - getCoordList (xCoords, getInheritedAttribute (&xml, T("x")), true, true); - getCoordList (yCoords, getInheritedAttribute (&xml, T("y")), true, false); - getCoordList (dxCoords, getInheritedAttribute (&xml, T("dx")), true, true); - getCoordList (dyCoords, getInheritedAttribute (&xml, T("dy")), true, false); + getCoordList (xCoords, getInheritedAttribute (&xml, "x"), true, true); + getCoordList (yCoords, getInheritedAttribute (&xml, "y"), true, false); + getCoordList (dxCoords, getInheritedAttribute (&xml, "dx"), true, true); + getCoordList (dyCoords, getInheritedAttribute (&xml, "dy"), true, false); //xxx not done text yet! @@ -84294,7 +84283,7 @@ private: Drawable* s = parseShape (*e, path); delete s; } - else if (e->hasTagName (T("tspan"))) + else if (e->hasTagName ("tspan")) { Drawable* s = parseText (*e); delete s; @@ -84306,7 +84295,7 @@ private: void addTransform (const XmlElement& xml) { - transform = parseTransform (xml.getStringAttribute (T("transform"))) + transform = parseTransform (xml.getStringAttribute ("transform")) .followedBy (transform); } @@ -84344,15 +84333,15 @@ private: const tchar n1 = s [len - 2]; const tchar n2 = s [len - 1]; - if (n1 == T('i') && n2 == T('n')) + if (n1 == 'i' && n2 == 'n') n *= dpi; - else if (n1 == T('m') && n2 == T('m')) + else if (n1 == 'm' && n2 == 'm') n *= dpi / 25.4f; - else if (n1 == T('c') && n2 == T('m')) + else if (n1 == 'c' && n2 == 'm') n *= dpi / 2.54f; - else if (n1 == T('p') && n2 == T('c')) + else if (n1 == 'p' && n2 == 'c') n *= 15.0f; - else if (n2 == T('%')) + else if (n2 == '%') n *= 0.01f * sizeForProportions; } @@ -84371,7 +84360,7 @@ private: void parseCSSStyle (const XmlElement& xml) { - cssStyleText = xml.getAllSubText() + T("\n") + cssStyleText; + cssStyleText = xml.getAllSubText() + "\n" + cssStyleText; } const String getStyleAttribute (const XmlElement* xml, const String& attributeName, @@ -84380,7 +84369,7 @@ private: if (xml->hasAttribute (attributeName)) return xml->getStringAttribute (attributeName, defaultValue); - const String styleAtt (xml->getStringAttribute (T("style"))); + const String styleAtt (xml->getStringAttribute ("style")); if (styleAtt.isNotEmpty()) { @@ -84389,22 +84378,22 @@ private: if (value.isNotEmpty()) return value; } - else if (xml->hasAttribute (T("class"))) + else if (xml->hasAttribute ("class")) { - const String className (T(".") + xml->getStringAttribute (T("class"))); + const String className ("." + xml->getStringAttribute ("class")); - int index = cssStyleText.indexOfIgnoreCase (className + T(" ")); + int index = cssStyleText.indexOfIgnoreCase (className + " "); if (index < 0) - index = cssStyleText.indexOfIgnoreCase (className + T("{")); + index = cssStyleText.indexOfIgnoreCase (className + "{"); if (index >= 0) { - const int openBracket = cssStyleText.indexOfChar (index, T('{')); + const int openBracket = cssStyleText.indexOfChar (index, '{'); if (openBracket > index) { - const int closeBracket = cssStyleText.indexOfChar (openBracket, T('}')); + const int closeBracket = cssStyleText.indexOfChar (openBracket, '}'); if (closeBracket > openBracket) { @@ -84440,7 +84429,7 @@ private: static bool isIdentifierChar (const tchar c) { - return CharacterFunctions::isLetter (c) || c == T('-'); + return CharacterFunctions::isLetter (c) || c == '-'; } static const String getAttributeFromStyleList (const String& list, const String& attributeName, const String& defaultValue) @@ -84457,12 +84446,12 @@ private: if ((i == 0 || (i > 0 && ! isIdentifierChar (list [i - 1]))) && ! isIdentifierChar (list [i + attributeName.length()])) { - i = list.indexOfChar (i, T(':')); + i = list.indexOfChar (i, ':'); if (i < 0) break; - int end = list.indexOfChar (i, T(';')); + int end = list.indexOfChar (i, ';'); if (end < 0) end = 0x7ffff; @@ -84480,21 +84469,21 @@ private: { const tchar* const s = (const tchar*) source; - while (CharacterFunctions::isWhitespace (s[index]) || s[index] == T(',')) + while (CharacterFunctions::isWhitespace (s[index]) || s[index] == ',') ++index; int start = index; - if (CharacterFunctions::isDigit (s[index]) || s[index] == T('.') || s[index] == T('-')) + if (CharacterFunctions::isDigit (s[index]) || s[index] == '.' || s[index] == '-') ++index; - while (CharacterFunctions::isDigit (s[index]) || s[index] == T('.')) + while (CharacterFunctions::isDigit (s[index]) || s[index] == '.') ++index; - if ((s[index] == T('e') || s[index] == T('E')) + if ((s[index] == 'e' || s[index] == 'E') && (CharacterFunctions::isDigit (s[index + 1]) - || s[index + 1] == T('-') - || s[index + 1] == T('+'))) + || s[index + 1] == '-' + || s[index + 1] == '+')) { index += 2; @@ -84513,7 +84502,7 @@ private: value = String (s + start, index - start); - while (CharacterFunctions::isWhitespace (s[index]) || s[index] == T(',')) + while (CharacterFunctions::isWhitespace (s[index]) || s[index] == ',') ++index; return true; @@ -84521,7 +84510,7 @@ private: static const Colour parseColour (const String& s, int& index, const Colour& defaultColour) { - if (s [index] == T('#')) + if (s [index] == '#') { uint32 hex [6]; zeromem (hex, sizeof (hex)); @@ -84546,23 +84535,23 @@ private: (uint8) ((hex [2] << 4) + hex [3]), (uint8) ((hex [4] << 4) + hex [5])); } - else if (s [index] == T('r') - && s [index + 1] == T('g') - && s [index + 2] == T('b')) + else if (s [index] == 'r' + && s [index + 1] == 'g' + && s [index + 2] == 'b') { - const int openBracket = s.indexOfChar (index, T('(')); - const int closeBracket = s.indexOfChar (openBracket, T(')')); + const int openBracket = s.indexOfChar (index, '('); + const int closeBracket = s.indexOfChar (openBracket, ')'); if (openBracket >= 3 && closeBracket > openBracket) { index = closeBracket; StringArray tokens; - tokens.addTokens (s.substring (openBracket + 1, closeBracket), T(","), T("")); + tokens.addTokens (s.substring (openBracket + 1, closeBracket), ",", ""); tokens.trim(); tokens.removeEmptyStrings(); - if (tokens[0].containsChar (T('%'))) + if (tokens[0].containsChar ('%')) return Colour ((uint8) roundToInt (2.55 * tokens[0].getDoubleValue()), (uint8) roundToInt (2.55 * tokens[1].getDoubleValue()), (uint8) roundToInt (2.55 * tokens[2].getDoubleValue())); @@ -84585,7 +84574,7 @@ private: StringArray tokens; tokens.addTokens (t.fromFirstOccurrenceOf (T("("), false, false) .upToFirstOccurrenceOf (T(")"), false, false), - T(", "), String::empty); + ", ", String::empty); tokens.removeEmptyStrings (true); @@ -84725,7 +84714,7 @@ private: { forEachXmlChildElement (*parent, e) { - if (e->compareAttribute (T("id"), id)) + if (e->compareAttribute ("id", id)) return e; const XmlElement* const found = findElementForId (e, id); @@ -84908,15 +84897,15 @@ END_JUCE_NAMESPACE /*** Start of inlined file: juce_Font.cpp ***/ BEGIN_JUCE_NAMESPACE -static const float minFontHeight = 0.1f; -static const float maxFontHeight = 10000.0f; -static const float defaultFontHeight = 14.0f; +namespace FontValues +{ + static float limitFontHeight (const float height) throw() + { + return jlimit (0.1f, 10000.0f, height); + } -static const tchar* const juce_defaultFontNameSans = T(""); -static const tchar* const juce_defaultFontNameSerif = T(""); -static const tchar* const juce_defaultFontNameMono = T(""); - -void clearUpDefaultFontNames() throw(); // in juce_LookAndFeel.cpp + static const float defaultFontHeight = 14.0f; +} Font::SharedFontInternal::SharedFontInternal (const String& typefaceName_, const float height_, const float horizontalScale_, const float kerning_, const float ascent_, const int styleFlags_, @@ -84943,13 +84932,13 @@ Font::SharedFontInternal::SharedFontInternal (const SharedFontInternal& other) t } Font::Font() throw() - : font (new SharedFontInternal (juce_defaultFontNameSans, defaultFontHeight, + : font (new SharedFontInternal (getDefaultSansSerifFontName(), FontValues::defaultFontHeight, 1.0f, 0, 0, Font::plain, 0)) { } Font::Font (const float fontHeight, const int styleFlags_) throw() - : font (new SharedFontInternal (juce_defaultFontNameSans, jlimit (minFontHeight, maxFontHeight, fontHeight), + : font (new SharedFontInternal (getDefaultSansSerifFontName(), FontValues::limitFontHeight (fontHeight), 1.0f, 0, 0, styleFlags_, 0)) { } @@ -84957,7 +84946,7 @@ Font::Font (const float fontHeight, const int styleFlags_) throw() Font::Font (const String& typefaceName_, const float fontHeight, const int styleFlags_) throw() - : font (new SharedFontInternal (typefaceName_, jlimit (minFontHeight, maxFontHeight, fontHeight), + : font (new SharedFontInternal (typefaceName_, FontValues::limitFontHeight (fontHeight), 1.0f, 0, 0, styleFlags_, 0)) { } @@ -84978,7 +84967,7 @@ Font::~Font() throw() } Font::Font (const Typeface::Ptr& typeface) throw() - : font (new SharedFontInternal (typeface->getName(), defaultFontHeight, + : font (new SharedFontInternal (typeface->getName(), FontValues::defaultFontHeight, 1.0f, 0, 0, Font::plain, typeface)) { } @@ -85006,17 +84995,20 @@ void Font::dupeInternalIfShared() throw() const String Font::getDefaultSansSerifFontName() throw() { - return juce_defaultFontNameSans; + static const String name (""); + return name; } const String Font::getDefaultSerifFontName() throw() { - return juce_defaultFontNameSerif; + static const String name (""); + return name; } const String Font::getDefaultMonospacedFontName() throw() { - return juce_defaultFontNameMono; + static const String name (""); + return name; } void Font::setTypefaceName (const String& faceName) throw() @@ -85044,7 +85036,7 @@ void Font::setFallbackFontName (const String& name) throw() void Font::setHeight (float newHeight) throw() { - newHeight = jlimit (minFontHeight, maxFontHeight, newHeight); + newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight) { @@ -85055,7 +85047,7 @@ void Font::setHeight (float newHeight) throw() void Font::setHeightWithoutChangingWidth (float newHeight) throw() { - newHeight = jlimit (minFontHeight, maxFontHeight, newHeight); + newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight) { @@ -85081,7 +85073,7 @@ void Font::setSizeAndStyle (float newHeight, const float newHorizontalScale, const float newKerningAmount) throw() { - newHeight = jlimit (minFontHeight, maxFontHeight, newHeight); + newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight || font->horizontalScale != newHorizontalScale @@ -85198,7 +85190,7 @@ void Font::findFonts (Array& destArray) throw() const StringArray names (findAllTypefaceNames()); for (int i = 0; i < names.size(); ++i) - destArray.add (Font (names[i], defaultFontHeight, Font::plain)); + destArray.add (Font (names[i], FontValues::defaultFontHeight, Font::plain)); } class TypefaceCache : public DeletedAtShutdown @@ -85213,7 +85205,6 @@ public: ~TypefaceCache() { - clearUpDefaultFontNames(); clearSingletonInstance(); } @@ -85497,7 +85488,7 @@ int GlyphArrangement::insertEllipsis (const Font& font, const float maxXPos, { Array dotGlyphs; Array dotXs; - font.getGlyphPositions (T(".."), dotGlyphs, dotXs); + font.getGlyphPositions ("..", dotGlyphs, dotXs); const float dx = dotXs[1]; float xOffset = 0.0f, yOffset = 0.0f; @@ -85545,8 +85536,8 @@ void GlyphArrangement::addJustifiedText (const Font& font, { int i = lineStartIndex; - if (glyphs.getUnchecked(i)->getCharacter() != T('\n') - && glyphs.getUnchecked(i)->getCharacter() != T('\r')) + if (glyphs.getUnchecked(i)->getCharacter() != '\n' + && glyphs.getUnchecked(i)->getCharacter() != '\r') ++i; const float lineMaxX = glyphs.getUnchecked (lineStartIndex)->getLeft() + maxLineWidth; @@ -85557,12 +85548,12 @@ void GlyphArrangement::addJustifiedText (const Font& font, const PositionedGlyph* pg = glyphs.getUnchecked (i); const juce_wchar c = pg->getCharacter(); - if (c == T('\r') || c == T('\n')) + if (c == '\r' || c == '\n') { ++i; - if (c == T('\r') && i < glyphs.size() - && glyphs.getUnchecked(i)->getCharacter() == T('\n')) + if (c == '\r' && i < glyphs.size() + && glyphs.getUnchecked(i)->getCharacter() == '\n') ++i; break; @@ -85743,7 +85734,7 @@ void GlyphArrangement::addFittedText (const Font& f, if ((glyphs.getUnchecked (i)->getRight() - lineStartX) * minimumHorizontalScale < width) { if (glyphs.getUnchecked (i)->isWhitespace() - || glyphs.getUnchecked (i)->getCharacter() == T('-')) + || glyphs.getUnchecked (i)->getCharacter() == '-') { ++i; break; @@ -85757,7 +85748,7 @@ void GlyphArrangement::addFittedText (const Font& f, for (int back = 1; back < jmin (5, i - startIndex - 1); ++back) { if (glyphs.getUnchecked (i - back)->isWhitespace() - || glyphs.getUnchecked (i - back)->getCharacter() == T('-')) + || glyphs.getUnchecked (i - back)->getCharacter() == '-') { i -= back - 1; break; @@ -85979,8 +85970,8 @@ void GlyphArrangement::justifyGlyphs (const int startIndex, void GlyphArrangement::spreadOutLine (const int start, const int num, const float targetWidth) { if (start + num < glyphs.size() - && glyphs.getUnchecked (start + num - 1)->getCharacter() != T('\r') - && glyphs.getUnchecked (start + num - 1)->getCharacter() != T('\n')) + && glyphs.getUnchecked (start + num - 1)->getCharacter() != '\r' + && glyphs.getUnchecked (start + num - 1)->getCharacter() != '\n') { int numSpaces = 0; int spacesAtEnd = 0; @@ -86211,7 +86202,7 @@ void TextLayout::appendText (const String& text, break; int charType; - if (c == T('\r') || c == T('\n')) + if (c == '\r' || c == '\n') { charType = 0; } @@ -86234,7 +86225,7 @@ void TextLayout::appendText (const String& text, currentString = String::charToString (c); - if (c == T('\r') && *t == T('\n')) + if (c == '\r' && *t == '\n') currentString += *t++; } else @@ -88843,14 +88834,14 @@ const String Path::toString() const { String n (data.elements [i++], 3); - if (n.endsWithChar (T('0'))) + if (n.endsWithChar ('0')) { do { n = n.dropLastCharacters (1); - } while (n.endsWithChar (T('0'))); + } while (n.endsWithChar ('0')); - if (n.endsWithChar (T('.'))) + if (n.endsWithChar ('.')) n = n.dropLastCharacters (1); } @@ -88872,8 +88863,8 @@ void Path::restoreFromString (const String& stringVersion) clear(); setUsingNonZeroWinding (true); - const tchar* t = stringVersion; - tchar marker = T('m'); + const juce_wchar* t = stringVersion; + juce_wchar marker = 'm'; int numValues = 2; float values [6]; @@ -88883,27 +88874,27 @@ void Path::restoreFromString (const String& stringVersion) const tchar firstChar = token[0]; int startNum = 0; - if (firstChar == T('m') || firstChar == T('l')) + if (firstChar == 'm' || firstChar == 'l') { marker = firstChar; numValues = 2; } - else if (firstChar == T('q')) + else if (firstChar == 'q') { marker = firstChar; numValues = 4; } - else if (firstChar == T('c')) + else if (firstChar == 'c') { marker = firstChar; numValues = 6; } - else if (firstChar == T('z')) + else if (firstChar == 'z') { marker = firstChar; numValues = 0; } - else if (firstChar == T('a')) + else if (firstChar == 'a') { setUsingNonZeroWinding (false); continue; @@ -88919,26 +88910,26 @@ void Path::restoreFromString (const String& stringVersion) switch (marker) { - case T('m'): + case 'm': startNewSubPath (values[0], values[1]); break; - case T('l'): + case 'l': lineTo (values[0], values[1]); break; - case T('q'): + case 'q': quadraticTo (values[0], values[1], values[2], values[3]); break; - case T('c'): + case 'c': cubicTo (values[0], values[1], values[2], values[3], values[4], values[5]); break; - case T('z'): + case 'z': closeSubPath(); break; @@ -89969,11 +89960,11 @@ const String PositionedRectangle::toString() const throw() s.preallocateStorage (12); addPosDescription (s, xMode, x); - s << T(' '); + s << ' '; addPosDescription (s, yMode, y); - s << T(' '); + s << ' '; addSizeDescription (s, wMode, w); - s << T(' '); + s << ' '; addSizeDescription (s, hMode, h); return s; @@ -90108,53 +90099,53 @@ void PositionedRectangle::addPosDescription (String& s, const uint8 mode, const { if ((mode & proportionOfParentSize) != 0) { - s << (roundToInt (value * 100000.0) / 1000.0) << T('%'); + s << (roundToInt (value * 100000.0) / 1000.0) << '%'; } else { s << (roundToInt (value * 100.0) / 100.0); if ((mode & absoluteFromParentBottomRight) != 0) - s << T('R'); + s << 'R'; else if ((mode & absoluteFromParentCentre) != 0) - s << T('C'); + s << 'C'; } if ((mode & anchorAtRightOrBottom) != 0) - s << T('r'); + s << 'r'; else if ((mode & anchorAtCentre) != 0) - s << T('c'); + s << 'c'; } void PositionedRectangle::addSizeDescription (String& s, const uint8 mode, const double value) const throw() { if (mode == proportionalSize) - s << (roundToInt (value * 100000.0) / 1000.0) << T('%'); + s << (roundToInt (value * 100000.0) / 1000.0) << '%'; else if (mode == parentSizeMinusAbsolute) - s << (roundToInt (value * 100.0) / 100.0) << T('M'); + s << (roundToInt (value * 100.0) / 100.0) << 'M'; else s << (roundToInt (value * 100.0) / 100.0); } void PositionedRectangle::decodePosString (const String& s, uint8& mode, double& value) throw() { - if (s.containsChar (T('r'))) + if (s.containsChar ('r')) mode = anchorAtRightOrBottom; - else if (s.containsChar (T('c'))) + else if (s.containsChar ('c')) mode = anchorAtCentre; else mode = anchorAtLeftOrTop; - if (s.containsChar (T('%'))) + if (s.containsChar ('%')) { mode |= proportionOfParentSize; value = s.removeCharacters (T("%rcRC")).getDoubleValue() / 100.0; } else { - if (s.containsChar (T('R'))) + if (s.containsChar ('R')) mode |= absoluteFromParentBottomRight; - else if (s.containsChar (T('C'))) + else if (s.containsChar ('C')) mode |= absoluteFromParentCentre; else mode |= absoluteFromParentTopLeft; @@ -90165,12 +90156,12 @@ void PositionedRectangle::decodePosString (const String& s, uint8& mode, double& void PositionedRectangle::decodeSizeString (const String& s, uint8& mode, double& value) throw() { - if (s.containsChar (T('%'))) + if (s.containsChar ('%')) { mode = proportionalSize; value = s.upToFirstOccurrenceOf (T("%"), false, false).getDoubleValue() / 100.0; } - else if (s.containsChar (T('M'))) + else if (s.containsChar ('M')) { mode = parentSizeMinusAbsolute; value = s.getDoubleValue(); @@ -91699,7 +91690,7 @@ PNGImageFormat::~PNGImageFormat() {} const String PNGImageFormat::getFormatName() { - return T("PNG"); + return "PNG"; } bool PNGImageFormat::canUnderstand (InputStream& in) @@ -91741,7 +91732,7 @@ void JPEGImageFormat::setQuality (const float newQuality) const String JPEGImageFormat::getFormatName() { - return T("JPEG"); + return "JPEG"; } bool JPEGImageFormat::canUnderstand (InputStream& in) @@ -91779,7 +91770,7 @@ public: const String getFormatName() { - return T("GIF"); + return "GIF"; } bool canUnderstand (InputStream& in) @@ -188577,7 +188568,7 @@ bool juce_writeJPEGImageToStream (const Image& image, jpegCompStruct.dct_method = JDCT_FLOAT; jpegCompStruct.optimize_coding = 1; -// jpegCompStruct.smoothing_factor = 10; + //jpegCompStruct.smoothing_factor = 10; if (quality < 0.0f) quality = 0.85f; @@ -188589,8 +188580,7 @@ bool juce_writeJPEGImageToStream (const Image& image, const int strideBytes = jpegCompStruct.image_width * jpegCompStruct.input_components; JSAMPARRAY buffer = (*jpegCompStruct.mem->alloc_sarray) ((j_common_ptr) &jpegCompStruct, - JPOOL_IMAGE, - strideBytes, 1); + JPOOL_IMAGE, strideBytes, 1); const Image::BitmapData srcData (image, 0, 0, jpegCompStruct.image_width, jpegCompStruct.image_height); @@ -211259,7 +211249,7 @@ extern void juce_initialiseThreadEvents(); void Logger::outputDebugString (const String& text) throw() { - OutputDebugString (text + T("\n")); + OutputDebugString (text + "\n"); } static int64 hiResTicksPerSecond; @@ -211983,7 +211973,7 @@ void InterProcessLock::exit() #define INVALID_FILE_ATTRIBUTES ((DWORD) -1) #endif -const juce_wchar File::separator = T('\\'); +const juce_wchar File::separator = '\\'; const juce_wchar* File::separatorString = T("\\"); bool juce_fileExists (const String& fileName, const bool dontCountDirectories) @@ -212235,8 +212225,8 @@ const StringArray juce_getFileSystemRoots() static const String getDriveFromPath (const String& path) { - if (path.isNotEmpty() && path[1] == T(':')) - return path.substring (0, 2) + T("\\"); + if (path.isNotEmpty() && path[1] == ':') + return path.substring (0, 2) + '\\'; return path; } @@ -212296,7 +212286,7 @@ bool File::isOnHardDisk() const const unsigned int n = getWindowsDriveType (getFullPathName()); - if (fullPath.toLowerCase()[0] <= 'b' && fullPath[1] == T(':')) + if (fullPath.toLowerCase()[0] <= 'b' && fullPath[1] == ':') return n != DRIVE_REMOVABLE; else return n != DRIVE_CDROM && n != DRIVE_REMOTE; @@ -212414,8 +212404,8 @@ const File File::getLinkedTarget() const String p (getFullPathName()); if (! exists()) - p += T(".lnk"); - else if (getFileExtension() != T(".lnk")) + p += ".lnk"; + else if (getFileExtension() != ".lnk") return result; ComSmartPtr shellLink; @@ -213238,9 +213228,9 @@ static HKEY findKeyForPath (String name, if (rootKey != 0) { - name = name.substring (name.indexOfChar (T('\\')) + 1); + name = name.substring (name.indexOfChar ('\\') + 1); - const int lastSlash = name.lastIndexOfChar (T('\\')); + const int lastSlash = name.lastIndexOfChar ('\\'); valueName = name.substring (lastSlash + 1); name = name.substring (0, lastSlash); @@ -213389,7 +213379,7 @@ const String JUCE_CALLTYPE PlatformUtilities::getCurrentCommandLineParams() thro StringArray tokens; tokens.addTokens (s, true); // tokenise so that we can remove the initial filename argument - return tokens.joinIntoString (T(" "), 1); + return tokens.joinIntoString (" ", 1); } static void* currentModuleHandle = 0; @@ -213656,7 +213646,7 @@ static const String getMessageWindowClassName() if (number == 0) number = 0x7fffffff & (int) Time::getHighResolutionTicks(); - return T("JUCEcs_") + String (number); + return "JUCEcs_" + String (number); } void MessageManager::doPlatformSpecificInitialisation() @@ -213999,8 +213989,8 @@ bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() SHORT k = (SHORT) keyCode; if ((keyCode & extendedKeyModifier) == 0 - && (k >= (SHORT) T('a') && k <= (SHORT) T('z'))) - k += (SHORT) T('A') - (SHORT) T('a'); + && (k >= (SHORT) 'a' && k <= (SHORT) 'z')) + k += (SHORT) 'A' - (SHORT) 'a'; const SHORT translatedValues[] = { (SHORT) ',', VK_OEM_COMMA, (SHORT) '+', VK_OEM_PLUS, @@ -216666,7 +216656,7 @@ static int CALLBACK wfontEnum1 (ENUMLOGFONTEXW* lpelfe, return 1; } -const StringArray Font::findAllTypefaceNames() throw() +const StringArray Font::findAllTypefaceNames() { StringArray results; HDC dc = CreateCompatibleDC (0); @@ -216696,7 +216686,7 @@ const StringArray Font::findAllTypefaceNames() throw() extern bool juce_IsRunningInWine(); -void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw() +void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) { if (juce_IsRunningInWine()) { @@ -216984,119 +216974,116 @@ const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) // compiled on its own). #if JUCE_INCLUDED_FILE -static const void* defaultDirPath = 0; -static String returnedString; // need this to get non-existent pathnames from the directory chooser -static Component* currentExtraFileWin = 0; - -static bool areThereAnyAlwaysOnTopWindows() -{ - for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) - { - Component* c = Desktop::getInstance().getComponent (i); - - if (c != 0 && c->isAlwaysOnTop() && c->isShowing()) - return true; - } - - return false; -} - -static int CALLBACK browseCallbackProc (HWND hWnd, UINT msg, LPARAM lParam, LPARAM /*lpData*/) -{ - if (msg == BFFM_INITIALIZED) - { - SendMessage (hWnd, BFFM_SETSELECTIONW, TRUE, (LPARAM) defaultDirPath); - } - else if (msg == BFFM_VALIDATEFAILEDW) - { - returnedString = (LPCWSTR) lParam; - } - else if (msg == BFFM_VALIDATEFAILEDA) - { - returnedString = (const char*) lParam; - } - - return 0; -} - void juce_setWindowStyleBit (HWND h, const int styleType, const int feature, const bool bitIsSet) throw(); -static UINT_PTR CALLBACK openCallback (HWND hdlg, UINT uiMsg, WPARAM /*wParam*/, LPARAM lParam) +namespace FileChooserHelpers { - if (currentExtraFileWin != 0) + static const void* defaultDirPath = 0; + static String returnedString; // need this to get non-existent pathnames from the directory chooser + static Component* currentExtraFileWin = 0; + + static bool areThereAnyAlwaysOnTopWindows() { - if (uiMsg == WM_INITDIALOG) + for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) { - HWND dialogH = GetParent (hdlg); - jassert (dialogH != 0); - if (dialogH == 0) - dialogH = hdlg; + Component* c = Desktop::getInstance().getComponent (i); - RECT r, cr; - GetWindowRect (dialogH, &r); - GetClientRect (dialogH, &cr); - - SetWindowPos (dialogH, 0, - r.left, r.top, - currentExtraFileWin->getWidth() + jmax (150, (int) (r.right - r.left)), - jmax (150, (int) (r.bottom - r.top)), - SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER); - - currentExtraFileWin->setBounds (cr.right, cr.top, currentExtraFileWin->getWidth(), cr.bottom - cr.top); - currentExtraFileWin->getChildComponent(0)->setBounds (0, 0, currentExtraFileWin->getWidth(), currentExtraFileWin->getHeight()); - - SetParent ((HWND) currentExtraFileWin->getWindowHandle(), (HWND) dialogH); - juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_CHILD, (dialogH != 0)); - juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_POPUP, (dialogH == 0)); + if (c != 0 && c->isAlwaysOnTop() && c->isShowing()) + return true; } - else if (uiMsg == WM_NOTIFY) + + return false; + } + + static int CALLBACK browseCallbackProc (HWND hWnd, UINT msg, LPARAM lParam, LPARAM /*lpData*/) + { + if (msg == BFFM_INITIALIZED) + SendMessage (hWnd, BFFM_SETSELECTIONW, TRUE, (LPARAM) defaultDirPath); + else if (msg == BFFM_VALIDATEFAILEDW) + returnedString = (LPCWSTR) lParam; + else if (msg == BFFM_VALIDATEFAILEDA) + returnedString = (const char*) lParam; + + return 0; + } + + static UINT_PTR CALLBACK openCallback (HWND hdlg, UINT uiMsg, WPARAM /*wParam*/, LPARAM lParam) + { + if (currentExtraFileWin != 0) { - LPOFNOTIFY ofn = (LPOFNOTIFY) lParam; - - if (ofn->hdr.code == CDN_SELCHANGE) + if (uiMsg == WM_INITDIALOG) { - FilePreviewComponent* comp = (FilePreviewComponent*) currentExtraFileWin->getChildComponent(0); + HWND dialogH = GetParent (hdlg); + jassert (dialogH != 0); + if (dialogH == 0) + dialogH = hdlg; - if (comp != 0) + RECT r, cr; + GetWindowRect (dialogH, &r); + GetClientRect (dialogH, &cr); + + SetWindowPos (dialogH, 0, + r.left, r.top, + currentExtraFileWin->getWidth() + jmax (150, (int) (r.right - r.left)), + jmax (150, (int) (r.bottom - r.top)), + SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER); + + currentExtraFileWin->setBounds (cr.right, cr.top, currentExtraFileWin->getWidth(), cr.bottom - cr.top); + currentExtraFileWin->getChildComponent(0)->setBounds (0, 0, currentExtraFileWin->getWidth(), currentExtraFileWin->getHeight()); + + SetParent ((HWND) currentExtraFileWin->getWindowHandle(), (HWND) dialogH); + juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_CHILD, (dialogH != 0)); + juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_POPUP, (dialogH == 0)); + } + else if (uiMsg == WM_NOTIFY) + { + LPOFNOTIFY ofn = (LPOFNOTIFY) lParam; + + if (ofn->hdr.code == CDN_SELCHANGE) { - TCHAR path [MAX_PATH * 2]; - path[0] = 0; - CommDlg_OpenSave_GetFilePath (GetParent (hdlg), (LPARAM) &path, MAX_PATH); + FilePreviewComponent* comp = (FilePreviewComponent*) currentExtraFileWin->getChildComponent(0); - const String fn ((const WCHAR*) path); + if (comp != 0) + { + TCHAR path [MAX_PATH * 2]; + path[0] = 0; + CommDlg_OpenSave_GetFilePath (GetParent (hdlg), (LPARAM) &path, MAX_PATH); - comp->selectedFileChanged (File (fn)); + const String fn ((const WCHAR*) path); + + comp->selectedFileChanged (File (fn)); + } } } } + + return 0; } - return 0; + class FPComponentHolder : public Component + { + public: + FPComponentHolder() + { + setVisible (true); + setOpaque (true); + } + + ~FPComponentHolder() + { + } + + void paint (Graphics& g) + { + g.fillAll (Colours::lightgrey); + } + + private: + FPComponentHolder (const FPComponentHolder&); + FPComponentHolder& operator= (const FPComponentHolder&); + }; } -class FPComponentHolder : public Component -{ -public: - FPComponentHolder() - { - setVisible (true); - setOpaque (true); - } - - ~FPComponentHolder() - { - } - - void paint (Graphics& g) - { - g.fillAll (Colours::lightgrey); - } - -private: - FPComponentHolder (const FPComponentHolder&); - FPComponentHolder& operator= (const FPComponentHolder&); -}; - void FileChooser::showPlatformDialog (Array& results, const String& title, const File& currentFileOrDirectory, @@ -217108,6 +217095,7 @@ void FileChooser::showPlatformDialog (Array& results, bool selectMultipleFiles, FilePreviewComponent* extraInfoComponent) { + using namespace FileChooserHelpers; const int numCharsAvailable = 32768; MemoryBlock filenameSpace ((numCharsAvailable + 1) * sizeof (WCHAR), true); WCHAR* const fname = (WCHAR*) filenameSpace.getData(); @@ -217278,7 +217266,7 @@ void FileChooser::showPlatformDialog (Array& results, while (*filename != 0) { - const String filepath (String (files) + T("\\") + String (filename)); + const String filepath (String (files) + "\\" + String (filename)); results.add (File (filepath)); filename += CharacterFunctions::length (filename) + 1; } @@ -217298,7 +217286,7 @@ void FileChooser::showPlatformDialog (Array& results, // compiled on its own). #if JUCE_INCLUDED_FILE -void SystemClipboard::copyTextToClipboard (const String& text) throw() +void SystemClipboard::copyTextToClipboard (const String& text) { if (OpenClipboard (0) != 0) { @@ -217326,7 +217314,7 @@ void SystemClipboard::copyTextToClipboard (const String& text) throw() } } -const String SystemClipboard::getTextFromClipboard() throw() +const String SystemClipboard::getTextFromClipboard() { String result; @@ -220758,11 +220746,11 @@ const StringArray AudioCDReader::getAvailableCDNames() String s; if (list[i].scsiDriveLetter > 0) - s << String::charToString (list[i].scsiDriveLetter).toUpperCase() << T(": "); + s << String::charToString (list[i].scsiDriveLetter).toUpperCase() << ": "; s << String (list[i].vendor).trim() - << T(" ") << String (list[i].productId).trim() - << T(" ") << String (list[i].rev).trim(); + << ' ' << String (list[i].productId).trim() + << ' ' << String (list[i].rev).trim(); results.add (s); } @@ -220801,7 +220789,7 @@ AudioCDReader* AudioCDReader::createReaderForCD (const int deviceIndex) } AudioCDReader::AudioCDReader (void* handle_) - : AudioFormatReader (0, T("CD Audio")), + : AudioFormatReader (0, "CD Audio"), handle (handle_), indexingEnabled (false), lastIndex (0), @@ -222219,7 +222207,7 @@ static void logError (const String& context, long error) else if (error == ASE_NoMemory) err = "Out of memory"; - log (T("!!error: ") + context + T(" - ") + err); + log ("!!error: " + context + " - " + err); } #else #define logError(a, b) {} @@ -222238,7 +222226,7 @@ public: ASIOAudioIODevice (const String& name_, const CLSID classId_, const int slotNumber, const String& optionalDllForDirectLoading_) - : AudioIODevice (name_, T("ASIO")), + : AudioIODevice (name_, "ASIO"), asioObject (0), classId (classId_), optionalDllForDirectLoading (optionalDllForDirectLoading_), @@ -222287,11 +222275,11 @@ public: if (err == 0) { sampleRates.add ((int) possibleSampleRates[index]); - log (T("rate: ") + String ((int) possibleSampleRates[index])); + log ("rate: " + String ((int) possibleSampleRates[index])); } else if (err != ASE_NoClock) { - logError (T("CanSampleRate"), err); + logError ("CanSampleRate", err); } } @@ -222299,7 +222287,7 @@ public: { double cr = 0; const long err = asioObject->getSampleRate (&cr); - log (T("No sample rates supported - current rate: ") + String ((int) cr)); + log ("No sample rates supported - current rate: " + String ((int) cr)); if (err == 0) sampleRates.add ((int) cr); @@ -222477,7 +222465,7 @@ public: if (currentSampleRate != sampleRate) { - log (T("ASIO samplerate: ") + String (currentSampleRate) + T(" to ") + String (sampleRate)); + log ("ASIO samplerate: " + String (currentSampleRate) + " to " + String (sampleRate)); err = asioObject->setSampleRate (sampleRate); if (err == ASE_NoClock && numSources > 0) @@ -222514,7 +222502,7 @@ public: if (error.isNotEmpty()) { - log (T("ASIOInit: ") + error); + log ("ASIOInit: " + error); } needToReset = false; @@ -222582,7 +222570,7 @@ public: log ("disposing buffers"); err = asioObject->disposeBuffers(); - log (T("creating buffers: ") + String (totalBuffers) + T(", ") + String (currentBlockSizeSamples)); + log ("creating buffers: " + String (totalBuffers) + ", " + String (currentBlockSizeSamples)); err = asioObject->createBuffers (bufferInfos, totalBuffers, currentBlockSizeSamples, @@ -222669,7 +222657,7 @@ public: for (i = types.size(); --i >= 0;) { - log (T("channel format: ") + String (types[i])); + log ("channel format: " + String (types[i])); } jassert (n <= totalBuffers); @@ -222698,10 +222686,7 @@ public: } else { - log (T("ASIO latencies: ") - + String ((int) outputLatency) - + T(", ") - + String ((int) inputLatency)); + log ("ASIO latencies: " + String ((int) outputLatency) + ", " + String ((int) inputLatency)); } isOpen_ = true; @@ -222897,7 +222882,7 @@ public: const int spent = (int) Time::getMillisecondCounter() - (int) started; - log (T("spent: ") + String (spent)); + log ("spent: " + String (spent)); if (spent > 300) { @@ -223085,7 +223070,7 @@ private: modalWindow.enterModalState(); // open the device and get its info.. - log (T("opening ASIO device: ") + getName()); + log ("opening ASIO device: " + getName()); needToReset = false; isReSync = false; @@ -223120,12 +223105,12 @@ private: if (asioObject != 0 && (err = asioObject->getChannels (&totalNumInputChans, &totalNumOutputChans)) == 0) { - log (String ((int) totalNumInputChans) + T(" in, ") + String ((int) totalNumOutputChans) + T(" out")); + log (String ((int) totalNumInputChans) + " in, " + String ((int) totalNumOutputChans) + " out"); if ((err = asioObject->getBufferSize (&minSize, &maxSize, &preferredSize, &granularity)) == 0) { // find a list of buffer sizes.. - log (String ((int) minSize) + T(" ") + String ((int) maxSize) + T(" ") + String ((int)preferredSize) + T(" ") + String ((int)granularity)); + log (String ((int) minSize) + " " + String ((int) maxSize) + " " + String ((int) preferredSize) + " " + String ((int) granularity)); if (granularity >= 0) { @@ -223180,9 +223165,7 @@ private: log ("ASIO - no latencies"); } - log (String ("latencies: ") - + String ((int) inputLatency) - + T(", ") + String ((int) outputLatency)); + log ("latencies: " + String ((int) inputLatency) + ", " + String ((int) outputLatency)); // create some dummy buffers now.. because cubase does.. numActiveInputChans = 0; @@ -223235,8 +223218,7 @@ private: jassertfalse } - log (T("creating buffers (dummy): ") + String (numChans) - + T(", ") + String ((int) preferredSize)); + log ("creating buffers (dummy): " + String (numChans) + ", " + String ((int) preferredSize)); if (preferredSize > 0) { @@ -223255,8 +223237,7 @@ private: totalNumInputChans = newInps; totalNumOutputChans = newOuts; - log (String ((int) totalNumInputChans) + T(" in; ") - + String ((int) totalNumOutputChans) + T(" out")); + log (String ((int) totalNumInputChans) + " in; " + String ((int) totalNumOutputChans) + " out"); } updateSampleRates(); @@ -223868,7 +223849,7 @@ class ASIOAudioIODeviceType : public AudioIODeviceType { public: ASIOAudioIODeviceType() - : AudioIODeviceType (T("ASIO")), + : AudioIODeviceType ("ASIO"), hasScanned (false) { CoInitialize (0); @@ -224059,7 +224040,7 @@ private: else deviceName = keyName; - log (T("found ") + deviceName); + log ("found " + deviceName); deviceNames.add (deviceName); classIds.add (new CLSID (classId)); } @@ -224288,7 +224269,7 @@ static const String getDSErrorMessage (HRESULT hr) if (hr != S_OK) { String error ("DS error at line "); - error << lineNum << T(" - ") << getDSErrorMessage (hr); + error << lineNum << " - " << getDSErrorMessage (hr); log (error); } } @@ -224377,7 +224358,7 @@ public: { JUCE_TRY { - log (T("closing dsound out: ") + name); + log ("closing dsound out: " + name); hr = pOutputBuffer->Stop(); logError (hr); } @@ -224408,10 +224389,8 @@ public: const String open() { - log (T("opening dsound out device: ") + name - + T(" rate=") + String (sampleRate) - + T(" bits=") + String (bitDepth) - + T(" buf=") + String (bufferSizeSamples)); + log ("opening dsound out device: " + name + " rate=" + String (sampleRate) + + " bits=" + String (bitDepth) + " buf=" + String (bufferSizeSamples)); pDirectSound = 0; pOutputBuffer = 0; @@ -224784,7 +224763,7 @@ public: { JUCE_TRY { - log (T("closing dsound in: ") + name); + log ("closing dsound in: " + name); hr = pInputBuffer->Stop(); logError (hr); } @@ -224827,8 +224806,8 @@ public: const String open() { - log (T("opening dsound in device: ") + name - + T(" rate=") + String (sampleRate) + T(" bits=") + String (bitDepth) + T(" buf=") + String (bufferSizeSamples)); + log ("opening dsound in device: " + name + + " rate=" + String (sampleRate) + " bits=" + String (bitDepth) + " buf=" + String (bufferSizeSamples)); pDirectSound = 0; pDirectSoundCapture = 0; @@ -224867,7 +224846,7 @@ public: captureDesc.dwBufferBytes = totalBytesPerBuffer; captureDesc.lpwfxFormat = &wfFormat; - log (T("opening dsound in step 2")); + log ("opening dsound in step 2"); hr = pDirectSoundCapture->CreateCaptureBuffer (&captureDesc, &pInputBuffer, 0); logError (hr); @@ -225399,7 +225378,7 @@ class DSoundAudioIODeviceType : public AudioIODeviceType { public: DSoundAudioIODeviceType() - : AudioIODeviceType (T("DirectSound")), + : AudioIODeviceType ("DirectSound"), hasScanned (false) { initialiseDSoundFunctions(); @@ -225490,7 +225469,7 @@ private: int n = 2; while (outputDeviceNames.contains (desc)) - desc = origDesc + T(" (") + String (n++) + T(")"); + desc = origDesc + " (" + String (n++) + ")"; outputDeviceNames.add (desc); @@ -225525,7 +225504,7 @@ private: int n = 2; while (inputDeviceNames.contains (desc)) - desc = origDesc + T(" (") + String (n++) + T(")"); + desc = origDesc + " (" + String (n++) + ")"; inputDeviceNames.add (desc); @@ -225640,8 +225619,7 @@ const String DSoundAudioIODevice::openDevice (const BigInteger& inputChannels, if (error.isNotEmpty()) { - error = T("Error opening ") + dlh.outputDeviceNames[i] - + T(": \"") + error + T("\""); + error = "Error opening " + dlh.outputDeviceNames[i] + ": \"" + error + "\""; break; } } @@ -225654,8 +225632,7 @@ const String DSoundAudioIODevice::openDevice (const BigInteger& inputChannels, if (error.isNotEmpty()) { - error = T("Error opening ") + dlh.inputDeviceNames[i] - + T(": \"") + error + T("\""); + error = "Error opening " + dlh.inputDeviceNames[i] + ": \"" + error + "\""; break; } } @@ -226610,7 +226587,7 @@ class WASAPIAudioIODeviceType : public AudioIODeviceType { public: WASAPIAudioIODeviceType() - : AudioIODeviceType (T("Windows Audio")), + : AudioIODeviceType ("Windows Audio"), hasScanned (false) { } @@ -227819,8 +227796,8 @@ void JUCE_CALLTYPE Thread::sleep (int millisecs) nanosleep (&time, 0); } -const tchar File::separator = T('/'); -const tchar* File::separatorString = T("/"); +const juce_wchar File::separator = '/'; +const juce_wchar* File::separatorString = T("/"); const File File::getCurrentWorkingDirectory() { @@ -228099,7 +228076,7 @@ InterProcessLock::InterProcessLock (const String& name_) { #if JUCE_MAC // (don't use getSpecialLocation() to avoid the temp folder being different for each app) - const File temp (File (T("~/Library/Caches/Juce")).getChildFile (name)); + const File temp (File ("~/Library/Caches/Juce").getChildFile (name)); #else const File temp (File::getSpecialLocation (File::tempDirectory).getChildFile (name)); #endif @@ -228271,7 +228248,7 @@ bool juce_copyFile (const String& s, const String& d) const StringArray juce_getFileSystemRoots() { StringArray s; - s.add (T("/")); + s.add ("/"); return s; } @@ -228320,7 +228297,7 @@ bool File::isOnRemovableDrive() const bool File::isHidden() const { - return getFileName().startsWithChar (T('.')); + return getFileName().startsWithChar ('.'); } const char* juce_Argv0 = 0; // referenced from juce_Application.cpp @@ -228364,7 +228341,7 @@ const File File::getSpecialLocation (const SpecialLocationType type) if (! tmp.isDirectory()) { - tmp = T("/tmp"); + tmp = "/tmp"; if (! tmp.isDirectory()) tmp = File::getCurrentWorkingDirectory(); @@ -228412,10 +228389,10 @@ bool File::moveToTrash() const if (! exists()) return true; - File trashCan (T("~/.Trash")); + File trashCan ("~/.Trash"); if (! trashCan.isDirectory()) - trashCan = T("~/.local/share/Trash/files"); + trashCan = "~/.local/share/Trash/files"; if (! trashCan.isDirectory()) return false; @@ -228501,8 +228478,8 @@ void* juce_findFileStart (const String& directory, const String& wildCard, Strin ff->parentDir += File::separator; ff->wildCard = wildCard; - if (wildCard == T("*.*")) - ff->wildCard = T("*"); + if (wildCard == "*.*") + ff->wildCard = "*"; ff->dir = d; @@ -228561,9 +228538,9 @@ bool juce_launchFile (const String& fileName, StringArray cmdLines; for (int i = 0; i < numElementsInArray (browserNames); ++i) - cmdLines.add (String (browserNames[i]) + T(" ") + cmdString.trim().quoted()); + cmdLines.add (String (browserNames[i]) + " " + cmdString.trim().quoted()); - cmdString = cmdLines.joinIntoString (T(" || ")); + cmdString = cmdLines.joinIntoString (" || "); } const char* const argv[4] = { "/bin/sh", "-c", cmdString.toUTF8(), 0 }; @@ -228666,10 +228643,10 @@ bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) signal (SIGPIPE, NamedPipeInternal::signalHandler); siginterrupt (SIGPIPE, 1); - const String pipePath (T("/tmp/") + File::createLegalFileName (pipeName)); + const String pipePath ("/tmp/" + File::createLegalFileName (pipeName)); - intern->pipeInName = pipePath + T("_in"); - intern->pipeOutName = pipePath + T("_out"); + intern->pipeInName = pipePath + "_in"; + intern->pipeOutName = pipePath + "_out"; intern->pipeIn = -1; intern->pipeOut = -1; @@ -228975,19 +228952,19 @@ public: // NB - using charToString() here instead of just T(" "), because that was // causing a mysterious gcc internal compiler error... - const int statusCode = responseHeader.fromFirstOccurrenceOf (String::charToString (T(' ')), false, false) + const int statusCode = responseHeader.fromFirstOccurrenceOf (String::charToString (' '), false, false) .substring (0, 3).getIntValue(); //int contentLength = findHeaderItem (lines, T("Content-Length:")).getIntValue(); //bool isChunked = findHeaderItem (lines, T("Transfer-Encoding:")).equalsIgnoreCase ("chunked"); - String location (findHeaderItem (lines, T("Location:"))); + String location (findHeaderItem (lines, "Location:")); if (statusCode >= 300 && statusCode < 400 && location.isNotEmpty()) { if (! location.startsWithIgnoreCase (T("http://"))) - location = T("http://") + location; + location = "http://" + location; if (levelsOfRedirection++ < 3) return open (location, headers, postData, isPost, callback, callbackContext, timeOutMs); @@ -229148,7 +229125,7 @@ private: if (nextSlash >= 0) path = url.substring (nextSlash); else - path = T("/"); + path = "/"; return true; } @@ -229248,7 +229225,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw() const String SystemStats::getOperatingSystemName() throw() { - return T("Linux"); + return "Linux"; } bool SystemStats::isOperatingSystem64Bit() throw() @@ -229833,7 +229810,7 @@ void juce_handleSelectionRequest (XSelectionRequestEvent &evt) XSendEvent (evt.display, evt.requestor, 0, NoEventMask, (XEvent*) &reply); } -void SystemClipboard::copyTextToClipboard (const String& clipText) throw() +void SystemClipboard::copyTextToClipboard (const String& clipText) { initSelectionAtoms(); localClipboardContent = clipText; @@ -229842,7 +229819,7 @@ void SystemClipboard::copyTextToClipboard (const String& clipText) throw() XSetSelectionOwner (display, atom_CLIPBOARD, juce_messageWindowHandle, CurrentTime); } -const String SystemClipboard::getTextFromClipboard() throw() +const String SystemClipboard::getTextFromClipboard() { initSelectionAtoms(); @@ -230008,7 +229985,7 @@ static XIOErrorHandler oldIOErrorHandler = (XIOErrorHandler) 0; // Usually happens when client-server connection is broken static int ioErrorHandler (Display* display) { - DBG (T("ERROR: connection to X server broken.. terminating.")); + DBG ("ERROR: connection to X server broken.. terminating."); errorOccurred = true; @@ -230030,7 +230007,7 @@ static int errorHandler (Display* display, XErrorEvent* event) XGetErrorDatabaseText (display, "XRequest", String (event->request_code).toCString(), "Unknown", requestStr, 64); - DBG (T("ERROR: X returned ") + String (errorStr) + T(" for operation ") + String (requestStr)); + DBG ("ERROR: X returned " + String (errorStr) + " for operation " + String (requestStr)); #endif return 0; @@ -230369,14 +230346,14 @@ public: int faceIndex; }; - FreeTypeFontFace (const String& familyName) throw() + FreeTypeFontFace (const String& familyName) : hasSerif (false), monospaced (false) { family = familyName; } - void setFileName (const String& name, const int faceIndex, FontStyle style) throw() + void setFileName (const String& name, const int faceIndex, FontStyle style) { if (names [(int) style].fileName.isEmpty()) { @@ -230410,7 +230387,7 @@ class FreeTypeInterface : public DeletedAtShutdown { public: - FreeTypeInterface() throw() + FreeTypeInterface() : lastFace (0), lastBold (false), lastItalic (false) @@ -230418,7 +230395,7 @@ public: if (FT_Init_FreeType (&ftLib) != 0) { ftLib = 0; - DBG (T("Failed to initialize FreeType")); + DBG ("Failed to initialize FreeType"); } StringArray fontDirs; @@ -230432,7 +230409,7 @@ public: if (fontsInfo != 0) { - forEachXmlChildElementWithTagName (*fontsInfo, e, T("dir")) + forEachXmlChildElementWithTagName (*fontsInfo, e, "dir") { fontDirs.add (e->getAllSubText().trim()); } @@ -230448,7 +230425,7 @@ public: enumerateFaces (fontDirs[i]); } - ~FreeTypeInterface() throw() + ~FreeTypeInterface() { if (lastFace != 0) FT_Done_Face (lastFace); @@ -230459,8 +230436,7 @@ public: clearSingletonInstance(); } - FreeTypeFontFace* findOrCreate (const String& familyName, - const bool create = false) throw() + FreeTypeFontFace* findOrCreate (const String& familyName, const bool create = false) { for (int i = 0; i < faces.size(); i++) if (faces[i]->getFamilyName() == familyName) @@ -230476,7 +230452,7 @@ public: } // Enumerate all font faces available in a given directory - void enumerateFaces (const String& path) throw() + void enumerateFaces (const String& path) { File dirPath (path); if (path.isEmpty() || ! dirPath.isDirectory()) @@ -230488,9 +230464,9 @@ public: { File possible (di.getFile()); - if (possible.hasFileExtension (T("ttf")) - || possible.hasFileExtension (T("pfb")) - || possible.hasFileExtension (T("pcf"))) + if (possible.hasFileExtension ("ttf") + || possible.hasFileExtension ("pfb") + || possible.hasFileExtension ("pcf")) { FT_Face face; int faceIndex = 0; @@ -230536,9 +230512,7 @@ public: } // Create a FreeType face object for a given font - FT_Face createFT_Face (const String& fontName, - const bool bold, - const bool italic) throw() + FT_Face createFT_Face (const String& fontName, const bool bold, const bool italic) { FT_Face face = 0; @@ -230608,7 +230582,7 @@ public: return face; } - bool addGlyph (FT_Face face, CustomTypeface& dest, uint32 character) throw() + bool addGlyph (FT_Face face, CustomTypeface& dest, uint32 character) { const unsigned int glyphIndex = FT_Get_Char_Index (face, character); const float height = (float) (face->ascender - face->descender); @@ -230714,7 +230688,7 @@ public: return true; } - void addKerning (FT_Face face, CustomTypeface& dest, const uint32 character, const uint32 glyphIndex) throw() + void addKerning (FT_Face face, CustomTypeface& dest, const uint32 character, const uint32 glyphIndex) { const float height = (float) (face->ascender - face->descender); @@ -230738,7 +230712,7 @@ public: // Add a glyph to a font bool addGlyphToFont (const uint32 character, const tchar* fontName, bool bold, bool italic, - CustomTypeface& dest) throw() + CustomTypeface& dest) { FT_Face face = createFT_Face (fontName, bold, italic); @@ -230748,27 +230722,27 @@ public: return false; } - void getFamilyNames (StringArray& familyNames) const throw() + void getFamilyNames (StringArray& familyNames) const { for (int i = 0; i < faces.size(); i++) familyNames.add (faces[i]->getFamilyName()); } - void getMonospacedNames (StringArray& monoSpaced) const throw() + void getMonospacedNames (StringArray& monoSpaced) const { for (int i = 0; i < faces.size(); i++) if (faces[i]->getMonospaced()) monoSpaced.add (faces[i]->getFamilyName()); } - void getSerifNames (StringArray& serif) const throw() + void getSerifNames (StringArray& serif) const { for (int i = 0; i < faces.size(); i++) if (faces[i]->getSerif()) serif.add (faces[i]->getFamilyName()); } - void getSansSerifNames (StringArray& sansSerif) const throw() + void getSansSerifNames (StringArray& sansSerif) const { for (int i = 0; i < faces.size(); i++) if (! faces[i]->getSerif()) @@ -230799,7 +230773,7 @@ public: if (face == 0) { #ifdef JUCE_DEBUG - String msg (T("Failed to create typeface: ")); + String msg ("Failed to create typeface: "); msg << font.getTypefaceName() << " " << (font.isBold() ? 'B' : ' ') << (font.isItalic() ? 'I' : ' '); DBG (msg); #endif @@ -230825,7 +230799,7 @@ const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) return new FreetypeTypeface (font); } -const StringArray Font::findAllTypefaceNames() throw() +const StringArray Font::findAllTypefaceNames() { StringArray s; FreeTypeInterface::getInstance()->getFamilyNames (s); @@ -230883,7 +230857,7 @@ static const String linux_getDefaultMonospacedFontName() return pickBestFont (allFonts, "Bitstream Vera Sans Mono, Courier, Sans Mono, Mono"); } -void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw() +void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) { defaultSans = linux_getDefaultSansSerifFontName(); defaultSerif = linux_getDefaultSerifFontName(); @@ -234471,7 +234445,7 @@ public: if (bitDepth == 0) { error = "device doesn't support a compatible PCM format"; - DBG (T("ALSA error: ") + error + T("\n")); + DBG ("ALSA error: " + error + "\n"); return false; } @@ -234602,7 +234576,7 @@ private: return false; error = snd_strerror (errorNum); - DBG (T("ALSA error: ") + error + T("\n")); + DBG ("ALSA error: " + error + "\n"); return true; } }; @@ -234886,7 +234860,7 @@ private: return false; error = snd_strerror (errorNum); - DBG (T("ALSA error: ") + error + T("\n")); + DBG ("ALSA error: " + error + "\n"); return true; } @@ -234906,10 +234880,10 @@ private: unsigned int i; for (i = 0; i < maxChansOut; ++i) - channelNamesOut.add (T("channel ") + String ((int) i + 1)); + channelNamesOut.add ("channel " + String ((int) i + 1)); for (i = 0; i < maxChansIn; ++i) - channelNamesIn.add (T("channel ") + String ((int) i + 1)); + channelNamesIn.add ("channel " + String ((int) i + 1)); } }; @@ -234919,7 +234893,7 @@ public: ALSAAudioIODevice (const String& deviceName, const String& inputId_, const String& outputId_) - : AudioIODevice (deviceName, T("ALSA")), + : AudioIODevice (deviceName, "ALSA"), inputId (inputId_), outputId (outputId_), isOpen_ (false), @@ -235097,7 +235071,7 @@ class ALSAAudioIODeviceType : public AudioIODeviceType public: ALSAAudioIODeviceType() - : AudioIODeviceType (T("ALSA")), + : AudioIODeviceType ("ALSA"), hasScanned (false) { } @@ -235241,10 +235215,10 @@ private: getDeviceProperties (id, minChansOut, maxChansOut, minChansIn, maxChansIn, rates); - DBG (T("ALSA device: ") + id - + T(" outs=") + String ((int) minChansOut) + T("-") + String ((int) maxChansOut) - + T(" ins=") + String ((int) minChansIn) + T("-") + String ((int) maxChansIn) - + T(" rates=") + String (rates.size())); + DBG ("ALSA device: " + id + + " outs=" + String ((int) minChansOut) + "-" + String ((int) maxChansOut) + + " ins=" + String ((int) minChansIn) + "-" + String ((int) maxChansIn) + + " rates=" + String (rates.size())); isInput = maxChansIn > 0; isOutput = maxChansOut > 0; @@ -235359,7 +235333,7 @@ public: JackAudioIODevice (const String& deviceName, const String& inputId_, const String& outputId_) - : AudioIODevice (deviceName, T("JACK")), + : AudioIODevice (deviceName, "JACK"), inputId (inputId_), outputId (outputId_), isOpen_ (false), @@ -235453,7 +235427,7 @@ public: { if (client == 0) { - lastError = T("No JACK client running"); + lastError = "No JACK client running"; return lastError; } @@ -235690,7 +235664,7 @@ class JackAudioIODeviceType : public AudioIODeviceType public: JackAudioIODeviceType() - : AudioIODeviceType (T("JACK")), + : AudioIODeviceType ("JACK"), hasScanned (false) { } @@ -236098,7 +236072,7 @@ public: MidiInputThread (MidiInput* const midiInput_, snd_seq_t* const seqHandle_, MidiInputCallback* const callback_) - : Thread (T("Juce MIDI Input")), + : Thread ("Juce MIDI Input"), midiInput (midiInput_), seqHandle (seqHandle_), callback (callback_) @@ -236272,7 +236246,7 @@ MidiInput* MidiInput::createNewDevice (const String&, MidiInputCallback*) { re #if JUCE_INCLUDED_FILE && JUCE_USE_CDREADER AudioCDReader::AudioCDReader() - : AudioFormatReader (0, T("CD Audio")) + : AudioFormatReader (0, "CD Audio") { } @@ -236360,7 +236334,7 @@ void FileChooser::showPlatformDialog (Array& results, bool selectMultipleFiles, FilePreviewComponent* previewComponent) { - const tchar* const separator = T(":"); + const String separator (":"); String command ("zenity --file-selection"); if (title.isNotEmpty()) @@ -236670,7 +236644,7 @@ const String PlatformUtilities::convertToPrecomposedUnicode (const String& s) #if ! JUCE_ONLY_BUILD_CORE_LIBRARY -void SystemClipboard::copyTextToClipboard (const String& text) throw() +void SystemClipboard::copyTextToClipboard (const String& text) { #if JUCE_IPHONE [[UIPasteboard generalPasteboard] setValue: juceStringToNS (text) @@ -236684,7 +236658,7 @@ void SystemClipboard::copyTextToClipboard (const String& text) throw() #endif } -const String SystemClipboard::getTextFromClipboard() throw() +const String SystemClipboard::getTextFromClipboard() { #if JUCE_IPHONE NSString* text = [[UIPasteboard generalPasteboard] valueForPasteboardType: @"public.text"]; @@ -236808,7 +236782,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw() const String SystemStats::getOperatingSystemName() throw() { - return T("Mac OS X"); + return "Mac OS X"; } bool SystemStats::isOperatingSystem64Bit() throw() @@ -237089,7 +237063,7 @@ class JuceURLConnectionMessageThread : public Thread public: JuceURLConnectionMessageThread (JuceURLConnection* owner_) - : Thread (T("http connection")), + : Thread ("http connection"), owner (owner_) { } @@ -237423,10 +237397,10 @@ bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) signal (SIGPIPE, NamedPipeInternal::signalHandler); siginterrupt (SIGPIPE, 1); - const String pipePath (T("/tmp/") + File::createLegalFileName (pipeName)); + const String pipePath ("/tmp/" + File::createLegalFileName (pipeName)); - intern->pipeInName = pipePath + T("_in"); - intern->pipeOutName = pipePath + T("_out"); + intern->pipeInName = pipePath + "_in"; + intern->pipeOutName = pipePath + "_out"; intern->pipeIn = -1; intern->pipeOut = -1; @@ -237788,8 +237762,8 @@ void JUCE_CALLTYPE Thread::sleep (int millisecs) nanosleep (&time, 0); } -const tchar File::separator = T('/'); -const tchar* File::separatorString = T("/"); +const juce_wchar File::separator = '/'; +const juce_wchar* File::separatorString = T("/"); const File File::getCurrentWorkingDirectory() { @@ -238068,7 +238042,7 @@ InterProcessLock::InterProcessLock (const String& name_) { #if JUCE_MAC // (don't use getSpecialLocation() to avoid the temp folder being different for each app) - const File temp (File (T("~/Library/Caches/Juce")).getChildFile (name)); + const File temp (File ("~/Library/Caches/Juce").getChildFile (name)); #else const File temp (File::getSpecialLocation (File::tempDirectory).getChildFile (name)); #endif @@ -238221,7 +238195,7 @@ bool juce_copyFile (const String& src, const String& dst) const StringArray juce_getFileSystemRoots() { StringArray s; - s.add (T("/")); + s.add ("/"); return s; } @@ -238278,7 +238252,7 @@ bool File::isOnRemovableDrive() const static bool juce_isHiddenFile (const String& path) { #if JUCE_IPHONE - return File (path).getFileName().startsWithChar (T('.')); + return File (path).getFileName().startsWithChar ('.'); #else FSRef ref; if (! PlatformUtilities::makeFSRefFromPath (&ref, path)) @@ -238343,7 +238317,7 @@ const File File::getSpecialLocation (const SpecialLocationType type) case tempDirectory: { - File tmp (T("~/Library/Caches/") + juce_getExecutableFile().getFileNameWithoutExtension()); + File tmp ("~/Library/Caches/" + juce_getExecutableFile().getFileNameWithoutExtension()); tmp.createDirectory(); return tmp.getFullPathName(); @@ -238587,7 +238561,7 @@ bool juce_launchFile (const String& fileName, const String& parameters) } else { - ok = juce_launchExecutable (T("\"") + fileName + T("\" ") + parameters); + ok = juce_launchExecutable ("\"" + fileName + "\" " + parameters); } } @@ -239567,7 +239541,7 @@ const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) return new MacTypeface (font); } -const StringArray Font::findAllTypefaceNames() throw() +const StringArray Font::findAllTypefaceNames() { StringArray names; @@ -239586,7 +239560,7 @@ const StringArray Font::findAllTypefaceNames() throw() return names; } -void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw() +void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) { #if JUCE_IPHONE defaultSans = "Helvetica"; @@ -241031,7 +241005,7 @@ BOOL UIViewComponentPeer::textFieldShouldReturn() if (target != 0) { - target->insertTextAtCaret (T("\n")); + target->insertTextAtCaret ("\n"); updateHiddenTextContent (target); } @@ -242591,7 +242565,7 @@ class IPhoneAudioIODevice : public AudioIODevice public: IPhoneAudioIODevice (const String& deviceName) - : AudioIODevice (deviceName, T("Audio")), + : AudioIODevice (deviceName, "Audio"), audioUnit (0), isRunning (false), callback (0), @@ -242695,8 +242669,7 @@ public: isRunning = true; propertyChanged (0, 0, 0); // creates and starts the AU - lastError = audioUnit != 0 ? String::empty - : T("Couldn't open the device"); + lastError = audioUnit != 0 ? "" : "Couldn't open the device"; return lastError; } @@ -243067,7 +243040,7 @@ class IPhoneAudioIODeviceType : public AudioIODeviceType public: IPhoneAudioIODeviceType() - : AudioIODeviceType (T("iPhone Audio")) + : AudioIODeviceType ("iPhone Audio") { } @@ -243141,7 +243114,7 @@ static bool logAnyErrorsMidi (const OSStatus err, const int lineNum) if (err == noErr) return true; - log (T("CoreMidi error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); + log ("CoreMidi error: " + String (lineNum) + " - " + String::toHexString ((int) err)); jassertfalse return false; } @@ -243204,7 +243177,7 @@ static const String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) else if (! result.startsWithIgnoreCase (s)) { // prepend the device name to the entity name - result = (s + T(" ") + result).trimEnd(); + result = (s + " " + result).trimEnd(); } } @@ -243319,7 +243292,7 @@ static bool makeSureClientExists() { if (! hasGlobalClientBeenCreated) { - String name (T("JUCE")); + String name ("JUCE"); if (JUCEApplication::getInstance() != 0) name = JUCEApplication::getInstance()->getApplicationName(); @@ -243365,7 +243338,7 @@ MidiOutput* MidiOutput::openDevice (int index) CFStringRef pname; if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) { - log (T("CoreMidi - opening out: ") + PlatformUtilities::cfStringToJuceString (pname)); + log ("CoreMidi - opening out: " + PlatformUtilities::cfStringToJuceString (pname)); if (makeSureClientExists()) { @@ -243638,7 +243611,7 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) { - log (T("CoreMidi - opening inp: ") + PlatformUtilities::cfStringToJuceString (pname)); + log ("CoreMidi - opening inp: " + PlatformUtilities::cfStringToJuceString (pname)); if (makeSureClientExists()) { @@ -244260,7 +244233,7 @@ const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) return new MacTypeface (font); } -const StringArray Font::findAllTypefaceNames() throw() +const StringArray Font::findAllTypefaceNames() { StringArray names; @@ -244279,7 +244252,7 @@ const StringArray Font::findAllTypefaceNames() throw() return names; } -void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw() +void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) { #if JUCE_IPHONE defaultSans = "Helvetica"; @@ -249284,7 +249257,7 @@ public: for (unsigned int i = 0; i < [filenames count]; ++i) { String filename (nsStringToJuce ((NSString*) [filenames objectAtIndex: i])); - if (filename.containsChar (T(' '))) + if (filename.containsChar (' ')) filename = filename.quoted('"'); files.add (filename); @@ -249292,7 +249265,7 @@ public: if (files.size() > 0 && JUCEApplication::getInstance() != 0) { - JUCEApplication::getInstance()->anotherInstanceStarted (files.joinIntoString (T(" "))); + JUCEApplication::getInstance()->anotherInstanceStarted (files.joinIntoString (" ")); } } @@ -250025,7 +249998,7 @@ bool WebBrowserComponent::pageAboutToLoad (const String& url) if (err == noErr) return true; - Logger::writeToLog (T("CoreAudio error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); + Logger::writeToLog ("CoreAudio error: " + String (lineNum) + " - " + String::toHexString ((int) err)); jassertfalse return false; } @@ -250263,7 +250236,7 @@ public: if (ok) { sampleRates.add (possibleRates[i]); - rates << possibleRates[i] << T(" "); + rates << possibleRates[i] << ' '; } } } @@ -250275,7 +250248,7 @@ public: rates << sampleRate; } - log (T("sr: ") + rates); + log ("sr: " + rates); inputLatency = 0; outputLatency = 0; @@ -250293,7 +250266,7 @@ public: if (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, &lat) == noErr) outputLatency = (int) lat; - log (T("lat: ") + String (inputLatency) + T(" ") + String (outputLatency)); + log ("lat: " + String (inputLatency) + " " + String (outputLatency)); inChanNames.clear(); outChanNames.clear(); @@ -251084,7 +251057,7 @@ class CoreAudioIODeviceType : public AudioIODeviceType public: CoreAudioIODeviceType() - : AudioIODeviceType (T("CoreAudio")), + : AudioIODeviceType ("CoreAudio"), hasScanned (false) { } @@ -251129,7 +251102,7 @@ public: const String nameString (String::fromUTF8 (name, (int) strlen (name))); if (! alreadyLogged) - log (T("CoreAudio device: ") + nameString); + log ("CoreAudio device: " + nameString); const int numIns = getNumChannels (devs[i], true); const int numOuts = getNumChannels (devs[i], false); @@ -251304,7 +251277,7 @@ static bool logAnyErrorsMidi (const OSStatus err, const int lineNum) if (err == noErr) return true; - log (T("CoreMidi error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); + log ("CoreMidi error: " + String (lineNum) + " - " + String::toHexString ((int) err)); jassertfalse return false; } @@ -251367,7 +251340,7 @@ static const String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) else if (! result.startsWithIgnoreCase (s)) { // prepend the device name to the entity name - result = (s + T(" ") + result).trimEnd(); + result = (s + " " + result).trimEnd(); } } @@ -251482,7 +251455,7 @@ static bool makeSureClientExists() { if (! hasGlobalClientBeenCreated) { - String name (T("JUCE")); + String name ("JUCE"); if (JUCEApplication::getInstance() != 0) name = JUCEApplication::getInstance()->getApplicationName(); @@ -251528,7 +251501,7 @@ MidiOutput* MidiOutput::openDevice (int index) CFStringRef pname; if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) { - log (T("CoreMidi - opening out: ") + PlatformUtilities::cfStringToJuceString (pname)); + log ("CoreMidi - opening out: " + PlatformUtilities::cfStringToJuceString (pname)); if (makeSureClientExists()) { @@ -251801,7 +251774,7 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) { - log (T("CoreMidi - opening inp: ") + PlatformUtilities::cfStringToJuceString (pname)); + log ("CoreMidi - opening inp: " + PlatformUtilities::cfStringToJuceString (pname)); if (makeSureClientExists()) { diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 71bd821d7b..1a4acfb3e7 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -1271,7 +1271,7 @@ public: const String unquoted() const; - const String quoted (juce_wchar quoteCharacter = JUCE_T('"')) const; + const String quoted (juce_wchar quoteCharacter = '"') const; static const String repeatedString (const juce_wchar* stringToRepeat, int numberOfTimesToRepeat); @@ -4076,7 +4076,7 @@ public: double inWeeks() const throw(); - const String getDescription (const String& returnValueForZeroTime = JUCE_T("0")) const throw(); + const String getDescription (const String& returnValueForZeroTime = "0") const throw(); bool operator== (const RelativeTime& other) const throw(); bool operator!= (const RelativeTime& other) const throw(); @@ -4342,10 +4342,10 @@ public: int findChildFiles (Array& results, int whatToLookFor, bool searchRecursively, - const String& wildCardPattern = JUCE_T("*")) const; + const String& wildCardPattern = "*") const; int getNumberOfChildFiles (int whatToLookFor, - const String& wildCardPattern = JUCE_T("*")) const; + const String& wildCardPattern = "*") const; bool containsSubDirectories() const; @@ -4485,19 +4485,19 @@ public: const String createDocument (const String& dtdToUse, bool allOnOneLine = false, bool includeXmlHeader = true, - const String& encodingType = JUCE_T("UTF-8"), + const String& encodingType = "UTF-8", int lineWrapLength = 60) const; void writeToStream (OutputStream& output, const String& dtdToUse, bool allOnOneLine = false, bool includeXmlHeader = true, - const String& encodingType = JUCE_T("UTF-8"), + const String& encodingType = "UTF-8", int lineWrapLength = 60) const; bool writeToFile (const File& destinationFile, const String& dtdToUse, - const String& encodingType = JUCE_T("UTF-8"), + const String& encodingType = "UTF-8", int lineWrapLength = 60) const; inline const String& getTagName() const throw() { return tagName; } @@ -7598,7 +7598,7 @@ public: DirectoryIterator (const File& directory, bool isRecursive, - const String& wildCard = JUCE_T("*"), + const String& wildCard = "*", int whatToLookFor = File::findFiles); ~DirectoryIterator(); @@ -7754,7 +7754,7 @@ public: int findChildFiles (Array& results, int whatToLookFor, bool searchRecursively, - const String& wildCardPattern = JUCE_T("*")) const; + const String& wildCardPattern = "*") const; bool isFileInPath (const File& fileToCheck, bool checkRecursively) const; @@ -10146,7 +10146,7 @@ public: static const Rectangle fromString (const String& stringVersion) { StringArray toks; - toks.addTokens (stringVersion.trim(), JUCE_T(",; \t\r\n"), String::empty); + toks.addTokens (stringVersion.trim(), ",; \t\r\n", String::empty); return Rectangle (toks[0].trim().getIntValue(), toks[1].trim().getIntValue(), @@ -10708,7 +10708,7 @@ public: static const String getDefaultMonospacedFontName() throw(); - static void getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw(); + static void getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed); float getHeight() const throw() { return font->height; } @@ -10756,7 +10756,7 @@ public: static void findFonts (Array& results) throw(); - static const StringArray findAllTypefaceNames() throw(); + static const StringArray findAllTypefaceNames(); static const String getFallbackFontName() throw(); @@ -14914,11 +14914,11 @@ class JUCE_API IIRFilter { public: - IIRFilter() throw(); + IIRFilter(); - IIRFilter (const IIRFilter& other) throw(); + IIRFilter (const IIRFilter& other); - ~IIRFilter() throw(); + ~IIRFilter(); void reset() throw(); @@ -15142,7 +15142,7 @@ public: virtual ~AudioIODeviceType(); protected: - AudioIODeviceType (const tchar* const typeName); + AudioIODeviceType (const String& typeName); private: String typeName; @@ -16984,7 +16984,7 @@ public: AudioIODevice* getCurrentAudioDevice() const throw() { return currentAudioDevice; } - const String getCurrentAudioDeviceType() const throw() { return currentDeviceType; } + const String getCurrentAudioDeviceType() const { return currentDeviceType; } AudioIODeviceType* getCurrentDeviceTypeObject() const; @@ -17014,7 +17014,7 @@ public: void setDefaultMidiOutput (const String& deviceName); - const String getDefaultMidiOutputName() const throw() { return defaultMidiOutputName; } + const String getDefaultMidiOutputName() const { return defaultMidiOutputName; } MidiOutput* getDefaultMidiOutput() const throw() { return defaultMidiOutput; } @@ -27308,7 +27308,7 @@ public: bool hasProgressBar, bool hasCancelButton, int timeOutMsWhenCancelling = 10000, - const String& cancelButtonText = JUCE_T("Cancel")); + const String& cancelButtonText = "Cancel"); ~ThreadWithProgressWindow(); @@ -28490,9 +28490,9 @@ private: class JUCE_API SystemClipboard { public: - static void copyTextToClipboard (const String& text) throw(); + static void copyTextToClipboard (const String& text); - static const String getTextFromClipboard() throw(); + static const String getTextFromClipboard(); }; #endif // __JUCE_SYSTEMCLIPBOARD_JUCEHEADER__ diff --git a/src/application/juce_Application.cpp b/src/application/juce_Application.cpp index 6d959cf426..b78452aa22 100644 --- a/src/application/juce_Application.cpp +++ b/src/application/juce_Application.cpp @@ -144,7 +144,7 @@ void JUCEApplication::getCommandInfo (const CommandID commandID, ApplicationComm "Application", 0); - result.defaultKeypresses.add (KeyPress (T('q'), ModifierKeys::commandModifier, 0)); + result.defaultKeypresses.add (KeyPress ('q', ModifierKeys::commandModifier, 0)); } } diff --git a/src/application/juce_Application.h b/src/application/juce_Application.h index 048580d0c0..06d0516ac9 100644 --- a/src/application/juce_Application.h +++ b/src/application/juce_Application.h @@ -78,12 +78,12 @@ const String getApplicationName() { - return T("Super JUCE-o-matic"); + return "Super JUCE-o-matic"; } const String getApplicationVersion() { - return T("1.0"); + return "1.0"; } }; diff --git a/src/application/juce_ApplicationCommandInfo.h b/src/application/juce_ApplicationCommandInfo.h index c24cc8fb67..7df4f8b4ce 100644 --- a/src/application/juce_ApplicationCommandInfo.h +++ b/src/application/juce_ApplicationCommandInfo.h @@ -76,11 +76,11 @@ struct JUCE_API ApplicationCommandInfo This is just so you can write things like: @code - myinfo.addDefaultKeypress (T('s'), ModifierKeys::commandModifier); + myinfo.addDefaultKeypress ('s', ModifierKeys::commandModifier); @endcode instead of @code - myinfo.defaultKeypresses.add (KeyPress (T('s'), ModifierKeys::commandModifier)); + myinfo.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier)); @endcode */ void addDefaultKeypress (int keyCode, diff --git a/src/audio/audio_file_formats/juce_AudioCDReader.cpp b/src/audio/audio_file_formats/juce_AudioCDReader.cpp index dea9c90aac..8a6241d3d0 100644 --- a/src/audio/audio_file_formats/juce_AudioCDReader.cpp +++ b/src/audio/audio_file_formats/juce_AudioCDReader.cpp @@ -112,7 +112,7 @@ void AudioCDReader::refreshTrackLengths() { tracks.clear(); trackStartSamples.clear(); - volumeDir.findChildFiles (tracks, File::findFiles | File::ignoreHiddenFiles, false, T("*.aiff")); + volumeDir.findChildFiles (tracks, File::findFiles | File::ignoreHiddenFiles, false, "*.aiff"); tracks.sort (*this); diff --git a/src/audio/audio_file_formats/juce_AudioFormatManager.cpp b/src/audio/audio_file_formats/juce_AudioFormatManager.cpp index 63822403de..f497d2300f 100644 --- a/src/audio/audio_file_formats/juce_AudioFormatManager.cpp +++ b/src/audio/audio_file_formats/juce_AudioFormatManager.cpp @@ -122,8 +122,8 @@ AudioFormat* AudioFormatManager::getDefaultFormat() const AudioFormat* AudioFormatManager::findFormatForFileExtension (const String& fileExtension) const { String e (fileExtension); - if (! e.startsWithChar (T('.'))) - e = T(".") + e; + if (! e.startsWithChar ('.')) + e = "." + e; for (int i = 0; i < getNumKnownFormats(); ++i) if (getKnownFormat(i)->getFileExtensions().contains (e, true)) @@ -146,15 +146,15 @@ const String AudioFormatManager::getWildcardForAllFormats() const String s; for (i = 0; i < allExtensions.size(); ++i) { - s << T('*'); + s << '*'; - if (! allExtensions[i].startsWithChar (T('.'))) - s << T('.'); + if (! allExtensions[i].startsWithChar ('.')) + s << '.'; s << allExtensions[i]; if (i < allExtensions.size() - 1) - s << T(';'); + s << ';'; } return s; diff --git a/src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp b/src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp index 5dd73d4ae2..f9317cc2f5 100644 --- a/src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp +++ b/src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp @@ -44,7 +44,7 @@ struct ThumbnailCacheEntry //============================================================================== AudioThumbnailCache::AudioThumbnailCache (const int maxNumThumbsToStore_) - : TimeSliceThread (T("thumb cache")), + : TimeSliceThread ("thumb cache"), maxNumThumbsToStore (maxNumThumbsToStore_) { startThread (2); diff --git a/src/audio/audio_sources/juce_ChannelRemappingAudioSource.cpp b/src/audio/audio_sources/juce_ChannelRemappingAudioSource.cpp index 06be9726cb..a1a5948780 100644 --- a/src/audio/audio_sources/juce_ChannelRemappingAudioSource.cpp +++ b/src/audio/audio_sources/juce_ChannelRemappingAudioSource.cpp @@ -163,7 +163,7 @@ void ChannelRemappingAudioSource::getNextAudioBlock (const AudioSourceChannelInf //============================================================================== XmlElement* ChannelRemappingAudioSource::createXml() const throw() { - XmlElement* e = new XmlElement (T("MAPPINGS")); + XmlElement* e = new XmlElement ("MAPPINGS"); String ins, outs; int i; @@ -171,28 +171,28 @@ XmlElement* ChannelRemappingAudioSource::createXml() const throw() const ScopedLock sl (lock); for (i = 0; i < remappedInputs.size(); ++i) - ins << remappedInputs.getUnchecked(i) << T(' '); + ins << remappedInputs.getUnchecked(i) << ' '; for (i = 0; i < remappedOutputs.size(); ++i) - outs << remappedOutputs.getUnchecked(i) << T(' '); + outs << remappedOutputs.getUnchecked(i) << ' '; - e->setAttribute (T("inputs"), ins.trimEnd()); - e->setAttribute (T("outputs"), outs.trimEnd()); + e->setAttribute ("inputs", ins.trimEnd()); + e->setAttribute ("outputs", outs.trimEnd()); return e; } void ChannelRemappingAudioSource::restoreFromXml (const XmlElement& e) throw() { - if (e.hasTagName (T("MAPPINGS"))) + if (e.hasTagName ("MAPPINGS")) { const ScopedLock sl (lock); clearAllMappings(); StringArray ins, outs; - ins.addTokens (e.getStringAttribute (T("inputs")), false); - outs.addTokens (e.getStringAttribute (T("outputs")), false); + ins.addTokens (e.getStringAttribute ("inputs"), false); + outs.addTokens (e.getStringAttribute ("outputs"), false); int i; for (i = 0; i < ins.size(); ++i) diff --git a/src/audio/devices/juce_AudioDeviceManager.cpp b/src/audio/devices/juce_AudioDeviceManager.cpp index e0f8a155f3..691e3e0bdc 100644 --- a/src/audio/devices/juce_AudioDeviceManager.cpp +++ b/src/audio/devices/juce_AudioDeviceManager.cpp @@ -155,7 +155,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, numInputChansNeeded = numInputChannelsNeeded; numOutputChansNeeded = numOutputChannelsNeeded; - if (e != 0 && e->hasTagName (T("DEVICESETUP"))) + if (e != 0 && e->hasTagName ("DEVICESETUP")) { lastExplicitSettings = new XmlElement (*e); @@ -165,18 +165,18 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, if (preferredSetupOptions != 0) setup = *preferredSetupOptions; - if (e->getStringAttribute (T("audioDeviceName")).isNotEmpty()) + if (e->getStringAttribute ("audioDeviceName").isNotEmpty()) { setup.inputDeviceName = setup.outputDeviceName - = e->getStringAttribute (T("audioDeviceName")); + = e->getStringAttribute ("audioDeviceName"); } else { - setup.inputDeviceName = e->getStringAttribute (T("audioInputDeviceName")); - setup.outputDeviceName = e->getStringAttribute (T("audioOutputDeviceName")); + setup.inputDeviceName = e->getStringAttribute ("audioInputDeviceName"); + setup.outputDeviceName = e->getStringAttribute ("audioOutputDeviceName"); } - currentDeviceType = e->getStringAttribute (T("deviceType")); + currentDeviceType = e->getStringAttribute ("deviceType"); if (currentDeviceType.isEmpty()) { AudioIODeviceType* const type = findType (setup.inputDeviceName, setup.outputDeviceName); @@ -187,20 +187,20 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, currentDeviceType = availableDeviceTypes[0]->getTypeName(); } - setup.bufferSize = e->getIntAttribute (T("audioDeviceBufferSize")); - setup.sampleRate = e->getDoubleAttribute (T("audioDeviceRate")); + setup.bufferSize = e->getIntAttribute ("audioDeviceBufferSize"); + setup.sampleRate = e->getDoubleAttribute ("audioDeviceRate"); - setup.inputChannels.parseString (e->getStringAttribute (T("audioDeviceInChans"), T("11")), 2); - setup.outputChannels.parseString (e->getStringAttribute (T("audioDeviceOutChans"), T("11")), 2); + setup.inputChannels.parseString (e->getStringAttribute ("audioDeviceInChans", "11"), 2); + setup.outputChannels.parseString (e->getStringAttribute ("audioDeviceOutChans", "11"), 2); - setup.useDefaultInputChannels = ! e->hasAttribute (T("audioDeviceInChans")); - setup.useDefaultOutputChannels = ! e->hasAttribute (T("audioDeviceOutChans")); + setup.useDefaultInputChannels = ! e->hasAttribute ("audioDeviceInChans"); + setup.useDefaultOutputChannels = ! e->hasAttribute ("audioDeviceOutChans"); error = setAudioDeviceSetup (setup, true); midiInsFromXml.clear(); - forEachXmlChildElementWithTagName (*e, c, T("MIDIINPUT")) - midiInsFromXml.add (c->getStringAttribute (T("name"))); + forEachXmlChildElementWithTagName (*e, c, "MIDIINPUT") + midiInsFromXml.add (c->getStringAttribute ("name")); const StringArray allMidiIns (MidiInput::getDevices()); @@ -211,7 +211,7 @@ const String AudioDeviceManager::initialise (const int numInputChannelsNeeded, error = initialise (numInputChannelsNeeded, numOutputChannelsNeeded, 0, false, preferredDefaultDeviceName); - setDefaultMidiOutput (e->getStringAttribute (T("defaultMidiOutput"))); + setDefaultMidiOutput (e->getStringAttribute ("defaultMidiOutput")); return error; } diff --git a/src/audio/devices/juce_AudioDeviceManager.h b/src/audio/devices/juce_AudioDeviceManager.h index 65e67cdaf3..694b68c26e 100644 --- a/src/audio/devices/juce_AudioDeviceManager.h +++ b/src/audio/devices/juce_AudioDeviceManager.h @@ -224,7 +224,7 @@ public: /** Returns the type of audio device currently in use. @see setCurrentAudioDeviceType */ - const String getCurrentAudioDeviceType() const throw() { return currentDeviceType; } + const String getCurrentAudioDeviceType() const { return currentDeviceType; } /** Returns the currently active audio device type object. Don't keep a copy of this pointer - it's owned by the device manager and could @@ -356,7 +356,7 @@ public: @see setDefaultMidiOutput, getDefaultMidiOutput */ - const String getDefaultMidiOutputName() const throw() { return defaultMidiOutputName; } + const String getDefaultMidiOutputName() const { return defaultMidiOutputName; } /** Returns the current default midi output device. diff --git a/src/audio/devices/juce_AudioIODeviceType.cpp b/src/audio/devices/juce_AudioIODeviceType.cpp index 86d2962ac1..a12627a00f 100644 --- a/src/audio/devices/juce_AudioIODeviceType.cpp +++ b/src/audio/devices/juce_AudioIODeviceType.cpp @@ -31,7 +31,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== -AudioIODeviceType::AudioIODeviceType (const tchar* const name) +AudioIODeviceType::AudioIODeviceType (const String& name) : typeName (name) { } diff --git a/src/audio/devices/juce_AudioIODeviceType.h b/src/audio/devices/juce_AudioIODeviceType.h index 86cc4ba495..3c1f3562a9 100644 --- a/src/audio/devices/juce_AudioIODeviceType.h +++ b/src/audio/devices/juce_AudioIODeviceType.h @@ -132,7 +132,7 @@ public: virtual ~AudioIODeviceType(); protected: - AudioIODeviceType (const tchar* const typeName); + AudioIODeviceType (const String& typeName); private: String typeName; diff --git a/src/audio/dsp/juce_IIRFilter.cpp b/src/audio/dsp/juce_IIRFilter.cpp index 38085c757a..9a80e23d50 100644 --- a/src/audio/dsp/juce_IIRFilter.cpp +++ b/src/audio/dsp/juce_IIRFilter.cpp @@ -32,13 +32,13 @@ BEGIN_JUCE_NAMESPACE //============================================================================== -IIRFilter::IIRFilter() throw() +IIRFilter::IIRFilter() : active (false) { reset(); } -IIRFilter::IIRFilter (const IIRFilter& other) throw() +IIRFilter::IIRFilter (const IIRFilter& other) : active (other.active) { const ScopedLock sl (other.processLock); @@ -46,7 +46,7 @@ IIRFilter::IIRFilter (const IIRFilter& other) throw() reset(); } -IIRFilter::~IIRFilter() throw() +IIRFilter::~IIRFilter() { } diff --git a/src/audio/dsp/juce_IIRFilter.h b/src/audio/dsp/juce_IIRFilter.h index 334fb1857b..fb131bf9f0 100644 --- a/src/audio/dsp/juce_IIRFilter.h +++ b/src/audio/dsp/juce_IIRFilter.h @@ -46,13 +46,13 @@ public: you process with it. Use the appropriate method to turn it into the type of filter needed. */ - IIRFilter() throw(); + IIRFilter(); /** Creates a copy of another filter. */ - IIRFilter (const IIRFilter& other) throw(); + IIRFilter (const IIRFilter& other); /** Destructor. */ - ~IIRFilter() throw(); + ~IIRFilter(); //============================================================================== /** Resets the filter's processing pipeline, ready to start a new stream of data. diff --git a/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm b/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm index c2e593e60b..2f83d68d10 100644 --- a/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm +++ b/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm @@ -92,7 +92,7 @@ static const tchar* auIdentifierPrefix = T("AudioUnit:"); static const String createAUPluginIdentifier (const ComponentDescription& desc) { - jassert (osTypeToString ('abcd') == T("abcd")); // agh, must have got the endianness wrong.. + jassert (osTypeToString ('abcd') == "abcd"); // agh, must have got the endianness wrong.. jassert (stringToOSType ("abcd") == (OSType) 'abcd'); // ditto String s (auIdentifierPrefix); @@ -158,11 +158,11 @@ static bool getComponentDescFromIdentifier (const String& fileOrIdentifier, Comp if (fileOrIdentifier.startsWithIgnoreCase (auIdentifierPrefix)) { - String s (fileOrIdentifier.substring (jmax (fileOrIdentifier.lastIndexOfChar (T(':')), - fileOrIdentifier.lastIndexOfChar (T('/'))) + 1)); + String s (fileOrIdentifier.substring (jmax (fileOrIdentifier.lastIndexOfChar (':'), + fileOrIdentifier.lastIndexOfChar ('/')) + 1)); StringArray tokens; - tokens.addTokens (s, T(","), String::empty); + tokens.addTokens (s, ",", String::empty); tokens.trim(); tokens.removeEmptyStrings(); @@ -378,7 +378,7 @@ AudioUnitPluginInstance::AudioUnitPluginInstance (const String& fileOrIdentifier { ++insideCallback; - log (T("Opening AU: ") + fileOrIdentifier); + log ("Opening AU: " + fileOrIdentifier); if (getComponentDescFromFile (fileOrIdentifier)) { @@ -423,7 +423,7 @@ bool AudioUnitPluginInstance::getComponentDescFromFile (const String& fileOrIden return true; const File file (fileOrIdentifier); - if (! file.hasFileExtension (T(".component"))) + if (! file.hasFileExtension (".component")) return false; const char* const utf8 = fileOrIdentifier.toUTF8(); @@ -497,7 +497,7 @@ void AudioUnitPluginInstance::initialise() if (initialised || audioUnit == 0) return; - log (T("Initialising AU: ") + pluginName); + log ("Initialising AU: " + pluginName); parameterIds.clear(); @@ -1044,7 +1044,7 @@ private: HIViewRef attachView (WindowRef windowRef, HIViewRef rootView) { - log (T("Opening AU GUI: ") + owner->plugin.getName()); + log ("Opening AU GUI: " + owner->plugin.getName()); AudioUnitCarbonView viewComponent = owner->getViewComponent(); @@ -1069,7 +1069,7 @@ private: void removeView (HIViewRef) { - log (T("Closing AU GUI: ") + owner->plugin.getName()); + log ("Closing AU GUI: " + owner->plugin.getName()); owner->closeViewComponent(); } @@ -1297,7 +1297,7 @@ void AudioUnitPluginInstance::changeProgramName (int index, const String& newNam const String AudioUnitPluginInstance::getInputChannelName (const int index) const { if (((unsigned int) index) < (unsigned int) getNumInputChannels()) - return T("Input ") + String (index + 1); + return "Input " + String (index + 1); return String::empty; } @@ -1314,7 +1314,7 @@ bool AudioUnitPluginInstance::isInputChannelStereoPair (int index) const const String AudioUnitPluginInstance::getOutputChannelName (const int index) const { if (((unsigned int) index) < (unsigned int) getNumOutputChannels()) - return T("Output ") + String (index + 1); + return "Output " + String (index + 1); return String::empty; } @@ -1485,7 +1485,7 @@ bool AudioUnitPluginFormat::fileMightContainThisPluginType (const String& fileOr const File f (fileOrIdentifier); - return f.hasFileExtension (T(".component")) + return f.hasFileExtension (".component") && f.isDirectory(); } diff --git a/src/audio/plugins/formats/juce_VSTPluginFormat.cpp b/src/audio/plugins/formats/juce_VSTPluginFormat.cpp index 4cb77cdc6a..acf0d89d29 100644 --- a/src/audio/plugins/formats/juce_VSTPluginFormat.cpp +++ b/src/audio/plugins/formats/juce_VSTPluginFormat.cpp @@ -469,7 +469,7 @@ public: bool ok = false; const String filename (file.getFullPathName()); - if (file.hasFileExtension (T(".vst"))) + if (file.hasFileExtension (".vst")) { const char* const utf8 = filename.toUTF8(); CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*) utf8, @@ -823,7 +823,7 @@ VSTPluginInstance::VSTPluginInstance (const ReferenceCountedObjectPtr pluginName; - log (T("Creating VST instance: ") + name); + log ("Creating VST instance: " + name); #if JUCE_MAC if (module->resFileId != 0) @@ -907,7 +907,7 @@ void VSTPluginInstance::initialise() if (initialised || effect == 0) return; - log (T("Initialising VST: ") + module->pluginName); + log ("Initialising VST: " + module->pluginName); initialised = true; dispatch (effIdentify, 0, 0, 0, 0); @@ -1454,7 +1454,7 @@ private: if (isOpen || getWindowHandle() == 0) return; - log (T("Opening VST UI: ") + plugin.name); + log ("Opening VST UI: " + plugin.name); isOpen = true; ERect* rect = 0; @@ -1569,7 +1569,7 @@ private: { if (isOpen) { - log (T("Closing VST UI: ") + plugin.getName()); + log ("Closing VST UI: " + plugin.getName()); isOpen = false; dispatch (effEditClose, 0, 0, 0, 0); @@ -2937,7 +2937,7 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti const File f (fileOrIdentifier); #if JUCE_MAC - if (f.isDirectory() && f.hasFileExtension (T(".vst"))) + if (f.isDirectory() && f.hasFileExtension (".vst")) return true; #if JUCE_PPC @@ -2960,10 +2960,10 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti return false; #elif JUCE_WIN32 return f.existsAsFile() - && f.hasFileExtension (T(".dll")); + && f.hasFileExtension (".dll"); #elif JUCE_LINUX return f.existsAsFile() - && f.hasFileExtension (T(".so")); + && f.hasFileExtension (".so"); #endif } diff --git a/src/audio/plugins/juce_KnownPluginList.cpp b/src/audio/plugins/juce_KnownPluginList.cpp index b0fa22aad9..c206aaa102 100644 --- a/src/audio/plugins/juce_KnownPluginList.cpp +++ b/src/audio/plugins/juce_KnownPluginList.cpp @@ -95,8 +95,8 @@ void KnownPluginList::removeType (const int index) throw() static Time getFileModTime (const String& fileOrIdentifier) throw() { - if (fileOrIdentifier.startsWithChar (T('/')) - || fileOrIdentifier[1] == T(':')) + if (fileOrIdentifier.startsWithChar ('/') + || fileOrIdentifier[1] == ':') { return File (fileOrIdentifier).getLastModificationTime(); } @@ -229,9 +229,9 @@ public: else if (method == KnownPluginList::sortByManufacturer) diff = first->manufacturerName.compareLexicographically (second->manufacturerName); else if (method == KnownPluginList::sortByFileSystemLocation) - diff = first->fileOrIdentifier.replaceCharacter (T('\\'), T('/')) + diff = first->fileOrIdentifier.replaceCharacter ('\\', '/') .upToLastOccurrenceOf (T("/"), false, false) - .compare (second->fileOrIdentifier.replaceCharacter (T('\\'), T('/')) + .compare (second->fileOrIdentifier.replaceCharacter ('\\', '/') .upToLastOccurrenceOf (T("/"), false, false)); if (diff == 0) @@ -256,7 +256,7 @@ void KnownPluginList::sort (const SortMethod method) //============================================================================== XmlElement* KnownPluginList::createXml() const { - XmlElement* const e = new XmlElement (T("KNOWNPLUGINS")); + XmlElement* const e = new XmlElement ("KNOWNPLUGINS"); for (int i = 0; i < types.size(); ++i) e->addChildElement (types.getUnchecked(i)->createXml()); @@ -268,7 +268,7 @@ void KnownPluginList::recreateFromXml (const XmlElement& xml) { clear(); - if (xml.hasTagName (T("KNOWNPLUGINS"))) + if (xml.hasTagName ("KNOWNPLUGINS")) { forEachXmlChildElement (xml, e) { @@ -345,10 +345,10 @@ public: for (int i = 0; i < allPlugins.size(); ++i) { String path (allPlugins.getUnchecked(i) - ->fileOrIdentifier.replaceCharacter (T('\\'), T('/')) + ->fileOrIdentifier.replaceCharacter ('\\', '/') .upToLastOccurrenceOf (T("/"), false, false)); - if (path.substring (1, 2) == T(":")) + if (path.substring (1, 2) == ":") path = path.substring (2); addPlugin (allPlugins.getUnchecked(i), path); @@ -411,7 +411,7 @@ void KnownPluginList::addToMenu (PopupMenu& menu, const SortMethod sortMethod) c : pd->manufacturerName); if (! thisSubMenuName.containsNonWhitespaceChars()) - thisSubMenuName = T("Other"); + thisSubMenuName = "Other"; if (thisSubMenuName != lastSubMenuName) { diff --git a/src/audio/plugins/juce_PluginDescription.cpp b/src/audio/plugins/juce_PluginDescription.cpp index 4a8c3c39b3..5199256c5f 100644 --- a/src/audio/plugins/juce_PluginDescription.cpp +++ b/src/audio/plugins/juce_PluginDescription.cpp @@ -85,44 +85,44 @@ bool PluginDescription::isDuplicateOf (const PluginDescription& other) const const String PluginDescription::createIdentifierString() const throw() { return pluginFormatName - + T("-") + name - + T("-") + String::toHexString (fileOrIdentifier.hashCode()) - + T("-") + String::toHexString (uid); + + "-" + name + + "-" + String::toHexString (fileOrIdentifier.hashCode()) + + "-" + String::toHexString (uid); } XmlElement* PluginDescription::createXml() const { - XmlElement* const e = new XmlElement (T("PLUGIN")); - e->setAttribute (T("name"), name); - e->setAttribute (T("format"), pluginFormatName); - e->setAttribute (T("category"), category); - e->setAttribute (T("manufacturer"), manufacturerName); - e->setAttribute (T("version"), version); - e->setAttribute (T("file"), fileOrIdentifier); - e->setAttribute (T("uid"), String::toHexString (uid)); - e->setAttribute (T("isInstrument"), isInstrument); - e->setAttribute (T("fileTime"), String::toHexString (lastFileModTime.toMilliseconds())); - e->setAttribute (T("numInputs"), numInputChannels); - e->setAttribute (T("numOutputs"), numOutputChannels); + XmlElement* const e = new XmlElement ("PLUGIN"); + e->setAttribute ("name", name); + e->setAttribute ("format", pluginFormatName); + e->setAttribute ("category", category); + e->setAttribute ("manufacturer", manufacturerName); + e->setAttribute ("version", version); + e->setAttribute ("file", fileOrIdentifier); + e->setAttribute ("uid", String::toHexString (uid)); + e->setAttribute ("isInstrument", isInstrument); + e->setAttribute ("fileTime", String::toHexString (lastFileModTime.toMilliseconds())); + e->setAttribute ("numInputs", numInputChannels); + e->setAttribute ("numOutputs", numOutputChannels); return e; } bool PluginDescription::loadFromXml (const XmlElement& xml) { - if (xml.hasTagName (T("PLUGIN"))) + if (xml.hasTagName ("PLUGIN")) { - name = xml.getStringAttribute (T("name")); - pluginFormatName = xml.getStringAttribute (T("format")); - category = xml.getStringAttribute (T("category")); - manufacturerName = xml.getStringAttribute (T("manufacturer")); - version = xml.getStringAttribute (T("version")); - fileOrIdentifier = xml.getStringAttribute (T("file")); - uid = xml.getStringAttribute (T("uid")).getHexValue32(); - isInstrument = xml.getBoolAttribute (T("isInstrument"), false); - lastFileModTime = Time (xml.getStringAttribute (T("fileTime")).getHexValue64()); - numInputChannels = xml.getIntAttribute (T("numInputs")); - numOutputChannels = xml.getIntAttribute (T("numOutputs")); + name = xml.getStringAttribute ("name"); + pluginFormatName = xml.getStringAttribute ("format"); + category = xml.getStringAttribute ("category"); + manufacturerName = xml.getStringAttribute ("manufacturer"); + version = xml.getStringAttribute ("version"); + fileOrIdentifier = xml.getStringAttribute ("file"); + uid = xml.getStringAttribute ("uid").getHexValue32(); + isInstrument = xml.getBoolAttribute ("isInstrument", false); + lastFileModTime = Time (xml.getStringAttribute ("fileTime").getHexValue64()); + numInputChannels = xml.getIntAttribute ("numInputs"); + numOutputChannels = xml.getIntAttribute ("numOutputs"); return true; } diff --git a/src/containers/juce_BitArray.cpp b/src/containers/juce_BitArray.cpp index eb0d9914ec..6048f14f2a 100644 --- a/src/containers/juce_BitArray.cpp +++ b/src/containers/juce_BitArray.cpp @@ -877,7 +877,7 @@ const String BigInteger::toString (const int base, const int minimumNumCharacter if (base == 2 || base == 8 || base == 16) { const int bits = (base == 2) ? 1 : (base == 8 ? 3 : 4); - static const juce_wchar* const hexDigits = T("0123456789abcdef"); + static const char* const hexDigits = "0123456789abcdef"; for (;;) { @@ -914,7 +914,7 @@ const String BigInteger::toString (const int base, const int minimumNumCharacter s = s.paddedLeft ('0', minimumNumCharacters); - return isNegative() ? T("-") + s : s; + return isNegative() ? "-" + s : s; } void BigInteger::parseString (const String& text, const int base) @@ -950,10 +950,10 @@ void BigInteger::parseString (const String& text, const int base) { const juce_wchar c = *t++; - if (c >= T('0') && c <= T('9')) + if (c >= '0' && c <= '9') { operator*= (ten); - operator+= ((int) (c - T('0'))); + operator+= ((int) (c - '0')); } else if (c == 0) { @@ -962,7 +962,7 @@ void BigInteger::parseString (const String& text, const int base) } } - setNegative (text.trimStart().startsWithChar (T('-'))); + setNegative (text.trimStart().startsWithChar ('-')); } const MemoryBlock BigInteger::toMemoryBlock() const diff --git a/src/containers/juce_MemoryBlock.cpp b/src/containers/juce_MemoryBlock.cpp index 310cbbf6a2..670bb944cb 100644 --- a/src/containers/juce_MemoryBlock.cpp +++ b/src/containers/juce_MemoryBlock.cpp @@ -309,19 +309,19 @@ void MemoryBlock::loadFromHexString (const String& hex) throw() { const juce_wchar c = hex [i++]; - if (c >= T('0') && c <= T('9')) + if (c >= '0' && c <= '9') { - byte |= c - T('0'); + byte |= c - '0'; break; } - else if (c >= T('a') && c <= T('z')) + else if (c >= 'a' && c <= 'z') { - byte |= c - (T('a') - 10); + byte |= c - ('a' - 10); break; } - else if (c >= T('A') && c <= T('Z')) + else if (c >= 'A' && c <= 'Z') { - byte |= c - (T('A') - 10); + byte |= c - ('A' - 10); break; } else if (c == 0) @@ -349,7 +349,7 @@ const String MemoryBlock::toBase64Encoding() const throw() destString.preallocateStorage (initialLen + 2 + numChars); tchar* d = const_cast (((const tchar*) destString) + initialLen); - *d++ = T('.'); + *d++ = '.'; for (size_t i = 0; i < numChars; ++i) *d++ = encodingTable [getBitRange (i * 6, 6)]; @@ -361,7 +361,7 @@ const String MemoryBlock::toBase64Encoding() const throw() bool MemoryBlock::fromBase64Encoding (const String& s) throw() { - const int startPos = s.indexOfChar (T('.')) + 1; + const int startPos = s.indexOfChar ('.') + 1; if (startPos <= 0) return false; diff --git a/src/containers/juce_PropertySet.cpp b/src/containers/juce_PropertySet.cpp index c71692db91..74be904706 100644 --- a/src/containers/juce_PropertySet.cpp +++ b/src/containers/juce_PropertySet.cpp @@ -184,7 +184,7 @@ void PropertySet::setValue (const String& keyName, const double value) throw() void PropertySet::setValue (const String& keyName, const bool value) throw() { - setValue (keyName, String ((value) ? T("1") : T("0"))); + setValue (keyName, String (value ? "1" : "0")); } void PropertySet::setValue (const String& keyName, const XmlElement* const xml) @@ -213,8 +213,8 @@ XmlElement* PropertySet::createXml (const String& nodeName) const throw() for (int i = 0; i < properties.getAllKeys().size(); ++i) { XmlElement* const e = xml->createNewChildElement ("VALUE"); - e->setAttribute (T("name"), properties.getAllKeys()[i]); - e->setAttribute (T("val"), properties.getAllValues()[i]); + e->setAttribute ("name", properties.getAllKeys()[i]); + e->setAttribute ("val", properties.getAllValues()[i]); } return xml; @@ -225,13 +225,13 @@ void PropertySet::restoreFromXml (const XmlElement& xml) throw() const ScopedLock sl (lock); clear(); - forEachXmlChildElementWithTagName (xml, e, T("VALUE")) + forEachXmlChildElementWithTagName (xml, e, "VALUE") { - if (e->hasAttribute (T("name")) - && e->hasAttribute (T("val"))) + if (e->hasAttribute ("name") + && e->hasAttribute ("val")) { - properties.set (e->getStringAttribute (T("name")), - e->getStringAttribute (T("val"))); + properties.set (e->getStringAttribute ("name"), + e->getStringAttribute ("val")); } } diff --git a/src/containers/juce_Variant.cpp b/src/containers/juce_Variant.cpp index d83b61ab32..f6aa891ad9 100644 --- a/src/containers/juce_Variant.cpp +++ b/src/containers/juce_Variant.cpp @@ -188,7 +188,7 @@ const String var::toString() const { case voidType: return String::empty; case intType: return String (value.intValue); - case boolType: return value.boolValue ? T("1") : T("0"); + case boolType: return String::charToString (value.boolValue ? '1' : '0'); case doubleType: return String (value.doubleValue); case stringType: return *(value.stringValue); case objectType: return "Object 0x" + String::toHexString ((int) (pointer_sized_int) value.objectValue); diff --git a/src/core/juce_FileLogger.cpp b/src/core/juce_FileLogger.cpp index b40539c52b..4e6928bcad 100644 --- a/src/core/juce_FileLogger.cpp +++ b/src/core/juce_FileLogger.cpp @@ -75,7 +75,7 @@ void FileLogger::logMessage (const String& message) DBG (message); const ScopedLock sl (logLock); - (*logStream) << message << T("\r\n"); + (*logStream) << message << "\r\n"; logStream->flush(); } } diff --git a/src/core/juce_RelativeTime.cpp b/src/core/juce_RelativeTime.cpp index 7c26a7e3f6..d18eda0c9b 100644 --- a/src/core/juce_RelativeTime.cpp +++ b/src/core/juce_RelativeTime.cpp @@ -112,7 +112,7 @@ const String RelativeTime::getDescription (const String& returnValueForZeroTime) String result; if (seconds < 0) - result = T("-"); + result = "-"; int fieldsShown = 0; int n = abs ((int) inWeeks()); diff --git a/src/core/juce_RelativeTime.h b/src/core/juce_RelativeTime.h index d0287506a9..13cba24ef2 100644 --- a/src/core/juce_RelativeTime.h +++ b/src/core/juce_RelativeTime.h @@ -146,7 +146,7 @@ public: @see inMilliseconds, inSeconds, inMinutes, inHours, inDays, inWeeks */ - const String getDescription (const String& returnValueForZeroTime = JUCE_T("0")) const throw(); + const String getDescription (const String& returnValueForZeroTime = "0") const throw(); //============================================================================== diff --git a/src/core/juce_Uuid.cpp b/src/core/juce_Uuid.cpp index 78b32686bc..34306699a3 100644 --- a/src/core/juce_Uuid.cpp +++ b/src/core/juce_Uuid.cpp @@ -123,19 +123,19 @@ Uuid& Uuid::operator= (const String& uuidString) { const tchar c = uuidString [i++]; - if (c >= T('0') && c <= T('9')) + if (c >= '0' && c <= '9') { - byte |= c - T('0'); + byte |= c - '0'; break; } - else if (c >= T('a') && c <= T('z')) + else if (c >= 'a' && c <= 'z') { - byte |= c - (T('a') - 10); + byte |= c - ('a' - 10); break; } - else if (c >= T('A') && c <= T('Z')) + else if (c >= 'A' && c <= 'Z') { - byte |= c - (T('A') - 10); + byte |= c - ('A' - 10); break; } else if (c == 0) diff --git a/src/cryptography/juce_RSAKey.cpp b/src/cryptography/juce_RSAKey.cpp index dce5123cd2..fff5542362 100644 --- a/src/cryptography/juce_RSAKey.cpp +++ b/src/cryptography/juce_RSAKey.cpp @@ -39,7 +39,7 @@ RSAKey::RSAKey() RSAKey::RSAKey (const String& s) { - if (s.containsChar (T(','))) + if (s.containsChar (',')) { part1.parseString (s.upToFirstOccurrenceOf (T(","), false, false), 16); part2.parseString (s.fromFirstOccurrenceOf (T(","), false, false), 16); diff --git a/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp b/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp index 0c09b1c009..931378610f 100644 --- a/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp +++ b/src/gui/components/code_editor/juce_CPlusPlusCodeTokeniser.cpp @@ -46,14 +46,14 @@ namespace CppTokeniser static bool isIdentifierStart (const tchar c) throw() { return CharacterFunctions::isLetter (c) - || c == T('_') || c == T('@'); + || c == '_' || c == '@'; } static bool isIdentifierBody (const tchar c) throw() { return CharacterFunctions::isLetter (c) || CharacterFunctions::isDigit (c) - || c == T('_') || c == T('@'); + || c == '_' || c == '@'; } static int parseIdentifier (CodeDocument::Iterator& source) throw() @@ -314,7 +314,7 @@ static void skipComment (CodeDocument::Iterator& source) throw() { const juce_wchar c = source.nextChar(); - if (c == 0 || (c == T('/') && lastWasStar)) + if (c == 0 || (c == '/' && lastWasStar)) break; lastWasStar = (c == '*'); @@ -337,20 +337,20 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source) source.skip(); break; - case T('0'): - case T('1'): - case T('2'): - case T('3'): - case T('4'): - case T('5'): - case T('6'): - case T('7'): - case T('8'): - case T('9'): + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': result = CppTokeniser::parseNumber (source); break; - case T('.'): + case '.': result = CppTokeniser::parseNumber (source); if (result == tokenType_error) @@ -358,41 +358,41 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source) break; - case T(','): - case T(';'): - case T(':'): + case ',': + case ';': + case ':': source.skip(); result = tokenType_punctuation; break; - case T('('): - case T(')'): - case T('{'): - case T('}'): - case T('['): - case T(']'): + case '(': + case ')': + case '{': + case '}': + case '[': + case ']': source.skip(); result = tokenType_bracket; break; - case T('"'): - case T('\''): + case '"': + case '\'': CppTokeniser::skipQuotedString (source); result = tokenType_stringLiteral; break; - case T('+'): + case '+': result = tokenType_operator; source.skip(); - if (source.peekNextChar() == T('+')) + if (source.peekNextChar() == '+') source.skip(); - else if (source.peekNextChar() == T('=')) + else if (source.peekNextChar() == '=') source.skip(); break; - case T('-'): + case '-': source.skip(); result = CppTokeniser::parseNumber (source); @@ -400,39 +400,39 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source) { result = tokenType_operator; - if (source.peekNextChar() == T('-')) + if (source.peekNextChar() == '-') source.skip(); - else if (source.peekNextChar() == T('=')) + else if (source.peekNextChar() == '=') source.skip(); } break; - case T('*'): - case T('%'): - case T('='): - case T('!'): + case '*': + case '%': + case '=': + case '!': result = tokenType_operator; source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); break; - case T('/'): + case '/': result = tokenType_operator; source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('/')) + else if (source.peekNextChar() == '/') { result = tokenType_comment; source.skipToEndOfLine(); } - else if (source.peekNextChar() == T('*')) + else if (source.peekNextChar() == '*') { source.skip(); result = tokenType_comment; @@ -441,103 +441,103 @@ int CPlusPlusCodeTokeniser::readNextToken (CodeDocument::Iterator& source) break; - case T('?'): - case T('~'): + case '?': + case '~': source.skip(); result = tokenType_operator; break; - case T('<'): + case '<': source.skip(); result = tokenType_operator; - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('<')) + else if (source.peekNextChar() == '<') { source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); } break; - case T('>'): + case '>': source.skip(); result = tokenType_operator; - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('<')) + else if (source.peekNextChar() == '<') { source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); } break; - case T('|'): + case '|': source.skip(); result = tokenType_operator; - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('|')) + else if (source.peekNextChar() == '|') { source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); } break; - case T('&'): + case '&': source.skip(); result = tokenType_operator; - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('&')) + else if (source.peekNextChar() == '&') { source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); } break; - case T('^'): + case '^': source.skip(); result = tokenType_operator; - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') { source.skip(); } - else if (source.peekNextChar() == T('^')) + else if (source.peekNextChar() == '^') { source.skip(); - if (source.peekNextChar() == T('=')) + if (source.peekNextChar() == '=') source.skip(); } break; - case T('#'): + case '#': result = tokenType_preprocessor; source.skipToEndOfLine(); break; diff --git a/src/gui/components/code_editor/juce_CodeDocument.cpp b/src/gui/components/code_editor/juce_CodeDocument.cpp index ed6009e5f5..7f5c45da76 100644 --- a/src/gui/components/code_editor/juce_CodeDocument.cpp +++ b/src/gui/components/code_editor/juce_CodeDocument.cpp @@ -61,12 +61,12 @@ public: while (t[pos] != 0) { - if (t[pos] == T('\r')) + if (t[pos] == '\r') { ++numNewLineChars; ++pos; - if (t[pos] == T('\n')) + if (t[pos] == '\n') { ++numNewLineChars; ++pos; @@ -75,7 +75,7 @@ public: break; } - if (t[pos] == T('\n')) + if (t[pos] == '\n') { ++numNewLineChars; ++pos; @@ -567,7 +567,7 @@ bool CodeDocument::writeToStream (OutputStream& stream) void CodeDocument::setNewLineCharacters (const String& newLine) throw() { - jassert (newLine == T("\r\n") || newLine == T("\n") || newLine == T("\r")); + jassert (newLine == "\r\n" || newLine == "\n" || newLine == "\r"); newLineChars = newLine; } @@ -617,8 +617,8 @@ const CodeDocument::Position CodeDocument::findWordBreakAfter (const Position& p while (i < maxDistance && CharacterFunctions::isWhitespace (p.getCharacter()) - && (i == 0 || (p.getCharacter() != T('\n') - && p.getCharacter() != T('\r')))) + && (i == 0 || (p.getCharacter() != '\n' + && p.getCharacter() != '\r'))) { ++i; p.moveBy (1); @@ -636,8 +636,8 @@ const CodeDocument::Position CodeDocument::findWordBreakAfter (const Position& p while (i < maxDistance && CharacterFunctions::isWhitespace (p.getCharacter()) - && (i == 0 || (p.getCharacter() != T('\n') - && p.getCharacter() != T('\r')))) + && (i == 0 || (p.getCharacter() != '\n' + && p.getCharacter() != '\r'))) { ++i; p.moveBy (1); @@ -658,7 +658,7 @@ const CodeDocument::Position CodeDocument::findWordBreakBefore (const Position& { const tchar c = p.movedBy (-1).getCharacter(); - if (c == T('\r') || c == T('\n')) + if (c == '\r' || c == '\n') { stoppedAtLineStart = true; diff --git a/src/gui/components/code_editor/juce_CodeEditorComponent.cpp b/src/gui/components/code_editor/juce_CodeEditorComponent.cpp index e6bc35f06c..5339c193cc 100644 --- a/src/gui/components/code_editor/juce_CodeEditorComponent.cpp +++ b/src/gui/components/code_editor/juce_CodeEditorComponent.cpp @@ -245,7 +245,7 @@ private: for (;;) { - int tabPos = t.text.indexOfChar (T('\t')); + int tabPos = t.text.indexOfChar ('\t'); if (tabPos < 0) break; @@ -264,7 +264,7 @@ private: int col = 0; for (int i = 0; i < index; ++i) { - if (line[i] != T('\t')) + if (line[i] != '\t') ++col; else col += spacesPerTab - (col % spacesPerTab); @@ -636,7 +636,7 @@ void CodeEditorComponent::insertTabAtCaret() } else { - insertTextAtCaret (T("\t")); + insertTextAtCaret ("\t"); } } @@ -952,28 +952,28 @@ bool CodeEditorComponent::keyPressed (const KeyPress& key) { deleteForward (moveInWholeWordSteps); } - else if (key == KeyPress (T('c'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('c', ModifierKeys::commandModifier, 0)) { copy(); } - else if (key == KeyPress (T('x'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('x', ModifierKeys::commandModifier, 0)) { copyThenCut(); } - else if (key == KeyPress (T('v'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('v', ModifierKeys::commandModifier, 0)) { paste(); } - else if (key == KeyPress (T('z'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('z', ModifierKeys::commandModifier, 0)) { undo(); } - else if (key == KeyPress (T('y'), ModifierKeys::commandModifier, 0) - || key == KeyPress (T('z'), ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)) + else if (key == KeyPress ('y', ModifierKeys::commandModifier, 0) + || key == KeyPress ('z', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)) { redo(); } - else if (key == KeyPress (T('a'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('a', ModifierKeys::commandModifier, 0)) { selectAll(); } @@ -1098,7 +1098,7 @@ int CodeEditorComponent::indexToColumn (int lineNum, int index) const throw() int col = 0; for (int i = 0; i < index; ++i) { - if (line[i] != T('\t')) + if (line[i] != '\t') ++col; else col += getTabSize() - (col % getTabSize()); @@ -1115,7 +1115,7 @@ int CodeEditorComponent::columnToIndex (int lineNum, int column) const throw() int i, col = 0; for (i = 0; i < lineLength; ++i) { - if (line[i] != T('\t')) + if (line[i] != '\t') ++col; else col += getTabSize() - (col % getTabSize()); @@ -1131,7 +1131,7 @@ int CodeEditorComponent::columnToIndex (int lineNum, int column) const throw() void CodeEditorComponent::setFont (const Font& newFont) { font = newFont; - charWidth = font.getStringWidthFloat (T("0")); + charWidth = font.getStringWidthFloat ("0"); lineHeight = roundToInt (font.getHeight()); resized(); } diff --git a/src/gui/components/controls/juce_ListBox.cpp b/src/gui/components/controls/juce_ListBox.cpp index 0aa46f08b3..15d0bf1611 100644 --- a/src/gui/components/controls/juce_ListBox.cpp +++ b/src/gui/components/controls/juce_ListBox.cpp @@ -767,7 +767,7 @@ bool ListBox::keyPressed (const KeyPress& key) if (model != 0) model->deleteKeyPressed (lastRowSelected); } - else if (multiple && key == KeyPress (T('a'), ModifierKeys::commandModifier, 0)) + else if (multiple && key == KeyPress ('a', ModifierKeys::commandModifier, 0)) { selectRangeOfRows (0, std::numeric_limits::max()); } diff --git a/src/gui/components/controls/juce_ProgressBar.cpp b/src/gui/components/controls/juce_ProgressBar.cpp index 09804e2836..bd16ecee3f 100644 --- a/src/gui/components/controls/juce_ProgressBar.cpp +++ b/src/gui/components/controls/juce_ProgressBar.cpp @@ -74,7 +74,7 @@ void ProgressBar::paint (Graphics& g) if (displayPercentage) { if (currentValue >= 0 && currentValue <= 1.0) - text << roundToInt (currentValue * 100.0) << T("%"); + text << roundToInt (currentValue * 100.0) << '%'; } else { diff --git a/src/gui/components/controls/juce_Slider.cpp b/src/gui/components/controls/juce_Slider.cpp index 69608b9364..301035191c 100644 --- a/src/gui/components/controls/juce_Slider.cpp +++ b/src/gui/components/controls/juce_Slider.cpp @@ -647,7 +647,7 @@ double Slider::getValueFromText (const String& text) if (t.endsWith (textSuffix)) t = t.substring (0, t.length() - textSuffix.length()); - while (t.startsWithChar (T('+'))) + while (t.startsWithChar ('+')) t = t.substring (1).trimStart(); return t.initialSectionContainingOnly (T("0123456789.,-")) diff --git a/src/gui/components/controls/juce_TextEditor.cpp b/src/gui/components/controls/juce_TextEditor.cpp index 52e058cdae..d00ba75f0b 100644 --- a/src/gui/components/controls/juce_TextEditor.cpp +++ b/src/gui/components/controls/juce_TextEditor.cpp @@ -47,7 +47,7 @@ struct TextAtom //============================================================================== bool isWhitespace() const { return CharacterFunctions::isWhitespace (atomText[0]); } - bool isNewLine() const { return atomText[0] == T('\r') || atomText[0] == T('\n'); } + bool isNewLine() const { return atomText[0] == '\r' || atomText[0] == '\n'; } const String getText (const tchar passwordCharacter) const { @@ -285,30 +285,30 @@ private: // create a whitespace atom unless it starts with non-ws if (CharacterFunctions::isWhitespace (text[i]) - && text[i] != T('\r') - && text[i] != T('\n')) + && text[i] != '\r' + && text[i] != '\n') { while (i < len && CharacterFunctions::isWhitespace (text[i]) - && text[i] != T('\r') - && text[i] != T('\n')) + && text[i] != '\r' + && text[i] != '\n') { ++i; } } else { - if (text[i] == T('\r')) + if (text[i] == '\r') { ++i; - if ((i < len) && (text[i] == T('\n'))) + if ((i < len) && (text[i] == '\n')) { ++start; ++i; } } - else if (text[i] == T('\n')) + else if (text[i] == '\n') { ++i; } @@ -1585,7 +1585,7 @@ void TextEditor::insertTextAtCaret (const String& newText_) if (allowedCharacters.isNotEmpty()) newText = newText.retainCharacters (allowedCharacters); - if ((! returnKeyStartsNewLine) && newText == T("\n")) + if ((! returnKeyStartsNewLine) && newText == "\n") { returnPressed(); return; @@ -1847,7 +1847,7 @@ void TextEditor::mouseDoubleClick (const MouseEvent& e) { while (tokenEnd < totalLength) { - if (t [tokenEnd] != T('\r') && t [tokenEnd] != T('\n')) + if (t [tokenEnd] != '\r' && t [tokenEnd] != '\n') ++tokenEnd; else break; @@ -1855,7 +1855,7 @@ void TextEditor::mouseDoubleClick (const MouseEvent& e) while (tokenStart > 0) { - if (t [tokenStart - 1] != T('\r') && t [tokenStart - 1] != T('\n')) + if (t [tokenStart - 1] != '\r' && t [tokenStart - 1] != '\n') --tokenStart; else break; @@ -1876,7 +1876,7 @@ void TextEditor::mouseWheelMove (const MouseEvent& e, float wheelIncrementX, flo //============================================================================== bool TextEditor::keyPressed (const KeyPress& key) { - if (isReadOnly() && key != KeyPress (T('c'), ModifierKeys::commandModifier, 0)) + if (isReadOnly() && key != KeyPress ('c', ModifierKeys::commandModifier, 0)) return false; const bool moveInWholeWordSteps = key.getModifiers().isCtrlDown() || key.getModifiers().isAltDown(); @@ -1971,35 +1971,35 @@ bool TextEditor::keyPressed (const KeyPress& key) cut(); } - else if (key == KeyPress (T('c'), ModifierKeys::commandModifier, 0) + else if (key == KeyPress ('c', ModifierKeys::commandModifier, 0) || key == KeyPress (KeyPress::insertKey, ModifierKeys::ctrlModifier, 0)) { newTransaction(); copy(); } - else if (key == KeyPress (T('x'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('x', ModifierKeys::commandModifier, 0)) { newTransaction(); copy(); cut(); } - else if (key == KeyPress (T('v'), ModifierKeys::commandModifier, 0) + else if (key == KeyPress ('v', ModifierKeys::commandModifier, 0) || key == KeyPress (KeyPress::insertKey, ModifierKeys::shiftModifier, 0)) { newTransaction(); paste(); } - else if (key == KeyPress (T('z'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('z', ModifierKeys::commandModifier, 0)) { newTransaction(); doUndoRedo (false); } - else if (key == KeyPress (T('y'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('y', ModifierKeys::commandModifier, 0)) { newTransaction(); doUndoRedo (true); } - else if (key == KeyPress (T('a'), ModifierKeys::commandModifier, 0)) + else if (key == KeyPress ('a', ModifierKeys::commandModifier, 0)) { newTransaction(); moveCursorTo (getTotalNumChars(), false); @@ -2008,7 +2008,7 @@ bool TextEditor::keyPressed (const KeyPress& key) else if (key == KeyPress::returnKey) { newTransaction(); - insertTextAtCaret (T("\n")); + insertTextAtCaret ("\n"); } else if (key.isKeyCode (KeyPress::escapeKey)) { diff --git a/src/gui/components/controls/juce_Toolbar.cpp b/src/gui/components/controls/juce_Toolbar.cpp index dfeb4b30b4..458534687b 100644 --- a/src/gui/components/controls/juce_Toolbar.cpp +++ b/src/gui/components/controls/juce_Toolbar.cpp @@ -420,10 +420,10 @@ void Toolbar::setStyle (const ToolbarItemStyle& newStyle) const String Toolbar::toString() const { - String s (T("TB:")); + String s ("TB:"); for (int i = 0; i < getNumItems(); ++i) - s << getItemId(i) << T(' '); + s << getItemId(i) << ' '; return s.trimEnd(); } diff --git a/src/gui/components/controls/juce_TreeView.cpp b/src/gui/components/controls/juce_TreeView.cpp index 1b59f76bfd..032d9c5335 100644 --- a/src/gui/components/controls/juce_TreeView.cpp +++ b/src/gui/components/controls/juce_TreeView.cpp @@ -583,7 +583,7 @@ XmlElement* TreeView::getOpennessState (const bool alsoIncludeScrollPosition) co e = rootItem->getOpennessState(); if (e != 0 && alsoIncludeScrollPosition) - e->setAttribute (T("scrollPos"), viewport->getViewPositionY()); + e->setAttribute ("scrollPos", viewport->getViewPositionY()); } return e; @@ -595,9 +595,9 @@ void TreeView::restoreOpennessState (const XmlElement& newState) { rootItem->restoreOpennessState (newState); - if (newState.hasAttribute (T("scrollPos"))) + if (newState.hasAttribute ("scrollPos")) viewport->setViewPosition (viewport->getViewPositionX(), - newState.getIntAttribute (T("scrollPos"))); + newState.getIntAttribute ("scrollPos")); } } @@ -1699,7 +1699,7 @@ const String TreeViewItem::getItemIdentifierString() const if (parentItem != 0) s = parentItem->getItemIdentifierString(); - return s + T("/") + getUniqueName().replaceCharacter (T('/'), T('\\')); + return s + "/" + getUniqueName().replaceCharacter ('/', '\\'); } TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifierString) @@ -1709,7 +1709,7 @@ TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifi if (uid == identifierString) return this; - if (identifierString.startsWith (uid + T("/"))) + if (identifierString.startsWith (uid + "/")) { const String remainingPath (identifierString.substring (uid.length() + 1)); @@ -1732,17 +1732,17 @@ TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifi void TreeViewItem::restoreOpennessState (const XmlElement& e) throw() { - if (e.hasTagName (T("CLOSED"))) + if (e.hasTagName ("CLOSED")) { setOpen (false); } - else if (e.hasTagName (T("OPEN"))) + else if (e.hasTagName ("OPEN")) { setOpen (true); forEachXmlChildElement (e, n) { - const String id (n->getStringAttribute (T("id"))); + const String id (n->getStringAttribute ("id")); for (int i = 0; i < subItems.size(); ++i) { @@ -1768,17 +1768,17 @@ XmlElement* TreeViewItem::getOpennessState() const throw() if (isOpen()) { - e = new XmlElement (T("OPEN")); + e = new XmlElement ("OPEN"); for (int i = 0; i < subItems.size(); ++i) e->addChildElement (subItems.getUnchecked(i)->getOpennessState()); } else { - e = new XmlElement (T("CLOSED")); + e = new XmlElement ("CLOSED"); } - e->setAttribute (T("id"), name); + e->setAttribute ("id", name); return e; } diff --git a/src/gui/components/filebrowser/juce_DirectoryContentsList.cpp b/src/gui/components/filebrowser/juce_DirectoryContentsList.cpp index ead0b89ed5..ab35f49d8f 100644 --- a/src/gui/components/filebrowser/juce_DirectoryContentsList.cpp +++ b/src/gui/components/filebrowser/juce_DirectoryContentsList.cpp @@ -121,7 +121,7 @@ void DirectoryContentsList::refresh() jassert (fileFindHandle == 0); - fileFindHandle = juce_findFileStart (path, T("*"), fileFound, + fileFindHandle = juce_findFileStart (path, "*", fileFound, &fileFoundIsDir, &isHidden, &fileSize, @@ -265,8 +265,8 @@ bool DirectoryContentsList::addFile (const String& filename, const Time& creationTime, const bool isReadOnly) { - if (filename == T("..") - || filename == T(".") + if (filename == ".." + || filename == "." || (ignoreHiddenFiles && isHidden)) return false; diff --git a/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp b/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp index 1bfeec644a..1e96ba6ec8 100644 --- a/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileBrowserComponent.cpp @@ -333,7 +333,7 @@ void FileBrowserComponent::selectionChanged() } if (newFilenames.size() > 0) - filenameBox->setText (newFilenames.joinIntoString (T(", ")), false); + filenameBox->setText (newFilenames.joinIntoString (", "), false); sendListenerChangeMessage(); } @@ -516,7 +516,7 @@ const BigInteger FileBrowserComponent::getRoots (StringArray& rootNames, StringA { const File& volume = volumes.getReference(i); - if (volume.isDirectory() && ! volume.getFileName().startsWithChar (T('.'))) + if (volume.isDirectory() && ! volume.getFileName().startsWithChar ('.')) { rootPaths.add (volume.getFullPathName()); rootNames.add (volume.getFileName()); diff --git a/src/gui/components/filebrowser/juce_FileChooser.cpp b/src/gui/components/filebrowser/juce_FileChooser.cpp index 47d1ab5c56..c610ac13b3 100644 --- a/src/gui/components/filebrowser/juce_FileChooser.cpp +++ b/src/gui/components/filebrowser/juce_FileChooser.cpp @@ -49,7 +49,7 @@ FileChooser::FileChooser (const String& chooserBoxTitle, #endif if (! fileFilters.containsNonWhitespaceChars()) - filters = T("*"); + filters = "*"; } FileChooser::~FileChooser() diff --git a/src/gui/components/filebrowser/juce_FileChooserDialogBox.cpp b/src/gui/components/filebrowser/juce_FileChooserDialogBox.cpp index 2262c63612..c68255b959 100644 --- a/src/gui/components/filebrowser/juce_FileChooserDialogBox.cpp +++ b/src/gui/components/filebrowser/juce_FileChooserDialogBox.cpp @@ -106,9 +106,9 @@ void FileChooserDialogBox::buttonClicked (Button* button) { if (! AlertWindow::showOkCancelBox (AlertWindow::WarningIcon, TRANS("File already exists"), - TRANS("There's already a file called:\n\n") - + content->chooserComponent->getSelectedFile(0).getFullPathName() - + T("\n\nAre you sure you want to overwrite it?"), + TRANS("There's already a file called:") + + "\n\n" + content->chooserComponent->getSelectedFile(0).getFullPathName() + + "\n\n" + TRANS("Are you sure you want to overwrite it?"), TRANS("overwrite"), TRANS("cancel"))) { diff --git a/src/gui/components/filebrowser/juce_FileChooserDialogBox.h b/src/gui/components/filebrowser/juce_FileChooserDialogBox.h index f360974f7b..0e3cfadf90 100644 --- a/src/gui/components/filebrowser/juce_FileChooserDialogBox.h +++ b/src/gui/components/filebrowser/juce_FileChooserDialogBox.h @@ -43,15 +43,15 @@ @code { - WildcardFileFilter wildcardFilter (T("*.foo"), T("Foo files")); + WildcardFileFilter wildcardFilter ("*.foo", "Foo files"); FileBrowserComponent browser (FileBrowserComponent::loadFileMode, File::nonexistent, &wildcardFilter, 0); - FileChooserDialogBox dialogBox (T("Open some kind of file"), - T("Please choose some kind of file that you want to open..."), + FileChooserDialogBox dialogBox ("Open some kind of file", + "Please choose some kind of file that you want to open...", browser, getLookAndFeel().alertWindowBackground); diff --git a/src/gui/components/filebrowser/juce_FileListComponent.cpp b/src/gui/components/filebrowser/juce_FileListComponent.cpp index b5b9c39571..78fd2d504d 100644 --- a/src/gui/components/filebrowser/juce_FileListComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileListComponent.cpp @@ -206,7 +206,7 @@ private: { if (icon == 0) { - const int hashCode = (file.getFullPathName() + T("_iconCacheSalt")).hashCode(); + const int hashCode = (file.getFullPathName() + "_iconCacheSalt").hashCode(); Image* im = ImageCache::getFromHashCode (hashCode); if (im == 0 && ! onlyUpdateIfCached) diff --git a/src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp b/src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp index d7fcba53b7..a16912ffdb 100644 --- a/src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileSearchPathListComponent.cpp @@ -153,7 +153,7 @@ void FileSearchPathListComponent::deleteKeyPressed (int row) void FileSearchPathListComponent::returnKeyPressed (int row) { - FileChooser chooser (TRANS("Change folder..."), path [row], T("*")); + FileChooser chooser (TRANS("Change folder..."), path [row], "*"); if (chooser.browseForDirectory()) { @@ -234,7 +234,7 @@ void FileSearchPathListComponent::buttonClicked (Button* button) if (start == File::nonexistent) start = File::getCurrentWorkingDirectory(); - FileChooser chooser (TRANS("Add a folder..."), start, T("*")); + FileChooser chooser (TRANS("Add a folder..."), start, "*"); if (chooser.browseForDirectory()) { diff --git a/src/gui/components/filebrowser/juce_FileTreeComponent.cpp b/src/gui/components/filebrowser/juce_FileTreeComponent.cpp index b5f931d81e..6b63464d14 100644 --- a/src/gui/components/filebrowser/juce_FileTreeComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileTreeComponent.cpp @@ -207,7 +207,7 @@ private: { if (icon == 0) { - const int hashCode = (file.getFullPathName() + T("_iconCacheSalt")).hashCode(); + const int hashCode = (file.getFullPathName() + "_iconCacheSalt").hashCode(); Image* im = ImageCache::getFromHashCode (hashCode); if (im == 0 && ! onlyUpdateIfCached) diff --git a/src/gui/components/filebrowser/juce_FilenameComponent.cpp b/src/gui/components/filebrowser/juce_FilenameComponent.cpp index a20ad75877..ad8e002d05 100644 --- a/src/gui/components/filebrowser/juce_FilenameComponent.cpp +++ b/src/gui/components/filebrowser/juce_FilenameComponent.cpp @@ -50,14 +50,14 @@ FilenameComponent::FilenameComponent (const String& name, wildcard (fileBrowserWildcard), enforcedSuffix (enforcedSuffix_) { - addAndMakeVisible (filenameBox = new ComboBox (T("fn"))); + addAndMakeVisible (filenameBox = new ComboBox ("fn")); filenameBox->setEditableText (canEditFilename); filenameBox->addListener (this); filenameBox->setTextWhenNothingSelected (textWhenNothingSelected); filenameBox->setTextWhenNoChoicesAvailable (TRANS("(no recently seleced files)")); browseButton = 0; - setBrowseButtonText (T("...")); + setBrowseButtonText ("..."); setCurrentFile (currentFile, true); } diff --git a/src/gui/components/filebrowser/juce_WildcardFileFilter.cpp b/src/gui/components/filebrowser/juce_WildcardFileFilter.cpp index fd492cbe8e..298519927c 100644 --- a/src/gui/components/filebrowser/juce_WildcardFileFilter.cpp +++ b/src/gui/components/filebrowser/juce_WildcardFileFilter.cpp @@ -35,7 +35,7 @@ WildcardFileFilter::WildcardFileFilter (const String& fileWildcardPatterns, const String& directoryWildcardPatterns, const String& description_) : FileFilter (description_.isEmpty() ? fileWildcardPatterns - : (description_ + T(" (") + fileWildcardPatterns + T(")"))) + : (description_ + " (" + fileWildcardPatterns + ")")) { parse (fileWildcardPatterns, fileWildcards); parse (directoryWildcardPatterns, directoryWildcards); @@ -58,7 +58,7 @@ bool WildcardFileFilter::isDirectorySuitable (const File& file) const //============================================================================== void WildcardFileFilter::parse (const String& pattern, StringArray& result) throw() { - result.addTokens (pattern.toLowerCase(), T(";,"), T("\"'")); + result.addTokens (pattern.toLowerCase(), ";,", "\"'"); result.trim(); result.removeEmptyStrings(); @@ -66,8 +66,8 @@ void WildcardFileFilter::parse (const String& pattern, StringArray& result) thro // special case for *.*, because people use it to mean "any file", but it // would actually ignore files with no extension. for (int i = result.size(); --i >= 0;) - if (result[i] == T("*.*")) - result.set (i, T("*")); + if (result[i] == "*.*") + result.set (i, "*"); } bool WildcardFileFilter::match (const File& file, const StringArray& wildcards) throw() diff --git a/src/gui/components/juce_Component.cpp b/src/gui/components/juce_Component.cpp index b805de63a4..88c0870c73 100644 --- a/src/gui/components/juce_Component.cpp +++ b/src/gui/components/juce_Component.cpp @@ -1784,7 +1784,7 @@ static const var::identifier getColourPropertyId (const int colourId) { String s; s.preallocateStorage (18); - s << T("jcclr_") << String::toHexString (colourId); + s << "jcclr_" << String::toHexString (colourId); return s; } diff --git a/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp b/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp index 09a69bab65..71cea48f27 100644 --- a/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp +++ b/src/gui/components/keyboard/juce_KeyMappingEditorComponent.cpp @@ -331,7 +331,7 @@ bool KeyMappingEditorComponent::mightContainSubItems() const String KeyMappingEditorComponent::getUniqueName() const { - return T("keys"); + return "keys"; } void KeyMappingEditorComponent::setColours (const Colour& mainBackground, diff --git a/src/gui/components/keyboard/juce_KeyPress.cpp b/src/gui/components/keyboard/juce_KeyPress.cpp index 72a20e5df7..da4276f184 100644 --- a/src/gui/components/keyboard/juce_KeyPress.cpp +++ b/src/gui/components/keyboard/juce_KeyPress.cpp @@ -96,36 +96,39 @@ bool KeyPress::isCurrentlyDown() const throw() } //============================================================================== -struct KeyNameAndCode +namespace KeyPressHelpers { - const char* name; - int code; -}; + struct KeyNameAndCode + { + const char* name; + int code; + }; -static const KeyNameAndCode keyNameTranslations[] = -{ - { "spacebar", KeyPress::spaceKey }, - { "return", KeyPress::returnKey }, - { "escape", KeyPress::escapeKey }, - { "backspace", KeyPress::backspaceKey }, - { "cursor left", KeyPress::leftKey }, - { "cursor right", KeyPress::rightKey }, - { "cursor up", KeyPress::upKey }, - { "cursor down", KeyPress::downKey }, - { "page up", KeyPress::pageUpKey }, - { "page down", KeyPress::pageDownKey }, - { "home", KeyPress::homeKey }, - { "end", KeyPress::endKey }, - { "delete", KeyPress::deleteKey }, - { "insert", KeyPress::insertKey }, - { "tab", KeyPress::tabKey }, - { "play", KeyPress::playKey }, - { "stop", KeyPress::stopKey }, - { "fast forward", KeyPress::fastForwardKey }, - { "rewind", KeyPress::rewindKey } -}; + static const KeyNameAndCode translations[] = + { + { "spacebar", KeyPress::spaceKey }, + { "return", KeyPress::returnKey }, + { "escape", KeyPress::escapeKey }, + { "backspace", KeyPress::backspaceKey }, + { "cursor left", KeyPress::leftKey }, + { "cursor right", KeyPress::rightKey }, + { "cursor up", KeyPress::upKey }, + { "cursor down", KeyPress::downKey }, + { "page up", KeyPress::pageUpKey }, + { "page down", KeyPress::pageDownKey }, + { "home", KeyPress::homeKey }, + { "end", KeyPress::endKey }, + { "delete", KeyPress::deleteKey }, + { "insert", KeyPress::insertKey }, + { "tab", KeyPress::tabKey }, + { "play", KeyPress::playKey }, + { "stop", KeyPress::stopKey }, + { "fast forward", KeyPress::fastForwardKey }, + { "rewind", KeyPress::rewindKey } + }; -static const tchar* const numberPadPrefix = T("numpad "); + static const String numberPadPrefix() { return "numpad "; } +} //============================================================================== const KeyPress KeyPress::createFromDescription (const String& desc) throw() @@ -151,11 +154,11 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw() int key = 0; - for (int i = 0; i < numElementsInArray (keyNameTranslations); ++i) + for (int i = 0; i < numElementsInArray (KeyPressHelpers::translations); ++i) { - if (desc.containsWholeWordIgnoreCase (String (keyNameTranslations[i].name))) + if (desc.containsWholeWordIgnoreCase (String (KeyPressHelpers::translations[i].name))) { - key = keyNameTranslations[i].code; + key = KeyPressHelpers::translations[i].code; break; } } @@ -163,23 +166,23 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw() if (key == 0) { // see if it's a numpad key.. - if (desc.containsIgnoreCase (numberPadPrefix)) + if (desc.containsIgnoreCase (KeyPressHelpers::numberPadPrefix())) { const tchar lastChar = desc.trimEnd().getLastCharacter(); - if (lastChar >= T('0') && lastChar <= T('9')) - key = numberPad0 + lastChar - T('0'); - else if (lastChar == T('+')) + if (lastChar >= '0' && lastChar <= '9') + key = numberPad0 + lastChar - '0'; + else if (lastChar == '+') key = numberPadAdd; - else if (lastChar == T('-')) + else if (lastChar == '-') key = numberPadSubtract; - else if (lastChar == T('*')) + else if (lastChar == '*') key = numberPadMultiply; - else if (lastChar == T('/')) + else if (lastChar == '/') key = numberPadDivide; - else if (lastChar == T('.')) + else if (lastChar == '.') key = numberPadDecimalPoint; - else if (lastChar == T('=')) + else if (lastChar == '=') key = numberPadEquals; else if (desc.endsWith (T("separator"))) key = numberPadSeparator; @@ -191,7 +194,7 @@ const KeyPress KeyPress::createFromDescription (const String& desc) throw() { // see if it's a function key.. for (int i = 1; i <= 12; ++i) - if (desc.containsWholeWordIgnoreCase (T("f") + String (i))) + if (desc.containsWholeWordIgnoreCase ("f" + String (i))) key = F1Key + i - 1; if (key == 0) @@ -221,7 +224,7 @@ const String KeyPress::getTextDescription() const throw() { // some keyboard layouts use a shift-key to get the slash, but in those cases, we // want to store it as being a slash, not shift+whatever. - if (textCharacter == T('/')) + if (textCharacter == '/') return "/"; if (mods.isCtrlDown()) @@ -243,30 +246,30 @@ const String KeyPress::getTextDescription() const throw() desc << "alt + "; #endif - for (int i = 0; i < numElementsInArray (keyNameTranslations); ++i) - if (keyCode == keyNameTranslations[i].code) - return desc + keyNameTranslations[i].name; + for (int i = 0; i < numElementsInArray (KeyPressHelpers::translations); ++i) + if (keyCode == KeyPressHelpers::translations[i].code) + return desc + KeyPressHelpers::translations[i].name; if (keyCode >= F1Key && keyCode <= F16Key) desc << 'F' << (1 + keyCode - F1Key); else if (keyCode >= numberPad0 && keyCode <= numberPad9) - desc << numberPadPrefix << (keyCode - numberPad0); + desc << KeyPressHelpers::numberPadPrefix() << (keyCode - numberPad0); else if (keyCode >= 33 && keyCode < 176) desc += CharacterFunctions::toUpperCase ((tchar) keyCode); else if (keyCode == numberPadAdd) - desc << numberPadPrefix << '+'; + desc << KeyPressHelpers::numberPadPrefix() << '+'; else if (keyCode == numberPadSubtract) - desc << numberPadPrefix << '-'; + desc << KeyPressHelpers::numberPadPrefix() << '-'; else if (keyCode == numberPadMultiply) - desc << numberPadPrefix << '*'; + desc << KeyPressHelpers::numberPadPrefix() << '*'; else if (keyCode == numberPadDivide) - desc << numberPadPrefix << '/'; + desc << KeyPressHelpers::numberPadPrefix() << '/'; else if (keyCode == numberPadSeparator) - desc << numberPadPrefix << "separator"; + desc << KeyPressHelpers::numberPadPrefix() << "separator"; else if (keyCode == numberPadDecimalPoint) - desc << numberPadPrefix << '.'; + desc << KeyPressHelpers::numberPadPrefix() << '.'; else if (keyCode == numberPadDelete) - desc << numberPadPrefix << "delete"; + desc << KeyPressHelpers::numberPadPrefix() << "delete"; else desc << '#' << String::toHexString (keyCode); } diff --git a/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp b/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp index e591439a31..ce35300252 100644 --- a/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp +++ b/src/gui/components/keyboard/juce_KeyPressMappingSet.cpp @@ -233,9 +233,9 @@ void KeyPressMappingSet::invokeCommand (const CommandID commandID, //============================================================================== bool KeyPressMappingSet::restoreFromXml (const XmlElement& xmlVersion) { - if (xmlVersion.hasTagName (T("KEYMAPPINGS"))) + if (xmlVersion.hasTagName ("KEYMAPPINGS")) { - if (xmlVersion.getBoolAttribute (T("basedOnDefaults"), true)) + if (xmlVersion.getBoolAttribute ("basedOnDefaults", true)) { // if the XML was created as a set of differences from the default mappings, // (i.e. by calling createXml (true)), then we need to first restore the defaults. @@ -250,17 +250,17 @@ bool KeyPressMappingSet::restoreFromXml (const XmlElement& xmlVersion) forEachXmlChildElement (xmlVersion, map) { - const CommandID commandId = map->getStringAttribute (T("commandId")).getHexValue32(); + const CommandID commandId = map->getStringAttribute ("commandId").getHexValue32(); if (commandId != 0) { - const KeyPress key (KeyPress::createFromDescription (map->getStringAttribute (T("key")))); + const KeyPress key (KeyPress::createFromDescription (map->getStringAttribute ("key"))); - if (map->hasTagName (T("MAPPING"))) + if (map->hasTagName ("MAPPING")) { addKeyPress (commandId, key); } - else if (map->hasTagName (T("UNMAPPING"))) + else if (map->hasTagName ("UNMAPPING")) { if (containsMapping (commandId, key)) removeKeyPress (key); @@ -284,9 +284,9 @@ XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefault defaultSet->resetToDefaultMappings(); } - XmlElement* const doc = new XmlElement (T("KEYMAPPINGS")); + XmlElement* const doc = new XmlElement ("KEYMAPPINGS"); - doc->setAttribute (T("basedOnDefaults"), saveDifferencesFromDefaultSet); + doc->setAttribute ("basedOnDefaults", saveDifferencesFromDefaultSet); int i; for (i = 0; i < mappings.size(); ++i) @@ -300,9 +300,9 @@ XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefault { XmlElement* const map = doc->createNewChildElement ("MAPPING"); - map->setAttribute (T("commandId"), String::toHexString ((int) cm->commandID)); - map->setAttribute (T("description"), commandManager->getDescriptionOfCommand (cm->commandID)); - map->setAttribute (T("key"), cm->keypresses.getReference (j).getTextDescription()); + map->setAttribute ("commandId", String::toHexString ((int) cm->commandID)); + map->setAttribute ("description", commandManager->getDescriptionOfCommand (cm->commandID)); + map->setAttribute ("key", cm->keypresses.getReference (j).getTextDescription()); } } } @@ -319,9 +319,9 @@ XmlElement* KeyPressMappingSet::createXml (const bool saveDifferencesFromDefault { XmlElement* const map = doc->createNewChildElement ("UNMAPPING"); - map->setAttribute (T("commandId"), String::toHexString ((int) cm->commandID)); - map->setAttribute (T("description"), commandManager->getDescriptionOfCommand (cm->commandID)); - map->setAttribute (T("key"), cm->keypresses.getReference (j).getTextDescription()); + map->setAttribute ("commandId", String::toHexString ((int) cm->commandID)); + map->setAttribute ("description", commandManager->getDescriptionOfCommand (cm->commandID)); + map->setAttribute ("key", cm->keypresses.getReference (j).getTextDescription()); } } } diff --git a/src/gui/components/lookandfeel/juce_LookAndFeel.cpp b/src/gui/components/lookandfeel/juce_LookAndFeel.cpp index d810d26ee9..cdf1163a0f 100644 --- a/src/gui/components/lookandfeel/juce_LookAndFeel.cpp +++ b/src/gui/components/lookandfeel/juce_LookAndFeel.cpp @@ -87,15 +87,6 @@ static const Colour createBaseColour (const Colour& buttonColour, return baseColour; } -//============================================================================== -static String defaultSansName, defaultSerifName, defaultFixedName; - -void clearUpDefaultFontNames() throw() -{ - defaultSansName = String::empty; - defaultSerifName = String::empty; - defaultFixedName = String::empty; -} //============================================================================== LookAndFeel::LookAndFeel() @@ -234,6 +225,8 @@ LookAndFeel::LookAndFeel() for (int i = 0; i < numElementsInArray (standardColours); i += 2) setColour (standardColours [i], Colour (standardColours [i + 1])); + static String defaultSansName, defaultSerifName, defaultFixedName; + if (defaultSansName.isEmpty()) Font::getPlatformDefaultFontNames (defaultSansName, defaultSerifName, defaultFixedName); @@ -2381,7 +2374,7 @@ Button* LookAndFeel::createTabBarExtrasButton() overImage.insertDrawable (ellipse); overImage.insertDrawable (dp); - DrawableButton* db = new DrawableButton (T("tabs"), DrawableButton::ImageFitted); + DrawableButton* db = new DrawableButton ("tabs", DrawableButton::ImageFitted); db->setImages (&normalImage, &overImage, 0); return db; } diff --git a/src/gui/components/menus/juce_PopupMenu.cpp b/src/gui/components/menus/juce_PopupMenu.cpp index 35aade0ff7..ece16d5667 100644 --- a/src/gui/components/menus/juce_PopupMenu.cpp +++ b/src/gui/components/menus/juce_PopupMenu.cpp @@ -264,7 +264,7 @@ class PopupMenu::Window : public Component, public: //============================================================================== Window() - : Component (T("menu")), + : Component ("menu"), owner (0), currentChild (0), activeSubMenu (0), diff --git a/src/gui/components/properties/juce_PropertyPanel.cpp b/src/gui/components/properties/juce_PropertyPanel.cpp index 7934679c24..ac3b3e0ab7 100644 --- a/src/gui/components/properties/juce_PropertyPanel.cpp +++ b/src/gui/components/properties/juce_PropertyPanel.cpp @@ -385,7 +385,7 @@ void PropertyPanel::setSectionEnabled (const int sectionIndex, const bool should //============================================================================== XmlElement* PropertyPanel::getOpennessState() const { - XmlElement* const xml = new XmlElement (T("PROPERTYPANELSTATE")); + XmlElement* const xml = new XmlElement ("PROPERTYPANELSTATE"); xml->setAttribute ("scrollPos", viewport->getViewPositionY()); @@ -406,14 +406,14 @@ XmlElement* PropertyPanel::getOpennessState() const void PropertyPanel::restoreOpennessState (const XmlElement& xml) { - if (xml.hasTagName (T("PROPERTYPANELSTATE"))) + if (xml.hasTagName ("PROPERTYPANELSTATE")) { const StringArray sections (getSectionNames()); - forEachXmlChildElementWithTagName (xml, e, T("SECTION")) + forEachXmlChildElementWithTagName (xml, e, "SECTION") { - setSectionOpen (sections.indexOf (e->getStringAttribute (T("name"))), - e->getBoolAttribute (T("open"))); + setSectionOpen (sections.indexOf (e->getStringAttribute ("name")), + e->getBoolAttribute ("open")); } viewport->setViewPosition (viewport->getViewPositionX(), diff --git a/src/gui/components/special/juce_AudioDeviceSelectorComponent.cpp b/src/gui/components/special/juce_AudioDeviceSelectorComponent.cpp index b71b8279b8..0b86a9b201 100644 --- a/src/gui/components/special/juce_AudioDeviceSelectorComponent.cpp +++ b/src/gui/components/special/juce_AudioDeviceSelectorComponent.cpp @@ -401,7 +401,7 @@ public: if (error.isNotEmpty()) { AlertWindow::showMessageBox (AlertWindow::WarningIcon, - T("Error when trying to open audio device!"), + "Error when trying to open audio device!", error); } } @@ -559,7 +559,7 @@ public: for (int i = 0; i < numRates; ++i) { const int rate = roundToInt (currentDevice->getSampleRate (i)); - sampleRateDropDown->addItem (String (rate) + T(" Hz"), rate); + sampleRateDropDown->addItem (String (rate) + " Hz", rate); } sampleRateDropDown->setSelectedId (roundToInt (currentDevice->getCurrentSampleRate()), true); @@ -591,9 +591,9 @@ public: { const int bs = currentDevice->getBufferSizeSamples (i); bufferSizeDropDown->addItem (String (bs) - + T(" samples (") + + " samples (" + String (bs * 1000.0 / currentRate, 1) - + T(" ms)"), + + " ms)", bs); } diff --git a/src/gui/components/special/juce_ColourSelector.cpp b/src/gui/components/special/juce_ColourSelector.cpp index 283a754e21..608a10909f 100644 --- a/src/gui/components/special/juce_ColourSelector.cpp +++ b/src/gui/components/special/juce_ColourSelector.cpp @@ -508,7 +508,7 @@ void ColourSelector::paint (Graphics& g) for (int i = 4; --i >= 0;) { if (sliders[i]->isVisible()) - g.drawText (sliders[i]->getName() + T(":"), + g.drawText (sliders[i]->getName() + ":", 0, sliders[i]->getY(), sliders[i]->getX() - 8, sliders[i]->getHeight(), Justification::centredRight, false); diff --git a/src/gui/components/special/juce_DropShadower.cpp b/src/gui/components/special/juce_DropShadower.cpp index 80a51bbcdb..c29fb8cd28 100644 --- a/src/gui/components/special/juce_DropShadower.cpp +++ b/src/gui/components/special/juce_DropShadower.cpp @@ -231,10 +231,7 @@ void DropShadower::updateShadows() { // keep a cached version of the image to save doing the gaussian too often String imageId; - imageId << shadowEdge << T(',') - << xOffset << T(',') - << yOffset << T(',') - << alpha; + imageId << shadowEdge << ',' << xOffset << ',' << yOffset << ',' << alpha; const int hash = imageId.hashCode(); @@ -329,12 +326,8 @@ void DropShadower::updateShadows() bringShadowWindowsToFront(); } -void DropShadower::setShadowImage (Image* const src, - const int num, - const int w, - const int h, - const int sx, - const int sy) +void DropShadower::setShadowImage (Image* const src, const int num, const int w, const int h, + const int sx, const int sy) { shadowImageSections[num] = new Image (Image::ARGB, w, h, true); diff --git a/src/gui/components/windows/juce_AlertWindow.cpp b/src/gui/components/windows/juce_AlertWindow.cpp index b046014889..f38599fa02 100644 --- a/src/gui/components/windows/juce_AlertWindow.cpp +++ b/src/gui/components/windows/juce_AlertWindow.cpp @@ -62,7 +62,7 @@ public: void returnPressed() { // pass these up the component hierarchy to be trigger the buttons - getParentComponent()->keyPressed (KeyPress (KeyPress::returnKey, 0, T('\n'))); + getParentComponent()->keyPressed (KeyPress (KeyPress::returnKey, 0, '\n')); } void escapePressed() @@ -92,7 +92,7 @@ AlertWindow::AlertWindow (const String& title, associatedComponent (associatedComponent_) { if (message.isEmpty()) - text = T(" "); // to force an update if the message is empty + text = " "; // to force an update if the message is empty setMessage (message); @@ -140,7 +140,7 @@ void AlertWindow::setMessage (const String& message) font.setHeight (15.0f); Font titleFont (font.getHeight() * 1.1f, Font::bold); - textLayout.setText (getName() + T("\n\n"), titleFont); + textLayout.setText (getName() + "\n\n", titleFont); textLayout.appendText (text, font); diff --git a/src/gui/components/windows/juce_DocumentWindow.cpp b/src/gui/components/windows/juce_DocumentWindow.cpp index ebb0b33391..44090093eb 100644 --- a/src/gui/components/windows/juce_DocumentWindow.cpp +++ b/src/gui/components/windows/juce_DocumentWindow.cpp @@ -353,7 +353,7 @@ void DocumentWindow::lookAndFeelChanged() if (getCloseButton() != 0) { #if JUCE_MAC - getCloseButton()->addShortcut (KeyPress (T('w'), ModifierKeys::commandModifier, 0)); + getCloseButton()->addShortcut (KeyPress ('w', ModifierKeys::commandModifier, 0)); #else getCloseButton()->addShortcut (KeyPress (KeyPress::F4Key, ModifierKeys::altModifier, 0)); #endif diff --git a/src/gui/components/windows/juce_SplashScreen.h b/src/gui/components/windows/juce_SplashScreen.h index 6538be03d5..732b219ba0 100644 --- a/src/gui/components/windows/juce_SplashScreen.h +++ b/src/gui/components/windows/juce_SplashScreen.h @@ -47,7 +47,7 @@ { SplashScreen* splash = new SplashScreen(); - splash->show (T("welcome to my app"), + splash->show ("welcome to my app", ImageCache::getFromFile (File ("/foobar/splash.jpg")), 4000, false); diff --git a/src/gui/components/windows/juce_ThreadWithProgressWindow.h b/src/gui/components/windows/juce_ThreadWithProgressWindow.h index f84eef594b..bf8ac0ce4d 100644 --- a/src/gui/components/windows/juce_ThreadWithProgressWindow.h +++ b/src/gui/components/windows/juce_ThreadWithProgressWindow.h @@ -44,7 +44,7 @@ class MyTask : public ThreadWithProgressWindow { public: - MyTask() : ThreadWithProgressWindow (T("busy..."), true, true) + MyTask() : ThreadWithProgressWindow ("busy...", true, true) { } @@ -112,7 +112,7 @@ public: bool hasProgressBar, bool hasCancelButton, int timeOutMsWhenCancelling = 10000, - const String& cancelButtonText = JUCE_T("Cancel")); + const String& cancelButtonText = "Cancel"); /** Destructor. */ ~ThreadWithProgressWindow(); diff --git a/src/gui/graphics/drawables/juce_Drawable.cpp b/src/gui/graphics/drawables/juce_Drawable.cpp index bec9f50f70..c599191eda 100644 --- a/src/gui/graphics/drawables/juce_Drawable.cpp +++ b/src/gui/graphics/drawables/juce_Drawable.cpp @@ -105,7 +105,7 @@ Drawable* Drawable::createFromImageData (const void* data, const size_t numBytes XmlDocument doc (asString); ScopedPointer outer (doc.getDocumentElement (true)); - if (outer != 0 && outer->hasTagName (T("svg"))) + if (outer != 0 && outer->hasTagName ("svg")) { ScopedPointer svg (doc.getDocumentElement()); diff --git a/src/gui/graphics/drawables/juce_DrawableComposite.cpp b/src/gui/graphics/drawables/juce_DrawableComposite.cpp index cd7008d1b3..c21b57b1b6 100644 --- a/src/gui/graphics/drawables/juce_DrawableComposite.cpp +++ b/src/gui/graphics/drawables/juce_DrawableComposite.cpp @@ -185,7 +185,7 @@ Drawable* DrawableComposite::createCopy() const //============================================================================== ValueTree DrawableComposite::createValueTree() const throw() { - ValueTree v (T("Group")); + ValueTree v ("Group"); if (getName().isNotEmpty()) v.setProperty ("id", getName(), 0); diff --git a/src/gui/graphics/drawables/juce_DrawableImage.cpp b/src/gui/graphics/drawables/juce_DrawableImage.cpp index 63449f88de..d098511323 100644 --- a/src/gui/graphics/drawables/juce_DrawableImage.cpp +++ b/src/gui/graphics/drawables/juce_DrawableImage.cpp @@ -146,7 +146,7 @@ Drawable* DrawableImage::createCopy() const //============================================================================== ValueTree DrawableImage::createValueTree() const throw() { - ValueTree v (T("Image")); + ValueTree v ("Image"); if (getName().isNotEmpty()) v.setProperty ("id", getName(), 0); diff --git a/src/gui/graphics/drawables/juce_DrawablePath.cpp b/src/gui/graphics/drawables/juce_DrawablePath.cpp index 2fd86d2fed..514759795b 100644 --- a/src/gui/graphics/drawables/juce_DrawablePath.cpp +++ b/src/gui/graphics/drawables/juce_DrawablePath.cpp @@ -168,12 +168,12 @@ static ValueTree createTreeForFillType (const String& tagName, const FillType& f if (fillType.isColour()) { - v.setProperty ("type", T("solid"), 0); + v.setProperty ("type", "solid", 0); v.setProperty ("colour", String::toHexString ((int) fillType.colour.getARGB()), 0); } else if (fillType.isGradient()) { - v.setProperty ("type", T("gradient"), 0); + v.setProperty ("type", "gradient", 0); v.setProperty ("x1", fillType.gradient->x1, 0); v.setProperty ("y1", fillType.gradient->y1, 0); v.setProperty ("x2", fillType.gradient->x2, 0); @@ -197,19 +197,19 @@ static ValueTree createTreeForFillType (const String& tagName, const FillType& f ValueTree DrawablePath::createValueTree() const throw() { - ValueTree v (T("Path")); + ValueTree v ("Path"); - v.addChild (createTreeForFillType (T("fill"), mainFill), -1, 0); - v.addChild (createTreeForFillType (T("stroke"), strokeFill), -1, 0); + v.addChild (createTreeForFillType ("fill", mainFill), -1, 0); + v.addChild (createTreeForFillType ("stroke", strokeFill), -1, 0); if (getName().isNotEmpty()) v.setProperty ("id", getName(), 0); v.setProperty ("strokeWidth", (double) strokeType.getStrokeThickness(), 0); v.setProperty ("jointStyle", strokeType.getJointStyle() == PathStrokeType::mitered - ? T("miter") : (strokeType.getJointStyle() == PathStrokeType::curved ? T("curved") : T("bevel")), 0); + ? "miter" : (strokeType.getJointStyle() == PathStrokeType::curved ? "curved" : "bevel"), 0); v.setProperty ("capStyle", strokeType.getEndStyle() == PathStrokeType::butt - ? T("butt") : (strokeType.getEndStyle() == PathStrokeType::square ? T("square") : T("round")), 0); + ? "butt" : (strokeType.getEndStyle() == PathStrokeType::square ? "square" : "round"), 0); v.setProperty ("path", path.toString(), 0); return v; @@ -223,8 +223,8 @@ DrawablePath* DrawablePath::createFromValueTree (const ValueTree& tree) throw() DrawablePath* p = new DrawablePath(); p->setName (tree ["id"]); - p->mainFill = readFillTypeFromTree (tree.getChildWithName (T("fill"))); - p->strokeFill = readFillTypeFromTree (tree.getChildWithName (T("stroke"))); + p->mainFill = readFillTypeFromTree (tree.getChildWithName ("fill")); + p->strokeFill = readFillTypeFromTree (tree.getChildWithName ("stroke")); const String jointStyle (tree ["jointStyle"].toString()); const String endStyle (tree ["capStyle"].toString()); diff --git a/src/gui/graphics/drawables/juce_DrawableText.cpp b/src/gui/graphics/drawables/juce_DrawableText.cpp index 164862dc10..fed0da9932 100644 --- a/src/gui/graphics/drawables/juce_DrawableText.cpp +++ b/src/gui/graphics/drawables/juce_DrawableText.cpp @@ -92,7 +92,7 @@ Drawable* DrawableText::createCopy() const //============================================================================== ValueTree DrawableText::createValueTree() const throw() { - ValueTree v (T("Text")); + ValueTree v ("Text"); if (getName().isNotEmpty()) v.setProperty ("id", getName(), 0); diff --git a/src/gui/graphics/drawables/juce_SVGParser.cpp b/src/gui/graphics/drawables/juce_SVGParser.cpp index 42ccb567df..8291cb8d66 100644 --- a/src/gui/graphics/drawables/juce_SVGParser.cpp +++ b/src/gui/graphics/drawables/juce_SVGParser.cpp @@ -52,26 +52,26 @@ public: //============================================================================== Drawable* parseSVGElement (const XmlElement& xml) { - if (! xml.hasTagName (T("svg"))) + if (! xml.hasTagName ("svg")) return 0; DrawableComposite* const drawable = new DrawableComposite(); - drawable->setName (xml.getStringAttribute (T("id"))); + drawable->setName (xml.getStringAttribute ("id")); SVGState newState (*this); - if (xml.hasAttribute (T("transform"))) + if (xml.hasAttribute ("transform")) newState.addTransform (xml); - newState.elementX = getCoordLength (xml.getStringAttribute (T("x"), String (newState.elementX)), viewBoxW); - newState.elementY = getCoordLength (xml.getStringAttribute (T("y"), String (newState.elementY)), viewBoxH); - newState.width = getCoordLength (xml.getStringAttribute (T("width"), String (newState.width)), viewBoxW); - newState.height = getCoordLength (xml.getStringAttribute (T("height"), String (newState.height)), viewBoxH); + newState.elementX = getCoordLength (xml.getStringAttribute ("x", String (newState.elementX)), viewBoxW); + newState.elementY = getCoordLength (xml.getStringAttribute ("y", String (newState.elementY)), viewBoxH); + newState.width = getCoordLength (xml.getStringAttribute ("width", String (newState.width)), viewBoxW); + newState.height = getCoordLength (xml.getStringAttribute ("height", String (newState.height)), viewBoxH); - if (xml.hasAttribute (T("viewBox"))) + if (xml.hasAttribute ("viewBox")) { - const String viewParams (xml.getStringAttribute (T("viewBox"))); + const String viewParams (xml.getStringAttribute ("viewBox")); int i = 0; float vx, vy, vw, vh; @@ -85,7 +85,7 @@ public: int placementFlags = 0; - const String aspect (xml.getStringAttribute (T("preserveAspectRatio"))); + const String aspect (xml.getStringAttribute ("preserveAspectRatio")); if (aspect.containsIgnoreCase (T("none"))) { @@ -147,29 +147,29 @@ private: { Drawable* d = 0; - if (e->hasTagName (T("g"))) + if (e->hasTagName ("g")) d = parseGroupElement (*e); - else if (e->hasTagName (T("svg"))) + else if (e->hasTagName ("svg")) d = parseSVGElement (*e); - else if (e->hasTagName (T("path"))) + else if (e->hasTagName ("path")) d = parsePath (*e); - else if (e->hasTagName (T("rect"))) + else if (e->hasTagName ("rect")) d = parseRect (*e); - else if (e->hasTagName (T("circle"))) + else if (e->hasTagName ("circle")) d = parseCircle (*e); - else if (e->hasTagName (T("ellipse"))) + else if (e->hasTagName ("ellipse")) d = parseEllipse (*e); - else if (e->hasTagName (T("line"))) + else if (e->hasTagName ("line")) d = parseLine (*e); - else if (e->hasTagName (T("polyline"))) + else if (e->hasTagName ("polyline")) d = parsePolygon (*e, true); - else if (e->hasTagName (T("polygon"))) + else if (e->hasTagName ("polygon")) d = parsePolygon (*e, false); - else if (e->hasTagName (T("text"))) + else if (e->hasTagName ("text")) d = parseText (*e); - else if (e->hasTagName (T("switch"))) + else if (e->hasTagName ("switch")) d = parseSwitch (*e); - else if (e->hasTagName (T("style"))) + else if (e->hasTagName ("style")) parseCSSStyle (*e); parentDrawable->insertDrawable (d); @@ -178,7 +178,7 @@ private: DrawableComposite* parseSwitch (const XmlElement& xml) { - const XmlElement* const group = xml.getChildByName (T("g")); + const XmlElement* const group = xml.getChildByName ("g"); if (group != 0) return parseGroupElement (*group); @@ -190,9 +190,9 @@ private: { DrawableComposite* const drawable = new DrawableComposite(); - drawable->setName (xml.getStringAttribute (T("id"))); + drawable->setName (xml.getStringAttribute ("id")); - if (xml.hasAttribute (T("transform"))) + if (xml.hasAttribute ("transform")) { SVGState newState (*this); newState.addTransform (xml); @@ -210,10 +210,10 @@ private: //============================================================================== Drawable* parsePath (const XmlElement& xml) const { - const String d (xml.getStringAttribute (T("d")).trimStart()); + const String d (xml.getStringAttribute ("d").trimStart()); Path path; - if (getStyleAttribute (&xml, T("fill-rule")).trim().equalsIgnoreCase (T("evenodd"))) + if (getStyleAttribute (&xml, "fill-rule").trim().equalsIgnoreCase (T("evenodd"))) path.setUsingNonZeroWinding (false); int index = 0; @@ -223,7 +223,7 @@ private: bool isRelative = true; bool carryOn = true; - const String validCommandChars (T("MmLlHhVvCcSsQqTtAaZz")); + const String validCommandChars ("MmLlHhVvCcSsQqTtAaZz"); for (;;) { @@ -237,10 +237,10 @@ private: switch (lastCommandChar) { - case T('M'): - case T('m'): - case T('L'): - case T('l'): + case 'M': + case 'm': + case 'L': + case 'l': if (parseCoords (d, x, y, index, false)) { if (isRelative) @@ -249,7 +249,7 @@ private: y += lastY; } - if (lastCommandChar == T('M') || lastCommandChar == T('m')) + if (lastCommandChar == 'M' || lastCommandChar == 'm') path.startNewSubPath (x, y); else path.lineTo (x, y); @@ -266,8 +266,8 @@ private: break; - case T('H'): - case T('h'): + case 'H': + case 'h': if (parseCoord (d, x, index, false, true)) { if (isRelative) @@ -284,8 +284,8 @@ private: } break; - case T('V'): - case T('v'): + case 'V': + case 'v': if (parseCoord (d, y, index, false, false)) { if (isRelative) @@ -302,8 +302,8 @@ private: } break; - case T('C'): - case T('c'): + case 'C': + case 'c': if (parseCoords (d, x, y, index, false) && parseCoords (d, x2, y2, index, false) && parseCoords (d, x3, y3, index, false)) @@ -331,8 +331,8 @@ private: } break; - case T('S'): - case T('s'): + case 'S': + case 's': if (parseCoords (d, x, y, index, false) && parseCoords (d, x3, y3, index, false)) { @@ -359,8 +359,8 @@ private: } break; - case T('Q'): - case T('q'): + case 'Q': + case 'q': if (parseCoords (d, x, y, index, false) && parseCoords (d, x2, y2, index, false)) { @@ -385,8 +385,8 @@ private: } break; - case T('T'): - case T('t'): + case 'T': + case 't': if (parseCoords (d, x, y, index, false)) { if (isRelative) @@ -410,8 +410,8 @@ private: } break; - case T('A'): - case T('a'): + case 'A': + case 'a': if (parseCoords (d, x, y, index, false)) { String num; @@ -470,8 +470,8 @@ private: break; - case T('Z'): - case T('z'): + case 'Z': + case 'z': path.closeSubPath(); while (CharacterFunctions::isWhitespace (d [index])) ++index; @@ -494,31 +494,31 @@ private: { Path rect; - const bool hasRX = xml.hasAttribute (T("rx")); - const bool hasRY = xml.hasAttribute (T("ry")); + const bool hasRX = xml.hasAttribute ("rx"); + const bool hasRY = xml.hasAttribute ("ry"); if (hasRX || hasRY) { - float rx = getCoordLength (xml.getStringAttribute (T("rx")), viewBoxW); - float ry = getCoordLength (xml.getStringAttribute (T("ry")), viewBoxH); + float rx = getCoordLength (xml.getStringAttribute ("rx"), viewBoxW); + float ry = getCoordLength (xml.getStringAttribute ("ry"), viewBoxH); if (! hasRX) rx = ry; else if (! hasRY) ry = rx; - rect.addRoundedRectangle (getCoordLength (xml.getStringAttribute (T("x")), viewBoxW), - getCoordLength (xml.getStringAttribute (T("y")), viewBoxH), - getCoordLength (xml.getStringAttribute (T("width")), viewBoxW), - getCoordLength (xml.getStringAttribute (T("height")), viewBoxH), + rect.addRoundedRectangle (getCoordLength (xml.getStringAttribute ("x"), viewBoxW), + getCoordLength (xml.getStringAttribute ("y"), viewBoxH), + getCoordLength (xml.getStringAttribute ("width"), viewBoxW), + getCoordLength (xml.getStringAttribute ("height"), viewBoxH), rx, ry); } else { - rect.addRectangle (getCoordLength (xml.getStringAttribute (T("x")), viewBoxW), - getCoordLength (xml.getStringAttribute (T("y")), viewBoxH), - getCoordLength (xml.getStringAttribute (T("width")), viewBoxW), - getCoordLength (xml.getStringAttribute (T("height")), viewBoxH)); + rect.addRectangle (getCoordLength (xml.getStringAttribute ("x"), viewBoxW), + getCoordLength (xml.getStringAttribute ("y"), viewBoxH), + getCoordLength (xml.getStringAttribute ("width"), viewBoxW), + getCoordLength (xml.getStringAttribute ("height"), viewBoxH)); } return parseShape (xml, rect); @@ -528,9 +528,9 @@ private: { Path circle; - const float cx = getCoordLength (xml.getStringAttribute (T("cx")), viewBoxW); - const float cy = getCoordLength (xml.getStringAttribute (T("cy")), viewBoxH); - const float radius = getCoordLength (xml.getStringAttribute (T("r")), viewBoxW); + const float cx = getCoordLength (xml.getStringAttribute ("cx"), viewBoxW); + const float cy = getCoordLength (xml.getStringAttribute ("cy"), viewBoxH); + const float radius = getCoordLength (xml.getStringAttribute ("r"), viewBoxW); circle.addEllipse (cx - radius, cy - radius, radius * 2.0f, radius * 2.0f); @@ -541,10 +541,10 @@ private: { Path ellipse; - const float cx = getCoordLength (xml.getStringAttribute (T("cx")), viewBoxW); - const float cy = getCoordLength (xml.getStringAttribute (T("cy")), viewBoxH); - const float radiusX = getCoordLength (xml.getStringAttribute (T("rx")), viewBoxW); - const float radiusY = getCoordLength (xml.getStringAttribute (T("ry")), viewBoxH); + const float cx = getCoordLength (xml.getStringAttribute ("cx"), viewBoxW); + const float cy = getCoordLength (xml.getStringAttribute ("cy"), viewBoxH); + const float radiusX = getCoordLength (xml.getStringAttribute ("rx"), viewBoxW); + const float radiusY = getCoordLength (xml.getStringAttribute ("ry"), viewBoxH); ellipse.addEllipse (cx - radiusX, cy - radiusY, radiusX * 2.0f, radiusY * 2.0f); @@ -555,10 +555,10 @@ private: { Path line; - const float x1 = getCoordLength (xml.getStringAttribute (T("x1")), viewBoxW); - const float y1 = getCoordLength (xml.getStringAttribute (T("y1")), viewBoxH); - const float x2 = getCoordLength (xml.getStringAttribute (T("x2")), viewBoxW); - const float y2 = getCoordLength (xml.getStringAttribute (T("y2")), viewBoxH); + const float x1 = getCoordLength (xml.getStringAttribute ("x1"), viewBoxW); + const float y1 = getCoordLength (xml.getStringAttribute ("y1"), viewBoxH); + const float x2 = getCoordLength (xml.getStringAttribute ("x2"), viewBoxW); + const float y2 = getCoordLength (xml.getStringAttribute ("y2"), viewBoxH); line.startNewSubPath (x1, y1); line.lineTo (x2, y2); @@ -568,7 +568,7 @@ private: Drawable* parsePolygon (const XmlElement& xml, const bool isPolyline) const { - const String points (xml.getStringAttribute (T("points"))); + const String points (xml.getStringAttribute ("points")); Path path; int index = 0; @@ -600,7 +600,7 @@ private: Drawable* parseShape (const XmlElement& xml, Path& path, const bool shouldParseTransform = true) const { - if (shouldParseTransform && xml.hasAttribute (T("transform"))) + if (shouldParseTransform && xml.hasAttribute ("transform")) { SVGState newState (*this); newState.addTransform (xml); @@ -609,7 +609,7 @@ private: } DrawablePath* dp = new DrawablePath(); - dp->setName (xml.getStringAttribute (T("id"))); + dp->setName (xml.getStringAttribute ("id")); dp->setFill (FillType (Colours::transparentBlack)); path.applyTransform (transform); @@ -628,19 +628,19 @@ private: } dp->setFill (getPathFillType (path, - getStyleAttribute (&xml, T("fill")), - getStyleAttribute (&xml, T("fill-opacity")), - getStyleAttribute (&xml, T("opacity")), + getStyleAttribute (&xml, "fill"), + getStyleAttribute (&xml, "fill-opacity"), + getStyleAttribute (&xml, "opacity"), containsClosedSubPath ? Colours::black : Colours::transparentBlack)); - const String strokeType (getStyleAttribute (&xml, T("stroke"))); + const String strokeType (getStyleAttribute (&xml, "stroke")); - if (strokeType.isNotEmpty() && ! strokeType.equalsIgnoreCase (T("none"))) + if (strokeType.isNotEmpty() && ! strokeType.equalsIgnoreCase ("none")) { dp->setStrokeFill (getPathFillType (path, strokeType, - getStyleAttribute (&xml, T("stroke-opacity")), - getStyleAttribute (&xml, T("opacity")), + getStyleAttribute (&xml, "stroke-opacity"), + getStyleAttribute (&xml, "opacity"), Colours::transparentBlack)); dp->setStrokeType (getStrokeFor (&xml)); @@ -651,9 +651,9 @@ private: const XmlElement* findLinkedElement (const XmlElement* e) const { - const String id (e->getStringAttribute (T("xlink:href"))); + const String id (e->getStringAttribute ("xlink:href")); - if (! id.startsWithChar (T('#'))) + if (! id.startsWithChar ('#')) return 0; return findElementForId (topLevelXml, id.substring (1)); @@ -664,17 +664,17 @@ private: if (fillXml == 0) return; - forEachXmlChildElementWithTagName (*fillXml, e, T("stop")) + forEachXmlChildElementWithTagName (*fillXml, e, "stop") { int index = 0; - Colour col (parseColour (getStyleAttribute (e, T("stop-color")), index, Colours::black)); + Colour col (parseColour (getStyleAttribute (e, "stop-color"), index, Colours::black)); - const String opacity (getStyleAttribute (e, T("stop-opacity"), T("1"))); + const String opacity (getStyleAttribute (e, "stop-opacity", "1")); col = col.withMultipliedAlpha (jlimit (0.0f, 1.0f, opacity.getFloatValue())); - double offset = e->getDoubleAttribute (T("offset")); + double offset = e->getDoubleAttribute ("offset"); - if (e->getStringAttribute (T("offset")).containsChar (T('%'))) + if (e->getStringAttribute ("offset").containsChar ('%')) offset *= 0.01; cg.addColour (jlimit (0.0, 1.0, offset), col); @@ -703,8 +703,8 @@ private: const XmlElement* const fillXml = findElementForId (topLevelXml, id); if (fillXml != 0 - && (fillXml->hasTagName (T("linearGradient")) - || fillXml->hasTagName (T("radialGradient")))) + && (fillXml->hasTagName ("linearGradient") + || fillXml->hasTagName ("radialGradient"))) { const XmlElement* inheritedFrom = findLinkedElement (fillXml); @@ -729,14 +729,14 @@ private: jassert (gradient.getNumColours() > 0); - gradient.isRadial = fillXml->hasTagName (T("radialGradient")); + gradient.isRadial = fillXml->hasTagName ("radialGradient"); float width = viewBoxW; float height = viewBoxH; float dx = 0.0f; float dy = 0.0f; - const bool userSpace = fillXml->getStringAttribute (T("gradientUnits")).equalsIgnoreCase (T("userSpaceOnUse")); + const bool userSpace = fillXml->getStringAttribute ("gradientUnits").equalsIgnoreCase (T("userSpaceOnUse")); if (! userSpace) { @@ -749,10 +749,10 @@ private: if (gradient.isRadial) { - gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute (T("cx"), T("50%")), width); - gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute (T("cy"), T("50%")), height); + gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("cx", "50%"), width); + gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("cy", "50%"), height); - const float radius = getCoordLength (fillXml->getStringAttribute (T("r"), T("50%")), width); + const float radius = getCoordLength (fillXml->getStringAttribute ("r", "50%"), width); gradient.x2 = gradient.x1 + radius; gradient.y2 = gradient.y1; @@ -761,18 +761,18 @@ private: } else { - gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute (T("x1"), T("0%")), width); - gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute (T("y1"), T("0%")), height); + gradient.x1 = dx + getCoordLength (fillXml->getStringAttribute ("x1", "0%"), width); + gradient.y1 = dy + getCoordLength (fillXml->getStringAttribute ("y1", "0%"), height); - gradient.x2 = dx + getCoordLength (fillXml->getStringAttribute (T("x2"), T("100%")), width); - gradient.y2 = dy + getCoordLength (fillXml->getStringAttribute (T("y2"), T("0%")), height); + gradient.x2 = dx + getCoordLength (fillXml->getStringAttribute ("x2", "100%"), width); + gradient.y2 = dy + getCoordLength (fillXml->getStringAttribute ("y2", "0%"), height); if (gradient.x1 == gradient.x2 && gradient.y1 == gradient.y2) return Colour (gradient.getColour (gradient.getNumColours() - 1)); } FillType type (gradient); - type.transform = parseTransform (fillXml->getStringAttribute (T("gradientTransform"))) + type.transform = parseTransform (fillXml->getStringAttribute ("gradientTransform")) .followedBy (transform); return type; } @@ -788,9 +788,9 @@ private: const PathStrokeType getStrokeFor (const XmlElement* const xml) const { - const String width (getStyleAttribute (xml, T("stroke-width"))); - const String cap (getStyleAttribute (xml, T("stroke-linecap"))); - const String join (getStyleAttribute (xml, T("stroke-linejoin"))); + const String width (getStyleAttribute (xml, "stroke-width")); + const String cap (getStyleAttribute (xml, "stroke-linecap")); + const String join (getStyleAttribute (xml, "stroke-linejoin")); //const String mitreLimit (getStyleAttribute (xml, T("stroke-miterlimit"))); //const String dashArray (getStyleAttribute (xml, T("stroke-dasharray"))); @@ -823,10 +823,10 @@ private: { Array xCoords, yCoords, dxCoords, dyCoords; - getCoordList (xCoords, getInheritedAttribute (&xml, T("x")), true, true); - getCoordList (yCoords, getInheritedAttribute (&xml, T("y")), true, false); - getCoordList (dxCoords, getInheritedAttribute (&xml, T("dx")), true, true); - getCoordList (dyCoords, getInheritedAttribute (&xml, T("dy")), true, false); + getCoordList (xCoords, getInheritedAttribute (&xml, "x"), true, true); + getCoordList (yCoords, getInheritedAttribute (&xml, "y"), true, false); + getCoordList (dxCoords, getInheritedAttribute (&xml, "dx"), true, true); + getCoordList (dyCoords, getInheritedAttribute (&xml, "dy"), true, false); //xxx not done text yet! @@ -842,7 +842,7 @@ private: Drawable* s = parseShape (*e, path); delete s; } - else if (e->hasTagName (T("tspan"))) + else if (e->hasTagName ("tspan")) { Drawable* s = parseText (*e); delete s; @@ -855,7 +855,7 @@ private: //============================================================================== void addTransform (const XmlElement& xml) { - transform = parseTransform (xml.getStringAttribute (T("transform"))) + transform = parseTransform (xml.getStringAttribute ("transform")) .followedBy (transform); } @@ -894,15 +894,15 @@ private: const tchar n1 = s [len - 2]; const tchar n2 = s [len - 1]; - if (n1 == T('i') && n2 == T('n')) + if (n1 == 'i' && n2 == 'n') n *= dpi; - else if (n1 == T('m') && n2 == T('m')) + else if (n1 == 'm' && n2 == 'm') n *= dpi / 25.4f; - else if (n1 == T('c') && n2 == T('m')) + else if (n1 == 'c' && n2 == 'm') n *= dpi / 2.54f; - else if (n1 == T('p') && n2 == T('c')) + else if (n1 == 'p' && n2 == 'c') n *= 15.0f; - else if (n2 == T('%')) + else if (n2 == '%') n *= 0.01f * sizeForProportions; } @@ -922,7 +922,7 @@ private: //============================================================================== void parseCSSStyle (const XmlElement& xml) { - cssStyleText = xml.getAllSubText() + T("\n") + cssStyleText; + cssStyleText = xml.getAllSubText() + "\n" + cssStyleText; } const String getStyleAttribute (const XmlElement* xml, const String& attributeName, @@ -931,7 +931,7 @@ private: if (xml->hasAttribute (attributeName)) return xml->getStringAttribute (attributeName, defaultValue); - const String styleAtt (xml->getStringAttribute (T("style"))); + const String styleAtt (xml->getStringAttribute ("style")); if (styleAtt.isNotEmpty()) { @@ -940,22 +940,22 @@ private: if (value.isNotEmpty()) return value; } - else if (xml->hasAttribute (T("class"))) + else if (xml->hasAttribute ("class")) { - const String className (T(".") + xml->getStringAttribute (T("class"))); + const String className ("." + xml->getStringAttribute ("class")); - int index = cssStyleText.indexOfIgnoreCase (className + T(" ")); + int index = cssStyleText.indexOfIgnoreCase (className + " "); if (index < 0) - index = cssStyleText.indexOfIgnoreCase (className + T("{")); + index = cssStyleText.indexOfIgnoreCase (className + "{"); if (index >= 0) { - const int openBracket = cssStyleText.indexOfChar (index, T('{')); + const int openBracket = cssStyleText.indexOfChar (index, '{'); if (openBracket > index) { - const int closeBracket = cssStyleText.indexOfChar (openBracket, T('}')); + const int closeBracket = cssStyleText.indexOfChar (openBracket, '}'); if (closeBracket > openBracket) { @@ -992,7 +992,7 @@ private: //============================================================================== static bool isIdentifierChar (const tchar c) { - return CharacterFunctions::isLetter (c) || c == T('-'); + return CharacterFunctions::isLetter (c) || c == '-'; } static const String getAttributeFromStyleList (const String& list, const String& attributeName, const String& defaultValue) @@ -1009,12 +1009,12 @@ private: if ((i == 0 || (i > 0 && ! isIdentifierChar (list [i - 1]))) && ! isIdentifierChar (list [i + attributeName.length()])) { - i = list.indexOfChar (i, T(':')); + i = list.indexOfChar (i, ':'); if (i < 0) break; - int end = list.indexOfChar (i, T(';')); + int end = list.indexOfChar (i, ';'); if (end < 0) end = 0x7ffff; @@ -1033,21 +1033,21 @@ private: { const tchar* const s = (const tchar*) source; - while (CharacterFunctions::isWhitespace (s[index]) || s[index] == T(',')) + while (CharacterFunctions::isWhitespace (s[index]) || s[index] == ',') ++index; int start = index; - if (CharacterFunctions::isDigit (s[index]) || s[index] == T('.') || s[index] == T('-')) + if (CharacterFunctions::isDigit (s[index]) || s[index] == '.' || s[index] == '-') ++index; - while (CharacterFunctions::isDigit (s[index]) || s[index] == T('.')) + while (CharacterFunctions::isDigit (s[index]) || s[index] == '.') ++index; - if ((s[index] == T('e') || s[index] == T('E')) + if ((s[index] == 'e' || s[index] == 'E') && (CharacterFunctions::isDigit (s[index + 1]) - || s[index + 1] == T('-') - || s[index + 1] == T('+'))) + || s[index + 1] == '-' + || s[index + 1] == '+')) { index += 2; @@ -1066,7 +1066,7 @@ private: value = String (s + start, index - start); - while (CharacterFunctions::isWhitespace (s[index]) || s[index] == T(',')) + while (CharacterFunctions::isWhitespace (s[index]) || s[index] == ',') ++index; return true; @@ -1075,7 +1075,7 @@ private: //============================================================================== static const Colour parseColour (const String& s, int& index, const Colour& defaultColour) { - if (s [index] == T('#')) + if (s [index] == '#') { uint32 hex [6]; zeromem (hex, sizeof (hex)); @@ -1100,23 +1100,23 @@ private: (uint8) ((hex [2] << 4) + hex [3]), (uint8) ((hex [4] << 4) + hex [5])); } - else if (s [index] == T('r') - && s [index + 1] == T('g') - && s [index + 2] == T('b')) + else if (s [index] == 'r' + && s [index + 1] == 'g' + && s [index + 2] == 'b') { - const int openBracket = s.indexOfChar (index, T('(')); - const int closeBracket = s.indexOfChar (openBracket, T(')')); + const int openBracket = s.indexOfChar (index, '('); + const int closeBracket = s.indexOfChar (openBracket, ')'); if (openBracket >= 3 && closeBracket > openBracket) { index = closeBracket; StringArray tokens; - tokens.addTokens (s.substring (openBracket + 1, closeBracket), T(","), T("")); + tokens.addTokens (s.substring (openBracket + 1, closeBracket), ",", ""); tokens.trim(); tokens.removeEmptyStrings(); - if (tokens[0].containsChar (T('%'))) + if (tokens[0].containsChar ('%')) return Colour ((uint8) roundToInt (2.55 * tokens[0].getDoubleValue()), (uint8) roundToInt (2.55 * tokens[1].getDoubleValue()), (uint8) roundToInt (2.55 * tokens[2].getDoubleValue())); @@ -1139,7 +1139,7 @@ private: StringArray tokens; tokens.addTokens (t.fromFirstOccurrenceOf (T("("), false, false) .upToFirstOccurrenceOf (T(")"), false, false), - T(", "), String::empty); + ", ", String::empty); tokens.removeEmptyStrings (true); @@ -1279,7 +1279,7 @@ private: { forEachXmlChildElement (*parent, e) { - if (e->compareAttribute (T("id"), id)) + if (e->compareAttribute ("id", id)) return e; const XmlElement* const found = findElementForId (e, id); diff --git a/src/gui/graphics/fonts/juce_Font.cpp b/src/gui/graphics/fonts/juce_Font.cpp index 298ed4d509..ee7c7cc9b3 100644 --- a/src/gui/graphics/fonts/juce_Font.cpp +++ b/src/gui/graphics/fonts/juce_Font.cpp @@ -36,15 +36,15 @@ BEGIN_JUCE_NAMESPACE //============================================================================== -static const float minFontHeight = 0.1f; -static const float maxFontHeight = 10000.0f; -static const float defaultFontHeight = 14.0f; +namespace FontValues +{ + static float limitFontHeight (const float height) throw() + { + return jlimit (0.1f, 10000.0f, height); + } -static const tchar* const juce_defaultFontNameSans = T(""); -static const tchar* const juce_defaultFontNameSerif = T(""); -static const tchar* const juce_defaultFontNameMono = T(""); - -void clearUpDefaultFontNames() throw(); // in juce_LookAndFeel.cpp + static const float defaultFontHeight = 14.0f; +} //============================================================================== Font::SharedFontInternal::SharedFontInternal (const String& typefaceName_, const float height_, const float horizontalScale_, @@ -74,13 +74,13 @@ Font::SharedFontInternal::SharedFontInternal (const SharedFontInternal& other) t //============================================================================== Font::Font() throw() - : font (new SharedFontInternal (juce_defaultFontNameSans, defaultFontHeight, + : font (new SharedFontInternal (getDefaultSansSerifFontName(), FontValues::defaultFontHeight, 1.0f, 0, 0, Font::plain, 0)) { } Font::Font (const float fontHeight, const int styleFlags_) throw() - : font (new SharedFontInternal (juce_defaultFontNameSans, jlimit (minFontHeight, maxFontHeight, fontHeight), + : font (new SharedFontInternal (getDefaultSansSerifFontName(), FontValues::limitFontHeight (fontHeight), 1.0f, 0, 0, styleFlags_, 0)) { } @@ -88,7 +88,7 @@ Font::Font (const float fontHeight, const int styleFlags_) throw() Font::Font (const String& typefaceName_, const float fontHeight, const int styleFlags_) throw() - : font (new SharedFontInternal (typefaceName_, jlimit (minFontHeight, maxFontHeight, fontHeight), + : font (new SharedFontInternal (typefaceName_, FontValues::limitFontHeight (fontHeight), 1.0f, 0, 0, styleFlags_, 0)) { } @@ -109,7 +109,7 @@ Font::~Font() throw() } Font::Font (const Typeface::Ptr& typeface) throw() - : font (new SharedFontInternal (typeface->getName(), defaultFontHeight, + : font (new SharedFontInternal (typeface->getName(), FontValues::defaultFontHeight, 1.0f, 0, 0, Font::plain, typeface)) { } @@ -138,17 +138,20 @@ void Font::dupeInternalIfShared() throw() //============================================================================== const String Font::getDefaultSansSerifFontName() throw() { - return juce_defaultFontNameSans; + static const String name (""); + return name; } const String Font::getDefaultSerifFontName() throw() { - return juce_defaultFontNameSerif; + static const String name (""); + return name; } const String Font::getDefaultMonospacedFontName() throw() { - return juce_defaultFontNameMono; + static const String name (""); + return name; } void Font::setTypefaceName (const String& faceName) throw() @@ -178,7 +181,7 @@ void Font::setFallbackFontName (const String& name) throw() //============================================================================== void Font::setHeight (float newHeight) throw() { - newHeight = jlimit (minFontHeight, maxFontHeight, newHeight); + newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight) { @@ -189,7 +192,7 @@ void Font::setHeight (float newHeight) throw() void Font::setHeightWithoutChangingWidth (float newHeight) throw() { - newHeight = jlimit (minFontHeight, maxFontHeight, newHeight); + newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight) { @@ -215,7 +218,7 @@ void Font::setSizeAndStyle (float newHeight, const float newHorizontalScale, const float newKerningAmount) throw() { - newHeight = jlimit (minFontHeight, maxFontHeight, newHeight); + newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight || font->horizontalScale != newHorizontalScale @@ -332,7 +335,7 @@ void Font::findFonts (Array& destArray) throw() const StringArray names (findAllTypefaceNames()); for (int i = 0; i < names.size(); ++i) - destArray.add (Font (names[i], defaultFontHeight, Font::plain)); + destArray.add (Font (names[i], FontValues::defaultFontHeight, Font::plain)); } @@ -349,7 +352,6 @@ public: ~TypefaceCache() { - clearUpDefaultFontNames(); clearSingletonInstance(); } diff --git a/src/gui/graphics/fonts/juce_Font.h b/src/gui/graphics/fonts/juce_Font.h index 9589f17dd6..cfe5d47a70 100644 --- a/src/gui/graphics/fonts/juce_Font.h +++ b/src/gui/graphics/fonts/juce_Font.h @@ -169,7 +169,7 @@ public: static const String getDefaultMonospacedFontName() throw(); /** Returns the typeface names of the default fonts on the current platform. */ - static void getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw(); + static void getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed); //============================================================================== /** Returns the total height of this font. @@ -331,7 +331,7 @@ public: You can use this instead of findFonts() if you only need their names, and not font objects. */ - static const StringArray findAllTypefaceNames() throw(); + static const StringArray findAllTypefaceNames(); //============================================================================== /** Returns the name of the typeface to be used for rendering glyphs that aren't found diff --git a/src/gui/graphics/fonts/juce_GlyphArrangement.cpp b/src/gui/graphics/fonts/juce_GlyphArrangement.cpp index c1978699c5..776a2662f3 100644 --- a/src/gui/graphics/fonts/juce_GlyphArrangement.cpp +++ b/src/gui/graphics/fonts/juce_GlyphArrangement.cpp @@ -235,7 +235,7 @@ int GlyphArrangement::insertEllipsis (const Font& font, const float maxXPos, { Array dotGlyphs; Array dotXs; - font.getGlyphPositions (T(".."), dotGlyphs, dotXs); + font.getGlyphPositions ("..", dotGlyphs, dotXs); const float dx = dotXs[1]; float xOffset = 0.0f, yOffset = 0.0f; @@ -283,8 +283,8 @@ void GlyphArrangement::addJustifiedText (const Font& font, { int i = lineStartIndex; - if (glyphs.getUnchecked(i)->getCharacter() != T('\n') - && glyphs.getUnchecked(i)->getCharacter() != T('\r')) + if (glyphs.getUnchecked(i)->getCharacter() != '\n' + && glyphs.getUnchecked(i)->getCharacter() != '\r') ++i; const float lineMaxX = glyphs.getUnchecked (lineStartIndex)->getLeft() + maxLineWidth; @@ -295,12 +295,12 @@ void GlyphArrangement::addJustifiedText (const Font& font, const PositionedGlyph* pg = glyphs.getUnchecked (i); const juce_wchar c = pg->getCharacter(); - if (c == T('\r') || c == T('\n')) + if (c == '\r' || c == '\n') { ++i; - if (c == T('\r') && i < glyphs.size() - && glyphs.getUnchecked(i)->getCharacter() == T('\n')) + if (c == '\r' && i < glyphs.size() + && glyphs.getUnchecked(i)->getCharacter() == '\n') ++i; break; @@ -481,7 +481,7 @@ void GlyphArrangement::addFittedText (const Font& f, if ((glyphs.getUnchecked (i)->getRight() - lineStartX) * minimumHorizontalScale < width) { if (glyphs.getUnchecked (i)->isWhitespace() - || glyphs.getUnchecked (i)->getCharacter() == T('-')) + || glyphs.getUnchecked (i)->getCharacter() == '-') { ++i; break; @@ -495,7 +495,7 @@ void GlyphArrangement::addFittedText (const Font& f, for (int back = 1; back < jmin (5, i - startIndex - 1); ++back) { if (glyphs.getUnchecked (i - back)->isWhitespace() - || glyphs.getUnchecked (i - back)->getCharacter() == T('-')) + || glyphs.getUnchecked (i - back)->getCharacter() == '-') { i -= back - 1; break; @@ -718,8 +718,8 @@ void GlyphArrangement::justifyGlyphs (const int startIndex, void GlyphArrangement::spreadOutLine (const int start, const int num, const float targetWidth) { if (start + num < glyphs.size() - && glyphs.getUnchecked (start + num - 1)->getCharacter() != T('\r') - && glyphs.getUnchecked (start + num - 1)->getCharacter() != T('\n')) + && glyphs.getUnchecked (start + num - 1)->getCharacter() != '\r' + && glyphs.getUnchecked (start + num - 1)->getCharacter() != '\n') { int numSpaces = 0; int spacesAtEnd = 0; diff --git a/src/gui/graphics/fonts/juce_TextLayout.cpp b/src/gui/graphics/fonts/juce_TextLayout.cpp index 6bd96b0355..7b90310111 100644 --- a/src/gui/graphics/fonts/juce_TextLayout.cpp +++ b/src/gui/graphics/fonts/juce_TextLayout.cpp @@ -153,7 +153,7 @@ void TextLayout::appendText (const String& text, break; int charType; - if (c == T('\r') || c == T('\n')) + if (c == '\r' || c == '\n') { charType = 0; } @@ -176,7 +176,7 @@ void TextLayout::appendText (const String& text, currentString = String::charToString (c); - if (c == T('\r') && *t == T('\n')) + if (c == '\r' && *t == '\n') currentString += *t++; } else diff --git a/src/gui/graphics/geometry/juce_Path.cpp b/src/gui/graphics/geometry/juce_Path.cpp index 8ca1021f6d..5075973c2b 100644 --- a/src/gui/graphics/geometry/juce_Path.cpp +++ b/src/gui/graphics/geometry/juce_Path.cpp @@ -1407,14 +1407,14 @@ const String Path::toString() const { String n (data.elements [i++], 3); - if (n.endsWithChar (T('0'))) + if (n.endsWithChar ('0')) { do { n = n.dropLastCharacters (1); - } while (n.endsWithChar (T('0'))); + } while (n.endsWithChar ('0')); - if (n.endsWithChar (T('.'))) + if (n.endsWithChar ('.')) n = n.dropLastCharacters (1); } @@ -1436,8 +1436,8 @@ void Path::restoreFromString (const String& stringVersion) clear(); setUsingNonZeroWinding (true); - const tchar* t = stringVersion; - tchar marker = T('m'); + const juce_wchar* t = stringVersion; + juce_wchar marker = 'm'; int numValues = 2; float values [6]; @@ -1447,27 +1447,27 @@ void Path::restoreFromString (const String& stringVersion) const tchar firstChar = token[0]; int startNum = 0; - if (firstChar == T('m') || firstChar == T('l')) + if (firstChar == 'm' || firstChar == 'l') { marker = firstChar; numValues = 2; } - else if (firstChar == T('q')) + else if (firstChar == 'q') { marker = firstChar; numValues = 4; } - else if (firstChar == T('c')) + else if (firstChar == 'c') { marker = firstChar; numValues = 6; } - else if (firstChar == T('z')) + else if (firstChar == 'z') { marker = firstChar; numValues = 0; } - else if (firstChar == T('a')) + else if (firstChar == 'a') { setUsingNonZeroWinding (false); continue; @@ -1483,26 +1483,26 @@ void Path::restoreFromString (const String& stringVersion) switch (marker) { - case T('m'): + case 'm': startNewSubPath (values[0], values[1]); break; - case T('l'): + case 'l': lineTo (values[0], values[1]); break; - case T('q'): + case 'q': quadraticTo (values[0], values[1], values[2], values[3]); break; - case T('c'): + case 'c': cubicTo (values[0], values[1], values[2], values[3], values[4], values[5]); break; - case T('z'): + case 'z': closeSubPath(); break; diff --git a/src/gui/graphics/geometry/juce_PositionedRectangle.cpp b/src/gui/graphics/geometry/juce_PositionedRectangle.cpp index 5c6286df05..fc4796a923 100644 --- a/src/gui/graphics/geometry/juce_PositionedRectangle.cpp +++ b/src/gui/graphics/geometry/juce_PositionedRectangle.cpp @@ -108,11 +108,11 @@ const String PositionedRectangle::toString() const throw() s.preallocateStorage (12); addPosDescription (s, xMode, x); - s << T(' '); + s << ' '; addPosDescription (s, yMode, y); - s << T(' '); + s << ' '; addSizeDescription (s, wMode, w); - s << T(' '); + s << ' '; addSizeDescription (s, hMode, h); return s; @@ -251,53 +251,53 @@ void PositionedRectangle::addPosDescription (String& s, const uint8 mode, const { if ((mode & proportionOfParentSize) != 0) { - s << (roundToInt (value * 100000.0) / 1000.0) << T('%'); + s << (roundToInt (value * 100000.0) / 1000.0) << '%'; } else { s << (roundToInt (value * 100.0) / 100.0); if ((mode & absoluteFromParentBottomRight) != 0) - s << T('R'); + s << 'R'; else if ((mode & absoluteFromParentCentre) != 0) - s << T('C'); + s << 'C'; } if ((mode & anchorAtRightOrBottom) != 0) - s << T('r'); + s << 'r'; else if ((mode & anchorAtCentre) != 0) - s << T('c'); + s << 'c'; } void PositionedRectangle::addSizeDescription (String& s, const uint8 mode, const double value) const throw() { if (mode == proportionalSize) - s << (roundToInt (value * 100000.0) / 1000.0) << T('%'); + s << (roundToInt (value * 100000.0) / 1000.0) << '%'; else if (mode == parentSizeMinusAbsolute) - s << (roundToInt (value * 100.0) / 100.0) << T('M'); + s << (roundToInt (value * 100.0) / 100.0) << 'M'; else s << (roundToInt (value * 100.0) / 100.0); } void PositionedRectangle::decodePosString (const String& s, uint8& mode, double& value) throw() { - if (s.containsChar (T('r'))) + if (s.containsChar ('r')) mode = anchorAtRightOrBottom; - else if (s.containsChar (T('c'))) + else if (s.containsChar ('c')) mode = anchorAtCentre; else mode = anchorAtLeftOrTop; - if (s.containsChar (T('%'))) + if (s.containsChar ('%')) { mode |= proportionOfParentSize; value = s.removeCharacters (T("%rcRC")).getDoubleValue() / 100.0; } else { - if (s.containsChar (T('R'))) + if (s.containsChar ('R')) mode |= absoluteFromParentBottomRight; - else if (s.containsChar (T('C'))) + else if (s.containsChar ('C')) mode |= absoluteFromParentCentre; else mode |= absoluteFromParentTopLeft; @@ -308,12 +308,12 @@ void PositionedRectangle::decodePosString (const String& s, uint8& mode, double& void PositionedRectangle::decodeSizeString (const String& s, uint8& mode, double& value) throw() { - if (s.containsChar (T('%'))) + if (s.containsChar ('%')) { mode = proportionalSize; value = s.upToFirstOccurrenceOf (T("%"), false, false).getDoubleValue() / 100.0; } - else if (s.containsChar (T('M'))) + else if (s.containsChar ('M')) { mode = parentSizeMinusAbsolute; value = s.getDoubleValue(); diff --git a/src/gui/graphics/geometry/juce_Rectangle.h b/src/gui/graphics/geometry/juce_Rectangle.h index a8d331ad20..b11f45082c 100644 --- a/src/gui/graphics/geometry/juce_Rectangle.h +++ b/src/gui/graphics/geometry/juce_Rectangle.h @@ -519,7 +519,7 @@ public: static const Rectangle fromString (const String& stringVersion) { StringArray toks; - toks.addTokens (stringVersion.trim(), JUCE_T(",; \t\r\n"), String::empty); + toks.addTokens (stringVersion.trim(), ",; \t\r\n", String::empty); return Rectangle (toks[0].trim().getIntValue(), toks[1].trim().getIntValue(), diff --git a/src/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp b/src/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp index 9876d8626f..5354789783 100644 --- a/src/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp +++ b/src/gui/graphics/imaging/image_file_formats/juce_JPEGLoader.cpp @@ -361,7 +361,7 @@ bool juce_writeJPEGImageToStream (const Image& image, jpegCompStruct.dct_method = JDCT_FLOAT; jpegCompStruct.optimize_coding = 1; -// jpegCompStruct.smoothing_factor = 10; + //jpegCompStruct.smoothing_factor = 10; if (quality < 0.0f) quality = 0.85f; @@ -373,8 +373,7 @@ bool juce_writeJPEGImageToStream (const Image& image, const int strideBytes = jpegCompStruct.image_width * jpegCompStruct.input_components; JSAMPARRAY buffer = (*jpegCompStruct.mem->alloc_sarray) ((j_common_ptr) &jpegCompStruct, - JPOOL_IMAGE, - strideBytes, 1); + JPOOL_IMAGE, strideBytes, 1); const Image::BitmapData srcData (image, 0, 0, jpegCompStruct.image_width, jpegCompStruct.image_height); diff --git a/src/gui/graphics/imaging/juce_ImageFileFormat.cpp b/src/gui/graphics/imaging/juce_ImageFileFormat.cpp index 59ff16214f..685f4d0b2e 100644 --- a/src/gui/graphics/imaging/juce_ImageFileFormat.cpp +++ b/src/gui/graphics/imaging/juce_ImageFileFormat.cpp @@ -42,7 +42,7 @@ PNGImageFormat::~PNGImageFormat() {} const String PNGImageFormat::getFormatName() { - return T("PNG"); + return "PNG"; } bool PNGImageFormat::canUnderstand (InputStream& in) @@ -85,7 +85,7 @@ void JPEGImageFormat::setQuality (const float newQuality) const String JPEGImageFormat::getFormatName() { - return T("JPEG"); + return "JPEG"; } bool JPEGImageFormat::canUnderstand (InputStream& in) @@ -125,7 +125,7 @@ public: const String getFormatName() { - return T("GIF"); + return "GIF"; } bool canUnderstand (InputStream& in) diff --git a/src/io/files/juce_DirectoryIterator.cpp b/src/io/files/juce_DirectoryIterator.cpp index 0b97004ed4..b567be11dc 100644 --- a/src/io/files/juce_DirectoryIterator.cpp +++ b/src/io/files/juce_DirectoryIterator.cpp @@ -60,7 +60,7 @@ DirectoryIterator::DirectoryIterator (const File& directory, bool isDirectory, isHidden; void* const handle = juce_findFileStart (path, - isRecursive ? T("*") : wc, + isRecursive ? "*" : wc, filename, &isDirectory, &isHidden, 0, 0, 0, 0); if (handle != 0) diff --git a/src/io/files/juce_DirectoryIterator.h b/src/io/files/juce_DirectoryIterator.h index d61025f3de..8de883ca5d 100644 --- a/src/io/files/juce_DirectoryIterator.h +++ b/src/io/files/juce_DirectoryIterator.h @@ -70,7 +70,7 @@ public: */ DirectoryIterator (const File& directory, bool isRecursive, - const String& wildCard = JUCE_T("*"), + const String& wildCard = "*", int whatToLookFor = File::findFiles); /** Destructor. */ diff --git a/src/io/files/juce_File.cpp b/src/io/files/juce_File.cpp index e8243a5486..8f73efdb56 100644 --- a/src/io/files/juce_File.cpp +++ b/src/io/files/juce_File.cpp @@ -107,7 +107,7 @@ static const String parseAbsolutePath (String path) #if JUCE_WINDOWS // Windows.. - path = path.replaceCharacter (T('/'), T('\\')); + path = path.replaceCharacter ('/', '\\'); if (path.startsWithChar (File::separator)) { @@ -125,7 +125,7 @@ static const String parseAbsolutePath (String path) path = File::getCurrentWorkingDirectory().getFullPathName().substring (0, 2) + path; } } - else if (path.indexOfChar (T(':')) < 0) + else if (path.indexOfChar (':') < 0) { if (path.isEmpty()) return String::empty; @@ -143,9 +143,9 @@ static const String parseAbsolutePath (String path) } #else // Mac or Linux.. - path = path.replaceCharacter (T('\\'), T('/')); + path = path.replaceCharacter ('\\', '/'); - if (path.startsWithChar (T('~'))) + if (path.startsWithChar ('~')) { const char* homeDir = 0; @@ -422,7 +422,7 @@ int64 File::hashCode64() const const String File::getFileNameWithoutExtension() const { const int lastSlash = fullPath.lastIndexOfChar (separator) + 1; - const int lastDot = fullPath.lastIndexOfChar (T('.')); + const int lastDot = fullPath.lastIndexOfChar ('.'); if (lastDot > lastSlash) return fullPath.substring (lastSlash, lastDot); @@ -458,11 +458,11 @@ bool File::isAChildOf (const File& potentialParent) const //============================================================================== bool File::isAbsolutePath (const String& path) { - return path.startsWithChar (T('/')) || path.startsWithChar (T('\\')) + return path.startsWithChar ('/') || path.startsWithChar ('\\') #if JUCE_WINDOWS - || (path.isNotEmpty() && ((const String&) path)[1] == T(':')); + || (path.isNotEmpty() && path[1] == ':'); #else - || path.startsWithChar (T('~')); + || path.startsWithChar ('~'); #endif } @@ -478,16 +478,16 @@ const File File::getChildFile (String relativePath) const // it's relative, so remove any ../ or ./ bits at the start. String path (fullPath); - if (relativePath[0] == T('.')) + if (relativePath[0] == '.') { #if JUCE_WINDOWS - relativePath = relativePath.replaceCharacter (T('/'), T('\\')).trimStart(); + relativePath = relativePath.replaceCharacter ('/', '\\').trimStart(); #else - relativePath = relativePath.replaceCharacter (T('\\'), T('/')).trimStart(); + relativePath = relativePath.replaceCharacter ('\\', '/').trimStart(); #endif - while (relativePath[0] == T('.')) + while (relativePath[0] == '.') { - if (relativePath[1] == T('.')) + if (relativePath[1] == '.') { if (relativePath [2] == 0 || relativePath[2] == separator) { @@ -772,7 +772,7 @@ bool File::containsSubDirectories() const String filename; bool itemIsDirectory, itemIsHidden; void* const handle = juce_findFileStart (juce_addTrailingSeparator (fullPath), - T("*"), filename, + "*", filename, &itemIsDirectory, &itemIsHidden, 0, 0, 0, 0); if (handle != 0) @@ -807,12 +807,12 @@ const File File::getNonexistentChildFile (const String& prefix_, String prefix (prefix_); // remove any bracketed numbers that may already be on the end.. - if (prefix.trim().endsWithChar (T(')'))) + if (prefix.trim().endsWithChar (')')) { putNumbersInBrackets = true; - const int openBracks = prefix.lastIndexOfChar (T('(')); - const int closeBracks = prefix.lastIndexOfChar (T(')')); + const int openBracks = prefix.lastIndexOfChar ('('); + const int closeBracks = prefix.lastIndexOfChar (')'); if (openBracks > 0 && closeBracks > openBracks @@ -830,7 +830,7 @@ const File File::getNonexistentChildFile (const String& prefix_, do { if (putNumbersInBrackets) - f = getChildFile (prefix + T('(') + String (num++) + T(')') + suffix); + f = getChildFile (prefix + '(' + String (num++) + ')' + suffix); else f = getChildFile (prefix + String (num++) + suffix); @@ -862,7 +862,7 @@ const String File::getFileExtension() const if (! isDirectory()) { - const int indexOfDot = fullPath.lastIndexOfChar (T('.')); + const int indexOfDot = fullPath.lastIndexOfChar ('.'); if (indexOfDot > fullPath.lastIndexOfChar (separator)) ext = fullPath.substring (indexOfDot); @@ -874,9 +874,9 @@ const String File::getFileExtension() const bool File::hasFileExtension (const String& possibleSuffix) const { if (possibleSuffix.isEmpty()) - return fullPath.lastIndexOfChar (T('.')) <= fullPath.lastIndexOfChar (separator); + return fullPath.lastIndexOfChar ('.') <= fullPath.lastIndexOfChar (separator); - const int semicolon = possibleSuffix.indexOfChar (0, T(';')); + const int semicolon = possibleSuffix.indexOfChar (0, ';'); if (semicolon >= 0) { @@ -887,13 +887,13 @@ bool File::hasFileExtension (const String& possibleSuffix) const { if (fullPath.endsWithIgnoreCase (possibleSuffix)) { - if (possibleSuffix.startsWithChar (T('.'))) + if (possibleSuffix.startsWithChar ('.')) return true; const int dotPos = fullPath.length() - possibleSuffix.length() - 1; if (dotPos >= 0) - return fullPath [dotPos] == T('.'); + return fullPath [dotPos] == '.'; } } @@ -907,11 +907,11 @@ const File File::withFileExtension (const String& newExtension) const String filePart (getFileName()); - int i = filePart.lastIndexOfChar (T('.')); + int i = filePart.lastIndexOfChar ('.'); if (i >= 0) filePart = filePart.substring (0, i); - if (newExtension.isNotEmpty() && ! newExtension.startsWithChar (T('.'))) + if (newExtension.isNotEmpty() && ! newExtension.startsWithChar ('.')) filePart << '.'; return getSiblingFile (filePart + newExtension); @@ -1002,7 +1002,7 @@ const String File::createLegalPathName (const String& original) String s (original); String start; - if (s[1] == T(':')) + if (s[1] == ':') { start = s.substring (0, 2); s = s.substring (2); @@ -1021,7 +1021,7 @@ const String File::createLegalFileName (const String& original) if (len > maxLength) { - const int lastDot = s.lastIndexOfChar (T('.')); + const int lastDot = s.lastIndexOfChar ('.'); if (lastDot > jmax (0, len - 12)) { @@ -1083,9 +1083,9 @@ const String File::getRelativePathFrom (const File& dir) const while (dirPath.isNotEmpty()) { #if JUCE_WINDOWS - thisPath = T("..\\") + thisPath; + thisPath = "..\\" + thisPath; #else - thisPath = T("../") + thisPath; + thisPath = "../" + thisPath; #endif const int sep = dirPath.indexOfChar (separator); @@ -1126,7 +1126,7 @@ int File::getVolumeSerialNumber() const const File File::createTempFile (const String& fileNameEnding) { const File tempFile (getSpecialLocation (tempDirectory) - .getChildFile (T("temp_") + String (Random::getSystemRandom().nextInt())) + .getChildFile ("temp_" + String (Random::getSystemRandom().nextInt())) .withFileExtension (fileNameEnding)); if (tempFile.exists()) diff --git a/src/io/files/juce_File.h b/src/io/files/juce_File.h index 8f70ac8251..5ca66eb35d 100644 --- a/src/io/files/juce_File.h +++ b/src/io/files/juce_File.h @@ -532,7 +532,7 @@ public: int findChildFiles (Array& results, int whatToLookFor, bool searchRecursively, - const String& wildCardPattern = JUCE_T("*")) const; + const String& wildCardPattern = "*") const; /** Searches inside a directory and counts how many files match a wildcard pattern. @@ -551,7 +551,7 @@ public: @see findChildFiles, DirectoryIterator */ int getNumberOfChildFiles (int whatToLookFor, - const String& wildCardPattern = JUCE_T("*")) const; + const String& wildCardPattern = "*") const; /** Returns true if this file is a directory that contains one or more subdirectories. @see isDirectory, findChildFiles diff --git a/src/io/files/juce_FileSearchPath.cpp b/src/io/files/juce_FileSearchPath.cpp index 9b7cc8a7f3..146d4f3c43 100644 --- a/src/io/files/juce_FileSearchPath.cpp +++ b/src/io/files/juce_FileSearchPath.cpp @@ -59,7 +59,7 @@ FileSearchPath& FileSearchPath::operator= (const String& path) void FileSearchPath::init (const String& path) { directories.clear(); - directories.addTokens (path, T(";"), T("\"")); + directories.addTokens (path, ";", "\""); directories.trim(); directories.removeEmptyStrings(); @@ -81,10 +81,10 @@ const String FileSearchPath::toString() const { StringArray directories2 (directories); for (int i = directories2.size(); --i >= 0;) - if (directories2[i].containsChar (T(';'))) + if (directories2[i].containsChar (';')) directories2.set (i, directories2[i].quoted()); - return directories2.joinIntoString (T(";")); + return directories2.joinIntoString (";"); } void FileSearchPath::add (const File& dir, const int insertIndex) diff --git a/src/io/files/juce_FileSearchPath.h b/src/io/files/juce_FileSearchPath.h index 367fbc2750..7ac332daa6 100644 --- a/src/io/files/juce_FileSearchPath.h +++ b/src/io/files/juce_FileSearchPath.h @@ -133,7 +133,7 @@ public: int findChildFiles (Array& results, int whatToLookFor, bool searchRecursively, - const String& wildCardPattern = JUCE_T("*")) const; + const String& wildCardPattern = "*") const; //============================================================================== /** Finds out whether a file is inside one of the path's directories. diff --git a/src/io/files/juce_TemporaryFile.cpp b/src/io/files/juce_TemporaryFile.cpp index 7aa2c93caa..14e43d7985 100644 --- a/src/io/files/juce_TemporaryFile.cpp +++ b/src/io/files/juce_TemporaryFile.cpp @@ -36,7 +36,7 @@ BEGIN_JUCE_NAMESPACE TemporaryFile::TemporaryFile (const String& suffix, const int optionFlags) { createTempFile (File::getSpecialLocation (File::tempDirectory), - T("temp_") + String (Random::getSystemRandom().nextInt()), + "temp_" + String (Random::getSystemRandom().nextInt()), suffix, optionFlags); } @@ -48,7 +48,7 @@ TemporaryFile::TemporaryFile (const File& targetFile_, const int optionFlags) jassert (targetFile != File::nonexistent); createTempFile (targetFile.getParentDirectory(), - targetFile.getFileNameWithoutExtension() + T("_temp") + String (Random::getSystemRandom().nextInt()), + targetFile.getFileNameWithoutExtension() + "_temp" + String (Random::getSystemRandom().nextInt()), targetFile.getFileExtension(), optionFlags); } @@ -57,7 +57,7 @@ void TemporaryFile::createTempFile (const File& parentDirectory, String name, const String& suffix, const int optionFlags) { if ((optionFlags & useHiddenFile) != 0) - name = T(".") + name; + name = "." + name; temporaryFile = parentDirectory.getNonexistentChildFile (name, suffix, (optionFlags & putNumbersInBrackets) != 0); } diff --git a/src/io/files/juce_ZipFile.cpp b/src/io/files/juce_ZipFile.cpp index ab869d100d..f73f5ed9cf 100644 --- a/src/io/files/juce_ZipFile.cpp +++ b/src/io/files/juce_ZipFile.cpp @@ -386,7 +386,7 @@ void ZipFile::uncompressTo (const File& targetDirectory, const File targetFile (targetDirectory.getChildFile (zei.filename)); - if (zei.filename.endsWithChar (T('/'))) + if (zei.filename.endsWithChar ('/')) { targetFile.createDirectory(); // (entry is a directory, not a file) } diff --git a/src/io/network/juce_Socket.cpp b/src/io/network/juce_Socket.cpp index 92fae7d29e..1ebe09b4c7 100644 --- a/src/io/network/juce_Socket.cpp +++ b/src/io/network/juce_Socket.cpp @@ -488,7 +488,7 @@ StreamingSocket* StreamingSocket::waitForNextConnection() const bool StreamingSocket::isLocal() const throw() { - return hostName == T("127.0.0.1"); + return hostName == "127.0.0.1"; } @@ -625,7 +625,7 @@ int DatagramSocket::write (const void* sourceBuffer, const int numBytesToWrite) bool DatagramSocket::isLocal() const throw() { - return hostName == T("127.0.0.1"); + return hostName == "127.0.0.1"; } diff --git a/src/io/network/juce_URL.cpp b/src/io/network/juce_URL.cpp index 6068431618..c8f8840cc7 100644 --- a/src/io/network/juce_URL.cpp +++ b/src/io/network/juce_URL.cpp @@ -41,14 +41,14 @@ URL::URL() URL::URL (const String& url_) : url (url_) { - int i = url.indexOfChar (T('?')); + int i = url.indexOfChar ('?'); if (i >= 0) { do { - const int nextAmp = url.indexOfChar (i + 1, T('&')); - const int equalsPos = url.indexOfChar (i + 1, T('=')); + const int nextAmp = url.indexOfChar (i + 1, '&'); + const int equalsPos = url.indexOfChar (i + 1, '='); if (equalsPos > i + 1) { @@ -103,10 +103,10 @@ static const String getMangledParameters (const StringPairArray& parameters) for (int i = 0; i < parameters.size(); ++i) { if (i > 0) - p += T("&"); + p += '&'; p << URL::addEscapeChars (parameters.getAllKeys() [i], true) - << T("=") + << '=' << URL::addEscapeChars (parameters.getAllValues() [i], true); } @@ -116,7 +116,7 @@ static const String getMangledParameters (const StringPairArray& parameters) const String URL::toString (const bool includeGetParameters) const { if (includeGetParameters && parameters.size() > 0) - return url + T("?") + getMangledParameters (parameters); + return url + "?" + getMangledParameters (parameters); else return url; } @@ -135,17 +135,17 @@ static int findStartOfDomain (const String& url) || CharacterFunctions::indexOfChar (T("+-."), url[i], false) >= 0) ++i; - return url[i] == T(':') ? i + 1 : 0; + return url[i] == ':' ? i + 1 : 0; } const String URL::getDomain() const { int start = findStartOfDomain (url); - while (url[start] == T('/')) + while (url[start] == '/') ++start; - const int end1 = url.indexOfChar (start, T('/')); - const int end2 = url.indexOfChar (start, T(':')); + const int end1 = url.indexOfChar (start, '/'); + const int end2 = url.indexOfChar (start, ':'); const int end = (end1 < 0 || end2 < 0) ? jmax (end1, end2) : jmin (end1, end2); @@ -156,10 +156,10 @@ const String URL::getDomain() const const String URL::getSubPath() const { int start = findStartOfDomain (url); - while (url[start] == T('/')) + while (url[start] == '/') ++start; - const int startOfPath = url.indexOfChar (start, T('/')) + 1; + const int startOfPath = url.indexOfChar (start, '/') + 1; return startOfPath <= 0 ? String::empty : url.substring (startOfPath); @@ -173,20 +173,20 @@ const String URL::getScheme() const const URL URL::withNewSubPath (const String& newPath) const { int start = findStartOfDomain (url); - while (url[start] == T('/')) + while (url[start] == '/') ++start; - const int startOfPath = url.indexOfChar (start, T('/')) + 1; + const int startOfPath = url.indexOfChar (start, '/') + 1; URL u (*this); if (startOfPath > 0) u.url = url.substring (0, startOfPath); - if (! u.url.endsWithChar (T('/'))) + if (! u.url.endsWithChar ('/')) u.url << '/'; - if (newPath.startsWithChar (T('/'))) + if (newPath.startsWithChar ('/')) u.url << newPath.substring (1); else u.url << newPath; @@ -202,19 +202,19 @@ bool URL::isProbablyAWebsiteURL (const String& possibleURL) return true; if (possibleURL.startsWithIgnoreCase (T("file:")) - || possibleURL.containsChar (T('@')) - || possibleURL.endsWithChar (T('.')) - || (! possibleURL.containsChar (T('.')))) + || possibleURL.containsChar ('@') + || possibleURL.endsWithChar ('.') + || (! possibleURL.containsChar ('.'))) return false; if (possibleURL.startsWithIgnoreCase (T("www.")) - && possibleURL.substring (5).containsChar (T('.'))) + && possibleURL.substring (5).containsChar ('.')) return true; const char* commonTLDs[] = { "com", "net", "org", "uk", "de", "fr", "jp" }; for (int i = 0; i < numElementsInArray (commonTLDs); ++i) - if ((possibleURL + T("/")).containsIgnoreCase (T(".") + String (commonTLDs[i]) + T("/"))) + if ((possibleURL + "/").containsIgnoreCase ("." + String (commonTLDs[i]) + "/")) return true; return false; @@ -222,11 +222,11 @@ bool URL::isProbablyAWebsiteURL (const String& possibleURL) bool URL::isProbablyAnEmailAddress (const String& possibleEmailAddress) { - const int atSign = possibleEmailAddress.indexOfChar (T('@')); + const int atSign = possibleEmailAddress.indexOfChar ('@'); return atSign > 0 - && possibleEmailAddress.lastIndexOfChar (T('.')) > (atSign + 1) - && (! possibleEmailAddress.endsWithChar (T('.'))); + && possibleEmailAddress.lastIndexOfChar ('.') > (atSign + 1) + && (! possibleEmailAddress.endsWithChar ('.')); } //============================================================================== @@ -269,7 +269,7 @@ public: headers += extraHeaders; - if (! headers.endsWithChar (T('\n'))) + if (! headers.endsWithChar ('\n')) headers << "\r\n"; handle = juce_openInternetFile (server, headers, postData, isPost, @@ -583,13 +583,7 @@ const String URL::addEscapeChars (const String& s, const bool isParameter) else { const int v = (int) (uint8) c; - - if (v < 0x10) - result << T("%0"); - else - result << T('%'); - - result << String::toHexString (v); + result << (v < 0x10 ? "%0" : "%") << String::toHexString (v); } } diff --git a/src/native/common/juce_posix_NamedPipe.cpp b/src/native/common/juce_posix_NamedPipe.cpp index 35299f20b7..d9153e444b 100644 --- a/src/native/common/juce_posix_NamedPipe.cpp +++ b/src/native/common/juce_posix_NamedPipe.cpp @@ -95,10 +95,10 @@ bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) signal (SIGPIPE, NamedPipeInternal::signalHandler); siginterrupt (SIGPIPE, 1); - const String pipePath (T("/tmp/") + File::createLegalFileName (pipeName)); + const String pipePath ("/tmp/" + File::createLegalFileName (pipeName)); - intern->pipeInName = pipePath + T("_in"); - intern->pipeOutName = pipePath + T("_out"); + intern->pipeInName = pipePath + "_in"; + intern->pipeOutName = pipePath + "_out"; intern->pipeIn = -1; intern->pipeOut = -1; diff --git a/src/native/common/juce_posix_SharedCode.h b/src/native/common/juce_posix_SharedCode.h index e69d69063e..c650398d4b 100644 --- a/src/native/common/juce_posix_SharedCode.h +++ b/src/native/common/juce_posix_SharedCode.h @@ -183,8 +183,8 @@ void JUCE_CALLTYPE Thread::sleep (int millisecs) //============================================================================== -const tchar File::separator = T('/'); -const tchar* File::separatorString = T("/"); +const juce_wchar File::separator = '/'; +const juce_wchar* File::separatorString = T("/"); //============================================================================== const File File::getCurrentWorkingDirectory() @@ -470,7 +470,7 @@ InterProcessLock::InterProcessLock (const String& name_) { #if JUCE_MAC // (don't use getSpecialLocation() to avoid the temp folder being different for each app) - const File temp (File (T("~/Library/Caches/Juce")).getChildFile (name)); + const File temp (File ("~/Library/Caches/Juce").getChildFile (name)); #else const File temp (File::getSpecialLocation (File::tempDirectory).getChildFile (name)); #endif diff --git a/src/native/linux/juce_linux_Audio.cpp b/src/native/linux/juce_linux_Audio.cpp index 255da06fd3..c88d58f336 100644 --- a/src/native/linux/juce_linux_Audio.cpp +++ b/src/native/linux/juce_linux_Audio.cpp @@ -181,7 +181,7 @@ public: if (bitDepth == 0) { error = "device doesn't support a compatible PCM format"; - DBG (T("ALSA error: ") + error + T("\n")); + DBG ("ALSA error: " + error + "\n"); return false; } @@ -326,7 +326,7 @@ private: return false; error = snd_strerror (errorNum); - DBG (T("ALSA error: ") + error + T("\n")); + DBG ("ALSA error: " + error + "\n"); return true; } }; @@ -612,7 +612,7 @@ private: return false; error = snd_strerror (errorNum); - DBG (T("ALSA error: ") + error + T("\n")); + DBG ("ALSA error: " + error + "\n"); return true; } @@ -632,10 +632,10 @@ private: unsigned int i; for (i = 0; i < maxChansOut; ++i) - channelNamesOut.add (T("channel ") + String ((int) i + 1)); + channelNamesOut.add ("channel " + String ((int) i + 1)); for (i = 0; i < maxChansIn; ++i) - channelNamesIn.add (T("channel ") + String ((int) i + 1)); + channelNamesIn.add ("channel " + String ((int) i + 1)); } }; @@ -647,7 +647,7 @@ public: ALSAAudioIODevice (const String& deviceName, const String& inputId_, const String& outputId_) - : AudioIODevice (deviceName, T("ALSA")), + : AudioIODevice (deviceName, "ALSA"), inputId (inputId_), outputId (outputId_), isOpen_ (false), @@ -827,7 +827,7 @@ class ALSAAudioIODeviceType : public AudioIODeviceType public: //============================================================================== ALSAAudioIODeviceType() - : AudioIODeviceType (T("ALSA")), + : AudioIODeviceType ("ALSA"), hasScanned (false) { } @@ -973,10 +973,10 @@ private: getDeviceProperties (id, minChansOut, maxChansOut, minChansIn, maxChansIn, rates); - DBG (T("ALSA device: ") + id - + T(" outs=") + String ((int) minChansOut) + T("-") + String ((int) maxChansOut) - + T(" ins=") + String ((int) minChansIn) + T("-") + String ((int) maxChansIn) - + T(" rates=") + String (rates.size())); + DBG ("ALSA device: " + id + + " outs=" + String ((int) minChansOut) + "-" + String ((int) maxChansOut) + + " ins=" + String ((int) minChansIn) + "-" + String ((int) maxChansIn) + + " rates=" + String (rates.size())); isInput = maxChansIn > 0; isOutput = maxChansOut > 0; diff --git a/src/native/linux/juce_linux_AudioCDReader.cpp b/src/native/linux/juce_linux_AudioCDReader.cpp index 65257511e3..b76dcd6c21 100644 --- a/src/native/linux/juce_linux_AudioCDReader.cpp +++ b/src/native/linux/juce_linux_AudioCDReader.cpp @@ -30,7 +30,7 @@ //============================================================================== AudioCDReader::AudioCDReader() - : AudioFormatReader (0, T("CD Audio")) + : AudioFormatReader (0, "CD Audio") { } diff --git a/src/native/linux/juce_linux_Clipboard.cpp b/src/native/linux/juce_linux_Clipboard.cpp index 63f4749974..f4d5aa2cb3 100644 --- a/src/native/linux/juce_linux_Clipboard.cpp +++ b/src/native/linux/juce_linux_Clipboard.cpp @@ -210,7 +210,7 @@ void juce_handleSelectionRequest (XSelectionRequestEvent &evt) } //============================================================================== -void SystemClipboard::copyTextToClipboard (const String& clipText) throw() +void SystemClipboard::copyTextToClipboard (const String& clipText) { initSelectionAtoms(); localClipboardContent = clipText; @@ -219,7 +219,7 @@ void SystemClipboard::copyTextToClipboard (const String& clipText) throw() XSetSelectionOwner (display, atom_CLIPBOARD, juce_messageWindowHandle, CurrentTime); } -const String SystemClipboard::getTextFromClipboard() throw() +const String SystemClipboard::getTextFromClipboard() { initSelectionAtoms(); diff --git a/src/native/linux/juce_linux_FileChooser.cpp b/src/native/linux/juce_linux_FileChooser.cpp index e8bcdebdf1..4b7975cdd8 100644 --- a/src/native/linux/juce_linux_FileChooser.cpp +++ b/src/native/linux/juce_linux_FileChooser.cpp @@ -39,7 +39,7 @@ void FileChooser::showPlatformDialog (Array& results, bool selectMultipleFiles, FilePreviewComponent* previewComponent) { - const tchar* const separator = T(":"); + const String separator (":"); String command ("zenity --file-selection"); if (title.isNotEmpty()) diff --git a/src/native/linux/juce_linux_Files.cpp b/src/native/linux/juce_linux_Files.cpp index f840d36418..e5d3098103 100644 --- a/src/native/linux/juce_linux_Files.cpp +++ b/src/native/linux/juce_linux_Files.cpp @@ -116,7 +116,7 @@ bool juce_copyFile (const String& s, const String& d) const StringArray juce_getFileSystemRoots() { StringArray s; - s.add (T("/")); + s.add ("/"); return s; } @@ -166,7 +166,7 @@ bool File::isOnRemovableDrive() const bool File::isHidden() const { - return getFileName().startsWithChar (T('.')); + return getFileName().startsWithChar ('.'); } //============================================================================== @@ -211,7 +211,7 @@ const File File::getSpecialLocation (const SpecialLocationType type) if (! tmp.isDirectory()) { - tmp = T("/tmp"); + tmp = "/tmp"; if (! tmp.isDirectory()) tmp = File::getCurrentWorkingDirectory(); @@ -262,10 +262,10 @@ bool File::moveToTrash() const if (! exists()) return true; - File trashCan (T("~/.Trash")); + File trashCan ("~/.Trash"); if (! trashCan.isDirectory()) - trashCan = T("~/.local/share/Trash/files"); + trashCan = "~/.local/share/Trash/files"; if (! trashCan.isDirectory()) return false; @@ -352,8 +352,8 @@ void* juce_findFileStart (const String& directory, const String& wildCard, Strin ff->parentDir += File::separator; ff->wildCard = wildCard; - if (wildCard == T("*.*")) - ff->wildCard = T("*"); + if (wildCard == "*.*") + ff->wildCard = "*"; ff->dir = d; @@ -412,9 +412,9 @@ bool juce_launchFile (const String& fileName, StringArray cmdLines; for (int i = 0; i < numElementsInArray (browserNames); ++i) - cmdLines.add (String (browserNames[i]) + T(" ") + cmdString.trim().quoted()); + cmdLines.add (String (browserNames[i]) + " " + cmdString.trim().quoted()); - cmdString = cmdLines.joinIntoString (T(" || ")); + cmdString = cmdLines.joinIntoString (" || "); } const char* const argv[4] = { "/bin/sh", "-c", cmdString.toUTF8(), 0 }; diff --git a/src/native/linux/juce_linux_Fonts.cpp b/src/native/linux/juce_linux_Fonts.cpp index 979819e006..d0e3fd352b 100644 --- a/src/native/linux/juce_linux_Fonts.cpp +++ b/src/native/linux/juce_linux_Fonts.cpp @@ -47,14 +47,14 @@ public: }; //============================================================================== - FreeTypeFontFace (const String& familyName) throw() + FreeTypeFontFace (const String& familyName) : hasSerif (false), monospaced (false) { family = familyName; } - void setFileName (const String& name, const int faceIndex, FontStyle style) throw() + void setFileName (const String& name, const int faceIndex, FontStyle style) { if (names [(int) style].fileName.isEmpty()) { @@ -89,7 +89,7 @@ class FreeTypeInterface : public DeletedAtShutdown { public: //============================================================================== - FreeTypeInterface() throw() + FreeTypeInterface() : lastFace (0), lastBold (false), lastItalic (false) @@ -97,7 +97,7 @@ public: if (FT_Init_FreeType (&ftLib) != 0) { ftLib = 0; - DBG (T("Failed to initialize FreeType")); + DBG ("Failed to initialize FreeType"); } StringArray fontDirs; @@ -111,7 +111,7 @@ public: if (fontsInfo != 0) { - forEachXmlChildElementWithTagName (*fontsInfo, e, T("dir")) + forEachXmlChildElementWithTagName (*fontsInfo, e, "dir") { fontDirs.add (e->getAllSubText().trim()); } @@ -127,7 +127,7 @@ public: enumerateFaces (fontDirs[i]); } - ~FreeTypeInterface() throw() + ~FreeTypeInterface() { if (lastFace != 0) FT_Done_Face (lastFace); @@ -139,8 +139,7 @@ public: } //============================================================================== - FreeTypeFontFace* findOrCreate (const String& familyName, - const bool create = false) throw() + FreeTypeFontFace* findOrCreate (const String& familyName, const bool create = false) { for (int i = 0; i < faces.size(); i++) if (faces[i]->getFamilyName() == familyName) @@ -156,7 +155,7 @@ public: } // Enumerate all font faces available in a given directory - void enumerateFaces (const String& path) throw() + void enumerateFaces (const String& path) { File dirPath (path); if (path.isEmpty() || ! dirPath.isDirectory()) @@ -168,9 +167,9 @@ public: { File possible (di.getFile()); - if (possible.hasFileExtension (T("ttf")) - || possible.hasFileExtension (T("pfb")) - || possible.hasFileExtension (T("pcf"))) + if (possible.hasFileExtension ("ttf") + || possible.hasFileExtension ("pfb") + || possible.hasFileExtension ("pcf")) { FT_Face face; int faceIndex = 0; @@ -216,9 +215,7 @@ public: } // Create a FreeType face object for a given font - FT_Face createFT_Face (const String& fontName, - const bool bold, - const bool italic) throw() + FT_Face createFT_Face (const String& fontName, const bool bold, const bool italic) { FT_Face face = 0; @@ -288,7 +285,7 @@ public: return face; } - bool addGlyph (FT_Face face, CustomTypeface& dest, uint32 character) throw() + bool addGlyph (FT_Face face, CustomTypeface& dest, uint32 character) { const unsigned int glyphIndex = FT_Get_Char_Index (face, character); const float height = (float) (face->ascender - face->descender); @@ -394,7 +391,7 @@ public: return true; } - void addKerning (FT_Face face, CustomTypeface& dest, const uint32 character, const uint32 glyphIndex) throw() + void addKerning (FT_Face face, CustomTypeface& dest, const uint32 character, const uint32 glyphIndex) { const float height = (float) (face->ascender - face->descender); @@ -418,7 +415,7 @@ public: // Add a glyph to a font bool addGlyphToFont (const uint32 character, const tchar* fontName, bool bold, bool italic, - CustomTypeface& dest) throw() + CustomTypeface& dest) { FT_Face face = createFT_Face (fontName, bold, italic); @@ -429,27 +426,27 @@ public: } //============================================================================== - void getFamilyNames (StringArray& familyNames) const throw() + void getFamilyNames (StringArray& familyNames) const { for (int i = 0; i < faces.size(); i++) familyNames.add (faces[i]->getFamilyName()); } - void getMonospacedNames (StringArray& monoSpaced) const throw() + void getMonospacedNames (StringArray& monoSpaced) const { for (int i = 0; i < faces.size(); i++) if (faces[i]->getMonospaced()) monoSpaced.add (faces[i]->getFamilyName()); } - void getSerifNames (StringArray& serif) const throw() + void getSerifNames (StringArray& serif) const { for (int i = 0; i < faces.size(); i++) if (faces[i]->getSerif()) serif.add (faces[i]->getFamilyName()); } - void getSansSerifNames (StringArray& sansSerif) const throw() + void getSansSerifNames (StringArray& sansSerif) const { for (int i = 0; i < faces.size(); i++) if (! faces[i]->getSerif()) @@ -482,7 +479,7 @@ public: if (face == 0) { #ifdef JUCE_DEBUG - String msg (T("Failed to create typeface: ")); + String msg ("Failed to create typeface: "); msg << font.getTypefaceName() << " " << (font.isBold() ? 'B' : ' ') << (font.isItalic() ? 'I' : ' '); DBG (msg); #endif @@ -509,7 +506,7 @@ const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) } //============================================================================== -const StringArray Font::findAllTypefaceNames() throw() +const StringArray Font::findAllTypefaceNames() { StringArray s; FreeTypeInterface::getInstance()->getFamilyNames (s); @@ -567,7 +564,7 @@ static const String linux_getDefaultMonospacedFontName() return pickBestFont (allFonts, "Bitstream Vera Sans Mono, Courier, Sans Mono, Mono"); } -void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw() +void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) { defaultSans = linux_getDefaultSansSerifFontName(); defaultSerif = linux_getDefaultSerifFontName(); diff --git a/src/native/linux/juce_linux_JackAudio.cpp b/src/native/linux/juce_linux_JackAudio.cpp index 607eb83a9d..f5854da293 100644 --- a/src/native/linux/juce_linux_JackAudio.cpp +++ b/src/native/linux/juce_linux_JackAudio.cpp @@ -122,7 +122,7 @@ public: JackAudioIODevice (const String& deviceName, const String& inputId_, const String& outputId_) - : AudioIODevice (deviceName, T("JACK")), + : AudioIODevice (deviceName, "JACK"), inputId (inputId_), outputId (outputId_), isOpen_ (false), @@ -216,7 +216,7 @@ public: { if (client == 0) { - lastError = T("No JACK client running"); + lastError = "No JACK client running"; return lastError; } @@ -455,7 +455,7 @@ class JackAudioIODeviceType : public AudioIODeviceType public: //============================================================================== JackAudioIODeviceType() - : AudioIODeviceType (T("JACK")), + : AudioIODeviceType ("JACK"), hasScanned (false) { } diff --git a/src/native/linux/juce_linux_Messaging.cpp b/src/native/linux/juce_linux_Messaging.cpp index 9e8961d4ba..58338c3747 100644 --- a/src/native/linux/juce_linux_Messaging.cpp +++ b/src/native/linux/juce_linux_Messaging.cpp @@ -152,7 +152,7 @@ static XIOErrorHandler oldIOErrorHandler = (XIOErrorHandler) 0; // Usually happens when client-server connection is broken static int ioErrorHandler (Display* display) { - DBG (T("ERROR: connection to X server broken.. terminating.")); + DBG ("ERROR: connection to X server broken.. terminating."); errorOccurred = true; @@ -174,7 +174,7 @@ static int errorHandler (Display* display, XErrorEvent* event) XGetErrorDatabaseText (display, "XRequest", String (event->request_code).toCString(), "Unknown", requestStr, 64); - DBG (T("ERROR: X returned ") + String (errorStr) + T(" for operation ") + String (requestStr)); + DBG ("ERROR: X returned " + String (errorStr) + " for operation " + String (requestStr)); #endif return 0; diff --git a/src/native/linux/juce_linux_Midi.cpp b/src/native/linux/juce_linux_Midi.cpp index 7d8df59f8c..f940cef29f 100644 --- a/src/native/linux/juce_linux_Midi.cpp +++ b/src/native/linux/juce_linux_Midi.cpp @@ -280,7 +280,7 @@ public: MidiInputThread (MidiInput* const midiInput_, snd_seq_t* const seqHandle_, MidiInputCallback* const callback_) - : Thread (T("Juce MIDI Input")), + : Thread ("Juce MIDI Input"), midiInput (midiInput_), seqHandle (seqHandle_), callback (callback_) diff --git a/src/native/linux/juce_linux_Network.cpp b/src/native/linux/juce_linux_Network.cpp index 1208cbec34..f6e20b7a75 100644 --- a/src/native/linux/juce_linux_Network.cpp +++ b/src/native/linux/juce_linux_Network.cpp @@ -219,19 +219,19 @@ public: // NB - using charToString() here instead of just T(" "), because that was // causing a mysterious gcc internal compiler error... - const int statusCode = responseHeader.fromFirstOccurrenceOf (String::charToString (T(' ')), false, false) + const int statusCode = responseHeader.fromFirstOccurrenceOf (String::charToString (' '), false, false) .substring (0, 3).getIntValue(); //int contentLength = findHeaderItem (lines, T("Content-Length:")).getIntValue(); //bool isChunked = findHeaderItem (lines, T("Transfer-Encoding:")).equalsIgnoreCase ("chunked"); - String location (findHeaderItem (lines, T("Location:"))); + String location (findHeaderItem (lines, "Location:")); if (statusCode >= 300 && statusCode < 400 && location.isNotEmpty()) { if (! location.startsWithIgnoreCase (T("http://"))) - location = T("http://") + location; + location = "http://" + location; if (levelsOfRedirection++ < 3) return open (location, headers, postData, isPost, callback, callbackContext, timeOutMs); @@ -397,7 +397,7 @@ private: if (nextSlash >= 0) path = url.substring (nextSlash); else - path = T("/"); + path = "/"; return true; } diff --git a/src/native/linux/juce_linux_SystemStats.cpp b/src/native/linux/juce_linux_SystemStats.cpp index 01dc5a8e23..48375497a5 100644 --- a/src/native/linux/juce_linux_SystemStats.cpp +++ b/src/native/linux/juce_linux_SystemStats.cpp @@ -41,7 +41,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw() const String SystemStats::getOperatingSystemName() throw() { - return T("Linux"); + return "Linux"; } bool SystemStats::isOperatingSystem64Bit() throw() diff --git a/src/native/mac/juce_iphone_Audio.cpp b/src/native/mac/juce_iphone_Audio.cpp index 6b13f077db..1827bc82ef 100644 --- a/src/native/mac/juce_iphone_Audio.cpp +++ b/src/native/mac/juce_iphone_Audio.cpp @@ -34,7 +34,7 @@ class IPhoneAudioIODevice : public AudioIODevice public: //============================================================================== IPhoneAudioIODevice (const String& deviceName) - : AudioIODevice (deviceName, T("Audio")), + : AudioIODevice (deviceName, "Audio"), audioUnit (0), isRunning (false), callback (0), @@ -138,8 +138,7 @@ public: isRunning = true; propertyChanged (0, 0, 0); // creates and starts the AU - lastError = audioUnit != 0 ? String::empty - : T("Couldn't open the device"); + lastError = audioUnit != 0 ? "" : "Couldn't open the device"; return lastError; } @@ -529,7 +528,7 @@ class IPhoneAudioIODeviceType : public AudioIODeviceType public: //============================================================================== IPhoneAudioIODeviceType() - : AudioIODeviceType (T("iPhone Audio")) + : AudioIODeviceType ("iPhone Audio") { } diff --git a/src/native/mac/juce_iphone_UIViewComponentPeer.mm b/src/native/mac/juce_iphone_UIViewComponentPeer.mm index 2c56adc26e..0b66656d57 100644 --- a/src/native/mac/juce_iphone_UIViewComponentPeer.mm +++ b/src/native/mac/juce_iphone_UIViewComponentPeer.mm @@ -759,7 +759,7 @@ BOOL UIViewComponentPeer::textFieldShouldReturn() if (target != 0) { - target->insertTextAtCaret (T("\n")); + target->insertTextAtCaret ("\n"); updateHiddenTextContent (target); } diff --git a/src/native/mac/juce_mac_CoreAudio.cpp b/src/native/mac/juce_mac_CoreAudio.cpp index c33a426692..0c5c219f10 100644 --- a/src/native/mac/juce_mac_CoreAudio.cpp +++ b/src/native/mac/juce_mac_CoreAudio.cpp @@ -48,7 +48,7 @@ if (err == noErr) return true; - Logger::writeToLog (T("CoreAudio error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); + Logger::writeToLog ("CoreAudio error: " + String (lineNum) + " - " + String::toHexString ((int) err)); jassertfalse return false; } @@ -288,7 +288,7 @@ public: if (ok) { sampleRates.add (possibleRates[i]); - rates << possibleRates[i] << T(" "); + rates << possibleRates[i] << ' '; } } } @@ -300,7 +300,7 @@ public: rates << sampleRate; } - log (T("sr: ") + rates); + log ("sr: " + rates); inputLatency = 0; outputLatency = 0; @@ -318,7 +318,7 @@ public: if (AudioObjectGetPropertyData (deviceID, &pa, 0, 0, &size, &lat) == noErr) outputLatency = (int) lat; - log (T("lat: ") + String (inputLatency) + T(" ") + String (outputLatency)); + log ("lat: " + String (inputLatency) + " " + String (outputLatency)); inChanNames.clear(); outChanNames.clear(); @@ -1117,7 +1117,7 @@ class CoreAudioIODeviceType : public AudioIODeviceType public: //============================================================================== CoreAudioIODeviceType() - : AudioIODeviceType (T("CoreAudio")), + : AudioIODeviceType ("CoreAudio"), hasScanned (false) { } @@ -1163,7 +1163,7 @@ public: const String nameString (String::fromUTF8 (name, (int) strlen (name))); if (! alreadyLogged) - log (T("CoreAudio device: ") + nameString); + log ("CoreAudio device: " + nameString); const int numIns = getNumChannels (devs[i], true); const int numOuts = getNumChannels (devs[i], false); diff --git a/src/native/mac/juce_mac_CoreMidi.cpp b/src/native/mac/juce_mac_CoreMidi.cpp index a1726c669c..3e8ec6009c 100644 --- a/src/native/mac/juce_mac_CoreMidi.cpp +++ b/src/native/mac/juce_mac_CoreMidi.cpp @@ -38,7 +38,7 @@ static bool logAnyErrorsMidi (const OSStatus err, const int lineNum) if (err == noErr) return true; - log (T("CoreMidi error: ") + String (lineNum) + T(" - ") + String::toHexString ((int)err)); + log ("CoreMidi error: " + String (lineNum) + " - " + String::toHexString ((int) err)); jassertfalse return false; } @@ -103,7 +103,7 @@ static const String getEndpointName (MIDIEndpointRef endpoint, bool isExternal) else if (! result.startsWithIgnoreCase (s)) { // prepend the device name to the entity name - result = (s + T(" ") + result).trimEnd(); + result = (s + " " + result).trimEnd(); } } @@ -219,7 +219,7 @@ static bool makeSureClientExists() { if (! hasGlobalClientBeenCreated) { - String name (T("JUCE")); + String name ("JUCE"); if (JUCEApplication::getInstance() != 0) name = JUCEApplication::getInstance()->getApplicationName(); @@ -265,7 +265,7 @@ MidiOutput* MidiOutput::openDevice (int index) CFStringRef pname; if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) { - log (T("CoreMidi - opening out: ") + PlatformUtilities::cfStringToJuceString (pname)); + log ("CoreMidi - opening out: " + PlatformUtilities::cfStringToJuceString (pname)); if (makeSureClientExists()) { @@ -540,7 +540,7 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) if (OK (MIDIObjectGetStringProperty (endPoint, kMIDIPropertyName, &pname))) { - log (T("CoreMidi - opening inp: ") + PlatformUtilities::cfStringToJuceString (pname)); + log ("CoreMidi - opening inp: " + PlatformUtilities::cfStringToJuceString (pname)); if (makeSureClientExists()) { diff --git a/src/native/mac/juce_mac_Files.mm b/src/native/mac/juce_mac_Files.mm index 12683fb141..3a0b3bd333 100644 --- a/src/native/mac/juce_mac_Files.mm +++ b/src/native/mac/juce_mac_Files.mm @@ -102,7 +102,7 @@ bool juce_copyFile (const String& src, const String& dst) const StringArray juce_getFileSystemRoots() { StringArray s; - s.add (T("/")); + s.add ("/"); return s; } @@ -160,7 +160,7 @@ bool File::isOnRemovableDrive() const static bool juce_isHiddenFile (const String& path) { #if JUCE_IPHONE - return File (path).getFileName().startsWithChar (T('.')); + return File (path).getFileName().startsWithChar ('.'); #else FSRef ref; if (! PlatformUtilities::makeFSRefFromPath (&ref, path)) @@ -226,7 +226,7 @@ const File File::getSpecialLocation (const SpecialLocationType type) case tempDirectory: { - File tmp (T("~/Library/Caches/") + juce_getExecutableFile().getFileNameWithoutExtension()); + File tmp ("~/Library/Caches/" + juce_getExecutableFile().getFileNameWithoutExtension()); tmp.createDirectory(); return tmp.getFullPathName(); @@ -475,7 +475,7 @@ bool juce_launchFile (const String& fileName, const String& parameters) } else { - ok = juce_launchExecutable (T("\"") + fileName + T("\" ") + parameters); + ok = juce_launchExecutable ("\"" + fileName + "\" " + parameters); } } diff --git a/src/native/mac/juce_mac_Fonts.mm b/src/native/mac/juce_mac_Fonts.mm index 30d0fa379a..1e88742bf1 100644 --- a/src/native/mac/juce_mac_Fonts.mm +++ b/src/native/mac/juce_mac_Fonts.mm @@ -489,7 +489,7 @@ const Typeface::Ptr Typeface::createSystemTypefaceFor (const Font& font) } //============================================================================== -const StringArray Font::findAllTypefaceNames() throw() +const StringArray Font::findAllTypefaceNames() { StringArray names; @@ -508,7 +508,7 @@ const StringArray Font::findAllTypefaceNames() throw() return names; } -void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw() +void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) { #if JUCE_IPHONE defaultSans = "Helvetica"; diff --git a/src/native/mac/juce_mac_MessageManager.mm b/src/native/mac/juce_mac_MessageManager.mm index 0702d7a06e..498fa62487 100644 --- a/src/native/mac/juce_mac_MessageManager.mm +++ b/src/native/mac/juce_mac_MessageManager.mm @@ -93,7 +93,7 @@ public: for (unsigned int i = 0; i < [filenames count]; ++i) { String filename (nsStringToJuce ((NSString*) [filenames objectAtIndex: i])); - if (filename.containsChar (T(' '))) + if (filename.containsChar (' ')) filename = filename.quoted('"'); files.add (filename); @@ -101,7 +101,7 @@ public: if (files.size() > 0 && JUCEApplication::getInstance() != 0) { - JUCEApplication::getInstance()->anotherInstanceStarted (files.joinIntoString (T(" "))); + JUCEApplication::getInstance()->anotherInstanceStarted (files.joinIntoString (" ")); } } diff --git a/src/native/mac/juce_mac_Network.mm b/src/native/mac/juce_mac_Network.mm index 2fce7ab4d6..dd6b8c4804 100644 --- a/src/native/mac/juce_mac_Network.mm +++ b/src/native/mac/juce_mac_Network.mm @@ -161,7 +161,7 @@ class JuceURLConnectionMessageThread : public Thread public: JuceURLConnectionMessageThread (JuceURLConnection* owner_) - : Thread (T("http connection")), + : Thread ("http connection"), owner (owner_) { } diff --git a/src/native/mac/juce_mac_Strings.mm b/src/native/mac/juce_mac_Strings.mm index 429c01089b..5897392d78 100644 --- a/src/native/mac/juce_mac_Strings.mm +++ b/src/native/mac/juce_mac_Strings.mm @@ -141,7 +141,7 @@ const String PlatformUtilities::convertToPrecomposedUnicode (const String& s) //============================================================================== #if ! JUCE_ONLY_BUILD_CORE_LIBRARY -void SystemClipboard::copyTextToClipboard (const String& text) throw() +void SystemClipboard::copyTextToClipboard (const String& text) { #if JUCE_IPHONE [[UIPasteboard generalPasteboard] setValue: juceStringToNS (text) @@ -155,7 +155,7 @@ void SystemClipboard::copyTextToClipboard (const String& text) throw() #endif } -const String SystemClipboard::getTextFromClipboard() throw() +const String SystemClipboard::getTextFromClipboard() { #if JUCE_IPHONE NSString* text = [[UIPasteboard generalPasteboard] valueForPasteboardType: @"public.text"]; diff --git a/src/native/mac/juce_mac_SystemStats.mm b/src/native/mac/juce_mac_SystemStats.mm index ea07f56d7b..1e17ce069a 100644 --- a/src/native/mac/juce_mac_SystemStats.mm +++ b/src/native/mac/juce_mac_SystemStats.mm @@ -130,7 +130,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw() const String SystemStats::getOperatingSystemName() throw() { - return T("Mac OS X"); + return "Mac OS X"; } bool SystemStats::isOperatingSystem64Bit() throw() diff --git a/src/native/windows/juce_win32_ASIO.cpp b/src/native/windows/juce_win32_ASIO.cpp index e7f59576e8..c2172bedf7 100644 --- a/src/native/windows/juce_win32_ASIO.cpp +++ b/src/native/windows/juce_win32_ASIO.cpp @@ -60,7 +60,7 @@ static void logError (const String& context, long error) else if (error == ASE_NoMemory) err = "Out of memory"; - log (T("!!error: ") + context + T(" - ") + err); + log ("!!error: " + context + " - " + err); } #else #define logError(a, b) {} @@ -82,7 +82,7 @@ public: ASIOAudioIODevice (const String& name_, const CLSID classId_, const int slotNumber, const String& optionalDllForDirectLoading_) - : AudioIODevice (name_, T("ASIO")), + : AudioIODevice (name_, "ASIO"), asioObject (0), classId (classId_), optionalDllForDirectLoading (optionalDllForDirectLoading_), @@ -131,11 +131,11 @@ public: if (err == 0) { sampleRates.add ((int) possibleSampleRates[index]); - log (T("rate: ") + String ((int) possibleSampleRates[index])); + log ("rate: " + String ((int) possibleSampleRates[index])); } else if (err != ASE_NoClock) { - logError (T("CanSampleRate"), err); + logError ("CanSampleRate", err); } } @@ -143,7 +143,7 @@ public: { double cr = 0; const long err = asioObject->getSampleRate (&cr); - log (T("No sample rates supported - current rate: ") + String ((int) cr)); + log ("No sample rates supported - current rate: " + String ((int) cr)); if (err == 0) sampleRates.add ((int) cr); @@ -321,7 +321,7 @@ public: if (currentSampleRate != sampleRate) { - log (T("ASIO samplerate: ") + String (currentSampleRate) + T(" to ") + String (sampleRate)); + log ("ASIO samplerate: " + String (currentSampleRate) + " to " + String (sampleRate)); err = asioObject->setSampleRate (sampleRate); if (err == ASE_NoClock && numSources > 0) @@ -358,7 +358,7 @@ public: if (error.isNotEmpty()) { - log (T("ASIOInit: ") + error); + log ("ASIOInit: " + error); } needToReset = false; @@ -426,7 +426,7 @@ public: log ("disposing buffers"); err = asioObject->disposeBuffers(); - log (T("creating buffers: ") + String (totalBuffers) + T(", ") + String (currentBlockSizeSamples)); + log ("creating buffers: " + String (totalBuffers) + ", " + String (currentBlockSizeSamples)); err = asioObject->createBuffers (bufferInfos, totalBuffers, currentBlockSizeSamples, @@ -513,7 +513,7 @@ public: for (i = types.size(); --i >= 0;) { - log (T("channel format: ") + String (types[i])); + log ("channel format: " + String (types[i])); } jassert (n <= totalBuffers); @@ -542,10 +542,7 @@ public: } else { - log (T("ASIO latencies: ") - + String ((int) outputLatency) - + T(", ") - + String ((int) inputLatency)); + log ("ASIO latencies: " + String ((int) outputLatency) + ", " + String ((int) inputLatency)); } isOpen_ = true; @@ -741,7 +738,7 @@ public: const int spent = (int) Time::getMillisecondCounter() - (int) started; - log (T("spent: ") + String (spent)); + log ("spent: " + String (spent)); if (spent > 300) { @@ -932,7 +929,7 @@ private: modalWindow.enterModalState(); // open the device and get its info.. - log (T("opening ASIO device: ") + getName()); + log ("opening ASIO device: " + getName()); needToReset = false; isReSync = false; @@ -967,12 +964,12 @@ private: if (asioObject != 0 && (err = asioObject->getChannels (&totalNumInputChans, &totalNumOutputChans)) == 0) { - log (String ((int) totalNumInputChans) + T(" in, ") + String ((int) totalNumOutputChans) + T(" out")); + log (String ((int) totalNumInputChans) + " in, " + String ((int) totalNumOutputChans) + " out"); if ((err = asioObject->getBufferSize (&minSize, &maxSize, &preferredSize, &granularity)) == 0) { // find a list of buffer sizes.. - log (String ((int) minSize) + T(" ") + String ((int) maxSize) + T(" ") + String ((int)preferredSize) + T(" ") + String ((int)granularity)); + log (String ((int) minSize) + " " + String ((int) maxSize) + " " + String ((int) preferredSize) + " " + String ((int) granularity)); if (granularity >= 0) { @@ -1027,9 +1024,7 @@ private: log ("ASIO - no latencies"); } - log (String ("latencies: ") - + String ((int) inputLatency) - + T(", ") + String ((int) outputLatency)); + log ("latencies: " + String ((int) inputLatency) + ", " + String ((int) outputLatency)); // create some dummy buffers now.. because cubase does.. numActiveInputChans = 0; @@ -1083,8 +1078,7 @@ private: jassertfalse } - log (T("creating buffers (dummy): ") + String (numChans) - + T(", ") + String ((int) preferredSize)); + log ("creating buffers (dummy): " + String (numChans) + ", " + String ((int) preferredSize)); if (preferredSize > 0) { @@ -1103,8 +1097,7 @@ private: totalNumInputChans = newInps; totalNumOutputChans = newOuts; - log (String ((int) totalNumInputChans) + T(" in; ") - + String ((int) totalNumOutputChans) + T(" out")); + log (String ((int) totalNumInputChans) + " in; " + String ((int) totalNumOutputChans) + " out"); } updateSampleRates(); @@ -1722,7 +1715,7 @@ class ASIOAudioIODeviceType : public AudioIODeviceType { public: ASIOAudioIODeviceType() - : AudioIODeviceType (T("ASIO")), + : AudioIODeviceType ("ASIO"), hasScanned (false) { CoInitialize (0); @@ -1917,7 +1910,7 @@ private: else deviceName = keyName; - log (T("found ") + deviceName); + log ("found " + deviceName); deviceNames.add (deviceName); classIds.add (new CLSID (classId)); } diff --git a/src/native/windows/juce_win32_AudioCDReader.cpp b/src/native/windows/juce_win32_AudioCDReader.cpp index 4bc3038368..313dacef75 100644 --- a/src/native/windows/juce_win32_AudioCDReader.cpp +++ b/src/native/windows/juce_win32_AudioCDReader.cpp @@ -1663,11 +1663,11 @@ const StringArray AudioCDReader::getAvailableCDNames() String s; if (list[i].scsiDriveLetter > 0) - s << String::charToString (list[i].scsiDriveLetter).toUpperCase() << T(": "); + s << String::charToString (list[i].scsiDriveLetter).toUpperCase() << ": "; s << String (list[i].vendor).trim() - << T(" ") << String (list[i].productId).trim() - << T(" ") << String (list[i].rev).trim(); + << ' ' << String (list[i].productId).trim() + << ' ' << String (list[i].rev).trim(); results.add (s); } @@ -1706,7 +1706,7 @@ AudioCDReader* AudioCDReader::createReaderForCD (const int deviceIndex) } AudioCDReader::AudioCDReader (void* handle_) - : AudioFormatReader (0, T("CD Audio")), + : AudioFormatReader (0, "CD Audio"), handle (handle_), indexingEnabled (false), lastIndex (0), diff --git a/src/native/windows/juce_win32_DirectSound.cpp b/src/native/windows/juce_win32_DirectSound.cpp index d857b169ec..6014c38553 100644 --- a/src/native/windows/juce_win32_DirectSound.cpp +++ b/src/native/windows/juce_win32_DirectSound.cpp @@ -217,7 +217,7 @@ static const String getDSErrorMessage (HRESULT hr) if (hr != S_OK) { String error ("DS error at line "); - error << lineNum << T(" - ") << getDSErrorMessage (hr); + error << lineNum << " - " << getDSErrorMessage (hr); log (error); } } @@ -309,7 +309,7 @@ public: { JUCE_TRY { - log (T("closing dsound out: ") + name); + log ("closing dsound out: " + name); hr = pOutputBuffer->Stop(); logError (hr); } @@ -340,10 +340,8 @@ public: const String open() { - log (T("opening dsound out device: ") + name - + T(" rate=") + String (sampleRate) - + T(" bits=") + String (bitDepth) - + T(" buf=") + String (bufferSizeSamples)); + log ("opening dsound out device: " + name + " rate=" + String (sampleRate) + + " bits=" + String (bitDepth) + " buf=" + String (bufferSizeSamples)); pDirectSound = 0; pOutputBuffer = 0; @@ -717,7 +715,7 @@ public: { JUCE_TRY { - log (T("closing dsound in: ") + name); + log ("closing dsound in: " + name); hr = pInputBuffer->Stop(); logError (hr); } @@ -760,8 +758,8 @@ public: const String open() { - log (T("opening dsound in device: ") + name - + T(" rate=") + String (sampleRate) + T(" bits=") + String (bitDepth) + T(" buf=") + String (bufferSizeSamples)); + log ("opening dsound in device: " + name + + " rate=" + String (sampleRate) + " bits=" + String (bitDepth) + " buf=" + String (bufferSizeSamples)); pDirectSound = 0; pDirectSoundCapture = 0; @@ -800,7 +798,7 @@ public: captureDesc.dwBufferBytes = totalBytesPerBuffer; captureDesc.lpwfxFormat = &wfFormat; - log (T("opening dsound in step 2")); + log ("opening dsound in step 2"); hr = pDirectSoundCapture->CreateCaptureBuffer (&captureDesc, &pInputBuffer, 0); logError (hr); @@ -1336,7 +1334,7 @@ class DSoundAudioIODeviceType : public AudioIODeviceType { public: DSoundAudioIODeviceType() - : AudioIODeviceType (T("DirectSound")), + : AudioIODeviceType ("DirectSound"), hasScanned (false) { initialiseDSoundFunctions(); @@ -1430,7 +1428,7 @@ private: int n = 2; while (outputDeviceNames.contains (desc)) - desc = origDesc + T(" (") + String (n++) + T(")"); + desc = origDesc + " (" + String (n++) + ")"; outputDeviceNames.add (desc); @@ -1466,7 +1464,7 @@ private: int n = 2; while (inputDeviceNames.contains (desc)) - desc = origDesc + T(" (") + String (n++) + T(")"); + desc = origDesc + " (" + String (n++) + ")"; inputDeviceNames.add (desc); @@ -1583,8 +1581,7 @@ const String DSoundAudioIODevice::openDevice (const BigInteger& inputChannels, if (error.isNotEmpty()) { - error = T("Error opening ") + dlh.outputDeviceNames[i] - + T(": \"") + error + T("\""); + error = "Error opening " + dlh.outputDeviceNames[i] + ": \"" + error + "\""; break; } } @@ -1597,8 +1594,7 @@ const String DSoundAudioIODevice::openDevice (const BigInteger& inputChannels, if (error.isNotEmpty()) { - error = T("Error opening ") + dlh.inputDeviceNames[i] - + T(": \"") + error + T("\""); + error = "Error opening " + dlh.inputDeviceNames[i] + ": \"" + error + "\""; break; } } diff --git a/src/native/windows/juce_win32_FileChooser.cpp b/src/native/windows/juce_win32_FileChooser.cpp index 89fecc9b93..359e169843 100644 --- a/src/native/windows/juce_win32_FileChooser.cpp +++ b/src/native/windows/juce_win32_FileChooser.cpp @@ -29,119 +29,116 @@ //============================================================================== -static const void* defaultDirPath = 0; -static String returnedString; // need this to get non-existent pathnames from the directory chooser -static Component* currentExtraFileWin = 0; - -static bool areThereAnyAlwaysOnTopWindows() -{ - for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) - { - Component* c = Desktop::getInstance().getComponent (i); - - if (c != 0 && c->isAlwaysOnTop() && c->isShowing()) - return true; - } - - return false; -} - -static int CALLBACK browseCallbackProc (HWND hWnd, UINT msg, LPARAM lParam, LPARAM /*lpData*/) -{ - if (msg == BFFM_INITIALIZED) - { - SendMessage (hWnd, BFFM_SETSELECTIONW, TRUE, (LPARAM) defaultDirPath); - } - else if (msg == BFFM_VALIDATEFAILEDW) - { - returnedString = (LPCWSTR) lParam; - } - else if (msg == BFFM_VALIDATEFAILEDA) - { - returnedString = (const char*) lParam; - } - - return 0; -} - void juce_setWindowStyleBit (HWND h, const int styleType, const int feature, const bool bitIsSet) throw(); -static UINT_PTR CALLBACK openCallback (HWND hdlg, UINT uiMsg, WPARAM /*wParam*/, LPARAM lParam) +namespace FileChooserHelpers { - if (currentExtraFileWin != 0) + static const void* defaultDirPath = 0; + static String returnedString; // need this to get non-existent pathnames from the directory chooser + static Component* currentExtraFileWin = 0; + + static bool areThereAnyAlwaysOnTopWindows() { - if (uiMsg == WM_INITDIALOG) + for (int i = Desktop::getInstance().getNumComponents(); --i >= 0;) { - HWND dialogH = GetParent (hdlg); - jassert (dialogH != 0); - if (dialogH == 0) - dialogH = hdlg; + Component* c = Desktop::getInstance().getComponent (i); - RECT r, cr; - GetWindowRect (dialogH, &r); - GetClientRect (dialogH, &cr); - - SetWindowPos (dialogH, 0, - r.left, r.top, - currentExtraFileWin->getWidth() + jmax (150, (int) (r.right - r.left)), - jmax (150, (int) (r.bottom - r.top)), - SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER); - - currentExtraFileWin->setBounds (cr.right, cr.top, currentExtraFileWin->getWidth(), cr.bottom - cr.top); - currentExtraFileWin->getChildComponent(0)->setBounds (0, 0, currentExtraFileWin->getWidth(), currentExtraFileWin->getHeight()); - - SetParent ((HWND) currentExtraFileWin->getWindowHandle(), (HWND) dialogH); - juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_CHILD, (dialogH != 0)); - juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_POPUP, (dialogH == 0)); + if (c != 0 && c->isAlwaysOnTop() && c->isShowing()) + return true; } - else if (uiMsg == WM_NOTIFY) + + return false; + } + + static int CALLBACK browseCallbackProc (HWND hWnd, UINT msg, LPARAM lParam, LPARAM /*lpData*/) + { + if (msg == BFFM_INITIALIZED) + SendMessage (hWnd, BFFM_SETSELECTIONW, TRUE, (LPARAM) defaultDirPath); + else if (msg == BFFM_VALIDATEFAILEDW) + returnedString = (LPCWSTR) lParam; + else if (msg == BFFM_VALIDATEFAILEDA) + returnedString = (const char*) lParam; + + return 0; + } + + static UINT_PTR CALLBACK openCallback (HWND hdlg, UINT uiMsg, WPARAM /*wParam*/, LPARAM lParam) + { + if (currentExtraFileWin != 0) { - LPOFNOTIFY ofn = (LPOFNOTIFY) lParam; - - if (ofn->hdr.code == CDN_SELCHANGE) + if (uiMsg == WM_INITDIALOG) { - FilePreviewComponent* comp = (FilePreviewComponent*) currentExtraFileWin->getChildComponent(0); + HWND dialogH = GetParent (hdlg); + jassert (dialogH != 0); + if (dialogH == 0) + dialogH = hdlg; - if (comp != 0) + RECT r, cr; + GetWindowRect (dialogH, &r); + GetClientRect (dialogH, &cr); + + SetWindowPos (dialogH, 0, + r.left, r.top, + currentExtraFileWin->getWidth() + jmax (150, (int) (r.right - r.left)), + jmax (150, (int) (r.bottom - r.top)), + SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER); + + currentExtraFileWin->setBounds (cr.right, cr.top, currentExtraFileWin->getWidth(), cr.bottom - cr.top); + currentExtraFileWin->getChildComponent(0)->setBounds (0, 0, currentExtraFileWin->getWidth(), currentExtraFileWin->getHeight()); + + SetParent ((HWND) currentExtraFileWin->getWindowHandle(), (HWND) dialogH); + juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_CHILD, (dialogH != 0)); + juce_setWindowStyleBit ((HWND)currentExtraFileWin->getWindowHandle(), GWL_STYLE, WS_POPUP, (dialogH == 0)); + } + else if (uiMsg == WM_NOTIFY) + { + LPOFNOTIFY ofn = (LPOFNOTIFY) lParam; + + if (ofn->hdr.code == CDN_SELCHANGE) { - TCHAR path [MAX_PATH * 2]; - path[0] = 0; - CommDlg_OpenSave_GetFilePath (GetParent (hdlg), (LPARAM) &path, MAX_PATH); + FilePreviewComponent* comp = (FilePreviewComponent*) currentExtraFileWin->getChildComponent(0); - const String fn ((const WCHAR*) path); + if (comp != 0) + { + TCHAR path [MAX_PATH * 2]; + path[0] = 0; + CommDlg_OpenSave_GetFilePath (GetParent (hdlg), (LPARAM) &path, MAX_PATH); - comp->selectedFileChanged (File (fn)); + const String fn ((const WCHAR*) path); + + comp->selectedFileChanged (File (fn)); + } } } } + + return 0; } - return 0; + class FPComponentHolder : public Component + { + public: + FPComponentHolder() + { + setVisible (true); + setOpaque (true); + } + + ~FPComponentHolder() + { + } + + void paint (Graphics& g) + { + g.fillAll (Colours::lightgrey); + } + + private: + FPComponentHolder (const FPComponentHolder&); + FPComponentHolder& operator= (const FPComponentHolder&); + }; } -class FPComponentHolder : public Component -{ -public: - FPComponentHolder() - { - setVisible (true); - setOpaque (true); - } - - ~FPComponentHolder() - { - } - - void paint (Graphics& g) - { - g.fillAll (Colours::lightgrey); - } - -private: - FPComponentHolder (const FPComponentHolder&); - FPComponentHolder& operator= (const FPComponentHolder&); -}; - //============================================================================== void FileChooser::showPlatformDialog (Array& results, const String& title, @@ -154,6 +151,7 @@ void FileChooser::showPlatformDialog (Array& results, bool selectMultipleFiles, FilePreviewComponent* extraInfoComponent) { + using namespace FileChooserHelpers; const int numCharsAvailable = 32768; MemoryBlock filenameSpace ((numCharsAvailable + 1) * sizeof (WCHAR), true); WCHAR* const fname = (WCHAR*) filenameSpace.getData(); @@ -324,7 +322,7 @@ void FileChooser::showPlatformDialog (Array& results, while (*filename != 0) { - const String filepath (String (files) + T("\\") + String (filename)); + const String filepath (String (files) + "\\" + String (filename)); results.add (File (filepath)); filename += CharacterFunctions::length (filename) + 1; } diff --git a/src/native/windows/juce_win32_Files.cpp b/src/native/windows/juce_win32_Files.cpp index c6ded02ad5..2866aa62a7 100644 --- a/src/native/windows/juce_win32_Files.cpp +++ b/src/native/windows/juce_win32_Files.cpp @@ -42,7 +42,7 @@ #endif //============================================================================== -const juce_wchar File::separator = T('\\'); +const juce_wchar File::separator = '\\'; const juce_wchar* File::separatorString = T("\\"); @@ -302,8 +302,8 @@ const StringArray juce_getFileSystemRoots() //============================================================================== static const String getDriveFromPath (const String& path) { - if (path.isNotEmpty() && path[1] == T(':')) - return path.substring (0, 2) + T("\\"); + if (path.isNotEmpty() && path[1] == ':') + return path.substring (0, 2) + '\\'; return path; } @@ -364,7 +364,7 @@ bool File::isOnHardDisk() const const unsigned int n = getWindowsDriveType (getFullPathName()); - if (fullPath.toLowerCase()[0] <= 'b' && fullPath[1] == T(':')) + if (fullPath.toLowerCase()[0] <= 'b' && fullPath[1] == ':') return n != DRIVE_REMOVABLE; else return n != DRIVE_CDROM && n != DRIVE_REMOTE; @@ -486,8 +486,8 @@ const File File::getLinkedTarget() const String p (getFullPathName()); if (! exists()) - p += T(".lnk"); - else if (getFileExtension() != T(".lnk")) + p += ".lnk"; + else if (getFileExtension() != ".lnk") return result; ComSmartPtr shellLink; diff --git a/src/native/windows/juce_win32_Fonts.cpp b/src/native/windows/juce_win32_Fonts.cpp index 144d5b899b..b76cc16db6 100644 --- a/src/native/windows/juce_win32_Fonts.cpp +++ b/src/native/windows/juce_win32_Fonts.cpp @@ -74,7 +74,7 @@ static int CALLBACK wfontEnum1 (ENUMLOGFONTEXW* lpelfe, return 1; } -const StringArray Font::findAllTypefaceNames() throw() +const StringArray Font::findAllTypefaceNames() { StringArray results; HDC dc = CreateCompatibleDC (0); @@ -104,7 +104,7 @@ const StringArray Font::findAllTypefaceNames() throw() extern bool juce_IsRunningInWine(); -void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) throw() +void Font::getPlatformDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) { if (juce_IsRunningInWine()) { diff --git a/src/native/windows/juce_win32_Messaging.cpp b/src/native/windows/juce_win32_Messaging.cpp index ff2992d8f4..0bfebf2708 100644 --- a/src/native/windows/juce_win32_Messaging.cpp +++ b/src/native/windows/juce_win32_Messaging.cpp @@ -262,7 +262,7 @@ static const String getMessageWindowClassName() if (number == 0) number = 0x7fffffff & (int) Time::getHighResolutionTicks(); - return T("JUCEcs_") + String (number); + return "JUCEcs_" + String (number); } void MessageManager::doPlatformSpecificInitialisation() diff --git a/src/native/windows/juce_win32_Misc.cpp b/src/native/windows/juce_win32_Misc.cpp index 9f794b5cc5..1b7cde6547 100644 --- a/src/native/windows/juce_win32_Misc.cpp +++ b/src/native/windows/juce_win32_Misc.cpp @@ -29,7 +29,7 @@ //============================================================================== -void SystemClipboard::copyTextToClipboard (const String& text) throw() +void SystemClipboard::copyTextToClipboard (const String& text) { if (OpenClipboard (0) != 0) { @@ -57,7 +57,7 @@ void SystemClipboard::copyTextToClipboard (const String& text) throw() } } -const String SystemClipboard::getTextFromClipboard() throw() +const String SystemClipboard::getTextFromClipboard() { String result; diff --git a/src/native/windows/juce_win32_PlatformUtils.cpp b/src/native/windows/juce_win32_PlatformUtils.cpp index 6ed854afc3..66b284e083 100644 --- a/src/native/windows/juce_win32_PlatformUtils.cpp +++ b/src/native/windows/juce_win32_PlatformUtils.cpp @@ -44,9 +44,9 @@ static HKEY findKeyForPath (String name, if (rootKey != 0) { - name = name.substring (name.indexOfChar (T('\\')) + 1); + name = name.substring (name.indexOfChar ('\\') + 1); - const int lastSlash = name.lastIndexOfChar (T('\\')); + const int lastSlash = name.lastIndexOfChar ('\\'); valueName = name.substring (lastSlash + 1); name = name.substring (0, lastSlash); @@ -198,7 +198,7 @@ const String JUCE_CALLTYPE PlatformUtilities::getCurrentCommandLineParams() thro StringArray tokens; tokens.addTokens (s, true); // tokenise so that we can remove the initial filename argument - return tokens.joinIntoString (T(" "), 1); + return tokens.joinIntoString (" ", 1); } //============================================================================== diff --git a/src/native/windows/juce_win32_SystemStats.cpp b/src/native/windows/juce_win32_SystemStats.cpp index 1be7d3b1c5..aa77f96317 100644 --- a/src/native/windows/juce_win32_SystemStats.cpp +++ b/src/native/windows/juce_win32_SystemStats.cpp @@ -33,7 +33,7 @@ extern void juce_initialiseThreadEvents(); //============================================================================== void Logger::outputDebugString (const String& text) throw() { - OutputDebugString (text + T("\n")); + OutputDebugString (text + "\n"); } //============================================================================== diff --git a/src/native/windows/juce_win32_WASAPI.cpp b/src/native/windows/juce_win32_WASAPI.cpp index b04af69eda..f4a5674403 100644 --- a/src/native/windows/juce_win32_WASAPI.cpp +++ b/src/native/windows/juce_win32_WASAPI.cpp @@ -947,7 +947,7 @@ class WASAPIAudioIODeviceType : public AudioIODeviceType { public: WASAPIAudioIODeviceType() - : AudioIODeviceType (T("Windows Audio")), + : AudioIODeviceType ("Windows Audio"), hasScanned (false) { } diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index 65ae1d0954..4fa6a2c2ab 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -335,8 +335,8 @@ bool KeyPress::isKeyCurrentlyDown (const int keyCode) throw() SHORT k = (SHORT) keyCode; if ((keyCode & extendedKeyModifier) == 0 - && (k >= (SHORT) T('a') && k <= (SHORT) T('z'))) - k += (SHORT) T('A') - (SHORT) T('a'); + && (k >= (SHORT) 'a' && k <= (SHORT) 'z')) + k += (SHORT) 'A' - (SHORT) 'a'; const SHORT translatedValues[] = { (SHORT) ',', VK_OEM_COMMA, (SHORT) '+', VK_OEM_PLUS, diff --git a/src/text/juce_CharacterFunctions.cpp b/src/text/juce_CharacterFunctions.cpp index c830c0f3d3..e73d331ee3 100644 --- a/src/text/juce_CharacterFunctions.cpp +++ b/src/text/juce_CharacterFunctions.cpp @@ -380,7 +380,7 @@ int CharacterFunctions::getIntValue (const juce_wchar* s) throw() while (isWhitespace (*s)) ++s; - const bool isNeg = *s == T('-'); + const bool isNeg = *s == '-'; if (isNeg) ++s; @@ -388,8 +388,8 @@ int CharacterFunctions::getIntValue (const juce_wchar* s) throw() { const wchar_t c = *s++; - if (c >= T('0') && c <= T('9')) - v = v * 10 + (int) (c - T('0')); + if (c >= '0' && c <= '9') + v = v * 10 + (int) (c - '0'); else break; } @@ -410,7 +410,7 @@ int64 CharacterFunctions::getInt64Value (const char* s) throw() while (isWhitespace (*s)) ++s; - const bool isNeg = *s == T('-'); + const bool isNeg = *s == '-'; if (isNeg) ++s; @@ -438,7 +438,7 @@ int64 CharacterFunctions::getInt64Value (const juce_wchar* s) throw() while (isWhitespace (*s)) ++s; - const bool isNeg = *s == T('-'); + const bool isNeg = *s == '-'; if (isNeg) ++s; @@ -446,8 +446,8 @@ int64 CharacterFunctions::getInt64Value (const juce_wchar* s) throw() { const juce_wchar c = *s++; - if (c >= T('0') && c <= T('9')) - v = v * 10 + (int64) (c - T('0')); + if (c >= '0' && c <= '9') + v = v * 10 + (int64) (c - '0'); else break; } @@ -718,7 +718,7 @@ bool CharacterFunctions::isLowerCase (const juce_wchar character) throw() //============================================================================== bool CharacterFunctions::isWhitespace (const char character) throw() { - return character == T(' ') || (character <= 13 && character >= 9); + return character == ' ' || (character <= 13 && character >= 9); } bool CharacterFunctions::isWhitespace (const juce_wchar character) throw() diff --git a/src/text/juce_LocalisedStrings.cpp b/src/text/juce_LocalisedStrings.cpp index 827df334fd..df97d9b534 100644 --- a/src/text/juce_LocalisedStrings.cpp +++ b/src/text/juce_LocalisedStrings.cpp @@ -60,7 +60,7 @@ static int findCloseQuote (const String& text, int startPos) { const tchar c = text [startPos]; - if (c == 0 || (c == T('"') && lastChar != T('\\'))) + if (c == 0 || (c == '"' && lastChar != '\\')) break; lastChar = c; @@ -88,7 +88,7 @@ void LocalisedStrings::loadFromText (const String& fileContents) { String line (lines[i].trim()); - if (line.startsWithChar (T('"'))) + if (line.startsWithChar ('"')) { int closeQuote = findCloseQuote (line, 1); diff --git a/src/text/juce_String.cpp b/src/text/juce_String.cpp index 9c2098b12b..d11365361d 100644 --- a/src/text/juce_String.cpp +++ b/src/text/juce_String.cpp @@ -24,8 +24,8 @@ */ #ifdef _MSC_VER - #pragma warning (disable: 4514) #pragma warning (push) + #pragma warning (disable: 4514) #endif #include @@ -62,7 +62,7 @@ public: //============================================================================== static juce_wchar* create (const size_t numChars) { - StringHolder* const s = reinterpret_cast (juce_malloc (sizeof (StringHolder) + numChars * sizeof (juce_wchar))); + StringHolder* const s = reinterpret_cast (new char [sizeof (StringHolder) + numChars * sizeof (juce_wchar)]); s->refCount = 0; s->allocatedNumChars = numChars; return &(s->text[0]); @@ -82,7 +82,7 @@ public: static inline void release (StringHolder* const b) throw() { if (Atomic::decrementAndReturn (b->refCount) == -1 && b != &empty) - juce_free (b); + delete[] reinterpret_cast (b); } static void release (juce_wchar* const text) throw() @@ -284,8 +284,10 @@ String::String (const juce_wchar* const t, const size_t maxChars) const String String::charToString (const juce_wchar character) { - juce_wchar temp[] = { character, 0 }; - return String (temp); + String result ((size_t) 1, (int) 0); + result.text[0] = character; + result.text[1] = 0; + return result; } //============================================================================== @@ -299,13 +301,13 @@ namespace NumberToStringConverters do { - *--t = (juce_wchar) (T('0') + (int) (v % 10)); + *--t = (juce_wchar) ('0' + (int) (v % 10)); v /= 10; } while (v > 0); if (n < 0) - *--t = T('-'); + *--t = '-'; return t; } @@ -316,7 +318,7 @@ namespace NumberToStringConverters do { - *--t = (juce_wchar) (T('0') + (int) (v % 10)); + *--t = (juce_wchar) ('0' + (int) (v % 10)); v /= 10; } while (v > 0); @@ -334,13 +336,13 @@ namespace NumberToStringConverters do { - *--t = (juce_wchar) (T('0') + (v % 10)); + *--t = (juce_wchar) ('0' + (v % 10)); v /= 10; } while (v > 0); if (n < 0) - *--t = T('-'); + *--t = '-'; return t; } @@ -351,7 +353,7 @@ namespace NumberToStringConverters do { - *--t = (juce_wchar) (T('0') + (v % 10)); + *--t = (juce_wchar) ('0' + (v % 10)); v /= 10; } while (v > 0); @@ -383,14 +385,14 @@ namespace NumberToStringConverters if (numDecPlaces == 0) *--t = getDecimalPoint(); - *--t = (juce_wchar) (T('0') + (v % 10)); + *--t = (juce_wchar) ('0' + (v % 10)); v /= 10; --numDecPlaces; } if (n < 0) - *--t = T('-'); + *--t = '-'; len = end - t - 1; return t; @@ -1056,7 +1058,7 @@ static int indexOfMatch (const juce_wchar* const wildcard, if (wc == c || (ignoreCase && CharacterFunctions::toLowerCase (wc) == CharacterFunctions::toLowerCase (c)) - || (wc == T('?') && c != 0)) + || (wc == '?' && c != 0)) { if (wc == 0) return start; @@ -1065,10 +1067,10 @@ static int indexOfMatch (const juce_wchar* const wildcard, } else { - if (wc == T('*') && (wildcard [i + 1] == 0 - || indexOfMatch (wildcard + i + 1, - test + start + i, - ignoreCase) >= 0)) + if (wc == '*' && (wildcard [i + 1] == 0 + || indexOfMatch (wildcard + i + 1, + test + start + i, + ignoreCase) >= 0)) { return start; } @@ -1094,7 +1096,7 @@ bool String::matchesWildcard (const juce_wchar* wildcard, const bool ignoreCase) if (wc == c || (ignoreCase && CharacterFunctions::toLowerCase (wc) == CharacterFunctions::toLowerCase (c)) - || (wc == T('?') && c != 0)) + || (wc == '?' && c != 0)) { if (wc == 0) return true; @@ -1103,10 +1105,10 @@ bool String::matchesWildcard (const juce_wchar* wildcard, const bool ignoreCase) } else { - return wc == T('*') && (wildcard [i + 1] == 0 - || indexOfMatch (wildcard + i + 1, - text + i, - ignoreCase) >= 0); + return wc == '*' && (wildcard [i + 1] == 0 + || indexOfMatch (wildcard + i + 1, + text + i, + ignoreCase) >= 0); } } } @@ -1467,21 +1469,21 @@ bool String::isQuotedString() const { const String trimmed (trimStart()); - return trimmed[0] == T('"') - || trimmed[0] == T('\''); + return trimmed[0] == '"' + || trimmed[0] == '\''; } const String String::unquoted() const { String s (*this); - if (s.text[0] == T('"') || s.text[0] == T('\'')) + if (s.text[0] == '"' || s.text[0] == '\'') s = s.substring (1); const int lastCharIndex = s.length() - 1; if (lastCharIndex >= 0 - && (s [lastCharIndex] == T('"') || s[lastCharIndex] == T('\''))) + && (s [lastCharIndex] == '"' || s[lastCharIndex] == '\'')) s [lastCharIndex] = 0; return s; @@ -1718,7 +1720,14 @@ const String String::formatted (const juce_wchar* const pf, ... ) const int num = (int) vswprintf (result.text, bufferSize - 1, pf, tempArgs); va_end (tempArgs); #elif JUCE_WINDOWS + #ifdef _MSC_VER + #pragma warning (push) + #pragma warning (disable: 4996) + #endif const int num = (int) _vsnwprintf (result.text, bufferSize - 1, pf, args); + #ifdef _MSC_VER + #pragma warning (pop) + #endif #else const int num = (int) vswprintf (result.text, bufferSize - 1, pf, args); #endif @@ -1755,13 +1764,13 @@ int String::getTrailingIntValue() const throw() if (! CharacterFunctions::isDigit (c)) { - if (c == T('-')) + if (c == '-') n = -n; break; } - n += mult * (c - T('0')); + n += mult * (c - '0'); mult *= 10; } @@ -1848,7 +1857,7 @@ const String String::toHexString (const unsigned char* data, ++data; if (groupSize > 0 && (i % groupSize) == (groupSize - 1) && i < (size - 1)) - *d++ = T(' '); + *d++ = ' '; } *d = 0; diff --git a/src/text/juce_String.h b/src/text/juce_String.h index 1da08e0ad8..aee74151b1 100644 --- a/src/text/juce_String.h +++ b/src/text/juce_String.h @@ -698,7 +698,7 @@ public: @param quoteCharacter the character to add at the start and end @see isQuotedString, unquoted */ - const String quoted (juce_wchar quoteCharacter = JUCE_T('"')) const; + const String quoted (juce_wchar quoteCharacter = '"') const; //============================================================================== diff --git a/src/text/juce_StringArray.cpp b/src/text/juce_StringArray.cpp index c922113218..4f032a9ec5 100644 --- a/src/text/juce_StringArray.cpp +++ b/src/text/juce_StringArray.cpp @@ -396,16 +396,16 @@ int StringArray::addLines (const String& sourceText) while (*text != 0) { - if (*text == T('\r')) + if (*text == '\r') { ++text; - if (*text == T('\n')) + if (*text == '\n') ++text; break; } - if (*text == T('\n')) + if (*text == '\n') { ++text; break; @@ -415,10 +415,10 @@ int StringArray::addLines (const String& sourceText) } const juce_wchar* endOfLine = text; - if (endOfLine > startOfLine && (*(endOfLine - 1) == T('\r') || *(endOfLine - 1) == T('\n'))) + if (endOfLine > startOfLine && (*(endOfLine - 1) == '\r' || *(endOfLine - 1) == '\n')) --endOfLine; - if (endOfLine > startOfLine && (*(endOfLine - 1) == T('\r') || *(endOfLine - 1) == T('\n'))) + if (endOfLine > startOfLine && (*(endOfLine - 1) == '\r' || *(endOfLine - 1) == '\n')) --endOfLine; add (String (startOfLine, jmax (0, (int) (endOfLine - startOfLine)))); diff --git a/src/text/juce_StringPairArray.cpp b/src/text/juce_StringPairArray.cpp index df16328a72..8aa465b6b3 100644 --- a/src/text/juce_StringPairArray.cpp +++ b/src/text/juce_StringPairArray.cpp @@ -133,9 +133,9 @@ const String StringPairArray::getDescription() const for (int i = 0; i < keys.size(); ++i) { - s << keys[i] << T(" = ") << values[i]; + s << keys[i] << " = " << values[i]; if (i < keys.size()) - s << T(", "); + s << ", "; } return s; diff --git a/src/text/juce_XmlDocument.cpp b/src/text/juce_XmlDocument.cpp index 9cc0a8e97f..b104bc5d1c 100644 --- a/src/text/juce_XmlDocument.cpp +++ b/src/text/juce_XmlDocument.cpp @@ -60,10 +60,7 @@ void XmlDocument::setEmptyTextElementsIgnored (const bool shouldBeIgnored) throw bool XmlDocument::isXmlIdentifierCharSlow (const juce_wchar c) throw() { return CharacterFunctions::isLetterOrDigit (c) - || c == T('_') - || c == T('-') - || c == T(':') - || c == T('.'); + || c == '_' || c == '-' || c == ':' || c == '.'; } inline bool XmlDocument::isXmlIdentifierChar (const juce_wchar c) const throw() @@ -215,9 +212,9 @@ void XmlDocument::skipHeader() if (outOfData) return; - if (c == T('<')) + if (c == '<') ++n; - else if (c == T('>')) + else if (c == '>') --n; } @@ -239,11 +236,11 @@ void XmlDocument::skipNextWhiteSpace() outOfData = true; break; } - else if (c == T('<')) + else if (c == '<') { - if (input[1] == T('!') - && input[2] == T('-') - && input[3] == T('-')) + if (input[1] == '!' + && input[2] == '-' + && input[3] == '-') { const juce_wchar* const closeComment = CharacterFunctions::find (input, T("-->")); @@ -256,7 +253,7 @@ void XmlDocument::skipNextWhiteSpace() input = closeComment + 3; continue; } - else if (input[1] == T('?')) + else if (input[1] == '?') { const juce_wchar* const closeBracket = CharacterFunctions::find (input, T("?>")); @@ -286,7 +283,7 @@ void XmlDocument::readQuotedString (String& result) if (c == quote) break; - if (c == T('&')) + if (c == '&') { --input; readEntity (result); @@ -307,7 +304,7 @@ void XmlDocument::readQuotedString (String& result) return; } - else if (character == T('&')) + else if (character == '&') { result.append (start, (int) (input - start)); break; @@ -365,14 +362,14 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements) const juce_wchar c = *input; // empty tag.. - if (c == T('/') && input[1] == T('>')) + if (c == '/' && input[1] == '>') { input += 2; break; } // parse the guts of the element.. - if (c == T('>')) + if (c == '>') { ++input; skipNextWhiteSpace(); @@ -395,13 +392,13 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements) skipNextWhiteSpace(); - if (readNextChar() == T('=')) + if (readNextChar() == '=') { skipNextWhiteSpace(); const juce_wchar nextChar = *input; - if (nextChar == T('"') || nextChar == T('\'')) + if (nextChar == '"' || nextChar == '\'') { XmlElement::XmlAttributeNode* const newAtt = new XmlElement::XmlAttributeNode (String (attNameStart, attNameLen), @@ -448,23 +445,23 @@ void XmlDocument::readChildElements (XmlElement* parent) break; } - if (*input == T('<')) + if (*input == '<') { - if (input[1] == T('/')) + if (input[1] == '/') { // our close tag.. input = CharacterFunctions::find (input, T(">")); ++input; break; } - else if (input[1] == T('!') - && input[2] == T('[') - && input[3] == T('C') - && input[4] == T('D') - && input[5] == T('A') - && input[6] == T('T') - && input[7] == T('A') - && input[8] == T('[')) + else if (input[1] == '!' + && input[2] == '[' + && input[3] == 'C' + && input[4] == 'D' + && input[5] == 'A' + && input[6] == 'T' + && input[7] == 'A' + && input[8] == '[') { input += 9; const juce_wchar* const inputStart = input; @@ -479,9 +476,9 @@ void XmlDocument::readChildElements (XmlElement* parent) outOfData = true; break; } - else if (input[0] == T(']') - && input[1] == T(']') - && input[2] == T('>')) + else if (input[0] == ']' + && input[1] == ']' + && input[2] == '>') { input += 3; break; @@ -539,7 +536,7 @@ void XmlDocument::readChildElements (XmlElement* parent) { const juce_wchar c = *input; - if (c == T('<')) + if (c == '<') break; if (c == 0) @@ -549,12 +546,12 @@ void XmlDocument::readChildElements (XmlElement* parent) return; } - if (c == T('&')) + if (c == '&') { String entity; readEntity (entity); - if (entity.startsWithChar (T('<')) && entity [1] != 0) + if (entity.startsWithChar ('<') && entity [1] != 0) { const juce_wchar* const oldInput = input; const bool oldOutOfData = outOfData; @@ -594,7 +591,7 @@ void XmlDocument::readChildElements (XmlElement* parent) { const juce_wchar nextChar = *input; - if (nextChar == T('<') || nextChar == T('&')) + if (nextChar == '<' || nextChar == '&') { break; } @@ -628,39 +625,39 @@ void XmlDocument::readEntity (String& result) if (CharacterFunctions::compareIgnoreCase (input, T("amp;"), 4) == 0) { input += 4; - result += T("&"); + result += '&'; } else if (CharacterFunctions::compareIgnoreCase (input, T("quot;"), 5) == 0) { input += 5; - result += T("\""); + result += '"'; } else if (CharacterFunctions::compareIgnoreCase (input, T("apos;"), 5) == 0) { input += 5; - result += T("\'"); + result += '\''; } else if (CharacterFunctions::compareIgnoreCase (input, T("lt;"), 3) == 0) { input += 3; - result += T("<"); + result += '<'; } else if (CharacterFunctions::compareIgnoreCase (input, T("gt;"), 3) == 0) { input += 3; - result += T(">"); + result += '>'; } - else if (*input == T('#')) + else if (*input == '#') { int charCode = 0; ++input; - if (*input == T('x') || *input == T('X')) + if (*input == 'x' || *input == 'X') { ++input; int numChars = 0; - while (input[0] != T(';')) + while (input[0] != ';') { const int hexValue = CharacterFunctions::getHexDigitValue (input[0]); @@ -676,11 +673,11 @@ void XmlDocument::readEntity (String& result) ++input; } - else if (input[0] >= T('0') && input[0] <= T('9')) + else if (input[0] >= '0' && input[0] <= '9') { int numChars = 0; - while (input[0] != T(';')) + while (input[0] != ';') { if (++numChars > 12) { @@ -688,7 +685,7 @@ void XmlDocument::readEntity (String& result) break; } - charCode = charCode * 10 + (input[0] - T('0')); + charCode = charCode * 10 + (input[0] - '0'); ++input; } @@ -697,7 +694,7 @@ void XmlDocument::readEntity (String& result) else { setLastError ("illegal escape sequence", true); - result += T("&"); + result += '&'; return; } @@ -711,7 +708,7 @@ void XmlDocument::readEntity (String& result) if (closingSemiColon == 0) { outOfData = true; - result += T("&"); + result += '&'; } else { @@ -726,30 +723,30 @@ void XmlDocument::readEntity (String& result) const String XmlDocument::expandEntity (const String& ent) { if (ent.equalsIgnoreCase (T("amp"))) - return T("&"); + return String::charToString ('&'); if (ent.equalsIgnoreCase (T("quot"))) - return T("\""); + return String::charToString ('"'); if (ent.equalsIgnoreCase (T("apos"))) - return T("\'"); + return String::charToString ('\''); if (ent.equalsIgnoreCase (T("lt"))) - return T("<"); + return String::charToString ('<'); if (ent.equalsIgnoreCase (T("gt"))) - return T(">"); + return String::charToString ('>'); - if (ent[0] == T('#')) + if (ent[0] == '#') { - if (ent[1] == T('x') || ent[1] == T('X')) + if (ent[1] == 'x' || ent[1] == 'X') return String::charToString (static_cast (ent.substring (2).getHexValue32())); - if (ent[1] >= T('0') && ent[1] <= T('9')) + if (ent[1] >= '0' && ent[1] <= '9') return String::charToString (static_cast (ent.substring (1).getIntValue())); setLastError ("illegal escape sequence", false); - return T("&"); + return String::charToString ('&'); } return expandExternalEntity (ent); @@ -761,7 +758,7 @@ const String XmlDocument::expandExternalEntity (const String& entity) { if (dtdText.isNotEmpty()) { - while (dtdText.endsWithChar (T('>'))) + while (dtdText.endsWithChar ('>')) dtdText = dtdText.dropLastCharacters (1); tokenisedDTD.addTokens (dtdText, true); @@ -777,11 +774,11 @@ const String XmlDocument::expandExternalEntity (const String& entity) else { tokenisedDTD.clear(); - const int openBracket = dtdText.indexOfChar (T('[')); + const int openBracket = dtdText.indexOfChar ('['); if (openBracket > 0) { - const int closeBracket = dtdText.lastIndexOfChar (T(']')); + const int closeBracket = dtdText.lastIndexOfChar (']'); if (closeBracket > openBracket) tokenisedDTD.addTokens (dtdText.substring (openBracket + 1, @@ -791,8 +788,8 @@ const String XmlDocument::expandExternalEntity (const String& entity) for (int i = tokenisedDTD.size(); --i >= 0;) { - if (tokenisedDTD[i].startsWithChar (T('%')) - && tokenisedDTD[i].endsWithChar (T(';'))) + if (tokenisedDTD[i].startsWithChar ('%') + && tokenisedDTD[i].endsWithChar (';')) { const String parsed (getParameterEntity (tokenisedDTD[i].substring (1, tokenisedDTD[i].length() - 1))); StringArray newToks; @@ -817,13 +814,13 @@ const String XmlDocument::expandExternalEntity (const String& entity) { String ent (tokenisedDTD [i + 1]); - while (ent.endsWithChar (T('>'))) + while (ent.endsWithChar ('>')) ent = ent.dropLastCharacters (1); ent = ent.trim().unquoted(); // check for sub-entities.. - int ampersand = ent.indexOfChar (T('&')); + int ampersand = ent.indexOfChar ('&'); while (ampersand >= 0) { @@ -841,7 +838,7 @@ const String XmlDocument::expandExternalEntity (const String& entity) + resolved + ent.substring (semiColon + 1); - ampersand = ent.indexOfChar (semiColon + 1, T('&')); + ampersand = ent.indexOfChar (semiColon + 1, '&'); } return ent; @@ -860,19 +857,19 @@ const String XmlDocument::getParameterEntity (const String& entity) { if (tokenisedDTD[i] == entity) { - if (tokenisedDTD [i - 1] == T("%") + if (tokenisedDTD [i - 1] == "%" && tokenisedDTD [i - 2].equalsIgnoreCase (T("'))) + while (ent.endsWithChar ('>')) ent = ent.dropLastCharacters (1); if (ent.equalsIgnoreCase (T("system"))) { String filename (tokenisedDTD [i + 2]); - while (filename.endsWithChar (T('>'))) + while (filename.endsWithChar ('>')) filename = filename.dropLastCharacters (1); return getFileContents (filename); diff --git a/src/text/juce_XmlElement.cpp b/src/text/juce_XmlElement.cpp index 80d879380c..eebef93ad0 100644 --- a/src/text/juce_XmlElement.cpp +++ b/src/text/juce_XmlElement.cpp @@ -601,11 +601,11 @@ bool XmlElement::getBoolAttribute (const String& attributeName, const bool defau if (CharacterFunctions::isWhitespace (firstChar)) firstChar = att->value.trimStart() [0]; - return firstChar == T('1') - || firstChar == T('t') - || firstChar == T('y') - || firstChar == T('T') - || firstChar == T('Y'); + return firstChar == '1' + || firstChar == 't' + || firstChar == 'y' + || firstChar == 'T' + || firstChar == 'Y'; } att = att->next; @@ -645,9 +645,9 @@ void XmlElement::setAttribute (const String& attributeName, const String& value) while (*t != 0) { jassert (CharacterFunctions::isLetterOrDigit (*t) - || *t == T('_') - || *t == T('-') - || *t == T(':')); + || *t == '_' + || *t == '-' + || *t == ':'); ++t; } #endif diff --git a/src/text/juce_XmlElement.h b/src/text/juce_XmlElement.h index 58a389b7dd..1bd980ceee 100644 --- a/src/text/juce_XmlElement.h +++ b/src/text/juce_XmlElement.h @@ -42,7 +42,7 @@ forEachXmlChildElement (*myParentXml, child) { - if (child->hasTagName (T("FOO"))) + if (child->hasTagName ("FOO")) doSomethingWithXmlElement (child); } @@ -69,7 +69,7 @@ E.g. @code XmlElement* myParentXml = createSomeKindOfXmlDocument(); - forEachXmlChildElementWithTagName (*myParentXml, child, T("MYTAG")) + forEachXmlChildElementWithTagName (*myParentXml, child, "MYTAG") { // the child object is now guaranteed to be a element.. doSomethingWithMYTAGElement (child); @@ -100,12 +100,12 @@ Here's an example of parsing some elements: @code // check we're looking at the right kind of document.. - if (myElement->hasTagName (T("ANIMALS"))) + if (myElement->hasTagName ("ANIMALS")) { // now we'll iterate its sub-elements looking for 'giraffe' elements.. forEachXmlChildElement (*myElement, e) { - if (e->hasTagName (T("GIRAFFE"))) + if (e->hasTagName ("GIRAFFE")) { // found a giraffe, so use some of its attributes.. @@ -192,7 +192,7 @@ public: const String createDocument (const String& dtdToUse, bool allOnOneLine = false, bool includeXmlHeader = true, - const String& encodingType = JUCE_T("UTF-8"), + const String& encodingType = "UTF-8", int lineWrapLength = 60) const; /** Writes the document to a stream as UTF-8. @@ -214,7 +214,7 @@ public: const String& dtdToUse, bool allOnOneLine = false, bool includeXmlHeader = true, - const String& encodingType = JUCE_T("UTF-8"), + const String& encodingType = "UTF-8", int lineWrapLength = 60) const; /** Writes the element to a file as an XML document. @@ -238,7 +238,7 @@ public: */ bool writeToFile (const File& destinationFile, const String& dtdToUse, - const String& encodingType = JUCE_T("UTF-8"), + const String& encodingType = "UTF-8", int lineWrapLength = 60) const; //============================================================================== diff --git a/src/threads/juce_ThreadPool.cpp b/src/threads/juce_ThreadPool.cpp index 8b1d2ba3b0..ed3b4eaede 100644 --- a/src/threads/juce_ThreadPool.cpp +++ b/src/threads/juce_ThreadPool.cpp @@ -70,7 +70,7 @@ class ThreadPool::ThreadPoolThread : public Thread { public: ThreadPoolThread (ThreadPool& pool_) - : Thread (T("Pool")), + : Thread ("Pool"), pool (pool_), busy (false) { diff --git a/src/utilities/juce_FileBasedDocument.cpp b/src/utilities/juce_FileBasedDocument.cpp index 90a67e7662..961c349bf1 100644 --- a/src/utilities/juce_FileBasedDocument.cpp +++ b/src/utilities/juce_FileBasedDocument.cpp @@ -111,7 +111,7 @@ bool FileBasedDocument::loadFrom (const File& newFile, TRANS("Failed to open file..."), TRANS("There was an error while trying to load the file:\n\n") + newFile.getFullPathName() - + T("\n\n") + + "\n\n" + error); } @@ -199,7 +199,7 @@ FileBasedDocument::SaveResult FileBasedDocument::saveAs (const File& newFile, + getDocumentTitle() + TRANS("\" to the file:\n\n") + newFile.getFullPathName() - + T("\n\n") + + "\n\n" + error); } @@ -214,7 +214,7 @@ FileBasedDocument::SaveResult FileBasedDocument::saveIfNeededAndUserAgrees() const int r = AlertWindow::showYesNoCancelBox (AlertWindow::QuestionIcon, TRANS("Closing document..."), TRANS("Do you want to save the changes to \"") - + getDocumentTitle() + T("\"?"), + + getDocumentTitle() + "\"?", TRANS("save"), TRANS("discard changes"), TRANS("cancel")); @@ -270,9 +270,9 @@ FileBasedDocument::SaveResult FileBasedDocument::saveAsInteractive (const bool w { if (! AlertWindow::showOkCancelBox (AlertWindow::WarningIcon, TRANS("File already exists"), - TRANS("There's already a file called:\n\n") - + chosen.getFullPathName() - + T("\n\nAre you sure you want to overwrite it?"), + TRANS("There's already a file called:") + + "\n\n" + chosen.getFullPathName() + + "\n\n" + TRANS("Are you sure you want to overwrite it?"), TRANS("overwrite"), TRANS("cancel"))) { diff --git a/src/utilities/juce_RecentlyOpenedFilesList.cpp b/src/utilities/juce_RecentlyOpenedFilesList.cpp index af18717692..4aee4987e5 100644 --- a/src/utilities/juce_RecentlyOpenedFilesList.cpp +++ b/src/utilities/juce_RecentlyOpenedFilesList.cpp @@ -130,7 +130,7 @@ int RecentlyOpenedFilesList::createPopupMenuItems (PopupMenu& menuToAddTo, //============================================================================== const String RecentlyOpenedFilesList::toString() const { - return files.joinIntoString (T("\n")); + return files.joinIntoString ("\n"); } void RecentlyOpenedFilesList::restoreFromString (const String& stringifiedVersion) diff --git a/src/utilities/juce_SystemClipboard.h b/src/utilities/juce_SystemClipboard.h index 926dfd1cc9..8aa5fc49ec 100644 --- a/src/utilities/juce_SystemClipboard.h +++ b/src/utilities/juce_SystemClipboard.h @@ -37,14 +37,14 @@ class JUCE_API SystemClipboard { public: /** Copies a string of text onto the clipboard */ - static void copyTextToClipboard (const String& text) throw(); + static void copyTextToClipboard (const String& text); /** Gets the current clipboard's contents. Obviously this might have come from another app, so could contain anything.. */ - static const String getTextFromClipboard() throw(); + static const String getTextFromClipboard(); }; #endif // __JUCE_SYSTEMCLIPBOARD_JUCEHEADER__