From 343562889e2b9332942f1c190e0dd6b7ddcb9540 Mon Sep 17 00:00:00 2001 From: callum Date: Tue, 25 Oct 2011 19:34:05 -0700 Subject: EXP-1471 WIP Add support for zooming web pages by a scale facxtor --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 0f74772e42..d35d202e99 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -323,7 +323,7 @@ private: LLQtWebKit::getInstance()->enablePlugins( mPluginsEnabled ); // turn on/off Javascript based on what host app tells us - LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled ); + LLQtWebKit::getInstance()->enableJavaScript( mJavascriptEnabled ); std::stringstream str; str << "Cookies enabled = " << mCookiesEnabled << ", plugins enabled = " << mPluginsEnabled << ", Javascript enabled = " << mJavascriptEnabled; @@ -346,7 +346,7 @@ private: // append details to agent string LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent ); postDebugMessage( "Updating user agent with " + mUserAgent ); - + #if !LL_QTWEBKIT_USES_PIXMAPS // don't flip bitmap LLQtWebKit::getInstance()->flipWindow( mBrowserWindowId, true ); @@ -1298,6 +1298,15 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) mFirstFocus = false; } } + else if(message_name == "set_page_zoom_factor") + { +#if LLQTWEBKIT_API_VERSION >= 15 + F32 factor = message_in.getValueReal("factor"); + LLQtWebKit::getInstance()->setPageZoomFactor(factor); +#else + llwarns << "Ignoring setPageZoomFactor message (llqtwebkit version is too old)." << llendl; +#endif + } else if(message_name == "clear_cache") { LLQtWebKit::getInstance()->clearCache(); -- cgit v1.2.3 From 9399b66dc4e59bdbf2a3f551def06f4562ac9957 Mon Sep 17 00:00:00 2001 From: callum Date: Mon, 31 Oct 2011 11:33:41 -0700 Subject: Tie debugging/loading overlay to media debugging flag --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index d35d202e99..5098f3cea5 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -323,7 +323,11 @@ private: LLQtWebKit::getInstance()->enablePlugins( mPluginsEnabled ); // turn on/off Javascript based on what host app tells us +#if LLQTWEBKIT_API_VERSION >= 11 LLQtWebKit::getInstance()->enableJavaScript( mJavascriptEnabled ); +#else + LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled ); +#endif std::stringstream str; str << "Cookies enabled = " << mCookiesEnabled << ", plugins enabled = " << mPluginsEnabled << ", Javascript enabled = " << mJavascriptEnabled; @@ -374,7 +378,14 @@ private: url << "%22%3E%3C/body%3E%3C/html%3E"; //lldebugs << "data url is: " << url.str() << llendl; - + + // loading overlay debug screen follows media debugging flag from client for now. + LLQtWebKit::getInstance()->enableLoadingOverlay(mBrowserWindowId, mEnableMediaPluginDebugging); + + str.clear(); + str << "Loading overlay enabled = " << mEnableMediaPluginDebugging << " for mBrowserWindowId = " << mBrowserWindowId; + postDebugMessage( str.str() ); + LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, url.str() ); // LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" ); @@ -1210,7 +1221,6 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) { mEnableMediaPluginDebugging = message_in.getValueBoolean( "enable" ); } - else if(message_name == "js_enable_object") { -- cgit v1.2.3 From 2777ddd0607caeeee16deae79ca8284bdaccd261 Mon Sep 17 00:00:00 2001 From: callum Date: Mon, 31 Oct 2011 15:35:04 -0700 Subject: Added more logging and elapsed time counter to log message. --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 5098f3cea5..c7c66e5895 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -25,12 +25,11 @@ * $/LicenseInfo$ * @endcond */ - #include "llqtwebkit.h" - #include "linden_common.h" #include "indra_constants.h" // for indra keyboard codes +#include "lltimer.h" #include "llgl.h" #include "llplugininstance.h" @@ -117,15 +116,19 @@ private: F32 mBackgroundG; F32 mBackgroundB; std::string mTarget; - + LLTimer mElapsedTime; + VolumeCatcher mVolumeCatcher; void postDebugMessage( const std::string& msg ) { if ( mEnableMediaPluginDebugging ) { + std::stringstream str; + str << "@Media Msg> " << "[" << (double)mElapsedTime.getElapsedTimeF32() << "] -- " << msg; + LLPluginMessage debug_message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "debug_message"); - debug_message.setValue("message_text", "Media> " + msg); + debug_message.setValue("message_text", str.str()); debug_message.setValue("message_level", "info"); sendMessage(debug_message); } @@ -594,6 +597,10 @@ private: // These could be passed through as well, but aren't really needed. // message.setValue("uri", event.getEventUri()); // message.setValueBoolean("dead", (event.getIntValue() != 0)) + + // debug spam + postDebugMessage( "Sending cookie_set message from plugin: " + event.getStringValue() ); + sendMessage(message); } @@ -874,6 +881,8 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_ mPluginsEnabled = true; // default to on mEnableMediaPluginDebugging = false; mUserAgent = "LLPluginMedia Web Browser"; + + mElapsedTime.reset(); } MediaPluginWebKit::~MediaPluginWebKit() @@ -1343,6 +1352,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) else if(message_name == "set_cookies") { LLQtWebKit::getInstance()->setCookies(message_in.getValue("cookies")); + + // debug spam + postDebugMessage( "Plugin setting cookie: " + message_in.getValue("cookies") ); } else if(message_name == "proxy_setup") { -- cgit v1.2.3 From 91354304fc8a5dd400aefa8047c2e1fe62d143bd Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 2 Nov 2011 15:05:55 -0700 Subject: Turn off debug loading overlay for older versions of LLQtWebKit thar do not support it (Linux) --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index c7c66e5895..13d51099a8 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -383,8 +383,11 @@ private: //lldebugs << "data url is: " << url.str() << llendl; // loading overlay debug screen follows media debugging flag from client for now. +#if LLQTWEBKIT_API_VERSION >= 16 LLQtWebKit::getInstance()->enableLoadingOverlay(mBrowserWindowId, mEnableMediaPluginDebugging); - +#else + llwarns << "Ignoring enableLoadingOverlay() call (llqtwebkit version is too old)." << llendl; +#endif str.clear(); str << "Loading overlay enabled = " << mEnableMediaPluginDebugging << " for mBrowserWindowId = " << mBrowserWindowId; postDebugMessage( str.str() ); -- cgit v1.2.3 From 2a19aa93e9ec9a6c59a11231694b1f910cf817ea Mon Sep 17 00:00:00 2001 From: callum Date: Thu, 10 Nov 2011 19:00:03 -0800 Subject: Point to improved loading overlay and turn it on always --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 13d51099a8..47f8dcd545 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -382,9 +382,9 @@ private: //lldebugs << "data url is: " << url.str() << llendl; - // loading overlay debug screen follows media debugging flag from client for now. + // always display loading overlay now #if LLQTWEBKIT_API_VERSION >= 16 - LLQtWebKit::getInstance()->enableLoadingOverlay(mBrowserWindowId, mEnableMediaPluginDebugging); + LLQtWebKit::getInstance()->enableLoadingOverlay(mBrowserWindowId, true); #else llwarns << "Ignoring enableLoadingOverlay() call (llqtwebkit version is too old)." << llendl; #endif -- cgit v1.2.3