OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_MAC_FOUNDATION_UTIL_H_ | 5 #ifndef BASE_MAC_FOUNDATION_UTIL_H_ |
6 #define BASE_MAC_FOUNDATION_UTIL_H_ | 6 #define BASE_MAC_FOUNDATION_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <CoreFoundation/CoreFoundation.h> | 9 #include <CoreFoundation/CoreFoundation.h> |
10 #include <ApplicationServices/ApplicationServices.h> | |
msw
2012/06/22 17:42:10
Lint: Include "ApplicationServices/ApplicationServ
Alexei Svitkine (slow)
2012/06/22 19:35:29
Done.
| |
10 | 11 |
11 #include <string> | 12 #include <string> |
12 #include <vector> | 13 #include <vector> |
13 | 14 |
14 #include "base/base_export.h" | 15 #include "base/base_export.h" |
15 #include "base/logging.h" | 16 #include "base/logging.h" |
16 #include "base/mac/scoped_cftyperef.h" | 17 #include "base/mac/scoped_cftyperef.h" |
17 | 18 |
18 #if defined(__OBJC__) | 19 #if defined(__OBJC__) |
19 #import <Foundation/Foundation.h> | 20 #import <Foundation/Foundation.h> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 TYPE_NAME_FOR_CF_TYPE_DECL(CFBag); | 97 TYPE_NAME_FOR_CF_TYPE_DECL(CFBag); |
97 TYPE_NAME_FOR_CF_TYPE_DECL(CFBoolean); | 98 TYPE_NAME_FOR_CF_TYPE_DECL(CFBoolean); |
98 TYPE_NAME_FOR_CF_TYPE_DECL(CFData); | 99 TYPE_NAME_FOR_CF_TYPE_DECL(CFData); |
99 TYPE_NAME_FOR_CF_TYPE_DECL(CFDate); | 100 TYPE_NAME_FOR_CF_TYPE_DECL(CFDate); |
100 TYPE_NAME_FOR_CF_TYPE_DECL(CFDictionary); | 101 TYPE_NAME_FOR_CF_TYPE_DECL(CFDictionary); |
101 TYPE_NAME_FOR_CF_TYPE_DECL(CFNull); | 102 TYPE_NAME_FOR_CF_TYPE_DECL(CFNull); |
102 TYPE_NAME_FOR_CF_TYPE_DECL(CFNumber); | 103 TYPE_NAME_FOR_CF_TYPE_DECL(CFNumber); |
103 TYPE_NAME_FOR_CF_TYPE_DECL(CFSet); | 104 TYPE_NAME_FOR_CF_TYPE_DECL(CFSet); |
104 TYPE_NAME_FOR_CF_TYPE_DECL(CFString); | 105 TYPE_NAME_FOR_CF_TYPE_DECL(CFString); |
105 | 106 |
107 TYPE_NAME_FOR_CF_TYPE_DECL(CGColor); | |
108 | |
109 TYPE_NAME_FOR_CF_TYPE_DECL(CTFont); | |
110 TYPE_NAME_FOR_CF_TYPE_DECL(CTRun); | |
111 | |
106 #undef TYPE_NAME_FOR_CF_TYPE_DECL | 112 #undef TYPE_NAME_FOR_CF_TYPE_DECL |
107 | 113 |
108 // Retain/release calls for memory management in C++. | 114 // Retain/release calls for memory management in C++. |
109 BASE_EXPORT void NSObjectRetain(void* obj); | 115 BASE_EXPORT void NSObjectRetain(void* obj); |
110 BASE_EXPORT void NSObjectRelease(void* obj); | 116 BASE_EXPORT void NSObjectRelease(void* obj); |
111 | 117 |
112 // CFTypeRefToNSObjectAutorelease transfers ownership of a Core Foundation | 118 // CFTypeRefToNSObjectAutorelease transfers ownership of a Core Foundation |
113 // object (one derived from CFTypeRef) to the Foundation memory management | 119 // object (one derived from CFTypeRef) to the Foundation memory management |
114 // system. In a traditional managed-memory environment, cf_object is | 120 // system. In a traditional managed-memory environment, cf_object is |
115 // autoreleased and returned as an NSObject. In a garbage-collected | 121 // autoreleased and returned as an NSObject. In a garbage-collected |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 CF_CAST_DECL(CFBag); | 247 CF_CAST_DECL(CFBag); |
242 CF_CAST_DECL(CFBoolean); | 248 CF_CAST_DECL(CFBoolean); |
243 CF_CAST_DECL(CFData); | 249 CF_CAST_DECL(CFData); |
244 CF_CAST_DECL(CFDate); | 250 CF_CAST_DECL(CFDate); |
245 CF_CAST_DECL(CFDictionary); | 251 CF_CAST_DECL(CFDictionary); |
246 CF_CAST_DECL(CFNull); | 252 CF_CAST_DECL(CFNull); |
247 CF_CAST_DECL(CFNumber); | 253 CF_CAST_DECL(CFNumber); |
248 CF_CAST_DECL(CFSet); | 254 CF_CAST_DECL(CFSet); |
249 CF_CAST_DECL(CFString); | 255 CF_CAST_DECL(CFString); |
250 | 256 |
257 CF_CAST_DECL(CGColor); | |
258 | |
259 CF_CAST_DECL(CTFont); | |
260 CF_CAST_DECL(CTRun); | |
261 | |
251 CF_CAST_DECL(SecACL); | 262 CF_CAST_DECL(SecACL); |
252 CF_CAST_DECL(SecTrustedApplication); | 263 CF_CAST_DECL(SecTrustedApplication); |
253 | 264 |
254 #undef CF_CAST_DECL | 265 #undef CF_CAST_DECL |
255 | 266 |
256 #if defined(__OBJC__) | 267 #if defined(__OBJC__) |
257 | 268 |
258 // ObjCCast<>() and ObjCCastStrict<>() cast a basic id to a more | 269 // ObjCCast<>() and ObjCCastStrict<>() cast a basic id to a more |
259 // specific (NSObject-derived) type. The compatibility of the passed | 270 // specific (NSObject-derived) type. The compatibility of the passed |
260 // object is found by checking if it's a kind of the requested type | 271 // object is found by checking if it's a kind of the requested type |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 // by using the NSToCFCast methods above. | 340 // by using the NSToCFCast methods above. |
330 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); | 341 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); |
331 // Operator << can not be overloaded for ObjectiveC types as the compiler | 342 // Operator << can not be overloaded for ObjectiveC types as the compiler |
332 // can not distinguish between overloads for id with overloads for void*. | 343 // can not distinguish between overloads for id with overloads for void*. |
333 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, | 344 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, |
334 const CFErrorRef err); | 345 const CFErrorRef err); |
335 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, | 346 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, |
336 const CFStringRef str); | 347 const CFStringRef str); |
337 | 348 |
338 #endif // BASE_MAC_FOUNDATION_UTIL_H_ | 349 #endif // BASE_MAC_FOUNDATION_UTIL_H_ |
OLD | NEW |