| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 GFX_NATIVE_WIDGET_TYPES_H_ | 5 #ifndef GFX_NATIVE_WIDGET_TYPES_H_ |
| 6 #define GFX_NATIVE_WIDGET_TYPES_H_ | 6 #define GFX_NATIVE_WIDGET_TYPES_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // | 28 // |
| 29 // NativeEditView: a handle to a native edit-box. The Mac folks wanted this | 29 // NativeEditView: a handle to a native edit-box. The Mac folks wanted this |
| 30 // specific typedef. | 30 // specific typedef. |
| 31 // | 31 // |
| 32 // The name 'View' here meshes with OS X where the UI elements are called | 32 // The name 'View' here meshes with OS X where the UI elements are called |
| 33 // 'views' and with our Chrome UI code where the elements are also called | 33 // 'views' and with our Chrome UI code where the elements are also called |
| 34 // 'views'. | 34 // 'views'. |
| 35 | 35 |
| 36 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
| 37 #include <windows.h> | 37 #include <windows.h> |
| 38 typedef struct HFONT__* HFONT; |
| 38 #elif defined(OS_MACOSX) | 39 #elif defined(OS_MACOSX) |
| 39 struct CGContext; | 40 struct CGContext; |
| 40 #ifdef __OBJC__ | 41 #ifdef __OBJC__ |
| 42 @class NSFont; |
| 41 @class NSView; | 43 @class NSView; |
| 42 @class NSWindow; | 44 @class NSWindow; |
| 43 @class NSTextField; | 45 @class NSTextField; |
| 44 #else | 46 #else |
| 47 class NSFont; |
| 45 class NSView; | 48 class NSView; |
| 46 class NSWindow; | 49 class NSWindow; |
| 47 class NSTextField; | 50 class NSTextField; |
| 48 #endif // __OBJC__ | 51 #endif // __OBJC__ |
| 49 #elif defined(TOOLKIT_USES_GTK) | 52 #elif defined(TOOLKIT_USES_GTK) |
| 53 typedef struct _PangoFontDescription PangoFontDescription; |
| 50 typedef struct _GdkCursor GdkCursor; | 54 typedef struct _GdkCursor GdkCursor; |
| 51 typedef struct _GdkRegion GdkRegion; | 55 typedef struct _GdkRegion GdkRegion; |
| 52 typedef struct _GtkWidget GtkWidget; | 56 typedef struct _GtkWidget GtkWidget; |
| 53 typedef struct _GtkWindow GtkWindow; | 57 typedef struct _GtkWindow GtkWindow; |
| 54 typedef struct _cairo cairo_t; | 58 typedef struct _cairo cairo_t; |
| 55 #endif | 59 #endif |
| 56 | 60 |
| 57 namespace gfx { | 61 namespace gfx { |
| 58 | 62 |
| 59 #if defined(OS_WIN) | 63 #if defined(OS_WIN) |
| 64 typedef HFONT NativeFont; |
| 60 typedef HWND NativeView; | 65 typedef HWND NativeView; |
| 61 typedef HWND NativeWindow; | 66 typedef HWND NativeWindow; |
| 62 typedef HWND NativeEditView; | 67 typedef HWND NativeEditView; |
| 63 typedef HDC NativeDrawingContext; | 68 typedef HDC NativeDrawingContext; |
| 64 typedef HCURSOR NativeCursor; | 69 typedef HCURSOR NativeCursor; |
| 65 typedef HMENU NativeMenu; | 70 typedef HMENU NativeMenu; |
| 66 typedef HRGN NativeRegion; | 71 typedef HRGN NativeRegion; |
| 67 #elif defined(OS_MACOSX) | 72 #elif defined(OS_MACOSX) |
| 73 typedef NSFont* NativeFont; |
| 68 typedef NSView* NativeView; | 74 typedef NSView* NativeView; |
| 69 typedef NSWindow* NativeWindow; | 75 typedef NSWindow* NativeWindow; |
| 70 typedef NSTextField* NativeEditView; | 76 typedef NSTextField* NativeEditView; |
| 71 typedef CGContext* NativeDrawingContext; | 77 typedef CGContext* NativeDrawingContext; |
| 72 typedef void* NativeCursor; | 78 typedef void* NativeCursor; |
| 73 typedef void* NativeMenu; | 79 typedef void* NativeMenu; |
| 74 #elif defined(USE_X11) | 80 #elif defined(USE_X11) |
| 81 typedef PangoFontDescription* NativeFont; |
| 75 typedef GtkWidget* NativeView; | 82 typedef GtkWidget* NativeView; |
| 76 typedef GtkWindow* NativeWindow; | 83 typedef GtkWindow* NativeWindow; |
| 77 typedef GtkWidget* NativeEditView; | 84 typedef GtkWidget* NativeEditView; |
| 78 typedef cairo_t* NativeDrawingContext; | 85 typedef cairo_t* NativeDrawingContext; |
| 79 typedef GdkCursor* NativeCursor; | 86 typedef GdkCursor* NativeCursor; |
| 80 typedef GtkWidget* NativeMenu; | 87 typedef GtkWidget* NativeMenu; |
| 81 typedef GdkRegion* NativeRegion; | 88 typedef GdkRegion* NativeRegion; |
| 82 #endif | 89 #endif |
| 83 | 90 |
| 84 // Note: for test_shell we're packing a pointer into the NativeViewId. So, if | 91 // Note: for test_shell we're packing a pointer into the NativeViewId. So, if |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // GPU plugin becomes a full-on GPU process, this typedef can be | 151 // GPU plugin becomes a full-on GPU process, this typedef can be |
| 145 // returned to a bool. For now we use a type large enough to hold a | 152 // returned to a bool. For now we use a type large enough to hold a |
| 146 // pointer on 64-bit architectures in case we need this capability. | 153 // pointer on 64-bit architectures in case we need this capability. |
| 147 typedef uint64 PluginWindowHandle; | 154 typedef uint64 PluginWindowHandle; |
| 148 const PluginWindowHandle kNullPluginWindow = 0; | 155 const PluginWindowHandle kNullPluginWindow = 0; |
| 149 #endif | 156 #endif |
| 150 | 157 |
| 151 } // namespace gfx | 158 } // namespace gfx |
| 152 | 159 |
| 153 #endif // GFX_NATIVE_WIDGET_TYPES_H_ | 160 #endif // GFX_NATIVE_WIDGET_TYPES_H_ |
| OLD | NEW |