Remove pointess OSX_ prefix from functions

This commit is contained in:
Thomas Goyne 2013-10-21 18:10:21 -07:00
parent cbff449f8f
commit 535a17bcf2
7 changed files with 28 additions and 28 deletions

View file

@ -45,59 +45,59 @@ namespace agi {
/// Get the full name of the bundle itself.
///
/// @warning May return "" if the current executable is not inside a bundle.
std::string OSX_GetBundlePath();
std::string GetBundlePath();
/// @brief Get the esources directory.
/// @return Resources directory.
///
/// Mainly for user interface elements such as graphics and strings
std::string OSX_GetBundleResourcesDirectory();
std::string GetBundleResourcesDirectory();
/// @brief Get the built-in plugins directory.
/// @return Built-in plugins directory.
///
/// This is generaly only used by native Carbon and Cocoa applications. It is
/// not for general shared libraries.
std::string OSX_GetBundleBuiltInPlugInsDirectory();
std::string GetBundleBuiltInPlugInsDirectory();
/// @brief Get the private Frameworks directory.
/// @return Private Framework directory.
///
/// These are suitable locations for shared libraries.
std::string OSX_GetBundlePrivateFrameworksDirectory();
std::string GetBundlePrivateFrameworksDirectory();
/// @brief Get the shared Frameworks directory.
/// @return Shared Framework directory.
///
/// @see OSX_GetBundlePrivateFrameworksDirectory()
/// @see GetBundlePrivateFrameworksDirectory()
/// @note Does anyone know the difference between private and shared frameworks
/// inside a bundle?
std::string OSX_GetBundleSharedFrameworksDirectory();
std::string GetBundleSharedFrameworksDirectory();
/// @brief Get the shared support directory
/// @return Shared support directory
///
/// This is a suitable location for static configuration files. (Remember,
/// bundle is considered read-only.)
std::string OSX_GetBundleSharedSupportDirectory();
std::string GetBundleSharedSupportDirectory();
/// @brief Get the main executable path.
/// @return Main executable path.
///
/// The binary run when the user launches the bundle from Finder.
std::string OSX_GetBundleExecutablePath();
std::string GetBundleExecutablePath();
/// @brief Get the auxillary executable path.
/// @return Auxillary executable path.
///
/// Pass the basename of the executable to get the path.
std::string OSX_GetBundleAuxillaryExecutablePath(std::string const& executableName);
std::string GetBundleAuxillaryExecutablePath(std::string const& executableName);
std::string OSX_GetApplicationSupportDirectory();
std::string GetApplicationSupportDirectory();
/// @brief Open a URI using the Launcher.
/// @param location URI of file
/// @note If this is a FILE or DIRECTORY the path must be ABSOLUTE no 'file://'
void OSX_OpenLocation(std::string const& location);
void OpenLocation(std::string const& location);
} // namespace util
} // namespace agi

View file

