diff options
50 files changed, 520 insertions, 221 deletions
diff --git a/linden/indra/llplugin/CMakeLists.txt b/linden/indra/llplugin/CMakeLists.txt index e41cdf7..e41cdf7 100644..100755 --- a/linden/indra/llplugin/CMakeLists.txt +++ b/linden/indra/llplugin/CMakeLists.txt | |||
diff --git a/linden/indra/llplugin/llpluginclassmedia.cpp b/linden/indra/llplugin/llpluginclassmedia.cpp index a6f6f30..2e8bf3f 100644..100755 --- a/linden/indra/llplugin/llpluginclassmedia.cpp +++ b/linden/indra/llplugin/llpluginclassmedia.cpp | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginclassmedia.cpp | 2 | * @file llpluginclassmedia.cpp |
3 | * @brief LLPluginClassMedia handles a plugin which knows about the "media" message class. | 3 | * @brief LLPluginClassMedia handles a plugin which knows about the "media" message class. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
@@ -36,6 +38,8 @@ | |||
36 | #include "llpluginclassmedia.h" | 38 | #include "llpluginclassmedia.h" |
37 | #include "llpluginmessageclasses.h" | 39 | #include "llpluginmessageclasses.h" |
38 | 40 | ||
41 | #include "llqtwebkit.h" | ||
42 | |||
39 | static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256; | 43 | static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256; |
40 | 44 | ||
41 | static int nextPowerOf2( int value ) | 45 | static int nextPowerOf2( int value ) |
@@ -101,6 +105,8 @@ void LLPluginClassMedia::reset() | |||
101 | mSetMediaHeight = -1; | 105 | mSetMediaHeight = -1; |
102 | mRequestedMediaWidth = 0; | 106 | mRequestedMediaWidth = 0; |
103 | mRequestedMediaHeight = 0; | 107 | mRequestedMediaHeight = 0; |
108 | mRequestedTextureWidth = 0; | ||
109 | mRequestedTextureHeight = 0; | ||
104 | mFullMediaWidth = 0; | 110 | mFullMediaWidth = 0; |
105 | mFullMediaHeight = 0; | 111 | mFullMediaHeight = 0; |
106 | mTextureWidth = 0; | 112 | mTextureWidth = 0; |
@@ -123,7 +129,8 @@ void LLPluginClassMedia::reset() | |||
123 | mCanPaste = false; | 129 | mCanPaste = false; |
124 | mMediaName.clear(); | 130 | mMediaName.clear(); |
125 | mMediaDescription.clear(); | 131 | mMediaDescription.clear(); |
126 | 132 | mBackgroundColor = LLColor4(1.0f, 1.0f, 1.0f, 1.0f); | |
133 | |||
127 | // media_browser class | 134 | // media_browser class |
128 | mNavigateURI.clear(); | 135 | mNavigateURI.clear(); |
129 | mNavigateResultCode = -1; | 136 | mNavigateResultCode = -1; |
@@ -132,6 +139,9 @@ void LLPluginClassMedia::reset() | |||
132 | mHistoryForwardAvailable = false; | 139 | mHistoryForwardAvailable = false; |
133 | mStatusText.clear(); | 140 | mStatusText.clear(); |
134 | mProgressPercent = 0; | 141 | mProgressPercent = 0; |
142 | mClickURL.clear(); | ||
143 | mClickTarget.clear(); | ||
144 | mClickTargetType = TARGET_NONE; | ||
135 | 145 | ||
136 | // media_time class | 146 | // media_time class |
137 | mCurrentTime = 0.0f; | 147 | mCurrentTime = 0.0f; |
@@ -233,6 +243,10 @@ void LLPluginClassMedia::idle(void) | |||
233 | message.setValueS32("height", mRequestedMediaHeight); | 243 | message.setValueS32("height", mRequestedMediaHeight); |
234 | message.setValueS32("texture_width", mRequestedTextureWidth); | 244 | message.setValueS32("texture_width", mRequestedTextureWidth); |
235 | message.setValueS32("texture_height", mRequestedTextureHeight); | 245 | message.setValueS32("texture_height", mRequestedTextureHeight); |
246 | message.setValueReal("background_r", mBackgroundColor.mV[VX]); | ||
247 | message.setValueReal("background_g", mBackgroundColor.mV[VY]); | ||
248 | message.setValueReal("background_b", mBackgroundColor.mV[VZ]); | ||
249 | message.setValueReal("background_a", mBackgroundColor.mV[VW]); | ||
236 | mPlugin->sendMessage(message); // DO NOT just use sendMessage() here -- we want this to jump ahead of the queue. | 250 | mPlugin->sendMessage(message); // DO NOT just use sendMessage() here -- we want this to jump ahead of the queue. |
237 | 251 | ||
238 | LL_DEBUGS("Plugin") << "Sending size_change" << LL_ENDL; | 252 | LL_DEBUGS("Plugin") << "Sending size_change" << LL_ENDL; |
@@ -370,7 +384,7 @@ bool LLPluginClassMedia::textureValid(void) | |||
370 | 384 | ||
371 | bool LLPluginClassMedia::getDirty(LLRect *dirty_rect) | 385 | bool LLPluginClassMedia::getDirty(LLRect *dirty_rect) |
372 | { | 386 | { |
373 | bool result = !mDirtyRect.isNull(); | 387 | bool result = !mDirtyRect.isNull();//awfixme isEmpty(); |
374 | 388 | ||
375 | if(dirty_rect != NULL) | 389 | if(dirty_rect != NULL) |
376 | { | 390 | { |
@@ -458,7 +472,7 @@ void LLPluginClassMedia::mouseEvent(EMouseEventType type, int button, int x, int | |||
458 | sendMessage(message); | 472 | sendMessage(message); |
459 | } | 473 | } |
460 | 474 | ||
461 | bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifiers) | 475 | bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data) |
462 | { | 476 | { |
463 | bool result = true; | 477 | bool result = true; |
464 | 478 | ||
@@ -515,6 +529,7 @@ bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifie | |||
515 | message.setValueS32("key", key_code); | 529 | message.setValueS32("key", key_code); |
516 | 530 | ||
517 | message.setValue("modifiers", translateModifiers(modifiers)); | 531 | message.setValue("modifiers", translateModifiers(modifiers)); |
532 | message.setValueLLSD("native_key_data", native_key_data); | ||
518 | 533 | ||
519 | sendMessage(message); | 534 | sendMessage(message); |
520 | } | 535 | } |
@@ -533,12 +548,13 @@ void LLPluginClassMedia::scrollEvent(int x, int y, MASK modifiers) | |||
533 | sendMessage(message); | 548 | sendMessage(message); |
534 | } | 549 | } |
535 | 550 | ||
536 | bool LLPluginClassMedia::textInput(const std::string &text, MASK modifiers) | 551 | bool LLPluginClassMedia::textInput(const std::string &text, MASK modifiers, LLSD native_key_data) |
537 | { | 552 | { |
538 | LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "text_event"); | 553 | LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "text_event"); |
539 | 554 | ||
540 | message.setValue("text", text); | 555 | message.setValue("text", text); |
541 | message.setValue("modifiers", translateModifiers(modifiers)); | 556 | message.setValue("modifiers", translateModifiers(modifiers)); |
557 | message.setValueLLSD("native_key_data", native_key_data); | ||
542 | 558 | ||
543 | sendMessage(message); | 559 | sendMessage(message); |
544 | 560 | ||
@@ -663,6 +679,26 @@ void LLPluginClassMedia::paste() | |||
663 | sendMessage(message); | 679 | sendMessage(message); |
664 | } | 680 | } |
665 | 681 | ||
682 | LLPluginClassMedia::ETargetType getTargetTypeFromLLQtWebkit(int target_type) | ||
683 | { | ||
684 | // convert a LinkTargetType value from llqtwebkit to an ETargetType | ||
685 | // so that we don't expose the llqtwebkit header in viewer code | ||
686 | switch (target_type) | ||
687 | { | ||
688 | case LLQtWebKit::LTT_TARGET_NONE: | ||
689 | return LLPluginClassMedia::TARGET_NONE; | ||
690 | |||
691 | case LLQtWebKit::LTT_TARGET_BLANK: | ||
692 | return LLPluginClassMedia::TARGET_BLANK; | ||
693 | |||
694 | case LLQtWebKit::LTT_TARGET_EXTERNAL: | ||
695 | return LLPluginClassMedia::TARGET_EXTERNAL; | ||
696 | |||
697 | default: | ||
698 | return LLPluginClassMedia::TARGET_OTHER; | ||
699 | } | ||
700 | } | ||
701 | |||
666 | /* virtual */ | 702 | /* virtual */ |
667 | void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) | 703 | void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) |
668 | { | 704 | { |
@@ -710,7 +746,7 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) | |||
710 | newDirtyRect.mBottom = temp; | 746 | newDirtyRect.mBottom = temp; |
711 | } | 747 | } |
712 | 748 | ||
713 | if(mDirtyRect.isNull()) | 749 | if(mDirtyRect.isNull())//awfixme isEmpty()) |
714 | { | 750 | { |
715 | mDirtyRect = newDirtyRect; | 751 | mDirtyRect = newDirtyRect; |
716 | } | 752 | } |
@@ -915,12 +951,15 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) | |||
915 | { | 951 | { |
916 | mClickURL = message.getValue("uri"); | 952 | mClickURL = message.getValue("uri"); |
917 | mClickTarget = message.getValue("target"); | 953 | mClickTarget = message.getValue("target"); |
954 | U32 target_type = message.getValueU32("target_type"); | ||
955 | mClickTargetType = ::getTargetTypeFromLLQtWebkit(target_type); | ||
918 | mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF); | 956 | mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF); |
919 | } | 957 | } |
920 | else if(message_name == "click_nofollow") | 958 | else if(message_name == "click_nofollow") |
921 | { | 959 | { |
922 | mClickURL = message.getValue("uri"); | 960 | mClickURL = message.getValue("uri"); |
923 | mClickTarget.clear(); | 961 | mClickTarget.clear(); |
962 | mClickTargetType = TARGET_NONE; | ||
924 | mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW); | 963 | mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW); |
925 | } | 964 | } |
926 | else | 965 | else |
diff --git a/linden/indra/llplugin/llpluginclassmedia.h b/linden/indra/llplugin/llpluginclassmedia.h index c45010e..ab54348 100644..100755 --- a/linden/indra/llplugin/llpluginclassmedia.h +++ b/linden/indra/llplugin/llpluginclassmedia.h | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginclassmedia.h | 2 | * @file llpluginclassmedia.h |
3 | * @brief LLPluginClassMedia handles interaction with a plugin which knows about the "media" message class. | 3 | * @brief LLPluginClassMedia handles interaction with a plugin which knows about the "media" message class. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #ifndef LL_LLPLUGINCLASSMEDIA_H | 35 | #ifndef LL_LLPLUGINCLASSMEDIA_H |
@@ -38,7 +40,7 @@ | |||
38 | #include "llrect.h" | 40 | #include "llrect.h" |
39 | #include "llpluginclassmediaowner.h" | 41 | #include "llpluginclassmediaowner.h" |
40 | #include <queue> | 42 | #include <queue> |
41 | 43 | #include "v4color.h" | |
42 | 44 | ||
43 | class LLPluginClassMedia : public LLPluginProcessParentOwner | 45 | class LLPluginClassMedia : public LLPluginProcessParentOwner |
44 | { | 46 | { |
@@ -85,6 +87,8 @@ public: | |||
85 | void setSize(int width, int height); | 87 | void setSize(int width, int height); |
86 | void setAutoScale(bool auto_scale); | 88 | void setAutoScale(bool auto_scale); |
87 | 89 | ||
90 | void setBackgroundColor(LLColor4 color) { mBackgroundColor = color; }; | ||
91 | |||
88 | // Returns true if all of the texture parameters (depth, format, size, and texture size) are set up and consistent. | 92 | // Returns true if all of the texture parameters (depth, format, size, and texture size) are set up and consistent. |
89 | // This will initially be false, and will also be false for some time after setSize while the resize is processed. | 93 | // This will initially be false, and will also be false for some time after setSize while the resize is processed. |
90 | // Note that if this returns true, it is safe to use all the get() functions above without checking for invalid return values | 94 | // Note that if this returns true, it is safe to use all the get() functions above without checking for invalid return values |
@@ -111,12 +115,12 @@ public: | |||
111 | KEY_EVENT_REPEAT | 115 | KEY_EVENT_REPEAT |
112 | }EKeyEventType; | 116 | }EKeyEventType; |
113 | 117 | ||
114 | bool keyEvent(EKeyEventType type, int key_code, MASK modifiers); | 118 | bool keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data); |
115 | 119 | ||
116 | void scrollEvent(int x, int y, MASK modifiers); | 120 | void scrollEvent(int x, int y, MASK modifiers); |
117 | 121 | ||
118 | // Text may be unicode (utf8 encoded) | 122 | // Text may be unicode (utf8 encoded) |
119 | bool textInput(const std::string &text, MASK modifiers); | 123 | bool textInput(const std::string &text, MASK modifiers, LLSD native_key_data); |
120 | 124 | ||
121 | void loadURI(const std::string &uri); | 125 | void loadURI(const std::string &uri); |
122 | 126 | ||
@@ -211,6 +215,17 @@ public: | |||
211 | // This is valid after MEDIA_EVENT_CLICK_LINK_HREF | 215 | // This is valid after MEDIA_EVENT_CLICK_LINK_HREF |
212 | std::string getClickTarget() const { return mClickTarget; }; | 216 | std::string getClickTarget() const { return mClickTarget; }; |
213 | 217 | ||
218 | typedef enum | ||
219 | { | ||
220 | TARGET_NONE, // empty href target string | ||
221 | TARGET_BLANK, // target to open link in user's preferred browser | ||
222 | TARGET_EXTERNAL, // target to open link in external browser | ||
223 | TARGET_OTHER // nonempty and unsupported target type | ||
224 | }ETargetType; | ||
225 | |||
226 | // This is valid after MEDIA_EVENT_CLICK_LINK_HREF | ||
227 | ETargetType getClickTargetType() const { return mClickTargetType; }; | ||
228 | |||
214 | std::string getMediaName() const { return mMediaName; }; | 229 | std::string getMediaName() const { return mMediaName; }; |
215 | std::string getMediaDescription() const { return mMediaDescription; }; | 230 | std::string getMediaDescription() const { return mMediaDescription; }; |
216 | 231 | ||
@@ -327,6 +342,8 @@ protected: | |||
327 | std::string mMediaName; | 342 | std::string mMediaName; |
328 | std::string mMediaDescription; | 343 | std::string mMediaDescription; |
329 | 344 | ||
345 | LLColor4 mBackgroundColor; | ||
346 | |||
330 | ///////////////////////////////////////// | 347 | ///////////////////////////////////////// |
331 | // media_browser class | 348 | // media_browser class |
332 | std::string mNavigateURI; | 349 | std::string mNavigateURI; |
@@ -339,6 +356,7 @@ protected: | |||
339 | std::string mLocation; | 356 | std::string mLocation; |
340 | std::string mClickURL; | 357 | std::string mClickURL; |
341 | std::string mClickTarget; | 358 | std::string mClickTarget; |
359 | ETargetType mClickTargetType; | ||
342 | 360 | ||
343 | ///////////////////////////////////////// | 361 | ///////////////////////////////////////// |
344 | // media_time class | 362 | // media_time class |
diff --git a/linden/indra/llplugin/llpluginclassmediaowner.h b/linden/indra/llplugin/llpluginclassmediaowner.h index 182eb92..239f692 100644..100755 --- a/linden/indra/llplugin/llpluginclassmediaowner.h +++ b/linden/indra/llplugin/llpluginclassmediaowner.h | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginclassmediaowner.h | 2 | * @file llpluginclassmediaowner.h |
3 | * @brief LLPluginClassMedia handles interaction with a plugin which knows about the "media" message class. | 3 | * @brief LLPluginClassMedia handles interaction with a plugin which knows about the "media" message class. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #ifndef LL_LLPLUGINCLASSMEDIAOWNER_H | 35 | #ifndef LL_LLPLUGINCLASSMEDIAOWNER_H |
diff --git a/linden/indra/llplugin/llplugininstance.cpp b/linden/indra/llplugin/llplugininstance.cpp index 5185b36..ce10cb6 100644..100755 --- a/linden/indra/llplugin/llplugininstance.cpp +++ b/linden/indra/llplugin/llplugininstance.cpp | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llplugininstance.cpp | 2 | * @file llplugininstance.cpp |
3 | * @brief LLPluginInstance handles loading the dynamic library of a plugin and setting up its entry points for message passing. | 3 | * @brief LLPluginInstance handles loading the dynamic library of a plugin and setting up its entry points for message passing. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
diff --git a/linden/indra/llplugin/llplugininstance.h b/linden/indra/llplugin/llplugininstance.h index 0b53b5f..baa51cc 100644..100755 --- a/linden/indra/llplugin/llplugininstance.h +++ b/linden/indra/llplugin/llplugininstance.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /** | 1 | /** |
2 | * @file llplugininstance.h | 2 | * @file llplugininstance.h |
3 | * @brief LLPluginInstance handles loading the dynamic library of a plugin and setting up its entry points for message passing. | ||
4 | * | 3 | * |
4 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 7 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +28,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 29 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 30 | * $/LicenseInfo$ |
31 | * @endcond | ||
31 | */ | 32 | */ |
32 | 33 | ||
33 | #ifndef LL_LLPLUGININSTANCE_H | 34 | #ifndef LL_LLPLUGININSTANCE_H |
diff --git a/linden/indra/llplugin/llpluginmessage.cpp b/linden/indra/llplugin/llpluginmessage.cpp index 67ac995..8efc774 100644..100755 --- a/linden/indra/llplugin/llpluginmessage.cpp +++ b/linden/indra/llplugin/llpluginmessage.cpp | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginmessage.cpp | 2 | * @file llpluginmessage.cpp |
3 | * @brief LLPluginMessage encapsulates the serialization/deserialization of messages passed to and from plugins. | 3 | * @brief LLPluginMessage encapsulates the serialization/deserialization of messages passed to and from plugins. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
diff --git a/linden/indra/llplugin/llpluginmessage.h b/linden/indra/llplugin/llpluginmessage.h index 8bcb896..82eb89f 100644..100755 --- a/linden/indra/llplugin/llpluginmessage.h +++ b/linden/indra/llplugin/llpluginmessage.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /** | 1 | /** |
2 | * @file llpluginmessage.h | 2 | * @file llpluginmessage.h |
3 | * @brief LLPluginMessage encapsulates the serialization/deserialization of messages passed to and from plugins. | ||
4 | * | 3 | * |
4 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 7 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +28,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 29 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 30 | * $/LicenseInfo$ |
31 | * @endcond | ||
31 | */ | 32 | */ |
32 | 33 | ||
33 | #ifndef LL_LLPLUGINMESSAGE_H | 34 | #ifndef LL_LLPLUGINMESSAGE_H |
diff --git a/linden/indra/llplugin/llpluginmessageclasses.h b/linden/indra/llplugin/llpluginmessageclasses.h index 1f60d5e..9a39e98 100644..100755 --- a/linden/indra/llplugin/llpluginmessageclasses.h +++ b/linden/indra/llplugin/llpluginmessageclasses.h | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginmessageclasses.h | 2 | * @file llpluginmessageclasses.h |
3 | * @brief This file defines the versions of existing message classes for LLPluginMessage. | 3 | * @brief This file defines the versions of existing message classes for LLPluginMessage. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #ifndef LL_LLPLUGINMESSAGECLASSES_H | 35 | #ifndef LL_LLPLUGINMESSAGECLASSES_H |
diff --git a/linden/indra/llplugin/llpluginmessagepipe.cpp b/linden/indra/llplugin/llpluginmessagepipe.cpp index 209f49f..85ed227 100644..100755 --- a/linden/indra/llplugin/llpluginmessagepipe.cpp +++ b/linden/indra/llplugin/llpluginmessagepipe.cpp | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginmessagepipe.cpp | 2 | * @file llpluginmessagepipe.cpp |
3 | * @brief Classes that implement connections from the plugin system to pipes/pumps. | 3 | * @brief Classes that implement connections from the plugin system to pipes/pumps. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
@@ -303,7 +305,14 @@ void LLPluginMessagePipe::processInput(void) | |||
303 | while((delim = mInput.find(MESSAGE_DELIMITER, start)) != std::string::npos) | 305 | while((delim = mInput.find(MESSAGE_DELIMITER, start)) != std::string::npos) |
304 | { | 306 | { |
305 | // Let the owner process this message | 307 | // Let the owner process this message |
306 | mOwner->receiveMessageRaw(mInput.substr(start, delim - start)); | 308 | if (mOwner) |
309 | { | ||
310 | mOwner->receiveMessageRaw(mInput.substr(start, delim - start)); | ||
311 | } | ||
312 | else | ||
313 | { | ||
314 | LL_WARNS("Plugin") << "!mOwner" << LL_ENDL; | ||
315 | } | ||
307 | 316 | ||
308 | start = delim + 1; | 317 | start = delim + 1; |
309 | } | 318 | } |
diff --git a/linden/indra/llplugin/llpluginmessagepipe.h b/linden/indra/llplugin/llpluginmessagepipe.h index 9bf1781..63fd569 100644..100755 --- a/linden/indra/llplugin/llpluginmessagepipe.h +++ b/linden/indra/llplugin/llpluginmessagepipe.h | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginmessagepipe.h | 2 | * @file llpluginmessagepipe.h |
3 | * @brief Classes that implement connections from the plugin system to pipes/pumps. | 3 | * @brief Classes that implement connections from the plugin system to pipes/pumps. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #ifndef LL_LLPLUGINMESSAGEPIPE_H | 35 | #ifndef LL_LLPLUGINMESSAGEPIPE_H |
diff --git a/linden/indra/llplugin/llpluginprocesschild.cpp b/linden/indra/llplugin/llpluginprocesschild.cpp index 9b5eafc..e13376f 100644..100755 --- a/linden/indra/llplugin/llpluginprocesschild.cpp +++ b/linden/indra/llplugin/llpluginprocesschild.cpp | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginprocesschild.cpp | 2 | * @file llpluginprocesschild.cpp |
3 | * @brief LLPluginProcessChild handles the child side of the external-process plugin API. | 3 | * @brief LLPluginProcessChild handles the child side of the external-process plugin API. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
@@ -42,6 +44,7 @@ static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f; // Each call to idle will | |||
42 | 44 | ||
43 | LLPluginProcessChild::LLPluginProcessChild() | 45 | LLPluginProcessChild::LLPluginProcessChild() |
44 | { | 46 | { |
47 | mState = STATE_UNINITIALIZED; | ||
45 | mInstance = NULL; | 48 | mInstance = NULL; |
46 | mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); | 49 | mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); |
47 | mSleepTime = PLUGIN_IDLE_SECONDS; // default: send idle messages at 100Hz | 50 | mSleepTime = PLUGIN_IDLE_SECONDS; // default: send idle messages at 100Hz |
@@ -53,8 +56,14 @@ LLPluginProcessChild::~LLPluginProcessChild() | |||
53 | if(mInstance != NULL) | 56 | if(mInstance != NULL) |
54 | { | 57 | { |
55 | sendMessageToPlugin(LLPluginMessage("base", "cleanup")); | 58 | sendMessageToPlugin(LLPluginMessage("base", "cleanup")); |
56 | delete mInstance; | 59 | |
57 | mInstance = NULL; | 60 | // IMPORTANT: under some (unknown) circumstances the apr_dso_unload() triggered when mInstance is deleted |
61 | // appears to fail and lock up which means that a given instance of the slplugin process never exits. | ||
62 | // This is bad, especially when users try to update their version of SL - it fails because the slplugin | ||
63 | // process as well as a bunch of plugin specific files are locked and cannot be overwritten. | ||
64 | exit( 0 ); | ||
65 | //delete mInstance; | ||
66 | //mInstance = NULL; | ||
58 | } | 67 | } |
59 | } | 68 | } |
60 | 69 | ||
@@ -270,14 +279,21 @@ bool LLPluginProcessChild::isDone(void) | |||
270 | 279 | ||
271 | void LLPluginProcessChild::sendMessageToPlugin(const LLPluginMessage &message) | 280 | void LLPluginProcessChild::sendMessageToPlugin(const LLPluginMessage &message) |
272 | { | 281 | { |
273 | std::string buffer = message.generate(); | 282 | if (mInstance) |
274 | 283 | { | |
275 | LL_DEBUGS("Plugin") << "Sending to plugin: " << buffer << LL_ENDL; | 284 | std::string buffer = message.generate(); |
276 | LLTimer elapsed; | 285 | |
277 | 286 | LL_DEBUGS("Plugin") << "Sending to plugin: " << buffer << LL_ENDL; | |
278 | mInstance->sendMessage(buffer); | 287 | LLTimer elapsed; |
279 | 288 | ||
280 | mCPUElapsed += elapsed.getElapsedTimeF64(); | 289 | mInstance->sendMessage(buffer); |
290 | |||
291 | mCPUElapsed += elapsed.getElapsedTimeF64(); | ||
292 | } | ||
293 | else | ||
294 | { | ||
295 | LL_WARNS("Plugin") << "mInstance == NULL" << LL_ENDL; | ||
296 | } | ||
281 | } | 297 | } |
282 | 298 | ||
283 | void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message) | 299 | void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message) |
@@ -352,6 +368,7 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message) | |||
352 | else | 368 | else |
353 | { | 369 | { |
354 | LL_WARNS("Plugin") << "Couldn't create a shared memory segment!" << LL_ENDL; | 370 | LL_WARNS("Plugin") << "Couldn't create a shared memory segment!" << LL_ENDL; |
371 | delete region; | ||
355 | } | 372 | } |
356 | } | 373 | } |
357 | 374 | ||
diff --git a/linden/indra/llplugin/llpluginprocesschild.h b/linden/indra/llplugin/llpluginprocesschild.h index 16a1ae8..8e9579e 100644..100755 --- a/linden/indra/llplugin/llpluginprocesschild.h +++ b/linden/indra/llplugin/llpluginprocesschild.h | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginprocesschild.h | 2 | * @file llpluginprocesschild.h |
3 | * @brief LLPluginProcessChild handles the child side of the external-process plugin API. | 3 | * @brief LLPluginProcessChild handles the child side of the external-process plugin API. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #ifndef LL_LLPLUGINPROCESSCHILD_H | 35 | #ifndef LL_LLPLUGINPROCESSCHILD_H |
@@ -88,8 +90,9 @@ private: | |||
88 | STATE_ERROR, // generic bailout state | 90 | STATE_ERROR, // generic bailout state |
89 | STATE_DONE // state machine will sit in this state after either error or normal termination. | 91 | STATE_DONE // state machine will sit in this state after either error or normal termination. |
90 | }; | 92 | }; |
91 | EState mState; | ||
92 | void setState(EState state); | 93 | void setState(EState state); |
94 | |||
95 | EState mState; | ||
93 | 96 | ||
94 | LLHost mLauncherHost; | 97 | LLHost mLauncherHost; |
95 | LLSocket::ptr_t mSocket; | 98 | LLSocket::ptr_t mSocket; |
diff --git a/linden/indra/llplugin/llpluginprocessparent.cpp b/linden/indra/llplugin/llpluginprocessparent.cpp index bd36d11..9b8ea8b 100644..100755 --- a/linden/indra/llplugin/llpluginprocessparent.cpp +++ b/linden/indra/llplugin/llpluginprocessparent.cpp | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginprocessparent.cpp | 2 | * @file llpluginprocessparent.cpp |
3 | * @brief LLPluginProcessParent handles the parent side of the external-process plugin API. | 3 | * @brief LLPluginProcessParent handles the parent side of the external-process plugin API. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
@@ -49,11 +51,13 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner) | |||
49 | mOwner = owner; | 51 | mOwner = owner; |
50 | mBoundPort = 0; | 52 | mBoundPort = 0; |
51 | mState = STATE_UNINITIALIZED; | 53 | mState = STATE_UNINITIALIZED; |
54 | mSleepTime = 0.0; | ||
55 | mCPUUsage = 0.0; | ||
52 | mDisableTimeout = false; | 56 | mDisableTimeout = false; |
53 | mDebug = false; | 57 | mDebug = false; |
54 | 58 | ||
55 | mPluginLaunchTimeout = 60.0f; | 59 | mPluginLaunchTimeout = 60.0f; |
56 | mPluginLockupTimeout = 30.0f; | 60 | mPluginLockupTimeout = 15.0f; |
57 | 61 | ||
58 | // Don't start the timer here -- start it when we actually launch the plugin process. | 62 | // Don't start the timer here -- start it when we actually launch the plugin process. |
59 | mHeartbeat.stop(); | 63 | mHeartbeat.stop(); |
diff --git a/linden/indra/llplugin/llpluginprocessparent.h b/linden/indra/llplugin/llpluginprocessparent.h index 00c60b5..6dbe0c1 100644..100755 --- a/linden/indra/llplugin/llpluginprocessparent.h +++ b/linden/indra/llplugin/llpluginprocessparent.h | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llpluginprocessparent.h | 2 | * @file llpluginprocessparent.h |
3 | * @brief LLPluginProcessParent handles the parent side of the external-process plugin API. | 3 | * @brief LLPluginProcessParent handles the parent side of the external-process plugin API. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #ifndef LL_LLPLUGINPROCESSPARENT_H | 35 | #ifndef LL_LLPLUGINPROCESSPARENT_H |
diff --git a/linden/indra/llplugin/llpluginsharedmemory.cpp b/linden/indra/llplugin/llpluginsharedmemory.cpp index c946619..a475f12 100644..100755 --- a/linden/indra/llplugin/llpluginsharedmemory.cpp +++ b/linden/indra/llplugin/llpluginsharedmemory.cpp | |||
@@ -1,10 +1,11 @@ | |||
1 | /** | 1 | /** |
2 | * @file llpluginsharedmemory.cpp | 2 | * @file llpluginsharedmemory.cpp |
3 | * @brief LLPluginSharedMemory manages a shared memory segment for use by the LLPlugin API. | 3 | * LLPluginSharedMemory manages a shared memory segment for use by the LLPlugin API. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
diff --git a/linden/indra/llplugin/llpluginsharedmemory.h b/linden/indra/llplugin/llpluginsharedmemory.h index 2dc550e..1d23cbe 100644..100755 --- a/linden/indra/llplugin/llpluginsharedmemory.h +++ b/linden/indra/llplugin/llpluginsharedmemory.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /** | 1 | /** |
2 | * @file llpluginsharedmemory.h | 2 | * @file llpluginsharedmemory.h |
3 | * @brief LLPluginSharedMemory manages a shared memory segment for use by the LLPlugin API. | ||
4 | * | 3 | * |
4 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 7 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +28,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 29 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 30 | * $/LicenseInfo$ |
31 | * @endcond | ||
31 | */ | 32 | */ |
32 | 33 | ||
33 | #ifndef LL_LLPLUGINSHAREDMEMORY_H | 34 | #ifndef LL_LLPLUGINSHAREDMEMORY_H |
diff --git a/linden/indra/llplugin/slplugin/CMakeLists.txt b/linden/indra/llplugin/slplugin/CMakeLists.txt index 4a7d670..4a7d670 100644..100755 --- a/linden/indra/llplugin/slplugin/CMakeLists.txt +++ b/linden/indra/llplugin/slplugin/CMakeLists.txt | |||
diff --git a/linden/indra/llplugin/slplugin/slplugin.cpp b/linden/indra/llplugin/slplugin/slplugin.cpp index fa3924b..526734a 100644..100755 --- a/linden/indra/llplugin/slplugin/slplugin.cpp +++ b/linden/indra/llplugin/slplugin/slplugin.cpp | |||
@@ -1,10 +1,12 @@ | |||
1 | /** | 1 | /** |
2 | * @file slplugin.cpp | 2 | * @file slplugin.cpp |
3 | * @brief Loader shell for plugins, intended to be launched by the plugin host application, which directly loads a plugin dynamic library. | 3 | * @brief Loader shell for plugins, intended to be launched by the plugin host application, which directly loads a plugin dynamic library. |
4 | * | 4 | * |
5 | * @cond | ||
6 | * | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 7 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 8 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 9 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 10 | * |
9 | * Second Life Viewer Source Code | 11 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 12 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +30,8 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 30 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 31 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 32 | * $/LicenseInfo$ |
33 | * | ||
34 | * @endcond | ||
31 | */ | 35 | */ |
32 | 36 | ||
33 | 37 | ||
@@ -49,15 +53,15 @@ | |||
49 | 53 | ||
50 | /* | 54 | /* |
51 | On Mac OS, since we call WaitNextEvent, this process will show up in the dock unless we set the LSBackgroundOnly flag in the Info.plist. | 55 | On Mac OS, since we call WaitNextEvent, this process will show up in the dock unless we set the LSBackgroundOnly flag in the Info.plist. |
52 | 56 | ||
53 | Normally non-bundled binaries don't have an info.plist file, but it's possible to embed one in the binary by adding this to the linker flags: | 57 | Normally non-bundled binaries don't have an info.plist file, but it's possible to embed one in the binary by adding this to the linker flags: |
54 | 58 | ||
55 | -sectcreate __TEXT __info_plist /path/to/slplugin_info.plist | 59 | -sectcreate __TEXT __info_plist /path/to/slplugin_info.plist |
56 | 60 | ||
57 | which means adding this to the gcc flags: | 61 | which means adding this to the gcc flags: |
58 | 62 | ||
59 | -Wl,-sectcreate,__TEXT,__info_plist,/path/to/slplugin_info.plist | 63 | -Wl,-sectcreate,__TEXT,__info_plist,/path/to/slplugin_info.plist |
60 | 64 | ||
61 | */ | 65 | */ |
62 | 66 | ||
63 | #if LL_DARWIN || LL_LINUX | 67 | #if LL_DARWIN || LL_LINUX |
@@ -68,7 +72,7 @@ static void crash_handler(int sig) | |||
68 | // TODO: add our own crash reporting | 72 | // TODO: add our own crash reporting |
69 | _exit(1); | 73 | _exit(1); |
70 | } | 74 | } |
71 | #endif | 75 | #endif |
72 | 76 | ||
73 | #if LL_WINDOWS | 77 | #if LL_WINDOWS |
74 | #include <windows.h> | 78 | #include <windows.h> |
@@ -81,7 +85,7 @@ LONG WINAPI myWin32ExceptionHandler( struct _EXCEPTION_POINTERS* exception_infop | |||
81 | //std::cerr << "intercepted an unhandled exception and will exit immediately." << std::endl; | 85 | //std::cerr << "intercepted an unhandled exception and will exit immediately." << std::endl; |
82 | 86 | ||
83 | // TODO: replace exception handler before we exit? | 87 | // TODO: replace exception handler before we exit? |
84 | return EXCEPTION_EXECUTE_HANDLER; | 88 | return EXCEPTION_EXECUTE_HANDLER; |
85 | } | 89 | } |
86 | 90 | ||
87 | // Taken from : http://blog.kalmbachnet.de/?postid=75 | 91 | // Taken from : http://blog.kalmbachnet.de/?postid=75 |
@@ -153,7 +157,7 @@ bool checkExceptionHandler() | |||
153 | if (prev_filter == NULL) | 157 | if (prev_filter == NULL) |
154 | { | 158 | { |
155 | ok = FALSE; | 159 | ok = FALSE; |
156 | if (myWin32ExceptionHandler == NULL) | 160 | if (NULL == myWin32ExceptionHandler) |
157 | { | 161 | { |
158 | LL_WARNS("AppInit") << "Exception handler uninitialized." << LL_ENDL; | 162 | LL_WARNS("AppInit") << "Exception handler uninitialized." << LL_ENDL; |
159 | } | 163 | } |
@@ -167,7 +171,7 @@ bool checkExceptionHandler() | |||
167 | } | 171 | } |
168 | #endif | 172 | #endif |
169 | 173 | ||
170 | // If this application on Windows platform is a console application, a console is always | 174 | // If this application on Windows platform is a console application, a console is always |
171 | // created which is bad. Making it a Windows "application" via CMake settings but not | 175 | // created which is bad. Making it a Windows "application" via CMake settings but not |
172 | // adding any code to explicitly create windows does the right thing. | 176 | // adding any code to explicitly create windows does the right thing. |
173 | #if LL_WINDOWS | 177 | #if LL_WINDOWS |
@@ -178,7 +182,7 @@ int main(int argc, char **argv) | |||
178 | { | 182 | { |
179 | ll_init_apr(); | 183 | ll_init_apr(); |
180 | 184 | ||
181 | // Set up llerror logging | 185 | // Set up llerror logging |
182 | { | 186 | { |
183 | LLError::initForApplication("."); | 187 | LLError::initForApplication("."); |
184 | LLError::setDefaultLevel(LLError::LEVEL_INFO); | 188 | LLError::setDefaultLevel(LLError::LEVEL_INFO); |
@@ -191,14 +195,14 @@ int main(int argc, char **argv) | |||
191 | { | 195 | { |
192 | LL_ERRS("slplugin") << "usage: " << "SLPlugin" << " launcher_port" << LL_ENDL; | 196 | LL_ERRS("slplugin") << "usage: " << "SLPlugin" << " launcher_port" << LL_ENDL; |
193 | }; | 197 | }; |
194 | 198 | ||
195 | U32 port = 0; | 199 | U32 port = 0; |
196 | if(!LLStringUtil::convertToU32(lpCmdLine, port)) | 200 | if(!LLStringUtil::convertToU32(lpCmdLine, port)) |
197 | { | 201 | { |
198 | LL_ERRS("slplugin") << "port number must be numeric" << LL_ENDL; | 202 | LL_ERRS("slplugin") << "port number must be numeric" << LL_ENDL; |
199 | }; | 203 | }; |
200 | 204 | ||
201 | // Insert our exception handler into the system so this plugin doesn't | 205 | // Insert our exception handler into the system so this plugin doesn't |
202 | // display a crash message if something bad happens. The host app will | 206 | // display a crash message if something bad happens. The host app will |
203 | // see the missing heartbeat and log appropriately. | 207 | // see the missing heartbeat and log appropriately. |
204 | initExceptionHandler(); | 208 | initExceptionHandler(); |
@@ -207,7 +211,7 @@ int main(int argc, char **argv) | |||
207 | { | 211 | { |
208 | LL_ERRS("slplugin") << "usage: " << argv[0] << " launcher_port" << LL_ENDL; | 212 | LL_ERRS("slplugin") << "usage: " << argv[0] << " launcher_port" << LL_ENDL; |
209 | } | 213 | } |
210 | 214 | ||
211 | U32 port = 0; | 215 | U32 port = 0; |
212 | if(!LLStringUtil::convertToU32(argv[1], port)) | 216 | if(!LLStringUtil::convertToU32(argv[1], port)) |
213 | { | 217 | { |
@@ -228,17 +232,17 @@ int main(int argc, char **argv) | |||
228 | LLPluginProcessChild *plugin = new LLPluginProcessChild(); | 232 | LLPluginProcessChild *plugin = new LLPluginProcessChild(); |
229 | 233 | ||
230 | plugin->init(port); | 234 | plugin->init(port); |
231 | 235 | ||
232 | LLTimer timer; | 236 | LLTimer timer; |
233 | timer.start(); | 237 | timer.start(); |
234 | 238 | ||
235 | #if LL_WINDOWS | 239 | #if LL_WINDOWS |
236 | checkExceptionHandler(); | 240 | checkExceptionHandler(); |
237 | #endif | 241 | #endif |
238 | 242 | ||
239 | while(!plugin->isDone()) | 243 | while(!plugin->isDone()) |
240 | { | 244 | { |
241 | timer.reset(); | 245 | timer.reset(); |
242 | plugin->idle(); | 246 | plugin->idle(); |
243 | #if LL_DARWIN | 247 | #if LL_DARWIN |
244 | { | 248 | { |
@@ -249,7 +253,7 @@ int main(int argc, char **argv) | |||
249 | #endif | 253 | #endif |
250 | F64 elapsed = timer.getElapsedTimeF64(); | 254 | F64 elapsed = timer.getElapsedTimeF64(); |
251 | F64 remaining = plugin->getSleepTime() - elapsed; | 255 | F64 remaining = plugin->getSleepTime() - elapsed; |
252 | 256 | ||
253 | if(remaining <= 0.0f) | 257 | if(remaining <= 0.0f) |
254 | { | 258 | { |
255 | // We've already used our full allotment. | 259 | // We've already used our full allotment. |
@@ -262,26 +266,26 @@ int main(int argc, char **argv) | |||
262 | { | 266 | { |
263 | 267 | ||
264 | // LL_INFOS("slplugin") << "elapsed = " << elapsed * 1000.0f << " ms, remaining = " << remaining * 1000.0f << " ms, sleeping for " << remaining * 1000.0f << " ms" << LL_ENDL; | 268 | // LL_INFOS("slplugin") << "elapsed = " << elapsed * 1000.0f << " ms, remaining = " << remaining * 1000.0f << " ms, sleeping for " << remaining * 1000.0f << " ms" << LL_ENDL; |
265 | // timer.reset(); | 269 | // timer.reset(); |
266 | 270 | ||
267 | // This also services the network as needed. | 271 | // This also services the network as needed. |
268 | plugin->sleep(remaining); | 272 | plugin->sleep(remaining); |
269 | 273 | ||
270 | // LL_INFOS("slplugin") << "slept for "<< timer.getElapsedTimeF64() * 1000.0f << " ms" << LL_ENDL; | 274 | // LL_INFOS("slplugin") << "slept for "<< timer.getElapsedTimeF64() * 1000.0f << " ms" << LL_ENDL; |
271 | } | 275 | } |
272 | 276 | ||
273 | #if LL_WINDOWS | 277 | #if LL_WINDOWS |
274 | // More agressive checking of interfering exception handlers. | 278 | // More agressive checking of interfering exception handlers. |
275 | // Doesn't appear to be required so far - even for plugins | 279 | // Doesn't appear to be required so far - even for plugins |
276 | // that do crash with a single call to the intercept | 280 | // that do crash with a single call to the intercept |
277 | // exception handler such as QuickTime. | 281 | // exception handler such as QuickTime. |
278 | //checkExceptionHandler(); | 282 | //checkExceptionHandler(); |
279 | #endif | 283 | #endif |
280 | } | 284 | } |
281 | 285 | ||
282 | delete plugin; | 286 | delete plugin; |
283 | 287 | ||
284 | ll_cleanup_apr(); | 288 | ll_cleanup_apr(); |
285 | 289 | ||
286 | return 0; | 290 | return 0; |
287 | } | 291 | } |
diff --git a/linden/indra/llplugin/slplugin/slplugin_info.plist b/linden/indra/llplugin/slplugin/slplugin_info.plist index b1daf87..b1daf87 100644..100755 --- a/linden/indra/llplugin/slplugin/slplugin_info.plist +++ b/linden/indra/llplugin/slplugin/slplugin_info.plist | |||
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 | ||
41 | class LLSplashScreen; | 42 | class 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 | |||
211 | protected: | 215 | protected: |
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 | ||
3220 | BOOL LLWindowMacOSX::dialog_color_picker ( F32 *r, F32 *g, F32 *b) | 3220 | BOOL 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 | |||
120 | protected: | 124 | protected: |
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 | ||
255 | static SDL_Surface *Load_BMP_Resource(const char *basename) | 259 | static 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 | ||
2230 | BOOL 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 | */ | ||
2239 | LLSD 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 | |||
2267 | BOOL 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 | |
210 | private: | 212 | private: |
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 | */ | ||
3059 | LLSD 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 | ||
3056 | BOOL LLWindowWin32::dialog_color_picker ( F32 *r, F32 *g, F32 *b ) | 3069 | BOOL 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 | ||
diff --git a/linden/indra/media_plugins/CMakeLists.txt b/linden/indra/media_plugins/CMakeLists.txt index cc03d9c..cc03d9c 100644..100755 --- a/linden/indra/media_plugins/CMakeLists.txt +++ b/linden/indra/media_plugins/CMakeLists.txt | |||
diff --git a/linden/indra/media_plugins/base/CMakeLists.txt b/linden/indra/media_plugins/base/CMakeLists.txt index a3ee02e..a3ee02e 100644..100755 --- a/linden/indra/media_plugins/base/CMakeLists.txt +++ b/linden/indra/media_plugins/base/CMakeLists.txt | |||
diff --git a/linden/indra/media_plugins/base/media_plugin_base.cpp b/linden/indra/media_plugins/base/media_plugin_base.cpp index 4d5e374..baae68c 100644..100755 --- a/linden/indra/media_plugins/base/media_plugin_base.cpp +++ b/linden/indra/media_plugins/base/media_plugin_base.cpp | |||
@@ -4,9 +4,10 @@ | |||
4 | * | 4 | * |
5 | * All plugins should be a subclass of MediaPluginBase. | 5 | * All plugins should be a subclass of MediaPluginBase. |
6 | * | 6 | * |
7 | * @cond | ||
7 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 8 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
8 | * | 9 | * |
9 | * Copyright (c) 2008-2009, Linden Research, Inc. | 10 | * Copyright (c) 2008-2010, Linden Research, Inc. |
10 | * | 11 | * |
11 | * Second Life Viewer Source Code | 12 | * Second Life Viewer Source Code |
12 | * The source code in this file ("Source Code") is provided by Linden Lab | 13 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -30,6 +31,7 @@ | |||
30 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 31 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
31 | * COMPLETENESS OR PERFORMANCE. | 32 | * COMPLETENESS OR PERFORMANCE. |
32 | * $/LicenseInfo$ | 33 | * $/LicenseInfo$ |
34 | * @endcond | ||
33 | */ | 35 | */ |
34 | 36 | ||
35 | #include "linden_common.h" | 37 | #include "linden_common.h" |
diff --git a/linden/indra/media_plugins/base/media_plugin_base.exp b/linden/indra/media_plugins/base/media_plugin_base.exp index 1e27d1f..d8c7bb7 100644..100755 --- a/linden/indra/media_plugins/base/media_plugin_base.exp +++ b/linden/indra/media_plugins/base/media_plugin_base.exp | |||
@@ -1 +1,2 @@ | |||
1 | _LLPluginInitEntryPoint | 1 | _LLPluginInitEntryPoint |
2 | |||
diff --git a/linden/indra/media_plugins/base/media_plugin_base.h b/linden/indra/media_plugins/base/media_plugin_base.h index 24198af..8311e66 100644..100755 --- a/linden/indra/media_plugins/base/media_plugin_base.h +++ b/linden/indra/media_plugins/base/media_plugin_base.h | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file media_plugin_base.h | 2 | * @file media_plugin_base.h |
3 | * @brief Media plugin base class for LLMedia API plugin system | 3 | * @brief Media plugin base class for LLMedia API plugin system |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
diff --git a/linden/indra/media_plugins/example/CMakeLists.txt b/linden/indra/media_plugins/example/CMakeLists.txt index b074a1d..6d14c1b 100644..100755 --- a/linden/indra/media_plugins/example/CMakeLists.txt +++ b/linden/indra/media_plugins/example/CMakeLists.txt | |||
@@ -14,7 +14,7 @@ include(PluginAPI) | |||
14 | include(MediaPluginBase) | 14 | include(MediaPluginBase) |
15 | include(FindOpenGL) | 15 | include(FindOpenGL) |
16 | 16 | ||
17 | include(ExamplePlugin) | 17 | #awfixme include(ExamplePlugin) |
18 | 18 | ||
19 | include_directories( | 19 | include_directories( |
20 | ${LLPLUGIN_INCLUDE_DIRS} | 20 | ${LLPLUGIN_INCLUDE_DIRS} |
diff --git a/linden/indra/media_plugins/example/media_plugin_example.cpp b/linden/indra/media_plugins/example/media_plugin_example.cpp index 99e0199..83abae0 100644..100755 --- a/linden/indra/media_plugins/example/media_plugin_example.cpp +++ b/linden/indra/media_plugins/example/media_plugin_example.cpp | |||
@@ -2,31 +2,34 @@ | |||
2 | * @file media_plugin_example.cpp | 2 | * @file media_plugin_example.cpp |
3 | * @brief Example plugin for LLMedia API plugin system | 3 | * @brief Example plugin for LLMedia API plugin system |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
11 | * to you under the terms of the GNU General Public License, version 2.0 | 12 | * to you under the terms of the GNU General Public License, version 2.0 |
12 | * ("GPL"), unless you have obtained a separate licensing agreement | 13 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 14 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 15 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlife.com/developers/opensource/gplv2 | 16 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 17 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 18 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 19 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 20 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlife.com/developers/opensource/flossexception | 21 | * online at |
21 | * | 22 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception |
23 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | 24 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 25 | * that you have read and understood your obligations described above, |
24 | * and agree to abide by those obligations. | 26 | * and agree to abide by those obligations. |
25 | * | 27 | * |
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 28 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
28 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
29 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
30 | */ | 33 | */ |
31 | 34 | ||
32 | #include "linden_common.h" | 35 | #include "linden_common.h" |
diff --git a/linden/indra/media_plugins/gstreamer010/CMakeLists.txt b/linden/indra/media_plugins/gstreamer010/CMakeLists.txt index a3a32d8..3b73e04 100644..100755 --- a/linden/indra/media_plugins/gstreamer010/CMakeLists.txt +++ b/linden/indra/media_plugins/gstreamer010/CMakeLists.txt | |||
@@ -42,12 +42,12 @@ set(media_plugin_gstreamer010_HEADER_FILES | |||
42 | llmediaimplgstreamertriviallogging.h | 42 | llmediaimplgstreamertriviallogging.h |
43 | ) | 43 | ) |
44 | 44 | ||
45 | #awfixme if (${CXX_VERSION_NUMBER} MATCHES "4[23].") | 45 | if (${CXX_VERSION_NUMBER} MATCHES "4[23].") |
46 | # Work around a bad interaction between broken gstreamer headers and | 46 | # Work around a bad interaction between broken gstreamer headers and |
47 | # g++ 4.3's increased strictness. | 47 | # g++ 4.3's increased strictness. |
48 | set_source_files_properties(llmediaimplgstreamervidplug.cpp PROPERTIES | 48 | set_source_files_properties(llmediaimplgstreamervidplug.cpp PROPERTIES |
49 | COMPILE_FLAGS -Wno-write-strings) | 49 | COMPILE_FLAGS -Wno-write-strings) |
50 | #awfixme endif (${CXX_VERSION_NUMBER} MATCHES "4[23].") | 50 | endif (${CXX_VERSION_NUMBER} MATCHES "4[23].") |
51 | 51 | ||
52 | add_library(media_plugin_gstreamer010 | 52 | add_library(media_plugin_gstreamer010 |
53 | SHARED | 53 | SHARED |
diff --git a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h index ef41736..6920c3b 100644..100755 --- a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h +++ b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h | |||
@@ -3,9 +3,10 @@ | |||
3 | * @author Tofu Linden | 3 | * @author Tofu Linden |
4 | * @brief implementation that supports media playback via GStreamer. | 4 | * @brief implementation that supports media playback via GStreamer. |
5 | * | 5 | * |
6 | * @cond | ||
6 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 7 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
7 | * | 8 | * |
8 | * Copyright (c) 2007-2009, Linden Research, Inc. | 9 | * Copyright (c) 2007-2010, Linden Research, Inc. |
9 | * | 10 | * |
10 | * Second Life Viewer Source Code | 11 | * Second Life Viewer Source Code |
11 | * The source code in this file ("Source Code") is provided by Linden Lab | 12 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -29,6 +30,7 @@ | |||
29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 30 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
30 | * COMPLETENESS OR PERFORMANCE. | 31 | * COMPLETENESS OR PERFORMANCE. |
31 | * $/LicenseInfo$ | 32 | * $/LicenseInfo$ |
33 | * @endcond | ||
32 | */ | 34 | */ |
33 | 35 | ||
34 | // header guard | 36 | // header guard |
diff --git a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp index cc52232..28960ac 100644..100755 --- a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp +++ b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llmediaimplgstreamer_syms.cpp | 2 | * @file llmediaimplgstreamer_syms.cpp |
3 | * @brief dynamic GStreamer symbol-grabbing code | 3 | * @brief dynamic GStreamer symbol-grabbing code |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2007-2009, Linden Research, Inc. | 8 | * Copyright (c) 2007-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #if LL_GSTREAMER010_ENABLED | 35 | #if LL_GSTREAMER010_ENABLED |
diff --git a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h index ee7473d..7955898 100644..100755 --- a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h +++ b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llmediaimplgstreamer_syms.h | 2 | * @file llmediaimplgstreamer_syms.h |
3 | * @brief dynamic GStreamer symbol-grabbing code | 3 | * @brief dynamic GStreamer symbol-grabbing code |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2007-2009, Linden Research, Inc. | 8 | * Copyright (c) 2007-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
diff --git a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc index b33e593..b33e593 100644..100755 --- a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc +++ b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_raw.inc | |||
diff --git a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_rawv.inc b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_rawv.inc index 14fbcb4..14fbcb4 100644..100755 --- a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_rawv.inc +++ b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms_rawv.inc | |||
diff --git a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h index 04976b9..27f0eed 100644..100755 --- a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h +++ b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llmediaimplgstreamertriviallogging.h | 2 | * @file llmediaimplgstreamertriviallogging.h |
3 | * @brief minimal logging utilities. | 3 | * @brief minimal logging utilities. |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2009&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2009&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2009, Linden Research, Inc. | 8 | * Copyright (c) 2009-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #ifndef __LLMEDIAIMPLGSTREAMERTRIVIALLOGGING_H__ | 35 | #ifndef __LLMEDIAIMPLGSTREAMERTRIVIALLOGGING_H__ |
diff --git a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp index ef8ff58..2b10a2a 100644..100755 --- a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp +++ b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp | |||
@@ -1,10 +1,11 @@ | |||
1 | /** | 1 | /** |
2 | * @file llmediaimplgstreamervidplug.cpp | 2 | * @file llmediaimplgstreamervidplug.h |
3 | * @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl | 3 | * @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2007-2009, Linden Research, Inc. | 8 | * Copyright (c) 2007-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #if LL_GSTREAMER010_ENABLED | 35 | #if LL_GSTREAMER010_ENABLED |
diff --git a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h index 8cdc72d..fad80cb 100644..100755 --- a/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h +++ b/linden/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file llmediaimplgstreamervidplug.h | 2 | * @file llmediaimplgstreamervidplug.h |
3 | * @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl | 3 | * @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2007-2009, Linden Research, Inc. | 8 | * Copyright (c) 2007-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #ifndef __GST_SLVIDEO_H__ | 35 | #ifndef __GST_SLVIDEO_H__ |
diff --git a/linden/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp b/linden/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp index 5b3152d..82e6fdc 100644..100755 --- a/linden/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp +++ b/linden/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file media_plugin_gstreamer010.cpp | 2 | * @file media_plugin_gstreamer010.cpp |
3 | * @brief GStreamer-0.10 plugin for LLMedia API plugin system | 3 | * @brief GStreamer-0.10 plugin for LLMedia API plugin system |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2007-2009, Linden Research, Inc. | 8 | * Copyright (c) 2007-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
diff --git a/linden/indra/media_plugins/quicktime/CMakeLists.txt b/linden/indra/media_plugins/quicktime/CMakeLists.txt index df191f5..df191f5 100644..100755 --- a/linden/indra/media_plugins/quicktime/CMakeLists.txt +++ b/linden/indra/media_plugins/quicktime/CMakeLists.txt | |||
diff --git a/linden/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/linden/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index 6c8c41d..9b4c531 100644..100755 --- a/linden/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/linden/indra/media_plugins/quicktime/media_plugin_quicktime.cpp | |||
@@ -1,10 +1,11 @@ | |||
1 | /** | 1 | /** |
2 | * @file media_plugin_quicktime.cpp | 2 | * @file media_plugin_quicktime.cpp |
3 | * @brief QuickTime plugin for LLMedia API plugin system | 3 | * @brief QuickTime plugin for LLMedia API plugin system |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,6 +29,7 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include "linden_common.h" | 35 | #include "linden_common.h" |
@@ -102,14 +104,14 @@ private: | |||
102 | message.setValueS32("top", top); | 104 | message.setValueS32("top", top); |
103 | message.setValueS32("right", right); | 105 | message.setValueS32("right", right); |
104 | message.setValueS32("bottom", bottom); | 106 | message.setValueS32("bottom", bottom); |
105 | 107 | ||
106 | if(mMovieHandle) | 108 | if(mMovieHandle) |
107 | { | 109 | { |
108 | message.setValueReal("current_time", getCurrentTime()); | 110 | message.setValueReal("current_time", getCurrentTime()); |
109 | message.setValueReal("duration", getDuration()); | 111 | message.setValueReal("duration", getDuration()); |
110 | message.setValueReal("current_rate", Fix2X(GetMovieRate(mMovieHandle))); | 112 | message.setValueReal("current_rate", Fix2X(GetMovieRate(mMovieHandle))); |
111 | } | 113 | } |
112 | 114 | ||
113 | sendMessage(message); | 115 | sendMessage(message); |
114 | } | 116 | } |
115 | 117 | ||
@@ -117,16 +119,16 @@ private: | |||
117 | static Rect rectFromSize(int width, int height) | 119 | static Rect rectFromSize(int width, int height) |
118 | { | 120 | { |
119 | Rect result; | 121 | Rect result; |
120 | 122 | ||
121 | 123 | ||
122 | result.left = 0; | 124 | result.left = 0; |
123 | result.top = 0; | 125 | result.top = 0; |
124 | result.right = width; | 126 | result.right = width; |
125 | result.bottom = height; | 127 | result.bottom = height; |
126 | 128 | ||
127 | return result; | 129 | return result; |
128 | } | 130 | } |
129 | 131 | ||
130 | Fixed getPlayRate(void) | 132 | Fixed getPlayRate(void) |
131 | { | 133 | { |
132 | Fixed result; | 134 | Fixed result; |
@@ -145,25 +147,27 @@ private: | |||
145 | { | 147 | { |
146 | result = X2Fix(mPlayRate); | 148 | result = X2Fix(mPlayRate); |
147 | } | 149 | } |
148 | 150 | ||
149 | return result; | 151 | return result; |
150 | } | 152 | } |
151 | 153 | ||
152 | void load( const std::string url ) | 154 | void load( const std::string url ) |
153 | { | 155 | { |
156 | |||
154 | if ( url.empty() ) | 157 | if ( url.empty() ) |
155 | return; | 158 | return; |
156 | 159 | ||
157 | // Stop and unload any existing movie before starting another one. | 160 | // Stop and unload any existing movie before starting another one. |
158 | unload(); | 161 | unload(); |
159 | 162 | ||
160 | setStatus(STATUS_LOADING); | 163 | setStatus(STATUS_LOADING); |
161 | 164 | ||
162 | //In case std::string::c_str() makes a copy of the url data, | 165 | //In case std::string::c_str() makes a copy of the url data, |
163 | //make sure there is memory to hold it before allocating memory for handle. | 166 | //make sure there is memory to hold it before allocating memory for handle. |
164 | //if fails, NewHandleClear(...) should return NULL. | 167 | //if fails, NewHandleClear(...) should return NULL. |
165 | const char* url_string = url.c_str() ; | 168 | const char* url_string = url.c_str() ; |
166 | Handle handle = NewHandleClear( ( Size )( url.length() + 1 ) ); | 169 | Handle handle = NewHandleClear( ( Size )( url.length() + 1 ) ); |
170 | |||
167 | if ( NULL == handle || noErr != MemError() || NULL == *handle ) | 171 | if ( NULL == handle || noErr != MemError() || NULL == *handle ) |
168 | { | 172 | { |
169 | setStatus(STATUS_ERROR); | 173 | setStatus(STATUS_ERROR); |
@@ -202,7 +206,7 @@ private: | |||
202 | SetMovieDrawingCompleteProc( mMovieHandle, movieDrawingCallWhenChanged, movieDrawingCompleteCallback, ( long )this ); | 206 | SetMovieDrawingCompleteProc( mMovieHandle, movieDrawingCallWhenChanged, movieDrawingCompleteCallback, ( long )this ); |
203 | 207 | ||
204 | setStatus(STATUS_LOADED); | 208 | setStatus(STATUS_LOADED); |
205 | 209 | ||
206 | sizeChanged(); | 210 | sizeChanged(); |
207 | }; | 211 | }; |
208 | 212 | ||
@@ -239,7 +243,7 @@ private: | |||
239 | DisposeGWorld( mGWorldHandle ); | 243 | DisposeGWorld( mGWorldHandle ); |
240 | mGWorldHandle = NULL; | 244 | mGWorldHandle = NULL; |
241 | }; | 245 | }; |
242 | 246 | ||
243 | setStatus(STATUS_NONE); | 247 | setStatus(STATUS_NONE); |
244 | 248 | ||
245 | return true; | 249 | return true; |
@@ -249,7 +253,7 @@ private: | |||
249 | { | 253 | { |
250 | unload(); | 254 | unload(); |
251 | load( url ); | 255 | load( url ); |
252 | 256 | ||
253 | return true; | 257 | return true; |
254 | }; | 258 | }; |
255 | 259 | ||
@@ -257,7 +261,7 @@ private: | |||
257 | { | 261 | { |
258 | if ( ! mMovieHandle ) | 262 | if ( ! mMovieHandle ) |
259 | return false; | 263 | return false; |
260 | 264 | ||
261 | // Check to see whether the movie's natural size has updated | 265 | // Check to see whether the movie's natural size has updated |
262 | { | 266 | { |
263 | int width, height; | 267 | int width, height; |
@@ -275,14 +279,14 @@ private: | |||
275 | //std::cerr << "<--- Sending size change request to application with name: " << mTextureSegmentName << " - size is " << width << " x " << height << std::endl; | 279 | //std::cerr << "<--- Sending size change request to application with name: " << mTextureSegmentName << " - size is " << width << " x " << height << std::endl; |
276 | } | 280 | } |
277 | } | 281 | } |
278 | 282 | ||
279 | // sanitize destination size | 283 | // sanitize destination size |
280 | Rect dest_rect = rectFromSize(mWidth, mHeight); | 284 | Rect dest_rect = rectFromSize(mWidth, mHeight); |
281 | 285 | ||
282 | // media depth won't change | 286 | // media depth won't change |
283 | int depth_bits = mDepth * 8; | 287 | int depth_bits = mDepth * 8; |
284 | long rowbytes = mDepth * mTextureWidth; | 288 | long rowbytes = mDepth * mTextureWidth; |
285 | 289 | ||
286 | GWorldPtr old_gworld_handle = mGWorldHandle; | 290 | GWorldPtr old_gworld_handle = mGWorldHandle; |
287 | 291 | ||
288 | if(mPixels != NULL) | 292 | if(mPixels != NULL) |
@@ -314,7 +318,7 @@ private: | |||
314 | { | 318 | { |
315 | DisposeGWorld( old_gworld_handle ); | 319 | DisposeGWorld( old_gworld_handle ); |
316 | } | 320 | } |
317 | 321 | ||
318 | // Set up the movie display matrix | 322 | // Set up the movie display matrix |
319 | { | 323 | { |
320 | // scale movie to fit rect and invert vertically to match opengl image format | 324 | // scale movie to fit rect and invert vertically to match opengl image format |
@@ -327,7 +331,7 @@ private: | |||
327 | ScaleMatrix( &transform, X2Fix( scaleX ), X2Fix( scaleY ), X2Fix( centerX ), X2Fix( centerY ) ); | 331 | ScaleMatrix( &transform, X2Fix( scaleX ), X2Fix( scaleY ), X2Fix( centerX ), X2Fix( centerY ) ); |
328 | SetMovieMatrix( mMovieHandle, &transform ); | 332 | SetMovieMatrix( mMovieHandle, &transform ); |
329 | } | 333 | } |
330 | 334 | ||
331 | // update movie controller | 335 | // update movie controller |
332 | if ( mMovieController ) | 336 | if ( mMovieController ) |
333 | { | 337 | { |
@@ -345,7 +349,6 @@ private: | |||
345 | 349 | ||
346 | return true; | 350 | return true; |
347 | } | 351 | } |
348 | |||
349 | static Boolean mcActionFilterCallBack( MovieController mc, short action, void *params, long ref ) | 352 | static Boolean mcActionFilterCallBack( MovieController mc, short action, void *params, long ref ) |
350 | { | 353 | { |
351 | Boolean result = false; | 354 | Boolean result = false; |
@@ -355,9 +358,9 @@ private: | |||
355 | switch( action ) | 358 | switch( action ) |
356 | { | 359 | { |
357 | // handle window resizing | 360 | // handle window resizing |
358 | case mcActionControllerSizeChanged: | 361 | case mcActionControllerSizeChanged: |
359 | // Ensure that the movie draws correctly at the new size | 362 | // Ensure that the movie draws correctly at the new size |
360 | self->sizeChanged(); | 363 | self->sizeChanged(); |
361 | break; | 364 | break; |
362 | 365 | ||
363 | // Block any movie controller actions that open URLs. | 366 | // Block any movie controller actions that open URLs. |
@@ -386,6 +389,7 @@ private: | |||
386 | // self->updateQuickTime(); | 389 | // self->updateQuickTime(); |
387 | // TODO ^^^ | 390 | // TODO ^^^ |
388 | 391 | ||
392 | |||
389 | if ( self->mWidth > 0 && self->mHeight > 0 ) | 393 | if ( self->mWidth > 0 && self->mHeight > 0 ) |
390 | self->setDirty( 0, 0, self->mWidth, self->mHeight ); | 394 | self->setDirty( 0, 0, self->mWidth, self->mHeight ); |
391 | 395 | ||
@@ -434,7 +438,7 @@ private: | |||
434 | MCDoAction( mMovieController, mcActionPlay, (void*)rate ); | 438 | MCDoAction( mMovieController, mcActionPlay, (void*)rate ); |
435 | rewind(); | 439 | rewind(); |
436 | }; | 440 | }; |
437 | 441 | ||
438 | MCDoAction( mMovieController, mcActionPrerollAndPlay, (void*)getPlayRate() ); | 442 | MCDoAction( mMovieController, mcActionPrerollAndPlay, (void*)getPlayRate() ); |
439 | MCDoAction( mMovieController, mcActionSetVolume, (void*)mCurVolume ); | 443 | MCDoAction( mMovieController, mcActionSetVolume, (void*)mCurVolume ); |
440 | setStatus(STATUS_PLAYING); | 444 | setStatus(STATUS_PLAYING); |
@@ -462,7 +466,7 @@ private: | |||
462 | if ( mCommand == COMMAND_PAUSE ) | 466 | if ( mCommand == COMMAND_PAUSE ) |
463 | { | 467 | { |
464 | if ( mStatus == STATUS_PLAYING ) | 468 | if ( mStatus == STATUS_PLAYING ) |
465 | { | 469 | { |
466 | if ( GetMovieLoadState( mMovieHandle ) >= kMovieLoadStatePlaythroughOK ) | 470 | if ( GetMovieLoadState( mMovieHandle ) >= kMovieLoadStatePlaythroughOK ) |
467 | { | 471 | { |
468 | Fixed rate = X2Fix( 0.0 ); | 472 | Fixed rate = X2Fix( 0.0 ); |
@@ -495,7 +499,7 @@ private: | |||
495 | void getMovieNaturalSize(int *movie_width, int *movie_height) | 499 | void getMovieNaturalSize(int *movie_width, int *movie_height) |
496 | { | 500 | { |
497 | Rect rect; | 501 | Rect rect; |
498 | 502 | ||
499 | GetMovieNaturalBoundsRect( mMovieHandle, &rect ); | 503 | GetMovieNaturalBoundsRect( mMovieHandle, &rect ); |
500 | 504 | ||
501 | int width = ( rect.right - rect.left ); | 505 | int width = ( rect.right - rect.left ); |
@@ -518,7 +522,7 @@ private: | |||
518 | *movie_width = width; | 522 | *movie_width = width; |
519 | *movie_height = height; | 523 | *movie_height = height; |
520 | } | 524 | } |
521 | 525 | ||
522 | void updateQuickTime(int milliseconds) | 526 | void updateQuickTime(int milliseconds) |
523 | { | 527 | { |
524 | if ( ! mMovieHandle ) | 528 | if ( ! mMovieHandle ) |
@@ -721,8 +725,8 @@ private: | |||
721 | return false; | 725 | return false; |
722 | 726 | ||
723 | // allocate some space and grab it | 727 | // allocate some space and grab it |
724 | UInt8* item_data = new UInt8( size + 1 ); | 728 | UInt8* item_data = new UInt8[ size + 1 ]; |
725 | memset( item_data, 0, ( size + 1 ) * sizeof( UInt8* ) ); | 729 | memset( item_data, 0, ( size + 1 ) * sizeof( UInt8 ) ); |
726 | result = QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL ); | 730 | result = QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL ); |
727 | if ( noErr != result ) | 731 | if ( noErr != result ) |
728 | { | 732 | { |
@@ -861,7 +865,7 @@ void MediaPluginQuickTime::receiveMessage(const char *message_string) | |||
861 | message.setMessage(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params"); | 865 | message.setMessage(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params"); |
862 | #if defined(LL_WINDOWS) | 866 | #if defined(LL_WINDOWS) |
863 | // Values for Windows | 867 | // Values for Windows |
864 | mDepth = 3; | 868 | mDepth = 3; |
865 | message.setValueU32("format", GL_RGB); | 869 | message.setValueU32("format", GL_RGB); |
866 | message.setValueU32("type", GL_UNSIGNED_BYTE); | 870 | message.setValueU32("type", GL_UNSIGNED_BYTE); |
867 | 871 | ||
@@ -870,7 +874,7 @@ void MediaPluginQuickTime::receiveMessage(const char *message_string) | |||
870 | message.setValueU32("padding", 32 * 3); | 874 | message.setValueU32("padding", 32 * 3); |
871 | #else | 875 | #else |
872 | // Values for Mac | 876 | // Values for Mac |
873 | mDepth = 4; | 877 | mDepth = 4; |
874 | message.setValueU32("format", GL_BGRA_EXT); | 878 | message.setValueU32("format", GL_BGRA_EXT); |
875 | #ifdef __BIG_ENDIAN__ | 879 | #ifdef __BIG_ENDIAN__ |
876 | message.setValueU32("type", GL_UNSIGNED_INT_8_8_8_8_REV ); | 880 | message.setValueU32("type", GL_UNSIGNED_INT_8_8_8_8_REV ); |
@@ -891,7 +895,7 @@ void MediaPluginQuickTime::receiveMessage(const char *message_string) | |||
891 | { | 895 | { |
892 | // no response is necessary here. | 896 | // no response is necessary here. |
893 | F64 time = message_in.getValueReal("time"); | 897 | F64 time = message_in.getValueReal("time"); |
894 | 898 | ||
895 | // Convert time to milliseconds for update() | 899 | // Convert time to milliseconds for update() |
896 | update((int)(time * 1000.0f)); | 900 | update((int)(time * 1000.0f)); |
897 | } | 901 | } |
@@ -905,8 +909,6 @@ void MediaPluginQuickTime::receiveMessage(const char *message_string) | |||
905 | info.mAddress = message_in.getValuePointer("address"); | 909 | info.mAddress = message_in.getValuePointer("address"); |
906 | info.mSize = (size_t)message_in.getValueS32("size"); | 910 | info.mSize = (size_t)message_in.getValueS32("size"); |
907 | std::string name = message_in.getValue("name"); | 911 | std::string name = message_in.getValue("name"); |
908 | |||
909 | |||
910 | // std::cerr << "MediaPluginQuickTime::receiveMessage: shared memory added, name: " << name | 912 | // std::cerr << "MediaPluginQuickTime::receiveMessage: shared memory added, name: " << name |
911 | // << ", size: " << info.mSize | 913 | // << ", size: " << info.mSize |
912 | // << ", address: " << info.mAddress | 914 | // << ", address: " << info.mAddress |
@@ -929,9 +931,9 @@ void MediaPluginQuickTime::receiveMessage(const char *message_string) | |||
929 | // This is the currently active pixel buffer. Make sure we stop drawing to it. | 931 | // This is the currently active pixel buffer. Make sure we stop drawing to it. |
930 | mPixels = NULL; | 932 | mPixels = NULL; |
931 | mTextureSegmentName.clear(); | 933 | mTextureSegmentName.clear(); |
932 | 934 | ||
933 | // Make sure the movie GWorld is no longer pointed at the shared segment. | 935 | // Make sure the movie GWorld is no longer pointed at the shared segment. |
934 | sizeChanged(); | 936 | sizeChanged(); |
935 | } | 937 | } |
936 | mSharedSegments.erase(iter); | 938 | mSharedSegments.erase(iter); |
937 | } | 939 | } |
@@ -988,9 +990,9 @@ void MediaPluginQuickTime::receiveMessage(const char *message_string) | |||
988 | mTextureHeight = texture_height; | 990 | mTextureHeight = texture_height; |
989 | 991 | ||
990 | mMediaSizeChanging = false; | 992 | mMediaSizeChanging = false; |
991 | 993 | ||
992 | sizeChanged(); | 994 | sizeChanged(); |
993 | 995 | ||
994 | update(); | 996 | update(); |
995 | }; | 997 | }; |
996 | }; | 998 | }; |
@@ -999,14 +1001,14 @@ void MediaPluginQuickTime::receiveMessage(const char *message_string) | |||
999 | { | 1001 | { |
1000 | std::string uri = message_in.getValue("uri"); | 1002 | std::string uri = message_in.getValue("uri"); |
1001 | load( uri ); | 1003 | load( uri ); |
1002 | sendStatus(); | 1004 | sendStatus(); |
1003 | } | 1005 | } |
1004 | else if(message_name == "mouse_event") | 1006 | else if(message_name == "mouse_event") |
1005 | { | 1007 | { |
1006 | std::string event = message_in.getValue("event"); | 1008 | std::string event = message_in.getValue("event"); |
1007 | S32 x = message_in.getValueS32("x"); | 1009 | S32 x = message_in.getValueS32("x"); |
1008 | S32 y = message_in.getValueS32("y"); | 1010 | S32 y = message_in.getValueS32("y"); |
1009 | 1011 | ||
1010 | if(event == "down") | 1012 | if(event == "down") |
1011 | { | 1013 | { |
1012 | mouseDown(x, y); | 1014 | mouseDown(x, y); |
@@ -1099,7 +1101,7 @@ MediaPluginQuickTime::~MediaPluginQuickTime() | |||
1099 | 1101 | ||
1100 | void MediaPluginQuickTime::receiveMessage(const char *message_string) | 1102 | void MediaPluginQuickTime::receiveMessage(const char *message_string) |
1101 | { | 1103 | { |
1102 | // no-op | 1104 | // no-op |
1103 | } | 1105 | } |
1104 | 1106 | ||
1105 | // We're building without quicktime enabled. Just refuse to initialize. | 1107 | // We're building without quicktime enabled. Just refuse to initialize. |
diff --git a/linden/indra/media_plugins/webkit/CMakeLists.txt b/linden/indra/media_plugins/webkit/CMakeLists.txt index 54bc364..1c999ba 100644 --- a/linden/indra/media_plugins/webkit/CMakeLists.txt +++ b/linden/indra/media_plugins/webkit/CMakeLists.txt | |||
@@ -9,6 +9,7 @@ include(LLPlugin) | |||
9 | include(LLMath) | 9 | include(LLMath) |
10 | include(LLRender) | 10 | include(LLRender) |
11 | include(LLWindow) | 11 | include(LLWindow) |
12 | include(UI) | ||
12 | include(Linking) | 13 | include(Linking) |
13 | include(PluginAPI) | 14 | include(PluginAPI) |
14 | include(MediaPluginBase) | 15 | include(MediaPluginBase) |
@@ -50,6 +51,11 @@ set(media_plugin_webkit_LINK_LIBRARIES | |||
50 | ${PLUGIN_API_WINDOWS_LIBRARIES} | 51 | ${PLUGIN_API_WINDOWS_LIBRARIES} |
51 | ) | 52 | ) |
52 | 53 | ||
54 | if(LINUX) | ||
55 | list(APPEND media_plugin_webkit_LINK_LIBRARIES | ||
56 | ${UI_LIBRARIES} # for glib/GTK | ||
57 | ) | ||
58 | endif(LINUX) | ||
53 | 59 | ||
54 | 60 | ||
55 | add_library(media_plugin_webkit | 61 | add_library(media_plugin_webkit |
@@ -93,3 +99,4 @@ if (DARWIN) | |||
93 | ) | 99 | ) |
94 | 100 | ||
95 | endif (DARWIN) | 101 | endif (DARWIN) |
102 | |||
diff --git a/linden/indra/media_plugins/webkit/media_plugin_webkit.cpp b/linden/indra/media_plugins/webkit/media_plugin_webkit.cpp index 91efdae..2e3f06d 100644..100755 --- a/linden/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/linden/indra/media_plugins/webkit/media_plugin_webkit.cpp | |||
@@ -2,9 +2,10 @@ | |||
2 | * @file media_plugin_webkit.cpp | 2 | * @file media_plugin_webkit.cpp |
3 | * @brief Webkit plugin for LLMedia API plugin system | 3 | * @brief Webkit plugin for LLMedia API plugin system |
4 | * | 4 | * |
5 | * @cond | ||
5 | * $LicenseInfo:firstyear=2008&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2008&license=viewergpl$ |
6 | * | 7 | * |
7 | * Copyright (c) 2008-2009, Linden Research, Inc. | 8 | * Copyright (c) 2008-2010, Linden Research, Inc. |
8 | * | 9 | * |
9 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -28,8 +29,9 @@ | |||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 30 | * COMPLETENESS OR PERFORMANCE. |
30 | * $/LicenseInfo$ | 31 | * $/LicenseInfo$ |
32 | * @endcond | ||
31 | */ | 33 | */ |
32 | 34 | #include <iomanip>//FIXME: This is included from elsewhere in SG2.0 | |
33 | #include "llqtwebkit.h" | 35 | #include "llqtwebkit.h" |
34 | 36 | ||
35 | #include "linden_common.h" | 37 | #include "linden_common.h" |
@@ -50,7 +52,7 @@ | |||
50 | #endif | 52 | #endif |
51 | 53 | ||
52 | #if LL_WINDOWS | 54 | #if LL_WINDOWS |
53 | // NOTE - This captures the module handle of the dll. This is used below | 55 | // *NOTE:Mani - This captures the module handle fo rthe dll. This is used below |
54 | // to get the path to this dll for webkit initialization. | 56 | // to get the path to this dll for webkit initialization. |
55 | // I don't know how/if this can be done with apr... | 57 | // I don't know how/if this can be done with apr... |
56 | namespace { HMODULE gModuleHandle;}; | 58 | namespace { HMODULE gModuleHandle;}; |
@@ -83,6 +85,7 @@ private: | |||
83 | INIT_STATE_NAVIGATING, // Browser instance has been set up and initial navigate to about:blank has been issued | 85 | INIT_STATE_NAVIGATING, // Browser instance has been set up and initial navigate to about:blank has been issued |
84 | INIT_STATE_NAVIGATE_COMPLETE, // initial navigate to about:blank has completed | 86 | INIT_STATE_NAVIGATE_COMPLETE, // initial navigate to about:blank has completed |
85 | INIT_STATE_WAIT_REDRAW, // First real navigate begin has been received, waiting for page changed event to start handling redraws | 87 | INIT_STATE_WAIT_REDRAW, // First real navigate begin has been received, waiting for page changed event to start handling redraws |
88 | INIT_STATE_WAIT_COMPLETE, // Waiting for first real navigate complete event | ||
86 | INIT_STATE_RUNNING // All initialization gymnastics are complete. | 89 | INIT_STATE_RUNNING // All initialization gymnastics are complete. |
87 | }; | 90 | }; |
88 | int mBrowserWindowId; | 91 | int mBrowserWindowId; |
@@ -96,6 +99,9 @@ private: | |||
96 | int mLastMouseX; | 99 | int mLastMouseX; |
97 | int mLastMouseY; | 100 | int mLastMouseY; |
98 | bool mFirstFocus; | 101 | bool mFirstFocus; |
102 | F32 mBackgroundR; | ||
103 | F32 mBackgroundG; | ||
104 | F32 mBackgroundB; | ||
99 | 105 | ||
100 | void setInitState(int state) | 106 | void setInitState(int state) |
101 | { | 107 | { |
@@ -121,7 +127,7 @@ private: | |||
121 | } | 127 | } |
122 | } | 128 | } |
123 | 129 | ||
124 | if ( (mInitState == INIT_STATE_RUNNING) && mNeedsUpdate ) | 130 | if ( (mInitState > INIT_STATE_WAIT_REDRAW) && mNeedsUpdate ) |
125 | { | 131 | { |
126 | const unsigned char* browser_pixels = LLQtWebKit::getInstance()->grabBrowserWindow( mBrowserWindowId ); | 132 | const unsigned char* browser_pixels = LLQtWebKit::getInstance()->grabBrowserWindow( mBrowserWindowId ); |
127 | 133 | ||
@@ -170,8 +176,17 @@ private: | |||
170 | } | 176 | } |
171 | std::string application_dir = std::string( cwd ); | 177 | std::string application_dir = std::string( cwd ); |
172 | 178 | ||
179 | #if LL_DARWIN | ||
180 | // When running under the Xcode debugger, there's a setting called "Break on Debugger()/DebugStr()" which defaults to being turned on. | ||
181 | // This causes the environment variable USERBREAK to be set to 1, which causes these legacy calls to break into the debugger. | ||
182 | // This wouldn't cause any problems except for the fact that the current release version of the Flash plugin has a call to Debugger() in it | ||
183 | // which gets hit when the plugin is probed by webkit. | ||
184 | // Unsetting the environment variable here works around this issue. | ||
185 | unsetenv("USERBREAK"); | ||
186 | #endif | ||
187 | |||
173 | #if LL_WINDOWS | 188 | #if LL_WINDOWS |
174 | // NOTE - On windows, at least, the component path is the | 189 | //*NOTE:Mani - On windows, at least, the component path is the |
175 | // location of this dll's image file. | 190 | // location of this dll's image file. |
176 | std::string component_dir; | 191 | std::string component_dir; |
177 | char dll_path[_MAX_PATH]; | 192 | char dll_path[_MAX_PATH]; |
@@ -187,8 +202,8 @@ private: | |||
187 | } | 202 | } |
188 | else | 203 | else |
189 | { | 204 | { |
190 | // NOTE - This case should be a rare exception. | 205 | // *NOTE:Mani - This case should be an rare exception. |
191 | // GetModuleFileNameA should always give you a full path. | 206 | // GetModuleFileNameA should always give you a full path, no? |
192 | component_dir = application_dir; | 207 | component_dir = application_dir; |
193 | } | 208 | } |
194 | #else | 209 | #else |
@@ -210,7 +225,6 @@ private: | |||
210 | { | 225 | { |
211 | // create single browser window | 226 | // create single browser window |
212 | mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight ); | 227 | mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight ); |
213 | |||
214 | #if LL_WINDOWS | 228 | #if LL_WINDOWS |
215 | // Enable plugins | 229 | // Enable plugins |
216 | LLQtWebKit::getInstance()->enablePlugins(true); | 230 | LLQtWebKit::getInstance()->enablePlugins(true); |
@@ -236,8 +250,9 @@ private: | |||
236 | // don't flip bitmap | 250 | // don't flip bitmap |
237 | LLQtWebKit::getInstance()->flipWindow( mBrowserWindowId, true ); | 251 | LLQtWebKit::getInstance()->flipWindow( mBrowserWindowId, true ); |
238 | 252 | ||
239 | // set background color to be black - mostly for initial login page | 253 | // set background color |
240 | LLQtWebKit::getInstance()->setBackgroundColor( mBrowserWindowId, 0x00, 0x00, 0x00 ); | 254 | // convert background color channels from [0.0, 1.0] to [0, 255]; |
255 | LLQtWebKit::getInstance()->setBackgroundColor( mBrowserWindowId, int(mBackgroundR * 255.0f), int(mBackgroundG * 255.0f), int(mBackgroundB * 255.0f) ); | ||
241 | 256 | ||
242 | // Set state _before_ starting the navigate, since onNavigateBegin might get called before this call returns. | 257 | // Set state _before_ starting the navigate, since onNavigateBegin might get called before this call returns. |
243 | setInitState(INIT_STATE_NAVIGATING); | 258 | setInitState(INIT_STATE_NAVIGATING); |
@@ -245,7 +260,21 @@ private: | |||
245 | // Don't do this here -- it causes the dreaded "white flash" when loading a browser instance. | 260 | // Don't do this here -- it causes the dreaded "white flash" when loading a browser instance. |
246 | // FIXME: Re-added this because navigating to a "page" initializes things correctly - especially | 261 | // FIXME: Re-added this because navigating to a "page" initializes things correctly - especially |
247 | // for the HTTP AUTH dialog issues (DEV-41731). Will fix at a later date. | 262 | // for the HTTP AUTH dialog issues (DEV-41731). Will fix at a later date. |
248 | LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" ); | 263 | // Build a data URL like this: "data:text/html,%3Chtml%3E%3Cbody bgcolor=%22#RRGGBB%22%3E%3C/body%3E%3C/html%3E" |
264 | // where RRGGBB is the background color in HTML style | ||
265 | std::stringstream url; | ||
266 | |||
267 | url << "data:text/html,%3Chtml%3E%3Cbody%20bgcolor=%22#"; | ||
268 | // convert background color channels from [0.0, 1.0] to [0, 255]; | ||
269 | url << std::setfill('0') << std::setw(2) << std::hex << int(mBackgroundR * 255.0f); | ||
270 | url << std::setfill('0') << std::setw(2) << std::hex << int(mBackgroundG * 255.0f); | ||
271 | url << std::setfill('0') << std::setw(2) << std::hex << int(mBackgroundB * 255.0f); | ||
272 | url << "%22%3E%3C/body%3E%3C/html%3E"; | ||
273 | |||
274 | lldebugs << "data url is: " << url.str() << llendl; | ||
275 | |||
276 | LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, url.str() ); | ||
277 | // LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" ); | ||
249 | 278 | ||
250 | return true; | 279 | return true; |
251 | }; | 280 | }; |
@@ -253,6 +282,7 @@ private: | |||
253 | return false; | 282 | return false; |
254 | }; | 283 | }; |
255 | 284 | ||
285 | |||
256 | //////////////////////////////////////////////////////////////////////////////// | 286 | //////////////////////////////////////////////////////////////////////////////// |
257 | // virtual | 287 | // virtual |
258 | void onCursorChanged(const EventType& event) | 288 | void onCursorChanged(const EventType& event) |
@@ -294,7 +324,7 @@ private: | |||
294 | { | 324 | { |
295 | if(mInitState == INIT_STATE_WAIT_REDRAW) | 325 | if(mInitState == INIT_STATE_WAIT_REDRAW) |
296 | { | 326 | { |
297 | setInitState(INIT_STATE_RUNNING); | 327 | setInitState(INIT_STATE_WAIT_COMPLETE); |
298 | } | 328 | } |
299 | 329 | ||
300 | // flag that an update is required | 330 | // flag that an update is required |
@@ -316,7 +346,9 @@ private: | |||
316 | 346 | ||
317 | if(mInitState == INIT_STATE_NAVIGATE_COMPLETE) | 347 | if(mInitState == INIT_STATE_NAVIGATE_COMPLETE) |
318 | { | 348 | { |
319 | setInitState(INIT_STATE_WAIT_REDRAW); | 349 | // Skip the WAIT_REDRAW state now -- with the right background color set, it should no longer be necessary. |
350 | // setInitState(INIT_STATE_WAIT_REDRAW); | ||
351 | setInitState(INIT_STATE_WAIT_COMPLETE); | ||
320 | } | 352 | } |
321 | 353 | ||
322 | } | 354 | } |
@@ -327,6 +359,14 @@ private: | |||
327 | { | 359 | { |
328 | if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE) | 360 | if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE) |
329 | { | 361 | { |
362 | if(mInitState < INIT_STATE_RUNNING) | ||
363 | { | ||
364 | setInitState(INIT_STATE_RUNNING); | ||
365 | |||
366 | // Clear the history, so the "back" button doesn't take you back to "about:blank". | ||
367 | LLQtWebKit::getInstance()->clearHistory(mBrowserWindowId); | ||
368 | } | ||
369 | |||
330 | LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete"); | 370 | LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete"); |
331 | message.setValue("uri", event.getEventUri()); | 371 | message.setValue("uri", event.getEventUri()); |
332 | message.setValueS32("result_code", event.getIntValue()); | 372 | message.setValueS32("result_code", event.getIntValue()); |
@@ -399,6 +439,7 @@ private: | |||
399 | LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href"); | 439 | LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href"); |
400 | message.setValue("uri", event.getStringValue()); | 440 | message.setValue("uri", event.getStringValue()); |
401 | message.setValue("target", event.getStringValue2()); | 441 | message.setValue("target", event.getStringValue2()); |
442 | message.setValueU32("target_type", event.getLinkType()); | ||
402 | sendMessage(message); | 443 | sendMessage(message); |
403 | } | 444 | } |
404 | 445 | ||
@@ -430,92 +471,96 @@ private: | |||
430 | return (LLQtWebKit::EKeyboardModifier)result; | 471 | return (LLQtWebKit::EKeyboardModifier)result; |
431 | } | 472 | } |
432 | 473 | ||
433 | |||
434 | //////////////////////////////////////////////////////////////////////////////// | 474 | //////////////////////////////////////////////////////////////////////////////// |
435 | // | 475 | // |
436 | void keyEvent(LLQtWebKit::EKeyEvent key_event, int key, LLQtWebKit::EKeyboardModifier modifiers) | 476 | void deserializeKeyboardData( LLSD native_key_data, uint32_t& native_scan_code, uint32_t& native_virtual_key, uint32_t& native_modifiers ) |
437 | { | 477 | { |
438 | int llqt_key; | 478 | native_scan_code = 0; |
479 | native_virtual_key = 0; | ||
480 | native_modifiers = 0; | ||
439 | 481 | ||
482 | if( native_key_data.isMap() ) | ||
483 | { | ||
484 | #if LL_DARWIN | ||
485 | native_scan_code = (uint32_t)(native_key_data["char_code"].asInteger()); | ||
486 | native_virtual_key = (uint32_t)(native_key_data["key_code"].asInteger()); | ||
487 | native_modifiers = (uint32_t)(native_key_data["modifiers"].asInteger()); | ||
488 | #elif LL_WINDOWS | ||
489 | native_scan_code = (uint32_t)(native_key_data["scan_code"].asInteger()); | ||
490 | native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger()); | ||
491 | // TODO: I don't think we need to do anything with native modifiers here -- please verify | ||
492 | #elif LL_LINUX | ||
493 | native_scan_code = (uint32_t)(native_key_data["scan_code"].asInteger()); | ||
494 | native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger()); | ||
495 | native_modifiers = (uint32_t)(native_key_data["modifiers"].asInteger()); | ||
496 | #else | ||
497 | // Add other platforms here as needed | ||
498 | #endif | ||
499 | }; | ||
500 | }; | ||
501 | |||
502 | //////////////////////////////////////////////////////////////////////////////// | ||
503 | // | ||
504 | void keyEvent(LLQtWebKit::EKeyEvent key_event, int key, LLQtWebKit::EKeyboardModifier modifiers, LLSD native_key_data = LLSD::emptyMap()) | ||
505 | { | ||
440 | // The incoming values for 'key' will be the ones from indra_constants.h | 506 | // The incoming values for 'key' will be the ones from indra_constants.h |
441 | // the outgoing values are the ones from llqtwebkit.h | 507 | std::string utf8_text; |
442 | 508 | ||
509 | if(key < KEY_SPECIAL) | ||
510 | { | ||
511 | // Low-ascii characters need to get passed through. | ||
512 | utf8_text = (char)key; | ||
513 | } | ||
514 | |||
515 | // Any special-case handling we want to do for particular keys... | ||
443 | switch((KEY)key) | 516 | switch((KEY)key) |
444 | { | 517 | { |
445 | // This is the list that the llqtwebkit implementation actually maps into Qt keys. | 518 | // ASCII codes for some standard keys |
446 | // case KEY_XXX: llqt_key = LL_DOM_VK_CANCEL; break; | 519 | case LLQtWebKit::KEY_BACKSPACE: utf8_text = (char)8; break; |
447 | // case KEY_XXX: llqt_key = LL_DOM_VK_HELP; break; | 520 | case LLQtWebKit::KEY_TAB: utf8_text = (char)9; break; |
448 | case KEY_BACKSPACE: llqt_key = LL_DOM_VK_BACK_SPACE; break; | 521 | case LLQtWebKit::KEY_RETURN: utf8_text = (char)13; break; |
449 | case KEY_TAB: llqt_key = LL_DOM_VK_TAB; break; | 522 | case LLQtWebKit::KEY_PAD_RETURN: utf8_text = (char)13; break; |
450 | // case KEY_XXX: llqt_key = LL_DOM_VK_CLEAR; break; | 523 | case LLQtWebKit::KEY_ESCAPE: utf8_text = (char)27; break; |
451 | case KEY_RETURN: llqt_key = LL_DOM_VK_RETURN; break; | ||
452 | case KEY_PAD_RETURN: llqt_key = LL_DOM_VK_ENTER; break; | ||
453 | case KEY_SHIFT: llqt_key = LL_DOM_VK_SHIFT; break; | ||
454 | case KEY_CONTROL: llqt_key = LL_DOM_VK_CONTROL; break; | ||
455 | case KEY_ALT: llqt_key = LL_DOM_VK_ALT; break; | ||
456 | // case KEY_XXX: llqt_key = LL_DOM_VK_PAUSE; break; | ||
457 | case KEY_CAPSLOCK: llqt_key = LL_DOM_VK_CAPS_LOCK; break; | ||
458 | case KEY_ESCAPE: llqt_key = LL_DOM_VK_ESCAPE; break; | ||
459 | case KEY_PAGE_UP: llqt_key = LL_DOM_VK_PAGE_UP; break; | ||
460 | case KEY_PAGE_DOWN: llqt_key = LL_DOM_VK_PAGE_DOWN; break; | ||
461 | case KEY_END: llqt_key = LL_DOM_VK_END; break; | ||
462 | case KEY_HOME: llqt_key = LL_DOM_VK_HOME; break; | ||
463 | case KEY_LEFT: llqt_key = LL_DOM_VK_LEFT; break; | ||
464 | case KEY_UP: llqt_key = LL_DOM_VK_UP; break; | ||
465 | case KEY_RIGHT: llqt_key = LL_DOM_VK_RIGHT; break; | ||
466 | case KEY_DOWN: llqt_key = LL_DOM_VK_DOWN; break; | ||
467 | // case KEY_XXX: llqt_key = LL_DOM_VK_PRINTSCREEN; break; | ||
468 | case KEY_INSERT: llqt_key = LL_DOM_VK_INSERT; break; | ||
469 | case KEY_DELETE: llqt_key = LL_DOM_VK_DELETE; break; | ||
470 | // case KEY_XXX: llqt_key = LL_DOM_VK_CONTEXT_MENU; break; | ||
471 | 524 | ||
472 | default: | 525 | default: |
473 | if(key < KEY_SPECIAL) | ||
474 | { | ||
475 | // Pass the incoming key through -- it should be regular ASCII, which should be correct for webkit. | ||
476 | llqt_key = key; | ||
477 | } | ||
478 | else | ||
479 | { | ||
480 | // Don't pass through untranslated special keys -- they'll be all wrong. | ||
481 | llqt_key = 0; | ||
482 | } | ||
483 | break; | 526 | break; |
484 | } | 527 | } |
485 | 528 | ||
486 | // std::cerr << "keypress, original code = 0x" << std::hex << key << ", converted code = 0x" << std::hex << llqt_key << std::dec << std::endl; | 529 | // std::cerr << "key event " << (int)key_event << ", native_key_data = " << native_key_data << std::endl; |
487 | 530 | ||
488 | if(llqt_key != 0) | 531 | uint32_t native_scan_code = 0; |
489 | { | 532 | uint32_t native_virtual_key = 0; |
490 | LLQtWebKit::getInstance()->keyEvent( mBrowserWindowId, key_event, llqt_key, modifiers); | 533 | uint32_t native_modifiers = 0; |
491 | } | 534 | deserializeKeyboardData( native_key_data, native_scan_code, native_virtual_key, native_modifiers ); |
535 | |||
536 | LLQtWebKit::getInstance()->keyboardEvent( mBrowserWindowId, key_event, (uint32_t)key, utf8_text.c_str(), modifiers, native_scan_code, native_virtual_key, native_modifiers); | ||
492 | 537 | ||
493 | checkEditState(); | 538 | checkEditState(); |
494 | }; | 539 | }; |
495 | 540 | ||
496 | //////////////////////////////////////////////////////////////////////////////// | 541 | //////////////////////////////////////////////////////////////////////////////// |
497 | // | 542 | // |
498 | void unicodeInput( const std::string &utf8str, LLQtWebKit::EKeyboardModifier modifiers) | 543 | void unicodeInput( const std::string &utf8str, LLQtWebKit::EKeyboardModifier modifiers, LLSD native_key_data = LLSD::emptyMap()) |
499 | { | 544 | { |
500 | LLWString wstr = utf8str_to_wstring(utf8str); | 545 | uint32_t key = LLQtWebKit::KEY_NONE; |
501 | 546 | ||
502 | unsigned int i; | 547 | // std::cerr << "unicode input, native_key_data = " << native_key_data << std::endl; |
503 | for(i=0; i < wstr.size(); i++) | 548 | |
549 | if(utf8str.size() == 1) | ||
504 | { | 550 | { |
505 | // std::cerr << "unicode input, code = 0x" << std::hex << (unsigned long)(wstr[i]) << std::dec << std::endl; | 551 | // The only way a utf8 string can be one byte long is if it's actually a single 7-bit ascii character. |
506 | 552 | // In this case, use it as the key value. | |
507 | if(wstr[i] == 32) | 553 | key = utf8str[0]; |
508 | { | ||
509 | // For some reason, the webkit plugin really wants the space bar to come in through the key-event path, not the unicode path. | ||
510 | LLQtWebKit::getInstance()->keyEvent( mBrowserWindowId, LLQtWebKit::KE_KEY_DOWN, 32, modifiers); | ||
511 | LLQtWebKit::getInstance()->keyEvent( mBrowserWindowId, LLQtWebKit::KE_KEY_UP, 32, modifiers); | ||
512 | } | ||
513 | else | ||
514 | { | ||
515 | LLQtWebKit::getInstance()->unicodeInput(mBrowserWindowId, wstr[i], modifiers); | ||
516 | } | ||
517 | } | 554 | } |
518 | 555 | ||
556 | uint32_t native_scan_code = 0; | ||
557 | uint32_t native_virtual_key = 0; | ||
558 | uint32_t native_modifiers = 0; | ||
559 | deserializeKeyboardData( native_key_data, native_scan_code, native_virtual_key, native_modifiers ); | ||
560 | |||
561 | LLQtWebKit::getInstance()->keyboardEvent( mBrowserWindowId, LLQtWebKit::KE_KEY_DOWN, (uint32_t)key, utf8str.c_str(), modifiers, native_scan_code, native_virtual_key, native_modifiers); | ||
562 | LLQtWebKit::getInstance()->keyboardEvent( mBrowserWindowId, LLQtWebKit::KE_KEY_UP, (uint32_t)key, utf8str.c_str(), modifiers, native_scan_code, native_virtual_key, native_modifiers); | ||
563 | |||
519 | checkEditState(); | 564 | checkEditState(); |
520 | }; | 565 | }; |
521 | 566 | ||
@@ -568,6 +613,9 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_ | |||
568 | mLastMouseX = 0; | 613 | mLastMouseX = 0; |
569 | mLastMouseY = 0; | 614 | mLastMouseY = 0; |
570 | mFirstFocus = true; | 615 | mFirstFocus = true; |
616 | mBackgroundR = 0.0f; | ||
617 | mBackgroundG = 0.0f; | ||
618 | mBackgroundB = 0.0f; | ||
571 | } | 619 | } |
572 | 620 | ||
573 | MediaPluginWebKit::~MediaPluginWebKit() | 621 | MediaPluginWebKit::~MediaPluginWebKit() |
@@ -645,7 +693,6 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) | |||
645 | info.mSize = (size_t)message_in.getValueS32("size"); | 693 | info.mSize = (size_t)message_in.getValueS32("size"); |
646 | std::string name = message_in.getValue("name"); | 694 | std::string name = message_in.getValue("name"); |
647 | 695 | ||
648 | |||
649 | // std::cerr << "MediaPluginWebKit::receiveMessage: shared memory added, name: " << name | 696 | // std::cerr << "MediaPluginWebKit::receiveMessage: shared memory added, name: " << name |
650 | // << ", size: " << info.mSize | 697 | // << ", size: " << info.mSize |
651 | // << ", address: " << info.mAddress | 698 | // << ", address: " << info.mAddress |
@@ -695,7 +742,11 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) | |||
695 | S32 height = message_in.getValueS32("height"); | 742 | S32 height = message_in.getValueS32("height"); |
696 | S32 texture_width = message_in.getValueS32("texture_width"); | 743 | S32 texture_width = message_in.getValueS32("texture_width"); |
697 | S32 texture_height = message_in.getValueS32("texture_height"); | 744 | S32 texture_height = message_in.getValueS32("texture_height"); |
698 | 745 | mBackgroundR = message_in.getValueReal("background_r"); | |
746 | mBackgroundG = message_in.getValueReal("background_g"); | ||
747 | mBackgroundB = message_in.getValueReal("background_b"); | ||
748 | // mBackgroundA = message_in.setValueReal("background_a"); // Ignore any alpha | ||
749 | |||
699 | if(!name.empty()) | 750 | if(!name.empty()) |
700 | { | 751 | { |
701 | // Find the shared memory region with this name | 752 | // Find the shared memory region with this name |
@@ -809,6 +860,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) | |||
809 | std::string event = message_in.getValue("event"); | 860 | std::string event = message_in.getValue("event"); |
810 | S32 key = message_in.getValueS32("key"); | 861 | S32 key = message_in.getValueS32("key"); |
811 | std::string modifiers = message_in.getValue("modifiers"); | 862 | std::string modifiers = message_in.getValue("modifiers"); |
863 | LLSD native_key_data = message_in.getValueLLSD("native_key_data"); | ||
812 | 864 | ||
813 | // Treat unknown events as key-up for safety. | 865 | // Treat unknown events as key-up for safety. |
814 | LLQtWebKit::EKeyEvent key_event = LLQtWebKit::KE_KEY_UP; | 866 | LLQtWebKit::EKeyEvent key_event = LLQtWebKit::KE_KEY_UP; |
@@ -821,14 +873,15 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) | |||
821 | key_event = LLQtWebKit::KE_KEY_REPEAT; | 873 | key_event = LLQtWebKit::KE_KEY_REPEAT; |
822 | } | 874 | } |
823 | 875 | ||
824 | keyEvent(key_event, key, decodeModifiers(modifiers)); | 876 | keyEvent(key_event, key, decodeModifiers(modifiers), native_key_data); |
825 | } | 877 | } |
826 | else if(message_name == "text_event") | 878 | else if(message_name == "text_event") |
827 | { | 879 | { |
828 | std::string text = message_in.getValue("text"); | 880 | std::string text = message_in.getValue("text"); |
829 | std::string modifiers = message_in.getValue("modifiers"); | 881 | std::string modifiers = message_in.getValue("modifiers"); |
882 | LLSD native_key_data = message_in.getValueLLSD("native_key_data"); | ||
830 | 883 | ||
831 | unicodeInput(text, decodeModifiers(modifiers)); | 884 | unicodeInput(text, decodeModifiers(modifiers), native_key_data); |
832 | } | 885 | } |
833 | if(message_name == "edit_cut") | 886 | if(message_name == "edit_cut") |
834 | { | 887 | { |
diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp index 5bdb26f..c0d1460 100644 --- a/linden/indra/newview/llviewermedia.cpp +++ b/linden/indra/newview/llviewermedia.cpp | |||
@@ -770,7 +770,38 @@ bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask) | |||
770 | 770 | ||
771 | if (mMediaSource) | 771 | if (mMediaSource) |
772 | { | 772 | { |
773 | result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN ,key, mask); | 773 | // FIXME: THIS IS SO WRONG. |
774 | // Menu keys should be handled by the menu system and not passed to UI elements, but this is how LLTextEditor and LLLineEditor do it... | ||
775 | if( MASK_CONTROL & mask ) | ||
776 | { | ||
777 | if( 'C' == key ) | ||
778 | { | ||
779 | mMediaSource->copy(); | ||
780 | result = true; | ||
781 | } | ||
782 | else | ||
783 | if( 'V' == key ) | ||
784 | { | ||
785 | mMediaSource->paste(); | ||
786 | result = true; | ||
787 | } | ||
788 | else | ||
789 | if( 'X' == key ) | ||
790 | { | ||
791 | mMediaSource->cut(); | ||
792 | result = true; | ||
793 | } | ||
794 | } | ||
795 | |||
796 | if(!result) | ||
797 | { | ||
798 | |||
799 | LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData(); | ||
800 | |||
801 | result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN ,key, mask, native_key_data); | ||
802 | // Since the viewer internal event dispatching doesn't give us key-up events, simulate one here. | ||
803 | (void)mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_UP ,key, mask, native_key_data); | ||
804 | } | ||
774 | } | 805 | } |
775 | 806 | ||
776 | return result; | 807 | return result; |
@@ -787,7 +818,9 @@ bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char) | |||
787 | if (uni_char >= 32 // discard 'control' characters | 818 | if (uni_char >= 32 // discard 'control' characters |
788 | && uni_char != 127) // SDL thinks this is 'delete' - yuck. | 819 | && uni_char != 127) // SDL thinks this is 'delete' - yuck. |
789 | { | 820 | { |
790 | mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(FALSE)); | 821 | LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData(); |
822 | |||
823 | mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(FALSE), native_key_data); | ||
791 | } | 824 | } |
792 | } | 825 | } |
793 | 826 | ||
diff --git a/linden/install.xml b/linden/install.xml index 99d3bb2..d9f400a 100644 --- a/linden/install.xml +++ b/linden/install.xml | |||
@@ -1144,23 +1144,23 @@ Portions copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura | |||
1144 | <key>darwin</key> | 1144 | <key>darwin</key> |
1145 | <map> | 1145 | <map> |
1146 | <key>md5sum</key> | 1146 | <key>md5sum</key> |
1147 | <string>b40a13847ee773c9ee06f641fe0dd1c2</string> | 1147 | <string>95f44f0023dddc80be4398fc4f213861</string> |
1148 | <key>url</key> | 1148 | <key>url</key> |
1149 | <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-darwin-20091023.tar.bz2</uri> | 1149 | <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20100208.tar.bz2</uri> |
1150 | </map> | 1150 | </map> |
1151 | <key>linux</key> | 1151 | <key>linux</key> |
1152 | <map> | 1152 | <map> |
1153 | <key>md5sum</key> | 1153 | <key>md5sum</key> |
1154 | <string>ffede2775355676096b1085cbb9d0da7</string> | 1154 | <string>4c75b2f1e8524c7844ee3ea1cd59a3db</string> |
1155 | <key>url</key> | 1155 | <key>url</key> |
1156 | <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-linux-20091117.tar.bz2</uri> | 1156 | <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-linux-20100209b.tar.bz2</uri> |
1157 | </map> | 1157 | </map> |
1158 | <key>windows</key> | 1158 | <key>windows</key> |
1159 | <map> | 1159 | <map> |
1160 | <key>md5sum</key> | 1160 | <key>md5sum</key> |
1161 | <string>6f2f911545e5906edc87f4f3cda423a1</string> | 1161 | <string>1e9798dc424a6f6c2bea50649bbcc7ae</string> |
1162 | <key>url</key> | 1162 | <key>url</key> |
1163 | <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-windows-20091023.tar.bz2</uri> | 1163 | <uri>http://viewer-source-downloads.s3.amazonaws.com/install_pkgs/llqtwebkit-windows-qt4.6-20100210.tar.bz2</uri> |
1164 | </map> | 1164 | </map> |
1165 | </map> | 1165 | </map> |
1166 | </map> | 1166 | </map> |