| 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 UI_GFX_NATIVE_WIDGET_TYPES_H_ | 5 #ifndef UI_GFX_NATIVE_WIDGET_TYPES_H_ |
| 6 #define UI_GFX_NATIVE_WIDGET_TYPES_H_ | 6 #define UI_GFX_NATIVE_WIDGET_TYPES_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/strings/string16.h" |
| 11 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 12 | 13 |
| 13 #if defined(OS_ANDROID) | 14 #if defined(OS_ANDROID) |
| 14 #include <jni.h> | 15 #include <jni.h> |
| 15 #endif | 16 #endif |
| 16 | 17 |
| 17 // This file provides cross platform typedefs for native widget types. | 18 // This file provides cross platform typedefs for native widget types. |
| 18 // NativeWindow: this is a handle to a native, top-level window | 19 // NativeWindow: this is a handle to a native, top-level window |
| 19 // NativeView: this is a handle to a native UI element. It may be the | 20 // NativeView: this is a handle to a native UI element. It may be the |
| 20 // same type as a NativeWindow on some platforms. | 21 // same type as a NativeWindow on some platforms. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 #elif defined(OS_MACOSX) | 74 #elif defined(OS_MACOSX) |
| 74 struct CGContext; | 75 struct CGContext; |
| 75 #ifdef __OBJC__ | 76 #ifdef __OBJC__ |
| 76 @class NSCursor; | 77 @class NSCursor; |
| 77 @class NSEvent; | 78 @class NSEvent; |
| 78 @class NSFont; | 79 @class NSFont; |
| 79 @class NSImage; | 80 @class NSImage; |
| 80 @class NSView; | 81 @class NSView; |
| 81 @class NSWindow; | 82 @class NSWindow; |
| 82 @class NSTextField; | 83 @class NSTextField; |
| 84 @class NSMutableAttributedString; |
| 83 #else | 85 #else |
| 84 class NSCursor; | 86 class NSCursor; |
| 85 class NSEvent; | 87 class NSEvent; |
| 86 class NSFont; | 88 class NSFont; |
| 87 class NSImage; | 89 class NSImage; |
| 88 struct NSView; | 90 struct NSView; |
| 89 class NSWindow; | 91 class NSWindow; |
| 90 class NSTextField; | 92 class NSTextField; |
| 93 class NSMutableAttributedString; |
| 91 #endif // __OBJC__ | 94 #endif // __OBJC__ |
| 92 #elif defined(OS_POSIX) | 95 #elif defined(OS_POSIX) |
| 93 typedef struct _cairo cairo_t; | 96 typedef struct _cairo cairo_t; |
| 94 #endif | 97 #endif |
| 95 | 98 |
| 96 #if defined(OS_ANDROID) | 99 #if defined(OS_ANDROID) |
| 97 struct ANativeWindow; | 100 struct ANativeWindow; |
| 98 namespace ui { | 101 namespace ui { |
| 99 class WindowAndroid; | 102 class WindowAndroid; |
| 100 class ViewAndroid; | 103 class ViewAndroid; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 #elif defined(OS_ANDROID) | 211 #elif defined(OS_ANDROID) |
| 209 typedef ANativeWindow* AcceleratedWidget; | 212 typedef ANativeWindow* AcceleratedWidget; |
| 210 const AcceleratedWidget kNullAcceleratedWidget = 0; | 213 const AcceleratedWidget kNullAcceleratedWidget = 0; |
| 211 #elif defined(USE_OZONE) | 214 #elif defined(USE_OZONE) |
| 212 typedef int32_t AcceleratedWidget; | 215 typedef int32_t AcceleratedWidget; |
| 213 const AcceleratedWidget kNullAcceleratedWidget = 0; | 216 const AcceleratedWidget kNullAcceleratedWidget = 0; |
| 214 #else | 217 #else |
| 215 #error unknown platform | 218 #error unknown platform |
| 216 #endif | 219 #endif |
| 217 | 220 |
| 221 #if defined(OS_MACOSX) |
| 222 typedef NSMutableAttributedString* NativeStyledString; |
| 223 #else |
| 224 typedef base::string16* NativeStyledString; |
| 225 #endif |
| 226 |
| 218 } // namespace gfx | 227 } // namespace gfx |
| 219 | 228 |
| 220 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ | 229 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ |
| OLD | NEW |