From 8b3f4b56f93bfae8251e79c9210836437d2e945b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 26 Apr 2021 23:55:45 +0300 Subject: SL-14664 Increase range of supported cursors on prim's media --- indra/media_plugins/cef/media_plugin_cef.cpp | 77 ++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 9 deletions(-) (limited to 'indra/media_plugins/cef/media_plugin_cef.cpp') 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; -- cgit v1.2.3 From e5136cd19b38d45854d9fc69ca05b6a4c89b0394 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 27 Apr 2021 20:51:23 +0300 Subject: SL-14664 Added 'alias' --- indra/media_plugins/cef/media_plugin_cef.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/media_plugins/cef/media_plugin_cef.cpp') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 6ac5ce6dd9..7f3c159caa 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -434,7 +434,9 @@ void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) //case dullahan::CT_VERTICALTEXT: //case dullahan::CT_CELL: //case dullahan::CT_CONTEXTMENU: - //case dullahan::CT_ALIAS: + case dullahan::CT_ALIAS: + name = "tool_media_open"; + break; case dullahan::CT_PROGRESS: name = "working"; break; -- cgit v1.2.3 From 5cde118ec848cc9053a3a502daeecb417c8cfc18 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 27 Apr 2021 22:52:00 +0300 Subject: SL-14664 Added zoomout and sizeall Remade code to use getCursorFromString --- indra/media_plugins/cef/media_plugin_cef.cpp | 42 +++++++++++++++------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'indra/media_plugins/cef/media_plugin_cef.cpp') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 7f3c159caa..d5bfd7eda0 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -383,43 +383,46 @@ void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) switch (type) { - case dullahan::CT_POINTER: - name = "arrow"; - break; + case dullahan::CT_POINTER: + name = "UI_CURSOR_ARROW"; + break; case dullahan::CT_CROSS: - name = "cross"; + name = "UI_CURSOR_CROSS"; break; case dullahan::CT_HAND: - name = "hand"; + name = "UI_CURSOR_HAND"; break; case dullahan::CT_IBEAM: - name = "ibeam"; + name = "UI_CURSOR_IBEAM"; break; case dullahan::CT_WAIT: - name = "wait"; + name = "UI_CURSOR_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"; + name = "UI_CURSOR_SIZENS"; break; case dullahan::CT_COLUMNRESIZE: case dullahan::CT_EASTRESIZE: case dullahan::CT_WESTRESIZE: case dullahan::CT_EASTWESTRESIZE: - name = "split_we"; + name = "UI_CURSOR_SIZEWE"; break; case dullahan::CT_NORTHEASTRESIZE: case dullahan::CT_SOUTHWESTRESIZE: case dullahan::CT_NORTHEASTSOUTHWESTRESIZE: - name = "split_nesw"; + name = "UI_CURSOR_SIZENESW"; break; case dullahan::CT_SOUTHEASTRESIZE: case dullahan::CT_NORTHWESTRESIZE: case dullahan::CT_NORTHWESTSOUTHEASTRESIZE: - name = "split_nwse"; + name = "UI_CURSOR_SIZENWSE"; + break; + case dullahan::CT_MOVE: + name = "UI_CURSOR_SIZEALL"; break; //case dullahan::CT_MIDDLEPANNING: //case dullahan::CT_EASTPANNING: @@ -430,32 +433,33 @@ void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) //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: - name = "tool_media_open"; + name = "UI_CURSOR_TOOLMEDIAOPEN"; break; case dullahan::CT_PROGRESS: - name = "working"; + name = "UI_CURSOR_WORKING"; break; case dullahan::CT_COPY: - name = "arrow_copy"; + name = "UI_CURSOR_ARROWCOPY"; break; case dullahan::CT_NONE: - name = "cursor_no"; + name = "UI_CURSOR_NO"; break; case dullahan::CT_NODROP: case dullahan::CT_NOTALLOWED: - name = "cursor_no_locked"; + name = "UI_CURSOR_NOLOCKED"; break; case dullahan::CT_ZOOMIN: + name = "UI_CURSOR_TOOLZOOMIN"; + break; case dullahan::CT_ZOOMOUT: - name = "tool_zoomin"; + name = "UI_CURSOR_TOOLZOOMOUT"; break; case dullahan::CT_GRAB: - name = "tool_grab"; + name = "UI_CURSOR_TOOLGRAB"; break; //case dullahan::CT_GRABING: //case dullahan::CT_CUSTOM: -- cgit v1.2.3 From 454c7f4543688126b2fa5c0560710f5a1733702e Mon Sep 17 00:00:00 2001 From: Callum Linden Date: Tue, 5 Oct 2021 14:37:48 -0700 Subject: Fix: SL-12320 The Viewer functionality is broken with an in-viewer enabled proxy --- indra/media_plugins/cef/media_plugin_cef.cpp | 104 ++++++++++++++++----------- 1 file changed, 62 insertions(+), 42 deletions(-) (limited to 'indra/media_plugins/cef/media_plugin_cef.cpp') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 8465285d2b..567bab2acf 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -89,6 +89,9 @@ private: bool mCookiesEnabled; bool mPluginsEnabled; bool mJavascriptEnabled; + bool mProxyEnabled; + std::string mProxyHost; + int mProxyPort; bool mDisableGPU; bool mDisableNetworkService; bool mUseMockKeyChain; @@ -124,6 +127,9 @@ MediaPluginBase(host_send_func, host_user_data) mCookiesEnabled = true; mPluginsEnabled = false; mJavascriptEnabled = true; + mProxyEnabled = false; + mProxyHost = ""; + mProxyPort = 0; mDisableGPU = false; mDisableNetworkService = true; mUseMockKeyChain = true; @@ -513,50 +519,58 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA) { - if (message_name == "init") - { - // event callbacks from Dullahan - mCEFLib->setOnPageChangedCallback(std::bind(&MediaPluginCEF::onPageChangedCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); - mCEFLib->setOnCustomSchemeURLCallback(std::bind(&MediaPluginCEF::onCustomSchemeURLCallback, this, std::placeholders::_1)); - mCEFLib->setOnConsoleMessageCallback(std::bind(&MediaPluginCEF::onConsoleMessageCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); - mCEFLib->setOnStatusMessageCallback(std::bind(&MediaPluginCEF::onStatusMessageCallback, this, std::placeholders::_1)); - mCEFLib->setOnTitleChangeCallback(std::bind(&MediaPluginCEF::onTitleChangeCallback, this, std::placeholders::_1)); - mCEFLib->setOnTooltipCallback(std::bind(&MediaPluginCEF::onTooltipCallback, this, std::placeholders::_1)); - mCEFLib->setOnLoadStartCallback(std::bind(&MediaPluginCEF::onLoadStartCallback, this)); - mCEFLib->setOnLoadEndCallback(std::bind(&MediaPluginCEF::onLoadEndCallback, this, std::placeholders::_1)); - mCEFLib->setOnLoadErrorCallback(std::bind(&MediaPluginCEF::onLoadError, this, std::placeholders::_1, std::placeholders::_2)); - mCEFLib->setOnAddressChangeCallback(std::bind(&MediaPluginCEF::onAddressChangeCallback, this, std::placeholders::_1)); - mCEFLib->setOnOpenPopupCallback(std::bind(&MediaPluginCEF::onOpenPopupCallback, this, std::placeholders::_1, std::placeholders::_2)); - mCEFLib->setOnHTTPAuthCallback(std::bind(&MediaPluginCEF::onHTTPAuthCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); - mCEFLib->setOnFileDialogCallback(std::bind(&MediaPluginCEF::onFileDialog, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); - mCEFLib->setOnCursorChangedCallback(std::bind(&MediaPluginCEF::onCursorChangedCallback, this, std::placeholders::_1)); - mCEFLib->setOnRequestExitCallback(std::bind(&MediaPluginCEF::onRequestExitCallback, this)); - mCEFLib->setOnJSDialogCallback(std::bind(&MediaPluginCEF::onJSDialogCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); - mCEFLib->setOnJSBeforeUnloadCallback(std::bind(&MediaPluginCEF::onJSBeforeUnloadCallback, this)); - - dullahan::dullahan_settings settings; + if (message_name == "init") + { + // event callbacks from Dullahan + mCEFLib->setOnPageChangedCallback(std::bind(&MediaPluginCEF::onPageChangedCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); + mCEFLib->setOnCustomSchemeURLCallback(std::bind(&MediaPluginCEF::onCustomSchemeURLCallback, this, std::placeholders::_1)); + mCEFLib->setOnConsoleMessageCallback(std::bind(&MediaPluginCEF::onConsoleMessageCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + mCEFLib->setOnStatusMessageCallback(std::bind(&MediaPluginCEF::onStatusMessageCallback, this, std::placeholders::_1)); + mCEFLib->setOnTitleChangeCallback(std::bind(&MediaPluginCEF::onTitleChangeCallback, this, std::placeholders::_1)); + mCEFLib->setOnTooltipCallback(std::bind(&MediaPluginCEF::onTooltipCallback, this, std::placeholders::_1)); + mCEFLib->setOnLoadStartCallback(std::bind(&MediaPluginCEF::onLoadStartCallback, this)); + mCEFLib->setOnLoadEndCallback(std::bind(&MediaPluginCEF::onLoadEndCallback, this, std::placeholders::_1)); + mCEFLib->setOnLoadErrorCallback(std::bind(&MediaPluginCEF::onLoadError, this, std::placeholders::_1, std::placeholders::_2)); + mCEFLib->setOnAddressChangeCallback(std::bind(&MediaPluginCEF::onAddressChangeCallback, this, std::placeholders::_1)); + mCEFLib->setOnOpenPopupCallback(std::bind(&MediaPluginCEF::onOpenPopupCallback, this, std::placeholders::_1, std::placeholders::_2)); + mCEFLib->setOnHTTPAuthCallback(std::bind(&MediaPluginCEF::onHTTPAuthCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); + mCEFLib->setOnFileDialogCallback(std::bind(&MediaPluginCEF::onFileDialog, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); + mCEFLib->setOnCursorChangedCallback(std::bind(&MediaPluginCEF::onCursorChangedCallback, this, std::placeholders::_1)); + mCEFLib->setOnRequestExitCallback(std::bind(&MediaPluginCEF::onRequestExitCallback, this)); + mCEFLib->setOnJSDialogCallback(std::bind(&MediaPluginCEF::onJSDialogCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + mCEFLib->setOnJSBeforeUnloadCallback(std::bind(&MediaPluginCEF::onJSBeforeUnloadCallback, this)); + + dullahan::dullahan_settings settings; #if LL_WINDOWS - // As of CEF version 83+, for Windows versions, we need to tell CEF - // where the host helper process is since this DLL is not in the same - // dir as the executable that loaded it (SLPlugin.exe). The code in - // Dullahan that tried to figure out the location automatically uses - // the location of the exe which isn't helpful so we tell it explicitly. - char cur_dir_str[MAX_PATH]; - GetCurrentDirectoryA(MAX_PATH, cur_dir_str); - settings.host_process_path = std::string(cur_dir_str); + // As of CEF version 83+, for Windows versions, we need to tell CEF + // where the host helper process is since this DLL is not in the same + // dir as the executable that loaded it (SLPlugin.exe). The code in + // Dullahan that tried to figure out the location automatically uses + // the location of the exe which isn't helpful so we tell it explicitly. + char cur_dir_str[MAX_PATH]; + GetCurrentDirectoryA(MAX_PATH, cur_dir_str); + settings.host_process_path = std::string(cur_dir_str); #endif - settings.accept_language_list = mHostLanguage; - - // SL-15560: Product team overruled my change to set the default - // embedded background color to match the floater background - // and set it to white - settings.background_color = 0xffffffff; // white - - settings.cache_enabled = true; - settings.root_cache_path = mRootCachePath; - settings.cache_path = mCachePath; - settings.context_cache_path = mContextCachePath; - settings.cookies_enabled = mCookiesEnabled; + settings.accept_language_list = mHostLanguage; + + // SL-15560: Product team overruled my change to set the default + // embedded background color to match the floater background + // and set it to white + settings.background_color = 0xffffffff; // white + + settings.cache_enabled = true; + settings.root_cache_path = mRootCachePath; + settings.cache_path = mCachePath; + settings.context_cache_path = mContextCachePath; + settings.cookies_enabled = mCookiesEnabled; + + // configure proxy argument if enabled and valid + if (mProxyEnabled && mProxyHost.length()) + { + std::ostringstream proxy_url; + proxy_url << mProxyHost << ":" << mProxyPort; + settings.proxy_host_port = proxy_url.str(); + } settings.disable_gpu = mDisableGPU; #if LL_DARWIN settings.disable_network_service = mDisableNetworkService; @@ -883,6 +897,12 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mDisableGPU = message_in.getValueBoolean("disable"); } + else if (message_name == "proxy_setup") + { + mProxyEnabled = message_in.getValueBoolean("enable"); + mProxyHost = message_in.getValue("host"); + mProxyPort = message_in.getValueS32("port"); + } } else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME) { -- cgit v1.2.3