aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llwindow
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-11-02 21:32:04 -0700
committerMcCabe Maxsted2010-11-02 21:32:04 -0700
commitb5074f1a8e3306f1be9e93172d26c97ff088cea0 (patch)
treea53d5cc54a1f339b7637a9d7d8248eca42995af2 /linden/indra/llwindow
parentRevert "Fix Bug #671 (aka VWR-1603): Duckwalk is too fast" (diff)
parentUploaded the linux64 libraries created by Aleric to imprudenceviewer.org (diff)
downloadmeta-impy-b5074f1a8e3306f1be9e93172d26c97ff088cea0.zip
meta-impy-b5074f1a8e3306f1be9e93172d26c97ff088cea0.tar.gz
meta-impy-b5074f1a8e3306f1be9e93172d26c97ff088cea0.tar.bz2
meta-impy-b5074f1a8e3306f1be9e93172d26c97ff088cea0.tar.xz
Merged webkit_plugins into weekly. Huzzah! The weekly branch now has browser/media plugin support
Diffstat (limited to 'linden/indra/llwindow')
-rw-r--r--linden/indra/llwindow/CMakeLists.txt14
-rw-r--r--linden/indra/llwindow/llwindow.h6
-rw-r--r--linden/indra/llwindow/llwindowmacosx.cpp2
-rw-r--r--linden/indra/llwindow/llwindowmacosx.h4
-rw-r--r--linden/indra/llwindow/llwindowsdl.cpp42
-rw-r--r--linden/indra/llwindow/llwindowsdl.h9
-rw-r--r--linden/indra/llwindow/llwindowwin32.cpp13
-rw-r--r--linden/indra/llwindow/llwindowwin32.h8
8 files changed, 91 insertions, 7 deletions
diff --git a/linden/indra/llwindow/CMakeLists.txt b/linden/indra/llwindow/CMakeLists.txt
index afce0c0..5224163 100644
--- a/linden/indra/llwindow/CMakeLists.txt
+++ b/linden/indra/llwindow/CMakeLists.txt
@@ -19,7 +19,6 @@ include(LLRender)
19include(LLVFS) 19include(LLVFS)
20include(LLWindow) 20include(LLWindow)
21include(LLXML) 21include(LLXML)
22include(Mozlib)
23include(UI) 22include(UI)
24 23
25include_directories( 24include_directories(
@@ -55,6 +54,13 @@ set(viewer_HEADER_FILES
55 llmousehandler.h 54 llmousehandler.h
56 ) 55 )
57 56
57# Libraries on which this library depends, needed for Linux builds
58# Sort by high-level to low-level
59set(llwindow_LINK_LIBRARIES
60 ${UI_LIBRARIES} # for GTK
61 ${SDL_LIBRARY}
62 )
63
58if (DARWIN) 64if (DARWIN)
59 list(APPEND llwindow_SOURCE_FILES 65 list(APPEND llwindow_SOURCE_FILES
60 llkeyboardmacosx.cpp 66 llkeyboardmacosx.cpp
@@ -98,6 +104,9 @@ if (WINDOWS)
98 lldxhardware.h 104 lldxhardware.h
99 llkeyboardwin32.h 105 llkeyboardwin32.h
100 ) 106 )
107 list(APPEND llwindow_LINK_LIBRARIES
108 comdlg32 # Common Dialogs for ChooseColor
109 )
101endif (WINDOWS) 110endif (WINDOWS)
102 111
103if (SOLARIS) 112if (SOLARIS)
@@ -134,6 +143,7 @@ if (SERVER AND NOT WINDOWS AND NOT DARWIN)
134 ${server_SOURCE_FILES} 143 ${server_SOURCE_FILES}
135 ) 144 )
136endif (SERVER AND NOT WINDOWS AND NOT DARWIN) 145endif (SERVER AND NOT WINDOWS AND NOT DARWIN)
146 # *TODO: This should probably have target_link_libraries
137 147
138if (llwindow_HEADER_FILES) 148if (llwindow_HEADER_FILES)
139 list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES}) 149 list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES})
@@ -145,4 +155,6 @@ if (VIEWER)
145 ${llwindow_SOURCE_FILES} 155 ${llwindow_SOURCE_FILES}
146 ${viewer_SOURCE_FILES} 156 ${viewer_SOURCE_FILES}
147 ) 157 )
158 target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES})
148endif (VIEWER) 159endif (VIEWER)
160
diff --git a/linden/indra/llwindow/llwindow.h b/linden/indra/llwindow/llwindow.h
index 14759cc..5e93ab3 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
@@ -195,7 +196,7 @@ public:
195// return a platform-specific window reference (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) 196// return a platform-specific window reference (HWND on Windows, WindowRef on the Mac, Gtk window on Linux)
196 virtual void *getPlatformWindow() = 0; 197 virtual void *getPlatformWindow() = 0;
197 198
198// return the platform-specific window reference we use to initialize llmozlib (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) 199// return the platform-specific window reference we use to initialize llqtwebkitlib (HWND on Windows, WindowRef on the Mac, Gtk window on Linux)
199 virtual void *getMediaWindow(); 200 virtual void *getMediaWindow();
200 201
201 // control platform's Language Text Input mechanisms. 202 // control platform's Language Text Input mechanisms.
@@ -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 4dedc03..d68d4df 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 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
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