summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp77
-rw-r--r--indra/newview/llviewermedia.cpp63
2 files changed, 119 insertions, 21 deletions
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp
index 0bb62d79ff..6ac5ce6dd9 100644
--- a/indra/media_plugins/cef/media_plugin_cef.cpp
+++ b/indra/media_plugins/cef/media_plugin_cef.cpp
@@ -386,18 +386,77 @@ void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type)
case dullahan::CT_POINTER:
name = "arrow";
break;
+ case dullahan::CT_CROSS:
+ name = "cross";
+ break;
+ case dullahan::CT_HAND:
+ name = "hand";
+ break;
case dullahan::CT_IBEAM:
name = "ibeam";
break;
- case dullahan::CT_NORTHSOUTHRESIZE:
- name = "splitv";
- break;
- case dullahan::CT_EASTWESTRESIZE:
- name = "splith";
- break;
- case dullahan::CT_HAND:
- name = "hand";
- break;
+ case dullahan::CT_WAIT:
+ name = "wait";
+ break;
+ //case dullahan::CT_HELP:
+ case dullahan::CT_ROWRESIZE:
+ case dullahan::CT_NORTHRESIZE:
+ case dullahan::CT_SOUTHRESIZE:
+ case dullahan::CT_NORTHSOUTHRESIZE:
+ name = "split_ns";
+ break;
+ case dullahan::CT_COLUMNRESIZE:
+ case dullahan::CT_EASTRESIZE:
+ case dullahan::CT_WESTRESIZE:
+ case dullahan::CT_EASTWESTRESIZE:
+ name = "split_we";
+ break;
+ case dullahan::CT_NORTHEASTRESIZE:
+ case dullahan::CT_SOUTHWESTRESIZE:
+ case dullahan::CT_NORTHEASTSOUTHWESTRESIZE:
+ name = "split_nesw";
+ break;
+ case dullahan::CT_SOUTHEASTRESIZE:
+ case dullahan::CT_NORTHWESTRESIZE:
+ case dullahan::CT_NORTHWESTSOUTHEASTRESIZE:
+ name = "split_nwse";
+ break;
+ //case dullahan::CT_MIDDLEPANNING:
+ //case dullahan::CT_EASTPANNING:
+ //case dullahan::CT_NORTHPANNING:
+ //case dullahan::CT_NORTHEASTPANNING:
+ //case dullahan::CT_NORTHWESTPANNING:
+ //case dullahan::CT_SOUTHPANNING:
+ //case dullahan::CT_SOUTHEASTPANNING:
+ //case dullahan::CT_SOUTHWESTPANNING:
+ //case dullahan::CT_WESTPANNING:
+ //case dullahan::CT_MOVE:
+ //case dullahan::CT_VERTICALTEXT:
+ //case dullahan::CT_CELL:
+ //case dullahan::CT_CONTEXTMENU:
+ //case dullahan::CT_ALIAS:
+ case dullahan::CT_PROGRESS:
+ name = "working";
+ break;
+ case dullahan::CT_COPY:
+ name = "arrow_copy";
+ break;
+ case dullahan::CT_NONE:
+ name = "cursor_no";
+ break;
+ case dullahan::CT_NODROP:
+ case dullahan::CT_NOTALLOWED:
+ name = "cursor_no_locked";
+ break;
+ case dullahan::CT_ZOOMIN:
+ case dullahan::CT_ZOOMOUT:
+ name = "tool_zoomin";
+ break;
+ case dullahan::CT_GRAB:
+ name = "tool_grab";
+ break;
+ //case dullahan::CT_GRABING:
+ //case dullahan::CT_CUSTOM:
default:
LL_WARNS() << "Unknown cursor ID: " << (int)type << LL_ENDL;
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 9ed2df2759..8cf9f4a85c 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -3194,18 +3194,57 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
std::string cursor = plugin->getCursorName();
- if(cursor == "arrow")
- mLastSetCursor = UI_CURSOR_ARROW;
- else if(cursor == "ibeam")
- mLastSetCursor = UI_CURSOR_IBEAM;
- else if(cursor == "splith")
- mLastSetCursor = UI_CURSOR_SIZEWE;
- else if(cursor == "splitv")
- mLastSetCursor = UI_CURSOR_SIZENS;
- else if(cursor == "hand")
- mLastSetCursor = UI_CURSOR_HAND;
- else // for anything else, default to the arrow
- mLastSetCursor = UI_CURSOR_ARROW;
+ static const std::map<std::string, ECursorType> cursor_name_to_enum
+ {
+ {std::string("arrow"), UI_CURSOR_ARROW},
+ {std::string("wait"), UI_CURSOR_WAIT},
+ {std::string("hand"), UI_CURSOR_HAND},
+ {std::string("ibeam"), UI_CURSOR_IBEAM},
+ {std::string("cross"), UI_CURSOR_CROSS},
+ {std::string("split_nwse"), UI_CURSOR_SIZENWSE},
+ {std::string("split_nesw"), UI_CURSOR_SIZENESW},
+ {std::string("split_we"), UI_CURSOR_SIZEWE},
+ {std::string("split_ns"), UI_CURSOR_SIZENS},
+ {std::string("cursor_no"), UI_CURSOR_NO},
+ {std::string("working"), UI_CURSOR_WORKING},
+ {std::string("tool_grab"), UI_CURSOR_TOOLGRAB},
+ {std::string("tool_land"), UI_CURSOR_TOOLLAND},
+ {std::string("tool_focus"), UI_CURSOR_TOOLFOCUS},
+ {std::string("tool_create"), UI_CURSOR_TOOLCREATE},
+ {std::string("arrow_drag"), UI_CURSOR_ARROWDRAG},
+ {std::string("arrow_copy"), UI_CURSOR_ARROWCOPY},
+ {std::string("arrow_drag_multi"), UI_CURSOR_ARROWDRAGMULTI},
+ {std::string("arrow_copy_multi"), UI_CURSOR_ARROWCOPYMULTI},
+ {std::string("cursor_no_locked"), UI_CURSOR_NOLOCKED},
+ {std::string("arrow_locked"), UI_CURSOR_ARROWLOCKED},
+ {std::string("grab_locked"), UI_CURSOR_GRABLOCKED},
+ {std::string("tool_translate"), UI_CURSOR_TOOLTRANSLATE},
+ {std::string("tool_rotate"), UI_CURSOR_TOOLROTATE},
+ {std::string("tool_scale"), UI_CURSOR_TOOLSCALE},
+ {std::string("tool_camera"), UI_CURSOR_TOOLCAMERA},
+ {std::string("tool_pan"), UI_CURSOR_TOOLPAN},
+ {std::string("tool_zoomin"), UI_CURSOR_TOOLZOOMIN},
+ {std::string("tool_pick_object3"), UI_CURSOR_TOOLPICKOBJECT3},
+ {std::string("tool_play"), UI_CURSOR_TOOLPLAY},
+ {std::string("tool_pause"), UI_CURSOR_TOOLPAUSE},
+ {std::string("tool_media_open"), UI_CURSOR_TOOLMEDIAOPEN},
+ {std::string("tool_pipette"), UI_CURSOR_PIPETTE},
+ {std::string("tool_sit"), UI_CURSOR_TOOLSIT},
+ {std::string("tool_buy"), UI_CURSOR_TOOLBUY},
+ {std::string("tool_open"), UI_CURSOR_TOOLOPEN},
+ {std::string("tool_pathfinding"), UI_CURSOR_TOOLPATHFINDING},
+ };
+
+ std::map<std::string, ECursorType>::const_iterator iter = cursor_name_to_enum.find(cursor);
+ if (iter != cursor_name_to_enum.end())
+ {
+ mLastSetCursor = iter->second;
+ }
+ else
+ {
+ // for anything else, default to the arrow
+ mLastSetCursor = UI_CURSOR_ARROW;
+ }
}
break;