| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 WEBKIT_GLUE_WEBCURSOR_H_ | 5 #ifndef WEBKIT_GLUE_WEBCURSOR_H_ |
| 6 #define WEBKIT_GLUE_WEBCURSOR_H_ | 6 #define WEBKIT_GLUE_WEBCURSOR_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/gfx/point.h" | 9 #include "base/gfx/point.h" |
| 10 #include "base/gfx/size.h" | 10 #include "base/gfx/size.h" |
| 11 | 11 |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
| 15 typedef struct HINSTANCE__* HINSTANCE; | 15 typedef struct HINSTANCE__* HINSTANCE; |
| 16 typedef struct HICON__* HICON; | 16 typedef struct HICON__* HICON; |
| 17 typedef HICON HCURSOR; | 17 typedef HICON HCURSOR; |
| 18 #elif defined(OS_LINUX) | 18 #elif defined(TOOLKIT_GTK) |
| 19 // GdkCursorType is an enum, which we can't forward-declare. :( | 19 // GdkCursorType is an enum, which we can't forward-declare. :( |
| 20 #include <gdk/gdkcursor.h> | 20 #include <gdk/gdkcursor.h> |
| 21 #elif defined(OS_MACOSX) | 21 #elif defined(OS_MACOSX) |
| 22 #ifdef __OBJC__ | 22 #ifdef __OBJC__ |
| 23 @class NSCursor; | 23 @class NSCursor; |
| 24 #else | 24 #else |
| 25 class NSCursor; | 25 class NSCursor; |
| 26 #endif | 26 #endif |
| 27 #endif | 27 #endif |
| 28 | 28 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // Returns a HCURSOR representing the current WebCursor instance. | 64 // Returns a HCURSOR representing the current WebCursor instance. |
| 65 // The ownership of the HCURSOR (does not apply to external cursors) remains | 65 // The ownership of the HCURSOR (does not apply to external cursors) remains |
| 66 // with the WebCursor instance. | 66 // with the WebCursor instance. |
| 67 HCURSOR GetCursor(HINSTANCE module_handle); | 67 HCURSOR GetCursor(HINSTANCE module_handle); |
| 68 | 68 |
| 69 // Initialize this from the given Windows cursor. The caller must ensure that | 69 // Initialize this from the given Windows cursor. The caller must ensure that |
| 70 // the HCURSOR remains valid by not invoking the DestroyCursor/DestroyIcon | 70 // the HCURSOR remains valid by not invoking the DestroyCursor/DestroyIcon |
| 71 // APIs on it. | 71 // APIs on it. |
| 72 void InitFromExternalCursor(HCURSOR handle); | 72 void InitFromExternalCursor(HCURSOR handle); |
| 73 | 73 |
| 74 #elif defined(OS_LINUX) | 74 #elif defined(TOOLKIT_GTK) |
| 75 // Return the stock GdkCursorType for this cursor, or GDK_CURSOR_IS_PIXMAP | 75 // Return the stock GdkCursorType for this cursor, or GDK_CURSOR_IS_PIXMAP |
| 76 // if it's a custom cursor. Return GDK_LAST_CURSOR to indicate that the cursor | 76 // if it's a custom cursor. Return GDK_LAST_CURSOR to indicate that the cursor |
| 77 // should be set to the system default. | 77 // should be set to the system default. |
| 78 GdkCursorType GetCursorType() const; | 78 GdkCursorType GetCursorType() const; |
| 79 | 79 |
| 80 // Return a new GdkCursor* for this cursor. Only valid if GetCursorType | 80 // Return a new GdkCursor* for this cursor. Only valid if GetCursorType |
| 81 // returns GDK_CURSOR_IS_PIXMAP. | 81 // returns GDK_CURSOR_IS_PIXMAP. |
| 82 GdkCursor* GetCustomCursor() const; | 82 GdkCursor* GetCustomCursor() const; |
| 83 #elif defined(OS_MACOSX) | 83 #elif defined(OS_MACOSX) |
| 84 NSCursor* GetCursor() const; | 84 NSCursor* GetCursor() const; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 #if defined(OS_WIN) | 123 #if defined(OS_WIN) |
| 124 // An externally generated HCURSOR. We assume that it remains valid, i.e we | 124 // An externally generated HCURSOR. We assume that it remains valid, i.e we |
| 125 // don't attempt to copy the HCURSOR. | 125 // don't attempt to copy the HCURSOR. |
| 126 HCURSOR external_cursor_; | 126 HCURSOR external_cursor_; |
| 127 // A custom cursor created from custom bitmap data by Webkit. | 127 // A custom cursor created from custom bitmap data by Webkit. |
| 128 HCURSOR custom_cursor_; | 128 HCURSOR custom_cursor_; |
| 129 #endif // OS_WIN | 129 #endif // OS_WIN |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 #endif // WEBKIT_GLUE_WEBCURSOR_H_ | 132 #endif // WEBKIT_GLUE_WEBCURSOR_H_ |
| OLD | NEW |