aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llwindow
diff options
context:
space:
mode:
authorArmin Weatherwax2010-02-26 17:06:16 +0100
committerArmin Weatherwax2010-09-23 15:40:22 +0200
commitdcdfa1ebab37dd78282bc95093a5f347f5846b1c (patch)
tree22d6ea3f35b749e51ae4ac882bd56f42d35f9590 /linden/indra/llwindow
parentremove deprecated files (diff)
downloadmeta-impy-dcdfa1ebab37dd78282bc95093a5f347f5846b1c.zip
meta-impy-dcdfa1ebab37dd78282bc95093a5f347f5846b1c.tar.gz
meta-impy-dcdfa1ebab37dd78282bc95093a5f347f5846b1c.tar.bz2
meta-impy-dcdfa1ebab37dd78282bc95093a5f347f5846b1c.tar.xz
port SG2.0 Mediaplugs (webkit supports flash now)
Diffstat (limited to 'linden/indra/llwindow')
-rw-r--r--linden/indra/llwindow/llwindow.h4
-rw-r--r--linden/indra/llwindow/llwindowmacosx.cpp2
-rw-r--r--linden/indra/llwindow/llwindowmacosx.h4
-rw-r--r--linden/indra/llwindow/llwindowsdl.cpp39
-rw-r--r--linden/indra/llwindow/llwindowsdl.h9
-rw-r--r--linden/indra/llwindow/llwindowwin32.cpp13
-rw-r--r--linden/indra/llwindow/llwindowwin32.h8
7 files changed, 75 insertions, 4 deletions
diff --git a/linden/indra/llwindow/llwindow.h b/linden/indra/llwindow/llwindow.h
index 14759cc..2e96294 100644
--- a/linden/indra/llwindow/llwindow.h
+++ b/linden/indra/llwindow/llwindow.h
@@ -37,6 +37,7 @@
37#include "llcoord.h" 37#include "llcoord.h"
38#include "llstring.h" 38#include "llstring.h"
39#include "llcursortypes.h" 39#include "llcursortypes.h"
40#include "llsd.h"
40 41
41class LLSplashScreen; 42class LLSplashScreen;
42 43
@@ -208,6 +209,9 @@ public:
208 209
209 static std::vector<std::string> getDynamicFallbackFontList(); 210 static std::vector<std::string> getDynamicFallbackFontList();
210 211
212 // Provide native key event data
213 virtual LLSD getNativeKeyData() { return LLSD::emptyMap(); }
214
211protected: 215protected:
212 LLWindow(BOOL fullscreen, U32 flags); 216 LLWindow(BOOL fullscreen, U32 flags);
213 virtual ~LLWindow() {} 217 virtual ~LLWindow() {}
diff --git a/linden/indra/llwindow/llwindowmacosx.cpp b/linden/indra/llwindow/llwindowmacosx.cpp
index 7efba51..430687b 100644
--- a/linden/indra/llwindow/llwindowmacosx.cpp
+++ b/linden/indra/llwindow/llwindowmacosx.cpp
@@ -3217,7 +3217,7 @@ void LLWindowMacOSX::ShellEx(const std::string& command)
3217 } 3217 }
3218} 3218}
3219 3219
3220BOOL LLWindowMacOSX::dialog_color_picker ( F32 *r, F32 *g, F32 *b) 3220BOOL LLWindowMacOSX::dialog_color_picker( F32 *r, F32 *g, F32 *b)
3221{ 3221{
3222 BOOL retval = FALSE; 3222 BOOL retval = FALSE;
3223 OSErr error = noErr; 3223 OSErr error = noErr;
diff --git a/linden/indra/llwindow/llwindowmacosx.h b/linden/indra/llwindow/llwindowmacosx.h
index 9e87e9f..92c73e8 100644
--- a/linden/indra/llwindow/llwindowmacosx.h
+++ b/linden/indra/llwindow/llwindowmacosx.h
@@ -117,6 +117,10 @@ public:
117 117
118 static std::vector<std::string> getDynamicFallbackFontList(); 118 static std::vector<std::string> getDynamicFallbackFontList();
119 119
120 // Provide native key event data
121 /*virtual*/ LLSD getNativeKeyData();
122
123
120protected: 124protected:
121 LLWindowMacOSX( 125 LLWindowMacOSX(
122 const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, 126 const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp
index bf339f2..9310ff5 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)
@@ -2227,7 +2231,40 @@ static void color_changed_callback(GtkWidget *widget,
2227 gtk_color_selection_get_current_color(colorsel, colorp); 2231 gtk_color_selection_get_current_color(colorsel, colorp);
2228} 2232}
2229 2233
2230BOOL LLWindowSDL::dialog_color_picker ( F32 *r, F32 *g, F32 *b) 2234
2235/*
2236 Make the raw keyboard data available - used to poke through to LLQtWebKit so
2237 that Qt/Webkit has access to the virtual keycodes etc. that it needs
2238*/
2239LLSD LLWindowSDL::getNativeKeyData()
2240{
2241 LLSD result = LLSD::emptyMap();
2242
2243 U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave!
2244
2245 // we go through so many levels of device abstraction that I can't really guess
2246 // what a plugin under GDK under Qt under SL under SDL under X11 considers
2247 // a 'native' modifier mask. this has been sort of reverse-engineered... they *appear*
2248 // to match GDK consts, but that may be co-incidence.
2249 modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0;
2250 modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift
2251 modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0;
2252 modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0;
2253 modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl
2254 modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested
2255 modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested
2256 // *todo: test ALTs - I don't have a case for testing these. Do you?
2257 // *todo: NUM? - I don't care enough right now (and it's not a GDK modifier).
2258
2259 result["scan_code"] = (S32)mKeyScanCode;
2260 result["virtual_key"] = (S32)mKeyVirtualKey;
2261 result["modifiers"] = (S32)modifiers;
2262
2263 return result;
2264}
2265
2266
2267BOOL LLWindowSDL::dialog_color_picker( F32 *r, F32 *g, F32 *b)
2231{ 2268{
2232 BOOL rtn = FALSE; 2269 BOOL rtn = FALSE;
2233 2270
diff --git a/linden/indra/llwindow/llwindowsdl.h b/linden/indra/llwindow/llwindowsdl.h
index 39a6007..37b0835 100644
--- a/linden/indra/llwindow/llwindowsdl.h
+++ b/linden/indra/llwindow/llwindowsdl.h
@@ -154,6 +154,8 @@ protected:
154 BOOL ignore_pixel_depth, U32 fsaa_samples); 154 BOOL ignore_pixel_depth, U32 fsaa_samples);
155 ~LLWindowSDL(); 155 ~LLWindowSDL();
156 156
157 /*virtual*/ LLSD getNativeKeyData();
158
157 void initCursors(); 159 void initCursors();
158 void quitCursors(); 160 void quitCursors();
159 BOOL isValid(); 161 BOOL isValid();
@@ -206,12 +208,17 @@ protected:
206 208
207 friend class LLWindowManager; 209 friend class LLWindowManager;
208 210
209#if LL_X11 211
210private: 212private:
213#if LL_X11
211 void x11_set_urgent(BOOL urgent); 214 void x11_set_urgent(BOOL urgent);
212 BOOL mFlashing; 215 BOOL mFlashing;
213 LLTimer mFlashTimer; 216 LLTimer mFlashTimer;
214#endif //LL_X11 217#endif //LL_X11
218 U32 mKeyScanCode;
219 U32 mKeyVirtualKey;
220 SDLMod mKeyModifiers;
221
215}; 222};
216 223
217 224
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp
index e47cab4..12a488a 100644
--- a/linden/indra/llwindow/llwindowwin32.cpp
+++ b/linden/indra/llwindow/llwindowwin32.cpp
@@ -3052,6 +3052,19 @@ void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url )
3052 */ 3052 */
3053} 3053}
3054 3054
3055/*
3056 Make the raw keyboard data available - used to poke through to LLQtWebKit so
3057 that Qt/Webkit has access to the virtual keycodes etc. that it needs
3058*/
3059LLSD LLWindowWin32::getNativeKeyData()
3060{
3061 LLSD result = LLSD::emptyMap();
3062
3063 result["scan_code"] = (S32)mKeyScanCode;
3064 result["virtual_key"] = (S32)mKeyVirtualKey;
3065
3066 return result;
3067}
3055 3068
3056BOOL LLWindowWin32::dialog_color_picker ( F32 *r, F32 *g, F32 *b ) 3069BOOL LLWindowWin32::dialog_color_picker ( F32 *r, F32 *g, F32 *b )
3057{ 3070{
diff --git a/linden/indra/llwindow/llwindowwin32.h b/linden/indra/llwindow/llwindowwin32.h
index cc95993..0e40115 100644
--- a/linden/indra/llwindow/llwindowwin32.h
+++ b/linden/indra/llwindow/llwindowwin32.h
@@ -128,7 +128,7 @@ protected:
128 HCURSOR loadColorCursor(LPCTSTR name); 128 HCURSOR loadColorCursor(LPCTSTR name);
129 BOOL isValid(); 129 BOOL isValid();
130 void moveWindow(const LLCoordScreen& position,const LLCoordScreen& size); 130 void moveWindow(const LLCoordScreen& position,const LLCoordScreen& size);
131 131 LLSD getNativeKeyData();
132 132
133 // Changes display resolution. Returns true if successful 133 // Changes display resolution. Returns true if successful
134 BOOL setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh); 134 BOOL setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh);
@@ -208,6 +208,12 @@ protected:
208 208
209 LLPreeditor *mPreeditor; 209 LLPreeditor *mPreeditor;
210 210
211
212
213 U32 mKeyCharCode;
214 U32 mKeyScanCode;
215 U32 mKeyVirtualKey;
216
211 friend class LLWindowManager; 217 friend class LLWindowManager;
212}; 218};
213 219