@ -46,62 +46,62 @@ AppNapDisabler::~AppNapDisabler() {
}
namespace util {
std::string OSX_GetBundlePath() {
std::string GetBundlePath() {
@autoreleasepool {
return EmptyIfNil([[NSBundle mainBundle] bundlePath]);
}
}
std::string OSX_GetBundleResourcesDirectory() {
std::string GetBundleResourcesDirectory() {
@autoreleasepool {
return EmptyIfNil([[[NSBundle mainBundle] resourceURL] path]);
}
}
std::string OSX_GetBundleExecutablePath() {
std::string GetBundleExecutablePath() {
@autoreleasepool {
return EmptyIfNil([[NSBundle mainBundle] executablePath]);
}
}
std::string OSX_GetBundleBuiltInPlugInsDirectory() {
std::string GetBundleBuiltInPlugInsDirectory() {
@autoreleasepool {
return EmptyIfNil([[NSBundle mainBundle] builtInPlugInsPath]);
}
}
std::string OSX_GetBundlePrivateFrameworksDirectory() {
std::string GetBundlePrivateFrameworksDirectory() {
@autoreleasepool {
return EmptyIfNil([[NSBundle mainBundle] privateFrameworksPath]);
}
}
std::string OSX_GetBundleSharedFrameworksDirectory() {
std::string GetBundleSharedFrameworksDirectory() {
@autoreleasepool {
return EmptyIfNil([[NSBundle mainBundle] sharedFrameworksPath]);
}
}
std::string OSX_GetBundleSharedSupportDirectory() {
std::string GetBundleSharedSupportDirectory() {
@autoreleasepool {
return EmptyIfNil([[NSBundle mainBundle] sharedSupportPath]);
}
}
std::string OSX_GetBundleAuxillaryExecutablePath(std::string const& executableName) {
std::string GetBundleAuxillaryExecutablePath(std::string const& executableName) {
@autoreleasepool {
NSString *name = [NSString stringWithUTF8String:executableName.c_str()];
return EmptyIfNil([[NSBundle mainBundle]pathForAuxiliaryExecutable:name]);
}
}
std::string OSX_GetApplicationSupportDirectory() {
std::string GetApplicationSupportDirectory() {
@autoreleasepool {
return EmptyIfNil([NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject]);
}
}
void OSX_OpenLocation(std::string const& location) {
void OpenLocation(std::string const& location) {
@autoreleasepool {
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:location.c_str()]];
LSOpenCFURLRef((CFURLRef)url, NULL);

View file

@ -46,10 +46,10 @@ void Path::FillPlatformSpecificPaths() {
SetToken("?local", home/".aegisub");
SetToken("?data", P_DATA);
#else
agi::fs::path app_support = agi::util::OSX_GetApplicationSupportDirectory();
agi::fs::path app_support = agi::util::GetApplicationSupportDirectory();
SetToken("?user", app_support/"Aegisub");
SetToken("?local", app_support/"Aegisub");
SetToken("?data", agi::util::OSX_GetBundleSharedSupportDirectory());
SetToken("?data", agi::util::GetBundleSharedSupportDirectory());
#endif
SetToken("?temp", boost::filesystem::temp_directory_path());
SetToken("?dictionary", "/usr/share/hunspell");

View file

@ -95,7 +95,7 @@ struct help_files : public Command {
STR_HELP("Resource files")
void operator()(agi::Context *) {
agi::util::OSX_OpenLocation((agi::util::OSX_GetBundleSharedSupportDirectory() + "/doc").c_str());
agi::util::OpenLocation((agi::util::GetBundleSharedSupportDirectory() + "/doc").c_str());
}
};
#endif

View file

@ -41,7 +41,7 @@ namespace {
FcConfig *init_fontconfig() {
#ifdef __APPLE__
FcConfig *config = FcConfigCreate();
std::string conf_path = agi::util::OSX_GetBundleResourcesDirectory() + "/etc/fonts/fonts.conf";
std::string conf_path = agi::util::GetBundleResourcesDirectory() + "/etc/fonts/fonts.conf";
if (FcConfigParseAndLoad(config, (unsigned char *)conf_path.c_str(), FcTrue))
return config;

View file

@ -77,7 +77,7 @@ void msg_callback(int level, const char *fmt, va_list args, void *) {
}
#ifdef __APPLE__
#define CONFIG_PATH (agi::util::OSX_GetBundleResourcesDirectory() + "/etc/fonts/fonts.conf").c_str()
#define CONFIG_PATH (agi::util::GetBundleResourcesDirectory() + "/etc/fonts/fonts.conf").c_str()
#else
#define CONFIG_PATH nullptr
#endif

View file

@ -116,8 +116,8 @@ void RestartAegisub() {
#if defined(__WXMSW__)
wxExecute("\"" + wxStandardPaths::Get().GetExecutablePath() + "\"");
#elif defined(__WXMAC__)
std::string bundle_path = agi::util::OSX_GetBundlePath();
std::string helper_path = agi::util::OSX_GetBundleAuxillaryExecutablePath("restart-helper");
std::string bundle_path = agi::util::GetBundlePath();
std::string helper_path = agi::util::GetBundleAuxillaryExecutablePath("restart-helper");
if (bundle_path.empty() || helper_path.empty()) return;
wxString exec = wxString::Format("\"%s\" /usr/bin/open -n \"%s\"'", to_wx(helper_path), to_wx(bundle_path));