aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llwindow/llwindowsdl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llwindow/llwindowsdl.cpp')
-rw-r--r--linden/indra/llwindow/llwindowsdl.cpp42
1 files changed, 40 insertions, 2 deletions
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp
index 16a583a..16106af 100644
--- a/linden/indra/llwindow/llwindowsdl.cpp
+++ b/linden/indra/llwindow/llwindowsdl.cpp
@@ -250,6 +250,10 @@ LLWindowSDL::LLWindowSDL(const std::string& title, S32 x, S32 y, S32 width,
250#if LL_X11 250#if LL_X11
251 mFlashing = FALSE; 251 mFlashing = FALSE;
252#endif // LL_X11 252#endif // LL_X11
253
254 mKeyScanCode = 0;
255 mKeyVirtualKey = 0;
256 mKeyModifiers = KMOD_NONE;
253} 257}
254 258
255static SDL_Surface *Load_BMP_Resource(const char *basename) 259static SDL_Surface *Load_BMP_Resource(const char *basename)
@@ -1602,6 +1606,7 @@ void LLWindowSDL::processMiscNativeEvents()
1602 // the locale to protect it, as exotic/non-C locales 1606 // the locale to protect it, as exotic/non-C locales
1603 // causes our code lots of general critical weirdness 1607 // causes our code lots of general critical weirdness
1604 // and crashness. (SL-35450) 1608 // and crashness. (SL-35450)
1609 // Note: It is unknown if this is still needed now that we use webkit.
1605 static std::string saved_locale; 1610 static std::string saved_locale;
1606 saved_locale = ll_safe_string(setlocale(LC_ALL, NULL)); 1611 saved_locale = ll_safe_string(setlocale(LC_ALL, NULL));
1607 1612
@@ -2227,7 +2232,40 @@ static void color_changed_callback(GtkWidget *widget,
2227 gtk_color_selection_get_current_color(colorsel, colorp); 2232 gtk_color_selection_get_current_color(colorsel, colorp);
2228} 2233}
2229 2234
2230BOOL LLWindowSDL::dialog_color_picker ( F32 *r, F32 *g, F32 *b) 2235
2236/*
2237 Make the raw keyboard data available - used to poke through to LLQtWebKit so
2238 that Qt/Webkit has access to the virtual keycodes etc. that it needs
2239*/
2240LLSD LLWindowSDL::getNativeKeyData()
2241{
2242 LLSD result = LLSD::emptyMap();
2243
2244 U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave!
2245
2246 // we go through so many levels of device abstraction that I can't really guess
2247 // what a plugin under GDK under Qt under SL under SDL under X11 considers
2248 // a 'native' modifier mask. this has been sort of reverse-engineered... they *appear*
2249 // to match GDK consts, but that may be co-incidence.
2250 modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0;
2251 modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift
2252 modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0;
2253 modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0;
2254 modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl
2255 modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested
2256 modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested
2257 // *todo: test ALTs - I don't have a case for testing these. Do you?
2258 // *todo: NUM? - I don't care enough right now (and it's not a GDK modifier).
2259
2260 result["scan_code"] = (S32)mKeyScanCode;
2261 result["virtual_key"] = (S32)mKeyVirtualKey;
2262 result["modifiers"] = (S32)modifiers;
2263
2264 return result;
2265}
2266
2267
2268BOOL LLWindowSDL::dialog_color_picker( F32 *r, F32 *g, F32 *b)
2231{ 2269{
2232 BOOL rtn = FALSE; 2270 BOOL rtn = FALSE;
2233 2271
@@ -2396,7 +2434,7 @@ void *LLWindowSDL::getPlatformWindow()
2396 return rtnw; 2434 return rtnw;
2397 } 2435 }
2398#endif // LL_GTK && LL_LLMOZLIB_ENABLED 2436#endif // LL_GTK && LL_LLMOZLIB_ENABLED
2399 // Unixoid mozilla really needs GTK. 2437 llassert(false); // Do we even GET here at all? Note that LL_LLMOZLIB_ENABLED is never defined!
2400 return NULL; 2438 return NULL;
2401} 2439}
2402 2440