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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 typedef struct _GtkWidget GtkWidget; | 49 typedef struct _GtkWidget GtkWidget; |
50 typedef struct _GtkWindow GtkWindow; | 50 typedef struct _GtkWindow GtkWindow; |
51 #endif | 51 #endif |
52 | 52 |
53 namespace gfx { | 53 namespace gfx { |
54 | 54 |
55 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
56 typedef HWND NativeView; | 56 typedef HWND NativeView; |
57 typedef HWND NativeWindow; | 57 typedef HWND NativeWindow; |
58 typedef HWND NativeEditView; | 58 typedef HWND NativeEditView; |
| 59 typedef HDC NativeDrawingContext; |
59 #elif defined(OS_MACOSX) | 60 #elif defined(OS_MACOSX) |
60 typedef NSView* NativeView; | 61 typedef NSView* NativeView; |
61 typedef NSWindow* NativeWindow; | 62 typedef NSWindow* NativeWindow; |
62 typedef NSTextField* NativeEditView; | 63 typedef NSTextField* NativeEditView; |
| 64 typedef struct CGContext* NativeDrawingContext; |
63 #elif defined(OS_LINUX) | 65 #elif defined(OS_LINUX) |
64 typedef GtkWidget* NativeView; | 66 typedef GtkWidget* NativeView; |
65 typedef GtkWindow* NativeWindow; | 67 typedef GtkWindow* NativeWindow; |
66 typedef GtkWidget* NativeEditView; | 68 typedef GtkWidget* NativeEditView; |
| 69 typedef void *NativeDrawingContext; // TODO(port): update for Gtk |
67 #else // null port. | 70 #else // null port. |
68 #error No known OS defined | 71 #error No known OS defined |
69 #endif | 72 #endif |
70 | 73 |
71 // 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 |
72 // 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 |
73 // test_shell. | 76 // test_shell. |
74 // | 77 // |
75 // See comment at the top of the file for usage. | 78 // See comment at the top of the file for usage. |
76 typedef intptr_t NativeViewId; | 79 typedef intptr_t NativeViewId; |
(...skipping 12 matching lines...) Expand all Loading... |
89 // NativeView == HWND). | 92 // NativeView == HWND). |
90 // 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 |
91 // This is only to be called in the browser process. | 94 // This is only to be called in the browser process. |
92 static inline NativeViewId IdFromNativeView(NativeView view) { | 95 static inline NativeViewId IdFromNativeView(NativeView view) { |
93 return reinterpret_cast<NativeViewId>(view); | 96 return reinterpret_cast<NativeViewId>(view); |
94 } | 97 } |
95 | 98 |
96 } // namespace gfx | 99 } // namespace gfx |
97 | 100 |
98 #endif // BASE_GFX_NATIVE_WIDGET_TYPES_H_ | 101 #endif // BASE_GFX_NATIVE_WIDGET_TYPES_H_ |
OLD | NEW |