| 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 "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_ANDROID) | 10 #if defined(OS_ANDROID) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // use an HWND for this. | 25 // use an HWND for this. |
| 26 // | 26 // |
| 27 // As a rule of thumb - if you're in the renderer, you should be dealing | 27 // As a rule of thumb - if you're in the renderer, you should be dealing |
| 28 // with NativeViewIds. This should remind you that you shouldn't be doing | 28 // with NativeViewIds. This should remind you that you shouldn't be doing |
| 29 // direct operations on platform widgets from the renderer process. | 29 // direct operations on platform widgets from the renderer process. |
| 30 // | 30 // |
| 31 // If you're in the browser, you're probably dealing with NativeViews, | 31 // If you're in the browser, you're probably dealing with NativeViews, |
| 32 // unless you're in the IPC layer, which will be translating between | 32 // unless you're in the IPC layer, which will be translating between |
| 33 // NativeViewIds from the renderer and NativeViews. | 33 // NativeViewIds from the renderer and NativeViews. |
| 34 // | 34 // |
| 35 // NativeEditView: a handle to a native edit-box. The Mac folks wanted this | |
| 36 // specific typedef. | |
| 37 // | |
| 38 // NativeImage: The platform-specific image type used for drawing UI elements | 35 // NativeImage: The platform-specific image type used for drawing UI elements |
| 39 // in the browser. | 36 // in the browser. |
| 40 // | 37 // |
| 41 // The name 'View' here meshes with OS X where the UI elements are called | 38 // The name 'View' here meshes with OS X where the UI elements are called |
| 42 // 'views' and with our Chrome UI code where the elements are also called | 39 // 'views' and with our Chrome UI code where the elements are also called |
| 43 // 'views'. | 40 // 'views'. |
| 44 | 41 |
| 45 #if defined(USE_AURA) | 42 #if defined(USE_AURA) |
| 46 class SkRegion; | 43 class SkRegion; |
| 47 namespace aura { | 44 namespace aura { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 typedef void* NativeCursor; | 131 typedef void* NativeCursor; |
| 135 typedef ui::ViewAndroid* NativeView; | 132 typedef ui::ViewAndroid* NativeView; |
| 136 typedef ui::WindowAndroid* NativeWindow; | 133 typedef ui::WindowAndroid* NativeWindow; |
| 137 typedef jobject NativeEvent; | 134 typedef jobject NativeEvent; |
| 138 #else | 135 #else |
| 139 #error Unknown build environment. | 136 #error Unknown build environment. |
| 140 #endif | 137 #endif |
| 141 | 138 |
| 142 #if defined(OS_WIN) | 139 #if defined(OS_WIN) |
| 143 typedef HFONT NativeFont; | 140 typedef HFONT NativeFont; |
| 144 typedef HWND NativeEditView; | |
| 145 typedef HDC NativeDrawingContext; | 141 typedef HDC NativeDrawingContext; |
| 146 typedef IAccessible* NativeViewAccessible; | 142 typedef IAccessible* NativeViewAccessible; |
| 147 #elif defined(OS_IOS) | 143 #elif defined(OS_IOS) |
| 148 typedef UIFont* NativeFont; | 144 typedef UIFont* NativeFont; |
| 149 typedef UITextField* NativeEditView; | |
| 150 typedef CGContext* NativeDrawingContext; | 145 typedef CGContext* NativeDrawingContext; |
| 151 #ifdef __OBJC__ | 146 #ifdef __OBJC__ |
| 152 typedef id NativeViewAccessible; | 147 typedef id NativeViewAccessible; |
| 153 #else | 148 #else |
| 154 typedef void* NativeViewAccessible; | 149 typedef void* NativeViewAccessible; |
| 155 #endif // __OBJC__ | 150 #endif // __OBJC__ |
| 156 #elif defined(OS_MACOSX) | 151 #elif defined(OS_MACOSX) |
| 157 typedef NSFont* NativeFont; | 152 typedef NSFont* NativeFont; |
| 158 typedef NSTextField* NativeEditView; | |
| 159 typedef CGContext* NativeDrawingContext; | 153 typedef CGContext* NativeDrawingContext; |
| 160 #ifdef __OBJC__ | 154 #ifdef __OBJC__ |
| 161 typedef id NativeViewAccessible; | 155 typedef id NativeViewAccessible; |
| 162 #else | 156 #else |
| 163 typedef void* NativeViewAccessible; | 157 typedef void* NativeViewAccessible; |
| 164 #endif // __OBJC__ | 158 #endif // __OBJC__ |
| 165 #else // Android, Linux, Chrome OS, etc. | 159 #else // Android, Linux, Chrome OS, etc. |
| 166 // Linux doesn't have a native font type. | 160 // Linux doesn't have a native font type. |
| 167 typedef void* NativeEditView; | |
| 168 #if defined(USE_CAIRO) | 161 #if defined(USE_CAIRO) |
| 169 typedef cairo_t* NativeDrawingContext; | 162 typedef cairo_t* NativeDrawingContext; |
| 170 #else | 163 #else |
| 171 typedef void* NativeDrawingContext; | 164 typedef void* NativeDrawingContext; |
| 172 #endif // defined(USE_CAIRO) | 165 #endif // defined(USE_CAIRO) |
| 173 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 166 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 174 typedef AtkObject* NativeViewAccessible; | 167 typedef AtkObject* NativeViewAccessible; |
| 175 #else | 168 #else |
| 176 typedef void* NativeViewAccessible; | 169 typedef void* NativeViewAccessible; |
| 177 #endif | 170 #endif |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 #elif defined(USE_OZONE) | 255 #elif defined(USE_OZONE) |
| 263 typedef intptr_t AcceleratedWidget; | 256 typedef intptr_t AcceleratedWidget; |
| 264 const AcceleratedWidget kNullAcceleratedWidget = 0; | 257 const AcceleratedWidget kNullAcceleratedWidget = 0; |
| 265 #else | 258 #else |
| 266 #error unknown platform | 259 #error unknown platform |
| 267 #endif | 260 #endif |
| 268 | 261 |
| 269 } // namespace gfx | 262 } // namespace gfx |
| 270 | 263 |
| 271 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ | 264 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ |
| OLD | NEW |