From e4a9704d4157151442accca1116ad70f7f63ae95 Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 13 May 2011 17:08:43 -0700 Subject: EXP-676 FIX As a web developer, I want to access information about the current state of the SL client, such as avatar location --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 51 +++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'indra/media_plugins/webkit/media_plugin_webkit.cpp') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 9ba8edbb59..b22dbc6604 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -1168,6 +1168,56 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) authResponse(message_in); } else + if(message_name == "js_expose_object") + { + bool expose_object = message_in.getValueBoolean( "expose" ); +#if LLQTWEBKIT_API_VERSION >= 9 + LLQtWebKit::getInstance()->setExposeObject( expose_object ); +#endif + } + else + if(message_name == "js_values_valid") + { + bool valid = message_in.getValueBoolean( "valid" ); +#if LLQTWEBKIT_API_VERSION >= 9 + LLQtWebKit::getInstance()->setValuesValid( valid ); +#endif + } + else + if(message_name == "js_agent_location") + { + F32 x = message_in.getValueReal("x"); + F32 y = message_in.getValueReal("y"); + F32 z = message_in.getValueReal("z"); +#if LLQTWEBKIT_API_VERSION >= 9 + LLQtWebKit::getInstance()->setAgentLocation( x, y, z ); +#endif + } + else + if(message_name == "js_agent_language") + { + const std::string& language = message_in.getValue("language"); +#if LLQTWEBKIT_API_VERSION >= 9 + LLQtWebKit::getInstance()->setAgentLanguage( language ); +#endif + } + else + if(message_name == "js_agent_region") + { + const std::string& region = message_in.getValue("region"); +#if LLQTWEBKIT_API_VERSION >= 9 + LLQtWebKit::getInstance()->setAgentRegion( region ); +#endif + } + else + if(message_name == "js_agent_maturity") + { + const std::string& maturity = message_in.getValue("maturity"); +#if LLQTWEBKIT_API_VERSION >= 9 + LLQtWebKit::getInstance()->setAgentMaturity( maturity ); +#endif + } + else { // std::cerr << "MediaPluginWebKit::receiveMessage: unknown media message: " << message_string << std::endl; } @@ -1324,4 +1374,3 @@ int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void return 0; } - -- cgit v1.2.3 From e5e98a597d6bad6d2ccbe5a5a0bee45f8e66eb0b Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 18 May 2011 09:56:02 -0700 Subject: Reverted Linux LLQtWebKit to older version which triggered warnings here that are treated as errors. --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/media_plugins/webkit/media_plugin_webkit.cpp') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index b22dbc6604..bdfbde8494 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -1170,50 +1170,50 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) else if(message_name == "js_expose_object") { - bool expose_object = message_in.getValueBoolean( "expose" ); #if LLQTWEBKIT_API_VERSION >= 9 + bool expose_object = message_in.getValueBoolean( "expose" ); LLQtWebKit::getInstance()->setExposeObject( expose_object ); #endif } else if(message_name == "js_values_valid") { - bool valid = message_in.getValueBoolean( "valid" ); #if LLQTWEBKIT_API_VERSION >= 9 + bool valid = message_in.getValueBoolean( "valid" ); LLQtWebKit::getInstance()->setValuesValid( valid ); #endif } else if(message_name == "js_agent_location") { +#if LLQTWEBKIT_API_VERSION >= 9 F32 x = message_in.getValueReal("x"); F32 y = message_in.getValueReal("y"); F32 z = message_in.getValueReal("z"); -#if LLQTWEBKIT_API_VERSION >= 9 LLQtWebKit::getInstance()->setAgentLocation( x, y, z ); #endif } else if(message_name == "js_agent_language") { - const std::string& language = message_in.getValue("language"); #if LLQTWEBKIT_API_VERSION >= 9 + const std::string& language = message_in.getValue("language"); LLQtWebKit::getInstance()->setAgentLanguage( language ); #endif } else if(message_name == "js_agent_region") { - const std::string& region = message_in.getValue("region"); #if LLQTWEBKIT_API_VERSION >= 9 + const std::string& region = message_in.getValue("region"); LLQtWebKit::getInstance()->setAgentRegion( region ); #endif } else if(message_name == "js_agent_maturity") { - const std::string& maturity = message_in.getValue("maturity"); #if LLQTWEBKIT_API_VERSION >= 9 + const std::string& maturity = message_in.getValue("maturity"); LLQtWebKit::getInstance()->setAgentMaturity( maturity ); #endif } -- cgit v1.2.3 From e9f8a5441b0d737133a833cd240709962add56a5 Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 25 May 2011 08:10:04 -0700 Subject: Added support for pushing agent global location on grid and agent orientation out to LLQtWebKit --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'indra/media_plugins/webkit/media_plugin_webkit.cpp') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index bdfbde8494..27f3c7260e 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -1194,11 +1194,21 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) #endif } else - if(message_name == "js_agent_language") + if(message_name == "js_agent_global_location") { #if LLQTWEBKIT_API_VERSION >= 9 - const std::string& language = message_in.getValue("language"); - LLQtWebKit::getInstance()->setAgentLanguage( language ); + F32 x = message_in.getValueReal("x"); + F32 y = message_in.getValueReal("y"); + F32 z = message_in.getValueReal("z"); + LLQtWebKit::getInstance()->setAgentGlobalLocation( x, y, z ); +#endif + } + else + if(message_name == "js_agent_orientation") + { +#if LLQTWEBKIT_API_VERSION >= 9 + F32 angle = message_in.getValueReal("angle"); + LLQtWebKit::getInstance()->setAgentOrientation( angle ); #endif } else -- cgit v1.2.3