aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/CMakeLists.txt100
-rw-r--r--linden/indra/newview/app_settings/settings.xml35
-rw-r--r--linden/indra/newview/chatbar_as_cmdline.cpp4
-rw-r--r--linden/indra/newview/floatervoicelicense.cpp4
-rw-r--r--linden/indra/newview/floatervoicelicense.h8
-rw-r--r--linden/indra/newview/llagent.cpp6
-rw-r--r--linden/indra/newview/llappviewer.cpp20
-rw-r--r--linden/indra/newview/llappviewerlinux.cpp2
-rw-r--r--linden/indra/newview/llappviewermacosx.cpp4
-rw-r--r--linden/indra/newview/llassetuploadresponders.cpp5
-rw-r--r--linden/indra/newview/llaudiosourcevo.h2
-rw-r--r--linden/indra/newview/llchatbar.cpp2
-rw-r--r--linden/indra/newview/llcommandhandler.cpp6
-rw-r--r--linden/indra/newview/llcommandhandler.h10
-rw-r--r--linden/indra/newview/llfirstuse.cpp4
-rw-r--r--linden/indra/newview/llfloaterabout.cpp27
-rw-r--r--linden/indra/newview/llfloateravatarinfo.cpp2
-rw-r--r--linden/indra/newview/llfloaterchat.cpp54
-rw-r--r--linden/indra/newview/llfloaterchat.h2
-rw-r--r--linden/indra/newview/llfloaterclassified.cpp2
-rw-r--r--linden/indra/newview/llfloaterevent.cpp2
-rw-r--r--linden/indra/newview/llfloatergroupinfo.cpp2
-rw-r--r--linden/indra/newview/llfloaterhandler.cpp4
-rw-r--r--linden/indra/newview/llfloaterhandler.h2
-rw-r--r--linden/indra/newview/llfloaterhtmlsimple.cpp6
-rw-r--r--linden/indra/newview/llfloaterhud.cpp4
-rw-r--r--linden/indra/newview/llfloaterhud.h4
-rw-r--r--linden/indra/newview/llfloaterland.cpp12
-rw-r--r--linden/indra/newview/llfloaterland.h3
-rw-r--r--linden/indra/newview/llfloatermediabrowser.cpp398
-rw-r--r--linden/indra/newview/llfloatermediabrowser.h (renamed from linden/indra/newview/llfloaterhtmlhelp.h)34
-rw-r--r--linden/indra/newview/llfloaterobjectiminfo.cpp6
-rw-r--r--linden/indra/newview/llfloaterparcel.cpp2
-rw-r--r--linden/indra/newview/llfloaterpreference.cpp8
-rw-r--r--linden/indra/newview/llfloatertos.cpp33
-rw-r--r--linden/indra/newview/llfloatertos.h7
-rw-r--r--linden/indra/newview/llfloaterurlentry.cpp2
-rw-r--r--linden/indra/newview/llhoverview.cpp3
-rw-r--r--linden/indra/newview/llhoverview.h3
-rw-r--r--linden/indra/newview/llhudview.cpp13
-rw-r--r--linden/indra/newview/llhudview.h2
-rw-r--r--linden/indra/newview/llimpanel.cpp2
-rw-r--r--linden/indra/newview/llloginhandler.cpp2
-rw-r--r--linden/indra/newview/llloginhandler.h2
-rw-r--r--linden/indra/newview/llmediactrl.cpp1201
-rw-r--r--linden/indra/newview/llmediactrl.h201
-rw-r--r--linden/indra/newview/llmediaremotectrl.cpp57
-rw-r--r--linden/indra/newview/llmimetypes.cpp24
-rw-r--r--linden/indra/newview/llmimetypes.h6
-rw-r--r--linden/indra/newview/lloverlaybar.cpp17
-rw-r--r--linden/indra/newview/llpanelaudioprefs.cpp4
-rw-r--r--linden/indra/newview/llpanelavatar.cpp60
-rw-r--r--linden/indra/newview/llpanelavatar.h16
-rw-r--r--linden/indra/newview/llpanelclassified.cpp2
-rw-r--r--linden/indra/newview/llpaneldebug.cpp2
-rw-r--r--linden/indra/newview/llpaneldirfind.cpp42
-rw-r--r--linden/indra/newview/llpaneldirfind.h15
-rw-r--r--linden/indra/newview/llpaneldirgroups.cpp1
-rw-r--r--linden/indra/newview/llpanelface.cpp33
-rw-r--r--linden/indra/newview/llpanellandaudio.cpp195
-rw-r--r--linden/indra/newview/llpanellandaudio.h63
-rw-r--r--linden/indra/newview/llpanellandmedia.cpp292
-rw-r--r--linden/indra/newview/llpanellandmedia.h25
-rw-r--r--linden/indra/newview/llpanellogin.cpp55
-rw-r--r--linden/indra/newview/llpanellogin.h8
-rw-r--r--linden/indra/newview/llpanelmediahud.cpp667
-rw-r--r--linden/indra/newview/llpanelmediahud.h110
-rw-r--r--linden/indra/newview/llpanelpermissions.cpp2
-rw-r--r--linden/indra/newview/llpanelweb.cpp65
-rw-r--r--linden/indra/newview/llprefsvoice.cpp4
-rw-r--r--linden/indra/newview/llpreviewscript.cpp14
-rw-r--r--linden/indra/newview/llpreviewsound.cpp2
-rw-r--r--linden/indra/newview/llselectmgr.cpp11
-rw-r--r--linden/indra/newview/llstartup.cpp37
-rw-r--r--linden/indra/newview/llstatusbar.cpp2
-rw-r--r--linden/indra/newview/lltoolcomp.cpp4
-rw-r--r--linden/indra/newview/lltoolcomp.h1
-rw-r--r--linden/indra/newview/lltoolgun.cpp7
-rw-r--r--linden/indra/newview/lltoolgun.h2
-rw-r--r--linden/indra/newview/lltoolmgr.cpp14
-rw-r--r--linden/indra/newview/lltoolmorph.cpp2
-rw-r--r--linden/indra/newview/lltoolpie.cpp208
-rw-r--r--linden/indra/newview/lltoolpie.h1
-rw-r--r--linden/indra/newview/lltoolplacer.cpp2
-rw-r--r--linden/indra/newview/llurldispatcher.cpp22
-rw-r--r--linden/indra/newview/llurldispatcher.h6
-rw-r--r--linden/indra/newview/llvieweraudio.cpp3
-rw-r--r--linden/indra/newview/llviewercontrol.cpp19
-rw-r--r--linden/indra/newview/llviewergesture.cpp2
-rw-r--r--linden/indra/newview/llviewerimagelist.cpp2
-rw-r--r--linden/indra/newview/llviewerkeyboard.cpp2
-rw-r--r--linden/indra/newview/llviewermedia.cpp1390
-rw-r--r--linden/indra/newview/llviewermedia.h200
-rw-r--r--linden/indra/newview/llviewermedia_streamingaudio.cpp169
-rw-r--r--linden/indra/newview/llviewermedia_streamingaudio.h69
-rw-r--r--linden/indra/newview/llviewermediafocus.cpp359
-rw-r--r--linden/indra/newview/llviewermediafocus.h91
-rw-r--r--linden/indra/newview/llviewermediaobserver.h (renamed from linden/indra/llmedia/llmediaimplexample1.h)66
-rw-r--r--linden/indra/newview/llviewermenu.cpp34
-rw-r--r--linden/indra/newview/llviewermenufile.cpp2
-rwxr-xr-xlinden/indra/newview/llviewermessage.cpp8
-rw-r--r--linden/indra/newview/llviewerobject.cpp2
-rw-r--r--linden/indra/newview/llviewerparcelmedia.cpp350
-rw-r--r--linden/indra/newview/llviewerparcelmedia.h31
-rw-r--r--linden/indra/newview/llviewerparcelmediaautoplay.cpp2
-rw-r--r--linden/indra/newview/llviewerparcelmediaautoplay.h1
-rw-r--r--linden/indra/newview/llviewerparcelmgr.cpp80
-rw-r--r--linden/indra/newview/llviewerparcelmgr.h5
-rw-r--r--linden/indra/newview/llviewerregion.cpp6
-rw-r--r--linden/indra/newview/llviewertexteditor.cpp2
-rw-r--r--linden/indra/newview/llviewerwindow.cpp58
-rw-r--r--linden/indra/newview/llvoavatar.cpp17
-rw-r--r--linden/indra/newview/llvovolume.cpp2
-rw-r--r--linden/indra/newview/llweb.cpp2
-rw-r--r--linden/indra/newview/mozilla-powerpc-darwin-readme.txt71
-rw-r--r--linden/indra/newview/pipeline.cpp2
-rw-r--r--linden/indra/newview/skins/default/textures/textures.xml20
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml744
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_media_browser.xml21
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/mime_types.xml456
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml445
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml445
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml445
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_bars.xml3
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_hud.xml4
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_media_hud.xml68
-rwxr-xr-xlinden/indra/newview/viewer_manifest.py126
-rwxr-xr-xlinden/indra/newview/viewer_manifest.py~1176
128 files changed, 9405 insertions, 1952 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 1691095..15561d0 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -21,8 +21,8 @@ include(LLImage)
21include(LLImageJ2COJ) 21include(LLImageJ2COJ)
22include(LLInventory) 22include(LLInventory)
23include(LLMath) 23include(LLMath)
24include(LLMedia)
25include(LLMessage) 24include(LLMessage)
25include(LLPlugin)
26include(LLPrimitive) 26include(LLPrimitive)
27include(LLRender) 27include(LLRender)
28include(LLUI) 28include(LLUI)
@@ -31,7 +31,6 @@ include(LLWindow)
31include(LLXML) 31include(LLXML)
32include(LScript) 32include(LScript)
33include(Linking) 33include(Linking)
34include(Mozlib)
35include(NDOF) 34include(NDOF)
36include(GooglePerfTools) 35include(GooglePerfTools)
37include(TemplateCheck) 36include(TemplateCheck)
@@ -55,8 +54,8 @@ include_directories(
55 ${LLIMAGE_INCLUDE_DIRS} 54 ${LLIMAGE_INCLUDE_DIRS}
56 ${LLINVENTORY_INCLUDE_DIRS} 55 ${LLINVENTORY_INCLUDE_DIRS}
57 ${LLMATH_INCLUDE_DIRS} 56 ${LLMATH_INCLUDE_DIRS}
58 ${LLMEDIA_INCLUDE_DIRS}
59 ${LLMESSAGE_INCLUDE_DIRS} 57 ${LLMESSAGE_INCLUDE_DIRS}
58 ${LLPLUGIN_INCLUDE_DIRS}
60 ${LLPRIMITIVE_INCLUDE_DIRS} 59 ${LLPRIMITIVE_INCLUDE_DIRS}
61 ${LLRENDER_INCLUDE_DIRS} 60 ${LLRENDER_INCLUDE_DIRS}
62 ${LLUI_INCLUDE_DIRS} 61 ${LLUI_INCLUDE_DIRS}
@@ -65,7 +64,6 @@ include_directories(
65 ${LLXML_INCLUDE_DIRS} 64 ${LLXML_INCLUDE_DIRS}
66 ${LSCRIPT_INCLUDE_DIRS} 65 ${LSCRIPT_INCLUDE_DIRS}
67 ${LSCRIPT_INCLUDE_DIRS}/lscript_compile 66 ${LSCRIPT_INCLUDE_DIRS}/lscript_compile
68 ${GSTREAMER_INCLUDE_DIRS}
69 ) 67 )
70 68
71set(viewer_SOURCE_FILES 69set(viewer_SOURCE_FILES
@@ -185,9 +183,8 @@ set(viewer_SOURCE_FILES
185 llfloatergroups.cpp 183 llfloatergroups.cpp
186 llfloaterhandler.cpp 184 llfloaterhandler.cpp
187 llfloaterhardwaresettings.cpp 185 llfloaterhardwaresettings.cpp
188 llfloaterhtml.cpp
189 llfloaterhtmlcurrency.cpp 186 llfloaterhtmlcurrency.cpp
190 llfloaterhtmlhelp.cpp 187 llfloatermediabrowser.cpp
191 llfloaterhtmlsimple.cpp 188 llfloaterhtmlsimple.cpp
192 llfloaterhud.cpp 189 llfloaterhud.cpp
193 llfloaterimagepreview.cpp 190 llfloaterimagepreview.cpp
@@ -312,10 +309,12 @@ set(viewer_SOURCE_FILES
312 llpanelinput.cpp 309 llpanelinput.cpp
313 llpanelinventory.cpp 310 llpanelinventory.cpp
314 llpanelland.cpp 311 llpanelland.cpp
312 llpanellandaudio.cpp
315 llpanellandmedia.cpp 313 llpanellandmedia.cpp
316 llpanellandobjects.cpp 314 llpanellandobjects.cpp
317 llpanellandoptions.cpp 315 llpanellandoptions.cpp
318 llpanellogin.cpp 316 llpanellogin.cpp
317 llpanelmediahud.cpp
319 llpanelmsgs.cpp 318 llpanelmsgs.cpp
320 llpanelnetwork.cpp 319 llpanelnetwork.cpp
321 llpanelobject.cpp 320 llpanelobject.cpp
@@ -421,6 +420,8 @@ set(viewer_SOURCE_FILES
421 llviewerkeyboard.cpp 420 llviewerkeyboard.cpp
422 llviewerlayer.cpp 421 llviewerlayer.cpp
423 llviewermedia.cpp 422 llviewermedia.cpp
423 llviewermediafocus.cpp
424 llviewermedia_streamingaudio.cpp
424 llviewermenu.cpp 425 llviewermenu.cpp
425 llviewermenufile.cpp 426 llviewermenufile.cpp
426 llviewermessage.cpp 427 llviewermessage.cpp
@@ -467,7 +468,7 @@ set(viewer_SOURCE_FILES
467 llwearable.cpp 468 llwearable.cpp
468 llwearablelist.cpp 469 llwearablelist.cpp
469 llweb.cpp 470 llweb.cpp
470 llwebbrowserctrl.cpp 471 llmediactrl.cpp
471 llwindlightremotectrl.cpp 472 llwindlightremotectrl.cpp
472 llwind.cpp 473 llwind.cpp
473 llwlanimator.cpp 474 llwlanimator.cpp
@@ -630,9 +631,8 @@ set(viewer_HEADER_FILES
630 llfloatergroups.h 631 llfloatergroups.h
631 llfloaterhandler.h 632 llfloaterhandler.h
632 llfloaterhardwaresettings.h 633 llfloaterhardwaresettings.h
633 llfloaterhtml.h
634 llfloaterhtmlcurrency.h 634 llfloaterhtmlcurrency.h
635 llfloaterhtmlhelp.h 635 llfloatermediabrowser.h
636 llfloaterhtmlsimple.h 636 llfloaterhtmlsimple.h
637 llfloaterhud.h 637 llfloaterhud.h
638 llfloaterimagepreview.h 638 llfloaterimagepreview.h
@@ -756,11 +756,13 @@ set(viewer_HEADER_FILES
756 llpanelinput.h 756 llpanelinput.h
757 llpanelinventory.h 757 llpanelinventory.h
758 llpanelland.h 758 llpanelland.h
759 llpanellandaudio.h
759 llpanellandmedia.h 760 llpanellandmedia.h
760 llpanellandobjects.h 761 llpanellandobjects.h
761 llpanellandoptions.h 762 llpanellandoptions.h
762 llpanelLCD.h 763 llpanelLCD.h
763 llpanellogin.h 764 llpanellogin.h
765 llpanelmediahud.h
764 llpanelmsgs.h 766 llpanelmsgs.h
765 llpanelnetwork.h 767 llpanelnetwork.h
766 llpanelobject.h 768 llpanelobject.h
@@ -867,6 +869,8 @@ set(viewer_HEADER_FILES
867 llviewerkeyboard.h 869 llviewerkeyboard.h
868 llviewerlayer.h 870 llviewerlayer.h
869 llviewermedia.h 871 llviewermedia.h
872 llviewermediaobserver.h
873 llviewermediafocus.h
870 llviewermenu.h 874 llviewermenu.h
871 llviewermenufile.h 875 llviewermenufile.h
872 llviewermessage.h 876 llviewermessage.h
@@ -915,7 +919,7 @@ set(viewer_HEADER_FILES
915 llwearable.h 919 llwearable.h
916 llwearablelist.h 920 llwearablelist.h
917 llweb.h 921 llweb.h
918 llwebbrowserctrl.h 922 llmediactrl.h
919 llwind.h 923 llwind.h
920 llwindebug.h 924 llwindebug.h
921 llwindlightremotectrl.h 925 llwindlightremotectrl.h
@@ -1118,6 +1122,7 @@ if (WINDOWS)
1118 if (INTEL_MEMOPS_LIBRARY) 1122 if (INTEL_MEMOPS_LIBRARY)
1119 list(APPEND viewer_LIBRARIES ${INTEL_MEMOPS_LIBRARY}) 1123 list(APPEND viewer_LIBRARIES ${INTEL_MEMOPS_LIBRARY})
1120 endif (INTEL_MEMOPS_LIBRARY) 1124 endif (INTEL_MEMOPS_LIBRARY)
1125 use_prebuilt_binary(dbghelp)
1121endif (WINDOWS) 1126endif (WINDOWS)
1122 1127
1123# Add the xui files. This is handy for searching for xui elements 1128# Add the xui files. This is handy for searching for xui elements
@@ -1134,6 +1139,8 @@ set(viewer_XUI_FILES
1134 1139
1135 1140
1136 ) 1141 )
1142list(APPEND viewer_XUI_FILES ${viewer_XUI_FILE_GLOB_LIST})
1143list(SORT viewer_XUI_FILES)
1137 1144
1138list(APPEND viewer_XUI_FILES ${viewer_XUI_FILE_GLOB_LIST}) 1145list(APPEND viewer_XUI_FILES ${viewer_XUI_FILE_GLOB_LIST})
1139list(SORT viewer_XUI_FILES) 1146list(SORT viewer_XUI_FILES)
@@ -1169,6 +1176,7 @@ set(viewer_APPSETTINGS_FILES
1169 ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg 1176 ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
1170 ) 1177 )
1171 1178
1179
1172source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES}) 1180source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES})
1173 1181
1174set_source_files_properties(${viewer_APPSETTINGS_FILES} 1182set_source_files_properties(${viewer_APPSETTINGS_FILES}
@@ -1326,6 +1334,9 @@ if (WINDOWS)
1326 --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat 1334 --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat
1327 DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py 1335 DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
1328 ) 1336 )
1337
1338 add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit)
1339
1329 if (PACKAGE) 1340 if (PACKAGE)
1330 add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat) 1341 add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat)
1331 add_dependencies(package windows-updater windows-crash-logger) 1342 add_dependencies(package windows-updater windows-crash-logger)
@@ -1338,8 +1349,8 @@ target_link_libraries(${VIEWER_BINARY_NAME}
1338 ${LLIMAGE_LIBRARIES} 1349 ${LLIMAGE_LIBRARIES}
1339 ${LLIMAGEJ2COJ_LIBRARIES} 1350 ${LLIMAGEJ2COJ_LIBRARIES}
1340 ${LLINVENTORY_LIBRARIES} 1351 ${LLINVENTORY_LIBRARIES}
1341 ${LLMEDIA_LIBRARIES}
1342 ${LLMESSAGE_LIBRARIES} 1352 ${LLMESSAGE_LIBRARIES}
1353 ${LLPLUGIN_LIBRARIES}
1343 ${LLPRIMITIVE_LIBRARIES} 1354 ${LLPRIMITIVE_LIBRARIES}
1344 ${LLRENDER_LIBRARIES} 1355 ${LLRENDER_LIBRARIES}
1345 ${FREETYPE_LIBRARIES} 1356 ${FREETYPE_LIBRARIES}
@@ -1361,7 +1372,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
1361 ${OPENGL_LIBRARIES} 1372 ${OPENGL_LIBRARIES}
1362 ${FMODWRAPPER_LIBRARY} 1373 ${FMODWRAPPER_LIBRARY}
1363 ${OPENGL_LIBRARIES} 1374 ${OPENGL_LIBRARIES}
1364 ${MOZLIB_LIBRARIES}
1365 ${JSONCPP_LIBRARIES} 1375 ${JSONCPP_LIBRARIES}
1366 ${SDL_LIBRARY} 1376 ${SDL_LIBRARY}
1367 ${SMARTHEAP_LIBRARY} 1377 ${SMARTHEAP_LIBRARY}
@@ -1443,6 +1453,8 @@ if (DARWIN)
1443 DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py 1453 DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
1444 ) 1454 )
1445 1455
1456 add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_gstreamer010 media_plugin_webkit)
1457
1446 if (PACKAGE) 1458 if (PACKAGE)
1447 add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME}) 1459 add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME})
1448 add_dependencies(package mac-updater mac-crash-logger) 1460 add_dependencies(package mac-updater mac-crash-logger)
@@ -1461,6 +1473,8 @@ if (DARWIN)
1461 --build=${CMAKE_CURRENT_BINARY_DIR} 1473 --build=${CMAKE_CURRENT_BINARY_DIR}
1462 --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app 1474 --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
1463 --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched 1475 --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
1476
1477 add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit)
1464 DEPENDS 1478 DEPENDS
1465 ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py 1479 ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
1466 ) 1480 )
@@ -1492,3 +1506,65 @@ if (INSTALL)
1492endif (INSTALL) 1506endif (INSTALL)
1493 1507
1494ADD_VIEWER_BUILD_TEST(llagentaccess viewer) 1508ADD_VIEWER_BUILD_TEST(llagentaccess viewer)
1509
1510# Don't do these for DARWIN or LINUX here -- they're taken care of by viewer_manifest.py
1511if (WINDOWS)
1512 get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION)
1513 add_custom_command(
1514 TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1515 COMMAND ${CMAKE_COMMAND}
1516 ARGS
1517 -E
1518 copy_if_different
1519 ${BUILT_SLPLUGIN}
1520 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
1521 COMMENT "Copying SLPlugin executable to the runtime folder."
1522 )
1523
1524 get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
1525 add_custom_command(
1526 TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1527 COMMAND ${CMAKE_COMMAND}
1528 ARGS
1529 -E
1530 copy_if_different
1531 ${BUILT_WEBKIT_PLUGIN}
1532 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin
1533 COMMENT "Copying WebKit Plugin to the runtime folder."
1534 )
1535
1536 get_target_property(BUILT_QUICKTIME_PLUGIN media_plugin_quicktime LOCATION)
1537 add_custom_command(
1538 TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1539 COMMAND ${CMAKE_COMMAND}
1540 ARGS
1541 -E
1542 copy_if_different
1543 ${BUILT_QUICKTIME_PLUGIN}
1544 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin
1545 COMMENT "Copying Quicktime Plugin to the runtime folder."
1546 )
1547
1548 # Copying the mime_types.xml file to app_settings
1549 set(mime_types_source "${CMAKE_SOURCE_DIR}/newview/skins/default/xui/en-us")
1550 set(mime_types_dest "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/app_settings")
1551 add_custom_command(
1552 TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1553 COMMAND ${CMAKE_COMMAND}
1554 ARGS
1555 -E
1556 copy_if_different
1557 ${mime_types_source}/mime_types_windows.xml
1558 ${mime_types_dest}/mime_types.xml
1559 COMMENT "Copying mime_types_windows.xml to mime_types.xml."
1560 )
1561
1562endif (WINDOWS)
1563
1564if (DARWIN)
1565# Don't do this here -- it's taken care of by viewer_manifest.py
1566# add_custom_command(TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1567# COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release/libllqtwebkit.dylib ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin/
1568# DEPENDS ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release/libllqtwebkit.dylib
1569# )
1570endif (DARWIN)
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 0a27aa2..4d80845 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -7624,7 +7624,40 @@
7624 <key>Value</key> 7624 <key>Value</key>
7625 <integer>0</integer> 7625 <integer>0</integer>
7626 </map> 7626 </map>
7627 <key>MemoryLogFrequency</key> 7627 <key>MediaControlFadeTime</key>
7628 <map>
7629 <key>Comment</key>
7630 <string>Amount of time (in seconds) that the media control fades</string>
7631 <key>Persist</key>
7632 <integer>1</integer>
7633 <key>Type</key>
7634 <string>F32</string>
7635 <key>Value</key>
7636 <real>1.5</real>
7637 </map>
7638 <key>MediaControlTimeout</key>
7639 <map>
7640 <key>Comment</key>
7641 <string>Amount of time (in seconds) for media controls to fade with no mouse activity</string>
7642 <key>Persist</key>
7643 <integer>1</integer>
7644 <key>Type</key>
7645 <string>F32</string>
7646 <key>Value</key>
7647 <real>3.0</real>
7648 </map>
7649 <key>MediaOnAPrimUI</key>
7650 <map>
7651 <key>Comment</key>
7652 <string>Whether or not to show the "link sharing" UI</string>
7653 <key>Persist</key>
7654 <integer>1</integer>
7655 <key>Type</key>
7656 <string>Boolean</string>
7657 <key>Value</key>
7658 <integer>0</integer>
7659 </map>
7660 <key>MemoryLogFrequency</key>
7628 <map> 7661 <map>
7629 <key>Comment</key> 7662 <key>Comment</key>
7630 <string>Seconds between display of Memory in log (0 for never)</string> 7663 <string>Seconds between display of Memory in log (0 for never)</string>
diff --git a/linden/indra/newview/chatbar_as_cmdline.cpp b/linden/indra/newview/chatbar_as_cmdline.cpp
index 59804c0..d90bcd8 100644
--- a/linden/indra/newview/chatbar_as_cmdline.cpp
+++ b/linden/indra/newview/chatbar_as_cmdline.cpp
@@ -16,7 +16,7 @@
16 * may be used to endorse or promote products derived from this 16 * may be used to endorse or promote products derived from this
17 * software without specific prior written permission. 17 * software without specific prior written permission.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY MODULAR SYSTEMS AND CONTRIBUTORS AS IS 19 * THIS SOFTWARE IS PROVIDED BY MODULAR SYSTEMS AND CONTRIBUTORS �AS IS�
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MODULAR SYSTEMS OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MODULAR SYSTEMS OR CONTRIBUTORS
@@ -69,7 +69,7 @@
69#include "llviewerparcelmgr.h" 69#include "llviewerparcelmgr.h"
70#include "llviewerparcelmedia.h" 70#include "llviewerparcelmedia.h"
71#include "llparcel.h" 71#include "llparcel.h"
72#include "audioengine.h" 72#include "llaudioengine.h"
73#include "llviewerparcelmediaautoplay.h" 73#include "llviewerparcelmediaautoplay.h"
74#include "lloverlaybar.h" 74#include "lloverlaybar.h"
75#include "lggautocorrectfloater.h" 75#include "lggautocorrectfloater.h"
diff --git a/linden/indra/newview/floatervoicelicense.cpp b/linden/indra/newview/floatervoicelicense.cpp
index 4004290..74d16c3 100644
--- a/linden/indra/newview/floatervoicelicense.cpp
+++ b/linden/indra/newview/floatervoicelicense.cpp
@@ -27,7 +27,7 @@
27* COMPLETENESS OR PERFORMANCE. 27* COMPLETENESS OR PERFORMANCE.
28* $/LicenseInfo$ 28* $/LicenseInfo$
29*/ 29*/
30 30/*
31#include "llviewerprecompiledheaders.h" 31#include "llviewerprecompiledheaders.h"
32 32
33#include "floatervoicelicense.h" 33#include "floatervoicelicense.h"
@@ -234,4 +234,4 @@ void FloaterVoiceLicense::onNavigateComplete( const EventType& eventIn )
234 LLCheckBoxCtrl * license_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); 234 LLCheckBoxCtrl * license_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
235 license_agreement->setEnabled( true ); 235 license_agreement->setEnabled( true );
236 } 236 }
237} 237}*/
diff --git a/linden/indra/newview/floatervoicelicense.h b/linden/indra/newview/floatervoicelicense.h
index 4130d22..9d2012d 100644
--- a/linden/indra/newview/floatervoicelicense.h
+++ b/linden/indra/newview/floatervoicelicense.h
@@ -35,8 +35,8 @@
35 35
36#include "llmodaldialog.h" 36#include "llmodaldialog.h"
37#include "llassetstorage.h" 37#include "llassetstorage.h"
38#include "llwebbrowserctrl.h" 38//imprudence fixme: removed for media plugins #include "llwebbrowserctrl.h"
39 39/*
40class LLButton; 40class LLButton;
41class LLRadioGroup; 41class LLRadioGroup;
42class LLVFS; 42class LLVFS;
@@ -45,7 +45,7 @@ class LLUUID;
45 45
46class FloaterVoiceLicense : 46class FloaterVoiceLicense :
47 public LLModalDialog, 47 public LLModalDialog,
48 public LLWebBrowserCtrlObserver, 48 public LLViewerMediaObserver
49 public LLFloaterSingleton<FloaterVoiceLicense> 49 public LLFloaterSingleton<FloaterVoiceLicense>
50{ 50{
51public: 51public:
@@ -67,6 +67,6 @@ public:
67private: 67private:
68 int mWebBrowserWindowId; 68 int mWebBrowserWindowId;
69 int mLoadCompleteCount; 69 int mLoadCompleteCount;
70}; 70};*/
71 71
72#endif // FLOATERVOICELICENSE_H 72#endif // FLOATERVOICELICENSE_H
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index 51b6c53..5bcffdb 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -77,6 +77,7 @@
77#include "llfloaterdirectory.h" 77#include "llfloaterdirectory.h"
78#include "llfloatergroupinfo.h" 78#include "llfloatergroupinfo.h"
79#include "llfloatergroups.h" 79#include "llfloatergroups.h"
80#include "llfloaterland.h"
80#include "llfloatermap.h" 81#include "llfloatermap.h"
81#include "llfloatermute.h" 82#include "llfloatermute.h"
82#include "llfloatersnapshot.h" 83#include "llfloatersnapshot.h"
@@ -113,6 +114,7 @@
113#include "llurldispatcher.h" 114#include "llurldispatcher.h"
114#include "llviewercamera.h" 115#include "llviewercamera.h"
115#include "llviewerinventory.h" 116#include "llviewerinventory.h"
117#include "llviewermediafocus.h"
116#include "llviewermenu.h" 118#include "llviewermenu.h"
117#include "llviewernetwork.h" 119#include "llviewernetwork.h"
118#include "llviewerobjectlist.h" 120#include "llviewerobjectlist.h"
@@ -6061,7 +6063,11 @@ bool LLAgent::teleportCore(bool is_local)
6061 LLFloaterWorldMap::hide(NULL); 6063 LLFloaterWorldMap::hide(NULL);
6062 LLFloaterDirectory::hide(NULL); 6064 LLFloaterDirectory::hide(NULL);
6063 6065
6066 // hide land floater too - it'll be out of date
6067 LLFloaterLand::hideInstance();
6068
6064 LLViewerParcelMgr::getInstance()->deselectLand(); 6069 LLViewerParcelMgr::getInstance()->deselectLand();
6070 LLViewerMediaFocus::getInstance()->setFocusFace(false, NULL, 0, NULL);
6065 6071
6066 // Close all pie menus, deselect land, etc. 6072 // Close all pie menus, deselect land, etc.
6067 // Don't change the camera until we know teleport succeeded. JC 6073 // Don't change the camera until we know teleport succeeded. JC
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index b3f3e59..86c83b9 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -61,8 +61,8 @@
61#include "llviewerwindow.h" 61#include "llviewerwindow.h"
62#include "llviewerdisplay.h" 62#include "llviewerdisplay.h"
63#include "llviewermedia.h" 63#include "llviewermedia.h"
64 64#include "llviewerparcelmedia.h"
65 65#include "llviewermediafocus.h"
66#include "llviewermessage.h" 66#include "llviewermessage.h"
67#include "llviewerobjectlist.h" 67#include "llviewerobjectlist.h"
68#include "llworldmap.h" 68#include "llworldmap.h"
@@ -103,7 +103,8 @@
103#include "llassetstorage.h" 103#include "llassetstorage.h"
104#include "llpolymesh.h" 104#include "llpolymesh.h"
105#include "llcachename.h" 105#include "llcachename.h"
106#include "audioengine.h" 106#include "llaudioengine.h"
107#include "llstreamingaudio.h"
107#include "llviewermenu.h" 108#include "llviewermenu.h"
108#include "llselectmgr.h" 109#include "llselectmgr.h"
109#include "lltrans.h" 110#include "lltrans.h"
@@ -1257,6 +1258,14 @@ bool LLAppViewer::cleanup()
1257 1258
1258 if (gAudiop) 1259 if (gAudiop)
1259 { 1260 {
1261 // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
1262
1263 LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl();
1264 delete sai;
1265 gAudiop->setStreamingAudioImpl(NULL);
1266
1267 // shut down the audio subsystem
1268
1260 bool want_longname = false; 1269 bool want_longname = false;
1261 if (gAudiop->getDriverName(want_longname) == "FMOD") 1270 if (gAudiop->getDriverName(want_longname) == "FMOD")
1262 { 1271 {
@@ -1483,7 +1492,9 @@ bool LLAppViewer::cleanup()
1483 //Note: 1492 //Note:
1484 //LLViewerMedia::cleanupClass() has to be put before gImageList.shutdown() 1493 //LLViewerMedia::cleanupClass() has to be put before gImageList.shutdown()
1485 //because some new image might be generated during cleaning up media. --bao 1494 //because some new image might be generated during cleaning up media. --bao
1495 LLViewerMediaFocus::cleanupClass();
1486 LLViewerMedia::cleanupClass(); 1496 LLViewerMedia::cleanupClass();
1497 LLViewerParcelMedia::cleanupClass();
1487 gImageList.shutdown(); // shutdown again in case a callback added something 1498 gImageList.shutdown(); // shutdown again in case a callback added something
1488 LLUIImageList::getInstance()->cleanUp(); 1499 LLUIImageList::getInstance()->cleanUp();
1489 1500
@@ -3671,6 +3682,9 @@ void LLAppViewer::idle()
3671 gAgent.updateCamera(); 3682 gAgent.updateCamera();
3672 } 3683 }
3673 3684
3685 // update media focus
3686 LLViewerMediaFocus::getInstance()->update();
3687
3674 // objects and camera should be in sync, do LOD calculations now 3688 // objects and camera should be in sync, do LOD calculations now
3675 { 3689 {
3676 LLFastTimer t(LLFastTimer::FTM_LOD_UPDATE); 3690 LLFastTimer t(LLFastTimer::FTM_LOD_UPDATE);
diff --git a/linden/indra/newview/llappviewerlinux.cpp b/linden/indra/newview/llappviewerlinux.cpp
index bfad899..307f925 100644
--- a/linden/indra/newview/llappviewerlinux.cpp
+++ b/linden/indra/newview/llappviewerlinux.cpp
@@ -437,7 +437,7 @@ gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **succ
437 llinfos << "Was asked to go to slurl: " << slurl << llendl; 437 llinfos << "Was asked to go to slurl: " << slurl << llendl;
438 438
439 std::string url = slurl; 439 std::string url = slurl;
440 LLWebBrowserCtrl* web = NULL; 440 LLMediaCtrl* web = NULL;
441 const bool trusted_browser = false; 441 const bool trusted_browser = false;
442 if (LLURLDispatcher::dispatch(url, web, trusted_browser)) 442 if (LLURLDispatcher::dispatch(url, web, trusted_browser))
443 { 443 {
diff --git a/linden/indra/newview/llappviewermacosx.cpp b/linden/indra/newview/llappviewermacosx.cpp
index 3cd0836..3a993eb 100644
--- a/linden/indra/newview/llappviewermacosx.cpp
+++ b/linden/indra/newview/llappviewermacosx.cpp
@@ -1,6 +1,6 @@
1/** 1/**
2 * @file llappviewermacosx.cpp 2 * @file llappviewermacosx.cpp
3 * @brief The LLAppViewerWin32 class definitions 3 * @brief The LLAppViewerMacOSX class definitions
4 * 4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$ 5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 * 6 *
@@ -476,7 +476,7 @@ OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn)
476 url.replace(0, prefix.length(), "secondlife:///app/"); 476 url.replace(0, prefix.length(), "secondlife:///app/");
477 } 477 }
478 478
479 LLWebBrowserCtrl* web = NULL; 479 LLMediaCtrl* web = NULL;
480 const bool trusted_browser = false; 480 const bool trusted_browser = false;
481 LLURLDispatcher::dispatch(url, web, trusted_browser); 481 LLURLDispatcher::dispatch(url, web, trusted_browser);
482 } 482 }
diff --git a/linden/indra/newview/llassetuploadresponders.cpp b/linden/indra/newview/llassetuploadresponders.cpp
index aff1fb8..b9ec9a0 100644
--- a/linden/indra/newview/llassetuploadresponders.cpp
+++ b/linden/indra/newview/llassetuploadresponders.cpp
@@ -287,7 +287,8 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
287 LLInventoryView* view = LLInventoryView::getActiveInventory(); 287 LLInventoryView* view = LLInventoryView::getActiveInventory();
288 if(view) 288 if(view)
289 { 289 {
290 LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); 290 LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
291
291 view->getPanel()->setSelection(content["new_inventory_item"].asUUID(), TAKE_FOCUS_NO); 292 view->getPanel()->setSelection(content["new_inventory_item"].asUUID(), TAKE_FOCUS_NO);
292 if((LLAssetType::AT_TEXTURE == asset_type || LLAssetType::AT_SOUND == asset_type) 293 if((LLAssetType::AT_TEXTURE == asset_type || LLAssetType::AT_SOUND == asset_type)
293 && LLFilePicker::instance().getFileCount() <= FILE_COUNT_DISPLAY_THRESHOLD) 294 && LLFilePicker::instance().getFileCount() <= FILE_COUNT_DISPLAY_THRESHOLD)
@@ -296,7 +297,7 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
296 } 297 }
297 //LLInventoryView::dumpSelectionInformation((void*)view); 298 //LLInventoryView::dumpSelectionInformation((void*)view);
298 // restore keyboard focus 299 // restore keyboard focus
299 gFocusMgr.setKeyboardFocus(focus_ctrl); 300 gFocusMgr.setKeyboardFocus(focus);
300 } 301 }
301 } 302 }
302 else 303 else
diff --git a/linden/indra/newview/llaudiosourcevo.h b/linden/indra/newview/llaudiosourcevo.h
index e7bb283..4b70f8b 100644
--- a/linden/indra/newview/llaudiosourcevo.h
+++ b/linden/indra/newview/llaudiosourcevo.h
@@ -34,7 +34,7 @@
34#ifndef LL_LLAUDIOSOURCEVO_H 34#ifndef LL_LLAUDIOSOURCEVO_H
35#define LL_LLAUDIOSOURCEVO_H 35#define LL_LLAUDIOSOURCEVO_H
36 36
37#include "audioengine.h" 37#include "llaudioengine.h"
38#include "llviewerobject.h" 38#include "llviewerobject.h"
39 39
40class LLViewerObject; 40class LLViewerObject;
diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp
index 0a4ca34..99a2a22 100644
--- a/linden/indra/newview/llchatbar.cpp
+++ b/linden/indra/newview/llchatbar.cpp
@@ -955,7 +955,7 @@ public:
955 955
956 // Your code here 956 // Your code here
957 bool handle(const LLSD& tokens, const LLSD& query_map, 957 bool handle(const LLSD& tokens, const LLSD& query_map,
958 LLWebBrowserCtrl* web) 958 LLMediaCtrl* web)
959 { 959 {
960 if (tokens.size() < 2) return false; 960 if (tokens.size() < 2) return false;
961 S32 channel = tokens[0].asInteger(); 961 S32 channel = tokens[0].asInteger();
diff --git a/linden/indra/newview/llcommandhandler.cpp b/linden/indra/newview/llcommandhandler.cpp
index 422c94a..a04182a 100644
--- a/linden/indra/newview/llcommandhandler.cpp
+++ b/linden/indra/newview/llcommandhandler.cpp
@@ -55,7 +55,7 @@ public:
55 bool dispatch(const std::string& cmd, 55 bool dispatch(const std::string& cmd,
56 const LLSD& params, 56 const LLSD& params,
57 const LLSD& query_map, 57 const LLSD& query_map,
58 LLWebBrowserCtrl* web, 58 LLMediaCtrl* web,
59 bool trusted_browser); 59 bool trusted_browser);
60 60
61private: 61private:
@@ -84,7 +84,7 @@ void LLCommandHandlerRegistry::add(const char* cmd, bool require_trusted_browser
84bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, 84bool LLCommandHandlerRegistry::dispatch(const std::string& cmd,
85 const LLSD& params, 85 const LLSD& params,
86 const LLSD& query_map, 86 const LLSD& query_map,
87 LLWebBrowserCtrl* web, 87 LLMediaCtrl* web,
88 bool trusted_browser) 88 bool trusted_browser)
89{ 89{
90 std::map<std::string, LLCommandHandlerInfo>::iterator it = mMap.find(cmd); 90 std::map<std::string, LLCommandHandlerInfo>::iterator it = mMap.find(cmd);
@@ -126,7 +126,7 @@ LLCommandHandler::~LLCommandHandler()
126bool LLCommandDispatcher::dispatch(const std::string& cmd, 126bool LLCommandDispatcher::dispatch(const std::string& cmd,
127 const LLSD& params, 127 const LLSD& params,
128 const LLSD& query_map, 128 const LLSD& query_map,
129 LLWebBrowserCtrl* web, 129 LLMediaCtrl* web,
130 bool trusted_browser) 130 bool trusted_browser)
131{ 131{
132 return LLCommandHandlerRegistry::instance().dispatch( 132 return LLCommandHandlerRegistry::instance().dispatch(
diff --git a/linden/indra/newview/llcommandhandler.h b/linden/indra/newview/llcommandhandler.h
index ab4c2cc..5cb3ee7 100644
--- a/linden/indra/newview/llcommandhandler.h
+++ b/linden/indra/newview/llcommandhandler.h
@@ -47,7 +47,7 @@ public:
47 47
48 // Your code here 48 // Your code here
49 bool handle(const LLSD& tokens, const LLSD& query_map, 49 bool handle(const LLSD& tokens, const LLSD& query_map,
50 LLWebBrowserCtrl* web) 50 LLMediaCtrl* web)
51 { 51 {
52 if (tokens.size() < 1) return false; 52 if (tokens.size() < 1) return false;
53 LLUUID id( tokens[0] ); 53 LLUUID id( tokens[0] );
@@ -60,7 +60,7 @@ LLFooHandler gFooHandler;
60 60
61*/ 61*/
62 62
63class LLWebBrowserCtrl; 63class LLMediaCtrl;
64 64
65class LLCommandHandler 65class LLCommandHandler
66{ 66{
@@ -68,14 +68,14 @@ public:
68 LLCommandHandler(const char* command, bool allow_from_untrusted_browser); 68 LLCommandHandler(const char* command, bool allow_from_untrusted_browser);
69 // Automatically registers object to get called when 69 // Automatically registers object to get called when
70 // command is executed. All commands can be processed 70 // command is executed. All commands can be processed
71 // in links from LLWebBrowserCtrl, but some (like teleport) 71 // in links from LLMediaCtrl, but some (like teleport)
72 // should not be allowed from outside the app. 72 // should not be allowed from outside the app.
73 73
74 virtual ~LLCommandHandler(); 74 virtual ~LLCommandHandler();
75 75
76 virtual bool handle(const LLSD& params, 76 virtual bool handle(const LLSD& params,
77 const LLSD& query_map, 77 const LLSD& query_map,
78 LLWebBrowserCtrl* web) = 0; 78 LLMediaCtrl* web) = 0;
79 // For URL secondlife:///app/foo/bar/baz?cat=1&dog=2 79 // For URL secondlife:///app/foo/bar/baz?cat=1&dog=2
80 // @params - array of "bar", "baz", possibly empty 80 // @params - array of "bar", "baz", possibly empty
81 // @query_map - map of "cat" -> 1, "dog" -> 2, possibly empty 81 // @query_map - map of "cat" -> 1, "dog" -> 2, possibly empty
@@ -91,7 +91,7 @@ public:
91 static bool dispatch(const std::string& cmd, 91 static bool dispatch(const std::string& cmd,
92 const LLSD& params, 92 const LLSD& params,
93 const LLSD& query_map, 93 const LLSD& query_map,
94 LLWebBrowserCtrl* web, 94 LLMediaCtrl* web,
95 bool trusted_browser); 95 bool trusted_browser);
96 // Execute a command registered via the above mechanism, 96 // Execute a command registered via the above mechanism,
97 // passing string parameters. 97 // passing string parameters.
diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp
index e82aa96..ca8614c 100644
--- a/linden/indra/newview/llfirstuse.cpp
+++ b/linden/indra/newview/llfirstuse.cpp
@@ -397,8 +397,8 @@ void LLFirstUse::voiceLicenseAgreement()
397 { 397 {
398 gSavedSettings.setWarning("FirstVoiceLicense", FALSE); 398 gSavedSettings.setWarning("FirstVoiceLicense", FALSE);
399 399
400 FloaterVoiceLicense::getInstance()->open(); 400// imprudence fixme FloaterVoiceLicense::getInstance()->open();
401 FloaterVoiceLicense::getInstance()->center(); 401// FloaterVoiceLicense::getInstance()->center();
402 } 402 }
403 else // currently in STATE_LOGIN_VOICE_LICENSE when arriving here 403 else // currently in STATE_LOGIN_VOICE_LICENSE when arriving here
404 { 404 {
diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp
index 1945df4..d2d1250 100644
--- a/linden/indra/newview/llfloaterabout.cpp
+++ b/linden/indra/newview/llfloaterabout.cpp
@@ -42,7 +42,7 @@
42 42
43#include "llcurl.h" 43#include "llcurl.h"
44#include "llimagej2c.h" 44#include "llimagej2c.h"
45#include "audioengine.h" 45#include "llaudioengine.h"
46 46
47#include "hippoGridManager.h" 47#include "hippoGridManager.h"
48#include "llviewertexteditor.h" 48#include "llviewertexteditor.h"
@@ -57,7 +57,6 @@
57#include "lltrans.h" 57#include "lltrans.h"
58#include "llappviewer.h" 58#include "llappviewer.h"
59#include "llglheaders.h" 59#include "llglheaders.h"
60#include "llmediamanager.h"
61#include "llwindow.h" 60#include "llwindow.h"
62#include "viewerversion.h" 61#include "viewerversion.h"
63 62
@@ -244,26 +243,10 @@ LLFloaterAbout::LLFloaterAbout()
244 243
245 support.append("\n"); 244 support.append("\n");
246 245
247 LLMediaManager *mgr = LLMediaManager::getInstance(); 246 // TODO: Implement media plugin version query
248 if (mgr) 247
249 { 248 support.append("Qt Webkit Version: 4.5.2 ");
250 LLMediaBase *gstreamer = mgr->createSourceFromMimeType("http", "audio/mpeg"); 249 support.append("\n");
251 if (gstreamer)
252 {
253 support.append("GStreamer Version: ");
254 support.append( gstreamer->getVersion() );
255 support.append("\n");
256 }
257
258 LLMediaBase *media_source = mgr->createSourceFromMimeType("http", "text/html");
259 if (media_source)
260 {
261 support.append("LLMozLib Version: ");
262 support.append(media_source->getVersion());
263 support.append("\n");
264 mgr->destroySource(media_source);
265 }
266 }
267 250
268 if (gPacketsIn > 0) 251 if (gPacketsIn > 0)
269 { 252 {
diff --git a/linden/indra/newview/llfloateravatarinfo.cpp b/linden/indra/newview/llfloateravatarinfo.cpp
index 21f160e..0618875 100644
--- a/linden/indra/newview/llfloateravatarinfo.cpp
+++ b/linden/indra/newview/llfloateravatarinfo.cpp
@@ -63,7 +63,7 @@ public:
63 LLAgentHandler() : LLCommandHandler("agent", true) { } 63 LLAgentHandler() : LLCommandHandler("agent", true) { }
64 64
65 bool handle(const LLSD& params, const LLSD& query_map, 65 bool handle(const LLSD& params, const LLSD& query_map,
66 LLWebBrowserCtrl* web) 66 LLMediaCtrl* web)
67 { 67 {
68 if (params.size() < 2) return false; 68 if (params.size() < 2) return false;
69 LLUUID agent_id; 69 LLUUID agent_id;
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp
index 59f4d70..2daa5aa 100644
--- a/linden/indra/newview/llfloaterchat.cpp
+++ b/linden/indra/newview/llfloaterchat.cpp
@@ -190,6 +190,15 @@ void LLFloaterChat::setMinimized(BOOL minimized)
190 updateConsoleVisibility(); 190 updateConsoleVisibility();
191} 191}
192 192
193// linden library includes
194#include "llaudioengine.h"
195#include "llchat.h"
196#include "llfontgl.h"
197#include "llrect.h"
198#include "llerror.h"
199#include "llstring.h"
200#include "llwindow.h"
201#include "message.h"
193 202
194void LLFloaterChat::updateConsoleVisibility() 203void LLFloaterChat::updateConsoleVisibility()
195{ 204{
@@ -583,13 +592,54 @@ void LLFloaterChat::addChat(const LLChat& chat,
583 if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) 592 if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory"))
584 addChatHistory(chat,false); 593 addChatHistory(chat,false);
585 594
586 LLTextParser* highlight = LLTextParser::getInstance(); 595 triggerAlerts(chat.mText);
587 highlight->triggerAlerts(gAgent.getID(), gAgent.getPositionGlobal(), chat.mText, gViewerWindow->getWindow());
588 596
589 if(!from_instant_message) 597 if(!from_instant_message)
590 addChatHistory(chat); 598 addChatHistory(chat);
591} 599}
592 600
601// Moved from lltextparser.cpp to break llui/llaudio library dependency.
602//static
603void LLFloaterChat::triggerAlerts(const std::string& text)
604{
605 LLTextParser* parser = LLTextParser::getInstance();
606// bool spoken=FALSE;
607 for (S32 i=0;i<parser->mHighlights.size();i++)
608 {
609 LLSD& highlight = parser->mHighlights[i];
610 if (parser->findPattern(text,highlight) >= 0 )
611 {
612 if(gAudiop)
613 {
614 if ((std::string)highlight["sound_lluuid"] != LLUUID::null.asString())
615 {
616 gAudiop->triggerSound(highlight["sound_lluuid"].asUUID(),
617 gAgent.getID(),
618 1.f,
619 LLAudioEngine::AUDIO_TYPE_UI,
620 gAgent.getPositionGlobal() );
621 }
622/*
623 if (!spoken)
624 {
625 LLTextToSpeech* text_to_speech = NULL;
626 text_to_speech = LLTextToSpeech::getInstance();
627 spoken = text_to_speech->speak((LLString)highlight["voice"],text);
628 }
629 */
630 }
631 if (highlight["flash"])
632 {
633 LLWindow* viewer_window = gViewerWindow->getWindow();
634 if (viewer_window && viewer_window->getMinimized())
635 {
636 viewer_window->flashIcon(5.f);
637 }
638 }
639 }
640 }
641}
642
593LLColor4 get_text_color(const LLChat& chat) 643LLColor4 get_text_color(const LLChat& chat)
594{ 644{
595 LLColor4 text_color; 645 LLColor4 text_color;
diff --git a/linden/indra/newview/llfloaterchat.h b/linden/indra/newview/llfloaterchat.h
index 5a26567..f8683b9 100644
--- a/linden/indra/newview/llfloaterchat.h
+++ b/linden/indra/newview/llfloaterchat.h
@@ -78,6 +78,8 @@ public:
78 // Add chat to history alone. 78 // Add chat to history alone.
79 static void addChatHistory(const LLChat& chat, bool log_to_file = true); 79 static void addChatHistory(const LLChat& chat, bool log_to_file = true);
80 80
81 static void triggerAlerts(const std::string& text);
82
81 static void onClickMute(void *data); 83 static void onClickMute(void *data);
82 static void onClickToggleShowMute(LLUICtrl* caller, void *data); 84 static void onClickToggleShowMute(LLUICtrl* caller, void *data);
83 static void onClickToggleTranslateChat(LLUICtrl* caller, void *data); 85 static void onClickToggleTranslateChat(LLUICtrl* caller, void *data);
diff --git a/linden/indra/newview/llfloaterclassified.cpp b/linden/indra/newview/llfloaterclassified.cpp
index d426e04..0760303 100644
--- a/linden/indra/newview/llfloaterclassified.cpp
+++ b/linden/indra/newview/llfloaterclassified.cpp
@@ -57,7 +57,7 @@ public:
57 // requires trusted browser to trigger 57 // requires trusted browser to trigger
58 LLClassifiedHandler() : LLCommandHandler("classified", true) { } 58 LLClassifiedHandler() : LLCommandHandler("classified", true) { }
59 bool handle(const LLSD& tokens, const LLSD& query_map, 59 bool handle(const LLSD& tokens, const LLSD& query_map,
60 LLWebBrowserCtrl* web) 60 LLMediaCtrl* web)
61 { 61 {
62 if (tokens.size() < 2) 62 if (tokens.size() < 2)
63 { 63 {
diff --git a/linden/indra/newview/llfloaterevent.cpp b/linden/indra/newview/llfloaterevent.cpp
index 485c13c..0ec2a76 100644
--- a/linden/indra/newview/llfloaterevent.cpp
+++ b/linden/indra/newview/llfloaterevent.cpp
@@ -58,7 +58,7 @@ public:
58 // requires trusted browser to trigger 58 // requires trusted browser to trigger
59 LLEventHandler() : LLCommandHandler("event", true) { } 59 LLEventHandler() : LLCommandHandler("event", true) { }
60 bool handle(const LLSD& tokens, const LLSD& query_map, 60 bool handle(const LLSD& tokens, const LLSD& query_map,
61 LLWebBrowserCtrl* web) 61 LLMediaCtrl* web)
62 { 62 {
63 if (tokens.size() < 2) 63 if (tokens.size() < 2)
64 { 64 {
diff --git a/linden/indra/newview/llfloatergroupinfo.cpp b/linden/indra/newview/llfloatergroupinfo.cpp
index 6fbd5e1..3ae7d5a 100644
--- a/linden/indra/newview/llfloatergroupinfo.cpp
+++ b/linden/indra/newview/llfloatergroupinfo.cpp
@@ -60,7 +60,7 @@ public:
60 // requires trusted browser to trigger 60 // requires trusted browser to trigger
61 LLGroupHandler() : LLCommandHandler("group", true) { } 61 LLGroupHandler() : LLCommandHandler("group", true) { }
62 bool handle(const LLSD& tokens, const LLSD& query_map, 62 bool handle(const LLSD& tokens, const LLSD& query_map,
63 LLWebBrowserCtrl* web) 63 LLMediaCtrl* web)
64 { 64 {
65 if (tokens.size() < 1) 65 if (tokens.size() < 1)
66 { 66 {
diff --git a/linden/indra/newview/llfloaterhandler.cpp b/linden/indra/newview/llfloaterhandler.cpp
index f4c7e43..7cf7156 100644
--- a/linden/indra/newview/llfloaterhandler.cpp
+++ b/linden/indra/newview/llfloaterhandler.cpp
@@ -31,7 +31,7 @@
31#include "llfloaterhandler.h" 31#include "llfloaterhandler.h"
32 32
33#include "llfloater.h" 33#include "llfloater.h"
34#include "llwebbrowserctrl.h" 34#include "llmediactrl.h"
35 35
36// register with dispatch via global object 36// register with dispatch via global object
37LLFloaterHandler gFloaterHandler; 37LLFloaterHandler gFloaterHandler;
@@ -54,7 +54,7 @@ LLFloater* get_parent_floater(LLView* view)
54} 54}
55 55
56 56
57bool LLFloaterHandler::handle(const LLSD &params, const LLSD &query_map, LLWebBrowserCtrl *web) 57bool LLFloaterHandler::handle(const LLSD &params, const LLSD &query_map, LLMediaCtrl *web)
58{ 58{
59 if (params.size() < 2) return false; 59 if (params.size() < 2) return false;
60 LLFloater* floater = NULL; 60 LLFloater* floater = NULL;
diff --git a/linden/indra/newview/llfloaterhandler.h b/linden/indra/newview/llfloaterhandler.h
index b08f1f3..31ea80c 100644
--- a/linden/indra/newview/llfloaterhandler.h
+++ b/linden/indra/newview/llfloaterhandler.h
@@ -39,7 +39,7 @@ class LLFloaterHandler
39{ 39{
40public: 40public:
41 LLFloaterHandler() : LLCommandHandler("floater", true) { } 41 LLFloaterHandler() : LLCommandHandler("floater", true) { }
42 bool handle(const LLSD& params, const LLSD& query_map, LLWebBrowserCtrl* web); 42 bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web);
43}; 43};
44 44
45#endif 45#endif
diff --git a/linden/indra/newview/llfloaterhtmlsimple.cpp b/linden/indra/newview/llfloaterhtmlsimple.cpp
index 7dfc4f6..8091c1e 100644
--- a/linden/indra/newview/llfloaterhtmlsimple.cpp
+++ b/linden/indra/newview/llfloaterhtmlsimple.cpp
@@ -35,7 +35,7 @@
35#include "llfloaterhtmlsimple.h" 35#include "llfloaterhtmlsimple.h"
36 36
37#include "lluictrlfactory.h" 37#include "lluictrlfactory.h"
38#include "llwebbrowserctrl.h" 38#include "llmediactrl.h"
39 39
40 40
41LLFloaterHtmlSimple::LLFloaterHtmlSimple(const LLSD &initial_url) 41LLFloaterHtmlSimple::LLFloaterHtmlSimple(const LLSD &initial_url)
@@ -56,12 +56,12 @@ LLFloaterHtmlSimple::~LLFloaterHtmlSimple()
56 56
57void LLFloaterHtmlSimple::navigateTo(const std::string &url) 57void LLFloaterHtmlSimple::navigateTo(const std::string &url)
58{ 58{
59 LLWebBrowserCtrl* web = getChild<LLWebBrowserCtrl>("browser"); 59 LLMediaCtrl* web = getChild<LLMediaCtrl>("browser");
60 web->navigateTo(url); 60 web->navigateTo(url);
61} 61}
62 62
63void LLFloaterHtmlSimple::setTrusted(bool trusted) 63void LLFloaterHtmlSimple::setTrusted(bool trusted)
64{ 64{
65 LLWebBrowserCtrl* web = getChild<LLWebBrowserCtrl>("browser"); 65 LLMediaCtrl* web = getChild<LLMediaCtrl>("browser");
66 web->setTrusted(trusted); 66 web->setTrusted(trusted);
67} 67}
diff --git a/linden/indra/newview/llfloaterhud.cpp b/linden/indra/newview/llfloaterhud.cpp
index 9810bf1..6324b56 100644
--- a/linden/indra/newview/llfloaterhud.cpp
+++ b/linden/indra/newview/llfloaterhud.cpp
@@ -36,7 +36,7 @@
36 36
37// Viewer libs 37// Viewer libs
38#include "llviewercontrol.h" 38#include "llviewercontrol.h"
39#include "llwebbrowserctrl.h" 39#include "llmediactrl.h"
40#include "llalertdialog.h" 40#include "llalertdialog.h"
41 41
42// Linden libs 42// Linden libs
@@ -74,7 +74,7 @@ LLFloaterHUD::LLFloaterHUD()
74 reshape(saved_position_rect.getWidth(), saved_position_rect.getHeight(), FALSE); 74 reshape(saved_position_rect.getWidth(), saved_position_rect.getHeight(), FALSE);
75 setRect(saved_position_rect); 75 setRect(saved_position_rect);
76 76
77 mWebBrowser = getChild<LLWebBrowserCtrl>("floater_hud_browser" ); 77 mWebBrowser = getChild<LLMediaCtrl>("floater_hud_browser" );
78 if (mWebBrowser) 78 if (mWebBrowser)
79 { 79 {
80 // Open links in internal browser 80 // Open links in internal browser
diff --git a/linden/indra/newview/llfloaterhud.h b/linden/indra/newview/llfloaterhud.h
index 2d58685..919ffef 100644
--- a/linden/indra/newview/llfloaterhud.h
+++ b/linden/indra/newview/llfloaterhud.h
@@ -35,7 +35,7 @@
35 35
36#include "llfloater.h" 36#include "llfloater.h"
37 37
38class LLWebBrowserCtrl; 38class LLMediaCtrl;
39 39
40class LLFloaterHUD : public LLFloater 40class LLFloaterHUD : public LLFloater
41{ 41{
@@ -53,7 +53,7 @@ private:
53 /*virtual*/ ~LLFloaterHUD(); 53 /*virtual*/ ~LLFloaterHUD();
54 54
55private: 55private:
56 LLWebBrowserCtrl* mWebBrowser; ///< the actual web browser control 56 LLMediaCtrl* mWebBrowser; ///< the actual web browser control
57 static LLFloaterHUD* sInstance; 57 static LLFloaterHUD* sInstance;
58}; 58};
59 59
diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp
index 066b739..39de55f 100644
--- a/linden/indra/newview/llfloaterland.cpp
+++ b/linden/indra/newview/llfloaterland.cpp
@@ -56,6 +56,7 @@
56#include "lllineeditor.h" 56#include "lllineeditor.h"
57#include "llnamelistctrl.h" 57#include "llnamelistctrl.h"
58#include "llnotify.h" 58#include "llnotify.h"
59#include "llpanellandaudio.h"
59#include "llpanellandmedia.h" 60#include "llpanellandmedia.h"
60#include "llradiogroup.h" 61#include "llradiogroup.h"
61#include "llscrolllistctrl.h" 62#include "llscrolllistctrl.h"
@@ -204,6 +205,7 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed)
204 factory_map["land_covenant_panel"] = LLCallbackMap(createPanelLandCovenant, this); 205 factory_map["land_covenant_panel"] = LLCallbackMap(createPanelLandCovenant, this);
205 factory_map["land_objects_panel"] = LLCallbackMap(createPanelLandObjects, this); 206 factory_map["land_objects_panel"] = LLCallbackMap(createPanelLandObjects, this);
206 factory_map["land_options_panel"] = LLCallbackMap(createPanelLandOptions, this); 207 factory_map["land_options_panel"] = LLCallbackMap(createPanelLandOptions, this);
208// factory_map["land_audio_panel"] = LLCallbackMap(createPanelLandAudio, this);
207 factory_map["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this); 209 factory_map["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this);
208 factory_map["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this); 210 factory_map["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this);
209 211
@@ -239,6 +241,7 @@ void LLFloaterLand::refresh()
239 mPanelGeneral->refresh(); 241 mPanelGeneral->refresh();
240 mPanelObjects->refresh(); 242 mPanelObjects->refresh();
241 mPanelOptions->refresh(); 243 mPanelOptions->refresh();
244// mPanelAudio->refresh();
242 mPanelMedia->refresh(); 245 mPanelMedia->refresh();
243 mPanelAccess->refresh(); 246 mPanelAccess->refresh();
244} 247}
@@ -277,6 +280,15 @@ void* LLFloaterLand::createPanelLandOptions(void* data)
277 return self->mPanelOptions; 280 return self->mPanelOptions;
278} 281}
279 282
283/*
284// static
285void* LLFloaterLand::createPanelLandAudio(void* data)
286{
287 LLFloaterLand* self = (LLFloaterLand*)data;
288 self->mPanelAudio = new LLPanelLandAudio(self->mParcel);
289 return self->mPanelAudio;
290}
291*/
280// static 292// static
281void* LLFloaterLand::createPanelLandMedia(void* data) 293void* LLFloaterLand::createPanelLandMedia(void* data)
282{ 294{
diff --git a/linden/indra/newview/llfloaterland.h b/linden/indra/newview/llfloaterland.h
index 113b679..4105f44 100644
--- a/linden/indra/newview/llfloaterland.h
+++ b/linden/indra/newview/llfloaterland.h
@@ -64,6 +64,7 @@ class LLParcelSelection;
64class LLPanelLandGeneral; 64class LLPanelLandGeneral;
65class LLPanelLandObjects; 65class LLPanelLandObjects;
66class LLPanelLandOptions; 66class LLPanelLandOptions;
67class LLPanelLandAudio;
67class LLPanelLandMedia; 68class LLPanelLandMedia;
68class LLPanelLandAccess; 69class LLPanelLandAccess;
69class LLPanelLandBan; 70class LLPanelLandBan;
@@ -102,6 +103,7 @@ protected:
102 static void* createPanelLandCovenant(void* data); 103 static void* createPanelLandCovenant(void* data);
103 static void* createPanelLandObjects(void* data); 104 static void* createPanelLandObjects(void* data);
104 static void* createPanelLandOptions(void* data); 105 static void* createPanelLandOptions(void* data);
106 static void* createPanelLandAudio(void* data);
105 static void* createPanelLandMedia(void* data); 107 static void* createPanelLandMedia(void* data);
106 static void* createPanelLandAccess(void* data); 108 static void* createPanelLandAccess(void* data);
107 static void* createPanelLandBan(void* data); 109 static void* createPanelLandBan(void* data);
@@ -115,6 +117,7 @@ protected:
115 LLPanelLandGeneral* mPanelGeneral; 117 LLPanelLandGeneral* mPanelGeneral;
116 LLPanelLandObjects* mPanelObjects; 118 LLPanelLandObjects* mPanelObjects;
117 LLPanelLandOptions* mPanelOptions; 119 LLPanelLandOptions* mPanelOptions;
120// LLPanelLandAudio* mPanelAudio;
118 LLPanelLandMedia* mPanelMedia; 121 LLPanelLandMedia* mPanelMedia;
119 LLPanelLandAccess* mPanelAccess; 122 LLPanelLandAccess* mPanelAccess;
120 LLPanelLandCovenant* mPanelCovenant; 123 LLPanelLandCovenant* mPanelCovenant;
diff --git a/linden/indra/newview/llfloatermediabrowser.cpp b/linden/indra/newview/llfloatermediabrowser.cpp
new file mode 100644
index 0000000..def0159
--- /dev/null
+++ b/linden/indra/newview/llfloatermediabrowser.cpp
@@ -0,0 +1,398 @@
1/**
2 * @file llfloaterhtmlhelp.cpp
3 * @brief HTML Help floater - uses embedded web browser control
4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 *
7 * Copyright (c) 2006-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * 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 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("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 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * 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 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#include "llviewerprecompiledheaders.h"
34
35#include "llfloatermediabrowser.h"
36#include "llfloaterhtml.h"
37
38#include "llparcel.h"
39#include "llpluginclassmedia.h"
40#include "lluictrlfactory.h"
41#include "llmediactrl.h"
42#include "llviewerwindow.h"
43#include "llviewercontrol.h"
44#include "llviewerparcelmgr.h"
45#include "llweb.h"
46#include "llui.h"
47#include "roles_constants.h"
48
49#include "llurlhistory.h"
50#include "llmediactrl.h"
51#include "llviewermedia.h"
52#include "llviewerparcelmedia.h"
53#include "llcombobox.h"
54
55
56// TEMP
57#include "llsdutil.h"
58
59LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data)
60{
61 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_media_browser.xml");
62
63}
64
65void LLFloaterMediaBrowser::draw()
66{
67 childSetEnabled("go", !mAddressCombo->getValue().asString().empty());
68 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
69 if(parcel)
70 {
71 childSetVisible("parcel_owner_controls", LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA));
72 childSetEnabled("assign", !mAddressCombo->getValue().asString().empty());
73 }
74 bool show_time_controls = false;
75 bool media_playing = false;
76 if(mBrowser)
77 {
78 LLPluginClassMedia* media_plugin = mBrowser->getMediaPlugin();
79 if(media_plugin)
80 {
81 show_time_controls = media_plugin->pluginSupportsMediaTime();
82 media_playing = media_plugin->getStatus() == LLPluginClassMediaOwner::MEDIA_PLAYING;
83 }
84 }
85 childSetVisible("rewind", show_time_controls);
86 childSetVisible("play", show_time_controls && ! media_playing);
87 childSetVisible("pause", show_time_controls && media_playing);
88 childSetVisible("stop", show_time_controls);
89 childSetVisible("seek", show_time_controls);
90
91 childSetEnabled("play", ! media_playing);
92 childSetEnabled("stop", media_playing);
93
94 childSetEnabled("back", mBrowser->canNavigateBack());
95 childSetEnabled("forward", mBrowser->canNavigateForward());
96
97 LLFloater::draw();
98}
99
100BOOL LLFloaterMediaBrowser::postBuild()
101{
102 mBrowser = getChild<LLMediaCtrl>("browser");
103 mBrowser->addObserver(this);
104
105 mAddressCombo = getChild<LLComboBox>("address");
106 mAddressCombo->setCommitCallback(onEnterAddress);
107 mAddressCombo->setCallbackUserData(this);
108
109 childSetAction("back", onClickBack, this);
110 childSetAction("forward", onClickForward, this);
111 childSetAction("reload", onClickRefresh, this);
112 childSetAction("rewind", onClickRewind, this);
113 childSetAction("play", onClickPlay, this);
114 childSetAction("stop", onClickStop, this);
115 childSetAction("pause", onClickPlay, this);
116 childSetAction("seek", onClickSeek, this);
117 childSetAction("go", onClickGo, this);
118 childSetAction("close", onClickClose, this);
119 childSetAction("open_browser", onClickOpenWebBrowser, this);
120 childSetAction("assign", onClickAssign, this);
121
122 buildURLHistory();
123 return TRUE;
124}
125
126void LLFloaterMediaBrowser::buildURLHistory()
127{
128 LLCtrlListInterface* url_list = childGetListInterface("address");
129 if (url_list)
130 {
131 url_list->operateOnAll(LLCtrlListInterface::OP_DELETE);
132 }
133
134 // Get all of the entries in the "browser" collection
135 LLSD browser_history = LLURLHistory::getURLHistory("browser");
136
137 LLSD::array_iterator iter_history =
138 browser_history.beginArray();
139 LLSD::array_iterator end_history =
140 browser_history.endArray();
141 for(; iter_history != end_history; ++iter_history)
142 {
143 std::string url = (*iter_history).asString();
144 if(! url.empty())
145 url_list->addSimpleElement(url);
146 }
147
148 // initialize URL history in the plugin
149 mBrowser->getMediaPlugin()->initializeUrlHistory(browser_history);
150}
151
152std::string LLFloaterMediaBrowser::getSupportURL()
153{
154 return getString("support_page_url");
155}
156void LLFloaterMediaBrowser::onClose(bool app_quitting)
157{
158 //setVisible(FALSE);
159 destroy();
160}
161
162void LLFloaterMediaBrowser::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
163{
164 if(event == MEDIA_EVENT_LOCATION_CHANGED)
165 {
166 setCurrentURL(self->getLocation());
167 }
168 else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
169 {
170 // This is the event these flags are sent with.
171 childSetEnabled("back", self->getHistoryBackAvailable());
172 childSetEnabled("forward", self->getHistoryForwardAvailable());
173 }
174}
175void LLFloaterMediaBrowser::setCurrentURL(const std::string& url)
176{
177 mCurrentURL = url;
178
179 // redirects will navigate momentarily to about:blank, don't add to history
180 if (mCurrentURL != "about:blank")
181 {
182 mAddressCombo->remove(mCurrentURL);
183 mAddressCombo->add(mCurrentURL, ADD_SORTED);
184 mAddressCombo->selectByValue(mCurrentURL);
185
186 // Serialize url history
187 LLURLHistory::removeURL("browser", mCurrentURL);
188 LLURLHistory::addURL("browser", mCurrentURL);
189 }
190 childSetEnabled("back", mBrowser->canNavigateBack());
191 childSetEnabled("forward", mBrowser->canNavigateForward());
192 childSetEnabled("reload", TRUE);
193}
194
195LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url)
196{
197 LLFloaterMediaBrowser* floaterp = LLUISingleton<LLFloaterMediaBrowser, VisibilityPolicy<LLFloater> >::showInstance(media_url);
198
199 floaterp->openMedia(media_url.asString());
200 return floaterp;
201}
202
203//static
204void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data)
205{
206 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
207 self->mBrowser->navigateTo(self->mAddressCombo->getValue().asString());
208}
209
210//static
211void LLFloaterMediaBrowser::onClickRefresh(void* user_data)
212{
213 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
214
215 self->mAddressCombo->remove(0);
216 self->mBrowser->navigateTo(self->mCurrentURL);
217}
218
219//static
220void LLFloaterMediaBrowser::onClickForward(void* user_data)
221{
222 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
223
224 self->mBrowser->navigateForward();
225}
226
227//static
228void LLFloaterMediaBrowser::onClickBack(void* user_data)
229{
230 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
231
232 self->mBrowser->navigateBack();
233}
234
235//static
236void LLFloaterMediaBrowser::onClickGo(void* user_data)
237{
238 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
239
240 self->mBrowser->navigateTo(self->mAddressCombo->getValue().asString());
241}
242
243//static
244void LLFloaterMediaBrowser::onClickClose(void* user_data)
245{
246 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
247
248 self->close();
249}
250
251//static
252void LLFloaterMediaBrowser::onClickOpenWebBrowser(void* user_data)
253{
254 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
255
256 std::string url = self->mCurrentURL.empty() ?
257 self->mBrowser->getHomePageUrl() :
258 self->mCurrentURL;
259 LLWeb::loadURLExternal(url);
260}
261
262void LLFloaterMediaBrowser::onClickAssign(void* user_data)
263{
264 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
265
266 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
267 if (!parcel)
268 {
269 return;
270 }
271 std::string media_url = self->mAddressCombo->getValue().asString();
272 LLStringUtil::trim(media_url);
273
274 if(parcel->getMediaType() != "text/html")
275 {
276 parcel->setMediaURL(media_url);
277 parcel->setMediaCurrentURL(media_url);
278 parcel->setMediaType(std::string("text/html"));
279 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel, true );
280 LLViewerParcelMedia::sendMediaNavigateMessage(media_url);
281 LLViewerParcelMedia::stop();
282 // LLViewerParcelMedia::update( parcel );
283 }
284 LLViewerParcelMedia::sendMediaNavigateMessage(media_url);
285}
286//static
287void LLFloaterMediaBrowser::onClickRewind(void* user_data)
288{
289 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
290
291 if(self->mBrowser->getMediaPlugin())
292 self->mBrowser->getMediaPlugin()->start(-2.0f);
293}
294//static
295void LLFloaterMediaBrowser::onClickPlay(void* user_data)
296{
297 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
298
299 LLPluginClassMedia* plugin = self->mBrowser->getMediaPlugin();
300 if(plugin)
301 {
302 if(plugin->getStatus() == LLPluginClassMediaOwner::MEDIA_PLAYING)
303 {
304 plugin->pause();
305 }
306 else
307 {
308 plugin->start();
309 }
310 }
311}
312//static
313void LLFloaterMediaBrowser::onClickStop(void* user_data)
314{
315 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
316
317 if(self->mBrowser->getMediaPlugin())
318 self->mBrowser->getMediaPlugin()->stop();
319}
320//static
321void LLFloaterMediaBrowser::onClickSeek(void* user_data)
322{
323 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
324
325 if(self->mBrowser->getMediaPlugin())
326 self->mBrowser->getMediaPlugin()->start(2.0f);
327}
328void LLFloaterMediaBrowser::openMedia(const std::string& media_url)
329{
330 mBrowser->setHomePageUrl(media_url);
331 mBrowser->navigateTo(media_url);
332 setCurrentURL(media_url);
333}
334////////////////////////////////////////////////////////////////////////////////
335//
336
337LLViewerHtmlHelp gViewerHtmlHelp;
338
339
340////////////////////////////////////////////////////////////////////////////////
341//
342LLViewerHtmlHelp::LLViewerHtmlHelp()
343{
344
345 LLUI::setHtmlHelp(this);
346}
347
348LLViewerHtmlHelp::~LLViewerHtmlHelp()
349{
350
351 LLUI::setHtmlHelp(NULL);
352}
353
354void LLViewerHtmlHelp::show()
355{
356 show("");
357}
358
359void LLViewerHtmlHelp::show(std::string url)
360{
361 LLFloaterMediaBrowser* floater_html = LLFloaterMediaBrowser::getInstance();
362 floater_html->setVisible(FALSE);
363
364 if (url.empty())
365 {
366 url = floater_html->getSupportURL();
367 }
368
369 if (gSavedSettings.getBOOL("UseExternalBrowser"))
370 {
371 LLSD notificationData;
372 notificationData["url"] = url;
373
374 LLNotifications::instance().add("ClickOpenF1Help", notificationData, LLSD(), onClickF1HelpLoadURL);
375 floater_html->close();
376 }
377 else
378 {
379 // don't wait, just do it
380 floater_html->setVisible(TRUE);
381 floater_html->openMedia(url);
382 }
383}
384// static
385bool LLViewerHtmlHelp::onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response)
386{
387 LLFloaterMediaBrowser* floater_html = LLFloaterMediaBrowser::getInstance();
388 floater_html->setVisible(FALSE);
389 std::string url = floater_html->getSupportURL();
390 S32 option = LLNotification::getSelectedOption(notification, response);
391 if (option == 0)
392 {
393 LLWeb::loadURL(url);
394 }
395 floater_html->close();
396 return false;
397}
398
diff --git a/linden/indra/newview/llfloaterhtmlhelp.h b/linden/indra/newview/llfloatermediabrowser.h
index 83f15cd..8a78df8 100644
--- a/linden/indra/newview/llfloaterhtmlhelp.h
+++ b/linden/indra/newview/llfloatermediabrowser.h
@@ -35,7 +35,7 @@
35 35
36#include "llhtmlhelp.h" 36#include "llhtmlhelp.h"
37#include "llfloater.h" 37#include "llfloater.h"
38#include "llwebbrowserctrl.h" 38#include "llmediactrl.h"
39 39
40class LLViewerHtmlHelp : public LLHtmlHelp 40class LLViewerHtmlHelp : public LLHtmlHelp
41{ 41{
@@ -45,28 +45,38 @@ public:
45 45
46 /*virtual*/ void show(); 46 /*virtual*/ void show();
47 /*virtual*/ void show(std::string start_url); 47 /*virtual*/ void show(std::string start_url);
48 void show(std::string start_url, std::string title);
49
50 static bool onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response);
51
48}; 52};
49 53
50class LLComboBox; 54class LLComboBox;
51class LLWebBrowserCtrl; 55class LLMediaCtrl;
52 56
53class LLFloaterMediaBrowser : public LLFloater, public LLFloaterSingleton<LLFloaterMediaBrowser>, public LLWebBrowserCtrlObserver 57class LLFloaterMediaBrowser :
58 public LLFloater,
59 public LLUISingleton<LLFloaterMediaBrowser,
60 VisibilityPolicy<LLFloater> >,
61 public LLViewerMediaObserver
54{ 62{
55public: 63public:
56 LLFloaterMediaBrowser(const LLSD& media_data); 64 LLFloaterMediaBrowser(const LLSD& media_data);
57 65
58 /*virtual*/ BOOL postBuild(); 66 /*virtual*/ BOOL postBuild();
59 /*virtual*/ void onClose(bool app_quitting); 67 /*virtual*/ void onClose(bool app_quitting);
60 /*virtual*/ void onLocationChange( const EventType& eventIn );
61
62 /*virtual*/ void draw(); 68 /*virtual*/ void draw();
63 69
70 // inherited from LLViewerMediaObserver
71 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
72
64 void openMedia(const std::string& media_url); 73 void openMedia(const std::string& media_url);
65 void buildURLHistory(); 74 void buildURLHistory();
75 std::string getSupportURL();
76 void setCurrentURL(const std::string& url);
66 77
67 static void helpF1();
68 78
69private: 79 static LLFloaterMediaBrowser* showInstance(const LLSD& id);
70 static void onEnterAddress(LLUICtrl* ctrl, void* user_data); 80 static void onEnterAddress(LLUICtrl* ctrl, void* user_data);
71 static void onClickRefresh(void* user_data); 81 static void onClickRefresh(void* user_data);
72 static void onClickBack(void* user_data); 82 static void onClickBack(void* user_data);
@@ -75,11 +85,13 @@ private:
75 static void onClickClose(void* user_data); 85 static void onClickClose(void* user_data);
76 static void onClickOpenWebBrowser(void* user_data); 86 static void onClickOpenWebBrowser(void* user_data);
77 static void onClickAssign(void* user_data); 87 static void onClickAssign(void* user_data);
78 static void onClickHome(void* user_data); 88 static void onClickRewind(void* user_data);
79 static void onClickSetHome(void* user_data); 89 static void onClickPlay(void* user_data);
80 static bool onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response); 90 static void onClickStop(void* user_data);
91 static void onClickSeek(void* user_data);
81 92
82 LLWebBrowserCtrl* mBrowser; 93private:
94 LLMediaCtrl* mBrowser;
83 LLComboBox* mAddressCombo; 95 LLComboBox* mAddressCombo;
84 std::string mCurrentURL; 96 std::string mCurrentURL;
85}; 97};
diff --git a/linden/indra/newview/llfloaterobjectiminfo.cpp b/linden/indra/newview/llfloaterobjectiminfo.cpp
index fa7964c..f933a85 100644
--- a/linden/indra/newview/llfloaterobjectiminfo.cpp
+++ b/linden/indra/newview/llfloaterobjectiminfo.cpp
@@ -137,7 +137,7 @@ void LLFloaterObjectIMInfo::onClickMap(void* data)
137 137
138 std::ostringstream link; 138 std::ostringstream link;
139 link << "secondlife://" << self->mSlurl; 139 link << "secondlife://" << self->mSlurl;
140 class LLWebBrowserCtrl* web = NULL; 140 class LLMediaCtrl* web = NULL;
141 LLURLDispatcher::dispatch(link.str(), web, true); 141 LLURLDispatcher::dispatch(link.str(), web, true);
142} 142}
143 143
@@ -213,14 +213,14 @@ public:
213 LLObjectIMInfoHandler() : LLCommandHandler("objectim", true) { } 213 LLObjectIMInfoHandler() : LLCommandHandler("objectim", true) { }
214 214
215 bool handle(const LLSD& tokens, const LLSD& query_map, 215 bool handle(const LLSD& tokens, const LLSD& query_map,
216 LLWebBrowserCtrl* web); 216 LLMediaCtrl* web);
217}; 217};
218 218
219// Creating the object registers with the dispatcher. 219// Creating the object registers with the dispatcher.
220LLObjectIMInfoHandler gObjectIMHandler; 220LLObjectIMInfoHandler gObjectIMHandler;
221 221
222// ex. secondlife:///app/objectim/9426adfc-9c17-8765-5f09-fdf19957d003?owner=a112d245-9095-4e9c-ace4-ffa31717f934&groupowned=true&slurl=ahern/123/123/123&name=Object 222// ex. secondlife:///app/objectim/9426adfc-9c17-8765-5f09-fdf19957d003?owner=a112d245-9095-4e9c-ace4-ffa31717f934&groupowned=true&slurl=ahern/123/123/123&name=Object
223bool LLObjectIMInfoHandler::handle(const LLSD &tokens, const LLSD &query_map, LLWebBrowserCtrl* web) 223bool LLObjectIMInfoHandler::handle(const LLSD &tokens, const LLSD &query_map, LLMediaCtrl* web)
224{ 224{
225 LLUUID task_id = tokens[0].asUUID(); 225 LLUUID task_id = tokens[0].asUUID();
226 std::string name = query_map["name"].asString(); 226 std::string name = query_map["name"].asString();
diff --git a/linden/indra/newview/llfloaterparcel.cpp b/linden/indra/newview/llfloaterparcel.cpp
index 4213150..a61f3b9 100644
--- a/linden/indra/newview/llfloaterparcel.cpp
+++ b/linden/indra/newview/llfloaterparcel.cpp
@@ -55,7 +55,7 @@ public:
55 // requires trusted browser to trigger 55 // requires trusted browser to trigger
56 LLParcelHandler() : LLCommandHandler("parcel", true) { } 56 LLParcelHandler() : LLCommandHandler("parcel", true) { }
57 bool handle(const LLSD& params, const LLSD& query_map, 57 bool handle(const LLSD& params, const LLSD& query_map,
58 LLWebBrowserCtrl* web) 58 LLMediaCtrl* web)
59 { 59 {
60 if (params.size() < 2) 60 if (params.size() < 2)
61 { 61 {
diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp
index 09336cb..a94f7cf 100644
--- a/linden/indra/newview/llfloaterpreference.cpp
+++ b/linden/indra/newview/llfloaterpreference.cpp
@@ -94,7 +94,7 @@ public:
94 // requires trusted browser 94 // requires trusted browser
95 LLPreferencesHandler() : LLCommandHandler("preferences", true) { } 95 LLPreferencesHandler() : LLCommandHandler("preferences", true) { }
96 bool handle(const LLSD& tokens, const LLSD& query_map, 96 bool handle(const LLSD& tokens, const LLSD& query_map,
97 LLWebBrowserCtrl* web) 97 LLMediaCtrl* web)
98 { 98 {
99 LLFloaterPreference::show(NULL); 99 LLFloaterPreference::show(NULL);
100 return true; 100 return true;
@@ -445,7 +445,7 @@ void LLFloaterPreference::onBtnOK( void* userdata )
445 // commit any outstanding text entry 445 // commit any outstanding text entry
446 if (fp->hasFocus()) 446 if (fp->hasFocus())
447 { 447 {
448 LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); 448 LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
449 if (cur_focus->acceptsTextInput()) 449 if (cur_focus->acceptsTextInput())
450 { 450 {
451 cur_focus->onCommit(); 451 cur_focus->onCommit();
@@ -479,7 +479,7 @@ void LLFloaterPreference::onBtnApply( void* userdata )
479 LLFloaterPreference *fp =(LLFloaterPreference *)userdata; 479 LLFloaterPreference *fp =(LLFloaterPreference *)userdata;
480 if (fp->hasFocus()) 480 if (fp->hasFocus())
481 { 481 {
482 LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); 482 LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
483 if (cur_focus->acceptsTextInput()) 483 if (cur_focus->acceptsTextInput())
484 { 484 {
485 cur_focus->onCommit(); 485 cur_focus->onCommit();
@@ -505,7 +505,7 @@ void LLFloaterPreference::onBtnCancel( void* userdata )
505 LLFloaterPreference *fp =(LLFloaterPreference *)userdata; 505 LLFloaterPreference *fp =(LLFloaterPreference *)userdata;
506 if (fp->hasFocus()) 506 if (fp->hasFocus())
507 { 507 {
508 LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); 508 LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
509 if (cur_focus->acceptsTextInput()) 509 if (cur_focus->acceptsTextInput())
510 { 510 {
511 cur_focus->onCommit(); 511 cur_focus->onCommit();
diff --git a/linden/indra/newview/llfloatertos.cpp b/linden/indra/newview/llfloatertos.cpp
index 6a392e0..2dedc79 100644
--- a/linden/indra/newview/llfloatertos.cpp
+++ b/linden/indra/newview/llfloatertos.cpp
@@ -161,12 +161,10 @@ BOOL LLFloaterTOS::postBuild()
161 LLTextEditor *editor = getChild<LLTextEditor>("tos_text"); 161 LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
162 editor->setVisible( FALSE ); 162 editor->setVisible( FALSE );
163 163
164 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); 164 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
165 if ( web_browser ) 165 if ( web_browser )
166 { 166 {
167 // start to observe it so we see navigate complete events 167 web_browser->addObserver(this);
168 web_browser->addObserver( this );
169
170 gResponsePtr = LLIamHere::build( this ); 168 gResponsePtr = LLIamHere::build( this );
171 LLHTTPClient::get( getString( "real_url" ), gResponsePtr ); 169 LLHTTPClient::get( getString( "real_url" ), gResponsePtr );
172 } 170 }
@@ -179,7 +177,7 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
179 // only do this for TOS pages 177 // only do this for TOS pages
180 if ( mType == TOS_TOS ) 178 if ( mType == TOS_TOS )
181 { 179 {
182 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); 180 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
183 // if the contents of the site was retrieved 181 // if the contents of the site was retrieved
184 if ( alive ) 182 if ( alive )
185 { 183 {
@@ -201,12 +199,6 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
201 199
202LLFloaterTOS::~LLFloaterTOS() 200LLFloaterTOS::~LLFloaterTOS()
203{ 201{
204 // stop obsaerving events
205 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html");
206 if ( web_browser )
207 {
208 web_browser->remObserver( this );
209 };
210 202
211 // tell the responder we're not here anymore 203 // tell the responder we're not here anymore
212 if ( gResponsePtr ) 204 if ( gResponsePtr )
@@ -269,14 +261,17 @@ void LLFloaterTOS::onCancel( void* userdata )
269} 261}
270 262
271//virtual 263//virtual
272void LLFloaterTOS::onNavigateComplete( const EventType& eventIn ) 264void LLFloaterTOS::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
273{ 265{
274 // skip past the loading screen navigate complete 266 if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
275 if ( ++mLoadCompleteCount == 2 )
276 { 267 {
277 llinfos << "NAVIGATE COMPLETE" << llendl; 268 // skip past the loading screen navigate complete
278 // enable Agree to TOS radio button now that page has loaded 269 if ( ++mLoadCompleteCount == 2 )
279 LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); 270 {
280 tos_agreement->setEnabled( true ); 271 llinfos << "NAVIGATE COMPLETE" << llendl;
281 }; 272 // enable Agree to TOS radio button now that page has loaded
273 LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
274 tos_agreement->setEnabled( true );
275 }
276 }
282} 277}
diff --git a/linden/indra/newview/llfloatertos.h b/linden/indra/newview/llfloatertos.h
index dbec3ff..c5d5878 100644
--- a/linden/indra/newview/llfloatertos.h
+++ b/linden/indra/newview/llfloatertos.h
@@ -35,7 +35,7 @@
35 35
36#include "llmodaldialog.h" 36#include "llmodaldialog.h"
37#include "llassetstorage.h" 37#include "llassetstorage.h"
38#include "llwebbrowserctrl.h" 38#include "llmediactrl.h"
39 39
40class LLButton; 40class LLButton;
41class LLRadioGroup; 41class LLRadioGroup;
@@ -45,7 +45,7 @@ class LLUUID;
45 45
46class LLFloaterTOS : 46class LLFloaterTOS :
47 public LLModalDialog, 47 public LLModalDialog,
48 public LLWebBrowserCtrlObserver 48 public LLViewerMediaObserver
49{ 49{
50public: 50public:
51 virtual ~LLFloaterTOS(); 51 virtual ~LLFloaterTOS();
@@ -70,7 +70,8 @@ public:
70 70
71 void setSiteIsAlive( bool alive ); 71 void setSiteIsAlive( bool alive );
72 72
73 virtual void onNavigateComplete( const EventType& eventIn ); 73 // inherited from LLViewerMediaObserver
74 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
74 75
75private: 76private:
76 // Asset_id is overwritten with LLUUID::null when agree is clicked. 77 // Asset_id is overwritten with LLUUID::null when agree is clicked.
diff --git a/linden/indra/newview/llfloaterurlentry.cpp b/linden/indra/newview/llfloaterurlentry.cpp
index 9d91aa9..8d483e5 100644
--- a/linden/indra/newview/llfloaterurlentry.cpp
+++ b/linden/indra/newview/llfloaterurlentry.cpp
@@ -227,7 +227,7 @@ void LLFloaterURLEntry::onBtnOK( void* userdata )
227 } 227 }
228 228
229 // Discover the MIME type only for "http" scheme. 229 // Discover the MIME type only for "http" scheme.
230 if(scheme == "http") 230 if(scheme == "http" || scheme == "https")
231 { 231 {
232 LLHTTPClient::getHeaderOnly( media_url, 232 LLHTTPClient::getHeaderOnly( media_url,
233 new LLMediaTypeResponder(self->getHandle())); 233 new LLMediaTypeResponder(self->getHandle()));
diff --git a/linden/indra/newview/llhoverview.cpp b/linden/indra/newview/llhoverview.cpp
index 6367380..109eece 100644
--- a/linden/indra/newview/llhoverview.cpp
+++ b/linden/indra/newview/llhoverview.cpp
@@ -154,12 +154,13 @@ void LLHoverView::updateHover(LLTool* current_tool)
154 154
155void LLHoverView::pickCallback(const LLPickInfo& pick_info) 155void LLHoverView::pickCallback(const LLPickInfo& pick_info)
156{ 156{
157 gHoverView->mLastPickInfo = pick_info;
157 LLViewerObject* hit_obj = pick_info.getObject(); 158 LLViewerObject* hit_obj = pick_info.getObject();
158 159
159 if (hit_obj) 160 if (hit_obj)
160 { 161 {
161 gHoverView->setHoverActive(TRUE); 162 gHoverView->setHoverActive(TRUE);
162 LLSelectMgr::getInstance()->setHoverObject(hit_obj); 163 LLSelectMgr::getInstance()->setHoverObject(hit_obj, pick_info.mObjectFace);
163 gHoverView->mLastHoverObject = hit_obj; 164 gHoverView->mLastHoverObject = hit_obj;
164 gHoverView->mHoverOffset = pick_info.mObjectOffset; 165 gHoverView->mHoverOffset = pick_info.mObjectOffset;
165 } 166 }
diff --git a/linden/indra/newview/llhoverview.h b/linden/indra/newview/llhoverview.h
index 0891118..d0bb28d 100644
--- a/linden/indra/newview/llhoverview.h
+++ b/linden/indra/newview/llhoverview.h
@@ -42,6 +42,7 @@
42#include "v3dmath.h" 42#include "v3dmath.h"
43 43
44#include "lldarray.h" 44#include "lldarray.h"
45#include "llviewerwindow.h"
45#include "llviewerobject.h" 46#include "llviewerobject.h"
46 47
47class LLTool; 48class LLTool;
@@ -79,6 +80,7 @@ public:
79 BOOL isHoveringLand() const; 80 BOOL isHoveringLand() const;
80 81
81 LLViewerObject* getLastHoverObject() const; 82 LLViewerObject* getLastHoverObject() const;
83 LLPickInfo getPickInfo() { return mLastPickInfo; }
82 84
83 static void pickCallback(const LLPickInfo& info); 85 static void pickCallback(const LLPickInfo& info);
84 86
@@ -103,6 +105,7 @@ protected:
103 105
104 // If not null and not dead, we're over an object. 106 // If not null and not dead, we're over an object.
105 LLPointer<LLViewerObject> mLastHoverObject; 107 LLPointer<LLViewerObject> mLastHoverObject;
108 LLPickInfo mLastPickInfo;
106 109
107 // If not LLVector3d::ZERO, we're over land. 110 // If not LLVector3d::ZERO, we're over land.
108 LLVector3d mHoverLandGlobal; 111 LLVector3d mHoverLandGlobal;
diff --git a/linden/indra/newview/llhudview.cpp b/linden/indra/newview/llhudview.cpp
index 198514c..afcdd73 100644
--- a/linden/indra/newview/llhudview.cpp
+++ b/linden/indra/newview/llhudview.cpp
@@ -48,14 +48,19 @@
48#include "lltracker.h" 48#include "lltracker.h"
49#include "llviewercamera.h" 49#include "llviewercamera.h"
50#include "llui.h" 50#include "llui.h"
51#include "lluictrlfactory.h"
51 52
52LLHUDView *gHUDView = NULL; 53LLHUDView *gHUDView = NULL;
53 54
54const S32 HUD_ARROW_SIZE = 32; 55const S32 HUD_ARROW_SIZE = 32;
55 56
56LLHUDView::LLHUDView() 57
57: LLPanel() 58
58{ } 59LLHUDView::LLHUDView(const LLRect& r)
60{
61 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_hud.xml");
62 userSetShape(r);
63}
59 64
60LLHUDView::~LLHUDView() 65LLHUDView::~LLHUDView()
61{ } 66{ }
@@ -64,6 +69,7 @@ LLHUDView::~LLHUDView()
64void LLHUDView::draw() 69void LLHUDView::draw()
65{ 70{
66 LLTracker::drawHUDArrow(); 71 LLTracker::drawHUDArrow();
72 LLView::draw();
67} 73}
68 74
69 75
@@ -89,4 +95,3 @@ BOOL LLHUDView::handleMouseDown(S32 x, S32 y, MASK mask)
89 } 95 }
90 return LLView::handleMouseDown(x, y, mask); 96 return LLView::handleMouseDown(x, y, mask);
91} 97}
92
diff --git a/linden/indra/newview/llhudview.h b/linden/indra/newview/llhudview.h
index 7859e7f..05ff9c8 100644
--- a/linden/indra/newview/llhudview.h
+++ b/linden/indra/newview/llhudview.h
@@ -42,7 +42,7 @@ class LLHUDView
42: public LLPanel 42: public LLPanel
43{ 43{
44public: 44public:
45 LLHUDView(); 45 LLHUDView(const LLRect& rect);
46 virtual ~LLHUDView(); 46 virtual ~LLHUDView();
47 47
48 virtual void draw(); 48 virtual void draw();
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp
index 808a2c9..cc7a35d 100644
--- a/linden/indra/newview/llimpanel.cpp
+++ b/linden/indra/newview/llimpanel.cpp
@@ -2198,8 +2198,8 @@ void LLFloaterIMPanel::sendMsg()
2198 2198
2199 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_IM_COUNT); 2199 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_IM_COUNT);
2200 2200
2201 mInputEditor->setText(LLStringUtil::null);
2201 } 2202 }
2202 mInputEditor->setText(LLStringUtil::null);
2203 2203
2204 // Don't need to actually send the typing stop message, the other 2204 // Don't need to actually send the typing stop message, the other
2205 // client will infer it from receiving the message. 2205 // client will infer it from receiving the message.
diff --git a/linden/indra/newview/llloginhandler.cpp b/linden/indra/newview/llloginhandler.cpp
index 6366398..30b05ef 100644
--- a/linden/indra/newview/llloginhandler.cpp
+++ b/linden/indra/newview/llloginhandler.cpp
@@ -111,7 +111,7 @@ void LLLoginHandler::parse(const LLSD& queryMap)
111 111
112bool LLLoginHandler::handle(const LLSD& tokens, 112bool LLLoginHandler::handle(const LLSD& tokens,
113 const LLSD& query_map, 113 const LLSD& query_map,
114 LLWebBrowserCtrl* web) 114 LLMediaCtrl* web)
115{ 115{
116 parse(query_map); 116 parse(query_map);
117 117
diff --git a/linden/indra/newview/llloginhandler.h b/linden/indra/newview/llloginhandler.h
index c76d7e8..0844b80 100644
--- a/linden/indra/newview/llloginhandler.h
+++ b/linden/indra/newview/llloginhandler.h
@@ -40,7 +40,7 @@ class LLLoginHandler : public LLCommandHandler
40 public: 40 public:
41 // allow from external browsers 41 // allow from external browsers
42 LLLoginHandler() : LLCommandHandler("login", false) { } 42 LLLoginHandler() : LLCommandHandler("login", false) { }
43 /*virtual*/ bool handle(const LLSD& tokens, const LLSD& query_map, LLWebBrowserCtrl* web); 43 /*virtual*/ bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web);
44 44
45 // Fill in our internal fields from a SLURL like 45 // Fill in our internal fields from a SLURL like
46 // secondlife:///app/login?first=Bob&last=Dobbs 46 // secondlife:///app/login?first=Bob&last=Dobbs
diff --git a/linden/indra/newview/llmediactrl.cpp b/linden/indra/newview/llmediactrl.cpp
new file mode 100644
index 0000000..1530598
--- /dev/null
+++ b/linden/indra/newview/llmediactrl.cpp
@@ -0,0 +1,1201 @@
1/**
2 * @file LLMediaCtrl.cpp
3 * @brief Web browser UI control
4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 *
7 * Copyright (c) 2006-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * 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 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("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 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * 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 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#include "llviewerprecompiledheaders.h"
34
35
36#include "llmediactrl.h"
37
38// viewer includes
39#include "llfloaterhtml.h"
40#include "llfloaterworldmap.h"
41#include "lluictrlfactory.h"
42#include "llurldispatcher.h"
43#include "llurlsimstring.h"
44#include "llviewborder.h"
45#include "llviewercontrol.h"
46#include "llviewermedia.h"
47#include "llviewerwindow.h"
48#include "llnotifications.h"
49#include "llweb.h"
50#include "llrender.h"
51#include "llpluginclassmedia.h"
52
53// linden library includes
54#include "llfocusmgr.h"
55
56extern BOOL gRestoreGL;
57
58// Setting the mozilla buffer width to 2048 exactly doesn't work, since it pads its rowbytes a bit, pushing the texture width over 2048.
59// 2000 should give enough headroom for any amount of padding it cares to add.
60const S32 MAX_DIMENSION = 2000;
61const S32 MAX_TEXTURE_DIMENSION = 2048;
62
63static LLRegisterWidget<LLMediaCtrl> r("web_browser");
64
65LLMediaCtrl::LLMediaCtrl( const std::string& name, const LLRect& rect ) :
66 LLUICtrl( name, rect, FALSE, NULL, NULL ),
67 mTextureDepthBytes( 4 ),
68 mWebBrowserImage( 0 ),
69 mBorder(NULL),
70 mFrequentUpdates( true ),
71 mForceUpdate( false ),
72 mOpenLinksInExternalBrowser( false ),
73 mOpenLinksInInternalBrowser( false ),
74 mTrusted( false ),
75 mHomePageUrl( "" ),
76 mIgnoreUIScale( true ),
77 mAlwaysRefresh( false ),
78 mExternalUrl( "" ),
79 mMediaSource( 0 ),
80 mTakeFocusOnClick( true ),
81 mCurrentNavUrl( "about:blank" ),
82 mLastSetCursor( UI_CURSOR_ARROW ),
83 mStretchToFill( true ),
84 mMaintainAspectRatio ( true ),
85 mHideLoading (false)
86{
87 S32 screen_width = mIgnoreUIScale ?
88 llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]) : getRect().getWidth();
89 S32 screen_height = mIgnoreUIScale ?
90 llround((F32)getRect().getHeight() * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight();
91
92 mMediaSource = LLViewerMedia::newMediaImpl(mHomePageUrl, LLUUID::null, screen_width, screen_height, false, false, "text/html");
93 if ( !mMediaSource )
94 {
95 llwarns << "media source create failed " << llendl;
96 // return;
97 }
98 else
99 {
100 // create a new texture (based on LLDynamic texture) that will be used to display the output
101 mWebBrowserImage = new LLWebBrowserTexture( screen_width, screen_height, this, mMediaSource );
102 }
103
104 mMediaSource->setVisible( getVisible() );
105
106 mMediaSource->addObserver( this );
107
108 LLRect border_rect( 0, getRect().getHeight() + 2, getRect().getWidth() + 2, 0 );
109 mBorder = new LLViewBorder( std::string("web control border"), border_rect, LLViewBorder::BEVEL_IN );
110 addChild( mBorder );
111}
112
113////////////////////////////////////////////////////////////////////////////////
114// note: this is now a singleton and destruction happens via initClass() now
115LLMediaCtrl::~LLMediaCtrl()
116{
117
118 if (mMediaSource)
119 {
120 mMediaSource->remObserver( this );
121 mMediaSource = NULL;
122 }
123
124 if ( mWebBrowserImage )
125 {
126 delete mWebBrowserImage;
127 mWebBrowserImage = NULL;
128 }
129}
130
131////////////////////////////////////////////////////////////////////////////////
132//
133void LLMediaCtrl::setBorderVisible( BOOL border_visible )
134{
135 if ( mBorder )
136 {
137 mBorder->setVisible( border_visible );
138 };
139};
140
141////////////////////////////////////////////////////////////////////////////////
142//
143void LLMediaCtrl::setTakeFocusOnClick( bool take_focus )
144{
145 mTakeFocusOnClick = take_focus;
146}
147
148////////////////////////////////////////////////////////////////////////////////
149// set flag that forces the embedded browser to open links in the external system browser
150void LLMediaCtrl::setOpenInExternalBrowser( bool valIn )
151{
152 mOpenLinksInExternalBrowser = valIn;
153};
154
155////////////////////////////////////////////////////////////////////////////////
156// set flag that forces the embedded browser to open links in the internal browser floater
157void LLMediaCtrl::setOpenInInternalBrowser( bool valIn )
158{
159 mOpenLinksInInternalBrowser = valIn;
160};
161
162////////////////////////////////////////////////////////////////////////////////
163void LLMediaCtrl::setTrusted( bool valIn )
164{
165 mTrusted = valIn;
166}
167
168////////////////////////////////////////////////////////////////////////////////
169//
170BOOL LLMediaCtrl::handleHover( S32 x, S32 y, MASK mask )
171{
172 convertInputCoords(x, y);
173
174 if (mMediaSource)
175 mMediaSource->mouseMove(x, y);
176
177 gViewerWindow->setCursor(mLastSetCursor);
178
179 return TRUE;
180}
181
182////////////////////////////////////////////////////////////////////////////////
183//
184BOOL LLMediaCtrl::handleScrollWheel( S32 x, S32 y, S32 clicks )
185{
186 if (mMediaSource && mMediaSource->hasMedia())
187 mMediaSource->getMediaPlugin()->scrollEvent(0, clicks, MASK_NONE);
188
189 return TRUE;
190}
191
192////////////////////////////////////////////////////////////////////////////////
193//
194BOOL LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask )
195{
196 convertInputCoords(x, y);
197
198 if (mMediaSource)
199 {
200 mMediaSource->mouseUp(x, y);
201
202 // *HACK: LLMediaImplLLMozLib automatically takes focus on mouseup,
203 // in addition to the onFocusReceived() call below. Undo this. JC
204 if (!mTakeFocusOnClick)
205 {
206 mMediaSource->focus(false);
207 gViewerWindow->focusClient();
208 }
209 }
210
211 gFocusMgr.setMouseCapture( NULL );
212
213 return TRUE;
214}
215
216////////////////////////////////////////////////////////////////////////////////
217//
218BOOL LLMediaCtrl::handleMouseDown( S32 x, S32 y, MASK mask )
219{
220 convertInputCoords(x, y);
221
222 if (mMediaSource)
223 mMediaSource->mouseDown(x, y);
224
225 gFocusMgr.setMouseCapture( this );
226
227 if (mTakeFocusOnClick)
228 {
229 setFocus( TRUE );
230 }
231
232 return TRUE;
233}
234
235////////////////////////////////////////////////////////////////////////////////
236//
237BOOL LLMediaCtrl::handleDoubleClick( S32 x, S32 y, MASK mask )
238{
239 convertInputCoords(x, y);
240
241 if (mMediaSource)
242 mMediaSource->mouseLeftDoubleClick( x, y );
243
244 gFocusMgr.setMouseCapture( this );
245
246 if (mTakeFocusOnClick)
247 {
248 setFocus( TRUE );
249 }
250
251 return TRUE;
252}
253
254////////////////////////////////////////////////////////////////////////////////
255//
256void LLMediaCtrl::onFocusReceived()
257{
258 if (mMediaSource)
259 {
260 mMediaSource->focus(true);
261
262 // Set focus for edit menu items
263 LLEditMenuHandler::gEditMenuHandler = mMediaSource;
264 }
265
266 LLUICtrl::onFocusReceived();
267}
268
269////////////////////////////////////////////////////////////////////////////////
270//
271void LLMediaCtrl::onFocusLost()
272{
273 if (mMediaSource)
274 {
275 mMediaSource->focus(false);
276
277 if( LLEditMenuHandler::gEditMenuHandler == mMediaSource )
278 {
279 // Clear focus for edit menu items
280 LLEditMenuHandler::gEditMenuHandler = NULL;
281 }
282 }
283
284 gViewerWindow->focusClient();
285
286 LLUICtrl::onFocusLost();
287}
288
289////////////////////////////////////////////////////////////////////////////////
290//
291BOOL LLMediaCtrl::handleKeyHere( KEY key, MASK mask )
292{
293 BOOL result = FALSE;
294
295 // FIXME: THIS IS SO WRONG.
296 // Menu keys should be handled by the menu system and not passed to UI elements, but this is how LLTextEditor and LLLineEditor do it...
297
298 if (mMediaSource)
299 {
300 if( MASK_CONTROL & mask )
301 {
302 if( 'C' == key )
303 {
304 mMediaSource->copy();
305 result = TRUE;
306 }
307 else
308 if( 'V' == key )
309 {
310 mMediaSource->paste();
311 result = TRUE;
312 }
313 else
314 if( 'X' == key )
315 {
316 mMediaSource->cut();
317 result = TRUE;
318 }
319 }
320
321 if(!result)
322 {
323 result = mMediaSource->handleKeyHere(key, mask);
324 }
325 }
326
327 return result;
328}
329
330////////////////////////////////////////////////////////////////////////////////
331//
332void LLMediaCtrl::handleVisibilityChange ( BOOL new_visibility )
333{
334 llinfos << "visibility changed to " << (new_visibility?"true":"false") << llendl;
335 if(mMediaSource)
336 {
337 mMediaSource->setVisible( new_visibility );
338 }
339}
340
341////////////////////////////////////////////////////////////////////////////////
342//
343BOOL LLMediaCtrl::handleUnicodeCharHere(llwchar uni_char)
344{
345 BOOL result = FALSE;
346
347 // only accept 'printable' characters, sigh...
348 if (uni_char >= 32 // discard 'control' characters
349 && uni_char != 127) // SDL thinks this is 'delete' - yuck.
350 {
351 if (mMediaSource)
352 result = mMediaSource->handleUnicodeCharHere(uni_char);
353 }
354
355 return result;
356}
357
358////////////////////////////////////////////////////////////////////////////////
359//
360void LLMediaCtrl::onVisibilityChange ( BOOL new_visibility )
361{
362 // set state of frequent updates automatically if visibility changes
363 if ( new_visibility )
364 {
365 mFrequentUpdates = true;
366 }
367 else
368 {
369 mFrequentUpdates = false;
370 }
371 LLUICtrl::onVisibilityChange(new_visibility);
372}
373
374////////////////////////////////////////////////////////////////////////////////
375//
376void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent )
377{
378 S32 screen_width = mIgnoreUIScale ? llround((F32)width * LLUI::sGLScaleFactor.mV[VX]) : width;
379 S32 screen_height = mIgnoreUIScale ? llround((F32)height * LLUI::sGLScaleFactor.mV[VY]) : height;
380
381// llinfos << "reshape called with width = " << width << ", height = " << height << llendl;
382
383 // when floater is minimized, these sizes are negative
384 if ( mWebBrowserImage && screen_height > 0 && screen_width > 0 )
385 {
386 mWebBrowserImage->resize( screen_width, screen_height );
387 mForceUpdate = true;
388 }
389
390 LLUICtrl::reshape( width, height, called_from_parent );
391}
392
393////////////////////////////////////////////////////////////////////////////////
394//
395void LLMediaCtrl::navigateBack()
396{
397 if (mMediaSource && mMediaSource->hasMedia())
398 {
399 mMediaSource->getMediaPlugin()->browse_back();
400 }
401}
402
403////////////////////////////////////////////////////////////////////////////////
404//
405void LLMediaCtrl::navigateForward()
406{
407 if (mMediaSource && mMediaSource->hasMedia())
408 {
409 mMediaSource->getMediaPlugin()->browse_forward();
410 }
411}
412
413////////////////////////////////////////////////////////////////////////////////
414//
415bool LLMediaCtrl::canNavigateBack()
416{
417 if (mMediaSource)
418 return mMediaSource->canNavigateBack();
419 else
420 return false;
421}
422
423////////////////////////////////////////////////////////////////////////////////
424//
425bool LLMediaCtrl::canNavigateForward()
426{
427 if (mMediaSource)
428 return mMediaSource->canNavigateForward();
429 else
430 return false;
431}
432
433////////////////////////////////////////////////////////////////////////////////
434//
435void LLMediaCtrl::set404RedirectUrl( std::string redirect_url )
436{
437 if(mMediaSource && mMediaSource->hasMedia())
438 mMediaSource->getMediaPlugin()->set_status_redirect( 404, redirect_url );
439}
440
441////////////////////////////////////////////////////////////////////////////////
442//
443void LLMediaCtrl::clr404RedirectUrl()
444{
445 if(mMediaSource && mMediaSource->hasMedia())
446 mMediaSource->getMediaPlugin()->set_status_redirect(404, "");
447}
448
449////////////////////////////////////////////////////////////////////////////////
450//
451void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
452{
453 // don't browse to anything that starts with secondlife:// or sl://
454 const std::string protocol1 = "secondlife://";
455 const std::string protocol2 = "sl://";
456 if ((LLStringUtil::compareInsensitive(url_in.substr(0, protocol1.length()), protocol1) == 0) ||
457 (LLStringUtil::compareInsensitive(url_in.substr(0, protocol2.length()), protocol2) == 0))
458 {
459 // TODO: Print out/log this attempt?
460 // llinfos << "Rejecting attempt to load restricted website :" << urlIn << llendl;
461 return;
462 }
463
464 if (mMediaSource)
465 {
466 mCurrentNavUrl = url_in;
467 mMediaSource->navigateTo(url_in, mime_type, mime_type.empty());
468 }
469}
470
471////////////////////////////////////////////////////////////////////////////////
472//
473void LLMediaCtrl::navigateToLocalPage( const std::string& subdir, const std::string& filename_in )
474{
475 std::string language = LLUI::getLanguage();
476 std::string delim = gDirUtilp->getDirDelimiter();
477 std::string filename;
478
479 filename += subdir;
480 filename += delim;
481 filename += filename_in;
482
483 std::string expanded_filename = gDirUtilp->findSkinnedFilename("html", language, filename);
484
485 if (! gDirUtilp->fileExists(expanded_filename))
486 {
487 if (language != "en-us")
488 {
489 expanded_filename = gDirUtilp->findSkinnedFilename("html", "en-us", filename);
490 if (! gDirUtilp->fileExists(expanded_filename))
491 {
492 llwarns << "File " << subdir << delim << filename_in << "not found" << llendl;
493 return;
494 }
495 }
496 else
497 {
498 llwarns << "File " << subdir << delim << filename_in << "not found" << llendl;
499 return;
500 }
501 }
502 if (mMediaSource)
503 {
504 mCurrentNavUrl = expanded_filename;
505 mMediaSource->navigateTo(expanded_filename, "text/html", false);
506 }
507
508}
509
510////////////////////////////////////////////////////////////////////////////////
511//
512void LLMediaCtrl::navigateHome()
513{
514 if( mHomePageUrl.length() )
515 {
516 if (mMediaSource)
517 mMediaSource->navigateTo(mHomePageUrl);
518 };
519}
520
521////////////////////////////////////////////////////////////////////////////////
522//
523void LLMediaCtrl::setHomePageUrl( const std::string urlIn )
524{
525 mHomePageUrl = urlIn;
526}
527
528////////////////////////////////////////////////////////////////////////////////
529//
530bool LLMediaCtrl::setCaretColor(unsigned int red, unsigned int green, unsigned int blue)
531{
532 //NOOP
533 return false;
534}
535////////////////////////////////////////////////////////////////////////////////
536//
537std::string LLMediaCtrl::getHomePageUrl()
538{
539 return mHomePageUrl;
540}
541
542////////////////////////////////////////////////////////////////////////////////
543//
544LLPluginClassMedia* LLMediaCtrl::getMediaPlugin()
545{
546 return mMediaSource.isNull() ? NULL : mMediaSource->getMediaPlugin();
547}
548
549////////////////////////////////////////////////////////////////////////////////
550//
551void LLMediaCtrl::draw()
552{
553 if ( ! mWebBrowserImage )
554 return;
555
556 if ( gRestoreGL == 1 )
557 {
558 LLRect r = getRect();
559 reshape( r.getWidth(), r.getHeight(), FALSE );
560 return;
561 };
562
563 // NOTE: optimization needed here - probably only need to do this once
564 // unless tearoffs change the parent which they probably do.
565 const LLUICtrl* ptr = findRootMostFocusRoot();
566 if ( ptr && ptr->hasFocus() )
567 {
568 setFrequentUpdates( true );
569 }
570 else
571 {
572 setFrequentUpdates( false );
573 };
574
575 // alpha off for this
576 LLGLSUIDefault gls_ui;
577 LLGLDisable gls_alphaTest( GL_ALPHA_TEST );
578
579 gGL.pushMatrix();
580 {
581 if (mIgnoreUIScale)
582 {
583 glLoadIdentity();
584 // font system stores true screen origin, need to scale this by UI scale factor
585 // to get render origin for this view (with unit scale)
586 gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]),
587 floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]),
588 LLFontGL::sCurOrigin.mZ);
589 }
590
591 // scale texture to fit the space using texture coords
592 gGL.getTexUnit(0)->bind(mWebBrowserImage->getTexture());
593 gGL.color4fv( LLColor4::white.mV );
594 F32 max_u = ( F32 )mWebBrowserImage->getMediaWidth() / ( F32 )mWebBrowserImage->getWidth();
595 F32 max_v = ( F32 )mWebBrowserImage->getMediaHeight() / ( F32 )mWebBrowserImage->getHeight();
596
597 LLRect r = getRect();
598 S32 width, height;
599 S32 x_offset = 0;
600 S32 y_offset = 0;
601
602 if(mStretchToFill)
603 {
604 if(mMaintainAspectRatio)
605 {
606 F32 media_aspect = (F32)(mWebBrowserImage->getMediaWidth()) / (F32)(mWebBrowserImage->getMediaHeight());
607 F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight());
608 if(media_aspect > view_aspect)
609 {
610 // max width, adjusted height
611 width = r.getWidth();
612 height = llmin(llmax(S32(width / media_aspect), 0), r.getHeight());
613 }
614 else
615 {
616 // max height, adjusted width
617 height = r.getHeight();
618 width = llmin(llmax(S32(height * media_aspect), 0), r.getWidth());
619 }
620 }
621 else
622 {
623 width = r.getWidth();
624 height = r.getHeight();
625 }
626 }
627 else
628 {
629 width = llmin(mWebBrowserImage->getMediaWidth(), r.getWidth());
630 height = llmin(mWebBrowserImage->getMediaHeight(), r.getHeight());
631 }
632
633 x_offset = (r.getWidth() - width) / 2;
634 y_offset = (r.getHeight() - height) / 2;
635
636 if (mIgnoreUIScale)
637 {
638 width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]);
639 height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]);
640 x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]);
641 y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]);
642 }
643
644 // draw the browser
645 gGL.setSceneBlendType(LLRender::BT_REPLACE);
646 gGL.begin( LLRender::QUADS );
647 if (! mWebBrowserImage->getTextureCoordsOpenGL())
648 {
649 // render using web browser reported width and height, instead of trying to invert GL scale
650 gGL.texCoord2f( max_u, 0.f );
651 gGL.vertex2i( x_offset + width, y_offset + height );
652
653 gGL.texCoord2f( 0.f, 0.f );
654 gGL.vertex2i( x_offset, y_offset + height );
655
656 gGL.texCoord2f( 0.f, max_v );
657 gGL.vertex2i( x_offset, y_offset );
658
659 gGL.texCoord2f( max_u, max_v );
660 gGL.vertex2i( x_offset + width, y_offset );
661 }
662 else
663 {
664 // render using web browser reported width and height, instead of trying to invert GL scale
665 gGL.texCoord2f( max_u, max_v );
666 gGL.vertex2i( x_offset + width, y_offset + height );
667
668 gGL.texCoord2f( 0.f, max_v );
669 gGL.vertex2i( x_offset, y_offset + height );
670
671 gGL.texCoord2f( 0.f, 0.f );
672 gGL.vertex2i( x_offset, y_offset );
673
674 gGL.texCoord2f( max_u, 0.f );
675 gGL.vertex2i( x_offset + width, y_offset );
676 }
677 gGL.end();
678 gGL.setSceneBlendType(LLRender::BT_ALPHA);
679 }
680 gGL.popMatrix();
681
682 // highlight if keyboard focus here. (TODO: this needs some work)
683 if ( mBorder->getVisible() )
684 mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus( this ) );
685
686
687 LLUICtrl::draw();
688}
689
690////////////////////////////////////////////////////////////////////////////////
691//
692void LLMediaCtrl::convertInputCoords(S32& x, S32& y)
693{
694 x = mIgnoreUIScale ? llround((F32)x * LLUI::sGLScaleFactor.mV[VX]) : x;
695 if ( ! mWebBrowserImage->getTextureCoordsOpenGL() )
696 {
697 y = mIgnoreUIScale ? llround((F32)(y) * LLUI::sGLScaleFactor.mV[VY]) : y;
698 }
699 else
700 {
701 y = mIgnoreUIScale ? llround((F32)(getRect().getHeight() - y) * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight() - y;
702 };
703}
704
705////////////////////////////////////////////////////////////////////////////////
706// static
707bool LLMediaCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD& response )
708{
709 S32 option = LLNotification::getSelectedOption(notification, response);
710 if ( 0 == option )
711 {
712 // open in external browser because we don't support
713 // creation of our own secondary browser windows
714 LLWeb::loadURLExternal( notification["payload"]["external_url"].asString() );
715 }
716 return false;
717}
718
719////////////////////////////////////////////////////////////////////////////////
720// inherited from LLViewerMediaObserver
721//virtual
722void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
723{
724 switch(event)
725 {
726 case MEDIA_EVENT_CONTENT_UPDATED:
727 {
728 // LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CONTENT_UPDATED " << LL_ENDL;
729 };
730 break;
731
732 case MEDIA_EVENT_TIME_DURATION_UPDATED:
733 {
734 // LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_TIME_DURATION_UPDATED, time is " << self->getCurrentTime() << " of " << self->getDuration() << LL_ENDL;
735 };
736 break;
737
738 case MEDIA_EVENT_SIZE_CHANGED:
739 {
740 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_SIZE_CHANGED " << LL_ENDL;
741 LLRect r = getRect();
742 reshape( r.getWidth(), r.getHeight(), FALSE );
743 };
744 break;
745
746 case MEDIA_EVENT_CURSOR_CHANGED:
747 {
748 LL_INFOS("Media") << "Media event: MEDIA_EVENT_CURSOR_CHANGED, new cursor is " << self->getCursorName() << LL_ENDL;
749
750 std::string cursor = self->getCursorName();
751
752 if(cursor == "arrow")
753 mLastSetCursor = UI_CURSOR_ARROW;
754 else if(cursor == "ibeam")
755 mLastSetCursor = UI_CURSOR_IBEAM;
756 else if(cursor == "splith")
757 mLastSetCursor = UI_CURSOR_SIZEWE;
758 else if(cursor == "splitv")
759 mLastSetCursor = UI_CURSOR_SIZENS;
760 else if(cursor == "hand")
761 mLastSetCursor = UI_CURSOR_HAND;
762 else // for anything else, default to the arrow
763 mLastSetCursor = UI_CURSOR_ARROW;
764 };
765 break;
766
767 case MEDIA_EVENT_NAVIGATE_BEGIN:
768 {
769 LL_INFOS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_BEGIN, url is " << self->getNavigateURI() << LL_ENDL;
770 if(mMediaSource && mHideLoading)
771 {
772 mMediaSource->suspendUpdates(true);
773 }
774 };
775 break;
776
777 case MEDIA_EVENT_NAVIGATE_COMPLETE:
778 {
779 LL_INFOS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_COMPLETE, result string is: " << self->getNavigateResultString() << LL_ENDL;
780 if(mMediaSource && mHideLoading)
781 {
782 mMediaSource->suspendUpdates(false);
783 }
784 };
785 break;
786
787 case MEDIA_EVENT_PROGRESS_UPDATED:
788 {
789 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PROGRESS_UPDATED, loading at " << self->getProgressPercent() << "%" << LL_ENDL;
790 };
791 break;
792
793 case MEDIA_EVENT_STATUS_TEXT_CHANGED:
794 {
795 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_STATUS_TEXT_CHANGED, new status text is: " << self->getStatusText() << LL_ENDL;
796 };
797 break;
798
799 case MEDIA_EVENT_LOCATION_CHANGED:
800 {
801 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_LOCATION_CHANGED, new uri is: " << self->getLocation() << LL_ENDL;
802 };
803 break;
804
805 case MEDIA_EVENT_CLICK_LINK_HREF:
806 {
807 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << self->getClickTarget() << "\", uri is " << self->getClickURL() << LL_ENDL;
808 onClickLinkHref(self);
809 };
810 break;
811
812 case MEDIA_EVENT_CLICK_LINK_NOFOLLOW:
813 {
814 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_NOFOLLOW, uri is " << self->getClickURL() << LL_ENDL;
815 onClickLinkNoFollow(self);
816 };
817 break;
818
819 case MEDIA_EVENT_PLUGIN_FAILED:
820 {
821 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PLUGIN_FAILED" << LL_ENDL;
822 };
823 break;
824
825 case MEDIA_EVENT_PLUGIN_FAILED_LAUNCH:
826 {
827 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PLUGIN_FAILED_LAUNCH" << LL_ENDL;
828 };
829 break;
830
831 case MEDIA_EVENT_NAME_CHANGED:
832 {
833 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAME_CHANGED" << LL_ENDL;
834 };
835 break;
836 };
837
838 // chain all events to any potential observers of this object.
839 emitEvent(self, event);
840}
841
842////////////////////////////////////////////////////////////////////////////////
843//
844void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self )
845{
846 // retrieve the event parameters
847 std::string target = self->getClickTarget();
848 std::string url = self->getClickURL();
849
850 // if there is a value for the target
851 if ( !target.empty() )
852 {
853 if ( target == "_external" )
854 {
855 mExternalUrl = url;
856 LLSD payload;
857 payload["external_url"] = mExternalUrl;
858 LLNotifications::instance().add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget);
859 return;
860 }
861 }
862
863 const std::string protocol1( "http://" );
864 const std::string protocol2( "https://" );
865 if( mOpenLinksInExternalBrowser )
866 {
867 if ( !url.empty() )
868 {
869 if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 ||
870 LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 )
871 {
872 LLWeb::loadURLExternal( url );
873 }
874 }
875 }
876 else
877 if( mOpenLinksInInternalBrowser )
878 {
879 if ( !url.empty() )
880 {
881 if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 ||
882 LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 )
883 {
884 // If we spawn a new LLFloaterHTML, assume we want it to
885 // follow this LLMediaCtrl's trust for whether or
886 // not to open secondlife:///app/ links. JC.
887// const bool open_links_externally = false;
888// LLFloaterHtml::getInstance()->show(
889// event_in.mStringPayload,
890// "Second Life Browser",
891// open_links_externally,
892// mTrusted);
893 }
894 }
895 }
896}
897
898////////////////////////////////////////////////////////////////////////////////
899//
900void LLMediaCtrl::onClickLinkNoFollow( LLPluginClassMedia* self )
901{
902 std::string url = self->getClickURL();
903 if (LLURLDispatcher::isSLURLCommand(url)
904 && !mTrusted)
905 {
906 // block handling of this secondlife:///app/ URL
907 LLNotifications::instance().add("UnableToOpenCommandURL");
908 return;
909 }
910
911 LLURLDispatcher::dispatch(url, this, mTrusted);
912}
913
914////////////////////////////////////////////////////////////////////////////////
915//
916LLWebBrowserTexture::LLWebBrowserTexture( S32 width, S32 height, LLMediaCtrl* browserCtrl, viewer_media_t media_source ) :
917 LLDynamicTexture( 512, 512, 4, ORDER_FIRST, TRUE ),
918 mNeedsUpdate( true ),
919 mNeedsResize( false ),
920 mTextureCoordsOpenGL( true ),
921 mWebBrowserCtrl( browserCtrl ),
922 mMediaSource(media_source)
923{
924 mElapsedTime.start();
925
926 resize( width, height );
927}
928
929////////////////////////////////////////////////////////////////////////////////
930//
931LLWebBrowserTexture::~LLWebBrowserTexture()
932{
933 mElapsedTime.stop();
934 mMediaSource = NULL;
935}
936
937////////////////////////////////////////////////////////////////////////////////
938//
939BOOL LLWebBrowserTexture::needsRender()
940{
941 bool texture_dirty = false;
942
943 if ( mWebBrowserCtrl->getFrequentUpdates() ||
944 mWebBrowserCtrl->getAlwaysRefresh() ||
945 mWebBrowserCtrl->getForceUpdate() )
946 {
947 // All of these force an update
948 return TRUE;
949 }
950
951 // If the texture needs updating, render needs to be called.
952 if (mMediaSource && mMediaSource->hasMedia())
953 {
954 LLPluginClassMedia* media = mMediaSource->getMediaPlugin();
955
956 if(media->textureValid() && media->getDirty())
957 {
958 texture_dirty = true;
959 }
960 }
961
962
963 return texture_dirty;
964}
965
966////////////////////////////////////////////////////////////////////////////////
967//
968BOOL LLWebBrowserTexture::render()
969{
970 if(updateBrowserTexture())
971 {
972 // updateBrowserTexture already verified that the media plugin is there and the texture is valid.
973 LLPluginClassMedia* media_plugin = mMediaSource->getMediaPlugin();
974 LLRect dirty_rect;
975
976 if(mNeedsUpdate)
977 {
978 // If we need an update, use the whole rect instead of the dirty rect.
979 dirty_rect.mLeft = 0;
980 dirty_rect.mBottom = 0;
981 dirty_rect.mRight = media_plugin->getWidth();
982 dirty_rect.mTop = media_plugin->getHeight();
983 }
984 else
985 {
986 mNeedsUpdate = media_plugin->getDirty(&dirty_rect);
987 }
988
989 if ( mNeedsUpdate )
990 {
991 mNeedsUpdate = false;
992 mWebBrowserCtrl->setForceUpdate(false);
993
994 // Constrain the dirty rect to be inside the texture
995 S32 x_pos = llmax(dirty_rect.mLeft, 0);
996 S32 y_pos = llmax(dirty_rect.mBottom, 0);
997 S32 width = llmin(dirty_rect.mRight, getWidth()) - x_pos;
998 S32 height = llmin(dirty_rect.mTop, getHeight()) - y_pos;
999
1000 if(width > 0 && height > 0)
1001 {
1002 U8* data = media_plugin->getBitsData();
1003
1004 // Offset the pixels pointer to match x_pos and y_pos
1005 data += ( x_pos * media_plugin->getTextureDepth() * media_plugin->getBitsWidth() );
1006 data += ( y_pos * media_plugin->getTextureDepth() );
1007
1008 mTexture->setSubImage(
1009 data,
1010 media_plugin->getBitsWidth(),
1011 media_plugin->getBitsHeight(),
1012 x_pos,
1013 y_pos,
1014 width,
1015 height,
1016 TRUE); // force a fast update (i.e. don't call analyzeAlpha, etc.)
1017 }
1018
1019 media_plugin->resetDirty();
1020
1021 return TRUE;
1022 };
1023 };
1024
1025 return FALSE;
1026}
1027
1028////////////////////////////////////////////////////////////////////////////////
1029//
1030S32 LLWebBrowserTexture::getMediaWidth()
1031{
1032 return mMediaWidth;
1033}
1034
1035////////////////////////////////////////////////////////////////////////////////
1036//
1037S32 LLWebBrowserTexture::getMediaHeight()
1038{
1039 return mMediaHeight;
1040}
1041
1042////////////////////////////////////////////////////////////////////////////////
1043//
1044void LLWebBrowserTexture::setNeedsUpdate()
1045{
1046 mNeedsUpdate = true;
1047}
1048
1049////////////////////////////////////////////////////////////////////////////////
1050//
1051bool LLWebBrowserTexture::getNeedsUpdate()
1052{
1053 return mNeedsUpdate;
1054}
1055
1056////////////////////////////////////////////////////////////////////////////////
1057//
1058bool LLWebBrowserTexture::getTextureCoordsOpenGL()
1059{
1060 return mTextureCoordsOpenGL;
1061}
1062
1063
1064////////////////////////////////////////////////////////////////////////////////
1065//
1066void LLWebBrowserTexture::resize( S32 new_width, S32 new_height )
1067{
1068 F32 scale_ratio = 1.f;
1069 if (new_width > MAX_DIMENSION)
1070 {
1071 scale_ratio = (F32)MAX_DIMENSION / (F32)new_width;
1072 }
1073 if (new_height > MAX_DIMENSION)
1074 {
1075 scale_ratio = llmin(scale_ratio, (F32)MAX_DIMENSION / (F32)new_height);
1076 }
1077
1078 mMediaWidth = llround(scale_ratio * (F32)new_width);
1079 mMediaHeight = llround(scale_ratio * (F32)new_height);
1080
1081 adjustSize();
1082}
1083
1084bool LLWebBrowserTexture::adjustSize()
1085{
1086 if (mMediaSource && mMediaSource->hasMedia())
1087 {
1088 int natural_width = mMediaSource->getMediaPlugin()->getNaturalWidth();
1089 int natural_height = mMediaSource->getMediaPlugin()->getNaturalHeight();
1090
1091 if(natural_width != 0)
1092 {
1093 // If the media has a "natural size", use it.
1094 mMediaWidth = natural_width;
1095 mMediaHeight = natural_height;
1096 }
1097
1098 mMediaSource->setSize(mMediaWidth, mMediaHeight);
1099 mNeedsResize = false;
1100
1101 return true;
1102 }
1103 else
1104 {
1105 // The media isn't fully initialized yet, delay the resize until later.
1106 mNeedsResize = true;
1107 }
1108
1109 return false;
1110}
1111
1112bool LLWebBrowserTexture::updateBrowserTexture()
1113{
1114 if (!adjustSize())
1115 return false;
1116
1117 LLPluginClassMedia* media = mMediaSource->getMediaPlugin();
1118
1119 if(!media->textureValid())
1120 return false;
1121
1122 if(mMediaSource->mNeedsNewTexture
1123 || media->getTextureWidth() != mWidth
1124 || media->getTextureHeight() != mHeight )
1125 {
1126 releaseGLTexture();
1127
1128 mWidth = media->getTextureWidth();
1129 mHeight = media->getTextureHeight();
1130 mTextureCoordsOpenGL = media->getTextureCoordsOpenGL();
1131
1132 // will create mWidth * mHeight sized texture, using the texture params specified by the media.
1133 LLDynamicTexture::generateGLTexture(
1134 media->getTextureFormatInternal(),
1135 media->getTextureFormatPrimary(),
1136 media->getTextureFormatType(),
1137 media->getTextureFormatSwapBytes());
1138
1139
1140 mMediaSource->mNeedsNewTexture = false;
1141 }
1142
1143 return true;
1144}
1145// virtual
1146LLXMLNodePtr LLMediaCtrl::getXML(bool save_children) const
1147{
1148 LLXMLNodePtr node = LLUICtrl::getXML();
1149
1150 node->setName(LL_WEB_BROWSER_CTRL_TAG);
1151
1152 return node;
1153}
1154
1155LLView* LLMediaCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
1156{
1157 std::string name("web_browser");
1158 node->getAttributeString("name", name);
1159
1160 std::string start_url("");
1161 node->getAttributeString("start_url", start_url );
1162
1163 BOOL border_visible = true;
1164 node->getAttributeBOOL("border_visible", border_visible);
1165
1166 LLRect rect;
1167 createRect(node, rect, parent, LLRect());
1168
1169 LLMediaCtrl* web_browser = new LLMediaCtrl( name, rect );
1170
1171 if(node->hasAttribute("caret_color"))
1172 {
1173 LLColor4 color;
1174 LLUICtrlFactory::getAttributeColor(node, "caret_color", color);
1175 LLColor4U colorU = LLColor4U(color);
1176 web_browser->setCaretColor( colorU.mV[0], colorU.mV[1], colorU.mV[2] );
1177 }
1178
1179 BOOL ignore_ui_scale = web_browser->getIgnoreUIScale();
1180 node->getAttributeBOOL("ignore_ui_scale", ignore_ui_scale);
1181 web_browser->setIgnoreUIScale((bool)ignore_ui_scale);
1182
1183 web_browser->initFromXML(node, parent);
1184
1185 web_browser->setHomePageUrl( start_url );
1186
1187 web_browser->setBorderVisible( border_visible );
1188
1189 if(! start_url.empty())
1190 {
1191 web_browser->navigateHome();
1192 }
1193
1194 return web_browser;
1195}
1196
1197std::string LLMediaCtrl::getCurrentNavUrl()
1198{
1199 return mCurrentNavUrl;
1200}
1201
diff --git a/linden/indra/newview/llmediactrl.h b/linden/indra/newview/llmediactrl.h
new file mode 100644
index 0000000..77f59c7
--- /dev/null
+++ b/linden/indra/newview/llmediactrl.h
@@ -0,0 +1,201 @@
1/**
2 * @file llmediactrl.h
3 * @brief Web browser UI control
4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 *
7 * Copyright (c) 2006-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * 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 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("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 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * 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 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#ifndef LL_LLMediaCtrl_H
34#define LL_LLMediaCtrl_H
35
36#include "llviewermedia.h"
37
38#include "lluictrl.h"
39#include "llframetimer.h"
40#include "lldynamictexture.h"
41
42class LLViewBorder;
43class LLWebBrowserTexture;
44class LLUICtrlFactory;
45
46////////////////////////////////////////////////////////////////////////////////
47//
48class LLMediaCtrl :
49 public LLUICtrl,
50 public LLViewerMediaObserver,
51 public LLViewerMediaEventEmitter
52{
53 public:
54 LLMediaCtrl( const std::string& name, const LLRect& rect );
55 virtual ~LLMediaCtrl();
56
57 void setBorderVisible( BOOL border_visible );
58
59 // For the tutorial window, we don't want to take focus on clicks,
60 // as the examples include how to move around with the arrow
61 // keys. Thus we keep focus on the app by setting this false.
62 // Defaults to true.
63 void setTakeFocusOnClick( bool take_focus );
64
65 virtual LLXMLNodePtr getXML(bool save_children = true) const;
66 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
67
68 // handle mouse related methods
69 virtual BOOL handleHover( S32 x, S32 y, MASK mask );
70 virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
71 virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
72 virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
73 virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks );
74
75 // navigation
76 void navigateTo( std::string url_in, std::string mime_type = "");
77 void navigateBack();
78 void navigateHome();
79 void navigateForward();
80 void navigateToLocalPage( const std::string& subdir, const std::string& filename_in );
81 bool canNavigateBack();
82 bool canNavigateForward();
83 void setOpenInExternalBrowser( bool valIn );
84 void setOpenInInternalBrowser( bool valIn );
85 std::string getCurrentNavUrl();
86
87 // By default, we do not handle "secondlife:///app/" SLURLs, because
88 // those can cause teleports, open windows, etc. We cannot be sure
89 // that each "click" is actually due to a user action, versus
90 // Javascript or some other mechanism. However, we need the search
91 // floater and login page to handle these URLs. Those are safe
92 // because we control the page content. See DEV-9530. JC.
93 void setTrusted( bool valIn );
94
95 void setHomePageUrl( const std::string urlIn );
96 std::string getHomePageUrl();
97
98 // set/clear URL to visit when a 404 page is reached
99 void set404RedirectUrl( std::string redirect_url );
100 void clr404RedirectUrl();
101
102 // accessor/mutator for flag that indicates if frequent updates to texture happen
103 bool getFrequentUpdates() { return mFrequentUpdates; };
104 void setFrequentUpdates( bool frequentUpdatesIn ) { mFrequentUpdates = frequentUpdatesIn; };
105
106 void setIgnoreUIScale(bool ignore) { mIgnoreUIScale = ignore; }
107 bool getIgnoreUIScale() { return mIgnoreUIScale; }
108
109 void setAlwaysRefresh(bool refresh) { mAlwaysRefresh = refresh; }
110 bool getAlwaysRefresh() { return mAlwaysRefresh; }
111
112 void setForceUpdate(bool force_update) { mForceUpdate = force_update; }
113 bool getForceUpdate() { return mForceUpdate; }
114
115 LLPluginClassMedia* getMediaPlugin();
116
117 bool setCaretColor( unsigned int red, unsigned int green, unsigned int blue );
118
119
120 // over-rides
121 virtual BOOL handleKeyHere( KEY key, MASK mask);
122 virtual void handleVisibilityChange ( BOOL new_visibility );
123 virtual BOOL handleUnicodeCharHere(llwchar uni_char);
124 virtual void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE);
125 virtual void draw();
126 virtual void onVisibilityChange ( BOOL curVisibilityIn );
127
128 // focus overrides
129 void onFocusLost();
130 void onFocusReceived();
131
132 // Incoming media event dispatcher
133 virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
134
135 // handlers for individual events (could be done inside the switch in handleMediaEvent, they're just individual functions for clarity)
136 void onClickLinkHref( LLPluginClassMedia* self );
137 void onClickLinkNoFollow( LLPluginClassMedia* self );
138
139 protected:
140 void convertInputCoords(S32& x, S32& y);
141
142 private:
143 static bool onClickLinkExternalTarget( const LLSD&, const LLSD& );
144
145 const S32 mTextureDepthBytes;
146 LLWebBrowserTexture* mWebBrowserImage;
147 LLViewBorder* mBorder;
148 bool mFrequentUpdates;
149 bool mForceUpdate;
150 bool mOpenLinksInExternalBrowser;
151 bool mOpenLinksInInternalBrowser;
152 bool mTrusted;
153 std::string mHomePageUrl;
154 std::string mExternalUrl;
155 std::string mCurrentNavUrl;
156 bool mIgnoreUIScale;
157 bool mAlwaysRefresh;
158 viewer_media_t mMediaSource;
159 bool mTakeFocusOnClick;
160 ECursorType mLastSetCursor;
161 bool mStretchToFill;
162 bool mMaintainAspectRatio;
163 bool mHideLoading;
164};
165
166////////////////////////////////////////////////////////////////////////////////
167//
168class LLWebBrowserTexture : public LLDynamicTexture
169{
170LOG_CLASS(LLWebBrowserTexture);
171 public:
172 LLWebBrowserTexture( S32 width, S32 height, LLMediaCtrl* browserCtrl, viewer_media_t media_source );
173 virtual ~LLWebBrowserTexture();
174
175 virtual BOOL needsRender();
176 virtual void preRender( BOOL clear_depth = TRUE ) {};
177 virtual void postRender( BOOL success ) {};
178 virtual BOOL render();
179
180 bool adjustSize();
181 S32 getMediaWidth();
182 S32 getMediaHeight();
183 bool getNeedsUpdate();
184 void setNeedsUpdate();
185 bool getTextureCoordsOpenGL();
186
187 void resize( S32 new_width, S32 new_height );
188 bool updateBrowserTexture();
189
190 protected:
191 S32 mMediaWidth;
192 S32 mMediaHeight;
193 bool mNeedsUpdate;
194 bool mNeedsResize;
195 bool mTextureCoordsOpenGL;
196 LLFrameTimer mElapsedTime;
197 LLMediaCtrl* mWebBrowserCtrl;
198 viewer_media_t mMediaSource;
199};
200
201#endif // LL_LLMediaCtrl_H
diff --git a/linden/indra/newview/llmediaremotectrl.cpp b/linden/indra/newview/llmediaremotectrl.cpp
index f2ec414..a62973a 100644
--- a/linden/indra/newview/llmediaremotectrl.cpp
+++ b/linden/indra/newview/llmediaremotectrl.cpp
@@ -34,7 +34,7 @@
34 34
35#include "llmediaremotectrl.h" 35#include "llmediaremotectrl.h"
36 36
37#include "audioengine.h" 37#include "llaudioengine.h"
38#include "lliconctrl.h" 38#include "lliconctrl.h"
39#include "llmimetypes.h" 39#include "llmimetypes.h"
40#include "lloverlaybar.h" 40#include "lloverlaybar.h"
@@ -86,6 +86,7 @@ BOOL LLMediaRemoteCtrl::postBuild()
86 childSetAction("media_stop",LLOverlayBar::mediaStop,this); 86 childSetAction("media_stop",LLOverlayBar::mediaStop,this);
87 childSetAction("music_stop",LLOverlayBar::toggleMusicPlay,this); 87 childSetAction("music_stop",LLOverlayBar::toggleMusicPlay,this);
88 childSetAction("media_pause",LLOverlayBar::toggleMediaPlay,this); 88 childSetAction("media_pause",LLOverlayBar::toggleMediaPlay,this);
89 childSetAction("music_pause",LLOverlayBar::toggleMusicPlay,this);
89 90
90 childSetAction("expand", onClickExpandBtn, this); 91 childSetAction("expand", onClickExpandBtn, this);
91 return TRUE; 92 return TRUE;
@@ -135,9 +136,11 @@ void* LLMediaRemoteCtrl::createVolumePanel(void* data)
135// Virtual 136// Virtual
136void LLMediaRemoteCtrl::setToolTip(const std::string& msg) 137void LLMediaRemoteCtrl::setToolTip(const std::string& msg)
137{ 138{
138 std::string mime_type = LLMIMETypes::translate(LLViewerMedia::getMimeType()); 139 // TODO: this gets removed for Media on a Prim
139 std::string tool_tip = LLMIMETypes::findToolTip(LLViewerMedia::getMimeType()); 140
140 std::string play_tip = LLMIMETypes::findPlayTip(LLViewerMedia::getMimeType()); 141 const std::string mime_type = LLViewerParcelMedia::getMimeType();
142 std::string tool_tip = LLMIMETypes::findToolTip(mime_type);
143 std::string play_tip = LLMIMETypes::findPlayTip(mime_type);
141 // childSetToolTip("media_stop", mControls->getString("stop_label") + "\n" + tool_tip); 144 // childSetToolTip("media_stop", mControls->getString("stop_label") + "\n" + tool_tip);
142 childSetToolTip("media_icon", tool_tip); 145 childSetToolTip("media_icon", tool_tip);
143 childSetToolTip("media_play", play_tip); 146 childSetToolTip("media_play", play_tip);
@@ -150,6 +153,7 @@ void LLMediaRemoteCtrl::enableMediaButtons()
150 bool stop_media_enabled = false; 153 bool stop_media_enabled = false;
151 bool play_music_enabled = false; 154 bool play_music_enabled = false;
152 bool stop_music_enabled = false; 155 bool stop_music_enabled = false;
156 bool music_show_pause = false;
153 bool media_show_pause = false; 157 bool media_show_pause = false;
154 LLColor4 music_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); 158 LLColor4 music_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" );
155 LLColor4 media_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); 159 LLColor4 media_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" );
@@ -161,7 +165,7 @@ void LLMediaRemoteCtrl::enableMediaButtons()
161 165
162 if (gSavedSettings.getBOOL("AudioStreamingVideo")) 166 if (gSavedSettings.getBOOL("AudioStreamingVideo"))
163 { 167 {
164 if ( parcel && parcel->getMediaURL()[0]) 168 if ( parcel && !parcel->getMediaURL().empty())
165 { 169 {
166 // Set the tooltip 170 // Set the tooltip
167 // Put this text into xui file 171 // Put this text into xui file
@@ -171,23 +175,22 @@ void LLMediaRemoteCtrl::enableMediaButtons()
171 play_media_enabled = true; 175 play_media_enabled = true;
172 media_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); 176 media_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" );
173 177
174 LLMediaBase::EStatus status = LLViewerParcelMedia::getStatus(); 178 LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus();
175 switch(status) 179 switch(status)
176 { 180 {
177 case LLMediaBase::STATUS_STOPPED: 181 case LLViewerMediaImpl::MEDIA_NONE:
178 case LLMediaBase::STATUS_UNKNOWN:
179 media_show_pause = false; 182 media_show_pause = false;
180 stop_media_enabled = false; 183 stop_media_enabled = false;
181 break; 184 break;
182 case LLMediaBase::STATUS_STARTED: 185 case LLViewerMediaImpl::MEDIA_LOADING:
183 case LLMediaBase::STATUS_NAVIGATING: 186 case LLViewerMediaImpl::MEDIA_LOADED:
184 case LLMediaBase::STATUS_RESETTING: 187 case LLViewerMediaImpl::MEDIA_PLAYING:
185 // HACK: only show the pause button for movie types 188 // HACK: only show the pause button for movie types
186 media_show_pause = LLMIMETypes::widgetType(parcel->getMediaType()) == "movie" ? true : false; 189 media_show_pause = LLMIMETypes::widgetType(parcel->getMediaType()) == "movie" ? true : false;
187 stop_media_enabled = true; 190 stop_media_enabled = true;
188 play_media_enabled = false; 191 play_media_enabled = false;
189 break; 192 break;
190 case LLMediaBase::STATUS_PAUSED: 193 case LLViewerMediaImpl::MEDIA_PAUSED:
191 media_show_pause = false; 194 media_show_pause = false;
192 stop_media_enabled = true; 195 stop_media_enabled = true;
193 break; 196 break;
@@ -197,46 +200,42 @@ void LLMediaRemoteCtrl::enableMediaButtons()
197 } 200 }
198 } 201 }
199 } 202 }
203
200 if (gSavedSettings.getBOOL("AudioStreamingMusic") && gAudiop) 204 if (gSavedSettings.getBOOL("AudioStreamingMusic") && gAudiop)
201 { 205 {
202 206 if ( parcel && !parcel->getMusicURL().empty())
203 if ( parcel && parcel->getMusicURL()[0])
204 { 207 {
208 play_music_enabled = true;
205 music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); 209 music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" );
206 210
207 if (gOverlayBar->musicPlaying()) 211 if (gOverlayBar->musicPlaying())
208 { 212 {
209 play_music_enabled = false; 213 music_show_pause = true;
210 stop_music_enabled = true; 214 stop_music_enabled = true;
211 } 215 }
212 else 216 else
213 { 217 {
214 play_music_enabled = true; 218 music_show_pause = false;
215 stop_music_enabled = false; 219 stop_music_enabled = false;
216 } 220 }
217 } 221 }
218 // if no mime type has been set disable play 222 // Don't test the mime-type: this is not updated in a consistent basis. The existence of a valid gAudiop is enough guarantee.
219 if( LLViewerMedia::getMimeType().empty()
220 || LLViewerMedia::getMimeType() == "none/none")
221 {
222 play_media_enabled = false;
223 stop_media_enabled = false;
224 }
225 } 223 }
226 const std::string media_icon_name = LLMIMETypes::findIcon(media_type); 224 const std::string media_icon_name = LLMIMETypes::findIcon(media_type);
227
228 LLButton* music_play_btn = getChild<LLButton>("music_play"); 225 LLButton* music_play_btn = getChild<LLButton>("music_play");
229 LLButton* music_stop_btn = getChild<LLButton>("music_stop"); 226 LLButton* music_stop_btn = getChild<LLButton>("music_stop");
230 227 LLButton* music_pause_btn = getChild<LLButton>("music_pause");
231 music_play_btn->setEnabled(play_music_enabled);
232 music_stop_btn->setEnabled(stop_music_enabled);
233 childSetColor("music_icon", music_icon_color);
234
235 LLButton* media_play_btn = getChild<LLButton>("media_play"); 228 LLButton* media_play_btn = getChild<LLButton>("media_play");
236 LLButton* media_stop_btn = getChild<LLButton>("media_stop"); 229 LLButton* media_stop_btn = getChild<LLButton>("media_stop");
237 LLButton* media_pause_btn = getChild<LLButton>("media_pause"); 230 LLButton* media_pause_btn = getChild<LLButton>("media_pause");
238 LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon"); 231 LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon");
239 232
233 music_play_btn->setEnabled(play_music_enabled);
234 music_stop_btn->setEnabled(stop_music_enabled);
235 music_pause_btn->setEnabled(music_show_pause);
236 music_pause_btn->setVisible(music_show_pause);
237 music_play_btn->setVisible(! music_show_pause);
238 childSetColor("music_icon", music_icon_color);
240 if(!media_icon_name.empty()) 239 if(!media_icon_name.empty())
241 { 240 {
242 media_icon->setImage(media_icon_name); 241 media_icon->setImage(media_icon_name);
diff --git a/linden/indra/newview/llmimetypes.cpp b/linden/indra/newview/llmimetypes.cpp
index bfbc81a..525e89c 100644
--- a/linden/indra/newview/llmimetypes.cpp
+++ b/linden/indra/newview/llmimetypes.cpp
@@ -46,6 +46,8 @@ std::string sDefaultWidgetType;
46 // Returned when we don't know what widget set to use 46 // Returned when we don't know what widget set to use
47std::string sDefaultImpl; 47std::string sDefaultImpl;
48 // Returned when we don't know what impl to use 48 // Returned when we don't know what impl to use
49std::string sXMLFilename;
50 // Squirrel away XML filename so we know how to reset
49 51
50///////////////////////////////////////////////////////////////////////////// 52/////////////////////////////////////////////////////////////////////////////
51 53
@@ -146,6 +148,8 @@ bool LLMIMETypes::parseMIMETypes(const std::string& xml_filename)
146 sWidgetMap[set_name] = info; 148 sWidgetMap[set_name] = info;
147 } 149 }
148 } 150 }
151
152 sXMLFilename = xml_filename;
149 return true; 153 return true;
150} 154}
151 155
@@ -267,3 +271,23 @@ bool LLMIMETypes::findAllowLooping(const std::string& mime_type)
267 } 271 }
268 return allow_looping; 272 return allow_looping;
269} 273}
274
275// static
276bool LLMIMETypes::isTypeHandled(const std::string& mime_type)
277{
278 mime_info_map_t::const_iterator it = sMap.find(mime_type);
279 if (it != sMap.end())
280 {
281 return true;
282 }
283 return false;
284}
285
286// static
287void LLMIMETypes::reload(void*)
288{
289 sMap.clear();
290 sWidgetMap.clear();
291 (void)LLMIMETypes::parseMIMETypes(sXMLFilename);
292}
293
diff --git a/linden/indra/newview/llmimetypes.h b/linden/indra/newview/llmimetypes.h
index 7a50c29..b217ce7 100644
--- a/linden/indra/newview/llmimetypes.h
+++ b/linden/indra/newview/llmimetypes.h
@@ -72,6 +72,12 @@ public:
72 static bool findAllowLooping(const std::string& mime_type); 72 static bool findAllowLooping(const std::string& mime_type);
73 // accessor for flag to enable/disable media looping checkbox 73 // accessor for flag to enable/disable media looping checkbox
74 74
75 static bool isTypeHandled(const std::string& mime_type);
76 // determines if the specific mime type is handled by the media system
77
78 static void reload(void*);
79 // re-loads the MIME types file from the file path last passed into parseMIMETypes
80
75public: 81public:
76 struct LLMIMEInfo 82 struct LLMIMEInfo
77 { 83 {
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp
index 6191a01..db4422d 100644
--- a/linden/indra/newview/lloverlaybar.cpp
+++ b/linden/indra/newview/lloverlaybar.cpp
@@ -38,7 +38,7 @@
38#include "lloverlaybar.h" 38#include "lloverlaybar.h"
39 39
40#include "aoremotectrl.h" 40#include "aoremotectrl.h"
41#include "audioengine.h" 41#include "llaudioengine.h"
42#include "llrender.h" 42#include "llrender.h"
43#include "llagent.h" 43#include "llagent.h"
44#include "llbutton.h" 44#include "llbutton.h"
@@ -63,7 +63,7 @@
63#include "llvoiceclient.h" 63#include "llvoiceclient.h"
64#include "llvoavatar.h" 64#include "llvoavatar.h"
65#include "llvoiceremotectrl.h" 65#include "llvoiceremotectrl.h"
66#include "llwebbrowserctrl.h" 66#include "llmediactrl.h"
67#include "llwindlightremotectrl.h" 67#include "llwindlightremotectrl.h"
68#include "llselectmgr.h" 68#include "llselectmgr.h"
69 69
@@ -75,13 +75,14 @@ LLOverlayBar *gOverlayBar = NULL;
75 75
76extern S32 MENU_BAR_HEIGHT; 76extern S32 MENU_BAR_HEIGHT;
77 77
78 78//awfixme
79/*
79class LLTitleObserver 80class LLTitleObserver
80 : public LLMediaObserver 81 : public LLMediaObserver
81{ 82{
82public: 83public:
83 void init(std::string url); 84 void init(std::string url);
84 /*virtual*/ void onMediaTitleChange(const EventType& event_in); 85 *//*virtual*//* void onMediaTitleChange(const EventType& event_in);
85private: 86private:
86 LLMediaBase* mMediaSource; 87 LLMediaBase* mMediaSource;
87}; 88};
@@ -120,7 +121,7 @@ void LLTitleObserver::onMediaTitleChange(const EventType& event_in)
120 chat.mText = playing_msg; 121 chat.mText = playing_msg;
121 LLFloaterChat::addChat(chat, FALSE, FALSE); 122 LLFloaterChat::addChat(chat, FALSE, FALSE);
122} 123}
123 124*/
124 125
125// 126//
126// Functions 127// Functions
@@ -445,11 +446,11 @@ void LLOverlayBar::toggleMediaPlay(void*)
445 } 446 }
446 447
447 448
448 if (LLViewerMedia::isMediaPaused()) 449 if (LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PAUSED)
449 { 450 {
450 LLViewerParcelMedia::start(); 451 LLViewerParcelMedia::start();
451 } 452 }
452 else if(LLViewerMedia::isMediaPlaying()) 453 else if(LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PLAYING)
453 { 454 {
454 LLViewerParcelMedia::pause(); 455 LLViewerParcelMedia::pause();
455 } 456 }
@@ -490,7 +491,7 @@ void LLOverlayBar::toggleMusicPlay(void*)
490 // if ( gAudiop->isInternetStreamPlaying() == 0 ) 491 // if ( gAudiop->isInternetStreamPlaying() == 0 )
491 { 492 {
492 gAudiop->startInternetStream(parcel->getMusicURL()); 493 gAudiop->startInternetStream(parcel->getMusicURL());
493 sTitleObserver.init(parcel->getMusicURL()); 494//awfixme sTitleObserver.init(parcel->getMusicURL());
494 } 495 }
495 } 496 }
496 } 497 }
diff --git a/linden/indra/newview/llpanelaudioprefs.cpp b/linden/indra/newview/llpanelaudioprefs.cpp
index 2bb3ab4..d4c8e9f 100644
--- a/linden/indra/newview/llpanelaudioprefs.cpp
+++ b/linden/indra/newview/llpanelaudioprefs.cpp
@@ -42,7 +42,7 @@
42#include "llfontgl.h" 42#include "llfontgl.h"
43 43
44// project includes 44// project includes
45#include "audioengine.h" 45#include "llaudioengine.h"
46#include "llbutton.h" 46#include "llbutton.h"
47#include "llcheckboxctrl.h" 47#include "llcheckboxctrl.h"
48#include "llcombobox.h" 48#include "llcombobox.h"
@@ -105,7 +105,6 @@ void LLPanelAudioPrefs::refreshValues()
105 mPreviousMusicVolume = gSavedSettings.getF32("AudioLevelMusic"); 105 mPreviousMusicVolume = gSavedSettings.getF32("AudioLevelMusic");
106 mPreviousMediaVolume = gSavedSettings.getF32("AudioLevelMedia"); 106 mPreviousMediaVolume = gSavedSettings.getF32("AudioLevelMedia");
107 mPreviousDoppler = gSavedSettings.getF32("AudioLevelDoppler"); 107 mPreviousDoppler = gSavedSettings.getF32("AudioLevelDoppler");
108 mPreviousDistance = gSavedSettings.getF32("AudioLevelDistance");
109 mPreviousRolloff = gSavedSettings.getF32("AudioLevelRolloff"); 108 mPreviousRolloff = gSavedSettings.getF32("AudioLevelRolloff");
110 109
111 mPreviousMoneyThreshold = gSavedSettings.getF32("UISndMoneyChangeThreshold"); 110 mPreviousMoneyThreshold = gSavedSettings.getF32("UISndMoneyChangeThreshold");
@@ -134,7 +133,6 @@ void LLPanelAudioPrefs::cancel()
134 gSavedSettings.setF32("AudioLevelMusic", mPreviousMusicVolume); 133 gSavedSettings.setF32("AudioLevelMusic", mPreviousMusicVolume);
135 gSavedSettings.setF32("AudioLevelMedia", mPreviousMediaVolume); 134 gSavedSettings.setF32("AudioLevelMedia", mPreviousMediaVolume);
136 gSavedSettings.setF32("AudioLevelDoppler", mPreviousDoppler ); 135 gSavedSettings.setF32("AudioLevelDoppler", mPreviousDoppler );
137 gSavedSettings.setF32("AudioLevelDistance", mPreviousDistance );
138 gSavedSettings.setF32("AudioLevelRolloff", mPreviousRolloff ); 136 gSavedSettings.setF32("AudioLevelRolloff", mPreviousRolloff );
139 137
140 gSavedSettings.setF32("UISndMoneyChangeThreshold", mPreviousMoneyThreshold ); 138 gSavedSettings.setF32("UISndMoneyChangeThreshold", mPreviousMoneyThreshold );
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp
index 33f4cd6..288dbcd 100644
--- a/linden/indra/newview/llpanelavatar.cpp
+++ b/linden/indra/newview/llpanelavatar.cpp
@@ -64,6 +64,7 @@
64#include "llmutelist.h" 64#include "llmutelist.h"
65#include "llpanelclassified.h" 65#include "llpanelclassified.h"
66#include "llpanelpick.h" 66#include "llpanelpick.h"
67#include "llpluginclassmedia.h"
67#include "llscrolllistctrl.h" 68#include "llscrolllistctrl.h"
68#include "llstatusbar.h" 69#include "llstatusbar.h"
69#include "lltabcontainer.h" 70#include "lltabcontainer.h"
@@ -410,14 +411,12 @@ BOOL LLPanelAvatarWeb::postBuild(void)
410 411
411 childSetControlName("auto_load","AutoLoadWebProfiles"); 412 childSetControlName("auto_load","AutoLoadWebProfiles");
412 413
413 mWebBrowser = getChild<LLWebBrowserCtrl>("profile_html"); 414 mWebBrowser = getChild<LLMediaCtrl>("profile_html");
415 mWebBrowser->addObserver(this);
414 416
415 // links open in internally 417 // links open in internally
416 mWebBrowser->setOpenInExternalBrowser( false ); 418 mWebBrowser->setOpenInExternalBrowser( false );
417 419
418 // observe browser events
419 mWebBrowser->addObserver( this );
420
421 return TRUE; 420 return TRUE;
422} 421}
423 422
@@ -476,18 +475,22 @@ LLPanelAvatarWeb::LLPanelAvatarWeb(const std::string& name, const LLRect& rect,
476 475
477LLPanelAvatarWeb::~LLPanelAvatarWeb() 476LLPanelAvatarWeb::~LLPanelAvatarWeb()
478{ 477{
479 // stop observing browser events 478}
480 if ( mWebBrowser ) 479
480void LLPanelAvatarWeb::refresh()
481{
482 if (mNavigateTo != "")
481 { 483 {
482 mWebBrowser->remObserver( this ); 484 llinfos << "Loading " << mNavigateTo << llendl;
483 }; 485 mWebBrowser->navigateTo( mNavigateTo );
486 mNavigateTo = "";
487 }
484} 488}
485 489
490
486void LLPanelAvatarWeb::enableControls(BOOL self) 491void LLPanelAvatarWeb::enableControls(BOOL self)
487{ 492{
488 childSetEnabled("url_edit",self); 493 childSetEnabled("url_edit",self);
489 childSetVisible("status_text",!self && !mHome.empty());
490 childSetText("status_text", LLStringUtil::null);
491} 494}
492 495
493void LLPanelAvatarWeb::setWebURL(std::string url) 496void LLPanelAvatarWeb::setWebURL(std::string url)
@@ -511,11 +514,8 @@ void LLPanelAvatarWeb::setWebURL(std::string url)
511 else 514 else
512 { 515 {
513 childSetVisible("profile_html",false); 516 childSetVisible("profile_html",false);
517 childSetVisible("status_text", false);
514 } 518 }
515
516 BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() );
517 childSetVisible("status_text",!own_avatar && !mHome.empty());
518
519} 519}
520 520
521// static 521// static
@@ -538,13 +538,15 @@ void LLPanelAvatarWeb::load(std::string url)
538{ 538{
539 bool have_url = (!url.empty()); 539 bool have_url = (!url.empty());
540 540
541
542 childSetVisible("profile_html", have_url);
543 childSetVisible("status_text", have_url);
544 childSetText("status_text", LLStringUtil::null);
545
541 if (have_url) 546 if (have_url)
542 { 547 {
543 llinfos << "Loading " << url << llendl; 548 mNavigateTo = url;
544 mWebBrowser->navigateTo( url );
545 } 549 }
546
547 childSetVisible("profile_html", have_url);
548} 550}
549 551
550//static 552//static
@@ -586,14 +588,22 @@ void LLPanelAvatarWeb::onCommitLoad(LLUICtrl* ctrl, void* data)
586 } 588 }
587} 589}
588 590
589void LLPanelAvatarWeb::onStatusTextChange( const EventType& eventIn ) 591void LLPanelAvatarWeb::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
590{
591 childSetText("status_text", eventIn.getStringValue() );
592}
593
594void LLPanelAvatarWeb::onLocationChange( const EventType& eventIn )
595{ 592{
596 childSetText("url_edit", eventIn.getStringValue() ); 593 switch(event)
594 {
595 case MEDIA_EVENT_STATUS_TEXT_CHANGED:
596 childSetText("status_text", self->getStatusText() );
597 break;
598
599 case MEDIA_EVENT_LOCATION_CHANGED:
600 childSetText("url_edit", self->getLocation() );
601 break;
602
603 default:
604 // Having a default case makes the compiler happy.
605 break;
606 }
597} 607}
598 608
599 609
diff --git a/linden/indra/newview/llpanelavatar.h b/linden/indra/newview/llpanelavatar.h
index 72a47f5..b687cd8 100644
--- a/linden/indra/newview/llpanelavatar.h
+++ b/linden/indra/newview/llpanelavatar.h
@@ -36,7 +36,7 @@
36#include "llpanel.h" 36#include "llpanel.h"
37#include "v3dmath.h" 37#include "v3dmath.h"
38#include "lluuid.h" 38#include "lluuid.h"
39#include "llwebbrowserctrl.h" 39#include "llmediactrl.h"
40 40
41class LLButton; 41class LLButton;
42class LLCheckBoxCtrl; 42class LLCheckBoxCtrl;
@@ -55,7 +55,7 @@ class LLViewerImage;
55class LLViewerObject; 55class LLViewerObject;
56class LLMessageSystem; 56class LLMessageSystem;
57class LLIconCtrl; 57class LLIconCtrl;
58class LLWebBrowserCtrl; 58class LLMediaCtrl;
59 59
60enum EOnlineStatus 60enum EOnlineStatus
61{ 61{
@@ -137,13 +137,15 @@ private:
137// WARNING! The order of the inheritance here matters!! Do not change. - KLW 137// WARNING! The order of the inheritance here matters!! Do not change. - KLW
138class LLPanelAvatarWeb : 138class LLPanelAvatarWeb :
139 public LLPanelAvatarTab 139 public LLPanelAvatarTab
140 , public LLWebBrowserCtrlObserver 140 , public LLViewerMediaObserver
141{ 141{
142public: 142public:
143 LLPanelAvatarWeb(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); 143 LLPanelAvatarWeb(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar);
144 /*virtual*/ ~LLPanelAvatarWeb(); 144 /*virtual*/ ~LLPanelAvatarWeb();
145 /*virtual*/ BOOL postBuild(void); 145 /*virtual*/ BOOL postBuild(void);
146 146
147 /*virtual*/ void refresh();
148
147 void enableControls(BOOL own_avatar); 149 void enableControls(BOOL own_avatar);
148 150
149 void setWebURL(std::string url); 151 void setWebURL(std::string url);
@@ -154,13 +156,13 @@ public:
154 static void onCommitURL(LLUICtrl* ctrl, void* data); 156 static void onCommitURL(LLUICtrl* ctrl, void* data);
155 static void onClickWebProfileHelp(void *); 157 static void onClickWebProfileHelp(void *);
156 158
157 // browser observer impls 159 // inherited from LLViewerMediaObserver
158 virtual void onStatusTextChange( const EventType& eventIn ); 160 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
159 virtual void onLocationChange( const EventType& eventIn );
160 161
161private: 162private:
162 std::string mHome; 163 std::string mHome;
163 LLWebBrowserCtrl* mWebBrowser; 164 std::string mNavigateTo;
165 LLMediaCtrl* mWebBrowser;
164}; 166};
165 167
166 168
diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp
index 36fc86d..2250012 100644
--- a/linden/indra/newview/llpanelclassified.cpp
+++ b/linden/indra/newview/llpanelclassified.cpp
@@ -142,7 +142,7 @@ public:
142 const bool from_search = true; 142 const bool from_search = true;
143 LLPanelClassified::sendClassifiedClickMessage(classified_id, "teleport", from_search); 143 LLPanelClassified::sendClassifiedClickMessage(classified_id, "teleport", from_search);
144 // Invoke teleport 144 // Invoke teleport
145 LLWebBrowserCtrl* web = NULL; 145 LLMediaCtrl* web = NULL;
146 const bool trusted_browser = true; 146 const bool trusted_browser = true;
147 return LLURLDispatcher::dispatch(url, web, trusted_browser); 147 return LLURLDispatcher::dispatch(url, web, trusted_browser);
148 } 148 }
diff --git a/linden/indra/newview/llpaneldebug.cpp b/linden/indra/newview/llpaneldebug.cpp
index c804fce..745daf5 100644
--- a/linden/indra/newview/llpaneldebug.cpp
+++ b/linden/indra/newview/llpaneldebug.cpp
@@ -42,7 +42,7 @@
42#include "llfontgl.h" 42#include "llfontgl.h"
43 43
44// project includes 44// project includes
45#include "audioengine.h" 45#include "llaudioengine.h"
46#include "llbutton.h" 46#include "llbutton.h"
47#include "llcheckboxctrl.h" 47#include "llcheckboxctrl.h"
48#include "llcolorswatch.h" 48#include "llcolorswatch.h"
diff --git a/linden/indra/newview/llpaneldirfind.cpp b/linden/indra/newview/llpaneldirfind.cpp
index 609f5cc..14c4a90 100644
--- a/linden/indra/newview/llpaneldirfind.cpp
+++ b/linden/indra/newview/llpaneldirfind.cpp
@@ -50,6 +50,7 @@
50#include "llviewercontrol.h" 50#include "llviewercontrol.h"
51#include "llmenucommands.h" 51#include "llmenucommands.h"
52#include "llmenugl.h" 52#include "llmenugl.h"
53#include "llpluginclassmedia.h"
53#include "lltextbox.h" 54#include "lltextbox.h"
54#include "lluiconstants.h" 55#include "lluiconstants.h"
55#include "llviewerimagelist.h" 56#include "llviewerimagelist.h"
@@ -143,9 +144,11 @@ BOOL LLPanelDirFind::postBuild()
143 } 144 }
144 145
145 146
146 mWebBrowser = getChild<LLWebBrowserCtrl>(mBrowserName); 147 mWebBrowser = getChild<LLMediaCtrl>(mBrowserName);
147 if (mWebBrowser) 148 if (mWebBrowser)
148 { 149 {
150 mWebBrowser->addObserver(this);
151
149 // new pages appear in same window as the results page now 152 // new pages appear in same window as the results page now
150 mWebBrowser->setOpenInInternalBrowser( false ); 153 mWebBrowser->setOpenInInternalBrowser( false );
151 mWebBrowser->setOpenInExternalBrowser( false ); 154 mWebBrowser->setOpenInExternalBrowser( false );
@@ -156,9 +159,6 @@ BOOL LLPanelDirFind::postBuild()
156 // redirect 404 pages from S3 somewhere else 159 // redirect 404 pages from S3 somewhere else
157 mWebBrowser->set404RedirectUrl( getString("redirect_404_url") ); 160 mWebBrowser->set404RedirectUrl( getString("redirect_404_url") );
158 161
159 // Track updates for progress display.
160 mWebBrowser->addObserver(this);
161
162 navigateToDefaultPage(); 162 navigateToDefaultPage();
163 } 163 }
164 164
@@ -167,8 +167,6 @@ BOOL LLPanelDirFind::postBuild()
167 167
168LLPanelDirFind::~LLPanelDirFind() 168LLPanelDirFind::~LLPanelDirFind()
169{ 169{
170 if (mWebBrowser)
171 mWebBrowser->remObserver(this);
172} 170}
173 171
174// virtual 172// virtual
@@ -485,19 +483,27 @@ void LLPanelDirFind::onClickSearch(void* data)
485 LLFloaterDirectory::sNewSearchCount++; 483 LLFloaterDirectory::sNewSearchCount++;
486} 484}
487 485
488void LLPanelDirFind::onNavigateBegin( const EventType& eventIn ) 486void LLPanelDirFind::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
489{
490 childSetText("status_text", getString("loading_text"));
491}
492
493void LLPanelDirFind::onNavigateComplete( const EventType& eventIn )
494{ 487{
495 childSetText("status_text", getString("done_text")); 488 switch(event)
496} 489 {
497 490 case MEDIA_EVENT_NAVIGATE_BEGIN:
498void LLPanelDirFind::onLocationChange( const EventType& eventIn ) 491 childSetText("status_text", getString("loading_text"));
499{ 492 break;
500 llinfos << eventIn.getStringValue() << llendl; 493
494 case MEDIA_EVENT_NAVIGATE_COMPLETE:
495 childSetText("status_text", getString("done_text"));
496 break;
497
498 case MEDIA_EVENT_LOCATION_CHANGED:
499 // Debugging info to console
500 llinfos << self->getLocation() << llendl;
501 break;
502
503 default:
504 // Having a default case makes the compiler happy.
505 break;
506 }
501} 507}
502 508
503//--------------------------------------------------------------------------- 509//---------------------------------------------------------------------------
diff --git a/linden/indra/newview/llpaneldirfind.h b/linden/indra/newview/llpaneldirfind.h
index 1a97f4b..d3dda6e 100644
--- a/linden/indra/newview/llpaneldirfind.h
+++ b/linden/indra/newview/llpaneldirfind.h
@@ -34,19 +34,18 @@
34#define LL_LLPANELDIRFIND_H 34#define LL_LLPANELDIRFIND_H
35 35
36#include "llpaneldirbrowser.h" 36#include "llpaneldirbrowser.h"
37#include "llwebbrowserctrl.h" 37#include "llmediactrl.h"
38 38
39class LLUICtrl; 39class LLUICtrl;
40class LLLineEditor; 40class LLLineEditor;
41class LLPanelDirFindAll; 41class LLPanelDirFindAll;
42class LLFloaterDirectory; 42class LLFloaterDirectory;
43class LLWebBrowserCtrlObserver;
44 43
45// This class in an abstract base class for all new style search widgets. It contains a pointer to a web browser control 44// This class in an abstract base class for all new style search widgets. It contains a pointer to a web browser control
46// 45//
47class LLPanelDirFind 46class LLPanelDirFind
48: public LLPanelDirBrowser, 47: public LLPanelDirBrowser,
49 public LLWebBrowserCtrlObserver 48 public LLViewerMediaObserver
50{ 49{
51public: 50public:
52 LLPanelDirFind(const std::string& name, LLFloaterDirectory* floater, const std::string& browser_name); 51 LLPanelDirFind(const std::string& name, LLFloaterDirectory* floater, const std::string& browser_name);
@@ -73,15 +72,11 @@ private:
73 static void onCommitSearch(LLUICtrl*, void* data); 72 static void onCommitSearch(LLUICtrl*, void* data);
74 static void onClickHelp( void* data ); 73 static void onClickHelp( void* data );
75 74
76 /*virtual*/ void onNavigateBegin( const EventType& eventIn ); 75 // inherited from LLViewerMediaObserver
77 /*virtual*/ void onNavigateComplete( const EventType& eventIn ); 76 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
78
79 // Used to update progress indicator
80 /*virtual*/ void onLocationChange( const EventType& eventIn );
81 // Debugging info to console
82 77
83protected: 78protected:
84 LLWebBrowserCtrl* mWebBrowser; 79 LLMediaCtrl* mWebBrowser;
85 std::string mBrowserName; 80 std::string mBrowserName;
86}; 81};
87 82
diff --git a/linden/indra/newview/llpaneldirgroups.cpp b/linden/indra/newview/llpaneldirgroups.cpp
index 1aa2e86..4119514 100644
--- a/linden/indra/newview/llpaneldirgroups.cpp
+++ b/linden/indra/newview/llpaneldirgroups.cpp
@@ -41,6 +41,7 @@
41#include "llqueryflags.h" 41#include "llqueryflags.h"
42#include "llviewercontrol.h" 42#include "llviewercontrol.h"
43#include "llviewerwindow.h" 43#include "llviewerwindow.h"
44#include "llmediactrl.h"
44 45
45LLPanelDirGroups::LLPanelDirGroups(const std::string& name, LLFloaterDirectory* floater) 46LLPanelDirGroups::LLPanelDirGroups(const std::string& name, LLFloaterDirectory* floater)
46 : LLPanelDirBrowser(name, floater) 47 : LLPanelDirBrowser(name, floater)
diff --git a/linden/indra/newview/llpanelface.cpp b/linden/indra/newview/llpanelface.cpp
index 68e603e..b9a40da 100644
--- a/linden/indra/newview/llpanelface.cpp
+++ b/linden/indra/newview/llpanelface.cpp
@@ -66,6 +66,7 @@
66#include "llviewerstats.h" 66#include "llviewerstats.h"
67#include "llviewerwindow.h" 67#include "llviewerwindow.h"
68#include "lluictrlfactory.h" 68#include "lluictrlfactory.h"
69#include "llpluginclassmedia.h"
69 70
70// 71//
71// Methods 72// Methods
@@ -77,7 +78,6 @@ BOOL LLPanelFace::postBuild()
77 LLTextureCtrl* mTextureCtrl; 78 LLTextureCtrl* mTextureCtrl;
78 LLColorSwatchCtrl* mColorSwatch; 79 LLColorSwatchCtrl* mColorSwatch;
79 80
80 LLTextBox* mLabelTexGen;
81 LLComboBox* mComboTexGen; 81 LLComboBox* mComboTexGen;
82 82
83 LLCheckBoxCtrl *mCheckFullbright; 83 LLCheckBoxCtrl *mCheckFullbright;
@@ -85,7 +85,6 @@ BOOL LLPanelFace::postBuild()
85 LLTextBox* mLabelColorTransp; 85 LLTextBox* mLabelColorTransp;
86 LLSpinCtrl* mCtrlColorTransp; // transparency = 1 - alpha 86 LLSpinCtrl* mCtrlColorTransp; // transparency = 1 - alpha
87 87
88 LLTextBox* mLabelGlow;
89 LLSpinCtrl* mCtrlGlow; 88 LLSpinCtrl* mCtrlGlow;
90 89
91 setMouseOpaque(FALSE); 90 setMouseOpaque(FALSE);
@@ -156,7 +155,7 @@ BOOL LLPanelFace::postBuild()
156 mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright); 155 mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright);
157 mCheckFullbright->setCallbackUserData( this ); 156 mCheckFullbright->setCallbackUserData( this );
158 } 157 }
159 mLabelTexGen = getChild<LLTextBox>("tex gen"); 158
160 mComboTexGen = getChild<LLComboBox>("combobox texgen"); 159 mComboTexGen = getChild<LLComboBox>("combobox texgen");
161 if(mComboTexGen) 160 if(mComboTexGen)
162 { 161 {
@@ -165,7 +164,6 @@ BOOL LLPanelFace::postBuild()
165 mComboTexGen->setCallbackUserData( this ); 164 mComboTexGen->setCallbackUserData( this );
166 } 165 }
167 166
168 mLabelGlow = getChild<LLTextBox>("glow label");
169 mCtrlGlow = getChild<LLSpinCtrl>("glow"); 167 mCtrlGlow = getChild<LLSpinCtrl>("glow");
170 if(mCtrlGlow) 168 if(mCtrlGlow)
171 { 169 {
@@ -507,11 +505,6 @@ void LLPanelFace::getState()
507 childSetEnabled("button align",FALSE); 505 childSetEnabled("button align",FALSE);
508 //mBtnAutoFix->setEnabled ( FALSE ); 506 //mBtnAutoFix->setEnabled ( FALSE );
509 507
510 if(LLViewerMedia::hasMedia())
511 {
512 childSetEnabled("textbox autofix",editable);
513 childSetEnabled("button align",editable);
514 }
515 //if ( LLMediaEngine::getInstance()->getMediaRenderer () ) 508 //if ( LLMediaEngine::getInstance()->getMediaRenderer () )
516 // if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () ) 509 // if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () )
517 // { 510 // {
@@ -568,7 +561,15 @@ void LLPanelFace::getState()
568 } 561 }
569 } 562 }
570 } 563 }
564
565 if(LLViewerMedia::textureHasMedia(id))
566 {
567 childSetEnabled("textbox autofix",editable);
568 childSetEnabled("button align",editable);
569 }
570
571 } 571 }
572
572 573
573 LLAggregatePermissions texture_perms; 574 LLAggregatePermissions texture_perms;
574 if(texture_ctrl) 575 if(texture_ctrl)
@@ -1117,14 +1118,18 @@ struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor
1117{ 1118{
1118 virtual bool apply(LLViewerObject* object, S32 te) 1119 virtual bool apply(LLViewerObject* object, S32 te)
1119 { 1120 {
1121 // TODO: the media impl pointer should actually be stored by the texture
1122 viewer_media_t pMediaImpl = LLViewerMedia::getMediaImplFromTextureID(object->getTE ( te )->getID());
1120 // only do this if it's a media texture 1123 // only do this if it's a media texture
1121 if ( object->getTE ( te )->getID() == LLViewerMedia::getMediaTextureID() ) 1124 if ( pMediaImpl.notNull())
1122 { 1125 {
1123 S32 media_width, media_height; 1126 LLPluginClassMedia *media = pMediaImpl->getMediaPlugin();
1124 S32 texture_width, texture_height; 1127 if(media)
1125 if ( LLViewerMedia::getMediaSize( &media_width, &media_height )
1126 && LLViewerMedia::getTextureSize( &texture_width, &texture_height ) )
1127 { 1128 {
1129 S32 media_width = media->getWidth();
1130 S32 media_height = media->getHeight();
1131 S32 texture_width = media->getTextureWidth();
1132 S32 texture_height = media->getTextureHeight();
1128 F32 scale_s = (F32)media_width / (F32)texture_width; 1133 F32 scale_s = (F32)media_width / (F32)texture_width;
1129 F32 scale_t = (F32)media_height / (F32)texture_height; 1134 F32 scale_t = (F32)media_height / (F32)texture_height;
1130 1135
diff --git a/linden/indra/newview/llpanellandaudio.cpp b/linden/indra/newview/llpanellandaudio.cpp
new file mode 100644
index 0000000..0247009
--- /dev/null
+++ b/linden/indra/newview/llpanellandaudio.cpp
@@ -0,0 +1,195 @@
1/**
2 * @file llpanellandaudio.cpp
3 * @brief Allows configuration of "media" for a land parcel,
4 * for example movies, web pages, and audio.
5 *
6 * $LicenseInfo:firstyear=2007&license=viewergpl$
7 *
8 * Copyright (c) 2007-2009, Linden Research, Inc.
9 *
10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab
12 * to you under the terms of the GNU General Public License, version 2.0
13 * ("GPL"), unless you have obtained a separate licensing agreement
14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 *
18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
23 *
24 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above,
26 * and agree to abide by those obligations.
27 *
28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
30 * COMPLETENESS OR PERFORMANCE.
31 * $/LicenseInfo$
32 */
33
34#include "llviewerprecompiledheaders.h"
35
36#include "llpanellandaudio.h"
37
38// viewer includes
39#include "llmimetypes.h"
40#include "llviewerparcelmgr.h"
41#include "llviewerregion.h"
42#include "lluictrlfactory.h"
43
44// library includes
45#include "llcheckboxctrl.h"
46#include "llcombobox.h"
47#include "llfloaterurlentry.h"
48#include "llfocusmgr.h"
49#include "lllineeditor.h"
50#include "llparcel.h"
51#include "lltextbox.h"
52#include "llradiogroup.h"
53#include "llspinctrl.h"
54#include "llsdutil.h"
55#include "lltexturectrl.h"
56#include "roles_constants.h"
57#include "llscrolllistctrl.h"
58
59// Values for the parcel voice settings radio group
60enum
61{
62 kRadioVoiceChatEstate = 0,
63 kRadioVoiceChatPrivate = 1,
64 kRadioVoiceChatDisable = 2
65};
66
67//---------------------------------------------------------------------------
68// LLPanelLandAudio
69//---------------------------------------------------------------------------
70
71LLPanelLandAudio::LLPanelLandAudio(LLParcelSelectionHandle& parcel)
72: LLPanel(std::string("land_media_panel")), mParcel(parcel)
73{
74}
75
76
77// virtual
78LLPanelLandAudio::~LLPanelLandAudio()
79{
80}
81
82
83BOOL LLPanelLandAudio::postBuild()
84{
85 mCheckSoundLocal = getChild<LLCheckBoxCtrl>("check_sound_local");
86 childSetCommitCallback("check_sound_local", onCommitAny, this);
87
88 mRadioVoiceChat = getChild<LLRadioGroup>("parcel_voice_channel");
89 childSetCommitCallback("parcel_voice_channel", onCommitAny, this);
90
91 mMusicURLEdit = getChild<LLLineEditor>("music_url");
92 childSetCommitCallback("music_url", onCommitAny, this);
93
94 mMusicUrlCheck = getChild<LLCheckBoxCtrl>("hide_music_url");
95 childSetCommitCallback("hide_music_url", onCommitAny, this);
96
97 return TRUE;
98}
99
100
101// public
102void LLPanelLandAudio::refresh()
103{
104 LLParcel *parcel = mParcel->getParcel();
105
106 if (!parcel)
107 {
108 clearCtrls();
109 }
110 else
111 {
112 // something selected, hooray!
113
114 // Display options
115 BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA);
116
117 mMusicURLEdit->setText(parcel->getMusicURL());
118 mMusicURLEdit->setEnabled( can_change_media );
119
120 mMusicUrlCheck->set( parcel->getObscureMusic() );
121 mMusicUrlCheck->setEnabled( can_change_media );
122
123 mCheckSoundLocal->set( parcel->getSoundLocal() );
124 mCheckSoundLocal->setEnabled( can_change_media );
125
126 if(parcel->getParcelFlagAllowVoice())
127 {
128 if(parcel->getParcelFlagUseEstateVoiceChannel())
129 mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatEstate);
130 else
131 mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatPrivate);
132 }
133 else
134 {
135 mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatDisable);
136 }
137
138 LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
139 mRadioVoiceChat->setEnabled( region && region->isVoiceEnabled() && can_change_media );
140 }
141}
142// static
143void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata)
144{
145 LLPanelLandAudio *self = (LLPanelLandAudio *)userdata;
146
147 LLParcel* parcel = self->mParcel->getParcel();
148 if (!parcel)
149 {
150 return;
151 }
152
153 // Extract data from UI
154 BOOL sound_local = self->mCheckSoundLocal->get();
155 int voice_setting = self->mRadioVoiceChat->getSelectedIndex();
156 std::string music_url = self->mMusicURLEdit->getText();
157 U8 obscure_music = self->mMusicUrlCheck->get();
158
159
160 BOOL voice_enabled;
161 BOOL voice_estate_chan;
162
163 switch(voice_setting)
164 {
165 default:
166 case kRadioVoiceChatEstate:
167 voice_enabled = TRUE;
168 voice_estate_chan = TRUE;
169 break;
170 case kRadioVoiceChatPrivate:
171 voice_enabled = TRUE;
172 voice_estate_chan = FALSE;
173 break;
174 case kRadioVoiceChatDisable:
175 voice_enabled = FALSE;
176 voice_estate_chan = FALSE;
177 break;
178 }
179
180 // Remove leading/trailing whitespace (common when copying/pasting)
181 LLStringUtil::trim(music_url);
182
183 // Push data into current parcel
184 parcel->setParcelFlag(PF_ALLOW_VOICE_CHAT, voice_enabled);
185 parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan);
186 parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local);
187 parcel->setMusicURL(music_url);
188 parcel->setObscureMusic(obscure_music);
189
190 // Send current parcel data upstream to server
191 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );
192
193 // Might have changed properties, so let's redraw!
194 self->refresh();
195}
diff --git a/linden/indra/newview/llpanellandaudio.h b/linden/indra/newview/llpanellandaudio.h
new file mode 100644
index 0000000..3d5d633
--- /dev/null
+++ b/linden/indra/newview/llpanellandaudio.h
@@ -0,0 +1,63 @@
1/**
2 * @file llpanellandaudio.h
3 * @brief Allows configuration of "audio" for a land parcel.
4 *
5 *
6 * $LicenseInfo:firstyear=2007&license=viewergpl$
7 *
8 * Copyright (c) 2007-2009, Linden Research, Inc.
9 *
10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab
12 * to you under the terms of the GNU General Public License, version 2.0
13 * ("GPL"), unless you have obtained a separate licensing agreement
14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 *
18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
23 *
24 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above,
26 * and agree to abide by those obligations.
27 *
28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
30 * COMPLETENESS OR PERFORMANCE.
31 * $/LicenseInfo$
32 */
33
34#ifndef LLPANELLANDAUDIO_H
35#define LLPANELLANDAUDIO_H
36
37#include "lllineeditor.h"
38#include "llpanel.h"
39#include "llparcelselection.h"
40#include "lluifwd.h" // widget pointer types
41
42class LLPanelLandAudio
43 : public LLPanel
44{
45public:
46 LLPanelLandAudio(LLSafeHandle<LLParcelSelection>& parcelp);
47 /*virtual*/ ~LLPanelLandAudio();
48 /*virtual*/ BOOL postBuild();
49 void refresh();
50
51private:
52 static void onCommitAny(LLUICtrl* ctrl, void *userdata);
53
54private:
55 LLCheckBoxCtrl* mCheckSoundLocal;
56 LLRadioGroup* mRadioVoiceChat;
57 LLLineEditor* mMusicURLEdit;
58 LLCheckBoxCtrl* mMusicUrlCheck;
59
60 LLSafeHandle<LLParcelSelection>& mParcel;
61};
62
63#endif
diff --git a/linden/indra/newview/llpanellandmedia.cpp b/linden/indra/newview/llpanellandmedia.cpp
index bebd69e..a8e7c4a 100644
--- a/linden/indra/newview/llpanellandmedia.cpp
+++ b/linden/indra/newview/llpanellandmedia.cpp
@@ -39,6 +39,8 @@
39#include "llmimetypes.h" 39#include "llmimetypes.h"
40#include "llviewerparcelmgr.h" 40#include "llviewerparcelmgr.h"
41#include "llviewerregion.h" 41#include "llviewerregion.h"
42#include "llviewermedia.h"
43#include "llviewerparcelmedia.h"
42#include "lluictrlfactory.h" 44#include "lluictrlfactory.h"
43 45
44// library includes 46// library includes
@@ -54,6 +56,7 @@
54#include "llsdutil.h" 56#include "llsdutil.h"
55#include "lltexturectrl.h" 57#include "lltexturectrl.h"
56#include "roles_constants.h" 58#include "roles_constants.h"
59#include "llscrolllistctrl.h"
57 60
58#include "hippoGridManager.h" 61#include "hippoGridManager.h"
59 62
@@ -62,15 +65,8 @@
62//--------------------------------------------------------------------------- 65//---------------------------------------------------------------------------
63 66
64LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) 67LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel)
65: LLPanel(std::string("land_media_panel")), 68: LLPanel(),
66
67 mParcel(parcel), 69 mParcel(parcel),
68 mCheckSoundLocal(NULL),
69 mSoundHelpButton(NULL),
70 mCheckEnableVoiceChat(NULL),
71 mCheckEnableVoiceChatIsEstateDisabled(NULL),
72 mCheckEnableVoiceChatParcel(NULL),
73 mMusicURLEdit(NULL),
74 mMediaURLEdit(NULL), 70 mMediaURLEdit(NULL),
75 mMediaDescEdit(NULL), 71 mMediaDescEdit(NULL),
76 mMediaTypeCombo(NULL), 72 mMediaTypeCombo(NULL),
@@ -81,8 +77,7 @@ LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel)
81 mMediaTextureCtrl(NULL), 77 mMediaTextureCtrl(NULL),
82 mMediaAutoScaleCheck(NULL), 78 mMediaAutoScaleCheck(NULL),
83 mMediaLoopCheck(NULL), 79 mMediaLoopCheck(NULL),
84 mMediaUrlCheck(NULL), 80 mMediaUrlCheck(NULL)
85 mMusicUrlCheck(NULL)
86{ 81{
87} 82}
88 83
@@ -90,34 +85,10 @@ LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel)
90// virtual 85// virtual
91LLPanelLandMedia::~LLPanelLandMedia() 86LLPanelLandMedia::~LLPanelLandMedia()
92{ 87{
93 // close LLFloaterURLEntry?
94}
95
96
97// static
98void LLPanelLandMedia::onClickSoundHelp(void*)
99{
100 LLNotifications::instance().add("ClickSoundHelpLand");
101} 88}
102 89
103
104BOOL LLPanelLandMedia::postBuild() 90BOOL LLPanelLandMedia::postBuild()
105{ 91{
106 mCheckSoundLocal = getChild<LLCheckBoxCtrl>("check sound local");
107 childSetCommitCallback("check sound local", onCommitAny, this);
108
109 mSoundHelpButton = getChild<LLButton>("?");
110 mSoundHelpButton->setClickedCallback(onClickSoundHelp, this);
111
112 mCheckEnableVoiceChat = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel");
113 childSetCommitCallback("parcel_enable_voice_channel", onCommitAny, this);
114 mCheckEnableVoiceChatIsEstateDisabled = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_is_estate_disabled");
115 childSetCommitCallback("parcel_enable_voice_channel_is_estate_disabled", onCommitAny, this);
116 mCheckEnableVoiceChatParcel = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_parcel");
117 childSetCommitCallback("parcel_enable_voice_channel_parcel", onCommitAny, this);
118
119 mMusicURLEdit = getChild<LLLineEditor>("music_url");
120 childSetCommitCallback("music_url", onCommitAny, this);
121 92
122 mMediaTextureCtrl = getChild<LLTextureCtrl>("media texture"); 93 mMediaTextureCtrl = getChild<LLTextureCtrl>("media texture");
123 mMediaTextureCtrl->setCommitCallback( onCommitAny ); 94 mMediaTextureCtrl->setCommitCallback( onCommitAny );
@@ -130,16 +101,13 @@ BOOL LLPanelLandMedia::postBuild()
130 childSetCommitCallback("media_auto_scale", onCommitAny, this); 101 childSetCommitCallback("media_auto_scale", onCommitAny, this);
131 102
132 mMediaLoopCheck = getChild<LLCheckBoxCtrl>("media_loop"); 103 mMediaLoopCheck = getChild<LLCheckBoxCtrl>("media_loop");
133 childSetCommitCallback("media_loop", onCommitAny, this); 104 childSetCommitCallback("media_loop", onCommitAny, this );
134 105
135 mMediaUrlCheck = getChild<LLCheckBoxCtrl>("hide_media_url"); 106 mMediaUrlCheck = getChild<LLCheckBoxCtrl>("hide_media_url");
136 childSetCommitCallback("hide_media_url", onCommitAny, this); 107 childSetCommitCallback("hide_media_url", onCommitAny, this );
137
138 mMusicUrlCheck = getChild<LLCheckBoxCtrl>("hide_music_url");
139 childSetCommitCallback("hide_music_url", onCommitAny, this);
140 108
141 mMediaURLEdit = getChild<LLLineEditor>("media_url"); 109 mMediaURLEdit = getChild<LLLineEditor>("media_url");
142 childSetCommitCallback("media_url", onCommitAny, this); 110 childSetCommitCallback("media_url", onCommitAny, this );
143 111
144 mMediaDescEdit = getChild<LLLineEditor>("url_description"); 112 mMediaDescEdit = getChild<LLLineEditor>("url_description");
145 childSetCommitCallback("url_description", onCommitAny, this); 113 childSetCommitCallback("url_description", onCommitAny, this);
@@ -148,15 +116,41 @@ BOOL LLPanelLandMedia::postBuild()
148 childSetCommitCallback("media type", onCommitType, this); 116 childSetCommitCallback("media type", onCommitType, this);
149 populateMIMECombo(); 117 populateMIMECombo();
150 118
119 mMediaResetCtrl = getChild<LLSpinCtrl>("media_reset_time");
120 childSetCommitCallback("media_reset_time", onCommitAny, this);
121 mMediaResetCtrlLabel = getChild<LLTextBox>("media_reset");
122
151 mMediaWidthCtrl = getChild<LLSpinCtrl>("media_size_width"); 123 mMediaWidthCtrl = getChild<LLSpinCtrl>("media_size_width");
152 childSetCommitCallback("media_size_width", onCommitAny, this); 124 childSetCommitCallback("media_size_width", onCommitAny, this);
153 mMediaHeightCtrl = getChild<LLSpinCtrl>("media_size_height"); 125 mMediaHeightCtrl = getChild<LLSpinCtrl>("media_size_height");
154 childSetCommitCallback("media_size_height", onCommitAny, this); 126 childSetCommitCallback("media_size_height", onCommitAny, this);
155 mMediaSizeCtrlLabel = getChild<LLTextBox>("media_size"); 127 mMediaSizeCtrlLabel = getChild<LLTextBox>("media_size");
156 128
129 mMediaNavigateAllowCheck = getChild<LLCheckBoxCtrl>("check navigate allow");
130 childSetCommitCallback("check navigate allow", onCommitAny, this);
131 mMediaURLFilterCheck = getChild<LLCheckBoxCtrl>("check navigate filter");
132 childSetCommitCallback("check navigate filter", onCommitAny, this);
133
157 mSetURLButton = getChild<LLButton>("set_media_url"); 134 mSetURLButton = getChild<LLButton>("set_media_url");
158 childSetAction("set_media_url", onSetBtn, this); 135 childSetAction("set_media_url", onSetBtn, this);
159 136
137 mResetURLButton = getChild<LLButton>("reset_media_url");
138 childSetAction("reset_media_url", onResetBtn, this);
139
140 mURLFilterList = getChild<LLScrollListCtrl>("filter_list");
141
142 mMediaURLFilterDomainEdit = getChild<LLLineEditor>("navigate_filter_domain");
143
144 mMediaURLFilterAddButton = getChild<LLButton>("add_navigate_filter");
145 childSetAction("add_navigate_filter", onClickAddURLFilter, this);
146
147 mMediaURLFilterRemoveButton = getChild<LLButton>("remove_navigate_filter");
148 childSetAction("remove_navigate_filter", onClickRemoveURLFilter, this);
149
150 mRadioNavigateControl = getChild<LLRadioGroup>("radio_navigate_allow");
151 childSetCommitCallback("radio_navigate_allow", onCommitAny, this);
152
153
160 return TRUE; 154 return TRUE;
161} 155}
162 156
@@ -177,8 +171,8 @@ void LLPanelLandMedia::refresh()
177 // Display options 171 // Display options
178 BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA); 172 BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA);
179 173
180 mCheckSoundLocal->set( parcel->getSoundLocal() ); 174//imprudence fixme mCheckSoundLocal->set( parcel->getSoundLocal() );
181 mCheckSoundLocal->setEnabled( can_change_media ); 175//imprudence fixme mCheckSoundLocal->setEnabled( can_change_media );
182 176
183 LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); 177 LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
184 if (!region) 178 if (!region)
@@ -194,42 +188,43 @@ void LLPanelLandMedia::refresh()
194 { 188 {
195 if (region && region->isVoiceEnabled()) // estate-wide voice-disable overrides all 189 if (region && region->isVoiceEnabled()) // estate-wide voice-disable overrides all
196 { 190 {
197 mCheckEnableVoiceChatIsEstateDisabled->setVisible(false); 191//imprudence fixme mCheckEnableVoiceChatIsEstateDisabled->setVisible(false);
198 192
199 mCheckEnableVoiceChat->setVisible(true); 193//imprudence fixme mCheckEnableVoiceChat->setVisible(true);
200 mCheckEnableVoiceChat->setEnabled( can_change_media ); 194//imprudence fixme mCheckEnableVoiceChat->setEnabled( can_change_media );
201 mCheckEnableVoiceChat->set(allow_voice); 195//imprudence fixme mCheckEnableVoiceChat->set(allow_voice);
202 196
203 mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice ); 197//imprudence fixme mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice );
204 } 198 }
205 else // disabled at region level 199 else // disabled at region level
206 { 200 {
207 mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); // always disabled 201//imprudence fixme mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); // always disabled
208 mCheckEnableVoiceChat->setVisible(false); 202//imprudence fixme mCheckEnableVoiceChat->setVisible(false);
209 mCheckEnableVoiceChat->setEnabled(false); 203//imprudence fixme mCheckEnableVoiceChat->setEnabled(false);
210 mCheckEnableVoiceChat->set(false); 204//imprudence fixme mCheckEnableVoiceChat->set(false);
211 205
212 mCheckEnableVoiceChatParcel->setEnabled(false); 206//imprudence fixme mCheckEnableVoiceChatParcel->setEnabled(false);
213 } 207 }
214 } 208 }
215 else 209 else
216 { 210 {
217 mCheckEnableVoiceChatIsEstateDisabled->setVisible(true); 211//imprudence fixme mCheckEnableVoiceChatIsEstateDisabled->setVisible(true);
218 212
219 mCheckEnableVoiceChat->setVisible(true); 213//imprudence fixme mCheckEnableVoiceChat->setVisible(true);
220 mCheckEnableVoiceChat->setEnabled( can_change_media ); 214//imprudence fixme mCheckEnableVoiceChat->setEnabled( can_change_media );
221 mCheckEnableVoiceChat->set(allow_voice); 215//imprudence fixme mCheckEnableVoiceChat->set(allow_voice);
222 216
223 mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice ); 217//imprudence fixme mCheckEnableVoiceChatParcel->setEnabled( can_change_media && allow_voice );
224 } 218 }
225 219
226 mCheckEnableVoiceChatParcel->set(!parcel->getParcelFlagUseEstateVoiceChannel()); 220//imprudence fixme mCheckEnableVoiceChatParcel->set(!parcel->getParcelFlagUseEstateVoiceChannel());
221
222//imprudence fixme mMusicURLEdit->setText(parcel->getMusicURL());
223//imprudence fixme mMusicURLEdit->setEnabled( can_change_media );
224
227 225
228 mMusicURLEdit->setText(parcel->getMusicURL());
229 mMusicURLEdit->setEnabled( can_change_media );
230 226
231 mMediaURLEdit->setText(parcel->getMediaURL()); 227 childSetText("current_url", parcel->getMediaCurrentURL());
232 mMediaURLEdit->setEnabled( FALSE );
233 228
234 mMediaDescEdit->setText(parcel->getMediaDesc()); 229 mMediaDescEdit->setText(parcel->getMediaDesc());
235 mMediaDescEdit->setEnabled( can_change_media ); 230 mMediaDescEdit->setEnabled( can_change_media );
@@ -246,15 +241,11 @@ void LLPanelLandMedia::refresh()
246 mMediaUrlCheck->set( parcel->getObscureMedia() ); 241 mMediaUrlCheck->set( parcel->getObscureMedia() );
247 mMediaUrlCheck->setEnabled( can_change_media ); 242 mMediaUrlCheck->setEnabled( can_change_media );
248 243
249 mMusicUrlCheck->set( parcel->getObscureMusic() );
250 mMusicUrlCheck->setEnabled( can_change_media );
251
252 // don't display urls if you're not able to change it 244 // don't display urls if you're not able to change it
253 // much requested change in forums so people can't 'steal' urls 245 // much requested change in forums so people can't 'steal' urls
254 // NOTE: bug#2009 means this is still vunerable - however, bug 246 // NOTE: bug#2009 means this is still vunerable - however, bug
255 // should be closed since this bug opens up major security issues elsewhere. 247 // should be closed since this bug opens up major security issues elsewhere.
256 bool obscure_media = ! can_change_media && parcel->getObscureMedia(); 248 bool obscure_media = ! can_change_media && parcel->getObscureMedia();
257 bool obscure_music = ! can_change_media && parcel->getObscureMusic();
258 249
259 // Special code to disable asterixes for html type 250 // Special code to disable asterixes for html type
260 if(mime_type == "text/html") 251 if(mime_type == "text/html")
@@ -264,7 +255,6 @@ void LLPanelLandMedia::refresh()
264 mMediaUrlCheck->setEnabled( false ); 255 mMediaUrlCheck->setEnabled( false );
265 } 256 }
266 257
267 mMusicURLEdit->setDrawAsterixes( obscure_music );
268 mMediaURLEdit->setDrawAsterixes( obscure_media ); 258 mMediaURLEdit->setDrawAsterixes( obscure_media );
269 259
270 mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () ); 260 mMediaAutoScaleCheck->set( parcel->getMediaAutoScale () );
@@ -278,6 +268,10 @@ void LLPanelLandMedia::refresh()
278 else 268 else
279 mMediaLoopCheck->set( false ); 269 mMediaLoopCheck->set( false );
280 mMediaLoopCheck->setEnabled ( can_change_media && allow_looping ); 270 mMediaLoopCheck->setEnabled ( can_change_media && allow_looping );
271
272 mMediaResetCtrl->set( parcel->getMediaURLTimeout() );
273 mMediaResetCtrl->setEnabled( can_change_media );
274 mMediaResetCtrlLabel->setEnabled( can_change_media );
281 275
282 // disallow media size change for mime types that don't allow it 276 // disallow media size change for mime types that don't allow it
283 bool allow_resize = LLMIMETypes::findAllowResize( mime_type ); 277 bool allow_resize = LLMIMETypes::findAllowResize( mime_type );
@@ -301,28 +295,45 @@ void LLPanelLandMedia::refresh()
301 mMediaTextureCtrl->setEnabled( can_change_media ); 295 mMediaTextureCtrl->setEnabled( can_change_media );
302 296
303 mSetURLButton->setEnabled( can_change_media ); 297 mSetURLButton->setEnabled( can_change_media );
298 mResetURLButton->setEnabled( can_change_media );
304 299
305 #if 0 300 mMediaURLFilterCheck->set( parcel->getMediaURLFilterEnable() );
306 // there is a media url and a media texture selected 301 mMediaURLFilterCheck->setEnabled( can_change_media );
307 if ( ( ! ( std::string ( parcel->getMediaURL() ).empty () ) ) && ( ! ( parcel->getMediaID ().isNull () ) ) )
308 {
309 // turn on transport controls if allowed for this parcel
310 mMediaStopButton->setEnabled ( editable );
311 mMediaStartButton->setEnabled ( editable );
312 }
313 else
314 {
315 // no media url or no media texture
316 mMediaStopButton->setEnabled ( FALSE );
317 mMediaStartButton->setEnabled ( FALSE );
318 };
319 #endif
320 302
321 LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mURLEntryFloater.get(); 303 LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mURLEntryFloater.get();
322 if (floater_url_entry) 304 if (floater_url_entry)
323 { 305 {
324 floater_url_entry->updateFromLandMediaPanel(); 306 floater_url_entry->updateFromLandMediaPanel();
325 } 307 }
308
309 // This radial control is really just an inverse mapping to the boolean allow_navigate value.
310 // It is set as a radial merely for user readability.
311 mRadioNavigateControl->setSelectedIndex(! parcel->getMediaAllowNavigate());
312 mRadioNavigateControl->setEnabled( can_change_media );
313
314 mMediaURLFilterDomainEdit->setEnabled( can_change_media );
315 mMediaURLFilterAddButton->setEnabled( can_change_media );
316 mMediaURLFilterRemoveButton->setEnabled( can_change_media );
317
318 if (mURLFilterList)
319 {
320 mURLFilterList->setEnabled( can_change_media );
321
322 mURLFilterList->deleteAllItems();
323
324 LLSD list = parcel->getMediaURLFilterList();
325
326 for (LLSD::array_iterator i = list.beginArray(); i != list.endArray(); ++i)
327 {
328 std::string domain = (*i).asString();
329
330 LLSD element;
331 element["id"] = domain;
332 element["columns"][0]["value"] = domain;
333
334 mURLFilterList->addElement(element);
335 }
336 }
326 } 337 }
327} 338}
328 339
@@ -364,12 +375,19 @@ void LLPanelLandMedia::setMediaType(const std::string& mime_type)
364void LLPanelLandMedia::setMediaURL(const std::string& media_url) 375void LLPanelLandMedia::setMediaURL(const std::string& media_url)
365{ 376{
366 mMediaURLEdit->setText(media_url); 377 mMediaURLEdit->setText(media_url);
378 LLParcel *parcel = mParcel->getParcel();
379 if(parcel)
380 parcel->setMediaCurrentURL(media_url);
381 // LLViewerMedia::navigateHome();
382
383
367 mMediaURLEdit->onCommit(); 384 mMediaURLEdit->onCommit();
385 // LLViewerParcelMedia::sendMediaNavigateMessage(media_url);
386 childSetText("current_url", media_url);
368} 387}
369
370std::string LLPanelLandMedia::getMediaURL() 388std::string LLPanelLandMedia::getMediaURL()
371{ 389{
372 return mMediaURLEdit->getText(); 390 return mMediaURLEdit->getText();
373} 391}
374 392
375// static 393// static
@@ -398,33 +416,26 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata)
398 } 416 }
399 417
400 // Extract data from UI 418 // Extract data from UI
401 BOOL sound_local = self->mCheckSoundLocal->get();
402 std::string music_url = self->mMusicURLEdit->getText();
403 std::string media_url = self->mMediaURLEdit->getText(); 419 std::string media_url = self->mMediaURLEdit->getText();
404 std::string media_desc = self->mMediaDescEdit->getText(); 420 std::string media_desc = self->mMediaDescEdit->getText();
405 std::string mime_type = self->childGetText("mime_type"); 421 std::string mime_type = self->childGetText("mime_type");
406 U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); 422 U8 media_auto_scale = self->mMediaAutoScaleCheck->get();
407 U8 media_loop = self->mMediaLoopCheck->get(); 423 U8 media_loop = self->mMediaLoopCheck->get();
408 U8 obscure_media = self->mMediaUrlCheck->get(); 424 U8 obscure_media = self->mMediaUrlCheck->get();
409 U8 obscure_music = self->mMusicUrlCheck->get(); 425 F32 media_reset_time = (F32)self->mMediaResetCtrl->get();
410 S32 media_width = (S32)self->mMediaWidthCtrl->get(); 426 S32 media_width = (S32)self->mMediaWidthCtrl->get();
411 S32 media_height = (S32)self->mMediaHeightCtrl->get(); 427 S32 media_height = (S32)self->mMediaHeightCtrl->get();
412 LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); 428 LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID();
429 U8 navigate_allow = ! self->mRadioNavigateControl->getSelectedIndex();
430 U8 navigate_filter = self->mMediaURLFilterCheck->get();
413 431
414 BOOL voice_enabled = self->mCheckEnableVoiceChat->get();
415 BOOL voice_estate_chan = ! self->mCheckEnableVoiceChatParcel->get();
416 432
417 self->childSetText("mime_type", mime_type); 433 self->childSetText("mime_type", mime_type);
418 434
419 // Remove leading/trailing whitespace (common when copying/pasting) 435 // Remove leading/trailing whitespace (common when copying/pasting)
420 LLStringUtil::trim(music_url);
421 LLStringUtil::trim(media_url); 436 LLStringUtil::trim(media_url);
422 437
423 // Push data into current parcel 438 // Push data into current parcel
424 parcel->setParcelFlag(PF_ALLOW_VOICE_CHAT, voice_enabled);
425 parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan);
426 parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local);
427 parcel->setMusicURL(music_url);
428 parcel->setMediaURL(media_url); 439 parcel->setMediaURL(media_url);
429 parcel->setMediaType(mime_type); 440 parcel->setMediaType(mime_type);
430 parcel->setMediaDesc(media_desc); 441 parcel->setMediaDesc(media_desc);
@@ -434,7 +445,10 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata)
434 parcel->setMediaAutoScale ( media_auto_scale ); 445 parcel->setMediaAutoScale ( media_auto_scale );
435 parcel->setMediaLoop ( media_loop ); 446 parcel->setMediaLoop ( media_loop );
436 parcel->setObscureMedia( obscure_media ); 447 parcel->setObscureMedia( obscure_media );
437 parcel->setObscureMusic( obscure_music ); 448 parcel->setMediaURLFilterEnable(navigate_filter);
449 parcel->setMediaAllowNavigate(navigate_allow);
450 parcel->setMediaURLTimeout(media_reset_time);
451
438 452
439 // Send current parcel data upstream to server 453 // Send current parcel data upstream to server
440 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); 454 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );
@@ -453,3 +467,91 @@ void LLPanelLandMedia::onSetBtn(void *userdata)
453 parent_floater->addDependentFloater(self->mURLEntryFloater.get()); 467 parent_floater->addDependentFloater(self->mURLEntryFloater.get());
454 } 468 }
455} 469}
470
471// static
472void LLPanelLandMedia::onResetBtn(void *userdata)
473{
474 LLPanelLandMedia *self = (LLPanelLandMedia *)userdata;
475 LLParcel* parcel = self->mParcel->getParcel();
476 // LLViewerMedia::navigateHome();
477 self->refresh();
478 self->childSetText("current_url", parcel->getMediaURL());
479 // LLViewerParcelMedia::sendMediaNavigateMessage(parcel->getMediaURL());
480
481}
482// static
483void LLPanelLandMedia::onClickAddURLFilter(void *userdata)
484{
485 LLPanelLandMedia *panelp = (LLPanelLandMedia *)userdata;
486 LLParcel* parcel = panelp->mParcel->getParcel();
487
488 LLSD list = parcel->getMediaURLFilterList();
489
490 std::string domain = panelp->mMediaURLFilterDomainEdit->getText();
491 LLStringUtil::trim(domain);
492
493 BOOL add = TRUE;
494 if (domain == "")
495 {
496 add = FALSE;
497 }
498
499 // check for dupes
500 for(S32 i = 0; i < list.size(); i++)
501 {
502 if (list[i].asString() == domain)
503 {
504 add = FALSE;
505 break;
506 }
507 }
508
509 if (add)
510 {
511 list.append(domain);
512 parcel->setMediaURLFilterList(list);
513
514 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );
515
516 panelp->mMediaURLFilterDomainEdit->setText(std::string(""));
517
518 panelp->refresh();
519 }
520
521}
522
523// static
524void LLPanelLandMedia::onClickRemoveURLFilter(void *data)
525{
526 LLPanelLandMedia* panelp = (LLPanelLandMedia*)data;
527 if (panelp && panelp->mURLFilterList)
528 {
529 LLParcel* parcel = panelp->mParcel->getParcel();
530 if (parcel)
531 {
532 LLSD list = parcel->getMediaURLFilterList();
533
534 std::vector<LLScrollListItem*> domains = panelp->mURLFilterList->getAllSelected();
535 for (std::vector<LLScrollListItem*>::iterator iter = domains.begin(); iter != domains.end(); iter++)
536 {
537 LLScrollListItem* item = *iter;
538 const std::string domain = item->getValue().asString();
539
540 for(S32 i = 0; i < list.size(); i++)
541 {
542 if (list[i].asString() == domain)
543 {
544 list.erase(i);
545 break;
546 }
547 }
548 }
549
550 parcel->setMediaURLFilterList(list);
551 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );
552
553 panelp->refresh();
554 }
555 }
556
557}
diff --git a/linden/indra/newview/llpanellandmedia.h b/linden/indra/newview/llpanellandmedia.h
index 6a53dd4..c883d98 100644
--- a/linden/indra/newview/llpanellandmedia.h
+++ b/linden/indra/newview/llpanellandmedia.h
@@ -56,29 +56,36 @@ private:
56 static void onCommitAny(LLUICtrl* ctrl, void *userdata); 56 static void onCommitAny(LLUICtrl* ctrl, void *userdata);
57 static void onCommitType(LLUICtrl* ctrl, void *userdata); 57 static void onCommitType(LLUICtrl* ctrl, void *userdata);
58 static void onSetBtn(void* userdata); 58 static void onSetBtn(void* userdata);
59 static void onClickSoundHelp(void*); 59 static void onResetBtn(void* userdata);
60 60 static void onClickAddURLFilter(void *userdata);
61 static void onClickRemoveURLFilter(void *userdata);
62
61private: 63private:
62 LLCheckBoxCtrl* mCheckSoundLocal;
63 LLButton* mSoundHelpButton;
64 LLCheckBoxCtrl* mCheckEnableVoiceChat;
65 LLCheckBoxCtrl* mCheckEnableVoiceChatIsEstateDisabled;
66 LLCheckBoxCtrl* mCheckEnableVoiceChatParcel;
67 LLLineEditor* mMusicURLEdit;
68 LLLineEditor* mMediaURLEdit; 64 LLLineEditor* mMediaURLEdit;
69 LLLineEditor* mMediaDescEdit; 65 LLLineEditor* mMediaDescEdit;
70 LLComboBox* mMediaTypeCombo; 66 LLComboBox* mMediaTypeCombo;
71 LLButton* mSetURLButton; 67 LLButton* mSetURLButton;
68 LLButton* mResetURLButton;
69 LLSpinCtrl* mMediaResetCtrl;
72 LLSpinCtrl* mMediaHeightCtrl; 70 LLSpinCtrl* mMediaHeightCtrl;
73 LLSpinCtrl* mMediaWidthCtrl; 71 LLSpinCtrl* mMediaWidthCtrl;
72 LLTextBox* mMediaResetCtrlLabel;
74 LLTextBox* mMediaSizeCtrlLabel; 73 LLTextBox* mMediaSizeCtrlLabel;
75 LLTextureCtrl* mMediaTextureCtrl; 74 LLTextureCtrl* mMediaTextureCtrl;
76 LLCheckBoxCtrl* mMediaAutoScaleCheck; 75 LLCheckBoxCtrl* mMediaAutoScaleCheck;
77 LLCheckBoxCtrl* mMediaLoopCheck; 76 LLCheckBoxCtrl* mMediaLoopCheck;
78 LLCheckBoxCtrl* mMediaUrlCheck; 77 LLCheckBoxCtrl* mMediaUrlCheck;
79 LLCheckBoxCtrl* mMusicUrlCheck;
80 LLHandle<LLFloater> mURLEntryFloater; 78 LLHandle<LLFloater> mURLEntryFloater;
79 LLCheckBoxCtrl* mMediaNavigateAllowCheck;
80 LLCheckBoxCtrl* mMediaURLFilterCheck;
81 LLLineEditor* mMediaURLFilterDomainEdit;
82 LLButton* mMediaURLFilterAddButton;
83 LLButton* mMediaURLFilterRemoveButton;
84 LLScrollListCtrl* mURLFilterList;
85 LLRadioGroup* mRadioNavigateControl;
86
81 87
88
82 LLSafeHandle<LLParcelSelection>& mParcel; 89 LLSafeHandle<LLParcelSelection>& mParcel;
83}; 90};
84 91
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index 23b7785..a8b7106 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -73,12 +73,10 @@
73#include "lluictrlfactory.h" 73#include "lluictrlfactory.h"
74#include "llhttpclient.h" 74#include "llhttpclient.h"
75#include "llweb.h" 75#include "llweb.h"
76#include "llwebbrowserctrl.h"
77#include "viewerversion.h" 76#include "viewerversion.h"
77#include "llmediactrl.h"
78 78
79#include "llfloaterhtml.h" 79#include "llfloatermediabrowser.h"
80
81#include "llfloaterhtmlhelp.h"
82#include "llfloatertos.h" 80#include "llfloatertos.h"
83 81
84#include "llglheaders.h" 82#include "llglheaders.h"
@@ -101,7 +99,7 @@ class LLLoginRefreshHandler : public LLCommandHandler
101public: 99public:
102 // don't allow from external browsers 100 // don't allow from external browsers
103 LLLoginRefreshHandler() : LLCommandHandler("login_refresh", true) { } 101 LLLoginRefreshHandler() : LLCommandHandler("login_refresh", true) { }
104 bool handle(const LLSD& tokens, const LLSD& query_map, LLWebBrowserCtrl* web) 102 bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
105 { 103 {
106 if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) 104 if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP)
107 { 105 {
@@ -291,16 +289,15 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
291#endif 289#endif
292 290
293 // get the web browser control 291 // get the web browser control
294 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("login_html"); 292 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
293 web_browser->addObserver(this);
294
295 // Need to handle login secondlife:///app/ URLs 295 // Need to handle login secondlife:///app/ URLs
296 web_browser->setTrusted( true ); 296 web_browser->setTrusted( true );
297 297
298 // observe browser events
299 web_browser->addObserver( this );
300
301 // don't make it a tab stop until SL-27594 is fixed 298 // don't make it a tab stop until SL-27594 is fixed
302 web_browser->setTabStop(FALSE); 299 web_browser->setTabStop(FALSE);
303 web_browser->navigateToLocalPage( "loading", "loading.html" ); 300 // web_browser->navigateToLocalPage( "loading", "loading.html" );
304 301
305 // make links open in external browser 302 // make links open in external browser
306 web_browser->setOpenInExternalBrowser( true ); 303 web_browser->setOpenInExternalBrowser( true );
@@ -335,7 +332,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
335 332
336void LLPanelLogin::setSiteIsAlive( bool alive ) 333void LLPanelLogin::setSiteIsAlive( bool alive )
337{ 334{
338 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("login_html"); 335 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
339 // if the contents of the site was retrieved 336 // if the contents of the site was retrieved
340 if ( alive ) 337 if ( alive )
341 { 338 {
@@ -398,6 +395,11 @@ LLPanelLogin::~LLPanelLogin()
398 395
399 //// We know we're done with the image, so be rid of it. 396 //// We know we're done with the image, so be rid of it.
400 //gImageList.deleteImage( mLogoImage ); 397 //gImageList.deleteImage( mLogoImage );
398
399 if ( gFocusMgr.getDefaultKeyboardFocus() == this )
400 {
401 gFocusMgr.setDefaultKeyboardFocus(NULL);
402 }
401} 403}
402 404
403// virtual 405// virtual
@@ -779,7 +781,7 @@ void LLPanelLogin::setAlwaysRefresh(bool refresh)
779{ 781{
780 if (LLStartUp::getStartupState() >= STATE_LOGIN_CLEANUP) return; 782 if (LLStartUp::getStartupState() >= STATE_LOGIN_CLEANUP) return;
781 783
782 LLWebBrowserCtrl* web_browser = sInstance->getChild<LLWebBrowserCtrl>("login_html"); 784 LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
783 785
784 if (web_browser) 786 if (web_browser)
785 { 787 {
@@ -952,25 +954,28 @@ void LLPanelLogin::loadLoginPage()
952#endif 954#endif
953#endif 955#endif
954 956
955 LLWebBrowserCtrl* web_browser = sInstance->getChild<LLWebBrowserCtrl>("login_html"); 957 LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
956 958
957 // navigate to the "real" page 959 // navigate to the "real" page
958 web_browser->navigateTo( oStr.str() ); 960 web_browser->navigateTo( oStr.str(), "text/html" );
959} 961}
960 962
961void LLPanelLogin::onNavigateComplete( const EventType& eventIn ) 963void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
962{ 964{
963 LLWebBrowserCtrl* web_browser = sInstance->getChild<LLWebBrowserCtrl>("login_html"); 965 if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
964 if (web_browser)
965 { 966 {
966 // *HACK HACK HACK HACK! 967 LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
967 /* Stuff a Tab key into the browser now so that the first field will 968 if (web_browser)
968 ** get the focus! The embedded javascript on the page that properly 969 {
969 ** sets the initial focus in a real web browser is not working inside 970 // *HACK HACK HACK HACK!
970 ** the viewer, so this is an UGLY HACK WORKAROUND for now. 971 /* Stuff a Tab key into the browser now so that the first field will
971 */ 972 ** get the focus! The embedded javascript on the page that properly
972 // Commented out as it's not reliable 973 ** sets the initial focus in a real web browser is not working inside
973 //web_browser->handleKey(KEY_TAB, MASK_NONE, false); 974 ** the viewer, so this is an UGLY HACK WORKAROUND for now.
975 */
976 // Commented out as it's not reliable
977 //web_browser->handleKey(KEY_TAB, MASK_NONE, false);
978 }
974 } 979 }
975} 980}
976 981
diff --git a/linden/indra/newview/llpanellogin.h b/linden/indra/newview/llpanellogin.h
index 15c2d28..c99fa30 100644
--- a/linden/indra/newview/llpanellogin.h
+++ b/linden/indra/newview/llpanellogin.h
@@ -35,14 +35,14 @@
35 35
36#include "llpanel.h" 36#include "llpanel.h"
37#include "llmemory.h" // LLPointer<> 37#include "llmemory.h" // LLPointer<>
38#include "llwebbrowserctrl.h" // LLWebBrowserCtrlObserver 38#include "llmediactrl.h" // LLMediaCtrlObserver
39 39
40class LLUIImage; 40class LLUIImage;
41 41
42 42
43class LLPanelLogin: 43class LLPanelLogin:
44 public LLPanel, 44 public LLPanel,
45 public LLWebBrowserCtrlObserver 45 public LLViewerMediaObserver
46{ 46{
47 LOG_CLASS(LLPanelLogin); 47 LOG_CLASS(LLPanelLogin);
48public: 48public:
@@ -84,6 +84,9 @@ public:
84 static void setAlwaysRefresh(bool refresh); 84 static void setAlwaysRefresh(bool refresh);
85 static void mungePassword(LLUICtrl* caller, void* user_data); 85 static void mungePassword(LLUICtrl* caller, void* user_data);
86 86
87 // inherited from LLViewerMediaObserver
88 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
89
87private: 90private:
88 static void onClickConnect(void*); 91 static void onClickConnect(void*);
89 static void onClickGrid(void*); 92 static void onClickGrid(void*);
@@ -91,7 +94,6 @@ private:
91 static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response); 94 static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response);
92 static void onClickQuit(void*); 95 static void onClickQuit(void*);
93 static void onClickVersion(void*); 96 static void onClickVersion(void*);
94 virtual void onNavigateComplete( const EventType& eventIn );
95 static void onClickForgotPassword(void*); 97 static void onClickForgotPassword(void*);
96 static void onPassKey(LLLineEditor* caller, void* user_data); 98 static void onPassKey(LLLineEditor* caller, void* user_data);
97 static void onSelectServer(LLUICtrl*, void*); 99 static void onSelectServer(LLUICtrl*, void*);
diff --git a/linden/indra/newview/llpanelmediahud.cpp b/linden/indra/newview/llpanelmediahud.cpp
new file mode 100644
index 0000000..39c4b63
--- /dev/null
+++ b/linden/indra/newview/llpanelmediahud.cpp
@@ -0,0 +1,667 @@
1/**
2 * @file llpanelmsgs.cpp
3 * @brief Message popup preferences panel
4 *
5 * $LicenseInfo:firstyear=2003&license=viewergpl$
6 *
7 * Copyright (c) 2003-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * 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 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("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 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * 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 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#include "llviewerprecompiledheaders.h"
34
35//LLPanelMediaHUD
36#include "llagent.h"
37#include "llparcel.h"
38#include "llpanel.h"
39#include "llselectmgr.h"
40#include "llrender.h"
41#include "lldrawable.h"
42#include "llviewerwindow.h"
43#include "lluictrlfactory.h"
44#include "llbutton.h"
45#include "llface.h"
46#include "llhudview.h"
47#include "lliconctrl.h"
48#include "lltoolpie.h"
49#include "llviewercamera.h"
50#include "llpanelmediahud.h"
51#include "llpluginclassmedia.h"
52#include "llviewercontrol.h"
53#include "llviewerparcelmgr.h"
54#include "llviewermedia.h"
55#include "llviewermediafocus.h"
56#include "llvovolume.h"
57#include "llweb.h"
58
59glh::matrix4f glh_get_current_modelview();
60glh::matrix4f glh_get_current_projection();
61
62const F32 ZOOM_NEAR_PADDING = 1.0f;
63const F32 ZOOM_MEDIUM_PADDING = 1.2f;
64const F32 ZOOM_FAR_PADDING = 1.5f;
65
66//
67// LLPanelMediaHUD
68//
69
70LLPanelMediaHUD::LLPanelMediaHUD(viewer_media_t media_impl)
71 : mMediaImpl(media_impl)
72{
73 mMediaFocus = false;
74 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_hud.xml");
75 mMouseMoveTimer.reset();
76 mFadeTimer.stop();
77 mCurrentZoom = ZOOM_NONE;
78 mScrollState = SCROLL_NONE;
79
80 mPanelHandle.bind(this);
81}
82LLPanelMediaHUD::~LLPanelMediaHUD()
83{
84 mMediaImpl = NULL;
85}
86
87BOOL LLPanelMediaHUD::postBuild()
88{
89 LLButton* close_btn = getChild<LLButton>("close");
90 close_btn->setClickedCallback(onClickClose, this);
91
92 LLButton* back_btn = getChild<LLButton>("back");
93 back_btn->setClickedCallback(onClickBack, this);
94
95 LLButton* fwd_btn = getChild<LLButton>("fwd");
96 fwd_btn->setClickedCallback(onClickForward, this);
97
98 LLButton* home_btn = getChild<LLButton>("home");
99 home_btn->setClickedCallback(onClickHome, this);
100
101 LLButton* stop_btn = getChild<LLButton>("stop");
102 stop_btn->setClickedCallback(onClickStop, this);
103
104 LLButton* media_stop_btn = getChild<LLButton>("media_stop");
105 media_stop_btn->setClickedCallback(onClickStop, this);
106
107 LLButton* reload_btn = getChild<LLButton>("reload");
108 reload_btn->setClickedCallback(onClickReload, this);
109
110 LLButton* play_btn = getChild<LLButton>("play");
111 play_btn->setClickedCallback(onClickPlay, this);
112
113 LLButton* pause_btn = getChild<LLButton>("pause");
114 pause_btn->setClickedCallback(onClickPause, this);
115
116 LLButton* open_btn = getChild<LLButton>("new_window");
117 open_btn->setClickedCallback(onClickOpen, this);
118
119 LLButton* zoom_btn = getChild<LLButton>("zoom_frame");
120 zoom_btn->setClickedCallback(onClickZoom, this);
121
122 LLButton* open_btn_h = getChild<LLButton>("new_window_hover");
123 open_btn_h->setClickedCallback(onClickOpen, this);
124
125 LLButton* zoom_btn_h = getChild<LLButton>("zoom_frame_hover");
126 zoom_btn_h->setClickedCallback(onClickZoom, this);
127
128 LLButton* scroll_up_btn = getChild<LLButton>("scrollup");
129 scroll_up_btn->setClickedCallback(onScrollUp, this);
130 scroll_up_btn->setHeldDownCallback(onScrollUpHeld);
131 scroll_up_btn->setMouseUpCallback(onScrollStop);
132 LLButton* scroll_left_btn = getChild<LLButton>("scrollleft");
133 scroll_left_btn->setClickedCallback(onScrollLeft, this);
134 scroll_left_btn->setHeldDownCallback(onScrollLeftHeld);
135 scroll_left_btn->setMouseUpCallback(onScrollStop);
136 LLButton* scroll_right_btn = getChild<LLButton>("scrollright");
137 scroll_right_btn->setClickedCallback(onScrollRight, this);
138 scroll_right_btn->setHeldDownCallback(onScrollLeftHeld);
139 scroll_right_btn->setMouseUpCallback(onScrollStop);
140 LLButton* scroll_down_btn = getChild<LLButton>("scrolldown");
141 scroll_down_btn->setClickedCallback(onScrollDown, this);
142 scroll_down_btn->setHeldDownCallback(onScrollDownHeld);
143 scroll_down_btn->setMouseUpCallback(onScrollStop);
144
145 mMouseInactiveTime = gSavedSettings.getF32("MediaControlTimeout");
146 mControlFadeTime = gSavedSettings.getF32("MediaControlFadeTime");
147
148 mCurrentZoom = ZOOM_NONE;
149 // clicks on HUD buttons do not remove keyboard focus from media
150 setIsChrome(TRUE);
151 return TRUE;
152}
153
154void LLPanelMediaHUD::updateShape()
155{
156 const S32 MIN_HUD_WIDTH=200;
157 const S32 MIN_HUD_HEIGHT=120;
158
159 LLPluginClassMedia* media_plugin = NULL;
160 if(mMediaImpl.notNull() && mMediaImpl->hasMedia())
161 {
162 media_plugin = mMediaImpl->getMediaPlugin();
163 }
164
165 // Early out for no media plugin
166 if(media_plugin == NULL)
167 {
168 setVisible(FALSE);
169 return;
170 }
171
172 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
173
174 bool can_navigate = parcel->getMediaAllowNavigate();
175
176 // LLObjectSelectionHandle selection = LLViewerMediaFocus::getInstance()->getSelection();
177
178 LLSelectNode* nodep = mMediaFocus ? LLSelectMgr::getInstance()->getSelection()->getFirstNode() : LLSelectMgr::getInstance()->getHoverNode();
179 if(! nodep)
180 {
181 return;
182 }
183 setVisible(FALSE);
184 LLViewerObject* objectp = nodep->getObject();
185
186 if (objectp)
187 {
188
189 // Set the state of the buttons
190 LLButton* back_btn = getChild<LLButton>("back");
191 LLButton* fwd_btn = getChild<LLButton>("fwd");
192 LLButton* reload_btn = getChild<LLButton>("reload");
193 LLButton* play_btn = getChild<LLButton>("play");
194 LLButton* pause_btn = getChild<LLButton>("pause");
195 LLButton* stop_btn = getChild<LLButton>("stop");
196 LLButton* media_stop_btn = getChild<LLButton>("media_stop");
197 LLButton* home_btn = getChild<LLButton>("home");
198 LLButton* close_btn = getChild<LLButton>("close");
199 LLButton* open_btn = getChild<LLButton>("new_window");
200 LLPanel* media_focused_panel = getChild<LLPanel>("media_focused_controls");
201 LLPanel* media_hover_panel = getChild<LLPanel>("media_hover_controls");
202 back_btn->setVisible(true);
203 fwd_btn->setVisible(true);
204 reload_btn->setVisible(true);
205 stop_btn->setVisible(false);
206 home_btn->setVisible(true);
207 close_btn->setVisible(true);
208 open_btn->setVisible(true);
209
210
211 if(mMediaFocus)
212 {
213 back_btn->setEnabled(mMediaImpl->canNavigateBack() && can_navigate);
214 fwd_btn->setEnabled(mMediaImpl->canNavigateForward() && can_navigate);
215 stop_btn->setEnabled(can_navigate);
216 home_btn->setEnabled(can_navigate);
217 LLPluginClassMediaOwner::EMediaStatus result = media_plugin->getStatus();
218
219 if(media_plugin->pluginSupportsMediaTime())
220 {
221 reload_btn->setEnabled(FALSE);
222 reload_btn->setVisible(FALSE);
223 media_stop_btn->setVisible(TRUE);
224 home_btn->setVisible(FALSE);
225 back_btn->setEnabled(TRUE);
226 fwd_btn->setEnabled(TRUE);
227 switch(result)
228 {
229 case LLPluginClassMediaOwner::MEDIA_PLAYING:
230 play_btn->setEnabled(FALSE);
231 play_btn->setVisible(FALSE);
232 pause_btn->setEnabled(TRUE);
233 pause_btn->setVisible(TRUE);
234 media_stop_btn->setEnabled(TRUE);
235 break;
236 case LLPluginClassMediaOwner::MEDIA_PAUSED:
237 default:
238 pause_btn->setEnabled(FALSE);
239 pause_btn->setVisible(FALSE);
240 play_btn->setEnabled(TRUE);
241 play_btn->setVisible(TRUE);
242 media_stop_btn->setEnabled(FALSE);
243 break;
244 }
245 }
246 else
247 {
248 play_btn->setVisible(FALSE);
249 pause_btn->setVisible(FALSE);
250 media_stop_btn->setVisible(FALSE);
251 if(result == LLPluginClassMediaOwner::MEDIA_LOADING)
252 {
253 reload_btn->setEnabled(FALSE);
254 reload_btn->setVisible(FALSE);
255 stop_btn->setEnabled(TRUE);
256 stop_btn->setVisible(TRUE);
257 }
258 else
259 {
260 reload_btn->setEnabled(TRUE);
261 reload_btn->setVisible(TRUE);
262 stop_btn->setEnabled(FALSE);
263 stop_btn->setVisible(FALSE);
264 }
265 }
266 }
267 media_focused_panel->setVisible(mMediaFocus);
268 media_hover_panel->setVisible(!mMediaFocus);
269
270 if(media_plugin == NULL)
271 // Handle Scrolling
272 switch (mScrollState)
273 {
274 case SCROLL_UP:
275 media_plugin->scrollEvent(0, -1, MASK_NONE);
276 break;
277 case SCROLL_DOWN:
278 media_plugin->scrollEvent(0, 1, MASK_NONE);
279 break;
280 case SCROLL_LEFT:
281 mMediaImpl->handleKeyHere(KEY_LEFT, MASK_NONE);
282 break;
283 case SCROLL_RIGHT:
284 mMediaImpl->handleKeyHere(KEY_RIGHT, MASK_NONE);
285 break;
286 case SCROLL_NONE:
287 default:
288 break;
289 }
290 LLBBox screen_bbox;
291 setVisible(TRUE);
292 glh::matrix4f mat = glh_get_current_projection()*glh_get_current_modelview();
293 std::vector<LLVector3>::iterator vert_it;
294 std::vector<LLVector3>::iterator vert_end;
295 std::vector<LLVector3> vect_face;
296
297 LLVolume* volume = objectp->getVolume();
298
299 if (volume)
300 {
301 const LLVolumeFace& vf = volume->getVolumeFace(nodep->getLastSelectedTE());
302
303 const LLVector3* ext = vf.mExtents;
304
305 LLVector3 center = (ext[0]+ext[1])*0.5f;
306 LLVector3 size = (ext[1]-ext[0])*0.5f;
307 LLVector3 vert[] =
308 {
309 center + size.scaledVec(LLVector3(1,1,1)),
310 center + size.scaledVec(LLVector3(-1,1,1)),
311 center + size.scaledVec(LLVector3(1,-1,1)),
312 center + size.scaledVec(LLVector3(-1,-1,1)),
313 center + size.scaledVec(LLVector3(1,1,-1)),
314 center + size.scaledVec(LLVector3(-1,1,-1)),
315 center + size.scaledVec(LLVector3(1,-1,-1)),
316 center + size.scaledVec(LLVector3(-1,-1,-1)),
317 };
318
319 LLVOVolume* vo = (LLVOVolume*) objectp;
320
321 for (U32 i = 0; i < 8; i++)
322 {
323 vect_face.push_back(vo->volumePositionToAgent(vert[i]));
324 }
325 }
326 vert_it = vect_face.begin();
327 vert_end = vect_face.end();
328
329 LLVector3 min = LLVector3(1,1,1);
330 LLVector3 max = LLVector3(-1,-1,-1);
331 for(; vert_it != vert_end; ++vert_it)
332 {
333 // project silhouette vertices into screen space
334 glh::vec3f screen_vert = glh::vec3f(vert_it->mV);
335 mat.mult_matrix_vec(screen_vert);
336
337 // add to screenspace bounding box
338 update_min_max(min, max, LLVector3(screen_vert.v));
339 }
340
341 LLCoordGL screen_min;
342 screen_min.mX = llround((F32)gViewerWindow->getWindowWidth() * (min.mV[VX] + 1.f) * 0.5f);
343 screen_min.mY = llround((F32)gViewerWindow->getWindowHeight() * (min.mV[VY] + 1.f) * 0.5f);
344
345 LLCoordGL screen_max;
346 screen_max.mX = llround((F32)gViewerWindow->getWindowWidth() * (max.mV[VX] + 1.f) * 0.5f);
347 screen_max.mY = llround((F32)gViewerWindow->getWindowHeight() * (max.mV[VY] + 1.f) * 0.5f);
348
349 // grow panel so that screenspace bounding box fits inside "media_region" element of HUD
350 LLRect media_hud_rect;
351 getParent()->screenRectToLocal(LLRect(screen_min.mX, screen_max.mY, screen_max.mX, screen_min.mY), &media_hud_rect);
352 LLView* media_region = getChild<LLView>("media_region");
353 media_hud_rect.mLeft -= media_region->getRect().mLeft;
354 media_hud_rect.mBottom -= media_region->getRect().mBottom;
355 media_hud_rect.mTop += getRect().getHeight() - media_region->getRect().mTop;
356 media_hud_rect.mRight += getRect().getWidth() - media_region->getRect().mRight;
357
358
359 LLRect old_hud_rect = media_hud_rect;
360 // keep all parts of HUD on-screen
361 media_hud_rect.intersectWith(getParent()->getLocalRect());
362
363 // If we had to clip the rect, don't display the border
364 childSetVisible("bg_image", false);
365
366 // clamp to minimum size, keeping centered
367 media_hud_rect.setCenterAndSize(media_hud_rect.getCenterX(), media_hud_rect.getCenterY(),
368 llmax(MIN_HUD_WIDTH, media_hud_rect.getWidth()), llmax(MIN_HUD_HEIGHT, media_hud_rect.getHeight()));
369
370 userSetShape(media_hud_rect);
371
372 // Test mouse position to see if the cursor is stationary
373 LLCoordWindow cursor_pos_window;
374 getWindow()->getCursorPosition(&cursor_pos_window);
375
376 // If last pos is not equal to current pos, the mouse has moved
377 // We need to reset the timer, and make sure the panel is visible
378 if(cursor_pos_window.mX != mLastCursorPos.mX ||
379 cursor_pos_window.mY != mLastCursorPos.mY ||
380 mScrollState != SCROLL_NONE)
381 {
382 mMouseMoveTimer.start();
383 mLastCursorPos = cursor_pos_window;
384 }
385
386 // Mouse has been stationary, but not for long enough to fade the UI
387 if(mMouseMoveTimer.getElapsedTimeF32() < mMouseInactiveTime)
388 {
389 // If we have started fading, reset the alpha values
390 if(mFadeTimer.getStarted())
391 {
392 F32 alpha = 1.0f;
393 setAlpha(alpha);
394 mFadeTimer.stop();
395 }
396 }
397 // If we need to start fading the UI (and we have not already started)
398 else if(! mFadeTimer.getStarted())
399 {
400 mFadeTimer.reset();
401 mFadeTimer.start();
402 }
403 }
404}
405/*virtual*/
406void LLPanelMediaHUD::draw()
407{
408 if(mFadeTimer.getStarted())
409 {
410 if(mFadeTimer.getElapsedTimeF32() >= mControlFadeTime)
411 {
412 setVisible(FALSE);
413 }
414 else
415 {
416 F32 time = mFadeTimer.getElapsedTimeF32();
417 F32 alpha = llmax(lerp(1.0, 0.0, time / mControlFadeTime), 0.0f);
418 setAlpha(alpha);
419 }
420 }
421 LLPanel::draw();
422}
423void LLPanelMediaHUD::setAlpha(F32 alpha)
424{
425 LLViewQuery query;
426
427 LLView* query_view = mMediaFocus ? getChildView("media_focused_controls") : getChildView("media_hover_controls");
428 child_list_t children = query(query_view);
429 for (child_list_iter_t child_iter = children.begin();
430 child_iter != children.end(); ++child_iter)
431 {
432 LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(*child_iter);
433 if (ctrl)
434 ctrl->setAlpha(alpha);
435 }
436
437 LLPanel::setAlpha(alpha);
438}
439BOOL LLPanelMediaHUD::handleScrollWheel(S32 x, S32 y, S32 clicks)
440{
441 return LLViewerMediaFocus::getInstance()->handleScrollWheel(x, y, clicks);
442}
443bool LLPanelMediaHUD::isMouseOver()
444{
445 if( ! getVisible() )
446 {
447 return false;
448 }
449 LLRect screen_rect;
450 LLCoordWindow cursor_pos_window;
451 getWindow()->getCursorPosition(&cursor_pos_window);
452
453 localRectToScreen(getLocalRect(), &screen_rect);
454 // screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &local_mouse_x, &local_mouse_y);
455
456 if(screen_rect.pointInRect(cursor_pos_window.mX, cursor_pos_window.mY))
457 {
458 return true;
459 }
460 return false;
461}
462
463//static
464void LLPanelMediaHUD::onClickClose(void* user_data)
465{
466 LLViewerMediaFocus::getInstance()->setFocusFace(FALSE, NULL, 0, NULL);
467 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
468 if(this_panel->mCurrentZoom != ZOOM_NONE)
469 {
470 // gAgent.setFocusOnAvatar(TRUE, ANIMATE);
471 this_panel->mCurrentZoom = ZOOM_NONE;
472 }
473 this_panel->setVisible(FALSE);
474
475}
476
477//static
478void LLPanelMediaHUD::onClickBack(void* user_data)
479{
480 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
481 if (this_panel->mMediaImpl.notNull() && this_panel->mMediaImpl->hasMedia())
482 {
483 if(this_panel->mMediaImpl->getMediaPlugin()->pluginSupportsMediaTime())
484 {
485 this_panel->mMediaImpl->getMediaPlugin()->start(-2.0);
486 }
487 else
488 {
489 this_panel->mMediaImpl->getMediaPlugin()->browse_back();
490 }
491
492 }
493}
494//static
495void LLPanelMediaHUD::onClickForward(void* user_data)
496{
497 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
498 if (this_panel->mMediaImpl.notNull() && this_panel->mMediaImpl->hasMedia())
499 {
500 if(this_panel->mMediaImpl->getMediaPlugin()->pluginSupportsMediaTime())
501 {
502 this_panel->mMediaImpl->getMediaPlugin()->start(2.0);
503 }
504 else
505 {
506 this_panel->mMediaImpl->getMediaPlugin()->browse_forward();
507 }
508 }
509}
510//static
511void LLPanelMediaHUD::onClickHome(void* user_data)
512{
513 //LLViewerMedia::navigateHome();
514 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
515 if(this_panel->mMediaImpl.notNull())
516 {
517 this_panel->mMediaImpl->navigateHome();
518 }
519}
520//static
521void LLPanelMediaHUD::onClickOpen(void* user_data)
522{
523 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
524 if(this_panel->mMediaImpl.notNull())
525 {
526 LLWeb::loadURL(this_panel->mMediaImpl->getMediaURL());
527 }
528}
529//static
530void LLPanelMediaHUD::onClickReload(void* user_data)
531{
532 //LLViewerMedia::navigateHome();
533 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
534 LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
535 if(objectp && this_panel->mMediaImpl.notNull())
536 {
537 this_panel->mMediaImpl->navigateTo(objectp->getMediaURL());
538 }
539}
540//static
541void LLPanelMediaHUD::onClickPlay(void* user_data)
542{
543 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
544 if (this_panel->mMediaImpl.notNull() && this_panel->mMediaImpl->hasMedia())
545 {
546 this_panel->mMediaImpl->getMediaPlugin()->start();
547 }
548}
549//static
550void LLPanelMediaHUD::onClickPause(void* user_data)
551{
552 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
553 if (this_panel->mMediaImpl.notNull() && this_panel->mMediaImpl->hasMedia())
554 {
555 this_panel->mMediaImpl->getMediaPlugin()->pause();
556 }
557}
558//static
559void LLPanelMediaHUD::onClickStop(void* user_data)
560{
561 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
562 if (this_panel->mMediaImpl.notNull() && this_panel->mMediaImpl->hasMedia())
563 {
564 if(this_panel->mMediaImpl->getMediaPlugin()->pluginSupportsMediaTime())
565 {
566 this_panel->mMediaImpl->getMediaPlugin()->stop();
567 }
568 else
569 {
570 this_panel->mMediaImpl->getMediaPlugin()->browse_stop();
571 }
572 }
573}
574//static
575void LLPanelMediaHUD::onClickZoom(void* user_data)
576{
577 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
578 this_panel->nextZoomLevel();
579}
580void LLPanelMediaHUD::nextZoomLevel()
581{
582 F32 zoom_padding = 0.0f;
583 S32 last_zoom_level = (S32)mCurrentZoom;
584 mCurrentZoom = (EZoomLevel)((last_zoom_level + 1) % (S32)ZOOM_END);
585
586 switch (mCurrentZoom)
587 {
588 case ZOOM_NONE:
589 {
590 gAgent.setFocusOnAvatar(TRUE, ANIMATE);
591 break;
592 }
593 case ZOOM_MEDIUM:
594 {
595 zoom_padding = ZOOM_MEDIUM_PADDING;
596 break;
597 }
598 default:
599 {
600 gAgent.setFocusOnAvatar(TRUE, ANIMATE);
601 break;
602 }
603 }
604
605 if (zoom_padding > 0.0f)
606 LLViewerMediaFocus::getInstance()->setCameraZoom(zoom_padding);
607}
608void LLPanelMediaHUD::onScrollUp(void* user_data)
609{
610 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
611 if(this_panel->mMediaImpl.notNull() && this_panel->mMediaImpl->hasMedia())
612 {
613 this_panel->mMediaImpl->getMediaPlugin()->scrollEvent(0, -1, MASK_NONE);
614 }
615}
616void LLPanelMediaHUD::onScrollUpHeld(void* user_data)
617{
618 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
619 this_panel->mScrollState = SCROLL_UP;
620}
621void LLPanelMediaHUD::onScrollRight(void* user_data)
622{
623 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
624 if(this_panel->mMediaImpl.notNull())
625 {
626 this_panel->mMediaImpl->handleKeyHere(KEY_RIGHT, MASK_NONE);
627 }
628}
629void LLPanelMediaHUD::onScrollRightHeld(void* user_data)
630{
631 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
632 this_panel->mScrollState = SCROLL_RIGHT;
633}
634
635void LLPanelMediaHUD::onScrollLeft(void* user_data)
636{
637 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
638 if(this_panel->mMediaImpl.notNull())
639 {
640 this_panel->mMediaImpl->handleKeyHere(KEY_LEFT, MASK_NONE);
641 }
642}
643void LLPanelMediaHUD::onScrollLeftHeld(void* user_data)
644{
645 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
646 this_panel->mScrollState = SCROLL_LEFT;
647}
648
649void LLPanelMediaHUD::onScrollDown(void* user_data)
650{
651 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
652 if(this_panel->mMediaImpl.notNull() && this_panel->mMediaImpl->hasMedia())
653 {
654 this_panel->mMediaImpl->getMediaPlugin()->scrollEvent(0, 1, MASK_NONE);
655 }
656}
657void LLPanelMediaHUD::onScrollDownHeld(void* user_data)
658{
659 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
660 this_panel->mScrollState = SCROLL_DOWN;
661}
662
663void LLPanelMediaHUD::onScrollStop(void* user_data)
664{
665 LLPanelMediaHUD* this_panel = static_cast<LLPanelMediaHUD*> (user_data);
666 this_panel->mScrollState = SCROLL_NONE;
667}
diff --git a/linden/indra/newview/llpanelmediahud.h b/linden/indra/newview/llpanelmediahud.h
new file mode 100644
index 0000000..5f12ebc
--- /dev/null
+++ b/linden/indra/newview/llpanelmediahud.h
@@ -0,0 +1,110 @@
1/**
2 * @file llpanelmediahud.h
3 * @brief Media hud panel
4 *
5 * $LicenseInfo:firstyear=2003&license=viewergpl$
6 *
7 * Copyright (c) 2003-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * 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 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("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 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * 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 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#ifndef LL_PANELMEDIAHUD_H
34#define LL_PANELMEDIAHUD_H
35
36#include "llpanel.h"
37#include "llviewermedia.h"
38
39class LLCoordWindow;
40class LLViewerMediaImpl;
41
42class LLPanelMediaHUD : public LLPanel
43{
44public:
45 LLPanelMediaHUD(viewer_media_t media_impl);
46 virtual ~LLPanelMediaHUD();
47 /*virtual*/ BOOL postBuild();
48 virtual void draw();
49 virtual void setAlpha(F32 alpha);
50 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
51 void updateShape();
52 bool isMouseOver();
53 void setMediaFocus(bool b) { mMediaFocus = b; }
54 void nextZoomLevel();
55 void resetZoomLevel() { mCurrentZoom = ZOOM_NONE; }
56
57 LLHandle<LLPanelMediaHUD> getHandle() const { return mPanelHandle; }
58 void setMediaImpl(viewer_media_t media_impl) { mMediaImpl = media_impl; }
59
60
61 enum EZoomLevel
62 {
63 ZOOM_NONE = 0,
64 ZOOM_MEDIUM = 1,
65 ZOOM_END
66 };
67 enum EScrollDir
68 {
69 SCROLL_UP = 0,
70 SCROLL_DOWN,
71 SCROLL_LEFT,
72 SCROLL_RIGHT,
73 SCROLL_NONE
74 };
75
76private:
77 static void onClickClose(void* user_data);
78 static void onClickBack(void* user_data);
79 static void onClickForward(void* user_data);
80 static void onClickHome(void* user_data);
81 static void onClickOpen(void* user_data);
82 static void onClickReload(void* user_data);
83 static void onClickPlay(void* user_data);
84 static void onClickPause(void* user_data);
85 static void onClickStop(void* user_data);
86 static void onClickZoom(void* user_data);
87 static void onScrollUp(void* user_data);
88 static void onScrollUpHeld(void* user_data);
89 static void onScrollLeft(void* user_data);
90 static void onScrollLeftHeld(void* user_data);
91 static void onScrollRight(void* user_data);
92 static void onScrollRightHeld(void* user_data);
93 static void onScrollDown(void* user_data);
94 static void onScrollDownHeld(void* user_data);
95 static void onScrollStop(void* user_data);
96
97 bool mMediaFocus;
98 LLMatrix4 mLastCameraMat;
99 EZoomLevel mCurrentZoom;
100 EScrollDir mScrollState;
101 LLCoordWindow mLastCursorPos;
102 LLFrameTimer mMouseMoveTimer;
103 LLFrameTimer mFadeTimer;
104 F32 mMouseInactiveTime;
105 F32 mControlFadeTime;
106 viewer_media_t mMediaImpl;
107 LLRootHandle<LLPanelMediaHUD> mPanelHandle;
108};
109
110#endif // LL_PANELMEDIAHUD_H
diff --git a/linden/indra/newview/llpanelpermissions.cpp b/linden/indra/newview/llpanelpermissions.cpp
index fc05744..6b318e0 100644
--- a/linden/indra/newview/llpanelpermissions.cpp
+++ b/linden/indra/newview/llpanelpermissions.cpp
@@ -277,7 +277,7 @@ void LLPanelPermissions::refresh()
277 BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 277 BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
278 && LLSelectMgr::getInstance()->selectGetRootsModify()) 278 && LLSelectMgr::getInstance()->selectGetRootsModify())
279 || LLSelectMgr::getInstance()->selectGetModify(); 279 || LLSelectMgr::getInstance()->selectGetModify();
280 const LLView* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); 280 const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus();
281 S32 string_index = 0; 281 S32 string_index = 0;
282 std::string MODIFY_INFO_STRINGS[] = 282 std::string MODIFY_INFO_STRINGS[] =
283 { 283 {
diff --git a/linden/indra/newview/llpanelweb.cpp b/linden/indra/newview/llpanelweb.cpp
index 38bb2d7..e2933f0 100644
--- a/linden/indra/newview/llpanelweb.cpp
+++ b/linden/indra/newview/llpanelweb.cpp
@@ -38,50 +38,23 @@
38// project includes 38// project includes
39#include "llcheckboxctrl.h" 39#include "llcheckboxctrl.h"
40#include "hippoGridManager.h" 40#include "hippoGridManager.h"
41#include "llmediamanager.h"
42#include "lluictrlfactory.h" 41#include "lluictrlfactory.h"
43#include "llviewercontrol.h" 42#include "llviewercontrol.h"
43#include "llviewermedia.h"
44#include "llviewerwindow.h" 44#include "llviewerwindow.h"
45#include "llpluginclassmedia.h"
45 46
46// helper functions for getting/freeing the web browser media 47// helper functions for getting/freeing the web browser media
47// if creating/destroying these is too slow, we'll need to create 48// if creating/destroying these is too slow, we'll need to create
48// a static member and update all our static callbacks 49// a static member and update all our static callbacks
49LLMediaBase *get_web_media() 50viewer_media_t get_web_media()
50{ 51{
51 LLMediaBase *media_source;
52 LLMediaManager *mgr = LLMediaManager::getInstance();
53
54 if (!mgr)
55 {
56 llwarns << "cannot get media manager" << llendl;
57 return NULL;
58 }
59 52
60 media_source = mgr->createSourceFromMimeType("http", "text/html" ); 53 viewer_media_t media_source = LLViewerMedia::newMediaImpl("", LLUUID::null, 0, 0, 0, 0, "text/html");
61 if ( !media_source )
62 {
63 llwarns << "media source create failed " << llendl;
64 return NULL;
65 }
66 54
67 return media_source; 55 return media_source;
68} 56}
69 57
70void free_web_media(LLMediaBase *media_source)
71{
72 if (!media_source)
73 return;
74
75 LLMediaManager *mgr = LLMediaManager::getInstance();
76 if (!mgr)
77 {
78 llwarns << "cannot get media manager" << llendl;
79 return;
80 }
81
82 mgr->destroySource(media_source);
83}
84
85LLPanelWeb::LLPanelWeb() 58LLPanelWeb::LLPanelWeb()
86{ 59{
87 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_web.xml"); 60 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_web.xml");
@@ -144,17 +117,16 @@ void LLPanelWeb::apply()
144 bool value = childGetValue("use_external_browser").asString() == "external" ? true : false; 117 bool value = childGetValue("use_external_browser").asString() == "external" ? true : false;
145 gSavedSettings.setBOOL("UseExternalBrowser", value); 118 gSavedSettings.setBOOL("UseExternalBrowser", value);
146 119
147 LLMediaBase *media_source = get_web_media(); 120 viewer_media_t media_source = get_web_media();
148 if (media_source) 121 if (media_source && media_source->hasMedia())
149 { 122 {
150 media_source->enableCookies(childGetValue("cookies_enabled")); 123 media_source->getMediaPlugin()->enable_cookies(childGetValue("cookies_enabled"));
151 124
152 bool proxy_enable = childGetValue("web_proxy_enabled"); 125 bool proxy_enable = childGetValue("web_proxy_enabled");
153 std::string proxy_address = childGetValue("web_proxy_editor"); 126 std::string proxy_address = childGetValue("web_proxy_editor");
154 int proxy_port = childGetValue("web_proxy_port"); 127 int proxy_port = childGetValue("web_proxy_port");
155 media_source->enableProxy(proxy_enable, proxy_address, proxy_port); 128 media_source->getMediaPlugin()->proxy_setup(proxy_enable, proxy_address, proxy_port);
156 } 129 }
157 free_web_media(media_source);
158} 130}
159 131
160void LLPanelWeb::cancel() 132void LLPanelWeb::cancel()
@@ -173,10 +145,9 @@ bool LLPanelWeb::callback_clear_browser_cache(const LLSD& notification, const LL
173 S32 option = LLNotification::getSelectedOption(notification, response); 145 S32 option = LLNotification::getSelectedOption(notification, response);
174 if ( option == 0 ) // YES 146 if ( option == 0 ) // YES
175 { 147 {
176 LLMediaBase *media_source = get_web_media(); 148 viewer_media_t media_source = get_web_media();
177 if (media_source) 149 if (media_source && media_source->hasMedia())
178 media_source->clearCache(); 150 media_source->getMediaPlugin()->clear_cache();
179 free_web_media(media_source);
180 } 151 }
181 return false; 152 return false;
182} 153}
@@ -193,10 +164,9 @@ bool LLPanelWeb::callback_clear_cookies(const LLSD& notification, const LLSD& re
193 S32 option = LLNotification::getSelectedOption(notification, response); 164 S32 option = LLNotification::getSelectedOption(notification, response);
194 if ( option == 0 ) // YES 165 if ( option == 0 ) // YES
195 { 166 {
196 LLMediaBase *media_source = get_web_media(); 167 viewer_media_t media_source = get_web_media();
197 if (media_source) 168 if (media_source && media_source->hasMedia())
198 media_source->clearCookies(); 169 media_source->getMediaPlugin()->clear_cookies();
199 free_web_media(media_source);
200 } 170 }
201 return false; 171 return false;
202} 172}
@@ -209,10 +179,9 @@ void LLPanelWeb::onCommitCookies(LLUICtrl* ctrl, void* data)
209 179
210 if (!self || !check) return; 180 if (!self || !check) return;
211 181
212 LLMediaBase *media_source = get_web_media(); 182 viewer_media_t media_source = get_web_media();
213 if (media_source) 183 if (media_source && media_source->hasMedia())
214 media_source->enableCookies(check->get()); 184 media_source->getMediaPlugin()->enable_cookies(check->get());
215 free_web_media(media_source);
216} 185}
217// static 186// static
218void LLPanelWeb::onCommitWebProxyEnabled(LLUICtrl* ctrl, void* data) 187void LLPanelWeb::onCommitWebProxyEnabled(LLUICtrl* ctrl, void* data)
diff --git a/linden/indra/newview/llprefsvoice.cpp b/linden/indra/newview/llprefsvoice.cpp
index fe5446b..609d30a 100644
--- a/linden/indra/newview/llprefsvoice.cpp
+++ b/linden/indra/newview/llprefsvoice.cpp
@@ -153,8 +153,8 @@ void LLPrefsVoice::apply()
153 if (enable_voice && !gSavedSettings.getBOOL("VivoxLicenseAccepted")) 153 if (enable_voice && !gSavedSettings.getBOOL("VivoxLicenseAccepted"))
154 { 154 {
155 // This window enables voice chat if license is accepted 155 // This window enables voice chat if license is accepted
156 FloaterVoiceLicense::getInstance()->open(); 156//imprudence fixme FloaterVoiceLicense::getInstance()->open();
157 FloaterVoiceLicense::getInstance()->center(); 157//imprudence fixme FloaterVoiceLicense::getInstance()->center();
158 } 158 }
159 else 159 else
160 { 160 {
diff --git a/linden/indra/newview/llpreviewscript.cpp b/linden/indra/newview/llpreviewscript.cpp
index d8c3aa9..737d712 100644
--- a/linden/indra/newview/llpreviewscript.cpp
+++ b/linden/indra/newview/llpreviewscript.cpp
@@ -81,7 +81,7 @@
81#include "llviewertexteditor.h" 81#include "llviewertexteditor.h"
82#include "llviewerwindow.h" 82#include "llviewerwindow.h"
83#include "lluictrlfactory.h" 83#include "lluictrlfactory.h"
84#include "llwebbrowserctrl.h" 84#include "llmediactrl.h"
85#include "lluictrlfactory.h" 85#include "lluictrlfactory.h"
86 86
87#include "llviewercontrol.h" 87#include "llviewercontrol.h"
@@ -360,7 +360,7 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
360 // update back and forward buttons 360 // update back and forward buttons
361 LLButton* fwd_button = help_floater->getChild<LLButton>("fwd_btn"); 361 LLButton* fwd_button = help_floater->getChild<LLButton>("fwd_btn");
362 LLButton* back_button = help_floater->getChild<LLButton>("back_btn"); 362 LLButton* back_button = help_floater->getChild<LLButton>("back_btn");
363 LLWebBrowserCtrl* browser = help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 363 LLMediaCtrl* browser = help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
364 back_button->setEnabled(browser->canNavigateBack()); 364 back_button->setEnabled(browser->canNavigateBack());
365 fwd_button->setEnabled(browser->canNavigateForward()); 365 fwd_button->setEnabled(browser->canNavigateForward());
366 366
@@ -419,7 +419,7 @@ void LLScriptEdCore::setHelpPage(const std::string& help_string)
419 LLFloater* help_floater = mLiveHelpHandle.get(); 419 LLFloater* help_floater = mLiveHelpHandle.get();
420 if (!help_floater) return; 420 if (!help_floater) return;
421 421
422 LLWebBrowserCtrl* web_browser = help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 422 LLMediaCtrl* web_browser = help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
423 if (!web_browser) return; 423 if (!web_browser) return;
424 424
425 LLComboBox* history_combo = help_floater->getChild<LLComboBox>("history_combo"); 425 LLComboBox* history_combo = help_floater->getChild<LLComboBox>("history_combo");
@@ -592,7 +592,7 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata)
592 live_help_floater->childSetAction("back_btn", onClickBack, userdata); 592 live_help_floater->childSetAction("back_btn", onClickBack, userdata);
593 live_help_floater->childSetAction("fwd_btn", onClickForward, userdata); 593 live_help_floater->childSetAction("fwd_btn", onClickForward, userdata);
594 594
595 LLWebBrowserCtrl* browser = live_help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 595 LLMediaCtrl* browser = live_help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
596 browser->setAlwaysRefresh(TRUE); 596 browser->setAlwaysRefresh(TRUE);
597 597
598 LLComboBox* help_combo = live_help_floater->getChild<LLComboBox>("history_combo"); 598 LLComboBox* help_combo = live_help_floater->getChild<LLComboBox>("history_combo");
@@ -621,7 +621,7 @@ void LLScriptEdCore::onClickBack(void* userdata)
621 LLFloater* live_help_floater = corep->mLiveHelpHandle.get(); 621 LLFloater* live_help_floater = corep->mLiveHelpHandle.get();
622 if (live_help_floater) 622 if (live_help_floater)
623 { 623 {
624 LLWebBrowserCtrl* browserp = live_help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 624 LLMediaCtrl* browserp = live_help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
625 if (browserp) 625 if (browserp)
626 { 626 {
627 browserp->navigateBack(); 627 browserp->navigateBack();
@@ -636,7 +636,7 @@ void LLScriptEdCore::onClickForward(void* userdata)
636 LLFloater* live_help_floater = corep->mLiveHelpHandle.get(); 636 LLFloater* live_help_floater = corep->mLiveHelpHandle.get();
637 if (live_help_floater) 637 if (live_help_floater)
638 { 638 {
639 LLWebBrowserCtrl* browserp = live_help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 639 LLMediaCtrl* browserp = live_help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
640 if (browserp) 640 if (browserp)
641 { 641 {
642 browserp->navigateForward(); 642 browserp->navigateForward();
@@ -678,7 +678,7 @@ void LLScriptEdCore::onHelpComboCommit(LLUICtrl* ctrl, void* userdata)
678 678
679 corep->addHelpItemToHistory(help_string); 679 corep->addHelpItemToHistory(help_string);
680 680
681 LLWebBrowserCtrl* web_browser = live_help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 681 LLMediaCtrl* web_browser = live_help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
682 LLUIString url_string = gSavedSettings.getString("LSLHelpURL"); 682 LLUIString url_string = gSavedSettings.getString("LSLHelpURL");
683 url_string.setArg("[APP_DIRECTORY]", gDirUtilp->getWorkingDir()); 683 url_string.setArg("[APP_DIRECTORY]", gDirUtilp->getWorkingDir());
684 url_string.setArg("[LSL_STRING]", help_string); 684 url_string.setArg("[LSL_STRING]", help_string);
diff --git a/linden/indra/newview/llpreviewsound.cpp b/linden/indra/newview/llpreviewsound.cpp
index 26d8da5..0dd65ab 100644
--- a/linden/indra/newview/llpreviewsound.cpp
+++ b/linden/indra/newview/llpreviewsound.cpp
@@ -32,7 +32,7 @@
32 32
33#include "llviewerprecompiledheaders.h" 33#include "llviewerprecompiledheaders.h"
34 34
35#include "audioengine.h" 35#include "llaudioengine.h"
36#include "llagent.h" // gAgent 36#include "llagent.h" // gAgent
37#include "llbutton.h" 37#include "llbutton.h"
38#include "llinventory.h" 38#include "llinventory.h"
diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp
index 83abcf4..558d278 100644
--- a/linden/indra/newview/llselectmgr.cpp
+++ b/linden/indra/newview/llselectmgr.cpp
@@ -59,6 +59,7 @@
59#include "llfloaterreporter.h" 59#include "llfloaterreporter.h"
60#include "llfloatertools.h" 60#include "llfloatertools.h"
61#include "llframetimer.h" 61#include "llframetimer.h"
62#include "llfocusmgr.h"
62#include "llhudeffecttrail.h" 63#include "llhudeffecttrail.h"
63#include "llhudmanager.h" 64#include "llhudmanager.h"
64#include "llinventorymodel.h" 65#include "llinventorymodel.h"
@@ -74,6 +75,8 @@
74#include "llviewercamera.h" 75#include "llviewercamera.h"
75#include "llviewercontrol.h" 76#include "llviewercontrol.h"
76#include "llviewerimagelist.h" 77#include "llviewerimagelist.h"
78#include "llviewermedia.h"
79#include "llviewermediafocus.h"
77#include "llviewermenu.h" 80#include "llviewermenu.h"
78#include "llviewerobject.h" 81#include "llviewerobject.h"
79#include "llviewerobjectlist.h" 82#include "llviewerobjectlist.h"
@@ -4875,7 +4878,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
4875 if (mSelectedObjects->getNumNodes()) 4878 if (mSelectedObjects->getNumNodes())
4876 { 4879 {
4877 LLUUID inspect_item_id = LLFloaterInspect::getSelectedUUID(); 4880 LLUUID inspect_item_id = LLFloaterInspect::getSelectedUUID();
4878 4881 LLUUID focus_item_id = LLViewerMediaFocus::getInstance()->getSelectedUUID();
4879 for (S32 pass = 0; pass < 2; pass++) 4882 for (S32 pass = 0; pass < 2; pass++)
4880 { 4883 {
4881 for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); 4884 for (LLObjectSelection::iterator iter = mSelectedObjects->begin();
@@ -4889,7 +4892,11 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
4889 { 4892 {
4890 continue; 4893 continue;
4891 } 4894 }
4892 if(objectp->getID() == inspect_item_id) 4895 if (objectp->getID() == focus_item_id)
4896 {
4897 node->renderOneSilhouette(gFocusMgr.getFocusColor());
4898 }
4899 else if(objectp->getID() == inspect_item_id)
4893 { 4900 {
4894 node->renderOneSilhouette(sHighlightInspectColor); 4901 node->renderOneSilhouette(sHighlightInspectColor);
4895 } 4902 }
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 4fd4daa..87d48c8 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -40,14 +40,15 @@
40# include <sys/stat.h> // mkdir() 40# include <sys/stat.h> // mkdir()
41#endif 41#endif
42 42
43#include "audioengine.h" 43#include "llviewermedia_streamingaudio.h"
44#include "llaudioengine.h"
44 45
45#ifdef LL_FMOD 46#ifdef LL_FMOD
46# include "audioengine_fmod.h" 47# include "llaudioengine_fmod.h"
47#endif 48#endif
48 49
49#ifdef LL_OPENAL 50#ifdef LL_OPENAL
50#include "audioengine_openal.h" 51#include "llaudioengine_openal.h"
51#endif 52#endif
52 53
53#include "llares.h" 54#include "llares.h"
@@ -100,6 +101,7 @@
100#include "llfloatergesture.h" 101#include "llfloatergesture.h"
101#include "llfloaterhud.h" 102#include "llfloaterhud.h"
102#include "llfloaterland.h" 103#include "llfloaterland.h"
104#include "llfloaterteleporthistory.h"
103#include "llfloatertopobjects.h" 105#include "llfloatertopobjects.h"
104#include "llfloatertos.h" 106#include "llfloatertos.h"
105#include "llfloaterworldmap.h" 107#include "llfloaterworldmap.h"
@@ -191,12 +193,6 @@
191#include "jcfloater_animation_list.h" 193#include "jcfloater_animation_list.h"
192#include "jcfloaterareasearch.h" 194#include "jcfloaterareasearch.h"
193 195
194#include "llfloaterteleporthistory.h"
195
196#if LL_LIBXUL_ENABLED
197#include "llmozlib.h"
198#endif // LL_LIBXUL_ENABLED
199
200#if LL_WINDOWS 196#if LL_WINDOWS
201#include "llwindebug.h" 197#include "llwindebug.h"
202#include "lldxhardware.h" 198#include "lldxhardware.h"
@@ -675,6 +671,16 @@ bool idle_startup()
675 delete gAudiop; 671 delete gAudiop;
676 gAudiop = NULL; 672 gAudiop = NULL;
677 } 673 }
674
675 if (gAudiop)
676 {
677 // if the audio engine hasn't set up its own preferred handler for streaming audio then set up the generic streaming audio implementation which uses media plugins
678 if (NULL == gAudiop->getStreamingAudioImpl())
679 {
680 LL_INFOS("AppInit") << "Using media plugins to render streaming audio" << LL_ENDL;
681 gAudiop->setStreamingAudioImpl(new LLStreamingAudio_MediaPlugins());
682 }
683 }
678 } 684 }
679 } 685 }
680 686
@@ -760,7 +766,7 @@ bool idle_startup()
760 std::string msg = LLTrans::getString("LoginInitializingBrowser"); 766 std::string msg = LLTrans::getString("LoginInitializingBrowser");
761 set_startup_status(0.03f, msg.c_str(), gAgent.mMOTD.c_str()); 767 set_startup_status(0.03f, msg.c_str(), gAgent.mMOTD.c_str());
762 display_startup(); 768 display_startup();
763 LLViewerMedia::initBrowser(); 769 // LLViewerMedia::initBrowser();
764 770
765 LLStartUp::setStartupState( STATE_LOGIN_SHOW ); 771 LLStartUp::setStartupState( STATE_LOGIN_SHOW );
766 return FALSE; 772 return FALSE;
@@ -2234,6 +2240,8 @@ bool idle_startup()
2234 LLStringUtil::truncate(gWindowTitle, 255); 2240 LLStringUtil::truncate(gWindowTitle, 255);
2235 gViewerWindow->getWindow()->setWindowTitle(gWindowTitle); 2241 gViewerWindow->getWindow()->setWindowTitle(gWindowTitle);
2236 } 2242 }
2243 // Inform simulator of our language preference
2244 LLAgentLanguage::update();
2237 2245
2238 // unpack thin inventory 2246 // unpack thin inventory
2239 LLUserAuth::options_t options; 2247 LLUserAuth::options_t options;
@@ -2553,9 +2561,6 @@ bool idle_startup()
2553 // JC - 7/20/2002 2561 // JC - 7/20/2002
2554 gViewerWindow->sendShapeToSim(); 2562 gViewerWindow->sendShapeToSim();
2555 2563
2556 // Inform simulator of our language preference
2557 LLAgentLanguage::update();
2558
2559 2564
2560 // Ignore stipend information for now. Money history is on the web site. 2565 // Ignore stipend information for now. Money history is on the web site.
2561 // if needed, show the L$ history window 2566 // if needed, show the L$ history window
@@ -3824,7 +3829,7 @@ void LLStartUp::multimediaInit()
3824 set_startup_status(0.42f, msg.c_str(), gAgent.mMOTD.c_str()); 3829 set_startup_status(0.42f, msg.c_str(), gAgent.mMOTD.c_str());
3825 display_startup(); 3830 display_startup();
3826 3831
3827 LLViewerMedia::initClass(); 3832 //LLViewerMedia::initClass();
3828 LLViewerParcelMedia::initClass(); 3833 LLViewerParcelMedia::initClass();
3829} 3834}
3830 3835
@@ -3833,7 +3838,7 @@ bool LLStartUp::dispatchURL()
3833 // ok, if we've gotten this far and have a startup URL 3838 // ok, if we've gotten this far and have a startup URL
3834 if (!sSLURLCommand.empty()) 3839 if (!sSLURLCommand.empty())
3835 { 3840 {
3836 LLWebBrowserCtrl* web = NULL; 3841 LLMediaCtrl* web = NULL;
3837 const bool trusted_browser = false; 3842 const bool trusted_browser = false;
3838 LLURLDispatcher::dispatch(sSLURLCommand, web, trusted_browser); 3843 LLURLDispatcher::dispatch(sSLURLCommand, web, trusted_browser);
3839 } 3844 }
@@ -3851,7 +3856,7 @@ bool LLStartUp::dispatchURL()
3851 || (dy*dy > SLOP*SLOP) ) 3856 || (dy*dy > SLOP*SLOP) )
3852 { 3857 {
3853 std::string url = LLURLSimString::getURL(); 3858 std::string url = LLURLSimString::getURL();
3854 LLWebBrowserCtrl* web = NULL; 3859 LLMediaCtrl* web = NULL;
3855 const bool trusted_browser = false; 3860 const bool trusted_browser = false;
3856 LLURLDispatcher::dispatch(url, web, trusted_browser); 3861 LLURLDispatcher::dispatch(url, web, trusted_browser);
3857 } 3862 }
diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp
index 366363b..d08d3da 100644
--- a/linden/indra/newview/llstatusbar.cpp
+++ b/linden/indra/newview/llstatusbar.cpp
@@ -857,7 +857,7 @@ class LLBalanceHandler : public LLCommandHandler
857public: 857public:
858 // Requires "trusted" browser/URL source 858 // Requires "trusted" browser/URL source
859 LLBalanceHandler() : LLCommandHandler("balance", true) { } 859 LLBalanceHandler() : LLCommandHandler("balance", true) { }
860 bool handle(const LLSD& tokens, const LLSD& query_map, LLWebBrowserCtrl* web) 860 bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
861 { 861 {
862 if (tokens.size() == 1 862 if (tokens.size() == 1
863 && tokens[0].asString() == "request") 863 && tokens[0].asString() == "request")
diff --git a/linden/indra/newview/lltoolcomp.cpp b/linden/indra/newview/lltoolcomp.cpp
index b6090bc..16e0136 100644
--- a/linden/indra/newview/lltoolcomp.cpp
+++ b/linden/indra/newview/lltoolcomp.cpp
@@ -766,10 +766,6 @@ void LLToolCompGun::onMouseCaptureLost()
766 return; 766 return;
767 } 767 }
768 mCur->onMouseCaptureLost(); 768 mCur->onMouseCaptureLost();
769
770 // JC - I don't know if this is necessary. Maybe we could lose capture
771 // if someone ALT-Tab's out when in mouselook.
772 setCurrentTool( (LLTool*) mGun );
773} 769}
774 770
775void LLToolCompGun::handleSelect() 771void LLToolCompGun::handleSelect()
diff --git a/linden/indra/newview/lltoolcomp.h b/linden/indra/newview/lltoolcomp.h
index b24ba25..81ed0ba 100644
--- a/linden/indra/newview/lltoolcomp.h
+++ b/linden/indra/newview/lltoolcomp.h
@@ -229,6 +229,7 @@ public:
229 virtual void onMouseCaptureLost(); 229 virtual void onMouseCaptureLost();
230 virtual void handleSelect(); 230 virtual void handleSelect();
231 virtual void handleDeselect(); 231 virtual void handleDeselect();
232 virtual LLTool* getOverrideTool(MASK mask) { return NULL; }
232 233
233protected: 234protected:
234 LLToolGun* mGun; 235 LLToolGun* mGun;
diff --git a/linden/indra/newview/lltoolgun.cpp b/linden/indra/newview/lltoolgun.cpp
index d21fd49..f7af018 100644
--- a/linden/indra/newview/lltoolgun.cpp
+++ b/linden/indra/newview/lltoolgun.cpp
@@ -49,7 +49,8 @@
49#include "lltoolgrab.h" 49#include "lltoolgrab.h"
50 50
51LLToolGun::LLToolGun( LLToolComposite* composite ) 51LLToolGun::LLToolGun( LLToolComposite* composite )
52: LLTool( std::string("gun"), composite ) 52: LLTool( std::string("gun"), composite ),
53 mIsSelected(FALSE)
53{ 54{
54} 55}
55 56
@@ -58,6 +59,7 @@ void LLToolGun::handleSelect()
58 gViewerWindow->hideCursor(); 59 gViewerWindow->hideCursor();
59 gViewerWindow->moveCursorToCenter(); 60 gViewerWindow->moveCursorToCenter();
60 gViewerWindow->mWindow->setMouseClipping(TRUE); 61 gViewerWindow->mWindow->setMouseClipping(TRUE);
62 mIsSelected = TRUE;
61} 63}
62 64
63void LLToolGun::handleDeselect() 65void LLToolGun::handleDeselect()
@@ -65,6 +67,7 @@ void LLToolGun::handleDeselect()
65 gViewerWindow->moveCursorToCenter(); 67 gViewerWindow->moveCursorToCenter();
66 gViewerWindow->showCursor(); 68 gViewerWindow->showCursor();
67 gViewerWindow->mWindow->setMouseClipping(FALSE); 69 gViewerWindow->mWindow->setMouseClipping(FALSE);
70 mIsSelected = FALSE;
68} 71}
69 72
70BOOL LLToolGun::handleMouseDown(S32 x, S32 y, MASK mask) 73BOOL LLToolGun::handleMouseDown(S32 x, S32 y, MASK mask)
@@ -77,7 +80,7 @@ BOOL LLToolGun::handleMouseDown(S32 x, S32 y, MASK mask)
77 80
78BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask) 81BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask)
79{ 82{
80 if( gAgent.cameraMouselook() ) 83 if( gAgent.cameraMouselook() && mIsSelected )
81 { 84 {
82 const F32 NOMINAL_MOUSE_SENSITIVITY = 0.0025f; 85 const F32 NOMINAL_MOUSE_SENSITIVITY = 0.0025f;
83 86
diff --git a/linden/indra/newview/lltoolgun.h b/linden/indra/newview/lltoolgun.h
index 4e945d7..4644e68 100644
--- a/linden/indra/newview/lltoolgun.h
+++ b/linden/indra/newview/lltoolgun.h
@@ -52,6 +52,8 @@ public:
52 52
53 virtual LLTool* getOverrideTool(MASK mask) { return NULL; } 53 virtual LLTool* getOverrideTool(MASK mask) { return NULL; }
54 virtual BOOL clipMouseWhenDown() { return FALSE; } 54 virtual BOOL clipMouseWhenDown() { return FALSE; }
55private:
56 BOOL mIsSelected;
55}; 57};
56 58
57#endif 59#endif
diff --git a/linden/indra/newview/lltoolmgr.cpp b/linden/indra/newview/lltoolmgr.cpp
index 3a776d1..8204374 100644
--- a/linden/indra/newview/lltoolmgr.cpp
+++ b/linden/indra/newview/lltoolmgr.cpp
@@ -281,22 +281,20 @@ void LLToolMgr::clearTransientTool()
281} 281}
282 282
283 283
284// The "gun tool", used for handling mouselook, captures the mouse and
285// locks it within the window. When the app loses focus we need to
286// release this locking.
287void LLToolMgr::onAppFocusLost() 284void LLToolMgr::onAppFocusLost()
288{ 285{
289 mSavedTool = mBaseTool; 286 if (mSelectedTool)
290 mBaseTool = gToolNull; 287 {
288 mSelectedTool->handleDeselect();
289 }
291 updateToolStatus(); 290 updateToolStatus();
292} 291}
293 292
294void LLToolMgr::onAppFocusGained() 293void LLToolMgr::onAppFocusGained()
295{ 294{
296 if (mSavedTool) 295 if (mSelectedTool)
297 { 296 {
298 mBaseTool = mSavedTool; 297 mSelectedTool->handleSelect();
299 mSavedTool = NULL;
300 } 298 }
301 updateToolStatus(); 299 updateToolStatus();
302} 300}
diff --git a/linden/indra/newview/lltoolmorph.cpp b/linden/indra/newview/lltoolmorph.cpp
index 75e1964..6e09efa 100644
--- a/linden/indra/newview/lltoolmorph.cpp
+++ b/linden/indra/newview/lltoolmorph.cpp
@@ -37,7 +37,7 @@
37#include "llrender.h" 37#include "llrender.h"
38 38
39// Library includes 39// Library includes
40#include "audioengine.h" 40#include "llaudioengine.h"
41#include "llviewercontrol.h" 41#include "llviewercontrol.h"
42#include "llfontgl.h" 42#include "llfontgl.h"
43#include "sound_ids.h" 43#include "sound_ids.h"
diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp
index 2b63a24..b121b1a 100644
--- a/linden/indra/newview/lltoolpie.cpp
+++ b/linden/indra/newview/lltoolpie.cpp
@@ -36,11 +36,11 @@
36 36
37#include "indra_constants.h" 37#include "indra_constants.h"
38#include "llclickaction.h" 38#include "llclickaction.h"
39#include "llmediabase.h" // for status codes
40#include "llparcel.h" 39#include "llparcel.h"
41 40
42#include "llagent.h" 41#include "llagent.h"
43#include "llviewercontrol.h" 42#include "llviewercontrol.h"
43#include "llfocusmgr.h"
44#include "llfirstuse.h" 44#include "llfirstuse.h"
45#include "llfloateravatarinfo.h" 45#include "llfloateravatarinfo.h"
46#include "llfloaterland.h" 46#include "llfloaterland.h"
@@ -63,6 +63,7 @@
63#include "llviewerparcelmgr.h" 63#include "llviewerparcelmgr.h"
64#include "llviewerwindow.h" 64#include "llviewerwindow.h"
65#include "llviewermedia.h" 65#include "llviewermedia.h"
66#include "llviewermediafocus.h"
66#include "llvoavatar.h" 67#include "llvoavatar.h"
67#include "llworld.h" 68#include "llworld.h"
68#include "llui.h" 69#include "llui.h"
@@ -72,13 +73,15 @@ extern void handle_buy(void*);
72 73
73extern BOOL gDebugClicks; 74extern BOOL gDebugClicks;
74 75
76static bool handle_media_click(const LLPickInfo& info);
77static bool handle_media_hover(const LLPickInfo& info);
75static void handle_click_action_play(); 78static void handle_click_action_play();
76static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp); 79static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp);
77static ECursorType cursor_from_parcel_media(U8 click_action); 80static ECursorType cursor_from_parcel_media(U8 click_action);
78 81
79 82
80LLToolPie::LLToolPie() 83LLToolPie::LLToolPie()
81: LLTool(std::string("Select")), 84: LLTool(std::string("Pie")),
82 mPieMouseButtonDown( FALSE ), 85 mPieMouseButtonDown( FALSE ),
83 mGrabMouseButtonDown( FALSE ), 86 mGrabMouseButtonDown( FALSE ),
84 mMouseOutsideSlop( FALSE ), 87 mMouseOutsideSlop( FALSE ),
@@ -110,6 +113,10 @@ BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask)
110 return FALSE; 113 return FALSE;
111} 114}
112 115
116BOOL LLToolPie::handleScrollWheel(S32 x, S32 y, S32 clicks)
117{
118 return LLViewerMediaFocus::getInstance()->handleScrollWheel(x, y, clicks);
119}
113// static 120// static
114void LLToolPie::rightMouseCallback(const LLPickInfo& pick_info) 121void LLToolPie::rightMouseCallback(const LLPickInfo& pick_info)
115{ 122{
@@ -143,6 +150,7 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
143 } 150 }
144 } 151 }
145 152
153 gFocusMgr.setKeyboardFocus(NULL);
146 return LLTool::handleMouseDown(x, y, mask); 154 return LLTool::handleMouseDown(x, y, mask);
147 } 155 }
148 156
@@ -161,9 +169,11 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
161 parent = object->getRootEdit(); 169 parent = object->getRootEdit();
162 } 170 }
163 171
172
164 BOOL touchable = (object && object->flagHandleTouch()) 173 BOOL touchable = (object && object->flagHandleTouch())
165 || (parent && parent->flagHandleTouch()); 174 || (parent && parent->flagHandleTouch());
166 175
176
167 // If it's a left-click, and we have a special action, do it. 177 // If it's a left-click, and we have a special action, do it.
168 if (useClickAction(always_show, mask, object, parent)) 178 if (useClickAction(always_show, mask, object, parent))
169 { 179 {
@@ -195,6 +205,8 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
195 if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting) && !gSavedSettings.getBOOL("BlockClickSit")) // agent not already sitting 205 if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting) && !gSavedSettings.getBOOL("BlockClickSit")) // agent not already sitting
196 { 206 {
197 handle_sit_or_stand(); 207 handle_sit_or_stand();
208 // put focus in world when sitting on an object
209 gFocusMgr.setKeyboardFocus(NULL);
198 return TRUE; 210 return TRUE;
199 } // else nothing (fall through to touch) 211 } // else nothing (fall through to touch)
200 212
@@ -247,6 +259,14 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
247 } 259 }
248 } 260 }
249 261
262 if (!always_show && handle_media_click(mPick))
263 {
264 return FALSE;
265 }
266
267 // put focus back "in world"
268 gFocusMgr.setKeyboardFocus(NULL);
269
250 // Switch to grab tool if physical or triggerable 270 // Switch to grab tool if physical or triggerable
251 if (object && 271 if (object &&
252 !object->isAvatar() && 272 !object->isAvatar() &&
@@ -614,41 +634,46 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
614 mMouseOutsideSlop = TRUE; 634 mMouseOutsideSlop = TRUE;
615 } 635 }
616 */ 636 */
637
617 638
639 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
640
618 LLViewerObject *object = NULL; 641 LLViewerObject *object = NULL;
619 LLViewerObject *parent = NULL; 642 LLViewerObject *parent = NULL;
620 if (gHoverView) 643 object = gViewerWindow->getHoverPick().getObject();
621 {
622 object = gViewerWindow->getHoverPick().getObject();
623 }
624 644
625 if (object) 645 if (object)
626 { 646 {
627 parent = object->getRootEdit(); 647 parent = object->getRootEdit();
628 }
629 648
630 if (object && useClickAction(FALSE, mask, object, parent)) 649 if (object && useClickAction(FALSE, mask, object, parent))
631 { 650 {
632 ECursorType cursor = cursor_from_object(object); 651 ECursorType cursor = cursor_from_object(object);
633 gViewerWindow->getWindow()->setCursor(cursor); 652 gViewerWindow->getWindow()->setCursor(cursor);
634 lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; 653 }
635 } 654 else if (handle_media_hover(gViewerWindow->getHoverPick()))
636 else if ((object && !object->isAvatar() && object->usePhysics()) 655 {
637 || (parent && !parent->isAvatar() && parent->usePhysics())) 656 // cursor set by media object
638 { 657 }
639 gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLGRAB); 658 else if ((object && !object->isAvatar() && object->usePhysics())
640 lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; 659 || (parent && !parent->isAvatar() && parent->usePhysics()))
641 } 660 {
642 else if ( (object && object->flagHandleTouch()) 661 gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLGRAB);
643 || (parent && parent->flagHandleTouch())) 662 }
644 { 663 else if ( (object && object->flagHandleTouch())
645 gViewerWindow->getWindow()->setCursor(UI_CURSOR_HAND); 664 || (parent && parent->flagHandleTouch()))
646 lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; 665 {
666 gViewerWindow->getWindow()->setCursor(UI_CURSOR_HAND);
667 }
647 } 668 }
648 else 669 else
649 { 670 {
650 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 671 // We need to clear media hover flag
651 lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; 672 if (LLViewerMediaFocus::getInstance()->getMouseOverFlag())
673 {
674 LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
675 }
676
652 } 677 }
653 678
654 return TRUE; 679 return TRUE;
@@ -830,14 +855,14 @@ static void handle_click_action_play()
830 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 855 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
831 if (!parcel) return; 856 if (!parcel) return;
832 857
833 LLMediaBase::EStatus status = LLViewerParcelMedia::getStatus(); 858 LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus();
834 switch(status) 859 switch(status)
835 { 860 {
836 case LLMediaBase::STATUS_STARTED: 861 case LLViewerMediaImpl::MEDIA_PLAYING:
837 LLViewerParcelMedia::pause(); 862 LLViewerParcelMedia::pause();
838 break; 863 break;
839 864
840 case LLMediaBase::STATUS_PAUSED: 865 case LLViewerMediaImpl::MEDIA_PAUSED:
841 LLViewerParcelMedia::start(); 866 LLViewerParcelMedia::start();
842 break; 867 break;
843 868
@@ -847,6 +872,111 @@ static void handle_click_action_play()
847 } 872 }
848} 873}
849 874
875static bool handle_media_click(const LLPickInfo& pick)
876{
877 //FIXME: how do we handle object in different parcel than us?
878 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
879 LLPointer<LLViewerObject> objectp = pick.getObject();
880
881
882 if (!parcel ||
883 objectp.isNull() ||
884 pick.mObjectFace < 0 ||
885 pick.mObjectFace >= objectp->getNumTEs())
886 {
887 LLSelectMgr::getInstance()->deselect();
888 LLViewerMediaFocus::getInstance()->clearFocus();
889
890 return false;
891 }
892
893
894
895 // HACK: This is directly referencing an impl name. BAD!
896 // This can be removed when we have a truly generic media browser that only
897 // builds an impl based on the type of url it is passed.
898
899 // is media playing on this face?
900 const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
901
902 viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(tep->getID());
903 if (tep
904 && media_impl.notNull()
905 && media_impl->hasMedia()
906 && gSavedSettings.getBOOL("MediaOnAPrimUI"))
907 {
908 LLObjectSelectionHandle selection = LLViewerMediaFocus::getInstance()->getSelection();
909 if (! selection->contains(pick.getObject(), pick.mObjectFace))
910 {
911 LLViewerMediaFocus::getInstance()->setFocusFace(TRUE, pick.getObject(), pick.mObjectFace, media_impl);
912 }
913 else
914 {
915 media_impl->mouseDown(pick.mXYCoords.mX, pick.mXYCoords.mY);
916 media_impl->mouseCapture(); // the mouse-up will happen when capture is lost
917 }
918
919 return true;
920 }
921
922 LLSelectMgr::getInstance()->deselect();
923 LLViewerMediaFocus::getInstance()->clearFocus();
924
925 return false;
926}
927
928static bool handle_media_hover(const LLPickInfo& pick)
929{
930 //FIXME: how do we handle object in different parcel than us?
931 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
932 if (!parcel) return false;
933
934 LLPointer<LLViewerObject> objectp = pick.getObject();
935
936 // Early out cases. Must clear mouse over media focus flag
937 // did not hit an object or did not hit a valid face
938 if ( objectp.isNull() ||
939 pick.mObjectFace < 0 ||
940 pick.mObjectFace >= objectp->getNumTEs() )
941 {
942 LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
943 return false;
944 }
945
946
947 // HACK: This is directly referencing an impl name. BAD!
948 // This can be removed when we have a truly generic media browser that only
949 // builds an impl based on the type of url it is passed.
950
951 // is media playing on this face?
952 const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
953 viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(tep->getID());
954 if (tep
955 && media_impl.notNull()
956 && media_impl->hasMedia()
957 && gSavedSettings.getBOOL("MediaOnAPrimUI"))
958 {
959 if(LLViewerMediaFocus::getInstance()->getFocus())
960 {
961 media_impl->mouseMove(pick.mXYCoords.mX, pick.mXYCoords.mY);
962 }
963
964 // Set mouse over flag if unset
965 if (! LLViewerMediaFocus::getInstance()->getMouseOverFlag())
966 {
967 LLSelectMgr::getInstance()->setHoverObject(objectp, pick.mObjectFace);
968 LLViewerMediaFocus::getInstance()->setMouseOverFlag(true, media_impl);
969 LLViewerMediaFocus::getInstance()->setPickInfo(pick);
970 }
971
972 return true;
973 }
974 LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
975
976 return false;
977}
978
979
850static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp) 980static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp)
851{ 981{
852 //FIXME: how do we handle object in different parcel than us? 982 //FIXME: how do we handle object in different parcel than us?
@@ -861,7 +991,7 @@ static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp)
861 if( face < 0 || face >= objectp->getNumTEs() ) return; 991 if( face < 0 || face >= objectp->getNumTEs() ) return;
862 992
863 // is media playing on this face? 993 // is media playing on this face?
864 if (!LLViewerMedia::isActiveMediaTexture(objectp->getTE(face)->getID())) 994 if (LLViewerMedia::getMediaImplFromTextureID(objectp->getTE(face)->getID()) != NULL)
865 { 995 {
866 handle_click_action_play(); 996 handle_click_action_play();
867 return; 997 return;
@@ -879,10 +1009,7 @@ static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp)
879 // This can be removed when we have a truly generic media browser that only 1009 // This can be removed when we have a truly generic media browser that only
880 // builds an impl based on the type of url it is passed. 1010 // builds an impl based on the type of url it is passed.
881 1011
882 if( LLMediaManager::getInstance()->supportsMediaType( "LLMediaImplLLMozLib", media_scheme, media_type ) ) 1012 LLWeb::loadURL(media_url);
883 {
884 LLWeb::loadURL(media_url);
885 }
886} 1013}
887 1014
888static ECursorType cursor_from_parcel_media(U8 click_action) 1015static ECursorType cursor_from_parcel_media(U8 click_action)
@@ -900,19 +1027,12 @@ static ECursorType cursor_from_parcel_media(U8 click_action)
900 std::string media_type = std::string ( parcel->getMediaType() ); 1027 std::string media_type = std::string ( parcel->getMediaType() );
901 LLStringUtil::trim(media_url); 1028 LLStringUtil::trim(media_url);
902 1029
903 // Get the scheme, see if that is handled as well. 1030 open_cursor = UI_CURSOR_TOOLMEDIAOPEN;
904 LLURI uri(media_url);
905 std::string media_scheme = uri.scheme() != "" ? uri.scheme() : "http";
906
907 if( LLMediaManager::getInstance()->supportsMediaType( "LLMediaImplLLMozLib", media_scheme, media_type ) )
908 {
909 open_cursor = UI_CURSOR_TOOLMEDIAOPEN;
910 }
911 1031
912 LLMediaBase::EStatus status = LLViewerParcelMedia::getStatus(); 1032 LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus();
913 switch(status) 1033 switch(status)
914 { 1034 {
915 case LLMediaBase::STATUS_STARTED: 1035 case LLViewerMediaImpl::MEDIA_PLAYING:
916 return click_action == CLICK_ACTION_PLAY ? UI_CURSOR_TOOLPAUSE : open_cursor; 1036 return click_action == CLICK_ACTION_PLAY ? UI_CURSOR_TOOLPAUSE : open_cursor;
917 default: 1037 default:
918 return UI_CURSOR_TOOLPLAY; 1038 return UI_CURSOR_TOOLPLAY;
diff --git a/linden/indra/newview/lltoolpie.h b/linden/indra/newview/lltoolpie.h
index 113fba7..001886f 100644
--- a/linden/indra/newview/lltoolpie.h
+++ b/linden/indra/newview/lltoolpie.h
@@ -51,6 +51,7 @@ public:
51 virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); 51 virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
52 virtual BOOL handleHover(S32 x, S32 y, MASK mask); 52 virtual BOOL handleHover(S32 x, S32 y, MASK mask);
53 virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); 53 virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
54 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
54 55
55 virtual void render(); 56 virtual void render();
56 57
diff --git a/linden/indra/newview/lltoolplacer.cpp b/linden/indra/newview/lltoolplacer.cpp
index d5c4de1..c031a18 100644
--- a/linden/indra/newview/lltoolplacer.cpp
+++ b/linden/indra/newview/lltoolplacer.cpp
@@ -59,7 +59,7 @@
59#include "llvolumemessage.h" 59#include "llvolumemessage.h"
60#include "llhudmanager.h" 60#include "llhudmanager.h"
61#include "llagent.h" 61#include "llagent.h"
62#include "audioengine.h" 62#include "llaudioengine.h"
63#include "llhudeffecttrail.h" 63#include "llhudeffecttrail.h"
64#include "llviewerobjectlist.h" 64#include "llviewerobjectlist.h"
65#include "llviewercamera.h" 65#include "llviewercamera.h"
diff --git a/linden/indra/newview/llurldispatcher.cpp b/linden/indra/newview/llurldispatcher.cpp
index f9b6b39..1144c58 100644
--- a/linden/indra/newview/llurldispatcher.cpp
+++ b/linden/indra/newview/llurldispatcher.cpp
@@ -39,7 +39,7 @@
39#include "llfloaterurldisplay.h" 39#include "llfloaterurldisplay.h"
40#include "llfloaterdirectory.h" 40#include "llfloaterdirectory.h"
41#include "llfloaterworldmap.h" 41#include "llfloaterworldmap.h"
42#include "llfloaterhtmlhelp.h" 42#include "llfloatermediabrowser.h"
43#include "llpanellogin.h" 43#include "llpanellogin.h"
44#include "llstartup.h" // gStartupState 44#include "llstartup.h" // gStartupState
45#include "llurlsimstring.h" 45#include "llurlsimstring.h"
@@ -65,7 +65,7 @@ public:
65 static bool isSLURLCommand(const std::string& url); 65 static bool isSLURLCommand(const std::string& url);
66 66
67 static bool dispatch(const std::string& url, 67 static bool dispatch(const std::string& url,
68 LLWebBrowserCtrl* web, 68 LLMediaCtrl* web,
69 bool trusted_browser); 69 bool trusted_browser);
70 // returns true if handled or explicitly blocked. 70 // returns true if handled or explicitly blocked.
71 71
@@ -74,7 +74,7 @@ public:
74private: 74private:
75 static bool dispatchCore(const std::string& url, 75 static bool dispatchCore(const std::string& url,
76 bool right_mouse, 76 bool right_mouse,
77 LLWebBrowserCtrl* web, 77 LLMediaCtrl* web,
78 bool trusted_browser); 78 bool trusted_browser);
79 // handles both left and right click 79 // handles both left and right click
80 80
@@ -84,7 +84,7 @@ private:
84 84
85 static bool dispatchApp(const std::string& url, 85 static bool dispatchApp(const std::string& url,
86 bool right_mouse, 86 bool right_mouse,
87 LLWebBrowserCtrl* web, 87 LLMediaCtrl* web,
88 bool trusted_browser); 88 bool trusted_browser);
89 // Handles secondlife:///app/agent/<agent_id>/about and similar 89 // Handles secondlife:///app/agent/<agent_id>/about and similar
90 // by showing panel in Search floater. 90 // by showing panel in Search floater.
@@ -138,7 +138,7 @@ bool LLURLDispatcherImpl::isSLURLCommand(const std::string& url)
138// static 138// static
139bool LLURLDispatcherImpl::dispatchCore(const std::string& url, 139bool LLURLDispatcherImpl::dispatchCore(const std::string& url,
140 bool right_mouse, 140 bool right_mouse,
141 LLWebBrowserCtrl* web, 141 LLMediaCtrl* web,
142 bool trusted_browser) 142 bool trusted_browser)
143{ 143{
144 if (url.empty()) return false; 144 if (url.empty()) return false;
@@ -158,7 +158,7 @@ bool LLURLDispatcherImpl::dispatchCore(const std::string& url,
158 158
159// static 159// static
160bool LLURLDispatcherImpl::dispatch(const std::string& url, 160bool LLURLDispatcherImpl::dispatch(const std::string& url,
161 LLWebBrowserCtrl* web, 161 LLMediaCtrl* web,
162 bool trusted_browser) 162 bool trusted_browser)
163{ 163{
164 llinfos << "url: " << url << llendl; 164 llinfos << "url: " << url << llendl;
@@ -171,7 +171,7 @@ bool LLURLDispatcherImpl::dispatchRightClick(const std::string& url)
171{ 171{
172 llinfos << "url: " << url << llendl; 172 llinfos << "url: " << url << llendl;
173 const bool right_click = true; 173 const bool right_click = true;
174 LLWebBrowserCtrl* web = NULL; 174 LLMediaCtrl* web = NULL;
175 const bool trusted_browser = false; 175 const bool trusted_browser = false;
176 return dispatchCore(url, right_click, web, trusted_browser); 176 return dispatchCore(url, right_click, web, trusted_browser);
177} 177}
@@ -192,7 +192,7 @@ bool LLURLDispatcherImpl::dispatchHelp(const std::string& url, bool right_mouse)
192// static 192// static
193bool LLURLDispatcherImpl::dispatchApp(const std::string& url, 193bool LLURLDispatcherImpl::dispatchApp(const std::string& url,
194 bool right_mouse, 194 bool right_mouse,
195 LLWebBrowserCtrl* web, 195 LLMediaCtrl* web,
196 bool trusted_browser) 196 bool trusted_browser)
197{ 197{
198 if (!isSLURL(url)) 198 if (!isSLURL(url))
@@ -386,7 +386,7 @@ public:
386 LLTeleportHandler() : LLCommandHandler("teleport", true) { } 386 LLTeleportHandler() : LLCommandHandler("teleport", true) { }
387 387
388 bool handle(const LLSD& tokens, const LLSD& query_map, 388 bool handle(const LLSD& tokens, const LLSD& query_map,
389 LLWebBrowserCtrl* web) 389 LLMediaCtrl* web)
390 { 390 {
391 // construct a "normal" SLURL, resolve the region to 391 // construct a "normal" SLURL, resolve the region to
392 // a global position, and teleport to it 392 // a global position, and teleport to it
@@ -426,7 +426,7 @@ bool LLURLDispatcher::isSLURLCommand(const std::string& url)
426 426
427// static 427// static
428bool LLURLDispatcher::dispatch(const std::string& url, 428bool LLURLDispatcher::dispatch(const std::string& url,
429 LLWebBrowserCtrl* web, 429 LLMediaCtrl* web,
430 bool trusted_browser) 430 bool trusted_browser)
431{ 431{
432 return LLURLDispatcherImpl::dispatch(url, web, trusted_browser); 432 return LLURLDispatcherImpl::dispatch(url, web, trusted_browser);
@@ -448,7 +448,7 @@ bool LLURLDispatcher::dispatchFromTextEditor(const std::string& url)
448 // click on it. 448 // click on it.
449 // *TODO: Make this trust model more refined. JC 449 // *TODO: Make this trust model more refined. JC
450 const bool trusted_browser = true; 450 const bool trusted_browser = true;
451 LLWebBrowserCtrl* web = NULL; 451 LLMediaCtrl* web = NULL;
452 return LLURLDispatcherImpl::dispatch(url, web, trusted_browser); 452 return LLURLDispatcherImpl::dispatch(url, web, trusted_browser);
453} 453}
454 454
diff --git a/linden/indra/newview/llurldispatcher.h b/linden/indra/newview/llurldispatcher.h
index a4f6866..c947e5e 100644
--- a/linden/indra/newview/llurldispatcher.h
+++ b/linden/indra/newview/llurldispatcher.h
@@ -32,7 +32,7 @@
32#ifndef LLURLDISPATCHER_H 32#ifndef LLURLDISPATCHER_H
33#define LLURLDISPATCHER_H 33#define LLURLDISPATCHER_H
34 34
35class LLWebBrowserCtrl; 35class LLMediaCtrl;
36 36
37 37
38class LLURLDispatcher 38class LLURLDispatcher
@@ -45,7 +45,7 @@ public:
45 // Is this a special secondlife://app/ URL? 45 // Is this a special secondlife://app/ URL?
46 46
47 static bool dispatch(const std::string& url, 47 static bool dispatch(const std::string& url,
48 LLWebBrowserCtrl* web, 48 LLMediaCtrl* web,
49 bool trusted_browser); 49 bool trusted_browser);
50 // At startup time and on clicks in internal web browsers, 50 // At startup time and on clicks in internal web browsers,
51 // teleport, open map, or run requested command. 51 // teleport, open map, or run requested command.
@@ -54,7 +54,7 @@ public:
54 // secondlife:///app/agent/3d6181b0-6a4b-97ef-18d8-722652995cf1/show 54 // secondlife:///app/agent/3d6181b0-6a4b-97ef-18d8-722652995cf1/show
55 // sl://app/foo/bar 55 // sl://app/foo/bar
56 // @param web 56 // @param web
57 // Pointer to LLWebBrowserCtrl sending URL, can be NULL 57 // Pointer to LLMediaCtrl sending URL, can be NULL
58 // @param trusted_browser 58 // @param trusted_browser
59 // True if coming inside the app AND from a brower instance 59 // True if coming inside the app AND from a brower instance
60 // that navigates to trusted (Linden Lab) pages. 60 // that navigates to trusted (Linden Lab) pages.
diff --git a/linden/indra/newview/llvieweraudio.cpp b/linden/indra/newview/llvieweraudio.cpp
index f043fb5..74b8e8f 100644
--- a/linden/indra/newview/llvieweraudio.cpp
+++ b/linden/indra/newview/llvieweraudio.cpp
@@ -32,7 +32,7 @@
32 32
33#include "llviewerprecompiledheaders.h" 33#include "llviewerprecompiledheaders.h"
34 34
35#include "audioengine.h" 35#include "llaudioengine.h"
36#include "llagent.h" 36#include "llagent.h"
37#include "llappviewer.h" 37#include "llappviewer.h"
38#include "llvieweraudio.h" 38#include "llvieweraudio.h"
@@ -130,7 +130,6 @@ void audio_update_volume(bool force_update)
130 gAudiop->setMasterGain ( master_volume ); 130 gAudiop->setMasterGain ( master_volume );
131 131
132 gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); 132 gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler"));
133 gAudiop->setDistanceFactor(gSavedSettings.getF32("AudioLevelDistance"));
134 gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); 133 gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff"));
135 134
136 if(wind_muted == false) 135 if(wind_muted == false)
diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp
index 50224ad..1531e6c 100644
--- a/linden/indra/newview/llviewercontrol.cpp
+++ b/linden/indra/newview/llviewercontrol.cpp
@@ -38,7 +38,7 @@
38#include "indra_constants.h" 38#include "indra_constants.h"
39 39
40// For Listeners 40// For Listeners
41#include "audioengine.h" 41#include "llaudioengine.h"
42#include "llagent.h" 42#include "llagent.h"
43#include "llconsole.h" 43#include "llconsole.h"
44#include "lldrawpoolterrain.h" 44#include "lldrawpoolterrain.h"
@@ -69,7 +69,6 @@
69#include "llvosurfacepatch.h" 69#include "llvosurfacepatch.h"
70#include "llvowlsky.h" 70#include "llvowlsky.h"
71#include "llrender.h" 71#include "llrender.h"
72#include "llmediamanager.h"
73#include "llslider.h" 72#include "llslider.h"
74#include "llfloaterchat.h" 73#include "llfloaterchat.h"
75 74
@@ -498,21 +497,6 @@ bool handleTranslateChatPrefsChanged(const LLSD& newvalue)
498 return true; 497 return true;
499} 498}
500 499
501bool handleMediaDebugLevelChanged(const LLSD& newvalue)
502{
503 LLMediaManager *mgr = LLMediaManager::getInstance();
504 if (mgr)
505 {
506 LLMediaBase *impl =
507 mgr->createSourceFromMimeType("http", "audio/mpeg");
508
509 if (impl)
510 {
511 impl->setDebugLevel( (LLMediaBase::EDebugLevel)newvalue.asInteger() );
512 }
513 }
514 return true;
515}
516 500
517bool handleSliderScrollWheelMultiplierChanged(const LLSD& newvalue) 501bool handleSliderScrollWheelMultiplierChanged(const LLSD& newvalue)
518{ 502{
@@ -674,7 +658,6 @@ void settings_setup_listeners()
674 gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); 658 gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
675 gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); 659 gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
676 gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); 660 gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
677 gSavedSettings.getControl("MediaDebugLevel")->getSignal()->connect(boost::bind(&handleMediaDebugLevelChanged, _1));
678 gSavedSettings.getControl("SliderScrollWheelMultiplier")->getSignal()->connect(boost::bind(&handleSliderScrollWheelMultiplierChanged, _1)); 661 gSavedSettings.getControl("SliderScrollWheelMultiplier")->getSignal()->connect(boost::bind(&handleSliderScrollWheelMultiplierChanged, _1));
679 gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1)); 662 gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1));
680 663
diff --git a/linden/indra/newview/llviewergesture.cpp b/linden/indra/newview/llviewergesture.cpp
index 01b3c58..7799c99 100644
--- a/linden/indra/newview/llviewergesture.cpp
+++ b/linden/indra/newview/llviewergesture.cpp
@@ -34,7 +34,7 @@
34 34
35#include "llviewergesture.h" 35#include "llviewergesture.h"
36 36
37#include "audioengine.h" 37#include "llaudioengine.h"
38#include "lldir.h" 38#include "lldir.h"
39#include "llviewerinventory.h" 39#include "llviewerinventory.h"
40#include "sound_ids.h" // for testing 40#include "sound_ids.h" // for testing
diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp
index 703d233..29c630b 100644
--- a/linden/indra/newview/llviewerimagelist.cpp
+++ b/linden/indra/newview/llviewerimagelist.cpp
@@ -593,7 +593,7 @@ void LLViewerImageList::updateImages(F32 max_time)
593 llpushcallstacks ; 593 llpushcallstacks ;
594 if (!gNoRender && !gGLManager.mIsDisabled) 594 if (!gNoRender && !gGLManager.mIsDisabled)
595 { 595 {
596 LLViewerMedia::updateImagesMediaStreams(); 596 LLViewerMedia::updateMedia();
597 } 597 }
598 llpushcallstacks ; 598 llpushcallstacks ;
599 updateImagesUpdateStats(); 599 updateImagesUpdateStats();
diff --git a/linden/indra/newview/llviewerkeyboard.cpp b/linden/indra/newview/llviewerkeyboard.cpp
index 15c8148..6dd7fb5 100644
--- a/linden/indra/newview/llviewerkeyboard.cpp
+++ b/linden/indra/newview/llviewerkeyboard.cpp
@@ -506,7 +506,7 @@ void start_chat( EKeystate s )
506void start_gesture( EKeystate s ) 506void start_gesture( EKeystate s )
507{ 507{
508 if (KEYSTATE_UP == s && 508 if (KEYSTATE_UP == s &&
509 !(gFocusMgr.getKeyboardFocus() && gFocusMgr.getKeyboardFocus()->acceptsTextInput())) 509 !(gFocusMgr.getKeyboardFocus() && dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus())->acceptsTextInput()))
510 { 510 {
511 if (gChatBar->getCurrentChat().empty()) 511 if (gChatBar->getCurrentChat().empty())
512 { 512 {
diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp
index 6bcf8ce..92ccf25 100644
--- a/linden/indra/newview/llviewermedia.cpp
+++ b/linden/indra/newview/llviewermedia.cpp
@@ -33,687 +33,1137 @@
33#include "llviewerprecompiledheaders.h" 33#include "llviewerprecompiledheaders.h"
34 34
35#include "llviewermedia.h" 35#include "llviewermedia.h"
36 36#include "llviewermediafocus.h"
37#include "llhoverview.h"
37#include "llmimetypes.h" 38#include "llmimetypes.h"
38#include "llviewercontrol.h" 39#include "llviewercontrol.h"
39#include "llviewerimage.h" 40#include "llviewerimage.h"
40#include "llviewerwindow.h" 41#include "llviewerwindow.h"
41#include "llviewerimagelist.h" 42#include "llviewerimagelist.h"
42#include "viewerversion.h" 43
44#include "llpluginclassmedia.h"
43 45
44#include "llevent.h" // LLSimpleListener 46#include "llevent.h" // LLSimpleListener
45#include "llmediamanager.h"
46#include "lluuid.h" 47#include "lluuid.h"
48#include "llkeyboard.h"
47 49
48#include <boost/bind.hpp> // for SkinFolder listener
49#include <boost/signal.hpp>
50 50
51// Merov: Temporary definitions while porting the new viewer media code to Snowglobe
52const int LEFT_BUTTON = 0;
53const int RIGHT_BUTTON = 1;
51 54
52// Implementation functions not exported into header file 55// Move this to its own file.
53class LLViewerMediaImpl 56
54 : public LLMediaObserver 57LLViewerMediaEventEmitter::~LLViewerMediaEventEmitter()
55{ 58{
56 public: 59 observerListType::iterator iter = mObservers.begin();
57 LLViewerMediaImpl()
58 : mMediaSource( NULL ),
59 mMovieImageID(),
60 mMovieImageHasMips(false)
61 { }
62
63 void destroyMediaSource();
64
65 void play(const std::string& media_url,
66 const std::string& mime_type,
67 const LLUUID& placeholder_texture_id,
68 S32 media_width, S32 media_height, U8 media_auto_scale,
69 U8 media_loop);
70
71 void stop();
72 void pause();
73 void start();
74 void seek(F32 time);
75 void setVolume(F32 volume);
76 LLMediaBase::EStatus getStatus();
77
78 /*virtual*/ void onMediaSizeChange(const EventType& event_in);
79 /*virtual*/ void onMediaContentsChange(const EventType& event_in);
80
81 void updateMovieImage(const LLUUID& image_id, BOOL active);
82 void updateImagesMediaStreams();
83 LLUUID getMediaTextureID();
84
85 // Internally set our desired browser user agent string, including
86 // the Second Life version and skin name. Used because we can
87 // switch skins without restarting the app.
88 static void updateBrowserUserAgent();
89
90 // Callback for when the SkinCurrent control is changed to
91 // switch the user agent string to indicate the new skin.
92 static bool handleSkinCurrentChanged(const LLSD& newvalue);
93 60
94 public: 61 while( iter != mObservers.end() )
62 {
63 LLViewerMediaObserver *self = *iter;
64 iter++;
65 remObserver(self);
66 }
67}
95 68
96 // a single media url with some data and an impl. 69///////////////////////////////////////////////////////////////////////////////
97 LLMediaBase* mMediaSource; 70//
98 LLUUID mMovieImageID; 71bool LLViewerMediaEventEmitter::addObserver( LLViewerMediaObserver* observer )
99 bool mMovieImageHasMips; 72{
100 std::string mMediaURL; 73 if ( ! observer )
101 std::string mMimeType; 74 return false;
102 private:
103 void initializePlaceholderImage(LLViewerImage *placeholder_image, LLMediaBase *media_source);
104};
105 75
106static LLViewerMediaImpl sViewerMediaImpl; 76 if ( std::find( mObservers.begin(), mObservers.end(), observer ) != mObservers.end() )
77 return false;
107 78
108////////////////////////////////////////////////////////////////////////////////////////// 79 mObservers.push_back( observer );
80 observer->mEmitters.push_back( this );
109 81
110void LLViewerMediaImpl::destroyMediaSource() 82 return true;
83}
84
85///////////////////////////////////////////////////////////////////////////////
86//
87bool LLViewerMediaEventEmitter::remObserver( LLViewerMediaObserver* observer )
88{
89 if ( ! observer )
90 return false;
91
92 mObservers.remove( observer );
93 observer->mEmitters.remove(this);
94
95 return true;
96}
97
98///////////////////////////////////////////////////////////////////////////////
99//
100void LLViewerMediaEventEmitter::emitEvent( LLPluginClassMedia* media, LLPluginClassMediaOwner::EMediaEvent event )
111{ 101{
112 LLMediaManager* mgr = LLMediaManager::getInstance(); 102 observerListType::iterator iter = mObservers.begin();
113 if ( mMediaSource ) 103
104 while( iter != mObservers.end() )
114 { 105 {
115 bool was_playing = LLViewerMedia::isMediaPlaying(); 106 LLViewerMediaObserver *self = *iter;
116 mMediaSource->remObserver(this); 107 ++iter;
117 mgr->destroySource( mMediaSource ); 108 self->handleMediaEvent( media, event );
109 }
110}
118 111
119 // Restore the texture 112// Move this to its own file.
120 updateMovieImage(LLUUID::null, was_playing); 113LLViewerMediaObserver::~LLViewerMediaObserver()
114{
115 std::list<LLViewerMediaEventEmitter *>::iterator iter = mEmitters.begin();
121 116
117 while( iter != mEmitters.end() )
118 {
119 LLViewerMediaEventEmitter *self = *iter;
120 iter++;
121 self->remObserver( this );
122 } 122 }
123 mMediaSource = NULL;
124} 123}
125 124
126void LLViewerMediaImpl::play(const std::string& media_url, 125
127 const std::string& mime_type, 126// Move this to its own file.
128 const LLUUID& placeholder_texture_id, 127// helper class that tries to download a URL from a web site and calls a method
129 S32 media_width, S32 media_height, U8 media_auto_scale, 128// on the Panel Land Media and to discover the MIME type
130 U8 media_loop) 129class LLMimeDiscoveryResponder : public LLHTTPClient::Responder
131{ 130{
132 // first stop any previously playing media 131LOG_CLASS(LLMimeDiscoveryResponder);
133 stop(); 132public:
133 LLMimeDiscoveryResponder( viewer_media_t media_impl)
134 : mMediaImpl(media_impl),
135 mInitialized(false)
136 {}
137
134 138
135 // Save this first, as init/load below may fire events
136 mMovieImageID = placeholder_texture_id;
137 139
138 // If the mime_type passed in is different than the cached one, and 140 virtual void completedHeader(U32 status, const std::string& reason, const LLSD& content)
139 // Auto-discovery is turned OFF, replace the cached mime_type with the new one.
140 if(mime_type != mMimeType &&
141 ! gSavedSettings.getBOOL("AutoMimeDiscovery"))
142 { 141 {
143 mMimeType = mime_type; 142 std::string media_type = content["content-type"].asString();
143 std::string::size_type idx1 = media_type.find_first_of(";");
144 std::string mime_type = media_type.substr(0, idx1);
145 completeAny(status, mime_type);
144 } 146 }
145 LLURI url(media_url);
146 std::string scheme = url.scheme() != "" ? url.scheme() : "http";
147 147
148 LLMediaManager* mgr = LLMediaManager::getInstance(); 148 virtual void error( U32 status, const std::string& reason )
149 mMediaSource = mgr->createSourceFromMimeType(scheme, mMimeType );
150 if ( !mMediaSource )
151 { 149 {
152 if (mMimeType != "none/none") 150 // completeAny(status, "none/none");
151 }
152
153 void completeAny(U32 status, const std::string& mime_type)
154 {
155 if(!mInitialized && ! mime_type.empty())
153 { 156 {
154 llwarns << "media source create failed " << media_url 157 if (mMediaImpl->initializeMedia(mime_type))
155 << " type " << mMimeType 158 {
156 << llendl; 159 mInitialized = true;
160 mMediaImpl->play();
161 }
157 } 162 }
158 return;
159 } 163 }
160 164
161 // Store the URL and Mime Type 165 public:
162 mMediaURL = media_url; 166 viewer_media_t mMediaImpl;
167 bool mInitialized;
168};
169typedef std::list<LLViewerMediaImpl*> impl_list;
170static impl_list sViewerMediaImplList;
171
172//////////////////////////////////////////////////////////////////////////////////////////
173// LLViewerMedia
163 174
164 if ((media_width != 0) && (media_height != 0)) 175//////////////////////////////////////////////////////////////////////////////////////////
176// static
177viewer_media_t LLViewerMedia::newMediaImpl(const std::string& media_url,
178 const LLUUID& texture_id,
179 S32 media_width, S32 media_height, U8 media_auto_scale,
180 U8 media_loop,
181 std::string mime_type)
182{
183 LLViewerMediaImpl* media_impl = getMediaImplFromTextureID(texture_id);
184 if(media_impl == NULL || texture_id.isNull())
165 { 185 {
166 mMediaSource->setRequestedMediaSize(media_width, media_height); 186 // Create the media impl
187 media_impl = new LLViewerMediaImpl(media_url, texture_id, media_width, media_height, media_auto_scale, media_loop, mime_type);
188 sViewerMediaImplList.push_back(media_impl);
167 } 189 }
168 190 else
169 mMediaSource->setLooping(media_loop); 191 {
170 mMediaSource->setAutoScaled(media_auto_scale); 192 media_impl->stop();
171 mMediaSource->addObserver( this ); 193 media_impl->mTextureId = texture_id;
172 mMediaSource->navigateTo( media_url ); 194 media_impl->mMediaURL = media_url;
173 mMediaSource->addCommand(LLMediaBase::COMMAND_START); 195 media_impl->mMediaWidth = media_width;
196 media_impl->mMediaHeight = media_height;
197 media_impl->mMediaAutoScale = media_auto_scale;
198 media_impl->mMediaLoop = media_loop;
199 if(! media_url.empty())
200 media_impl->navigateTo(media_url, mime_type, true);
201 }
202 return media_impl;
174} 203}
175 204
176void LLViewerMediaImpl::stop() 205//////////////////////////////////////////////////////////////////////////////////////////
206// static
207void LLViewerMedia::removeMedia(LLViewerMediaImpl* media)
177{ 208{
178 destroyMediaSource(); 209 impl_list::iterator iter = sViewerMediaImplList.begin();
210 impl_list::iterator end = sViewerMediaImplList.end();
211
212 for(; iter != end; iter++)
213 {
214 if(media == *iter)
215 {
216 sViewerMediaImplList.erase(iter);
217 return;
218 }
219 }
179} 220}
180 221
181void LLViewerMediaImpl::pause() 222//////////////////////////////////////////////////////////////////////////////////////////
223// static
224LLViewerMediaImpl* LLViewerMedia::getMediaImplFromTextureID(const LLUUID& texture_id)
182{ 225{
183 if(mMediaSource) 226 impl_list::iterator iter = sViewerMediaImplList.begin();
227 impl_list::iterator end = sViewerMediaImplList.end();
228
229 for(; iter != end; iter++)
184 { 230 {
185 mMediaSource->addCommand(LLMediaBase::COMMAND_PAUSE); 231 LLViewerMediaImpl* media_impl = *iter;
232 if(media_impl->getMediaTextureID() == texture_id)
233 {
234 return media_impl;
235 }
186 } 236 }
237 return NULL;
187} 238}
188 239
189void LLViewerMediaImpl::start() 240//////////////////////////////////////////////////////////////////////////////////////////
241// static
242std::string LLViewerMedia::getCurrentUserAgent()
190{ 243{
191 if(mMediaSource) 244 // Don't use user-visible string to avoid
192 { 245 // punctuation and strange characters.
193 mMediaSource->addCommand(LLMediaBase::COMMAND_START); 246 std::string skin_name = gSavedSettings.getString("SkinCurrent");
194 } 247
248 // Just in case we need to check browser differences in A/B test
249 // builds.
250 std::string channel = gSavedSettings.getString("VersionChannelName");
251
252 // append our magic version number string to the browser user agent id
253 // See the HTTP 1.0 and 1.1 specifications for allowed formats:
254 // http://www.ietf.org/rfc/rfc1945.txt section 10.15
255 // http://www.ietf.org/rfc/rfc2068.txt section 3.8
256 // This was also helpful:
257 // http://www.mozilla.org/build/revised-user-agent-strings.html
258 std::ostringstream codec;
259 codec << "SecondLife/";
260 codec << "C64 Basic V2"; //imprudence fixme : this isn't anybodys business anyway
261// codec << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VERSION_BUILD;
262// codec << " (" << channel << "; " << skin_name << " skin)";
263// llinfos << codec.str() << llendl;
264
265 return codec.str();
195} 266}
196 267
197void LLViewerMediaImpl::seek(F32 time) 268//////////////////////////////////////////////////////////////////////////////////////////
269// static
270void LLViewerMedia::updateBrowserUserAgent()
198{ 271{
199 if(mMediaSource) 272 std::string user_agent = getCurrentUserAgent();
273
274 impl_list::iterator iter = sViewerMediaImplList.begin();
275 impl_list::iterator end = sViewerMediaImplList.end();
276
277 for(; iter != end; iter++)
200 { 278 {
201 mMediaSource->seek(time); 279 LLViewerMediaImpl* pimpl = *iter;
280 if(pimpl->mMediaSource && pimpl->mMediaSource->pluginSupportsMediaBrowser())
281 {
282 pimpl->mMediaSource->setBrowserUserAgent(user_agent);
283 }
202 } 284 }
285
203} 286}
204 287
205void LLViewerMediaImpl::setVolume(F32 volume) 288//////////////////////////////////////////////////////////////////////////////////////////
289// static
290bool LLViewerMedia::handleSkinCurrentChanged(const LLSD& /*newvalue*/)
206{ 291{
207 if(mMediaSource) 292 // gSavedSettings is already updated when this function is called.
293 updateBrowserUserAgent();
294 return true;
295}
296
297//////////////////////////////////////////////////////////////////////////////////////////
298// static
299bool LLViewerMedia::textureHasMedia(const LLUUID& texture_id)
300{
301 impl_list::iterator iter = sViewerMediaImplList.begin();
302 impl_list::iterator end = sViewerMediaImplList.end();
303
304 for(; iter != end; iter++)
208 { 305 {
209 mMediaSource->setVolume( volume); 306 LLViewerMediaImpl* pimpl = *iter;
307 if(pimpl->getMediaTextureID() == texture_id)
308 {
309 return true;
310 }
210 } 311 }
312 return false;
211} 313}
212 314
213LLMediaBase::EStatus LLViewerMediaImpl::getStatus() 315//////////////////////////////////////////////////////////////////////////////////////////
316// static
317void LLViewerMedia::setVolume(F32 volume)
214{ 318{
215 if (mMediaSource) 319 impl_list::iterator iter = sViewerMediaImplList.begin();
320 impl_list::iterator end = sViewerMediaImplList.end();
321
322 for(; iter != end; iter++)
216 { 323 {
217 return mMediaSource->getStatus(); 324 LLViewerMediaImpl* pimpl = *iter;
325 pimpl->setVolume(volume);
218 } 326 }
219 else 327}
328
329//////////////////////////////////////////////////////////////////////////////////////////
330// static
331void LLViewerMedia::updateMedia()
332{
333 impl_list::iterator iter = sViewerMediaImplList.begin();
334 impl_list::iterator end = sViewerMediaImplList.end();
335
336 for(; iter != end; iter++)
220 { 337 {
221 return LLMediaBase::STATUS_UNKNOWN; 338 LLViewerMediaImpl* pimpl = *iter;
339 pimpl->update();
222 } 340 }
223} 341}
224 342
225////////////////////////////////////////////////////////////////////////////////////////// 343//////////////////////////////////////////////////////////////////////////////////////////
226// static 344// static
227void LLViewerMediaImpl::updateMovieImage(const LLUUID& uuid, BOOL active) 345void LLViewerMedia::cleanupClass()
228{ 346{
229 // IF the media image hasn't changed, do nothing 347 // This is no longer necessary, since the list is no longer smart pointers.
230 if (mMovieImageID == uuid) 348#if 0
349 while(!sViewerMediaImplList.empty())
231 { 350 {
232 return; 351 sViewerMediaImplList.pop_back();
233 } 352 }
234 // If we have changed media uuid, restore the old one 353#endif
235 if (!mMovieImageID.isNull()) 354}
355
356//////////////////////////////////////////////////////////////////////////////////////////
357// LLViewerMediaImpl
358//////////////////////////////////////////////////////////////////////////////////////////
359LLViewerMediaImpl::LLViewerMediaImpl(const std::string& media_url,
360 const LLUUID& texture_id,
361 S32 media_width,
362 S32 media_height,
363 U8 media_auto_scale,
364 U8 media_loop,
365 const std::string& mime_type)
366:
367 mMediaSource( NULL ),
368 mMovieImageHasMips(false),
369 mTextureId(texture_id),
370 mMediaWidth(media_width),
371 mMediaHeight(media_height),
372 mMediaAutoScale(media_auto_scale),
373 mMediaLoop(media_loop),
374 mMediaURL(media_url),
375 mMimeType(mime_type),
376 mNeedsNewTexture(true),
377 mSuspendUpdates(false),
378 mVisible(true)
379{
380 createMediaSource();
381}
382
383//////////////////////////////////////////////////////////////////////////////////////////
384LLViewerMediaImpl::~LLViewerMediaImpl()
385{
386 if( gEditMenuHandler == this )
236 { 387 {
237 LLViewerImage* oldImage = LLViewerImage::getImage( mMovieImageID ); 388 gEditMenuHandler = NULL;
238 if (oldImage)
239 {
240 oldImage->reinit(mMovieImageHasMips);
241 oldImage->mIsMediaTexture = FALSE;
242 }
243 mMovieImageID.setNull();
244 } 389 }
245 // If the movie is playing, set the new media image 390
246 if (active && !uuid.isNull()) 391 destroyMediaSource();
392 LLViewerMedia::removeMedia(this);
393}
394
395//////////////////////////////////////////////////////////////////////////////////////////
396bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type)
397{
398 if((mMediaSource == NULL) || (mMimeType != mime_type))
247 { 399 {
248 LLViewerImage* viewerImage = LLViewerImage::getImage( uuid ); 400 if(! initializePlugin(mime_type))
249 if( viewerImage )
250 { 401 {
251 mMovieImageID = uuid; 402 LL_WARNS("Plugin") << "plugin intialization failed for mime type: " << mime_type << LL_ENDL;
252 // Can't use mipmaps for movies because they don't update the full image 403 LLSD args;
253 mMovieImageHasMips = viewerImage->getUseMipMaps(); 404 args["MIME_TYPE"] = mime_type;
254 viewerImage->reinit(FALSE); 405 LLNotifications::instance().add("NoPlugin", args);
255 viewerImage->mIsMediaTexture = TRUE; 406
407 return false;
256 } 408 }
257 } 409 }
258}
259 410
411 // play();
412 return (mMediaSource != NULL);
413}
260 414
261////////////////////////////////////////////////////////////////////////////////////////// 415//////////////////////////////////////////////////////////////////////////////////////////
262// static 416void LLViewerMediaImpl::createMediaSource()
263void LLViewerMediaImpl::updateImagesMediaStreams()
264{ 417{
265 LLMediaManager::updateClass(); 418 if(! mMediaURL.empty())
419 {
420 navigateTo(mMediaURL, mMimeType, true);
421 }
422 else if(! mMimeType.empty())
423 {
424 initializeMedia(mMimeType);
425 }
426
266} 427}
267 428
268void LLViewerMediaImpl::initializePlaceholderImage(LLViewerImage *placeholder_image, LLMediaBase *media_source) 429//////////////////////////////////////////////////////////////////////////////////////////
430void LLViewerMediaImpl::destroyMediaSource()
269{ 431{
270 int media_width = media_source->getMediaWidth(); 432 mNeedsNewTexture = true;
271 int media_height = media_source->getMediaHeight(); 433 if(! mMediaSource)
272 //int media_rowspan = media_source->getMediaRowSpan(); 434 {
273
274 // if width & height are invalid, don't bother doing anything
275 if ( media_width < 1 || media_height < 1 )
276 return; 435 return;
436 }
437 // Restore the texture
438 updateMovieImage(LLUUID::null, false);
439 delete mMediaSource;
440 mMediaSource = NULL;
441}
277 442
278 llinfos << "initializing media placeholder" << llendl; 443//////////////////////////////////////////////////////////////////////////////////////////
279 llinfos << "movie image id " << mMovieImageID << llendl; 444void LLViewerMediaImpl::setMediaType(const std::string& media_type)
280 445{
281 int texture_width = LLMediaManager::textureWidthFromMediaWidth( media_width ); 446 mMimeType = media_type;
282 int texture_height = LLMediaManager::textureHeightFromMediaHeight( media_height ); 447}
283 int texture_depth = media_source->getMediaDepth();
284
285 // MEDIAOPT: check to see if size actually changed before doing work
286 placeholder_image->destroyGLTexture();
287 // MEDIAOPT: apparently just calling setUseMipMaps(FALSE) doesn't work?
288 placeholder_image->reinit(FALSE); // probably not needed
289 448
290 // MEDIAOPT: seems insane that we actually have to make an imageraw then 449//////////////////////////////////////////////////////////////////////////////////////////
291 // immediately discard it 450/*static*/
292 LLPointer<LLImageRaw> raw = new LLImageRaw(texture_width, texture_height, texture_depth); 451LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height)
293 raw->clear(0x0f, 0x0f, 0x0f, 0xff); 452{
294 int discard_level = 0; 453 std::string plugin_basename = LLMIMETypes::implType(media_type);
295 454
296 // ask media source for correct GL image format constants 455 if(plugin_basename.empty())
297 placeholder_image->setExplicitFormat(media_source->getTextureFormatInternal(), 456 {
298 media_source->getTextureFormatPrimary(), 457 LL_WARNS("Media") << "Couldn't find plugin for media type " << media_type << LL_ENDL;
299 media_source->getTextureFormatType()); 458 }
459 else
460 {
461 std::string launcher_name = gDirUtilp->getLLPluginLauncher();
462 std::string plugin_name = gDirUtilp->getLLPluginFilename(plugin_basename);
463 std::string user_data_path = gDirUtilp->getOSUserAppDir();
464 user_data_path += gDirUtilp->getDirDelimiter();
465
466 // See if the plugin executable exists
467 llstat s;
468 if(LLFile::stat(launcher_name, &s))
469 {
470 LL_WARNS("Media") << "Couldn't find launcher at " << launcher_name << LL_ENDL;
471 }
472 else if(LLFile::stat(plugin_name, &s))
473 {
474 LL_WARNS("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL;
475 }
476 else
477 {
478 LLPluginClassMedia* media_source = new LLPluginClassMedia(owner);
479 media_source->setSize(default_width, default_height);
480 if (media_source->init(launcher_name, plugin_name, false, user_data_path))
481 {
482 return media_source;
483 }
484 else
485 {
486 LL_WARNS("Media") << "Failed to init plugin. Destroying." << LL_ENDL;
487 delete media_source;
488 }
489 }
490 }
491
492 return NULL;
493}
300 494
301 placeholder_image->createGLTexture(discard_level, raw); 495//////////////////////////////////////////////////////////////////////////////////////////
496bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
497{
498 if(mMediaSource)
499 {
500 // Save the previous media source's last set size before destroying it.
501 mMediaWidth = mMediaSource->getSetWidth();
502 mMediaHeight = mMediaSource->getSetHeight();
503 }
504
505 // Always delete the old media impl first.
506 destroyMediaSource();
507
508 // and unconditionally set the mime type
509 mMimeType = media_type;
302 510
303 // placeholder_image->setExplicitFormat() 511 LLPluginClassMedia* media_source = newSourceFromMediaType(media_type, this, mMediaWidth, mMediaHeight);
304 placeholder_image->setUseMipMaps(FALSE); 512
513 if (media_source)
514 {
515 media_source->setDisableTimeout(gSavedSettings.getBOOL("DebugPluginDisableTimeout"));
516 media_source->setLoop(mMediaLoop);
517 media_source->setAutoScale(mMediaAutoScale);
518 media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent());
519
520 mMediaSource = media_source;
521 return true;
522 }
305 523
306 // MEDIAOPT: set this dynamically on play/stop 524 return false;
307 placeholder_image->mIsMediaTexture = true;
308} 525}
309 526
527void LLViewerMediaImpl::setSize(int width, int height)
528{
529 mMediaWidth = width;
530 mMediaHeight = height;
531 if(mMediaSource)
532 {
533 mMediaSource->setSize(width, height);
534 }
535}
310 536
311 537//////////////////////////////////////////////////////////////////////////////////////////
312// virtual 538void LLViewerMediaImpl::play()
313void LLViewerMediaImpl::onMediaContentsChange(const EventType& event_in)
314{ 539{
315 LLMediaBase* media_source = event_in.getSubject(); 540 // first stop any previously playing media
316 LLViewerImage* placeholder_image = gImageList.getImage( mMovieImageID ); 541 // stop();
317 if ((placeholder_image) && (placeholder_image->getHasGLTexture())) 542
543 // mMediaSource->addObserver( this );
544 if(mMediaSource == NULL)
318 { 545 {
319 if (placeholder_image->getUseMipMaps()) 546 if(!initializePlugin(mMimeType))
320 { 547 {
321 // bad image! NO MIPMAPS! 548 // Plugin failed initialization... should assert or something
322 initializePlaceholderImage(placeholder_image, media_source); 549 return;
323 } 550 }
551 }
552
553 // updateMovieImage(mTextureId, true);
324 554
325 U8* data = media_source->getMediaData(); 555 mMediaSource->loadURI( mMediaURL );
326 S32 x_pos = 0; 556 if(/*mMediaSource->pluginSupportsMediaTime()*/ true)
327 S32 y_pos = 0; 557 {
328 S32 width = media_source->getMediaWidth(); 558 start();
329 S32 height = media_source->getMediaHeight();
330 S32 data_width = media_source->getMediaDataWidth();
331 S32 data_height = media_source->getMediaDataHeight();
332 placeholder_image->setSubImage(data, data_width, data_height,
333 x_pos, y_pos, width, height);
334 } 559 }
335} 560}
336 561
562//////////////////////////////////////////////////////////////////////////////////////////
563void LLViewerMediaImpl::stop()
564{
565 if(mMediaSource)
566 {
567 mMediaSource->stop();
568 // destroyMediaSource();
569 }
570}
337 571
338// virtual 572//////////////////////////////////////////////////////////////////////////////////////////
339void LLViewerMediaImpl::onMediaSizeChange(const EventType& event_in) 573void LLViewerMediaImpl::pause()
340{ 574{
341 LLMediaBase* media_source = event_in.getSubject(); 575 if(mMediaSource)
342 LLViewerImage* placeholder_image = gImageList.getImage( mMovieImageID );
343 if (placeholder_image)
344 { 576 {
345 initializePlaceholderImage(placeholder_image, media_source); 577 mMediaSource->pause();
346 } 578 }
347 else 579}
580
581//////////////////////////////////////////////////////////////////////////////////////////
582void LLViewerMediaImpl::start()
583{
584 if(mMediaSource)
348 { 585 {
349 llinfos << "no placeholder image" << llendl; 586 mMediaSource->start();
350 } 587 }
351} 588}
352 589
590//////////////////////////////////////////////////////////////////////////////////////////
591void LLViewerMediaImpl::seek(F32 time)
592{
593 if(mMediaSource)
594 {
595 mMediaSource->seek(time);
596 }
597}
353 598
354 // Get the image we're using 599//////////////////////////////////////////////////////////////////////////////////////////
600void LLViewerMediaImpl::setVolume(F32 volume)
601{
602 if(mMediaSource)
603 {
604 mMediaSource->setVolume(volume);
605 }
606}
355 607
356 /* 608//////////////////////////////////////////////////////////////////////////////////////////
357 // update media stream if required 609void LLViewerMediaImpl::focus(bool focus)
358 LLMediaEngine* media_engine = LLMediaEngine::getInstance(); 610{
359 if (media_engine) 611 if (mMediaSource)
360 { 612 {
361 if ( media_engine->update() ) 613 // call focus just for the hell of it, even though this apopears to be a nop
362 { 614 mMediaSource->focus(focus);
363 LLUUID media_uuid = media_engine->getImageUUID(); 615 if (focus)
364 updateMovieImage(media_uuid, TRUE);
365 if (!media_uuid.isNull())
366 {
367 LLViewerImage* viewerImage = getImage( media_uuid );
368 if( viewerImage )
369 {
370 LLMediaBase* renderer = media_engine->getMediaRenderer();
371 if ((renderer->getTextureWidth() != viewerImage->getWidth()) ||
372 (renderer->getTextureHeight() != viewerImage->getHeight()) ||
373 (renderer->getTextureDepth() != viewerImage->getComponents()) ||
374 (viewerImage->getHasGLTexture() == FALSE))
375 {
376 // destroy existing GL image
377 viewerImage->destroyGLTexture();
378
379 // set new size
380 viewerImage->setSize( renderer->getTextureWidth(),
381 renderer->getTextureHeight(),
382 renderer->getTextureDepth() );
383
384 LLPointer<LLImageRaw> raw = new LLImageRaw(renderer->getTextureWidth(),
385 renderer->getTextureHeight(),
386 renderer->getTextureDepth());
387 raw->clear(0x7f,0x7f,0x7f,0xff);
388 viewerImage->createGLTexture(0, raw);
389 }
390
391 // Set the explicit format the instance wants
392 viewerImage->setExplicitFormat(renderer->getTextureFormatInternal(),
393 renderer->getTextureFormatPrimary(),
394 renderer->getTextureFormatType(),
395 renderer->getTextureFormatSwapBytes());
396 // This should be redundant, but just in case:
397 viewerImage->setUseMipMaps(FALSE);
398
399 LLImageRaw* rawImage = media_engine->getImageRaw();
400 if ( rawImage )
401 {
402 viewerImage->setSubImage(rawImage, 0, 0,
403 renderer->getMediaWidth(),
404 renderer->getMediaHeight());
405 }
406 }
407 else
408 {
409 llwarns << "MediaEngine update unable to get viewer image for GL texture" << llendl;
410 }
411 }
412 }
413 else
414 { 616 {
415 LLUUID media_uuid = media_engine->getImageUUID(); 617 // spoof a mouse click to *actually* pass focus
416 updateMovieImage(media_uuid, FALSE); 618 // Don't do this anymore -- it actually clicks through now.
619// mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOWN, 1, 1, 0);
620// mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, 1, 1, 0);
417 } 621 }
418 } 622 }
419 */ 623}
420
421 624
422LLUUID LLViewerMediaImpl::getMediaTextureID() 625//////////////////////////////////////////////////////////////////////////////////////////
626void LLViewerMediaImpl::mouseDown(S32 x, S32 y)
423{ 627{
424 return mMovieImageID; 628 scaleMouse(&x, &y);
629 mLastMouseX = x;
630 mLastMouseY = y;
631 if (mMediaSource)
632 {
633 mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOWN, LEFT_BUTTON, x, y, 0);
634 }
425} 635}
426 636
427// static 637//////////////////////////////////////////////////////////////////////////////////////////
428void LLViewerMediaImpl::updateBrowserUserAgent() 638void LLViewerMediaImpl::mouseUp(S32 x, S32 y)
429{ 639{
430 // Don't use user-visible string to avoid 640 scaleMouse(&x, &y);
431 // punctuation and strange characters. 641 mLastMouseX = x;
432 std::string skin_name = gSavedSettings.getString("SkinCurrent"); 642 mLastMouseY = y;
433 643 if (mMediaSource)
434 // Just in case we need to check browser differences in A/B test 644 {
435 // builds. 645 mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, LEFT_BUTTON, x, y, 0);
436 std::string channel = gSavedSettings.getString("VersionChannelName"); 646 }
437
438 // append our magic version number string to the browser user agent id
439 // See the HTTP 1.0 and 1.1 specifications for allowed formats:
440 // http://www.ietf.org/rfc/rfc1945.txt section 10.15
441 // http://www.ietf.org/rfc/rfc2068.txt section 3.8
442 // This was also helpful:
443 // http://www.mozilla.org/build/revised-user-agent-strings.html
444 std::ostringstream codec;
445 codec << "SecondLife/";
446 codec << ViewerVersion::getLLMajorVersion() << "." << ViewerVersion::getLLMinorVersion() << "." << ViewerVersion::getLLPatchVersion() << "." << ViewerVersion::getLLBuildVersion();
447 codec << " (" << channel << "; " << skin_name << " skin)";
448 llinfos << codec.str() << llendl;
449 LLMediaManager::setBrowserUserAgent( codec.str() );
450} 647}
451 648
452// static 649//////////////////////////////////////////////////////////////////////////////////////////
453bool LLViewerMediaImpl::handleSkinCurrentChanged(const LLSD& /*newvalue*/) 650void LLViewerMediaImpl::mouseMove(S32 x, S32 y)
454{ 651{
455 // gSavedSettings is already updated when this function is called. 652 scaleMouse(&x, &y);
456 updateBrowserUserAgent(); 653 mLastMouseX = x;
457 return true; 654 mLastMouseY = y;
655 if (mMediaSource)
656 {
657 mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_MOVE, LEFT_BUTTON, x, y, 0);
658 }
458} 659}
459 660
460////////////////////////////////////////////////////////////////////////////////////////// 661//////////////////////////////////////////////////////////////////////////////////////////
461// Wrapper class 662void LLViewerMediaImpl::mouseLeftDoubleClick(S32 x, S32 y)
663{
664 scaleMouse(&x, &y);
665 mLastMouseX = x;
666 mLastMouseY = y;
667 if (mMediaSource)
668 {
669 mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOUBLE_CLICK, LEFT_BUTTON, x, y, 0);
670 }
671}
672
462////////////////////////////////////////////////////////////////////////////////////////// 673//////////////////////////////////////////////////////////////////////////////////////////
674void LLViewerMediaImpl::onMouseCaptureLost()
675{
676 if (mMediaSource)
677 {
678 mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, LEFT_BUTTON, mLastMouseX, mLastMouseY, 0);
679 }
680}
463 681
682//////////////////////////////////////////////////////////////////////////////////////////
683BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask)
684{
685 // NOTE: this is called when the mouse is released when we have capture.
686 // Due to the way mouse coordinates are mapped to the object, we can't use the x and y coordinates that come in with the event.
687
688 if(hasMouseCapture())
689 {
690 // Release the mouse -- this will also send a mouseup to the media
691 gFocusMgr.setMouseCapture( FALSE );
692 }
464 693
694 return TRUE;
695}
465////////////////////////////////////////////////////////////////////////////////////////// 696//////////////////////////////////////////////////////////////////////////////////////////
466// The viewer takes a long time to load the start screen. Part of the problem 697void LLViewerMediaImpl::navigateHome()
467// is media initialization -- in particular, QuickTime loads many DLLs and
468// hits the disk heavily. So we initialize only the browser component before
469// the login screen, then do the rest later when we have a progress bar. JC
470// static
471void LLViewerMedia::initBrowser()
472{ 698{
473 LLMediaManagerData* init_data = new LLMediaManagerData; 699 if(mMediaSource)
474 buildMediaManagerData( init_data ); 700 {
475 LLMediaManager::initBrowser( init_data ); 701 mMediaSource->loadURI( mHomeURL );
476 delete init_data; 702 }
477
478 // We use a custom user agent with viewer version and skin name.
479 LLViewerMediaImpl::updateBrowserUserAgent();
480} 703}
481 704
482////////////////////////////////////////////////////////////////////////////////////////// 705//////////////////////////////////////////////////////////////////////////////////////////
483// static 706void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type)
484void LLViewerMedia::initClass()
485{ 707{
486 // *TODO: This looks like a memory leak to me. JC 708 if(rediscover_type)
487 LLMediaManagerData* init_data = new LLMediaManagerData; 709 {
488 buildMediaManagerData( init_data ); 710
489 LLMediaManager::initClass( init_data ); 711 LLURI uri(url);
490 delete init_data; 712 std::string scheme = uri.scheme();
491 713
492 LLMediaManager* mm = LLMediaManager::getInstance(); 714 if(scheme.empty() || "http" == scheme || "https" == scheme)
493 LLMIMETypes::mime_info_map_t::const_iterator it; 715 {
494 for (it = LLMIMETypes::sMap.begin(); it != LLMIMETypes::sMap.end(); ++it) 716 LLHTTPClient::getHeaderOnly( url, new LLMimeDiscoveryResponder(this));
717 }
718 else if("data" == scheme || "file" == scheme || "about" == scheme)
719 {
720 // FIXME: figure out how to really discover the type for these schemes
721 // We use "data" internally for a text/html url for loading the login screen
722 if(initializeMedia("text/html"))
723 {
724 mMediaSource->loadURI( url );
725 }
726 }
727 else
728 {
729 // This catches 'rtsp://' urls
730 if(initializeMedia(scheme))
731 {
732 mMediaSource->loadURI( url );
733 }
734 }
735 }
736 else if (mMediaSource)
495 { 737 {
496 const std::string& mime_type = it->first; 738 mMediaSource->loadURI( url );
497 const LLMIMETypes::LLMIMEInfo& info = it->second;
498 mm->addMimeTypeImplNameMap( mime_type, info.mImpl );
499 } 739 }
500 740 else if(initializeMedia(mime_type) && mMediaSource)
501 LLMediaBase *impl = mm->createSourceFromMimeType("http", "audio/mpeg"); 741 {
502 if (impl) 742 mMediaSource->loadURI( url );
743 }
744 else
503 { 745 {
504 U32 level = gSavedSettings.getU32("MediaDebugLevel"); 746 LL_WARNS("Media") << "Couldn't navigate to: " << url << " as there is no media type for: " << mime_type << LL_ENDL;
505 impl->setDebugLevel( (LLMediaBase::EDebugLevel)level ); 747 return;
506 } 748 }
749 mMediaURL = url;
750
507} 751}
508 752
509////////////////////////////////////////////////////////////////////////////////////////// 753//////////////////////////////////////////////////////////////////////////////////////////
510// static 754void LLViewerMediaImpl::navigateStop()
511void LLViewerMedia::buildMediaManagerData( LLMediaManagerData* init_data ) 755{
512{ 756 if(mMediaSource)
513// std::string executable_dir = std::string( arg0 ).substr( 0, std::string( arg0 ).find_last_of("\\/") ); 757 {
514// std::string component_dir = std::string( executable_dir ).substr( 0, std::string( executable_dir ).find_last_of("\\/") ); 758 mMediaSource->browse_stop();
515// component_dir = std::string( component_dir ).substr( 0, std::string( component_dir ).find_last_of("\\/") ); 759 }
516// component_dir = std::string( component_dir ).substr( 0, std::string( component_dir ).find_last_of("\\/") );
517// component_dir += "\\newview\\app_settings\\mozilla";
518
519
520#if LL_DARWIN
521 // For Mac OS, we store both the shared libraries and the runtime files (chrome/, plugins/, etc) in
522 // Second Life.app/Contents/MacOS/. This matches the way Firefox is distributed on the Mac.
523 std::string component_dir(gDirUtilp->getExecutableDir());
524#elif LL_WINDOWS
525 std::string component_dir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) );
526 component_dir += gDirUtilp->getDirDelimiter();
527 #ifdef LL_DEBUG
528 component_dir += "mozilla_debug";
529 #else // LL_DEBUG
530 component_dir += "mozilla";
531 #endif // LL_DEBUG
532#elif LL_LINUX
533 std::string component_dir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) );
534 component_dir += gDirUtilp->getDirDelimiter();
535
536 #if LINUX64
537 component_dir += "mozilla-runtime-linux-x86_64";
538 #else
539 component_dir += "mozilla-runtime-linux-i686";
540 #endif
541
542#elif LL_SOLARIS
543 std::string component_dir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) );
544 component_dir += gDirUtilp->getDirDelimiter();
545 #ifdef __sparc
546 component_dir += "mozilla-solaris-sparc";
547 #else
548 component_dir += "mozilla-solaris-i686";
549 #endif
550#else
551 std::string component_dir( gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "" ) );
552 component_dir += gDirUtilp->getDirDelimiter();
553 component_dir += "mozilla";
554#endif
555
556 std::string application_dir = gDirUtilp->getExecutableDir();
557 760
558 init_data->setBrowserApplicationDir( application_dir ); 761}
559 std::string profile_dir = gDirUtilp->getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" );
560 init_data->setBrowserProfileDir( profile_dir );
561 init_data->setBrowserComponentDir( component_dir );
562 std::string profile_name("Second Life");
563 init_data->setBrowserProfileName( profile_name );
564 init_data->setBrowserParentWindow( gViewerWindow->getMediaWindow() );
565 762
566 // Users can change skins while client is running, so make sure 763//////////////////////////////////////////////////////////////////////////////////////////
567 // we pick up on changes. 764bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask)
568 gSavedSettings.getControl("SkinCurrent")->getSignal()->connect( 765{
569 boost::bind( LLViewerMediaImpl::handleSkinCurrentChanged, _1 ) ); 766 bool result = false;
767
768 if (mMediaSource)
769 {
770 result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN ,key, mask);
771 }
772
773 return result;
774}
570 775
776//////////////////////////////////////////////////////////////////////////////////////////
777bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char)
778{
779 bool result = false;
780
781 if (mMediaSource)
782 {
783 // only accept 'printable' characters, sigh...
784 if (uni_char >= 32 // discard 'control' characters
785 && uni_char != 127) // SDL thinks this is 'delete' - yuck.
786 {
787 mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(FALSE));
788 }
789 }
790
791 return result;
571} 792}
572 793
573////////////////////////////////////////////////////////////////////////////////////////// 794//////////////////////////////////////////////////////////////////////////////////////////
574// static 795bool LLViewerMediaImpl::canNavigateForward()
575void LLViewerMedia::cleanupClass()
576{ 796{
577 stop() ; 797 BOOL result = FALSE;
578 LLMediaManager::cleanupClass(); 798 if (mMediaSource)
799 {
800 result = mMediaSource->getHistoryForwardAvailable();
801 }
802 return result;
579} 803}
580 804
581// static 805//////////////////////////////////////////////////////////////////////////////////////////
582void LLViewerMedia::play(const std::string& media_url, 806bool LLViewerMediaImpl::canNavigateBack()
583 const std::string& mime_type,
584 const LLUUID& placeholder_texture_id,
585 S32 media_width, S32 media_height, U8 media_auto_scale,
586 U8 media_loop)
587{ 807{
588 sViewerMediaImpl.play(media_url, mime_type, placeholder_texture_id, 808 BOOL result = FALSE;
589 media_width, media_height, media_auto_scale, media_loop); 809 if (mMediaSource)
810 {
811 result = mMediaSource->getHistoryBackAvailable();
812 }
813 return result;
590} 814}
591 815
592// static 816
593void LLViewerMedia::stop() 817//////////////////////////////////////////////////////////////////////////////////////////
818void LLViewerMediaImpl::updateMovieImage(const LLUUID& uuid, BOOL active)
594{ 819{
595 sViewerMediaImpl.stop(); 820 // IF the media image hasn't changed, do nothing
821 if (mTextureId == uuid)
822 {
823 return;
824 }
825 // If we have changed media uuid, restore the old one
826 if (!mTextureId.isNull())
827 {
828 LLViewerImage* oldImage = LLViewerImage::getImage( mTextureId );
829 if (oldImage)
830 {
831 oldImage->reinit(mMovieImageHasMips);
832 oldImage->mIsMediaTexture = FALSE;
833 }
834 }
835 // If the movie is playing, set the new media image
836 if (active && !uuid.isNull())
837 {
838 LLViewerImage* viewerImage = LLViewerImage::getImage( uuid );
839 if( viewerImage )
840 {
841 mTextureId = uuid;
842 // Can't use mipmaps for movies because they don't update the full image
843 mMovieImageHasMips = viewerImage->getUseMipMaps();
844 viewerImage->reinit(FALSE);
845 viewerImage->mIsMediaTexture = TRUE;
846 }
847 }
596} 848}
597 849
598// static 850//////////////////////////////////////////////////////////////////////////////////////////
599void LLViewerMedia::pause() 851void LLViewerMediaImpl::update()
600{ 852{
601 sViewerMediaImpl.pause(); 853 if(mMediaSource == NULL)
854 {
855 return;
856 }
857
858 mMediaSource->idle();
859
860 if(mMediaSource->isPluginExited())
861 {
862 destroyMediaSource();
863 return;
864 }
865
866 if(!mMediaSource->textureValid())
867 {
868 return;
869 }
870
871 if(mSuspendUpdates || !mVisible)
872 {
873 return;
874 }
875
876 LLViewerImage* placeholder_image = updatePlaceholderImage();
877
878 if(placeholder_image)
879 {
880 LLRect dirty_rect;
881 if(mMediaSource->getDirty(&dirty_rect))
882 {
883 // Constrain the dirty rect to be inside the texture
884 S32 x_pos = llmax(dirty_rect.mLeft, 0);
885 S32 y_pos = llmax(dirty_rect.mBottom, 0);
886 S32 width = llmin(dirty_rect.mRight, placeholder_image->getWidth()) - x_pos;
887 S32 height = llmin(dirty_rect.mTop, placeholder_image->getHeight()) - y_pos;
888
889 if(width > 0 && height > 0)
890 {
891
892 U8* data = mMediaSource->getBitsData();
893
894 // Offset the pixels pointer to match x_pos and y_pos
895 data += ( x_pos * mMediaSource->getTextureDepth() * mMediaSource->getBitsWidth() );
896 data += ( y_pos * mMediaSource->getTextureDepth() );
897
898 placeholder_image->setSubImage(
899 data,
900 mMediaSource->getBitsWidth(),
901 mMediaSource->getBitsHeight(),
902 x_pos,
903 y_pos,
904 width,
905 height,
906 TRUE); // force a fast update (i.e. don't call analyzeAlpha, etc.)
907
908 }
909
910 mMediaSource->resetDirty();
911 }
912 }
602} 913}
603 914
604// static 915
605void LLViewerMedia::start() 916//////////////////////////////////////////////////////////////////////////////////////////
917void LLViewerMediaImpl::updateImagesMediaStreams()
606{ 918{
607 sViewerMediaImpl.start();
608} 919}
609 920
610// static 921
611void LLViewerMedia::seek(F32 time) 922//////////////////////////////////////////////////////////////////////////////////////////
923LLViewerImage* LLViewerMediaImpl::updatePlaceholderImage()
612{ 924{
613 sViewerMediaImpl.seek(time); 925 if(mTextureId.isNull())
926 {
927 // The code that created this instance will read from the plugin's bits.
928 return NULL;
929 }
930
931 LLViewerImage* placeholder_image = gImageList.getImage( mTextureId );
932
933 if (mNeedsNewTexture
934 || placeholder_image->getUseMipMaps()
935 || ! placeholder_image->mIsMediaTexture
936 || placeholder_image->getWidth() != mMediaSource->getTextureWidth()
937 || placeholder_image->getHeight() != mMediaSource->getTextureHeight())
938 {
939 llinfos << "initializing media placeholder" << llendl;
940 llinfos << "movie image id " << mTextureId << llendl;
941
942 int texture_width = mMediaSource->getTextureWidth();
943 int texture_height = mMediaSource->getTextureHeight();
944 int texture_depth = mMediaSource->getTextureDepth();
945
946 // MEDIAOPT: check to see if size actually changed before doing work
947 placeholder_image->destroyGLTexture();
948 // MEDIAOPT: apparently just calling setUseMipMaps(FALSE) doesn't work?
949 placeholder_image->reinit(FALSE); // probably not needed
950
951 // MEDIAOPT: seems insane that we actually have to make an imageraw then
952 // immediately discard it
953 LLPointer<LLImageRaw> raw = new LLImageRaw(texture_width, texture_height, texture_depth);
954 raw->clear(0x0f, 0x0f, 0x0f, 0xff);
955 int discard_level = 0;
956
957 // ask media source for correct GL image format constants
958 placeholder_image->setExplicitFormat(mMediaSource->getTextureFormatInternal(),
959 mMediaSource->getTextureFormatPrimary(),
960 mMediaSource->getTextureFormatType(),
961 mMediaSource->getTextureFormatSwapBytes());
962
963 placeholder_image->createGLTexture(discard_level, raw);
964
965 // placeholder_image->setExplicitFormat()
966 placeholder_image->setUseMipMaps(FALSE);
967
968 // MEDIAOPT: set this dynamically on play/stop
969 placeholder_image->mIsMediaTexture = true;
970 mNeedsNewTexture = false;
971 }
972
973 return placeholder_image;
614} 974}
615 975
616// static 976
617void LLViewerMedia::setVolume(F32 volume) 977//////////////////////////////////////////////////////////////////////////////////////////
978LLUUID LLViewerMediaImpl::getMediaTextureID()
618{ 979{
619 sViewerMediaImpl.setVolume(volume); 980 return mTextureId;
620} 981}
621 982
622// static 983//////////////////////////////////////////////////////////////////////////////////////////
623LLMediaBase::EStatus LLViewerMedia::getStatus() 984void LLViewerMediaImpl::setVisible(bool visible)
624{ 985{
625 return sViewerMediaImpl.getStatus(); 986 mVisible = visible;
987
988 if(mVisible)
989 {
990 if(mMediaSource && mMediaSource->isPluginExited())
991 {
992 destroyMediaSource();
993 }
994
995 if(!mMediaSource)
996 {
997 createMediaSource();
998 }
999 }
1000
1001 if(mMediaSource)
1002 {
1003 mMediaSource->setPriority(mVisible?LLPluginClassMedia::PRIORITY_NORMAL:LLPluginClassMedia::PRIORITY_HIDDEN);
1004 }
626} 1005}
627 1006
628////////////////////////////////////////////////////////////////////////////////////////// 1007//////////////////////////////////////////////////////////////////////////////////////////
629// static 1008void LLViewerMediaImpl::mouseCapture()
630LLUUID LLViewerMedia::getMediaTextureID()
631{ 1009{
632 return sViewerMediaImpl.getMediaTextureID(); 1010 gFocusMgr.setMouseCapture(this);
633} 1011}
634 1012
635////////////////////////////////////////////////////////////////////////////////////////// 1013//////////////////////////////////////////////////////////////////////////////////////////
636// static 1014void LLViewerMediaImpl::getTextureSize(S32 *texture_width, S32 *texture_height)
637bool LLViewerMedia::getMediaSize(S32 *media_width, S32 *media_height)
638{ 1015{
639 // make sure we're valid 1016 if(mMediaSource && mMediaSource->textureValid())
1017 {
1018 S32 real_texture_width = mMediaSource->getBitsWidth();
1019 S32 real_texture_height = mMediaSource->getBitsHeight();
640 1020
641 if ( sViewerMediaImpl.mMediaSource != NULL ) 1021 {
1022 // The "texture width" coming back from the plugin may not be a power of two (thanks to webkit).
1023 // It will be the correct "data width" to pass to setSubImage
1024 int i;
1025
1026 for(i = 1; i < real_texture_width; i <<= 1)
1027 ;
1028 *texture_width = i;
1029
1030 for(i = 1; i < real_texture_height; i <<= 1)
1031 ;
1032 *texture_height = i;
1033 }
1034
1035 }
1036 else
642 { 1037 {
643 *media_width = sViewerMediaImpl.mMediaSource->getMediaWidth(); 1038 *texture_width = 0;
644 *media_height = sViewerMediaImpl.mMediaSource->getMediaHeight(); 1039 *texture_height = 0;
645 return true;
646 } 1040 }
647 return false; 1041}
1042//////////////////////////////////////////////////////////////////////////////////////////
1043void LLViewerMediaImpl::scaleMouse(S32 *mouse_x, S32 *mouse_y)
1044{
1045#if 0
1046 S32 media_width, media_height;
1047 S32 texture_width, texture_height;
1048 getMediaSize( &media_width, &media_height );
1049 getTextureSize( &texture_width, &texture_height );
1050 S32 y_delta = texture_height - media_height;
1051
1052 *mouse_y -= y_delta;
1053#endif
648} 1054}
649 1055
650////////////////////////////////////////////////////////////////////////////////////////// 1056//////////////////////////////////////////////////////////////////////////////////////////
651// static 1057bool LLViewerMediaImpl::isMediaPlaying()
652bool LLViewerMedia::getTextureSize(S32 *texture_width, S32 *texture_height)
653{ 1058{
654 if ( sViewerMediaImpl.mMediaSource != NULL ) 1059 bool result = false;
1060
1061 if(mMediaSource)
655 { 1062 {
656 S32 media_width = sViewerMediaImpl.mMediaSource->getMediaWidth(); 1063 EMediaStatus status = mMediaSource->getStatus();
657 S32 media_height = sViewerMediaImpl.mMediaSource->getMediaHeight(); 1064 if(status == MEDIA_PLAYING || status == MEDIA_LOADING)
658 *texture_width = LLMediaManager::textureWidthFromMediaWidth( media_width ); 1065 result = true;
659 *texture_height = LLMediaManager::textureHeightFromMediaHeight( media_height );
660 return true;
661 } 1066 }
662 return false; 1067
1068 return result;
663} 1069}
1070//////////////////////////////////////////////////////////////////////////////////////////
1071bool LLViewerMediaImpl::isMediaPaused()
1072{
1073 bool result = false;
664 1074
1075 if(mMediaSource)
1076 {
1077 if(mMediaSource->getStatus() == MEDIA_PAUSED)
1078 result = true;
1079 }
1080
1081 return result;
1082}
665 1083
666////////////////////////////////////////////////////////////////////////////////////////// 1084//////////////////////////////////////////////////////////////////////////////////////////
667// static 1085//
668void LLViewerMedia::updateImagesMediaStreams() 1086bool LLViewerMediaImpl::hasMedia()
669{ 1087{
670 sViewerMediaImpl.updateImagesMediaStreams(); 1088 return mMediaSource != NULL;
671} 1089}
1090
672////////////////////////////////////////////////////////////////////////////////////////// 1091//////////////////////////////////////////////////////////////////////////////////////////
673// static 1092void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* self, LLPluginClassMediaOwner::EMediaEvent event)
674bool LLViewerMedia::isMediaPlaying()
675{ 1093{
676 LLMediaBase::EStatus status = sViewerMediaImpl.getStatus(); 1094 switch(event)
677 return (status == LLMediaBase::STATUS_STARTED ); 1095 {
1096 case MEDIA_EVENT_PLUGIN_FAILED:
1097 {
1098 LLSD args;
1099 args["PLUGIN"] = LLMIMETypes::implType(mMimeType);
1100 LLNotifications::instance().add("MediaPluginFailed", args);
1101 }
1102 break;
1103 default:
1104 break;
1105 }
1106 // Just chain the event to observers.
1107 emitEvent(self, event);
678} 1108}
679////////////////////////////////////////////////////////////////////////////////////////// 1109
680// static 1110////////////////////////////////////////////////////////////////////////////////
681bool LLViewerMedia::isMediaPaused() 1111// virtual
1112void
1113LLViewerMediaImpl::cut()
682{ 1114{
683 LLMediaBase::EStatus status = sViewerMediaImpl.getStatus(); 1115 if (mMediaSource)
684 return (status == LLMediaBase::STATUS_PAUSED); 1116 mMediaSource->cut();
685} 1117}
686////////////////////////////////////////////////////////////////////////////////////////// 1118
687// static 1119////////////////////////////////////////////////////////////////////////////////
688bool LLViewerMedia::hasMedia() 1120// virtual
1121BOOL
1122LLViewerMediaImpl::canCut() const
689{ 1123{
690 return sViewerMediaImpl.mMediaSource != NULL; 1124 if (mMediaSource)
1125 return mMediaSource->canCut();
1126 else
1127 return FALSE;
691} 1128}
692 1129
693////////////////////////////////////////////////////////////////////////////////////////// 1130////////////////////////////////////////////////////////////////////////////////
694//static 1131// virtual
695bool LLViewerMedia::isActiveMediaTexture(const LLUUID& id) 1132void
1133LLViewerMediaImpl::copy()
696{ 1134{
697 return (id.notNull() 1135 if (mMediaSource)
698 && id == getMediaTextureID() 1136 mMediaSource->copy();
699 && isMediaPlaying());
700} 1137}
701 1138
702////////////////////////////////////////////////////////////////////////////////////////// 1139////////////////////////////////////////////////////////////////////////////////
703// static 1140// virtual
704std::string LLViewerMedia::getMediaURL() 1141BOOL
1142LLViewerMediaImpl::canCopy() const
705{ 1143{
706 return sViewerMediaImpl.mMediaURL; 1144 if (mMediaSource)
1145 return mMediaSource->canCopy();
1146 else
1147 return FALSE;
707} 1148}
708////////////////////////////////////////////////////////////////////////////////////////// 1149
709// static 1150////////////////////////////////////////////////////////////////////////////////
710std::string LLViewerMedia::getMimeType() 1151// virtual
1152void
1153LLViewerMediaImpl::paste()
711{ 1154{
712 return sViewerMediaImpl.mMimeType; 1155 if (mMediaSource)
1156 mMediaSource->paste();
713} 1157}
714////////////////////////////////////////////////////////////////////////////////////////// 1158
715// static 1159////////////////////////////////////////////////////////////////////////////////
716void LLViewerMedia::setMimeType(std::string mime_type) 1160// virtual
1161BOOL
1162LLViewerMediaImpl::canPaste() const
717{ 1163{
718 sViewerMediaImpl.mMimeType = mime_type; 1164 if (mMediaSource)
1165 return mMediaSource->canPaste();
1166 else
1167 return FALSE;
719} 1168}
1169
diff --git a/linden/indra/newview/llviewermedia.h b/linden/indra/newview/llviewermedia.h
index 600d740..afda426 100644
--- a/linden/indra/newview/llviewermedia.h
+++ b/linden/indra/newview/llviewermedia.h
@@ -33,50 +33,192 @@
33#ifndef LLVIEWERMEDIA_H 33#ifndef LLVIEWERMEDIA_H
34#define LLVIEWERMEDIA_H 34#define LLVIEWERMEDIA_H
35 35
36#include "llmediabase.h" // for status codes 36#include "llfocusmgr.h"
37 37
38class LLMediaManagerData; 38#include "llpanel.h"
39#include "llpluginclassmediaowner.h"
40
41#include "llviewermediaobserver.h"
42
43class LLViewerMediaImpl;
39class LLUUID; 44class LLUUID;
45class LLViewerImage;
46
47typedef LLPointer<LLViewerMediaImpl> viewer_media_t;
48///////////////////////////////////////////////////////////////////////////////
49//
50class LLViewerMediaEventEmitter
51{
52public:
53 virtual ~LLViewerMediaEventEmitter();
54
55 bool addObserver( LLViewerMediaObserver* subject );
56 bool remObserver( LLViewerMediaObserver* subject );
57 void emitEvent(LLPluginClassMedia* self, LLPluginClassMediaOwner::EMediaEvent event);
58
59private:
60 typedef std::list< LLViewerMediaObserver* > observerListType;
61 observerListType mObservers;
62};
40 63
41class LLViewerMedia 64class LLViewerMedia
42{ 65{
66 LOG_CLASS(LLViewerMedia);
43 public: 67 public:
44 // Special case early init for just web browser component 68 // Special case early init for just web browser component
45 // so we can show login screen. See .cpp file for details. JC 69 // so we can show login screen. See .cpp file for details. JC
46 static void initBrowser();
47 70
48 static void initClass(); 71 static viewer_media_t newMediaImpl(const std::string& media_url,
49 static void cleanupClass(); 72 const LLUUID& texture_id,
73 S32 media_width,
74 S32 media_height,
75 U8 media_auto_scale,
76 U8 media_loop,
77 std::string mime_type = "none/none");
50 78
51 static void play(const std::string& media_url, 79 static void removeMedia(LLViewerMediaImpl* media);
52 const std::string& mime_type, 80 static LLViewerMediaImpl* getMediaImplFromTextureID(const LLUUID& texture_id);
53 const LLUUID& placeholder_texture_id, 81 static std::string getCurrentUserAgent();
54 S32 media_width, S32 media_height, U8 media_auto_scale, 82 static void updateBrowserUserAgent();
55 U8 media_loop); 83 static bool handleSkinCurrentChanged(const LLSD& /*newvalue*/);
56 static void stop(); 84 static bool textureHasMedia(const LLUUID& texture_id);
57 static void pause();
58 static void start();
59 static void seek(F32 time);
60 static void setVolume(F32 volume); 85 static void setVolume(F32 volume);
61 static LLMediaBase::EStatus getStatus();
62 86
63 static LLUUID getMediaTextureID(); 87 static void updateMedia();
64 static bool getMediaSize(S32 *media_width, S32 *media_height); 88
65 static bool getTextureSize(S32 *texture_width, S32 *texture_height); 89 static void cleanupClass();
66 static bool isMediaPlaying(); 90
67 static bool isMediaPaused(); 91};
68 static bool hasMedia(); 92
69 static bool isActiveMediaTexture(const LLUUID& id); 93// Implementation functions not exported into header file
94class LLViewerMediaImpl
95 : public LLMouseHandler, public LLRefCount, public LLPluginClassMediaOwner, public LLViewerMediaEventEmitter, public LLEditMenuHandler
96{
97 LOG_CLASS(LLViewerMediaImpl);
98public:
99
100 LLViewerMediaImpl(const std::string& media_url,
101 const LLUUID& texture_id,
102 S32 media_width,
103 S32 media_height,
104 U8 media_auto_scale,
105 U8 media_loop,
106 const std::string& mime_type);
107
108 ~LLViewerMediaImpl();
109 void createMediaSource();
110 void destroyMediaSource();
111 void setMediaType(const std::string& media_type);
112 bool initializeMedia(const std::string& mime_type);
113 bool initializePlugin(const std::string& media_type);
114 LLPluginClassMedia* getMediaPlugin() { return mMediaSource; }
115 void setSize(int width, int height);
116
117 void play();
118 void stop();
119 void pause();
120 void start();
121 void seek(F32 time);
122 void setVolume(F32 volume);
123 void focus(bool focus);
124 void mouseDown(S32 x, S32 y);
125 void mouseUp(S32 x, S32 y);
126 void mouseMove(S32 x, S32 y);
127 void mouseLeftDoubleClick(S32 x,S32 y );
128 void mouseCapture();
129
130 void navigateHome();
131 void navigateTo(const std::string& url, const std::string& mime_type = "", bool rediscover_type = false);
132 void navigateStop();
133 bool handleKeyHere(KEY key, MASK mask);
134 bool handleUnicodeCharHere(llwchar uni_char);
135 bool canNavigateForward();
136 bool canNavigateBack();
137 std::string getMediaURL() { return mMediaURL; }
138 std::string getMediaHomeURL() { return mHomeURL; }
139 std::string getMimeType() { return mMimeType; }
140 void getTextureSize(S32 *texture_width, S32 *texture_height);
141 void scaleMouse(S32 *mouse_x, S32 *mouse_y);
142
143 void update();
144 void updateMovieImage(const LLUUID& image_id, BOOL active);
145 void updateImagesMediaStreams();
146 LLUUID getMediaTextureID();
147
148 void suspendUpdates(bool suspend) { mSuspendUpdates = suspend; };
149 void setVisible(bool visible);
150
151 bool isMediaPlaying();
152 bool isMediaPaused();
153 bool hasMedia();
154
155 // utility function to create a ready-to-use media instance from a desired media type.
156 static LLPluginClassMedia* newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height);
157
158 // Internally set our desired browser user agent string, including
159 // the Second Life version and skin name. Used because we can
160 // switch skins without restarting the app.
161 static void updateBrowserUserAgent();
162
163 // Callback for when the SkinCurrent control is changed to
164 // switch the user agent string to indicate the new skin.
165 static bool handleSkinCurrentChanged(const LLSD& newvalue);
166
167 // need these to handle mouseup...
168 /*virtual*/ void onMouseCaptureLost();
169 /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
170
171 // Grr... the only thing I want as an LLMouseHandler are the onMouseCaptureLost and handleMouseUp calls.
172 // Sadly, these are all pure virtual, so I have to supply implementations here:
173 /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; };
174 /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) { return FALSE; };
175 /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) { return FALSE; };
176 /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) { return FALSE; };
177 /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) { return FALSE; };
178 /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) { return FALSE; };
179 /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) { return FALSE; };
180 /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; };
181 /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) {return FALSE; };
182 /*virtual*/ const std::string& getName() const { return LLStringUtil::null; };
183 /*virtual*/ BOOL isView() const { return FALSE; };
184 /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {};
185 /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const {};
186 /*virtual*/ BOOL hasMouseCapture() { return gFocusMgr.getMouseCapture() == this; };
187
188 // Inherited from LLPluginClassMediaOwner
189 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, LLPluginClassMediaOwner::EMediaEvent);
190
191 // LLEditMenuHandler overrides
192 /*virtual*/ void cut();
193 /*virtual*/ BOOL canCut() const;
194
195 /*virtual*/ void copy();
196 /*virtual*/ BOOL canCopy() const;
70 197
71 static std::string getMediaURL(); 198 /*virtual*/ void paste();
72 static std::string getMimeType(); 199 /*virtual*/ BOOL canPaste() const;
73 static void setMimeType(std::string mime_type); 200
201public:
202 // a single media url with some data and an impl.
203 LLPluginClassMedia* mMediaSource;
204 LLUUID mTextureId;
205 bool mMovieImageHasMips;
206 std::string mMediaURL;
207 std::string mHomeURL;
208 std::string mMimeType;
209 S32 mLastMouseX; // save the last mouse coord we get, so when we lose capture we can simulate a mouseup at that point.
210 S32 mLastMouseY;
211 S32 mMediaWidth;
212 S32 mMediaHeight;
213 bool mMediaAutoScale;
214 bool mMediaLoop;
215 bool mNeedsNewTexture;
216 bool mSuspendUpdates;
217 bool mVisible;
74 218
75 static void updateImagesMediaStreams();
76 219
77 private: 220private:
78 // Fill in initialization data for LLMediaManager::initClass() 221 LLViewerImage *updatePlaceholderImage();
79 static void buildMediaManagerData( LLMediaManagerData* init_data );
80}; 222};
81 223
82#endif // LLVIEWERMEDIA_H 224#endif // LLVIEWERMEDIA_H
diff --git a/linden/indra/newview/llviewermedia_streamingaudio.cpp b/linden/indra/newview/llviewermedia_streamingaudio.cpp
new file mode 100644
index 0000000..06946da
--- /dev/null
+++ b/linden/indra/newview/llviewermedia_streamingaudio.cpp
@@ -0,0 +1,169 @@
1/**
2 * @file llviewermedia_streamingaudio.h
3 * @author Tofu Linden, Sam Kolb
4 * @brief LLStreamingAudio_MediaPlugins implementation - an implementation of the streaming audio interface which is implemented as a client of the media plugins API.
5 *
6 * $LicenseInfo:firstyear=2009&license=viewergpl$
7 *
8 * Copyright (c) 2009, Linden Research, Inc.
9 *
10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab
12 * to you under the terms of the GNU General Public License, version 2.0
13 * ("GPL"), unless you have obtained a separate licensing agreement
14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 *
18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
23 *
24 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above,
26 * and agree to abide by those obligations.
27 *
28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
30 * COMPLETENESS OR PERFORMANCE.
31 * $/LicenseInfo$
32 */
33
34#include "llviewerprecompiledheaders.h"
35
36#include "linden_common.h"
37#include "llpluginclassmedia.h"
38#include "llviewermedia.h"
39
40#include "llviewermedia_streamingaudio.h"
41
42#include "llmimetypes.h"
43#include "llvfs.h"
44#include "lldir.h"
45
46
47LLStreamingAudio_MediaPlugins::LLStreamingAudio_MediaPlugins() :
48 mMediaPlugin(NULL),
49 mGain(1.0)
50{
51 // nothing interesting to do?
52 // we will lazily create a media plugin at play-time, if none exists.
53}
54
55LLStreamingAudio_MediaPlugins::~LLStreamingAudio_MediaPlugins()
56{
57 delete mMediaPlugin;
58 mMediaPlugin = NULL;
59}
60
61void LLStreamingAudio_MediaPlugins::start(const std::string& url)
62{
63 if (!mMediaPlugin) // lazy-init the underlying media plugin
64 {
65 mMediaPlugin = initializeMedia("audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis.
66 llinfos << "mMediaPlugin is now " << mMediaPlugin << llendl;
67 }
68
69 if(!mMediaPlugin)
70 return;
71
72 if (!url.empty()) {
73 llinfos << "Starting internet stream: " << url << llendl;
74 mURL = url;
75 mMediaPlugin->loadURI ( url );
76 mMediaPlugin->start();
77 llinfos << "Playing....." << llendl;
78 } else {
79 llinfos << "setting stream to NULL"<< llendl;
80 mURL.clear();
81 mMediaPlugin->stop();
82 }
83}
84
85void LLStreamingAudio_MediaPlugins::stop()
86{
87 if(mMediaPlugin)
88 {
89 mMediaPlugin->stop();
90 }
91
92 mURL.clear();
93}
94
95void LLStreamingAudio_MediaPlugins::pause(int pause)
96{
97 if(!mMediaPlugin)
98 return;
99
100 if(pause)
101 {
102 mMediaPlugin->pause();
103 }
104 else
105 {
106 mMediaPlugin->start();
107 }
108}
109
110void LLStreamingAudio_MediaPlugins::update()
111{
112 if (mMediaPlugin)
113 mMediaPlugin->idle();
114}
115
116int LLStreamingAudio_MediaPlugins::isPlaying()
117{
118 if (!mMediaPlugin)
119 return 0;
120
121 // *TODO: can probably do better than this
122 if (mMediaPlugin->isPluginRunning())
123 {
124 return 1; // Active and playing
125 }
126
127 if (mMediaPlugin->isPluginExited())
128 {
129 return 0; // stopped
130 }
131
132 return 2; // paused
133}
134
135void LLStreamingAudio_MediaPlugins::setGain(F32 vol)
136{
137 mGain = vol;
138
139 if(!mMediaPlugin)
140 return;
141
142 vol = llclamp(vol, 0.f, 1.f);
143 mMediaPlugin->setVolume(vol);
144}
145
146F32 LLStreamingAudio_MediaPlugins::getGain()
147{
148 return mGain;
149}
150
151std::string LLStreamingAudio_MediaPlugins::getURL()
152{
153 return mURL;
154}
155
156LLPluginClassMedia* LLStreamingAudio_MediaPlugins::initializeMedia(const std::string& media_type)
157{
158 LLPluginClassMediaOwner* owner = NULL;
159 S32 default_size = 1; // audio-only - be minimal, doesn't matter
160 LLPluginClassMedia* media_source = LLViewerMediaImpl::newSourceFromMediaType(media_type, owner, default_size, default_size);
161
162 if (media_source)
163 {
164 media_source->setLoop(false); // audio streams are not expected to loop
165 }
166
167 return media_source;
168}
169
diff --git a/linden/indra/newview/llviewermedia_streamingaudio.h b/linden/indra/newview/llviewermedia_streamingaudio.h
new file mode 100644
index 0000000..270bab7
--- /dev/null
+++ b/linden/indra/newview/llviewermedia_streamingaudio.h
@@ -0,0 +1,69 @@
1/**
2 * @file llviewermedia_streamingaudio.h
3 * @author Tofu Linden
4 * @brief Definition of LLStreamingAudio_MediaPlugins implementation - an implementation of the streaming audio interface which is implemented as a client of the media plugins API.
5 *
6 * $LicenseInfo:firstyear=2009&license=viewergpl$
7 *
8 * Copyright (c) 2009, Linden Research, Inc.
9 *
10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab
12 * to you under the terms of the GNU General Public License, version 2.0
13 * ("GPL"), unless you have obtained a separate licensing agreement
14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 *
18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
23 *
24 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above,
26 * and agree to abide by those obligations.
27 *
28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
30 * COMPLETENESS OR PERFORMANCE.
31 * $/LicenseInfo$
32 */
33
34#ifndef LL_VIEWERMEDIA_STREAMINGAUDIO_H
35#define LL_VIEWERMEDIA_STREAMINGAUDIO_H
36
37
38#include "stdtypes.h" // from llcommon
39
40#include "llstreamingaudio.h"
41
42class LLPluginClassMedia;
43
44class LLStreamingAudio_MediaPlugins : public LLStreamingAudioInterface
45{
46 public:
47 LLStreamingAudio_MediaPlugins();
48 /*virtual*/ ~LLStreamingAudio_MediaPlugins();
49
50 /*virtual*/ void start(const std::string& url);
51 /*virtual*/ void stop();
52 /*virtual*/ void pause(int pause);
53 /*virtual*/ void update();
54 /*virtual*/ int isPlaying();
55 /*virtual*/ void setGain(F32 vol);
56 /*virtual*/ F32 getGain();
57 /*virtual*/ std::string getURL();
58
59private:
60 LLPluginClassMedia* initializeMedia(const std::string& media_type);
61
62 LLPluginClassMedia *mMediaPlugin;
63
64 std::string mURL;
65 F32 mGain;
66};
67
68
69#endif //LL_VIEWERMEDIA_STREAMINGAUDIO_H
diff --git a/linden/indra/newview/llviewermediafocus.cpp b/linden/indra/newview/llviewermediafocus.cpp
new file mode 100644
index 0000000..2e372a1
--- /dev/null
+++ b/linden/indra/newview/llviewermediafocus.cpp
@@ -0,0 +1,359 @@
1/**
2 * @file llviewermediafocus.cpp
3 * @brief Governs focus on Media prims
4 *
5 * $LicenseInfo:firstyear=2003&license=viewergpl$
6 *
7 * Copyright (c) 2003-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * 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 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("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 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * 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 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#include "llviewerprecompiledheaders.h"
34
35#include "llviewermediafocus.h"
36
37//LLViewerMediaFocus
38#include "llviewerobjectlist.h"
39#include "llpanelmediahud.h"
40#include "llpluginclassmedia.h"
41#include "llagent.h"
42#include "lltoolpie.h"
43#include "llviewercamera.h"
44#include "llviewermedia.h"
45#include "llhudview.h"
46#include "lluictrlfactory.h"
47#include "lldrawable.h"
48#include "llparcel.h"
49#include "llviewerparcelmgr.h"
50#include "llweb.h"
51//
52// LLViewerMediaFocus
53//
54
55LLViewerMediaFocus::LLViewerMediaFocus()
56: mMouseOverFlag(false)
57{
58}
59
60LLViewerMediaFocus::~LLViewerMediaFocus()
61{
62 // The destructor for LLSingletons happens at atexit() time, which is too late to do much.
63 // Clean up in cleanupClass() instead.
64}
65
66void LLViewerMediaFocus::cleanupClass()
67{
68 LLViewerMediaFocus *self = LLViewerMediaFocus::getInstance();
69
70 if(self)
71 {
72 // mMediaHUD will have been deleted by this point -- don't try to delete it.
73
74 /* Richard says:
75 all widgets are supposed to be destroyed at the same time
76 you shouldn't hold on to pointer to them outside of ui code
77 you can use the LLHandle approach
78 if you want to be type safe, you'll need to add a LLRootHandle to whatever derived class you are pointing to
79 look at llview::gethandle
80 its our version of a weak pointer
81 */
82 if(self->mMediaHUD.get())
83 {
84 self->mMediaHUD.get()->setMediaImpl(NULL);
85 }
86 self->mMediaImpl = NULL;
87 }
88
89}
90
91
92void LLViewerMediaFocus::setFocusFace( BOOL b, LLPointer<LLViewerObject> objectp, S32 face, viewer_media_t media_impl )
93{
94 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
95 if (b && media_impl.notNull())
96 {
97 mMediaImpl = media_impl;
98 LLSelectMgr::getInstance()->deselectAll();
99 LLSelectMgr::getInstance()->selectObjectOnly(objectp, face);
100
101 mFocus = LLSelectMgr::getInstance()->getSelection();
102 if(mMediaHUD.get() && ! parcel->getMediaPreventCameraZoom())
103 {
104 mMediaHUD.get()->resetZoomLevel();
105 mMediaHUD.get()->nextZoomLevel();
106 }
107 if (!mFocus->isEmpty())
108 {
109 gFocusMgr.setKeyboardFocus(this);
110 }
111 mObjectID = objectp->getID();
112 // LLViewerMedia::addObserver(this, mObjectID);
113
114
115 }
116 else
117 {
118 gFocusMgr.setKeyboardFocus(NULL);
119 if(! parcel->getMediaPreventCameraZoom())
120 {
121 if (!mFocus->isEmpty())
122 {
123 gAgent.setFocusOnAvatar(TRUE, ANIMATE);
124 }
125 }
126 mFocus = NULL;
127 // LLViewerMedia::remObserver(this, mObjectID);
128
129 // Null out the media hud media pointer
130 if(mMediaHUD.get())
131 {
132 mMediaHUD.get()->setMediaImpl(NULL);
133 }
134
135 // and null out the media impl
136 mMediaImpl = NULL;
137 }
138 if(mMediaHUD.get())
139 {
140 mMediaHUD.get()->setMediaFocus(b);
141 }
142}
143bool LLViewerMediaFocus::getFocus()
144{
145 if (gFocusMgr.getKeyboardFocus() == this)
146 {
147 return true;
148 }
149 return false;
150}
151
152// This function selects an ideal viewing distance given a selection bounding box, normal, and padding value
153void LLViewerMediaFocus::setCameraZoom(F32 padding_factor)
154{
155 LLPickInfo& pick = LLToolPie::getInstance()->getPick();
156
157 if(LLSelectMgr::getInstance()->getSelection()->isEmpty())
158 {
159 pick = mPickInfo;
160 setFocusFace(true, pick.getObject(), pick.mObjectFace, mMediaImpl);
161 }
162
163 if (!LLSelectMgr::getInstance()->getSelection()->isEmpty())
164 {
165 gAgent.setFocusOnAvatar(FALSE, ANIMATE);
166
167 LLBBox selection_bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
168 F32 height;
169 F32 width;
170 F32 depth;
171 F32 angle_of_view;
172 F32 distance;
173
174 // We need the aspect ratio, and the 3 components of the bbox as height, width, and depth.
175 F32 aspect_ratio = getBBoxAspectRatio(selection_bbox, pick.mNormal, &height, &width, &depth);
176 F32 camera_aspect = LLViewerCamera::getInstance()->getAspect();
177
178 // We will normally use the side of the volume aligned with the short side of the screen (i.e. the height for
179 // a screen in a landscape aspect ratio), however there is an edge case where the aspect ratio of the object is
180 // more extreme than the screen. In this case we invert the logic, using the longer component of both the object
181 // and the screen.
182 bool invert = (camera_aspect > 1.0f && aspect_ratio > camera_aspect) ||
183 (camera_aspect < 1.0f && aspect_ratio < camera_aspect);
184
185 // To calculate the optimum viewing distance we will need the angle of the shorter side of the view rectangle.
186 // In portrait mode this is the width, and in landscape it is the height.
187 // We then calculate the distance based on the corresponding side of the object bbox (width for portrait, height for landscape)
188 // We will add half the depth of the bounding box, as the distance projection uses the center point of the bbox.
189 if(camera_aspect < 1.0f || invert)
190 {
191 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect());
192 distance = width * 0.5 * padding_factor / tan(angle_of_view * 0.5f );
193 }
194 else
195 {
196 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getView());
197 distance = height * 0.5 * padding_factor / tan(angle_of_view * 0.5f );
198 }
199
200 distance += depth * 0.5;
201
202 // Finally animate the camera to this new position and focal point
203 gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(pick.mNormal * distance),
204 LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getFirstObject()->mID );
205 }
206}
207void LLViewerMediaFocus::onFocusReceived()
208{
209 if(mMediaImpl.notNull())
210 mMediaImpl->focus(true);
211
212 LLFocusableElement::onFocusReceived();
213}
214
215void LLViewerMediaFocus::onFocusLost()
216{
217 if(mMediaImpl.notNull())
218 mMediaImpl->focus(false);
219 gViewerWindow->focusClient();
220 mFocus = NULL;
221 LLFocusableElement::onFocusLost();
222}
223void LLViewerMediaFocus::setMouseOverFlag(bool b, viewer_media_t media_impl)
224{
225 if (b && media_impl.notNull())
226 {
227 if(! mMediaHUD.get())
228 {
229 LLPanelMediaHUD* media_hud = new LLPanelMediaHUD(mMediaImpl);
230 mMediaHUD = media_hud->getHandle();
231 gHUDView->addChild(media_hud);
232 }
233 mMediaHUD.get()->setMediaImpl(media_impl);
234 mMediaImpl = media_impl;
235 }
236 mMouseOverFlag = b;
237}
238LLUUID LLViewerMediaFocus::getSelectedUUID()
239{
240 LLViewerObject* object = mFocus->getFirstObject();
241 return object ? object->getID() : LLUUID::null;
242}
243#if 0 // Must re-implement when the new media api event system is ready
244void LLViewerMediaFocus::onNavigateComplete( const EventType& event_in )
245{
246 if (hasFocus() && mLastURL != event_in.getStringValue())
247 {
248 LLViewerMedia::focus(true, mObjectID);
249 // spoof mouse event to reassert focus
250 LLViewerMedia::mouseDown(1,1, mObjectID);
251 LLViewerMedia::mouseUp(1,1, mObjectID);
252 }
253 mLastURL = event_in.getStringValue();
254}
255#endif
256BOOL LLViewerMediaFocus::handleKey(KEY key, MASK mask, BOOL called_from_parent)
257{
258 if(mMediaImpl.notNull())
259 mMediaImpl->handleKeyHere(key, mask);
260 return true;
261}
262
263BOOL LLViewerMediaFocus::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent)
264{
265 if(mMediaImpl.notNull())
266 mMediaImpl->handleUnicodeCharHere(uni_char);
267 return true;
268}
269BOOL LLViewerMediaFocus::handleScrollWheel(S32 x, S32 y, S32 clicks)
270{
271 BOOL retval = FALSE;
272 if(mFocus.notNull() && mMediaImpl.notNull() && mMediaImpl->hasMedia())
273 {
274 mMediaImpl->getMediaPlugin()->scrollEvent(x, y, clicks);
275 retval = TRUE;
276 }
277 return retval;
278}
279
280void LLViewerMediaFocus::update()
281{
282 if (mMediaHUD.get())
283 {
284 if(mFocus.notNull() || mMouseOverFlag || mMediaHUD.get()->isMouseOver())
285 {
286 // mMediaHUD.get()->setVisible(true);
287 mMediaHUD.get()->updateShape();
288 }
289 else
290 {
291 mMediaHUD.get()->setVisible(false);
292 }
293 }
294}
295// This function calculates the aspect ratio and the world aligned components of a selection bounding box.
296F32 LLViewerMediaFocus::getBBoxAspectRatio(const LLBBox& bbox, const LLVector3& normal, F32* height, F32* width, F32* depth)
297{
298 // Convert the selection normal and an up vector to local coordinate space of the bbox
299 LLVector3 local_normal = bbox.agentToLocalBasis(normal);
300 LLVector3 z_vec = bbox.agentToLocalBasis(LLVector3(0.0f, 0.0f, 1.0f));
301
302 LLVector3 comp1(0.f,0.f,0.f);
303 LLVector3 comp2(0.f,0.f,0.f);
304 LLVector3 bbox_max = bbox.getExtentLocal();
305 F32 dot1 = 0.f;
306 F32 dot2 = 0.f;
307
308 // The largest component of the localized normal vector is the depth component
309 // meaning that the other two are the legs of the rectangle.
310 local_normal.abs();
311 if(local_normal.mV[VX] > local_normal.mV[VY])
312 {
313 if(local_normal.mV[VX] > local_normal.mV[VZ])
314 {
315 // Use the y and z comps
316 comp1.mV[VY] = bbox_max.mV[VY];
317 comp2.mV[VZ] = bbox_max.mV[VZ];
318 *depth = bbox_max.mV[VX];
319 }
320 else
321 {
322 // Use the x and y comps
323 comp1.mV[VY] = bbox_max.mV[VY];
324 comp2.mV[VZ] = bbox_max.mV[VZ];
325 *depth = bbox_max.mV[VZ];
326 }
327 }
328 else if(local_normal.mV[VY] > local_normal.mV[VZ])
329 {
330 // Use the x and z comps
331 comp1.mV[VX] = bbox_max.mV[VX];
332 comp2.mV[VZ] = bbox_max.mV[VZ];
333 *depth = bbox_max.mV[VY];
334 }
335 else
336 {
337 // Use the x and y comps
338 comp1.mV[VY] = bbox_max.mV[VY];
339 comp2.mV[VZ] = bbox_max.mV[VZ];
340 *depth = bbox_max.mV[VX];
341 }
342
343 // The height is the vector closest to vertical in the bbox coordinate space (highest dot product value)
344 dot1 = comp1 * z_vec;
345 dot2 = comp2 * z_vec;
346 if(fabs(dot1) > fabs(dot2))
347 {
348 *height = comp1.length();
349 *width = comp2.length();
350 }
351 else
352 {
353 *height = comp2.length();
354 *width = comp1.length();
355 }
356
357 // Return the aspect ratio.
358 return *width / *height;
359}
diff --git a/linden/indra/newview/llviewermediafocus.h b/linden/indra/newview/llviewermediafocus.h
new file mode 100644
index 0000000..ed9597e
--- /dev/null
+++ b/linden/indra/newview/llviewermediafocus.h
@@ -0,0 +1,91 @@
1/**
2 * @file llpanelmsgs.h
3 * @brief Message popup preferences panel
4 *
5 * $LicenseInfo:firstyear=2003&license=viewergpl$
6 *
7 * Copyright (c) 2003-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * 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 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("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 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * 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 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#ifndef LL_VIEWERMEDIAFOCUS_H
34#define LL_VIEWERMEDIAFOCUS_H
35
36// includes for LLViewerMediaFocus
37#include "llfocusmgr.h"
38#include "llviewermedia.h"
39#include "llviewerobject.h"
40#include "llviewerwindow.h"
41#include "llselectmgr.h"
42
43class LLViewerMediaImpl;
44class LLPanelMediaHUD;
45
46class LLViewerMediaFocus :
47 public LLFocusableElement,
48 public LLSingleton<LLViewerMediaFocus>
49{
50public:
51 LLViewerMediaFocus();
52 ~LLViewerMediaFocus();
53
54 static void cleanupClass();
55
56 void setFocusFace(BOOL b, LLPointer<LLViewerObject> objectp, S32 face, viewer_media_t media_impl);
57 void clearFocus() { setFocusFace(false, NULL, 0, NULL); }
58 /*virtual*/ bool getFocus();
59 /*virtual*/ // void onNavigateComplete( const EventType& event_in );
60
61 /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
62 /*virtual*/ BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent);
63 BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
64
65 LLUUID getSelectedUUID();
66 LLObjectSelectionHandle getSelection() { return mFocus; }
67
68 void update();
69
70 void setCameraZoom(F32 padding_factor);
71 void setMouseOverFlag(bool b, viewer_media_t media_impl = NULL);
72 bool getMouseOverFlag() { return mMouseOverFlag; }
73 void setPickInfo(LLPickInfo pick_info) { mPickInfo = pick_info; }
74 F32 getBBoxAspectRatio(const LLBBox& bbox, const LLVector3& normal, F32* height, F32* width, F32* depth);
75
76protected:
77 /*virtual*/ void onFocusReceived();
78 /*virtual*/ void onFocusLost();
79
80private:
81 LLObjectSelectionHandle mFocus;
82 std::string mLastURL;
83 bool mMouseOverFlag;
84 LLPickInfo mPickInfo;
85 LLHandle<LLPanelMediaHUD> mMediaHUD;
86 LLUUID mObjectID;
87 viewer_media_t mMediaImpl;
88};
89
90
91#endif // LL_VIEWERMEDIAFOCUS_H
diff --git a/linden/indra/llmedia/llmediaimplexample1.h b/linden/indra/newview/llviewermediaobserver.h
index 1b90e93..6667f98 100644
--- a/linden/indra/llmedia/llmediaimplexample1.h
+++ b/linden/indra/newview/llviewermediaobserver.h
@@ -1,6 +1,6 @@
1/** 1/**
2 * @file llmediaimplexample1.h 2 * @file llviewermediaobserver.h
3 * @brief Example 1 of a media impl concrete class 3 * @brief Methods to override to catch events from LLViewerMedia class
4 * 4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$ 5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 * 6 *
@@ -30,44 +30,42 @@
30 * $/LicenseInfo$ 30 * $/LicenseInfo$
31 */ 31 */
32 32
33#ifndef LLMEDIAIMPLEXAMPLE1_H 33#ifndef LLVIEWERMEDIAOBSERVER_H
34#define LLMEDIAIMPLEXAMPLE1_H 34#define LLVIEWERMEDIAOBSERVER_H
35 35
36#include "llmediaimplcommon.h" 36#include "llpluginclassmediaowner.h"
37#include "llmediaimplfactory.h"
38 37
39class LLMediaManagerData; 38class LLViewerMediaEventEmitter;
40 39
41class LLMediaImplExample1 : 40class LLViewerMediaObserver : public LLPluginClassMediaOwner
42 public LLMediaImplCommon
43{ 41{
44 public: 42public:
45 LLMediaImplExample1(); 43 virtual ~LLViewerMediaObserver();
44
45private:
46 // Emitters will manage this list in addObserver/remObserver.
47 friend class LLViewerMediaEventEmitter;
48 std::list<LLViewerMediaEventEmitter *> mEmitters;
49};
46 50
47 static bool startup( LLMediaManagerData* init_data );
48 static bool closedown();
49 51
50 /* virtual */ bool init(); 52#if 0
51 /* virtual */ bool navigateTo( const std::string url ); 53 // Classes that inherit from LLViewerMediaObserver should add this to their class declaration:
52 /* virtual */ bool updateMedia(); 54
53 /* virtual */ std::string getVersion(); 55 // inherited from LLViewerMediaObserver
54 /* virtual */ unsigned char* getMediaData(); 56 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
55 /* virtual */ bool reset(); 57
56 /* virtual */ bool mouseMove( int x_pos, int y_pos ); 58 /* and will probably need to add this to their cpp file:
57 /* virtual */ bool setRequestedMediaSize( int width, int height );
58 59
59 private: 60 #include "llpluginclassmedia.h"
60 unsigned char* mMediaPixels;
61};
62 61
63class LLMediaImplExample1Maker : public LLMediaImplMaker 62 */
64{ 63
65 public: 64 // The list of events is in llpluginclassmediaowner.h
66 LLMediaImplExample1Maker(); 65
67 LLMediaImplExample1* create() 66
68 { 67#endif
69 return new LLMediaImplExample1(); 68
70 } 69
71}; 70#endif // LLVIEWERMEDIAOBSERVER_H
72 71
73#endif // LLMEDIAIMPLEXAMPLE1_H
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index fd6e842..7266dbc 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -40,7 +40,7 @@
40#include <sstream> 40#include <sstream>
41 41
42// linden library includes 42// linden library includes
43#include "audioengine.h" 43#include "llaudioengine.h"
44#include "indra_constants.h" 44#include "indra_constants.h"
45#include "llassetstorage.h" 45#include "llassetstorage.h"
46#include "llchat.h" 46#include "llchat.h"
@@ -111,9 +111,8 @@
111#include "llfloatergroupinfo.h" 111#include "llfloatergroupinfo.h"
112#include "llfloatergroupinvite.h" 112#include "llfloatergroupinvite.h"
113#include "llfloatergroups.h" 113#include "llfloatergroups.h"
114#include "llfloaterhtml.h"
115#include "llfloaterhtmlcurrency.h" 114#include "llfloaterhtmlcurrency.h"
116#include "llfloaterhtmlhelp.h" // gViewerHtmlHelp 115#include "llfloatermediabrowser.h" // gViewerHtmlHelp
117#include "llfloaterhtmlsimple.h" 116#include "llfloaterhtmlsimple.h"
118#include "llfloaterhud.h" 117#include "llfloaterhud.h"
119#include "llfloaterinspect.h" 118#include "llfloaterinspect.h"
@@ -158,6 +157,7 @@
158#include "lllineeditor.h" 157#include "lllineeditor.h"
159#include "llmenucommands.h" 158#include "llmenucommands.h"
160#include "llmenugl.h" 159#include "llmenugl.h"
160#include "llmimetypes.h"
161#include "llmorphview.h" 161#include "llmorphview.h"
162#include "llmoveview.h" 162#include "llmoveview.h"
163#include "llmutelist.h" 163#include "llmutelist.h"
@@ -934,6 +934,14 @@ void init_client_menu(LLMenuGL* menu)
934 menu->appendMenu( sub ); 934 menu->appendMenu( sub );
935 sub->createJumpKeys(); 935 sub->createJumpKeys();
936 } 936 }
937 {
938 LLMenuGL* sub = NULL;
939 sub = new LLMenuGL("Media");
940 sub->append(new LLMenuItemCallGL("Reload MIME types", &LLMIMETypes::reload));
941 sub->append(new LLMenuItemCallGL("Web Browser Test", &handle_web_browser_test));
942 menu->appendMenu( sub );
943 sub->createJumpKeys();
944 }
937 945
938 menu->appendSeparator(); 946 menu->appendSeparator();
939 947
@@ -1063,6 +1071,7 @@ void init_debug_ui_menu(LLMenuGL* menu)
1063 menu->appendSeparator(); 1071 menu->appendSeparator();
1064 1072
1065 menu->append(new LLMenuItemCallGL("Web Browser Test", &handle_web_browser_test)); 1073 menu->append(new LLMenuItemCallGL("Web Browser Test", &handle_web_browser_test));
1074
1066 // commented out until work is complete: DEV-32268 1075 // commented out until work is complete: DEV-32268
1067 // menu->append(new LLMenuItemCallGL("Buy Currency Test", &handle_buy_currency_test)); 1076 // menu->append(new LLMenuItemCallGL("Buy Currency Test", &handle_buy_currency_test));
1068 menu->append(new LLMenuItemCallGL("Editable UI", &edit_ui)); 1077 menu->append(new LLMenuItemCallGL("Editable UI", &edit_ui));
@@ -5493,6 +5502,7 @@ class LLWorldSetAway : public view_listener_t
5493 if (gAgent.getAFK()) 5502 if (gAgent.getAFK())
5494 { 5503 {
5495 gAgent.clearAFK(); 5504 gAgent.clearAFK();
5505 llinfos << "Spawning HTML help window" << llendl;
5496 } 5506 }
5497 else 5507 else
5498 { 5508 {
@@ -6045,10 +6055,10 @@ class LLShowFloater : public view_listener_t
6045 { 6055 {
6046 JCFloaterAnimList::toggleInstance(LLSD()); 6056 JCFloaterAnimList::toggleInstance(LLSD());
6047 } 6057 }
6048 else if (floater_name == "inworld browser") 6058//imprudence fixme else if (floater_name == "inworld browser")
6049 { 6059// {
6050 LLFloaterMediaBrowser::toggleInstance(LLSD()); 6060// LLFloaterMediaBrowser::toggle();
6051 } 6061// }
6052 else if (floater_name == "beacons") 6062 else if (floater_name == "beacons")
6053 { 6063 {
6054 LLFloaterBeacons::toggleInstance(LLSD()); 6064 LLFloaterBeacons::toggleInstance(LLSD());
@@ -7844,7 +7854,7 @@ void handle_grab_texture(void* data)
7844 // user know that the image is now in inventory. 7854 // user know that the image is now in inventory.
7845 if(view) 7855 if(view)
7846 { 7856 {
7847 LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); 7857 LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
7848 7858
7849 view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO); 7859 view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO);
7850 view->getPanel()->openSelected(); 7860 view->getPanel()->openSelected();
@@ -8048,13 +8058,7 @@ void handle_load_from_xml(void*)
8048 8058
8049void handle_web_browser_test(void*) 8059void handle_web_browser_test(void*)
8050{ 8060{
8051 const bool open_links_externally = false; 8061 LLWeb::loadURL("http://secondlife.com/app/search/slurls.html");
8052 const bool open_app_slurls = true;
8053 LLFloaterHtml::getInstance()->show(
8054 "http://secondlife.com/app/search/slurls.html",
8055 "Web Browser Test",
8056 open_links_externally,
8057 open_app_slurls);
8058} 8062}
8059 8063
8060void handle_buy_currency_test(void*) 8064void handle_buy_currency_test(void*)
diff --git a/linden/indra/newview/llviewermenufile.cpp b/linden/indra/newview/llviewermenufile.cpp
index 364dcfd..d3473df 100644
--- a/linden/indra/newview/llviewermenufile.cpp
+++ b/linden/indra/newview/llviewermenufile.cpp
@@ -66,7 +66,7 @@
66#include "llstring.h" 66#include "llstring.h"
67#include "lltransactiontypes.h" 67#include "lltransactiontypes.h"
68#include "lluuid.h" 68#include "lluuid.h"
69#include "vorbisencode.h" 69#include "llvorbisencode.h"
70 70
71// system libraries 71// system libraries
72#include <boost/tokenizer.hpp> 72#include <boost/tokenizer.hpp>
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index bfd1045..9f6ae3d 100755
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -37,7 +37,7 @@
37 37
38#include <deque> 38#include <deque>
39 39
40#include "audioengine.h" 40#include "llaudioengine.h"
41#include "indra_constants.h" 41#include "indra_constants.h"
42#include "lscript_byteformat.h" 42#include "lscript_byteformat.h"
43#include "mean_collision_data.h" 43#include "mean_collision_data.h"
@@ -972,7 +972,7 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
972 LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL; 972 LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL;
973 //highlight item 973 //highlight item
974 974
975 LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); 975 LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
976 view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO); 976 view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO);
977 gFocusMgr.setKeyboardFocus(focus_ctrl); 977 gFocusMgr.setKeyboardFocus(focus_ctrl);
978 } 978 }
@@ -5197,11 +5197,11 @@ void mean_name_callback(const LLUUID &id, const std::string& first, const std::s
5197 return; 5197 return;
5198 } 5198 }
5199 5199
5200 static const int max_collision_list_size = 20; 5200 static const U32 max_collision_list_size = 20;
5201 if (gMeanCollisionList.size() > max_collision_list_size) 5201 if (gMeanCollisionList.size() > max_collision_list_size)
5202 { 5202 {
5203 mean_collision_list_t::iterator iter = gMeanCollisionList.begin(); 5203 mean_collision_list_t::iterator iter = gMeanCollisionList.begin();
5204 for (S32 i=0; i<max_collision_list_size; i++) iter++; 5204 for (U32 i=0; i<max_collision_list_size; i++) iter++;
5205 for_each(iter, gMeanCollisionList.end(), DeletePointer()); 5205 for_each(iter, gMeanCollisionList.end(), DeletePointer());
5206 gMeanCollisionList.erase(iter, gMeanCollisionList.end()); 5206 gMeanCollisionList.erase(iter, gMeanCollisionList.end());
5207 } 5207 }
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp
index a854583..b40d4e0 100644
--- a/linden/indra/newview/llviewerobject.cpp
+++ b/linden/indra/newview/llviewerobject.cpp
@@ -34,7 +34,7 @@
34 34
35#include "llviewerobject.h" 35#include "llviewerobject.h"
36 36
37#include "audioengine.h" 37#include "llaudioengine.h"
38#include "imageids.h" 38#include "imageids.h"
39#include "indra_constants.h" 39#include "indra_constants.h"
40#include "llmath.h" 40#include "llmath.h"
diff --git a/linden/indra/newview/llviewerparcelmedia.cpp b/linden/indra/newview/llviewerparcelmedia.cpp
index b98f418..c7f0c4b 100644
--- a/linden/indra/newview/llviewerparcelmedia.cpp
+++ b/linden/indra/newview/llviewerparcelmedia.cpp
@@ -41,47 +41,22 @@
41#include "llviewerparcelmgr.h" 41#include "llviewerparcelmgr.h"
42#include "lluuid.h" 42#include "lluuid.h"
43#include "message.h" 43#include "message.h"
44#include "llviewermediafocus.h"
44#include "llviewerparcelmediaautoplay.h" 45#include "llviewerparcelmediaautoplay.h"
45#include "llviewerwindow.h" 46#include "llviewerwindow.h"
46#include "llfirstuse.h" 47#include "llfirstuse.h"
48#include "llpluginclassmedia.h"
47 49
48// Static Variables 50// Static Variables
49 51
50S32 LLViewerParcelMedia::sMediaParcelLocalID = 0; 52S32 LLViewerParcelMedia::sMediaParcelLocalID = 0;
51LLUUID LLViewerParcelMedia::sMediaRegionID; 53LLUUID LLViewerParcelMedia::sMediaRegionID;
54viewer_media_t LLViewerParcelMedia::sMediaImpl;
55
52 56
53// Local functions 57// Local functions
54bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel); 58bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel);
55 59
56// Move this to its own file.
57// helper class that tries to download a URL from a web site and calls a method
58// on the Panel Land Media and to discover the MIME type
59class LLMimeDiscoveryResponder : public LLHTTPClient::Responder
60{
61public:
62 LLMimeDiscoveryResponder( )
63 {}
64
65
66
67 virtual void completedHeader(U32 status, const std::string& reason, const LLSD& content)
68 {
69 std::string media_type = content["content-type"].asString();
70 std::string::size_type idx1 = media_type.find_first_of(";");
71 std::string mime_type = media_type.substr(0, idx1);
72 completeAny(status, mime_type);
73 }
74
75 virtual void error( U32 status, const std::string& reason )
76 {
77 completeAny(status, "none/none");
78 }
79
80 void completeAny(U32 status, const std::string& mime_type)
81 {
82 LLViewerMedia::setMimeType(mime_type);
83 }
84};
85 60
86// static 61// static
87void LLViewerParcelMedia::initClass() 62void LLViewerParcelMedia::initClass()
@@ -92,6 +67,13 @@ void LLViewerParcelMedia::initClass()
92 LLViewerParcelMediaAutoPlay::initClass(); 67 LLViewerParcelMediaAutoPlay::initClass();
93} 68}
94 69
70//static
71void LLViewerParcelMedia::cleanupClass()
72{
73 // This needs to be destroyed before global destructor time.
74 sMediaImpl = NULL;
75}
76
95////////////////////////////////////////////////////////////////////////////////////////// 77//////////////////////////////////////////////////////////////////////////////////////////
96// static 78// static
97void LLViewerParcelMedia::update(LLParcel* parcel) 79void LLViewerParcelMedia::update(LLParcel* parcel)
@@ -105,6 +87,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
105 { 87 {
106 sMediaRegionID = LLUUID() ; 88 sMediaRegionID = LLUUID() ;
107 stop() ; 89 stop() ;
90 LL_DEBUGS("Media") << "no agent region, bailing out." << LL_ENDL;
108 return ; 91 return ;
109 } 92 }
110 93
@@ -115,64 +98,54 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
115 LLUUID regionid = gAgent.getRegion()->getRegionID(); 98 LLUUID regionid = gAgent.getRegion()->getRegionID();
116 if (parcelid != sMediaParcelLocalID || regionid != sMediaRegionID) 99 if (parcelid != sMediaParcelLocalID || regionid != sMediaRegionID)
117 { 100 {
101 LL_DEBUGS("Media") << "New parcel, parcel id = " << parcelid << ", region id = " << regionid << LL_ENDL;
118 sMediaParcelLocalID = parcelid; 102 sMediaParcelLocalID = parcelid;
119 sMediaRegionID = regionid; 103 sMediaRegionID = regionid;
120 new_parcel = true; 104 new_parcel = true;
121 } 105 }
122 106
123 std::string mediaUrl = std::string ( parcel->getMediaURL () ); 107 std::string mediaUrl = std::string ( parcel->getMediaURL () );
108 std::string mediaCurrentUrl = std::string( parcel->getMediaCurrentURL());
109
110 // First use warning
111 if( ! mediaUrl.empty() && gSavedSettings.getWarning("FirstStreamingVideo") )
112 {
113 LLNotifications::instance().add("ParcelCanPlayMedia", LLSD(), LLSD(),
114 boost::bind(callback_play_media, _1, _2, parcel));
115 return;
116
117 }
118
119 // if we have a current (link sharing) url, use it instead
120 if (mediaCurrentUrl != "" && parcel->getMediaType() == "text/html")
121 {
122 mediaUrl = mediaCurrentUrl;
123 }
124
124 LLStringUtil::trim(mediaUrl); 125 LLStringUtil::trim(mediaUrl);
126
127 // If no parcel media is playing, nothing left to do
128 if(sMediaImpl.isNull())
125 129
126 // has something changed?
127 if ( ( LLViewerMedia::getMediaURL() != mediaUrl )
128 || ( LLViewerMedia::getMediaTextureID() != parcel->getMediaID () ) )
129 { 130 {
130 bool video_was_playing = FALSE; 131 return;
131 bool same_media_id = LLViewerMedia::getMediaTextureID() == parcel->getMediaID (); 132 }
132 133
133 if (LLViewerMedia::isMediaPlaying()) 134 // Media is playing...has something changed?
135 else if (( sMediaImpl->getMediaURL() != mediaUrl )
136 || ( sMediaImpl->getMediaTextureID() != parcel->getMediaID() )
137 || ( sMediaImpl->getMimeType() != parcel->getMediaType() ))
138 {
139 // Only play if the media types are the same.
140 if(sMediaImpl->getMimeType() == parcel->getMediaType())
134 { 141 {
135 video_was_playing = TRUE; 142 play(parcel);
136 } 143 }
137 144
138 if ( !mediaUrl.empty() && same_media_id && ! new_parcel)
139 {
140 // Someone has "changed the channel", changing the URL of a video
141 // you were already watching. Automatically play provided the texture ID is the same
142 if (video_was_playing)
143 {
144 // Poke the mime type in before calling play.
145 // This is necessary because in this instance we are not waiting
146 // for the results of a header curl. In order to change the channel
147 // a mime type MUST be provided.
148 LLViewerMedia::setMimeType(parcel->getMediaType());
149 play(parcel);
150 }
151 }
152 else 145 else
153 { 146 {
154 stop(); 147 stop();
155 } 148 }
156
157 // Discover the MIME type
158 // Disabled for the time being. Get the mime type from the parcel.
159 if(gSavedSettings.getBOOL("AutoMimeDiscovery"))
160 {
161 LLHTTPClient::getHeaderOnly( mediaUrl, new LLMimeDiscoveryResponder());
162 }
163 else
164 {
165 LLViewerMedia::setMimeType(parcel->getMediaType());
166 }
167
168 // First use warning
169 if( gSavedSettings.getWarning("FirstStreamingVideo") )
170 {
171 LLNotifications::instance().add("ParcelCanPlayMedia", LLSD(), LLSD(),
172 boost::bind(callback_play_media, _1, _2, parcel));
173
174 }
175
176 } 149 }
177 } 150 }
178 else 151 else
@@ -183,7 +156,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
183 /* 156 /*
184 else 157 else
185 { 158 {
186 // no audio player, do a first use dialog if their is media here 159 // no audio player, do a first use dialog if there is media here
187 if (parcel) 160 if (parcel)
188 { 161 {
189 std::string mediaUrl = std::string ( parcel->getMediaURL () ); 162 std::string mediaUrl = std::string ( parcel->getMediaURL () );
@@ -212,15 +185,54 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
212 return; 185 return;
213 186
214 std::string media_url = parcel->getMediaURL(); 187 std::string media_url = parcel->getMediaURL();
188 std::string media_current_url = parcel->getMediaCurrentURL();
215 std::string mime_type = parcel->getMediaType(); 189 std::string mime_type = parcel->getMediaType();
216 LLUUID placeholder_texture_id = parcel->getMediaID(); 190 LLUUID placeholder_texture_id = parcel->getMediaID();
217 U8 media_auto_scale = parcel->getMediaAutoScale(); 191 U8 media_auto_scale = parcel->getMediaAutoScale();
218 U8 media_loop = parcel->getMediaLoop(); 192 U8 media_loop = parcel->getMediaLoop();
219 S32 media_width = parcel->getMediaWidth(); 193 S32 media_width = parcel->getMediaWidth();
220 S32 media_height = parcel->getMediaHeight(); 194 S32 media_height = parcel->getMediaHeight();
221 LLViewerMedia::play(media_url, mime_type, placeholder_texture_id, 195
222 media_width, media_height, media_auto_scale, 196 if(sMediaImpl)
223 media_loop); 197 {
198 // If the url and mime type are the same, call play again
199 if(sMediaImpl->getMediaURL() == media_url
200 && sMediaImpl->getMimeType() == mime_type
201 && sMediaImpl->getMediaTextureID() == placeholder_texture_id)
202 {
203 LL_DEBUGS("Media") << "playing with existing url " << media_url << LL_ENDL;
204
205 sMediaImpl->play();
206 }
207 // Else if the texture id's are the same, navigate and rediscover type
208 // MBW -- This causes other state from the previous parcel (texture size, autoscale, and looping) to get re-used incorrectly.
209 // It's also not really necessary -- just creating a new instance is fine.
210// else if(sMediaImpl->getMediaTextureID() == placeholder_texture_id)
211// {
212// sMediaImpl->navigateTo(media_url, mime_type, true);
213// }
214 else
215 {
216 // Since the texture id is different, we need to generate a new impl
217 LL_DEBUGS("Media") << "new media impl with mime type " << mime_type << ", url " << media_url << LL_ENDL;
218
219 // Delete the old one first so they don't fight over the texture.
220 sMediaImpl->stop();
221
222 sMediaImpl = LLViewerMedia::newMediaImpl(media_url, placeholder_texture_id,
223 media_width, media_height, media_auto_scale,
224 media_loop);
225 }
226 }
227 else
228 {
229 // There is no media impl, make a new one
230 sMediaImpl = LLViewerMedia::newMediaImpl(media_url, placeholder_texture_id,
231 media_width, media_height, media_auto_scale,
232 media_loop);
233 }
234
235
224 LLFirstUse::useMedia(); 236 LLFirstUse::useMedia();
225 237
226 LLViewerParcelMediaAutoPlay::playStarted(); 238 LLViewerParcelMediaAutoPlay::playStarted();
@@ -229,20 +241,38 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
229// static 241// static
230void LLViewerParcelMedia::stop() 242void LLViewerParcelMedia::stop()
231{ 243{
244 if(sMediaImpl.isNull())
245 {
246 return;
247 }
248
249 // We need to remove the media HUD if it is up.
250 LLViewerMediaFocus::getInstance()->clearFocus();
232 251
233 LLViewerMedia::stop(); 252 // This will kill the media instance.
253 sMediaImpl->stop();
254 sMediaImpl = NULL;
234} 255}
235 256
236// static 257// static
237void LLViewerParcelMedia::pause() 258void LLViewerParcelMedia::pause()
238{ 259{
239 LLViewerMedia::pause(); 260 if(sMediaImpl.isNull())
261 {
262 return;
263 }
264 sMediaImpl->pause();
240} 265}
241 266
242// static 267// static
243void LLViewerParcelMedia::start() 268void LLViewerParcelMedia::start()
244{ 269{
245 LLViewerMedia::start(); 270 if(sMediaImpl.isNull())
271 {
272 return;
273 }
274 sMediaImpl->start();
275
246 LLFirstUse::useMedia(); 276 LLFirstUse::useMedia();
247 277
248 LLViewerParcelMediaAutoPlay::playStarted(); 278 LLViewerParcelMediaAutoPlay::playStarted();
@@ -251,16 +281,41 @@ void LLViewerParcelMedia::start()
251// static 281// static
252void LLViewerParcelMedia::seek(F32 time) 282void LLViewerParcelMedia::seek(F32 time)
253{ 283{
254 LLViewerMedia::seek(time); 284 if(sMediaImpl.isNull())
285 {
286 return;
287 }
288 sMediaImpl->seek(time);
255} 289}
256 290
257
258// static 291// static
259LLMediaBase::EStatus LLViewerParcelMedia::getStatus() 292void LLViewerParcelMedia::focus(bool focus)
260{ 293{
261 return LLViewerMedia::getStatus(); 294 sMediaImpl->focus(focus);
295}
296
297// static
298LLViewerMediaImpl::EMediaStatus LLViewerParcelMedia::getStatus()
299{
300 LLViewerMediaImpl::EMediaStatus result = LLViewerMediaImpl::MEDIA_NONE;
301
302 if(sMediaImpl.notNull() && sMediaImpl->hasMedia())
303 {
304 result = sMediaImpl->getMediaPlugin()->getStatus();
305 }
306
307 return result;
262} 308}
263 309
310// static
311std::string LLViewerParcelMedia::getMimeType()
312{
313 return sMediaImpl.notNull() ? sMediaImpl->getMimeType() : "none/none";
314}
315viewer_media_t LLViewerParcelMedia::getParcelMedia()
316{
317 return sMediaImpl;
318}
264////////////////////////////////////////////////////////////////////////////////////////// 319//////////////////////////////////////////////////////////////////////////////////////////
265// static 320// static
266void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg, void ** ) 321void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg, void ** )
@@ -298,7 +353,7 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg
298 if(( command == PARCEL_MEDIA_COMMAND_PLAY ) || 353 if(( command == PARCEL_MEDIA_COMMAND_PLAY ) ||
299 ( command == PARCEL_MEDIA_COMMAND_LOOP )) 354 ( command == PARCEL_MEDIA_COMMAND_LOOP ))
300 { 355 {
301 if (LLViewerMedia::isMediaPaused()) 356 if (getStatus() == LLViewerMediaImpl::MEDIA_PAUSED)
302 { 357 {
303 start(); 358 start();
304 } 359 }
@@ -318,7 +373,7 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg
318 373
319 if (flags & (1<<PARCEL_MEDIA_COMMAND_TIME)) 374 if (flags & (1<<PARCEL_MEDIA_COMMAND_TIME))
320 { 375 {
321 if(! LLViewerMedia::hasMedia()) 376 if(sMediaImpl.isNull())
322 { 377 {
323 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 378 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
324 play(parcel); 379 play(parcel);
@@ -382,6 +437,119 @@ void LLViewerParcelMedia::processParcelMediaUpdate( LLMessageSystem *msg, void *
382 } 437 }
383 } 438 }
384} 439}
440// Static
441/////////////////////////////////////////////////////////////////////////////////////////
442void LLViewerParcelMedia::sendMediaNavigateMessage(const std::string& url)
443{
444 std::string region_url = gAgent.getRegion()->getCapability("ParcelNavigateMedia");
445 if (!region_url.empty())
446 {
447 // send navigate event to sim for link sharing
448 LLSD body;
449 body["agent-id"] = gAgent.getID();
450 body["local-id"] = LLViewerParcelMgr::getInstance()->getAgentParcel()->getLocalID();
451 body["url"] = url;
452 LLHTTPClient::post(region_url, body, new LLHTTPClient::Responder);
453 }
454 else
455 {
456 llwarns << "can't get ParcelNavigateMedia capability" << llendl;
457 }
458
459}
460
461/////////////////////////////////////////////////////////////////////////////////////////
462// inherited from LLViewerMediaObserver
463// virtual
464void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
465{
466 switch(event)
467 {
468 case MEDIA_EVENT_CONTENT_UPDATED:
469 {
470 // LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CONTENT_UPDATED " << LL_ENDL;
471 };
472 break;
473
474 case MEDIA_EVENT_TIME_DURATION_UPDATED:
475 {
476 // LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_TIME_DURATION_UPDATED, time is " << self->getCurrentTime() << " of " << self->getDuration() << LL_ENDL;
477 };
478 break;
479
480 case MEDIA_EVENT_SIZE_CHANGED:
481 {
482 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_SIZE_CHANGED " << LL_ENDL;
483 };
484 break;
485
486 case MEDIA_EVENT_CURSOR_CHANGED:
487 {
488 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CURSOR_CHANGED, new cursor is " << self->getCursorName() << LL_ENDL;
489 };
490 break;
491
492 case MEDIA_EVENT_NAVIGATE_BEGIN:
493 {
494 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_BEGIN " << LL_ENDL;
495 };
496 break;
497
498 case MEDIA_EVENT_NAVIGATE_COMPLETE:
499 {
500 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_COMPLETE, result string is: " << self->getNavigateResultString() << LL_ENDL;
501 };
502 break;
503
504 case MEDIA_EVENT_PROGRESS_UPDATED:
505 {
506 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PROGRESS_UPDATED, loading at " << self->getProgressPercent() << "%" << LL_ENDL;
507 };
508 break;
509
510 case MEDIA_EVENT_STATUS_TEXT_CHANGED:
511 {
512 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_STATUS_TEXT_CHANGED, new status text is: " << self->getStatusText() << LL_ENDL;
513 };
514 break;
515
516 case MEDIA_EVENT_LOCATION_CHANGED:
517 {
518 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_LOCATION_CHANGED, new uri is: " << self->getLocation() << LL_ENDL;
519 };
520 break;
521
522 case MEDIA_EVENT_CLICK_LINK_HREF:
523 {
524 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << self->getClickTarget() << "\", uri is " << self->getClickURL() << LL_ENDL;
525 };
526 break;
527
528 case MEDIA_EVENT_CLICK_LINK_NOFOLLOW:
529 {
530 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_NOFOLLOW, uri is " << self->getClickURL() << LL_ENDL;
531 };
532 break;
533
534 case MEDIA_EVENT_PLUGIN_FAILED:
535 {
536 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PLUGIN_FAILED" << LL_ENDL;
537 };
538 break;
539
540 case MEDIA_EVENT_PLUGIN_FAILED_LAUNCH:
541 {
542 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PLUGIN_FAILED_LAUNCH" << LL_ENDL;
543 };
544 break;
545
546 case MEDIA_EVENT_NAME_CHANGED:
547 {
548 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAME_CHANGED" << LL_ENDL;
549 };
550 break;
551 };
552}
385 553
386bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel) 554bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel)
387{ 555{
@@ -399,3 +567,19 @@ bool callback_play_media(const LLSD& notification, const LLSD& response, LLParce
399 return false; 567 return false;
400} 568}
401 569
570// TODO: observer
571/*
572void LLViewerParcelMediaNavigationObserver::onNavigateComplete( const EventType& event_in )
573{
574 std::string url = event_in.getStringValue();
575
576 if (mCurrentURL != url && ! mFromMessage)
577 {
578 LLViewerParcelMedia::sendMediaNavigateMessage(url);
579 }
580
581 mCurrentURL = url;
582 mFromMessage = false;
583
584}
585*/
diff --git a/linden/indra/newview/llviewerparcelmedia.h b/linden/indra/newview/llviewerparcelmedia.h
index 1898870..0f1e85c 100644
--- a/linden/indra/newview/llviewerparcelmedia.h
+++ b/linden/indra/newview/llviewerparcelmedia.h
@@ -33,18 +33,22 @@
33#ifndef LLVIEWERPARCELMEDIA_H 33#ifndef LLVIEWERPARCELMEDIA_H
34#define LLVIEWERPARCELMEDIA_H 34#define LLVIEWERPARCELMEDIA_H
35 35
36#include "llmediabase.h" 36#include "llviewermedia.h"
37 37
38class LLMessageSystem; 38class LLMessageSystem;
39class LLParcel; 39class LLParcel;
40class LLViewerParcelMediaNavigationObserver;
41
40 42
41// This class understands land parcels, network traffic, LSL media 43// This class understands land parcels, network traffic, LSL media
42// transport commands, and talks to the LLViewerMedia class to actually 44// transport commands, and talks to the LLViewerMedia class to actually
43// do playback. It allows us to remove code from LLViewerParcelMgr. 45// do playback. It allows us to remove code from LLViewerParcelMgr.
44class LLViewerParcelMedia 46class LLViewerParcelMedia : public LLViewerMediaObserver
45{ 47{
48 LOG_CLASS(LLViewerParcelMedia);
46 public: 49 public:
47 static void initClass(); 50 static void initClass();
51 static void cleanupClass();
48 52
49 static void update(LLParcel* parcel); 53 static void update(LLParcel* parcel);
50 // called when the agent's parcel has a new URL, or the agent has 54 // called when the agent's parcel has a new URL, or the agent has
@@ -60,17 +64,38 @@ class LLViewerParcelMedia
60 static void start(); 64 static void start();
61 // restart after pause - no need for all the setup 65 // restart after pause - no need for all the setup
62 66
67 static void focus(bool focus);
68
63 static void seek(F32 time); 69 static void seek(F32 time);
64 // jump to timecode time 70 // jump to timecode time
65 71
66 static LLMediaBase::EStatus getStatus(); 72 static LLViewerMediaImpl::EMediaStatus getStatus();
73 static std::string getMimeType();
74 static viewer_media_t getParcelMedia();
67 75
68 static void processParcelMediaCommandMessage( LLMessageSystem *msg, void ** ); 76 static void processParcelMediaCommandMessage( LLMessageSystem *msg, void ** );
69 static void processParcelMediaUpdate( LLMessageSystem *msg, void ** ); 77 static void processParcelMediaUpdate( LLMessageSystem *msg, void ** );
78 static void sendMediaNavigateMessage(const std::string& url);
79
80 // inherited from LLViewerMediaObserver
81 virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
70 82
71 public: 83 public:
72 static S32 sMediaParcelLocalID; 84 static S32 sMediaParcelLocalID;
73 static LLUUID sMediaRegionID; 85 static LLUUID sMediaRegionID;
86 // HACK: this will change with Media on a Prim
87 static viewer_media_t sMediaImpl;
88};
89
90
91class LLViewerParcelMediaNavigationObserver
92{
93public:
94 std::string mCurrentURL;
95 bool mFromMessage;
96
97 // void onNavigateComplete( const EventType& event_in );
98
74}; 99};
75 100
76#endif 101#endif
diff --git a/linden/indra/newview/llviewerparcelmediaautoplay.cpp b/linden/indra/newview/llviewerparcelmediaautoplay.cpp
index dbb9c32..ccd6b14 100644
--- a/linden/indra/newview/llviewerparcelmediaautoplay.cpp
+++ b/linden/indra/newview/llviewerparcelmediaautoplay.cpp
@@ -109,7 +109,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick()
109 if ((!mPlayed) && // if we've never played 109 if ((!mPlayed) && // if we've never played
110 (mTimeInParcel > AUTOPLAY_TIME) && // and if we've been here for so many seconds 110 (mTimeInParcel > AUTOPLAY_TIME) && // and if we've been here for so many seconds
111 (this_media_url.size() != 0) && // and if the parcel has media 111 (this_media_url.size() != 0) && // and if the parcel has media
112 (!LLViewerMedia::isMediaPlaying())) // and if the media is not already playing 112 (LLViewerParcelMedia::sMediaImpl.isNull())) // and if the media is not already playing
113 { 113 {
114 if (this_media_texture_id.notNull()) // and if the media texture is good 114 if (this_media_texture_id.notNull()) // and if the media texture is good
115 { 115 {
diff --git a/linden/indra/newview/llviewerparcelmediaautoplay.h b/linden/indra/newview/llviewerparcelmediaautoplay.h
index cc2e70b..16279e7 100644
--- a/linden/indra/newview/llviewerparcelmediaautoplay.h
+++ b/linden/indra/newview/llviewerparcelmediaautoplay.h
@@ -33,7 +33,6 @@
33#ifndef LLVIEWERPARCELMEDIAAUTOPLAY_H 33#ifndef LLVIEWERPARCELMEDIAAUTOPLAY_H
34#define LLVIEWERPARCELMEDIAAUTOPLAY_H 34#define LLVIEWERPARCELMEDIAAUTOPLAY_H
35 35
36#include "llmediabase.h"
37#include "lltimer.h" 36#include "lltimer.h"
38 37
39// timer to automatically play media 38// timer to automatically play media
diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp
index 61b91fe..3ed41a3 100644
--- a/linden/indra/newview/llviewerparcelmgr.cpp
+++ b/linden/indra/newview/llviewerparcelmgr.cpp
@@ -35,7 +35,7 @@
35#include "llviewerparcelmgr.h" 35#include "llviewerparcelmgr.h"
36 36
37// Library includes 37// Library includes
38#include "audioengine.h" 38#include "llaudioengine.h"
39#include "indra_constants.h" 39#include "indra_constants.h"
40#include "llcachename.h" 40#include "llcachename.h"
41#include "llgl.h" 41#include "llgl.h"
@@ -1599,6 +1599,9 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1599 // Request access list information for this land 1599 // Request access list information for this land
1600 LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN); 1600 LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN);
1601 1601
1602 // Request the media url filter list for this land
1603 LLViewerParcelMgr::getInstance()->requestParcelMediaURLFilter();
1604
1602 // Request dwell for this land, if it's not public land. 1605 // Request dwell for this land, if it's not public land.
1603 LLViewerParcelMgr::getInstance()->mSelectedDwell = 0.f; 1606 LLViewerParcelMgr::getInstance()->mSelectedDwell = 0.f;
1604 if (0 != local_id) 1607 if (0 != local_id)
@@ -1726,21 +1729,6 @@ void optionally_start_music(const std::string& music_url)
1726 } 1729 }
1727} 1730}
1728 1731
1729
1730void callback_start_music(S32 option, void* data)
1731{
1732 if (option == 0)
1733 {
1734 // Before the callback, we verified the url was good.
1735 // We fetch again to avoid lag while loading.
1736 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
1737 gAudiop->startInternetStream(parcel->getMusicURL());
1738
1739 LLOverlayBar::musicFirstRun();
1740 }
1741 gSavedSettings.setWarning("FirstStreamingMusic", FALSE);
1742}
1743
1744// static 1732// static
1745void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void **user) 1733void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void **user)
1746{ 1734{
@@ -1937,6 +1925,66 @@ void LLViewerParcelMgr::sendParcelAccessListUpdate(U32 which)
1937 } 1925 }
1938} 1926}
1939 1927
1928class LLParcelMediaURLFilterResponder : public LLHTTPClient::Responder
1929{
1930 virtual void result(const LLSD& content)
1931 {
1932 LLViewerParcelMgr::getInstance()->receiveParcelMediaURLFilter(content);
1933 }
1934};
1935
1936void LLViewerParcelMgr::requestParcelMediaURLFilter()
1937{
1938 if (!mSelected)
1939 {
1940 return;
1941 }
1942
1943 LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth );
1944 if (!region)
1945 {
1946 return;
1947 }
1948
1949 LLParcel* parcel = mCurrentParcel;
1950 if (!parcel)
1951 {
1952 llwarns << "no parcel" << llendl;
1953 return;
1954 }
1955
1956 LLSD body;
1957 body["local-id"] = parcel->getLocalID();
1958 body["list"] = parcel->getMediaURLFilterList();
1959
1960 std::string url = region->getCapability("ParcelMediaURLFilterList");
1961 if (!url.empty())
1962 {
1963 LLHTTPClient::post(url, body, new LLParcelMediaURLFilterResponder);
1964 }
1965 else
1966 {
1967 llwarns << "can't get ParcelMediaURLFilterList cap" << llendl;
1968 }
1969}
1970
1971
1972void LLViewerParcelMgr::receiveParcelMediaURLFilter(const LLSD &content)
1973{
1974 if (content.has("list"))
1975 {
1976 LLParcel* parcel = LLViewerParcelMgr::getInstance()->mCurrentParcel;
1977 if (!parcel) return;
1978
1979 if (content["local-id"].asInteger() == parcel->getLocalID())
1980 {
1981 parcel->setMediaURLFilterList(content["list"]);
1982
1983 LLViewerParcelMgr::getInstance()->notifyObservers();
1984 }
1985 }
1986}
1987
1940 1988
1941void LLViewerParcelMgr::deedLandToGroup() 1989void LLViewerParcelMgr::deedLandToGroup()
1942{ 1990{
diff --git a/linden/indra/newview/llviewerparcelmgr.h b/linden/indra/newview/llviewerparcelmgr.h
index 9f762a1..9bf6096 100644
--- a/linden/indra/newview/llviewerparcelmgr.h
+++ b/linden/indra/newview/llviewerparcelmgr.h
@@ -198,6 +198,11 @@ public:
198 // Takes an Access List flag, like AL_ACCESS or AL_BAN 198 // Takes an Access List flag, like AL_ACCESS or AL_BAN
199 void sendParcelAccessListRequest(U32 flags); 199 void sendParcelAccessListRequest(U32 flags);
200 200
201 // asks for the parcel's media url filter list
202 void requestParcelMediaURLFilter();
203 // receive the response
204 void receiveParcelMediaURLFilter(const LLSD &content);
205
201 // Dwell is not part of the usual parcel update information because the 206 // Dwell is not part of the usual parcel update information because the
202 // simulator doesn't actually know the per-parcel dwell. Ack! We have 207 // simulator doesn't actually know the per-parcel dwell. Ack! We have
203 // to get it out of the database. 208 // to get it out of the database.
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp
index 4257f70..f06c3d8 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -322,7 +322,7 @@ void LLViewerRegion::loadCache()
322 322
323 LLUUID cache_id; 323 LLUUID cache_id;
324 nread = fread(&cache_id.mData, 1, UUID_BYTES, fp); 324 nread = fread(&cache_id.mData, 1, UUID_BYTES, fp);
325 if (nread != UUID_BYTES || mCacheID != cache_id) 325 if (nread != (size_t)UUID_BYTES || mCacheID != cache_id)
326 { 326 {
327 llinfos << "Cache ID doesn't match for this region, discarding" 327 llinfos << "Cache ID doesn't match for this region, discarding"
328 << llendl; 328 << llendl;
@@ -398,7 +398,7 @@ void LLViewerRegion::saveCache()
398 } 398 }
399 399
400 // write the cache id for this sim 400 // write the cache id for this sim
401 if (fwrite(&mCacheID.mData, 1, UUID_BYTES, fp) != UUID_BYTES) 401 if (fwrite(&mCacheID.mData, 1, UUID_BYTES, fp) != (size_t)UUID_BYTES)
402 { 402 {
403 llwarns << "Short write" << llendl; 403 llwarns << "Short write" << llendl;
404 } 404 }
@@ -1428,6 +1428,8 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1428 capabilityNames.append("MapLayerGod"); 1428 capabilityNames.append("MapLayerGod");
1429 capabilityNames.append("NewFileAgentInventory"); 1429 capabilityNames.append("NewFileAgentInventory");
1430 capabilityNames.append("ParcelPropertiesUpdate"); 1430 capabilityNames.append("ParcelPropertiesUpdate");
1431 capabilityNames.append("ParcelMediaURLFilterList");
1432 capabilityNames.append("ParcelNavigateMedia");
1431 capabilityNames.append("ParcelVoiceInfoRequest"); 1433 capabilityNames.append("ParcelVoiceInfoRequest");
1432 capabilityNames.append("ProductInfoRequest"); 1434 capabilityNames.append("ProductInfoRequest");
1433 capabilityNames.append("ProvisionVoiceAccountRequest"); 1435 capabilityNames.append("ProvisionVoiceAccountRequest");
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp
index 981c9bc..34577a7 100644
--- a/linden/indra/newview/llviewertexteditor.cpp
+++ b/linden/indra/newview/llviewertexteditor.cpp
@@ -33,7 +33,7 @@
33#include "llviewerprecompiledheaders.h" 33#include "llviewerprecompiledheaders.h"
34 34
35#include "llfocusmgr.h" 35#include "llfocusmgr.h"
36#include "audioengine.h" 36#include "llaudioengine.h"
37#include "llagent.h" 37#include "llagent.h"
38#include "llinventory.h" 38#include "llinventory.h"
39#include "llinventorymodel.h" 39#include "llinventorymodel.h"
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index eb8977c..f7713c2 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -54,7 +54,7 @@
54// 54//
55 55
56// linden library includes 56// linden library includes
57#include "audioengine.h" // mute on minimize 57#include "llaudioengine.h" // mute on minimize
58#include "indra_constants.h" 58#include "indra_constants.h"
59#include "llassetstorage.h" 59#include "llassetstorage.h"
60#include "llfontgl.h" 60#include "llfontgl.h"
@@ -156,7 +156,6 @@
156#include "lltoolselectland.h" 156#include "lltoolselectland.h"
157#include "lltoolview.h" 157#include "lltoolview.h"
158#include "lluictrlfactory.h" 158#include "lluictrlfactory.h"
159#include "lluploaddialog.h"
160#include "llurldispatcher.h" // SLURL from other app instance 159#include "llurldispatcher.h" // SLURL from other app instance
161#include "llvieweraudio.h" 160#include "llvieweraudio.h"
162#include "llviewercamera.h" 161#include "llviewercamera.h"
@@ -164,6 +163,8 @@
164#include "llviewerimagelist.h" 163#include "llviewerimagelist.h"
165#include "llviewerinventory.h" 164#include "llviewerinventory.h"
166#include "llviewerkeyboard.h" 165#include "llviewerkeyboard.h"
166#include "llviewermedia.h"
167#include "llviewermediafocus.h"
167#include "llviewermenu.h" 168#include "llviewermenu.h"
168#include "llviewermessage.h" 169#include "llviewermessage.h"
169#include "llviewerobjectlist.h" 170#include "llviewerobjectlist.h"
@@ -310,7 +311,9 @@ public:
310 S32 hours = (S32)(time / (60*60)); 311 S32 hours = (S32)(time / (60*60));
311 S32 mins = (S32)((time - hours*(60*60)) / 60); 312 S32 mins = (S32)((time - hours*(60*60)) / 60);
312 S32 secs = (S32)((time - hours*(60*60) - mins*60)); 313 S32 secs = (S32)((time - hours*(60*60) - mins*60));
313 addText(xpos, ypos, llformat(" Debug %d: %d:%02d:%02d", idx, hours,mins,secs)); ypos += y_inc2; 314 std::string label = gDebugTimerLabel[idx];
315 if (label.empty()) label = llformat("Debug: %d", idx);
316 addText(xpos, ypos, llformat(" %s: %d:%02d:%02d", label.c_str(), hours,mins,secs)); ypos += y_inc2;
314 } 317 }
315 318
316 F32 time = gFrameTimeSeconds; 319 F32 time = gFrameTimeSeconds;
@@ -795,6 +798,7 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
795 if (handle) 798 if (handle)
796 return handle; 799 return handle;
797 800
801
798 // *HACK: this should be rolled into the composite tool logic, not 802 // *HACK: this should be rolled into the composite tool logic, not
799 // hardcoded at the top level. 803 // hardcoded at the top level.
800 if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance()) 804 if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance())
@@ -1141,7 +1145,7 @@ void LLViewerWindow::handleDataCopy(LLWindow *window, S32 data_type, void *data)
1141 case SLURL_MESSAGE_TYPE: 1145 case SLURL_MESSAGE_TYPE:
1142 // received URL 1146 // received URL
1143 std::string url = (const char*)data; 1147 std::string url = (const char*)data;
1144 LLWebBrowserCtrl* web = NULL; 1148 LLMediaCtrl* web = NULL;
1145 const bool trusted_browser = false; 1149 const bool trusted_browser = false;
1146 if (LLURLDispatcher::dispatch(url, web, trusted_browser)) 1150 if (LLURLDispatcher::dispatch(url, web, trusted_browser))
1147 { 1151 {
@@ -1736,6 +1740,19 @@ void LLViewerWindow::initWorldUI()
1736 // menu holder appears on top to get first pass at all mouse events 1740 // menu holder appears on top to get first pass at all mouse events
1737 1741
1738 mRootView->sendChildToFront(gMenuHolder); 1742 mRootView->sendChildToFront(gMenuHolder);
1743
1744 if ( gHUDView == NULL )
1745 {
1746 LLRect hud_rect = full_window;
1747 hud_rect.mBottom += 50;
1748 if (gMenuBarView)
1749 {
1750 hud_rect.mTop -= gMenuBarView->getRect().getHeight();
1751 }
1752 gHUDView = new LLHUDView(hud_rect);
1753 // put behind everything else in the UI
1754 mRootView->addChildAtEnd(gHUDView);
1755 }
1739} 1756}
1740 1757
1741// Destroy the UI 1758// Destroy the UI
@@ -2180,7 +2197,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2180 if (key < 0x80) 2197 if (key < 0x80)
2181 { 2198 {
2182 // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first. 2199 // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first.
2183 return gFocusMgr.childHasKeyboardFocus(mRootView); 2200 return (gFocusMgr.getKeyboardFocus() != NULL);
2184 } 2201 }
2185 } 2202 }
2186 2203
@@ -2243,7 +2260,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2243 } 2260 }
2244 2261
2245 // Traverses up the hierarchy 2262 // Traverses up the hierarchy
2246 LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus(); 2263 LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
2247 if( keyboard_focus ) 2264 if( keyboard_focus )
2248 { 2265 {
2249 // arrow keys move avatar while chatting hack 2266 // arrow keys move avatar while chatting hack
@@ -2377,7 +2394,7 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
2377 } 2394 }
2378 2395
2379 // Traverses up the hierarchy 2396 // Traverses up the hierarchy
2380 LLView* keyboard_focus = gFocusMgr.getKeyboardFocus(); 2397 LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
2381 if( keyboard_focus ) 2398 if( keyboard_focus )
2382 { 2399 {
2383 if (keyboard_focus->handleUnicodeChar(uni_char, FALSE)) 2400 if (keyboard_focus->handleUnicodeChar(uni_char, FALSE))
@@ -2530,7 +2547,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
2530 } 2547 }
2531 2548
2532 // clean up current focus 2549 // clean up current focus
2533 LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); 2550 LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
2534 if (cur_focus) 2551 if (cur_focus)
2535 { 2552 {
2536 if (!cur_focus->isInVisibleChain() || !cur_focus->isInEnabledChain()) 2553 if (!cur_focus->isInVisibleChain() || !cur_focus->isInEnabledChain())
@@ -2910,12 +2927,18 @@ BOOL LLViewerWindow::handlePerFrameHover()
2910 { 2927 {
2911 do_pick = FALSE; 2928 do_pick = FALSE;
2912 } 2929 }
2930
2931 if(LLViewerMediaFocus::getInstance()->getFocus())
2932 {
2933 // When in-world media is in focus, pick every frame so that browser mouse-overs, dragging scrollbars, etc. work properly.
2934 do_pick = TRUE;
2935 }
2913 2936
2914 if (do_pick) 2937 if (do_pick)
2915 { 2938 {
2916 mouse_moved_since_pick = FALSE; 2939 mouse_moved_since_pick = FALSE;
2917 mPickTimer.reset(); 2940 mPickTimer.reset();
2918 pickAsync(getCurrentMouseX(), getCurrentMouseY(), mask, hoverPickCallback, TRUE); 2941 pickAsync(getCurrentMouseX(), getCurrentMouseY(), mask, hoverPickCallback, TRUE, TRUE);
2919 } 2942 }
2920 2943
2921 previous_x = x; 2944 previous_x = x;
@@ -4694,7 +4717,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size,
4694 BOOL result_first_try = FALSE; 4717 BOOL result_first_try = FALSE;
4695 BOOL result_second_try = FALSE; 4718 BOOL result_second_try = FALSE;
4696 4719
4697 LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus(); 4720 LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
4698 send_agent_pause(); 4721 send_agent_pause();
4699 llinfos << "Stopping GL during changeDisplaySettings" << llendl; 4722 llinfos << "Stopping GL during changeDisplaySettings" << llendl;
4700 stopGL(); 4723 stopGL();
@@ -4923,7 +4946,6 @@ LLBottomPanel::LLBottomPanel(const LLRect &rect) :
4923 4946
4924 mFactoryMap["toolbar"] = LLCallbackMap(createToolBar, NULL); 4947 mFactoryMap["toolbar"] = LLCallbackMap(createToolBar, NULL);
4925 mFactoryMap["overlay"] = LLCallbackMap(createOverlayBar, NULL); 4948 mFactoryMap["overlay"] = LLCallbackMap(createOverlayBar, NULL);
4926 mFactoryMap["hud"] = LLCallbackMap(createHUD, NULL);
4927 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_bars.xml", &getFactoryMap()); 4949 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_bars.xml", &getFactoryMap());
4928 4950
4929 setOrigin(rect.mLeft, rect.mBottom); 4951 setOrigin(rect.mLeft, rect.mBottom);
@@ -4946,12 +4968,6 @@ void LLBottomPanel::draw()
4946 LLPanel::draw(); 4968 LLPanel::draw();
4947} 4969}
4948 4970
4949void* LLBottomPanel::createHUD(void* data)
4950{
4951 gHUDView = new LLHUDView();
4952 return gHUDView;
4953}
4954
4955 4971
4956void* LLBottomPanel::createOverlayBar(void* data) 4972void* LLBottomPanel::createOverlayBar(void* data)
4957{ 4973{
@@ -5164,12 +5180,8 @@ void LLPickInfo::updateXYCoords()
5164 LLPointer<LLViewerImage> imagep = gImageList.getImage(tep->getID()); 5180 LLPointer<LLViewerImage> imagep = gImageList.getImage(tep->getID());
5165 if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull()) 5181 if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull())
5166 { 5182 {
5167 LLCoordGL coords; 5183 mXYCoords.mX = llround(mUVCoords.mV[VX] * (F32)imagep->getWidth());
5168 5184 mXYCoords.mY = llround((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight());
5169 coords.mX = llround(mUVCoords.mV[VX] * (F32)imagep->getWidth());
5170 coords.mY = llround(mUVCoords.mV[VY] * (F32)imagep->getHeight());
5171
5172 gViewerWindow->getWindow()->convertCoords(coords, &mXYCoords);
5173 } 5185 }
5174 } 5186 }
5175} 5187}
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index c8b26be..14b8d3e 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -37,7 +37,7 @@
37#include <stdio.h> 37#include <stdio.h>
38#include <ctype.h> 38#include <ctype.h>
39 39
40#include "audioengine.h" 40#include "llaudioengine.h"
41#include "noise.h" 41#include "noise.h"
42 42
43#include "llagent.h" // Get state values from here 43#include "llagent.h" // Get state values from here
@@ -69,6 +69,7 @@
69#include "lltoolmorph.h" 69#include "lltoolmorph.h"
70#include "llviewercamera.h" 70#include "llviewercamera.h"
71#include "llviewerimagelist.h" 71#include "llviewerimagelist.h"
72#include "llviewermedia.h"
72#include "llviewermenu.h" 73#include "llviewermenu.h"
73#include "llviewerobjectlist.h" 74#include "llviewerobjectlist.h"
74#include "llviewerparcelmgr.h" 75#include "llviewerparcelmgr.h"
@@ -3825,6 +3826,18 @@ void LLVOAvatar::idleUpdateTractorBeam()
3825 { 3826 {
3826 return; 3827 return;
3827 } 3828 }
3829 const LLPickInfo& pick = gViewerWindow->getLastPick();
3830
3831 // No beam for media textures
3832 // TODO: this will change for Media on a Prim
3833 if(pick.getObject() && pick.mObjectFace >= 0)
3834 {
3835 const LLTextureEntry* tep = pick.getObject()->getTE(pick.mObjectFace);
3836 if (tep && LLViewerMedia::textureHasMedia(tep->getID()))
3837 {
3838 return;
3839 }
3840 }
3828 3841
3829 // This is only done for yourself (maybe it should be in the agent?) 3842 // This is only done for yourself (maybe it should be in the agent?)
3830 if (!needsRenderBeam() || !mIsBuilt) 3843 if (!needsRenderBeam() || !mIsBuilt)
@@ -3935,7 +3948,7 @@ void LLVOAvatar::idleUpdateTractorBeam()
3935 } 3948 }
3936 else 3949 else
3937 { 3950 {
3938 const LLPickInfo& pick = gViewerWindow->getLastPick(); 3951
3939 mBeam->setPositionGlobal(pick.mPosGlobal); 3952 mBeam->setPositionGlobal(pick.mPosGlobal);
3940 } 3953 }
3941 3954
diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp
index 5f7327d..385dbe0 100644
--- a/linden/indra/newview/llvovolume.cpp
+++ b/linden/indra/newview/llvovolume.cpp
@@ -1694,7 +1694,7 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p
1694 trans_mat.translate(getRegion()->getOriginAgent()); 1694 trans_mat.translate(getRegion()->getOriginAgent());
1695 } 1695 }
1696 1696
1697 volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, nodep->mSilhouetteSegments, view_vector, trans_mat, mRelativeXformInvTrans); 1697 volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, nodep->mSilhouetteSegments, view_vector, trans_mat, mRelativeXformInvTrans, nodep->getTESelectMask());
1698 1698
1699 nodep->mSilhouetteExists = TRUE; 1699 nodep->mSilhouetteExists = TRUE;
1700 } 1700 }
diff --git a/linden/indra/newview/llweb.cpp b/linden/indra/newview/llweb.cpp
index fb4b063..7021b48 100644
--- a/linden/indra/newview/llweb.cpp
+++ b/linden/indra/newview/llweb.cpp
@@ -38,7 +38,7 @@
38#include "llviewerwindow.h" 38#include "llviewerwindow.h"
39 39
40#include "llviewercontrol.h" 40#include "llviewercontrol.h"
41#include "llfloaterhtmlhelp.h" 41#include "llfloatermediabrowser.h"
42 42
43// static 43// static
44void LLWeb::initClass() 44void LLWeb::initClass()
diff --git a/linden/indra/newview/mozilla-powerpc-darwin-readme.txt b/linden/indra/newview/mozilla-powerpc-darwin-readme.txt
index be67ad3..e69de29 100644
--- a/linden/indra/newview/mozilla-powerpc-darwin-readme.txt
+++ b/linden/indra/newview/mozilla-powerpc-darwin-readme.txt
@@ -1,71 +0,0 @@
1NOTE: these directions have been obsoleted. There are now shell scripts that will check out, build, and package the necessary pieces
2of the mozilla code in lindelib/mozilla-1.8.0/mac-build. I'm leaving this file here for historical interest.
3-------------
4Written by Monroe on June 17, 2005.
5
6Here's how to rebuild the Mozilla components for the Mac build.
7
8Check out the mozilla source from cvs
9
10cd to the mozilla directory (the same one that contains client.mk)
11
12cp .mozconfig.opt.shared.small .mozconfig
13
14Add the following line to the .mozconfig file you just created:
15
16ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.2.8.sdk
17
18make -f client.mk build
19
20wait a while.
21
22The build products you need to extract are in objdir-opt-shared-small/dist/bin and objdir-opt-shared-small/dist/lib.
23
24Copy the following to linden/libraries/firefox-1.0.4/<arch>/lib_release and linden/libraries/firefox-1.0.4/<arch>/lib_release:
25
26objdir-opt-shared-small/dist/lib/libembed_base_s.a
27objdir-opt-shared-small/dist/lib/libxpcomglue_s.a
28objdir-opt-shared-small/dist/bin/libxpcom.dylib
29objdir-opt-shared-small/dist/bin/libplds4.dylib
30objdir-opt-shared-small/dist/bin/libplc4.dylib
31objdir-opt-shared-small/dist/bin/libnspr4.dylib
32objdir-opt-shared-small/dist/bin/libgkgfx.dylib
33
34This first part should be repeated with .mozconfig.debug.shared.small to generate the libraries in the two matching lib_debug directories. The debug version of the bin directory is prohibitively large, so we're just using the release version of that part.
35
36Much of the contents of objdir-opt-shared-small/dist/bin also needs to go into a tar file that will be used when generating the application bundle.
37
38The bin directory will be populated with symlinks. If you just tar it up as-is, you'll get a tar file full of symlinks, which is not useful.
39
40Use 'cp -RL source dest' to make a copy of the bin directory with all symlinks expanded. This will be more useful.
41
42Remove things that aren't needed. This includes at least:
43
44asdecode
45firefox
46firefox-bin
47firefox-config
48LICENSE
49nsinstall
50mangle
51regxpcom
52regchrome
53README.txt
54run-mozilla.sh
55xpcshell
56xpt_dump
57shlibsign
58xpt_link
59xpidl
60xpicleanup
61
62There may be other pieces that aren't needed as well. I expect this will be refined moving forward.
63
64Because of the way the tar file will be expanded (directly inside the application bundle, in Contents/MacOS), it's important to create it so that it won't expand at a subdirectory of the current path. The way to to this is to cd to the dist/bin directory and do something like this:
65
66tar -zcvf ../mozilla-powerpc-darwin.tgz .
67
68This will create a tar file containing everything in the current directory, and will place the file one level up (so it doesn't interfere with its own creation). This file should replace the file with the above name checked into cvs in linden/indra/newview/. One of the lines in the shell script phase of the build extracts it appropriately into the application bundle.
69
70If any of this is unclear, please contact Monroe and I'll try to clarify and update this file.
71
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp
index f10aca5..72da3c6 100644
--- a/linden/indra/newview/pipeline.cpp
+++ b/linden/indra/newview/pipeline.cpp
@@ -35,7 +35,7 @@
35#include "pipeline.h" 35#include "pipeline.h"
36 36
37// library includes 37// library includes
38#include "audioengine.h" // For MAX_BUFFERS for debugging. 38#include "llaudioengine.h" // For MAX_BUFFERS for debugging.
39#include "imageids.h" 39#include "imageids.h"
40#include "llerror.h" 40#include "llerror.h"
41#include "llviewercontrol.h" 41#include "llviewercontrol.h"
diff --git a/linden/indra/newview/skins/default/textures/textures.xml b/linden/indra/newview/skins/default/textures/textures.xml
index 0b4a088..f2189a4 100644
--- a/linden/indra/newview/skins/default/textures/textures.xml
+++ b/linden/indra/newview/skins/default/textures/textures.xml
@@ -16,7 +16,9 @@
16 <texture name="toolbar_btn_selected.tga" scale_left="7" scale_top="32" scale_right="121" scale_bottom="0" /> 16 <texture name="toolbar_btn_selected.tga" scale_left="7" scale_top="32" scale_right="121" scale_bottom="0" />
17 17
18 <texture name="button_enabled_selected_32x128.tga" preload="true" scale_left="16" scale_top="16" scale_right="112" scale_bottom="16" /> 18 <texture name="button_enabled_selected_32x128.tga" preload="true" scale_left="16" scale_top="16" scale_right="112" scale_bottom="16" />
19 19
20 <texture name="media_panel_bg.png" preload="true" scale_left="9" scale_top="9" scale_right="9" scale_bottom="9" />
21 <texture name="media_panel_hoverrectangle.png" preload="true" scale_left="9" scale_top="9" scale_right="9" scale_bottom="9" />
20 <texture name="checkbox_disabled_false.tga" preload="true"/> 22 <texture name="checkbox_disabled_false.tga" preload="true"/>
21 <texture name="checkbox_disabled_true.tga" preload="true"/> 23 <texture name="checkbox_disabled_true.tga" preload="true"/>
22 <texture name="checkbox_enabled_false.tga" preload="true"/> 24 <texture name="checkbox_enabled_false.tga" preload="true"/>
@@ -376,7 +378,23 @@
376 <texture name="default_profile_picture.j2c"/> 378 <texture name="default_profile_picture.j2c"/>
377 <texture name="locked_image.j2c"/> 379 <texture name="locked_image.j2c"/>
378 380
381
379 <!-- Kitty Viewer Art --> 382 <!-- Kitty Viewer Art -->
380 <texture name="Inv_WindLight" file_name="Inv_WindLight.png" preload="false" /> 383 <texture name="Inv_WindLight" file_name="Inv_WindLight.png" preload="false" />
381 <texture name="Inv_WaterLight" file_name="Inv_WaterLight.png" preload="false" /> 384 <texture name="Inv_WaterLight" file_name="Inv_WaterLight.png" preload="false" />
385
386 <texture name="media_btn_back.png"/>
387 <texture name="media_btn_done.png"/>
388 <texture name="media_btn_forward.png"/>
389 <texture name="media_btn_home.png"/>
390 <texture name="media_btn_newwindow.png"/>
391 <texture name="media_btn_optimalzoom.png"/>
392 <texture name="media_btn_reload.png"/>
393 <texture name="media_btn_scrolldown.png"/>
394 <texture name="media_btn_scrollleft.png"/>
395 <texture name="media_btn_scrollright.png"/>
396 <texture name="media_btn_scrollup.png"/>
397 <texture name="media_btn_stoploading.png"/>
398 <texture name="media_panel_divider.png"/>
399
382</textures> 400</textures>
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml b/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml
index 9bc91e7..c8aacba 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml
@@ -800,143 +800,633 @@ Only large parcels can be listed in search.
800 No Pushing (Region Override) 800 No Pushing (Region Override)
801 </string> 801 </string>
802 </panel> 802 </panel>
803 <panel border="true" bottom="-349" enabled="true" follows="left|top|right|bottom" 803 <panel
804 height="363" label="Media" left="1" mouse_opaque="true" 804 border="true"
805 name="land_media_panel" width="458"> 805 border_visible="true"
806 <text type="string" length="1" bottom="-25" follows="left|top" font="SansSerifSmall" halign="left" height="16" 806 bottom="-363"
807 left="10" mouse_opaque="true" name="with media:" width="65"> 807 enabled="true"
808 Media Type: 808 follows="left|top|right|bottom"
809 </text> 809 height="513"
810 <combo_box allow_text_entry="false" bottom_delta="0" follows="left|top" height="18" 810 label="Media"
811 left="80" max_chars="20" name="media type" 811 left="1"
812 tool_tip="Specify if the URL is a movie, web page, or other media" 812 mouse_opaque="true"
813 width="120" /> 813 name="land_media_panel"
814 <text bottom_delta="0" follows="left|top" font="SansSerifSmall" height="16" 814 width="458">
815 left_delta="130" name="mime_type" width="200" /> 815 <text
816 <text type="string" length="1" bottom_delta="-20" follows="left|top" font="SansSerifSmall" halign="left" 816 bottom="-25"
817 height="16" left="10" name="at URL:" width="65"> 817 follows="left|top"
818 Media URL: 818 font="SansSerifSmall"
819 </text> 819 halign="left"
820 <line_editor bottom_delta="0" follows="left|top" font="SansSerifSmall" height="16" left="80" 820 height="16"
821 max_length="255" name="media_url" right="-80" 821 left="10"
822 select_all_on_focus_received="true" select_on_focus="true" 822 length="1"
823 text_readonly_color="0.576471 0.662745 0.835294 1" /> 823 mouse_opaque="true"
824 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" halign="center" 824 name="with media:"
825 height="16" label="Set..." label_selected="Set..." mouse_opaque="true" 825 type="string"
826 name="set_media_url" right="-12" scale_image="true" width="60" /> 826 width="65">
827 <text type="string" length="1" bottom_delta="-20" follows="left|top" font="SansSerifSmall" halign="left" 827 Type:
828 height="16" left="10" name="Description:" width="364"> 828 </text>
829 <combo_box
830 allow_text_entry="false"
831 bottom_delta="0"
832 follows="left|top"
833 height="18"
834 left="80"
835 max_chars="20"
836 name="media type"
837 tool_tip="Specify if the URL is a movie, web page, or other media"
838 width="120" />
839 <text
840 bottom_delta="0"
841 follows="left|top"
842 font="SansSerifSmall"
843 height="16"
844 left_delta="130"
845 name="mime_type"
846 width="200" />
847 <text type="string"
848 bottom_delta="-21"
849 follows="left|top"
850 font="SansSerifSmall" halign="left"
851 height="16"
852 left="10"
853 length="1"
854 name="at URL:"
855 width="65">
856 Home URL:
857 </text>
858 <line_editor
859 bottom_delta="0"
860 follows="left|top|right"
861 font="SansSerifSmall"
862 height="16"
863 left="80"
864 max_length="255"
865 name="media_url"
866 right="-90"
867 select_all_on_focus_received="true"
868 select_on_focus="true"
869 text_readonly_color="0.576471 0.662745 0.835294 1" />
870 <button
871 bottom_delta="0"
872 follows="right|top"
873 font="SansSerifSmall"
874 halign="center"
875 height="16"
876 label="Set..."
877 label_selected="Set..."
878 mouse_opaque="true"
879 name="set_media_url"
880 right="-12"
881 scale_image="true"
882 width="70" />
883 <text
884 bottom_delta="-22"
885 follows="left|top"
886 font="SansSerifSmall"
887 halign="left"
888 height="16"
889 left="10"
890 length="1"
891 name="at URL:"
892 type="string"
893 width="65">
894 Current URL:
895 </text>
896 <text
897 bottom_delta="0"
898 follows="left|top|right"
899 font="SansSerifSmall"
900 halign="left"
901 height="16"
902 left="80"
903 name="current_url"
904 right="-90" />
905 <button
906 bottom_delta="0"
907 follows="right|top"
908 font="SansSerifSmall"
909 halign="center"
910 height="16"
911 label="Reset..."
912 label_selected="Reset..."
913 mouse_opaque="true"
914 name="reset_media_url"
915 right="-12"
916 scale_image="true"
917 width="70" />
918 <check_box
919 bottom_delta="-22"
920 enabled="true"
921 follows="left|top"
922 font="SansSerifSmall"
923 height="16"
924 initial_value="false"
925 label="Hide URL"
926 left="80"
927 mouse_opaque="true"
928 name="hide_media_url"
929 radio_style="false"
930 tool_tip="Checking this option will hide the media URL from any non-authorized viewers of this parcel information. Note this is not available for HTML types."
931 width="150" />
932 <text
933 bottom_delta="0"
934 follows="right|top"
935 font="SansSerifSmall"
936 halign="right"
937 height="16"
938 length="1"
939 name="media_reset"
940 right="-164"
941 tool_tip="Amount of time until parcel automatically reverts to default URL (0 for never return)"
942 type="string"
943 width="185">
944 Return to Home URL in:
945 </text>
946 <spinner
947 bottom_delta="0"
948 decimal_digits="0"
949 enabled="false"
950 follows="right|top"
951 halign="right"
952 height="16"
953 increment="1"
954 initial_val="0"
955 max_val="1024"
956 min_val="0"
957 name="media_reset_time"
958 right="-90"
959 tool_tip="Amount of time until parcel reverts to default URL (0 for never return)"
960 width="64" />
961 <text
962 bottom_delta="0"
963 follows="right|top"
964 font="SansSerifSmall"
965 halign="left"
966 height="16"
967 left_delta="70"
968 length="1"
969 name="minutes"
970 right="-10"
971 type="string">
972 Minutes
973 </text>
974 <text
975 bottom_delta="-22"
976 follows="left|top"
977 font="SansSerifSmall"
978 halign="left"
979 height="16"
980 left="10"
981 length="1"
982 name="Description:"
983 type="string"
984 width="364">
829 Description: 985 Description:
830 </text> 986 </text>
831 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0" 987 <line_editor
832 follows="left|top" font="SansSerifSmall" height="16" left="80" 988 bevel_style="in"
833 max_length="255" name="url_description" right="-80" 989 border_style="line"
834 select_all_on_focus_received="true" select_on_focus="true" 990 border_thickness="1"
835 tool_tip="Text displayed next to play/load button" spell_check="true" /> 991 bottom_delta="0"
836 <text type="string" length="1" bottom_delta="-20" follows="left|top" font="SansSerifSmall" halign="left" 992 follows="left|top|right"
837 height="16" left="10" name="Media texture:" width="364"> 993 font="SansSerifSmall"
838 Replace 994 height="16"
839Texture: 995 left="80"
840 </text> 996 max_length="255"
841 <texture_picker allow_no_texture="true" bottom_delta="-64" can_apply_immediately="false" 997 name="url_description"
842 default_image_name="Default" follows="left|top" height="80" label="" 998 right="-90"
843 left="80" name="media texture" tool_tip="Click to choose a picture" 999 select_all_on_focus_received="true"
844 width="64" /> 1000 select_on_focus="true"
845 <text type="string" length="1" bottom_delta="48" follows="left|top" font="SansSerifSmall" halign="left" 1001 tool_tip="Text displayed next to play/load button" />
846 height="16" left_delta="75" name="replace_texture_help" width="270"> 1002 <text
847 (Objects using this texture will show the movie or 1003 bottom_delta="-28"
848web page after you click the play arrow.) 1004 follows="left|top"
849 </text> 1005 font="SansSerifSmall"
850 <text type="string" length="1" bottom_delta="-55" follows="left|top" font="SansSerifSmall" halign="left" 1006 halign="left"
851 height="16" left="10" mouse_opaque="true" name="Options:" width="292"> 1007 height="16"
852 Media 1008 left="10"
853Options: 1009 length="1"
854 </text> 1010 name="Media texture:"
855 <check_box bottom_delta="0" enabled="true" follows="left|top" font="SansSerifSmall" 1011 type="string"
856 height="16" initial_value="false" label="Auto scale" left="80" 1012 width="364">
857 mouse_opaque="true" name="media_auto_scale" radio_style="false" 1013 Texture:
858 tool_tip="Checking this option will scale the content for this parcel automatically. It may be slightly slower and lower quality visually but no other texture scaling or alignment will be required." 1014 </text>
859 width="200" /> 1015 <texture_picker
860 <check_box bottom_delta="0" enabled="true" follows="left|top" font="SansSerifSmall" 1016 allow_no_texture="true"
861 height="16" initial_value="false" label="Loop Media" left="250" 1017 bottom_delta="-64"
862 mouse_opaque="true" name="media_loop" radio_style="false" 1018 can_apply_immediately="false"
863 tool_tip="Play media in a loop. When the media has finished playing, it will restart from the beginning." 1019 default_image_name="Default"
864 width="200" /> 1020 follows="left|top"
865 <check_box bottom_delta="-20" enabled="true" follows="left|top" font="SansSerifSmall" 1021 height="80"
866 height="16" initial_value="false" label="Hide Media URL" left="80" 1022 label=""
867 mouse_opaque="true" name="hide_media_url" radio_style="false" 1023 left="80"
868 tool_tip="Checking this option will hide the media url to any non-authorized viewers of this parcel information. Note this is not available for HTML types." 1024 name="media texture"
869 width="200" /> 1025 tool_tip="Click to choose a texture"
870 <check_box bottom_delta="0" enabled="true" follows="left|top" font="SansSerifSmall" 1026 width="64" />
871 height="16" initial_value="false" label="Hide Music URL" left="250" 1027 <text
872 mouse_opaque="true" name="hide_music_url" radio_style="false" 1028 type="string"
873 tool_tip="Checking this option will hide the music url to any non-authorized viewers of this parcel information" 1029 length="1"
874 width="200" /> 1030 bottom_delta="0"
875 <text type="string" length="1" bottom_delta="-25" follows="left|top" font="SansSerifSmall" halign="left" 1031 follows="left|top"
876 height="16" left="85" name="media_size" 1032 font="SansSerifSmall"
877 tool_tip="Size to render Web media, leave 0 for default." width="85"> 1033 halign="left"
878 Media size: 1034 height="80"
879 </text> 1035 left_delta="75"
880 <spinner bottom_delta="0" decimal_digits="0" enabled="false" follows="left|top" 1036 name="replace_texture_help"
881 halign="right" height="16" increment="1" initial_val="0" left_delta="65" 1037 width="270">
882 max_val="1024" min_val="0" name="media_size_width" 1038 Objects using this texture will show the movie or
883 tool_tip="Size to render Web media, leave 0 for default." width="64" /> 1039web page after you click the play arrow.
884 <spinner bottom_delta="0" decimal_digits="0" enabled="false" follows="left|top" 1040
885 halign="right" height="16" increment="1" initial_val="0" left_delta="80" 1041Select the thumbnail to choose a different texture.
886 max_val="1024" min_val="0" name="media_size_height" 1042 </text>
887 tool_tip="Size to render Web media, leave 0 for default." width="64" /> 1043 <text
888 <text type="string" length="1" bottom_delta="0" follows="left|top" font="SansSerifSmall" halign="left" 1044 bottom_delta="-16"
889 height="16" left_delta="70" name="pixels" right="-10"> 1045 follows="left|top"
1046 font="SansSerifSmall"
1047 halign="left"
1048 height="16"
1049 left="10"
1050 length="1"
1051 mouse_opaque="true"
1052 name="Options:"
1053 top_delta="0"
1054 type="string"
1055 width="64">
1056 Options:
1057 </text>
1058 <check_box
1059 bottom_delta="0"
1060 enabled="true"
1061 follows="left|top"
1062 font="SansSerifSmall"
1063 height="16"
1064 initial_value="false"
1065 label="Loop"
1066 left="80"
1067 mouse_opaque="true"
1068 name="media_loop"
1069 radio_style="false"
1070 tool_tip="Play media in a loop. When the media has finished playing, it will restart from the beginning."
1071 width="200" />
1072 <check_box
1073 bottom_delta="0"
1074 enabled="true"
1075 follows="left|top"
1076 font="SansSerifSmall"
1077 height="16"
1078 initial_value="false"
1079 label="Auto scale"
1080 left_delta="80"
1081 mouse_opaque="true"
1082 name="media_auto_scale"
1083 radio_style="false"
1084 tool_tip="Checking this option will scale the content for this parcel automatically. It may be slightly slower and lower quality visually but no other texture scaling or alignment will be required."
1085 width="200" />
1086 <text
1087 bottom_delta="-24"
1088 follows="left|top"
1089 font="SansSerifSmall"
1090 halign="left"
1091 height="16"
1092 left="10"
1093 length="1"
1094 name="media_size"
1095 tool_tip="Size to render Web media, leave 0 for default."
1096 type="string"
1097 width="85">
1098 Media Size:
1099 </text>
1100 <spinner
1101 bottom_delta="0"
1102 decimal_digits="0"
1103 enabled="false"
1104 follows="left|top"
1105 halign="right"
1106 height="16"
1107 increment="1"
1108 initial_val="0"
1109 left="80"
1110 max_val="1024"
1111 min_val="0"
1112 name="media_size_width"
1113 tool_tip="Width to render Web media, leave 0 for default."
1114 width="60" />
1115 <spinner
1116 bottom_delta="0"
1117 decimal_digits="0"
1118 enabled="false"
1119 follows="left|top"
1120 halign="right"
1121 height="16"
1122 increment="1"
1123 initial_val="0"
1124 left_delta="64"
1125 max_val="1024"
1126 min_val="0"
1127 name="media_size_height"
1128 tool_tip="Height to render Web media, leave 0 for default."
1129 width="60" />
1130 <text
1131 bottom_delta="0"
1132 follows="left|top"
1133 font="SansSerifSmall"
1134 halign="left"
1135 height="16"
1136 left_delta="64"
1137 length="1"
1138 name="pixels"
1139 type="string"
1140 width="70">
890 pixels 1141 pixels
891 </text> 1142 </text>
892 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 1143 <text
893 bottom_delta="-40" drop_shadow_visible="true" enabled="true" 1144 bg_visible="false"
894 follows="left|top" font="SansSerifSmall" h_pad="0" halign="left" 1145 border_drop_shadow_visible="false"
895 height="16" left="10" mouse_opaque="true" name="MusicURL:" v_pad="0" 1146 border_visible="false"
896 width="364"> 1147 bottom_delta="-30"
1148 drop_shadow_visible="true"
1149 enabled="true"
1150 follows="left|top"
1151 font="SansSerifSmall"
1152 h_pad="0"
1153 halign="left"
1154 height="16"
1155 left="10"
1156 length="1"
1157 mouse_opaque="true"
1158 name="Interaction:"
1159 type="string"
1160 v_pad="0"
1161 width="364">
1162 Interaction:
1163 </text>
1164 <radio_group
1165 bottom_delta="-2"
1166 draw_border="false"
1167 enabled="true"
1168 follows="left|top"
1169 height="22"
1170 left="80"
1171 mouse_opaque="true"
1172 name="radio_navigate_allow"
1173 tab_stop="true"
1174 width="219">
1175 <radio_item
1176 bottom="-20"
1177 enabled="true"
1178 follows="left|top"
1179 height="16"
1180 left="0"
1181 length="1"
1182 mouse_opaque="true"
1183 name="Anyone"
1184 tool_tip="Any resident can interact with media."
1185 type="string"
1186 width="70">
1187 Anyone
1188 </radio_item>
1189 <radio_item
1190 bottom="-20"
1191 enabled="true"
1192 follows="left|top"
1193 height="16"
1194 left="80"
1195 length="1"
1196 mouse_opaque="true"
1197 name="Group"
1198 tool_tip="Group permissions control who can interact with media."
1199 type="string"
1200 width="70">
1201 Group
1202 </radio_item>
1203 </radio_group>
1204 <check_box
1205 bottom_delta="-22"
1206 enabled="true"
1207 follows="left|top"
1208 font="SansSerifSmall"
1209 height="16"
1210 initial_value="false"
1211 label="Allow browsing only within these domains:"
1212 left="80"
1213 mouse_opaque="true"
1214 name="check navigate filter"
1215 radio_style="false"
1216 width="292" />
1217 <line_editor
1218 bevel_style="in"
1219 border_style="line"
1220 border_thickness="1"
1221 bottom_delta="-20"
1222 enabled="true"
1223 follows="left|top|right"
1224 font="SansSerifSmall"
1225 handle_edit_keys_directly="false"
1226 height="16"
1227 left="80"
1228 max_length="63"
1229 mouse_opaque="true"
1230 name="navigate_filter_domain"
1231 right="-90"
1232 select_all_on_focus_received="false"
1233 select_on_focus="false" />
1234 <button
1235 bottom_delta="0"
1236 enabled="true"
1237 follows="right|top"
1238 font="SansSerifSmall"
1239 halign="center"
1240 height="16"
1241 label="Add..."
1242 label_selected="Add..."
1243 right="-12"
1244 mouse_opaque="true"
1245 name="add_navigate_filter"
1246 scale_image="true"
1247 width="70" />
1248 <scroll_list
1249 bottom_delta="-52"
1250 can_resize="false"
1251 column_padding="0"
1252 draw_heading="false"
1253 draw_stripes="false"
1254 follows="left|top|right"
1255 height="50"
1256 halign="left"
1257 left="80"
1258 multi_select="false"
1259 name="filter_list"
1260 right="-90"
1261 search_column="0"
1262 sort_column="0">
1263 <column
1264 halign="left"
1265 label="Domain"
1266 name="domain"
1267 sort="domain"/>
1268 </scroll_list>
1269 <button
1270 bottom_delta="0"
1271 enabled="true"
1272 follows="right|top"
1273 font="SansSerifSmall"
1274 halign="center"
1275 height="16"
1276 label="Remove"
1277 label_selected="Remove"
1278 right="-12"
1279 mouse_opaque="true"
1280 name="remove_navigate_filter"
1281 scale_image="true"
1282 width="70" />
1283 </panel>
1284 <panel
1285 border="true"
1286 follows="left|top|right|bottom"
1287 height="363"
1288 label="Audio"
1289 layout="topleft"
1290 left_delta="0"
1291 name="land_audio_panel"
1292 top_delta="1"
1293 width="458">
1294 <text
1295 bottom="-45"
1296 follows="left|top"
1297 height="16"
1298 layout="topleft"
1299 left="10"
1300 length="1"
1301 name="MusicURL:"
1302 type="string"
1303 width="364">
897 Music URL: 1304 Music URL:
898 </text> 1305 </text>
899 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0" 1306 <line_editor
900 enabled="true" follows="left|top" font="SansSerifSmall" 1307 border_style="line"
901 handle_edit_keys_directly="false" height="16" left="80" max_length="255" 1308 border_thickness="1"
902 mouse_opaque="true" name="music_url" right="-15" 1309 bottom_delta="0"
903 select_all_on_focus_received="true" select_on_focus="true"/> 1310 follows="left|top|right"
904 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 1311 height="16"
905 bottom_delta="-40" drop_shadow_visible="true" enabled="true" 1312 layout="topleft"
906 follows="left|top" font="SansSerifSmall" h_pad="0" halign="left" 1313 left="80"
907 height="16" left="10" mouse_opaque="true" name="Sound:" v_pad="0" 1314 max_length="255"
908 width="364"> 1315 name="music_url"
1316 right="-15"
1317 select_on_focus="true" />
1318 <check_box
1319 bottom_delta="-25"
1320 enabled="true"
1321 follows="left|top"
1322 font="SansSerifSmall"
1323 height="16"
1324 initial_value="false"
1325 label="Hide URL"
1326 left="80"
1327 mouse_opaque="true"
1328 name="hide_music_url"
1329 radio_style="false"
1330 tool_tip="Checking this option will hide the music URL from any non-authorized viewers of this parcel information."
1331 width="150" />
1332 <text
1333 bottom_delta="-65"
1334 follows="left|top"
1335 height="16"
1336 layout="topleft"
1337 left="10"
1338 length="1"
1339 name="Sound:"
1340 type="string"
1341 width="364">
909 Sound: 1342 Sound:
910 </text> 1343 </text>
911 <check_box bottom_delta="0" enabled="true" follows="left|top" font="SansSerifSmall" 1344 <check_box
912 height="16" initial_value="false" 1345 bottom_delta="0"
913 label="Restrict gesture and object sounds to this parcel" left="80" 1346 follows="left|top"
914 mouse_opaque="true" name="check sound local" radio_style="false" 1347 height="16"
915 width="292" /> 1348 label="Restrict gesture and object sounds to this parcel"
916 <button bottom_delta="0" enabled="true" follows="left|top" font="SansSerif" 1349 layout="topleft"
917 halign="center" height="18" label="?" label_selected="?" left="372" 1350 left_delta="70"
918 mouse_opaque="true" name="?" width="18" /> 1351 name="check_sound_local"
919 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 1352 width="200" />
920 bottom_delta="-40" enabled="true" follows="left|top" font="SansSerifSmall" 1353 <button
921 h_pad="0" halign="left" height="16" left="10" mouse_opaque="false" 1354 bottom_delta="0"
922 name="Voice settings:" tab_stop="false" v_pad="0" width="364"> 1355 follows="left|top"
1356 height="18"
1357 label="?"
1358 label_selected="?"
1359 layout="topleft"
1360 left_delta="292"
1361 name="?"
1362 width="18" />
1363 <text
1364 bottom_delta="-65"
1365 follows="left|top"
1366 height="16"
1367 layout="topleft"
1368 left="10"
1369 length="1"
1370 mouse_opaque="false"
1371 name="Voice:"
1372 type="string"
1373 width="364">
923 Voice: 1374 Voice:
924 </text> 1375 </text>
925 <check_box bottom_delta="-0" enabled="true" follows="left|top" 1376 <radio_group
926 height="54" left="80" mouse_opaque="true" name="parcel_enable_voice_channel" 1377 bottom_delta="-40"
927 tab_stop="true" width="463" 1378 draw_border="false"
928 label="Enable Voice" 1379 enabled="true"
929 /> 1380 follows="left|top"
930 <check_box bottom_delta="-0" enabled="false" follows="left|top" 1381 height="60"
931 height="54" left="80" mouse_opaque="true" name="parcel_enable_voice_channel_is_estate_disabled" 1382 left="80"
932 tab_stop="true" width="463" 1383 mouse_opaque="true"
933 label="Enable Voice (established by the Estate)" 1384 name="parcel_voice_channel"
934 /> 1385 tab_stop="true"
935 <check_box bottom_delta="-20" enabled="true" follows="left|top" 1386 width="219">
936 height="54" left="100" mouse_opaque="true" name="parcel_enable_voice_channel_parcel" 1387 <radio_item
937 tab_stop="true" width="443" 1388 bottom="-19"
938 label="Restrict Voice to this parcel" 1389 enabled="true"
939 /> 1390 follows="left|top"
1391 height="16"
1392 left="0"
1393 length="1"
1394 mouse_opaque="true"
1395 name="Estate"
1396 tool_tip="Use the estate voice channel."
1397 type="string"
1398 width="70">
1399 Estate Channel
1400 </radio_item>
1401 <radio_item
1402 bottom="-39"
1403 enabled="true"
1404 follows="left|top"
1405 height="16"
1406 left="0"
1407 length="1"
1408 mouse_opaque="true"
1409 name="Parcel"
1410 tool_tip="Restrict Voice to this parcel."
1411 type="string"
1412 width="70">
1413 Parcel Channel
1414 </radio_item>
1415 <radio_item
1416 bottom="-59"
1417 enabled="true"
1418 follows="left|top"
1419 height="16"
1420 left="0"
1421 length="1"
1422 mouse_opaque="true"
1423 name="Disabled"
1424 tool_tip="Disable voice on this parcel."
1425 type="string"
1426 width="70">
1427 Disabled
1428 </radio_item>
1429 </radio_group>
940 </panel> 1430 </panel>
941 <panel border="true" bottom="-349" enabled="true" follows="left|top|right|bottom" 1431 <panel border="true" bottom="-349" enabled="true" follows="left|top|right|bottom"
942 height="333" label="Access" left="1" mouse_opaque="true" 1432 height="333" label="Access" left="1" mouse_opaque="true"
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_media_browser.xml b/linden/indra/newview/skins/default/xui/en-us/floater_media_browser.xml
index b30ca89..c1bfdcc 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_media_browser.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_media_browser.xml
@@ -18,7 +18,20 @@
18 <button bottom_delta="0" enabled="true" follows="right|top" height="20" label="Home" 18 <button bottom_delta="0" enabled="true" follows="right|top" height="20" label="Home"
19 left_delta="58" name="home" width="55" /> 19 left_delta="58" name="home" width="55" />
20 </layout_panel> 20 </layout_panel>
21 <layout_panel auto_resize="false" bottom="0" height="20" left="0" 21 <layout_panel auto_resize="false" bottom="0" height="20" left="0" name="time_controls" user_resize="false"
22 width="800">
23 <button bottom="0" follows="left|top" height="20" label="rewind" left="0" name="rewind"
24 width="55" />
25 <button bottom_delta="0" follows="left|top" height="20" label="" left_delta="55"
26 name="play" width="55" image_unselected="button_anim_play.tga" image_selected="button_anim_play_selected.tga" scale_image="true" />
27 <button bottom_delta="0" follows="left|top" height="20" label="" left_delta="0"
28 name="pause" width="55" image_unselected="button_anim_pause.tga" image_selected="button_anim_pause_selected.tga" scale_image="true" />
29 <button bottom_delta="0" follows="left|top" height="20" label="stop"
30 left_delta="65" name="stop" width="55" />
31 <button bottom_delta="0" follows="left|top" height="20" label="forward"
32 left_delta="75" name="seek" width="55" />
33 </layout_panel>
34 <layout_panel auto_resize="false" bottom="0" height="20" left="0"
22 name="parcel_owner_controls" user_resize="false" width="540"> 35 name="parcel_owner_controls" user_resize="false" width="540">
23 <button bottom="0" enabled="false" follows="left|top" height="20" 36 <button bottom="0" enabled="false" follows="left|top" height="20"
24 label="Send Current URL to Parcel" left="0" name="assign" width="200" /> 37 label="Send Current URL to Parcel" left="0" name="assign" width="200" />
@@ -38,4 +51,10 @@
38 name="close" width="70" /> 51 name="close" width="70" />
39 </layout_panel> 52 </layout_panel>
40 </layout_stack> 53 </layout_stack>
54 <string name="home_page_url">
55 http://www.secondlife.com
56 </string>
57 <string name="support_page_url">
58 http://support.secondlife.com
59 </string>
41</floater> 60</floater>
diff --git a/linden/indra/newview/skins/default/xui/en-us/mime_types.xml b/linden/indra/newview/skins/default/xui/en-us/mime_types.xml
index e3d1021..e69de29 100644
--- a/linden/indra/newview/skins/default/xui/en-us/mime_types.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/mime_types.xml
@@ -1,456 +0,0 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<mimetypes name="default">
3 <defaultlabel>
4 (Unknown)
5 </defaultlabel>
6 <defaultwidget>
7 none
8 </defaultwidget>
9 <defaultimpl>
10 LLMediaImplLLMozLib
11 </defaultimpl>
12 <widgetset name="web">
13 <label name="web_label">
14 Web Content
15 </label>
16 <icon>
17 icn_media_web.tga
18 </icon>
19 <default_type>
20 text/html
21 </default_type>
22 <tooltip name="web_tooltip">
23 This location has Web content
24 </tooltip>
25 <playtip name="web_playtip">
26 Show Web content
27 </playtip>
28 <allow_resize>
29 true
30 </allow_resize>
31 <allow_looping>
32 false
33 </allow_looping>
34 </widgetset>
35 <widgetset name="movie">
36 <label name="movie_label">
37 Movie
38 </label>
39 <default_type>
40 video/*
41 </default_type>
42 <icon>
43 icn_media_movie.tga
44 </icon>
45 <tooltip name="movie_tooltip">
46 There is a movie to play here
47 </tooltip>
48 <playtip name="movie_playtip">
49 Play movie
50 </playtip>
51 <allow_resize>
52 false
53 </allow_resize>
54 <allow_looping>
55 true
56 </allow_looping>
57 </widgetset>
58 <widgetset name="none">
59 <label name="none_label">
60 No Content
61 </label>
62 <default_type>
63 none/none
64 </default_type>
65 <icon>
66 icn_media_web.tga
67 </icon>
68 <tooltip name="none_tooltip">
69 No media here
70 </tooltip>
71 <playtip name="none_playtip" />
72 <allow_resize>
73 false
74 </allow_resize>
75 <allow_looping>
76 false
77 </allow_looping>
78 </widgetset>
79 <widgetset name="image">
80 <label name="image_label">
81 Image
82 </label>
83 <icon>
84 icn_media_web.tga
85 </icon>
86 <default_type>
87 image/*
88 </default_type>
89 <tooltip name="image_tooltip">
90 There is an image at this location
91 </tooltip>
92 <playtip name="image_playtip">
93 View this location&apos;s image
94 </playtip>
95 <allow_resize>
96 false
97 </allow_resize>
98 <allow_looping>
99 false
100 </allow_looping>
101 </widgetset>
102 <widgetset name="audio">
103 <label name="audio_label">
104 Audio
105 </label>
106 <icon>
107 icn_media_web.tga
108 </icon>
109 <default_type>
110 audio/*
111 </default_type>
112 <tooltip name="audio_tooltip">
113 There is audio at this location
114 </tooltip>
115 <playtip name="audio_playtip">
116 Play this location&apos;s audio
117 </playtip>
118 <allow_resize>
119 false
120 </allow_resize>
121 <allow_looping>
122 true
123 </allow_looping>
124 </widgetset>
125 <scheme name="rtsp">
126 <label name="rtsp_label">
127 Real Time Streaming
128 </label>
129 <widgettype>
130 movie
131 </widgettype>
132 </scheme>
133 <mimetype name="blank">
134 <label name="blank_label">
135 - None -
136 </label>
137 <widgettype>
138 none
139 </widgettype>
140 <impl>
141 LLMediaImplQuickTime
142 </impl>
143 </mimetype>
144 <mimetype name="none/none">
145 <label name="none/none_label">
146 - None -
147 </label>
148 <widgettype>
149 none
150 </widgettype>
151 </mimetype>
152 <mimetype name="audio/*">
153 <label name="audio2_label">
154 Audio
155 </label>
156 <widgettype>
157 audio
158 </widgettype>
159 </mimetype>
160 <mimetype name="video/*">
161 <label name="video2_label">
162 Video
163 </label>
164 <widgettype>
165 movie
166 </widgettype>
167 </mimetype>
168 <mimetype name="image/*">
169 <label name="image2_label">
170 Image
171 </label>
172 <widgettype>
173 image
174 </widgettype>
175 </mimetype>
176 <mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
177 <label name="vnd.secondlife.qt.legacy_label">
178 Movie (QuickTime)
179 </label>
180 <widgettype>
181 movie
182 </widgettype>
183 <impl>
184 LLMediaImplQuickTime
185 </impl>
186 </mimetype>
187 <mimetype name="application/javascript">
188 <label name="application/javascript_label">
189 Javascript
190 </label>
191 <widgettype>
192 web
193 </widgettype>
194 </mimetype>
195 <mimetype name="application/ogg">
196 <label name="application/ogg_label">
197 Ogg Audio/Video
198 </label>
199 <widgettype>
200 audio
201 </widgettype>
202 </mimetype>
203 <mimetype name="application/pdf">
204 <label name="application/pdf_label">
205 PDF Document
206 </label>
207 <widgettype>
208 image
209 </widgettype>
210 </mimetype>
211 <mimetype name="application/postscript">
212 <label name="application/postscript_label">
213 Postscript Document
214 </label>
215 <widgettype>
216 image
217 </widgettype>
218 </mimetype>
219 <mimetype name="application/rtf">
220 <label name="application/rtf_label">
221 Rich Text (RTF)
222 </label>
223 <widgettype>
224 image
225 </widgettype>
226 </mimetype>
227 <mimetype name="application/smil">
228 <label name="application/smil_label">
229 Synchronized Multimedia Integration Language (SMIL)
230 </label>
231 <widgettype>
232 movie
233 </widgettype>
234 </mimetype>
235 <mimetype name="application/xhtml+xml">
236 <label name="application/xhtml+xml_label">
237 Web Page (XHTML)
238 </label>
239 <widgettype>
240 web
241 </widgettype>
242 </mimetype>
243 <mimetype name="application/x-director">
244 <label name="application/x-director_label">
245 Macromedia Director
246 </label>
247 <widgettype>
248 image
249 </widgettype>
250 </mimetype>
251 <mimetype name="application/x-shockwave-flash">
252 <label name="application/x-shockwave-flash_label">
253 Flash
254 </label>
255 <widgettype>
256 image
257 </widgettype>
258 </mimetype>
259 <mimetype name="audio/mid">
260 <label name="audio/mid_label">
261 Audio (MIDI)
262 </label>
263 <widgettype>
264 audio
265 </widgettype>
266 </mimetype>
267 <mimetype name="audio/mpeg">
268 <label name="audio/mpeg_label">
269 Audio (MP3)
270 </label>
271 <widgettype>
272 audio
273 </widgettype>
274 </mimetype>
275 <mimetype name="audio/x-aiff">
276 <label name="audio/x-aiff_label">
277 Audio (AIFF)
278 </label>
279 <widgettype>
280 audio
281 </widgettype>
282 </mimetype>
283 <mimetype name="audio/x-wav">
284 <label name="audio/x-wav_label">
285 Audio (WAV)
286 </label>
287 <widgettype>
288 audio
289 </widgettype>
290 </mimetype>
291 <mimetype menu="1" name="image/bmp">
292 <label name="image/bmp_label">
293 Image (BMP)
294 </label>
295 <widgettype>
296 image
297 </widgettype>
298 <impl>
299 LLMediaImplLLMozLib
300 </impl>
301 </mimetype>
302 <mimetype menu="1" name="image/gif">
303 <label name="image/gif_label">
304 Image (GIF)
305 </label>
306 <widgettype>
307 image
308 </widgettype>
309 <impl>
310 LLMediaImplLLMozLib
311 </impl>
312 </mimetype>
313 <mimetype menu="1" name="image/jpeg">
314 <label name="image/jpeg_label">
315 Image (JPEG)
316 </label>
317 <widgettype>
318 image
319 </widgettype>
320 <impl>
321 LLMediaImplLLMozLib
322 </impl>
323 </mimetype>
324 <mimetype menu="1" name="image/png">
325 <label name="image/png_label">
326 Image (PNG)
327 </label>
328 <widgettype>
329 image
330 </widgettype>
331 <impl>
332 LLMediaImplLLMozLib
333 </impl>
334 </mimetype>
335 <mimetype name="image/svg+xml">
336 <label name="image/svg+xml_label">
337 Image (SVG)
338 </label>
339 <widgettype>
340 image
341 </widgettype>
342 <impl>
343 LLMediaImplLLMozLib
344 </impl>
345 </mimetype>
346 <mimetype menu="1" name="image/tiff">
347 <label name="image/tiff_label">
348 Image (TIFF)
349 </label>
350 <widgettype>
351 image
352 </widgettype>
353 <impl>
354 LLMediaImplLLMozLib
355 </impl>
356 </mimetype>
357 <mimetype menu="1" name="text/html">
358 <label name="text/html_label">
359 Web Page
360 </label>
361 <widgettype>
362 web
363 </widgettype>
364 <impl>
365 LLMediaImplLLMozLib
366 </impl>
367 </mimetype>
368 <mimetype menu="1" name="text/plain">
369 <label name="text/plain_label">
370 Text
371 </label>
372 <widgettype>
373 text
374 </widgettype>
375 <impl>
376 LLMediaImplLLMozLib
377 </impl>
378 </mimetype>
379 <mimetype name="text/xml">
380 <label name="text/xml_label">
381 XML
382 </label>
383 <widgettype>
384 text
385 </widgettype>
386 <impl>
387 LLMediaImplLLMozLib
388 </impl>
389 </mimetype>
390 <mimetype menu="1" name="video/mpeg">
391 <label name="video/mpeg_label">
392 Movie (MPEG)
393 </label>
394 <widgettype>
395 movie
396 </widgettype>
397 <impl>
398 LLMediaImplQuickTime
399 </impl>
400 </mimetype>
401 <mimetype name="video/mp4">
402 <label name="video/mp4_label">
403 Movie (MP4)
404 </label>
405 <widgettype>
406 movie
407 </widgettype>
408 <impl>
409 LLMediaImplQuickTime
410 </impl>
411 </mimetype>
412 <mimetype menu="1" name="video/quicktime">
413 <label name="video/quicktime_label">
414 Movie (QuickTime)
415 </label>
416 <widgettype>
417 movie
418 </widgettype>
419 <impl>
420 LLMediaImplQuickTime
421 </impl>
422 </mimetype>
423 <mimetype name="video/x-ms-asf">
424 <label name="video/x-ms-asf_label">
425 Movie (Windows Media ASF)
426 </label>
427 <widgettype>
428 movie
429 </widgettype>
430 <impl>
431 LLMediaImplQuickTime
432 </impl>
433 </mimetype>
434 <mimetype name="video/x-ms-wmv">
435 <label name="video/x-ms-wmv_label">
436 Movie (Windows Media WMV)
437 </label>
438 <widgettype>
439 movie
440 </widgettype>
441 <impl>
442 LLMediaImplQuickTime
443 </impl>
444 </mimetype>
445 <mimetype menu="1" name="video/x-msvideo">
446 <label name="video/x-msvideo_label">
447 Movie (AVI)
448 </label>
449 <widgettype>
450 movie
451 </widgettype>
452 <impl>
453 LLMediaImplQuickTime
454 </impl>
455 </mimetype>
456</mimetypes>
diff --git a/linden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml b/linden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml
new file mode 100644
index 0000000..2977d7a
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml
@@ -0,0 +1,445 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<mimetypes name="default">
3 <defaultlabel>
4 (Unknown)
5 </defaultlabel>
6 <defaultwidget>
7 none
8 </defaultwidget>
9 <defaultimpl>
10 media_plugin_webkit
11 </defaultimpl>
12 <widgetset name="web">
13 <label name="web_label">
14 Web Content
15 </label>
16 <icon>
17 icn_media_web.tga
18 </icon>
19 <default_type>
20 text/html
21 </default_type>
22 <tooltip name="web_tooltip">
23 This location has Web content
24 </tooltip>
25 <playtip name="web_playtip">
26 Show Web content
27 </playtip>
28 <allow_resize>
29 true
30 </allow_resize>
31 <allow_looping>
32 false
33 </allow_looping>
34 </widgetset>
35 <widgetset name="movie">
36 <label name="movie_label">
37 Movie
38 </label>
39 <default_type>
40 video/*
41 </default_type>
42 <icon>
43 icn_media_movie.tga
44 </icon>
45 <tooltip name="movie_tooltip">
46 There is a movie to play here
47 </tooltip>
48 <playtip name="movie_playtip">
49 Play movie
50 </playtip>
51 <allow_resize>
52 false
53 </allow_resize>
54 <allow_looping>
55 true
56 </allow_looping>
57 </widgetset>
58 <widgetset name="image">
59 <label name="image_label">
60 Image
61 </label>
62 <icon>
63 icn_media_web.tga
64 </icon>
65 <default_type>
66 image/*
67 </default_type>
68 <tooltip name="image_tooltip">
69 There is an image at this location
70 </tooltip>
71 <playtip name="image_playtip">
72 View this location&apos;s image
73 </playtip>
74 <allow_resize>
75 false
76 </allow_resize>
77 <allow_looping>
78 false
79 </allow_looping>
80 </widgetset>
81 <widgetset name="audio">
82 <label name="audio_label">
83 Audio
84 </label>
85 <icon>
86 icn_media_web.tga
87 </icon>
88 <default_type>
89 audio/*
90 </default_type>
91 <tooltip name="audio_tooltip">
92 There is audio at this location
93 </tooltip>
94 <playtip name="audio_playtip">
95 Play this location&apos;s audio
96 </playtip>
97 <allow_resize>
98 false
99 </allow_resize>
100 <allow_looping>
101 true
102 </allow_looping>
103 </widgetset>
104 <scheme name="rtsp">
105 <label name="rtsp_label">
106 Real Time Streaming
107 </label>
108 <widgettype>
109 movie
110 </widgettype>
111 <impl>
112 media_plugin_gstreamer
113 </impl>
114 </scheme>
115 <mimetype name="blank">
116 <label name="blank_label">
117 - None -
118 </label>
119 <widgettype>
120 none
121 </widgettype>
122 <impl>
123 media_plugin_gstreamer
124 </impl>
125 </mimetype>
126 <mimetype name="none/none">
127 <label name="none/none_label">
128 - None -
129 </label>
130 <widgettype>
131 none
132 </widgettype>
133 </mimetype>
134 <mimetype name="audio/*">
135 <label name="audio2_label">
136 Audio
137 </label>
138 <widgettype>
139 audio
140 </widgettype>
141 </mimetype>
142 <mimetype name="video/*">
143 <label name="video2_label">
144 Video
145 </label>
146 <widgettype>
147 movie
148 </widgettype>
149 </mimetype>
150 <mimetype name="image/*">
151 <label name="image2_label">
152 Image
153 </label>
154 <widgettype>
155 image
156 </widgettype>
157 </mimetype>
158 <mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
159 <label name="vnd.secondlife.qt.legacy_label">
160 Movie (QuickTime)
161 </label>
162 <widgettype>
163 movie
164 </widgettype>
165 <impl>
166 media_plugin_gstreamer
167 </impl>
168 </mimetype>
169 <mimetype name="application/javascript">
170 <label name="application/javascript_label">
171 Javascript
172 </label>
173 <widgettype>
174 web
175 </widgettype>
176 </mimetype>
177 <mimetype name="application/ogg">
178 <label name="application/ogg_label">
179 Ogg Audio/Video
180 </label>
181 <widgettype>
182 audio
183 </widgettype>
184 </mimetype>
185 <mimetype name="application/pdf">
186 <label name="application/pdf_label">
187 PDF Document
188 </label>
189 <widgettype>
190 image
191 </widgettype>
192 </mimetype>
193 <mimetype name="application/postscript">
194 <label name="application/postscript_label">
195 Postscript Document
196 </label>
197 <widgettype>
198 image
199 </widgettype>
200 </mimetype>
201 <mimetype name="application/rtf">
202 <label name="application/rtf_label">
203 Rich Text (RTF)
204 </label>
205 <widgettype>
206 image
207 </widgettype>
208 </mimetype>
209 <mimetype name="application/smil">
210 <label name="application/smil_label">
211 Synchronized Multimedia Integration Language (SMIL)
212 </label>
213 <widgettype>
214 movie
215 </widgettype>
216 <impl>
217 media_plugin_gstreamer
218 </impl>
219 </mimetype>
220 <mimetype name="application/xhtml+xml">
221 <label name="application/xhtml+xml_label">
222 Web Page (XHTML)
223 </label>
224 <widgettype>
225 web
226 </widgettype>
227 </mimetype>
228 <mimetype name="application/x-director">
229 <label name="application/x-director_label">
230 Macromedia Director
231 </label>
232 <widgettype>
233 image
234 </widgettype>
235 </mimetype>
236 <mimetype name="audio/mid">
237 <label name="audio/mid_label">
238 Audio (MIDI)
239 </label>
240 <widgettype>
241 audio
242 </widgettype>
243 <impl>
244 media_plugin_gstreamer
245 </impl>
246 </mimetype>
247 <mimetype name="audio/mpeg">
248 <label name="audio/mpeg_label">
249 Audio (MP3)
250 </label>
251 <widgettype>
252 audio
253 </widgettype>
254 <impl>
255 media_plugin_gstreamer
256 </impl>
257 </mimetype>
258 <mimetype name="audio/x-aiff">
259 <label name="audio/x-aiff_label">
260 Audio (AIFF)
261 </label>
262 <widgettype>
263 audio
264 </widgettype>
265 <impl>
266 media_plugin_gstreamer
267 </impl>
268 </mimetype>
269 <mimetype name="audio/x-wav">
270 <label name="audio/x-wav_label">
271 Audio (WAV)
272 </label>
273 <widgettype>
274 audio
275 </widgettype>
276 <impl>
277 media_plugin_gstreamer
278 </impl>
279 </mimetype>
280 <mimetype menu="1" name="image/bmp">
281 <label name="image/bmp_label">
282 Image (BMP)
283 </label>
284 <widgettype>
285 image
286 </widgettype>
287 <impl>
288 media_plugin_webkit
289 </impl>
290 </mimetype>
291 <mimetype menu="1" name="image/gif">
292 <label name="image/gif_label">
293 Image (GIF)
294 </label>
295 <widgettype>
296 image
297 </widgettype>
298 <impl>
299 media_plugin_webkit
300 </impl>
301 </mimetype>
302 <mimetype menu="1" name="image/jpeg">
303 <label name="image/jpeg_label">
304 Image (JPEG)
305 </label>
306 <widgettype>
307 image
308 </widgettype>
309 <impl>
310 media_plugin_webkit
311 </impl>
312 </mimetype>
313 <mimetype menu="1" name="image/png">
314 <label name="image/png_label">
315 Image (PNG)
316 </label>
317 <widgettype>
318 image
319 </widgettype>
320 <impl>
321 media_plugin_webkit
322 </impl>
323 </mimetype>
324 <mimetype name="image/svg+xml">
325 <label name="image/svg+xml_label">
326 Image (SVG)
327 </label>
328 <widgettype>
329 image
330 </widgettype>
331 <impl>
332 media_plugin_webkit
333 </impl>
334 </mimetype>
335 <mimetype menu="1" name="image/tiff">
336 <label name="image/tiff_label">
337 Image (TIFF)
338 </label>
339 <widgettype>
340 image
341 </widgettype>
342 <impl>
343 media_plugin_webkit
344 </impl>
345 </mimetype>
346 <mimetype menu="1" name="text/html">
347 <label name="text/html_label">
348 Web Page
349 </label>
350 <widgettype>
351 web
352 </widgettype>
353 <impl>
354 media_plugin_webkit
355 </impl>
356 </mimetype>
357 <mimetype menu="1" name="text/plain">
358 <label name="text/plain_label">
359 Text
360 </label>
361 <widgettype>
362 text
363 </widgettype>
364 <impl>
365 media_plugin_webkit
366 </impl>
367 </mimetype>
368 <mimetype name="text/xml">
369 <label name="text/xml_label">
370 XML
371 </label>
372 <widgettype>
373 text
374 </widgettype>
375 <impl>
376 media_plugin_webkit
377 </impl>
378 </mimetype>
379 <mimetype menu="1" name="video/mpeg">
380 <label name="video/mpeg_label">
381 Movie (MPEG)
382 </label>
383 <widgettype>
384 movie
385 </widgettype>
386 <impl>
387 media_plugin_gstreamer
388 </impl>
389 </mimetype>
390 <mimetype name="video/mp4">
391 <label name="video/mp4_label">
392 Movie (MP4)
393 </label>
394 <widgettype>
395 movie
396 </widgettype>
397 <impl>
398 media_plugin_gstreamer
399 </impl>
400 </mimetype>
401 <mimetype menu="1" name="video/quicktime">
402 <label name="video/quicktime_label">
403 Movie (QuickTime)
404 </label>
405 <widgettype>
406 movie
407 </widgettype>
408 <impl>
409 media_plugin_gstreamer
410 </impl>
411 </mimetype>
412 <mimetype name="video/x-ms-asf">
413 <label name="video/x-ms-asf_label">
414 Movie (Windows Media ASF)
415 </label>
416 <widgettype>
417 movie
418 </widgettype>
419 <impl>
420 media_plugin_gstreamer
421 </impl>
422 </mimetype>
423 <mimetype name="video/x-ms-wmv">
424 <label name="video/x-ms-wmv_label">
425 Movie (Windows Media WMV)
426 </label>
427 <widgettype>
428 movie
429 </widgettype>
430 <impl>
431 media_plugin_gstreamer
432 </impl>
433 </mimetype>
434 <mimetype menu="1" name="video/x-msvideo">
435 <label name="video/x-msvideo_label">
436 Movie (AVI)
437 </label>
438 <widgettype>
439 movie
440 </widgettype>
441 <impl>
442 media_plugin_gstreamer
443 </impl>
444 </mimetype>
445</mimetypes>
diff --git a/linden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml b/linden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml
new file mode 100644
index 0000000..4a7a6e1
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml
@@ -0,0 +1,445 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<mimetypes name="default">
3 <defaultlabel>
4 (Unknown)
5 </defaultlabel>
6 <defaultwidget>
7 none
8 </defaultwidget>
9 <defaultimpl>
10 media_plugin_webkit
11 </defaultimpl>
12 <widgetset name="web">
13 <label name="web_label">
14 Web Content
15 </label>
16 <icon>
17 icn_media_web.tga
18 </icon>
19 <default_type>
20 text/html
21 </default_type>
22 <tooltip name="web_tooltip">
23 This location has Web content
24 </tooltip>
25 <playtip name="web_playtip">
26 Show Web content
27 </playtip>
28 <allow_resize>
29 true
30 </allow_resize>
31 <allow_looping>
32 false
33 </allow_looping>
34 </widgetset>
35 <widgetset name="movie">
36 <label name="movie_label">
37 Movie
38 </label>
39 <default_type>
40 video/*
41 </default_type>
42 <icon>
43 icn_media_movie.tga
44 </icon>
45 <tooltip name="movie_tooltip">
46 There is a movie to play here
47 </tooltip>
48 <playtip name="movie_playtip">
49 Play movie
50 </playtip>
51 <allow_resize>
52 false
53 </allow_resize>
54 <allow_looping>
55 true
56 </allow_looping>
57 </widgetset>
58 <widgetset name="image">
59 <label name="image_label">
60 Image
61 </label>
62 <icon>
63 icn_media_web.tga
64 </icon>
65 <default_type>
66 image/*
67 </default_type>
68 <tooltip name="image_tooltip">
69 There is an image at this location
70 </tooltip>
71 <playtip name="image_playtip">
72 View this location&apos;s image
73 </playtip>
74 <allow_resize>
75 false
76 </allow_resize>
77 <allow_looping>
78 false
79 </allow_looping>
80 </widgetset>
81 <widgetset name="audio">
82 <label name="audio_label">
83 Audio
84 </label>
85 <icon>
86 icn_media_web.tga
87 </icon>
88 <default_type>
89 audio/*
90 </default_type>
91 <tooltip name="audio_tooltip">
92 There is audio at this location
93 </tooltip>
94 <playtip name="audio_playtip">
95 Play this location&apos;s audio
96 </playtip>
97 <allow_resize>
98 false
99 </allow_resize>
100 <allow_looping>
101 true
102 </allow_looping>
103 </widgetset>
104 <scheme name="rtsp">
105 <label name="rtsp_label">
106 Real Time Streaming
107 </label>
108 <widgettype>
109 movie
110 </widgettype>
111 <impl>
112 media_plugin_quicktime
113 </impl>
114 </scheme>
115 <mimetype name="blank">
116 <label name="blank_label">
117 - None -
118 </label>
119 <widgettype>
120 none
121 </widgettype>
122 <impl>
123 media_plugin_quicktime
124 </impl>
125 </mimetype>
126 <mimetype name="none/none">
127 <label name="none/none_label">
128 - None -
129 </label>
130 <widgettype>
131 none
132 </widgettype>
133 </mimetype>
134 <mimetype name="audio/*">
135 <label name="audio2_label">
136 Audio
137 </label>
138 <widgettype>
139 audio
140 </widgettype>
141 </mimetype>
142 <mimetype name="video/*">
143 <label name="video2_label">
144 Video
145 </label>
146 <widgettype>
147 movie
148 </widgettype>
149 </mimetype>
150 <mimetype name="image/*">
151 <label name="image2_label">
152 Image
153 </label>
154 <widgettype>
155 image
156 </widgettype>
157 </mimetype>
158 <mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
159 <label name="vnd.secondlife.qt.legacy_label">
160 Movie (QuickTime)
161 </label>
162 <widgettype>
163 movie
164 </widgettype>
165 <impl>
166 media_plugin_quicktime
167 </impl>
168 </mimetype>
169 <mimetype name="application/javascript">
170 <label name="application/javascript_label">
171 Javascript
172 </label>
173 <widgettype>
174 web
175 </widgettype>
176 </mimetype>
177 <mimetype name="application/ogg">
178 <label name="application/ogg_label">
179 Ogg Audio/Video
180 </label>
181 <widgettype>
182 audio
183 </widgettype>
184 </mimetype>
185 <mimetype name="application/pdf">
186 <label name="application/pdf_label">
187 PDF Document
188 </label>
189 <widgettype>
190 image
191 </widgettype>
192 </mimetype>
193 <mimetype name="application/postscript">
194 <label name="application/postscript_label">
195 Postscript Document
196 </label>
197 <widgettype>
198 image
199 </widgettype>
200 </mimetype>
201 <mimetype name="application/rtf">
202 <label name="application/rtf_label">
203 Rich Text (RTF)
204 </label>
205 <widgettype>
206 image
207 </widgettype>
208 </mimetype>
209 <mimetype name="application/smil">
210 <label name="application/smil_label">
211 Synchronized Multimedia Integration Language (SMIL)
212 </label>
213 <widgettype>
214 movie
215 </widgettype>
216 <impl>
217 media_plugin_quicktime
218 </impl>
219 </mimetype>
220 <mimetype name="application/xhtml+xml">
221 <label name="application/xhtml+xml_label">
222 Web Page (XHTML)
223 </label>
224 <widgettype>
225 web
226 </widgettype>
227 </mimetype>
228 <mimetype name="application/x-director">
229 <label name="application/x-director_label">
230 Macromedia Director
231 </label>
232 <widgettype>
233 image
234 </widgettype>
235 </mimetype>
236 <mimetype name="audio/mid">
237 <label name="audio/mid_label">
238 Audio (MIDI)
239 </label>
240 <widgettype>
241 audio
242 </widgettype>
243 <impl>
244 media_plugin_quicktime
245 </impl>
246 </mimetype>
247 <mimetype name="audio/mpeg">
248 <label name="audio/mpeg_label">
249 Audio (MP3)
250 </label>
251 <widgettype>
252 audio
253 </widgettype>
254 <impl>
255 media_plugin_quicktime
256 </impl>
257 </mimetype>
258 <mimetype name="audio/x-aiff">
259 <label name="audio/x-aiff_label">
260 Audio (AIFF)
261 </label>
262 <widgettype>
263 audio
264 </widgettype>
265 <impl>
266 media_plugin_quicktime
267 </impl>
268 </mimetype>
269 <mimetype name="audio/x-wav">
270 <label name="audio/x-wav_label">
271 Audio (WAV)
272 </label>
273 <widgettype>
274 audio
275 </widgettype>
276 <impl>
277 media_plugin_quicktime
278 </impl>
279 </mimetype>
280 <mimetype menu="1" name="image/bmp">
281 <label name="image/bmp_label">
282 Image (BMP)
283 </label>
284 <widgettype>
285 image
286 </widgettype>
287 <impl>
288 media_plugin_webkit
289 </impl>
290 </mimetype>
291 <mimetype menu="1" name="image/gif">
292 <label name="image/gif_label">
293 Image (GIF)
294 </label>
295 <widgettype>
296 image
297 </widgettype>
298 <impl>
299 media_plugin_webkit
300 </impl>
301 </mimetype>
302 <mimetype menu="1" name="image/jpeg">
303 <label name="image/jpeg_label">
304 Image (JPEG)
305 </label>
306 <widgettype>
307 image
308 </widgettype>
309 <impl>
310 media_plugin_webkit
311 </impl>
312 </mimetype>
313 <mimetype menu="1" name="image/png">
314 <label name="image/png_label">
315 Image (PNG)
316 </label>
317 <widgettype>
318 image
319 </widgettype>
320 <impl>
321 media_plugin_webkit
322 </impl>
323 </mimetype>
324 <mimetype name="image/svg+xml">
325 <label name="image/svg+xml_label">
326 Image (SVG)
327 </label>
328 <widgettype>
329 image
330 </widgettype>
331 <impl>
332 media_plugin_webkit
333 </impl>
334 </mimetype>
335 <mimetype menu="1" name="image/tiff">
336 <label name="image/tiff_label">
337 Image (TIFF)
338 </label>
339 <widgettype>
340 image
341 </widgettype>
342 <impl>
343 media_plugin_webkit
344 </impl>
345 </mimetype>
346 <mimetype menu="1" name="text/html">
347 <label name="text/html_label">
348 Web Page
349 </label>
350 <widgettype>
351 web
352 </widgettype>
353 <impl>
354 media_plugin_webkit
355 </impl>
356 </mimetype>
357 <mimetype menu="1" name="text/plain">
358 <label name="text/plain_label">
359 Text
360 </label>
361 <widgettype>
362 text
363 </widgettype>
364 <impl>
365 media_plugin_webkit
366 </impl>
367 </mimetype>
368 <mimetype name="text/xml">
369 <label name="text/xml_label">
370 XML
371 </label>
372 <widgettype>
373 text
374 </widgettype>
375 <impl>
376 media_plugin_webkit
377 </impl>
378 </mimetype>
379 <mimetype menu="1" name="video/mpeg">
380 <label name="video/mpeg_label">
381 Movie (MPEG)
382 </label>
383 <widgettype>
384 movie
385 </widgettype>
386 <impl>
387 media_plugin_quicktime
388 </impl>
389 </mimetype>
390 <mimetype name="video/mp4">
391 <label name="video/mp4_label">
392 Movie (MP4)
393 </label>
394 <widgettype>
395 movie
396 </widgettype>
397 <impl>
398 media_plugin_quicktime
399 </impl>
400 </mimetype>
401 <mimetype menu="1" name="video/quicktime">
402 <label name="video/quicktime_label">
403 Movie (QuickTime)
404 </label>
405 <widgettype>
406 movie
407 </widgettype>
408 <impl>
409 media_plugin_quicktime
410 </impl>
411 </mimetype>
412 <mimetype name="video/x-ms-asf">
413 <label name="video/x-ms-asf_label">
414 Movie (Windows Media ASF)
415 </label>
416 <widgettype>
417 movie
418 </widgettype>
419 <impl>
420 media_plugin_quicktime
421 </impl>
422 </mimetype>
423 <mimetype name="video/x-ms-wmv">
424 <label name="video/x-ms-wmv_label">
425 Movie (Windows Media WMV)
426 </label>
427 <widgettype>
428 movie
429 </widgettype>
430 <impl>
431 media_plugin_quicktime
432 </impl>
433 </mimetype>
434 <mimetype menu="1" name="video/x-msvideo">
435 <label name="video/x-msvideo_label">
436 Movie (AVI)
437 </label>
438 <widgettype>
439 movie
440 </widgettype>
441 <impl>
442 media_plugin_quicktime
443 </impl>
444 </mimetype>
445</mimetypes>
diff --git a/linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml b/linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml
new file mode 100644
index 0000000..4a7a6e1
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml
@@ -0,0 +1,445 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<mimetypes name="default">
3 <defaultlabel>
4 (Unknown)
5 </defaultlabel>
6 <defaultwidget>
7 none
8 </defaultwidget>
9 <defaultimpl>
10 media_plugin_webkit
11 </defaultimpl>
12 <widgetset name="web">
13 <label name="web_label">
14 Web Content
15 </label>
16 <icon>
17 icn_media_web.tga
18 </icon>
19 <default_type>
20 text/html
21 </default_type>
22 <tooltip name="web_tooltip">
23 This location has Web content
24 </tooltip>
25 <playtip name="web_playtip">
26 Show Web content
27 </playtip>
28 <allow_resize>
29 true
30 </allow_resize>
31 <allow_looping>
32 false
33 </allow_looping>
34 </widgetset>
35 <widgetset name="movie">
36 <label name="movie_label">
37 Movie
38 </label>
39 <default_type>
40 video/*
41 </default_type>
42 <icon>
43 icn_media_movie.tga
44 </icon>
45 <tooltip name="movie_tooltip">
46 There is a movie to play here
47 </tooltip>
48 <playtip name="movie_playtip">
49 Play movie
50 </playtip>
51 <allow_resize>
52 false
53 </allow_resize>
54 <allow_looping>
55 true
56 </allow_looping>
57 </widgetset>
58 <widgetset name="image">
59 <label name="image_label">
60 Image
61 </label>
62 <icon>
63 icn_media_web.tga
64 </icon>
65 <default_type>
66 image/*
67 </default_type>
68 <tooltip name="image_tooltip">
69 There is an image at this location
70 </tooltip>
71 <playtip name="image_playtip">
72 View this location&apos;s image
73 </playtip>
74 <allow_resize>
75 false
76 </allow_resize>
77 <allow_looping>
78 false
79 </allow_looping>
80 </widgetset>
81 <widgetset name="audio">
82 <label name="audio_label">
83 Audio
84 </label>
85 <icon>
86 icn_media_web.tga
87 </icon>
88 <default_type>
89 audio/*
90 </default_type>
91 <tooltip name="audio_tooltip">
92 There is audio at this location
93 </tooltip>
94 <playtip name="audio_playtip">
95 Play this location&apos;s audio
96 </playtip>
97 <allow_resize>
98 false
99 </allow_resize>
100 <allow_looping>
101 true
102 </allow_looping>
103 </widgetset>
104 <scheme name="rtsp">
105 <label name="rtsp_label">
106 Real Time Streaming
107 </label>
108 <widgettype>
109 movie
110 </widgettype>
111 <impl>
112 media_plugin_quicktime
113 </impl>
114 </scheme>
115 <mimetype name="blank">
116 <label name="blank_label">
117 - None -
118 </label>
119 <widgettype>
120 none
121 </widgettype>
122 <impl>
123 media_plugin_quicktime
124 </impl>
125 </mimetype>
126 <mimetype name="none/none">
127 <label name="none/none_label">
128 - None -
129 </label>
130 <widgettype>
131 none
132 </widgettype>
133 </mimetype>
134 <mimetype name="audio/*">
135 <label name="audio2_label">
136 Audio
137 </label>
138 <widgettype>
139 audio
140 </widgettype>
141 </mimetype>
142 <mimetype name="video/*">
143 <label name="video2_label">
144 Video
145 </label>
146 <widgettype>
147 movie
148 </widgettype>
149 </mimetype>
150 <mimetype name="image/*">
151 <label name="image2_label">
152 Image
153 </label>
154 <widgettype>
155 image
156 </widgettype>
157 </mimetype>
158 <mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
159 <label name="vnd.secondlife.qt.legacy_label">
160 Movie (QuickTime)
161 </label>
162 <widgettype>
163 movie
164 </widgettype>
165 <impl>
166 media_plugin_quicktime
167 </impl>
168 </mimetype>
169 <mimetype name="application/javascript">
170 <label name="application/javascript_label">
171 Javascript
172 </label>
173 <widgettype>
174 web
175 </widgettype>
176 </mimetype>
177 <mimetype name="application/ogg">
178 <label name="application/ogg_label">
179 Ogg Audio/Video
180 </label>
181 <widgettype>
182 audio
183 </widgettype>
184 </mimetype>
185 <mimetype name="application/pdf">
186 <label name="application/pdf_label">
187 PDF Document
188 </label>
189 <widgettype>
190 image
191 </widgettype>
192 </mimetype>
193 <mimetype name="application/postscript">
194 <label name="application/postscript_label">
195 Postscript Document
196 </label>
197 <widgettype>
198 image
199 </widgettype>
200 </mimetype>
201 <mimetype name="application/rtf">
202 <label name="application/rtf_label">
203 Rich Text (RTF)
204 </label>
205 <widgettype>
206 image
207 </widgettype>
208 </mimetype>
209 <mimetype name="application/smil">
210 <label name="application/smil_label">
211 Synchronized Multimedia Integration Language (SMIL)
212 </label>
213 <widgettype>
214 movie
215 </widgettype>
216 <impl>
217 media_plugin_quicktime
218 </impl>
219 </mimetype>
220 <mimetype name="application/xhtml+xml">
221 <label name="application/xhtml+xml_label">
222 Web Page (XHTML)
223 </label>
224 <widgettype>
225 web
226 </widgettype>
227 </mimetype>
228 <mimetype name="application/x-director">
229 <label name="application/x-director_label">
230 Macromedia Director
231 </label>
232 <widgettype>
233 image
234 </widgettype>
235 </mimetype>
236 <mimetype name="audio/mid">
237 <label name="audio/mid_label">
238 Audio (MIDI)
239 </label>
240 <widgettype>
241 audio
242 </widgettype>
243 <impl>
244 media_plugin_quicktime
245 </impl>
246 </mimetype>
247 <mimetype name="audio/mpeg">
248 <label name="audio/mpeg_label">
249 Audio (MP3)
250 </label>
251 <widgettype>
252 audio
253 </widgettype>
254 <impl>
255 media_plugin_quicktime
256 </impl>
257 </mimetype>
258 <mimetype name="audio/x-aiff">
259 <label name="audio/x-aiff_label">
260 Audio (AIFF)
261 </label>
262 <widgettype>
263 audio
264 </widgettype>
265 <impl>
266 media_plugin_quicktime
267 </impl>
268 </mimetype>
269 <mimetype name="audio/x-wav">
270 <label name="audio/x-wav_label">
271 Audio (WAV)
272 </label>
273 <widgettype>
274 audio
275 </widgettype>
276 <impl>
277 media_plugin_quicktime
278 </impl>
279 </mimetype>
280 <mimetype menu="1" name="image/bmp">
281 <label name="image/bmp_label">
282 Image (BMP)
283 </label>
284 <widgettype>
285 image
286 </widgettype>
287 <impl>
288 media_plugin_webkit
289 </impl>
290 </mimetype>
291 <mimetype menu="1" name="image/gif">
292 <label name="image/gif_label">
293 Image (GIF)
294 </label>
295 <widgettype>
296 image
297 </widgettype>
298 <impl>
299 media_plugin_webkit
300 </impl>
301 </mimetype>
302 <mimetype menu="1" name="image/jpeg">
303 <label name="image/jpeg_label">
304 Image (JPEG)
305 </label>
306 <widgettype>
307 image
308 </widgettype>
309 <impl>
310 media_plugin_webkit
311 </impl>
312 </mimetype>
313 <mimetype menu="1" name="image/png">
314 <label name="image/png_label">
315 Image (PNG)
316 </label>
317 <widgettype>
318 image
319 </widgettype>
320 <impl>
321 media_plugin_webkit
322 </impl>
323 </mimetype>
324 <mimetype name="image/svg+xml">
325 <label name="image/svg+xml_label">
326 Image (SVG)
327 </label>
328 <widgettype>
329 image
330 </widgettype>
331 <impl>
332 media_plugin_webkit
333 </impl>
334 </mimetype>
335 <mimetype menu="1" name="image/tiff">
336 <label name="image/tiff_label">
337 Image (TIFF)
338 </label>
339 <widgettype>
340 image
341 </widgettype>
342 <impl>
343 media_plugin_webkit
344 </impl>
345 </mimetype>
346 <mimetype menu="1" name="text/html">
347 <label name="text/html_label">
348 Web Page
349 </label>
350 <widgettype>
351 web
352 </widgettype>
353 <impl>
354 media_plugin_webkit
355 </impl>
356 </mimetype>
357 <mimetype menu="1" name="text/plain">
358 <label name="text/plain_label">
359 Text
360 </label>
361 <widgettype>
362 text
363 </widgettype>
364 <impl>
365 media_plugin_webkit
366 </impl>
367 </mimetype>
368 <mimetype name="text/xml">
369 <label name="text/xml_label">
370 XML
371 </label>
372 <widgettype>
373 text
374 </widgettype>
375 <impl>
376 media_plugin_webkit
377 </impl>
378 </mimetype>
379 <mimetype menu="1" name="video/mpeg">
380 <label name="video/mpeg_label">
381 Movie (MPEG)
382 </label>
383 <widgettype>
384 movie
385 </widgettype>
386 <impl>
387 media_plugin_quicktime
388 </impl>
389 </mimetype>
390 <mimetype name="video/mp4">
391 <label name="video/mp4_label">
392 Movie (MP4)
393 </label>
394 <widgettype>
395 movie
396 </widgettype>
397 <impl>
398 media_plugin_quicktime
399 </impl>
400 </mimetype>
401 <mimetype menu="1" name="video/quicktime">
402 <label name="video/quicktime_label">
403 Movie (QuickTime)
404 </label>
405 <widgettype>
406 movie
407 </widgettype>
408 <impl>
409 media_plugin_quicktime
410 </impl>
411 </mimetype>
412 <mimetype name="video/x-ms-asf">
413 <label name="video/x-ms-asf_label">
414 Movie (Windows Media ASF)
415 </label>
416 <widgettype>
417 movie
418 </widgettype>
419 <impl>
420 media_plugin_quicktime
421 </impl>
422 </mimetype>
423 <mimetype name="video/x-ms-wmv">
424 <label name="video/x-ms-wmv_label">
425 Movie (Windows Media WMV)
426 </label>
427 <widgettype>
428 movie
429 </widgettype>
430 <impl>
431 media_plugin_quicktime
432 </impl>
433 </mimetype>
434 <mimetype menu="1" name="video/x-msvideo">
435 <label name="video/x-msvideo_label">
436 Movie (AVI)
437 </label>
438 <widgettype>
439 movie
440 </widgettype>
441 <impl>
442 media_plugin_quicktime
443 </impl>
444 </mimetype>
445</mimetypes>
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_bars.xml b/linden/indra/newview/skins/default/xui/en-us/panel_bars.xml
index 4a13604..aab98db 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_bars.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_bars.xml
@@ -15,7 +15,4 @@
15 <layout_panel auto_resize="false" filename="panel_toolbar.xml" name="toolbar" 15 <layout_panel auto_resize="false" filename="panel_toolbar.xml" name="toolbar"
16 use_bounding_rect="true" user_resize="false" width="1024" min_height="28" /> 16 use_bounding_rect="true" user_resize="false" width="1024" min_height="28" />
17 </layout_stack> 17 </layout_stack>
18 <panel auto_resize="true" background_visible="false" bottom="50"
19 follows="left|right|top|bottom" height="728" left="0" mouse_opaque="false"
20 name="hud" user_resize="false" width="1024" />
21</panel> 18</panel>
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_hud.xml b/linden/indra/newview/skins/default/xui/en-us/panel_hud.xml
new file mode 100644
index 0000000..95f8289
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_hud.xml
@@ -0,0 +1,4 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel border="false" auto_resize="true" background_visible="false" bottom="50"
3 follows="left|right|top|bottom" height="728" left="0" mouse_opaque="false"
4 name="hud" user_resize="false" width="1024" />
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_media_hud.xml b/linden/indra/newview/skins/default/xui/en-us/panel_media_hud.xml
new file mode 100644
index 0000000..1c0781a
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_media_hud.xml
@@ -0,0 +1,68 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel border="false" follows="" height="160" visible="false" mouse_opaque="false"
3 label="" name="MediaHUD" width="208" background_visible="false" background_opaque="false" bg_alpha_color="1 1 1 0.0">
4<panel name="media_region" left="20" right="-20" bottom="35" top="-20" follows="left|right|top|bottom" visible="true" background_opaque="false"
5 mouse_opaque="false"/>
6 <!--icon name="bg_image" image_name="media_panel_hoverrectangle.png" visible="true" left="10" bottom="32" right="-10" top="-10" follows="left|right|top|bottom"/-->
7 <layout_stack orientation="horizontal" left="0" bottom="0" follows="left|right|bottom" visible="true" width="208" height="32">
8 <layout_panel user_resize="false"/>
9 <layout_panel user_resize="false" auto_resize="false" width="210" min_width="208">
10 <panel name="media_focused_controls" width="208" left="0" height="32" bottom="0" visible="true">
11 <icon name="media_panel_transportcontrols_bg" image_name="media_panel_bg.png" visible="true" height="32" width="99" scale_image="true" bottom="0"/>
12 <button name="back" label="" left="4" width="20" bottom="6" height="22" image_unselected="media_btn_back.png"
13 image_selected="media_btn_back.png" scale_image="true"/>
14 <icon name="media_panel_divider-1" image_name="media_panel_divider.png" visible="true" height="22" width="3" left_delta="20"
15 scale_image="false" bottom="5"/>
16 <button name="fwd" label="" left_delta="3" width="17" bottom_delta="0" height="22" image_unselected="media_btn_forward.png"
17 image_selected="media_btn_forward.png" scale_image="true"/>
18 <icon name="media_panel_divider-2" image_name="media_panel_divider.png" visible="true" height="22" width="3" left_delta="17"
19 scale_image="false" bottom="5"/>
20 <button name="home" label="" left_delta="3" width="22" bottom_delta="0" height="22" image_unselected="media_btn_home.png"
21 image_selected="media_btn_home.png" scale_image="true"/>
22 <button name="media_stop" label="" left_delta="0" width="22" bottom_delta="0" height="22" image_unselected="button_anim_stop.tga"
23 image_selected="button_anim_stop.tga" scale_image="true"/>
24 <icon name="media_panel_divider-3" image_name="media_panel_divider.png" visible="true" height="22" width="3" left_delta="22"
25 scale_image="false" bottom="5"/>
26 <button name="reload" label="" left_delta="3" width="22" bottom_delta="0" height="22" image_unselected="media_btn_reload.png"
27 image_selected="media_btn_reload.png" scale_image="true"/>
28 <button name="stop" label="" left_delta="0" width="22" bottom_delta="0" height="22" image_unselected="media_btn_stoploading.png"
29 image_selected="media_btn_stoploading.png" scale_image="true" visible="false"/>
30 <button name="play" label="" left_delta="0" width="22" bottom_delta="0" height="22" image_unselected="button_anim_play.tga"
31 image_selected="button_anim_play.tga" scale_image="true" visible="false"/>
32 <button name="pause" label="" left_delta="0" width="22" bottom_delta="0" height="22" image_unselected="button_anim_pause.tga"
33 image_selected="button_anim_pause.tga" scale_image="true" visible="false"/>
34 <icon name="media_panel_scrollbg" image_name="media_panel_scrollbg.png" visible="true" height="32" width="32"
35 scale_image="false" bottom="0" left="97"/>
36 <button name="scrollup" label="" left="109" width="8" bottom="20" height="8" image_unselected="media_btn_scrollup.png"
37 image_selected="media_btn_scrollup.png" scale_image="false"/>
38 <button name="scrollleft" label="" left="100" width="8" bottom="12" height="8" image_unselected="media_btn_scrollleft.png"
39 image_selected="media_btn_scrollleft.png" scale_image="false"/>
40 <button name="scrollright" label="" left="117" width="8" bottom="12" height="8" image_unselected="media_btn_scrollright.png"
41 image_selected="media_btn_scrollright.png" scale_image="false"/>
42 <button name="scrolldown" label="" left="109" width="8" bottom="4" height="8" image_unselected="media_btn_scrolldown.png"
43 image_selected="media_btn_scrolldown.png" scale_image="false"/>
44 <icon name="media_panel_metacontrols_bg" image_name="media_panel_bg.png" visible="true" height="32" width="81"
45 scale_image="true" bottom="0" left="127"/>
46 <button name="zoom_frame" label="" left_delta="4" width="22" bottom="5" height="22" image_unselected="media_btn_optimalzoom.png"
47 image_selected="media_btn_optimalzoom.png" scale_image="true"/>
48 <icon name="media_panel_divider-4" image_name="media_panel_divider.png" visible="true" height="22" width="3" left_delta="22"
49 scale_image="false" bottom="5"/>
50 <button name="new_window" label="" left_delta="3" width="24" bottom_delta="1" height="22" image_unselected="media_btn_newwindow.png"
51 image_selected="media_btn_newwindow.png" scale_image="true"/>
52 <icon name="media_panel_divider-5" image_name="media_panel_divider.png" visible="true" height="22" width="3" left_delta="24"
53 scale_image="false" bottom="5"/>
54 <button name="close" label="" left_delta="3" width="21" bottom_delta="1" height="22" image_unselected="media_btn_done.png"
55 image_selected="media_btn_done.png" scale_image="true"/>
56 </panel>
57 <panel name="media_hover_controls" width="57" left="74" height="32" bottom="0" visible="false">
58 <icon name="media_panel_metacontrols_bg-hover" image_name="media_panel_bg.png" visible="true" height="32" width="57" scale_image="true" bottom="0" left="0"/>
59 <button name="zoom_frame_hover" label="" left_delta="4" width="22" bottom="5" height="22" image_unselected="media_btn_optimalzoom.png" image_selected="media_btn_optimalzoom.png"
60 scale_image="true"/>
61 <icon name="media_panel_divider" image_name="media_panel_divider.png" visible="true" height="22" width="3" left_delta="22" scale_image="false" bottom="5"/>
62 <button name="new_window_hover" label="" left_delta="3" width="24" bottom_delta="1" height="22" image_unselected="media_btn_newwindow.png" image_selected="media_btn_newwindow.png"
63 scale_image="true"/>
64 </panel>
65 </layout_panel>
66 <layout_panel user_resize="false"/>
67 </layout_stack>
68</panel>
diff --git a/linden/indra/newview/viewer_manifest.py b/linden/indra/newview/viewer_manifest.py
index 6b5e800..fcebda9 100755
--- a/linden/indra/newview/viewer_manifest.py
+++ b/linden/indra/newview/viewer_manifest.py
@@ -229,6 +229,12 @@ class WindowsManifest(ViewerManifest):
229 229
230 self.path("imprudence.url") 230 self.path("imprudence.url")
231 231
232 # Plugin host application
233 self.path(os.path.join(os.pardir,
234 'llplugin', 'slplugin', self.args['configuration'], "SLPlugin.exe"),
235 "SLPlugin.exe")
236
237
232 self.path("featuretable.txt") 238 self.path("featuretable.txt")
233 239
234 # For use in crash reporting (generates minidumps) 240 # For use in crash reporting (generates minidumps)
@@ -251,7 +257,41 @@ class WindowsManifest(ViewerManifest):
251 self.path("alut.dll") 257 self.path("alut.dll")
252 self.end_prefix() 258 self.end_prefix()
253 259
254 # Mozilla appears to force a dependency on these files so we need to ship it (CP) - updated to vc8 versions (nyx) 260
261 # Media plugins - QuickTime
262 if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"):
263 self.path("media_plugin_quicktime.dll")
264 self.end_prefix()
265
266 # Media plugins - WebKit/Qt
267 if self.prefix(src='../media_plugins/webkit/%s' % self.args['configuration'], dst="llplugin"):
268 self.path("media_plugin_webkit.dll")
269 self.end_prefix()
270
271 # For WebKit/Qt plugin runtimes
272 if self.prefix(src="../../libraries/i686-win32/lib/release", dst="llplugin"):
273 self.path("libeay32.dll")
274 self.path("qtcore4.dll")
275 self.path("qtgui4.dll")
276 self.path("qtnetwork4.dll")
277 self.path("qtopengl4.dll")
278 self.path("qtwebkit4.dll")
279 self.path("ssleay32.dll")
280 self.end_prefix()
281
282 # For WebKit/Qt plugin runtimes (image format plugins)
283 if self.prefix(src="../../libraries/i686-win32/lib/release/imageformats", dst="llplugin/imageformats"):
284 self.path("qgif4.dll")
285 self.path("qico4.dll")
286 self.path("qjpeg4.dll")
287 self.path("qmng4.dll")
288 self.path("qsvg4.dll")
289 self.path("qtiff4.dll")
290 self.end_prefix()
291
292 # Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
293 self.path("skins/default/xui/en-us/mime_types_windows.xml", "skins/default/xui/en-us/mime_types.xml")
294
255 # These need to be installed as a SxS assembly, currently a 'private' assembly. 295 # These need to be installed as a SxS assembly, currently a 'private' assembly.
256 # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx 296 # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx
257 if self.prefix(src=self.args['configuration'], dst=""): 297 if self.prefix(src=self.args['configuration'], dst=""):
@@ -278,34 +318,6 @@ class WindowsManifest(ViewerManifest):
278 # same thing for auto-updater. 318 # same thing for auto-updater.
279 #self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst="updater.exe.config") 319 #self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst="updater.exe.config")
280 320
281 # Mozilla runtime DLLs (CP)
282 if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):
283 self.path("freebl3.dll")
284 self.path("js3250.dll")
285 self.path("nspr4.dll")
286 self.path("nss3.dll")
287 self.path("nssckbi.dll")
288 self.path("plc4.dll")
289 self.path("plds4.dll")
290 self.path("smime3.dll")
291 self.path("softokn3.dll")
292 self.path("ssl3.dll")
293 self.path("xpcom.dll")
294 self.path("xul.dll")
295 self.end_prefix()
296
297 # Mozilla runtime misc files (CP)
298 if self.prefix(src="app_settings/mozilla"):
299 self.path("chrome/*.*")
300 self.path("components/*.*")
301 self.path("greprefs/*.*")
302 self.path("plugins/*.*")
303 self.path("res/*.*")
304 self.path("res/*/*")
305 self.end_prefix()
306
307 # Mozilla hack to get it to accept newer versions of msvc*80.dll than are listed in manifest
308 # necessary as llmozlib2-vc80.lib refers to an old version of msvc*80.dll - can be removed when new version of llmozlib is built - Nyx
309 # Vivox runtimes 321 # Vivox runtimes
310 if self.prefix(src="vivox-runtime/i686-win32", dst=""): 322 if self.prefix(src="vivox-runtime/i686-win32", dst=""):
311 # self.path("alut.dll") 323 # self.path("alut.dll")
@@ -534,11 +546,8 @@ class DarwinManifest(ViewerManifest):
534 self.path(self.args['configuration'] + "/Imprudence.app", dst="") 546 self.path(self.args['configuration'] + "/Imprudence.app", dst="")
535 547
536 if self.prefix(src="", dst="Contents"): # everything goes in Contents 548 if self.prefix(src="", dst="Contents"): # everything goes in Contents
537 # Expand the tar file containing the assorted mozilla bits into 549
538 # <bundle>/Contents/MacOS/ 550 self.path("Info-Imprudence.plist", dst="Info.plist")
539 self.contents_of_tar(self.args['source']+'/mozilla-universal-darwin.tgz', 'MacOS')
540
541 self.path("Info-Imprudence.plist", dst="Info.plist")
542 551
543 # copy additional libs in <bundle>/Contents/MacOS/ 552 # copy additional libs in <bundle>/Contents/MacOS/
544 if self.prefix(src="../../libraries/universal-darwin/lib_release", dst="MacOS/"): 553 if self.prefix(src="../../libraries/universal-darwin/lib_release", dst="MacOS/"):
@@ -590,12 +599,6 @@ class DarwinManifest(ViewerManifest):
590 599
591 self.end_prefix("../../libraries/universal-darwin/lib_release") 600 self.end_prefix("../../libraries/universal-darwin/lib_release")
592 601
593 # replace the default theme with our custom theme (so scrollbars work).
594 if self.prefix(src="mozilla-theme", dst="MacOS/chrome"):
595 self.path("classic.jar")
596 self.path("classic.manifest")
597 self.end_prefix("MacOS/chrome")
598
599 # most everything goes in the Resources directory 602 # most everything goes in the Resources directory
600 if self.prefix(src="", dst="Resources"): 603 if self.prefix(src="", dst="Resources"):
601 super(DarwinManifest, self).construct() 604 super(DarwinManifest, self).construct()
@@ -723,7 +726,21 @@ class DarwinManifest(ViewerManifest):
723 # our apps 726 # our apps
724# self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app") 727# self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app")
725 self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app") 728 self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app")
729
730 # plugin launcher
731 self.path("../llplugin/slplugin/" + self.args['configuration'] + "/SLPlugin", "SLPlugin")
732
733 # plugins
734 if self.prefix(src="", dst="llplugin"):
735 self.path("../media_plugins/quicktime/" + self.args['configuration'] + "/media_plugin_quicktime.dylib", "media_plugin_quicktime.dylib")
736 self.path("../media_plugins/webkit/" + self.args['configuration'] + "/media_plugin_webkit.dylib", "media_plugin_webkit.dylib")
737 self.path("../../libraries/universal-darwin/lib_release/libllqtwebkit.dylib", "libllqtwebkit.dylib")
738
739 self.end_prefix("llplugin")
726 740
741 # Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
742 self.path("skins/default/xui/en-us/mime_types_mac.xml", "skins/default/xui/en-us/mime_types.xml")
743
727 # command line arguments for connecting to the proper grid 744 # command line arguments for connecting to the proper grid
728 self.put_in_file(self.flags_list(), 'arguments.txt') 745 self.put_in_file(self.flags_list(), 'arguments.txt')
729 746
@@ -766,7 +783,7 @@ class DarwinManifest(ViewerManifest):
766 # make sure we don't have stale files laying about 783 # make sure we don't have stale files laying about
767 self.remove(sparsename, finalname) 784 self.remove(sparsename, finalname)
768 785
769 self.run_command('hdiutil create "%(sparse)s" -volname "%(vol)s" -fs HFS+ -type SPARSE -megabytes 300 -layout SPUD' % { 786 self.run_command('hdiutil create "%(sparse)s" -volname "%(vol)s" -fs HFS+ -type SPARSE -megabytes 400 -layout SPUD' % {
770 'sparse':sparsename, 787 'sparse':sparsename,
771 'vol':volname}) 788 'vol':volname})
772 789
@@ -851,6 +868,23 @@ class LinuxManifest(ViewerManifest):
851 868
852 # Create an appropriate gridargs.dat for this package, denoting required grid. 869 # Create an appropriate gridargs.dat for this package, denoting required grid.
853 self.put_in_file(self.flags_list(), 'gridargs.dat') 870 self.put_in_file(self.flags_list(), 'gridargs.dat')
871 self.path("linux_tools/launch_url.sh","launch_url.sh")
872 self.path("../llplugin/slplugin/SLPlugin", "bin/SLPlugin")
873 if self.prefix("res-sdl"):
874 self.path("*")
875 # recurse
876 self.end_prefix("res-sdl")
877
878 # plugins
879 if self.prefix(src="", dst="bin/llplugin"):
880 self.path("../media_plugins/webkit/libmedia_plugin_webkit.so", "libmedia_plugin_webkit.so")
881 self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
882 self.end_prefix("bin/llplugin")
883
884 # Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
885 self.path("skins/default/xui/en-us/mime_types_linux.xml", "skins/default/xui/en-us/mime_types.xml")
886
887 self.path("featuretable_linux.txt")
854 888
855 889
856 def package_finish(self): 890 def package_finish(self):
@@ -904,17 +938,7 @@ class Linux_i686Manifest(LinuxManifest):
904 def construct(self): 938 def construct(self):
905 super(Linux_i686Manifest, self).construct() 939 super(Linux_i686Manifest, self).construct()
906 self.path("imprudence-stripped","bin/do-not-directly-run-imprudence-bin") 940 self.path("imprudence-stripped","bin/do-not-directly-run-imprudence-bin")
907# self.path("../linux_crash_logger/linux-crash-logger-stripped","linux-crash-logger.bin")
908 self.path("linux_tools/launch_url.sh","launch_url.sh")
909 if self.prefix("res-sdl"):
910 self.path("*")
911 # recurse
912 self.end_prefix("res-sdl")
913
914 self.path("featuretable_linux.txt")
915 #self.path("secondlife-i686.supp")
916 941
917 self.path("app_settings/mozilla-runtime-linux-i686")
918 942
919 if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"): 943 if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"):
920 self.path("libapr-1.so.0") 944 self.path("libapr-1.so.0")
diff --git a/linden/indra/newview/viewer_manifest.py~ b/linden/indra/newview/viewer_manifest.py~
new file mode 100755
index 0000000..452b165
--- /dev/null
+++ b/linden/indra/newview/viewer_manifest.py~
@@ -0,0 +1,1176 @@
1#!/usr/bin/python
2# @file viewer_manifest.py
3# @author Ryan Williams
4# @brief Description of all installer viewer files, and methods for packaging
5# them into installers for all supported platforms.
6#
7# $LicenseInfo:firstyear=2006&license=viewergpl$
8#
9# Copyright (c) 2006-2009, Linden Research, Inc.
10#
11# Second Life Viewer Source Code
12# The source code in this file ("Source Code") is provided by Linden Lab
13# to you under the terms of the GNU General Public License, version 2.0
14# ("GPL"), unless you have obtained a separate licensing agreement
15# ("Other License"), formally executed by you and Linden Lab. Terms of
16# the GPL can be found in doc/GPL-license.txt in this distribution, or
17# online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
18#
19# There are special exceptions to the terms and conditions of the GPL as
20# it is applied to this Source Code. View the full text of the exception
21# in the file doc/FLOSS-exception.txt in this software distribution, or
22# online at
23# http://secondlifegrid.net/programs/open_source/licensing/flossexception
24#
25# By copying, modifying or distributing this software, you acknowledge
26# that you have read and understood your obligations described above,
27# and agree to abide by those obligations.
28#
29# ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
30# WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
31# COMPLETENESS OR PERFORMANCE.
32# $/LicenseInfo$
33
34# DO NOT RUN THIS FILE DIRECTLY
35# Instead, run develop.py with "configure -DPACKAGE:BOOL=ON" e.g.:
36# develop.py -G vc80 configure -DPACKAGE:BOOL=ON
37# to generate the "package" project in Visual Studio 2005
38# Note: as of Imprudence 1.3, this defaults to on for Windows
39
40import sys
41import os.path
42import re
43import tarfile
44viewer_dir = os.path.dirname(__file__)
45# add llmanifest library to our path so we don't have to muck with PYTHONPATH
46sys.path.append(os.path.join(viewer_dir, '../lib/python/indra/util'))
47from llmanifest import LLManifest, main, proper_windows_path, path_ancestors
48
49class ViewerManifest(LLManifest):
50 def construct(self):
51 super(ViewerManifest, self).construct()
52 self.exclude("*.svn*")
53 self.path(src="../../scripts/messages/message_template.msg", dst="app_settings/message_template.msg")
54 self.path(src="../../etc/message.xml", dst="app_settings/message.xml")
55
56 if self.prefix(src="app_settings"):
57 self.exclude("logcontrol.xml")
58 self.exclude("logcontrol-dev.xml")
59 self.path("*.pem")
60 self.path("*.ini")
61 self.path("*.xml")
62 self.path("*.db2")
63
64 # include the entire shaders directory recursively
65 self.path("shaders")
66 # ... and the entire windlight directory
67 self.path("windlight")
68 self.end_prefix("app_settings")
69
70 if self.prefix(src="character"):
71 self.path("*.llm")
72 self.path("*.xml")
73 self.path("*.tga")
74 self.end_prefix("character")
75
76 # Include our fonts
77 if self.prefix(src="fonts"):
78 self.path("LiberationSans-Bold.ttf")
79 self.path("LiberationSans-Regular.ttf")
80 self.path("VeraMono.ttf")
81 self.path("DejaVuSansCondensed-BoldOblique.ttf")
82 self.path("DejaVuSansCondensed-Bold.ttf")
83 self.path("DejaVuSansCondensed-Oblique.ttf")
84 self.path("DejaVuSansCondensed.ttf")
85 self.path("GPL.txt")
86 self.path("Liberation-License.txt")
87 self.path("Vera-License.txt")
88 self.end_prefix("fonts")
89
90 # skins
91 if self.prefix(src="skins"):
92 self.path("paths.xml")
93 # include the entire textures directory recursively
94 if self.prefix(src="*/textures"):
95 self.path("*.tga")
96 self.path("*.j2c")
97 self.path("*.jpg")
98 self.path("*.png")
99 self.path("textures.xml")
100 self.end_prefix("*/textures")
101 self.path("*/xui/*/*.xml")
102 self.path("*/*.xml")
103
104 # Local HTML files (e.g. loading screen)
105 if self.prefix(src="*/html"):
106 self.path("*.png")
107 self.path("*/*/*.html")
108 self.path("*/*/*.gif")
109 self.path("*/*/*.png")
110 self.end_prefix("*/html")
111 self.end_prefix("skins")
112
113 # Files in the newview/ directory
114 self.path("gpu_table.txt")
115
116
117 # Gather up the README file, etc.
118 def gather_documents(self):
119 # From the top level directory (imprudence)
120 if self.prefix("../../..", dst=""):
121 self.path("README.txt")
122 self.path("MANIFESTO.txt")
123 self.path("CONTRIBUTE.txt")
124 self.path("RELEASE_NOTES.txt")
125 self.path("ChangeLog.txt", required=False)
126 self.end_prefix("../../..")
127
128 # From the linden directory
129 if self.prefix("../..", dst="doc"):
130 self.path("LICENSE-source.txt")
131 self.path("LICENSE-logos.txt", "LICENSE-artwork.txt")
132 self.end_prefix("../..")
133
134 # From the linden/doc directory
135 if self.prefix("../../doc", dst="doc"):
136 self.path("contributions.txt")
137 self.path("GPL-license.txt", "GPL.txt")
138 self.path("FLOSS-exception.txt")
139 self.end_prefix("../../doc")
140
141
142 def login_channel(self):
143 """Channel reported for login and upgrade purposes ONLY;
144 used for A/B testing"""
145 # NOTE: Do not return the normal channel if login_channel
146 # is not specified, as some code may branch depending on
147 # whether or not this is present
148 return self.args.get('login_channel')
149
150 def grid(self):
151 return self.args['grid']
152 def channel(self):
153 return self.args['channel']
154 def channel_unique(self):
155 return self.channel().replace("Imprudence", "").strip()
156 def channel_oneword(self):
157 return "".join(self.channel_unique().split())
158 def channel_lowerword(self):
159 return self.channel_oneword().lower()
160
161 def flags_list(self):
162 """ Convenience function that returns the command-line flags
163 for the grid"""
164
165 # Set command line flags relating to the target grid
166 grid_flags = ''
167 if not self.default_grid():
168 grid_flags = "--grid %(grid)s "\
169 "--helperuri http://preview-%(grid)s.secondlife.com/helpers/" %\
170 {'grid':self.grid()}
171
172 # set command line flags for channel
173 channel_flags = ''
174 if self.login_channel() and self.login_channel() != self.channel():
175 # Report a special channel during login, but use default
176 channel_flags = '--channel "%s"' % (self.login_channel())
177 elif not self.default_channel():
178 channel_flags = '--channel "%s"' % self.channel()
179
180 # Deal with settings
181 setting_flags = ''
182 if not self.default_channel() or not self.default_grid():
183 if self.default_grid():
184 setting_flags = '--settings settings_%s.xml'\
185 % self.channel_lowerword()
186 else:
187 setting_flags = '--settings settings_%s_%s.xml'\
188 % (self.grid(), self.channel_lowerword())
189
190 return " ".join((channel_flags, grid_flags, setting_flags)).strip()
191
192
193class WindowsManifest(ViewerManifest):
194 def final_exe(self):
195 if self.default_channel():
196 if self.default_grid():
197 return "imprudence.exe"
198 else:
199 return "imprudencepreview.exe"
200 else:
201 return ''.join(self.channel().split()) + '.exe'
202
203
204 def construct(self):
205 super(WindowsManifest, self).construct()
206 # the final exe is complicated because we're not sure where it's coming from,
207 # nor do we have a fixed name for the executable
208 self.path(self.find_existing_file('debug/imprudence-bin.exe', 'release/imprudence-bin.exe', 'relwithdebinfo/imprudence-bin.exe'), dst=self.final_exe())
209
210 self.gather_documents()
211
212 if self.prefix("../..", dst="doc"):
213 self.path("LICENSE-libraries.txt")
214 self.end_prefix("../..")
215
216
217 self.path("imprudence.url")
218
219 # Plugin host application
220 self.path(os.path.join(os.pardir,
221 'llplugin', 'slplugin', self.args['configuration'], "SLPlugin.exe"),
222 "SLPlugin.exe")
223
224
225 self.path("featuretable.txt")
226
227 # For use in crash reporting (generates minidumps)
228 self.path("dbghelp.dll")
229
230 # For using FMOD for sound... DJS
231 #self.path("fmod.dll")
232
233 # For spellchecking
234 self.path("libhunspell.dll")
235
236 # For textures
237 if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):
238 self.path("openjpeg.dll")
239 self.end_prefix()
240
241 # For sound
242 if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):
243 self.path("openal32.dll")
244 self.path("alut.dll")
245 self.end_prefix()
246
247
248 # Media plugins - QuickTime
249 if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"):
250 self.path("media_plugin_quicktime.dll")
251 self.end_prefix()
252
253 # Media plugins - WebKit/Qt
254 if self.prefix(src='../media_plugins/webkit/%s' % self.args['configuration'], dst="llplugin"):
255 self.path("media_plugin_webkit.dll")
256 self.end_prefix()
257
258 # For WebKit/Qt plugin runtimes
259 if self.prefix(src="../../libraries/i686-win32/lib/release", dst="llplugin"):
260 self.path("libeay32.dll")
261 self.path("qtcore4.dll")
262 self.path("qtgui4.dll")
263 self.path("qtnetwork4.dll")
264 self.path("qtopengl4.dll")
265 self.path("qtwebkit4.dll")
266 self.path("ssleay32.dll")
267 self.end_prefix()
268
269 # For WebKit/Qt plugin runtimes (image format plugins)
270 if self.prefix(src="../../libraries/i686-win32/lib/release/imageformats", dst="llplugin/imageformats"):
271 self.path("qgif4.dll")
272 self.path("qico4.dll")
273 self.path("qjpeg4.dll")
274 self.path("qmng4.dll")
275 self.path("qsvg4.dll")
276 self.path("qtiff4.dll")
277 self.end_prefix()
278
279 # Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
280 self.path("skins/default/xui/en-us/mime_types_windows.xml", "skins/default/xui/en-us/mime_types.xml")
281
282 # These need to be installed as a SxS assembly, currently a 'private' assembly.
283 # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx
284 if self.prefix(src=self.args['configuration'], dst=""):
285 if self.args['configuration'] == 'Debug':
286 self.path("msvcr80d.dll")
287 self.path("msvcp80d.dll")
288 self.path("Microsoft.VC80.DebugCRT.manifest")
289 else:
290 self.path("msvcr80.dll")
291 self.path("msvcp80.dll")
292 self.path("Microsoft.VC80.CRT.manifest")
293 self.end_prefix()
294
295 # The config file name needs to match the exe's name.
296 self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst=self.final_exe() + ".config")
297
298 # We need this one too, so that llkdu loads at runtime - DEV-41194
299 #self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst="llkdu.dll.2.config")
300 self.path("llkdu.dll.2.config")
301
302 # We need this one too, so that win_crash_logger.exe loads at runtime - DEV-19004
303 #self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst="win_crash_logger.exe.config")
304
305 # same thing for auto-updater.
306 #self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst="updater.exe.config")
307
308 # Vivox runtimes
309 if self.prefix(src="vivox-runtime/i686-win32", dst=""):
310 # self.path("alut.dll")
311 self.path("wrap_oal.dll")
312 self.path("SLVoice.exe")
313 # self.path("SLVoiceAgent.exe")
314 # self.path("libeay32.dll")
315 # self.path("srtp.dll")
316 # self.path("ssleay32.dll")
317 # self.path("tntk.dll")
318 self.path("vivoxsdk.dll")
319 self.path("ortp.dll")
320
321 self.end_prefix()
322
323 # Gstreamer plugins
324 if self.prefix(src="lib/gstreamer-plugins", dst=""):
325 self.path("*.dll", dst="lib/gstreamer-plugins/*.dll")
326 self.end_prefix()
327
328 # Gstreamer libs
329 if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):
330 self.path("iconv.dll")
331 self.path("libxml2.dll")
332 self.path("libcairo-2.dll")
333 self.path("libgio-2.0-0.dll")
334 self.path("libglib-2.0-0.dll")
335 self.path("libgmodule-2.0-0.dll")
336 self.path("libgobject-2.0-0.dll")
337 self.path("libgthread-2.0-0.dll")
338 self.path("charset.dll")
339 self.path("intl.dll")
340 self.path("libgcrypt-11.dll")
341 self.path("libgnutls-26.dll")
342 self.path("libgpg-error-0.dll")
343 self.path("libgstapp.dll")
344 self.path("libgstaudio.dll")
345 self.path("libgstbase-0.10.dll")
346 self.path("libgstcdda.dll")
347 self.path("libgstcontroller-0.10.dll")
348 self.path("libgstdataprotocol-0.10.dll")
349 self.path("libgstdshow.dll")
350 self.path("libgstfft.dll")
351 self.path("libgstinterfaces.dll")
352 self.path("libgstnet-0.10.dll")
353 self.path("libgstnetbuffer.dll")
354 self.path("libgstpbutils.dll")
355 self.path("libgstreamer-0.10.dll")
356 self.path("libgstriff.dll")
357 self.path("libgstrtp.dll")
358 self.path("libgstrtsp.dll")
359 self.path("libgstsdp.dll")
360 self.path("libgsttag.dll")
361 self.path("libgstvideo.dll")
362 self.path("libjpeg.dll")
363 self.path("libmp3lame-0.dll")
364 self.path("libneon-27.dll")
365 self.path("libogg-0.dll")
366 self.path("liboil-0.3-0.dll")
367 self.path("libopenjpeg-2.dll")
368 self.path("libpng12-0.dll")
369 self.path("libschroedinger-1.0-0.dll")
370 self.path("libspeex-1.dll")
371 self.path("libtheora-0.dll")
372 self.path("libvorbis-0.dll")
373 self.path("libvorbisenc-2.dll")
374 self.path("libxml2-2.dll")
375 self.path("glew32.dll")
376 self.path("xvidcore.dll")
377 self.path("zlib1.dll")
378 self.end_prefix()
379
380# # pull in the crash logger and updater from other projects
381# self.path(src=self.find_existing_file( # tag:"crash-logger" here as a cue to the exporter
382# "../win_crash_logger/debug/windows-crash-logger.exe",
383# "../win_crash_logger/release/windows-crash-logger.exe",
384# "../win_crash_logger/relwithdebinfo/windows-crash-logger.exe"),
385# dst="win_crash_logger.exe")
386 self.path(src=self.find_existing_file(
387 "../win_updater/debug/windows-updater.exe",
388 "../win_updater/release/windows-updater.exe",
389 "../win_updater/relwithdebinfo/windows-updater.exe"),
390 dst="updater.exe")
391
392 # For google-perftools tcmalloc allocator.
393 #if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):
394 # self.path("libtcmalloc_minimal.dll")
395 # self.end_prefix()
396
397
398 def nsi_file_commands(self, install=True):
399 def wpath(path):
400 if path.endswith('/') or path.endswith(os.path.sep):
401 path = path[:-1]
402 path = path.replace('/', '\\')
403 return path
404
405 result = ""
406 dest_files = [pair[1] for pair in self.file_list if pair[0] and os.path.isfile(pair[1])]
407 # sort deepest hierarchy first
408 dest_files.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b))
409 dest_files.reverse()
410 out_path = None
411 for pkg_file in dest_files:
412 rel_file = os.path.normpath(pkg_file.replace(self.get_dst_prefix()+os.path.sep,''))
413 installed_dir = wpath(os.path.join('$INSTDIR', os.path.dirname(rel_file)))
414 pkg_file = wpath(os.path.normpath(pkg_file))
415 if installed_dir != out_path:
416 if install:
417 out_path = installed_dir
418 result += 'SetOutPath ' + out_path + '\n'
419 if install:
420 result += 'File ' + pkg_file + '\n'
421 else:
422 result += 'Delete ' + wpath(os.path.join('$INSTDIR', rel_file)) + '\n'
423 # at the end of a delete, just rmdir all the directories
424 if not install:
425 deleted_file_dirs = [os.path.dirname(pair[1].replace(self.get_dst_prefix()+os.path.sep,'')) for pair in self.file_list]
426 # find all ancestors so that we don't skip any dirs that happened to have no non-dir children
427 deleted_dirs = []
428 for d in deleted_file_dirs:
429 deleted_dirs.extend(path_ancestors(d))
430 # sort deepest hierarchy first
431 deleted_dirs.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b))
432 deleted_dirs.reverse()
433 prev = None
434 for d in deleted_dirs:
435 if d != prev: # skip duplicates
436 result += 'RMDir ' + wpath(os.path.join('$INSTDIR', os.path.normpath(d))) + '\n'
437 prev = d
438
439 return result
440
441 def package_finish(self):
442 # a standard map of strings for replacing in the templates
443 substitution_strings = {
444 'version' : '.'.join(self.args['version']).replace(' ', '_'),
445 'version_short' : '.'.join(self.args['version'][:-1]).replace(' ', '_'),
446 'version_dashes' : '-'.join(self.args['version']).replace(' ', '_'),
447 'final_exe' : self.final_exe(),
448 'grid':self.args['grid'],
449 'grid_caps':self.args['grid'].upper(),
450 # escape quotes becase NSIS doesn't handle them well
451 'flags':self.flags_list().replace('"', '$\\"'),
452 'channel':self.channel(),
453 'channel_oneword':self.channel_oneword(),
454 'channel_unique':self.channel_unique(),
455 }
456
457 version_vars = """
458 !define INSTEXE "%(final_exe)s"
459 !define VERSION "%(version_short)s"
460 !define VERSION_LONG "%(version)s"
461 !define VERSION_DASHES "%(version_dashes)s"
462 """ % substitution_strings
463 if self.default_channel():
464 if self.default_grid():
465 # release viewer
466 installer_file = "Imprudence_%(version_dashes)s_Setup.exe"
467 grid_vars_template = """
468 OutFile "%(installer_file)s"
469 !define INSTFLAGS "%(flags)s"
470 !define INSTNAME "Imprudence"
471 !define SHORTCUT "Imprudence"
472 !define URLNAME "imprudence"
473 Caption "Imprudence ${VERSION}"
474 """
475 else:
476 # beta grid viewer
477 installer_file = "Imprudence_%(version_dashes)s_(%(grid_caps)s)_Setup.exe"
478 grid_vars_template = """
479 OutFile "%(installer_file)s"
480 !define INSTFLAGS "%(flags)s"
481 !define INSTNAME "Imprudence%(grid_caps)s"
482 !define SHORTCUT "Imprudence (%(grid_caps)s)"
483 !define URLNAME "imprudence%(grid)s"
484 !define UNINSTALL_SETTINGS 1
485 Caption "Imprudence %(grid)s ${VERSION}"
486 """
487 else:
488 # some other channel on some grid
489 installer_file = "Imprudence_%(version_dashes)s_%(channel_oneword)s_Setup.exe"
490 grid_vars_template = """
491 OutFile "%(installer_file)s"
492 !define INSTFLAGS "%(flags)s"
493 !define INSTNAME "Imprudence%(channel_oneword)s"
494 !define SHORTCUT "%(channel)s"
495 !define URLNAME "imprudence"
496 !define UNINSTALL_SETTINGS 1
497 Caption "%(channel)s ${VERSION}"
498 """
499 if 'installer_name' in self.args:
500 installer_file = self.args['installer_name']
501 else:
502 installer_file = installer_file % substitution_strings
503 substitution_strings['installer_file'] = installer_file
504
505 tempfile = "imprudence_setup_tmp.nsi"
506 # the following replaces strings in the nsi template
507 # it also does python-style % substitution
508 self.replace_in("installers/windows/installer_template.nsi", tempfile, {
509 "%%VERSION%%":version_vars,
510 "%%SOURCE%%":self.get_src_prefix(),
511 "%%GRID_VARS%%":grid_vars_template % substitution_strings,
512 "%%INSTALL_FILES%%":self.nsi_file_commands(True),
513 "%%DELETE_FILES%%":self.nsi_file_commands(False)})
514
515 # We use the Unicode version of NSIS, available from
516 # http://www.scratchpaper.com/
517 NSIS_path = 'C:\\Program Files\\NSIS\\Unicode\\makensis.exe'
518 self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile))
519 # self.remove(self.dst_path_of(tempfile))
520 # If we're on a build machine, sign the code using our Authenticode certificate. JC
521 sign_py = 'C:\\buildscripts\\code-signing\\sign.py'
522 if os.path.exists(sign_py):
523 self.run_command(sign_py + ' ' + self.dst_path_of(installer_file))
524 else:
525 print "Skipping code signing,", sign_py, "does not exist"
526 self.created_path(self.dst_path_of(installer_file))
527 self.package_file = installer_file
528
529
530class DarwinManifest(ViewerManifest):
531 def construct(self):
532 # copy over the build result (this is a no-op if run within the xcode script)
533 self.path(self.args['configuration'] + "/Imprudence.app", dst="")
534
535 if self.prefix(src="", dst="Contents"): # everything goes in Contents
536
537 self.path("Info-Imprudence.plist", dst="Info.plist")
538
539 # copy additional libs in <bundle>/Contents/MacOS/
540 if self.prefix(src="../../libraries/universal-darwin/lib_release", dst="MacOS/"):
541
542 self.path("libndofdev.dylib")
543
544 self.path("libopenal.1.dylib")
545 self.path("libalut.0.dylib")
546
547 self.path("libglib-2.0.dylib")
548 self.path("libgmodule-2.0.dylib")
549 self.path("libgobject-2.0.dylib")
550 self.path("libgthread-2.0.dylib")
551
552 self.path("libgstreamer-0.10.dylib")
553 self.path("libgstapp-0.10.dylib")
554 self.path("libgstaudio-0.10.dylib")
555 self.path("libgstbase-0.10.dylib")
556 self.path("libgstcdda-0.10.dylib")
557 self.path("libgstcontroller-0.10.dylib")
558 self.path("libgstdataprotocol-0.10.dylib")
559 self.path("libgstfft-0.10.dylib")
560 self.path("libgstinterfaces-0.10.dylib")
561 self.path("libgstnet-0.10.dylib")
562 self.path("libgstnetbuffer-0.10.dylib")
563 self.path("libgstpbutils-0.10.dylib")
564 self.path("libgstriff-0.10.dylib")
565 self.path("libgstrtp-0.10.dylib")
566 self.path("libgstrtsp-0.10.dylib")
567 self.path("libgstsdp-0.10.dylib")
568 self.path("libgsttag-0.10.dylib")
569 self.path("libgstvideo-0.10.dylib")
570
571 self.path("libxml2.2.dylib")
572 self.path("libfaad.2.dylib")
573 self.path("libFLAC.8.dylib")
574 self.path("libintl.3.dylib")
575 self.path("libjpeg.62.dylib")
576 self.path("libpng12.0.dylib")
577 self.path("libneon.27.dylib")
578 self.path("libogg.0.dylib")
579 self.path("liboil-0.3.0.dylib")
580 self.path("libopenjpeg.1.4.dylib")
581 self.path("libtheora.0.dylib")
582 self.path("libvorbis.0.dylib")
583 self.path("libvorbisenc.2.dylib")
584 self.path("libvorbisfile.3.dylib")
585
586 self.end_prefix("../../libraries/universal-darwin/lib_release")
587
588 # most everything goes in the Resources directory
589 if self.prefix(src="", dst="Resources"):
590 super(DarwinManifest, self).construct()
591
592 if self.prefix("cursors_mac"):
593 self.path("*.tif")
594 self.end_prefix("cursors_mac")
595
596 # From the linden directory
597 if self.prefix("../..", dst="doc"):
598 self.path("LICENSE-libraries.txt")
599 self.end_prefix("../..")
600
601 self.gather_documents()
602
603 self.path("featuretable_mac.txt")
604 self.path("SecondLife.nib")
605
606 self.path("viewer.icns")
607
608 # Translations
609 self.path("English.lproj")
610 self.path("German.lproj")
611 self.path("Japanese.lproj")
612 self.path("Korean.lproj")
613 self.path("da.lproj")
614 self.path("es.lproj")
615 self.path("fr.lproj")
616 self.path("hu.lproj")
617 self.path("it.lproj")
618 self.path("nl.lproj")
619 self.path("pl.lproj")
620 self.path("pt.lproj")
621 self.path("ru.lproj")
622 self.path("tr.lproj")
623 self.path("uk.lproj")
624 self.path("zh-Hans.lproj")
625
626
627 if self.prefix(src="../../libraries/universal-darwin/lib_release/gstreamer-plugins", dst="lib/gstreamer-plugins"):
628 self.path("libgstaacparse.so")
629 self.path("libgstadder.so")
630 self.path("libgstaiffparse.so")
631 self.path("libgstamrparse.so")
632 self.path("libgstapp.so")
633 self.path("libgstaudioconvert.so")
634 self.path("libgstaudiorate.so")
635 self.path("libgstaudioresample.so")
636 self.path("libgstautodetect.so")
637 self.path("libgstavi.so")
638 self.path("libgstcoreelements.so")
639 self.path("libgstcoreindexers.so")
640 self.path("libgstdebug.so")
641 self.path("libgstdecodebin.so")
642 self.path("libgstdecodebin2.so")
643 self.path("libgstdeinterlace2.so")
644 self.path("libgstequalizer.so")
645 self.path("libgstfaad.so")
646 self.path("libgstffmpeg.so")
647 self.path("libgstffmpegcolorspace.so")
648 self.path("libgstffmpegscale.so")
649 self.path("libgstfilter.so")
650 self.path("libgstflac.so")
651 self.path("libgstflv.so")
652 self.path("libgstgdp.so")
653 self.path("libgsth264parse.so")
654 self.path("libgsticydemux.so")
655 self.path("libgstid3demux.so")
656 self.path("libgstinterleave.so")
657 self.path("libgstjpeg.so")
658 self.path("libgstlevel.so")
659 self.path("libgstmetadata.so")
660 self.path("libgstmpeg4videoparse.so")
661 self.path("libgstmpegdemux.so")
662 self.path("libgstmpegvideoparse.so")
663 self.path("libgstmultifile.so")
664 self.path("libgstmultipart.so")
665 self.path("libgstneonhttpsrc.so")
666 self.path("libgstogg.so")
667 self.path("libgstosxaudio.so")
668 self.path("libgstosxvideosink.so")
669 self.path("libgstplaybin.so")
670 self.path("libgstpng.so")
671 self.path("libgstpostproc.so")
672 self.path("libgstqtdemux.so")
673 #self.path("libgstqtwrapper.so")
674 self.path("libgstqueue2.so")
675 self.path("libgstreal.so")
676 self.path("libgstrtp.so")
677 self.path("libgstrtpmanager.so")
678 self.path("libgstrtsp.so")
679 self.path("libgstsdpelem.so")
680 self.path("libgstselector.so")
681 self.path("libgststereo.so")
682 self.path("libgsttcp.so")
683 self.path("libgsttheora.so")
684 self.path("libgsttypefindfunctions.so")
685 self.path("libgstudp.so")
686 self.path("libgstvideobalance.so")
687 self.path("libgstvideobox.so")
688 self.path("libgstvideocrop.so")
689 self.path("libgstvideoflip.so")
690 self.path("libgstvideomixer.so")
691 self.path("libgstvideorate.so")
692 self.path("libgstvideoscale.so")
693 self.path("libgstvideosignal.so")
694 self.path("libgstvolume.so")
695 self.path("libgstvorbis.so")
696 self.path("libgstwavparse.so")
697
698 self.end_prefix("../../libraries/universal-darwin/lib_release/gstreamer-plugins")
699
700
701 # SLVoice and vivox lols
702 self.path("vivox-runtime/universal-darwin/libalut.dylib", "libalut.dylib")
703 self.path("vivox-runtime/universal-darwin/libopenal.dylib", "libopenal.dylib")
704 self.path("vivox-runtime/universal-darwin/libortp.dylib", "libortp.dylib")
705 self.path("vivox-runtime/universal-darwin/libvivoxsdk.dylib", "libvivoxsdk.dylib")
706 self.path("vivox-runtime/universal-darwin/SLVoice", "SLVoice")
707 #self.path("vivox-runtime/universal-darwin/SLVoiceAgent.app", "SLVoiceAgent.app")
708
709 #libfmodwrapper.dylib
710 #self.path(self.args['configuration'] + "/libfmodwrapper.dylib", "libfmodwrapper.dylib")
711
712 # our apps
713# self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app")
714 self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app")
715
716 # plugin launcher
717 self.path("../llplugin/slplugin/" + self.args['configuration'] + "/SLPlugin", "SLPlugin")
718
719 # plugins
720 if self.prefix(src="", dst="llplugin"):
721 self.path("../media_plugins/quicktime/" + self.args['configuration'] + "/media_plugin_quicktime.dylib", "media_plugin_quicktime.dylib")
722 self.path("../media_plugins/webkit/" + self.args['configuration'] + "/media_plugin_webkit.dylib", "media_plugin_webkit.dylib")
723 self.path("../../libraries/universal-darwin/lib_release/libllqtwebkit.dylib", "libllqtwebkit.dylib")
724
725 self.end_prefix("llplugin")
726
727 # Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
728 self.path("skins/default/xui/en-us/mime_types_mac.xml", "skins/default/xui/en-us/mime_types.xml")
729
730 # command line arguments for connecting to the proper grid
731 self.put_in_file(self.flags_list(), 'arguments.txt')
732
733 self.end_prefix("Resources")
734
735 self.end_prefix("Contents")
736
737 # NOTE: the -S argument to strip causes it to keep enough info for
738 # annotated backtraces (i.e. function names in the crash log). 'strip' with no
739 # arguments yields a slightly smaller binary but makes crash logs mostly useless.
740 # This may be desirable for the final release. Or not.
741 if ("package" in self.args['actions'] or
742 "unpacked" in self.args['actions']):
743 self.run_command('strip -S "%(viewer_binary)s"' %
744 { 'viewer_binary' : self.dst_path_of('Contents/MacOS/Second Life')})
745
746
747 def package_finish(self):
748 channel_standin = 'Imprudence' # hah, our default channel is not usable on its own
749 if not self.default_channel():
750 channel_standin = self.channel()
751
752 imagename="Imprudence_" + '_'.join(self.args['version'])
753
754 # MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning.
755 # If we really need differently named volumes, we'll need to create multiple DS_Store file images, or use some other trick.
756
757 volname="Imprudence Installer" # DO NOT CHANGE without understanding comment above
758
759 if self.default_channel():
760 if not self.default_grid():
761 # beta case
762 imagename = imagename + '_' + self.args['grid'].upper()
763 else:
764 # first look, etc
765 imagename = imagename + '_' + self.channel_oneword().upper()
766
767 sparsename = imagename + ".sparseimage"
768 finalname = imagename + ".dmg"
769 # make sure we don't have stale files laying about
770 self.remove(sparsename, finalname)
771
772 self.run_command('hdiutil create "%(sparse)s" -volname "%(vol)s" -fs HFS+ -type SPARSE -megabytes 400 -layout SPUD' % {
773 'sparse':sparsename,
774 'vol':volname})
775
776 # mount the image and get the name of the mount point and device node
777 hdi_output = self.run_command('hdiutil attach -private "' + sparsename + '"')
778 devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip()
779 volpath = re.search('HFS\s+(.+)', hdi_output).group(1).strip()
780
781 # Copy everything in to the mounted .dmg
782
783 if self.default_channel() and not self.default_grid():
784 app_name = "Imprudence " + self.args['grid']
785 else:
786 app_name = channel_standin.strip()
787
788 # Hack:
789 # Because there is no easy way to coerce the Finder into positioning
790 # the app bundle in the same place with different app names, we are
791 # adding multiple .DS_Store files to svn. There is one for release,
792 # one for release candidate and one for first look. Any other channels
793 # will use the release .DS_Store, and will look broken.
794 # - Ambroff 2008-08-20
795 dmg_template = os.path.join(
796 'installers',
797 'darwin',
798 '%s-dmg' % "".join(self.channel_unique().split()).lower())
799
800 if not os.path.exists (self.src_path_of(dmg_template)):
801 dmg_template = os.path.join ('installers', 'darwin', 'release-dmg')
802
803 for s,d in {self.get_dst_prefix():app_name + ".app",
804 os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns",
805 os.path.join(dmg_template, "background.jpg"): "background.jpg",
806 os.path.join(dmg_template, "_DS_Store"): ".DS_Store"}.items():
807 print "Copying to dmg", s, d
808 self.copy_action(self.src_path_of(s), os.path.join(volpath, d))
809
810 # Hide the background image, DS_Store file, and volume icon file (set their "visible" bit)
811 self.run_command('SetFile -a V "' + os.path.join(volpath, ".VolumeIcon.icns") + '"')
812 self.run_command('SetFile -a V "' + os.path.join(volpath, "background.jpg") + '"')
813 self.run_command('SetFile -a V "' + os.path.join(volpath, ".DS_Store") + '"')
814
815 # Create the alias file (which is a resource file) from the .r
816 self.run_command('rez "' + self.src_path_of("installers/darwin/release-dmg/Applications-alias.r") + '" -o "' + os.path.join(volpath, "Applications") + '"')
817
818 # Set the alias file's alias and custom icon bits
819 self.run_command('SetFile -a AC "' + os.path.join(volpath, "Applications") + '"')
820
821 # Set the disk image root's custom icon bit
822 self.run_command('SetFile -a C "' + volpath + '"')
823
824 # Unmount the image
825 self.run_command('hdiutil detach -force "' + devfile + '"')
826
827 print "Converting temp disk image to final disk image"
828 self.run_command('hdiutil convert "%(sparse)s" -format UDZO -imagekey zlib-level=9 -o "%(final)s"' % {'sparse':sparsename, 'final':finalname})
829 # get rid of the temp file
830 self.package_file = finalname
831 self.remove(sparsename)
832
833class LinuxManifest(ViewerManifest):
834 def construct(self):
835 super(LinuxManifest, self).construct()
836
837 self.path("res/imprudence_icon.png","imprudence_icon.png")
838 if self.prefix("linux_tools", dst=""):
839 #self.path("client-readme.txt","README-linux.txt")
840 self.path("client-readme-voice.txt","README-linux-voice.txt")
841 #self.path("client-readme-joystick.txt","README-linux-joystick.txt")
842 self.path("wrapper.sh","imprudence")
843 self.path("handle_secondlifeprotocol.sh")
844 self.path("register_secondlifeprotocol.sh")
845 self.path("getvoice.sh")
846 self.end_prefix("linux_tools")
847
848 self.gather_documents()
849
850 # From the linden directory
851 if self.prefix("../..", dst="doc"):
852 self.path("LICENSE-libraries.txt")
853 self.end_prefix("../..")
854
855 # Create an appropriate gridargs.dat for this package, denoting required grid.
856 self.put_in_file(self.flags_list(), 'gridargs.dat')
857 self.path("linux_tools/launch_url.sh","launch_url.sh")
858 self.path("../llplugin/slplugin/SLPlugin", "bin/SLPlugin")
859 if self.prefix("res-sdl"):
860 self.path("*")
861 # recurse
862 self.end_prefix("res-sdl")
863
864 # plugins
865 if self.prefix(src="", dst="bin/llplugin"):
866 self.path("../media_plugins/webkit/libmedia_plugin_webkit.so", "libmedia_plugin_webkit.so")
867 self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
868 self.end_prefix("bin/llplugin")
869
870 # Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
871 self.path("skins/default/xui/en-us/mime_types_linux.xml", "skins/default/xui/en-us/mime_types.xml")
872
873 self.path("featuretable_linux.txt")
874
875
876 def package_finish(self):
877 if 'installer_name' in self.args:
878 installer_name = self.args['installer_name']
879 else:
880 installer_name_components = ['Imprudence_', self.args.get('arch')]
881 installer_name_components.extend(self.args['version'])
882 installer_name = "_".join(installer_name_components)
883 if self.default_channel():
884 if not self.default_grid():
885 installer_name += '_' + self.args['grid'].upper()
886 else:
887 installer_name += '_' + self.channel_oneword().upper()
888
889 # Fix access permissions
890 self.run_command("""
891 find %(dst)s -type d | xargs --no-run-if-empty chmod 755;
892 find %(dst)s -type f -perm 0700 | xargs --no-run-if-empty chmod 0755;
893 find %(dst)s -type f -perm 0500 | xargs --no-run-if-empty chmod 0555;
894 find %(dst)s -type f -perm 0600 | xargs --no-run-if-empty chmod 0644;
895 find %(dst)s -type f -perm 0400 | xargs --no-run-if-empty chmod 0444;
896 true""" % {'dst':self.get_dst_prefix() })
897
898 self.package_file = installer_name + '.tar.bz2'
899
900 # Disabled for now. It's a waste of time to package every compile.
901
902 # if("package" in self.args['actions'] or
903 # "unpacked" in self.args['actions']):
904 #
905 # # temporarily move directory tree so that it has the right
906 # # name in the tarfile
907 # self.run_command("mv %(dst)s %(inst)s" % {
908 # 'dst': self.get_dst_prefix(),
909 # 'inst': self.build_path_of(installer_name)})
910 # try:
911 # # --numeric-owner hides the username of the builder for
912 # # security etc.
913 # self.run_command('tar -C %(dir)s --numeric-owner -cjf '
914 # '%(inst_path)s.tar.bz2 %(inst_name)s' % {
915 # 'dir': self.get_build_prefix(),
916 # 'inst_name': installer_name,
917 # 'inst_path':self.build_path_of(installer_name)})
918 # finally:
919 # self.run_command("mv %(inst)s %(dst)s" % {
920 # 'dst': self.get_dst_prefix(),
921 # 'inst': self.build_path_of(installer_name)})
922
923class Linux_i686Manifest(LinuxManifest):
924 def construct(self):
925 super(Linux_i686Manifest, self).construct()
926 self.path("imprudence-stripped","bin/do-not-directly-run-imprudence-bin")
927
928
929 if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"):
930 self.path("libapr-1.so.0")
931 self.path("libaprutil-1.so.0")
932 self.path("libdb-4.2.so")
933 self.path("libcrypto.so.0.9.7")
934 self.path("libexpat.so.1")
935 self.path("libssl.so.0.9.7")
936 self.path("libuuid.so", "libuuid.so.1")
937 self.path("libSDL-1.2.so.0")
938 self.path("libELFIO.so")
939 self.path("libopenjpeg.so.2")
940 self.path("libxml2.so.2")
941 self.path("libz.so.1")
942
943 # OpenAL
944 self.path("libopenal.so.1")
945 self.path("libalut.so.0")
946
947 # GTK+ and dependencies
948 self.path("libatk-1.0.so.0")
949 self.path("libcairo.so.2")
950 self.path("libfontconfig.so.1")
951 self.path("libfreetype.so.6")
952 # self.path("libgdk_pixbuf-2.0.so.0") # see linux64 why
953 self.path("libgdk-x11-2.0.so.0")
954 self.path("libgtk-x11-2.0.so.0")
955 # self.path("libpango-1.0.so.0") # dto.
956 # self.path("libpangoft2-1.0.so.0")
957 # self.path("libpangox-1.0.so.0")
958 # self.path("libpangoxft-1.0.so.0")
959 self.path("libpixman-1.so.0")
960
961 # Gstreamer libs
962 self.path("libgstbase-0.10.so.0")
963 self.path("libgstreamer-0.10.so.0")
964 self.path("libgstaudio-0.10.so.0")
965 self.path("libgstbase-0.10.so.0")
966 self.path("libgstcontroller-0.10.so.0")
967 self.path("libgstdataprotocol-0.10.so.0")
968 self.path("libgstinterfaces-0.10.so.0")
969 self.path("libgstnetbuffer-0.10.so.0")
970 self.path("libgstpbutils-0.10.so.0")
971 self.path("libgstriff-0.10.so.0")
972 self.path("libgstrtp-0.10.so.0")
973 self.path("libgstrtsp-0.10.so.0")
974 self.path("libgstsdp-0.10.so.0")
975 self.path("libgsttag-0.10.so.0")
976 self.path("libgstvideo-0.10.so.0")
977
978 # Gstreamer plugin dependencies
979 self.path("libfaad.so.0")
980 self.path("libogg.so.0")
981 self.path("libtheora.so.0")
982 self.path("libvorbis.so.0")
983 self.path("libvorbisenc.so.2")
984 self.path("liboil-0.3.so.0")
985
986 # Gstreamer plugins
987 if self.prefix("gstreamer-plugins"):
988 self.path("libgstalsa.so")
989 self.path("libgstasf.so")
990 self.path("libgstaudioconvert.so")
991 self.path("libgstaudioresample.so")
992 self.path("libgstautodetect.so")
993 self.path("libgstavi.so")
994 self.path("libgstcoreelements.so")
995 self.path("libgstcoreindexers.so")
996 self.path("libgstdecodebin2.so")
997 self.path("libgstdecodebin.so")
998 self.path("libgstesd.so")
999 self.path("libgstfaad.so")
1000 self.path("libgstffmpeg.so")
1001 self.path("libgstgnomevfs.so")
1002 self.path("libgsticydemux.so")
1003 self.path("libgstid3demux.so")
1004 self.path("libgstmpegdemux.so")
1005 self.path("libgstmultifile.so")
1006 self.path("libgstmultipart.so")
1007 self.path("libgstogg.so")
1008 self.path("libgstossaudio.so")
1009 self.path("libgstplaybin.so")
1010 self.path("libgstpulse.so")
1011 self.path("libgstqtdemux.so")
1012 self.path("libgstqueue2.so")
1013 self.path("libgsttcp.so")
1014 self.path("libgsttheora.so")
1015 self.path("libgsttypefindfunctions.so")
1016 self.path("libgstudp.so")
1017 self.path("libgstvideoscale.so")
1018 self.path("libgstvolume.so")
1019 self.path("libgstvorbis.so")
1020 self.path("libgstwavparse.so")
1021
1022 self.end_prefix("gstreamer-plugins")
1023
1024 self.end_prefix("lib")
1025
1026 # Vivox runtimes and libs
1027 if self.prefix(src="vivox-runtime/i686-linux", dst="bin"):
1028 self.path("SLVoice")
1029 self.end_prefix("bin")
1030
1031 if self.prefix(src="vivox-runtime/i686-linux", dst="lib"):
1032 self.path("libalut.so")
1033 self.path("libortp.so")
1034 self.path("libvivoxsdk.so")
1035 self.end_prefix("lib")
1036
1037class Linux_x86_64Manifest(LinuxManifest):
1038 def construct(self):
1039 super(Linux_x86_64Manifest, self).construct()
1040 self.path("imprudence-stripped","bin/do-not-directly-run-imprudence-bin")
1041# self.path("../linux_crash_logger/linux-crash-logger-stripped","linux-crash-logger.bin")
1042
1043 self.path("linux_tools/launch_url.sh","launch_url.sh")
1044 if self.prefix("res-sdl"):
1045 self.path("*")
1046 # recurse
1047 self.end_prefix("res-sdl")
1048
1049 self.path("featuretable_linux.txt")
1050 #self.path("secondlife-x86_64.supp")
1051
1052 self.path("app_settings/mozilla-runtime-linux-x86_64")
1053
1054 if self.prefix("../../libraries/x86_64-linux/lib_release_client", dst="lib64"):
1055 self.path("libapr-1.so.0")
1056 self.path("libaprutil-1.so.0")
1057 self.path("libdb-4.2.so")
1058 self.path("libcrypto.so.0.9.8")
1059 self.path("libexpat.so.1")
1060 self.path("libssl.so.0.9.8")
1061 self.path("libuuid.so", "libuuid.so.1")
1062 self.path("libSDL-1.2.so.0")
1063 self.path("libELFIO.so")
1064 self.path("libjpeg.so.7")
1065 self.path("libpng12.so.0")
1066 self.path("libopenjpeg.so.2")
1067 self.path("libxml2.so.2")
1068 #self.path("libz.so.1") #not needed
1069
1070 # OpenAL
1071 self.path("libopenal.so.1")
1072 self.path("libalut.so.0")
1073
1074 # GTK+ and dependencies
1075 self.path("libatk-1.0.so.0")
1076 self.path("libcairo.so.2")
1077 self.path("libfontconfig.so.1")
1078 self.path("libfreetype.so.6")
1079 self.path("libgdk_pixbuf-2.0.so.0") # was commented to use systems gdk pixbufs instead -
1080 # but seems webkit needs it o_O . Packaging for testing now.
1081 self.path("libgdk-x11-2.0.so.0")
1082 self.path("libgtk-x11-2.0.so.0")
1083# self.path("libpango-1.0.so.0") # use systems pango instead
1084# self.path("libpangoft2-1.0.so.0") # Both gdk pixbufs and pango would load systems modules
1085# self.path("libpangox-1.0.so.0") # and crash if not compatible or present.
1086# self.path("libpangoxft-1.0.so.0") # So we depend system gdk pixbufs and pango anyway.
1087 self.path("libpixman-1.so.0")
1088
1089 # Gstreamer libs
1090 self.path("libgstbase-0.10.so.0")
1091 self.path("libgstreamer-0.10.so.0")
1092 self.path("libgstaudio-0.10.so.0")
1093 self.path("libgstbase-0.10.so.0")
1094 self.path("libgstcontroller-0.10.so.0")
1095 self.path("libgstdataprotocol-0.10.so.0")
1096 self.path("libgstinterfaces-0.10.so.0")
1097 self.path("libgstnetbuffer-0.10.so.0")
1098 self.path("libgstpbutils-0.10.so.0")
1099 self.path("libgstriff-0.10.so.0")
1100 self.path("libgstrtp-0.10.so.0")
1101 self.path("libgstrtsp-0.10.so.0")
1102 self.path("libgstsdp-0.10.so.0")
1103 self.path("libgsttag-0.10.so.0")
1104 self.path("libgstvideo-0.10.so.0")
1105
1106 # Gstreamer plugin dependencies
1107 self.path("libfaad.so.0")
1108 self.path("libogg.so.0")
1109 self.path("libtheora.so.0")
1110 self.path("libvorbis.so.0")
1111 self.path("libvorbisenc.so.2")
1112 self.path("liboil-0.3.so.0")
1113
1114 # Gstreamer plugins
1115 if self.prefix("gstreamer-plugins"):
1116 self.path("libgstalsa.so")
1117 self.path("libgstasf.so")
1118 self.path("libgstaudioconvert.so")
1119 self.path("libgstaudioresample.so")
1120 self.path("libgstautodetect.so")
1121 self.path("libgstavi.so")
1122 self.path("libgstcoreelements.so")
1123 self.path("libgstcoreindexers.so")
1124 self.path("libgstdecodebin2.so")
1125 self.path("libgstdecodebin.so")
1126 self.path("libgstesd.so")
1127 self.path("libgstfaad.so")
1128 self.path("libgstffmpeg.so")
1129 self.path("libgstffmpegcolorspace.so")
1130 self.path("libgstgnomevfs.so")
1131 self.path("libgsticydemux.so")
1132 self.path("libgstid3demux.so")
1133 self.path("libgstmpegdemux.so")
1134 self.path("libgstmultifile.so")
1135 self.path("libgstmultipart.so")
1136 self.path("libgstogg.so")
1137 self.path("libgstossaudio.so")
1138 self.path("libgstplaybin.so")
1139 self.path("libgstpulse.so")
1140 self.path("libgstqtdemux.so")
1141 self.path("libgstqueue2.so")
1142 self.path("libgsttcp.so")
1143 self.path("libgsttheora.so")
1144 self.path("libgsttypefindfunctions.so")
1145 self.path("libgstudp.so")
1146 self.path("libgstvideoscale.so")
1147 self.path("libgstvolume.so")
1148 self.path("libgstvorbis.so")
1149 self.path("libgstwavparse.so")
1150
1151 self.end_prefix("gstreamer-plugins")
1152 self.end_prefix("lib64")
1153
1154
1155 # Vivox runtimes and libs
1156 if self.prefix(src="vivox-runtime/i686-linux", dst="bin"):
1157 self.path("SLVoice")
1158 self.end_prefix("bin")
1159
1160 if self.prefix(src="vivox-runtime/i686-linux", dst="lib32"):
1161 #self.path("libalut.so")
1162 self.path("libortp.so")
1163 self.path("libvivoxsdk.so")
1164 self.end_prefix("lib32")
1165
1166 # 32bit libs needed for voice
1167 if self.prefix("../../libraries/x86_64-linux/lib_release_client/32bit-compat", dst="lib32"):
1168 self.path("libalut.so")
1169 self.path("libidn.so.11")
1170 self.path("libopenal.so.1")
1171 # self.path("libortp.so")
1172 self.path("libuuid.so.1")
1173 self.end_prefix("lib32")
1174
1175if __name__ == "__main__":
1176 main()