1 /* 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: 7 * 8 * * Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * * Redistributions in binary form must reproduce the above 11 * copyright notice, this list of conditions and the following disclaimer 12 * in the documentation and/or other materials provided with the 13 * distribution. 14 * * Neither the name of Google Inc. nor the names of its 15 * contributors may be used to endorse or promote products derived from 16 * this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 #include "config.h" 32 #include "Cursor.h" 33 34 namespace WebCore { 35 36 Cursor::Cursor(const Cursor& other) 37 : m_impl(other.m_impl) 38 { 39 } 40 41 Cursor::Cursor(Image* image, const IntPoint& hotSpot) 42 : m_impl(image, hotSpot) 43 { 44 } 45 46 Cursor::~Cursor() 47 { 48 } 49 50 Cursor& Cursor::operator=(const Cursor& other) 51 { 52 m_impl = other.m_impl; 53 return *this; 54 } 55 56 Cursor::Cursor(PlatformCursor c) 57 : m_impl(c) 58 { 59 } 60 61 const Cursor& pointerCursor() 62 { 63 static const Cursor c(PlatformCursor::TypePointer); 64 return c; 65 } 66 67 const Cursor& crossCursor() 68 { 69 static const Cursor c(PlatformCursor::TypeCross); 70 return c; 71 } 72 73 const Cursor& handCursor() 74 { 75 static const Cursor c(PlatformCursor::TypeHand); 76 return c; 77 } 78 79 const Cursor& iBeamCursor() 80 { 81 static const Cursor c(PlatformCursor::TypeIBeam); 82 return c; 83 } 84 85 const Cursor& waitCursor() 86 { 87 static const Cursor c(PlatformCursor::TypeWait); 88 return c; 89 } 90 91 const Cursor& helpCursor() 92 { 93 static const Cursor c(PlatformCursor::TypeHelp); 94 return c; 95 } 96 97 const Cursor& eastResizeCursor() 98 { 99 static const Cursor c(PlatformCursor::TypeEastResize); 100 return c; 101 } 102 103 const Cursor& northResizeCursor() 104 { 105 static const Cursor c(PlatformCursor::TypeNorthResize); 106 return c; 107 } 108 109 const Cursor& northEastResizeCursor() 110 { 111 static const Cursor c(PlatformCursor::TypeNorthEastResize); 112 return c; 113 } 114 115 const Cursor& northWestResizeCursor() 116 { 117 static const Cursor c(PlatformCursor::TypeNorthWestResize); 118 return c; 119 } 120 121 const Cursor& southResizeCursor() 122 { 123 static const Cursor c(PlatformCursor::TypeSouthResize); 124 return c; 125 } 126 127 const Cursor& southEastResizeCursor() 128 { 129 static const Cursor c(PlatformCursor::TypeSouthEastResize); 130 return c; 131 } 132 133 const Cursor& southWestResizeCursor() 134 { 135 static const Cursor c(PlatformCursor::TypeSouthWestResize); 136 return c; 137 } 138 139 const Cursor& westResizeCursor() 140 { 141 static const Cursor c(PlatformCursor::TypeWestResize); 142 return c; 143 } 144 145 const Cursor& northSouthResizeCursor() 146 { 147 static const Cursor c(PlatformCursor::TypeNorthSouthResize); 148 return c; 149 } 150 151 const Cursor& eastWestResizeCursor() 152 { 153 static const Cursor c(PlatformCursor::TypeEastWestResize); 154 return c; 155 } 156 157 const Cursor& northEastSouthWestResizeCursor() 158 { 159 static const Cursor c(PlatformCursor::TypeNorthEastSouthWestResize); 160 return c; 161 } 162 163 const Cursor& northWestSouthEastResizeCursor() 164 { 165 static const Cursor c(PlatformCursor::TypeNorthWestSouthEastResize); 166 return c; 167 } 168 169 const Cursor& columnResizeCursor() 170 { 171 static const Cursor c(PlatformCursor::TypeColumnResize); 172 return c; 173 } 174 175 const Cursor& rowResizeCursor() 176 { 177 static const Cursor c(PlatformCursor::TypeRowResize); 178 return c; 179 } 180 181 const Cursor& middlePanningCursor() 182 { 183 static const Cursor c(PlatformCursor::TypeMiddlePanning); 184 return c; 185 } 186 187 const Cursor& eastPanningCursor() 188 { 189 static const Cursor c(PlatformCursor::TypeEastPanning); 190 return c; 191 } 192 193 const Cursor& northPanningCursor() 194 { 195 static const Cursor c(PlatformCursor::TypeNorthPanning); 196 return c; 197 } 198 199 const Cursor& northEastPanningCursor() 200 { 201 static const Cursor c(PlatformCursor::TypeNorthEastPanning); 202 return c; 203 } 204 205 const Cursor& northWestPanningCursor() 206 { 207 static const Cursor c(PlatformCursor::TypeNorthWestPanning); 208 return c; 209 } 210 211 const Cursor& southPanningCursor() 212 { 213 static const Cursor c(PlatformCursor::TypeSouthPanning); 214 return c; 215 } 216 217 const Cursor& southEastPanningCursor() 218 { 219 static const Cursor c(PlatformCursor::TypeSouthEastPanning); 220 return c; 221 } 222 223 const Cursor& southWestPanningCursor() 224 { 225 static const Cursor c(PlatformCursor::TypeSouthWestPanning); 226 return c; 227 } 228 229 const Cursor& westPanningCursor() 230 { 231 static const Cursor c(PlatformCursor::TypeWestPanning); 232 return c; 233 } 234 235 const Cursor& moveCursor() 236 { 237 static const Cursor c(PlatformCursor::TypeMove); 238 return c; 239 } 240 241 const Cursor& verticalTextCursor() 242 { 243 static const Cursor c(PlatformCursor::TypeVerticalText); 244 return c; 245 } 246 247 const Cursor& cellCursor() 248 { 249 static const Cursor c(PlatformCursor::TypeCell); 250 return c; 251 } 252 253 const Cursor& contextMenuCursor() 254 { 255 static const Cursor c(PlatformCursor::TypeContextMenu); 256 return c; 257 } 258 259 const Cursor& aliasCursor() 260 { 261 static const Cursor c(PlatformCursor::TypeAlias); 262 return c; 263 } 264 265 const Cursor& progressCursor() 266 { 267 static const Cursor c(PlatformCursor::TypeProgress); 268 return c; 269 } 270 271 const Cursor& noDropCursor() 272 { 273 static const Cursor c(PlatformCursor::TypeNoDrop); 274 return c; 275 } 276 277 const Cursor& copyCursor() 278 { 279 static const Cursor c(PlatformCursor::TypeCopy); 280 return c; 281 } 282 283 const Cursor& noneCursor() 284 { 285 static const Cursor c(PlatformCursor::TypeNone); 286 return c; 287 } 288 289 const Cursor& notAllowedCursor() 290 { 291 static const Cursor c(PlatformCursor::TypeNotAllowed); 292 return c; 293 } 294 295 const Cursor& zoomInCursor() 296 { 297 static const Cursor c(PlatformCursor::TypeZoomIn); 298 return c; 299 } 300 301 const Cursor& zoomOutCursor() 302 { 303 static const Cursor c(PlatformCursor::TypeZoomOut); 304 return c; 305 } 306 307 const Cursor& grabCursor() 308 { 309 return pointerCursor(); 310 } 311 312 const Cursor& grabbingCursor() 313 { 314 return pointerCursor(); 315 } 316 317 } // namespace WebCore 318