Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: base/gfx/native_widget_types.h

Issue 42056: Basic windowless plugins, try 2. (Closed)
Patch Set: review comments Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | skia/ext/bitmap_platform_device_linux.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | skia/ext/bitmap_platform_device_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698