OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 BASE_GFX_NATIVE_WIDGET_TYPES_H_ | 5 #ifndef BASE_GFX_NATIVE_WIDGET_TYPES_H_ |
6 #define BASE_GFX_NATIVE_WIDGET_TYPES_H_ | 6 #define BASE_GFX_NATIVE_WIDGET_TYPES_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 @class NSWindow; | 42 @class NSWindow; |
43 @class NSTextField; | 43 @class NSTextField; |
44 #else | 44 #else |
45 class NSView; | 45 class NSView; |
46 class NSWindow; | 46 class NSWindow; |
47 class NSTextField; | 47 class NSTextField; |
48 #endif // __OBJC__ | 48 #endif // __OBJC__ |
49 #elif defined(OS_LINUX) | 49 #elif defined(OS_LINUX) |
50 typedef struct _GtkWidget GtkWidget; | 50 typedef struct _GtkWidget GtkWidget; |
51 typedef struct _GtkWindow GtkWindow; | 51 typedef struct _GtkWindow GtkWindow; |
| 52 typedef struct _cairo_surface cairo_surface_t; |
52 #endif | 53 #endif |
53 | 54 |
54 namespace gfx { | 55 namespace gfx { |
55 | 56 |
56 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
57 typedef HWND NativeView; | 58 typedef HWND NativeView; |
58 typedef HWND NativeWindow; | 59 typedef HWND NativeWindow; |
59 typedef HWND NativeEditView; | 60 typedef HWND NativeEditView; |
60 typedef HDC NativeDrawingContext; | 61 typedef HDC NativeDrawingContext; |
61 #elif defined(OS_MACOSX) | 62 #elif defined(OS_MACOSX) |
62 typedef NSView* NativeView; | 63 typedef NSView* NativeView; |
63 typedef NSWindow* NativeWindow; | 64 typedef NSWindow* NativeWindow; |
64 typedef NSTextField* NativeEditView; | 65 typedef NSTextField* NativeEditView; |
65 typedef CGContext* NativeDrawingContext; | 66 typedef CGContext* NativeDrawingContext; |
66 #elif defined(OS_LINUX) | 67 #elif defined(OS_LINUX) |
67 typedef GtkWidget* NativeView; | 68 typedef GtkWidget* NativeView; |
68 typedef GtkWindow* NativeWindow; | 69 typedef GtkWindow* NativeWindow; |
69 typedef GtkWidget* NativeEditView; | 70 typedef GtkWidget* NativeEditView; |
70 typedef void *NativeDrawingContext; // TODO(port): update for Gtk | 71 typedef cairo_surface_t* NativeDrawingContext; |
71 #else // null port. | |
72 #error No known OS defined | |
73 #endif | 72 #endif |
74 | 73 |
75 // Note: for test_shell we're packing a pointer into the NativeViewId. So, if | 74 // Note: for test_shell we're packing a pointer into the NativeViewId. So, if |
76 // you make it a type which is smaller than a pointer, you have to fix | 75 // you make it a type which is smaller than a pointer, you have to fix |
77 // test_shell. | 76 // test_shell. |
78 // | 77 // |
79 // See comment at the top of the file for usage. | 78 // See comment at the top of the file for usage. |
80 typedef intptr_t NativeViewId; | 79 typedef intptr_t NativeViewId; |
81 | 80 |
82 // Convert a NativeViewId to a NativeView. At the moment, we assume that the | 81 // Convert a NativeViewId to a NativeView. At the moment, we assume that the |
(...skipping 10 matching lines...) Expand all Loading... |
93 // NativeView == HWND). | 92 // NativeView == HWND). |
94 // TODO(port): figure out what ids are going to be and implement this function | 93 // TODO(port): figure out what ids are going to be and implement this function |
95 // This is only to be called in the browser process. | 94 // This is only to be called in the browser process. |
96 static inline NativeViewId IdFromNativeView(NativeView view) { | 95 static inline NativeViewId IdFromNativeView(NativeView view) { |
97 return reinterpret_cast<NativeViewId>(view); | 96 return reinterpret_cast<NativeViewId>(view); |
98 } | 97 } |
99 | 98 |
100 } // namespace gfx | 99 } // namespace gfx |
101 | 100 |
102 #endif // BASE_GFX_NATIVE_WIDGET_TYPES_H_ | 101 #endif // BASE_GFX_NATIVE_WIDGET_TYPES_H_ |
OLD | NEW |