Remove pointess OSX_ prefix from functions
This commit is contained in:
parent
cbff449f8f
commit
535a17bcf2
7 changed files with 28 additions and 28 deletions
|
@ -45,59 +45,59 @@ namespace agi {
|
||||||
/// Get the full name of the bundle itself.
|
/// Get the full name of the bundle itself.
|
||||||
///
|
///
|
||||||
/// @warning May return "" if the current executable is not inside a bundle.
|
/// @warning May return "" if the current executable is not inside a bundle.
|
||||||
std::string OSX_GetBundlePath();
|
std::string GetBundlePath();
|
||||||
|
|
||||||
/// @brief Get the esources directory.
|
/// @brief Get the esources directory.
|
||||||
/// @return Resources directory.
|
/// @return Resources directory.
|
||||||
///
|
///
|
||||||
/// Mainly for user interface elements such as graphics and strings
|
/// Mainly for user interface elements such as graphics and strings
|
||||||
std::string OSX_GetBundleResourcesDirectory();
|
std::string GetBundleResourcesDirectory();
|
||||||
|
|
||||||
/// @brief Get the built-in plugins directory.
|
/// @brief Get the built-in plugins directory.
|
||||||
/// @return Built-in plugins directory.
|
/// @return Built-in plugins directory.
|
||||||
///
|
///
|
||||||
/// This is generaly only used by native Carbon and Cocoa applications. It is
|
/// This is generaly only used by native Carbon and Cocoa applications. It is
|
||||||
/// not for general shared libraries.
|
/// not for general shared libraries.
|
||||||
std::string OSX_GetBundleBuiltInPlugInsDirectory();
|
std::string GetBundleBuiltInPlugInsDirectory();
|
||||||
|
|
||||||
/// @brief Get the private Frameworks directory.
|
/// @brief Get the private Frameworks directory.
|
||||||
/// @return Private Framework directory.
|
/// @return Private Framework directory.
|
||||||
///
|
///
|
||||||
/// These are suitable locations for shared libraries.
|
/// These are suitable locations for shared libraries.
|
||||||
std::string OSX_GetBundlePrivateFrameworksDirectory();
|
std::string GetBundlePrivateFrameworksDirectory();
|
||||||
|
|
||||||
/// @brief Get the shared Frameworks directory.
|
/// @brief Get the shared Frameworks directory.
|
||||||
/// @return Shared Framework directory.
|
/// @return Shared Framework directory.
|
||||||
///
|
///
|
||||||
/// @see OSX_GetBundlePrivateFrameworksDirectory()
|
/// @see GetBundlePrivateFrameworksDirectory()
|
||||||
/// @note Does anyone know the difference between private and shared frameworks
|
/// @note Does anyone know the difference between private and shared frameworks
|
||||||
/// inside a bundle?
|
/// inside a bundle?
|
||||||
std::string OSX_GetBundleSharedFrameworksDirectory();
|
std::string GetBundleSharedFrameworksDirectory();
|
||||||
|
|
||||||
/// @brief Get the shared support directory
|
/// @brief Get the shared support directory
|
||||||
/// @return Shared support directory
|
/// @return Shared support directory
|
||||||
///
|
///
|
||||||
/// This is a suitable location for static configuration files. (Remember,
|
/// This is a suitable location for static configuration files. (Remember,
|
||||||
/// bundle is considered read-only.)
|
/// bundle is considered read-only.)
|
||||||
std::string OSX_GetBundleSharedSupportDirectory();
|
std::string GetBundleSharedSupportDirectory();
|
||||||
|
|
||||||
/// @brief Get the main executable path.
|
/// @brief Get the main executable path.
|
||||||
/// @return Main executable path.
|
/// @return Main executable path.
|
||||||
///
|
///
|
||||||
/// The binary run when the user launches the bundle from Finder.
|
/// The binary run when the user launches the bundle from Finder.
|
||||||
std::string OSX_GetBundleExecutablePath();
|
std::string GetBundleExecutablePath();
|
||||||
|
|
||||||
/// @brief Get the auxillary executable path.
|
/// @brief Get the auxillary executable path.
|
||||||
/// @return Auxillary executable path.
|
/// @return Auxillary executable path.
|
||||||
///
|
///
|
||||||
/// Pass the basename of the executable to get the 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.
|
/// @brief Open a URI using the Launcher.
|
||||||
/// @param location URI of file
|
/// @param location URI of file
|
||||||
/// @note If this is a FILE or DIRECTORY the path must be ABSOLUTE no '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 util
|
||||||
} // namespace agi
|
} // namespace agi
|
||||||
|
|
|
@ -46,62 +46,62 @@ AppNapDisabler::~AppNapDisabler() {
|
||||||
}
|
}
|
||||||
namespace util {
|
namespace util {
|
||||||
|
|
||||||
std::string OSX_GetBundlePath() {
|
std::string GetBundlePath() {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return EmptyIfNil([[NSBundle mainBundle] bundlePath]);
|
return EmptyIfNil([[NSBundle mainBundle] bundlePath]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OSX_GetBundleResourcesDirectory() {
|
std::string GetBundleResourcesDirectory() {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return EmptyIfNil([[[NSBundle mainBundle] resourceURL] path]);
|
return EmptyIfNil([[[NSBundle mainBundle] resourceURL] path]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OSX_GetBundleExecutablePath() {
|
std::string GetBundleExecutablePath() {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return EmptyIfNil([[NSBundle mainBundle] executablePath]);
|
return EmptyIfNil([[NSBundle mainBundle] executablePath]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OSX_GetBundleBuiltInPlugInsDirectory() {
|
std::string GetBundleBuiltInPlugInsDirectory() {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return EmptyIfNil([[NSBundle mainBundle] builtInPlugInsPath]);
|
return EmptyIfNil([[NSBundle mainBundle] builtInPlugInsPath]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OSX_GetBundlePrivateFrameworksDirectory() {
|
std::string GetBundlePrivateFrameworksDirectory() {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return EmptyIfNil([[NSBundle mainBundle] privateFrameworksPath]);
|
return EmptyIfNil([[NSBundle mainBundle] privateFrameworksPath]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OSX_GetBundleSharedFrameworksDirectory() {
|
std::string GetBundleSharedFrameworksDirectory() {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return EmptyIfNil([[NSBundle mainBundle] sharedFrameworksPath]);
|
return EmptyIfNil([[NSBundle mainBundle] sharedFrameworksPath]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OSX_GetBundleSharedSupportDirectory() {
|
std::string GetBundleSharedSupportDirectory() {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return EmptyIfNil([[NSBundle mainBundle] sharedSupportPath]);
|
return EmptyIfNil([[NSBundle mainBundle] sharedSupportPath]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OSX_GetBundleAuxillaryExecutablePath(std::string const& executableName) {
|
std::string GetBundleAuxillaryExecutablePath(std::string const& executableName) {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
NSString *name = [NSString stringWithUTF8String:executableName.c_str()];
|
NSString *name = [NSString stringWithUTF8String:executableName.c_str()];
|
||||||
return EmptyIfNil([[NSBundle mainBundle]pathForAuxiliaryExecutable:name]);
|
return EmptyIfNil([[NSBundle mainBundle]pathForAuxiliaryExecutable:name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OSX_GetApplicationSupportDirectory() {
|
std::string GetApplicationSupportDirectory() {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
return EmptyIfNil([NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject]);
|
return EmptyIfNil([NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSX_OpenLocation(std::string const& location) {
|
void OpenLocation(std::string const& location) {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:location.c_str()]];
|
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:location.c_str()]];
|
||||||
LSOpenCFURLRef((CFURLRef)url, NULL);
|
LSOpenCFURLRef((CFURLRef)url, NULL);
|
||||||
|
|
|
@ -46,10 +46,10 @@ void Path::FillPlatformSpecificPaths() {
|
||||||
SetToken("?local", home/".aegisub");
|
SetToken("?local", home/".aegisub");
|
||||||
SetToken("?data", P_DATA);
|
SetToken("?data", P_DATA);
|
||||||
#else
|
#else
|
||||||
agi::fs::path app_support = agi::util::OSX_GetApplicationSupportDirectory();
|
agi::fs::path app_support = agi::util::GetApplicationSupportDirectory();
|
||||||
SetToken("?user", app_support/"Aegisub");
|
SetToken("?user", app_support/"Aegisub");
|
||||||
SetToken("?local", app_support/"Aegisub");
|
SetToken("?local", app_support/"Aegisub");
|
||||||
SetToken("?data", agi::util::OSX_GetBundleSharedSupportDirectory());
|
SetToken("?data", agi::util::GetBundleSharedSupportDirectory());
|
||||||
#endif
|
#endif
|
||||||
SetToken("?temp", boost::filesystem::temp_directory_path());
|
SetToken("?temp", boost::filesystem::temp_directory_path());
|
||||||
SetToken("?dictionary", "/usr/share/hunspell");
|
SetToken("?dictionary", "/usr/share/hunspell");
|
||||||
|
|
|
@ -95,7 +95,7 @@ struct help_files : public Command {
|
||||||
STR_HELP("Resource files")
|
STR_HELP("Resource files")
|
||||||
|
|
||||||
void operator()(agi::Context *) {
|
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
|
#endif
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace {
|
||||||
FcConfig *init_fontconfig() {
|
FcConfig *init_fontconfig() {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
FcConfig *config = FcConfigCreate();
|
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))
|
if (FcConfigParseAndLoad(config, (unsigned char *)conf_path.c_str(), FcTrue))
|
||||||
return config;
|
return config;
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ void msg_callback(int level, const char *fmt, va_list args, void *) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#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
|
#else
|
||||||
#define CONFIG_PATH nullptr
|
#define CONFIG_PATH nullptr
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -116,8 +116,8 @@ void RestartAegisub() {
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
wxExecute("\"" + wxStandardPaths::Get().GetExecutablePath() + "\"");
|
wxExecute("\"" + wxStandardPaths::Get().GetExecutablePath() + "\"");
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
std::string bundle_path = agi::util::OSX_GetBundlePath();
|
std::string bundle_path = agi::util::GetBundlePath();
|
||||||
std::string helper_path = agi::util::OSX_GetBundleAuxillaryExecutablePath("restart-helper");
|
std::string helper_path = agi::util::GetBundleAuxillaryExecutablePath("restart-helper");
|
||||||
if (bundle_path.empty() || helper_path.empty()) return;
|
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));
|
wxString exec = wxString::Format("\"%s\" /usr/bin/open -n \"%s\"'", to_wx(helper_path), to_wx(bundle_path));
|
||||||
|
|
Loading…
Reference in a new issue