From 5534ab4e182b8403cf0ed514059e346d55f18162 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Tue, 21 Feb 2017 15:06:21 -0800 Subject: First round of changes to replace LLCEFLib with Dullahan. Mostly Windows changes in this batch since I'm working on Windows box but some speculative macOS ones too although they are quite untested --- indra/media_plugins/cef/media_plugin_cef.cpp | 218 ++++++++++++++------------- 1 file changed, 113 insertions(+), 105 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index eaba71a6ad..b78af1b348 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -36,11 +36,12 @@ #include "llpluginmessageclasses.h" #include "media_plugin_base.h" -#include "boost/function.hpp" -#include "boost/bind.hpp" -#include "llCEFLib.h" +#include + +#include "dullahan.h" //#include "volume_catcher.h" + //////////////////////////////////////////////////////////////////////////////// // class MediaPluginCEF : @@ -56,7 +57,7 @@ public: private: bool init(); - void onPageChangedCallback(unsigned char* pixels, int x, int y, int width, int height, bool is_popup); + void onPageChangedCallback(const unsigned char* pixels, int x, int y, const int width, const int height, bool is_popup); void onCustomSchemeURLCallback(std::string url); void onConsoleMessageCallback(std::string message, std::string source, int line); void onStatusMessageCallback(std::string value); @@ -67,17 +68,17 @@ private: void onAddressChangeCallback(std::string url); void onNavigateURLCallback(std::string url, std::string target); bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password); - void onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle); + void onCursorChangedCallback(dullahan::ECursorType type, unsigned int handle); void onFileDownloadCallback(std::string filename); const std::string onFileDialogCallback(); void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); - LLCEFLib::EKeyboardModifier decodeModifiers(std::string &modifiers); + dullahan::EKeyboardModifier decodeModifiers(std::string &modifiers); void deserializeKeyboardData(LLSD native_key_data, uint32_t& native_scan_code, uint32_t& native_virtual_key, uint32_t& native_modifiers); - void keyEvent(LLCEFLib::EKeyEvent key_event, int key, LLCEFLib::EKeyboardModifier modifiers, LLSD native_key_data); - void unicodeInput(const std::string &utf8str, LLCEFLib::EKeyboardModifier modifiers, LLSD native_key_data); + void keyEvent(dullahan::EKeyEvent key_event, int key, dullahan::EKeyboardModifier modifiers, LLSD native_key_data); + void unicodeInput(const std::string &utf8str, dullahan::EKeyboardModifier modifiers, LLSD native_key_data); void checkEditState(); void setVolume(F32 vol); @@ -97,7 +98,7 @@ private: std::string mCachePath; std::string mCookiePath; std::string mPickedFile; - LLCEFLib* mLLCEFLib; + dullahan* mCEFLib; U8 *mPopupBuffer; U32 mPopupW; @@ -130,7 +131,7 @@ MediaPluginBase(host_send_func, host_user_data) mCachePath = ""; mCookiePath = ""; mPickedFile = ""; - mLLCEFLib = new LLCEFLib(); + mCEFLib = new dullahan(); mPopupBuffer = NULL; mPopupW = 0; @@ -164,8 +165,11 @@ void MediaPluginCEF::postDebugMessage(const std::string& msg) //////////////////////////////////////////////////////////////////////////////// // -void MediaPluginCEF::onPageChangedCallback(unsigned char* pixels, int x, int y, int width, int height, bool is_popup) +void MediaPluginCEF::onPageChangedCallback(const unsigned char* pixels, int x, int y, const int width, const int height, bool is_popup) { + + OutputDebugStringA("@"); + if( is_popup ) { delete mPopupBuffer; @@ -252,8 +256,8 @@ void MediaPluginCEF::onLoadStartCallback() { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin"); //message.setValue("uri", event.getEventUri()); // not easily available here in CEF - needed? - message.setValueBoolean("history_back_available", mLLCEFLib->canGoBack()); - message.setValueBoolean("history_forward_available", mLLCEFLib->canGoForward()); + message.setValueBoolean("history_back_available", mCEFLib->canGoBack()); + message.setValueBoolean("history_forward_available", mCEFLib->canGoForward()); sendMessage(message); } @@ -261,7 +265,7 @@ void MediaPluginCEF::onLoadStartCallback() // void MediaPluginCEF::onRequestExitCallback() { - mLLCEFLib->shutdown(); + mCEFLib->shutdown(); LLPluginMessage message("base", "goodbye"); sendMessage(message); @@ -274,8 +278,8 @@ void MediaPluginCEF::onLoadEndCallback(int httpStatusCode) LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete"); //message.setValue("uri", event.getEventUri()); // not easily available here in CEF - needed? message.setValueS32("result_code", httpStatusCode); - message.setValueBoolean("history_back_available", mLLCEFLib->canGoBack()); - message.setValueBoolean("history_forward_available", mLLCEFLib->canGoForward()); + message.setValueBoolean("history_back_available", mCEFLib->canGoBack()); + message.setValueBoolean("history_forward_available", mCEFLib->canGoForward()); sendMessage(message); } @@ -358,25 +362,25 @@ const std::string MediaPluginCEF::onFileDialogCallback() return mPickedFile; } -void MediaPluginCEF::onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle) +void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type, unsigned int handle) { std::string name = ""; switch (type) { - case LLCEFLib::CT_POINTER: + case dullahan::CT_POINTER: name = "arrow"; break; - case LLCEFLib::CT_IBEAM: + case dullahan::CT_IBEAM: name = "ibeam"; break; - case LLCEFLib::CT_NORTHSOUTHRESIZE: + case dullahan::CT_NORTHSOUTHRESIZE: name = "splitv"; break; - case LLCEFLib::CT_EASTWESTRESIZE: + case dullahan::CT_EASTWESTRESIZE: name = "splith"; break; - case LLCEFLib::CT_HAND: + case dullahan::CT_HAND: name = "hand"; break; @@ -428,7 +432,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_name == "idle") { - mLLCEFLib->update(); + mCEFLib->update(); // this seems bad but unless the state changes (it won't until we figure out // how to get CEF to tell us if copy/cut/paste is available) then this function @@ -437,7 +441,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_name == "cleanup") { - mLLCEFLib->requestExit(); + mCEFLib->requestExit(); } else if (message_name == "shm_added") { @@ -479,47 +483,48 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { if (message_name == "init") { - // event callbacks from LLCefLib - mLLCEFLib->setOnPageChangedCallback(boost::bind(&MediaPluginCEF::onPageChangedCallback, this, _1, _2, _3, _4, _5, _6)); - mLLCEFLib->setOnCustomSchemeURLCallback(boost::bind(&MediaPluginCEF::onCustomSchemeURLCallback, this, _1)); - mLLCEFLib->setOnConsoleMessageCallback(boost::bind(&MediaPluginCEF::onConsoleMessageCallback, this, _1, _2, _3)); - mLLCEFLib->setOnStatusMessageCallback(boost::bind(&MediaPluginCEF::onStatusMessageCallback, this, _1)); - mLLCEFLib->setOnTitleChangeCallback(boost::bind(&MediaPluginCEF::onTitleChangeCallback, this, _1)); - mLLCEFLib->setOnLoadStartCallback(boost::bind(&MediaPluginCEF::onLoadStartCallback, this)); - mLLCEFLib->setOnLoadEndCallback(boost::bind(&MediaPluginCEF::onLoadEndCallback, this, _1)); - mLLCEFLib->setOnAddressChangeCallback(boost::bind(&MediaPluginCEF::onAddressChangeCallback, this, _1)); - mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1, _2)); - mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4)); - mLLCEFLib->setOnFileDownloadCallback(boost::bind(&MediaPluginCEF::onFileDownloadCallback, this, _1)); - mLLCEFLib->setOnFileDialogCallback(boost::bind(&MediaPluginCEF::onFileDialogCallback, this)); - mLLCEFLib->setOnCursorChangedCallback(boost::bind(&MediaPluginCEF::onCursorChangedCallback, this, _1, _2)); - mLLCEFLib->setOnRequestExitCallback(boost::bind(&MediaPluginCEF::onRequestExitCallback, this)); - - LLCEFLib::LLCEFLibSettings settings; - settings.initial_width = 1024; - settings.initial_height = 1024; - // The LLCEFLibSettings struct in the Windows 32-bit - // llceflib's build 500907 does not have a page_zoom_factor - // member. Set below. - //settings.page_zoom_factor = message_in.getValueReal("factor"); - settings.plugins_enabled = mPluginsEnabled; - settings.media_stream_enabled = false; // MAINT-6060 - WebRTC media removed until we can add granualrity/query UI - settings.javascript_enabled = mJavascriptEnabled; - settings.cookies_enabled = mCookiesEnabled; - settings.cookie_store_path = mCookiePath; + // 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, std::placeholders::_6)); + 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->setOnLoadStartCallback(std::bind(&MediaPluginCEF::onLoadStartCallback, this)); + mCEFLib->setOnLoadEndCallback(std::bind(&MediaPluginCEF::onLoadEndCallback, this, std::placeholders::_1)); + mCEFLib->setOnAddressChangeCallback(std::bind(&MediaPluginCEF::onAddressChangeCallback, this, std::placeholders::_1)); + mCEFLib->setOnNavigateURLCallback(std::bind(&MediaPluginCEF::onNavigateURLCallback, 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->setOnFileDownloadCallback(std::bind(&MediaPluginCEF::onFileDownloadCallback, this, std::placeholders::_1)); + mCEFLib->setOnFileDialogCallback(std::bind(&MediaPluginCEF::onFileDialogCallback, this)); + mCEFLib->setOnCursorChangedCallback(std::bind(&MediaPluginCEF::onCursorChangedCallback, this, std::placeholders::_1, std::placeholders::_2)); + mCEFLib->setOnRequestExitCallback(std::bind(&MediaPluginCEF::onRequestExitCallback, this)); + + dullahan::dullahan_settings settings; + settings.accept_language_list = mHostLanguage; + settings.background_color = 0xffffff; settings.cache_enabled = true; settings.cache_path = mCachePath; - settings.accept_language_list = mHostLanguage; - settings.user_agent_substring = mLLCEFLib->makeCompatibleUserAgentString(mUserAgentSubtring); + settings.cookie_store_path = mCookiePath; + settings.cookies_enabled = mCookiesEnabled; + settings.flash_enabled = mPluginsEnabled; + settings.frame_rate = 60; + settings.initial_height = 1024; + settings.initial_width = 1024; + settings.java_enabled = false; + settings.javascript_enabled = mJavascriptEnabled; + settings.media_stream_enabled = false; // MAINT-6060 - WebRTC media removed until we can add granualrity/query UI + settings.plugins_enabled = mPluginsEnabled; + settings.user_agent_substring = mCEFLib->makeCompatibleUserAgentString(mUserAgentSubtring); + settings.webgl_enabled = true; - bool result = mLLCEFLib->init(settings); + bool result = mCEFLib->init(settings); if (!result) { // if this fails, the media system in viewer will put up a message } // now we can set page zoom factor - mLLCEFLib->setPageZoom(message_in.getValueReal("factor")); + mCEFLib->setPageZoom(message_in.getValueReal("factor")); // Plugin gets to decide the texture parameters to use. mDepth = 4; @@ -530,7 +535,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) message.setValueU32("internalformat", GL_RGB); message.setValueU32("format", GL_BGRA); message.setValueU32("type", GL_UNSIGNED_BYTE); - message.setValueBoolean("coords_opengl", true); + message.setValueBoolean("coords_opengl", false); sendMessage(message); } else if (message_name == "set_user_data_path") @@ -563,7 +568,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) }; }; - mLLCEFLib->setSize(mWidth, mHeight); + mCEFLib->setSize(mWidth, mHeight); LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response"); message.setValue("name", name); @@ -581,7 +586,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) else if (message_name == "load_uri") { std::string uri = message_in.getValue("uri"); - mLLCEFLib->navigate(uri); + mCEFLib->navigate(uri); } else if (message_name == "set_cookie") { @@ -592,7 +597,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) std::string path = message_in.getValue("path"); bool httponly = message_in.getValueBoolean("httponly"); bool secure = message_in.getValueBoolean("secure"); - mLLCEFLib->setCookie(uri, name, value, domain, path, httponly, secure); + mCEFLib->setCookie(uri, name, value, domain, path, httponly, secure); } else if (message_name == "mouse_event") { @@ -603,16 +608,16 @@ void MediaPluginCEF::receiveMessage(const char* message_string) y = mHeight - y; - // only even send left mouse button events to LLCEFLib + // only even send left mouse button events to the CEF library // (partially prompted by crash in OS X CEF when sending right button events) // we catch the right click in viewer and display our own context menu anyway S32 button = message_in.getValueS32("button"); - LLCEFLib::EMouseButton btn = LLCEFLib::MB_MOUSE_BUTTON_LEFT; + dullahan::EMouseButton btn = dullahan::MB_MOUSE_BUTTON_LEFT; if (event == "down" && button == 0) { - mLLCEFLib->mouseButton(btn, LLCEFLib::ME_MOUSE_DOWN, x, y); - mLLCEFLib->setFocus(true); + mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_DOWN, x, y); + mCEFLib->setFocus(); std::stringstream str; str << "Mouse down at = " << x << ", " << y; @@ -620,7 +625,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (event == "up" && button == 0) { - mLLCEFLib->mouseButton(btn, LLCEFLib::ME_MOUSE_UP, x, y); + mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_UP, x, y); std::stringstream str; str << "Mouse up at = " << x << ", " << y; @@ -628,11 +633,11 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (event == "double_click") { - mLLCEFLib->mouseButton(btn, LLCEFLib::ME_MOUSE_DOUBLE_CLICK, x, y); + mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_DOUBLE_CLICK, x, y); } else { - mLLCEFLib->mouseMove(x, y); + mCEFLib->mouseMove(x, y); } } else if (message_name == "scroll_event") @@ -642,7 +647,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) const int scaling_factor = 40; y *= -scaling_factor; - mLLCEFLib->mouseWheel(x, y); + mCEFLib->mouseWheel(x, y); } else if (message_name == "text_event") { @@ -662,28 +667,28 @@ void MediaPluginCEF::receiveMessage(const char* message_string) #if 0 if (event == "down") { - //mLLCEFLib->keyPress(key, true); - mLLCEFLib->keyboardEvent(LLCEFLib::KE_KEY_DOWN, (uint32_t)key, 0, LLCEFLib::KM_MODIFIER_NONE, 0, 0, 0); + //mCEFLib->keyPress(key, true); + mCEFLib->keyboardEvent(dullahan::KE_KEY_DOWN, (uint32_t)key, 0, dullahan::KM_MODIFIER_NONE, 0, 0, 0); } else if (event == "up") { - //mLLCEFLib->keyPress(key, false); - mLLCEFLib->keyboardEvent(LLCEFLib::KE_KEY_UP, (uint32_t)key, 0, LLCEFLib::KM_MODIFIER_NONE, 0, 0, 0); + //mCEFLib->keyPress(key, false); + mCEFLib->keyboardEvent(dullahan::KE_KEY_UP, (uint32_t)key, 0, dullahan::KM_MODIFIER_NONE, 0, 0, 0); } #else // Treat unknown events as key-up for safety. - LLCEFLib::EKeyEvent key_event = LLCEFLib::KE_KEY_UP; + dullahan::EKeyEvent key_event = dullahan::KE_KEY_UP; if (event == "down") { - key_event = LLCEFLib::KE_KEY_DOWN; + key_event = dullahan::KE_KEY_DOWN; } else if (event == "repeat") { - key_event = LLCEFLib::KE_KEY_REPEAT; + key_event = dullahan::KE_KEY_REPEAT; } - keyEvent(key_event, key, LLCEFLib::KM_MODIFIER_NONE, native_key_data); + keyEvent(key_event, key, dullahan::KM_MODIFIER_NONE, native_key_data); #endif #elif LL_WINDOWS @@ -693,14 +698,14 @@ void MediaPluginCEF::receiveMessage(const char* message_string) LLSD native_key_data = message_in.getValueLLSD("native_key_data"); // Treat unknown events as key-up for safety. - LLCEFLib::EKeyEvent key_event = LLCEFLib::KE_KEY_UP; + dullahan::EKeyEvent key_event = dullahan::KE_KEY_UP; if (event == "down") { - key_event = LLCEFLib::KE_KEY_DOWN; + key_event = dullahan::KE_KEY_DOWN; } else if (event == "repeat") { - key_event = LLCEFLib::KE_KEY_REPEAT; + key_event = dullahan::KE_KEY_REPEAT; } keyEvent(key_event, key, decodeModifiers(modifiers), native_key_data); @@ -720,15 +725,15 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } if (message_name == "edit_cut") { - mLLCEFLib->editCut(); + //$1 mCEFLib->editCut(); } if (message_name == "edit_copy") { - mLLCEFLib->editCopy(); + //$1 mCEFLib->editCopy(); } if (message_name == "edit_paste") { - mLLCEFLib->editPaste(); + //$1 mCEFLib->editPaste(); } } else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER) @@ -736,24 +741,24 @@ void MediaPluginCEF::receiveMessage(const char* message_string) if (message_name == "set_page_zoom_factor") { F32 factor = (F32)message_in.getValueReal("factor"); - mLLCEFLib->setPageZoom(factor); + mCEFLib->setPageZoom(factor); } if (message_name == "browse_stop") { - mLLCEFLib->stop(); + mCEFLib->stop(); } else if (message_name == "browse_reload") { bool ignore_cache = true; - mLLCEFLib->reload(ignore_cache); + mCEFLib->reload(ignore_cache); } else if (message_name == "browse_forward") { - mLLCEFLib->goForward(); + mCEFLib->goForward(); } else if (message_name == "browse_back") { - mLLCEFLib->goBack(); + mCEFLib->goBack(); } else if (message_name == "cookies_enabled") { @@ -765,7 +770,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_name == "show_web_inspector") { - mLLCEFLib->showDevTools(true); + mCEFLib->showDevTools(); } else if (message_name == "plugins_enabled") { @@ -790,23 +795,23 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } } -LLCEFLib::EKeyboardModifier MediaPluginCEF::decodeModifiers(std::string &modifiers) +dullahan::EKeyboardModifier MediaPluginCEF::decodeModifiers(std::string &modifiers) { int result = 0; if (modifiers.find("shift") != std::string::npos) - result |= LLCEFLib::KM_MODIFIER_SHIFT; + result |= dullahan::KM_MODIFIER_SHIFT; if (modifiers.find("alt") != std::string::npos) - result |= LLCEFLib::KM_MODIFIER_ALT; + result |= dullahan::KM_MODIFIER_ALT; if (modifiers.find("control") != std::string::npos) - result |= LLCEFLib::KM_MODIFIER_CONTROL; + result |= dullahan::KM_MODIFIER_CONTROL; if (modifiers.find("meta") != std::string::npos) - result |= LLCEFLib::KM_MODIFIER_META; + result |= dullahan::KM_MODIFIER_META; - return (LLCEFLib::EKeyboardModifier)result; + return (dullahan::EKeyboardModifier)result; } //////////////////////////////////////////////////////////////////////////////// @@ -833,7 +838,7 @@ void MediaPluginCEF::deserializeKeyboardData(LLSD native_key_data, uint32_t& nat //////////////////////////////////////////////////////////////////////////////// // -void MediaPluginCEF::keyEvent(LLCEFLib::EKeyEvent key_event, int key, LLCEFLib::EKeyboardModifier modifiers_x, LLSD native_key_data = LLSD::emptyMap()) +void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, int key, dullahan::EKeyboardModifier modifiers_x, LLSD native_key_data = LLSD::emptyMap()) { #if LL_DARWIN @@ -852,7 +857,7 @@ void MediaPluginCEF::keyEvent(LLCEFLib::EKeyEvent key_event, int key, LLCEFLib:: char eventUChars = static_cast(native_key_data["event_umodchars"].isUndefined() ? 0 : native_key_data["event_umodchars"].asInteger()); bool eventIsRepeat = native_key_data["event_isrepeat"].asBoolean(); - mLLCEFLib->keyboardEventOSX(eventType, eventModifiers, (eventChars) ? &eventChars : NULL, + mCEFLib->keyboardEventOSX(eventType, eventModifiers, (eventChars) ? &eventChars : NULL, (eventUChars) ? &eventUChars : NULL, eventIsRepeat, eventKeycode); #elif LL_WINDOWS @@ -860,15 +865,15 @@ void MediaPluginCEF::keyEvent(LLCEFLib::EKeyEvent key_event, int key, LLCEFLib:: U32 wparam = ll_U32_from_sd(native_key_data["w_param"]); U64 lparam = ll_U32_from_sd(native_key_data["l_param"]); - mLLCEFLib->nativeKeyboardEvent(msg, wparam, lparam); + mCEFLib->nativeKeyboardEvent(msg, wparam, lparam); #endif }; -void MediaPluginCEF::unicodeInput(const std::string &utf8str, LLCEFLib::EKeyboardModifier modifiers, LLSD native_key_data = LLSD::emptyMap()) +void MediaPluginCEF::unicodeInput(const std::string &utf8str, dullahan::EKeyboardModifier modifiers, LLSD native_key_data = LLSD::emptyMap()) { #if LL_DARWIN - //mLLCEFLib->keyPress(utf8str[0], true); - //mLLCEFLib->keyboardEvent(LLCEFLib::KE_KEY_DOWN, (uint32_t)(utf8str[0]), 0, LLCEFLib::KM_MODIFIER_NONE, 0, 0, 0); + //mCEFLib->keyPress(utf8str[0], true); + //mCEFLib->keyboardEvent(dullahan::KE_KEY_DOWN, (uint32_t)(utf8str[0]), 0, dullahan::KM_MODIFIER_NONE, 0, 0, 0); if (!native_key_data.has("event_chars") || !native_key_data.has("event_umodchars") || !native_key_data.has("event_keycode") || !native_key_data.has("event_modifiers")) return; @@ -877,13 +882,13 @@ void MediaPluginCEF::unicodeInput(const std::string &utf8str, LLCEFLib::EKeyboar uint32_t keyCode = native_key_data["event_keycode"].asInteger(); uint32_t rawmodifiers = native_key_data["event_modifiers"].asInteger(); - mLLCEFLib->injectUnicodeText(unicodeChar, unmodifiedChar, keyCode, rawmodifiers); + mCEFLib->injectUnicodeText(unicodeChar, unmodifiedChar, keyCode, rawmodifiers); #elif LL_WINDOWS U32 msg = ll_U32_from_sd(native_key_data["msg"]); U32 wparam = ll_U32_from_sd(native_key_data["w_param"]); U64 lparam = ll_U32_from_sd(native_key_data["l_param"]); - mLLCEFLib->nativeKeyboardEvent(msg, wparam, lparam); + mCEFLib->nativeKeyboardEvent(msg, wparam, lparam); #endif }; @@ -891,9 +896,12 @@ void MediaPluginCEF::unicodeInput(const std::string &utf8str, LLCEFLib::EKeyboar // void MediaPluginCEF::checkEditState() { - bool can_cut = mLLCEFLib->editCanCut(); - bool can_copy = mLLCEFLib->editCanCopy(); - bool can_paste = mLLCEFLib->editCanPaste(); + //$1 bool can_cut = mCEFLib->editCanCut(); + //$1 bool can_copy = mCEFLib->editCanCopy(); + //$1 bool can_paste = mCEFLib->editCanPaste(); + bool can_cut = false; + bool can_copy = false; + bool can_paste = false; if ((can_cut != mCanCut) || (can_copy != mCanCopy) || (can_paste != mCanPaste)) { -- cgit v1.2.3 From 2c8299d643156bb39528c3a56cac330c0dcd5df9 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Wed, 22 Feb 2017 19:21:55 -0800 Subject: reenable support for copy/cut/paste to/from a web page --- indra/media_plugins/cef/media_plugin_cef.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index b78af1b348..1637976422 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -507,6 +507,8 @@ void MediaPluginCEF::receiveMessage(const char* message_string) settings.cookie_store_path = mCookiePath; settings.cookies_enabled = mCookiesEnabled; settings.flash_enabled = mPluginsEnabled; + settings.flip_mouse_y = false; + settings.flip_pixels_y = true; settings.frame_rate = 60; settings.initial_height = 1024; settings.initial_width = 1024; @@ -535,7 +537,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) message.setValueU32("internalformat", GL_RGB); message.setValueU32("format", GL_BGRA); message.setValueU32("type", GL_UNSIGNED_BYTE); - message.setValueBoolean("coords_opengl", false); + message.setValueBoolean("coords_opengl", true); sendMessage(message); } else if (message_name == "set_user_data_path") @@ -606,8 +608,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string) S32 x = message_in.getValueS32("x"); S32 y = message_in.getValueS32("y"); - y = mHeight - y; - // only even send left mouse button events to the CEF library // (partially prompted by crash in OS X CEF when sending right button events) // we catch the right click in viewer and display our own context menu anyway @@ -725,15 +725,15 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } if (message_name == "edit_cut") { - //$1 mCEFLib->editCut(); + mCEFLib->editCut(); } if (message_name == "edit_copy") { - //$1 mCEFLib->editCopy(); + mCEFLib->editCopy(); } if (message_name == "edit_paste") { - //$1 mCEFLib->editPaste(); + mCEFLib->editPaste(); } } else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER) @@ -896,12 +896,9 @@ void MediaPluginCEF::unicodeInput(const std::string &utf8str, dullahan::EKeyboar // void MediaPluginCEF::checkEditState() { - //$1 bool can_cut = mCEFLib->editCanCut(); - //$1 bool can_copy = mCEFLib->editCanCopy(); - //$1 bool can_paste = mCEFLib->editCanPaste(); - bool can_cut = false; - bool can_copy = false; - bool can_paste = false; + bool can_cut = mCEFLib->editCanCut(); + bool can_copy = mCEFLib->editCanCopy(); + bool can_paste = mCEFLib->editCanPaste(); if ((can_cut != mCanCut) || (can_copy != mCanCopy) || (can_paste != mCanPaste)) { -- cgit v1.2.3 From f04bfdd70ed6003bd3a333cfd99f91530f18f7ad Mon Sep 17 00:00:00 2001 From: "callum@lindenlab.com" Date: Thu, 23 Feb 2017 10:17:52 -0800 Subject: Update media plugin CEF code to match new Dullahan --- indra/media_plugins/cef/media_plugin_cef.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 1637976422..d0ba8e5b3c 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -68,7 +68,7 @@ private: void onAddressChangeCallback(std::string url); void onNavigateURLCallback(std::string url, std::string target); bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password); - void onCursorChangedCallback(dullahan::ECursorType type, unsigned int handle); + void onCursorChangedCallback(dullahan::ECursorType type); void onFileDownloadCallback(std::string filename); const std::string onFileDialogCallback(); @@ -362,7 +362,7 @@ const std::string MediaPluginCEF::onFileDialogCallback() return mPickedFile; } -void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type, unsigned int handle) +void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) { std::string name = ""; @@ -496,7 +496,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mCEFLib->setOnHTTPAuthCallback(std::bind(&MediaPluginCEF::onHTTPAuthCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); mCEFLib->setOnFileDownloadCallback(std::bind(&MediaPluginCEF::onFileDownloadCallback, this, std::placeholders::_1)); mCEFLib->setOnFileDialogCallback(std::bind(&MediaPluginCEF::onFileDialogCallback, this)); - mCEFLib->setOnCursorChangedCallback(std::bind(&MediaPluginCEF::onCursorChangedCallback, this, std::placeholders::_1, std::placeholders::_2)); + mCEFLib->setOnCursorChangedCallback(std::bind(&MediaPluginCEF::onCursorChangedCallback, this, std::placeholders::_1)); mCEFLib->setOnRequestExitCallback(std::bind(&MediaPluginCEF::onRequestExitCallback, this)); dullahan::dullahan_settings settings; -- cgit v1.2.3 From bff83a7f415635cf575520bc747e5da7a5b1ef0f Mon Sep 17 00:00:00 2001 From: "callum@lindenlab.com" Date: Thu, 23 Feb 2017 10:26:46 -0800 Subject: Whoopps. Apologies for leaving Windows debug spam in code :( --- indra/media_plugins/cef/media_plugin_cef.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index d0ba8e5b3c..0116b18a99 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -167,9 +167,6 @@ void MediaPluginCEF::postDebugMessage(const std::string& msg) // void MediaPluginCEF::onPageChangedCallback(const unsigned char* pixels, int x, int y, const int width, const int height, bool is_popup) { - - OutputDebugStringA("@"); - if( is_popup ) { delete mPopupBuffer; -- cgit v1.2.3 From 08940da90ee944dd838b1db65658c39bb0aa80d4 Mon Sep 17 00:00:00 2001 From: "callum@lindenlab.com" Date: Fri, 24 Feb 2017 15:44:36 -0800 Subject: First round of changes to make the macOS 64 build work --- indra/media_plugins/cef/CMakeLists.txt | 3 ++ indra/media_plugins/cef/media_plugin_cef.cpp | 49 ++++++++++++++-------------- 2 files changed, 27 insertions(+), 25 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 1c41fadcaf..bc924eabf0 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -93,6 +93,9 @@ if (DARWIN) LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) + ## turns on C++11 using Cmake + target_compile_features(media_plugin_cef PRIVATE cxx_range_for) + add_custom_command(TARGET media_plugin_cef POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "@executable_path/Chromium Embedded Framework" "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 0116b18a99..99958e0d81 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -41,7 +41,6 @@ #include "dullahan.h" //#include "volume_catcher.h" - //////////////////////////////////////////////////////////////////////////////// // class MediaPluginCEF : @@ -839,23 +838,23 @@ void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, int key, dullahan:: { #if LL_DARWIN - if (!native_key_data.has("event_type") || - !native_key_data.has("event_modifiers") || - !native_key_data.has("event_keycode") || - !native_key_data.has("event_isrepeat")) - return; + // if (!native_key_data.has("event_type") || + // !native_key_data.has("event_modifiers") || + // !native_key_data.has("event_keycode") || + // !native_key_data.has("event_isrepeat")) + // return; - uint32_t eventType = native_key_data["event_type"].asInteger(); - if (!eventType) - return; - uint32_t eventModifiers = native_key_data["event_modifiers"].asInteger(); - uint32_t eventKeycode = native_key_data["event_keycode"].asInteger(); - char eventChars = static_cast(native_key_data["event_chars"].isUndefined() ? 0 : native_key_data["event_chars"].asInteger()); - char eventUChars = static_cast(native_key_data["event_umodchars"].isUndefined() ? 0 : native_key_data["event_umodchars"].asInteger()); - bool eventIsRepeat = native_key_data["event_isrepeat"].asBoolean(); + // uint32_t eventType = native_key_data["event_type"].asInteger(); + // if (!eventType) + // return; + // uint32_t eventModifiers = native_key_data["event_modifiers"].asInteger(); + // uint32_t eventKeycode = native_key_data["event_keycode"].asInteger(); + // char eventChars = static_cast(native_key_data["event_chars"].isUndefined() ? 0 : native_key_data["event_chars"].asInteger()); + // char eventUChars = static_cast(native_key_data["event_umodchars"].isUndefined() ? 0 : native_key_data["event_umodchars"].asInteger()); + // bool eventIsRepeat = native_key_data["event_isrepeat"].asBoolean(); - mCEFLib->keyboardEventOSX(eventType, eventModifiers, (eventChars) ? &eventChars : NULL, - (eventUChars) ? &eventUChars : NULL, eventIsRepeat, eventKeycode); + // mCEFLib->keyboardEventOSX(eventType, eventModifiers, (eventChars) ? &eventChars : NULL, + // (eventUChars) ? &eventUChars : NULL, eventIsRepeat, eventKeycode); #elif LL_WINDOWS U32 msg = ll_U32_from_sd(native_key_data["msg"]); @@ -871,15 +870,15 @@ void MediaPluginCEF::unicodeInput(const std::string &utf8str, dullahan::EKeyboar #if LL_DARWIN //mCEFLib->keyPress(utf8str[0], true); //mCEFLib->keyboardEvent(dullahan::KE_KEY_DOWN, (uint32_t)(utf8str[0]), 0, dullahan::KM_MODIFIER_NONE, 0, 0, 0); - if (!native_key_data.has("event_chars") || !native_key_data.has("event_umodchars") || - !native_key_data.has("event_keycode") || !native_key_data.has("event_modifiers")) - return; - uint32_t unicodeChar = native_key_data["event_chars"].asInteger(); - uint32_t unmodifiedChar = native_key_data["event_umodchars"].asInteger(); - uint32_t keyCode = native_key_data["event_keycode"].asInteger(); - uint32_t rawmodifiers = native_key_data["event_modifiers"].asInteger(); - - mCEFLib->injectUnicodeText(unicodeChar, unmodifiedChar, keyCode, rawmodifiers); + // if (!native_key_data.has("event_chars") || !native_key_data.has("event_umodchars") || + // !native_key_data.has("event_keycode") || !native_key_data.has("event_modifiers")) + // return; + // uint32_t unicodeChar = native_key_data["event_chars"].asInteger(); + // uint32_t unmodifiedChar = native_key_data["event_umodchars"].asInteger(); + // uint32_t keyCode = native_key_data["event_keycode"].asInteger(); + // uint32_t rawmodifiers = native_key_data["event_modifiers"].asInteger(); + + // CP removed to build mCEFLib->injectUnicodeText(unicodeChar, unmodifiedChar, keyCode, rawmodifiers); #elif LL_WINDOWS U32 msg = ll_U32_from_sd(native_key_data["msg"]); -- cgit v1.2.3 From f49033efcfec6ee0df69c346c8d6e04345d5c87c Mon Sep 17 00:00:00 2001 From: "callum@lindenlab.com" Date: Wed, 1 Mar 2017 16:43:15 -0800 Subject: Fix up slight change to Dullahan interface where we call out the platform for native keyboard injection to match OSX version --- indra/media_plugins/cef/media_plugin_cef.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 99958e0d81..33a5f32089 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -861,7 +861,7 @@ void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, int key, dullahan:: U32 wparam = ll_U32_from_sd(native_key_data["w_param"]); U64 lparam = ll_U32_from_sd(native_key_data["l_param"]); - mCEFLib->nativeKeyboardEvent(msg, wparam, lparam); + mCEFLib->nativeKeyboardEventWin(msg, wparam, lparam); #endif }; @@ -884,7 +884,7 @@ void MediaPluginCEF::unicodeInput(const std::string &utf8str, dullahan::EKeyboar U32 msg = ll_U32_from_sd(native_key_data["msg"]); U32 wparam = ll_U32_from_sd(native_key_data["w_param"]); U64 lparam = ll_U32_from_sd(native_key_data["l_param"]); - mCEFLib->nativeKeyboardEvent(msg, wparam, lparam); + mCEFLib->nativeKeyboardEventWin(msg, wparam, lparam); #endif }; -- cgit v1.2.3 From 398c351371b7f1bacea3b898729a4723acc6f417 Mon Sep 17 00:00:00 2001 From: "callum@lindenlab.com" Date: Fri, 3 Mar 2017 15:32:47 -0800 Subject: First pass at osx/macos keyboard events - simple case like google homepage is working --- indra/media_plugins/cef/media_plugin_cef.cpp | 122 +++++---------------------- 1 file changed, 21 insertions(+), 101 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 33a5f32089..a511c32c73 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -29,6 +29,9 @@ #include "linden_common.h" #include "indra_constants.h" // for indra keyboard codes +#include +#include + #include "llgl.h" #include "llsdutil.h" #include "llplugininstance.h" @@ -39,7 +42,6 @@ #include #include "dullahan.h" -//#include "volume_catcher.h" //////////////////////////////////////////////////////////////////////////////// // @@ -74,10 +76,8 @@ private: void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); - dullahan::EKeyboardModifier decodeModifiers(std::string &modifiers); - void deserializeKeyboardData(LLSD native_key_data, uint32_t& native_scan_code, uint32_t& native_virtual_key, uint32_t& native_modifiers); - void keyEvent(dullahan::EKeyEvent key_event, int key, dullahan::EKeyboardModifier modifiers, LLSD native_key_data); - void unicodeInput(const std::string &utf8str, dullahan::EKeyboardModifier modifiers, LLSD native_key_data); + void keyEvent(dullahan::EKeyEvent key_event, LLSD native_key_data); + void unicodeInput(LLSD native_key_data); void checkEditState(); void setVolume(F32 vol); @@ -647,33 +647,15 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_name == "text_event") { - std::string text = message_in.getValue("text"); - std::string modifiers = message_in.getValue("modifiers"); LLSD native_key_data = message_in.getValueLLSD("native_key_data"); - - unicodeInput(text, decodeModifiers(modifiers), native_key_data); + unicodeInput(native_key_data); } else if (message_name == "key_event") { #if LL_DARWIN std::string event = message_in.getValue("event"); - S32 key = message_in.getValueS32("key"); LLSD native_key_data = message_in.getValueLLSD("native_key_data"); -#if 0 - if (event == "down") - { - //mCEFLib->keyPress(key, true); - mCEFLib->keyboardEvent(dullahan::KE_KEY_DOWN, (uint32_t)key, 0, dullahan::KM_MODIFIER_NONE, 0, 0, 0); - - } - else if (event == "up") - { - //mCEFLib->keyPress(key, false); - mCEFLib->keyboardEvent(dullahan::KE_KEY_UP, (uint32_t)key, 0, dullahan::KM_MODIFIER_NONE, 0, 0, 0); - } -#else - // Treat unknown events as key-up for safety. dullahan::EKeyEvent key_event = dullahan::KE_KEY_UP; if (event == "down") { @@ -684,9 +666,8 @@ void MediaPluginCEF::receiveMessage(const char* message_string) key_event = dullahan::KE_KEY_REPEAT; } - keyEvent(key_event, key, dullahan::KM_MODIFIER_NONE, native_key_data); + keyEvent(key_event, native_key_data); -#endif #elif LL_WINDOWS std::string event = message_in.getValue("event"); S32 key = message_in.getValueS32("key"); @@ -704,7 +685,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) key_event = dullahan::KE_KEY_REPEAT; } - keyEvent(key_event, key, decodeModifiers(modifiers), native_key_data); + keyEvent(key_event, native_key_data); #endif } else if (message_name == "enable_media_plugin_debugging") @@ -791,71 +772,20 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } } -dullahan::EKeyboardModifier MediaPluginCEF::decodeModifiers(std::string &modifiers) -{ - int result = 0; - - if (modifiers.find("shift") != std::string::npos) - result |= dullahan::KM_MODIFIER_SHIFT; - - if (modifiers.find("alt") != std::string::npos) - result |= dullahan::KM_MODIFIER_ALT; - - if (modifiers.find("control") != std::string::npos) - result |= dullahan::KM_MODIFIER_CONTROL; - - if (modifiers.find("meta") != std::string::npos) - result |= dullahan::KM_MODIFIER_META; - - return (dullahan::EKeyboardModifier)result; -} - //////////////////////////////////////////////////////////////////////////////// // -void MediaPluginCEF::deserializeKeyboardData(LLSD native_key_data, uint32_t& native_scan_code, uint32_t& native_virtual_key, uint32_t& native_modifiers) +void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, LLSD native_key_data = LLSD::emptyMap()) { - native_scan_code = 0; - native_virtual_key = 0; - native_modifiers = 0; - - if (native_key_data.isMap()) - { #if LL_DARWIN - native_scan_code = (uint32_t)(native_key_data["char_code"].asInteger()); - native_virtual_key = (uint32_t)(native_key_data["key_code"].asInteger()); - native_modifiers = (uint32_t)(native_key_data["modifiers"].asInteger()); -#elif LL_WINDOWS - native_scan_code = (uint32_t)(native_key_data["scan_code"].asInteger()); - native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger()); - // TODO: I don't think we need to do anything with native modifiers here -- please verify -#endif - }; -}; - -//////////////////////////////////////////////////////////////////////////////// -// -void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, int key, dullahan::EKeyboardModifier modifiers_x, LLSD native_key_data = LLSD::emptyMap()) -{ -#if LL_DARWIN - - // if (!native_key_data.has("event_type") || - // !native_key_data.has("event_modifiers") || - // !native_key_data.has("event_keycode") || - // !native_key_data.has("event_isrepeat")) - // return; - - // uint32_t eventType = native_key_data["event_type"].asInteger(); - // if (!eventType) - // return; - // uint32_t eventModifiers = native_key_data["event_modifiers"].asInteger(); - // uint32_t eventKeycode = native_key_data["event_keycode"].asInteger(); - // char eventChars = static_cast(native_key_data["event_chars"].isUndefined() ? 0 : native_key_data["event_chars"].asInteger()); - // char eventUChars = static_cast(native_key_data["event_umodchars"].isUndefined() ? 0 : native_key_data["event_umodchars"].asInteger()); - // bool eventIsRepeat = native_key_data["event_isrepeat"].asBoolean(); - - // mCEFLib->keyboardEventOSX(eventType, eventModifiers, (eventChars) ? &eventChars : NULL, - // (eventUChars) ? &eventUChars : NULL, eventIsRepeat, eventKeycode); - + U32 event_modifiers = native_key_data["event_modifiers"].asInteger(); + U32 event_keycode = native_key_data["event_keycode"].asInteger(); + U32 event_chars = native_key_data["event_chars"].asInteger(); + U32 event_umodchars = native_key_data["event_umodchars"].asInteger(); + bool event_isrepeat = native_key_data["event_isrepeat"].asBoolean(); + + mCEFLib->nativeKeyboardEventOSX(key_event, event_modifiers, + event_keycode, event_chars, + event_umodchars, event_isrepeat); #elif LL_WINDOWS U32 msg = ll_U32_from_sd(native_key_data["msg"]); U32 wparam = ll_U32_from_sd(native_key_data["w_param"]); @@ -865,21 +795,11 @@ void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, int key, dullahan:: #endif }; -void MediaPluginCEF::unicodeInput(const std::string &utf8str, dullahan::EKeyboardModifier modifiers, LLSD native_key_data = LLSD::emptyMap()) +void MediaPluginCEF::unicodeInput(LLSD native_key_data = LLSD::emptyMap()) { #if LL_DARWIN - //mCEFLib->keyPress(utf8str[0], true); - //mCEFLib->keyboardEvent(dullahan::KE_KEY_DOWN, (uint32_t)(utf8str[0]), 0, dullahan::KM_MODIFIER_NONE, 0, 0, 0); - // if (!native_key_data.has("event_chars") || !native_key_data.has("event_umodchars") || - // !native_key_data.has("event_keycode") || !native_key_data.has("event_modifiers")) - // return; - // uint32_t unicodeChar = native_key_data["event_chars"].asInteger(); - // uint32_t unmodifiedChar = native_key_data["event_umodchars"].asInteger(); - // uint32_t keyCode = native_key_data["event_keycode"].asInteger(); - // uint32_t rawmodifiers = native_key_data["event_modifiers"].asInteger(); - - // CP removed to build mCEFLib->injectUnicodeText(unicodeChar, unmodifiedChar, keyCode, rawmodifiers); - + // code to send keys here doesn't seem to be required for Darwin - in fact, + // not having reliable key event type info here means we don't know what to send anyway #elif LL_WINDOWS U32 msg = ll_U32_from_sd(native_key_data["msg"]); U32 wparam = ll_U32_from_sd(native_key_data["w_param"]); -- cgit v1.2.3 From 7d1942a2b6de129590a5c0e7c371c30461eb8859 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Fri, 3 Mar 2017 17:45:09 -0800 Subject: Remove OSX headers added for testing purposes and also some unused vars --- indra/media_plugins/cef/media_plugin_cef.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index a511c32c73..90bdeb082c 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -29,9 +29,6 @@ #include "linden_common.h" #include "indra_constants.h" // for indra keyboard codes -#include -#include - #include "llgl.h" #include "llsdutil.h" #include "llplugininstance.h" @@ -670,8 +667,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string) #elif LL_WINDOWS std::string event = message_in.getValue("event"); - S32 key = message_in.getValueS32("key"); - std::string modifiers = message_in.getValue("modifiers"); LLSD native_key_data = message_in.getValueLLSD("native_key_data"); // Treat unknown events as key-up for safety. -- cgit v1.2.3 From 884a59a2fbc71f68b1bc28b42ebfefdb22187cb5 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 9 Mar 2017 14:08:09 -0800 Subject: Second part of fix for SL-646 Fix 'LINK : warning LNK4075: ignoring /INCREMENTAL due to '/LTCG' specification' in LibVLC, JPEGLIB etc. --- indra/media_plugins/cef/CMakeLists.txt | 2 +- indra/media_plugins/libvlc/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index bc924eabf0..201fb44847 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -77,7 +77,7 @@ if (WINDOWS) set_target_properties( media_plugin_cef PROPERTIES - LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT /IGNORE:4099" + LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099" LINK_FLAGS_DEBUG "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMTD /IGNORE:4099" ) endif (WINDOWS) diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index 72159f9f69..d3e9243069 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -78,7 +78,7 @@ if (WINDOWS) set_target_properties( media_plugin_libvlc PROPERTIES - LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT" + LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT" ) endif (WINDOWS) -- cgit v1.2.3