#include "config.h"
#include "Cursor.h"
#include <Edje.h>
#include <Evas.h>
#include <wtf/Assertions.h>
namespace WebCore {
Cursor::Cursor(const Cursor& other)
: m_type(other.m_type)
, m_image(other.m_image)
, m_hotSpot(other.m_hotSpot)
#if ENABLE(MOUSE_CURSOR_SCALE)
, m_imageScaleFactor(other.m_imageScaleFactor)
#endif
, m_platformCursor(other.m_platformCursor)
{
}
Cursor::~Cursor()
{
}
Cursor& Cursor::operator=(const Cursor& other)
{
m_type = other.m_type;
m_image = other.m_image;
m_hotSpot = other.m_hotSpot;
#if ENABLE(MOUSE_CURSOR_SCALE)
m_imageScaleFactor = other.m_imageScaleFactor;
#endif
m_platformCursor = other.m_platformCursor;
return *this;
}
static const char* cursorString(Cursor::Type type)
{
static const char* cursorStrings[] = {
"cursor/pointer",
"cursor/cross",
"cursor/hand",
"cursor/i_beam",
"cursor/wait",
"cursor/help",
"cursor/east_resize",
"cursor/north_resize",
"cursor/north_east_resize",
"cursor/north_west_resize",
"cursor/south_resize",
"cursor/south_east_resize",
"cursor/south_west_resize",
"cursor/west_resize",
"cursor/north_south_resize",
"cursor/east_west_resize",
"cursor/north_east_south_west_resize",
"cursor/north_west_south_east_resize",
"cursor/column_resize",
"cursor/row_resize",
"cursor/middle_panning",
"cursor/east_panning",
"cursor/north_panning",
"cursor/north_east_panning",
"cursor/north_west_panning",
"cursor/south_panning",
"cursor/south_east_panning",
"cursor/south_west_panning",
"cursor/west_panning",
"cursor/move",
"cursor/vertical_text",
"cursor/cell",
"cursor/context_menu",
"cursor/alias",
"cursor/progress",
"cursor/no_drop",
"cursor/copy",
"cursor/none",
"cursor/not_allowed",
"cursor/zoom_in",
"cursor/zoom_out",
"cursor/grab",
"cursor/grabbing",
"" };
return cursorStrings[type];
}
void Cursor::ensurePlatformCursor() const
{
if (m_platformCursor)
return;
m_platformCursor = cursorString(m_type);
}
}