Merge remote-tracking branch 'siana/master' into curlthreading2

Conflicts:
	indra/llcommon/llstring.cpp
	indra/llmessage/llcurl.cpp
	indra/newview/llviewertexturelist.cpp
	indra/newview/viewer_manifest.py
	install.xml

Resolved:
	indra/llcommon/llstring.cpp :
		two different ways to work around compile error.
	indra/llmessage/llcurl.cpp :
		this file is no longer used.. I deleted huge
		parts to mark that I implemented that. Siana
		apparently made a few changes in those parts.
	indra/newview/llviewertexturelist.cpp :
		manually copied patch. Mine also removed trailing
		spaces, keeping that.
	indra/newview/viewer_manifest.py:
		Collision with changes from Liru, which have been
		ignored (kept siana/master).
	install.xml:
		Collision with an earlier screw up. I kept the
		fix from siana/master.
This commit is contained in:
Aleric Inglewood
2012-07-18 02:08:31 +02:00
608 changed files with 27136 additions and 35727 deletions

View File

@@ -446,10 +446,10 @@ void MediaPluginExample::update( F64 milliseconds )
};
if ( mXpos[ n ] + mXInc[ n ] < 0 || mXpos[ n ] + mXInc[ n ] >= mWidth - mBlockSize[ n ] )
mXInc[ n ] =- mXInc[ n ];
mXInc[ n ] = - mXInc[ n ];
if ( mYpos[ n ] + mYInc[ n ] < 0 || mYpos[ n ] + mYInc[ n ] >= mHeight - mBlockSize[ n ] )
mYInc[ n ] =- mYInc[ n ];
mYInc[ n ] = - mYInc[ n ];
mXpos[ n ] += mXInc[ n ];
mYpos[ n ] += mYInc[ n ];

206
indra/plugins/webkit/media_plugin_webkit.cpp Executable file → Normal file
View File

