2010-08-14 19:42:37 +02:00
|
|
|
// Copyright (c) 2008-2009 Niels Martin Hansen
|
|
|
|
//
|
2010-08-14 20:45:41 +02:00
|
|
|
// Permission to use, copy, modify, and distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice appear in all copies.
|
2010-08-14 19:42:37 +02:00
|
|
|
//
|
2010-08-14 20:45:41 +02:00
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2010-08-14 19:42:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
/// @file util_osx.h
|
2012-06-12 05:13:49 +02:00
|
|
|
/// @brief OSX Utilities
|
|
|
|
/// @ingroup libaegisub osx
|
2010-08-14 19:42:37 +02:00
|
|
|
///
|
|
|
|
/// Utility functions for running regular *NIX libraries inside application
|
|
|
|
/// bundles on Apple Macintosh OS X.
|
|
|
|
///
|
|
|
|
/// The GetBundle*Directory functions return the paths of directories inside
|
|
|
|
/// the appliaction bundle where the application can store static data and
|
|
|
|
/// shared libraries for its own use.
|
|
|
|
/// (The bundle and its contents should be considered read-only.)
|
|
|
|
///
|
|
|
|
/// When linking with this library, be sure to add '-framework CoreFoundation'
|
|
|
|
/// to the GCC commandline.
|
|
|
|
|
2012-06-12 05:13:49 +02:00
|
|
|
#include <string>
|
2010-08-14 19:42:37 +02:00
|
|
|
|
|
|
|
namespace agi {
|
2013-10-02 01:27:33 +02:00
|
|
|
namespace osx {
|
|
|
|
class AppNapDisabler {
|
|
|
|
void *handle;
|
|
|
|
public:
|
2014-03-26 17:24:47 +01:00
|
|
|
AppNapDisabler(std::string reason);
|
2013-10-02 01:27:33 +02:00
|
|
|
~AppNapDisabler();
|
|
|
|
};
|
|
|
|
}
|
2010-08-14 19:42:37 +02:00
|
|
|
namespace util {
|
|
|
|
/// @brief Get the esources directory.
|
|
|
|
/// @return Resources directory.
|
|
|
|
///
|
|
|
|
/// Mainly for user interface elements such as graphics and strings
|
2013-10-22 03:10:21 +02:00
|
|
|
std::string GetBundleResourcesDirectory();
|
2010-08-14 19:42:37 +02:00
|
|
|
|
|
|
|
/// @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.)
|
2013-10-22 03:10:21 +02:00
|
|
|
std::string GetBundleSharedSupportDirectory();
|
2010-08-14 19:42:37 +02:00
|
|
|
|
2013-10-22 03:10:21 +02:00
|
|
|
std::string GetApplicationSupportDirectory();
|
2013-10-02 01:27:33 +02:00
|
|
|
} // namespace util
|
2010-08-14 19:42:37 +02:00
|
|
|
} // namespace agi
|