aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/CMakeLists.txt113
-rw-r--r--linden/indra/newview/app_settings/settings.xml101
-rw-r--r--linden/indra/newview/chatbar_as_cmdline.cpp4
-rw-r--r--linden/indra/newview/floatervoicelicense.cpp27
-rw-r--r--linden/indra/newview/floatervoicelicense.h7
-rwxr-xr-xlinden/indra/newview/linux_tools/getvoice.sh5
-rwxr-xr-xlinden/indra/newview/linux_tools/wrapper.sh13
-rw-r--r--linden/indra/newview/llagent.cpp6
-rw-r--r--linden/indra/newview/llappviewer.cpp50
-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/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/llfloaterhtml.cpp1
-rw-r--r--linden/indra/newview/llfloaterhtmlhelp.cpp2
-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.cpp21
-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/llimview.cpp2
-rw-r--r--linden/indra/newview/llloginhandler.cpp2
-rw-r--r--linden/indra/newview/llloginhandler.h2
-rw-r--r--linden/indra/newview/llmediactrl.cpp1202
-rw-r--r--linden/indra/newview/llmediactrl.h (renamed from linden/indra/newview/llwebbrowserctrl.h)209
-rw-r--r--linden/indra/newview/llmediaremotectrl.cpp51
-rw-r--r--linden/indra/newview/llmimetypes.cpp42
-rw-r--r--linden/indra/newview/llmimetypes.h6
-rw-r--r--linden/indra/newview/llmutelist.cpp2
-rw-r--r--linden/indra/newview/lloverlaybar.cpp61
-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.cpp10
-rw-r--r--linden/indra/newview/llpanellandmedia.h2
-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.cpp71
-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.cpp13
-rw-r--r--linden/indra/newview/llstartup.cpp41
-rw-r--r--linden/indra/newview/llstatusbar.cpp2
-rw-r--r--linden/indra/newview/llsurface.cpp1
-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.cpp243
-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/llurlhistory.cpp2
-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.cpp1451
-rw-r--r--linden/indra/newview/llviewermedia.h200
-rw-r--r--linden/indra/newview/llviewermedia_streamingaudio.cpp189
-rw-r--r--linden/indra/newview/llviewermedia_streamingaudio.h73
-rw-r--r--linden/indra/newview/llviewermediafocus.cpp359
-rw-r--r--linden/indra/newview/llviewermediafocus.h91
-rw-r--r--linden/indra/newview/llviewermediaobserver.h71
-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.cpp353
-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.cpp145
-rw-r--r--linden/indra/newview/llviewerwindow.h1
-rw-r--r--linden/indra/newview/llvoavatar.cpp20
-rw-r--r--linden/indra/newview/llvovolume.cpp2
-rw-r--r--linden/indra/newview/llweb.cpp2
-rw-r--r--linden/indra/newview/llwebbrowserctrl.cpp1068
-rw-r--r--linden/indra/newview/mozilla-powerpc-darwin-readme.txt71
-rw-r--r--linden/indra/newview/pipeline.cpp4
-rw-r--r--linden/indra/newview/pipeline.h2
-rw-r--r--linden/indra/newview/secondlife-i686.supp44
-rw-r--r--linden/indra/newview/skins/default/textures/textures.xml21
-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
-rwxr-xr-xlinden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml478
-rwxr-xr-xlinden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml478
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml (renamed from linden/indra/newview/skins/default/xui/en-us/mime_types.xml)107
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/notifications.xml18
-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
-rw-r--r--linden/indra/newview/skins/default/xui/zh/mime_types.xml9
-rwxr-xr-xlinden/indra/newview/viewer_manifest.py385
139 files changed, 8010 insertions, 2980 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 1a6ad30..fb67423 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
@@ -186,9 +184,8 @@ set(viewer_SOURCE_FILES
186 llfloatergroups.cpp 184 llfloatergroups.cpp
187 llfloaterhandler.cpp 185 llfloaterhandler.cpp
188 llfloaterhardwaresettings.cpp 186 llfloaterhardwaresettings.cpp
189 llfloaterhtml.cpp
190 llfloaterhtmlcurrency.cpp 187 llfloaterhtmlcurrency.cpp
191 llfloaterhtmlhelp.cpp 188 llfloatermediabrowser.cpp
192 llfloaterhtmlsimple.cpp 189 llfloaterhtmlsimple.cpp
193 llfloaterhud.cpp 190 llfloaterhud.cpp
194 llfloaterimagepreview.cpp 191 llfloaterimagepreview.cpp
@@ -313,10 +310,12 @@ set(viewer_SOURCE_FILES
313 llpanelinput.cpp 310 llpanelinput.cpp
314 llpanelinventory.cpp 311 llpanelinventory.cpp
315 llpanelland.cpp 312 llpanelland.cpp
313 llpanellandaudio.cpp
316 llpanellandmedia.cpp 314 llpanellandmedia.cpp
317 llpanellandobjects.cpp 315 llpanellandobjects.cpp
318 llpanellandoptions.cpp 316 llpanellandoptions.cpp
319 llpanellogin.cpp 317 llpanellogin.cpp
318 llpanelmediahud.cpp
320 llpanelmsgs.cpp 319 llpanelmsgs.cpp
321 llpanelnetwork.cpp 320 llpanelnetwork.cpp
322 llpanelobject.cpp 321 llpanelobject.cpp
@@ -422,6 +421,8 @@ set(viewer_SOURCE_FILES
422 llviewerkeyboard.cpp 421 llviewerkeyboard.cpp
423 llviewerlayer.cpp 422 llviewerlayer.cpp
424 llviewermedia.cpp 423 llviewermedia.cpp
424 llviewermediafocus.cpp
425 llviewermedia_streamingaudio.cpp
425 llviewermenu.cpp 426 llviewermenu.cpp
426 llviewermenufile.cpp 427 llviewermenufile.cpp
427 llviewermessage.cpp 428 llviewermessage.cpp
@@ -468,7 +469,7 @@ set(viewer_SOURCE_FILES
468 llwearable.cpp 469 llwearable.cpp
469 llwearablelist.cpp 470 llwearablelist.cpp
470 llweb.cpp 471 llweb.cpp
471 llwebbrowserctrl.cpp 472 llmediactrl.cpp
472 llwindlightremotectrl.cpp 473 llwindlightremotectrl.cpp
473 llwind.cpp 474 llwind.cpp
474 llwlanimator.cpp 475 llwlanimator.cpp
@@ -633,9 +634,8 @@ set(viewer_HEADER_FILES
633 llfloatergroups.h 634 llfloatergroups.h
634 llfloaterhandler.h 635 llfloaterhandler.h
635 llfloaterhardwaresettings.h 636 llfloaterhardwaresettings.h
636 llfloaterhtml.h
637 llfloaterhtmlcurrency.h 637 llfloaterhtmlcurrency.h
638 llfloaterhtmlhelp.h 638 llfloatermediabrowser.h
639 llfloaterhtmlsimple.h 639 llfloaterhtmlsimple.h
640 llfloaterhud.h 640 llfloaterhud.h
641 llfloaterimagepreview.h 641 llfloaterimagepreview.h
@@ -759,11 +759,13 @@ set(viewer_HEADER_FILES
759 llpanelinput.h 759 llpanelinput.h
760 llpanelinventory.h 760 llpanelinventory.h
761 llpanelland.h 761 llpanelland.h
762 llpanellandaudio.h
762 llpanellandmedia.h 763 llpanellandmedia.h
763 llpanellandobjects.h 764 llpanellandobjects.h
764 llpanellandoptions.h 765 llpanellandoptions.h
765 llpanelLCD.h 766 llpanelLCD.h
766 llpanellogin.h 767 llpanellogin.h
768 llpanelmediahud.h
767 llpanelmsgs.h 769 llpanelmsgs.h
768 llpanelnetwork.h 770 llpanelnetwork.h
769 llpanelobject.h 771 llpanelobject.h
@@ -870,6 +872,8 @@ set(viewer_HEADER_FILES
870 llviewerkeyboard.h 872 llviewerkeyboard.h
871 llviewerlayer.h 873 llviewerlayer.h
872 llviewermedia.h 874 llviewermedia.h
875 llviewermediaobserver.h
876 llviewermediafocus.h
873 llviewermenu.h 877 llviewermenu.h
874 llviewermenufile.h 878 llviewermenufile.h
875 llviewermessage.h 879 llviewermessage.h
@@ -918,7 +922,7 @@ set(viewer_HEADER_FILES
918 llwearable.h 922 llwearable.h
919 llwearablelist.h 923 llwearablelist.h
920 llweb.h 924 llweb.h
921 llwebbrowserctrl.h 925 llmediactrl.h
922 llwind.h 926 llwind.h
923 llwindebug.h 927 llwindebug.h
924 llwindlightremotectrl.h 928 llwindlightremotectrl.h
@@ -1122,6 +1126,7 @@ if (WINDOWS)
1122 if (INTEL_MEMOPS_LIBRARY) 1126 if (INTEL_MEMOPS_LIBRARY)
1123 list(APPEND viewer_LIBRARIES ${INTEL_MEMOPS_LIBRARY}) 1127 list(APPEND viewer_LIBRARIES ${INTEL_MEMOPS_LIBRARY})
1124 endif (INTEL_MEMOPS_LIBRARY) 1128 endif (INTEL_MEMOPS_LIBRARY)
1129 use_prebuilt_binary(dbghelp)
1125endif (WINDOWS) 1130endif (WINDOWS)
1126 1131
1127# Add the xui files. This is handy for searching for xui elements 1132# Add the xui files. This is handy for searching for xui elements
@@ -1344,6 +1349,9 @@ if (WINDOWS)
1344 --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat 1349 --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat
1345 DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py 1350 DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
1346 ) 1351 )
1352
1353 add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_gstreamer010)
1354
1347 if (PACKAGE) 1355 if (PACKAGE)
1348 add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat) 1356 add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat)
1349 add_dependencies(package windows-updater windows-crash-logger) 1357 add_dependencies(package windows-updater windows-crash-logger)
@@ -1356,8 +1364,8 @@ target_link_libraries(${VIEWER_BINARY_NAME}
1356 ${LLIMAGE_LIBRARIES} 1364 ${LLIMAGE_LIBRARIES}
1357 ${LLIMAGEJ2COJ_LIBRARIES} 1365 ${LLIMAGEJ2COJ_LIBRARIES}
1358 ${LLINVENTORY_LIBRARIES} 1366 ${LLINVENTORY_LIBRARIES}
1359 ${LLMEDIA_LIBRARIES}
1360 ${LLMESSAGE_LIBRARIES} 1367 ${LLMESSAGE_LIBRARIES}
1368 ${LLPLUGIN_LIBRARIES}
1361 ${LLPRIMITIVE_LIBRARIES} 1369 ${LLPRIMITIVE_LIBRARIES}
1362 ${LLRENDER_LIBRARIES} 1370 ${LLRENDER_LIBRARIES}
1363 ${FREETYPE_LIBRARIES} 1371 ${FREETYPE_LIBRARIES}
@@ -1379,7 +1387,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
1379 ${OPENGL_LIBRARIES} 1387 ${OPENGL_LIBRARIES}
1380 ${FMODWRAPPER_LIBRARY} 1388 ${FMODWRAPPER_LIBRARY}
1381 ${OPENGL_LIBRARIES} 1389 ${OPENGL_LIBRARIES}
1382 ${MOZLIB_LIBRARIES}
1383 ${JSONCPP_LIBRARIES} 1390 ${JSONCPP_LIBRARIES}
1384 ${SDL_LIBRARY} 1391 ${SDL_LIBRARY}
1385 ${SMARTHEAP_LIBRARY} 1392 ${SMARTHEAP_LIBRARY}
@@ -1424,6 +1431,8 @@ if (LINUX)
1424 --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched 1431 --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
1425 DEPENDS imprudence-stripped ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py 1432 DEPENDS imprudence-stripped ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
1426 ) 1433 )
1434
1435 add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_gstreamer010 media_plugin_webkit)
1427 1436
1428 if (NOT INSTALL) 1437 if (NOT INSTALL)
1429 add_custom_target(package ALL DEPENDS ${product}.tar.bz2) 1438 add_custom_target(package ALL DEPENDS ${product}.tar.bz2)
@@ -1461,6 +1470,8 @@ if (DARWIN)
1461 --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app 1470 --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
1462 DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py 1471 DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
1463 ) 1472 )
1473
1474 add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_gstreamer010)
1464 1475
1465 if (PACKAGE) 1476 if (PACKAGE)
1466 add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME}) 1477 add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME})
@@ -1481,11 +1492,12 @@ if (DARWIN)
1481 --build=${CMAKE_CURRENT_BINARY_DIR} 1492 --build=${CMAKE_CURRENT_BINARY_DIR}
1482 --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app 1493 --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
1483 --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched 1494 --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
1495
1484 DEPENDS 1496 DEPENDS
1485 ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py 1497 ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
1486 ) 1498 )
1487 1499
1488 1500 add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_gstreamer010)
1489 add_custom_command( 1501 add_custom_command(
1490 TARGET package POST_BUILD 1502 TARGET package POST_BUILD
1491 COMMAND ${PYTHON_EXECUTABLE} 1503 COMMAND ${PYTHON_EXECUTABLE}
@@ -1512,3 +1524,78 @@ if (INSTALL)
1512endif (INSTALL) 1524endif (INSTALL)
1513 1525
1514ADD_VIEWER_BUILD_TEST(llagentaccess viewer) 1526ADD_VIEWER_BUILD_TEST(llagentaccess viewer)
1527
1528# Don't do these for DARWIN or LINUX here -- they're taken care of by viewer_manifest.py
1529if (WINDOWS)
1530
1531 get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION)
1532 add_custom_command(
1533 TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1534 COMMAND ${CMAKE_COMMAND}
1535 ARGS
1536 -E
1537 copy_if_different
1538 ${BUILT_SLPLUGIN}
1539 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
1540 COMMENT "Copying SLPlugin executable to the runtime folder."
1541 )
1542
1543 get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
1544 add_custom_command(
1545 TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1546 COMMAND ${CMAKE_COMMAND}
1547 ARGS
1548 -E
1549 copy_if_different
1550 ${BUILT_WEBKIT_PLUGIN}
1551 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin
1552 COMMENT "Copying WebKit Plugin to the runtime folder."
1553 )
1554
1555 #get_target_property(BUILT_GSTREAMER_PLUGIN media_plugin_gstreamer010 LOCATION)
1556 # add_custom_command(
1557 # TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1558 # COMMAND ${CMAKE_COMMAND}
1559 # ARGS
1560 # -E
1561 # copy_if_different
1562 # ${BUILT_GSTREAMER_PLUGIN}
1563 # ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin
1564 # COMMENT "Copying Gstreamer Plugin to the runtime folder."
1565 # )
1566
1567 get_target_property(BUILT_QUICKTIME_PLUGIN media_plugin_quicktime LOCATION)
1568 add_custom_command(
1569 TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1570 COMMAND ${CMAKE_COMMAND}
1571 ARGS
1572 -E
1573 copy_if_different
1574 ${BUILT_QUICKTIME_PLUGIN}
1575 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin
1576 COMMENT "Copying Quicktime Plugin to the runtime folder."
1577 )
1578
1579 # Copying the mime_types.xml file to app_settings
1580 set(mime_types_source "${CMAKE_SOURCE_DIR}/newview/skins/default/xui/en-us")
1581 set(mime_types_dest "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/app_settings")
1582 add_custom_command(
1583 TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1584 COMMAND ${CMAKE_COMMAND}
1585 ARGS
1586 -E
1587 copy_if_different
1588 ${mime_types_source}/mime_types_windows.xml
1589 ${mime_types_dest}/mime_types_windows.xml
1590 COMMENT "Copying mime_types_windows.xml to the runtime app_settings folder."
1591 )
1592
1593endif (WINDOWS)
1594
1595if (DARWIN)
1596# Don't do this here -- it's taken care of by viewer_manifest.py
1597# add_custom_command(TARGET ${VIEWER_BINARY_NAME} POST_BUILD
1598# COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release/libllqtwebkit.dylib ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin/
1599# DEPENDS ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release/libllqtwebkit.dylib
1600# )
1601endif (DARWIN)
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 7b37bb6..11555fa 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -2683,6 +2683,39 @@
2683 <key>Value</key> 2683 <key>Value</key>
2684 <integer>0</integer> 2684 <integer>0</integer>
2685 </map> 2685 </map>
2686 <key>BrowserCookiesEnabled</key>
2687 <map>
2688 <key>Comment</key>
2689 <string>Accept cookies from Web sites?</string>
2690 <key>Persist</key>
2691 <integer>1</integer>
2692 <key>Type</key>
2693 <string>Boolean</string>
2694 <key>Value</key>
2695 <integer>1</integer>
2696 </map>
2697 <key>BrowserJavascriptEnabled</key>
2698 <map>
2699 <key>Comment</key>
2700 <string>Enable Javascript in the built-in Web browser?</string>
2701 <key>Persist</key>
2702 <integer>1</integer>
2703 <key>Type</key>
2704 <string>Boolean</string>
2705 <key>Value</key>
2706 <integer>1</integer>
2707 </map>
2708 <key>BrowserPluginsEnabled</key>
2709 <map>
2710 <key>Comment</key>
2711 <string>Enable Web plugins in the built-in Web browser?</string>
2712 <key>Persist</key>
2713 <integer>1</integer>
2714 <key>Type</key>
2715 <string>Boolean</string>
2716 <key>Value</key>
2717 <integer>1</integer>
2718 </map>
2686 <key>BrowserProxyAddress</key> 2719 <key>BrowserProxyAddress</key>
2687 <map> 2720 <map>
2688 <key>Comment</key> 2721 <key>Comment</key>
@@ -4121,17 +4154,6 @@
4121 <key>Value</key> 4154 <key>Value</key>
4122 <integer>0</integer> 4155 <integer>0</integer>
4123 </map> 4156 </map>
4124 <key>CookiesEnabled</key>
4125 <map>
4126 <key>Comment</key>
4127 <string>Accept cookies from Web sites?</string>
4128 <key>Persist</key>
4129 <integer>1</integer>
4130 <key>Type</key>
4131 <string>Boolean</string>
4132 <key>Value</key>
4133 <integer>1</integer>
4134 </map>
4135 <key>CreateToolCopyCenters</key> 4157 <key>CreateToolCopyCenters</key>
4136 <map> 4158 <map>
4137 <key>Comment</key> 4159 <key>Comment</key>
@@ -4231,6 +4253,17 @@
4231 <key>Value</key> 4253 <key>Value</key>
4232 <integer>0</integer> 4254 <integer>0</integer>
4233 </map> 4255 </map>
4256 <key>DebugPluginDisableTimeout</key>
4257 <map>
4258 <key>Comment</key>
4259 <string>Disable the code which watches for plugins that are crashed or hung</string>
4260 <key>Persist</key>
4261 <integer>1</integer>
4262 <key>Type</key>
4263 <string>Boolean</string>
4264 <key>Value</key>
4265 <integer>0</integer>
4266 </map>
4234 <key>DebugShowColor</key> 4267 <key>DebugShowColor</key>
4235 <map> 4268 <map>
4236 <key>Comment</key> 4269 <key>Comment</key>
@@ -7720,7 +7753,40 @@
7720 <key>Value</key> 7753 <key>Value</key>
7721 <integer>0</integer> 7754 <integer>0</integer>
7722 </map> 7755 </map>
7723 <key>MemoryLogFrequency</key> 7756 <key>MediaControlFadeTime</key>
7757 <map>
7758 <key>Comment</key>
7759 <string>Amount of time (in seconds) that the media control fades</string>
7760 <key>Persist</key>
7761 <integer>1</integer>
7762 <key>Type</key>
7763 <string>F32</string>
7764 <key>Value</key>
7765 <real>1.5</real>
7766 </map>
7767 <key>MediaControlTimeout</key>
7768 <map>
7769 <key>Comment</key>
7770 <string>Amount of time (in seconds) for media controls to fade with no mouse activity</string>
7771 <key>Persist</key>
7772 <integer>1</integer>
7773 <key>Type</key>
7774 <string>F32</string>
7775 <key>Value</key>
7776 <real>3.0</real>
7777 </map>
7778 <key>MediaOnAPrimUI</key>
7779 <map>
7780 <key>Comment</key>
7781 <string>Whether or not to show the "link sharing" UI</string>
7782 <key>Persist</key>
7783 <integer>1</integer>
7784 <key>Type</key>
7785 <string>Boolean</string>
7786 <key>Value</key>
7787 <integer>0</integer>
7788 </map>
7789 <key>MemoryLogFrequency</key>
7724 <map> 7790 <map>
7725 <key>Comment</key> 7791 <key>Comment</key>
7726 <string>Seconds between display of Memory in log (0 for never)</string> 7792 <string>Seconds between display of Memory in log (0 for never)</string>
@@ -8487,6 +8553,17 @@
8487 <key>Value</key> 8553 <key>Value</key>
8488 <integer>1</integer> 8554 <integer>1</integer>
8489 </map> 8555 </map>
8556 <key>PluginAttachDebuggerToPlugins</key>
8557 <map>
8558 <key>Comment</key>
8559 <string>If true, attach a debugger session to each plugin process as it's launched.</string>
8560 <key>Persist</key>
8561 <integer>1</integer>
8562 <key>Type</key>
8563 <string>Boolean</string>
8564 <key>Value</key>
8565 <integer>0</integer>
8566 </map>
8490 <key>PrecachingDelay</key> 8567 <key>PrecachingDelay</key>
8491 <map> 8568 <map>
8492 <key>Comment</key> 8569 <key>Comment</key>
diff --git a/linden/indra/newview/chatbar_as_cmdline.cpp b/linden/indra/newview/chatbar_as_cmdline.cpp
index 9359444..96787ad 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 840a9e6..e8cd4f3 100644
--- a/linden/indra/newview/floatervoicelicense.cpp
+++ b/linden/indra/newview/floatervoicelicense.cpp
@@ -122,7 +122,7 @@ BOOL FloaterVoiceLicense::postBuild()
122 LLTextEditor *editor = getChild<LLTextEditor>("license_text"); 122 LLTextEditor *editor = getChild<LLTextEditor>("license_text");
123 editor->setVisible( FALSE ); 123 editor->setVisible( FALSE );
124 124
125 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("license_html"); 125 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("license_html");
126 if ( web_browser ) 126 if ( web_browser )
127 { 127 {
128 // start to observe it so we see navigate complete events 128 // start to observe it so we see navigate complete events
@@ -137,7 +137,7 @@ BOOL FloaterVoiceLicense::postBuild()
137 137
138void FloaterVoiceLicense::setSiteIsAlive( bool alive ) 138void FloaterVoiceLicense::setSiteIsAlive( bool alive )
139{ 139{
140 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("license_html"); 140 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("license_html");
141 // if the contents of the site was retrieved 141 // if the contents of the site was retrieved
142 if ( alive ) 142 if ( alive )
143 { 143 {
@@ -158,12 +158,6 @@ void FloaterVoiceLicense::setSiteIsAlive( bool alive )
158 158
159FloaterVoiceLicense::~FloaterVoiceLicense() 159FloaterVoiceLicense::~FloaterVoiceLicense()
160{ 160{
161 // stop observing events
162 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("license_html");
163 if ( web_browser )
164 {
165 web_browser->remObserver( this );
166 }
167 161
168 // tell the responder we're not here anymore 162 // tell the responder we're not here anymore
169 if ( gResponsePtr ) 163 if ( gResponsePtr )
@@ -224,14 +218,17 @@ void FloaterVoiceLicense::onCancel( void* userdata )
224} 218}
225 219
226//virtual 220//virtual
227void FloaterVoiceLicense::onNavigateComplete( const EventType& eventIn ) 221void FloaterVoiceLicense::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
228{ 222{
229 // skip past the loading screen navigate complete 223 if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
230 if ( ++mLoadCompleteCount == 2 )
231 { 224 {
232 llinfos << "NAVIGATE COMPLETE" << llendl; 225 // skip past the loading screen navigate complete
233 // enable Agree to License radio button now that page has loaded 226 if ( ++mLoadCompleteCount == 2 )
234 LLCheckBoxCtrl * license_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); 227 {
235 license_agreement->setEnabled( true ); 228 llinfos << "NAVIGATE COMPLETE" << llendl;
229 // enable Agree to License radio button now that page has loaded
230 LLCheckBoxCtrl * license_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
231 license_agreement->setEnabled( true );
232 }
236 } 233 }
237} 234}
diff --git a/linden/indra/newview/floatervoicelicense.h b/linden/indra/newview/floatervoicelicense.h
index 4130d22..30dbb2f 100644
--- a/linden/indra/newview/floatervoicelicense.h
+++ b/linden/indra/newview/floatervoicelicense.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 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:
@@ -62,7 +62,8 @@ public:
62 62
63 void setSiteIsAlive( bool alive ); 63 void setSiteIsAlive( bool alive );
64 64
65 virtual void onNavigateComplete( const EventType& eventIn ); 65 // inherited from LLViewerMediaObserver
66 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
66 67
67private: 68private:
68 int mWebBrowserWindowId; 69 int mWebBrowserWindowId;
diff --git a/linden/indra/newview/linux_tools/getvoice.sh b/linden/indra/newview/linux_tools/getvoice.sh
index 13b632f..afebda9 100755
--- a/linden/indra/newview/linux_tools/getvoice.sh
+++ b/linden/indra/newview/linux_tools/getvoice.sh
@@ -3,8 +3,9 @@
3SCRIPTSRC=`readlink -f "$0" || echo "$0"` 3SCRIPTSRC=`readlink -f "$0" || echo "$0"`
4RUN_PATH=`dirname "${SCRIPTSRC}" || echo .` 4RUN_PATH=`dirname "${SCRIPTSRC}" || echo .`
5 5
6#if mozilla-runtime-linux-x86_64 is present we are using 64bit Imprudence on 64bit Linux 6BINARY_SYSTEM=$(expr match "$(file -b /bin/uname)" '\(.*executable\)')
7if [ -d "${RUN_PATH}/app_settings/mozilla-runtime-linux-x86_64/" ]; then 7BINARY_VIEWER=$(expr match "$(file -b ${RUN_PATH}/bin/do-not-directly-run-imprudence-bin)" '\(.*executable\)')
8if ( [ "$BINARY_SYSTEM" == "ELF 64-bit LSB executable" ] && [ "$BINARY_VIEWER" == "ELF 64-bit LSB executable" ] ); then
8 LIB_INSTALLDIR="lib32/" # It's 32bit voice on 64bit Linux and 64bit viewer. Not using lib/ for avoiding ambiguity. 9 LIB_INSTALLDIR="lib32/" # It's 32bit voice on 64bit Linux and 64bit viewer. Not using lib/ for avoiding ambiguity.
9else 10else
10 LIB_INSTALLDIR="lib/" # It's 32bit voice on 32 or 64bit Linux and 32bit viewer. 11 LIB_INSTALLDIR="lib/" # It's 32bit voice on 32 or 64bit Linux and 32bit viewer.
diff --git a/linden/indra/newview/linux_tools/wrapper.sh b/linden/indra/newview/linux_tools/wrapper.sh
index bc2c127..a43ebd5 100755
--- a/linden/indra/newview/linux_tools/wrapper.sh
+++ b/linden/indra/newview/linux_tools/wrapper.sh
@@ -107,16 +107,15 @@ if [ -n "$LL_TCMALLOC" ]; then
107 fi 107 fi
108fi 108fi
109 109
110if([ "`uname -m`" = "x86_64" ] && [ -d "${RUN_PATH}/app_settings/mozilla-runtime-linux-x86_64/" ]); then 110export VIEWER_BINARY='do-not-directly-run-imprudence-bin'
111 export GST_PLUGIN_PATH="${GST_PLUGIN_PATH}:${RUN_PATH}/lib64/gstreamer-plugins/" 111BINARY_TYPE=$(expr match "$(file -b bin/$VIEWER_BINARY)" '\(.*executable\)')
112 112if [ "${BINARY_TYPE}" == "ELF 64-bit LSB executable" ]; then
113 export SL_ENV='LD_LIBRARY_PATH="`pwd`"/lib64:"`pwd`"/lib32:"`pwd`"/app_settings/mozilla-runtime-linux-x86_64:"${LD_LIBRARY_PATH}"' 113 export SL_ENV='LD_LIBRARY_PATH="`pwd`"/lib64:"`pwd`"/lib32:"${LD_LIBRARY_PATH}"'
114else 114else
115 export GST_PLUGIN_PATH="${GST_PLUGIN_PATH}:${RUN_PATH}/lib/gstreamer-plugins/" 115 export SL_ENV='LD_LIBRARY_PATH="`pwd`"/lib:"${LD_LIBRARY_PATH}"'
116 export SL_ENV='LD_LIBRARY_PATH="`pwd`"/lib:"`pwd`"/app_settings/mozilla-runtime-linux-i686:"${LD_LIBRARY_PATH}"'
117fi 116fi
118 117
119export SL_CMD='$LL_WRAPPER bin/do-not-directly-run-imprudence-bin' 118export SL_CMD='$LL_WRAPPER bin/$VIEWER_BINARY'
120export SL_OPT="`cat gridargs.dat` $@" 119export SL_OPT="`cat gridargs.dat` $@"
121 120
122# Run the program 121# Run the program
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index eb5cf9b..fba530f 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"
@@ -6079,7 +6081,11 @@ bool LLAgent::teleportCore(bool is_local)
6079 LLFloaterWorldMap::hide(NULL); 6081 LLFloaterWorldMap::hide(NULL);
6080 LLFloaterDirectory::hide(NULL); 6082 LLFloaterDirectory::hide(NULL);
6081 6083
6084 // hide land floater too - it'll be out of date
6085 LLFloaterLand::hideInstance();
6086
6082 LLViewerParcelMgr::getInstance()->deselectLand(); 6087 LLViewerParcelMgr::getInstance()->deselectLand();
6088 LLViewerMediaFocus::getInstance()->setFocusFace(false, NULL, 0, NULL);
6083 6089
6084 // Close all pie menus, deselect land, etc. 6090 // Close all pie menus, deselect land, etc.
6085 // Don't change the camera until we know teleport succeeded. JC 6091 // 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 4485cdf..97deca0 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -62,7 +62,8 @@
62#include "llviewerdisplay.h" 62#include "llviewerdisplay.h"
63#include "llviewermedia.h" 63#include "llviewermedia.h"
64#include "llv4math.h" // for LL_VECTORIZE 64#include "llv4math.h" // for LL_VECTORIZE
65 65#include "llviewerparcelmedia.h"
66#include "llviewermediafocus.h"
66#include "llviewermessage.h" 67#include "llviewermessage.h"
67#include "llviewerobjectlist.h" 68#include "llviewerobjectlist.h"
68#include "llworldmap.h" 69#include "llworldmap.h"
@@ -103,7 +104,8 @@
103#include "llassetstorage.h" 104#include "llassetstorage.h"
104#include "llpolymesh.h" 105#include "llpolymesh.h"
105#include "llcachename.h" 106#include "llcachename.h"
106#include "audioengine.h" 107#include "llaudioengine.h"
108#include "llstreamingaudio.h"
107#include "llviewermenu.h" 109#include "llviewermenu.h"
108#include "llselectmgr.h" 110#include "llselectmgr.h"
109#include "lltrans.h" 111#include "lltrans.h"
@@ -716,8 +718,15 @@ bool LLAppViewer::init()
716 LLViewerJointMesh::updateVectorize(); 718 LLViewerJointMesh::updateVectorize();
717 719
718 // load MIME type -> media impl mappings 720 // load MIME type -> media impl mappings
719 LLMIMETypes::parseMIMETypes( std::string("mime_types.xml") ); 721 std::string mime_types_name;
720 722#if LL_DARWIN
723 mime_types_name = "mime_types_mac.xml";
724#elif LL_LINUX
725 mime_types_name = "mime_types_linux.xml";
726#else
727 mime_types_name = "mime_types_windows.xml";
728#endif
729 LLMIMETypes::parseMIMETypes( mime_types_name );
721 730
722 // Copy settings to globals. *TODO: Remove or move to appropriage class initializers 731 // Copy settings to globals. *TODO: Remove or move to appropriage class initializers
723 settings_to_globals(); 732 settings_to_globals();
@@ -1199,7 +1208,10 @@ bool LLAppViewer::cleanup()
1199 1208
1200 //reset balance for not playing the UI-Sound 1209 //reset balance for not playing the UI-Sound
1201 //when relogging into another account 1210 //when relogging into another account
1202 gStatusBar->clearBalance(); 1211 if (gStatusBar)
1212 {
1213 gStatusBar->clearBalance();
1214 }
1203 1215
1204 if (mQuitRequested) 1216 if (mQuitRequested)
1205 { 1217 {
@@ -1273,6 +1285,14 @@ bool LLAppViewer::cleanup()
1273 1285
1274 if (gAudiop) 1286 if (gAudiop)
1275 { 1287 {
1288 // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
1289
1290 LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl();
1291 delete sai;
1292 gAudiop->setStreamingAudioImpl(NULL);
1293
1294 // shut down the audio subsystem
1295
1276 bool want_longname = false; 1296 bool want_longname = false;
1277 if (gAudiop->getDriverName(want_longname) == "FMOD") 1297 if (gAudiop->getDriverName(want_longname) == "FMOD")
1278 { 1298 {
@@ -1502,7 +1522,9 @@ bool LLAppViewer::cleanup()
1502 //Note: 1522 //Note:
1503 //LLViewerMedia::cleanupClass() has to be put before gImageList.shutdown() 1523 //LLViewerMedia::cleanupClass() has to be put before gImageList.shutdown()
1504 //because some new image might be generated during cleaning up media. --bao 1524 //because some new image might be generated during cleaning up media. --bao
1525 LLViewerMediaFocus::cleanupClass();
1505 LLViewerMedia::cleanupClass(); 1526 LLViewerMedia::cleanupClass();
1527 LLViewerParcelMedia::cleanupClass();
1506 gImageList.shutdown(); // shutdown again in case a callback added something 1528 gImageList.shutdown(); // shutdown again in case a callback added something
1507 LLUIImageList::getInstance()->cleanUp(); 1529 LLUIImageList::getInstance()->cleanUp();
1508 1530
@@ -3265,12 +3287,15 @@ void LLAppViewer::saveFinalSnapshot()
3265 gSavedSettings.setBOOL("ShowParcelOwners", FALSE); 3287 gSavedSettings.setBOOL("ShowParcelOwners", FALSE);
3266 idle(); 3288 idle();
3267 3289
3268 std::string snap_filename = gDirUtilp->getLindenUserDir(); 3290 std::string snap_filename = gDirUtilp->getLindenUserDir(true);
3269 snap_filename += gDirUtilp->getDirDelimiter(); 3291 if (!snap_filename.empty())
3270 snap_filename += SCREEN_LAST_FILENAME; 3292 {
3271 // use full pixel dimensions of viewer window (not post-scale dimensions) 3293 snap_filename += gDirUtilp->getDirDelimiter();
3272 gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, TRUE); 3294 snap_filename += SCREEN_LAST_FILENAME;
3273 mSavedFinalSnapshot = TRUE; 3295 // use full pixel dimensions of viewer window (not post-scale dimensions)
3296 gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, TRUE);
3297 mSavedFinalSnapshot = TRUE;
3298 }
3274 } 3299 }
3275} 3300}
3276 3301
@@ -3689,6 +3714,9 @@ void LLAppViewer::idle()
3689 gAgent.updateCamera(); 3714 gAgent.updateCamera();
3690 } 3715 }
3691 3716
3717 // update media focus
3718 LLViewerMediaFocus::getInstance()->update();
3719
3692 // objects and camera should be in sync, do LOD calculations now 3720 // objects and camera should be in sync, do LOD calculations now
3693 { 3721 {
3694 LLFastTimer t(LLFastTimer::FTM_LOD_UPDATE); 3722 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 1f5b7dc..91de066 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 *
@@ -474,7 +474,7 @@ OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn)
474 url.replace(0, prefix.length(), "secondlife:///app/"); 474 url.replace(0, prefix.length(), "secondlife:///app/");
475 } 475 }
476 476
477 LLWebBrowserCtrl* web = NULL; 477 LLMediaCtrl* web = NULL;
478 const bool trusted_browser = false; 478 const bool trusted_browser = false;
479 LLURLDispatcher::dispatch(url, web, trusted_browser); 479 LLURLDispatcher::dispatch(url, web, trusted_browser);
480 } 480 }
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 0633c8d..2f2ad16 100644
--- a/linden/indra/newview/llchatbar.cpp
+++ b/linden/indra/newview/llchatbar.cpp
@@ -946,7 +946,7 @@ public:
946 946
947 // Your code here 947 // Your code here
948 bool handle(const LLSD& tokens, const LLSD& query_map, 948 bool handle(const LLSD& tokens, const LLSD& query_map,
949 LLWebBrowserCtrl* web) 949 LLMediaCtrl* web)
950 { 950 {
951 if (tokens.size() < 2) return false; 951 if (tokens.size() < 2) return false;
952 S32 channel = tokens[0].asInteger(); 952 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/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp
index 9c1d67b..4be83b6 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
@@ -246,26 +245,10 @@ LLFloaterAbout::LLFloaterAbout()
246 245
247 support.append("\n"); 246 support.append("\n");
248 247
249 LLMediaManager *mgr = LLMediaManager::getInstance(); 248 // TODO: Implement media plugin version query
250 if (mgr) 249
251 { 250 support.append("Qt Webkit Version: 4.6 (version number hard-coded)");
252 LLMediaBase *gstreamer = mgr->createSourceFromMimeType("http", "audio/mpeg"); 251 support.append("\n");
253 if (gstreamer)
254 {
255 support.append("GStreamer Version: ");
256 support.append( gstreamer->getVersion() );
257 support.append("\n");
258 }
259
260 LLMediaBase *media_source = mgr->createSourceFromMimeType("http", "text/html");
261 if (media_source)
262 {
263 support.append("LLMozLib Version: ");
264 support.append(media_source->getVersion());
265 support.append("\n");
266 mgr->destroySource(media_source);
267 }
268 }
269 252
270 if (gPacketsIn > 0) 253 if (gPacketsIn > 0)
271 { 254 {
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 3f0b184..a453c39 100644
--- a/linden/indra/newview/llfloaterchat.cpp
+++ b/linden/indra/newview/llfloaterchat.cpp
@@ -194,6 +194,15 @@ void LLFloaterChat::setMinimized(BOOL minimized)
194 updateConsoleVisibility(); 194 updateConsoleVisibility();
195} 195}
196 196
197// linden library includes
198#include "llaudioengine.h"
199#include "llchat.h"
200#include "llfontgl.h"
201#include "llrect.h"
202#include "llerror.h"
203#include "llstring.h"
204#include "llwindow.h"
205#include "message.h"
197 206
198void LLFloaterChat::updateConsoleVisibility() 207void LLFloaterChat::updateConsoleVisibility()
199{ 208{
@@ -587,13 +596,54 @@ void LLFloaterChat::addChat(const LLChat& chat,
587 if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) 596 if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory"))
588 addChatHistory(chat,false); 597 addChatHistory(chat,false);
589 598
590 LLTextParser* highlight = LLTextParser::getInstance(); 599 triggerAlerts(chat.mText);
591 highlight->triggerAlerts(gAgent.getID(), gAgent.getPositionGlobal(), chat.mText, gViewerWindow->getWindow());
592 600
593 if(!from_instant_message) 601 if(!from_instant_message)
594 addChatHistory(chat); 602 addChatHistory(chat);
595} 603}
596 604
605// Moved from lltextparser.cpp to break llui/llaudio library dependency.
606//static
607void LLFloaterChat::triggerAlerts(const std::string& text)
608{
609 LLTextParser* parser = LLTextParser::getInstance();
610// bool spoken=FALSE;
611 for (S32 i=0;i<parser->mHighlights.size();i++)
612 {
613 LLSD& highlight = parser->mHighlights[i];
614 if (parser->findPattern(text,highlight) >= 0 )
615 {
616 if(gAudiop)
617 {
618 if ((std::string)highlight["sound_lluuid"] != LLUUID::null.asString())
619 {
620 gAudiop->triggerSound(highlight["sound_lluuid"].asUUID(),
621 gAgent.getID(),
622 1.f,
623 LLAudioEngine::AUDIO_TYPE_UI,
624 gAgent.getPositionGlobal() );
625 }
626/*
627 if (!spoken)
628 {
629 LLTextToSpeech* text_to_speech = NULL;
630 text_to_speech = LLTextToSpeech::getInstance();
631 spoken = text_to_speech->speak((LLString)highlight["voice"],text);
632 }
633 */
634 }
635 if (highlight["flash"])
636 {
637 LLWindow* viewer_window = gViewerWindow->getWindow();
638 if (viewer_window && viewer_window->getMinimized())
639 {
640 viewer_window->flashIcon(5.f);
641 }
642 }
643 }
644 }
645}
646
597LLColor4 get_text_color(const LLChat& chat) 647LLColor4 get_text_color(const LLChat& chat)
598{ 648{
599 LLColor4 text_color; 649 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/llfloaterhtml.cpp b/linden/indra/newview/llfloaterhtml.cpp
index a5d24f4..5822ed5 100644
--- a/linden/indra/newview/llfloaterhtml.cpp
+++ b/linden/indra/newview/llfloaterhtml.cpp
@@ -41,7 +41,6 @@
41#include "llviewerwindow.h" 41#include "llviewerwindow.h"
42#include "llweb.h" 42#include "llweb.h"
43 43
44#include "llwebbrowserctrl.h"
45 44
46LLFloaterHtml* LLFloaterHtml::sInstance = 0; 45LLFloaterHtml* LLFloaterHtml::sInstance = 0;
47 46
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp
index 1777403..1ec964b 100644
--- a/linden/indra/newview/llfloaterhtmlhelp.cpp
+++ b/linden/indra/newview/llfloaterhtmlhelp.cpp
@@ -534,7 +534,7 @@ void LLFloaterHtmlHelp::onStatusTextChange( const EventType& eventIn )
534// 534//
535void LLFloaterHtmlHelp::onLocationChange( const EventType& eventIn ) 535void LLFloaterHtmlHelp::onLocationChange( const EventType& eventIn )
536{ 536{
537 llinfos << "MOZ> Location changed to " << eventIn.getStringValue() << llendl; 537 llinfos << "WEB> Location changed to " << eventIn.getStringValue() << llendl;
538 mCurrentUrl = std::string( eventIn.getStringValue() ); 538 mCurrentUrl = std::string( eventIn.getStringValue() );
539} 539}
540 540
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 7dd4f8d..42bc41c 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"
@@ -208,6 +209,7 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed)
208 factory_map["land_covenant_panel"] = LLCallbackMap(createPanelLandCovenant, this); 209 factory_map["land_covenant_panel"] = LLCallbackMap(createPanelLandCovenant, this);
209 factory_map["land_objects_panel"] = LLCallbackMap(createPanelLandObjects, this); 210 factory_map["land_objects_panel"] = LLCallbackMap(createPanelLandObjects, this);
210 factory_map["land_options_panel"] = LLCallbackMap(createPanelLandOptions, this); 211 factory_map["land_options_panel"] = LLCallbackMap(createPanelLandOptions, this);
212// factory_map["land_audio_panel"] = LLCallbackMap(createPanelLandAudio, this);
211 factory_map["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this); 213 factory_map["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this);
212 factory_map["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this); 214 factory_map["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this);
213 215
@@ -243,6 +245,7 @@ void LLFloaterLand::refresh()
243 mPanelGeneral->refresh(); 245 mPanelGeneral->refresh();
244 mPanelObjects->refresh(); 246 mPanelObjects->refresh();
245 mPanelOptions->refresh(); 247 mPanelOptions->refresh();
248// mPanelAudio->refresh();
246 mPanelMedia->refresh(); 249 mPanelMedia->refresh();
247 mPanelAccess->refresh(); 250 mPanelAccess->refresh();
248} 251}
@@ -281,6 +284,15 @@ void* LLFloaterLand::createPanelLandOptions(void* data)
281 return self->mPanelOptions; 284 return self->mPanelOptions;
282} 285}
283 286
287/*
288// static
289void* LLFloaterLand::createPanelLandAudio(void* data)
290{
291 LLFloaterLand* self = (LLFloaterLand*)data;
292 self->mPanelAudio = new LLPanelLandAudio(self->mParcel);
293 return self->mPanelAudio;
294}
295*/
284// static 296// static
285void* LLFloaterLand::createPanelLandMedia(void* data) 297void* LLFloaterLand::createPanelLandMedia(void* data)
286{ 298{
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 06e6213..19721cc 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 f8a0a4f..b740725 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 52d7b1f..8d88601 100644
--- a/linden/indra/newview/llfloatertos.cpp
+++ b/linden/indra/newview/llfloatertos.cpp
@@ -163,12 +163,10 @@ BOOL LLFloaterTOS::postBuild()
163 LLTextEditor *editor = getChild<LLTextEditor>("tos_text"); 163 LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
164 editor->setVisible(FALSE); 164 editor->setVisible(FALSE);
165 165
166 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); 166 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
167 if ( web_browser ) 167 if ( web_browser )
168 { 168 {
169 // start to observe it so we see navigate complete events 169 web_browser->addObserver(this);
170 web_browser->addObserver( this );
171
172 gResponsePtr = LLIamHereTOS::build( this ); 170 gResponsePtr = LLIamHereTOS::build( this );
173 LLHTTPClient::head( getString( "real_url" ), gResponsePtr ); 171 LLHTTPClient::head( getString( "real_url" ), gResponsePtr );
174 } 172 }
@@ -181,7 +179,7 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
181 // only do this for TOS pages 179 // only do this for TOS pages
182 if ( mType == TOS_TOS ) 180 if ( mType == TOS_TOS )
183 { 181 {
184 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); 182 LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
185 // if the contents of the site was retrieved 183 // if the contents of the site was retrieved
186 if ( alive ) 184 if ( alive )
187 { 185 {
@@ -203,12 +201,6 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
203 201
204LLFloaterTOS::~LLFloaterTOS() 202LLFloaterTOS::~LLFloaterTOS()
205{ 203{
206 // stop obsaerving events
207 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html");
208 if ( web_browser )
209 {
210 web_browser->remObserver( this );
211 };
212 204
213 // tell the responder we're not here anymore 205 // tell the responder we're not here anymore
214 if ( gResponsePtr ) 206 if ( gResponsePtr )
@@ -271,8 +263,10 @@ void LLFloaterTOS::onCancel( void* userdata )
271} 263}
272 264
273//virtual 265//virtual
274void LLFloaterTOS::onNavigateComplete( const EventType& eventIn ) 266void LLFloaterTOS::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
275{ 267{
268 if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
269 {
276 // skip past the loading screen navigate complete 270 // skip past the loading screen navigate complete
277 if ( ++mLoadCompleteCount == 2 ) 271 if ( ++mLoadCompleteCount == 2 )
278 { 272 {
@@ -280,5 +274,6 @@ void LLFloaterTOS::onNavigateComplete( const EventType& eventIn )
280 // enable Agree to TOS radio button now that page has loaded 274 // enable Agree to TOS radio button now that page has loaded
281 LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); 275 LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
282 tos_agreement->setEnabled( true ); 276 tos_agreement->setEnabled( true );
283 }; 277 }
278 }
284} 279}
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 120bbaa..c7136bc 100644
--- a/linden/indra/newview/llhoverview.cpp
+++ b/linden/indra/newview/llhoverview.cpp
@@ -158,12 +158,13 @@ void LLHoverView::updateHover(LLTool* current_tool)
158 158
159void LLHoverView::pickCallback(const LLPickInfo& pick_info) 159void LLHoverView::pickCallback(const LLPickInfo& pick_info)
160{ 160{
161 gHoverView->mLastPickInfo = pick_info;
161 LLViewerObject* hit_obj = pick_info.getObject(); 162 LLViewerObject* hit_obj = pick_info.getObject();
162 163
163 if (hit_obj) 164 if (hit_obj)
164 { 165 {
165 gHoverView->setHoverActive(TRUE); 166 gHoverView->setHoverActive(TRUE);
166 LLSelectMgr::getInstance()->setHoverObject(hit_obj); 167 LLSelectMgr::getInstance()->setHoverObject(hit_obj, pick_info.mObjectFace);
167 gHoverView->mLastHoverObject = hit_obj; 168 gHoverView->mLastHoverObject = hit_obj;
168 gHoverView->mHoverOffset = pick_info.mObjectOffset; 169 gHoverView->mHoverOffset = pick_info.mObjectOffset;
169 } 170 }
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 d9e822f..41727f2 100644
--- a/linden/indra/newview/llimpanel.cpp
+++ b/linden/indra/newview/llimpanel.cpp
@@ -2202,8 +2202,8 @@ void LLFloaterIMPanel::sendMsg()
2202 2202
2203 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_IM_COUNT); 2203 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_IM_COUNT);
2204 2204
2205 mInputEditor->setText(LLStringUtil::null);
2205 } 2206 }
2206 mInputEditor->setText(LLStringUtil::null);
2207 2207
2208 // Don't need to actually send the typing stop message, the other 2208 // Don't need to actually send the typing stop message, the other
2209 // client will infer it from receiving the message. 2209 // client will infer it from receiving the message.
diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp
index 2253404..02f6a82 100644
--- a/linden/indra/newview/llimview.cpp
+++ b/linden/indra/newview/llimview.cpp
@@ -1363,7 +1363,7 @@ void LLIMMgr::saveIgnoreGroup()
1363{ 1363{
1364 // llinfos << "saving ignore_groups.xml" << llendl; 1364 // llinfos << "saving ignore_groups.xml" << llendl;
1365 1365
1366 std::string user_dir = gDirUtilp->getLindenUserDir(); 1366 std::string user_dir = gDirUtilp->getLindenUserDir(true);
1367 if (!user_dir.empty()) 1367 if (!user_dir.empty())
1368 { 1368 {
1369 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "ignore_groups.xml"); 1369 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "ignore_groups.xml");
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..c3bcf85
--- /dev/null
+++ b/linden/indra/newview/llmediactrl.cpp
@@ -0,0 +1,1202 @@
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: media_plugin_webkit automatically takes focus on mouseup,
203 // in addition to the onFocusReceived() call below. Undo this. JC
204 // RED-595: Is this really still the case for webkit?
205 if (!mTakeFocusOnClick)
206 {
207 mMediaSource->focus(false);
208 gViewerWindow->focusClient();
209 }
210 }
211
212 gFocusMgr.setMouseCapture( NULL );
213
214 return TRUE;
215}
216
217////////////////////////////////////////////////////////////////////////////////
218//
219BOOL LLMediaCtrl::handleMouseDown( S32 x, S32 y, MASK mask )
220{
221 convertInputCoords(x, y);
222
223 if (mMediaSource)
224 mMediaSource->mouseDown(x, y);
225
226 gFocusMgr.setMouseCapture( this );
227
228 if (mTakeFocusOnClick)
229 {
230 setFocus( TRUE );
231 }
232
233 return TRUE;
234}
235
236////////////////////////////////////////////////////////////////////////////////
237//
238BOOL LLMediaCtrl::handleDoubleClick( S32 x, S32 y, MASK mask )
239{
240 convertInputCoords(x, y);
241
242 if (mMediaSource)
243 mMediaSource->mouseLeftDoubleClick( x, y );
244
245 gFocusMgr.setMouseCapture( this );
246
247 if (mTakeFocusOnClick)
248 {
249 setFocus( TRUE );
250 }
251
252 return TRUE;
253}
254
255////////////////////////////////////////////////////////////////////////////////
256//
257void LLMediaCtrl::onFocusReceived()
258{
259 if (mMediaSource)
260 {
261 mMediaSource->focus(true);
262
263 // Set focus for edit menu items
264 LLEditMenuHandler::gEditMenuHandler = mMediaSource;
265 }
266
267 LLUICtrl::onFocusReceived();
268}
269
270////////////////////////////////////////////////////////////////////////////////
271//
272void LLMediaCtrl::onFocusLost()
273{
274 if (mMediaSource)
275 {
276 mMediaSource->focus(false);
277
278 if( LLEditMenuHandler::gEditMenuHandler == mMediaSource )
279 {
280 // Clear focus for edit menu items
281 LLEditMenuHandler::gEditMenuHandler = NULL;
282 }
283 }
284
285 gViewerWindow->focusClient();
286
287 LLUICtrl::onFocusLost();
288}
289
290////////////////////////////////////////////////////////////////////////////////
291//
292BOOL LLMediaCtrl::handleKeyHere( KEY key, MASK mask )
293{
294 BOOL result = FALSE;
295
296 // FIXME: THIS IS SO WRONG.
297 // Menu keys should be handled by the menu system and not passed to UI elements, but this is how LLTextEditor and LLLineEditor do it...
298
299 if (mMediaSource)
300 {
301 if( MASK_CONTROL & mask )
302 {
303 if( 'C' == key )
304 {
305 mMediaSource->copy();
306 result = TRUE;
307 }
308 else
309 if( 'V' == key )
310 {
311 mMediaSource->paste();
312 result = TRUE;
313 }
314 else
315 if( 'X' == key )
316 {
317 mMediaSource->cut();
318 result = TRUE;
319 }
320 }
321
322 if(!result)
323 {
324 result = mMediaSource->handleKeyHere(key, mask);
325 }
326 }
327
328 return result;
329}
330
331////////////////////////////////////////////////////////////////////////////////
332//
333void LLMediaCtrl::handleVisibilityChange ( BOOL new_visibility )
334{
335 llinfos << "visibility changed to " << (new_visibility?"true":"false") << llendl;
336 if(mMediaSource)
337 {
338 mMediaSource->setVisible( new_visibility );
339 }
340}
341
342////////////////////////////////////////////////////////////////////////////////
343//
344BOOL LLMediaCtrl::handleUnicodeCharHere(llwchar uni_char)
345{
346 BOOL result = FALSE;
347
348 // only accept 'printable' characters, sigh...
349 if (uni_char >= 32 // discard 'control' characters
350 && uni_char != 127) // SDL thinks this is 'delete' - yuck.
351 {
352 if (mMediaSource)
353 result = mMediaSource->handleUnicodeCharHere(uni_char);
354 }
355
356 return result;
357}
358
359////////////////////////////////////////////////////////////////////////////////
360//
361void LLMediaCtrl::onVisibilityChange ( BOOL new_visibility )
362{
363 // set state of frequent updates automatically if visibility changes
364 if ( new_visibility )
365 {
366 mFrequentUpdates = true;
367 }
368 else
369 {
370 mFrequentUpdates = false;
371 }
372 LLUICtrl::onVisibilityChange(new_visibility);
373}
374
375////////////////////////////////////////////////////////////////////////////////
376//
377void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent )
378{
379 S32 screen_width = mIgnoreUIScale ? llround((F32)width * LLUI::sGLScaleFactor.mV[VX]) : width;
380 S32 screen_height = mIgnoreUIScale ? llround((F32)height * LLUI::sGLScaleFactor.mV[VY]) : height;
381
382// llinfos << "reshape called with width = " << width << ", height = " << height << llendl;
383
384 // when floater is minimized, these sizes are negative
385 if ( mWebBrowserImage && screen_height > 0 && screen_width > 0 )
386 {
387 mWebBrowserImage->resize( screen_width, screen_height );
388 mForceUpdate = true;
389 }
390
391 LLUICtrl::reshape( width, height, called_from_parent );
392}
393
394////////////////////////////////////////////////////////////////////////////////
395//
396void LLMediaCtrl::navigateBack()
397{
398 if (mMediaSource && mMediaSource->hasMedia())
399 {
400 mMediaSource->getMediaPlugin()->browse_back();
401 }
402}
403
404////////////////////////////////////////////////////////////////////////////////
405//
406void LLMediaCtrl::navigateForward()
407{
408 if (mMediaSource && mMediaSource->hasMedia())
409 {
410 mMediaSource->getMediaPlugin()->browse_forward();
411 }
412}
413
414////////////////////////////////////////////////////////////////////////////////
415//
416bool LLMediaCtrl::canNavigateBack()
417{
418 if (mMediaSource)
419 return mMediaSource->canNavigateBack();
420 else
421 return false;
422}
423
424////////////////////////////////////////////////////////////////////////////////
425//
426bool LLMediaCtrl::canNavigateForward()
427{
428 if (mMediaSource)
429 return mMediaSource->canNavigateForward();
430 else
431 return false;
432}
433
434////////////////////////////////////////////////////////////////////////////////
435//
436void LLMediaCtrl::set404RedirectUrl( std::string redirect_url )
437{
438 if(mMediaSource && mMediaSource->hasMedia())
439 mMediaSource->getMediaPlugin()->set_status_redirect( 404, redirect_url );
440}
441
442////////////////////////////////////////////////////////////////////////////////
443//
444void LLMediaCtrl::clr404RedirectUrl()
445{
446 if(mMediaSource && mMediaSource->hasMedia())
447 mMediaSource->getMediaPlugin()->set_status_redirect(404, "");
448}
449
450////////////////////////////////////////////////////////////////////////////////
451//
452void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
453{
454 // don't browse to anything that starts with secondlife:// or sl://
455 const std::string protocol1 = "secondlife://";
456 const std::string protocol2 = "sl://";
457 if ((LLStringUtil::compareInsensitive(url_in.substr(0, protocol1.length()), protocol1) == 0) ||
458 (LLStringUtil::compareInsensitive(url_in.substr(0, protocol2.length()), protocol2) == 0))
459 {
460 // TODO: Print out/log this attempt?
461 // llinfos << "Rejecting attempt to load restricted website :" << urlIn << llendl;
462 return;
463 }
464
465 if (mMediaSource)
466 {
467 mCurrentNavUrl = url_in;
468 mMediaSource->navigateTo(url_in, mime_type, mime_type.empty());
469 }
470}
471
472////////////////////////////////////////////////////////////////////////////////
473//
474void LLMediaCtrl::navigateToLocalPage( const std::string& subdir, const std::string& filename_in )
475{
476 std::string language = LLUI::getLanguage();
477 std::string delim = gDirUtilp->getDirDelimiter();
478 std::string filename;
479
480 filename += subdir;
481 filename += delim;
482 filename += filename_in;
483
484 std::string expanded_filename = gDirUtilp->findSkinnedFilename("html", language, filename);
485
486 if (! gDirUtilp->fileExists(expanded_filename))
487 {
488 if (language != "en-us")
489 {
490 expanded_filename = gDirUtilp->findSkinnedFilename("html", "en-us", filename);
491 if (! gDirUtilp->fileExists(expanded_filename))
492 {
493 llwarns << "File " << subdir << delim << filename_in << "not found" << llendl;
494 return;
495 }
496 }
497 else
498 {
499 llwarns << "File " << subdir << delim << filename_in << "not found" << llendl;
500 return;
501 }
502 }
503 if (mMediaSource)
504 {
505 mCurrentNavUrl = expanded_filename;
506 mMediaSource->navigateTo(expanded_filename, "text/html", false);
507 }
508
509}
510
511////////////////////////////////////////////////////////////////////////////////
512//
513void LLMediaCtrl::navigateHome()
514{
515 if( mHomePageUrl.length() )
516 {
517 if (mMediaSource)
518 mMediaSource->navigateTo(mHomePageUrl);
519 };
520}
521
522////////////////////////////////////////////////////////////////////////////////
523//
524void LLMediaCtrl::setHomePageUrl( const std::string urlIn )
525{
526 mHomePageUrl = urlIn;
527}
528
529////////////////////////////////////////////////////////////////////////////////
530//
531bool LLMediaCtrl::setCaretColor(unsigned int red, unsigned int green, unsigned int blue)
532{
533 //NOOP
534 return false;
535}
536////////////////////////////////////////////////////////////////////////////////
537//
538std::string LLMediaCtrl::getHomePageUrl()
539{
540 return mHomePageUrl;
541}
542
543////////////////////////////////////////////////////////////////////////////////
544//
545LLPluginClassMedia* LLMediaCtrl::getMediaPlugin()
546{
547 return mMediaSource.isNull() ? NULL : mMediaSource->getMediaPlugin();
548}
549
550////////////////////////////////////////////////////////////////////////////////
551//
552void LLMediaCtrl::draw()
553{
554 if ( ! mWebBrowserImage )
555 return;
556
557 if ( gRestoreGL == 1 )
558 {
559 LLRect r = getRect();
560 reshape( r.getWidth(), r.getHeight(), FALSE );
561 return;
562 };
563
564 // NOTE: optimization needed here - probably only need to do this once
565 // unless tearoffs change the parent which they probably do.
566 const LLUICtrl* ptr = findRootMostFocusRoot();
567 if ( ptr && ptr->hasFocus() )
568 {
569 setFrequentUpdates( true );
570 }
571 else
572 {
573 setFrequentUpdates( false );
574 };
575
576 // alpha off for this
577 LLGLSUIDefault gls_ui;
578 LLGLDisable gls_alphaTest( GL_ALPHA_TEST );
579
580 gGL.pushMatrix();
581 {
582 if (mIgnoreUIScale)
583 {
584 glLoadIdentity();
585 // font system stores true screen origin, need to scale this by UI scale factor
586 // to get render origin for this view (with unit scale)
587 gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]),
588 floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]),
589 LLFontGL::sCurOrigin.mZ);
590 }
591
592 // scale texture to fit the space using texture coords
593 gGL.getTexUnit(0)->bind(mWebBrowserImage->getTexture());
594 gGL.color4fv( LLColor4::white.mV );
595 F32 max_u = ( F32 )mWebBrowserImage->getMediaWidth() / ( F32 )mWebBrowserImage->getWidth();
596 F32 max_v = ( F32 )mWebBrowserImage->getMediaHeight() / ( F32 )mWebBrowserImage->getHeight();
597
598 LLRect r = getRect();
599 S32 width, height;
600 S32 x_offset = 0;
601 S32 y_offset = 0;
602
603 if(mStretchToFill)
604 {
605 if(mMaintainAspectRatio)
606 {
607 F32 media_aspect = (F32)(mWebBrowserImage->getMediaWidth()) / (F32)(mWebBrowserImage->getMediaHeight());
608 F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight());
609 if(media_aspect > view_aspect)
610 {
611 // max width, adjusted height
612 width = r.getWidth();
613 height = llmin(llmax(S32(width / media_aspect), 0), r.getHeight());
614 }
615 else
616 {
617 // max height, adjusted width
618 height = r.getHeight();
619 width = llmin(llmax(S32(height * media_aspect), 0), r.getWidth());
620 }
621 }
622 else
623 {
624 width = r.getWidth();
625 height = r.getHeight();
626 }
627 }
628 else
629 {
630 width = llmin(mWebBrowserImage->getMediaWidth(), r.getWidth());
631 height = llmin(mWebBrowserImage->getMediaHeight(), r.getHeight());
632 }
633
634 x_offset = (r.getWidth() - width) / 2;
635 y_offset = (r.getHeight() - height) / 2;
636
637 if (mIgnoreUIScale)
638 {
639 width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]);
640 height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]);
641 x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]);
642 y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]);
643 }
644
645 // draw the browser
646 gGL.setSceneBlendType(LLRender::BT_REPLACE);
647 gGL.begin( LLRender::QUADS );
648 if (! mWebBrowserImage->getTextureCoordsOpenGL())
649 {
650 // render using web browser reported width and height, instead of trying to invert GL scale
651 gGL.texCoord2f( max_u, 0.f );
652 gGL.vertex2i( x_offset + width, y_offset + height );
653
654 gGL.texCoord2f( 0.f, 0.f );
655 gGL.vertex2i( x_offset, y_offset + height );
656
657 gGL.texCoord2f( 0.f, max_v );
658 gGL.vertex2i( x_offset, y_offset );
659
660 gGL.texCoord2f( max_u, max_v );
661 gGL.vertex2i( x_offset + width, y_offset );
662 }
663 else
664 {
665 // render using web browser reported width and height, instead of trying to invert GL scale
666 gGL.texCoord2f( max_u, max_v );
667 gGL.vertex2i( x_offset + width, y_offset + height );
668
669 gGL.texCoord2f( 0.f, max_v );
670 gGL.vertex2i( x_offset, y_offset + height );
671
672 gGL.texCoord2f( 0.f, 0.f );
673 gGL.vertex2i( x_offset, y_offset );
674
675 gGL.texCoord2f( max_u, 0.f );
676 gGL.vertex2i( x_offset + width, y_offset );
677 }
678 gGL.end();
679 gGL.setSceneBlendType(LLRender::BT_ALPHA);
680 }
681 gGL.popMatrix();
682
683 // highlight if keyboard focus here. (TODO: this needs some work)
684 if ( mBorder->getVisible() )
685 mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus( this ) );
686
687
688 LLUICtrl::draw();
689}
690
691////////////////////////////////////////////////////////////////////////////////
692//
693void LLMediaCtrl::convertInputCoords(S32& x, S32& y)
694{
695 x = mIgnoreUIScale ? llround((F32)x * LLUI::sGLScaleFactor.mV[VX]) : x;
696 if ( ! mWebBrowserImage->getTextureCoordsOpenGL() )
697 {
698 y = mIgnoreUIScale ? llround((F32)(y) * LLUI::sGLScaleFactor.mV[VY]) : y;
699 }
700 else
701 {
702 y = mIgnoreUIScale ? llround((F32)(getRect().getHeight() - y) * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight() - y;
703 };
704}
705
706////////////////////////////////////////////////////////////////////////////////
707// static
708bool LLMediaCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD& response )
709{
710 S32 option = LLNotification::getSelectedOption(notification, response);
711 if ( 0 == option )
712 {
713 // open in external browser because we don't support
714 // creation of our own secondary browser windows
715 LLWeb::loadURLExternal( notification["payload"]["external_url"].asString() );
716 }
717 return false;
718}
719
720////////////////////////////////////////////////////////////////////////////////
721// inherited from LLViewerMediaObserver
722//virtual
723void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
724{
725 switch(event)
726 {
727 case MEDIA_EVENT_CONTENT_UPDATED:
728 {
729 // LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CONTENT_UPDATED " << LL_ENDL;
730 };
731 break;
732
733 case MEDIA_EVENT_TIME_DURATION_UPDATED:
734 {
735 // LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_TIME_DURATION_UPDATED, time is " << self->getCurrentTime() << " of " << self->getDuration() << LL_ENDL;
736 };
737 break;
738
739 case MEDIA_EVENT_SIZE_CHANGED:
740 {
741 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_SIZE_CHANGED " << LL_ENDL;
742 LLRect r = getRect();
743 reshape( r.getWidth(), r.getHeight(), FALSE );
744 };
745 break;
746
747 case MEDIA_EVENT_CURSOR_CHANGED:
748 {
749 LL_INFOS("Media") << "Media event: MEDIA_EVENT_CURSOR_CHANGED, new cursor is " << self->getCursorName() << LL_ENDL;
750
751 std::string cursor = self->getCursorName();
752
753 if(cursor == "arrow")
754 mLastSetCursor = UI_CURSOR_ARROW;
755 else if(cursor == "ibeam")
756 mLastSetCursor = UI_CURSOR_IBEAM;
757 else if(cursor == "splith")
758 mLastSetCursor = UI_CURSOR_SIZEWE;
759 else if(cursor == "splitv")
760 mLastSetCursor = UI_CURSOR_SIZENS;
761 else if(cursor == "hand")
762 mLastSetCursor = UI_CURSOR_HAND;
763 else // for anything else, default to the arrow
764 mLastSetCursor = UI_CURSOR_ARROW;
765 };
766 break;
767
768 case MEDIA_EVENT_NAVIGATE_BEGIN:
769 {
770 LL_INFOS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_BEGIN, url is " << self->getNavigateURI() << LL_ENDL;
771 if(mMediaSource && mHideLoading)
772 {
773 mMediaSource->suspendUpdates(true);
774 }
775 };
776 break;
777
778 case MEDIA_EVENT_NAVIGATE_COMPLETE:
779 {
780 LL_INFOS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_COMPLETE, result string is: " << self->getNavigateResultString() << LL_ENDL;
781 if(mMediaSource && mHideLoading)
782 {
783 mMediaSource->suspendUpdates(false);
784 }
785 };
786 break;
787
788 case MEDIA_EVENT_PROGRESS_UPDATED:
789 {
790 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PROGRESS_UPDATED, loading at " << self->getProgressPercent() << "%" << LL_ENDL;
791 };
792 break;
793
794 case MEDIA_EVENT_STATUS_TEXT_CHANGED:
795 {
796 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_STATUS_TEXT_CHANGED, new status text is: " << self->getStatusText() << LL_ENDL;
797 };
798 break;
799
800 case MEDIA_EVENT_LOCATION_CHANGED:
801 {
802 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_LOCATION_CHANGED, new uri is: " << self->getLocation() << LL_ENDL;
803 };
804 break;
805
806 case MEDIA_EVENT_CLICK_LINK_HREF:
807 {
808 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << self->getClickTarget() << "\", uri is " << self->getClickURL() << LL_ENDL;
809 onClickLinkHref(self);
810 };
811 break;
812
813 case MEDIA_EVENT_CLICK_LINK_NOFOLLOW:
814 {
815 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_NOFOLLOW, uri is " << self->getClickURL() << LL_ENDL;
816 onClickLinkNoFollow(self);
817 };
818 break;
819
820 case MEDIA_EVENT_PLUGIN_FAILED:
821 {
822 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PLUGIN_FAILED" << LL_ENDL;
823 };
824 break;
825
826 case MEDIA_EVENT_PLUGIN_FAILED_LAUNCH:
827 {
828 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PLUGIN_FAILED_LAUNCH" << LL_ENDL;
829 };
830 break;
831
832 case MEDIA_EVENT_NAME_CHANGED:
833 {
834 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAME_CHANGED" << LL_ENDL;
835 };
836 break;
837 };
838
839 // chain all events to any potential observers of this object.
840 emitEvent(self, event);
841}
842
843////////////////////////////////////////////////////////////////////////////////
844//
845void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self )
846{
847 // retrieve the event parameters
848 std::string target = self->getClickTarget();
849 std::string url = self->getClickURL();
850
851 // if there is a value for the target
852 if ( !target.empty() )
853 {
854 if ( target == "_external" )
855 {
856 mExternalUrl = url;
857 LLSD payload;
858 payload["external_url"] = mExternalUrl;
859 LLNotifications::instance().add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget);
860 return;
861 }
862 }
863
864 const std::string protocol1( "http://" );
865 const std::string protocol2( "https://" );
866 if( mOpenLinksInExternalBrowser )
867 {
868 if ( !url.empty() )
869 {
870 if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 ||
871 LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 )
872 {
873 LLWeb::loadURLExternal( url );
874 }
875 }
876 }
877 else
878 if( mOpenLinksInInternalBrowser )
879 {
880 if ( !url.empty() )
881 {
882 if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 ||
883 LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 )
884 {
885 // If we spawn a new LLFloaterHTML, assume we want it to
886 // follow this LLMediaCtrl's trust for whether or
887 // not to open secondlife:///app/ links. JC.
888// const bool open_links_externally = false;
889// LLFloaterHtml::getInstance()->show(
890// event_in.mStringPayload,
891// "Second Life Browser",
892// open_links_externally,
893// mTrusted);
894 }
895 }
896 }
897}
898
899////////////////////////////////////////////////////////////////////////////////
900//
901void LLMediaCtrl::onClickLinkNoFollow( LLPluginClassMedia* self )
902{
903 std::string url = self->getClickURL();
904 if (LLURLDispatcher::isSLURLCommand(url)
905 && !mTrusted)
906 {
907 // block handling of this secondlife:///app/ URL
908 LLNotifications::instance().add("UnableToOpenCommandURL");
909 return;
910 }
911
912 LLURLDispatcher::dispatch(url, this, mTrusted);
913}
914
915////////////////////////////////////////////////////////////////////////////////
916//
917LLWebBrowserTexture::LLWebBrowserTexture( S32 width, S32 height, LLMediaCtrl* browserCtrl, viewer_media_t media_source ) :
918 LLDynamicTexture( 512, 512, 4, ORDER_FIRST, TRUE ),
919 mNeedsUpdate( true ),
920 mNeedsResize( false ),
921 mTextureCoordsOpenGL( true ),
922 mWebBrowserCtrl( browserCtrl ),
923 mMediaSource(media_source)
924{
925 mElapsedTime.start();
926
927 resize( width, height );
928}
929
930////////////////////////////////////////////////////////////////////////////////
931//
932LLWebBrowserTexture::~LLWebBrowserTexture()
933{
934 mElapsedTime.stop();
935 mMediaSource = NULL;
936}
937
938////////////////////////////////////////////////////////////////////////////////
939//
940BOOL LLWebBrowserTexture::needsRender()
941{
942 bool texture_dirty = false;
943
944 if ( mWebBrowserCtrl->getFrequentUpdates() ||
945 mWebBrowserCtrl->getAlwaysRefresh() ||
946 mWebBrowserCtrl->getForceUpdate() )
947 {
948 // All of these force an update
949 return TRUE;
950 }
951
952 // If the texture needs updating, render needs to be called.
953 if (mMediaSource && mMediaSource->hasMedia())
954 {
955 LLPluginClassMedia* media = mMediaSource->getMediaPlugin();
956
957 if(media->textureValid() && media->getDirty())
958 {
959 texture_dirty = true;
960 }
961 }
962
963
964 return texture_dirty;
965}
966
967////////////////////////////////////////////////////////////////////////////////
968//
969BOOL LLWebBrowserTexture::render()
970{
971 if(updateBrowserTexture())
972 {
973 // updateBrowserTexture already verified that the media plugin is there and the texture is valid.
974 LLPluginClassMedia* media_plugin = mMediaSource->getMediaPlugin();
975 LLRect dirty_rect;
976
977 if(mNeedsUpdate)
978 {
979 // If we need an update, use the whole rect instead of the dirty rect.
980 dirty_rect.mLeft = 0;
981 dirty_rect.mBottom = 0;
982 dirty_rect.mRight = media_plugin->getWidth();
983 dirty_rect.mTop = media_plugin->getHeight();
984 }
985 else
986 {
987 mNeedsUpdate = media_plugin->getDirty(&dirty_rect);
988 }
989
990 if ( mNeedsUpdate )
991 {
992 mNeedsUpdate = false;
993 mWebBrowserCtrl->setForceUpdate(false);
994
995 // Constrain the dirty rect to be inside the texture
996 S32 x_pos = llmax(dirty_rect.mLeft, 0);
997 S32 y_pos = llmax(dirty_rect.mBottom, 0);
998 S32 width = llmin(dirty_rect.mRight, getWidth()) - x_pos;
999 S32 height = llmin(dirty_rect.mTop, getHeight()) - y_pos;
1000
1001 if(width > 0 && height > 0)
1002 {
1003 U8* data = media_plugin->getBitsData();
1004
1005 // Offset the pixels pointer to match x_pos and y_pos
1006 data += ( x_pos * media_plugin->getTextureDepth() * media_plugin->getBitsWidth() );
1007 data += ( y_pos * media_plugin->getTextureDepth() );
1008
1009 mTexture->setSubImage(
1010 data,
1011 media_plugin->getBitsWidth(),
1012 media_plugin->getBitsHeight(),
1013 x_pos,
1014 y_pos,
1015 width,
1016 height,
1017 TRUE); // force a fast update (i.e. don't call analyzeAlpha, etc.)
1018 }
1019
1020 media_plugin->resetDirty();
1021
1022 return TRUE;
1023 };
1024 };
1025
1026 return FALSE;
1027}
1028
1029////////////////////////////////////////////////////////////////////////////////
1030//
1031S32 LLWebBrowserTexture::getMediaWidth()
1032{
1033 return mMediaWidth;
1034}
1035
1036////////////////////////////////////////////////////////////////////////////////
1037//
1038S32 LLWebBrowserTexture::getMediaHeight()
1039{
1040 return mMediaHeight;
1041}
1042
1043////////////////////////////////////////////////////////////////////////////////
1044//
1045void LLWebBrowserTexture::setNeedsUpdate()
1046{
1047 mNeedsUpdate = true;
1048}
1049
1050////////////////////////////////////////////////////////////////////////////////
1051//
1052bool LLWebBrowserTexture::getNeedsUpdate()
1053{
1054 return mNeedsUpdate;
1055}
1056
1057////////////////////////////////////////////////////////////////////////////////
1058//
1059bool LLWebBrowserTexture::getTextureCoordsOpenGL()
1060{
1061 return mTextureCoordsOpenGL;
1062}
1063
1064
1065////////////////////////////////////////////////////////////////////////////////
1066//
1067void LLWebBrowserTexture::resize( S32 new_width, S32 new_height )
1068{
1069 F32 scale_ratio = 1.f;
1070 if (new_width > MAX_DIMENSION)
1071 {
1072 scale_ratio = (F32)MAX_DIMENSION / (F32)new_width;
1073 }
1074 if (new_height > MAX_DIMENSION)
1075 {
1076 scale_ratio = llmin(scale_ratio, (F32)MAX_DIMENSION / (F32)new_height);
1077 }
1078
1079 mMediaWidth = llround(scale_ratio * (F32)new_width);
1080 mMediaHeight = llround(scale_ratio * (F32)new_height);
1081
1082 adjustSize();
1083}
1084
1085bool LLWebBrowserTexture::adjustSize()
1086{
1087 if (mMediaSource && mMediaSource->hasMedia())
1088 {
1089 int natural_width = mMediaSource->getMediaPlugin()->getNaturalWidth();
1090 int natural_height = mMediaSource->getMediaPlugin()->getNaturalHeight();
1091
1092 if(natural_width != 0)
1093 {
1094 // If the media has a "natural size", use it.
1095 mMediaWidth = natural_width;
1096 mMediaHeight = natural_height;
1097 }
1098
1099 mMediaSource->setSize(mMediaWidth, mMediaHeight);
1100 mNeedsResize = false;
1101
1102 return true;
1103 }
1104 else
1105 {
1106 // The media isn't fully initialized yet, delay the resize until later.
1107 mNeedsResize = true;
1108 }
1109
1110 return false;
1111}
1112
1113bool LLWebBrowserTexture::updateBrowserTexture()
1114{
1115 if (!adjustSize())
1116 return false;
1117
1118 LLPluginClassMedia* media = mMediaSource->getMediaPlugin();
1119
1120 if(!media->textureValid())
1121 return false;
1122
1123 if(mMediaSource->mNeedsNewTexture
1124 || media->getTextureWidth() != mWidth
1125 || media->getTextureHeight() != mHeight )
1126 {
1127 releaseGLTexture();
1128
1129 mWidth = media->getTextureWidth();
1130 mHeight = media->getTextureHeight();
1131 mTextureCoordsOpenGL = media->getTextureCoordsOpenGL();
1132
1133 // will create mWidth * mHeight sized texture, using the texture params specified by the media.
1134 LLDynamicTexture::generateGLTexture(
1135 media->getTextureFormatInternal(),
1136 media->getTextureFormatPrimary(),
1137 media->getTextureFormatType(),
1138 media->getTextureFormatSwapBytes());
1139
1140
1141 mMediaSource->mNeedsNewTexture = false;
1142 }
1143
1144 return true;
1145}
1146// virtual
1147LLXMLNodePtr LLMediaCtrl::getXML(bool save_children) const
1148{
1149 LLXMLNodePtr node = LLUICtrl::getXML();
1150
1151 node->setName(LL_WEB_BROWSER_CTRL_TAG);
1152
1153 return node;
1154}
1155
1156LLView* LLMediaCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
1157{
1158 std::string name("web_browser");
1159 node->getAttributeString("name", name);
1160
1161 std::string start_url("");
1162 node->getAttributeString("start_url", start_url );
1163
1164 BOOL border_visible = true;
1165 node->getAttributeBOOL("border_visible", border_visible);
1166
1167 LLRect rect;
1168 createRect(node, rect, parent, LLRect());
1169
1170 LLMediaCtrl* web_browser = new LLMediaCtrl( name, rect );
1171
1172 if(node->hasAttribute("caret_color"))
1173 {
1174 LLColor4 color;
1175 LLUICtrlFactory::getAttributeColor(node, "caret_color", color);
1176 LLColor4U colorU = LLColor4U(color);
1177 web_browser->setCaretColor( colorU.mV[0], colorU.mV[1], colorU.mV[2] );
1178 }
1179
1180 BOOL ignore_ui_scale = web_browser->getIgnoreUIScale();
1181 node->getAttributeBOOL("ignore_ui_scale", ignore_ui_scale);
1182 web_browser->setIgnoreUIScale((bool)ignore_ui_scale);
1183
1184 web_browser->initFromXML(node, parent);
1185
1186 web_browser->setHomePageUrl( start_url );
1187
1188 web_browser->setBorderVisible( border_visible );
1189
1190 if(! start_url.empty())
1191 {
1192 web_browser->navigateHome();
1193 }
1194
1195 return web_browser;
1196}
1197
1198std::string LLMediaCtrl::getCurrentNavUrl()
1199{
1200 return mCurrentNavUrl;
1201}
1202
diff --git a/linden/indra/newview/llwebbrowserctrl.h b/linden/indra/newview/llmediactrl.h
index 0100807..77f59c7 100644
--- a/linden/indra/newview/llwebbrowserctrl.h
+++ b/linden/indra/newview/llmediactrl.h
@@ -1,5 +1,5 @@
1/** 1/**
2 * @file llwebbrowserctrl.h 2 * @file llmediactrl.h
3 * @brief Web browser UI control 3 * @brief Web browser UI control
4 * 4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$ 5 * $LicenseInfo:firstyear=2006&license=viewergpl$
@@ -30,158 +30,29 @@
30 * $/LicenseInfo$ 30 * $/LicenseInfo$
31 */ 31 */
32 32
33#ifndef LL_LLWEBBROWSERCTRL_H 33#ifndef LL_LLMediaCtrl_H
34#define LL_LLWEBBROWSERCTRL_H 34#define LL_LLMediaCtrl_H
35 35
36//////////////////////////////////////////////////////////////////////////////// 36#include "llviewermedia.h"
37// data class that is passed with an event
38class LLWebBrowserCtrlEvent
39{
40 public:
41 LLWebBrowserCtrlEvent()
42 {
43 };
44
45 LLWebBrowserCtrlEvent( int intValIn ) :
46 mIntVal( intValIn )
47 {
48 };
49
50 LLWebBrowserCtrlEvent( std::string stringValIn ) :
51 mIntVal(-1),
52 mStringVal( stringValIn )
53 {
54 };
55
56 LLWebBrowserCtrlEvent( std::string stringValIn, std::string stringValExIn ) :
57 mIntVal(-1),
58 mStringVal( stringValIn ),
59 mStringValEx( stringValExIn )
60 {
61 };
62
63 virtual ~LLWebBrowserCtrlEvent()
64 {
65 };
66
67 int getIntValue() const
68 {
69 return mIntVal;
70 };
71
72 std::string getStringValue() const
73 {
74 return mStringVal;
75 };
76
77 std::string getStringValueEx() const
78 {
79 return mStringValEx;
80 };
81
82 private:
83 int mIntVal;
84 std::string mStringVal;
85 std::string mStringValEx;
86};
87
88////////////////////////////////////////////////////////////////////////////////
89// Override these methods to observe web browser control events
90// (they are chained and fired after observing LLMozLibEvents)
91class LLWebBrowserCtrlObserver
92{
93 public:
94 virtual ~LLWebBrowserCtrlObserver() { };
95
96 typedef LLWebBrowserCtrlEvent EventType;
97 virtual void onNavigateBegin( const EventType& eventIn ) { };
98 virtual void onNavigateComplete( const EventType& eventIn ) { };
99 virtual void onUpdateProgress( const EventType& eventIn ) { };
100 virtual void onStatusTextChange( const EventType& eventIn ) { };
101 virtual void onLocationChange( const EventType& eventIn ) { };
102 virtual void onClickLinkHref( const EventType& eventIn ) { };
103 virtual void onClickLinkNoFollow( const EventType& eventIn ) { };
104};
105 37
106#include "lluictrl.h" 38#include "lluictrl.h"
107#include "llframetimer.h" 39#include "llframetimer.h"
108#include "lldynamictexture.h" 40#include "lldynamictexture.h"
109#include "llmediamanager.h"
110#include "llmediaobserver.h"
111 41
112class LLViewBorder; 42class LLViewBorder;
113class LLWebBrowserTexture; 43class LLWebBrowserTexture;
114
115///////////////////////////////////////////////////////////////////////////////
116// manages the process of storing and emitting events that the consumer
117// of the embedding class can observe
118template< class T >
119class LLWebBrowserCtrlEventEmitter
120{
121 public:
122 LLWebBrowserCtrlEventEmitter() { };
123 ~LLWebBrowserCtrlEventEmitter() { };
124
125 typedef typename T::EventType EventType;
126 typedef std::list< T* > ObserverContainer;
127 typedef void( T::*observerMethod )( const EventType& );
128
129 ///////////////////////////////////////////////////////////////////////////////
130 //
131 bool addObserver( T* observerIn )
132 {
133 if ( ! observerIn )
134 return false;
135
136 if ( std::find( observers.begin(), observers.end(), observerIn ) != observers.end() )
137 return false;
138
139 observers.push_back( observerIn );
140
141 return true;
142 };
143
144 ///////////////////////////////////////////////////////////////////////////////
145 //
146 bool remObserver( T* observerIn )
147 {
148 if ( ! observerIn )
149 return false;
150
151 observers.remove( observerIn );
152
153 return true;
154 };
155
156 ///////////////////////////////////////////////////////////////////////////////
157 //
158 void update( observerMethod method, const EventType& msgIn )
159 {
160 typename std::list< T* >::iterator iter = observers.begin();
161
162 while( iter != observers.end() )
163 {
164 ( ( *iter )->*method )( msgIn );
165
166 ++iter;
167 };
168 };
169
170 protected:
171 ObserverContainer observers;
172};
173
174class LLUICtrlFactory; 44class LLUICtrlFactory;
175 45
176//////////////////////////////////////////////////////////////////////////////// 46////////////////////////////////////////////////////////////////////////////////
177// 47//
178class LLWebBrowserCtrl : 48class LLMediaCtrl :
179 public LLUICtrl, 49 public LLUICtrl,
180 public LLMediaObserver 50 public LLViewerMediaObserver,
51 public LLViewerMediaEventEmitter
181{ 52{
182 public: 53 public:
183 LLWebBrowserCtrl( const std::string& name, const LLRect& rect ); 54 LLMediaCtrl( const std::string& name, const LLRect& rect );
184 virtual ~LLWebBrowserCtrl(); 55 virtual ~LLMediaCtrl();
185 56
186 void setBorderVisible( BOOL border_visible ); 57 void setBorderVisible( BOOL border_visible );
187 58
@@ -202,7 +73,7 @@ class LLWebBrowserCtrl :
202 virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); 73 virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks );
203 74
204 // navigation 75 // navigation
205 void navigateTo( std::string urlIn ); 76 void navigateTo( std::string url_in, std::string mime_type = "");
206 void navigateBack(); 77 void navigateBack();
207 void navigateHome(); 78 void navigateHome();
208 void navigateForward(); 79 void navigateForward();
@@ -225,8 +96,8 @@ class LLWebBrowserCtrl :
225 std::string getHomePageUrl(); 96 std::string getHomePageUrl();
226 97
227 // set/clear URL to visit when a 404 page is reached 98 // set/clear URL to visit when a 404 page is reached
228 bool set404RedirectUrl( std::string redirect_url ); 99 void set404RedirectUrl( std::string redirect_url );
229 bool clr404RedirectUrl(); 100 void clr404RedirectUrl();
230 101
231 // accessor/mutator for flag that indicates if frequent updates to texture happen 102 // accessor/mutator for flag that indicates if frequent updates to texture happen
232 bool getFrequentUpdates() { return mFrequentUpdates; }; 103 bool getFrequentUpdates() { return mFrequentUpdates; };
@@ -241,11 +112,14 @@ class LLWebBrowserCtrl :
241 void setForceUpdate(bool force_update) { mForceUpdate = force_update; } 112 void setForceUpdate(bool force_update) { mForceUpdate = force_update; }
242 bool getForceUpdate() { return mForceUpdate; } 113 bool getForceUpdate() { return mForceUpdate; }
243 114
115 LLPluginClassMedia* getMediaPlugin();
116
244 bool setCaretColor( unsigned int red, unsigned int green, unsigned int blue ); 117 bool setCaretColor( unsigned int red, unsigned int green, unsigned int blue );
245 118
246 119
247 // over-rides 120 // over-rides
248 virtual BOOL handleKeyHere( KEY key, MASK mask); 121 virtual BOOL handleKeyHere( KEY key, MASK mask);
122 virtual void handleVisibilityChange ( BOOL new_visibility );
249 virtual BOOL handleUnicodeCharHere(llwchar uni_char); 123 virtual BOOL handleUnicodeCharHere(llwchar uni_char);
250 virtual void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE); 124 virtual void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE);
251 virtual void draw(); 125 virtual void draw();
@@ -254,30 +128,21 @@ class LLWebBrowserCtrl :
254 // focus overrides 128 // focus overrides
255 void onFocusLost(); 129 void onFocusLost();
256 void onFocusReceived(); 130 void onFocusReceived();
131
132 // Incoming media event dispatcher
133 virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
257 134
258 // observer interface 135 // handlers for individual events (could be done inside the switch in handleMediaEvent, they're just individual functions for clarity)
259 bool addObserver( LLWebBrowserCtrlObserver* subjectIn ); 136 void onClickLinkHref( LLPluginClassMedia* self );
260 bool remObserver( LLWebBrowserCtrlObserver* subjectIn ); 137 void onClickLinkNoFollow( LLPluginClassMedia* self );
261 138
262 // LLMozlib observer overrides
263 virtual void onNavigateBegin( const EventType& eventIn );
264 virtual void onNavigateComplete( const EventType& eventIn );
265 virtual void onUpdateProgress( const EventType& eventIn );
266 virtual void onStatusTextChange( const EventType& eventIn );
267 virtual void onLocationChange( const EventType& eventIn );
268 virtual void onClickLinkHref( const EventType& eventIn );
269 virtual void onClickLinkNoFollow( const EventType& eventIn );
270 virtual void onMediaContentsChange( const EventType& event_in );
271
272 protected: 139 protected:
273 void convertInputCoords(S32& x, S32& y); 140 void convertInputCoords(S32& x, S32& y);
274 141
275 private: 142 private:
276 static bool onClickLinkExternalTarget( const LLSD&, const LLSD& ); 143 static bool onClickLinkExternalTarget( const LLSD&, const LLSD& );
277 144
278 LLWebBrowserCtrlEventEmitter< LLWebBrowserCtrlObserver > mEventEmitter;
279 const S32 mTextureDepthBytes; 145 const S32 mTextureDepthBytes;
280 int mEmbeddedBrowserWindowId;
281 LLWebBrowserTexture* mWebBrowserImage; 146 LLWebBrowserTexture* mWebBrowserImage;
282 LLViewBorder* mBorder; 147 LLViewBorder* mBorder;
283 bool mFrequentUpdates; 148 bool mFrequentUpdates;
@@ -290,16 +155,21 @@ class LLWebBrowserCtrl :
290 std::string mCurrentNavUrl; 155 std::string mCurrentNavUrl;
291 bool mIgnoreUIScale; 156 bool mIgnoreUIScale;
292 bool mAlwaysRefresh; 157 bool mAlwaysRefresh;
293 LLMediaBase* mMediaSource; 158 viewer_media_t mMediaSource;
294 bool mTakeFocusOnClick; 159 bool mTakeFocusOnClick;
160 ECursorType mLastSetCursor;
161 bool mStretchToFill;
162 bool mMaintainAspectRatio;
163 bool mHideLoading;
295}; 164};
296 165
297//////////////////////////////////////////////////////////////////////////////// 166////////////////////////////////////////////////////////////////////////////////
298// 167//
299class LLWebBrowserTexture : public LLDynamicTexture 168class LLWebBrowserTexture : public LLDynamicTexture
300{ 169{
170LOG_CLASS(LLWebBrowserTexture);
301 public: 171 public:
302 LLWebBrowserTexture( S32 width, S32 height, LLWebBrowserCtrl* browserCtrl, LLMediaBase *media_source ); 172 LLWebBrowserTexture( S32 width, S32 height, LLMediaCtrl* browserCtrl, viewer_media_t media_source );
303 virtual ~LLWebBrowserTexture(); 173 virtual ~LLWebBrowserTexture();
304 174
305 virtual BOOL needsRender(); 175 virtual BOOL needsRender();
@@ -307,20 +177,25 @@ class LLWebBrowserTexture : public LLDynamicTexture
307 virtual void postRender( BOOL success ) {}; 177 virtual void postRender( BOOL success ) {};
308 virtual BOOL render(); 178 virtual BOOL render();
309 179
310 S32 getBrowserWidth(); 180 bool adjustSize();
311 S32 getBrowserHeight(); 181 S32 getMediaWidth();
182 S32 getMediaHeight();
183 bool getNeedsUpdate();
312 void setNeedsUpdate(); 184 void setNeedsUpdate();
185 bool getTextureCoordsOpenGL();
313 186
314 void resize( S32 new_width, S32 new_height ); 187 void resize( S32 new_width, S32 new_height );
188 bool updateBrowserTexture();
315 189
316 protected: 190 protected:
317 S32 mBrowserWidth; 191 S32 mMediaWidth;
318 S32 mBrowserHeight; 192 S32 mMediaHeight;
319 S32 mLastBrowserDepth;
320 bool mNeedsUpdate; 193 bool mNeedsUpdate;
194 bool mNeedsResize;
195 bool mTextureCoordsOpenGL;
321 LLFrameTimer mElapsedTime; 196 LLFrameTimer mElapsedTime;
322 LLWebBrowserCtrl* mWebBrowserCtrl; 197 LLMediaCtrl* mWebBrowserCtrl;
323 LLMediaBase *mMediaSource; 198 viewer_media_t mMediaSource;
324}; 199};
325 200
326#endif // LL_LLWEBBROWSERCTRL_H 201#endif // LL_LLMediaCtrl_H
diff --git a/linden/indra/newview/llmediaremotectrl.cpp b/linden/indra/newview/llmediaremotectrl.cpp
index 67cb758..48715fc 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 158
155 static LLColor4* sIconDisabledColor = rebind_llcontrol<LLColor4>("IconDisabledColor", &gColors, true); 159 static LLColor4* sIconDisabledColor = rebind_llcontrol<LLColor4>("IconDisabledColor", &gColors, true);
@@ -174,23 +178,22 @@ void LLMediaRemoteCtrl::enableMediaButtons()
174 play_media_enabled = true; 178 play_media_enabled = true;
175 media_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); 179 media_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" );
176 180
177 LLMediaBase::EStatus status = LLViewerParcelMedia::getStatus(); 181 LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus();
178 switch(status) 182 switch(status)
179 { 183 {
180 case LLMediaBase::STATUS_STOPPED: 184 case LLViewerMediaImpl::MEDIA_NONE:
181 case LLMediaBase::STATUS_UNKNOWN:
182 media_show_pause = false; 185 media_show_pause = false;
183 stop_media_enabled = false; 186 stop_media_enabled = false;
184 break; 187 break;
185 case LLMediaBase::STATUS_STARTED: 188 case LLViewerMediaImpl::MEDIA_LOADING:
186 case LLMediaBase::STATUS_NAVIGATING: 189 case LLViewerMediaImpl::MEDIA_LOADED:
187 case LLMediaBase::STATUS_RESETTING: 190 case LLViewerMediaImpl::MEDIA_PLAYING:
188 // HACK: only show the pause button for movie types 191 // HACK: only show the pause button for movie types
189 media_show_pause = LLMIMETypes::widgetType(parcel->getMediaType()) == "movie" ? true : false; 192 media_show_pause = LLMIMETypes::widgetType(parcel->getMediaType()) == "movie" ? true : false;
190 stop_media_enabled = true; 193 stop_media_enabled = true;
191 play_media_enabled = false; 194 play_media_enabled = false;
192 break; 195 break;
193 case LLMediaBase::STATUS_PAUSED: 196 case LLViewerMediaImpl::MEDIA_PAUSED:
194 media_show_pause = false; 197 media_show_pause = false;
195 stop_media_enabled = true; 198 stop_media_enabled = true;
196 break; 199 break;
@@ -205,41 +208,37 @@ void LLMediaRemoteCtrl::enableMediaButtons()
205 { 208 {
206 if ( parcel && !parcel->getMusicURL().empty()) 209 if ( parcel && !parcel->getMusicURL().empty())
207 { 210 {
211 play_music_enabled = true;
208 music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); 212 music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" );
209 213
210 if (gOverlayBar->musicPlaying()) 214 if (gOverlayBar->musicPlaying())
211 { 215 {
212 play_music_enabled = false; 216 music_show_pause = true;
213 stop_music_enabled = true; 217 stop_music_enabled = true;
214 } 218 }
215 else 219 else
216 { 220 {
217 play_music_enabled = true; 221 music_show_pause = false;
218 stop_music_enabled = false; 222 stop_music_enabled = false;
219 } 223 }
220 } 224 }
221 // if no mime type has been set disable play 225 // Don't test the mime-type: this is not updated in a consistent basis. The existence of a valid gAudiop is enough guarantee.
222 if( LLViewerMedia::getMimeType().empty()
223 || LLViewerMedia::getMimeType() == "none/none")
224 {
225 play_media_enabled = false;
226 stop_media_enabled = false;
227 }
228 } 226 }
229 const std::string media_icon_name = LLMIMETypes::findIcon(media_type); 227 const std::string media_icon_name = LLMIMETypes::findIcon(media_type);
230
231 LLButton* music_play_btn = getChild<LLButton>("music_play"); 228 LLButton* music_play_btn = getChild<LLButton>("music_play");
232 LLButton* music_stop_btn = getChild<LLButton>("music_stop"); 229 LLButton* music_stop_btn = getChild<LLButton>("music_stop");
233 230 LLButton* music_pause_btn = getChild<LLButton>("music_pause");
234 music_play_btn->setEnabled(play_music_enabled);
235 music_stop_btn->setEnabled(stop_music_enabled);
236 childSetColor("music_icon", music_icon_color);
237
238 LLButton* media_play_btn = getChild<LLButton>("media_play"); 231 LLButton* media_play_btn = getChild<LLButton>("media_play");
239 LLButton* media_stop_btn = getChild<LLButton>("media_stop"); 232 LLButton* media_stop_btn = getChild<LLButton>("media_stop");
240 LLButton* media_pause_btn = getChild<LLButton>("media_pause"); 233 LLButton* media_pause_btn = getChild<LLButton>("media_pause");
241 LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon"); 234 LLIconCtrl* media_icon = getChild<LLIconCtrl>("media_icon");
242 235
236 music_play_btn->setEnabled(play_music_enabled);
237 music_stop_btn->setEnabled(stop_music_enabled);
238 music_pause_btn->setEnabled(music_show_pause);
239 music_pause_btn->setVisible(music_show_pause);
240 music_play_btn->setVisible(! music_show_pause);
241 childSetColor("music_icon", music_icon_color);
243 if(!media_icon_name.empty()) 242 if(!media_icon_name.empty())
244 { 243 {
245 media_icon->setImage(media_icon_name); 244 media_icon->setImage(media_icon_name);
diff --git a/linden/indra/newview/llmimetypes.cpp b/linden/indra/newview/llmimetypes.cpp
index bfbc81a..c45e0ab 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
@@ -54,6 +56,24 @@ bool LLMIMETypes::parseMIMETypes(const std::string& xml_filename)
54{ 56{
55 LLXMLNodePtr root; 57 LLXMLNodePtr root;
56 bool success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root); 58 bool success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root);
59
60 if (!success)
61 {
62 // If fails, check if we can read the file from the app_settings folder
63 std::string settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, xml_filename);
64 success = LLUICtrlFactory::getLayeredXMLNode(settings_filename, root);
65
66 #if LL_WINDOWS
67 // On the windows dev builds, unpackaged, the mime_types.xml file will be located in
68 // indra/build-vc**/newview/<config>/app_settings.
69 if (!success)
70 {
71 settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "app_settings", xml_filename);
72 success = LLUICtrlFactory::getLayeredXMLNode(settings_filename, root);
73 }
74 #endif
75 }
76
57 if ( ! success || root.isNull() || ! root->hasName( "mimetypes" ) ) 77 if ( ! success || root.isNull() || ! root->hasName( "mimetypes" ) )
58 { 78 {
59 llwarns << "Unable to read MIME type file: " 79 llwarns << "Unable to read MIME type file: "
@@ -146,6 +166,8 @@ bool LLMIMETypes::parseMIMETypes(const std::string& xml_filename)
146 sWidgetMap[set_name] = info; 166 sWidgetMap[set_name] = info;
147 } 167 }
148 } 168 }
169
170 sXMLFilename = xml_filename;
149 return true; 171 return true;
150} 172}
151 173
@@ -267,3 +289,23 @@ bool LLMIMETypes::findAllowLooping(const std::string& mime_type)
267 } 289 }
268 return allow_looping; 290 return allow_looping;
269} 291}
292
293// static
294bool LLMIMETypes::isTypeHandled(const std::string& mime_type)
295{
296 mime_info_map_t::const_iterator it = sMap.find(mime_type);
297 if (it != sMap.end())
298 {
299 return true;
300 }
301 return false;
302}
303
304// static
305void LLMIMETypes::reload(void*)
306{
307 sMap.clear();
308 sWidgetMap.clear();
309 (void)LLMIMETypes::parseMIMETypes(sXMLFilename);
310}
311
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/llmutelist.cpp b/linden/indra/newview/llmutelist.cpp
index 0e03509..fff5558 100644
--- a/linden/indra/newview/llmutelist.cpp
+++ b/linden/indra/newview/llmutelist.cpp
@@ -265,7 +265,7 @@ LLMuteList::~LLMuteList()
265 // If we quit from the login screen we will not have an SL account 265 // If we quit from the login screen we will not have an SL account
266 // name. Don't try to save, otherwise we'll dump a file in 266 // name. Don't try to save, otherwise we'll dump a file in
267 // C:\Program Files\SecondLife\ JC 267 // C:\Program Files\SecondLife\ JC
268 std::string user_dir = gDirUtilp->getLindenUserDir(); 268 std::string user_dir = gDirUtilp->getLindenUserDir(true);
269 if (!user_dir.empty()) 269 if (!user_dir.empty())
270 { 270 {
271 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml"); 271 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml");
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp
index 5ca5905..ed406e8 100644
--- a/linden/indra/newview/lloverlaybar.cpp
+++ b/linden/indra/newview/lloverlaybar.cpp
@@ -38,12 +38,12 @@
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"
45#include "llchatbar.h" 45#include "llchatbar.h"
46#include "llfloaterchat.h" 46//#include "llfloaterchat.h"
47#include "llfocusmgr.h" 47#include "llfocusmgr.h"
48#include "llimview.h" 48#include "llimview.h"
49#include "llmediaremotectrl.h" 49#include "llmediaremotectrl.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
@@ -79,59 +79,10 @@ LLOverlayBar *gOverlayBar = NULL;
79 79
80extern S32 MENU_BAR_HEIGHT; 80extern S32 MENU_BAR_HEIGHT;
81 81
82
83class LLTitleObserver
84 : public LLMediaObserver
85{
86public:
87 void init(std::string url);
88 /*virtual*/ void onMediaTitleChange(const EventType& event_in);
89private:
90 LLMediaBase* mMediaSource;
91};
92
93static LLTitleObserver sTitleObserver;
94
95static LLRegisterWidget<LLMediaRemoteCtrl> r("media_remote");
96
97void LLTitleObserver::init(std::string url)
98{
99
100 if (!gAudiop)
101 {
102 return;
103 }
104
105 mMediaSource = gAudiop->getStreamMedia(); // LLViewerMedia::getSource();
106
107 if ( mMediaSource )
108 {
109 mMediaSource->addObserver(this);
110 }
111}
112
113//virtual
114void LLTitleObserver::onMediaTitleChange(const EventType& event_in)
115{
116 if ( !gSavedSettings.getBOOL("ShowStreamTitle") )
117 {
118 return;
119 }
120
121 LLChat chat;
122 //TODO: set this in XUI
123 std::string playing_msg = "Playing: " + event_in.getStringValue();
124 chat.mText = playing_msg;
125 LLFloaterChat::addChat(chat, FALSE, FALSE);
126}
127
128
129// 82//
130// Functions 83// Functions
131// 84//
132 85
133
134
135void* LLOverlayBar::createMediaRemote(void* userdata) 86void* LLOverlayBar::createMediaRemote(void* userdata)
136{ 87{
137 LLOverlayBar *self = (LLOverlayBar*)userdata; 88 LLOverlayBar *self = (LLOverlayBar*)userdata;
@@ -452,11 +403,11 @@ void LLOverlayBar::toggleMediaPlay(void*)
452 } 403 }
453 404
454 405
455 if (LLViewerMedia::isMediaPaused()) 406 if (LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PAUSED)
456 { 407 {
457 LLViewerParcelMedia::start(); 408 LLViewerParcelMedia::start();
458 } 409 }
459 else if(LLViewerMedia::isMediaPlaying()) 410 else if(LLViewerParcelMedia::getStatus() == LLViewerMediaImpl::MEDIA_PLAYING)
460 { 411 {
461 LLViewerParcelMedia::pause(); 412 LLViewerParcelMedia::pause();
462 } 413 }
@@ -497,7 +448,7 @@ void LLOverlayBar::toggleMusicPlay(void*)
497 // if ( gAudiop->isInternetStreamPlaying() == 0 ) 448 // if ( gAudiop->isInternetStreamPlaying() == 0 )
498 { 449 {
499 gAudiop->startInternetStream(parcel->getMusicURL()); 450 gAudiop->startInternetStream(parcel->getMusicURL());
500 sTitleObserver.init(parcel->getMusicURL()); 451//awfixme sTitleObserver.init(parcel->getMusicURL());
501 } 452 }
502 } 453 }
503 } 454 }
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 f4501be..e47ae2a 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"
@@ -414,14 +415,12 @@ BOOL LLPanelAvatarWeb::postBuild(void)
414 415
415 childSetControlName("auto_load","AutoLoadWebProfiles"); 416 childSetControlName("auto_load","AutoLoadWebProfiles");
416 417
417 mWebBrowser = getChild<LLWebBrowserCtrl>("profile_html"); 418 mWebBrowser = getChild<LLMediaCtrl>("profile_html");
419 mWebBrowser->addObserver(this);
418 420
419 // links open in internally 421 // links open in internally
420 mWebBrowser->setOpenInExternalBrowser( false ); 422 mWebBrowser->setOpenInExternalBrowser( false );
421 423
422 // observe browser events
423 mWebBrowser->addObserver( this );
424
425 return TRUE; 424 return TRUE;
426} 425}
427 426
@@ -480,18 +479,22 @@ LLPanelAvatarWeb::LLPanelAvatarWeb(const std::string& name, const LLRect& rect,
480 479
481LLPanelAvatarWeb::~LLPanelAvatarWeb() 480LLPanelAvatarWeb::~LLPanelAvatarWeb()
482{ 481{
483 // stop observing browser events 482}
484 if ( mWebBrowser ) 483
484void LLPanelAvatarWeb::refresh()
485{
486 if (mNavigateTo != "")
485 { 487 {
486 mWebBrowser->remObserver( this ); 488 llinfos << "Loading " << mNavigateTo << llendl;
487 }; 489 mWebBrowser->navigateTo( mNavigateTo );
490 mNavigateTo = "";
491 }
488} 492}
489 493
494
490void LLPanelAvatarWeb::enableControls(BOOL self) 495void LLPanelAvatarWeb::enableControls(BOOL self)
491{ 496{
492 childSetEnabled("url_edit",self); 497 childSetEnabled("url_edit",self);
493 childSetVisible("status_text",!self && !mHome.empty());
494 childSetText("status_text", LLStringUtil::null);
495} 498}
496 499
497void LLPanelAvatarWeb::setWebURL(std::string url) 500void LLPanelAvatarWeb::setWebURL(std::string url)
@@ -515,11 +518,8 @@ void LLPanelAvatarWeb::setWebURL(std::string url)
515 else 518 else
516 { 519 {
517 childSetVisible("profile_html",false); 520 childSetVisible("profile_html",false);
521 childSetVisible("status_text", false);
518 } 522 }
519
520 BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() );
521 childSetVisible("status_text",!own_avatar && !mHome.empty());
522
523} 523}
524 524
525// static 525// static
@@ -542,13 +542,15 @@ void LLPanelAvatarWeb::load(std::string url)
542{ 542{
543 bool have_url = (!url.empty()); 543 bool have_url = (!url.empty());
544 544
545
546 childSetVisible("profile_html", have_url);
547 childSetVisible("status_text", have_url);
548 childSetText("status_text", LLStringUtil::null);
549
545 if (have_url) 550 if (have_url)
546 { 551 {
547 llinfos << "Loading " << url << llendl; 552 mNavigateTo = url;
548 mWebBrowser->navigateTo( url );
549 } 553 }
550
551 childSetVisible("profile_html", have_url);
552} 554}
553 555
554//static 556//static
@@ -590,14 +592,22 @@ void LLPanelAvatarWeb::onCommitLoad(LLUICtrl* ctrl, void* data)
590 } 592 }
591} 593}
592 594
593void LLPanelAvatarWeb::onStatusTextChange( const EventType& eventIn ) 595void LLPanelAvatarWeb::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
594{
595 childSetText("status_text", eventIn.getStringValue() );
596}
597
598void LLPanelAvatarWeb::onLocationChange( const EventType& eventIn )
599{ 596{
600 childSetText("url_edit", eventIn.getStringValue() ); 597 switch(event)
598 {
599 case MEDIA_EVENT_STATUS_TEXT_CHANGED:
600 childSetText("status_text", self->getStatusText() );
601 break;
602
603 case MEDIA_EVENT_LOCATION_CHANGED:
604 childSetText("url_edit", self->getLocation() );
605 break;
606
607 default:
608 // Having a default case makes the compiler happy.
609 break;
610 }
601} 611}
602 612
603 613
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 2249479..d3230c8 100644
--- a/linden/indra/newview/llpanelclassified.cpp
+++ b/linden/indra/newview/llpanelclassified.cpp
@@ -146,7 +146,7 @@ public:
146 const bool from_search = true; 146 const bool from_search = true;
147 LLPanelClassified::sendClassifiedClickMessage(classified_id, "teleport", from_search); 147 LLPanelClassified::sendClassifiedClickMessage(classified_id, "teleport", from_search);
148 // Invoke teleport 148 // Invoke teleport
149 LLWebBrowserCtrl* web = NULL; 149 LLMediaCtrl* web = NULL;
150 const bool trusted_browser = true; 150 const bool trusted_browser = true;
151 return LLURLDispatcher::dispatch(url, web, trusted_browser); 151 return LLURLDispatcher::dispatch(url, web, trusted_browser);
152 } 152 }
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..11f491c 100644
--- a/linden/indra/newview/llpanellandmedia.cpp
+++ b/linden/indra/newview/llpanellandmedia.cpp
@@ -358,13 +358,21 @@ void LLPanelLandMedia::setMediaType(const std::string& mime_type)
358 358
359 std::string media_key = LLMIMETypes::widgetType(mime_type); 359 std::string media_key = LLMIMETypes::widgetType(mime_type);
360 mMediaTypeCombo->setValue(media_key); 360 mMediaTypeCombo->setValue(media_key);
361
361 childSetText("mime_type", mime_type); 362 childSetText("mime_type", mime_type);
362} 363}
363 364
364void LLPanelLandMedia::setMediaURL(const std::string& media_url) 365void LLPanelLandMedia::setMediaURL(const std::string& media_url)
365{ 366{
366 mMediaURLEdit->setText(media_url); 367 mMediaURLEdit->setText(media_url);
368 LLParcel *parcel = mParcel->getParcel();
369 if(parcel)
370 parcel->setMediaCurrentURL(media_url);
371 // LLViewerMedia::navigateHome();
372
367 mMediaURLEdit->onCommit(); 373 mMediaURLEdit->onCommit();
374// // LLViewerParcelMedia::sendMediaNavigateMessage(media_url);
375// childSetText("current_url", media_url);
368} 376}
369 377
370std::string LLPanelLandMedia::getMediaURL() 378std::string LLPanelLandMedia::getMediaURL()
@@ -452,4 +460,4 @@ void LLPanelLandMedia::onSetBtn(void *userdata)
452 { 460 {
453 parent_floater->addDependentFloater(self->mURLEntryFloater.get()); 461 parent_floater->addDependentFloater(self->mURLEntryFloater.get());
454 } 462 }
455} 463} \ No newline at end of file
diff --git a/linden/indra/newview/llpanellandmedia.h b/linden/indra/newview/llpanellandmedia.h
index 6a53dd4..845b953 100644
--- a/linden/indra/newview/llpanellandmedia.h
+++ b/linden/indra/newview/llpanellandmedia.h
@@ -82,4 +82,4 @@ private:
82 LLSafeHandle<LLParcelSelection>& mParcel; 82 LLSafeHandle<LLParcelSelection>& mParcel;
83}; 83};
84 84
85#endif 85#endif \ No newline at end of file
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index 69539c7..2a8c20f 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 8492988..5131d2c 100644
--- a/linden/indra/newview/llpanelpermissions.cpp
+++ b/linden/indra/newview/llpanelpermissions.cpp
@@ -281,7 +281,7 @@ void LLPanelPermissions::refresh()
281 BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 281 BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
282 && LLSelectMgr::getInstance()->selectGetRootsModify()) 282 && LLSelectMgr::getInstance()->selectGetRootsModify())
283 || LLSelectMgr::getInstance()->selectGetModify(); 283 || LLSelectMgr::getInstance()->selectGetModify();
284 const LLView* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); 284 const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus();
285 S32 string_index = 0; 285 S32 string_index = 0;
286 std::string MODIFY_INFO_STRINGS[] = 286 std::string MODIFY_INFO_STRINGS[] =
287 { 287 {
diff --git a/linden/indra/newview/llpanelweb.cpp b/linden/indra/newview/llpanelweb.cpp
index 38bb2d7..14df239 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");
@@ -95,7 +68,7 @@ BOOL LLPanelWeb::postBuild()
95 std::string value = gSavedSettings.getBOOL("UseExternalBrowser") ? "external" : "internal"; 68 std::string value = gSavedSettings.getBOOL("UseExternalBrowser") ? "external" : "internal";
96 childSetValue("use_external_browser", value); 69 childSetValue("use_external_browser", value);
97 70
98 childSetValue("cookies_enabled", gSavedSettings.getBOOL("CookiesEnabled")); 71 childSetValue("cookies_enabled", gSavedSettings.getBOOL("BrowserCookiesEnabled"));
99 72
100 childSetValue("web_proxy_enabled", gSavedSettings.getBOOL("BrowserProxyEnabled")); 73 childSetValue("web_proxy_enabled", gSavedSettings.getBOOL("BrowserProxyEnabled"));
101 childSetValue("web_proxy_editor", gSavedSettings.getString("BrowserProxyAddress")); 74 childSetValue("web_proxy_editor", gSavedSettings.getString("BrowserProxyAddress"));
@@ -128,7 +101,7 @@ LLPanelWeb::~LLPanelWeb()
128 101
129void LLPanelWeb::apply() 102void LLPanelWeb::apply()
130{ 103{
131 gSavedSettings.setBOOL("CookiesEnabled", childGetValue("cookies_enabled")); 104 gSavedSettings.setBOOL("BrowserCookiesEnabled", childGetValue("cookies_enabled"));
132 gSavedSettings.setBOOL("BrowserProxyEnabled", childGetValue("web_proxy_enabled")); 105 gSavedSettings.setBOOL("BrowserProxyEnabled", childGetValue("web_proxy_enabled"));
133 gSavedSettings.setString("BrowserProxyAddress", childGetValue("web_proxy_editor")); 106 gSavedSettings.setString("BrowserProxyAddress", childGetValue("web_proxy_editor"));
134 gSavedSettings.setS32("BrowserProxyPort", childGetValue("web_proxy_port")); 107 gSavedSettings.setS32("BrowserProxyPort", childGetValue("web_proxy_port"));
@@ -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)
@@ -255,4 +224,4 @@ void LLPanelWeb::onClickClear(void* user_data)
255{ 224{
256 LLPanelWeb* self = (LLPanelWeb*)user_data; 225 LLPanelWeb* self = (LLPanelWeb*)user_data;
257 self->childSetValue("world_search_editor","") ; 226 self->childSetValue("world_search_editor","") ;
258} \ No newline at end of file 227}
diff --git a/linden/indra/newview/llprefsvoice.cpp b/linden/indra/newview/llprefsvoice.cpp
index fe5446b..7c50f4a 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 FloaterVoiceLicense::getInstance()->open();
157 FloaterVoiceLicense::getInstance()->center(); 157 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 98a5d8f..d2d9ed5 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"
@@ -363,7 +363,7 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
363 // update back and forward buttons 363 // update back and forward buttons
364 LLButton* fwd_button = help_floater->getChild<LLButton>("fwd_btn"); 364 LLButton* fwd_button = help_floater->getChild<LLButton>("fwd_btn");
365 LLButton* back_button = help_floater->getChild<LLButton>("back_btn"); 365 LLButton* back_button = help_floater->getChild<LLButton>("back_btn");
366 LLWebBrowserCtrl* browser = help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 366 LLMediaCtrl* browser = help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
367 back_button->setEnabled(browser->canNavigateBack()); 367 back_button->setEnabled(browser->canNavigateBack());
368 fwd_button->setEnabled(browser->canNavigateForward()); 368 fwd_button->setEnabled(browser->canNavigateForward());
369 369
@@ -422,7 +422,7 @@ void LLScriptEdCore::setHelpPage(const std::string& help_string)
422 LLFloater* help_floater = mLiveHelpHandle.get(); 422 LLFloater* help_floater = mLiveHelpHandle.get();
423 if (!help_floater) return; 423 if (!help_floater) return;
424 424
425 LLWebBrowserCtrl* web_browser = help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 425 LLMediaCtrl* web_browser = help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
426 if (!web_browser) return; 426 if (!web_browser) return;
427 427
428 LLComboBox* history_combo = help_floater->getChild<LLComboBox>("history_combo"); 428 LLComboBox* history_combo = help_floater->getChild<LLComboBox>("history_combo");
@@ -595,7 +595,7 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata)
595 live_help_floater->childSetAction("back_btn", onClickBack, userdata); 595 live_help_floater->childSetAction("back_btn", onClickBack, userdata);
596 live_help_floater->childSetAction("fwd_btn", onClickForward, userdata); 596 live_help_floater->childSetAction("fwd_btn", onClickForward, userdata);
597 597
598 LLWebBrowserCtrl* browser = live_help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 598 LLMediaCtrl* browser = live_help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
599 browser->setAlwaysRefresh(TRUE); 599 browser->setAlwaysRefresh(TRUE);
600 600
601 LLComboBox* help_combo = live_help_floater->getChild<LLComboBox>("history_combo"); 601 LLComboBox* help_combo = live_help_floater->getChild<LLComboBox>("history_combo");
@@ -624,7 +624,7 @@ void LLScriptEdCore::onClickBack(void* userdata)
624 LLFloater* live_help_floater = corep->mLiveHelpHandle.get(); 624 LLFloater* live_help_floater = corep->mLiveHelpHandle.get();
625 if (live_help_floater) 625 if (live_help_floater)
626 { 626 {
627 LLWebBrowserCtrl* browserp = live_help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 627 LLMediaCtrl* browserp = live_help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
628 if (browserp) 628 if (browserp)
629 { 629 {
630 browserp->navigateBack(); 630 browserp->navigateBack();
@@ -639,7 +639,7 @@ void LLScriptEdCore::onClickForward(void* userdata)
639 LLFloater* live_help_floater = corep->mLiveHelpHandle.get(); 639 LLFloater* live_help_floater = corep->mLiveHelpHandle.get();
640 if (live_help_floater) 640 if (live_help_floater)
641 { 641 {
642 LLWebBrowserCtrl* browserp = live_help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 642 LLMediaCtrl* browserp = live_help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
643 if (browserp) 643 if (browserp)
644 { 644 {
645 browserp->navigateForward(); 645 browserp->navigateForward();
@@ -681,7 +681,7 @@ void LLScriptEdCore::onHelpComboCommit(LLUICtrl* ctrl, void* userdata)
681 681
682 corep->addHelpItemToHistory(help_string); 682 corep->addHelpItemToHistory(help_string);
683 683
684 LLWebBrowserCtrl* web_browser = live_help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); 684 LLMediaCtrl* web_browser = live_help_floater->getChild<LLMediaCtrl>("lsl_guide_html");
685 LLUIString url_string = gSavedSettings.getString("LSLHelpURL"); 685 LLUIString url_string = gSavedSettings.getString("LSLHelpURL");
686 url_string.setArg("[APP_DIRECTORY]", gDirUtilp->getWorkingDir()); 686 url_string.setArg("[APP_DIRECTORY]", gDirUtilp->getWorkingDir());
687 url_string.setArg("[LSL_STRING]", help_string); 687 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 5a10e98..56a1c67 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"
@@ -75,6 +76,8 @@
75#include "llviewercamera.h" 76#include "llviewercamera.h"
76#include "llviewercontrol.h" 77#include "llviewercontrol.h"
77#include "llviewerimagelist.h" 78#include "llviewerimagelist.h"
79#include "llviewermedia.h"
80#include "llviewermediafocus.h"
78#include "llviewermenu.h" 81#include "llviewermenu.h"
79#include "llviewerobject.h" 82#include "llviewerobject.h"
80#include "llviewerobjectlist.h" 83#include "llviewerobjectlist.h"
@@ -1718,7 +1721,7 @@ void LLSelectMgr::selectionSetMediaTypeAndURL(U8 media_type, const std::string&
1718 U8 media_flags = LLTextureEntry::MF_NONE; 1721 U8 media_flags = LLTextureEntry::MF_NONE;
1719 if (media_type == LLViewerObject::MEDIA_TYPE_WEB_PAGE) 1722 if (media_type == LLViewerObject::MEDIA_TYPE_WEB_PAGE)
1720 { 1723 {
1721 media_flags = LLTextureEntry::MF_WEB_PAGE; 1724 media_flags = LLTextureEntry::MF_HAS_MEDIA;
1722 } 1725 }
1723 1726
1724 struct f : public LLSelectedTEFunctor 1727 struct f : public LLSelectedTEFunctor
@@ -4923,7 +4926,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
4923 if (mSelectedObjects->getNumNodes()) 4926 if (mSelectedObjects->getNumNodes())
4924 { 4927 {
4925 LLUUID inspect_item_id = LLFloaterInspect::getSelectedUUID(); 4928 LLUUID inspect_item_id = LLFloaterInspect::getSelectedUUID();
4926 4929 LLUUID focus_item_id = LLViewerMediaFocus::getInstance()->getSelectedUUID();
4927 for (S32 pass = 0; pass < 2; pass++) 4930 for (S32 pass = 0; pass < 2; pass++)
4928 { 4931 {
4929 for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); 4932 for (LLObjectSelection::iterator iter = mSelectedObjects->begin();
@@ -4937,7 +4940,11 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
4937 { 4940 {
4938 continue; 4941 continue;
4939 } 4942 }
4940 if(objectp->getID() == inspect_item_id) 4943 if (objectp->getID() == focus_item_id)
4944 {
4945 node->renderOneSilhouette(gFocusMgr.getFocusColor());
4946 }
4947 else if(objectp->getID() == inspect_item_id)
4941 { 4948 {
4942 node->renderOneSilhouette(sHighlightInspectColor); 4949 node->renderOneSilhouette(sHighlightInspectColor);
4943 } 4950 }
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index d5adc11..49446c7 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -39,15 +39,16 @@
39#else 39#else
40# include <sys/stat.h> // mkdir() 40# include <sys/stat.h> // mkdir()
41#endif 41#endif
42 42#include "llpluginclassmediaowner.h"
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"
@@ -197,10 +199,6 @@
197#include <Security/Security.h> 199#include <Security/Security.h>
198#endif 200#endif
199 201
200#if LL_LIBXUL_ENABLED
201#include "llmozlib.h"
202#endif // LL_LIBXUL_ENABLED
203
204// [RLVa:KB] 202// [RLVa:KB]
205#include "rlvhandler.h" 203#include "rlvhandler.h"
206// [/RLVa:KB] 204// [/RLVa:KB]
@@ -683,6 +681,16 @@ bool idle_startup()
683 delete gAudiop; 681 delete gAudiop;
684 gAudiop = NULL; 682 gAudiop = NULL;
685 } 683 }
684
685 if (gAudiop)
686 {
687 // 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
688 if (NULL == gAudiop->getStreamingAudioImpl())
689 {
690 LL_INFOS("AppInit") << "Using media plugins to render streaming audio" << LL_ENDL;
691 gAudiop->setStreamingAudioImpl(new LLStreamingAudio_MediaPlugins());
692 }
693 }
686 } 694 }
687 } 695 }
688 696
@@ -768,7 +776,7 @@ bool idle_startup()
768 std::string msg = LLTrans::getString("LoginInitializingBrowser"); 776 std::string msg = LLTrans::getString("LoginInitializingBrowser");
769 set_startup_status(0.03f, msg.c_str(), gAgent.mMOTD.c_str()); 777 set_startup_status(0.03f, msg.c_str(), gAgent.mMOTD.c_str());
770 display_startup(); 778 display_startup();
771 LLViewerMedia::initBrowser(); 779 // LLViewerMedia::initBrowser();
772 780
773 LLStartUp::setStartupState( STATE_LOGIN_SHOW ); 781 LLStartUp::setStartupState( STATE_LOGIN_SHOW );
774 return FALSE; 782 return FALSE;
@@ -1820,6 +1828,10 @@ bool idle_startup()
1820 { 1828 {
1821 LL_DEBUGS("AppInitStartupState") << "STATE_WORLD_INIT" << LL_ENDL; 1829 LL_DEBUGS("AppInitStartupState") << "STATE_WORLD_INIT" << LL_ENDL;
1822 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); 1830 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD);
1831
1832 // Initialize the rest of the world.
1833 gViewerWindow->initWorldUI_postLogin();
1834
1823 gDisconnected=FALSE; 1835 gDisconnected=FALSE;
1824 display_startup(); 1836 display_startup();
1825 // We should have an agent id by this point. 1837 // We should have an agent id by this point.
@@ -2245,6 +2257,8 @@ bool idle_startup()
2245 LLStringUtil::truncate(gWindowTitle, 255); 2257 LLStringUtil::truncate(gWindowTitle, 255);
2246 gViewerWindow->getWindow()->setWindowTitle(gWindowTitle); 2258 gViewerWindow->getWindow()->setWindowTitle(gWindowTitle);
2247 } 2259 }
2260 // Inform simulator of our language preference
2261 LLAgentLanguage::update();
2248 2262
2249 // unpack thin inventory 2263 // unpack thin inventory
2250 LLUserAuth::options_t options; 2264 LLUserAuth::options_t options;
@@ -2572,9 +2586,6 @@ bool idle_startup()
2572 // JC - 7/20/2002 2586 // JC - 7/20/2002
2573 gViewerWindow->sendShapeToSim(); 2587 gViewerWindow->sendShapeToSim();
2574 2588
2575 // Inform simulator of our language preference
2576 LLAgentLanguage::update();
2577
2578 2589
2579 // Ignore stipend information for now. Money history is on the web site. 2590 // Ignore stipend information for now. Money history is on the web site.
2580 // if needed, show the L$ history window 2591 // if needed, show the L$ history window
@@ -3846,7 +3857,7 @@ void LLStartUp::multimediaInit()
3846 set_startup_status(0.42f, msg.c_str(), gAgent.mMOTD.c_str()); 3857 set_startup_status(0.42f, msg.c_str(), gAgent.mMOTD.c_str());
3847 display_startup(); 3858 display_startup();
3848 3859
3849 LLViewerMedia::initClass(); 3860 //LLViewerMedia::initClass();
3850 LLViewerParcelMedia::initClass(); 3861 LLViewerParcelMedia::initClass();
3851} 3862}
3852 3863
@@ -3855,7 +3866,7 @@ bool LLStartUp::dispatchURL()
3855 // ok, if we've gotten this far and have a startup URL 3866 // ok, if we've gotten this far and have a startup URL
3856 if (!sSLURLCommand.empty()) 3867 if (!sSLURLCommand.empty())
3857 { 3868 {
3858 LLWebBrowserCtrl* web = NULL; 3869 LLMediaCtrl* web = NULL;
3859 const bool trusted_browser = false; 3870 const bool trusted_browser = false;
3860 LLURLDispatcher::dispatch(sSLURLCommand, web, trusted_browser); 3871 LLURLDispatcher::dispatch(sSLURLCommand, web, trusted_browser);
3861 } 3872 }
@@ -3873,7 +3884,7 @@ bool LLStartUp::dispatchURL()
3873 || (dy*dy > SLOP*SLOP) ) 3884 || (dy*dy > SLOP*SLOP) )
3874 { 3885 {
3875 std::string url = LLURLSimString::getURL(); 3886 std::string url = LLURLSimString::getURL();
3876 LLWebBrowserCtrl* web = NULL; 3887 LLMediaCtrl* web = NULL;
3877 const bool trusted_browser = false; 3888 const bool trusted_browser = false;
3878 LLURLDispatcher::dispatch(url, web, trusted_browser); 3889 LLURLDispatcher::dispatch(url, web, trusted_browser);
3879 } 3890 }
diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp
index 50be146..4579100 100644
--- a/linden/indra/newview/llstatusbar.cpp
+++ b/linden/indra/newview/llstatusbar.cpp
@@ -864,7 +864,7 @@ class LLBalanceHandler : public LLCommandHandler
864public: 864public:
865 // Requires "trusted" browser/URL source 865 // Requires "trusted" browser/URL source
866 LLBalanceHandler() : LLCommandHandler("balance", true) { } 866 LLBalanceHandler() : LLCommandHandler("balance", true) { }
867 bool handle(const LLSD& tokens, const LLSD& query_map, LLWebBrowserCtrl* web) 867 bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
868 { 868 {
869 if (tokens.size() == 1 869 if (tokens.size() == 1
870 && tokens[0].asString() == "request") 870 && tokens[0].asString() == "request")
diff --git a/linden/indra/newview/llsurface.cpp b/linden/indra/newview/llsurface.cpp
index caaba05..578b565 100644
--- a/linden/indra/newview/llsurface.cpp
+++ b/linden/indra/newview/llsurface.cpp
@@ -275,6 +275,7 @@ void LLSurface::createWaterTexture()
275 *(default_texture + (i*sTextureSize/2 + j)*4 + 3) = MAX_WATER_COLOR.mV[3]; 275 *(default_texture + (i*sTextureSize/2 + j)*4 + 3) = MAX_WATER_COLOR.mV[3];
276 } 276 }
277 } 277 }
278
278 mWaterTexturep = new LLViewerImage(raw, FALSE); 279 mWaterTexturep = new LLViewerImage(raw, FALSE);
279 mWaterTexturep->dontDiscard(); 280 mWaterTexturep->dontDiscard();
280 gGL.getTexUnit(0)->bind(mWaterTexturep.get()); 281 gGL.getTexUnit(0)->bind(mWaterTexturep.get());
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 02ad008..296d1bb 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"
@@ -76,13 +77,15 @@ extern void handle_buy(void*);
76 77
77extern BOOL gDebugClicks; 78extern BOOL gDebugClicks;
78 79
80static bool handle_media_click(const LLPickInfo& info);
81static bool handle_media_hover(const LLPickInfo& info);
79static void handle_click_action_play(); 82static void handle_click_action_play();
80static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp); 83static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp);
81static ECursorType cursor_from_parcel_media(U8 click_action); 84static ECursorType cursor_from_parcel_media(U8 click_action);
82 85
83 86
84LLToolPie::LLToolPie() 87LLToolPie::LLToolPie()
85: LLTool(std::string("Select")), 88: LLTool(std::string("Pie")),
86 mPieMouseButtonDown( FALSE ), 89 mPieMouseButtonDown( FALSE ),
87 mGrabMouseButtonDown( FALSE ), 90 mGrabMouseButtonDown( FALSE ),
88 mMouseOutsideSlop( FALSE ), 91 mMouseOutsideSlop( FALSE ),
@@ -114,6 +117,10 @@ BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask)
114 return FALSE; 117 return FALSE;
115} 118}
116 119
120BOOL LLToolPie::handleScrollWheel(S32 x, S32 y, S32 clicks)
121{
122 return LLViewerMediaFocus::getInstance()->handleScrollWheel(x, y, clicks);
123}
117// static 124// static
118void LLToolPie::rightMouseCallback(const LLPickInfo& pick_info) 125void LLToolPie::rightMouseCallback(const LLPickInfo& pick_info)
119{ 126{
@@ -147,6 +154,7 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
147 } 154 }
148 } 155 }
149 156
157 gFocusMgr.setKeyboardFocus(NULL);
150 return LLTool::handleMouseDown(x, y, mask); 158 return LLTool::handleMouseDown(x, y, mask);
151 } 159 }
152 160
@@ -165,9 +173,11 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
165 parent = object->getRootEdit(); 173 parent = object->getRootEdit();
166 } 174 }
167 175
176
168 BOOL touchable = (object && object->flagHandleTouch()) 177 BOOL touchable = (object && object->flagHandleTouch())
169 || (parent && parent->flagHandleTouch()); 178 || (parent && parent->flagHandleTouch());
170 179
180
171 // If it's a left-click, and we have a special action, do it. 181 // If it's a left-click, and we have a special action, do it.
172 if (useClickAction(always_show, mask, object, parent)) 182 if (useClickAction(always_show, mask, object, parent))
173 { 183 {
@@ -199,6 +209,8 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
199 if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting) && !gSavedSettings.getBOOL("BlockClickSit")) // agent not already sitting 209 if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting) && !gSavedSettings.getBOOL("BlockClickSit")) // agent not already sitting
200 { 210 {
201 handle_sit_or_stand(); 211 handle_sit_or_stand();
212 // put focus in world when sitting on an object
213 gFocusMgr.setKeyboardFocus(NULL);
202 return TRUE; 214 return TRUE;
203 } // else nothing (fall through to touch) 215 } // else nothing (fall through to touch)
204 216
@@ -251,6 +263,14 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
251 } 263 }
252 } 264 }
253 265
266 if (!always_show && handle_media_click(mPick))
267 {
268 return FALSE;
269 }
270
271 // put focus back "in world"
272 gFocusMgr.setKeyboardFocus(NULL);
273
254 // Switch to grab tool if physical or triggerable 274 // Switch to grab tool if physical or triggerable
255 if (object && 275 if (object &&
256 !object->isAvatar() && 276 !object->isAvatar() &&
@@ -624,62 +644,68 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
624 mMouseOutsideSlop = TRUE; 644 mMouseOutsideSlop = TRUE;
625 } 645 }
626 */ 646 */
647
627 648
649 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
650
628 LLViewerObject *object = NULL; 651 LLViewerObject *object = NULL;
629 LLViewerObject *parent = NULL; 652 LLViewerObject *parent = NULL;
630 if (gHoverView) 653
631 {
632// object = gViewerWindow->getHoverPick().getObject();
633// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l 654// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l
634 // Block all special click action cursors when: 655// object = gViewerWindow->getHoverPick().getObject();
635 // - @fartouch=n restricted and the object is out of range 656 // Block all special click action cursors when:
636 // - @interact=n restricted and the object isn't a HUD attachment 657 // - @fartouch=n restricted and the object is out of range
637 const LLPickInfo& pick = gViewerWindow->getHoverPick(); 658 // - @interact=n restricted and the object isn't a HUD attachment
638 object = pick.getObject(); 659 const LLPickInfo& pick = gViewerWindow->getHoverPick();
639 if ( (object) && (rlv_handler_t::isEnabled()) && 660 object = pick.getObject();
640 ( ((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && (!gRlvHandler.canTouch(object, pick.mObjectOffset)) || 661 if ( (object) && (rlv_handler_t::isEnabled()) &&
641 ((gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (!object->isHUDAttachment())) ) ) 662 ( ((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && (!gRlvHandler.canTouch(object, pick.mObjectOffset)) ||
642 { 663 ((gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (!object->isHUDAttachment())) ) )
643 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 664 {
644 return TRUE; 665 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
645 } 666 return TRUE;
646// [/RLVa:KB]
647 } 667 }
668// [/RLVa:KB]
648 669
649 if (object) 670 if (object)
650 { 671 {
651 parent = object->getRootEdit(); 672 parent = object->getRootEdit();
652 }
653 673
654 if (object && useClickAction(FALSE, mask, object, parent)) 674 if (object && useClickAction(FALSE, mask, object, parent))
655 { 675 {
656 ECursorType cursor = cursor_from_object(object); 676 ECursorType cursor = cursor_from_object(object);
657 gViewerWindow->getWindow()->setCursor(cursor); 677 gViewerWindow->getWindow()->setCursor(cursor);
658 lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; 678 }
659 } 679 else if (handle_media_hover(gViewerWindow->getHoverPick()))
680 {
681 // cursor set by media object
682 }
660// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l 683// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l
661 else if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object)) ) 684 else if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object)) )
662 { 685 {
663 // Block showing the "grab" or "touch" cursor if we can't touch the object (@fartouch=n is handled above) 686 // Block showing the "grab" or "touch" cursor if we can't touch the object (@fartouch=n is handled above)
664 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 687 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
665 } 688 }
666// [/RLVa:KB] 689// [/RLVa:KB]
667 else if ((object && !object->isAvatar() && object->usePhysics()) 690 else if ((object && !object->isAvatar() && object->usePhysics())
668 || (parent && !parent->isAvatar() && parent->usePhysics())) 691 || (parent && !parent->isAvatar() && parent->usePhysics()))
669 { 692 {
670 gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLGRAB); 693 gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLGRAB);
671 lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; 694 }
672 } 695 else if ( (object && object->flagHandleTouch())
673 else if ( (object && object->flagHandleTouch()) 696 || (parent && parent->flagHandleTouch()))
674 || (parent && parent->flagHandleTouch())) 697 {
675 { 698 gViewerWindow->getWindow()->setCursor(UI_CURSOR_HAND);
676 gViewerWindow->getWindow()->setCursor(UI_CURSOR_HAND); 699 }
677 lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
678 } 700 }
679 else 701 else
680 { 702 {
681 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 703 // We need to clear media hover flag
682 lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; 704 if (LLViewerMediaFocus::getInstance()->getMouseOverFlag())
705 {
706 LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
707 }
708
683 } 709 }
684 710
685 return TRUE; 711 return TRUE;
@@ -861,14 +887,14 @@ static void handle_click_action_play()
861 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 887 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
862 if (!parcel) return; 888 if (!parcel) return;
863 889
864 LLMediaBase::EStatus status = LLViewerParcelMedia::getStatus(); 890 LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus();
865 switch(status) 891 switch(status)
866 { 892 {
867 case LLMediaBase::STATUS_STARTED: 893 case LLViewerMediaImpl::MEDIA_PLAYING:
868 LLViewerParcelMedia::pause(); 894 LLViewerParcelMedia::pause();
869 break; 895 break;
870 896
871 case LLMediaBase::STATUS_PAUSED: 897 case LLViewerMediaImpl::MEDIA_PAUSED:
872 LLViewerParcelMedia::start(); 898 LLViewerParcelMedia::start();
873 break; 899 break;
874 900
@@ -878,6 +904,111 @@ static void handle_click_action_play()
878 } 904 }
879} 905}
880 906
907static bool handle_media_click(const LLPickInfo& pick)
908{
909 //FIXME: how do we handle object in different parcel than us?
910 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
911 LLPointer<LLViewerObject> objectp = pick.getObject();
912
913
914 if (!parcel ||
915 objectp.isNull() ||
916 pick.mObjectFace < 0 ||
917 pick.mObjectFace >= objectp->getNumTEs())
918 {
919 LLSelectMgr::getInstance()->deselect();
920 LLViewerMediaFocus::getInstance()->clearFocus();
921
922 return false;
923 }
924
925
926
927 // HACK: This is directly referencing an impl name. BAD!
928 // This can be removed when we have a truly generic media browser that only
929 // builds an impl based on the type of url it is passed.
930
931 // is media playing on this face?
932 const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
933
934 viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(tep->getID());
935 if (tep
936 && media_impl.notNull()
937 && media_impl->hasMedia()
938 && gSavedSettings.getBOOL("MediaOnAPrimUI"))
939 {
940 LLObjectSelectionHandle selection = LLViewerMediaFocus::getInstance()->getSelection();
941 if (! selection->contains(pick.getObject(), pick.mObjectFace))
942 {
943 LLViewerMediaFocus::getInstance()->setFocusFace(TRUE, pick.getObject(), pick.mObjectFace, media_impl);
944 }
945 else
946 {
947 media_impl->mouseDown(pick.mXYCoords.mX, pick.mXYCoords.mY);
948 media_impl->mouseCapture(); // the mouse-up will happen when capture is lost
949 }
950
951 return true;
952 }
953
954 LLSelectMgr::getInstance()->deselect();
955 LLViewerMediaFocus::getInstance()->clearFocus();
956
957 return false;
958}
959
960static bool handle_media_hover(const LLPickInfo& pick)
961{
962 //FIXME: how do we handle object in different parcel than us?
963 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
964 if (!parcel) return false;
965
966 LLPointer<LLViewerObject> objectp = pick.getObject();
967
968 // Early out cases. Must clear mouse over media focus flag
969 // did not hit an object or did not hit a valid face
970 if ( objectp.isNull() ||
971 pick.mObjectFace < 0 ||
972 pick.mObjectFace >= objectp->getNumTEs() )
973 {
974 LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
975 return false;
976 }
977
978
979 // HACK: This is directly referencing an impl name. BAD!
980 // This can be removed when we have a truly generic media browser that only
981 // builds an impl based on the type of url it is passed.
982
983 // is media playing on this face?
984 const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
985 viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(tep->getID());
986 if (tep
987 && media_impl.notNull()
988 && media_impl->hasMedia()
989 && gSavedSettings.getBOOL("MediaOnAPrimUI"))
990 {
991 if(LLViewerMediaFocus::getInstance()->getFocus())
992 {
993 media_impl->mouseMove(pick.mXYCoords.mX, pick.mXYCoords.mY);
994 }
995
996 // Set mouse over flag if unset
997 if (! LLViewerMediaFocus::getInstance()->getMouseOverFlag())
998 {
999 LLSelectMgr::getInstance()->setHoverObject(objectp, pick.mObjectFace);
1000 LLViewerMediaFocus::getInstance()->setMouseOverFlag(true, media_impl);
1001 LLViewerMediaFocus::getInstance()->setPickInfo(pick);
1002 }
1003
1004 return true;
1005 }
1006 LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
1007
1008 return false;
1009}
1010
1011
881static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp) 1012static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp)
882{ 1013{
883 //FIXME: how do we handle object in different parcel than us? 1014 //FIXME: how do we handle object in different parcel than us?
@@ -892,7 +1023,7 @@ static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp)
892 if( face < 0 || face >= objectp->getNumTEs() ) return; 1023 if( face < 0 || face >= objectp->getNumTEs() ) return;
893 1024
894 // is media playing on this face? 1025 // is media playing on this face?
895 if (!LLViewerMedia::isActiveMediaTexture(objectp->getTE(face)->getID())) 1026 if (LLViewerMedia::getMediaImplFromTextureID(objectp->getTE(face)->getID()) != NULL)
896 { 1027 {
897 handle_click_action_play(); 1028 handle_click_action_play();
898 return; 1029 return;
@@ -910,10 +1041,7 @@ static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp)
910 // This can be removed when we have a truly generic media browser that only 1041 // This can be removed when we have a truly generic media browser that only
911 // builds an impl based on the type of url it is passed. 1042 // builds an impl based on the type of url it is passed.
912 1043
913 if( LLMediaManager::getInstance()->supportsMediaType( "LLMediaImplLLMozLib", media_scheme, media_type ) ) 1044 LLWeb::loadURL(media_url);
914 {
915 LLWeb::loadURL(media_url);
916 }
917} 1045}
918 1046
919static ECursorType cursor_from_parcel_media(U8 click_action) 1047static ECursorType cursor_from_parcel_media(U8 click_action)
@@ -931,19 +1059,12 @@ static ECursorType cursor_from_parcel_media(U8 click_action)
931 std::string media_type = std::string ( parcel->getMediaType() ); 1059 std::string media_type = std::string ( parcel->getMediaType() );
932 LLStringUtil::trim(media_url); 1060 LLStringUtil::trim(media_url);
933 1061
934 // Get the scheme, see if that is handled as well. 1062 open_cursor = UI_CURSOR_TOOLMEDIAOPEN;
935 LLURI uri(media_url);
936 std::string media_scheme = uri.scheme() != "" ? uri.scheme() : "http";
937
938 if( LLMediaManager::getInstance()->supportsMediaType( "LLMediaImplLLMozLib", media_scheme, media_type ) )
939 {
940 open_cursor = UI_CURSOR_TOOLMEDIAOPEN;
941 }
942 1063
943 LLMediaBase::EStatus status = LLViewerParcelMedia::getStatus(); 1064 LLViewerMediaImpl::EMediaStatus status = LLViewerParcelMedia::getStatus();
944 switch(status) 1065 switch(status)
945 { 1066 {
946 case LLMediaBase::STATUS_STARTED: 1067 case LLViewerMediaImpl::MEDIA_PLAYING:
947 return click_action == CLICK_ACTION_PLAY ? UI_CURSOR_TOOLPAUSE : open_cursor; 1068 return click_action == CLICK_ACTION_PLAY ? UI_CURSOR_TOOLPAUSE : open_cursor;
948 default: 1069 default:
949 return UI_CURSOR_TOOLPLAY; 1070 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 477dbca..52053f5 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/llurlhistory.cpp b/linden/indra/newview/llurlhistory.cpp
index fbd14bc..b187f3b 100644
--- a/linden/indra/newview/llurlhistory.cpp
+++ b/linden/indra/newview/llurlhistory.cpp
@@ -74,7 +74,7 @@ bool LLURLHistory::loadFile(const std::string& filename)
74// static 74// static
75bool LLURLHistory::saveFile(const std::string& filename) 75bool LLURLHistory::saveFile(const std::string& filename)
76{ 76{
77 std::string temp_str = gDirUtilp->getLindenUserDir(); 77 std::string temp_str = gDirUtilp->getLindenUserDir(true);
78 if( temp_str.empty() ) 78 if( temp_str.empty() )
79 { 79 {
80 llwarns << "Can't save " << filename 80 llwarns << "Can't save " << filename
diff --git a/linden/indra/newview/llvieweraudio.cpp b/linden/indra/newview/llvieweraudio.cpp
index 672836d..91e7ce5 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"
@@ -134,7 +134,6 @@ void audio_update_volume(bool force_update)
134 gAudiop->setMasterGain ( master_volume ); 134 gAudiop->setMasterGain ( master_volume );
135 135
136 gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler")); 136 gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler"));
137 gAudiop->setDistanceFactor(gSavedSettings.getF32("AudioLevelDistance"));
138 gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff")); 137 gAudiop->setRolloffFactor(gSavedSettings.getF32("AudioLevelRolloff"));
139 138
140 if(wind_muted == false) 139 if(wind_muted == false)
diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp
index 88ea904..3675072 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{
@@ -661,7 +645,6 @@ void settings_setup_listeners()
661 gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); 645 gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
662 gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); 646 gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
663 gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); 647 gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1));
664 gSavedSettings.getControl("MediaDebugLevel")->getSignal()->connect(boost::bind(&handleMediaDebugLevelChanged, _1));
665 gSavedSettings.getControl("SliderScrollWheelMultiplier")->getSignal()->connect(boost::bind(&handleSliderScrollWheelMultiplierChanged, _1)); 648 gSavedSettings.getControl("SliderScrollWheelMultiplier")->getSignal()->connect(boost::bind(&handleSliderScrollWheelMultiplierChanged, _1));
666 gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1)); 649 gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1));
667} 650}
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 869c9d7..039896f 100644
--- a/linden/indra/newview/llviewerimagelist.cpp
+++ b/linden/indra/newview/llviewerimagelist.cpp
@@ -597,7 +597,7 @@ void LLViewerImageList::updateImages(F32 max_time)
597 llpushcallstacks ; 597 llpushcallstacks ;
598 if (!gNoRender && !gGLManager.mIsDisabled) 598 if (!gNoRender && !gGLManager.mIsDisabled)
599 { 599 {
600 LLViewerMedia::updateImagesMediaStreams(); 600 LLViewerMedia::updateMedia();
601 } 601 }
602 llpushcallstacks ; 602 llpushcallstacks ;
603 updateImagesUpdateStats(); 603 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..5c01b25 100644
--- a/linden/indra/newview/llviewermedia.cpp
+++ b/linden/indra/newview/llviewermedia.cpp
@@ -33,687 +33,1206 @@
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//#include "viewerversion.h"
44
45#include "llpluginclassmedia.h"
43 46
44#include "llevent.h" // LLSimpleListener 47#include "llevent.h" // LLSimpleListener
45#include "llmediamanager.h"
46#include "lluuid.h" 48#include "lluuid.h"
49#include "llkeyboard.h"
47 50
48#include <boost/bind.hpp> // for SkinFolder listener
49#include <boost/signal.hpp>
50 51
52// Merov: Temporary definitions while porting the new viewer media code to Snowglobe
53const int LEFT_BUTTON = 0;
54const int RIGHT_BUTTON = 1;
51 55
52// Implementation functions not exported into header file 56// Move this to its own file.
53class LLViewerMediaImpl 57
54 : public LLMediaObserver 58LLViewerMediaEventEmitter::~LLViewerMediaEventEmitter()
55{ 59{
56 public: 60 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 61
94 public: 62 while( iter != mObservers.end() )
63 {
64 LLViewerMediaObserver *self = *iter;
65 iter++;
66 remObserver(self);
67 }
68}
95 69
96 // a single media url with some data and an impl. 70///////////////////////////////////////////////////////////////////////////////
97 LLMediaBase* mMediaSource; 71//
98 LLUUID mMovieImageID; 72bool LLViewerMediaEventEmitter::addObserver( LLViewerMediaObserver* observer )
99 bool mMovieImageHasMips; 73{
100 std::string mMediaURL; 74 if ( ! observer )
101 std::string mMimeType; 75 return false;
102 private:
103 void initializePlaceholderImage(LLViewerImage *placeholder_image, LLMediaBase *media_source);
104};
105 76
106static LLViewerMediaImpl sViewerMediaImpl; 77 if ( std::find( mObservers.begin(), mObservers.end(), observer ) != mObservers.end() )
78 return false;
107 79
108////////////////////////////////////////////////////////////////////////////////////////// 80 mObservers.push_back( observer );
81 observer->mEmitters.push_back( this );
109 82
110void LLViewerMediaImpl::destroyMediaSource() 83 return true;
84}
85
86///////////////////////////////////////////////////////////////////////////////
87//
88bool LLViewerMediaEventEmitter::remObserver( LLViewerMediaObserver* observer )
89{
90 if ( ! observer )
91 return false;
92
93 mObservers.remove( observer );
94 observer->mEmitters.remove(this);
95
96 return true;
97}
98
99///////////////////////////////////////////////////////////////////////////////
100//
101void LLViewerMediaEventEmitter::emitEvent( LLPluginClassMedia* media, LLPluginClassMediaOwner::EMediaEvent event )
111{ 102{
112 LLMediaManager* mgr = LLMediaManager::getInstance(); 103 observerListType::iterator iter = mObservers.begin();
113 if ( mMediaSource ) 104
105 while( iter != mObservers.end() )
114 { 106 {
115 bool was_playing = LLViewerMedia::isMediaPlaying(); 107 LLViewerMediaObserver *self = *iter;
116 mMediaSource->remObserver(this); 108 ++iter;
117 mgr->destroySource( mMediaSource ); 109 self->handleMediaEvent( media, event );
110 }
111}
118 112
119 // Restore the texture 113// Move this to its own file.
120 updateMovieImage(LLUUID::null, was_playing); 114LLViewerMediaObserver::~LLViewerMediaObserver()
115{
116 std::list<LLViewerMediaEventEmitter *>::iterator iter = mEmitters.begin();
121 117
118 while( iter != mEmitters.end() )
119 {
120 LLViewerMediaEventEmitter *self = *iter;
121 iter++;
122 self->remObserver( this );
122 } 123 }
123 mMediaSource = NULL;
124} 124}
125 125
126void LLViewerMediaImpl::play(const std::string& media_url, 126
127 const std::string& mime_type, 127// Move this to its own file.
128 const LLUUID& placeholder_texture_id, 128// 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, 129// on the Panel Land Media and to discover the MIME type
130 U8 media_loop) 130class LLMimeDiscoveryResponder : public LLHTTPClient::Responder
131{ 131{
132 // first stop any previously playing media 132LOG_CLASS(LLMimeDiscoveryResponder);
133 stop(); 133public:
134 LLMimeDiscoveryResponder( viewer_media_t media_impl)
135 : mMediaImpl(media_impl),
136 mInitialized(false)
137 {}
138
134 139
135 // Save this first, as init/load below may fire events
136 mMovieImageID = placeholder_texture_id;
137 140
138 // If the mime_type passed in is different than the cached one, and 141 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. 142 {
140 if(mime_type != mMimeType && 143 std::string media_type = content["content-type"].asString();
141 ! gSavedSettings.getBOOL("AutoMimeDiscovery")) 144 std::string::size_type idx1 = media_type.find_first_of(";");
145 std::string mime_type = media_type.substr(0, idx1);
146 completeAny(status, mime_type);
147 }
148
149 virtual void error( U32 status, const std::string& reason )
142 { 150 {
143 mMimeType = mime_type; 151 // completeAny(status, "none/none");
144 } 152 }
145 LLURI url(media_url);
146 std::string scheme = url.scheme() != "" ? url.scheme() : "http";
147 153
148 LLMediaManager* mgr = LLMediaManager::getInstance(); 154 void completeAny(U32 status, const std::string& mime_type)
149 mMediaSource = mgr->createSourceFromMimeType(scheme, mMimeType );
150 if ( !mMediaSource )
151 { 155 {
152 if (mMimeType != "none/none") 156 if(!mInitialized && ! mime_type.empty())
153 { 157 {
154 llwarns << "media source create failed " << media_url 158 if (mMediaImpl->initializeMedia(mime_type))
155 << " type " << mMimeType 159 {
156 << llendl; 160 mInitialized = true;
161 mMediaImpl->play();
162 }
157 } 163 }
158 return;
159 } 164 }
160 165
161 // Store the URL and Mime Type 166 public:
162 mMediaURL = media_url; 167 viewer_media_t mMediaImpl;
168 bool mInitialized;
169};
170typedef std::list<LLViewerMediaImpl*> impl_list;
171static impl_list sViewerMediaImplList;
172
173//////////////////////////////////////////////////////////////////////////////////////////
174// LLViewerMedia
163 175
164 if ((media_width != 0) && (media_height != 0)) 176//////////////////////////////////////////////////////////////////////////////////////////
177// static
178viewer_media_t LLViewerMedia::newMediaImpl(const std::string& media_url,
179 const LLUUID& texture_id,
180 S32 media_width, S32 media_height, U8 media_auto_scale,
181 U8 media_loop,
182 std::string mime_type)
183{
184 LLViewerMediaImpl* media_impl = getMediaImplFromTextureID(texture_id);
185 if(media_impl == NULL || texture_id.isNull())
165 { 186 {
166 mMediaSource->setRequestedMediaSize(media_width, media_height); 187 // Create the media impl
188 media_impl = new LLViewerMediaImpl(media_url, texture_id, media_width, media_height, media_auto_scale, media_loop, mime_type);
189 sViewerMediaImplList.push_back(media_impl);
167 } 190 }
168 191 else
169 mMediaSource->setLooping(media_loop); 192 {
170 mMediaSource->setAutoScaled(media_auto_scale); 193 media_impl->stop();
171 mMediaSource->addObserver( this ); 194 media_impl->mTextureId = texture_id;
172 mMediaSource->navigateTo( media_url ); 195 media_impl->mMediaURL = media_url;
173 mMediaSource->addCommand(LLMediaBase::COMMAND_START); 196 media_impl->mMediaWidth = media_width;
197 media_impl->mMediaHeight = media_height;
198 media_impl->mMediaAutoScale = media_auto_scale;
199 media_impl->mMediaLoop = media_loop;
200 if(! media_url.empty())
201 media_impl->navigateTo(media_url, mime_type, true);
202 }
203 return media_impl;
174} 204}
175 205
176void LLViewerMediaImpl::stop() 206//////////////////////////////////////////////////////////////////////////////////////////
207// static
208void LLViewerMedia::removeMedia(LLViewerMediaImpl* media)
177{ 209{
178 destroyMediaSource(); 210 impl_list::iterator iter = sViewerMediaImplList.begin();
211 impl_list::iterator end = sViewerMediaImplList.end();
212
213 for(; iter != end; iter++)
214 {
215 if(media == *iter)
216 {
217 sViewerMediaImplList.erase(iter);
218 return;
219 }
220 }
179} 221}
180 222
181void LLViewerMediaImpl::pause() 223//////////////////////////////////////////////////////////////////////////////////////////
224// static
225LLViewerMediaImpl* LLViewerMedia::getMediaImplFromTextureID(const LLUUID& texture_id)
182{ 226{
183 if(mMediaSource) 227 impl_list::iterator iter = sViewerMediaImplList.begin();
228 impl_list::iterator end = sViewerMediaImplList.end();
229
230 for(; iter != end; iter++)
184 { 231 {
185 mMediaSource->addCommand(LLMediaBase::COMMAND_PAUSE); 232 LLViewerMediaImpl* media_impl = *iter;
233 if(media_impl->getMediaTextureID() == texture_id)
234 {
235 return media_impl;
236 }
186 } 237 }
238 return NULL;
187} 239}
188 240
189void LLViewerMediaImpl::start() 241//////////////////////////////////////////////////////////////////////////////////////////
242// static
243std::string LLViewerMedia::getCurrentUserAgent()
190{ 244{
191 if(mMediaSource) 245 // Don't include version, channel, or skin -- MC
246
247 // Don't use user-visible string to avoid
248 // punctuation and strange characters.
249 //std::string skin_name = gSavedSettings.getString("SkinCurrent");
250
251 // Just in case we need to check browser differences in A/B test
252 // builds.
253 //std::string channel = gSavedSettings.getString("VersionChannelName");
254
255 // append our magic version number string to the browser user agent id
256 // See the HTTP 1.0 and 1.1 specifications for allowed formats:
257 // http://www.ietf.org/rfc/rfc1945.txt section 10.15
258 // http://www.ietf.org/rfc/rfc2068.txt section 3.8
259 // This was also helpful:
260 // http://www.mozilla.org/build/revised-user-agent-strings.html
261 std::ostringstream codec;
262 codec << "SecondLife/";
263 codec << "C64 Basic V2";
264 //codec << ViewerVersion::getImpMajorVersion() << "." << ViewerVersion::getImpMinorVersion() << "." << ViewerVersion::getImpPatchVersion() << " " << ViewerVersion::getImpTestVersion();
265 //codec << " (" << channel << "; " << skin_name << " skin)";
266// llinfos << codec.str() << llendl;
267
268 return codec.str();
269}
270
271//////////////////////////////////////////////////////////////////////////////////////////
272// static
273void LLViewerMedia::updateBrowserUserAgent()
274{
275 std::string user_agent = getCurrentUserAgent();
276
277 impl_list::iterator iter = sViewerMediaImplList.begin();
278 impl_list::iterator end = sViewerMediaImplList.end();
279
280 for(; iter != end; iter++)
192 { 281 {
193 mMediaSource->addCommand(LLMediaBase::COMMAND_START); 282 LLViewerMediaImpl* pimpl = *iter;
283 if(pimpl->mMediaSource && pimpl->mMediaSource->pluginSupportsMediaBrowser())
284 {
285 pimpl->mMediaSource->setBrowserUserAgent(user_agent);
286 }
194 } 287 }
288
195} 289}
196 290
197void LLViewerMediaImpl::seek(F32 time) 291//////////////////////////////////////////////////////////////////////////////////////////
292// static
293bool LLViewerMedia::handleSkinCurrentChanged(const LLSD& /*newvalue*/)
198{ 294{
199 if(mMediaSource) 295 // gSavedSettings is already updated when this function is called.
296 updateBrowserUserAgent();
297 return true;
298}
299
300//////////////////////////////////////////////////////////////////////////////////////////
301// static
302bool LLViewerMedia::textureHasMedia(const LLUUID& texture_id)
303{
304 impl_list::iterator iter = sViewerMediaImplList.begin();
305 impl_list::iterator end = sViewerMediaImplList.end();
306
307 for(; iter != end; iter++)
200 { 308 {
201 mMediaSource->seek(time); 309 LLViewerMediaImpl* pimpl = *iter;
310 if(pimpl->getMediaTextureID() == texture_id)
311 {
312 return true;
313 }
202 } 314 }
315 return false;
203} 316}
204 317
205void LLViewerMediaImpl::setVolume(F32 volume) 318//////////////////////////////////////////////////////////////////////////////////////////
319// static
320void LLViewerMedia::setVolume(F32 volume)
206{ 321{
207 if(mMediaSource) 322 impl_list::iterator iter = sViewerMediaImplList.begin();
323 impl_list::iterator end = sViewerMediaImplList.end();
324
325 for(; iter != end; iter++)
208 { 326 {
209 mMediaSource->setVolume( volume); 327 LLViewerMediaImpl* pimpl = *iter;
328 pimpl->setVolume(volume);
210 } 329 }
211} 330}
212 331
213LLMediaBase::EStatus LLViewerMediaImpl::getStatus() 332//////////////////////////////////////////////////////////////////////////////////////////
333// static
334void LLViewerMedia::updateMedia()
214{ 335{
215 if (mMediaSource) 336 impl_list::iterator iter = sViewerMediaImplList.begin();
337 impl_list::iterator end = sViewerMediaImplList.end();
338
339 for(; iter != end; iter++)
216 { 340 {
217 return mMediaSource->getStatus(); 341 LLViewerMediaImpl* pimpl = *iter;
342 pimpl->update();
218 } 343 }
219 else 344}
345
346//////////////////////////////////////////////////////////////////////////////////////////
347// static
348void LLViewerMedia::cleanupClass()
349{
350 // This is no longer necessary, since the list is no longer smart pointers.
351#if 0
352 while(!sViewerMediaImplList.empty())
220 { 353 {
221 return LLMediaBase::STATUS_UNKNOWN; 354 sViewerMediaImplList.pop_back();
222 } 355 }
356#endif
223} 357}
224 358
225////////////////////////////////////////////////////////////////////////////////////////// 359//////////////////////////////////////////////////////////////////////////////////////////
226// static 360// LLViewerMediaImpl
227void LLViewerMediaImpl::updateMovieImage(const LLUUID& uuid, BOOL active) 361//////////////////////////////////////////////////////////////////////////////////////////
362LLViewerMediaImpl::LLViewerMediaImpl(const std::string& media_url,
363 const LLUUID& texture_id,
364 S32 media_width,
365 S32 media_height,
366 U8 media_auto_scale,
367 U8 media_loop,
368 const std::string& mime_type)
369:
370 mMediaSource( NULL ),
371 mMovieImageHasMips(false),
372 mTextureId(texture_id),
373 mMediaWidth(media_width),
374 mMediaHeight(media_height),
375 mMediaAutoScale(media_auto_scale),
376 mMediaLoop(media_loop),
377 mMediaURL(media_url),
378 mMimeType(mime_type),
379 mNeedsNewTexture(true),
380 mSuspendUpdates(false),
381 mVisible(true)
382{
383 createMediaSource();
384}
385
386//////////////////////////////////////////////////////////////////////////////////////////
387LLViewerMediaImpl::~LLViewerMediaImpl()
228{ 388{
229 // IF the media image hasn't changed, do nothing 389 if( gEditMenuHandler == this )
230 if (mMovieImageID == uuid)
231 { 390 {
232 return; 391 gEditMenuHandler = NULL;
233 } 392 }
234 // If we have changed media uuid, restore the old one 393
235 if (!mMovieImageID.isNull()) 394 destroyMediaSource();
395 LLViewerMedia::removeMedia(this);
396}
397
398//////////////////////////////////////////////////////////////////////////////////////////
399bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type)
400{
401 if((mMediaSource == NULL) || (mMimeType != mime_type))
236 { 402 {
237 LLViewerImage* oldImage = LLViewerImage::getImage( mMovieImageID ); 403 if(! initializePlugin(mime_type))
238 if (oldImage)
239 { 404 {
240 oldImage->reinit(mMovieImageHasMips); 405 LL_WARNS("Plugin") << "plugin intialization failed for mime type: " << mime_type << LL_ENDL;
241 oldImage->mIsMediaTexture = FALSE; 406 LLSD args;
407 args["MIME_TYPE"] = mime_type;
408 LLNotifications::instance().add("NoPlugin", args);
409
410 return false;
242 } 411 }
243 mMovieImageID.setNull();
244 } 412 }
245 // If the movie is playing, set the new media image 413
246 if (active && !uuid.isNull()) 414 // play();
415 return (mMediaSource != NULL);
416}
417
418//////////////////////////////////////////////////////////////////////////////////////////
419void LLViewerMediaImpl::createMediaSource()
420{
421 if(! mMediaURL.empty())
247 { 422 {
248 LLViewerImage* viewerImage = LLViewerImage::getImage( uuid ); 423 navigateTo(mMediaURL, mMimeType, true);
249 if( viewerImage ) 424 }
250 { 425 else if(! mMimeType.empty())
251 mMovieImageID = uuid; 426 {
252 // Can't use mipmaps for movies because they don't update the full image 427 initializeMedia(mMimeType);
253 mMovieImageHasMips = viewerImage->getUseMipMaps();
254 viewerImage->reinit(FALSE);
255 viewerImage->mIsMediaTexture = TRUE;
256 }
257 } 428 }
429
258} 430}
259 431
432//////////////////////////////////////////////////////////////////////////////////////////
433void LLViewerMediaImpl::destroyMediaSource()
434{
435 mNeedsNewTexture = true;
436 if(! mMediaSource)
437 {
438 return;
439 }
440 // Restore the texture
441 updateMovieImage(LLUUID::null, false);
442 delete mMediaSource;
443 mMediaSource = NULL;
444}
260 445
261////////////////////////////////////////////////////////////////////////////////////////// 446//////////////////////////////////////////////////////////////////////////////////////////
262// static 447void LLViewerMediaImpl::setMediaType(const std::string& media_type)
263void LLViewerMediaImpl::updateImagesMediaStreams()
264{ 448{
265 LLMediaManager::updateClass(); 449 mMimeType = media_type;
266} 450}
267 451
268void LLViewerMediaImpl::initializePlaceholderImage(LLViewerImage *placeholder_image, LLMediaBase *media_source) 452//////////////////////////////////////////////////////////////////////////////////////////
453/*static*/
454LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height)
269{ 455{
270 int media_width = media_source->getMediaWidth(); 456 std::string plugin_basename = LLMIMETypes::implType(media_type);
271 int media_height = media_source->getMediaHeight();
272 //int media_rowspan = media_source->getMediaRowSpan();
273 457
274 // if width & height are invalid, don't bother doing anything 458 if(plugin_basename.empty())
275 if ( media_width < 1 || media_height < 1 ) 459 {
276 return; 460 LL_WARNS("Media") << "Couldn't find plugin for media type " << media_type << LL_ENDL;
461 }
462 else
463 {
464 std::string launcher_name = gDirUtilp->getLLPluginLauncher();
465 std::string plugin_name = gDirUtilp->getLLPluginFilename(plugin_basename);
466 std::string user_data_path = gDirUtilp->getOSUserAppDir();
467 user_data_path += gDirUtilp->getDirDelimiter();
468
469 // Fix for EXT-5960 - make browser profile specific to user (cache, cookies etc.)
470 // If the linden username returned is blank, that can only mean we are
471 // at the login page displaying login Web page or Web browser test via Develop menu.
472 // In this case we just use whatever gDirUtilp->getOSUserAppDir() gives us (this
473 // is what we always used before this change)
474 std::string linden_user_dir = gDirUtilp->getLindenUserDir(true);
475 if ( ! linden_user_dir.empty() )
476 {
477 // gDirUtilp->getLindenUserDir() is whole path, not just Linden name
478 user_data_path = linden_user_dir;
479 user_data_path += gDirUtilp->getDirDelimiter();
480 }
277 481
278 llinfos << "initializing media placeholder" << llendl; 482 // See if the plugin executable exists
279 llinfos << "movie image id " << mMovieImageID << llendl; 483 llstat s;
484 if(LLFile::stat(launcher_name, &s))
485 {
486 LL_WARNS("Media") << "Couldn't find launcher at " << launcher_name << LL_ENDL;
487 }
488 else if(LLFile::stat(plugin_name, &s))
489 {
490 LL_WARNS("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL;
491 }
492 else
493 {
494 LLPluginClassMedia* media_source = new LLPluginClassMedia(owner);
495 media_source->setSize(default_width, default_height);
496 media_source->setUserDataPath(user_data_path);
497 media_source->setLanguageCode(LLUI::getLanguage());
280 498
281 int texture_width = LLMediaManager::textureWidthFromMediaWidth( media_width ); 499 // collect 'cookies enabled' setting from prefs and send to embedded browser
282 int texture_height = LLMediaManager::textureHeightFromMediaHeight( media_height ); 500 bool cookies_enabled = gSavedSettings.getBOOL( "BrowserCookiesEnabled" );
283 int texture_depth = media_source->getMediaDepth(); 501 media_source->enable_cookies( cookies_enabled );
284 502
285 // MEDIAOPT: check to see if size actually changed before doing work 503 // collect 'plugins enabled' setting from prefs and send to embedded browser
286 placeholder_image->destroyGLTexture(); 504 bool plugins_enabled = gSavedSettings.getBOOL( "BrowserPluginsEnabled" );
287 // MEDIAOPT: apparently just calling setUseMipMaps(FALSE) doesn't work? 505 media_source->setPluginsEnabled( plugins_enabled );
288 placeholder_image->reinit(FALSE); // probably not needed
289 506
290 // MEDIAOPT: seems insane that we actually have to make an imageraw then 507 // collect 'javascript enabled' setting from prefs and send to embedded browser
291 // immediately discard it 508 bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" );
292 LLPointer<LLImageRaw> raw = new LLImageRaw(texture_width, texture_height, texture_depth); 509 media_source->setJavascriptEnabled( javascript_enabled );
293 raw->clear(0x0f, 0x0f, 0x0f, 0xff);
294 int discard_level = 0;
295 510
296 // ask media source for correct GL image format constants 511 if (media_source->init(launcher_name, plugin_name, gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins")))
297 placeholder_image->setExplicitFormat(media_source->getTextureFormatInternal(), 512 {
298 media_source->getTextureFormatPrimary(), 513 return media_source;
299 media_source->getTextureFormatType()); 514 }
515 else
516 {
517 LL_WARNS("Media") << "Failed to init plugin. Destroying." << LL_ENDL;
518 delete media_source;
519 }
520 }
521 }
300 522
301 placeholder_image->createGLTexture(discard_level, raw); 523 LL_WARNS("Plugin") << "plugin intialization failed for mime type: " << media_type << LL_ENDL;
524 LLSD args;
525 args["MIME_TYPE"] = media_type;
526 LLNotifications::instance().add("NoPlugin", args);
302 527
303 // placeholder_image->setExplicitFormat() 528 return NULL;
304 placeholder_image->setUseMipMaps(FALSE); 529}
305 530
306 // MEDIAOPT: set this dynamically on play/stop 531//////////////////////////////////////////////////////////////////////////////////////////
307 placeholder_image->mIsMediaTexture = true; 532bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
308} 533{
534 if(mMediaSource)
535 {
536 // Save the previous media source's last set size before destroying it.
537 mMediaWidth = mMediaSource->getSetWidth();
538 mMediaHeight = mMediaSource->getSetHeight();
539 }
540
541 // Always delete the old media impl first.
542 destroyMediaSource();
543
544 // and unconditionally set the mime type
545 mMimeType = media_type;
309 546
547 LLPluginClassMedia* media_source = newSourceFromMediaType(media_type, this, mMediaWidth, mMediaHeight);
548
549 if (media_source)
550 {
551 media_source->setDisableTimeout(gSavedSettings.getBOOL("DebugPluginDisableTimeout"));
552 media_source->setLoop(mMediaLoop);
553 media_source->setAutoScale(mMediaAutoScale);
554 media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent());
555
556 mMediaSource = media_source;
557 return true;
558 }
310 559
560 return false;
561}
311 562
312// virtual 563void LLViewerMediaImpl::setSize(int width, int height)
313void LLViewerMediaImpl::onMediaContentsChange(const EventType& event_in) 564{
565 mMediaWidth = width;
566 mMediaHeight = height;
567 if(mMediaSource)
568 {
569 mMediaSource->setSize(width, height);
570 }
571}
572
573//////////////////////////////////////////////////////////////////////////////////////////
574void LLViewerMediaImpl::play()
314{ 575{
315 LLMediaBase* media_source = event_in.getSubject(); 576 // first stop any previously playing media
316 LLViewerImage* placeholder_image = gImageList.getImage( mMovieImageID ); 577 // stop();
317 if ((placeholder_image) && (placeholder_image->getHasGLTexture())) 578
579 // mMediaSource->addObserver( this );
580 if(mMediaSource == NULL)
318 { 581 {
319 if (placeholder_image->getUseMipMaps()) 582 if(!initializePlugin(mMimeType))
320 { 583 {
321 // bad image! NO MIPMAPS! 584 // Plugin failed initialization... should assert or something
322 initializePlaceholderImage(placeholder_image, media_source); 585 return;
323 } 586 }
587 }
588
589 // updateMovieImage(mTextureId, true);
324 590
325 U8* data = media_source->getMediaData(); 591 mMediaSource->loadURI( mMediaURL );
326 S32 x_pos = 0; 592 if(/*mMediaSource->pluginSupportsMediaTime()*/ true)
327 S32 y_pos = 0; 593 {
328 S32 width = media_source->getMediaWidth(); 594 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 } 595 }
335} 596}
336 597
598//////////////////////////////////////////////////////////////////////////////////////////
599void LLViewerMediaImpl::stop()
600{
601 if(mMediaSource)
602 {
603 mMediaSource->stop();
604 // destroyMediaSource();
605 }
606}
337 607
338// virtual 608//////////////////////////////////////////////////////////////////////////////////////////
339void LLViewerMediaImpl::onMediaSizeChange(const EventType& event_in) 609void LLViewerMediaImpl::pause()
340{ 610{
341 LLMediaBase* media_source = event_in.getSubject(); 611 if(mMediaSource)
342 LLViewerImage* placeholder_image = gImageList.getImage( mMovieImageID );
343 if (placeholder_image)
344 { 612 {
345 initializePlaceholderImage(placeholder_image, media_source); 613 mMediaSource->pause();
346 } 614 }
347 else 615}
616
617//////////////////////////////////////////////////////////////////////////////////////////
618void LLViewerMediaImpl::start()
619{
620 if(mMediaSource)
348 { 621 {
349 llinfos << "no placeholder image" << llendl; 622 mMediaSource->start();
350 } 623 }
351} 624}
352 625
626//////////////////////////////////////////////////////////////////////////////////////////
627void LLViewerMediaImpl::seek(F32 time)
628{
629 if(mMediaSource)
630 {
631 mMediaSource->seek(time);
632 }
633}
353 634
354 // Get the image we're using 635//////////////////////////////////////////////////////////////////////////////////////////
636void LLViewerMediaImpl::setVolume(F32 volume)
637{
638 if(mMediaSource)
639 {
640 mMediaSource->setVolume(volume);
641 }
642}
355 643
356 /* 644//////////////////////////////////////////////////////////////////////////////////////////
357 // update media stream if required 645void LLViewerMediaImpl::focus(bool focus)
358 LLMediaEngine* media_engine = LLMediaEngine::getInstance(); 646{
359 if (media_engine) 647 if (mMediaSource)
360 { 648 {
361 if ( media_engine->update() ) 649 // call focus just for the hell of it, even though this apopears to be a nop
362 { 650 mMediaSource->focus(focus);
363 LLUUID media_uuid = media_engine->getImageUUID(); 651 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 { 652 {
415 LLUUID media_uuid = media_engine->getImageUUID(); 653 // spoof a mouse click to *actually* pass focus
416 updateMovieImage(media_uuid, FALSE); 654 // Don't do this anymore -- it actually clicks through now.
655// mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOWN, 1, 1, 0);
656// mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, 1, 1, 0);
417 } 657 }
418 } 658 }
419 */ 659}
420
421 660
422LLUUID LLViewerMediaImpl::getMediaTextureID() 661//////////////////////////////////////////////////////////////////////////////////////////
662void LLViewerMediaImpl::mouseDown(S32 x, S32 y)
423{ 663{
424 return mMovieImageID; 664 scaleMouse(&x, &y);
665 mLastMouseX = x;
666 mLastMouseY = y;
667 if (mMediaSource)
668 {
669 mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOWN, LEFT_BUTTON, x, y, 0);
670 }
425} 671}
426 672
427// static 673//////////////////////////////////////////////////////////////////////////////////////////
428void LLViewerMediaImpl::updateBrowserUserAgent() 674void LLViewerMediaImpl::mouseUp(S32 x, S32 y)
429{ 675{
430 // Don't use user-visible string to avoid 676 scaleMouse(&x, &y);
431 // punctuation and strange characters. 677 mLastMouseX = x;
432 std::string skin_name = gSavedSettings.getString("SkinCurrent"); 678 mLastMouseY = y;
433 679 if (mMediaSource)
434 // Just in case we need to check browser differences in A/B test 680 {
435 // builds. 681 mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, LEFT_BUTTON, x, y, 0);
436 std::string channel = gSavedSettings.getString("VersionChannelName"); 682 }
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} 683}
451 684
452// static 685//////////////////////////////////////////////////////////////////////////////////////////
453bool LLViewerMediaImpl::handleSkinCurrentChanged(const LLSD& /*newvalue*/) 686void LLViewerMediaImpl::mouseMove(S32 x, S32 y)
454{ 687{
455 // gSavedSettings is already updated when this function is called. 688 scaleMouse(&x, &y);
456 updateBrowserUserAgent(); 689 mLastMouseX = x;
457 return true; 690 mLastMouseY = y;
691 if (mMediaSource)
692 {
693 mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_MOVE, LEFT_BUTTON, x, y, 0);
694 }
458} 695}
459 696
460////////////////////////////////////////////////////////////////////////////////////////// 697//////////////////////////////////////////////////////////////////////////////////////////
461// Wrapper class 698void LLViewerMediaImpl::mouseLeftDoubleClick(S32 x, S32 y)
699{
700 scaleMouse(&x, &y);
701 mLastMouseX = x;
702 mLastMouseY = y;
703 if (mMediaSource)
704 {
705 mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOUBLE_CLICK, LEFT_BUTTON, x, y, 0);
706 }
707}
708
462////////////////////////////////////////////////////////////////////////////////////////// 709//////////////////////////////////////////////////////////////////////////////////////////
710void LLViewerMediaImpl::onMouseCaptureLost()
711{
712 if (mMediaSource)
713 {
714 mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, LEFT_BUTTON, mLastMouseX, mLastMouseY, 0);
715 }
716}
463 717
718//////////////////////////////////////////////////////////////////////////////////////////
719BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask)
720{
721 // NOTE: this is called when the mouse is released when we have capture.
722 // 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.
723
724 if(hasMouseCapture())
725 {
726 // Release the mouse -- this will also send a mouseup to the media
727 gFocusMgr.setMouseCapture( FALSE );
728 }
464 729
730 return TRUE;
731}
465////////////////////////////////////////////////////////////////////////////////////////// 732//////////////////////////////////////////////////////////////////////////////////////////
466// The viewer takes a long time to load the start screen. Part of the problem 733void 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{ 734{
473 LLMediaManagerData* init_data = new LLMediaManagerData; 735 if(mMediaSource)
474 buildMediaManagerData( init_data ); 736 {
475 LLMediaManager::initBrowser( init_data ); 737 mMediaSource->loadURI( mHomeURL );
476 delete init_data; 738 }
477
478 // We use a custom user agent with viewer version and skin name.
479 LLViewerMediaImpl::updateBrowserUserAgent();
480} 739}
481 740
482////////////////////////////////////////////////////////////////////////////////////////// 741//////////////////////////////////////////////////////////////////////////////////////////
483// static 742void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type)
484void LLViewerMedia::initClass()
485{ 743{
486 // *TODO: This looks like a memory leak to me. JC 744 if(rediscover_type)
487 LLMediaManagerData* init_data = new LLMediaManagerData; 745 {
488 buildMediaManagerData( init_data );
489 LLMediaManager::initClass( init_data );
490 delete init_data;
491 746
492 LLMediaManager* mm = LLMediaManager::getInstance(); 747 LLURI uri(url);
493 LLMIMETypes::mime_info_map_t::const_iterator it; 748 std::string scheme = uri.scheme();
494 for (it = LLMIMETypes::sMap.begin(); it != LLMIMETypes::sMap.end(); ++it) 749
750 if(scheme.empty() || "http" == scheme || "https" == scheme)
751 {
752 LLHTTPClient::getHeaderOnly( url, new LLMimeDiscoveryResponder(this));
753 }
754 else if("data" == scheme || "file" == scheme || "about" == scheme)
755 {
756 // FIXME: figure out how to really discover the type for these schemes
757 // We use "data" internally for a text/html url for loading the login screen
758 if(initializeMedia("text/html"))
759 {
760 mMediaSource->loadURI( url );
761 }
762 }
763 else
764 {
765 // This catches 'rtsp://' urls
766 if(initializeMedia(scheme))
767 {
768 mMediaSource->loadURI( url );
769 }
770 }
771 }
772 else if (mMediaSource)
495 { 773 {
496 const std::string& mime_type = it->first; 774 mMediaSource->loadURI( url );
497 const LLMIMETypes::LLMIMEInfo& info = it->second;
498 mm->addMimeTypeImplNameMap( mime_type, info.mImpl );
499 } 775 }
500 776 else if(initializeMedia(mime_type) && mMediaSource)
501 LLMediaBase *impl = mm->createSourceFromMimeType("http", "audio/mpeg"); 777 {
502 if (impl) 778 mMediaSource->loadURI( url );
779 }
780 else
503 { 781 {
504 U32 level = gSavedSettings.getU32("MediaDebugLevel"); 782 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 ); 783 return;
506 } 784 }
785 mMediaURL = url;
786
507} 787}
508 788
509////////////////////////////////////////////////////////////////////////////////////////// 789//////////////////////////////////////////////////////////////////////////////////////////
510// static 790void LLViewerMediaImpl::navigateStop()
511void LLViewerMedia::buildMediaManagerData( LLMediaManagerData* init_data ) 791{
512{ 792 if(mMediaSource)
513// std::string executable_dir = std::string( arg0 ).substr( 0, std::string( arg0 ).find_last_of("\\/") ); 793 {
514// std::string component_dir = std::string( executable_dir ).substr( 0, std::string( executable_dir ).find_last_of("\\/") ); 794 mMediaSource->browse_stop();
515// component_dir = std::string( component_dir ).substr( 0, std::string( component_dir ).find_last_of("\\/") ); 795 }
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 796
558 init_data->setBrowserApplicationDir( application_dir ); 797}
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 798
566 // Users can change skins while client is running, so make sure 799//////////////////////////////////////////////////////////////////////////////////////////
567 // we pick up on changes. 800bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask)
568 gSavedSettings.getControl("SkinCurrent")->getSignal()->connect( 801{
569 boost::bind( LLViewerMediaImpl::handleSkinCurrentChanged, _1 ) ); 802 bool result = false;
803
804 if (mMediaSource)
805 {
806 // FIXME: THIS IS SO WRONG.
807 // Menu keys should be handled by the menu system and not passed to UI elements, but this is how LLTextEditor and LLLineEditor do it...
808 if( MASK_CONTROL & mask )
809 {
810 if( 'C' == key )
811 {
812 mMediaSource->copy();
813 result = true;
814 }
815 else
816 if( 'V' == key )
817 {
818 mMediaSource->paste();
819 result = true;
820 }
821 else
822 if( 'X' == key )
823 {
824 mMediaSource->cut();
825 result = true;
826 }
827 }
828
829 if(!result)
830 {
831
832 LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
833
834 result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN ,key, mask, native_key_data);
835 // Since the viewer internal event dispatching doesn't give us key-up events, simulate one here.
836 (void)mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_UP ,key, mask, native_key_data);
837 }
838 }
839
840 return result;
841}
570 842
843//////////////////////////////////////////////////////////////////////////////////////////
844bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char)
845{
846 bool result = false;
847
848 if (mMediaSource)
849 {
850 // only accept 'printable' characters, sigh...
851 if (uni_char >= 32 // discard 'control' characters
852 && uni_char != 127) // SDL thinks this is 'delete' - yuck.
853 {
854 LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
855
856 mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(FALSE), native_key_data);
857 }
858 }
859
860 return result;
571} 861}
572 862
573////////////////////////////////////////////////////////////////////////////////////////// 863//////////////////////////////////////////////////////////////////////////////////////////
574// static 864bool LLViewerMediaImpl::canNavigateForward()
575void LLViewerMedia::cleanupClass()
576{ 865{
577 stop() ; 866 BOOL result = FALSE;
578 LLMediaManager::cleanupClass(); 867 if (mMediaSource)
868 {
869 result = mMediaSource->getHistoryForwardAvailable();
870 }
871 return result;
579} 872}
580 873
581// static 874//////////////////////////////////////////////////////////////////////////////////////////
582void LLViewerMedia::play(const std::string& media_url, 875bool 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{ 876{
588 sViewerMediaImpl.play(media_url, mime_type, placeholder_texture_id, 877 BOOL result = FALSE;
589 media_width, media_height, media_auto_scale, media_loop); 878 if (mMediaSource)
879 {
880 result = mMediaSource->getHistoryBackAvailable();
881 }
882 return result;
590} 883}
591 884
592// static 885
593void LLViewerMedia::stop() 886//////////////////////////////////////////////////////////////////////////////////////////
887void LLViewerMediaImpl::updateMovieImage(const LLUUID& uuid, BOOL active)
594{ 888{
595 sViewerMediaImpl.stop(); 889 // IF the media image hasn't changed, do nothing
890 if (mTextureId == uuid)
891 {
892 return;
893 }
894 // If we have changed media uuid, restore the old one
895 if (!mTextureId.isNull())
896 {
897 LLViewerImage* oldImage = LLViewerImage::getImage( mTextureId );
898 if (oldImage)
899 {
900 oldImage->reinit(mMovieImageHasMips);
901 oldImage->mIsMediaTexture = FALSE;
902 }
903 }
904 // If the movie is playing, set the new media image
905 if (active && !uuid.isNull())
906 {
907 LLViewerImage* viewerImage = LLViewerImage::getImage( uuid );
908 if( viewerImage )
909 {
910 mTextureId = uuid;
911 // Can't use mipmaps for movies because they don't update the full image
912 mMovieImageHasMips = viewerImage->getUseMipMaps();
913 viewerImage->reinit(FALSE);
914 viewerImage->mIsMediaTexture = TRUE;
915 }
916 }
596} 917}
597 918
598// static 919//////////////////////////////////////////////////////////////////////////////////////////
599void LLViewerMedia::pause() 920void LLViewerMediaImpl::update()
600{ 921{
601 sViewerMediaImpl.pause(); 922 if(mMediaSource == NULL)
923 {
924 return;
925 }
926
927 mMediaSource->idle();
928
929 if(mMediaSource->isPluginExited())
930 {
931 destroyMediaSource();
932 return;
933 }
934
935 if(!mMediaSource->textureValid())
936 {
937 return;
938 }
939
940 if(mSuspendUpdates || !mVisible)
941 {
942 return;
943 }
944
945 LLViewerImage* placeholder_image = updatePlaceholderImage();
946
947 if(placeholder_image)
948 {
949 LLRect dirty_rect;
950 if(mMediaSource->getDirty(&dirty_rect))
951 {
952 // Constrain the dirty rect to be inside the texture
953 S32 x_pos = llmax(dirty_rect.mLeft, 0);
954 S32 y_pos = llmax(dirty_rect.mBottom, 0);
955 S32 width = llmin(dirty_rect.mRight, placeholder_image->getWidth()) - x_pos;
956 S32 height = llmin(dirty_rect.mTop, placeholder_image->getHeight()) - y_pos;
957
958 if(width > 0 && height > 0)
959 {
960
961 U8* data = mMediaSource->getBitsData();
962
963 // Offset the pixels pointer to match x_pos and y_pos
964 data += ( x_pos * mMediaSource->getTextureDepth() * mMediaSource->getBitsWidth() );
965 data += ( y_pos * mMediaSource->getTextureDepth() );
966
967 placeholder_image->setSubImage(
968 data,
969 mMediaSource->getBitsWidth(),
970 mMediaSource->getBitsHeight(),
971 x_pos,
972 y_pos,
973 width,
974 height,
975 TRUE); // force a fast update (i.e. don't call analyzeAlpha, etc.)
976
977 }
978
979 mMediaSource->resetDirty();
980 }
981 }
602} 982}
603 983
604// static 984
605void LLViewerMedia::start() 985//////////////////////////////////////////////////////////////////////////////////////////
986void LLViewerMediaImpl::updateImagesMediaStreams()
606{ 987{
607 sViewerMediaImpl.start();
608} 988}
609 989
610// static 990
611void LLViewerMedia::seek(F32 time) 991//////////////////////////////////////////////////////////////////////////////////////////
992LLViewerImage* LLViewerMediaImpl::updatePlaceholderImage()
612{ 993{
613 sViewerMediaImpl.seek(time); 994 if(mTextureId.isNull())
995 {
996 // The code that created this instance will read from the plugin's bits.
997 return NULL;
998 }
999
1000 LLViewerImage* placeholder_image = gImageList.getImage( mTextureId );
1001
1002 if (mNeedsNewTexture
1003 || placeholder_image->getUseMipMaps()
1004 || ! placeholder_image->mIsMediaTexture
1005 || placeholder_image->getWidth() != mMediaSource->getTextureWidth()
1006 || placeholder_image->getHeight() != mMediaSource->getTextureHeight())
1007 {
1008 llinfos << "initializing media placeholder" << llendl;
1009 llinfos << "movie image id " << mTextureId << llendl;
1010
1011 int texture_width = mMediaSource->getTextureWidth();
1012 int texture_height = mMediaSource->getTextureHeight();
1013 int texture_depth = mMediaSource->getTextureDepth();
1014
1015 // MEDIAOPT: check to see if size actually changed before doing work
1016 placeholder_image->destroyGLTexture();
1017 // MEDIAOPT: apparently just calling setUseMipMaps(FALSE) doesn't work?
1018 placeholder_image->reinit(FALSE); // probably not needed
1019
1020 // MEDIAOPT: seems insane that we actually have to make an imageraw then
1021 // immediately discard it
1022 LLPointer<LLImageRaw> raw = new LLImageRaw(texture_width, texture_height, texture_depth);
1023 raw->clear(0x0f, 0x0f, 0x0f, 0xff);
1024 int discard_level = 0;
1025
1026 // ask media source for correct GL image format constants
1027 placeholder_image->setExplicitFormat(mMediaSource->getTextureFormatInternal(),
1028 mMediaSource->getTextureFormatPrimary(),
1029 mMediaSource->getTextureFormatType(),
1030 mMediaSource->getTextureFormatSwapBytes());
1031
1032 placeholder_image->createGLTexture(discard_level, raw);
1033
1034 // placeholder_image->setExplicitFormat()
1035 placeholder_image->setUseMipMaps(FALSE);
1036
1037 // MEDIAOPT: set this dynamically on play/stop
1038 placeholder_image->mIsMediaTexture = true;
1039 mNeedsNewTexture = false;
1040 }
1041
1042 return placeholder_image;
614} 1043}
615 1044
616// static 1045
617void LLViewerMedia::setVolume(F32 volume) 1046//////////////////////////////////////////////////////////////////////////////////////////
1047LLUUID LLViewerMediaImpl::getMediaTextureID()
618{ 1048{
619 sViewerMediaImpl.setVolume(volume); 1049 return mTextureId;
620} 1050}
621 1051
622// static 1052//////////////////////////////////////////////////////////////////////////////////////////
623LLMediaBase::EStatus LLViewerMedia::getStatus() 1053void LLViewerMediaImpl::setVisible(bool visible)
624{ 1054{
625 return sViewerMediaImpl.getStatus(); 1055 mVisible = visible;
1056
1057 if(mVisible)
1058 {
1059 if(mMediaSource && mMediaSource->isPluginExited())
1060 {
1061 destroyMediaSource();
1062 }
1063
1064 if(!mMediaSource)
1065 {
1066 createMediaSource();
1067 }
1068 }
1069
1070 if(mMediaSource)
1071 {
1072 mMediaSource->setPriority(mVisible?LLPluginClassMedia::PRIORITY_NORMAL:LLPluginClassMedia::PRIORITY_HIDDEN);
1073 }
626} 1074}
627 1075
628////////////////////////////////////////////////////////////////////////////////////////// 1076//////////////////////////////////////////////////////////////////////////////////////////
629// static 1077void LLViewerMediaImpl::mouseCapture()
630LLUUID LLViewerMedia::getMediaTextureID()
631{ 1078{
632 return sViewerMediaImpl.getMediaTextureID(); 1079 gFocusMgr.setMouseCapture(this);
633} 1080}
634 1081
635////////////////////////////////////////////////////////////////////////////////////////// 1082//////////////////////////////////////////////////////////////////////////////////////////
636// static 1083void LLViewerMediaImpl::getTextureSize(S32 *texture_width, S32 *texture_height)
637bool LLViewerMedia::getMediaSize(S32 *media_width, S32 *media_height)
638{ 1084{
639 // make sure we're valid 1085 if(mMediaSource && mMediaSource->textureValid())
1086 {
1087 S32 real_texture_width = mMediaSource->getBitsWidth();
1088 S32 real_texture_height = mMediaSource->getBitsHeight();
640 1089
641 if ( sViewerMediaImpl.mMediaSource != NULL ) 1090 {
1091 // The "texture width" coming back from the plugin may not be a power of two (thanks to webkit).
1092 // It will be the correct "data width" to pass to setSubImage
1093 int i;
1094
1095 for(i = 1; i < real_texture_width; i <<= 1)
1096 ;
1097 *texture_width = i;
1098
1099 for(i = 1; i < real_texture_height; i <<= 1)
1100 ;
1101 *texture_height = i;
1102 }
1103
1104 }
1105 else
642 { 1106 {
643 *media_width = sViewerMediaImpl.mMediaSource->getMediaWidth(); 1107 *texture_width = 0;
644 *media_height = sViewerMediaImpl.mMediaSource->getMediaHeight(); 1108 *texture_height = 0;
645 return true;
646 } 1109 }
647 return false; 1110}
1111//////////////////////////////////////////////////////////////////////////////////////////
1112void LLViewerMediaImpl::scaleMouse(S32 *mouse_x, S32 *mouse_y)
1113{
1114#if 0
1115 S32 media_width, media_height;
1116 S32 texture_width, texture_height;
1117 getMediaSize( &media_width, &media_height );
1118 getTextureSize( &texture_width, &texture_height );
1119 S32 y_delta = texture_height - media_height;
1120
1121 *mouse_y -= y_delta;
1122#endif
648} 1123}
649 1124
650////////////////////////////////////////////////////////////////////////////////////////// 1125//////////////////////////////////////////////////////////////////////////////////////////
651// static 1126bool LLViewerMediaImpl::isMediaPlaying()
652bool LLViewerMedia::getTextureSize(S32 *texture_width, S32 *texture_height)
653{ 1127{
654 if ( sViewerMediaImpl.mMediaSource != NULL ) 1128 bool result = false;
1129
1130 if(mMediaSource)
655 { 1131 {
656 S32 media_width = sViewerMediaImpl.mMediaSource->getMediaWidth(); 1132 EMediaStatus status = mMediaSource->getStatus();
657 S32 media_height = sViewerMediaImpl.mMediaSource->getMediaHeight(); 1133 if(status == MEDIA_PLAYING || status == MEDIA_LOADING)
658 *texture_width = LLMediaManager::textureWidthFromMediaWidth( media_width ); 1134 result = true;
659 *texture_height = LLMediaManager::textureHeightFromMediaHeight( media_height );
660 return true;
661 } 1135 }
662 return false; 1136
1137 return result;
663} 1138}
1139//////////////////////////////////////////////////////////////////////////////////////////
1140bool LLViewerMediaImpl::isMediaPaused()
1141{
1142 bool result = false;
664 1143
1144 if(mMediaSource)
1145 {
1146 if(mMediaSource->getStatus() == MEDIA_PAUSED)
1147 result = true;
1148 }
1149
1150 return result;
1151}
665 1152
666////////////////////////////////////////////////////////////////////////////////////////// 1153//////////////////////////////////////////////////////////////////////////////////////////
667// static 1154//
668void LLViewerMedia::updateImagesMediaStreams() 1155bool LLViewerMediaImpl::hasMedia()
669{ 1156{
670 sViewerMediaImpl.updateImagesMediaStreams(); 1157 return mMediaSource != NULL;
671} 1158}
1159
672////////////////////////////////////////////////////////////////////////////////////////// 1160//////////////////////////////////////////////////////////////////////////////////////////
673// static 1161void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* self, LLPluginClassMediaOwner::EMediaEvent event)
674bool LLViewerMedia::isMediaPlaying()
675{ 1162{
676 LLMediaBase::EStatus status = sViewerMediaImpl.getStatus(); 1163 switch(event)
677 return (status == LLMediaBase::STATUS_STARTED ); 1164 {
1165 case MEDIA_EVENT_PLUGIN_FAILED:
1166 {
1167 LLSD args;
1168 args["PLUGIN"] = LLMIMETypes::implType(mMimeType);
1169 LLNotifications::instance().add("MediaPluginFailed", args);
1170 }
1171 break;
1172 default:
1173 break;
1174 }
1175 // Just chain the event to observers.
1176 emitEvent(self, event);
678} 1177}
679////////////////////////////////////////////////////////////////////////////////////////// 1178
680// static 1179////////////////////////////////////////////////////////////////////////////////
681bool LLViewerMedia::isMediaPaused() 1180// virtual
1181void
1182LLViewerMediaImpl::cut()
682{ 1183{
683 LLMediaBase::EStatus status = sViewerMediaImpl.getStatus(); 1184 if (mMediaSource)
684 return (status == LLMediaBase::STATUS_PAUSED); 1185 mMediaSource->cut();
685} 1186}
686////////////////////////////////////////////////////////////////////////////////////////// 1187
687// static 1188////////////////////////////////////////////////////////////////////////////////
688bool LLViewerMedia::hasMedia() 1189// virtual
1190BOOL
1191LLViewerMediaImpl::canCut() const
689{ 1192{
690 return sViewerMediaImpl.mMediaSource != NULL; 1193 if (mMediaSource)
1194 return mMediaSource->canCut();
1195 else
1196 return FALSE;
691} 1197}
692 1198
693////////////////////////////////////////////////////////////////////////////////////////// 1199////////////////////////////////////////////////////////////////////////////////
694//static 1200// virtual
695bool LLViewerMedia::isActiveMediaTexture(const LLUUID& id) 1201void
1202LLViewerMediaImpl::copy()
696{ 1203{
697 return (id.notNull() 1204 if (mMediaSource)
698 && id == getMediaTextureID() 1205 mMediaSource->copy();
699 && isMediaPlaying());
700} 1206}
701 1207
702////////////////////////////////////////////////////////////////////////////////////////// 1208////////////////////////////////////////////////////////////////////////////////
703// static 1209// virtual
704std::string LLViewerMedia::getMediaURL() 1210BOOL
1211LLViewerMediaImpl::canCopy() const
705{ 1212{
706 return sViewerMediaImpl.mMediaURL; 1213 if (mMediaSource)
1214 return mMediaSource->canCopy();
1215 else
1216 return FALSE;
707} 1217}
708////////////////////////////////////////////////////////////////////////////////////////// 1218
709// static 1219////////////////////////////////////////////////////////////////////////////////
710std::string LLViewerMedia::getMimeType() 1220// virtual
1221void
1222LLViewerMediaImpl::paste()
711{ 1223{
712 return sViewerMediaImpl.mMimeType; 1224 if (mMediaSource)
1225 mMediaSource->paste();
713} 1226}
714////////////////////////////////////////////////////////////////////////////////////////// 1227
715// static 1228////////////////////////////////////////////////////////////////////////////////
716void LLViewerMedia::setMimeType(std::string mime_type) 1229// virtual
1230BOOL
1231LLViewerMediaImpl::canPaste() const
717{ 1232{
718 sViewerMediaImpl.mMimeType = mime_type; 1233 if (mMediaSource)
1234 return mMediaSource->canPaste();
1235 else
1236 return FALSE;
719} 1237}
1238
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..575dbc8
--- /dev/null
+++ b/linden/indra/newview/llviewermedia_streamingaudio.cpp
@@ -0,0 +1,189 @@
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#include "llviewercontrol.h"
40
41#include "llviewermedia_streamingaudio.h"
42
43#include "llmimetypes.h"
44#include "llvfs.h"
45#include "lldir.h"
46
47#include "llchat.h"
48#include "llfloaterchat.h"
49
50LLStreamingAudio_MediaPlugins::LLStreamingAudio_MediaPlugins() :
51 mMediaPlugin(NULL),
52 mGain(1.0)
53{
54 // nothing interesting to do?
55 // we will lazily create a media plugin at play-time, if none exists.
56}
57
58LLStreamingAudio_MediaPlugins::~LLStreamingAudio_MediaPlugins()
59{
60 delete mMediaPlugin;
61 mMediaPlugin = NULL;
62}
63
64void LLStreamingAudio_MediaPlugins::start(const std::string& url)
65{
66 if (!mMediaPlugin) // lazy-init the underlying media plugin
67 {
68 mMediaPlugin = initializeMedia("audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis.
69 llinfos << "mMediaPlugin is now " << mMediaPlugin << llendl;
70 }
71
72 if(!mMediaPlugin)
73 return;
74
75 if (!url.empty()) {
76 llinfos << "Starting internet stream: " << url << llendl;
77 mURL = url;
78 mMediaPlugin->loadURI ( url );
79 mMediaPlugin->start();
80 llinfos << "Playing....." << llendl;
81 } else {
82 llinfos << "setting stream to NULL"<< llendl;
83 mURL.clear();
84 mMediaPlugin->stop();
85 }
86}
87
88void LLStreamingAudio_MediaPlugins::stop()
89{
90 if(mMediaPlugin)
91 {
92 mMediaPlugin->stop();
93 }
94
95 mURL.clear();
96}
97
98void LLStreamingAudio_MediaPlugins::pause(int pause)
99{
100 if(!mMediaPlugin)
101 return;
102
103 if(pause)
104 {
105 mMediaPlugin->pause();
106 }
107 else
108 {
109 mMediaPlugin->start();
110 }
111}
112
113void LLStreamingAudio_MediaPlugins::update()
114{
115 if (mMediaPlugin)
116 mMediaPlugin->idle();
117}
118
119int LLStreamingAudio_MediaPlugins::isPlaying()
120{
121 if (!mMediaPlugin)
122 return 0;
123
124 // *TODO: can probably do better than this
125 if (mMediaPlugin->isPluginRunning())
126 {
127 return 1; // Active and playing
128 }
129
130 if (mMediaPlugin->isPluginExited())
131 {
132 return 0; // stopped
133 }
134
135 return 2; // paused
136}
137
138void LLStreamingAudio_MediaPlugins::setGain(F32 vol)
139{
140 mGain = vol;
141
142 if(!mMediaPlugin)
143 return;
144
145 vol = llclamp(vol, 0.f, 1.f);
146 mMediaPlugin->setVolume(vol);
147}
148
149F32 LLStreamingAudio_MediaPlugins::getGain()
150{
151 return mGain;
152}
153
154std::string LLStreamingAudio_MediaPlugins::getURL()
155{
156 return mURL;
157}
158
159void LLStreamingAudio_MediaPlugins::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
160{
161 if (event == MEDIA_EVENT_NAME_CHANGED)
162 {
163 std::string title = self->getMediaName();
164 if (!title.empty() && gSavedSettings.getBOOL("ShowStreamTitle"))
165 {
166 //llinfos << "Playing: " << title << llendl;
167 LLChat chat;
168 //TODO: set this in XUI
169 std::string playing_msg = "Playing: " + title;
170 chat.mText = playing_msg;
171 LLFloaterChat::addChat(chat, FALSE, FALSE);
172 }
173 }
174}
175
176LLPluginClassMedia* LLStreamingAudio_MediaPlugins::initializeMedia(const std::string& media_type)
177{
178 LLPluginClassMediaOwner* owner = this;
179 S32 default_size = 1; // audio-only - be minimal, doesn't matter
180 LLPluginClassMedia* media_source = LLViewerMediaImpl::newSourceFromMediaType(media_type, owner, default_size, default_size);
181
182 if (media_source)
183 {
184 media_source->setLoop(false); // audio streams are not expected to loop
185 }
186
187 return media_source;
188}
189
diff --git a/linden/indra/newview/llviewermedia_streamingaudio.h b/linden/indra/newview/llviewermedia_streamingaudio.h
new file mode 100644
index 0000000..816e213
--- /dev/null
+++ b/linden/indra/newview/llviewermedia_streamingaudio.h
@@ -0,0 +1,73 @@
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#include "llstreamingaudio.h"
40
41class LLPluginClassMedia;
42
43class LLStreamingAudio_MediaPlugins :
44 public LLStreamingAudioInterface,
45 public LLPluginClassMediaOwner
46{
47 public:
48 LLStreamingAudio_MediaPlugins();
49 /*virtual*/ ~LLStreamingAudio_MediaPlugins();
50
51 /*virtual*/ void start(const std::string& url);
52 /*virtual*/ void stop();
53 /*virtual*/ void pause(int pause);
54 /*virtual*/ void update();
55 /*virtual*/ int isPlaying();
56 /*virtual*/ void setGain(F32 vol);
57 /*virtual*/ F32 getGain();
58 /*virtual*/ std::string getURL();
59
60 // inherited from LLPluginClassMediaOwner
61 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
62
63private:
64 LLPluginClassMedia* initializeMedia(const std::string& media_type);
65
66 LLPluginClassMedia *mMediaPlugin;
67 std::string mURL;
68 F32 mGain;
69};
70
71
72
73#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/newview/llviewermediaobserver.h b/linden/indra/newview/llviewermediaobserver.h
new file mode 100644
index 0000000..6667f98
--- /dev/null
+++ b/linden/indra/newview/llviewermediaobserver.h
@@ -0,0 +1,71 @@
1/**
2 * @file llviewermediaobserver.h
3 * @brief Methods to override to catch events from LLViewerMedia class
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-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 LLVIEWERMEDIAOBSERVER_H
34#define LLVIEWERMEDIAOBSERVER_H
35
36#include "llpluginclassmediaowner.h"
37
38class LLViewerMediaEventEmitter;
39
40class LLViewerMediaObserver : public LLPluginClassMediaOwner
41{
42public:
43 virtual ~LLViewerMediaObserver();
44
45private:
46 // Emitters will manage this list in addObserver/remObserver.
47 friend class LLViewerMediaEventEmitter;
48 std::list<LLViewerMediaEventEmitter *> mEmitters;
49};
50
51
52#if 0
53 // Classes that inherit from LLViewerMediaObserver should add this to their class declaration:
54
55 // inherited from LLViewerMediaObserver
56 /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
57
58 /* and will probably need to add this to their cpp file:
59
60 #include "llpluginclassmedia.h"
61
62 */
63
64 // The list of events is in llpluginclassmediaowner.h
65
66
67#endif
68
69
70#endif // LLVIEWERMEDIAOBSERVER_H
71
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index 524654a..308a19d 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"
@@ -935,6 +935,14 @@ void init_client_menu(LLMenuGL* menu)
935 menu->appendMenu( sub ); 935 menu->appendMenu( sub );
936 sub->createJumpKeys(); 936 sub->createJumpKeys();
937 } 937 }
938 {
939 LLMenuGL* sub = NULL;
940 sub = new LLMenuGL("Media");
941 sub->append(new LLMenuItemCallGL("Reload MIME types", &LLMIMETypes::reload));
942 sub->append(new LLMenuItemCallGL("Web Browser Test", &handle_web_browser_test));
943 menu->appendMenu( sub );
944 sub->createJumpKeys();
945 }
938 946
939 menu->appendSeparator(); 947 menu->appendSeparator();
940 948
@@ -1065,6 +1073,7 @@ void init_debug_ui_menu(LLMenuGL* menu)
1065 menu->appendSeparator(); 1073 menu->appendSeparator();
1066 1074
1067 menu->append(new LLMenuItemCallGL("Web Browser Test", &handle_web_browser_test)); 1075 menu->append(new LLMenuItemCallGL("Web Browser Test", &handle_web_browser_test));
1076
1068 // commented out until work is complete: DEV-32268 1077 // commented out until work is complete: DEV-32268
1069 // menu->append(new LLMenuItemCallGL("Buy Currency Test", &handle_buy_currency_test)); 1078 // menu->append(new LLMenuItemCallGL("Buy Currency Test", &handle_buy_currency_test));
1070 menu->append(new LLMenuItemCallGL("Editable UI", &edit_ui)); 1079 menu->append(new LLMenuItemCallGL("Editable UI", &edit_ui));
@@ -5486,6 +5495,7 @@ class LLWorldSetAway : public view_listener_t
5486 if (gAgent.getAFK()) 5495 if (gAgent.getAFK())
5487 { 5496 {
5488 gAgent.clearAFK(); 5497 gAgent.clearAFK();
5498 llinfos << "Spawning HTML help window" << llendl;
5489 } 5499 }
5490 else 5500 else
5491 { 5501 {
@@ -6062,10 +6072,10 @@ class LLShowFloater : public view_listener_t
6062 { 6072 {
6063 JCFloaterAnimList::toggleInstance(LLSD()); 6073 JCFloaterAnimList::toggleInstance(LLSD());
6064 } 6074 }
6065 else if (floater_name == "inworld browser") 6075//imprudence fixme else if (floater_name == "inworld browser")
6066 { 6076// {
6067 LLFloaterMediaBrowser::toggleInstance(LLSD()); 6077// LLFloaterMediaBrowser::toggle();
6068 } 6078// }
6069 else if (floater_name == "beacons") 6079 else if (floater_name == "beacons")
6070 { 6080 {
6071 LLFloaterBeacons::toggleInstance(LLSD()); 6081 LLFloaterBeacons::toggleInstance(LLSD());
@@ -7871,7 +7881,7 @@ void handle_grab_texture(void* data)
7871 // user know that the image is now in inventory. 7881 // user know that the image is now in inventory.
7872 if(view) 7882 if(view)
7873 { 7883 {
7874 LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); 7884 LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
7875 7885
7876 view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO); 7886 view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO);
7877 view->getPanel()->openSelected(); 7887 view->getPanel()->openSelected();
@@ -8075,13 +8085,7 @@ void handle_load_from_xml(void*)
8075 8085
8076void handle_web_browser_test(void*) 8086void handle_web_browser_test(void*)
8077{ 8087{
8078 const bool open_links_externally = false; 8088 LLWeb::loadURL("http://secondlife.com/app/search/slurls.html");
8079 const bool open_app_slurls = true;
8080 LLFloaterHtml::getInstance()->show(
8081 "http://secondlife.com/app/search/slurls.html",
8082 "Web Browser Test",
8083 open_links_externally,
8084 open_app_slurls);
8085} 8089}
8086 8090
8087void handle_buy_currency_test(void*) 8091void handle_buy_currency_test(void*)
diff --git a/linden/indra/newview/llviewermenufile.cpp b/linden/indra/newview/llviewermenufile.cpp
index 1981bb9..b88b5ca 100644
--- a/linden/indra/newview/llviewermenufile.cpp
+++ b/linden/indra/newview/llviewermenufile.cpp
@@ -67,7 +67,7 @@
67#include "llstring.h" 67#include "llstring.h"
68#include "lltransactiontypes.h" 68#include "lltransactiontypes.h"
69#include "lluuid.h" 69#include "lluuid.h"
70#include "vorbisencode.h" 70#include "llvorbisencode.h"
71 71
72// system libraries 72// system libraries
73#include <boost/tokenizer.hpp> 73#include <boost/tokenizer.hpp>
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index dbf9d72..e6455f2 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"
@@ -984,7 +984,7 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
984 LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL; 984 LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL;
985 //highlight item 985 //highlight item
986 986
987 LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); 987 LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
988 view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO); 988 view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO);
989 gFocusMgr.setKeyboardFocus(focus_ctrl); 989 gFocusMgr.setKeyboardFocus(focus_ctrl);
990 } 990 }
@@ -5261,11 +5261,11 @@ void mean_name_callback(const LLUUID &id, const std::string& first, const std::s
5261 return; 5261 return;
5262 } 5262 }
5263 5263
5264 static const int max_collision_list_size = 20; 5264 static const U32 max_collision_list_size = 20;
5265 if (gMeanCollisionList.size() > max_collision_list_size) 5265 if (gMeanCollisionList.size() > max_collision_list_size)
5266 { 5266 {
5267 mean_collision_list_t::iterator iter = gMeanCollisionList.begin(); 5267 mean_collision_list_t::iterator iter = gMeanCollisionList.begin();
5268 for (S32 i=0; i<max_collision_list_size; i++) iter++; 5268 for (U32 i=0; i<max_collision_list_size; i++) iter++;
5269 for_each(iter, gMeanCollisionList.end(), DeletePointer()); 5269 for_each(iter, gMeanCollisionList.end(), DeletePointer());
5270 gMeanCollisionList.erase(iter, gMeanCollisionList.end()); 5270 gMeanCollisionList.erase(iter, gMeanCollisionList.end());
5271 } 5271 }
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp
index 1b79cd6..a2be26a 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..d4ebbd9 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,57 @@ 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 // Debug print
223 media_loop); 197 // LL_DEBUGS("Media") << "Play media type : " << mime_type << ", url : " << media_url << LL_ENDL;
198
199 if(sMediaImpl)
200 {
201 // If the url and mime type are the same, call play again
202 if(sMediaImpl->getMediaURL() == media_url
203 && sMediaImpl->getMimeType() == mime_type
204 && sMediaImpl->getMediaTextureID() == placeholder_texture_id)
205 {
206 LL_DEBUGS("Media") << "playing with existing url " << media_url << LL_ENDL;
207
208 sMediaImpl->play();
209 }
210 // Else if the texture id's are the same, navigate and rediscover type
211 // MBW -- This causes other state from the previous parcel (texture size, autoscale, and looping) to get re-used incorrectly.
212 // It's also not really necessary -- just creating a new instance is fine.
213// else if(sMediaImpl->getMediaTextureID() == placeholder_texture_id)
214// {
215// sMediaImpl->navigateTo(media_url, mime_type, true);
216// }
217 else
218 {
219 // Since the texture id is different, we need to generate a new impl
220 LL_DEBUGS("Media") << "new media impl with mime type " << mime_type << ", url " << media_url << LL_ENDL;
221
222 // Delete the old one first so they don't fight over the texture.
223 sMediaImpl->stop();
224
225 sMediaImpl = LLViewerMedia::newMediaImpl(media_url, placeholder_texture_id,
226 media_width, media_height, media_auto_scale,
227 media_loop, mime_type);
228 }
229 }
230 else
231 {
232 // There is no media impl, make a new one
233 sMediaImpl = LLViewerMedia::newMediaImpl(media_url, placeholder_texture_id,
234 media_width, media_height, media_auto_scale,
235 media_loop, mime_type);
236 }
237
238
224 LLFirstUse::useMedia(); 239 LLFirstUse::useMedia();
225 240
226 LLViewerParcelMediaAutoPlay::playStarted(); 241 LLViewerParcelMediaAutoPlay::playStarted();
@@ -229,20 +244,38 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
229// static 244// static
230void LLViewerParcelMedia::stop() 245void LLViewerParcelMedia::stop()
231{ 246{
247 if(sMediaImpl.isNull())
248 {
249 return;
250 }
251
252 // We need to remove the media HUD if it is up.
253 LLViewerMediaFocus::getInstance()->clearFocus();
232 254
233 LLViewerMedia::stop(); 255 // This will kill the media instance.
256 sMediaImpl->stop();
257 sMediaImpl = NULL;
234} 258}
235 259
236// static 260// static
237void LLViewerParcelMedia::pause() 261void LLViewerParcelMedia::pause()
238{ 262{
239 LLViewerMedia::pause(); 263 if(sMediaImpl.isNull())
264 {
265 return;
266 }
267 sMediaImpl->pause();
240} 268}
241 269
242// static 270// static
243void LLViewerParcelMedia::start() 271void LLViewerParcelMedia::start()
244{ 272{
245 LLViewerMedia::start(); 273 if(sMediaImpl.isNull())
274 {
275 return;
276 }
277 sMediaImpl->start();
278
246 LLFirstUse::useMedia(); 279 LLFirstUse::useMedia();
247 280
248 LLViewerParcelMediaAutoPlay::playStarted(); 281 LLViewerParcelMediaAutoPlay::playStarted();
@@ -251,16 +284,41 @@ void LLViewerParcelMedia::start()
251// static 284// static
252void LLViewerParcelMedia::seek(F32 time) 285void LLViewerParcelMedia::seek(F32 time)
253{ 286{
254 LLViewerMedia::seek(time); 287 if(sMediaImpl.isNull())
288 {
289 return;
290 }
291 sMediaImpl->seek(time);
255} 292}
256 293
257
258// static 294// static
259LLMediaBase::EStatus LLViewerParcelMedia::getStatus() 295void LLViewerParcelMedia::focus(bool focus)
260{ 296{
261 return LLViewerMedia::getStatus(); 297 sMediaImpl->focus(focus);
262} 298}
263 299
300// static
301LLViewerMediaImpl::EMediaStatus LLViewerParcelMedia::getStatus()
302{
303 LLViewerMediaImpl::EMediaStatus result = LLViewerMediaImpl::MEDIA_NONE;
304
305 if(sMediaImpl.notNull() && sMediaImpl->hasMedia())
306 {
307 result = sMediaImpl->getMediaPlugin()->getStatus();
308 }
309
310 return result;
311}
312
313// static
314std::string LLViewerParcelMedia::getMimeType()
315{
316 return sMediaImpl.notNull() ? sMediaImpl->getMimeType() : "none/none";
317}
318viewer_media_t LLViewerParcelMedia::getParcelMedia()
319{
320 return sMediaImpl;
321}
264////////////////////////////////////////////////////////////////////////////////////////// 322//////////////////////////////////////////////////////////////////////////////////////////
265// static 323// static
266void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg, void ** ) 324void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg, void ** )
@@ -298,7 +356,7 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg
298 if(( command == PARCEL_MEDIA_COMMAND_PLAY ) || 356 if(( command == PARCEL_MEDIA_COMMAND_PLAY ) ||
299 ( command == PARCEL_MEDIA_COMMAND_LOOP )) 357 ( command == PARCEL_MEDIA_COMMAND_LOOP ))
300 { 358 {
301 if (LLViewerMedia::isMediaPaused()) 359 if (getStatus() == LLViewerMediaImpl::MEDIA_PAUSED)
302 { 360 {
303 start(); 361 start();
304 } 362 }
@@ -318,7 +376,7 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg
318 376
319 if (flags & (1<<PARCEL_MEDIA_COMMAND_TIME)) 377 if (flags & (1<<PARCEL_MEDIA_COMMAND_TIME))
320 { 378 {
321 if(! LLViewerMedia::hasMedia()) 379 if(sMediaImpl.isNull())
322 { 380 {
323 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 381 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
324 play(parcel); 382 play(parcel);
@@ -382,6 +440,119 @@ void LLViewerParcelMedia::processParcelMediaUpdate( LLMessageSystem *msg, void *
382 } 440 }
383 } 441 }
384} 442}
443// Static
444/////////////////////////////////////////////////////////////////////////////////////////
445void LLViewerParcelMedia::sendMediaNavigateMessage(const std::string& url)
446{
447 std::string region_url = gAgent.getRegion()->getCapability("ParcelNavigateMedia");
448 if (!region_url.empty())
449 {
450 // send navigate event to sim for link sharing
451 LLSD body;
452 body["agent-id"] = gAgent.getID();
453 body["local-id"] = LLViewerParcelMgr::getInstance()->getAgentParcel()->getLocalID();
454 body["url"] = url;
455 LLHTTPClient::post(region_url, body, new LLHTTPClient::Responder);
456 }
457 else
458 {
459 llwarns << "can't get ParcelNavigateMedia capability" << llendl;
460 }
461
462}
463
464/////////////////////////////////////////////////////////////////////////////////////////
465// inherited from LLViewerMediaObserver
466// virtual
467void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
468{
469 switch(event)
470 {
471 case MEDIA_EVENT_CONTENT_UPDATED:
472 {
473 // LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CONTENT_UPDATED " << LL_ENDL;
474 };
475 break;
476
477 case MEDIA_EVENT_TIME_DURATION_UPDATED:
478 {
479 // LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_TIME_DURATION_UPDATED, time is " << self->getCurrentTime() << " of " << self->getDuration() << LL_ENDL;
480 };
481 break;
482
483 case MEDIA_EVENT_SIZE_CHANGED:
484 {
485 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_SIZE_CHANGED " << LL_ENDL;
486 };
487 break;
488
489 case MEDIA_EVENT_CURSOR_CHANGED:
490 {
491 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CURSOR_CHANGED, new cursor is " << self->getCursorName() << LL_ENDL;
492 };
493 break;
494
495 case MEDIA_EVENT_NAVIGATE_BEGIN:
496 {
497 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_BEGIN " << LL_ENDL;
498 };
499 break;
500
501 case MEDIA_EVENT_NAVIGATE_COMPLETE:
502 {
503 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_COMPLETE, result string is: " << self->getNavigateResultString() << LL_ENDL;
504 };
505 break;
506
507 case MEDIA_EVENT_PROGRESS_UPDATED:
508 {
509 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PROGRESS_UPDATED, loading at " << self->getProgressPercent() << "%" << LL_ENDL;
510 };
511 break;
512
513 case MEDIA_EVENT_STATUS_TEXT_CHANGED:
514 {
515 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_STATUS_TEXT_CHANGED, new status text is: " << self->getStatusText() << LL_ENDL;
516 };
517 break;
518
519 case MEDIA_EVENT_LOCATION_CHANGED:
520 {
521 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_LOCATION_CHANGED, new uri is: " << self->getLocation() << LL_ENDL;
522 };
523 break;
524
525 case MEDIA_EVENT_CLICK_LINK_HREF:
526 {
527 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << self->getClickTarget() << "\", uri is " << self->getClickURL() << LL_ENDL;
528 };
529 break;
530
531 case MEDIA_EVENT_CLICK_LINK_NOFOLLOW:
532 {
533 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_NOFOLLOW, uri is " << self->getClickURL() << LL_ENDL;
534 };
535 break;
536
537 case MEDIA_EVENT_PLUGIN_FAILED:
538 {
539 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PLUGIN_FAILED" << LL_ENDL;
540 };
541 break;
542
543 case MEDIA_EVENT_PLUGIN_FAILED_LAUNCH:
544 {
545 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PLUGIN_FAILED_LAUNCH" << LL_ENDL;
546 };
547 break;
548
549 case MEDIA_EVENT_NAME_CHANGED:
550 {
551 LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAME_CHANGED" << LL_ENDL;
552 };
553 break;
554 };
555}
385 556
386bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel) 557bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel)
387{ 558{
@@ -399,3 +570,19 @@ bool callback_play_media(const LLSD& notification, const LLSD& response, LLParce
399 return false; 570 return false;
400} 571}
401 572
573// TODO: observer
574/*
575void LLViewerParcelMediaNavigationObserver::onNavigateComplete( const EventType& event_in )
576{
577 std::string url = event_in.getStringValue();
578
579 if (mCurrentURL != url && ! mFromMessage)
580 {
581 LLViewerParcelMedia::sendMediaNavigateMessage(url);
582 }
583
584 mCurrentURL = url;
585 mFromMessage = false;
586
587}
588*/
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 257ce0d..5326049 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"
@@ -1605,6 +1605,9 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
1605 // Request access list information for this land 1605 // Request access list information for this land
1606 LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN); 1606 LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN);
1607 1607
1608 // Request the media url filter list for this land
1609 LLViewerParcelMgr::getInstance()->requestParcelMediaURLFilter();
1610
1608 // Request dwell for this land, if it's not public land. 1611 // Request dwell for this land, if it's not public land.
1609 LLViewerParcelMgr::getInstance()->mSelectedDwell = 0.f; 1612 LLViewerParcelMgr::getInstance()->mSelectedDwell = 0.f;
1610 if (0 != local_id) 1613 if (0 != local_id)
@@ -1732,21 +1735,6 @@ void optionally_start_music(const std::string& music_url)
1732 } 1735 }
1733} 1736}
1734 1737
1735
1736void callback_start_music(S32 option, void* data)
1737{
1738 if (option == 0)
1739 {
1740 // Before the callback, we verified the url was good.
1741 // We fetch again to avoid lag while loading.
1742 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
1743 gAudiop->startInternetStream(parcel->getMusicURL());
1744
1745 LLOverlayBar::musicFirstRun();
1746 }
1747 gSavedSettings.setWarning("FirstStreamingMusic", FALSE);
1748}
1749
1750// static 1738// static
1751void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void **user) 1739void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void **user)
1752{ 1740{
@@ -1943,6 +1931,66 @@ void LLViewerParcelMgr::sendParcelAccessListUpdate(U32 which)
1943 } 1931 }
1944} 1932}
1945 1933
1934class LLParcelMediaURLFilterResponder : public LLHTTPClient::Responder
1935{
1936 virtual void result(const LLSD& content)
1937 {
1938 LLViewerParcelMgr::getInstance()->receiveParcelMediaURLFilter(content);
1939 }
1940};
1941
1942void LLViewerParcelMgr::requestParcelMediaURLFilter()
1943{
1944 if (!mSelected)
1945 {
1946 return;
1947 }
1948
1949 LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth );
1950 if (!region)
1951 {
1952 return;
1953 }
1954
1955 LLParcel* parcel = mCurrentParcel;
1956 if (!parcel)
1957 {
1958 llwarns << "no parcel" << llendl;
1959 return;
1960 }
1961
1962 LLSD body;
1963 body["local-id"] = parcel->getLocalID();
1964 body["list"] = parcel->getMediaURLFilterList();
1965
1966 std::string url = region->getCapability("ParcelMediaURLFilterList");
1967 if (!url.empty())
1968 {
1969 LLHTTPClient::post(url, body, new LLParcelMediaURLFilterResponder);
1970 }
1971 else
1972 {
1973 llwarns << "can't get ParcelMediaURLFilterList cap" << llendl;
1974 }
1975}
1976
1977
1978void LLViewerParcelMgr::receiveParcelMediaURLFilter(const LLSD &content)
1979{
1980 if (content.has("list"))
1981 {
1982 LLParcel* parcel = LLViewerParcelMgr::getInstance()->mCurrentParcel;
1983 if (!parcel) return;
1984
1985 if (content["local-id"].asInteger() == parcel->getLocalID())
1986 {
1987 parcel->setMediaURLFilterList(content["list"]);
1988
1989 LLViewerParcelMgr::getInstance()->notifyObservers();
1990 }
1991 }
1992}
1993
1946 1994
1947void LLViewerParcelMgr::deedLandToGroup() 1995void LLViewerParcelMgr::deedLandToGroup()
1948{ 1996{
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 4fd3bfb..77796e2 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -323,7 +323,7 @@ void LLViewerRegion::loadCache()
323 323
324 LLUUID cache_id; 324 LLUUID cache_id;
325 nread = fread(&cache_id.mData, 1, UUID_BYTES, fp); 325 nread = fread(&cache_id.mData, 1, UUID_BYTES, fp);
326 if (nread != UUID_BYTES || mCacheID != cache_id) 326 if (nread != (size_t)UUID_BYTES || mCacheID != cache_id)
327 { 327 {
328 llinfos << "Cache ID doesn't match for this region, discarding" 328 llinfos << "Cache ID doesn't match for this region, discarding"
329 << llendl; 329 << llendl;
@@ -399,7 +399,7 @@ void LLViewerRegion::saveCache()
399 } 399 }
400 400
401 // write the cache id for this sim 401 // write the cache id for this sim
402 if (fwrite(&mCacheID.mData, 1, UUID_BYTES, fp) != UUID_BYTES) 402 if (fwrite(&mCacheID.mData, 1, UUID_BYTES, fp) != (size_t)UUID_BYTES)
403 { 403 {
404 llwarns << "Short write" << llendl; 404 llwarns << "Short write" << llendl;
405 } 405 }
@@ -1429,6 +1429,8 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1429 capabilityNames.append("MapLayerGod"); 1429 capabilityNames.append("MapLayerGod");
1430 capabilityNames.append("NewFileAgentInventory"); 1430 capabilityNames.append("NewFileAgentInventory");
1431 capabilityNames.append("ParcelPropertiesUpdate"); 1431 capabilityNames.append("ParcelPropertiesUpdate");
1432 capabilityNames.append("ParcelMediaURLFilterList");
1433 capabilityNames.append("ParcelNavigateMedia");
1432 capabilityNames.append("ParcelVoiceInfoRequest"); 1434 capabilityNames.append("ParcelVoiceInfoRequest");
1433 capabilityNames.append("ProductInfoRequest"); 1435 capabilityNames.append("ProductInfoRequest");
1434 capabilityNames.append("ProvisionVoiceAccountRequest"); 1436 capabilityNames.append("ProvisionVoiceAccountRequest");
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp
index 1616b97..5d0656d 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 401e62d..920d42e 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"
@@ -316,7 +317,9 @@ public:
316 S32 hours = (S32)(time / (60*60)); 317 S32 hours = (S32)(time / (60*60));
317 S32 mins = (S32)((time - hours*(60*60)) / 60); 318 S32 mins = (S32)((time - hours*(60*60)) / 60);
318 S32 secs = (S32)((time - hours*(60*60) - mins*60)); 319 S32 secs = (S32)((time - hours*(60*60) - mins*60));
319 addText(xpos, ypos, llformat(" Debug %d: %d:%02d:%02d", idx, hours,mins,secs)); ypos += y_inc2; 320 std::string label = gDebugTimerLabel[idx];
321 if (label.empty()) label = llformat("Debug: %d", idx);
322 addText(xpos, ypos, llformat(" %s: %d:%02d:%02d", label.c_str(), hours,mins,secs)); ypos += y_inc2;
320 } 323 }
321 324
322 F32 time = gFrameTimeSeconds; 325 F32 time = gFrameTimeSeconds;
@@ -803,6 +806,7 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
803 if (handle) 806 if (handle)
804 return handle; 807 return handle;
805 808
809
806 // *HACK: this should be rolled into the composite tool logic, not 810 // *HACK: this should be rolled into the composite tool logic, not
807 // hardcoded at the top level. 811 // hardcoded at the top level.
808 if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance()) 812 if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance())
@@ -1149,7 +1153,7 @@ void LLViewerWindow::handleDataCopy(LLWindow *window, S32 data_type, void *data)
1149 case SLURL_MESSAGE_TYPE: 1153 case SLURL_MESSAGE_TYPE:
1150 // received URL 1154 // received URL
1151 std::string url = (const char*)data; 1155 std::string url = (const char*)data;
1152 LLWebBrowserCtrl* web = NULL; 1156 LLMediaCtrl* web = NULL;
1153 const bool trusted_browser = false; 1157 const bool trusted_browser = false;
1154 if (LLURLDispatcher::dispatch(url, web, trusted_browser)) 1158 if (LLURLDispatcher::dispatch(url, web, trusted_browser))
1155 { 1159 {
@@ -1672,9 +1676,64 @@ void LLViewerWindow::initWorldUI()
1672 gHoverView = new LLHoverView(std::string("gHoverView"), full_window); 1676 gHoverView = new LLHoverView(std::string("gHoverView"), full_window);
1673 gHoverView->setVisible(TRUE); 1677 gHoverView->setVisible(TRUE);
1674 mRootView->addChild(gHoverView); 1678 mRootView->addChild(gHoverView);
1675 1679
1676 gIMMgr = LLIMMgr::getInstance(); 1680 gIMMgr = LLIMMgr::getInstance();
1677 1681
1682 // Make sure we only create menus once per session -- MC
1683 if (!gMenuHolder)
1684 {
1685 init_menus();
1686 }
1687
1688 // Toolbox floater
1689 if (!gFloaterTools)
1690 {
1691 gFloaterTools = new LLFloaterTools();
1692 gFloaterTools->setVisible(FALSE);
1693 }
1694
1695 if ( gHUDView == NULL )
1696 {
1697 LLRect hud_rect = full_window;
1698 hud_rect.mBottom += 50;
1699 if (gMenuBarView)
1700 {
1701 hud_rect.mTop -= gMenuBarView->getRect().getHeight();
1702 }
1703 gHUDView = new LLHUDView(hud_rect);
1704 // put behind everything else in the UI
1705 mRootView->addChildAtEnd(gHUDView);
1706 }
1707}
1708
1709// initWorldUI that wasn't before logging in. Some of this may require the access the 'LindenUserDir'.
1710void LLViewerWindow::initWorldUI_postLogin()
1711{
1712 S32 height = mRootView->getRect().getHeight();
1713 S32 width = mRootView->getRect().getWidth();
1714 LLRect full_window(0, height, width, 0);
1715
1716 // The status base must be created before calling sendChildToFront below,
1717 // or the text of the menu (after logging in) won't be visible.
1718 if (!gStatusBar)
1719 {
1720 // Status bar
1721 S32 menu_bar_height = gMenuBarView->getRect().getHeight();
1722 LLRect root_rect = mRootView->getRect();
1723 LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height);
1724 gStatusBar = new LLStatusBar(std::string("status"), status_rect);
1725 gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP);
1726
1727 gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE);
1728 gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight());
1729 // sync bg color with menu bar
1730 gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() );
1731 mRootView->addChild(gStatusBar);
1732 }
1733
1734 // Menu holder appears on top to get first pass at all mouse events
1735 mRootView->sendChildToFront(gMenuHolder);
1736
1678 if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) 1737 if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
1679 { 1738 {
1680 LLFloaterChat::getInstance(LLSD())->loadHistory(); 1739 LLFloaterChat::getInstance(LLSD())->loadHistory();
@@ -1690,8 +1749,6 @@ void LLViewerWindow::initWorldUI()
1690 mRootView->addChild(gMorphView); 1749 mRootView->addChild(gMorphView);
1691 gMorphView->setVisible(FALSE); 1750 gMorphView->setVisible(FALSE);
1692 1751
1693 // *Note: this is where gFloaterMute used to be initialized.
1694
1695 LLWorldMapView::initClass(); 1752 LLWorldMapView::initClass();
1696 1753
1697 adjust_rect_centered_partial_zoom("FloaterWorldMapRect2", full_window); 1754 adjust_rect_centered_partial_zoom("FloaterWorldMapRect2", full_window);
@@ -1709,46 +1766,7 @@ void LLViewerWindow::initWorldUI()
1709 gFloaterTeleportHistory->setVisible(FALSE); 1766 gFloaterTeleportHistory->setVisible(FALSE);
1710 } 1767 }
1711 1768
1712 //
1713 // Tools for building
1714 //
1715
1716 // Toolbox floater
1717
1718 // Make sure we only create menus once per session -- MC
1719 if (!gMenuHolder)
1720 {
1721 init_menus();
1722 }
1723
1724 if (!gFloaterTools)
1725 {
1726 gFloaterTools = new LLFloaterTools();
1727 gFloaterTools->setVisible(FALSE);
1728 }
1729
1730 if (!gStatusBar)
1731 {
1732 // Status bar
1733 S32 menu_bar_height = gMenuBarView->getRect().getHeight();
1734 LLRect root_rect = mRootView->getRect();
1735 LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height);
1736 gStatusBar = new LLStatusBar(std::string("status"), status_rect);
1737 gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP);
1738
1739 gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE);
1740 gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight());
1741 // sync bg color with menu bar
1742 gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() );
1743 mRootView->addChild(gStatusBar);
1744 }
1745
1746 LLFloaterChatterBox::createInstance(LLSD()); 1769 LLFloaterChatterBox::createInstance(LLSD());
1747
1748
1749 // menu holder appears on top to get first pass at all mouse events
1750
1751 mRootView->sendChildToFront(gMenuHolder);
1752} 1770}
1753 1771
1754// Destroy the UI 1772// Destroy the UI
@@ -2195,7 +2213,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2195 if (key < 0x80) 2213 if (key < 0x80)
2196 { 2214 {
2197 // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first. 2215 // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first.
2198 return gFocusMgr.childHasKeyboardFocus(mRootView); 2216 return (gFocusMgr.getKeyboardFocus() != NULL);
2199 } 2217 }
2200 } 2218 }
2201 2219
@@ -2258,7 +2276,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2258 } 2276 }
2259 2277
2260 // Traverses up the hierarchy 2278 // Traverses up the hierarchy
2261 LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus(); 2279 LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
2262 if( keyboard_focus ) 2280 if( keyboard_focus )
2263 { 2281 {
2264 // arrow keys move avatar while chatting hack 2282 // arrow keys move avatar while chatting hack
@@ -2392,7 +2410,7 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
2392 } 2410 }
2393 2411
2394 // Traverses up the hierarchy 2412 // Traverses up the hierarchy
2395 LLView* keyboard_focus = gFocusMgr.getKeyboardFocus(); 2413 LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
2396 if( keyboard_focus ) 2414 if( keyboard_focus )
2397 { 2415 {
2398 if (keyboard_focus->handleUnicodeChar(uni_char, FALSE)) 2416 if (keyboard_focus->handleUnicodeChar(uni_char, FALSE))
@@ -2547,7 +2565,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
2547 } 2565 }
2548 2566
2549 // clean up current focus 2567 // clean up current focus
2550 LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); 2568 LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
2551 if (cur_focus) 2569 if (cur_focus)
2552 { 2570 {
2553 if (!cur_focus->isInVisibleChain() || !cur_focus->isInEnabledChain()) 2571 if (!cur_focus->isInVisibleChain() || !cur_focus->isInEnabledChain())
@@ -2804,7 +2822,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
2804 // snap floaters to top of chat bar/button strip 2822 // snap floaters to top of chat bar/button strip
2805 LLView* chatbar_and_buttons = gOverlayBar->getChild<LLView>("chatbar_and_buttons", TRUE); 2823 LLView* chatbar_and_buttons = gOverlayBar->getChild<LLView>("chatbar_and_buttons", TRUE);
2806 // find top of chatbar and state buttons, if either are visible 2824 // find top of chatbar and state buttons, if either are visible
2807 if (chatbar_and_buttons && !chatbar_and_buttons->getLocalBoundingRect().isNull()) 2825 if (chatbar_and_buttons && !chatbar_and_buttons->getLocalBoundingRect().isEmpty())
2808 { 2826 {
2809 // convert top/left corner of chatbar/buttons container to gFloaterView-relative coordinates 2827 // convert top/left corner of chatbar/buttons container to gFloaterView-relative coordinates
2810 S32 top, left; 2828 S32 top, left;
@@ -2930,12 +2948,18 @@ BOOL LLViewerWindow::handlePerFrameHover()
2930 { 2948 {
2931 do_pick = FALSE; 2949 do_pick = FALSE;
2932 } 2950 }
2951
2952 if(LLViewerMediaFocus::getInstance()->getFocus())
2953 {
2954 // When in-world media is in focus, pick every frame so that browser mouse-overs, dragging scrollbars, etc. work properly.
2955 do_pick = TRUE;
2956 }
2933 2957
2934 if (do_pick) 2958 if (do_pick)
2935 { 2959 {
2936 mouse_moved_since_pick = FALSE; 2960 mouse_moved_since_pick = FALSE;
2937 mPickTimer.reset(); 2961 mPickTimer.reset();
2938 pickAsync(getCurrentMouseX(), getCurrentMouseY(), mask, hoverPickCallback, TRUE); 2962 pickAsync(getCurrentMouseX(), getCurrentMouseY(), mask, hoverPickCallback, TRUE, TRUE);
2939 } 2963 }
2940 2964
2941 previous_x = x; 2965 previous_x = x;
@@ -4738,7 +4762,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size,
4738 BOOL result_first_try = FALSE; 4762 BOOL result_first_try = FALSE;
4739 BOOL result_second_try = FALSE; 4763 BOOL result_second_try = FALSE;
4740 4764
4741 LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus(); 4765 LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
4742 send_agent_pause(); 4766 send_agent_pause();
4743 llinfos << "Stopping GL during changeDisplaySettings" << llendl; 4767 llinfos << "Stopping GL during changeDisplaySettings" << llendl;
4744 stopGL(); 4768 stopGL();
@@ -4967,7 +4991,6 @@ LLBottomPanel::LLBottomPanel(const LLRect &rect) :
4967 4991
4968 mFactoryMap["toolbar"] = LLCallbackMap(createToolBar, NULL); 4992 mFactoryMap["toolbar"] = LLCallbackMap(createToolBar, NULL);
4969 mFactoryMap["overlay"] = LLCallbackMap(createOverlayBar, NULL); 4993 mFactoryMap["overlay"] = LLCallbackMap(createOverlayBar, NULL);
4970 mFactoryMap["hud"] = LLCallbackMap(createHUD, NULL);
4971 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_bars.xml", &getFactoryMap()); 4994 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_bars.xml", &getFactoryMap());
4972 4995
4973 setOrigin(rect.mLeft, rect.mBottom); 4996 setOrigin(rect.mLeft, rect.mBottom);
@@ -4990,12 +5013,6 @@ void LLBottomPanel::draw()
4990 LLPanel::draw(); 5013 LLPanel::draw();
4991} 5014}
4992 5015
4993void* LLBottomPanel::createHUD(void* data)
4994{
4995 gHUDView = new LLHUDView();
4996 return gHUDView;
4997}
4998
4999 5016
5000void* LLBottomPanel::createOverlayBar(void* data) 5017void* LLBottomPanel::createOverlayBar(void* data)
5001{ 5018{
@@ -5208,12 +5225,8 @@ void LLPickInfo::updateXYCoords()
5208 LLPointer<LLViewerImage> imagep = gImageList.getImage(tep->getID()); 5225 LLPointer<LLViewerImage> imagep = gImageList.getImage(tep->getID());
5209 if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull()) 5226 if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull())
5210 { 5227 {
5211 LLCoordGL coords; 5228 mXYCoords.mX = llround(mUVCoords.mV[VX] * (F32)imagep->getWidth());
5212 5229 mXYCoords.mY = llround((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight());
5213 coords.mX = llround(mUVCoords.mV[VX] * (F32)imagep->getWidth());
5214 coords.mY = llround(mUVCoords.mV[VY] * (F32)imagep->getHeight());
5215
5216 gViewerWindow->getWindow()->convertCoords(coords, &mXYCoords);
5217 } 5230 }
5218 } 5231 }
5219} 5232}
diff --git a/linden/indra/newview/llviewerwindow.h b/linden/indra/newview/llviewerwindow.h
index 85cdc52..d26d820 100644
--- a/linden/indra/newview/llviewerwindow.h
+++ b/linden/indra/newview/llviewerwindow.h
@@ -144,6 +144,7 @@ public:
144 void adjustRectanglesForFirstUse(const LLRect& window); 144 void adjustRectanglesForFirstUse(const LLRect& window);
145 void adjustControlRectanglesForFirstUse(const LLRect& window); 145 void adjustControlRectanglesForFirstUse(const LLRect& window);
146 void initWorldUI(); 146 void initWorldUI();
147 void initWorldUI_postLogin();
147 148
148 // 149 //
149 // LLWindowCallback interface implementation 150 // LLWindowCallback interface implementation
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index 9937ed9..f039ade 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"
@@ -3844,6 +3845,18 @@ void LLVOAvatar::idleUpdateTractorBeam()
3844 { 3845 {
3845 return; 3846 return;
3846 } 3847 }
3848 const LLPickInfo& pick = gViewerWindow->getLastPick();
3849
3850 // No beam for media textures
3851 // TODO: this will change for Media on a Prim
3852 if(pick.getObject() && pick.mObjectFace >= 0)
3853 {
3854 const LLTextureEntry* tep = pick.getObject()->getTE(pick.mObjectFace);
3855 if (tep && LLViewerMedia::textureHasMedia(tep->getID()))
3856 {
3857 return;
3858 }
3859 }
3847 3860
3848 // This is only done for yourself (maybe it should be in the agent?) 3861 // This is only done for yourself (maybe it should be in the agent?)
3849 if (!needsRenderBeam() || !mIsBuilt) 3862 if (!needsRenderBeam() || !mIsBuilt)
@@ -3954,7 +3967,7 @@ void LLVOAvatar::idleUpdateTractorBeam()
3954 } 3967 }
3955 else 3968 else
3956 { 3969 {
3957 const LLPickInfo& pick = gViewerWindow->getLastPick(); 3970
3958 mBeam->setPositionGlobal(pick.mPosGlobal); 3971 mBeam->setPositionGlobal(pick.mPosGlobal);
3959 } 3972 }
3960 3973
@@ -7447,8 +7460,7 @@ LLGLuint LLVOAvatar::getScratchTexName( LLGLenum format, U32* texture_bytes )
7447 { 7460 {
7448 case GL_LUMINANCE: components = 1; internal_format = GL_LUMINANCE8; break; 7461 case GL_LUMINANCE: components = 1; internal_format = GL_LUMINANCE8; break;
7449 case GL_ALPHA: components = 1; internal_format = GL_ALPHA8; break; 7462 case GL_ALPHA: components = 1; internal_format = GL_ALPHA8; break;
7450// Deprecated. See http://svn.secondlife.com/trac/linden/changeset/2757 7463 case GL_COLOR_INDEX: components = 1; internal_format = GL_COLOR_INDEX8_EXT; break;
7451// case GL_COLOR_INDEX: components = 1; internal_format = GL_COLOR_INDEX8_EXT; break;
7452 case GL_LUMINANCE_ALPHA: components = 2; internal_format = GL_LUMINANCE8_ALPHA8; break; 7464 case GL_LUMINANCE_ALPHA: components = 2; internal_format = GL_LUMINANCE8_ALPHA8; break;
7453 case GL_RGB: components = 3; internal_format = GL_RGB8; break; 7465 case GL_RGB: components = 3; internal_format = GL_RGB8; break;
7454 case GL_RGBA: components = 4; internal_format = GL_RGBA8; break; 7466 case GL_RGBA: components = 4; internal_format = GL_RGBA8; break;
diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp
index f3b8447..73ff860 100644
--- a/linden/indra/newview/llvovolume.cpp
+++ b/linden/indra/newview/llvovolume.cpp
@@ -1698,7 +1698,7 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p
1698 trans_mat.translate(getRegion()->getOriginAgent()); 1698 trans_mat.translate(getRegion()->getOriginAgent());
1699 } 1699 }
1700 1700
1701 volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, nodep->mSilhouetteSegments, view_vector, trans_mat, mRelativeXformInvTrans); 1701 volume->generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, nodep->mSilhouetteSegments, view_vector, trans_mat, mRelativeXformInvTrans, nodep->getTESelectMask());
1702 1702
1703 nodep->mSilhouetteExists = TRUE; 1703 nodep->mSilhouetteExists = TRUE;
1704 } 1704 }
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/llwebbrowserctrl.cpp b/linden/indra/newview/llwebbrowserctrl.cpp
deleted file mode 100644
index 453b9d2..0000000
--- a/linden/indra/newview/llwebbrowserctrl.cpp
+++ /dev/null
@@ -1,1068 +0,0 @@
1/**
2 * @file llwebbrowserctrl.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 "llwebbrowserctrl.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 "llviewerwindow.h"
47#include "llnotifications.h"
48#include "llweb.h"
49#include "llrender.h"
50
51// linden library includes
52#include "llfocusmgr.h"
53
54extern BOOL gRestoreGL;
55
56// Setting the mozilla buffer width to 2048 exactly doesn't work, since it pads its rowbytes a bit, pushing the texture width over 2048.
57// 2000 should give enough headroom for any amount of padding it cares to add.
58const S32 MAX_DIMENSION = 2000;
59const S32 MAX_TEXTURE_DIMENSION = 2048;
60
61static LLRegisterWidget<LLWebBrowserCtrl> r("web_browser");
62
63LLWebBrowserCtrl::LLWebBrowserCtrl( const std::string& name, const LLRect& rect ) :
64 LLUICtrl( name, rect, FALSE, NULL, NULL ),
65 mTextureDepthBytes( 4 ),
66 mWebBrowserImage( 0 ),
67 mEmbeddedBrowserWindowId( 0 ),
68 mBorder(NULL),
69 mFrequentUpdates( true ),
70 mForceUpdate( false ),
71 mOpenLinksInExternalBrowser( false ),
72 mOpenLinksInInternalBrowser( false ),
73 mTrusted( false ),
74 mHomePageUrl( "" ),
75 mIgnoreUIScale( true ),
76 mAlwaysRefresh( false ),
77 mExternalUrl( "" ),
78 mMediaSource( 0 ),
79 mTakeFocusOnClick( true ),
80 mCurrentNavUrl( "about:blank" )
81{
82 S32 screen_width = mIgnoreUIScale ?
83 llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]) : getRect().getWidth();
84 S32 screen_height = mIgnoreUIScale ?
85 llround((F32)getRect().getHeight() * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight();
86
87
88 LLMediaManager *mgr = LLMediaManager::getInstance();
89
90 if (!mgr)
91 {
92 llwarns << "cannot get media manager" << llendl;
93 return;
94 }
95
96 mMediaSource = mgr->createSourceFromMimeType("http", "text/html" );
97 if ( !mMediaSource )
98 {
99 llwarns << "media source create failed " << llendl;
100 // return;
101 }
102 else
103 {
104
105 // mMediaSource->init();
106 mMediaSource->addCommand( LLMediaBase::COMMAND_START );
107
108 // observe the browser so we can trap HREF events)
109 mMediaSource->addObserver(this);
110
111 // create a new texture (based on LLDynamic texture) that will be used to display the output
112 mWebBrowserImage = new LLWebBrowserTexture( screen_width, screen_height, this, mMediaSource );
113 }
114
115 LLRect border_rect( 0, getRect().getHeight() + 2, getRect().getWidth() + 2, 0 );
116 mBorder = new LLViewBorder( std::string("web control border"), border_rect, LLViewBorder::BEVEL_IN );
117 addChild( mBorder );
118}
119
120////////////////////////////////////////////////////////////////////////////////
121// note: this is now a singleton and destruction happens via initClass() now
122LLWebBrowserCtrl::~LLWebBrowserCtrl()
123{
124 LLMediaManager *mgr = LLMediaManager::getInstance();
125
126 if (!mgr)
127 {
128 llwarns << "cannot get media manager" << llendl;
129 return;
130 }
131
132 if (mMediaSource)
133 {
134 mgr->destroySource(mMediaSource);
135 mMediaSource = NULL;
136 }
137
138 if ( mWebBrowserImage )
139 {
140 delete mWebBrowserImage;
141 mWebBrowserImage = 0;
142 };
143}
144
145////////////////////////////////////////////////////////////////////////////////
146//
147bool LLWebBrowserCtrl::addObserver( LLWebBrowserCtrlObserver* subjectIn )
148{
149 return mEventEmitter.addObserver( subjectIn );
150}
151
152////////////////////////////////////////////////////////////////////////////////
153//
154bool LLWebBrowserCtrl::remObserver( LLWebBrowserCtrlObserver* subjectIn )
155{
156 return mEventEmitter.remObserver( subjectIn );
157}
158
159////////////////////////////////////////////////////////////////////////////////
160//
161void LLWebBrowserCtrl::setBorderVisible( BOOL border_visible )
162{
163 if ( mBorder )
164 {
165 mBorder->setVisible( border_visible );
166 };
167};
168
169////////////////////////////////////////////////////////////////////////////////
170//
171void LLWebBrowserCtrl::setTakeFocusOnClick( bool take_focus )
172{
173 mTakeFocusOnClick = take_focus;
174}
175
176////////////////////////////////////////////////////////////////////////////////
177// set flag that forces the embedded browser to open links in the external system browser
178void LLWebBrowserCtrl::setOpenInExternalBrowser( bool valIn )
179{
180 mOpenLinksInExternalBrowser = valIn;
181};
182
183////////////////////////////////////////////////////////////////////////////////
184// set flag that forces the embedded browser to open links in the internal browser floater
185void LLWebBrowserCtrl::setOpenInInternalBrowser( bool valIn )
186{
187 mOpenLinksInInternalBrowser = valIn;
188};
189
190////////////////////////////////////////////////////////////////////////////////
191void LLWebBrowserCtrl::setTrusted( bool valIn )
192{
193 mTrusted = valIn;
194}
195
196////////////////////////////////////////////////////////////////////////////////
197//
198BOOL LLWebBrowserCtrl::handleHover( S32 x, S32 y, MASK mask )
199{
200 convertInputCoords(x, y);
201
202 if (mMediaSource)
203 mMediaSource->mouseMove(x, y);
204
205 return TRUE;
206}
207
208////////////////////////////////////////////////////////////////////////////////
209//
210BOOL LLWebBrowserCtrl::handleScrollWheel( S32 x, S32 y, S32 clicks )
211{
212 if (mMediaSource)
213 mMediaSource->scrollByLines(clicks);
214
215 return TRUE;
216}
217
218////////////////////////////////////////////////////////////////////////////////
219//
220BOOL LLWebBrowserCtrl::handleMouseUp( S32 x, S32 y, MASK mask )
221{
222 convertInputCoords(x, y);
223
224 if (mMediaSource)
225 {
226 mMediaSource->mouseUp(x, y);
227
228 // *HACK: LLMediaImplLLMozLib automatically takes focus on mouseup,
229 // in addition to the onFocusReceived() call below. Undo this. JC
230 if (!mTakeFocusOnClick)
231 {
232 mMediaSource->focus(false);
233 gViewerWindow->focusClient();
234 }
235 }
236
237 gFocusMgr.setMouseCapture( NULL );
238
239 return TRUE;
240}
241
242////////////////////////////////////////////////////////////////////////////////
243//
244BOOL LLWebBrowserCtrl::handleMouseDown( S32 x, S32 y, MASK mask )
245{
246 convertInputCoords(x, y);
247
248 if (mMediaSource)
249 mMediaSource->mouseDown(x, y);
250
251 gFocusMgr.setMouseCapture( this );
252
253 if (mTakeFocusOnClick)
254 {
255 setFocus( TRUE );
256 }
257
258 return TRUE;
259}
260
261////////////////////////////////////////////////////////////////////////////////
262//
263BOOL LLWebBrowserCtrl::handleDoubleClick( S32 x, S32 y, MASK mask )
264{
265 convertInputCoords(x, y);
266
267 if (mMediaSource)
268 mMediaSource->mouseLeftDoubleClick( x, y );
269
270 gFocusMgr.setMouseCapture( this );
271
272 if (mTakeFocusOnClick)
273 {
274 setFocus( TRUE );
275 }
276
277 return TRUE;
278}
279
280////////////////////////////////////////////////////////////////////////////////
281//
282void LLWebBrowserCtrl::onFocusReceived()
283{
284 if (mMediaSource)
285 mMediaSource->focus(true);
286
287
288 LLUICtrl::onFocusReceived();
289}
290
291////////////////////////////////////////////////////////////////////////////////
292//
293void LLWebBrowserCtrl::onFocusLost()
294{
295 if (mMediaSource)
296 mMediaSource->focus(false);
297
298 gViewerWindow->focusClient();
299
300 LLUICtrl::onFocusLost();
301}
302
303////////////////////////////////////////////////////////////////////////////////
304//
305BOOL LLWebBrowserCtrl::handleKeyHere( KEY key, MASK mask )
306{
307 unsigned long media_key;
308
309 // First, turn SL internal keycode enum into Mozilla keycode enum
310
311 // We don't have to deal with printable characters here - they should
312 // go through handleUnicodeChar(). This table could be more complete
313 // than it is, but I think this covers all of the important
314 // non-printables.
315
316 switch (key)
317 {
318 case KEY_BACKSPACE:
319 media_key = LL_MEDIA_KEY_BACKSPACE; break;
320 case KEY_TAB:
321 media_key = LL_MEDIA_KEY_TAB; break;
322 case KEY_RETURN:
323 media_key = LL_MEDIA_KEY_RETURN; break;
324 case KEY_PAD_RETURN:
325 media_key = LL_MEDIA_KEY_PAD_RETURN; break;
326 case KEY_ESCAPE:
327 media_key = LL_MEDIA_KEY_ESCAPE; break;
328 case KEY_PAGE_UP:
329 media_key = LL_MEDIA_KEY_PAGE_UP; break;
330 case KEY_PAGE_DOWN:
331 media_key = LL_MEDIA_KEY_PAGE_DOWN; break;
332 case KEY_END:
333 media_key = LL_MEDIA_KEY_END; break;
334 case KEY_HOME:
335 media_key = LL_MEDIA_KEY_HOME; break;
336 case KEY_LEFT:
337 media_key = LL_MEDIA_KEY_LEFT; break;
338 case KEY_UP:
339 media_key = LL_MEDIA_KEY_UP; break;
340 case KEY_RIGHT:
341 media_key = LL_MEDIA_KEY_RIGHT; break;
342 case KEY_DOWN:
343 media_key = LL_MEDIA_KEY_DOWN; break;
344 case KEY_INSERT:
345 media_key = LL_MEDIA_KEY_INSERT; break;
346 case KEY_DELETE:
347 media_key = LL_MEDIA_KEY_DELETE; break;
348 default:
349 llinfos << "Don't know how to map LL keycode " << U32(key)
350 << " to DOM key. Ignoring." << llendl;
351 return FALSE; // don't know how to map this key.
352 }
353
354 if (mMediaSource)
355 mMediaSource->keyPress(media_key);
356
357 return TRUE;
358}
359
360BOOL LLWebBrowserCtrl::handleUnicodeCharHere(llwchar uni_char)
361{
362 // only accept 'printable' characters, sigh...
363 if (uni_char >= 32 // discard 'control' characters
364 && uni_char != 127) // SDL thinks this is 'delete' - yuck.
365 {
366 if (mMediaSource)
367 mMediaSource->unicodeInput(uni_char);
368 }
369
370 return TRUE;
371}
372
373////////////////////////////////////////////////////////////////////////////////
374//
375void LLWebBrowserCtrl::onVisibilityChange ( BOOL new_visibility )
376{
377 // set state of frequent updates automatically if visibility changes
378 if ( new_visibility )
379 {
380 mFrequentUpdates = true;
381 }
382 else
383 {
384 mFrequentUpdates = false;
385 }
386 LLUICtrl::onVisibilityChange(new_visibility);
387}
388
389////////////////////////////////////////////////////////////////////////////////
390//
391void LLWebBrowserCtrl::reshape( S32 width, S32 height, BOOL called_from_parent )
392{
393 S32 screen_width = mIgnoreUIScale ? llround((F32)width * LLUI::sGLScaleFactor.mV[VX]) : width;
394 S32 screen_height = mIgnoreUIScale ? llround((F32)height * LLUI::sGLScaleFactor.mV[VY]) : height;
395
396 // when floater is minimized, these sizes are negative
397 if ( mWebBrowserImage && screen_height > 0 && screen_width > 0 )
398 {
399 mWebBrowserImage->resize( screen_width, screen_height );
400 mForceUpdate = true;
401 }
402
403 LLUICtrl::reshape( width, height, called_from_parent );
404}
405
406////////////////////////////////////////////////////////////////////////////////
407//
408void LLWebBrowserCtrl::navigateBack()
409{
410 if (mMediaSource)
411 mMediaSource->navigateBack();
412}
413
414////////////////////////////////////////////////////////////////////////////////
415//
416void LLWebBrowserCtrl::navigateForward()
417{
418 if (mMediaSource)
419 mMediaSource->navigateForward();
420}
421
422////////////////////////////////////////////////////////////////////////////////
423//
424bool LLWebBrowserCtrl::canNavigateBack()
425{
426 if (mMediaSource)
427 return mMediaSource->canNavigateBack();
428 else
429 return false;
430}
431
432////////////////////////////////////////////////////////////////////////////////
433//
434bool LLWebBrowserCtrl::canNavigateForward()
435{
436 if (mMediaSource)
437 return mMediaSource->canNavigateForward();
438 else
439 return false;
440}
441
442////////////////////////////////////////////////////////////////////////////////
443//
444bool LLWebBrowserCtrl::set404RedirectUrl( std::string redirect_url )
445{
446 if(mMediaSource)
447 return mMediaSource->set404RedirectUrl( redirect_url );
448 else
449 return false;
450}
451
452////////////////////////////////////////////////////////////////////////////////
453//
454bool LLWebBrowserCtrl::clr404RedirectUrl()
455{
456 if(mMediaSource)
457 return mMediaSource->clr404RedirectUrl();
458 else
459 return false;
460}
461
462////////////////////////////////////////////////////////////////////////////////
463//
464void LLWebBrowserCtrl::navigateTo( std::string urlIn )
465{
466 // don't browse to anything that starts with secondlife:// or sl://
467 const std::string protocol1 = "secondlife://";
468 const std::string protocol2 = "sl://";
469 if ((LLStringUtil::compareInsensitive(urlIn.substr(0, protocol1.length()), protocol1) == 0) ||
470 (LLStringUtil::compareInsensitive(urlIn.substr(0, protocol2.length()), protocol2) == 0))
471 {
472 // TODO: Print out/log this attempt?
473 // llinfos << "Rejecting attempt to load restricted website :" << urlIn << llendl;
474 return;
475 }
476
477 if (mMediaSource)
478 {
479 mCurrentNavUrl = urlIn;
480 mMediaSource->navigateTo(urlIn);
481 }
482}
483
484
485void LLWebBrowserCtrl::navigateToLocalPage( const std::string& subdir, const std::string& filename_in )
486{
487 std::string language = LLUI::getLanguage();
488 std::string delim = gDirUtilp->getDirDelimiter();
489 std::string filename;
490
491 filename += subdir;
492 filename += delim;
493 filename += filename_in;
494
495 std::string expanded_filename = gDirUtilp->findSkinnedFilename("html", language, filename);
496
497 if (gDirUtilp->fileExists(expanded_filename))
498 {
499 navigateTo(expanded_filename);
500 return;
501 }
502 if (language != "en-us")
503 {
504 expanded_filename = gDirUtilp->findSkinnedFilename("html", "en-us", filename);
505 if (gDirUtilp->fileExists(expanded_filename))
506 {
507 navigateTo(expanded_filename);
508 return;
509 }
510 }
511
512 llwarns << "File " << subdir << delim << filename_in << "not found" << llendl;
513}
514
515
516////////////////////////////////////////////////////////////////////////////////
517//
518void LLWebBrowserCtrl::navigateHome()
519{
520 if( mHomePageUrl.length() )
521 {
522 if (mMediaSource)
523 mMediaSource->navigateTo(mHomePageUrl);
524 };
525}
526
527////////////////////////////////////////////////////////////////////////////////
528//
529void LLWebBrowserCtrl::setHomePageUrl( const std::string urlIn )
530{
531 mHomePageUrl = urlIn;
532}
533
534////////////////////////////////////////////////////////////////////////////////
535//
536bool LLWebBrowserCtrl::setCaretColor(unsigned int red, unsigned int green, unsigned int blue)
537{
538 if (mMediaSource)
539 return mMediaSource->setCaretColor(red, green, blue);
540 else
541 return false;
542}
543////////////////////////////////////////////////////////////////////////////////
544//
545std::string LLWebBrowserCtrl::getHomePageUrl()
546{
547 return mHomePageUrl;
548}
549
550////////////////////////////////////////////////////////////////////////////////
551//
552void LLWebBrowserCtrl::draw()
553{
554 if ( ! mWebBrowserImage )
555 return;
556
557 if ( gRestoreGL == 1 )
558 {
559 LLRect r = getRect();
560 mMediaSource->updateMedia();
561 reshape( r.getWidth(), r.getHeight(), FALSE );
562 return;
563 };
564
565 // NOTE: optimization needed here - probably only need to do this once
566 // unless tearoffs change the parent which they probably do.
567 const LLUICtrl* ptr = findRootMostFocusRoot();
568 if ( ptr && ptr->hasFocus() )
569 {
570 setFrequentUpdates( true );
571 }
572 else
573 {
574 setFrequentUpdates( false );
575 };
576
577 // alpha off for this
578 LLGLSUIDefault gls_ui;
579 LLGLDisable gls_alphaTest( GL_ALPHA_TEST );
580
581 gGL.pushMatrix();
582 {
583 if (mIgnoreUIScale)
584 {
585 glLoadIdentity();
586 // font system stores true screen origin, need to scale this by UI scale factor
587 // to get render origin for this view (with unit scale)
588 gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]),
589 floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]),
590 LLFontGL::sCurOrigin.mZ);
591 }
592
593 // scale texture to fit the space using texture coords
594 gGL.getTexUnit(0)->bind(mWebBrowserImage->getTexture());
595 gGL.color4fv( LLColor4::white.mV );
596 F32 max_u = ( F32 )mWebBrowserImage->getBrowserWidth() / ( F32 )mWebBrowserImage->getWidth();
597 F32 max_v = ( F32 )mWebBrowserImage->getBrowserHeight() / ( F32 )mWebBrowserImage->getHeight();
598
599 // draw the browser
600 gGL.setSceneBlendType(LLRender::BT_REPLACE);
601 gGL.begin( LLRender::QUADS );
602 {
603 // render using web browser reported width and height, instead of trying to invert GL scale
604 gGL.texCoord2f( max_u, max_v );
605 gGL.vertex2i( mWebBrowserImage->getBrowserWidth(), mWebBrowserImage->getBrowserHeight() );
606
607 gGL.texCoord2f( 0.f, max_v );
608 gGL.vertex2i( 0, mWebBrowserImage->getBrowserHeight() );
609
610 gGL.texCoord2f( 0.f, 0.f );
611 gGL.vertex2i( 0, 0 );
612
613 gGL.texCoord2f( max_u, 0.f );
614 gGL.vertex2i( mWebBrowserImage->getBrowserWidth(), 0 );
615 }
616 gGL.end();
617 gGL.setSceneBlendType(LLRender::BT_ALPHA);
618 }
619 gGL.popMatrix();
620
621 // highlight if keyboard focus here. (TODO: this needs some work)
622 if ( mBorder->getVisible() )
623 mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus( this ) );
624
625
626 LLUICtrl::draw();
627}
628
629void LLWebBrowserCtrl::convertInputCoords(S32& x, S32& y)
630{
631 x = mIgnoreUIScale ? llround((F32)x * LLUI::sGLScaleFactor.mV[VX]) : x;
632 y = mIgnoreUIScale ? llround((F32)(getRect().getHeight() - y) * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight() - y;
633}
634
635////////////////////////////////////////////////////////////////////////////////
636// virtual
637void LLWebBrowserCtrl::onNavigateBegin( const EventType& eventIn )
638{
639 LLWebBrowserCtrlEvent event( eventIn.getStringValue() );
640 mEventEmitter.update( &LLWebBrowserCtrlObserver::onNavigateBegin, event );
641}
642
643////////////////////////////////////////////////////////////////////////////////
644// virtual
645void LLWebBrowserCtrl::onNavigateComplete( const EventType& eventIn )
646{
647 // chain this event on to observers of an instance of LLWebBrowserCtrl
648 LLWebBrowserCtrlEvent event( eventIn.getStringValue() );
649 mEventEmitter.update( &LLWebBrowserCtrlObserver::onNavigateComplete, event );
650}
651
652////////////////////////////////////////////////////////////////////////////////
653// virtual
654void LLWebBrowserCtrl::onUpdateProgress( const EventType& eventIn )
655{
656 // chain this event on to observers of an instance of LLWebBrowserCtrl
657 LLWebBrowserCtrlEvent event( eventIn.getIntValue() );
658 mEventEmitter.update( &LLWebBrowserCtrlObserver::onUpdateProgress, event );
659}
660
661////////////////////////////////////////////////////////////////////////////////
662// virtual
663void LLWebBrowserCtrl::onStatusTextChange( const EventType& eventIn )
664{
665 // chain this event on to observers of an instance of LLWebBrowserCtrl
666 LLWebBrowserCtrlEvent event( eventIn.getStringValue() );
667 mEventEmitter.update( &LLWebBrowserCtrlObserver::onStatusTextChange, event );
668}
669
670////////////////////////////////////////////////////////////////////////////////
671// virtual
672void LLWebBrowserCtrl::onLocationChange( const EventType& eventIn )
673{
674 // chain this event on to observers of an instance of LLWebBrowserCtrl
675 LLWebBrowserCtrlEvent event( eventIn.getStringValue() );
676 mEventEmitter.update( &LLWebBrowserCtrlObserver::onLocationChange, event );
677}
678
679////////////////////////////////////////////////////////////////////////////////
680// virtual
681void LLWebBrowserCtrl::onMediaContentsChange( const EventType& event_in )
682{
683 if ( mWebBrowserImage )
684 {
685 mWebBrowserImage->setNeedsUpdate();
686 mForceUpdate = true;
687 }
688}
689
690////////////////////////////////////////////////////////////////////////////////
691// static
692bool LLWebBrowserCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD& response )
693{
694 S32 option = LLNotification::getSelectedOption(notification, response);
695 if ( 0 == option )
696 {
697 // open in external browser because we don't support
698 // creation of our own secondary browser windows
699 LLWeb::loadURLExternal( notification["payload"]["external_url"].asString() );
700 }
701 return false;
702}
703
704////////////////////////////////////////////////////////////////////////////////
705// virtual
706void LLWebBrowserCtrl::onClickLinkHref( const EventType& eventIn )
707{
708 // if there is a value for the target (passed in stringValueEx)
709 if ( eventIn.getStringValueEx().length() )
710 {
711 // if the target = "_new"
712 if ( eventIn.getStringValueEx() == "_external" )
713 {
714 mExternalUrl = eventIn.getStringValue();
715 LLSD payload;
716 payload["external_url"] = mExternalUrl;
717 LLNotifications::instance().add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget);
718 return;
719 }
720 }
721
722 const std::string protocol1( "http://" );
723 const std::string protocol2( "https://" );
724 if( mOpenLinksInExternalBrowser )
725 {
726 if ( eventIn.getStringValue().length() )
727 {
728 if ( LLStringUtil::compareInsensitive( eventIn.getStringValue().substr( 0, protocol1.length() ), protocol1 ) == 0 ||
729 LLStringUtil::compareInsensitive( eventIn.getStringValue().substr( 0, protocol2.length() ), protocol2 ) == 0 )
730 {
731 LLWeb::loadURLExternal( eventIn.getStringValue() );
732 }
733 }
734 }
735 else
736 if( mOpenLinksInInternalBrowser )
737 {
738 if ( eventIn.getStringValue().length() )
739 {
740 if ( LLStringUtil::compareInsensitive( eventIn.getStringValue().substr( 0, protocol1.length() ), protocol1 ) == 0 ||
741 LLStringUtil::compareInsensitive( eventIn.getStringValue().substr( 0, protocol2.length() ), protocol2 ) == 0 )
742 {
743 // If we spawn a new LLFloaterHTML, assume we want it to
744 // follow this LLWebBrowserCtrl's trust for whether or
745 // not to open secondlife:///app/ links. JC.
746 const bool open_links_externally = false;
747 LLFloaterHtml::getInstance()->show(
748 eventIn.getStringValue(),
749 "Second Life Browser",
750 open_links_externally,
751 mTrusted);
752 }
753 }
754 }
755
756 // chain this event on to observers of an instance of LLWebBrowserCtrl
757 LLWebBrowserCtrlEvent event( eventIn.getStringValue(), eventIn.getStringValueEx() );
758 mEventEmitter.update( &LLWebBrowserCtrlObserver::onClickLinkHref, event );
759}
760
761////////////////////////////////////////////////////////////////////////////////
762// virtual
763void LLWebBrowserCtrl::onClickLinkNoFollow( const EventType& eventIn )
764{
765 std::string url = eventIn.getStringValue();
766 if (LLURLDispatcher::isSLURLCommand(url)
767 && !mTrusted)
768 {
769 // block handling of this secondlife:///app/ URL
770 LLNotifications::instance().add("UnableToOpenCommandURL");
771 return;
772 }
773
774 LLURLDispatcher::dispatch(url, this, mTrusted);
775
776 // chain this event on to observers of an instance of LLWebBrowserCtrl
777 LLWebBrowserCtrlEvent event( eventIn.getStringValue() );
778 mEventEmitter.update( &LLWebBrowserCtrlObserver::onClickLinkNoFollow, event );
779}
780
781////////////////////////////////////////////////////////////////////////////////
782//
783LLWebBrowserTexture::LLWebBrowserTexture( S32 width, S32 height, LLWebBrowserCtrl* browserCtrl, LLMediaBase *media_source ) :
784 LLDynamicTexture( 512, 512, 4, ORDER_FIRST, TRUE ),
785 mLastBrowserDepth( 0 ),
786 mNeedsUpdate( true ),
787 mWebBrowserCtrl( browserCtrl ),
788 mMediaSource(media_source)
789{
790 mElapsedTime.start();
791
792 resize( width, height );
793}
794
795////////////////////////////////////////////////////////////////////////////////
796//
797LLWebBrowserTexture::~LLWebBrowserTexture()
798{
799 mElapsedTime.stop();
800}
801
802////////////////////////////////////////////////////////////////////////////////
803//
804BOOL LLWebBrowserTexture::needsRender()
805{
806 if ( mWebBrowserCtrl->getFrequentUpdates() ||
807 mWebBrowserCtrl->getAlwaysRefresh() ||
808 mWebBrowserCtrl->getForceUpdate() )
809 {
810 // only update mozilla/texture occasionally
811 if ( mElapsedTime.getElapsedTimeF32() > ( 1.0f / 15.0f ) )
812 {
813 return TRUE;
814 }
815 }
816
817 return FALSE;
818}
819
820////////////////////////////////////////////////////////////////////////////////
821//
822BOOL LLWebBrowserTexture::render()
823{
824 if (!mMediaSource)
825 return FALSE;
826
827 // frequent updates turned on?
828 if ( mWebBrowserCtrl->getFrequentUpdates() ||
829 mWebBrowserCtrl->getAlwaysRefresh() ||
830 mWebBrowserCtrl->getForceUpdate() )
831 {
832
833 if ( mNeedsUpdate )
834 {
835
836 const unsigned char* pixels = mMediaSource->getMediaData();
837 if ( ! pixels )
838 return FALSE;
839
840 mNeedsUpdate = false;
841 mWebBrowserCtrl->setForceUpdate(false);
842
843 S32 media_depth = mMediaSource->getMediaDepth();
844 S32 media_width = mMediaSource->getMediaWidth();
845 S32 media_height = mMediaSource->getMediaHeight();
846
847 // these are both invalid conditions and should never happen but SL-27583 indicates it does
848 if ((media_width < 1) || (media_depth < 2))
849 return FALSE;
850
851 // Browser depth hasn't changed.
852 if(mLastBrowserDepth == media_depth)
853 {
854 S32 width = llmin(media_width, mBrowserWidth);
855 S32 height = llmin(media_height, mBrowserHeight);
856
857 S32 media_data_width = mMediaSource->getMediaDataWidth();
858 S32 media_data_height = mMediaSource->getMediaDataHeight();
859
860 // Just grab the pixels.
861 if ( media_data_width > 0 && media_data_height > 0 &&
862 media_data_width < MAX_DIMENSION && media_data_height < MAX_DIMENSION )
863 {
864 mTexture->setSubImage( pixels,
865 media_data_width, media_data_height,
866 0, 0,
867 llmin(width, media_data_width), llmin(media_data_height, height) );
868 };
869 }
870 else
871 {
872 // Browser depth has changed -- need to recreate texture to match.
873 resize(mBrowserWidth, mBrowserHeight);
874 };
875 };
876 };
877
878 return TRUE;
879}
880
881////////////////////////////////////////////////////////////////////////////////
882//
883S32 LLWebBrowserTexture::getBrowserWidth()
884{
885 return mBrowserWidth;
886}
887
888////////////////////////////////////////////////////////////////////////////////
889//
890S32 LLWebBrowserTexture::getBrowserHeight()
891{
892 return mBrowserHeight;
893}
894
895////////////////////////////////////////////////////////////////////////////////
896//
897void LLWebBrowserTexture::setNeedsUpdate()
898{
899 mNeedsUpdate = true;
900}
901
902////////////////////////////////////////////////////////////////////////////////
903//
904void LLWebBrowserTexture::resize( S32 new_width, S32 new_height )
905{
906 if (!mMediaSource)
907 return;
908
909 F32 scale_ratio = 1.f;
910 if (new_width > MAX_DIMENSION)
911 {
912 scale_ratio = (F32)MAX_DIMENSION / (F32)new_width;
913 }
914 if (new_height > MAX_DIMENSION)
915 {
916 scale_ratio = llmin(scale_ratio, (F32)MAX_DIMENSION / (F32)new_height);
917 }
918
919 mBrowserWidth = llround(scale_ratio * (F32)new_width);
920 mBrowserHeight = llround(scale_ratio * (F32)new_height);
921
922 mMediaSource->setRequestedMediaSize(mBrowserWidth, mBrowserHeight);
923
924 // HACK - this code is executing a render - resize should call render() instead
925 // (and render() should be refactored so it doesn't call resize())
926
927 mMediaSource->updateMedia();
928 const unsigned char* pixels = mMediaSource->getMediaData();
929
930 S32 media_width = mMediaSource->getMediaWidth();
931 S32 media_height = mMediaSource->getMediaHeight();
932 S32 media_depth = mMediaSource->getMediaDepth();
933
934 // these are both invalid conditions and should never happen but SL-27583 indicates it does
935 if ( media_width < 1 || media_depth < 2 )
936 return;
937
938 releaseGLTexture();
939
940 // calculate the next power of 2 bigger than reqquested size for width and height
941 for ( mWidth = 1; mWidth < mBrowserWidth; mWidth <<= 1 )
942 {
943 if ( mWidth >= MAX_TEXTURE_DIMENSION )
944 {
945 break;
946 };
947 };
948
949 for ( mHeight = 1; mHeight < mBrowserHeight; mHeight <<= 1 )
950 {
951 if ( mHeight >= MAX_TEXTURE_DIMENSION )
952 {
953 break;
954 };
955 };
956
957 LLGLint internal_format;
958 LLGLenum primary_format;
959 LLGLenum type_format;
960 BOOL swap_bytes = FALSE;
961
962 switch(media_depth)
963 {
964 default:
965 case 4:
966 internal_format = GL_RGBA8;
967 primary_format = GL_BGRA_EXT;
968 #if LL_DARWIN
969 #if LL_BIG_ENDIAN
970 type_format = GL_UNSIGNED_INT_8_8_8_8_REV;
971 #else
972 type_format = GL_UNSIGNED_INT_8_8_8_8;
973 #endif
974 #else // windows or linux
975 type_format = GL_UNSIGNED_BYTE;
976 #endif
977 break;
978
979 case 2:
980 #if LL_DARWIN
981 internal_format = GL_RGBA8;
982 primary_format = GL_BGRA_EXT;
983 type_format = GL_UNSIGNED_SHORT_1_5_5_5_REV;
984 #if LL_LITTLE_ENDIAN
985 swap_bytes = TRUE;
986 #endif
987 #else // windows or linux
988 // MBW -- XXX -- This is just a guess on my part. Someone needs to verify which GL texture format matches the 16-bit format used on windows.
989 internal_format = GL_RGB8;
990 primary_format = GL_RGB;
991 type_format = GL_UNSIGNED_SHORT_5_6_5;
992 #endif
993 break;
994 }
995
996 // will create mWidth * mHeight sized texture, using BGR ordering
997 LLDynamicTexture::generateGLTexture(internal_format, primary_format, type_format, swap_bytes);
998
999
1000 S32 width = llmin(media_width, mBrowserWidth);
1001 S32 height = llmin(media_height, mBrowserHeight);
1002
1003 S32 media_data_width = mMediaSource->getMediaDataWidth();
1004 S32 media_data_height = mMediaSource->getMediaDataHeight();
1005
1006 if (pixels)
1007 {
1008 mTexture->setSubImage( pixels, media_data_width, media_data_height,
1009 0, 0, width, height );
1010 }
1011
1012 mLastBrowserDepth = media_depth;
1013}
1014
1015// virtual
1016LLXMLNodePtr LLWebBrowserCtrl::getXML(bool save_children) const
1017{
1018 LLXMLNodePtr node = LLUICtrl::getXML();
1019
1020 node->setName(LL_WEB_BROWSER_CTRL_TAG);
1021
1022 return node;
1023}
1024
1025LLView* LLWebBrowserCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
1026{
1027 std::string name("web_browser");
1028 node->getAttributeString("name", name);
1029
1030 std::string start_url("start_url");
1031 node->getAttributeString("start_url", start_url );
1032
1033 BOOL border_visible = true;
1034 node->getAttributeBOOL("border_visible", border_visible);
1035
1036 LLRect rect;
1037 createRect(node, rect, parent, LLRect());
1038
1039 LLWebBrowserCtrl* web_browser = new LLWebBrowserCtrl( name, rect );
1040
1041 if(node->hasAttribute("caret_color"))
1042 {
1043 LLColor4 color;
1044 LLUICtrlFactory::getAttributeColor(node, "caret_color", color);
1045 LLColor4U colorU = LLColor4U(color);
1046 web_browser->setCaretColor( colorU.mV[0], colorU.mV[1], colorU.mV[2] );
1047 }
1048
1049 BOOL ignore_ui_scale = web_browser->getIgnoreUIScale();
1050 node->getAttributeBOOL("ignore_ui_scale", ignore_ui_scale);
1051 web_browser->setIgnoreUIScale((bool)ignore_ui_scale);
1052
1053 web_browser->initFromXML(node, parent);
1054
1055 web_browser->setHomePageUrl( start_url );
1056
1057 web_browser->setBorderVisible( border_visible );
1058
1059 web_browser->navigateHome();
1060
1061 return web_browser;
1062}
1063
1064std::string LLWebBrowserCtrl::getCurrentNavUrl()
1065{
1066 return mCurrentNavUrl;
1067}
1068
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 cf766e0..077d812 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"
@@ -5772,7 +5772,7 @@ void LLPipeline::renderDeferredLighting()
5772 (1 << LLPipeline::RENDER_TYPE_FULLBRIGHT) | 5772 (1 << LLPipeline::RENDER_TYPE_FULLBRIGHT) |
5773 (1 << LLPipeline::RENDER_TYPE_VOLUME) | 5773 (1 << LLPipeline::RENDER_TYPE_VOLUME) |
5774 (1 << LLPipeline::RENDER_TYPE_GLOW) | 5774 (1 << LLPipeline::RENDER_TYPE_GLOW) |
5775 (1 << LLPipeline::RENDER_TYPE_BUMP)); 5775 (1 << LLPipeline::RENDER_TYPE_BUMP));
5776 5776
5777 renderGeomPostDeferred(*LLViewerCamera::getInstance()); 5777 renderGeomPostDeferred(*LLViewerCamera::getInstance());
5778 mRenderTypeMask = render_mask; 5778 mRenderTypeMask = render_mask;
diff --git a/linden/indra/newview/pipeline.h b/linden/indra/newview/pipeline.h
index 3f3309a..1ecb56e 100644
--- a/linden/indra/newview/pipeline.h
+++ b/linden/indra/newview/pipeline.h
@@ -316,7 +316,7 @@ public:
316 RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, 316 RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE,
317 RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER, 317 RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER,
318 RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, 318 RENDER_TYPE_WATER = LLDrawPool::POOL_WATER,
319 RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA, 319 RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA,
320 RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW, 320 RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW,
321 321
322 // Following are object types (only used in drawable mRenderType) 322 // Following are object types (only used in drawable mRenderType)
diff --git a/linden/indra/newview/secondlife-i686.supp b/linden/indra/newview/secondlife-i686.supp
index 43d4483..d70cda3 100644
--- a/linden/indra/newview/secondlife-i686.supp
+++ b/linden/indra/newview/secondlife-i686.supp
@@ -41,50 +41,6 @@
41# - After you build the viewer, replace the stripped 41# - After you build the viewer, replace the stripped
42# do-not-directly-run-secondlife-bin binary with an unstripped copy. 42# do-not-directly-run-secondlife-bin binary with an unstripped copy.
43 43
44# Mozilla noise.
45
46{
47 Cond:mozilla-runtime/*.so
48 Memcheck:Cond
49 obj:*/mozilla-runtime-*/*.so
50}
51
52{
53 Value4:mozilla-runtime/*.so
54 Memcheck:Value4
55 obj:*/mozilla-runtime-*/*.so
56}
57
58{
59 Cond:mozilla-runtime/*/*.so
60 Memcheck:Cond
61 obj:*/mozilla-runtime-*/*/*.so
62}
63
64{
65 Value4:mozilla-runtime/*/*.so
66 Memcheck:Value4
67 obj:*/mozilla-runtime-*/*/*.so
68}
69
70{
71 Cond:mozilla-runtime/libmozjs.so
72 Memcheck:Cond
73 obj:*/libmozjs.so
74}
75
76{
77 Cond:mozilla-runtime/libxul
78 Memcheck:Cond
79 obj:*/libxul.so
80}
81
82{
83 Value4:mozilla-runtime/libxul
84 Memcheck:Value4
85 obj:*/libxul.so
86}
87
88# libcurl badness. 44# libcurl badness.
89 45
90{ 46{
diff --git a/linden/indra/newview/skins/default/textures/textures.xml b/linden/indra/newview/skins/default/textures/textures.xml
index 0b4a088..60fb4e0 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,24 @@
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 <texture name="media_panel_scrollbg.png"/>
400
382</textures> 401</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_linux.xml b/linden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml
new file mode 100755
index 0000000..e95b371
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/mime_types_linux.xml
@@ -0,0 +1,478 @@
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_webkit
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 <impl>
134 media_plugin_webkit
135 </impl>
136 </mimetype>
137 <mimetype name="audio/*">
138 <label name="audio2_label">
139 Audio
140 </label>
141 <widgettype>
142 audio
143 </widgettype>
144 <impl>
145 media_plugin_gstreamer
146 </impl>
147 </mimetype>
148 <mimetype name="video/*">
149 <label name="video2_label">
150 Video
151 </label>
152 <widgettype>
153 movie
154 </widgettype>
155 <impl>
156 media_plugin_gstreamer
157 </impl>
158 </mimetype>
159 <mimetype name="image/*">
160 <label name="image2_label">
161 Image
162 </label>
163 <widgettype>
164 image
165 </widgettype>
166 <impl>
167 media_plugin_webkit
168 </impl>
169 </mimetype>
170 <mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
171 <label name="vnd.secondlife.qt.legacy_label">
172 Movie (QuickTime)
173 </label>
174 <widgettype>
175 movie
176 </widgettype>
177 <impl>
178 media_plugin_gstreamer
179 </impl>
180 </mimetype>
181 <mimetype name="application/javascript">
182 <label name="application/javascript_label">
183 Javascript
184 </label>
185 <widgettype>
186 web
187 </widgettype>
188 <impl>
189 media_plugin_webkit
190 </impl>
191 </mimetype>
192 <mimetype name="application/ogg">
193 <label name="application/ogg_label">
194 Ogg Audio/Video
195 </label>
196 <widgettype>
197 audio
198 </widgettype>
199 <impl>
200 media_plugin_gstreamer
201 </impl>
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 <impl>
211 media_plugin_webkit
212 </impl>
213 </mimetype>
214 <mimetype name="application/postscript">
215 <label name="application/postscript_label">
216 Postscript Document
217 </label>
218 <widgettype>
219 image
220 </widgettype>
221 <impl>
222 media_plugin_webkit
223 </impl>
224 </mimetype>
225 <mimetype name="application/rtf">
226 <label name="application/rtf_label">
227 Rich Text (RTF)
228 </label>
229 <widgettype>
230 image
231 </widgettype>
232 <impl>
233 media_plugin_webkit
234 </impl>
235 </mimetype>
236 <mimetype name="application/smil">
237 <label name="application/smil_label">
238 Synchronized Multimedia Integration Language (SMIL)
239 </label>
240 <widgettype>
241 movie
242 </widgettype>
243 <impl>
244 media_plugin_webkit
245 </impl>
246 </mimetype>
247 <mimetype name="application/xhtml+xml">
248 <label name="application/xhtml+xml_label">
249 Web Page (XHTML)
250 </label>
251 <widgettype>
252 web
253 </widgettype>
254 <impl>
255 media_plugin_webkit
256 </impl>
257 </mimetype>
258 <mimetype name="application/x-director">
259 <label name="application/x-director_label">
260 Macromedia Director
261 </label>
262 <widgettype>
263 image
264 </widgettype>
265 <impl>
266 media_plugin_webkit
267 </impl>
268 </mimetype>
269 <mimetype name="audio/mid">
270 <label name="audio/mid_label">
271 Audio (MIDI)
272 </label>
273 <widgettype>
274 audio
275 </widgettype>
276 <impl>
277 media_plugin_gstreamer
278 </impl>
279 </mimetype>
280 <mimetype name="audio/mpeg">
281 <label name="audio/mpeg_label">
282 Audio (MP3)
283 </label>
284 <widgettype>
285 audio
286 </widgettype>
287 <impl>
288 media_plugin_gstreamer
289 </impl>
290 </mimetype>
291 <mimetype name="audio/x-aiff">
292 <label name="audio/x-aiff_label">
293 Audio (AIFF)
294 </label>
295 <widgettype>
296 audio
297 </widgettype>
298 <impl>
299 media_plugin_gstreamer
300 </impl>
301 </mimetype>
302 <mimetype name="audio/x-wav">
303 <label name="audio/x-wav_label">
304 Audio (WAV)
305 </label>
306 <widgettype>
307 audio
308 </widgettype>
309 <impl>
310 media_plugin_gstreamer
311 </impl>
312 </mimetype>
313 <mimetype menu="1" name="image/bmp">
314 <label name="image/bmp_label">
315 Image (BMP)
316 </label>
317 <widgettype>
318 image
319 </widgettype>
320 <impl>
321 media_plugin_webkit
322 </impl>
323 </mimetype>
324 <mimetype menu="1" name="image/gif">
325 <label name="image/gif_label">
326 Image (GIF)
327 </label>
328 <widgettype>
329 image
330 </widgettype>
331 <impl>
332 media_plugin_webkit
333 </impl>
334 </mimetype>
335 <mimetype menu="1" name="image/jpeg">
336 <label name="image/jpeg_label">
337 Image (JPEG)
338 </label>
339 <widgettype>
340 image
341 </widgettype>
342 <impl>
343 media_plugin_webkit
344 </impl>
345 </mimetype>
346 <mimetype menu="1" name="image/png">
347 <label name="image/png_label">
348 Image (PNG)
349 </label>
350 <widgettype>
351 image
352 </widgettype>
353 <impl>
354 media_plugin_webkit
355 </impl>
356 </mimetype>
357 <mimetype name="image/svg+xml">
358 <label name="image/svg+xml_label">
359 Image (SVG)
360 </label>
361 <widgettype>
362 image
363 </widgettype>
364 <impl>
365 media_plugin_webkit
366 </impl>
367 </mimetype>
368 <mimetype menu="1" name="image/tiff">
369 <label name="image/tiff_label">
370 Image (TIFF)
371 </label>
372 <widgettype>
373 image
374 </widgettype>
375 <impl>
376 media_plugin_webkit
377 </impl>
378 </mimetype>
379 <mimetype menu="1" name="text/html">
380 <label name="text/html_label">
381 Web Page
382 </label>
383 <widgettype>
384 web
385 </widgettype>
386 <impl>
387 media_plugin_webkit
388 </impl>
389 </mimetype>
390 <mimetype menu="1" name="text/plain">
391 <label name="text/plain_label">
392 Text
393 </label>
394 <widgettype>
395 text
396 </widgettype>
397 <impl>
398 media_plugin_webkit
399 </impl>
400 </mimetype>
401 <mimetype name="text/xml">
402 <label name="text/xml_label">
403 XML
404 </label>
405 <widgettype>
406 text
407 </widgettype>
408 <impl>
409 media_plugin_webkit
410 </impl>
411 </mimetype>
412 <mimetype menu="1" name="video/mpeg">
413 <label name="video/mpeg_label">
414 Movie (MPEG)
415 </label>
416 <widgettype>
417 movie
418 </widgettype>
419 <impl>
420 media_plugin_gstreamer
421 </impl>
422 </mimetype>
423 <mimetype name="video/mp4">
424 <label name="video/mp4_label">
425 Movie (MP4)
426 </label>
427 <widgettype>
428 movie
429 </widgettype>
430 <impl>
431 media_plugin_gstreamer
432 </impl>
433 </mimetype>
434 <mimetype menu="1" name="video/quicktime">
435 <label name="video/quicktime_label">
436 Movie (QuickTime)
437 </label>
438 <widgettype>
439 movie
440 </widgettype>
441 <impl>
442 media_plugin_gstreamer
443 </impl>
444 </mimetype>
445 <mimetype name="video/x-ms-asf">
446 <label name="video/x-ms-asf_label">
447 Movie (Windows Media ASF)
448 </label>
449 <widgettype>
450 movie
451 </widgettype>
452 <impl>
453 media_plugin_gstreamer
454 </impl>
455 </mimetype>
456 <mimetype name="video/x-ms-wmv">
457 <label name="video/x-ms-wmv_label">
458 Movie (Windows Media WMV)
459 </label>
460 <widgettype>
461 movie
462 </widgettype>
463 <impl>
464 media_plugin_gstreamer
465 </impl>
466 </mimetype>
467 <mimetype menu="1" name="video/x-msvideo">
468 <label name="video/x-msvideo_label">
469 Movie (AVI)
470 </label>
471 <widgettype>
472 movie
473 </widgettype>
474 <impl>
475 media_plugin_gstreamer
476 </impl>
477 </mimetype>
478</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 100755
index 0000000..7931e55
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/mime_types_mac.xml
@@ -0,0 +1,478 @@
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 <impl>
134 media_plugin_webkit
135 </impl>
136 </mimetype>
137 <mimetype name="audio/*">
138 <label name="audio2_label">
139 Audio
140 </label>
141 <widgettype>
142 audio
143 </widgettype>
144 <impl>
145 media_plugin_quicktime
146 </impl>
147 </mimetype>
148 <mimetype name="video/*">
149 <label name="video2_label">
150 Video
151 </label>
152 <widgettype>
153 movie
154 </widgettype>
155 <impl>
156 media_plugin_quicktime
157 </impl>
158 </mimetype>
159 <mimetype name="image/*">
160 <label name="image2_label">
161 Image
162 </label>
163 <widgettype>
164 image
165 </widgettype>
166 <impl>
167 media_plugin_webkit
168 </impl>
169 </mimetype>
170 <mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
171 <label name="vnd.secondlife.qt.legacy_label">
172 Movie (QuickTime)
173 </label>
174 <widgettype>
175 movie
176 </widgettype>
177 <impl>
178 media_plugin_quicktime
179 </impl>
180 </mimetype>
181 <mimetype name="application/javascript">
182 <label name="application/javascript_label">
183 Javascript
184 </label>
185 <widgettype>
186 web
187 </widgettype>
188 <impl>
189 media_plugin_webkit
190 </impl>
191 </mimetype>
192 <mimetype name="application/ogg">
193 <label name="application/ogg_label">
194 Ogg Audio/Video
195 </label>
196 <widgettype>
197 audio
198 </widgettype>
199 <impl>
200 media_plugin_quicktime
201 </impl>
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 <impl>
211 media_plugin_webkit
212 </impl>
213 </mimetype>
214 <mimetype name="application/postscript">
215 <label name="application/postscript_label">
216 Postscript Document
217 </label>
218 <widgettype>
219 image
220 </widgettype>
221 <impl>
222 media_plugin_webkit
223 </impl>
224 </mimetype>
225 <mimetype name="application/rtf">
226 <label name="application/rtf_label">
227 Rich Text (RTF)
228 </label>
229 <widgettype>
230 image
231 </widgettype>
232 <impl>
233 media_plugin_webkit
234 </impl>
235 </mimetype>
236 <mimetype name="application/smil">
237 <label name="application/smil_label">
238 Synchronized Multimedia Integration Language (SMIL)
239 </label>
240 <widgettype>
241 movie
242 </widgettype>
243 <impl>
244 media_plugin_webkit
245 </impl>
246 </mimetype>
247 <mimetype name="application/xhtml+xml">
248 <label name="application/xhtml+xml_label">
249 Web Page (XHTML)
250 </label>
251 <widgettype>
252 web
253 </widgettype>
254 <impl>
255 media_plugin_webkit
256 </impl>
257 </mimetype>
258 <mimetype name="application/x-director">
259 <label name="application/x-director_label">
260 Macromedia Director
261 </label>
262 <widgettype>
263 image
264 </widgettype>
265 <impl>
266 media_plugin_webkit
267 </impl>
268 </mimetype>
269 <mimetype name="audio/mid">
270 <label name="audio/mid_label">
271 Audio (MIDI)
272 </label>
273 <widgettype>
274 audio
275 </widgettype>
276 <impl>
277 media_plugin_quicktime
278 </impl>
279 </mimetype>
280 <mimetype name="audio/mpeg">
281 <label name="audio/mpeg_label">
282 Audio (MP3)
283 </label>
284 <widgettype>
285 audio
286 </widgettype>
287 <impl>
288 media_plugin_quicktime
289 </impl>
290 </mimetype>
291 <mimetype name="audio/x-aiff">
292 <label name="audio/x-aiff_label">
293 Audio (AIFF)
294 </label>
295 <widgettype>
296 audio
297 </widgettype>
298 <impl>
299 media_plugin_quicktime
300 </impl>
301 </mimetype>
302 <mimetype name="audio/x-wav">
303 <label name="audio/x-wav_label">
304 Audio (WAV)
305 </label>
306 <widgettype>
307 audio
308 </widgettype>
309 <impl>
310 media_plugin_quicktime
311 </impl>
312 </mimetype>
313 <mimetype menu="1" name="image/bmp">
314 <label name="image/bmp_label">
315 Image (BMP)
316 </label>
317 <widgettype>
318 image
319 </widgettype>
320 <impl>
321 media_plugin_webkit
322 </impl>
323 </mimetype>
324 <mimetype menu="1" name="image/gif">
325 <label name="image/gif_label">
326 Image (GIF)
327 </label>
328 <widgettype>
329 image
330 </widgettype>
331 <impl>
332 media_plugin_webkit
333 </impl>
334 </mimetype>
335 <mimetype menu="1" name="image/jpeg">
336 <label name="image/jpeg_label">
337 Image (JPEG)
338 </label>
339 <widgettype>
340 image
341 </widgettype>
342 <impl>
343 media_plugin_webkit
344 </impl>
345 </mimetype>
346 <mimetype menu="1" name="image/png">
347 <label name="image/png_label">
348 Image (PNG)
349 </label>
350 <widgettype>
351 image
352 </widgettype>
353 <impl>
354 media_plugin_webkit
355 </impl>
356 </mimetype>
357 <mimetype name="image/svg+xml">
358 <label name="image/svg+xml_label">
359 Image (SVG)
360 </label>
361 <widgettype>
362 image
363 </widgettype>
364 <impl>
365 media_plugin_webkit
366 </impl>
367 </mimetype>
368 <mimetype menu="1" name="image/tiff">
369 <label name="image/tiff_label">
370 Image (TIFF)
371 </label>
372 <widgettype>
373 image
374 </widgettype>
375 <impl>
376 media_plugin_webkit
377 </impl>
378 </mimetype>
379 <mimetype menu="1" name="text/html">
380 <label name="text/html_label">
381 Web Page
382 </label>
383 <widgettype>
384 web
385 </widgettype>
386 <impl>
387 media_plugin_webkit
388 </impl>
389 </mimetype>
390 <mimetype menu="1" name="text/plain">
391 <label name="text/plain_label">
392 Text
393 </label>
394 <widgettype>
395 text
396 </widgettype>
397 <impl>
398 media_plugin_webkit
399 </impl>
400 </mimetype>
401 <mimetype name="text/xml">
402 <label name="text/xml_label">
403 XML
404 </label>
405 <widgettype>
406 text
407 </widgettype>
408 <impl>
409 media_plugin_webkit
410 </impl>
411 </mimetype>
412 <mimetype menu="1" name="video/mpeg">
413 <label name="video/mpeg_label">
414 Movie (MPEG)
415 </label>
416 <widgettype>
417 movie
418 </widgettype>
419 <impl>
420 media_plugin_quicktime
421 </impl>
422 </mimetype>
423 <mimetype name="video/mp4">
424 <label name="video/mp4_label">
425 Movie (MP4)
426 </label>
427 <widgettype>
428 movie
429 </widgettype>
430 <impl>
431 media_plugin_quicktime
432 </impl>
433 </mimetype>
434 <mimetype menu="1" name="video/quicktime">
435 <label name="video/quicktime_label">
436 Movie (QuickTime)
437 </label>
438 <widgettype>
439 movie
440 </widgettype>
441 <impl>
442 media_plugin_quicktime
443 </impl>
444 </mimetype>
445 <mimetype name="video/x-ms-asf">
446 <label name="video/x-ms-asf_label">
447 Movie (Windows Media ASF)
448 </label>
449 <widgettype>
450 movie
451 </widgettype>
452 <impl>
453 media_plugin_quicktime
454 </impl>
455 </mimetype>
456 <mimetype name="video/x-ms-wmv">
457 <label name="video/x-ms-wmv_label">
458 Movie (Windows Media WMV)
459 </label>
460 <widgettype>
461 movie
462 </widgettype>
463 <impl>
464 media_plugin_quicktime
465 </impl>
466 </mimetype>
467 <mimetype menu="1" name="video/x-msvideo">
468 <label name="video/x-msvideo_label">
469 Movie (AVI)
470 </label>
471 <widgettype>
472 movie
473 </widgettype>
474 <impl>
475 media_plugin_quicktime
476 </impl>
477 </mimetype>
478</mimetypes>
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_windows.xml
index e3d1021..abc7f1a 100644
--- a/linden/indra/newview/skins/default/xui/en-us/mime_types.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/mime_types_windows.xml
@@ -7,7 +7,7 @@
7 none 7 none
8 </defaultwidget> 8 </defaultwidget>
9 <defaultimpl> 9 <defaultimpl>
10 LLMediaImplLLMozLib 10 media_plugin_webkit
11 </defaultimpl> 11 </defaultimpl>
12 <widgetset name="web"> 12 <widgetset name="web">
13 <label name="web_label"> 13 <label name="web_label">
@@ -55,27 +55,6 @@
55 true 55 true
56 </allow_looping> 56 </allow_looping>
57 </widgetset> 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"> 58 <widgetset name="image">
80 <label name="image_label"> 59 <label name="image_label">
81 Image 60 Image
@@ -129,6 +108,9 @@
129 <widgettype> 108 <widgettype>
130 movie 109 movie
131 </widgettype> 110 </widgettype>
111 <impl>
112 media_plugin_quicktime
113 </impl>
132 </scheme> 114 </scheme>
133 <mimetype name="blank"> 115 <mimetype name="blank">
134 <label name="blank_label"> 116 <label name="blank_label">
@@ -138,7 +120,7 @@
138 none 120 none
139 </widgettype> 121 </widgettype>
140 <impl> 122 <impl>
141 LLMediaImplQuickTime 123 media_plugin_quicktime
142 </impl> 124 </impl>
143 </mimetype> 125 </mimetype>
144 <mimetype name="none/none"> 126 <mimetype name="none/none">
@@ -175,14 +157,14 @@
175 </mimetype> 157 </mimetype>
176 <mimetype menu="1" name="video/vnd.secondlife.qt.legacy"> 158 <mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
177 <label name="vnd.secondlife.qt.legacy_label"> 159 <label name="vnd.secondlife.qt.legacy_label">
178 Movie (QuickTime) 160 Movie (gstreamer)
179 </label> 161 </label>
180 <widgettype> 162 <widgettype>
181 movie 163 movie
182 </widgettype> 164 </widgettype>
183 <impl> 165 <impl>
184 LLMediaImplQuickTime 166 media_plugin_quicktime
185 </impl> 167 </impl>
186 </mimetype> 168 </mimetype>
187 <mimetype name="application/javascript"> 169 <mimetype name="application/javascript">
188 <label name="application/javascript_label"> 170 <label name="application/javascript_label">
@@ -231,6 +213,9 @@
231 <widgettype> 213 <widgettype>
232 movie 214 movie
233 </widgettype> 215 </widgettype>
216 <impl>
217 media_plugin_quicktime
218 </impl>
234 </mimetype> 219 </mimetype>
235 <mimetype name="application/xhtml+xml"> 220 <mimetype name="application/xhtml+xml">
236 <label name="application/xhtml+xml_label"> 221 <label name="application/xhtml+xml_label">
@@ -248,14 +233,6 @@
248 image 233 image
249 </widgettype> 234 </widgettype>
250 </mimetype> 235 </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"> 236 <mimetype name="audio/mid">
260 <label name="audio/mid_label"> 237 <label name="audio/mid_label">
261 Audio (MIDI) 238 Audio (MIDI)
@@ -263,6 +240,9 @@
263 <widgettype> 240 <widgettype>
264 audio 241 audio
265 </widgettype> 242 </widgettype>
243 <impl>
244 media_plugin_quicktime
245 </impl>
266 </mimetype> 246 </mimetype>
267 <mimetype name="audio/mpeg"> 247 <mimetype name="audio/mpeg">
268 <label name="audio/mpeg_label"> 248 <label name="audio/mpeg_label">
@@ -271,6 +251,9 @@
271 <widgettype> 251 <widgettype>
272 audio 252 audio
273 </widgettype> 253 </widgettype>
254 <impl>
255 media_plugin_quicktime
256 </impl>
274 </mimetype> 257 </mimetype>
275 <mimetype name="audio/x-aiff"> 258 <mimetype name="audio/x-aiff">
276 <label name="audio/x-aiff_label"> 259 <label name="audio/x-aiff_label">
@@ -279,6 +262,9 @@
279 <widgettype> 262 <widgettype>
280 audio 263 audio
281 </widgettype> 264 </widgettype>
265 <impl>
266 media_plugin_quicktime
267 </impl>
282 </mimetype> 268 </mimetype>
283 <mimetype name="audio/x-wav"> 269 <mimetype name="audio/x-wav">
284 <label name="audio/x-wav_label"> 270 <label name="audio/x-wav_label">
@@ -287,6 +273,9 @@
287 <widgettype> 273 <widgettype>
288 audio 274 audio
289 </widgettype> 275 </widgettype>
276 <impl>
277 media_plugin_quicktime
278 </impl>
290 </mimetype> 279 </mimetype>
291 <mimetype menu="1" name="image/bmp"> 280 <mimetype menu="1" name="image/bmp">
292 <label name="image/bmp_label"> 281 <label name="image/bmp_label">
@@ -296,7 +285,7 @@
296 image 285 image
297 </widgettype> 286 </widgettype>
298 <impl> 287 <impl>
299 LLMediaImplLLMozLib 288 media_plugin_webkit
300 </impl> 289 </impl>
301 </mimetype> 290 </mimetype>
302 <mimetype menu="1" name="image/gif"> 291 <mimetype menu="1" name="image/gif">
@@ -307,7 +296,7 @@
307 image 296 image
308 </widgettype> 297 </widgettype>
309 <impl> 298 <impl>
310 LLMediaImplLLMozLib 299 media_plugin_webkit
311 </impl> 300 </impl>
312 </mimetype> 301 </mimetype>
313 <mimetype menu="1" name="image/jpeg"> 302 <mimetype menu="1" name="image/jpeg">
@@ -318,7 +307,7 @@
318 image 307 image
319 </widgettype> 308 </widgettype>
320 <impl> 309 <impl>
321 LLMediaImplLLMozLib 310 media_plugin_webkit
322 </impl> 311 </impl>
323 </mimetype> 312 </mimetype>
324 <mimetype menu="1" name="image/png"> 313 <mimetype menu="1" name="image/png">
@@ -329,7 +318,7 @@
329 image 318 image
330 </widgettype> 319 </widgettype>
331 <impl> 320 <impl>
332 LLMediaImplLLMozLib 321 media_plugin_webkit
333 </impl> 322 </impl>
334 </mimetype> 323 </mimetype>
335 <mimetype name="image/svg+xml"> 324 <mimetype name="image/svg+xml">
@@ -340,7 +329,7 @@
340 image 329 image
341 </widgettype> 330 </widgettype>
342 <impl> 331 <impl>
343 LLMediaImplLLMozLib 332 media_plugin_webkit
344 </impl> 333 </impl>
345 </mimetype> 334 </mimetype>
346 <mimetype menu="1" name="image/tiff"> 335 <mimetype menu="1" name="image/tiff">
@@ -351,7 +340,7 @@
351 image 340 image
352 </widgettype> 341 </widgettype>
353 <impl> 342 <impl>
354 LLMediaImplLLMozLib 343 media_plugin_webkit
355 </impl> 344 </impl>
356 </mimetype> 345 </mimetype>
357 <mimetype menu="1" name="text/html"> 346 <mimetype menu="1" name="text/html">
@@ -362,8 +351,8 @@
362 web 351 web
363 </widgettype> 352 </widgettype>
364 <impl> 353 <impl>
365 LLMediaImplLLMozLib 354 media_plugin_webkit
366 </impl> 355 </impl>
367 </mimetype> 356 </mimetype>
368 <mimetype menu="1" name="text/plain"> 357 <mimetype menu="1" name="text/plain">
369 <label name="text/plain_label"> 358 <label name="text/plain_label">
@@ -373,7 +362,7 @@
373 text 362 text
374 </widgettype> 363 </widgettype>
375 <impl> 364 <impl>
376 LLMediaImplLLMozLib 365 media_plugin_webkit
377 </impl> 366 </impl>
378 </mimetype> 367 </mimetype>
379 <mimetype name="text/xml"> 368 <mimetype name="text/xml">
@@ -384,7 +373,7 @@
384 text 373 text
385 </widgettype> 374 </widgettype>
386 <impl> 375 <impl>
387 LLMediaImplLLMozLib 376 media_plugin_webkit
388 </impl> 377 </impl>
389 </mimetype> 378 </mimetype>
390 <mimetype menu="1" name="video/mpeg"> 379 <mimetype menu="1" name="video/mpeg">
@@ -395,8 +384,8 @@
395 movie 384 movie
396 </widgettype> 385 </widgettype>
397 <impl> 386 <impl>
398 LLMediaImplQuickTime 387 media_plugin_quicktime
399 </impl> 388 </impl>
400 </mimetype> 389 </mimetype>
401 <mimetype name="video/mp4"> 390 <mimetype name="video/mp4">
402 <label name="video/mp4_label"> 391 <label name="video/mp4_label">
@@ -406,19 +395,19 @@
406 movie 395 movie
407 </widgettype> 396 </widgettype>
408 <impl> 397 <impl>
409 LLMediaImplQuickTime 398 media_plugin_quicktime
410 </impl> 399 </impl>
411 </mimetype> 400 </mimetype>
412 <mimetype menu="1" name="video/quicktime"> 401 <mimetype menu="1" name="video/gstreamer">
413 <label name="video/quicktime_label"> 402 <label name="video/gstreamer_label">
414 Movie (QuickTime) 403 Movie (gstreamer)
415 </label> 404 </label>
416 <widgettype> 405 <widgettype>
417 movie 406 movie
418 </widgettype> 407 </widgettype>
419 <impl> 408 <impl>
420 LLMediaImplQuickTime 409 media_plugin_quicktime
421 </impl> 410 </impl>
422 </mimetype> 411 </mimetype>
423 <mimetype name="video/x-ms-asf"> 412 <mimetype name="video/x-ms-asf">
424 <label name="video/x-ms-asf_label"> 413 <label name="video/x-ms-asf_label">
@@ -428,8 +417,8 @@
428 movie 417 movie
429 </widgettype> 418 </widgettype>
430 <impl> 419 <impl>
431 LLMediaImplQuickTime 420 media_plugin_quicktime
432 </impl> 421 </impl>
433 </mimetype> 422 </mimetype>
434 <mimetype name="video/x-ms-wmv"> 423 <mimetype name="video/x-ms-wmv">
435 <label name="video/x-ms-wmv_label"> 424 <label name="video/x-ms-wmv_label">
@@ -439,8 +428,8 @@
439 movie 428 movie
440 </widgettype> 429 </widgettype>
441 <impl> 430 <impl>
442 LLMediaImplQuickTime 431 media_plugin_quicktime
443 </impl> 432 </impl>
444 </mimetype> 433 </mimetype>
445 <mimetype menu="1" name="video/x-msvideo"> 434 <mimetype menu="1" name="video/x-msvideo">
446 <label name="video/x-msvideo_label"> 435 <label name="video/x-msvideo_label">
@@ -450,7 +439,7 @@
450 movie 439 movie
451 </widgettype> 440 </widgettype>
452 <impl> 441 <impl>
453 LLMediaImplQuickTime 442 media_plugin_quicktime
454 </impl> 443 </impl>
455 </mimetype> 444 </mimetype>
456</mimetypes> 445</mimetypes>
diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml
index 0ac7401..9c265d2 100644
--- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml
@@ -5556,7 +5556,25 @@ Apple&apos;s QuickTime software does not appear to be installed on your system.
5556 5556
5557If you want to view streaming media on parcels that support it you should go to the QuickTime site (http://www.apple.com/quicktime) and install the QuickTime Player. 5557If you want to view streaming media on parcels that support it you should go to the QuickTime site (http://www.apple.com/quicktime) and install the QuickTime Player.
5558</notification> 5558</notification>
5559<notification
5560 icon="notify.tga"
5561 name="NoPlugin"
5562 type="notify">
5563No Media Plugin was found to handle the "[MIME_TYPE]" mime type. Media of this type will be unavailable.
5564</notification>
5565<notification
5566 icon="alertmodal.tga"
5567 name="MediaPluginFailed"
5568 type="alertmodal">
5569The following Media Plugin has failed:
5570[PLUGIN]
5559 5571
5572Please re-install the plugin or contact the vendor if you continue to experience problems.
5573 <form name="form">
5574 <ignore name="ignore"
5575 text="When a Media Plugin fails"/>
5576 </form>
5577</notification>
5560<notification 5578<notification
5561 icon="notify.tga" 5579 icon="notify.tga"
5562 name="OwnedObjectsReturned" 5580 name="OwnedObjectsReturned"
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/skins/default/xui/zh/mime_types.xml b/linden/indra/newview/skins/default/xui/zh/mime_types.xml
index fc5fae4..0cc6f2f 100644
--- a/linden/indra/newview/skins/default/xui/zh/mime_types.xml
+++ b/linden/indra/newview/skins/default/xui/zh/mime_types.xml
@@ -1,14 +1,5 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<mimetypes name="default"> 2<mimetypes name="default">
3 <defaultlabel>
4 (未知)
5 </defaultlabel>
6 <defaultwidget>
7 æ— 
8 </defaultwidget>
9 <defaultimpl>
10 LLMediaImplLLMozLib
11 </defaultimpl>
12 <widgetset name="web"> 3 <widgetset name="web">
13 <label name="web_label"> 4 <label name="web_label">
14 网页内容 5 网页内容
diff --git a/linden/indra/newview/viewer_manifest.py b/linden/indra/newview/viewer_manifest.py
index ff59aec..ab88920 100755
--- a/linden/indra/newview/viewer_manifest.py
+++ b/linden/indra/newview/viewer_manifest.py
@@ -231,6 +231,12 @@ class WindowsManifest(ViewerManifest):
231 231
232 self.path("imprudence.url") 232 self.path("imprudence.url")
233 233
234 # Plugin host application
235 self.path(os.path.join(os.pardir,
236 'llplugin', 'slplugin', self.args['configuration'], "SLPlugin.exe"),
237 "SLPlugin.exe")
238
239
234 self.path("featuretable.txt") 240 self.path("featuretable.txt")
235 241
236 # For use in crash reporting (generates minidumps) 242 # For use in crash reporting (generates minidumps)
@@ -253,7 +259,45 @@ class WindowsManifest(ViewerManifest):
253 self.path("alut.dll") 259 self.path("alut.dll")
254 self.end_prefix() 260 self.end_prefix()
255 261
256 # Mozilla appears to force a dependency on these files so we need to ship it (CP) - updated to vc8 versions (nyx) 262 # Media plugins - QuickTime
263 if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"):
264 self.path("media_plugin_quicktime.dll")
265 self.end_prefix()
266
267 # Media plugins - WebKit/Qt
268 if self.prefix(src='../media_plugins/webkit/%s' % self.args['configuration'], dst="llplugin"):
269 self.path("media_plugin_webkit.dll")
270 self.end_prefix()
271
272 # Media plugins - Gstreamer
273 if self.prefix(src='../media_plugins/gstreamer/%s' % self.args['configuration'], dst="llplugin"):
274 self.path("media_plugin_gstreamer010.dll", "media_plugin_gstreamer.dll")
275 self.end_prefix()
276
277 # For WebKit/Qt plugin runtimes
278 if self.prefix(src="../../libraries/i686-win32/lib/release", dst="llplugin"):
279 self.path("libeay32.dll")
280 self.path("qtcore4.dll")
281 self.path("qtgui4.dll")
282 self.path("qtnetwork4.dll")
283 self.path("qtopengl4.dll")
284 self.path("qtwebkit4.dll")
285 self.path("ssleay32.dll")
286 self.end_prefix()
287
288 # For WebKit/Qt plugin runtimes (image format plugins)
289 if self.prefix(src="../../libraries/i686-win32/lib/release/imageformats", dst="llplugin/imageformats"):
290 self.path("qgif4.dll")
291 self.path("qico4.dll")
292 self.path("qjpeg4.dll")
293 self.path("qmng4.dll")
294 self.path("qsvg4.dll")
295 self.path("qtiff4.dll")
296 self.end_prefix()
297
298 # Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
299 self.path("skins/default/xui/en-us/mime_types_windows.xml", "skins/default/xui/en-us/mime_types.xml")
300
257 # These need to be installed as a SxS assembly, currently a 'private' assembly. 301 # These need to be installed as a SxS assembly, currently a 'private' assembly.
258 # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx 302 # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx
259 if self.prefix(src=self.args['configuration'], dst=""): 303 if self.prefix(src=self.args['configuration'], dst=""):
@@ -280,34 +324,6 @@ class WindowsManifest(ViewerManifest):
280 # same thing for auto-updater. 324 # same thing for auto-updater.
281 #self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst="updater.exe.config") 325 #self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst="updater.exe.config")
282 326
283 # Mozilla runtime DLLs (CP)
284 if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):
285 self.path("freebl3.dll")
286 self.path("js3250.dll")
287 self.path("nspr4.dll")
288 self.path("nss3.dll")
289 self.path("nssckbi.dll")
290 self.path("plc4.dll")
291 self.path("plds4.dll")
292 self.path("smime3.dll")
293 self.path("softokn3.dll")
294 self.path("ssl3.dll")
295 self.path("xpcom.dll")
296 self.path("xul.dll")
297 self.end_prefix()
298
299 # Mozilla runtime misc files (CP)
300 if self.prefix(src="app_settings/mozilla"):
301 self.path("chrome/*.*")
302 self.path("components/*.*")
303 self.path("greprefs/*.*")
304 self.path("plugins/*.*")
305 self.path("res/*.*")
306 self.path("res/*/*")
307 self.end_prefix()
308
309 # Mozilla hack to get it to accept newer versions of msvc*80.dll than are listed in manifest
310 # 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
311 # Vivox runtimes 327 # Vivox runtimes
312 if self.prefix(src="vivox-runtime/i686-win32", dst=""): 328 if self.prefix(src="vivox-runtime/i686-win32", dst=""):
313 # self.path("alut.dll") 329 # self.path("alut.dll")
@@ -540,10 +556,7 @@ class DarwinManifest(ViewerManifest):
540 self.path(self.args['configuration'] + "/Imprudence.app", dst="") 556 self.path(self.args['configuration'] + "/Imprudence.app", dst="")
541 557
542 if self.prefix(src="", dst="Contents"): # everything goes in Contents 558 if self.prefix(src="", dst="Contents"): # everything goes in Contents
543 # Expand the tar file containing the assorted mozilla bits into 559
544 # <bundle>/Contents/MacOS/
545 self.contents_of_tar(self.args['source']+'/mozilla-universal-darwin.tgz', 'MacOS')
546
547 self.path("Info-Imprudence.plist", dst="Info.plist") 560 self.path("Info-Imprudence.plist", dst="Info.plist")
548 561
549 # copy additional libs in <bundle>/Contents/MacOS/ 562 # copy additional libs in <bundle>/Contents/MacOS/
@@ -596,12 +609,6 @@ class DarwinManifest(ViewerManifest):
596 609
597 self.end_prefix("../../libraries/universal-darwin/lib_release") 610 self.end_prefix("../../libraries/universal-darwin/lib_release")
598 611
599 # replace the default theme with our custom theme (so scrollbars work).
600 if self.prefix(src="mozilla-theme", dst="MacOS/chrome"):
601 self.path("classic.jar")
602 self.path("classic.manifest")
603 self.end_prefix("MacOS/chrome")
604
605 # most everything goes in the Resources directory 612 # most everything goes in the Resources directory
606 if self.prefix(src="", dst="Resources"): 613 if self.prefix(src="", dst="Resources"):
607 super(DarwinManifest, self).construct() 614 super(DarwinManifest, self).construct()
@@ -729,7 +736,21 @@ class DarwinManifest(ViewerManifest):
729 # our apps 736 # our apps
730# self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app") 737# self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app")
731 self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app") 738 self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app")
739
740 # plugin launcher
741 self.path("../llplugin/slplugin/" + self.args['configuration'] + "/SLPlugin", "SLPlugin")
732 742
743 # plugins
744 if self.prefix(src="", dst="llplugin"):
745 self.path("../media_plugins/quicktime/" + self.args['configuration'] + "/media_plugin_quicktime.dylib", "media_plugin_quicktime.dylib")
746 self.path("../media_plugins/webkit/" + self.args['configuration'] + "/media_plugin_webkit.dylib", "media_plugin_webkit.dylib")
747 self.path("../../libraries/universal-darwin/lib_release/libllqtwebkit.dylib", "libllqtwebkit.dylib")
748
749 self.end_prefix("llplugin")
750
751 # Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
752 self.path("skins/default/xui/en-us/mime_types_mac.xml", "skins/default/xui/en-us/mime_types.xml")
753
733 # command line arguments for connecting to the proper grid 754 # command line arguments for connecting to the proper grid
734 self.put_in_file(self.flags_list(), 'arguments.txt') 755 self.put_in_file(self.flags_list(), 'arguments.txt')
735 756
@@ -772,7 +793,7 @@ class DarwinManifest(ViewerManifest):
772 # make sure we don't have stale files laying about 793 # make sure we don't have stale files laying about
773 self.remove(sparsename, finalname) 794 self.remove(sparsename, finalname)
774 795
775 self.run_command('hdiutil create "%(sparse)s" -volname "%(vol)s" -fs HFS+ -type SPARSE -megabytes 300 -layout SPUD' % { 796 self.run_command('hdiutil create "%(sparse)s" -volname "%(vol)s" -fs HFS+ -type SPARSE -megabytes 400 -layout SPUD' % {
776 'sparse':sparsename, 797 'sparse':sparsename,
777 'vol':volname}) 798 'vol':volname})
778 799
@@ -857,6 +878,23 @@ class LinuxManifest(ViewerManifest):
857 878
858 # Create an appropriate gridargs.dat for this package, denoting required grid. 879 # Create an appropriate gridargs.dat for this package, denoting required grid.
859 self.put_in_file(self.flags_list(), 'gridargs.dat') 880 self.put_in_file(self.flags_list(), 'gridargs.dat')
881 self.path("linux_tools/launch_url.sh","launch_url.sh")
882 self.path("../llplugin/slplugin/SLPlugin", "bin/SLPlugin")
883 if self.prefix("res-sdl"):
884 self.path("*")
885 # recurse
886 self.end_prefix("res-sdl")
887
888 # plugins
889 if self.prefix(src="", dst="bin/llplugin"):
890 self.path("../media_plugins/webkit/libmedia_plugin_webkit.so", "libmedia_plugin_webkit.so")
891 self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
892 self.end_prefix("bin/llplugin")
893
894 # Per platform MIME config on the cheap. See SNOW-307 / DEV-41388
895 self.path("skins/default/xui/en-us/mime_types_linux.xml", "skins/default/xui/en-us/mime_types.xml")
896
897 self.path("featuretable_linux.txt")
860 898
861 899
862 def package_finish(self): 900 def package_finish(self):
@@ -910,17 +948,6 @@ class Linux_i686Manifest(LinuxManifest):
910 def construct(self): 948 def construct(self):
911 super(Linux_i686Manifest, self).construct() 949 super(Linux_i686Manifest, self).construct()
912 self.path("imprudence-stripped","bin/do-not-directly-run-imprudence-bin") 950 self.path("imprudence-stripped","bin/do-not-directly-run-imprudence-bin")
913# self.path("../linux_crash_logger/linux-crash-logger-stripped","linux-crash-logger.bin")
914 self.path("linux_tools/launch_url.sh","launch_url.sh")
915 if self.prefix("res-sdl"):
916 self.path("*")
917 # recurse
918 self.end_prefix("res-sdl")
919
920 self.path("featuretable_linux.txt")
921 #self.path("secondlife-i686.supp")
922
923 self.path("app_settings/mozilla-runtime-linux-i686")
924 951
925 if (not self.standalone()) and self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"): 952 if (not self.standalone()) and self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"):
926 self.path("libapr-1.so.0") 953 self.path("libapr-1.so.0")
@@ -956,68 +983,69 @@ class Linux_i686Manifest(LinuxManifest):
956 # self.path("libpangoxft-1.0.so.0") 983 # self.path("libpangoxft-1.0.so.0")
957 ##self.path("libpixman-1.so.0") 984 ##self.path("libpixman-1.so.0")
958 985
959 # Gstreamer libs 986#KILL IT WITH FIRE
960 self.path("libgstbase-0.10.so.0") 987 ## Gstreamer libs
961 self.path("libgstreamer-0.10.so.0") 988 #self.path("libgstbase-0.10.so.0")
962 self.path("libgstaudio-0.10.so.0") 989 #self.path("libgstreamer-0.10.so.0")
963 self.path("libgstbase-0.10.so.0") 990 #self.path("libgstaudio-0.10.so.0")
964 self.path("libgstcontroller-0.10.so.0") 991 #self.path("libgstbase-0.10.so.0")
965 self.path("libgstdataprotocol-0.10.so.0") 992 #self.path("libgstcontroller-0.10.so.0")
966 self.path("libgstinterfaces-0.10.so.0") 993 #self.path("libgstdataprotocol-0.10.so.0")
967 self.path("libgstnetbuffer-0.10.so.0") 994 #self.path("libgstinterfaces-0.10.so.0")
968 self.path("libgstpbutils-0.10.so.0") 995 #self.path("libgstnetbuffer-0.10.so.0")
969 self.path("libgstriff-0.10.so.0") 996 #self.path("libgstpbutils-0.10.so.0")
970 self.path("libgstrtp-0.10.so.0") 997 #self.path("libgstriff-0.10.so.0")
971 self.path("libgstrtsp-0.10.so.0") 998 #self.path("libgstrtp-0.10.so.0")
972 self.path("libgstsdp-0.10.so.0") 999 #self.path("libgstrtsp-0.10.so.0")
973 self.path("libgsttag-0.10.so.0") 1000 #self.path("libgstsdp-0.10.so.0")
974 self.path("libgstvideo-0.10.so.0") 1001 #self.path("libgsttag-0.10.so.0")
975 1002 #self.path("libgstvideo-0.10.so.0")
976 # Gstreamer plugin dependencies 1003
977 self.path("libfaad.so.0") 1004 ## Gstreamer plugin dependencies
978 self.path("libogg.so.0") 1005 #self.path("libfaad.so.0")
979 self.path("libtheora.so.0") 1006 #self.path("libogg.so.0")
980 self.path("libvorbis.so.0") 1007 #self.path("libtheora.so.0")
981 self.path("libvorbisenc.so.2") 1008 #self.path("libvorbis.so.0")
982 self.path("liboil-0.3.so.0") 1009 #self.path("libvorbisenc.so.2")
983 1010 #self.path("liboil-0.3.so.0")
984 # Gstreamer plugins 1011
985 if self.prefix("gstreamer-plugins"): 1012 ## Gstreamer plugins
986 self.path("libgstalsa.so") 1013 #if self.prefix("gstreamer-plugins"):
987 self.path("libgstasf.so") 1014 #self.path("libgstalsa.so")
988 self.path("libgstaudioconvert.so") 1015 #self.path("libgstasf.so")
989 self.path("libgstaudioresample.so") 1016 #self.path("libgstaudioconvert.so")
990 self.path("libgstautodetect.so") 1017 #self.path("libgstaudioresample.so")
991 self.path("libgstavi.so") 1018 #self.path("libgstautodetect.so")
992 self.path("libgstcoreelements.so") 1019 #self.path("libgstavi.so")
993 self.path("libgstcoreindexers.so") 1020 #self.path("libgstcoreelements.so")
994 self.path("libgstdecodebin2.so") 1021 #self.path("libgstcoreindexers.so")
995 self.path("libgstdecodebin.so") 1022 #self.path("libgstdecodebin2.so")
996 self.path("libgstesd.so") 1023 #self.path("libgstdecodebin.so")
997 self.path("libgstfaad.so") 1024 #self.path("libgstesd.so")
998 self.path("libgstffmpeg.so") 1025 #self.path("libgstfaad.so")
999 self.path("libgstgnomevfs.so") 1026 #self.path("libgstffmpeg.so")
1000 self.path("libgsticydemux.so") 1027 #self.path("libgstgnomevfs.so")
1001 self.path("libgstid3demux.so") 1028 #self.path("libgsticydemux.so")
1002 self.path("libgstmpegdemux.so") 1029 #self.path("libgstid3demux.so")
1003 self.path("libgstmultifile.so") 1030 #self.path("libgstmpegdemux.so")
1004 self.path("libgstmultipart.so") 1031 #self.path("libgstmultifile.so")
1005 self.path("libgstogg.so") 1032 #self.path("libgstmultipart.so")
1006 self.path("libgstossaudio.so") 1033 #self.path("libgstogg.so")
1007 self.path("libgstplaybin.so") 1034 #self.path("libgstossaudio.so")
1008 self.path("libgstpulse.so") 1035 #self.path("libgstplaybin.so")
1009 self.path("libgstqtdemux.so") 1036 #self.path("libgstpulse.so")
1010 self.path("libgstqueue2.so") 1037 #self.path("libgstqtdemux.so")
1011 self.path("libgsttcp.so") 1038 #self.path("libgstqueue2.so")
1012 self.path("libgsttheora.so") 1039 #self.path("libgsttcp.so")
1013 self.path("libgsttypefindfunctions.so") 1040 #self.path("libgsttheora.so")
1014 self.path("libgstudp.so") 1041 #self.path("libgsttypefindfunctions.so")
1015 self.path("libgstvideoscale.so") 1042 #self.path("libgstudp.so")
1016 self.path("libgstvolume.so") 1043 #self.path("libgstvideoscale.so")
1017 self.path("libgstvorbis.so") 1044 #self.path("libgstvolume.so")
1018 self.path("libgstwavparse.so") 1045 #self.path("libgstvorbis.so")
1046 #self.path("libgstwavparse.so")
1019 1047
1020 self.end_prefix("gstreamer-plugins") 1048 #self.end_prefix("gstreamer-plugins")
1021 1049
1022 self.end_prefix("lib") 1050 self.end_prefix("lib")
1023 1051
@@ -1047,9 +1075,6 @@ class Linux_x86_64Manifest(LinuxManifest):
1047 self.path("featuretable_linux.txt") 1075 self.path("featuretable_linux.txt")
1048 #self.path("secondlife-x86_64.supp") 1076 #self.path("secondlife-x86_64.supp")
1049 1077
1050 if not self.standalone():
1051 self.path("app_settings/mozilla-runtime-linux-x86_64")
1052
1053 if (not self.standalone()) and self.prefix("../../libraries/x86_64-linux/lib_release_client", dst="lib64"): 1078 if (not self.standalone()) and self.prefix("../../libraries/x86_64-linux/lib_release_client", dst="lib64"):
1054 self.path("libapr-1.so.0") 1079 self.path("libapr-1.so.0")
1055 self.path("libaprutil-1.so.0") 1080 self.path("libaprutil-1.so.0")
@@ -1061,7 +1086,7 @@ class Linux_x86_64Manifest(LinuxManifest):
1061 self.path("libuuid.so", "libuuid.so.1") 1086 self.path("libuuid.so", "libuuid.so.1")
1062 self.path("libSDL-1.2.so.0") 1087 self.path("libSDL-1.2.so.0")
1063 self.path("libELFIO.so") 1088 self.path("libELFIO.so")
1064 self.path("libjpeg.so.7") 1089 self.path("libjpeg.so.62")
1065 self.path("libpng12.so.0") 1090 self.path("libpng12.so.0")
1066 self.path("libopenjpeg.so.2") 1091 self.path("libopenjpeg.so.2")
1067 self.path("libxml2.so.2") 1092 self.path("libxml2.so.2")
@@ -1077,7 +1102,8 @@ class Linux_x86_64Manifest(LinuxManifest):
1077 ##self.path("libcairo.so.2") 1102 ##self.path("libcairo.so.2")
1078 ##self.path("libfontconfig.so.1") 1103 ##self.path("libfontconfig.so.1")
1079 ##self.path("libfreetype.so.6") 1104 ##self.path("libfreetype.so.6")
1080# self.path("libgdk_pixbuf-2.0.so.0") # use systems gdk pixbufs instead 1105 self.path("libgdk_pixbuf-2.0.so.0") # was commented to use systems gdk pixbufs instead -
1106 # but seems webkit needs it o_O . Packaging for testing now.
1081 ##self.path("libgdk-x11-2.0.so.0") 1107 ##self.path("libgdk-x11-2.0.so.0")
1082 ##self.path("libgtk-x11-2.0.so.0") 1108 ##self.path("libgtk-x11-2.0.so.0")
1083# self.path("libpango-1.0.so.0") # use systems pango instead 1109# self.path("libpango-1.0.so.0") # use systems pango instead
@@ -1086,69 +1112,70 @@ class Linux_x86_64Manifest(LinuxManifest):
1086# self.path("libpangoxft-1.0.so.0") # So we depend system gdk pixbufs and pango anyway. 1112# self.path("libpangoxft-1.0.so.0") # So we depend system gdk pixbufs and pango anyway.
1087 ##self.path("libpixman-1.so.0") 1113 ##self.path("libpixman-1.so.0")
1088 1114
1089 # Gstreamer libs 1115#KILL IT WITH FIRE
1090 self.path("libgstbase-0.10.so.0") 1116 ## Gstreamer libs
1091 self.path("libgstreamer-0.10.so.0") 1117 #self.path("libgstbase-0.10.so.0")
1092 self.path("libgstaudio-0.10.so.0") 1118 #self.path("libgstreamer-0.10.so.0")
1093 self.path("libgstbase-0.10.so.0") 1119 #self.path("libgstaudio-0.10.so.0")
1094 self.path("libgstcontroller-0.10.so.0") 1120 #self.path("libgstbase-0.10.so.0")
1095 self.path("libgstdataprotocol-0.10.so.0") 1121 #self.path("libgstcontroller-0.10.so.0")
1096 self.path("libgstinterfaces-0.10.so.0") 1122 #self.path("libgstdataprotocol-0.10.so.0")
1097 self.path("libgstnetbuffer-0.10.so.0") 1123 #self.path("libgstinterfaces-0.10.so.0")
1098 self.path("libgstpbutils-0.10.so.0") 1124 #self.path("libgstnetbuffer-0.10.so.0")
1099 self.path("libgstriff-0.10.so.0") 1125 #self.path("libgstpbutils-0.10.so.0")
1100 self.path("libgstrtp-0.10.so.0") 1126 #self.path("libgstriff-0.10.so.0")
1101 self.path("libgstrtsp-0.10.so.0") 1127 #self.path("libgstrtp-0.10.so.0")
1102 self.path("libgstsdp-0.10.so.0") 1128 #self.path("libgstrtsp-0.10.so.0")
1103 self.path("libgsttag-0.10.so.0") 1129 #self.path("libgstsdp-0.10.so.0")
1104 self.path("libgstvideo-0.10.so.0") 1130 #self.path("libgsttag-0.10.so.0")
1105 1131 #self.path("libgstvideo-0.10.so.0")
1106 # Gstreamer plugin dependencies 1132
1107 self.path("libfaad.so.0") 1133 ## Gstreamer plugin dependencies
1108 self.path("libogg.so.0") 1134 #self.path("libfaad.so.0")
1109 self.path("libtheora.so.0") 1135 #self.path("libogg.so.0")
1110 self.path("libvorbis.so.0") 1136 #self.path("libtheora.so.0")
1111 self.path("libvorbisenc.so.2") 1137 #self.path("libvorbis.so.0")
1112 self.path("liboil-0.3.so.0") 1138 #self.path("libvorbisenc.so.2")
1113 1139 #self.path("liboil-0.3.so.0")
1114 # Gstreamer plugins 1140
1115 if self.prefix("gstreamer-plugins"): 1141 ## Gstreamer plugins
1116 self.path("libgstalsa.so") 1142 #if self.prefix("gstreamer-plugins"):
1117 self.path("libgstasf.so") 1143 #self.path("libgstalsa.so")
1118 self.path("libgstaudioconvert.so") 1144 #self.path("libgstasf.so")
1119 self.path("libgstaudioresample.so") 1145 #self.path("libgstaudioconvert.so")
1120 self.path("libgstautodetect.so") 1146 #self.path("libgstaudioresample.so")
1121 self.path("libgstavi.so") 1147 #self.path("libgstautodetect.so")
1122 self.path("libgstcoreelements.so") 1148 #self.path("libgstavi.so")
1123 self.path("libgstcoreindexers.so") 1149 #self.path("libgstcoreelements.so")
1124 self.path("libgstdecodebin2.so") 1150 #self.path("libgstcoreindexers.so")
1125 self.path("libgstdecodebin.so") 1151 #self.path("libgstdecodebin2.so")
1126 self.path("libgstesd.so") 1152 #self.path("libgstdecodebin.so")
1127 self.path("libgstfaad.so") 1153 #self.path("libgstesd.so")
1128 self.path("libgstffmpeg.so") 1154 #self.path("libgstfaad.so")
1129 self.path("libgstffmpegcolorspace.so") 1155 #self.path("libgstffmpeg.so")
1130 self.path("libgstgnomevfs.so") 1156 #self.path("libgstffmpegcolorspace.so")
1131 self.path("libgsticydemux.so") 1157 #self.path("libgstgnomevfs.so")
1132 self.path("libgstid3demux.so") 1158 #self.path("libgsticydemux.so")
1133 self.path("libgstmpegdemux.so") 1159 #self.path("libgstid3demux.so")
1134 self.path("libgstmultifile.so") 1160 #self.path("libgstmpegdemux.so")
1135 self.path("libgstmultipart.so") 1161 #self.path("libgstmultifile.so")
1136 self.path("libgstogg.so") 1162 #self.path("libgstmultipart.so")
1137 self.path("libgstossaudio.so") 1163 #self.path("libgstogg.so")
1138 self.path("libgstplaybin.so") 1164 #self.path("libgstossaudio.so")
1139 self.path("libgstpulse.so") 1165 #self.path("libgstplaybin.so")
1140 self.path("libgstqtdemux.so") 1166 #self.path("libgstpulse.so")
1141 self.path("libgstqueue2.so") 1167 #self.path("libgstqtdemux.so")
1142 self.path("libgsttcp.so") 1168 #self.path("libgstqueue2.so")
1143 self.path("libgsttheora.so") 1169 #self.path("libgsttcp.so")
1144 self.path("libgsttypefindfunctions.so") 1170 #self.path("libgsttheora.so")
1145 self.path("libgstudp.so") 1171 #self.path("libgsttypefindfunctions.so")
1146 self.path("libgstvideoscale.so") 1172 #self.path("libgstudp.so")
1147 self.path("libgstvolume.so") 1173 #self.path("libgstvideoscale.so")
1148 self.path("libgstvorbis.so") 1174 #self.path("libgstvolume.so")
1149 self.path("libgstwavparse.so") 1175 #self.path("libgstvorbis.so")
1176 #self.path("libgstwavparse.so")
1150 1177
1151 self.end_prefix("gstreamer-plugins") 1178 #self.end_prefix("gstreamer-plugins")
1152 self.end_prefix("lib64") 1179 self.end_prefix("lib64")
1153 1180
1154 1181