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

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

Issue 20093: Add native drawing context typedef so that we can cut down on some #ifdefs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698