diff options
Diffstat (limited to 'base/mac')
-rw-r--r-- | base/mac/foundation_util.h | 61 | ||||
-rw-r--r-- | base/mac/mac_util.h | 56 | ||||
-rw-r--r-- | base/mac/objc_property_releaser.h | 4 | ||||
-rw-r--r-- | base/mac/os_crash_dumps.h | 4 | ||||
-rw-r--r-- | base/mac/scoped_nsautorelease_pool.h | 4 | ||||
-rw-r--r-- | base/mac/scoped_nsexception_enabler.h | 8 |
6 files changed, 69 insertions, 68 deletions
diff --git a/base/mac/foundation_util.h b/base/mac/foundation_util.h index 37c2ff1..2e7757e 100644 --- a/base/mac/foundation_util.h +++ b/base/mac/foundation_util.h @@ -11,7 +11,7 @@ #include <string> #include <vector> -#include "base/base_api.h" +#include "base/base_export.h" #include "base/logging.h" #if defined(__OBJC__) @@ -36,25 +36,25 @@ namespace base { namespace mac { // Returns true if the application is running from a bundle -BASE_API bool AmIBundled(); -BASE_API void SetOverrideAmIBundled(bool value); +BASE_EXPORT bool AmIBundled(); +BASE_EXPORT void SetOverrideAmIBundled(bool value); // Returns true if this process is marked as a "Background only process". -BASE_API bool IsBackgroundOnlyProcess(); +BASE_EXPORT bool IsBackgroundOnlyProcess(); // Returns the main bundle or the override, used for code that needs // to fetch resources from bundles, but work within a unittest where we // aren't a bundle. -BASE_API NSBundle* MainAppBundle(); -BASE_API FilePath MainAppBundlePath(); +BASE_EXPORT NSBundle* MainAppBundle(); +BASE_EXPORT FilePath MainAppBundlePath(); // Returns the path to a resource within the MainAppBundle. FilePath PathForMainAppBundleResource(CFStringRef resourceName); // Set the bundle that MainAppBundle will return, overriding the default value // (Restore the default by calling SetOverrideAppBundle(nil)). -BASE_API void SetOverrideAppBundle(NSBundle* bundle); -BASE_API void SetOverrideAppBundlePath(const FilePath& file_path); +BASE_EXPORT void SetOverrideAppBundle(NSBundle* bundle); +BASE_EXPORT void SetOverrideAppBundlePath(const FilePath& file_path); // Returns the creator code associated with the CFBundleRef at bundle. OSType CreatorCodeForCFBundleRef(CFBundleRef bundle); @@ -65,7 +65,7 @@ OSType CreatorCodeForCFBundleRef(CFBundleRef bundle); // does not respect the override app bundle because it's based on CFBundle // instead of NSBundle, and because callers probably don't want the override // app bundle's creator code anyway. -BASE_API OSType CreatorCodeForApplication(); +BASE_EXPORT OSType CreatorCodeForApplication(); // Searches for directories for the given key in only the given |domain_mask|. // If found, fills result (which must always be non-NULL) with the @@ -77,34 +77,34 @@ bool GetSearchPathDirectory(NSSearchPathDirectory directory, // Searches for directories for the given key in only the local domain. // If found, fills result (which must always be non-NULL) with the // first found directory and returns true. Otherwise, returns false. -BASE_API bool GetLocalDirectory(NSSearchPathDirectory directory, - FilePath* result); +BASE_EXPORT bool GetLocalDirectory(NSSearchPathDirectory directory, + FilePath* result); // Searches for directories for the given key in only the user domain. // If found, fills result (which must always be non-NULL) with the // first found directory and returns true. Otherwise, returns false. -BASE_API bool GetUserDirectory(NSSearchPathDirectory directory, - FilePath* result); +BASE_EXPORT bool GetUserDirectory(NSSearchPathDirectory directory, + FilePath* result); // Returns the ~/Library directory. -BASE_API FilePath GetUserLibraryPath(); +BASE_EXPORT FilePath GetUserLibraryPath(); // Takes a path to an (executable) binary and tries to provide the path to an // application bundle containing it. It takes the outermost bundle that it can // find (so for "/Foo/Bar.app/.../Baz.app/..." it produces "/Foo/Bar.app"). // |exec_name| - path to the binary // returns - path to the application bundle, or empty on error -BASE_API FilePath GetAppBundlePath(const FilePath& exec_name); +BASE_EXPORT FilePath GetAppBundlePath(const FilePath& exec_name); // Utility function to pull out a value from a dictionary, check its type, and // return it. Returns NULL if the key is not present or of the wrong type. -BASE_API CFTypeRef GetValueFromDictionary(CFDictionaryRef dict, - CFStringRef key, - CFTypeID expected_type); +BASE_EXPORT CFTypeRef GetValueFromDictionary(CFDictionaryRef dict, + CFStringRef key, + CFTypeID expected_type); // Retain/release calls for memory management in C++. -BASE_API void NSObjectRetain(void* obj); -BASE_API void NSObjectRelease(void* obj); +BASE_EXPORT void NSObjectRetain(void* obj); +BASE_EXPORT void NSObjectRelease(void* obj); // CFTypeRefToNSObjectAutorelease transfers ownership of a Core Foundation // object (one derived from CFTypeRef) to the Foundation memory management @@ -123,16 +123,16 @@ BASE_API void NSObjectRelease(void* obj); // returned NSObject. // // Returns an id, typed here for C++'s sake as a void*. -BASE_API void* CFTypeRefToNSObjectAutorelease(CFTypeRef cf_object); +BASE_EXPORT void* CFTypeRefToNSObjectAutorelease(CFTypeRef cf_object); // Returns the base bundle ID, which can be set by SetBaseBundleID but // defaults to a reasonable string. This never returns NULL. BaseBundleID // returns a pointer to static storage that must not be freed. -BASE_API const char* BaseBundleID(); +BASE_EXPORT const char* BaseBundleID(); // Sets the base bundle ID to override the default. The implementation will // make its own copy of new_base_bundle_id. -BASE_API void SetBaseBundleID(const char* new_base_bundle_id); +BASE_EXPORT void SetBaseBundleID(const char* new_base_bundle_id); } // namespace mac } // namespace base @@ -161,8 +161,8 @@ OBJC_CPP_CLASS_DECL(TypeNS) \ \ namespace base { \ namespace mac { \ -BASE_API TypeNS* CFToNSCast(TypeCF##Ref cf_val); \ -BASE_API TypeCF##Ref NSToCFCast(TypeNS* ns_val); \ +BASE_EXPORT TypeNS* CFToNSCast(TypeCF##Ref cf_val); \ +BASE_EXPORT TypeCF##Ref NSToCFCast(TypeNS* ns_val); \ } \ } \ @@ -172,8 +172,8 @@ OBJC_CPP_CLASS_DECL(NSMutable##name) \ \ namespace base { \ namespace mac { \ -BASE_API NSMutable##name* CFToNSCast(CFMutable##name##Ref cf_val); \ -BASE_API CFMutable##name##Ref NSToCFCast(NSMutable##name* ns_val); \ +BASE_EXPORT NSMutable##name* CFToNSCast(CFMutable##name##Ref cf_val); \ +BASE_EXPORT CFMutable##name##Ref NSToCFCast(NSMutable##name* ns_val); \ } \ } \ @@ -203,8 +203,9 @@ CF_TO_NS_CAST_DECL(CFURL, NSURL); // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); // Operator << can not be overloaded for ObjectiveC types as the compiler // can not distinguish between overloads for id with overloads for void*. -BASE_API extern std::ostream& operator<<(std::ostream& o, const CFErrorRef err); -BASE_API extern std::ostream& operator<<(std::ostream& o, - const CFStringRef str); +BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, + const CFErrorRef err); +BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, + const CFStringRef str); #endif // BASE_MAC_FOUNDATION_UTIL_H_ diff --git a/base/mac/mac_util.h b/base/mac/mac_util.h index 67151a7..e3ee0db 100644 --- a/base/mac/mac_util.h +++ b/base/mac/mac_util.h @@ -10,7 +10,7 @@ #include <Carbon/Carbon.h> #include <string> -#include "base/base_api.h" +#include "base/base_export.h" #include "base/logging.h" // TODO(rohitrao): Clean up sites that include mac_util.h and remove this line. @@ -40,22 +40,22 @@ enum FullScreenMode { kFullScreenModeNormal = 10, }; -BASE_API std::string PathFromFSRef(const FSRef& ref); -BASE_API bool FSRefFromPath(const std::string& path, FSRef* ref); +BASE_EXPORT std::string PathFromFSRef(const FSRef& ref); +BASE_EXPORT bool FSRefFromPath(const std::string& path, FSRef* ref); // Returns an sRGB color space. The return value is a static value; do not // release it! -BASE_API CGColorSpaceRef GetSRGBColorSpace(); +BASE_EXPORT CGColorSpaceRef GetSRGBColorSpace(); // Returns the color space being used by the main display. The return value // is a static value; do not release it! -BASE_API CGColorSpaceRef GetSystemColorSpace(); +BASE_EXPORT CGColorSpaceRef GetSystemColorSpace(); // Add a full screen request for the given |mode|. Must be paired with a // ReleaseFullScreen() call for the same |mode|. This does not by itself create // a fullscreen window; rather, it manages per-application state related to // hiding the dock and menubar. Must be called on the main thread. -BASE_API void RequestFullScreen(FullScreenMode mode); +BASE_EXPORT void RequestFullScreen(FullScreenMode mode); // Release a request for full screen mode. Must be matched with a // RequestFullScreen() call for the same |mode|. As with RequestFullScreen(), @@ -63,45 +63,45 @@ BASE_API void RequestFullScreen(FullScreenMode mode); // state. For example, if there are no other outstanding // |kFullScreenModeAutoHideAll| requests, this will reshow the menu bar. Must // be called on main thread. -BASE_API void ReleaseFullScreen(FullScreenMode mode); +BASE_EXPORT void ReleaseFullScreen(FullScreenMode mode); // Convenience method to switch the current fullscreen mode. This has the same // net effect as a ReleaseFullScreen(from_mode) call followed immediately by a // RequestFullScreen(to_mode). Must be called on the main thread. -BASE_API void SwitchFullScreenModes(FullScreenMode from_mode, - FullScreenMode to_mode); +BASE_EXPORT void SwitchFullScreenModes(FullScreenMode from_mode, + FullScreenMode to_mode); // Set the visibility of the cursor. -BASE_API void SetCursorVisibility(bool visible); +BASE_EXPORT void SetCursorVisibility(bool visible); // Should windows miniaturize on a double-click (on the title bar)? -BASE_API bool ShouldWindowsMiniaturizeOnDoubleClick(); +BASE_EXPORT bool ShouldWindowsMiniaturizeOnDoubleClick(); // Activates the process with the given PID. -BASE_API void ActivateProcess(pid_t pid); +BASE_EXPORT void ActivateProcess(pid_t pid); // Returns true if this process is in the foreground, meaning that it's the // frontmost process, the one whose menu bar is shown at the top of the main // display. -BASE_API bool AmIForeground(); +BASE_EXPORT bool AmIForeground(); // Excludes the file given by |file_path| from being backed up by Time Machine. -BASE_API bool SetFileBackupExclusion(const FilePath& file_path); +BASE_EXPORT bool SetFileBackupExclusion(const FilePath& file_path); // Sets the process name as displayed in Activity Monitor to process_name. -BASE_API void SetProcessName(CFStringRef process_name); +BASE_EXPORT void SetProcessName(CFStringRef process_name); // Converts a NSImage to a CGImageRef. Normally, the system frameworks can do // this fine, especially on 10.6. On 10.5, however, CGImage cannot handle // converting a PDF-backed NSImage into a CGImageRef. This function will // rasterize the PDF into a bitmap CGImage. The caller is responsible for // releasing the return value. -BASE_API CGImageRef CopyNSImageToCGImage(NSImage* image); +BASE_EXPORT CGImageRef CopyNSImageToCGImage(NSImage* image); // Checks if the current application is set as a Login Item, so it will launch // on Login. If a non-NULL pointer to is_hidden is passed, the Login Item also // is queried for the 'hide on launch' flag. -BASE_API bool CheckLoginItemStatus(bool* is_hidden); +BASE_EXPORT bool CheckLoginItemStatus(bool* is_hidden); // Adds current application to the set of Login Items with specified "hide" // flag. This has the same effect as adding/removing the application in @@ -109,14 +109,14 @@ BASE_API bool CheckLoginItemStatus(bool* is_hidden); // as "Options->Open on Login". // Does nothing if the application is already set up as Login Item with // specified hide flag. -BASE_API void AddToLoginItems(bool hide_on_startup); +BASE_EXPORT void AddToLoginItems(bool hide_on_startup); // Removes the current application from the list Of Login Items. -BASE_API void RemoveFromLoginItems(); +BASE_EXPORT void RemoveFromLoginItems(); // Returns true if the current process was automatically launched as a // 'Login Item' with 'hide on startup' flag. Used to suppress opening windows. -BASE_API bool WasLaunchedAsHiddenLoginItem(); +BASE_EXPORT bool WasLaunchedAsHiddenLoginItem(); // Run-time OS version checks. Use these instead of // base::SysInfo::OperatingSystemVersionNumbers. Prefer the "OrEarlier" and @@ -124,22 +124,22 @@ BASE_API bool WasLaunchedAsHiddenLoginItem(); // know for sure that you need to check for a specific version. // Leopard is Mac OS X 10.5, Darwin 9. -BASE_API bool IsOSLeopard(); -BASE_API bool IsOSLeopardOrEarlier(); +BASE_EXPORT bool IsOSLeopard(); +BASE_EXPORT bool IsOSLeopardOrEarlier(); // Snow Leopard is Mac OS X 10.6, Darwin 10. -BASE_API bool IsOSSnowLeopard(); -BASE_API bool IsOSSnowLeopardOrEarlier(); -BASE_API bool IsOSSnowLeopardOrLater(); +BASE_EXPORT bool IsOSSnowLeopard(); +BASE_EXPORT bool IsOSSnowLeopardOrEarlier(); +BASE_EXPORT bool IsOSSnowLeopardOrLater(); // Lion is Mac OS X 10.7, Darwin 11. -BASE_API bool IsOSLion(); -BASE_API bool IsOSLionOrLater(); +BASE_EXPORT bool IsOSLion(); +BASE_EXPORT bool IsOSLionOrLater(); // This should be infrequently used. It only makes sense to use this to avoid // codepaths that are very likely to break on future (unreleased, untested, // unborn) OS releases. -BASE_API bool IsOSLaterThanLion(); +BASE_EXPORT bool IsOSLaterThanLion(); // When the deployment target is set, the code produced cannot run on earlier // OS releases. That enables some of the IsOS* family to be implemented as diff --git a/base/mac/objc_property_releaser.h b/base/mac/objc_property_releaser.h index 58c9b66..0772c43 100644 --- a/base/mac/objc_property_releaser.h +++ b/base/mac/objc_property_releaser.h @@ -8,7 +8,7 @@ #import <Foundation/Foundation.h> -#include "base/base_api.h" +#include "base/base_export.h" namespace base { namespace mac { @@ -83,7 +83,7 @@ namespace mac { // will only operate on instance variables in the immediate object in which // the property releaser is placed. -class BASE_API ObjCPropertyReleaser { +class BASE_EXPORT ObjCPropertyReleaser { public: // ObjCPropertyReleaser can only be owned by an Objective-C object, so its // memory is always guaranteed to be 0-initialized. Not defining the default diff --git a/base/mac/os_crash_dumps.h b/base/mac/os_crash_dumps.h index 6e74365..31d90fb 100644 --- a/base/mac/os_crash_dumps.h +++ b/base/mac/os_crash_dumps.h @@ -5,7 +5,7 @@ #ifndef BASE_MAC_OS_CRASH_DUMPS_H_ #define BASE_MAC_OS_CRASH_DUMPS_H_ -#include "base/base_api.h" +#include "base/base_export.h" namespace base { namespace mac { @@ -14,7 +14,7 @@ namespace mac { // process a Chrome crash when debugging symbols are available. This // translates into a long wait until the process actually dies. This call // disables Apple Crash Reporter entirely. -BASE_API void DisableOSCrashDumps(); +BASE_EXPORT void DisableOSCrashDumps(); } // namespace mac } // namespace base diff --git a/base/mac/scoped_nsautorelease_pool.h b/base/mac/scoped_nsautorelease_pool.h index 297b10a..3f73017 100644 --- a/base/mac/scoped_nsautorelease_pool.h +++ b/base/mac/scoped_nsautorelease_pool.h @@ -6,7 +6,7 @@ #define BASE_MAC_SCOPED_NSAUTORELEASE_POOL_H_ #pragma once -#include "base/base_api.h" +#include "base/base_export.h" #include "base/basictypes.h" #if defined(OS_MACOSX) @@ -28,7 +28,7 @@ namespace mac { // On other platforms, ScopedNSAutoreleasePool is an empty object with no // effects. This allows it to be used directly in cross-platform code without // ugly #ifdefs. -class BASE_API ScopedNSAutoreleasePool { +class BASE_EXPORT ScopedNSAutoreleasePool { public: #if !defined(OS_MACOSX) ScopedNSAutoreleasePool() {} diff --git a/base/mac/scoped_nsexception_enabler.h b/base/mac/scoped_nsexception_enabler.h index a251fcc..3c16d2f 100644 --- a/base/mac/scoped_nsexception_enabler.h +++ b/base/mac/scoped_nsexception_enabler.h @@ -6,7 +6,7 @@ #define BASE_MAC_SCOPED_NSEXCEPTION_ENABLER_H_ #pragma once -#include "base/base_api.h" +#include "base/base_export.h" #include "base/basictypes.h" namespace base { @@ -24,7 +24,7 @@ namespace mac { // top-level event loop, things are cleared in -reportException:. If // the exception is caught at a lower level, a higher level scoper // should eventually reset things. -class BASE_API ScopedNSExceptionEnabler { +class BASE_EXPORT ScopedNSExceptionEnabler { public: ScopedNSExceptionEnabler(); ~ScopedNSExceptionEnabler(); @@ -38,8 +38,8 @@ class BASE_API ScopedNSExceptionEnabler { // Access the exception setting for the current thread. This is for // the support code in BrowserCrApplication, other code should use // the scoper. -BASE_API bool GetNSExceptionsAllowed(); -BASE_API void SetNSExceptionsAllowed(bool allowed); +BASE_EXPORT bool GetNSExceptionsAllowed(); +BASE_EXPORT void SetNSExceptionsAllowed(bool allowed); } // namespace mac } // namespace base |