| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 typedef struct HICON__* HICON; | 35 typedef struct HICON__* HICON; |
| 36 typedef HICON HCURSOR; | 36 typedef HICON HCURSOR; |
| 37 #include <wtf/PassRefPtr.h> | 37 #include <wtf/PassRefPtr.h> |
| 38 #include <wtf/RefCounted.h> | 38 #include <wtf/RefCounted.h> |
| 39 #elif PLATFORM(MAC) | 39 #elif PLATFORM(MAC) |
| 40 #include <wtf/RetainPtr.h> | 40 #include <wtf/RetainPtr.h> |
| 41 #elif PLATFORM(GTK) | 41 #elif PLATFORM(GTK) |
| 42 #include "GRefPtrGtk.h" | 42 #include "GRefPtrGtk.h" |
| 43 #elif PLATFORM(QT) | 43 #elif PLATFORM(QT) |
| 44 #include <QCursor> | 44 #include <QCursor> |
| 45 #elif PLATFORM(BLACKBERRY) | |
| 46 #include <BlackBerryPlatformCursor.h> | |
| 47 #endif | 45 #endif |
| 48 | 46 |
| 49 #if PLATFORM(MAC) && !PLATFORM(IOS) | 47 #if PLATFORM(MAC) && !PLATFORM(IOS) |
| 50 OBJC_CLASS NSCursor; | 48 OBJC_CLASS NSCursor; |
| 51 #endif | 49 #endif |
| 52 | 50 |
| 53 #if PLATFORM(WIN) | 51 #if PLATFORM(WIN) |
| 54 typedef struct HICON__ *HICON; | 52 typedef struct HICON__ *HICON; |
| 55 typedef HICON HCURSOR; | 53 typedef HICON HCURSOR; |
| 56 #endif | 54 #endif |
| 57 | 55 |
| 58 // Looks like it's just PLATFORM(BLACKBERRY) still not using this? | |
| 59 #if PLATFORM(WIN) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(
CHROMIUM) | |
| 60 #define WTF_USE_LAZY_NATIVE_CURSOR 1 | 56 #define WTF_USE_LAZY_NATIVE_CURSOR 1 |
| 61 #endif | |
| 62 | 57 |
| 63 namespace WebCore { | 58 namespace WebCore { |
| 64 | 59 |
| 65 class Image; | 60 class Image; |
| 66 | 61 |
| 67 #if PLATFORM(WIN) | 62 #if PLATFORM(WIN) |
| 68 class SharedCursor : public RefCounted<SharedCursor> { | 63 class SharedCursor : public RefCounted<SharedCursor> { |
| 69 public: | 64 public: |
| 70 static PassRefPtr<SharedCursor> create(HCURSOR nativeCursor) { return ad
optRef(new SharedCursor(nativeCursor)); } | 65 static PassRefPtr<SharedCursor> create(HCURSOR nativeCursor) { return ad
optRef(new SharedCursor(nativeCursor)); } |
| 71 ~SharedCursor(); | 66 ~SharedCursor(); |
| 72 HCURSOR nativeCursor() const { return m_nativeCursor; } | 67 HCURSOR nativeCursor() const { return m_nativeCursor; } |
| 73 private: | 68 private: |
| 74 SharedCursor(HCURSOR nativeCursor) : m_nativeCursor(nativeCursor) { } | 69 SharedCursor(HCURSOR nativeCursor) : m_nativeCursor(nativeCursor) { } |
| 75 HCURSOR m_nativeCursor; | 70 HCURSOR m_nativeCursor; |
| 76 }; | 71 }; |
| 77 typedef RefPtr<SharedCursor> PlatformCursor; | 72 typedef RefPtr<SharedCursor> PlatformCursor; |
| 78 #elif PLATFORM(MAC) && !PLATFORM(IOS) | 73 #elif PLATFORM(MAC) && !PLATFORM(IOS) |
| 79 typedef NSCursor *PlatformCursor; | 74 typedef NSCursor *PlatformCursor; |
| 80 #elif PLATFORM(GTK) | 75 #elif PLATFORM(GTK) |
| 81 typedef GRefPtr<GdkCursor> PlatformCursor; | 76 typedef GRefPtr<GdkCursor> PlatformCursor; |
| 82 #elif PLATFORM(QT) && !defined(QT_NO_CURSOR) | 77 #elif PLATFORM(QT) && !defined(QT_NO_CURSOR) |
| 83 // Do not need to be shared but need to be created dynamically via ensurePla
tformCursor. | 78 // Do not need to be shared but need to be created dynamically via ensurePla
tformCursor. |
| 84 typedef QCursor* PlatformCursor; | 79 typedef QCursor* PlatformCursor; |
| 85 #elif PLATFORM(BLACKBERRY) | |
| 86 typedef BlackBerry::Platform::BlackBerryCursor PlatformCursor; | |
| 87 #else | 80 #else |
| 88 typedef void* PlatformCursor; | 81 typedef void* PlatformCursor; |
| 89 #endif | 82 #endif |
| 90 | 83 |
| 91 class Cursor { | 84 class Cursor { |
| 92 WTF_MAKE_FAST_ALLOCATED; | 85 WTF_MAKE_FAST_ALLOCATED; |
| 93 public: | 86 public: |
| 94 enum Type { | 87 enum Type { |
| 95 Pointer = 0, | 88 Pointer = 0, |
| 96 Cross, | 89 Cross, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 ZoomIn, | 127 ZoomIn, |
| 135 ZoomOut, | 128 ZoomOut, |
| 136 Grab, | 129 Grab, |
| 137 Grabbing, | 130 Grabbing, |
| 138 Custom | 131 Custom |
| 139 }; | 132 }; |
| 140 | 133 |
| 141 static const Cursor& fromType(Cursor::Type); | 134 static const Cursor& fromType(Cursor::Type); |
| 142 | 135 |
| 143 Cursor() | 136 Cursor() |
| 144 #if !PLATFORM(IOS) && !PLATFORM(BLACKBERRY) | 137 #if !PLATFORM(IOS) |
| 145 #if USE(LAZY_NATIVE_CURSOR) | 138 #if USE(LAZY_NATIVE_CURSOR) |
| 146 // This is an invalid Cursor and should never actually get used. | 139 // This is an invalid Cursor and should never actually get used. |
| 147 : m_type(static_cast<Type>(-1)) | 140 : m_type(static_cast<Type>(-1)) |
| 148 , m_platformCursor(0) | 141 , m_platformCursor(0) |
| 149 #else | 142 #else |
| 150 : m_platformCursor(0) | 143 : m_platformCursor(0) |
| 151 #endif // USE(LAZY_NATIVE_CURSOR) | 144 #endif // USE(LAZY_NATIVE_CURSOR) |
| 152 #endif // !PLATFORM(IOS) && !PLATFORM(BLACKBERRY) | 145 #endif // !PLATFORM(IOS) |
| 153 { | 146 { |
| 154 } | 147 } |
| 155 | 148 |
| 156 #if !PLATFORM(IOS) | 149 #if !PLATFORM(IOS) |
| 157 Cursor(Image*, const IntPoint& hotSpot); | 150 Cursor(Image*, const IntPoint& hotSpot); |
| 158 Cursor(const Cursor&); | 151 Cursor(const Cursor&); |
| 159 | 152 |
| 160 #if ENABLE(MOUSE_CURSOR_SCALE) | 153 #if ENABLE(MOUSE_CURSOR_SCALE) |
| 161 // Hot spot is in image pixels. | 154 // Hot spot is in image pixels. |
| 162 Cursor(Image*, const IntPoint& hotSpot, float imageScaleFactor); | 155 Cursor(Image*, const IntPoint& hotSpot, float imageScaleFactor); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 const Cursor& zoomInCursor(); | 239 const Cursor& zoomInCursor(); |
| 247 const Cursor& zoomOutCursor(); | 240 const Cursor& zoomOutCursor(); |
| 248 const Cursor& copyCursor(); | 241 const Cursor& copyCursor(); |
| 249 const Cursor& noneCursor(); | 242 const Cursor& noneCursor(); |
| 250 const Cursor& grabCursor(); | 243 const Cursor& grabCursor(); |
| 251 const Cursor& grabbingCursor(); | 244 const Cursor& grabbingCursor(); |
| 252 | 245 |
| 253 } // namespace WebCore | 246 } // namespace WebCore |
| 254 | 247 |
| 255 #endif // Cursor_h | 248 #endif // Cursor_h |
| OLD | NEW |