| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "build/build_config.h" | 10 #include "ui/ui_api.h" |
| 11 | 11 |
| 12 // This file provides cross platform typedefs for native widget types. | 12 // This file provides cross platform typedefs for native widget types. |
| 13 // NativeWindow: this is a handle to a native, top-level window | 13 // NativeWindow: this is a handle to a native, top-level window |
| 14 // NativeView: this is a handle to a native UI element. It may be the | 14 // NativeView: this is a handle to a native UI element. It may be the |
| 15 // same type as a NativeWindow on some platforms. | 15 // same type as a NativeWindow on some platforms. |
| 16 // NativeViewId: Often, in our cross process model, we need to pass around a | 16 // NativeViewId: Often, in our cross process model, we need to pass around a |
| 17 // reference to a "window". This reference will, say, be echoed back from a | 17 // reference to a "window". This reference will, say, be echoed back from a |
| 18 // renderer to the browser when it wishes to query its size. On Windows we | 18 // renderer to the browser when it wishes to query its size. On Windows we |
| 19 // use an HWND for this. | 19 // use an HWND for this. |
| 20 // | 20 // |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 #endif // defined(OS_POSIX) | 140 #endif // defined(OS_POSIX) |
| 141 | 141 |
| 142 // Convert a NativeView to a NativeViewId. See the comments at the top of | 142 // Convert a NativeView to a NativeViewId. See the comments at the top of |
| 143 // this file. | 143 // this file. |
| 144 #if defined(OS_WIN) || defined(OS_MACOSX) | 144 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 145 static inline NativeViewId IdFromNativeView(NativeView view) { | 145 static inline NativeViewId IdFromNativeView(NativeView view) { |
| 146 return reinterpret_cast<NativeViewId>(view); | 146 return reinterpret_cast<NativeViewId>(view); |
| 147 } | 147 } |
| 148 #elif defined(USE_X11) | 148 #elif defined(USE_X11) |
| 149 // Not inlined because it involves pulling too many headers. | 149 // Not inlined because it involves pulling too many headers. |
| 150 NativeViewId IdFromNativeView(NativeView view); | 150 UI_API NativeViewId IdFromNativeView(NativeView view); |
| 151 #endif // defined(USE_X11) | 151 #endif // defined(USE_X11) |
| 152 | 152 |
| 153 | 153 |
| 154 // PluginWindowHandle is an abstraction wrapping "the types of windows | 154 // PluginWindowHandle is an abstraction wrapping "the types of windows |
| 155 // used by NPAPI plugins". On Windows it's an HWND, on X it's an X | 155 // used by NPAPI plugins". On Windows it's an HWND, on X it's an X |
| 156 // window id. | 156 // window id. |
| 157 #if defined(OS_WIN) | 157 #if defined(OS_WIN) |
| 158 typedef HWND PluginWindowHandle; | 158 typedef HWND PluginWindowHandle; |
| 159 const PluginWindowHandle kNullPluginWindow = NULL; | 159 const PluginWindowHandle kNullPluginWindow = NULL; |
| 160 #elif defined(USE_X11) | 160 #elif defined(USE_X11) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 183 typedef unsigned long AcceleratedWidget; | 183 typedef unsigned long AcceleratedWidget; |
| 184 const AcceleratedWidget kNullAcceleratedWidget = 0; | 184 const AcceleratedWidget kNullAcceleratedWidget = 0; |
| 185 #else | 185 #else |
| 186 typedef void* AcceleratedWidget; | 186 typedef void* AcceleratedWidget; |
| 187 const AcceleratedWidget kNullAcceleratedWidget = NULL; | 187 const AcceleratedWidget kNullAcceleratedWidget = NULL; |
| 188 #endif | 188 #endif |
| 189 | 189 |
| 190 } // namespace gfx | 190 } // namespace gfx |
| 191 | 191 |
| 192 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ | 192 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ |
| OLD | NEW |