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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 class NSImage; | 73 class NSImage; |
74 struct NSView; | 74 struct NSView; |
75 class NSWindow; | 75 class NSWindow; |
76 class NSTextField; | 76 class NSTextField; |
77 #endif // __OBJC__ | 77 #endif // __OBJC__ |
78 #elif defined(OS_POSIX) | 78 #elif defined(OS_POSIX) |
79 typedef struct _PangoFontDescription PangoFontDescription; | 79 typedef struct _PangoFontDescription PangoFontDescription; |
80 typedef struct _cairo cairo_t; | 80 typedef struct _cairo cairo_t; |
81 #endif | 81 #endif |
82 | 82 |
83 #if defined(USE_WAYLAND) | 83 #if defined(TOOLKIT_GTK) |
84 typedef struct _GdkPixbuf GdkPixbuf; | |
85 struct wl_egl_window; | |
86 | |
87 namespace ui { | |
88 class WaylandWindow; | |
89 } | |
90 | |
91 typedef struct _GdkRegion GdkRegion; | |
92 #elif defined(TOOLKIT_GTK) | |
93 typedef struct _GdkCursor GdkCursor; | 84 typedef struct _GdkCursor GdkCursor; |
94 typedef union _GdkEvent GdkEvent; | 85 typedef union _GdkEvent GdkEvent; |
95 typedef struct _GdkPixbuf GdkPixbuf; | 86 typedef struct _GdkPixbuf GdkPixbuf; |
96 typedef struct _GdkRegion GdkRegion; | 87 typedef struct _GdkRegion GdkRegion; |
97 typedef struct _GtkWidget GtkWidget; | 88 typedef struct _GtkWidget GtkWidget; |
98 typedef struct _GtkWindow GtkWindow; | 89 typedef struct _GtkWindow GtkWindow; |
99 #elif defined(OS_ANDROID) | 90 #elif defined(OS_ANDROID) |
100 class ChromeView; | 91 class ChromeView; |
101 #endif | 92 #endif |
102 class SkBitmap; | 93 class SkBitmap; |
(...skipping 10 matching lines...) Expand all Loading... |
113 typedef HCURSOR NativeCursor; | 104 typedef HCURSOR NativeCursor; |
114 typedef HWND NativeView; | 105 typedef HWND NativeView; |
115 typedef HWND NativeWindow; | 106 typedef HWND NativeWindow; |
116 typedef HRGN NativeRegion; | 107 typedef HRGN NativeRegion; |
117 typedef MSG NativeEvent; | 108 typedef MSG NativeEvent; |
118 #elif defined(OS_MACOSX) | 109 #elif defined(OS_MACOSX) |
119 typedef NSCursor* NativeCursor; | 110 typedef NSCursor* NativeCursor; |
120 typedef NSView* NativeView; | 111 typedef NSView* NativeView; |
121 typedef NSWindow* NativeWindow; | 112 typedef NSWindow* NativeWindow; |
122 typedef NSEvent* NativeEvent; | 113 typedef NSEvent* NativeEvent; |
123 #elif defined(USE_WAYLAND) | |
124 typedef void* NativeCursor; | |
125 typedef ui::WaylandWindow* NativeView; | |
126 typedef ui::WaylandWindow* NativeWindow; | |
127 // TODO(dnicoara) This should be replaced with a cairo region or maybe | |
128 // a Wayland specific region | |
129 typedef GdkRegion* NativeRegion; | |
130 typedef void* NativeEvent; | |
131 #elif defined(TOOLKIT_GTK) | 114 #elif defined(TOOLKIT_GTK) |
132 typedef GdkCursor* NativeCursor; | 115 typedef GdkCursor* NativeCursor; |
133 typedef GtkWidget* NativeView; | 116 typedef GtkWidget* NativeView; |
134 typedef GtkWindow* NativeWindow; | 117 typedef GtkWindow* NativeWindow; |
135 typedef GdkRegion* NativeRegion; | 118 typedef GdkRegion* NativeRegion; |
136 typedef GdkEvent* NativeEvent; | 119 typedef GdkEvent* NativeEvent; |
137 #elif defined(OS_ANDROID) | 120 #elif defined(OS_ANDROID) |
138 typedef void* NativeCursor; | 121 typedef void* NativeCursor; |
139 typedef ChromeView* NativeView; | 122 typedef ChromeView* NativeView; |
140 typedef ChromeView* NativeWindow; | 123 typedef ChromeView* NativeWindow; |
141 typedef void* NativeRegion; | 124 typedef void* NativeRegion; |
142 typedef jobject NativeEvent; | 125 typedef jobject NativeEvent; |
143 #endif | 126 #endif |
144 | 127 |
145 #if defined(OS_WIN) | 128 #if defined(OS_WIN) |
146 typedef HFONT NativeFont; | 129 typedef HFONT NativeFont; |
147 typedef HWND NativeEditView; | 130 typedef HWND NativeEditView; |
148 typedef HDC NativeDrawingContext; | 131 typedef HDC NativeDrawingContext; |
149 typedef HMENU NativeMenu; | 132 typedef HMENU NativeMenu; |
150 typedef IAccessible* NativeViewAccessible; | 133 typedef IAccessible* NativeViewAccessible; |
151 #elif defined(OS_MACOSX) | 134 #elif defined(OS_MACOSX) |
152 typedef NSFont* NativeFont; | 135 typedef NSFont* NativeFont; |
153 typedef NSTextField* NativeEditView; | 136 typedef NSTextField* NativeEditView; |
154 typedef CGContext* NativeDrawingContext; | 137 typedef CGContext* NativeDrawingContext; |
155 typedef void* NativeMenu; | 138 typedef void* NativeMenu; |
156 typedef void* NativeViewAccessible; | 139 typedef void* NativeViewAccessible; |
157 #elif defined(USE_WAYLAND) | |
158 typedef PangoFontDescription* NativeFont; | |
159 typedef void* NativeEditView; | |
160 typedef cairo_t* NativeDrawingContext; | |
161 typedef void* NativeMenu; | |
162 typedef void* NativeViewAccessible; | |
163 #elif defined(TOOLKIT_GTK) | 140 #elif defined(TOOLKIT_GTK) |
164 typedef PangoFontDescription* NativeFont; | 141 typedef PangoFontDescription* NativeFont; |
165 typedef GtkWidget* NativeEditView; | 142 typedef GtkWidget* NativeEditView; |
166 typedef cairo_t* NativeDrawingContext; | 143 typedef cairo_t* NativeDrawingContext; |
167 typedef GtkWidget* NativeMenu; | 144 typedef GtkWidget* NativeMenu; |
168 typedef void* NativeViewAccessible; | 145 typedef void* NativeViewAccessible; |
169 #elif defined(USE_AURA) | 146 #elif defined(USE_AURA) |
170 typedef PangoFontDescription* NativeFont; | 147 typedef PangoFontDescription* NativeFont; |
171 typedef void* NativeEditView; | 148 typedef void* NativeEditView; |
172 typedef cairo_t* NativeDrawingContext; | 149 typedef cairo_t* NativeDrawingContext; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 return reinterpret_cast<NativeView>(id); | 203 return reinterpret_cast<NativeView>(id); |
227 } | 204 } |
228 #endif // defined(OS_POSIX) | 205 #endif // defined(OS_POSIX) |
229 | 206 |
230 // PluginWindowHandle is an abstraction wrapping "the types of windows | 207 // PluginWindowHandle is an abstraction wrapping "the types of windows |
231 // used by NPAPI plugins". On Windows it's an HWND, on X it's an X | 208 // used by NPAPI plugins". On Windows it's an HWND, on X it's an X |
232 // window id. | 209 // window id. |
233 #if defined(OS_WIN) | 210 #if defined(OS_WIN) |
234 typedef HWND PluginWindowHandle; | 211 typedef HWND PluginWindowHandle; |
235 const PluginWindowHandle kNullPluginWindow = NULL; | 212 const PluginWindowHandle kNullPluginWindow = NULL; |
236 #elif defined(USE_WAYLAND) | |
237 typedef struct wl_egl_window* PluginWindowHandle; | |
238 const PluginWindowHandle kNullPluginWindow = NULL; | |
239 #elif defined(USE_X11) | 213 #elif defined(USE_X11) |
240 typedef unsigned long PluginWindowHandle; | 214 typedef unsigned long PluginWindowHandle; |
241 const PluginWindowHandle kNullPluginWindow = 0; | 215 const PluginWindowHandle kNullPluginWindow = 0; |
242 #elif defined(USE_AURA) && defined(OS_MACOSX) | 216 #elif defined(USE_AURA) && defined(OS_MACOSX) |
243 // Mac-Aura uses NSView-backed GLSurface. Regular Mac does not. | 217 // Mac-Aura uses NSView-backed GLSurface. Regular Mac does not. |
244 // TODO(dhollowa): Rationalize these two definitions. http://crbug.com/104551. | 218 // TODO(dhollowa): Rationalize these two definitions. http://crbug.com/104551. |
245 typedef NSView* PluginWindowHandle; | 219 typedef NSView* PluginWindowHandle; |
246 const PluginWindowHandle kNullPluginWindow = 0; | 220 const PluginWindowHandle kNullPluginWindow = 0; |
247 #elif defined(OS_ANDROID) | 221 #elif defined(OS_ANDROID) |
248 typedef uint64 PluginWindowHandle; | 222 typedef uint64 PluginWindowHandle; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 int parent_gpu_process_id; | 262 int parent_gpu_process_id; |
289 uint32 parent_client_id; | 263 uint32 parent_client_id; |
290 uint32 parent_context_id; | 264 uint32 parent_context_id; |
291 uint32 parent_texture_id[2]; | 265 uint32 parent_texture_id[2]; |
292 }; | 266 }; |
293 | 267 |
294 // AcceleratedWidget provides a surface to compositors to paint pixels. | 268 // AcceleratedWidget provides a surface to compositors to paint pixels. |
295 #if defined(OS_WIN) | 269 #if defined(OS_WIN) |
296 typedef HWND AcceleratedWidget; | 270 typedef HWND AcceleratedWidget; |
297 const AcceleratedWidget kNullAcceleratedWidget = NULL; | 271 const AcceleratedWidget kNullAcceleratedWidget = NULL; |
298 #elif defined(USE_WAYLAND) | |
299 typedef struct wl_egl_window* AcceleratedWidget; | |
300 const AcceleratedWidget kNullAcceleratedWidget = NULL; | |
301 #elif defined(USE_X11) | 272 #elif defined(USE_X11) |
302 typedef unsigned long AcceleratedWidget; | 273 typedef unsigned long AcceleratedWidget; |
303 const AcceleratedWidget kNullAcceleratedWidget = 0; | 274 const AcceleratedWidget kNullAcceleratedWidget = 0; |
304 #elif defined(OS_MACOSX) | 275 #elif defined(OS_MACOSX) |
305 typedef NSView* AcceleratedWidget; | 276 typedef NSView* AcceleratedWidget; |
306 const AcceleratedWidget kNullAcceleratedWidget = 0; | 277 const AcceleratedWidget kNullAcceleratedWidget = 0; |
307 #elif defined(OS_ANDROID) | 278 #elif defined(OS_ANDROID) |
308 typedef uint64 AcceleratedWidget; | 279 typedef uint64 AcceleratedWidget; |
309 const AcceleratedWidget kNullAcceleratedWidget = 0; | 280 const AcceleratedWidget kNullAcceleratedWidget = 0; |
310 #else | 281 #else |
311 #error unknown platform | 282 #error unknown platform |
312 #endif | 283 #endif |
313 | 284 |
314 } // namespace gfx | 285 } // namespace gfx |
315 | 286 |
316 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ | 287 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ |
OLD | NEW |