@@ -25,13 +25,11 @@
* $/LicenseInfo$
* @endcond
*/
#include "linden_common.h"
#include "llqtwebkit.h"
#include "indra_constants.h" // for indra keyboard codes
#include "lltimer.h"
#include "llgl.h"
#include "llplugininstance.h"
@@ -92,6 +90,7 @@ private:
bool mCookiesEnabled;
bool mJavascriptEnabled;
bool mPluginsEnabled;
bool mEnableMediaPluginDebugging;
enum
{
@@ -118,9 +117,24 @@ 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", str.str());
debug_message.setValue("message_level", "info");
sendMessage(debug_message);
}
}
void setInitState(int state)
{
// std::cerr << "changing init state to " << state << std::endl;
@@ -230,7 +244,7 @@ private:
#endif
#if LL_WINDOWS
// *NOTE:Mani - On windows, at least, the component path is the
//*NOTE:Mani - On windows, at least, the component path is the
// location of this dll's image file.
std::string component_dir;
char dll_path[_MAX_PATH];
@@ -254,6 +268,9 @@ private:
std::string component_dir = application_dir;
#endif
// debug spam sent to viewer and displayed in the log as usual
postDebugMessage( "Component dir set to: " + component_dir );
// window handle - needed on Windows and must be app window.
#if LL_WINDOWS
char window_title[ MAX_PATH ];
@@ -268,10 +285,16 @@ private:
if ( result )
{
mInitState = INIT_STATE_INITIALIZED;
// debug spam sent to viewer and displayed in the log as usual
postDebugMessage( "browser initialized okay" );
return true;
};
// debug spam sent to viewer and displayed in the log as usual
postDebugMessage( "browser nOT initialized." );
return false;
};
@@ -294,19 +317,33 @@ private:
if(!mHostLanguage.empty())
{
LLQtWebKit::getInstance()->setHostLanguage(mHostLanguage);
postDebugMessage( "Setting language to " + mHostLanguage );
}
// turn on/off cookies based on what host app tells us
LLQtWebKit::getInstance()->enableCookies( mCookiesEnabled );
// turn on/off plugins based on what host app tells us
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;
postDebugMessage( str.str() );
// create single browser window
mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow(mWidth, mHeight, mTarget);
mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight, mTarget);
str.str("");
str.clear();
str << "Setting browser window size to " << mWidth << " x " << mHeight;
postDebugMessage( str.str() );
// tell LLQtWebKit about the size of the browser window
LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight );
@@ -316,6 +353,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
@@ -343,8 +381,18 @@ private:
url << std::setfill('0') << std::setw(2) << std::hex << int(mBackgroundB * 255.0f);
url << "%22%3E%3C/body%3E%3C/html%3E";
lldebugs << "data url is: " << url.str() << llendl;
//lldebugs << "data url is: " << url.str() << llendl;
// always display loading overlay now
#if LLQTWEBKIT_API_VERSION >= 16
LLQtWebKit::getInstance()->enableLoadingOverlay(mBrowserWindowId, true);
#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() );
LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, url.str() );
// LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" );
@@ -411,9 +459,11 @@ private:
message.setValue("uri", event.getEventUri());
message.setValueBoolean("history_back_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK));
message.setValueBoolean("history_forward_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD));
sendMessage(message);
// debug spam sent to viewer and displayed in the log as usual
postDebugMessage( "Navigate begin event at: " + event.getEventUri() );
setStatus(STATUS_LOADING);
}
@@ -455,6 +505,8 @@ private:
setInitState(INIT_STATE_NAVIGATE_COMPLETE);
}
// debug spam sent to viewer and displayed in the log as usual
postDebugMessage( "Navigate complete event at: " + event.getEventUri() );
}
////////////////////////////////////////////////////////////////////////////////
@@ -492,7 +544,7 @@ private:
sendMessage(message);
}
}
////////////////////////////////////////////////////////////////////////////////
// virtual
void onNavigateErrorPage(const EventType& event)
@@ -501,7 +553,7 @@ private:
message.setValueS32("status_code", event.getIntValue());
sendMessage(message);
}
////////////////////////////////////////////////////////////////////////////////
// virtual
void onLocationChange(const EventType& event)
@@ -538,6 +590,7 @@ private:
#endif
sendMessage(message);
}
////////////////////////////////////////////////////////////////////////////////
// virtual
@@ -548,10 +601,14 @@ 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);
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// virtual
void onWindowCloseRequested(const EventType& event)
{
@@ -579,7 +636,7 @@ private:
sendMessage(message);
}
}
std::string mAuthUsername;
std::string mAuthPassword;
bool mAuthOK;
@@ -630,7 +687,7 @@ private:
sendMessage(message);
}
}
LLQtWebKit::EKeyboardModifier decodeModifiers(std::string &modifiers)
{
int result = 0;
@@ -799,7 +856,10 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction send_
mHostLanguage = "en"; // default to english
mJavascriptEnabled = true; // default to on
mPluginsEnabled = true; // default to on
mEnableMediaPluginDebugging = false;
mUserAgent = "LLPluginMedia Web Browser";
mElapsedTime.reset();
}
MediaPluginWebKit::~MediaPluginWebKit()
@@ -826,8 +886,6 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
{
if(message_name == "init")
{
mTarget = message_in.getValue("target");
LLPluginMessage message("base", "init_response");
LLSD versions = LLSD::emptyMap();
versions[LLPLUGIN_MESSAGE_CLASS_BASE] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION;
@@ -907,7 +965,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
{
if(message_name == "set_volume")
{
F32 volume = message_in.getValueReal("volume");
F32 volume = (F32)message_in.getValueReal("volume");
setVolume(volume);
}
}
@@ -915,6 +973,8 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
{
if(message_name == "init")
{
mTarget = message_in.getValue("target");
// This is the media init message -- all necessary data for initialization should have been received.
if(initBrowser())
{
@@ -971,9 +1031,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
S32 height = message_in.getValueS32("height");
S32 texture_width = message_in.getValueS32("texture_width");
S32 texture_height = message_in.getValueS32("texture_height");
mBackgroundR = message_in.getValueReal("background_r");
mBackgroundG = message_in.getValueReal("background_g");
mBackgroundB = message_in.getValueReal("background_b");
mBackgroundR = (F32)message_in.getValueReal("background_r");
mBackgroundG = (F32)message_in.getValueReal("background_g");
mBackgroundB = (F32)message_in.getValueReal("background_b");
// mBackgroundA = message_in.setValueReal("background_a"); // Ignore any alpha
if(!name.empty())
@@ -1137,7 +1197,78 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
if(message_name == "auth_response")
{
authResponse(message_in);
}
}
else
if(message_name == "enable_media_plugin_debugging")
{
mEnableMediaPluginDebugging = message_in.getValueBoolean( "enable" );
}
else
if(message_name == "js_enable_object")
{
#if LLQTWEBKIT_API_VERSION >= 9
bool enable = message_in.getValueBoolean( "enable" );
LLQtWebKit::getInstance()->setSLObjectEnabled( enable );
#endif
}
else
if(message_name == "js_agent_location")
{
#if LLQTWEBKIT_API_VERSION >= 9
F32 x = (F32)message_in.getValueReal("x");
F32 y = (F32)message_in.getValueReal("y");
F32 z = (F32)message_in.getValueReal("z");
LLQtWebKit::getInstance()->setAgentLocation( x, y, z );
LLQtWebKit::getInstance()->emitLocation();
#endif
}
else
if(message_name == "js_agent_global_location")
{
#if LLQTWEBKIT_API_VERSION >= 9
F32 x = (F32)message_in.getValueReal("x");
F32 y = (F32)message_in.getValueReal("y");
F32 z = (F32)message_in.getValueReal("z");
LLQtWebKit::getInstance()->setAgentGlobalLocation( x, y, z );
LLQtWebKit::getInstance()->emitLocation();
#endif
}
else
if(message_name == "js_agent_orientation")
{
#if LLQTWEBKIT_API_VERSION >= 9
F32 angle = (F32)message_in.getValueReal("angle");
LLQtWebKit::getInstance()->setAgentOrientation( angle );
LLQtWebKit::getInstance()->emitLocation();
#endif
}
else
if(message_name == "js_agent_region")
{
#if LLQTWEBKIT_API_VERSION >= 9
const std::string& region = message_in.getValue("region");
LLQtWebKit::getInstance()->setAgentRegion( region );
LLQtWebKit::getInstance()->emitLocation();
#endif
}
else
if(message_name == "js_agent_maturity")
{
#if LLQTWEBKIT_API_VERSION >= 9
const std::string& maturity = message_in.getValue("maturity");
LLQtWebKit::getInstance()->setAgentMaturity( maturity );
LLQtWebKit::getInstance()->emitMaturity();
#endif
}
else
if(message_name == "js_agent_language")
{
#if LLQTWEBKIT_API_VERSION >= 9
const std::string& language = message_in.getValue("language");
LLQtWebKit::getInstance()->setAgentLanguage( language );
LLQtWebKit::getInstance()->emitLanguage();
#endif
}
else
{
// std::cerr << "MediaPluginWebKit::receiveMessage: unknown media message: " << message_string << std::endl;
@@ -1159,6 +1290,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 = (F32)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();
@@ -1185,6 +1325,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")
{
@@ -1226,6 +1369,15 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
mUserAgent = message_in.getValue("user_agent");
LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent );
}
else if(message_name == "show_web_inspector")
{
#if LLQTWEBKIT_API_VERSION >= 10
bool val = message_in.getValueBoolean("show");
LLQtWebKit::getInstance()->showWebInspector( val );
#else
llwarns << "Ignoring showWebInspector message (llqtwebkit version is too old)." << llendl;
#endif
}
else if(message_name == "ignore_ssl_cert_errors")
{
#if LLQTWEBKIT_API_VERSION >= 3
@@ -1237,7 +1389,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
else if(message_name == "add_certificate_file_path")
{
#if LLQTWEBKIT_API_VERSION >= 6
LLQtWebKit::getInstance()->addCAFile( message_in.getValue("path") );
LLQtWebKit::getInstance()->setCAFile( message_in.getValue("path") );
#else
llwarns << "Ignoring add_certificate_file_path message (llqtwebkit version is too old)." << llendl;
#endif