aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia/llmediaimplllmozlib.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:35 -0500
committerJacek Antonelli2008-08-15 23:45:35 -0500
commit7a29b2d1cd471767b58ea30f53900cd2c5a9637c (patch)
treea2f7b5eb90ec41f903f2558e57d47f5ebd913a8f /linden/indra/llmedia/llmediaimplllmozlib.cpp
parentSecond Life viewer sources 1.19.1.0 (diff)
downloadmeta-impy-7a29b2d1cd471767b58ea30f53900cd2c5a9637c.zip
meta-impy-7a29b2d1cd471767b58ea30f53900cd2c5a9637c.tar.gz
meta-impy-7a29b2d1cd471767b58ea30f53900cd2c5a9637c.tar.bz2
meta-impy-7a29b2d1cd471767b58ea30f53900cd2c5a9637c.tar.xz
Second Life viewer sources 1.19.1.1
Diffstat (limited to 'linden/indra/llmedia/llmediaimplllmozlib.cpp')
-rw-r--r--linden/indra/llmedia/llmediaimplllmozlib.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/linden/indra/llmedia/llmediaimplllmozlib.cpp b/linden/indra/llmedia/llmediaimplllmozlib.cpp
index 06250f7..87d9c77 100644
--- a/linden/indra/llmedia/llmediaimplllmozlib.cpp
+++ b/linden/indra/llmedia/llmediaimplllmozlib.cpp
@@ -47,6 +47,7 @@
47 // Linux, MESA headers, but not necessarily assuming MESA runtime. 47 // Linux, MESA headers, but not necessarily assuming MESA runtime.
48 // quotes so we get libraries/.../GL/ version 48 // quotes so we get libraries/.../GL/ version
49 #include "GL/gl.h" 49 #include "GL/gl.h"
50 #include <locale.h>
50#endif 51#endif
51 52
52#include <iostream> 53#include <iostream>
@@ -84,6 +85,14 @@ LLMediaImplLLMozLib::LLMediaImplLLMozLib() :
84// (static) super-initialization - called once at application startup 85// (static) super-initialization - called once at application startup
85bool LLMediaImplLLMozLib::startup( LLMediaManagerData* init_data ) 86bool LLMediaImplLLMozLib::startup( LLMediaManagerData* init_data )
86{ 87{
88#if LL_LINUX
89 // Yuck, Mozilla's GTK callbacks play with the locale - push/pop
90 // the locale to protect it, as exotic/non-C locales
91 // causes our code lots of general critical weirdness
92 // and crashness. (SL-35450)
93 std::string saved_locale = setlocale(LC_ALL, NULL);
94#endif // LL_LINUX
95
87 bool result = LLMozLib::getInstance()->init( init_data->getBrowserApplicationDir(), 96 bool result = LLMozLib::getInstance()->init( init_data->getBrowserApplicationDir(),
88 init_data->getBrowserComponentDir(), 97 init_data->getBrowserComponentDir(),
89 init_data->getBrowserProfileDir(), 98 init_data->getBrowserProfileDir(),
@@ -92,6 +101,10 @@ bool LLMediaImplLLMozLib::startup( LLMediaManagerData* init_data )
92 // append special string to the embedded browser user agent string 101 // append special string to the embedded browser user agent string
93 LLMozLib::getInstance()->setBrowserAgentId( init_data->getBrowserUserAgentId() ); 102 LLMozLib::getInstance()->setBrowserAgentId( init_data->getBrowserUserAgentId() );
94 103
104#if LL_LINUX
105 setlocale(LC_ALL, saved_locale.c_str() );
106#endif // LL_LINUX
107
95 return result; 108 return result;
96} 109}
97 110
@@ -114,6 +127,10 @@ bool LLMediaImplLLMozLib::init()
114 if ( mWindowId ) 127 if ( mWindowId )
115 return false; 128 return false;
116 129
130#if LL_LINUX
131 std::string saved_locale = setlocale(LC_ALL, NULL);
132#endif // LL_LINUX
133
117 mWindowId = LLMozLib::getInstance()->createBrowserWindow( mBrowserWindowWidth, mBrowserWindowHeight ); 134 mWindowId = LLMozLib::getInstance()->createBrowserWindow( mBrowserWindowWidth, mBrowserWindowHeight );
118 135
119 LLMozLib::getInstance()->setSize( mWindowId, mBrowserWindowWidth, mBrowserWindowHeight ); 136 LLMozLib::getInstance()->setSize( mWindowId, mBrowserWindowWidth, mBrowserWindowHeight );
@@ -132,6 +149,10 @@ bool LLMediaImplLLMozLib::init()
132 // set media depth now we have created a browser window and know what it is 149 // set media depth now we have created a browser window and know what it is
133 setMediaDepth( LLMozLib::getInstance()->getBrowserDepth( mWindowId ) ); 150 setMediaDepth( LLMozLib::getInstance()->getBrowserDepth( mWindowId ) );
134 151
152#if LL_LINUX
153 setlocale(LC_ALL, saved_locale.c_str() );
154#endif // LL_LINUX
155
135 return true; 156 return true;
136} 157}
137 158
@@ -177,9 +198,17 @@ bool LLMediaImplLLMozLib::setCaretColor( unsigned int red, unsigned int green, u
177// virtual 198// virtual
178bool LLMediaImplLLMozLib::navigateTo( const std::string url ) 199bool LLMediaImplLLMozLib::navigateTo( const std::string url )
179{ 200{
201#if LL_LINUX
202 std::string saved_locale = setlocale(LC_ALL, NULL);
203#endif // LL_LINUX
204
180 // pass url to llmozlib 205 // pass url to llmozlib
181 LLMozLib::getInstance()->navigateTo( mWindowId, url ); 206 LLMozLib::getInstance()->navigateTo( mWindowId, url );
182 207
208#if LL_LINUX
209 setlocale(LC_ALL, saved_locale.c_str() );
210#endif // LL_LINUX
211
183 // emit event with size change to kick things off 212 // emit event with size change to kick things off
184 LLMediaEvent event( this ); 213 LLMediaEvent event( this );
185 mEventEmitter.update( &LLMediaObserver::onMediaSizeChange, event ); 214 mEventEmitter.update( &LLMediaObserver::onMediaSizeChange, event );
@@ -235,6 +264,10 @@ bool LLMediaImplLLMozLib::updateState()
235 clearCommand(); 264 clearCommand();
236 }; 265 };
237 266
267#if LL_LINUX
268 std::string saved_locale = setlocale(LC_ALL, NULL);
269#endif // LL_LINUX
270
238 if ( nextCommand() == LLMediaBase::COMMAND_BACK ) 271 if ( nextCommand() == LLMediaBase::COMMAND_BACK )
239 { 272 {
240 setStatus( LLMediaBase::STATUS_STARTED ); 273 setStatus( LLMediaBase::STATUS_STARTED );
@@ -249,6 +282,10 @@ bool LLMediaImplLLMozLib::updateState()
249 clearCommand(); 282 clearCommand();
250 }; 283 };
251 284
285#if LL_LINUX
286 setlocale(LC_ALL, saved_locale.c_str() );
287#endif // LL_LINUX
288
252 return true; 289 return true;
253} 290}
254 291
@@ -345,8 +382,16 @@ bool LLMediaImplLLMozLib::recomputeSizes()
345 new_height = LLMediaManager::textureHeightFromMediaHeight( new_height ); 382 new_height = LLMediaManager::textureHeightFromMediaHeight( new_height );
346 } 383 }
347 384
385#if LL_LINUX
386 std::string saved_locale = setlocale(LC_ALL, NULL);
387#endif // LL_LINUX
388
348 bool status = LLMozLib::getInstance()->setSize( mWindowId, new_width, new_height ); 389 bool status = LLMozLib::getInstance()->setSize( mWindowId, new_width, new_height );
349 390
391#if LL_LINUX
392 setlocale(LC_ALL, saved_locale.c_str() );
393#endif // LL_LINUX
394
350 if (status) 395 if (status)
351 setMediaSize(new_width, new_height); 396 setMediaSize(new_width, new_height);
352 397
@@ -578,12 +623,20 @@ bool LLMediaImplLLMozLib::clearCookies()
578// virtual 623// virtual
579bool LLMediaImplLLMozLib::reset() 624bool LLMediaImplLLMozLib::reset()
580{ 625{
626#if LL_LINUX
627 std::string saved_locale = setlocale(LC_ALL, NULL);
628#endif // LL_LINUX
629
581 LLMozLib::getInstance()->remObserver( mWindowId, this ); 630 LLMozLib::getInstance()->remObserver( mWindowId, this );
582 631
583 LLMozLib::getInstance()->destroyBrowserWindow( mWindowId ); 632 LLMozLib::getInstance()->destroyBrowserWindow( mWindowId );
584 633
585 mWindowId = 0; 634 mWindowId = 0;
586 635
636#if LL_LINUX
637 setlocale(LC_ALL, saved_locale.c_str() );
638#endif // LL_LINUX
639
587 return true; 640 return true;
588} 641}
589 642