| 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 "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 #if defined(OS_ANDROID) | 13 #if defined(OS_ANDROID) |
| 14 #include <jni.h> | 14 #include <jni.h> |
| 15 #elif defined(OS_MACOSX) |
| 16 #include <objc/objc.h> |
| 15 #endif | 17 #endif |
| 16 | 18 |
| 17 // This file provides cross platform typedefs for native widget types. | 19 // This file provides cross platform typedefs for native widget types. |
| 18 // NativeWindow: this is a handle to a native, top-level window | 20 // 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 | 21 // NativeView: this is a handle to a native UI element. It may be the |
| 20 // same type as a NativeWindow on some platforms. | 22 // same type as a NativeWindow on some platforms. |
| 21 // NativeViewId: Often, in our cross process model, we need to pass around a | 23 // NativeViewId: Often, in our cross process model, we need to pass around a |
| 22 // reference to a "window". This reference will, say, be echoed back from a | 24 // reference to a "window". This reference will, say, be echoed back from a |
| 23 // renderer to the browser when it wishes to query its size. On Windows we | 25 // renderer to the browser when it wishes to query its size. On Windows we |
| 24 // use an HWND for this. | 26 // use an HWND for this. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 typedef jobject NativeEvent; | 134 typedef jobject NativeEvent; |
| 133 #else | 135 #else |
| 134 #error Unknown build environment. | 136 #error Unknown build environment. |
| 135 #endif | 137 #endif |
| 136 | 138 |
| 137 #if defined(OS_WIN) | 139 #if defined(OS_WIN) |
| 138 typedef HFONT NativeFont; | 140 typedef HFONT NativeFont; |
| 139 typedef IAccessible* NativeViewAccessible; | 141 typedef IAccessible* NativeViewAccessible; |
| 140 #elif defined(OS_IOS) | 142 #elif defined(OS_IOS) |
| 141 typedef UIFont* NativeFont; | 143 typedef UIFont* NativeFont; |
| 142 #ifdef __OBJC__ | |
| 143 typedef id NativeViewAccessible; | 144 typedef id NativeViewAccessible; |
| 144 #else | |
| 145 typedef void* NativeViewAccessible; | |
| 146 #endif // __OBJC__ | |
| 147 #elif defined(OS_MACOSX) | 145 #elif defined(OS_MACOSX) |
| 148 typedef NSFont* NativeFont; | 146 typedef NSFont* NativeFont; |
| 149 #ifdef __OBJC__ | |
| 150 typedef id NativeViewAccessible; | 147 typedef id NativeViewAccessible; |
| 151 #else | |
| 152 typedef void* NativeViewAccessible; | |
| 153 #endif // __OBJC__ | |
| 154 #else // Android, Linux, Chrome OS, etc. | 148 #else // Android, Linux, Chrome OS, etc. |
| 155 // Linux doesn't have a native font type. | 149 // Linux doesn't have a native font type. |
| 156 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 150 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 157 typedef AtkObject* NativeViewAccessible; | 151 typedef AtkObject* NativeViewAccessible; |
| 158 #else | 152 #else |
| 159 typedef void* NativeViewAccessible; | 153 typedef void* NativeViewAccessible; |
| 160 #endif | 154 #endif |
| 161 #endif | 155 #endif |
| 162 | 156 |
| 163 // A constant value to indicate that gfx::NativeCursor refers to no cursor. | 157 // A constant value to indicate that gfx::NativeCursor refers to no cursor. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 #elif defined(USE_OZONE) | 196 #elif defined(USE_OZONE) |
| 203 typedef int32_t AcceleratedWidget; | 197 typedef int32_t AcceleratedWidget; |
| 204 constexpr AcceleratedWidget kNullAcceleratedWidget = 0; | 198 constexpr AcceleratedWidget kNullAcceleratedWidget = 0; |
| 205 #else | 199 #else |
| 206 #error unknown platform | 200 #error unknown platform |
| 207 #endif | 201 #endif |
| 208 | 202 |
| 209 } // namespace gfx | 203 } // namespace gfx |
| 210 | 204 |
| 211 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ | 205 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ |
| OLD | NEW |