merge changes for storm-869
commit
4652e26196
10
.hgtags
10
.hgtags
|
|
@ -41,3 +41,13 @@ dc6483491b4af559060bccaef8e9045a303212dd 2.4.0-beta1
|
|||
dc6483491b4af559060bccaef8e9045a303212dd 2.4.0-beta1
|
||||
3bc1f50a72e117f4d4ad8d555f0c785ea8cc201e 2.4.0-beta1
|
||||
25bd6007e3d2fc15db9326ed4b18a24a5969a46a 2.4.0-beta2
|
||||
1ed382c6a08ba3850b6ce9061bc551ddece0ea07 2.4.0-release
|
||||
a82e5b1e22c7f90e3c7977d146b80588f004ed0d 2.5.0-start
|
||||
76f586a8e22b1abe6b2339758c8ac0fa718975de 76f586a8e22b
|
||||
76f586a8e22b1abe6b2339758c8ac0fa718975de 76f586a8e22b
|
||||
0000000000000000000000000000000000000000 76f586a8e22b
|
||||
0000000000000000000000000000000000000000 76f586a8e22b
|
||||
345b17e7cf630db77e840b4fe3451bd476d750a3 76f586a8e22b
|
||||
345b17e7cf630db77e840b4fe3451bd476d750a3 2.5.0-beta1
|
||||
345b17e7cf630db77e840b4fe3451bd476d750a3 76f586a8e22b
|
||||
0000000000000000000000000000000000000000 76f586a8e22b
|
||||
|
|
|
|||
21
BuildParams
21
BuildParams
|
|
@ -46,9 +46,6 @@ viewer-beta.viewer_channel = "Second Life Beta Viewer"
|
|||
viewer-beta.login_channel = "Second Life Beta Viewer"
|
||||
viewer-beta.build_debug_release_separately = true
|
||||
viewer-beta.build_viewer_update_version_manager = true
|
||||
# Settings to test new code ticket service
|
||||
viewer-beta.codeticket_server_url = "http://pdp75.lindenlab.com:8000/codeticket/linden/"
|
||||
viewer-beta.codeticket_add_context = true
|
||||
|
||||
# ========================================
|
||||
# Viewer Release
|
||||
|
|
@ -219,4 +216,22 @@ viewer-experience.public_build = false
|
|||
viewer-experience.viewer_channel = "Second Life SkyLight Viewer"
|
||||
viewer-experience.login_channel = "Second Life SkyLight Viewer"
|
||||
|
||||
# =================================================================
|
||||
# asset delivery 2010 projects
|
||||
# =================================================================
|
||||
viewer-asset-delivery.viewer_channel = "Second Life Development"
|
||||
viewer-asset-delivery.login_channel = "Second Life Development"
|
||||
viewer-asset-delivery.build_viewer_update_version_manager = false
|
||||
viewer-asset-delivery.email = monty@lindenlab.com
|
||||
viewer-asset-delivery.build_server = false
|
||||
viewer-asset-delivery.build_server_tests = false
|
||||
|
||||
viewer-asset-delivery-metrics.viewer_channel = "Second Life Development"
|
||||
viewer-asset-delivery-metrics.login_channel = "Second Life Development"
|
||||
viewer-asset-delivery-metrics.build_viewer_update_version_manager = false
|
||||
viewer-asset-delivery-metrics.email = monty@lindenlab.com
|
||||
viewer-asset-delivery-metrics.build_server = false
|
||||
viewer-asset-delivery-metrics.build_server_tests = false
|
||||
|
||||
|
||||
# eof
|
||||
|
|
|
|||
24
build.sh
24
build.sh
|
|
@ -59,10 +59,11 @@ pre_build()
|
|||
-t $variant \
|
||||
-G "$cmake_generator" \
|
||||
configure \
|
||||
-DGRID:STRING="$viewer_grid" \
|
||||
-DGRID:STRING="$viewer_grid" \
|
||||
-DVIEWER_CHANNEL:STRING="$viewer_channel" \
|
||||
-DVIEWER_LOGIN_CHANNEL:STRING="$login_channel" \
|
||||
-DINSTALL_PROPRIETARY:BOOL=ON \
|
||||
-DRELEASE_CRASH_REPORTING:BOOL=ON \
|
||||
-DLOCALIZESETUP:BOOL=ON \
|
||||
-DPACKAGE:BOOL=ON \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE
|
||||
|
|
@ -169,13 +170,7 @@ do
|
|||
mkdir -p "$build_dir"
|
||||
if pre_build "$variant" "$build_dir" >> "$build_log" 2>&1
|
||||
then
|
||||
if $build_link_parallel
|
||||
then
|
||||
begin_section BuildParallel
|
||||
( build "$variant" "$build_dir" > "$build_dir/build.log" 2>&1 ) &
|
||||
build_processes="$build_processes $!"
|
||||
end_section BuildParallel
|
||||
elif $build_coverity
|
||||
if $build_coverity
|
||||
then
|
||||
mkdir -p "$build_dir/cvbuild"
|
||||
coverity_config=`cygpath --windows "$coverity_dir/config/coverity_config.xml"`
|
||||
|
|
@ -197,7 +192,6 @@ do
|
|||
begin_section CovAnalyze\
|
||||
&&\
|
||||
"$coverity_dir"/bin/cov-analyze\
|
||||
--cxx\
|
||||
--security\
|
||||
--concurrency\
|
||||
--dir "$coverity_tmpdir"\
|
||||
|
|
@ -208,14 +202,14 @@ do
|
|||
begin_section CovCommit\
|
||||
&&\
|
||||
"$coverity_dir"/bin/cov-commit-defects\
|
||||
--product "$coverity_product"\
|
||||
--stream "$coverity_product"\
|
||||
--dir "$coverity_tmpdir"\
|
||||
--remote "$coverity_server"\
|
||||
--host "$coverity_server"\
|
||||
--strip-path "$coverity_root"\
|
||||
--target "$branch/$arch"\
|
||||
--version "$revision"\
|
||||
--description "$repo: $variant $revision"\
|
||||
--user admin --password admin\
|
||||
--user admin --password coverity\
|
||||
>> "$build_log" 2>&1\
|
||||
|| record_failure "Coverity Build Failed"
|
||||
# since any step could have failed, rely on the enclosing block to close any pending sub-blocks
|
||||
|
|
@ -226,6 +220,12 @@ do
|
|||
then
|
||||
upload_item log "$build_dir"/cvbuild/build-log.txt text/plain
|
||||
fi
|
||||
elif $build_link_parallel
|
||||
then
|
||||
begin_section BuildParallel
|
||||
( build "$variant" "$build_dir" > "$build_dir/build.log" 2>&1 ) &
|
||||
build_processes="$build_processes $!"
|
||||
end_section BuildParallel
|
||||
else
|
||||
begin_section "Build$variant"
|
||||
build "$variant" "$build_dir" >> "$build_log" 2>&1
|
||||
|
|
|
|||
|
|
@ -61,19 +61,31 @@ Aimee Trescothick
|
|||
Alejandro Rosenthal
|
||||
VWR-1184
|
||||
Aleric Inglewood
|
||||
SNOW-240
|
||||
SNOW-522
|
||||
SNOW-626
|
||||
SNOW-756
|
||||
SNOW-764
|
||||
VWR-10001
|
||||
VWR-10579
|
||||
VWR-10759
|
||||
VWR-10837
|
||||
VWR-12691
|
||||
VWR-12984
|
||||
VWR-13040
|
||||
VWR-13996
|
||||
VWR-14426
|
||||
VWR-24247
|
||||
VWR-24251
|
||||
VWR-24252
|
||||
VWR-24254
|
||||
VWR-24261
|
||||
VWR-24315
|
||||
VWR-24317
|
||||
VWR-24320
|
||||
SNOW-84
|
||||
SNOW-477
|
||||
SNOW-744
|
||||
SNOW-766
|
||||
STORM-163
|
||||
Ales Beaumont
|
||||
|
|
@ -211,6 +223,10 @@ Catherine Pfeffer
|
|||
Celierra Darling
|
||||
VWR-1274
|
||||
VWR-6975
|
||||
Coaldust Numbers
|
||||
VWR-1095
|
||||
Cron Stardust
|
||||
VWR-10579
|
||||
Cypren Christenson
|
||||
STORM-417
|
||||
Dale Glass
|
||||
|
|
@ -354,12 +370,18 @@ JB Kraft
|
|||
Joghert LeSabre
|
||||
VWR-64
|
||||
Jonathan Yap
|
||||
VWR-17801
|
||||
STORM-523
|
||||
STORM-596
|
||||
STORM-615
|
||||
STORM-616
|
||||
STORM-679
|
||||
STORM-596
|
||||
STORM-723
|
||||
STORM-726
|
||||
STORM-737
|
||||
STORM-869
|
||||
STORM-785
|
||||
STORM-812
|
||||
VWR-17801
|
||||
Kage Pixel
|
||||
VWR-11
|
||||
Ken March
|
||||
|
|
@ -373,6 +395,10 @@ Khyota Wulluf
|
|||
VWR-9966
|
||||
Kitty Barnett
|
||||
VWR-19699
|
||||
STORM-288
|
||||
STORM-799
|
||||
STORM-800
|
||||
VWR-24217
|
||||
Kunnis Basiat
|
||||
VWR-82
|
||||
VWR-102
|
||||
|
|
@ -585,6 +611,7 @@ Robin Cornelius
|
|||
STORM-422
|
||||
VWR-2488
|
||||
VWR-9557
|
||||
VWR-10579
|
||||
VWR-11128
|
||||
VWR-12533
|
||||
VWR-12587
|
||||
|
|
@ -608,6 +635,7 @@ Sammy Frederix
|
|||
VWR-6186
|
||||
Satomi Ahn
|
||||
STORM-501
|
||||
STORM-229
|
||||
Scrippy Scofield
|
||||
VWR-3748
|
||||
Seg Baphomet
|
||||
|
|
@ -714,6 +742,7 @@ Thickbrick Sleaford
|
|||
VWR-9287
|
||||
VWR-13483
|
||||
VWR-13947
|
||||
VWR-24420
|
||||
Thraxis Epsilon
|
||||
SVC-371
|
||||
VWR-383
|
||||
|
|
@ -732,6 +761,8 @@ Tue Torok
|
|||
CT-74
|
||||
Twisted Laws
|
||||
SNOW-352
|
||||
STORM-466
|
||||
STORM-467
|
||||
Vadim Bigbear
|
||||
VWR-2681
|
||||
Vector Hastings
|
||||
|
|
@ -774,10 +805,13 @@ WolfPup Lowenhar
|
|||
STORM-143
|
||||
STORM-255
|
||||
STORM-256
|
||||
STORM-288
|
||||
STORM-535
|
||||
STORM-544
|
||||
STORM-654
|
||||
STORM-674
|
||||
STORM-776
|
||||
STORM-825
|
||||
VWR-20741
|
||||
VWR-20933
|
||||
Zai Lynch
|
||||
|
|
|
|||
|
|
@ -678,20 +678,17 @@
|
|||
<key>EstateChangeInfo</key>
|
||||
<boolean>true</boolean>
|
||||
|
||||
<key>FetchInventoryDescendents</key>
|
||||
<key>FetchInventoryDescendents2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>WebFetchInventoryDescendents</key>
|
||||
<boolean>true</boolean>
|
||||
<key>FetchInventory2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>FetchInventory</key>
|
||||
<boolean>true</boolean>
|
||||
<key>FetchLibDescendents2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>FetchLibDescendents</key>
|
||||
<boolean>true</boolean>
|
||||
|
||||
<key>FetchLib</key>
|
||||
<boolean>true</boolean>
|
||||
<key>FetchLib2</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>UploadBakedTexture</key>
|
||||
<boolean>true</boolean>
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
|
|||
add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llcommon)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llimage)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llkdu)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llimagej2coj)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llinventory)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llmath)
|
||||
|
|
@ -53,10 +54,6 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llvfs)
|
|||
add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llxml)
|
||||
|
||||
if (EXISTS ${LIBS_CLOSED_DIR}llkdu)
|
||||
add_subdirectory(${LIBS_CLOSED_PREFIX}llkdu)
|
||||
endif (EXISTS ${LIBS_CLOSED_DIR}llkdu)
|
||||
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}lscript)
|
||||
|
||||
if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
|
||||
|
|
|
|||
|
|
@ -4,27 +4,28 @@
|
|||
|
||||
include(Variables)
|
||||
|
||||
|
||||
# Portable compilation flags.
|
||||
|
||||
if (EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
|
||||
# The release build should only offer to send crash reports if we're
|
||||
# building from a Linden internal source tree.
|
||||
set(release_crash_reports 1)
|
||||
else (EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
|
||||
set(release_crash_reports 0)
|
||||
endif (EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE
|
||||
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=${release_crash_reports} -DNDEBUG")
|
||||
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DNDEBUG")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
|
||||
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
|
||||
|
||||
# Configure crash reporting
|
||||
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
|
||||
set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")
|
||||
|
||||
if(RELEASE_CRASH_REPORTING)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DLL_SEND_CRASH_REPORTS=1")
|
||||
endif()
|
||||
|
||||
if(NON_RELEASE_CRASH_REPORTING)
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DLL_SEND_CRASH_REPORTS=1")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1")
|
||||
endif()
|
||||
|
||||
# Don't bother with a MinSizeRel build.
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
|
||||
"Supported build types." FORCE)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ set(DB_FIND_REQUIRED ON)
|
|||
if (STANDALONE)
|
||||
include(FindBerkeleyDB)
|
||||
else (STANDALONE)
|
||||
set(DB_LIBRARIES db-4.2)
|
||||
if (LINUX)
|
||||
# Need to add dependency pthread explicitely to support ld.gold.
|
||||
set(DB_LIBRARIES db-4.2 pthread)
|
||||
else (LINUX)
|
||||
set(DB_LIBRARIES db-4.2)
|
||||
endif (LINUX)
|
||||
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ set(cmake_SOURCE_FILES
|
|||
FindMySQL.cmake
|
||||
FindOpenJPEG.cmake
|
||||
FindXmlRpcEpi.cmake
|
||||
FindZLIB.cmake
|
||||
FMOD.cmake
|
||||
FreeType.cmake
|
||||
GStreamer010Plugin.cmake
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ else (STANDALONE)
|
|||
use_prebuilt_binary(curl)
|
||||
if (WINDOWS)
|
||||
set(CURL_LIBRARIES
|
||||
debug libcurld
|
||||
optimized libcurl)
|
||||
debug libcurld.lib
|
||||
optimized libcurl.lib)
|
||||
else (WINDOWS)
|
||||
set(CURL_LIBRARIES curl)
|
||||
set(CURL_LIBRARIES libcurl.a)
|
||||
endif (WINDOWS)
|
||||
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
|
|
|||
|
|
@ -60,22 +60,6 @@ if(WINDOWS)
|
|||
set(release_files ${release_files} fmod.dll)
|
||||
endif (FMOD)
|
||||
|
||||
#*******************************
|
||||
# LLKDU
|
||||
set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
|
||||
if(NOT EXISTS ${internal_llkdu_path})
|
||||
if (EXISTS "${debug_src_dir}/llkdu.dll")
|
||||
set(debug_llkdu_src "${debug_src_dir}/llkdu.dll")
|
||||
set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/llkdu.dll")
|
||||
endif (EXISTS "${debug_src_dir}/llkdu.dll")
|
||||
|
||||
if (EXISTS "${release_src_dir}/llkdu.dll")
|
||||
set(release_llkdu_src "${release_src_dir}/llkdu.dll")
|
||||
set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/llkdu.dll")
|
||||
set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/llkdu.dll")
|
||||
endif (EXISTS "${release_src_dir}/llkdu.dll")
|
||||
endif (NOT EXISTS ${internal_llkdu_path})
|
||||
|
||||
#*******************************
|
||||
# Copy MS C runtime dlls, required for packaging.
|
||||
# *TODO - Adapt this to support VC9
|
||||
|
|
@ -174,21 +158,6 @@ elseif(DARWIN)
|
|||
# fmod is statically linked on darwin
|
||||
set(fmod_files "")
|
||||
|
||||
#*******************************
|
||||
# LLKDU
|
||||
set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
|
||||
if(NOT EXISTS ${internal_llkdu_path})
|
||||
if (EXISTS "${debug_src_dir}/libllkdu.dylib")
|
||||
set(debug_llkdu_src "${debug_src_dir}/libllkdu.dylib")
|
||||
set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/libllkdu.dylib")
|
||||
endif (EXISTS "${debug_src_dir}/libllkdu.dylib")
|
||||
|
||||
if (EXISTS "${release_src_dir}/libllkdu.dylib")
|
||||
set(release_llkdu_src "${release_src_dir}/libllkdu.dylib")
|
||||
set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/libllkdu.dylib")
|
||||
set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/libllkdu.dylib")
|
||||
endif (EXISTS "${release_src_dir}/libllkdu.dylib")
|
||||
endif (NOT EXISTS ${internal_llkdu_path})
|
||||
elseif(LINUX)
|
||||
# linux is weird, multiple side by side configurations aren't supported
|
||||
# and we don't seem to have any debug shared libs built yet anyways...
|
||||
|
|
@ -242,21 +211,6 @@ elseif(LINUX)
|
|||
set(release_files ${release_files} "libfmod-3.75.so")
|
||||
endif (FMOD)
|
||||
|
||||
#*******************************
|
||||
# LLKDU
|
||||
set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
|
||||
if(NOT EXISTS ${internal_llkdu_path})
|
||||
if (EXISTS "${debug_src_dir}/libllkdu.so")
|
||||
set(debug_llkdu_src "${debug_src_dir}/libllkdu.so")
|
||||
set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/libllkdu.so")
|
||||
endif (EXISTS "${debug_src_dir}/libllkdu.so")
|
||||
|
||||
if (EXISTS "${release_src_dir}/libllkdu.so")
|
||||
set(release_llkdu_src "${release_src_dir}/libllkdu.so")
|
||||
set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/libllkdu.so")
|
||||
set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/libllkdu.so")
|
||||
endif (EXISTS "${release_src_dir}/libllkdu.so")
|
||||
endif(NOT EXISTS ${internal_llkdu_path})
|
||||
else(WINDOWS)
|
||||
message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
|
||||
set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
|
||||
|
|
@ -334,40 +288,29 @@ copy_if_different(
|
|||
)
|
||||
set(third_party_targets ${third_party_targets} ${out_targets})
|
||||
|
||||
#*******************************
|
||||
# LLKDU
|
||||
set(internal_llkdu_path "${CMAKE_SOURCE_DIR}/llkdu")
|
||||
if(NOT EXISTS ${internal_llkdu_path})
|
||||
if (EXISTS "${debug_llkdu_src}")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${debug_llkdu_dst}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst}
|
||||
DEPENDS ${debug_llkdu_src}
|
||||
COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_DEBUG}"
|
||||
)
|
||||
set(third_party_targets ${third_party_targets} $} ${debug_llkdu_dst})
|
||||
endif (EXISTS "${debug_llkdu_src}")
|
||||
|
||||
if (EXISTS "${release_llkdu_src}")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${release_llkdu_dst}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst}
|
||||
DEPENDS ${release_llkdu_src}
|
||||
COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELEASE}"
|
||||
)
|
||||
set(third_party_targets ${third_party_targets} ${release_llkdu_dst})
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${relwithdebinfo_llkdu_dst}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst}
|
||||
DEPENDS ${release_llkdu_src}
|
||||
COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
|
||||
)
|
||||
set(third_party_targets ${third_party_targets} ${relwithdebinfo_llkdu_dst})
|
||||
endif (EXISTS "${release_llkdu_src}")
|
||||
|
||||
endif (NOT EXISTS ${internal_llkdu_path})
|
||||
|
||||
if (FMOD_SDK_DIR)
|
||||
copy_if_different(
|
||||
${FMOD_SDK_DIR}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Debug"
|
||||
out_targets
|
||||
${fmod_files}
|
||||
)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different(
|
||||
${FMOD_SDK_DIR}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Release"
|
||||
out_targets
|
||||
${fmod_files}
|
||||
)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different(
|
||||
${FMOD_SDK_DIR}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo"
|
||||
out_targets
|
||||
${fmod_files}
|
||||
)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
endif (FMOD_SDK_DIR)
|
||||
|
||||
if(NOT STANDALONE)
|
||||
add_custom_target(
|
||||
|
|
|
|||
|
|
@ -21,7 +21,12 @@ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
|
|||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Try to find a library that was compiled with the same compiler version as we currently use.
|
||||
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so)
|
||||
IF (STANDALONE)
|
||||
# On standalone, assume that the system installed library was compiled with the used compiler.
|
||||
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so)
|
||||
ENDIF (STANDALONE)
|
||||
FIND_LIBRARY(JSONCPP_LIBRARY
|
||||
NAMES ${JSONCPP_NAMES}
|
||||
PATHS /usr/lib /usr/local/lib
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
# - Find llqtwebkit
|
||||
# Find the llqtwebkit includes and library
|
||||
# This module defines
|
||||
# LLQTWEBKIT_INCLUDE_DIR, where to find llqtwebkit.h, etc.
|
||||
# LLQTWEBKIT_LIBRARY, the llqtwebkit library with full path.
|
||||
# LLQTWEBKIT_FOUND, If false, do not try to use llqtwebkit.
|
||||
# also defined, but not for general use are
|
||||
# LLQTWEBKIT_LIBRARIES, the libraries needed to use llqtwebkit.
|
||||
# LLQTWEBKIT_LIBRARY_DIRS, where to find the llqtwebkit library.
|
||||
# LLQTWEBKIT_DEFINITIONS - You should add_definitions(${LLQTWEBKIT_DEFINITIONS})
|
||||
# before compiling code that includes llqtwebkit library files.
|
||||
|
||||
# Try to use pkg-config first.
|
||||
# This allows to have two different libllqtwebkit packages installed:
|
||||
# one for viewer 2.x and one for viewer 1.x.
|
||||
include(FindPkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
if (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
|
||||
set(_PACKAGE_ARGS libllqtwebkit>=${LLQtWebkit_FIND_VERSION} REQUIRED)
|
||||
else (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
|
||||
set(_PACKAGE_ARGS libllqtwebkit)
|
||||
endif (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
|
||||
if (NOT "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_LESS "2.8")
|
||||
# As virtually nobody will have a pkg-config file for this, do this check always quiet.
|
||||
# Unfortunately cmake 2.8 or higher is required for pkg_check_modules to have a 'QUIET'.
|
||||
set(_PACKAGE_ARGS ${_PACKAGE_ARGS} QUIET)
|
||||
endif ()
|
||||
pkg_check_modules(LLQTWEBKIT ${_PACKAGE_ARGS})
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
set(LLQTWEBKIT_DEFINITIONS ${LLQTWEBKIT_CFLAGS_OTHER})
|
||||
|
||||
find_path(LLQTWEBKIT_INCLUDE_DIR llqtwebkit.h NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_INCLUDE_DIRS})
|
||||
|
||||
find_library(LLQTWEBKIT_LIBRARY NAMES llqtwebkit NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_LIBRARY_DIRS})
|
||||
|
||||
if (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND) # If pkg-config couldn't find it, pretend we don't have pkg-config.
|
||||
set(LLQTWEBKIT_LIBRARIES llqtwebkit)
|
||||
get_filename_component(LLQTWEBKIT_LIBRARY_DIRS ${LLQTWEBKIT_LIBRARY} PATH)
|
||||
endif (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set LLQTWEBKIT_FOUND
|
||||
# to TRUE if all listed variables are TRUE.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
LLQTWEBKIT
|
||||
DEFAULT_MSG
|
||||
LLQTWEBKIT_LIBRARY
|
||||
LLQTWEBKIT_INCLUDE_DIR
|
||||
LLQTWEBKIT_LIBRARIES
|
||||
LLQTWEBKIT_LIBRARY_DIRS
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
LLQTWEBKIT_LIBRARY
|
||||
LLQTWEBKIT_INCLUDE_DIR
|
||||
LLQTWEBKIT_LIBRARIES
|
||||
LLQTWEBKIT_LIBRARY_DIRS
|
||||
LLQTWEBKIT_DEFINITIONS
|
||||
)
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
# - Find NDOF
|
||||
# Find the NDOF includes and library
|
||||
# This module defines
|
||||
# NDOF_INCLUDE_DIR, where to find ndofdev_external.h, etc.
|
||||
# NDOF_LIBRARY, the library needed to use NDOF.
|
||||
# NDOF_FOUND, If false, do not try to use NDOF.
|
||||
|
||||
find_path(NDOF_INCLUDE_DIR ndofdev_external.h
|
||||
PATH_SUFFIXES ndofdev
|
||||
)
|
||||
|
||||
set(NDOF_NAMES ${NDOF_NAMES} ndofdev libndofdev)
|
||||
find_library(NDOF_LIBRARY
|
||||
NAMES ${NDOF_NAMES}
|
||||
)
|
||||
|
||||
if (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
|
||||
set(NDOF_FOUND "YES")
|
||||
else (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
|
||||
set(NDOF_FOUND "NO")
|
||||
endif (NDOF_LIBRARY AND NDOF_INCLUDE_DIR)
|
||||
|
||||
|
||||
if (NDOF_FOUND)
|
||||
if (NOT NDOF_FIND_QUIETLY)
|
||||
message(STATUS "Found NDOF: Library in '${NDOF_LIBRARY}' and header in '${NDOF_INCLUDE_DIR}' ")
|
||||
endif (NOT NDOF_FIND_QUIETLY)
|
||||
else (NDOF_FOUND)
|
||||
if (NDOF_FIND_REQUIRED)
|
||||
message(FATAL_ERROR " * * *\nCould not find NDOF library!\nIf you don't need Space Navigator Joystick support you can skip this test by configuring with -DNDOF:BOOL=OFF\n * * *")
|
||||
endif (NDOF_FIND_REQUIRED)
|
||||
endif (NDOF_FOUND)
|
||||
|
||||
mark_as_advanced(
|
||||
NDOF_LIBRARY
|
||||
NDOF_INCLUDE_DIR
|
||||
)
|
||||
|
|
@ -3,12 +3,11 @@
|
|||
# - Find Tut
|
||||
# Find the Tut unit test framework includes and library
|
||||
# This module defines
|
||||
# TUT_INCLUDE_DIR, where to find tut.h, etc.
|
||||
# TUT_INCLUDE_DIR, where to find tut/tut.hpp.
|
||||
# TUT_FOUND, If false, do not try to use Tut.
|
||||
|
||||
find_path(TUT_INCLUDE_DIR tut.h
|
||||
/usr/local/include/
|
||||
/usr/include
|
||||
find_path(TUT_INCLUDE_DIR tut/tut.hpp
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
|
||||
if (TUT_INCLUDE_DIR)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
# - Find zlib
|
||||
# Find the ZLIB includes and library
|
||||
# This module defines
|
||||
# ZLIB_INCLUDE_DIRS, where to find zlib.h, etc.
|
||||
# ZLIB_LIBRARIES, the libraries needed to use zlib.
|
||||
# ZLIB_FOUND, If false, do not try to use zlib.
|
||||
#
|
||||
# This FindZLIB is about 43 times as fast the one provided with cmake (2.8.x),
|
||||
# because it doesn't look up the version of zlib, resulting in a dramatic
|
||||
# speed up for configure (from 4 minutes 22 seconds to 6 seconds).
|
||||
#
|
||||
# Note: Since this file is only used for standalone, the windows
|
||||
# specific parts were left out.
|
||||
|
||||
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY(ZLIB_LIBRARY z)
|
||||
|
||||
if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
|
||||
SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
|
||||
SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
|
||||
SET(ZLIB_FOUND "YES")
|
||||
else (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
|
||||
SET(ZLIB_FOUND "NO")
|
||||
endif (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
|
||||
|
||||
if (ZLIB_FOUND)
|
||||
if (NOT ZLIB_FIND_QUIETLY)
|
||||
message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES}")
|
||||
SET(ZLIB_FIND_QUIETLY TRUE)
|
||||
endif (NOT ZLIB_FIND_QUIETLY)
|
||||
else (ZLIB_FOUND)
|
||||
if (ZLIB_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find ZLIB library")
|
||||
endif (ZLIB_FIND_REQUIRED)
|
||||
endif (ZLIB_FOUND)
|
||||
|
||||
mark_as_advanced(
|
||||
ZLIB_LIBRARY
|
||||
ZLIB_INCLUDE_DIR
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,273 +1,276 @@
|
|||
# -*- cmake -*-
|
||||
include(LLTestCommand)
|
||||
include(GoogleMock)
|
||||
|
||||
MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
|
||||
# Given a project name and a list of sourcefiles (with optional properties on each),
|
||||
# add targets to build and run the tests specified.
|
||||
# ASSUMPTIONS:
|
||||
# * this macro is being executed in the project file that is passed in
|
||||
# * current working SOURCE dir is that project dir
|
||||
# * there is a subfolder tests/ with test code corresponding to the filenames passed in
|
||||
# * properties for each sourcefile passed in indicate what libs to link that file with (MAKE NO ASSUMPTIONS ASIDE FROM TUT)
|
||||
#
|
||||
# More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code
|
||||
#
|
||||
# WARNING: do NOT modify this code without working with poppy -
|
||||
# there is another branch that will conflict heavily with any changes here.
|
||||
INCLUDE(GoogleMock)
|
||||
|
||||
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
# Start with the header and project-wide setup before making targets
|
||||
#project(UNITTEST_PROJECT_${project})
|
||||
# Setup includes, paths, etc
|
||||
SET(alltest_SOURCE_FILES
|
||||
${CMAKE_SOURCE_DIR}/test/test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/lltut.cpp
|
||||
)
|
||||
SET(alltest_DEP_TARGETS
|
||||
# needed by the test harness itself
|
||||
${APRUTIL_LIBRARIES}
|
||||
${APR_LIBRARIES}
|
||||
llcommon
|
||||
)
|
||||
IF(NOT "${project}" STREQUAL "llmath")
|
||||
# add llmath as a dep unless the tested module *is* llmath!
|
||||
LIST(APPEND alltest_DEP_TARGETS
|
||||
llmath
|
||||
)
|
||||
ENDIF(NOT "${project}" STREQUAL "llmath")
|
||||
SET(alltest_INCLUDE_DIRS
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LIBS_OPEN_DIR}/test
|
||||
${GOOGLEMOCK_INCLUDE_DIRS}
|
||||
)
|
||||
SET(alltest_LIBRARIES
|
||||
${GOOGLEMOCK_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
${WINDOWS_LIBRARIES}
|
||||
)
|
||||
# Headers, for convenience in targets.
|
||||
SET(alltest_HEADER_FILES
|
||||
${CMAKE_SOURCE_DIR}/test/test.h
|
||||
)
|
||||
|
||||
# Use the default flags
|
||||
if (LINUX)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "")
|
||||
endif (LINUX)
|
||||
|
||||
# start the source test executable definitions
|
||||
SET(${project}_TEST_OUTPUT "")
|
||||
FOREACH (source ${sources})
|
||||
STRING( REGEX REPLACE "(.*)\\.[^.]+$" "\\1" name ${source} )
|
||||
STRING( REGEX REPLACE ".*\\.([^.]+)$" "\\1" extension ${source} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} individual source: ${source} (${name}.${extension})")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
#
|
||||
# Per-codefile additional / external source, header, and include dir property extraction
|
||||
#
|
||||
# Source
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_SOURCE_FILES ${source} LL_TEST_ADDITIONAL_SOURCE_FILES)
|
||||
IF(${name}_test_additional_SOURCE_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_SOURCE_FILES "")
|
||||
ENDIF(${name}_test_additional_SOURCE_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_SOURCE_FILES ${source} tests/${name}_test.${extension} ${alltest_SOURCE_FILES} ${${name}_test_additional_SOURCE_FILES} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_SOURCE_FILES ${${name}_test_SOURCE_FILES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Headers
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_HEADER_FILES ${source} LL_TEST_ADDITIONAL_HEADER_FILES)
|
||||
IF(${name}_test_additional_HEADER_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_HEADER_FILES "")
|
||||
ENDIF(${name}_test_additional_HEADER_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_HEADER_FILES ${name}.h ${${name}_test_additional_HEADER_FILES})
|
||||
set_source_files_properties(${${name}_test_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
LIST(APPEND ${name}_test_SOURCE_FILES ${${name}_test_HEADER_FILES})
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_HEADER_FILES ${${name}_test_HEADER_FILES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Include dirs
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_INCLUDE_DIRS ${source} LL_TEST_ADDITIONAL_INCLUDE_DIRS)
|
||||
IF(${name}_test_additional_INCLUDE_DIRS MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_INCLUDE_DIRS "")
|
||||
ENDIF(${name}_test_additional_INCLUDE_DIRS MATCHES NOTFOUND)
|
||||
INCLUDE_DIRECTORIES(${alltest_INCLUDE_DIRS} ${name}_test_additional_INCLUDE_DIRS )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_INCLUDE_DIRS ${${name}_test_additional_INCLUDE_DIRS}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
|
||||
# Setup target
|
||||
ADD_EXECUTABLE(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES})
|
||||
SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
|
||||
|
||||
#
|
||||
# Per-codefile additional / external project dep and lib dep property extraction
|
||||
#
|
||||
# WARNING: it's REALLY IMPORTANT to not mix these. I guarantee it will not work in the future. + poppy 2009-04-19
|
||||
# Projects
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_PROJECTS ${source} LL_TEST_ADDITIONAL_PROJECTS)
|
||||
IF(${name}_test_additional_PROJECTS MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_PROJECTS "")
|
||||
ENDIF(${name}_test_additional_PROJECTS MATCHES NOTFOUND)
|
||||
# Libraries
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_LIBRARIES ${source} LL_TEST_ADDITIONAL_LIBRARIES)
|
||||
IF(${name}_test_additional_LIBRARIES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_LIBRARIES "")
|
||||
ENDIF(${name}_test_additional_LIBRARIES MATCHES NOTFOUND)
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_PROJECTS ${${name}_test_additional_PROJECTS}")
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_LIBRARIES ${${name}_test_additional_LIBRARIES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Add to project
|
||||
TARGET_LINK_LIBRARIES(PROJECT_${project}_TEST_${name} ${alltest_LIBRARIES} ${alltest_DEP_TARGETS} ${${name}_test_additional_PROJECTS} ${${name}_test_additional_LIBRARIES} )
|
||||
# Compile-time Definitions
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_CFLAGS ${source} LL_TEST_ADDITIONAL_CFLAGS)
|
||||
IF(NOT ${name}_test_additional_CFLAGS MATCHES NOTFOUND)
|
||||
SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES COMPILE_FLAGS ${${name}_test_additional_CFLAGS} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_CFLAGS ${${name}_test_additional_CFLAGS}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
ENDIF(NOT ${name}_test_additional_CFLAGS MATCHES NOTFOUND)
|
||||
|
||||
#
|
||||
# Setup test targets
|
||||
#
|
||||
GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION)
|
||||
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt)
|
||||
SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
SET_TEST_PATH(LD_LIBRARY_PATH)
|
||||
LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${TEST_CMD})
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Add test
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${TEST_OUTPUT}
|
||||
COMMAND ${TEST_SCRIPT_CMD}
|
||||
DEPENDS PROJECT_${project}_TEST_${name}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
# Why not add custom target and add POST_BUILD command?
|
||||
# Slightly less uncertain behavior
|
||||
# (OUTPUT commands run non-deterministically AFAIK) + poppy 2009-04-19
|
||||
# > I did not use a post build step as I could not make it notify of a
|
||||
# > failure after the first time you build and fail a test. - daveh 2009-04-20
|
||||
LIST(APPEND ${project}_TEST_OUTPUT ${TEST_OUTPUT})
|
||||
ENDFOREACH (source)
|
||||
|
||||
# Add the test runner target per-project
|
||||
# (replaces old _test_ok targets all over the place)
|
||||
ADD_CUSTOM_TARGET(${project}_tests ALL DEPENDS ${${project}_TEST_OUTPUT})
|
||||
ADD_DEPENDENCIES(${project} ${project}_tests)
|
||||
ENDMACRO(LL_ADD_PROJECT_UNIT_TESTS)
|
||||
|
||||
FUNCTION(LL_ADD_INTEGRATION_TEST
|
||||
testname
|
||||
additional_source_files
|
||||
library_dependencies
|
||||
# variable args
|
||||
)
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "Adding INTEGRATION_TEST_${testname} - debug output is on")
|
||||
endif(TEST_DEBUG)
|
||||
|
||||
SET(source_files
|
||||
tests/${testname}_test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/lltut.cpp
|
||||
${additional_source_files}
|
||||
)
|
||||
|
||||
SET(libraries
|
||||
${library_dependencies}
|
||||
${GOOGLEMOCK_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
)
|
||||
|
||||
# Add test executable build target
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})")
|
||||
endif(TEST_DEBUG)
|
||||
ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
|
||||
|
||||
# Add link deps to the executable
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})")
|
||||
endif(TEST_DEBUG)
|
||||
TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})
|
||||
|
||||
# Create the test running command
|
||||
SET(test_command ${ARGN})
|
||||
GET_TARGET_PROPERTY(TEST_EXE INTEGRATION_TEST_${testname} LOCATION)
|
||||
LIST(FIND test_command "{}" test_exe_pos)
|
||||
IF(test_exe_pos LESS 0)
|
||||
# The {} marker means "the full pathname of the test executable."
|
||||
# test_exe_pos -1 means we didn't find it -- so append the test executable
|
||||
# name to $ARGN, the variable part of the arg list. This is convenient
|
||||
# shorthand for both straightforward execution of the test program (empty
|
||||
# $ARGN) and for running a "wrapper" program of some kind accepting the
|
||||
# pathname of the test program as the last of its args. You need specify
|
||||
# {} only if the test program's pathname isn't the last argument in the
|
||||
# desired command line.
|
||||
LIST(APPEND test_command "${TEST_EXE}")
|
||||
ELSE (test_exe_pos LESS 0)
|
||||
# Found {} marker at test_exe_pos. Remove the {}...
|
||||
LIST(REMOVE_AT test_command test_exe_pos)
|
||||
# ...and replace it with the actual name of the test executable.
|
||||
LIST(INSERT test_command test_exe_pos "${TEST_EXE}")
|
||||
ENDIF (test_exe_pos LESS 0)
|
||||
|
||||
SET_TEST_PATH(LD_LIBRARY_PATH)
|
||||
LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${test_command})
|
||||
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}")
|
||||
endif(TEST_DEBUG)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET INTEGRATION_TEST_${testname}
|
||||
POST_BUILD
|
||||
COMMAND ${TEST_SCRIPT_CMD}
|
||||
)
|
||||
|
||||
# Use CTEST? Not sure how to yet...
|
||||
# ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD})
|
||||
|
||||
ENDFUNCTION(LL_ADD_INTEGRATION_TEST)
|
||||
|
||||
MACRO(SET_TEST_PATH LISTVAR)
|
||||
IF(WINDOWS)
|
||||
# We typically build/package only Release variants of third-party
|
||||
# libraries, so append the Release staging dir in case the library being
|
||||
# sought doesn't have a debug variant.
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release)
|
||||
ELSEIF(DARWIN)
|
||||
# We typically build/package only Release variants of third-party
|
||||
# libraries, so append the Release staging dir in case the library being
|
||||
# sought doesn't have a debug variant.
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib)
|
||||
ELSE(WINDOWS)
|
||||
# Linux uses a single staging directory anyway.
|
||||
IF (STANDALONE)
|
||||
set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
|
||||
ELSE (STANDALONE)
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
|
||||
ENDIF (STANDALONE)
|
||||
ENDIF(WINDOWS)
|
||||
ENDMACRO(SET_TEST_PATH)
|
||||
# -*- cmake -*-
|
||||
include(LLTestCommand)
|
||||
include(GoogleMock)
|
||||
|
||||
MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
|
||||
# Given a project name and a list of sourcefiles (with optional properties on each),
|
||||
# add targets to build and run the tests specified.
|
||||
# ASSUMPTIONS:
|
||||
# * this macro is being executed in the project file that is passed in
|
||||
# * current working SOURCE dir is that project dir
|
||||
# * there is a subfolder tests/ with test code corresponding to the filenames passed in
|
||||
# * properties for each sourcefile passed in indicate what libs to link that file with (MAKE NO ASSUMPTIONS ASIDE FROM TUT)
|
||||
#
|
||||
# More info and examples at: https://wiki.secondlife.com/wiki/How_to_add_unit_tests_to_indra_code
|
||||
#
|
||||
# WARNING: do NOT modify this code without working with poppy -
|
||||
# there is another branch that will conflict heavily with any changes here.
|
||||
INCLUDE(GoogleMock)
|
||||
|
||||
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
# Start with the header and project-wide setup before making targets
|
||||
#project(UNITTEST_PROJECT_${project})
|
||||
# Setup includes, paths, etc
|
||||
SET(alltest_SOURCE_FILES
|
||||
${CMAKE_SOURCE_DIR}/test/test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/lltut.cpp
|
||||
)
|
||||
SET(alltest_DEP_TARGETS
|
||||
# needed by the test harness itself
|
||||
${APRUTIL_LIBRARIES}
|
||||
${APR_LIBRARIES}
|
||||
llcommon
|
||||
)
|
||||
IF(NOT "${project}" STREQUAL "llmath")
|
||||
# add llmath as a dep unless the tested module *is* llmath!
|
||||
LIST(APPEND alltest_DEP_TARGETS
|
||||
llmath
|
||||
)
|
||||
ENDIF(NOT "${project}" STREQUAL "llmath")
|
||||
SET(alltest_INCLUDE_DIRS
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LIBS_OPEN_DIR}/test
|
||||
${GOOGLEMOCK_INCLUDE_DIRS}
|
||||
)
|
||||
SET(alltest_LIBRARIES
|
||||
${GOOGLEMOCK_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
${WINDOWS_LIBRARIES}
|
||||
)
|
||||
# Headers, for convenience in targets.
|
||||
SET(alltest_HEADER_FILES
|
||||
${CMAKE_SOURCE_DIR}/test/test.h
|
||||
)
|
||||
|
||||
# Use the default flags
|
||||
if (LINUX)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "")
|
||||
endif (LINUX)
|
||||
|
||||
# start the source test executable definitions
|
||||
SET(${project}_TEST_OUTPUT "")
|
||||
FOREACH (source ${sources})
|
||||
STRING( REGEX REPLACE "(.*)\\.[^.]+$" "\\1" name ${source} )
|
||||
STRING( REGEX REPLACE ".*\\.([^.]+)$" "\\1" extension ${source} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} individual source: ${source} (${name}.${extension})")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
#
|
||||
# Per-codefile additional / external source, header, and include dir property extraction
|
||||
#
|
||||
# Source
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_SOURCE_FILES ${source} LL_TEST_ADDITIONAL_SOURCE_FILES)
|
||||
IF(${name}_test_additional_SOURCE_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_SOURCE_FILES "")
|
||||
ENDIF(${name}_test_additional_SOURCE_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_SOURCE_FILES ${source} tests/${name}_test.${extension} ${alltest_SOURCE_FILES} ${${name}_test_additional_SOURCE_FILES} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_SOURCE_FILES ${${name}_test_SOURCE_FILES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Headers
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_HEADER_FILES ${source} LL_TEST_ADDITIONAL_HEADER_FILES)
|
||||
IF(${name}_test_additional_HEADER_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_HEADER_FILES "")
|
||||
ENDIF(${name}_test_additional_HEADER_FILES MATCHES NOTFOUND)
|
||||
SET(${name}_test_HEADER_FILES ${name}.h ${${name}_test_additional_HEADER_FILES})
|
||||
set_source_files_properties(${${name}_test_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
LIST(APPEND ${name}_test_SOURCE_FILES ${${name}_test_HEADER_FILES})
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_HEADER_FILES ${${name}_test_HEADER_FILES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Include dirs
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_INCLUDE_DIRS ${source} LL_TEST_ADDITIONAL_INCLUDE_DIRS)
|
||||
IF(${name}_test_additional_INCLUDE_DIRS MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_INCLUDE_DIRS "")
|
||||
ENDIF(${name}_test_additional_INCLUDE_DIRS MATCHES NOTFOUND)
|
||||
INCLUDE_DIRECTORIES(${alltest_INCLUDE_DIRS} ${name}_test_additional_INCLUDE_DIRS )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_INCLUDE_DIRS ${${name}_test_additional_INCLUDE_DIRS}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
|
||||
# Setup target
|
||||
ADD_EXECUTABLE(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES})
|
||||
SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
|
||||
|
||||
#
|
||||
# Per-codefile additional / external project dep and lib dep property extraction
|
||||
#
|
||||
# WARNING: it's REALLY IMPORTANT to not mix these. I guarantee it will not work in the future. + poppy 2009-04-19
|
||||
# Projects
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_PROJECTS ${source} LL_TEST_ADDITIONAL_PROJECTS)
|
||||
IF(${name}_test_additional_PROJECTS MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_PROJECTS "")
|
||||
ENDIF(${name}_test_additional_PROJECTS MATCHES NOTFOUND)
|
||||
# Libraries
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_LIBRARIES ${source} LL_TEST_ADDITIONAL_LIBRARIES)
|
||||
IF(${name}_test_additional_LIBRARIES MATCHES NOTFOUND)
|
||||
SET(${name}_test_additional_LIBRARIES "")
|
||||
ENDIF(${name}_test_additional_LIBRARIES MATCHES NOTFOUND)
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_PROJECTS ${${name}_test_additional_PROJECTS}")
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_LIBRARIES ${${name}_test_additional_LIBRARIES}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Add to project
|
||||
TARGET_LINK_LIBRARIES(PROJECT_${project}_TEST_${name} ${alltest_LIBRARIES} ${alltest_DEP_TARGETS} ${${name}_test_additional_PROJECTS} ${${name}_test_additional_LIBRARIES} )
|
||||
# Compile-time Definitions
|
||||
GET_SOURCE_FILE_PROPERTY(${name}_test_additional_CFLAGS ${source} LL_TEST_ADDITIONAL_CFLAGS)
|
||||
IF(NOT ${name}_test_additional_CFLAGS MATCHES NOTFOUND)
|
||||
SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES COMPILE_FLAGS ${${name}_test_additional_CFLAGS} )
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_CFLAGS ${${name}_test_additional_CFLAGS}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
ENDIF(NOT ${name}_test_additional_CFLAGS MATCHES NOTFOUND)
|
||||
|
||||
#
|
||||
# Setup test targets
|
||||
#
|
||||
GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION)
|
||||
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt)
|
||||
SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
|
||||
SET_TEST_PATH(LD_LIBRARY_PATH)
|
||||
LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${TEST_CMD})
|
||||
IF(LL_TEST_VERBOSE)
|
||||
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}")
|
||||
ENDIF(LL_TEST_VERBOSE)
|
||||
# Add test
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${TEST_OUTPUT}
|
||||
COMMAND ${TEST_SCRIPT_CMD}
|
||||
DEPENDS PROJECT_${project}_TEST_${name}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
# Why not add custom target and add POST_BUILD command?
|
||||
# Slightly less uncertain behavior
|
||||
# (OUTPUT commands run non-deterministically AFAIK) + poppy 2009-04-19
|
||||
# > I did not use a post build step as I could not make it notify of a
|
||||
# > failure after the first time you build and fail a test. - daveh 2009-04-20
|
||||
LIST(APPEND ${project}_TEST_OUTPUT ${TEST_OUTPUT})
|
||||
ENDFOREACH (source)
|
||||
|
||||
# Add the test runner target per-project
|
||||
# (replaces old _test_ok targets all over the place)
|
||||
ADD_CUSTOM_TARGET(${project}_tests ALL DEPENDS ${${project}_TEST_OUTPUT})
|
||||
ADD_DEPENDENCIES(${project} ${project}_tests)
|
||||
ENDMACRO(LL_ADD_PROJECT_UNIT_TESTS)
|
||||
|
||||
FUNCTION(LL_ADD_INTEGRATION_TEST
|
||||
testname
|
||||
additional_source_files
|
||||
library_dependencies
|
||||
# variable args
|
||||
)
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "Adding INTEGRATION_TEST_${testname} - debug output is on")
|
||||
endif(TEST_DEBUG)
|
||||
|
||||
SET(source_files
|
||||
tests/${testname}_test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/test.cpp
|
||||
${CMAKE_SOURCE_DIR}/test/lltut.cpp
|
||||
${additional_source_files}
|
||||
)
|
||||
|
||||
SET(libraries
|
||||
${library_dependencies}
|
||||
${GOOGLEMOCK_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
)
|
||||
|
||||
# Add test executable build target
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})")
|
||||
endif(TEST_DEBUG)
|
||||
ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
|
||||
if(STANDALONE)
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}")
|
||||
endif(STANDALONE)
|
||||
|
||||
# Add link deps to the executable
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})")
|
||||
endif(TEST_DEBUG)
|
||||
TARGET_LINK_LIBRARIES(INTEGRATION_TEST_${testname} ${libraries})
|
||||
|
||||
# Create the test running command
|
||||
SET(test_command ${ARGN})
|
||||
GET_TARGET_PROPERTY(TEST_EXE INTEGRATION_TEST_${testname} LOCATION)
|
||||
LIST(FIND test_command "{}" test_exe_pos)
|
||||
IF(test_exe_pos LESS 0)
|
||||
# The {} marker means "the full pathname of the test executable."
|
||||
# test_exe_pos -1 means we didn't find it -- so append the test executable
|
||||
# name to $ARGN, the variable part of the arg list. This is convenient
|
||||
# shorthand for both straightforward execution of the test program (empty
|
||||
# $ARGN) and for running a "wrapper" program of some kind accepting the
|
||||
# pathname of the test program as the last of its args. You need specify
|
||||
# {} only if the test program's pathname isn't the last argument in the
|
||||
# desired command line.
|
||||
LIST(APPEND test_command "${TEST_EXE}")
|
||||
ELSE (test_exe_pos LESS 0)
|
||||
# Found {} marker at test_exe_pos. Remove the {}...
|
||||
LIST(REMOVE_AT test_command test_exe_pos)
|
||||
# ...and replace it with the actual name of the test executable.
|
||||
LIST(INSERT test_command test_exe_pos "${TEST_EXE}")
|
||||
ENDIF (test_exe_pos LESS 0)
|
||||
|
||||
SET_TEST_PATH(LD_LIBRARY_PATH)
|
||||
LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${test_command})
|
||||
|
||||
if(TEST_DEBUG)
|
||||
message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}")
|
||||
endif(TEST_DEBUG)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET INTEGRATION_TEST_${testname}
|
||||
POST_BUILD
|
||||
COMMAND ${TEST_SCRIPT_CMD}
|
||||
)
|
||||
|
||||
# Use CTEST? Not sure how to yet...
|
||||
# ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD})
|
||||
|
||||
ENDFUNCTION(LL_ADD_INTEGRATION_TEST)
|
||||
|
||||
MACRO(SET_TEST_PATH LISTVAR)
|
||||
IF(WINDOWS)
|
||||
# We typically build/package only Release variants of third-party
|
||||
# libraries, so append the Release staging dir in case the library being
|
||||
# sought doesn't have a debug variant.
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release)
|
||||
ELSEIF(DARWIN)
|
||||
# We typically build/package only Release variants of third-party
|
||||
# libraries, so append the Release staging dir in case the library being
|
||||
# sought doesn't have a debug variant.
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib)
|
||||
ELSE(WINDOWS)
|
||||
# Linux uses a single staging directory anyway.
|
||||
IF (STANDALONE)
|
||||
set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
|
||||
ELSE (STANDALONE)
|
||||
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
|
||||
ENDIF (STANDALONE)
|
||||
ENDIF(WINDOWS)
|
||||
ENDMACRO(SET_TEST_PATH)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,14 @@ set(LLCOMMON_INCLUDE_DIRS
|
|||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(LLCOMMON_LIBRARIES llcommon)
|
||||
if (LINUX)
|
||||
# In order to support using ld.gold on linux, we need to explicitely
|
||||
# specify all libraries that llcommon uses.
|
||||
# llcommon uses `clock_gettime' which is provided by librt on linux.
|
||||
set(LLCOMMON_LIBRARIES llcommon rt)
|
||||
else (LINUX)
|
||||
set(LLCOMMON_LIBRARIES llcommon)
|
||||
endif (LINUX)
|
||||
|
||||
add_definitions(${TCMALLOC_FLAG})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,20 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
# USE_KDU can be set when launching cmake or develop.py as an option using the argument -DUSE_KDU:BOOL=ON
|
||||
# When building using proprietary binaries though (i.e. having access to LL private servers), we always build with KDU
|
||||
if (INSTALL_PROPRIETARY AND NOT STANDALONE)
|
||||
use_prebuilt_binary(kdu)
|
||||
set(LLKDU_LIBRARY llkdu)
|
||||
set(USE_KDU ON)
|
||||
endif (INSTALL_PROPRIETARY AND NOT STANDALONE)
|
||||
|
||||
if (USE_KDU)
|
||||
use_prebuilt_binary(kdu)
|
||||
if (WINDOWS)
|
||||
set(KDU_LIBRARY kdu.lib)
|
||||
else (WINDOWS)
|
||||
set(KDU_LIBRARY libkdu.a)
|
||||
endif (WINDOWS)
|
||||
set(KDU_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/kdu)
|
||||
set(LLKDU_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llkdu)
|
||||
set(LLKDU_LIBRARIES llkdu)
|
||||
endif (USE_KDU)
|
||||
|
|
|
|||
|
|
@ -5,4 +5,10 @@ set(LLPLUGIN_INCLUDE_DIRS
|
|||
${LIBS_OPEN_DIR}/llplugin
|
||||
)
|
||||
|
||||
set(LLPLUGIN_LIBRARIES llplugin)
|
||||
if (LINUX)
|
||||
# In order to support using ld.gold on linux, we need to explicitely
|
||||
# specify all libraries that llplugin uses.
|
||||
set(LLPLUGIN_LIBRARIES llplugin pthread)
|
||||
else (LINUX)
|
||||
set(LLPLUGIN_LIBRARIES llplugin)
|
||||
endif (LINUX)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,32 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
use_prebuilt_binary(ndofdev)
|
||||
set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.")
|
||||
|
||||
if (WINDOWS OR DARWIN OR LINUX)
|
||||
if (NDOF)
|
||||
if (STANDALONE)
|
||||
set(NDOF_FIND_REQUIRED ON)
|
||||
include(FindNDOF)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(ndofdev)
|
||||
|
||||
if (WINDOWS)
|
||||
set(NDOF_LIBRARY libndofdev)
|
||||
elseif (DARWIN OR LINUX)
|
||||
set(NDOF_LIBRARY ndofdev)
|
||||
endif (WINDOWS)
|
||||
|
||||
set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)
|
||||
set(NDOF_FOUND 1)
|
||||
endif (STANDALONE)
|
||||
endif (NDOF)
|
||||
|
||||
if (NDOF_FOUND)
|
||||
add_definitions(-DLIB_NDOF=1)
|
||||
endif (WINDOWS OR DARWIN OR LINUX)
|
||||
include_directories(${NDOF_INCLUDE_DIR})
|
||||
else (NDOF_FOUND)
|
||||
message(STATUS "Building without N-DoF joystick support")
|
||||
set(NDOF_INCLUDE_DIR "")
|
||||
set(NDOF_LIBRARY "")
|
||||
endif (NDOF_FOUND)
|
||||
|
||||
if (WINDOWS)
|
||||
set(NDOF_LIBRARY libndofdev)
|
||||
elseif (DARWIN OR LINUX)
|
||||
set(NDOF_LIBRARY ndofdev)
|
||||
endif (WINDOWS)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ set(TUT_FIND_QUIETLY TRUE)
|
|||
|
||||
if (STANDALONE)
|
||||
include(FindTut)
|
||||
include_directories(${TUT_INCLUDE_DIR})
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(tut)
|
||||
endif (STANDALONE)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,29 @@ include(Linking)
|
|||
include(Prebuilt)
|
||||
|
||||
if (STANDALONE)
|
||||
# The minimal version, 4.4.3, is rather arbitrary: it's the version in Debian/Lenny.
|
||||
find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtNetwork QtOpenGL QtWebKit REQUIRED)
|
||||
include(${QT_USE_FILE})
|
||||
set(QTDIR $ENV{QTDIR})
|
||||
if (QTDIR AND NOT "${QT_BINARY_DIR}" STREQUAL "${QTDIR}/bin")
|
||||
message(FATAL_ERROR "\"${QT_BINARY_DIR}\" is unequal \"${QTDIR}/bin\"; "
|
||||
"Qt is found by looking for qmake in your PATH. "
|
||||
"Please set your PATH such that 'qmake' is found in \$QTDIR/bin, "
|
||||
"or unset QTDIR if the found Qt is correct.")
|
||||
endif (QTDIR AND NOT "${QT_BINARY_DIR}" STREQUAL "${QTDIR}/bin")
|
||||
find_package(LLQtWebkit REQUIRED QUIET)
|
||||
# Add the plugins.
|
||||
set(QT_PLUGIN_LIBRARIES)
|
||||
foreach(qlibname qgif qjpeg)
|
||||
find_library(QT_PLUGIN_${qlibname} ${qlibname} PATHS ${QT_PLUGINS_DIR}/imageformats NO_DEFAULT_PATH)
|
||||
if (QT_PLUGIN_${qlibname})
|
||||
list(APPEND QT_PLUGIN_LIBRARIES ${QT_PLUGIN_${qlibname}})
|
||||
else (QT_PLUGIN_${qtlibname})
|
||||
message(FATAL_ERROR "Could not find the Qt plugin ${qlibname} in \"${QT_PLUGINS_DIR}/imageformats\"!")
|
||||
endif (QT_PLUGIN_${qlibname})
|
||||
endforeach(qlibname)
|
||||
# qjpeg depends on libjpeg
|
||||
list(APPEND QT_PLUGIN_LIBRARIES jpeg)
|
||||
set(WEBKITLIBPLUGIN OFF CACHE BOOL
|
||||
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
|
||||
else (STANDALONE)
|
||||
|
|
@ -35,7 +58,7 @@ elseif (DARWIN)
|
|||
)
|
||||
elseif (LINUX)
|
||||
if (STANDALONE)
|
||||
set(WEBKIT_PLUGIN_LIBRARIES llqtwebkit)
|
||||
set(WEBKIT_PLUGIN_LIBRARIES ${LLQTWEBKIT_LIBRARY} ${QT_LIBRARIES} ${QT_PLUGIN_LIBRARIES})
|
||||
else (STANDALONE)
|
||||
set(WEBKIT_PLUGIN_LIBRARIES
|
||||
llqtwebkit
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ include(00-Common)
|
|||
include(LLCommon)
|
||||
include(LLImage)
|
||||
include(LLImageJ2COJ) # ugh, needed for images
|
||||
include(LLKDU)
|
||||
include(LLMath)
|
||||
include(LLMessage)
|
||||
include(LLRender)
|
||||
|
|
@ -71,6 +72,11 @@ endif (DARWIN)
|
|||
target_link_libraries(llui_libtest
|
||||
llui
|
||||
llmessage
|
||||
${LLRENDER_LIBRARIES}
|
||||
${LLIMAGE_LIBRARIES}
|
||||
${LLKDU_LIBRARIES}
|
||||
${KDU_LIBRARY}
|
||||
${LLIMAGEJ2COJ_LIBRARIES}
|
||||
${OS_LIBRARIES}
|
||||
${GOOGLE_PERFTOOLS_LIBRARIES}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -52,20 +52,22 @@ def get_HKLM_registry_value(key_str, value_str):
|
|||
|
||||
def find_vc_dir():
|
||||
supported_versions = (r'8.0', r'9.0')
|
||||
supported_products = (r'VisualStudio', r'VCExpress')
|
||||
value_str = (r'ProductDir')
|
||||
|
||||
for version in supported_versions:
|
||||
key_str = (r'SOFTWARE\Microsoft\VisualStudio\%s\Setup\VC' %
|
||||
version)
|
||||
try:
|
||||
return get_HKLM_registry_value(key_str, value_str)
|
||||
except WindowsError, err:
|
||||
x64_key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
|
||||
version)
|
||||
for product in supported_products:
|
||||
for version in supported_versions:
|
||||
key_str = (r'SOFTWARE\Microsoft\%s\%s\Setup\VC' %
|
||||
(product, version))
|
||||
try:
|
||||
return get_HKLM_registry_value(x64_key_str, value_str)
|
||||
except:
|
||||
print >> sys.stderr, "Didn't find MS VC version %s " % version
|
||||
return get_HKLM_registry_value(key_str, value_str)
|
||||
except WindowsError, err:
|
||||
x64_key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
|
||||
version)
|
||||
try:
|
||||
return get_HKLM_registry_value(x64_key_str, value_str)
|
||||
except:
|
||||
print >> sys.stderr, "Didn't find MS %s version %s " % (product,version)
|
||||
|
||||
raise
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,11 @@ void LLAudioEngine::setDefaults()
|
|||
}
|
||||
|
||||
mMasterGain = 1.f;
|
||||
mInternalGain = 0.f;
|
||||
// Setting mInternalGain to an out of range value fixes the issue reported in STORM-830.
|
||||
// There is an edge case in setMasterGain during startup which prevents setInternalGain from
|
||||
// being called if the master volume setting and mInternalGain both equal 0, so using -1 forces
|
||||
// the if statement in setMasterGain to execute when the viewer starts up.
|
||||
mInternalGain = -1.f;
|
||||
mNextWindUpdate = 0.f;
|
||||
|
||||
mStreamingAudioImpl = NULL;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "linden_common.h"
|
||||
#include "llapr.h"
|
||||
#include "apr_dso.h"
|
||||
|
||||
apr_pool_t *gAPRPoolp = NULL; // Global APR memory pool
|
||||
LLVolatileAPRPool *LLAPRFile::sAPRFilePoolp = NULL ; //global volatile APR memory pool.
|
||||
|
|
@ -279,14 +280,31 @@ bool ll_apr_warn_status(apr_status_t status)
|
|||
{
|
||||
if(APR_SUCCESS == status) return false;
|
||||
char buf[MAX_STRING]; /* Flawfinder: ignore */
|
||||
apr_strerror(status, buf, MAX_STRING);
|
||||
apr_strerror(status, buf, sizeof(buf));
|
||||
LL_WARNS("APR") << "APR: " << buf << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ll_apr_warn_status(apr_status_t status, apr_dso_handle_t *handle)
|
||||
{
|
||||
bool result = ll_apr_warn_status(status);
|
||||
// Despite observed truncation of actual Mac dylib load errors, increasing
|
||||
// this buffer to more than MAX_STRING doesn't help: it appears that APR
|
||||
// stores the output in a fixed 255-character internal buffer. (*sigh*)
|
||||
char buf[MAX_STRING]; /* Flawfinder: ignore */
|
||||
apr_dso_error(handle, buf, sizeof(buf));
|
||||
LL_WARNS("APR") << "APR: " << buf << LL_ENDL;
|
||||
return result;
|
||||
}
|
||||
|
||||
void ll_apr_assert_status(apr_status_t status)
|
||||
{
|
||||
llassert(ll_apr_warn_status(status) == false);
|
||||
llassert(! ll_apr_warn_status(status));
|
||||
}
|
||||
|
||||
void ll_apr_assert_status(apr_status_t status, apr_dso_handle_t *handle)
|
||||
{
|
||||
llassert(! ll_apr_warn_status(status, handle));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@
|
|||
extern LL_COMMON_API apr_thread_mutex_t* gLogMutexp;
|
||||
extern apr_thread_mutex_t* gCallStacksLogMutexp;
|
||||
|
||||
struct apr_dso_handle_t;
|
||||
|
||||
/**
|
||||
* @brief initialize the common apr constructs -- apr itself, the
|
||||
* global pool, and a mutex.
|
||||
|
|
@ -259,8 +261,11 @@ public:
|
|||
* @return Returns <code>true</code> if status is an error condition.
|
||||
*/
|
||||
bool LL_COMMON_API ll_apr_warn_status(apr_status_t status);
|
||||
/// There's a whole other APR error-message function if you pass a DSO handle.
|
||||
bool LL_COMMON_API ll_apr_warn_status(apr_status_t status, apr_dso_handle_t* handle);
|
||||
|
||||
void LL_COMMON_API ll_apr_assert_status(apr_status_t status);
|
||||
void LL_COMMON_API ll_apr_assert_status(apr_status_t status, apr_dso_handle_t* handle);
|
||||
|
||||
extern "C" LL_COMMON_API apr_pool_t* gAPRPoolp; // Global APR memory pool
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ LLAvatarName::LLAvatarName()
|
|||
mLegacyFirstName(),
|
||||
mLegacyLastName(),
|
||||
mIsDisplayNameDefault(false),
|
||||
mIsDummy(false),
|
||||
mIsTemporaryName(false),
|
||||
mExpires(F64_MAX),
|
||||
mNextUpdate(0.0)
|
||||
{ }
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public:
|
|||
// Under error conditions, we may insert "dummy" records with
|
||||
// names like "???" into caches as placeholders. These can be
|
||||
// shown in UI, but are not serialized.
|
||||
bool mIsDummy;
|
||||
bool mIsTemporaryName;
|
||||
|
||||
// Names can change, so need to keep track of when name was
|
||||
// last checked.
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ void LLEventPump::stopListening(const std::string& name)
|
|||
*****************************************************************************/
|
||||
bool LLEventStream::post(const LLSD& event)
|
||||
{
|
||||
if (! mEnabled)
|
||||
if (! mEnabled || !mSignal)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -515,6 +515,8 @@ bool LLEventQueue::post(const LLSD& event)
|
|||
|
||||
void LLEventQueue::flush()
|
||||
{
|
||||
if(!mSignal) return;
|
||||
|
||||
// Consider the case when a given listener on this LLEventQueue posts yet
|
||||
// another event on the same queue. If we loop over mEventQueue directly,
|
||||
// we'll end up processing all those events during the same flush() call
|
||||
|
|
|
|||
|
|
@ -92,6 +92,17 @@ LLFILE* LLFile::_fsopen(const std::string& filename, const char* mode, int shari
|
|||
#endif
|
||||
}
|
||||
|
||||
int LLFile::close(LLFILE * file)
|
||||
{
|
||||
int ret_value = 0;
|
||||
if (file)
|
||||
{
|
||||
ret_value = fclose(file);
|
||||
}
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
int LLFile::remove(const std::string& filename)
|
||||
{
|
||||
#if LL_WINDOWS
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ public:
|
|||
static LLFILE* fopen(const std::string& filename,const char* accessmode); /* Flawfinder: ignore */
|
||||
static LLFILE* _fsopen(const std::string& filename,const char* accessmode,int sharingFlag);
|
||||
|
||||
static int close(LLFILE * file);
|
||||
|
||||
// perms is a permissions mask like 0777 or 0700. In most cases it will
|
||||
// be overridden by the user's umask. It is ignored on Windows.
|
||||
static int mkdir(const std::string& filename, int perms = 0700);
|
||||
|
|
|
|||
|
|
@ -265,14 +265,7 @@ int LLProcessLauncher::launch(void)
|
|||
delete[] fake_argv;
|
||||
|
||||
mProcessID = id;
|
||||
|
||||
// At this point, the child process will have been created (since that's how vfork works -- the child borrowed our execution context until it forked)
|
||||
// If the process doesn't exist at this point, the exec failed.
|
||||
if(!isRunning())
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ public:
|
|||
void waitOnPending();
|
||||
void printQueueStats();
|
||||
|
||||
S32 getPending();
|
||||
virtual S32 getPending();
|
||||
bool getThreaded() { return mThreaded ? true : false; }
|
||||
|
||||
// Request accessors
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#define LL_LLVERSIONVIEWER_H
|
||||
|
||||
const S32 LL_VERSION_MAJOR = 2;
|
||||
const S32 LL_VERSION_MINOR = 5;
|
||||
const S32 LL_VERSION_MINOR = 6;
|
||||
const S32 LL_VERSION_PATCH = 0;
|
||||
const S32 LL_VERSION_BUILD = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@
|
|||
project(llimage)
|
||||
|
||||
include(00-Common)
|
||||
include(LLAddBuildTest)
|
||||
include(LLCommon)
|
||||
include(LLImage)
|
||||
include(LLMath)
|
||||
include(LLVFS)
|
||||
include(ZLIB)
|
||||
include(LLAddBuildTest)
|
||||
include(Tut)
|
||||
|
||||
include_directories(
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
|
|
@ -57,11 +58,18 @@ add_library (llimage ${llimage_SOURCE_FILES})
|
|||
# Sort by high-level to low-level
|
||||
target_link_libraries(llimage
|
||||
llcommon
|
||||
llimagej2coj # *HACK: In theory a noop for KDU builds?
|
||||
${JPEG_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
)
|
||||
|
||||
# Add tests
|
||||
#ADD_BUILD_TEST(llimageworker llimage)
|
||||
if (LL_TESTS)
|
||||
SET(llimage_TEST_SOURCE_FILES
|
||||
llimageworker.cpp
|
||||
)
|
||||
LL_ADD_PROJECT_UNIT_TESTS(llimage "${llimage_TEST_SOURCE_FILES}")
|
||||
endif (LL_TESTS)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -52,13 +52,11 @@ LLMutex* LLImage::sMutex = NULL;
|
|||
void LLImage::initClass()
|
||||
{
|
||||
sMutex = new LLMutex(NULL);
|
||||
LLImageJ2C::openDSO();
|
||||
}
|
||||
|
||||
//static
|
||||
void LLImage::cleanupClass()
|
||||
{
|
||||
LLImageJ2C::closeDSO();
|
||||
delete sMutex;
|
||||
sMutex = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@
|
|||
*/
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "apr_pools.h"
|
||||
#include "apr_dso.h"
|
||||
|
||||
#include "lldir.h"
|
||||
#include "llimagej2c.h"
|
||||
#include "llmemtype.h"
|
||||
|
|
@ -37,18 +34,10 @@ typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)();
|
|||
typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*);
|
||||
typedef const char* (*EngineInfoLLImageJ2CFunction)();
|
||||
|
||||
//some "private static" variables so we only attempt to load
|
||||
//dynamic libaries once
|
||||
CreateLLImageJ2CFunction j2cimpl_create_func;
|
||||
DestroyLLImageJ2CFunction j2cimpl_destroy_func;
|
||||
EngineInfoLLImageJ2CFunction j2cimpl_engineinfo_func;
|
||||
apr_pool_t *j2cimpl_dso_memory_pool;
|
||||
apr_dso_handle_t *j2cimpl_dso_handle;
|
||||
|
||||
//Declare the prototype for theses functions here, their functionality
|
||||
//will be implemented in other files which define a derived LLImageJ2CImpl
|
||||
//but only ONE static library which has the implementation for this
|
||||
//function should ever be included
|
||||
// Declare the prototype for theses functions here. Their functionality
|
||||
// will be implemented in other files which define a derived LLImageJ2CImpl
|
||||
// but only ONE static library which has the implementation for these
|
||||
// functions should ever be included.
|
||||
LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl();
|
||||
void fallbackDestroyLLImageJ2CImpl(LLImageJ2CImpl* impl);
|
||||
const char* fallbackEngineInfoLLImageJ2CImpl();
|
||||
|
|
@ -57,121 +46,10 @@ const char* fallbackEngineInfoLLImageJ2CImpl();
|
|||
LLImageCompressionTester* LLImageJ2C::sTesterp = NULL ;
|
||||
const std::string sTesterName("ImageCompressionTester");
|
||||
|
||||
//static
|
||||
//Loads the required "create", "destroy" and "engineinfo" functions needed
|
||||
void LLImageJ2C::openDSO()
|
||||
{
|
||||
//attempt to load a DSO and get some functions from it
|
||||
std::string dso_name;
|
||||
std::string dso_path;
|
||||
|
||||
bool all_functions_loaded = false;
|
||||
apr_status_t rv;
|
||||
|
||||
#if LL_WINDOWS
|
||||
dso_name = "llkdu.dll";
|
||||
#elif LL_DARWIN
|
||||
dso_name = "libllkdu.dylib";
|
||||
#else
|
||||
dso_name = "libllkdu.so";
|
||||
#endif
|
||||
|
||||
dso_path = gDirUtilp->findFile(dso_name,
|
||||
gDirUtilp->getAppRODataDir(),
|
||||
gDirUtilp->getExecutableDir());
|
||||
|
||||
j2cimpl_dso_handle = NULL;
|
||||
j2cimpl_dso_memory_pool = NULL;
|
||||
|
||||
//attempt to load the shared library
|
||||
apr_pool_create(&j2cimpl_dso_memory_pool, NULL);
|
||||
rv = apr_dso_load(&j2cimpl_dso_handle,
|
||||
dso_path.c_str(),
|
||||
j2cimpl_dso_memory_pool);
|
||||
|
||||
//now, check for success
|
||||
if ( rv == APR_SUCCESS )
|
||||
{
|
||||
//found the dynamic library
|
||||
//now we want to load the functions we're interested in
|
||||
CreateLLImageJ2CFunction create_func = NULL;
|
||||
DestroyLLImageJ2CFunction dest_func = NULL;
|
||||
EngineInfoLLImageJ2CFunction engineinfo_func = NULL;
|
||||
|
||||
rv = apr_dso_sym((apr_dso_handle_sym_t*)&create_func,
|
||||
j2cimpl_dso_handle,
|
||||
"createLLImageJ2CKDU");
|
||||
if ( rv == APR_SUCCESS )
|
||||
{
|
||||
//we've loaded the create function ok
|
||||
//we need to delete via the DSO too
|
||||
//so lets check for a destruction function
|
||||
rv = apr_dso_sym((apr_dso_handle_sym_t*)&dest_func,
|
||||
j2cimpl_dso_handle,
|
||||
"destroyLLImageJ2CKDU");
|
||||
if ( rv == APR_SUCCESS )
|
||||
{
|
||||
//we've loaded the destroy function ok
|
||||
rv = apr_dso_sym((apr_dso_handle_sym_t*)&engineinfo_func,
|
||||
j2cimpl_dso_handle,
|
||||
"engineInfoLLImageJ2CKDU");
|
||||
if ( rv == APR_SUCCESS )
|
||||
{
|
||||
//ok, everything is loaded alright
|
||||
j2cimpl_create_func = create_func;
|
||||
j2cimpl_destroy_func = dest_func;
|
||||
j2cimpl_engineinfo_func = engineinfo_func;
|
||||
all_functions_loaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !all_functions_loaded )
|
||||
{
|
||||
//something went wrong with the DSO or function loading..
|
||||
//fall back onto our satefy impl creation function
|
||||
|
||||
#if 0
|
||||
// precious verbose debugging, sadly we can't use our
|
||||
// 'llinfos' stream etc. this early in the initialisation seq.
|
||||
char errbuf[256];
|
||||
fprintf(stderr, "failed to load syms from DSO %s (%s)\n",
|
||||
dso_name.c_str(), dso_path.c_str());
|
||||
apr_strerror(rv, errbuf, sizeof(errbuf));
|
||||
fprintf(stderr, "error: %d, %s\n", rv, errbuf);
|
||||
apr_dso_error(j2cimpl_dso_handle, errbuf, sizeof(errbuf));
|
||||
fprintf(stderr, "dso-error: %d, %s\n", rv, errbuf);
|
||||
#endif
|
||||
|
||||
if ( j2cimpl_dso_handle )
|
||||
{
|
||||
apr_dso_unload(j2cimpl_dso_handle);
|
||||
j2cimpl_dso_handle = NULL;
|
||||
}
|
||||
|
||||
if ( j2cimpl_dso_memory_pool )
|
||||
{
|
||||
apr_pool_destroy(j2cimpl_dso_memory_pool);
|
||||
j2cimpl_dso_memory_pool = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLImageJ2C::closeDSO()
|
||||
{
|
||||
if ( j2cimpl_dso_handle ) apr_dso_unload(j2cimpl_dso_handle);
|
||||
if (j2cimpl_dso_memory_pool) apr_pool_destroy(j2cimpl_dso_memory_pool);
|
||||
}
|
||||
|
||||
//static
|
||||
std::string LLImageJ2C::getEngineInfo()
|
||||
{
|
||||
if (!j2cimpl_engineinfo_func)
|
||||
j2cimpl_engineinfo_func = fallbackEngineInfoLLImageJ2CImpl;
|
||||
|
||||
return j2cimpl_engineinfo_func();
|
||||
return fallbackEngineInfoLLImageJ2CImpl();
|
||||
}
|
||||
|
||||
LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C),
|
||||
|
|
@ -181,20 +59,7 @@ LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C),
|
|||
mReversible(FALSE),
|
||||
mAreaUsedForDataSizeCalcs(0)
|
||||
{
|
||||
//We assume here that if we wanted to create via
|
||||
//a dynamic library that the approriate open calls were made
|
||||
//before any calls to this constructor.
|
||||
|
||||
//Therefore, a NULL creation function pointer here means
|
||||
//we either did not want to create using functions from the dynamic
|
||||
//library or there were issues loading it, either way
|
||||
//use our fall back
|
||||
if ( !j2cimpl_create_func )
|
||||
{
|
||||
j2cimpl_create_func = fallbackCreateLLImageJ2CImpl;
|
||||
}
|
||||
|
||||
mImpl = j2cimpl_create_func();
|
||||
mImpl = fallbackCreateLLImageJ2CImpl();
|
||||
|
||||
// Clear data size table
|
||||
for( S32 i = 0; i <= MAX_DISCARD_LEVEL; i++)
|
||||
|
|
@ -217,22 +82,9 @@ LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C),
|
|||
// virtual
|
||||
LLImageJ2C::~LLImageJ2C()
|
||||
{
|
||||
//We assume here that if we wanted to destroy via
|
||||
//a dynamic library that the approriate open calls were made
|
||||
//before any calls to this destructor.
|
||||
|
||||
//Therefore, a NULL creation function pointer here means
|
||||
//we either did not want to destroy using functions from the dynamic
|
||||
//library or there were issues loading it, either way
|
||||
//use our fall back
|
||||
if ( !j2cimpl_destroy_func )
|
||||
{
|
||||
j2cimpl_destroy_func = fallbackDestroyLLImageJ2CImpl;
|
||||
}
|
||||
|
||||
if ( mImpl )
|
||||
{
|
||||
j2cimpl_destroy_func(mImpl);
|
||||
fallbackDestroyLLImageJ2CImpl(mImpl);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,8 +72,6 @@ public:
|
|||
static S32 calcHeaderSizeJ2C();
|
||||
static S32 calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate = 0.f);
|
||||
|
||||
static void openDSO();
|
||||
static void closeDSO();
|
||||
static std::string getEngineInfo();
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ LLPngWrapper::LLPngWrapper()
|
|||
mCompressionType( 0 ),
|
||||
mFilterMethod( 0 ),
|
||||
mFinalSize( 0 ),
|
||||
mHasBKGD(false),
|
||||
mBackgroundColor(),
|
||||
mGamma(0.f)
|
||||
{
|
||||
}
|
||||
|
|
@ -111,9 +109,9 @@ void LLPngWrapper::writeFlush(png_structp png_ptr)
|
|||
}
|
||||
|
||||
// Read the PNG file using the libpng. The low-level interface is used here
|
||||
// because we want to do various transformations (including setting the
|
||||
// matte background if any, and applying gama) which can't be done with
|
||||
// the high-level interface. The scanline also begins at the bottom of
|
||||
// because we want to do various transformations (including applying gama)
|
||||
// which can't be done with the high-level interface.
|
||||
// The scanline also begins at the bottom of
|
||||
// the image (per SecondLife conventions) instead of at the top, so we
|
||||
// must assign row-pointers in "reverse" order.
|
||||
BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop)
|
||||
|
|
@ -201,8 +199,7 @@ void LLPngWrapper::normalizeImage()
|
|||
// 2. Convert grayscales to RGB
|
||||
// 3. Create alpha layer from transparency
|
||||
// 4. Ensure 8-bpp for all images
|
||||
// 5. Apply background matte if any
|
||||
// 6. Set (or guess) gamma
|
||||
// 5. Set (or guess) gamma
|
||||
|
||||
if (mColorType == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
|
|
@ -229,12 +226,6 @@ void LLPngWrapper::normalizeImage()
|
|||
{
|
||||
png_set_strip_16(mReadPngPtr);
|
||||
}
|
||||
mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor);
|
||||
if (mHasBKGD)
|
||||
{
|
||||
png_set_background(mReadPngPtr, mBackgroundColor,
|
||||
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
|
||||
}
|
||||
|
||||
#if LL_DARWIN
|
||||
const F64 SCREEN_GAMMA = 1.8;
|
||||
|
|
@ -261,7 +252,6 @@ void LLPngWrapper::updateMetaData()
|
|||
mBitDepth = png_get_bit_depth(mReadPngPtr, mReadInfoPtr);
|
||||
mColorType = png_get_color_type(mReadPngPtr, mReadInfoPtr);
|
||||
mChannels = png_get_channels(mReadPngPtr, mReadInfoPtr);
|
||||
mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor);
|
||||
}
|
||||
|
||||
// Method to write raw image into PNG at dest. The raw scanline begins
|
||||
|
|
|
|||
|
|
@ -88,9 +88,6 @@ private:
|
|||
|
||||
U32 mFinalSize;
|
||||
|
||||
bool mHasBKGD;
|
||||
png_color_16p mBackgroundColor;
|
||||
|
||||
F64 mGamma;
|
||||
|
||||
std::string mErrorMessage;
|
||||
|
|
|
|||
|
|
@ -26,10 +26,8 @@
|
|||
*/
|
||||
|
||||
// Precompiled header: almost always required for newview cpp files
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
// Class to test
|
||||
#include "linden_common.h"
|
||||
// Class to test
|
||||
#include "../llimageworker.h"
|
||||
// For timer class
|
||||
#include "../llcommon/lltimer.h"
|
||||
|
|
@ -44,7 +42,17 @@
|
|||
// * Do not make any assumption as to how those classes or methods work (i.e. don't copy/paste code)
|
||||
// * A simulator for a class can be implemented here. Please comment and document thoroughly.
|
||||
|
||||
LLImageBase::LLImageBase() {}
|
||||
LLImageBase::LLImageBase()
|
||||
: mData(NULL),
|
||||
mDataSize(0),
|
||||
mWidth(0),
|
||||
mHeight(0),
|
||||
mComponents(0),
|
||||
mBadBufferAllocation(false),
|
||||
mAllowOverSize(false),
|
||||
mMemType(LLMemType::MTYPE_IMAGEBASE)
|
||||
{
|
||||
}
|
||||
LLImageBase::~LLImageBase() {}
|
||||
void LLImageBase::dump() { }
|
||||
void LLImageBase::sanityCheck() { }
|
||||
|
|
|
|||
|
|
@ -90,6 +90,12 @@ void info_callback(const char* msg, void*)
|
|||
lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl;
|
||||
}
|
||||
|
||||
// Divide a by 2 to the power of b and round upwards
|
||||
int ceildivpow2(int a, int b)
|
||||
{
|
||||
return (a + (1 << b) - 1) >> b;
|
||||
}
|
||||
|
||||
|
||||
LLImageJ2COJ::LLImageJ2COJ()
|
||||
: LLImageJ2CImpl()
|
||||
|
|
|
|||
|
|
@ -34,17 +34,11 @@ class LLImageJ2COJ : public LLImageJ2CImpl
|
|||
public:
|
||||
LLImageJ2COJ();
|
||||
virtual ~LLImageJ2COJ();
|
||||
|
||||
protected:
|
||||
/*virtual*/ BOOL getMetadata(LLImageJ2C &base);
|
||||
/*virtual*/ BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count);
|
||||
/*virtual*/ BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0,
|
||||
BOOL reversible = FALSE);
|
||||
int ceildivpow2(int a, int b)
|
||||
{
|
||||
// Divide a by b to the power of 2 and round upwards.
|
||||
return (a + (1 << b) - 1) >> b;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ bool LLNotecard::importStream(std::istream& str)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if(text_len > mMaxText)
|
||||
if(text_len > mMaxText || text_len < 0)
|
||||
{
|
||||
llwarns << "Invalid Linden text length: " << text_len << llendl;
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
project(llkdu)
|
||||
|
||||
# Visual Studio 2005 has a dumb bug that causes it to fail compilation
|
||||
# of KDU if building with both optimisation and /WS (treat warnings as
|
||||
# errors), even when the specific warnings that make it croak are
|
||||
# disabled.
|
||||
|
||||
#set(VS_DISABLE_FATAL_WARNINGS ON)
|
||||
|
||||
include(00-Common)
|
||||
include(LLCommon)
|
||||
include(LLImage)
|
||||
include(LLKDU)
|
||||
include(LLMath)
|
||||
|
||||
include_directories(
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LLIMAGE_INCLUDE_DIRS}
|
||||
${KDU_INCLUDE_DIR}
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(llkdu_SOURCE_FILES
|
||||
llimagej2ckdu.cpp
|
||||
llkdumem.cpp
|
||||
)
|
||||
|
||||
set(llkdu_HEADER_FILES
|
||||
CMakeLists.txt
|
||||
|
||||
llimagej2ckdu.h
|
||||
llkdumem.h
|
||||
)
|
||||
|
||||
set_source_files_properties(${llkdu_HEADER_FILES}
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
|
||||
list(APPEND llkdu_SOURCE_FILES ${llkdu_HEADER_FILES})
|
||||
|
||||
if (USE_KDU)
|
||||
add_library (${LLKDU_LIBRARIES} ${llkdu_SOURCE_FILES})
|
||||
|
||||
# Add tests
|
||||
if (LL_TESTS)
|
||||
include(LLAddBuildTest)
|
||||
include(Tut)
|
||||
SET(llkdu_TEST_SOURCE_FILES
|
||||
llimagej2ckdu.cpp
|
||||
)
|
||||
LL_ADD_PROJECT_UNIT_TESTS(llkdu "${llkdu_TEST_SOURCE_FILES}")
|
||||
endif (LL_TESTS)
|
||||
|
||||
endif (USE_KDU)
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,90 @@
|
|||
/**
|
||||
* @file llimagej2ckdu.h
|
||||
* @brief This is an implementation of JPEG2000 encode/decode using Kakadu
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLIMAGEJ2CKDU_H
|
||||
#define LL_LLIMAGEJ2CKDU_H
|
||||
|
||||
#include "llimagej2c.h"
|
||||
|
||||
//
|
||||
// KDU core header files
|
||||
//
|
||||
#include "kdu_elementary.h"
|
||||
#include "kdu_messaging.h"
|
||||
#include "kdu_params.h"
|
||||
#include "kdu_compressed.h"
|
||||
#include "kdu_sample_processing.h"
|
||||
|
||||
class LLKDUDecodeState;
|
||||
class LLKDUMemSource;
|
||||
|
||||
class LLImageJ2CKDU : public LLImageJ2CImpl
|
||||
{
|
||||
public:
|
||||
enum ECodeStreamMode
|
||||
{
|
||||
MODE_FAST = 0,
|
||||
MODE_RESILIENT = 1,
|
||||
MODE_FUSSY = 2
|
||||
};
|
||||
LLImageJ2CKDU();
|
||||
virtual ~LLImageJ2CKDU();
|
||||
|
||||
protected:
|
||||
/*virtual*/ BOOL getMetadata(LLImageJ2C &base);
|
||||
/*virtual*/ BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count);
|
||||
/*virtual*/ BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0,
|
||||
BOOL reversible=FALSE);
|
||||
|
||||
private:
|
||||
void setupCodeStream(LLImageJ2C &base, BOOL keep_codestream, ECodeStreamMode mode);
|
||||
void cleanupCodeStream();
|
||||
BOOL initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, ECodeStreamMode mode, S32 first_channel, S32 max_channel_count );
|
||||
|
||||
// Encode variable
|
||||
LLKDUMemSource *mInputp;
|
||||
kdu_codestream *mCodeStreamp;
|
||||
kdu_coords *mTPosp; // tile position
|
||||
kdu_dims *mTileIndicesp;
|
||||
|
||||
// Temporary variables for in-progress decodes...
|
||||
LLImageRaw *mRawImagep;
|
||||
LLKDUDecodeState *mDecodeState;
|
||||
};
|
||||
|
||||
#if LL_WINDOWS
|
||||
# define LLSYMEXPORT __declspec(dllexport)
|
||||
#elif LL_LINUX
|
||||
# define LLSYMEXPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
# define LLSYMEXPORT
|
||||
#endif
|
||||
|
||||
extern "C" LLSYMEXPORT const char* engineInfoLLImageJ2CKDU();
|
||||
extern "C" LLSYMEXPORT LLImageJ2CKDU* createLLImageJ2CKDU();
|
||||
extern "C" LLSYMEXPORT void destroyLLImageJ2CKDU(LLImageJ2CKDU* kdu);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,196 @@
|
|||
/**
|
||||
* @file llkdumem.cpp
|
||||
* @brief Helper class for kdu memory management
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "llkdumem.h"
|
||||
#include "llerror.h"
|
||||
|
||||
#if defined(LL_WINDOWS)
|
||||
# pragma warning(disable: 4702) // unreachable code
|
||||
#endif
|
||||
|
||||
LLKDUMemIn::LLKDUMemIn(const U8 *data,
|
||||
const U32 size,
|
||||
const U16 width,
|
||||
const U16 height,
|
||||
const U8 in_num_components,
|
||||
siz_params *siz)
|
||||
{
|
||||
U8 n;
|
||||
|
||||
first_comp_idx = 0;
|
||||
rows = height;
|
||||
cols = width;
|
||||
num_components = in_num_components;
|
||||
alignment_bytes = 0;
|
||||
|
||||
for (n=0; n<3; ++n)
|
||||
{
|
||||
precision[n] = 0;
|
||||
}
|
||||
|
||||
for (n=0; n < num_components; ++n)
|
||||
{
|
||||
siz->set(Sdims,n,0,rows);
|
||||
siz->set(Sdims,n,1,cols);
|
||||
siz->set(Ssigned,n,0,false);
|
||||
siz->set(Sprecision,n,0,8);
|
||||
}
|
||||
incomplete_lines = NULL;
|
||||
free_lines = NULL;
|
||||
num_unread_rows = rows;
|
||||
|
||||
mData = data;
|
||||
mDataSize = size;
|
||||
mCurPos = 0;
|
||||
}
|
||||
|
||||
LLKDUMemIn::~LLKDUMemIn()
|
||||
{
|
||||
if ((num_unread_rows > 0) || (incomplete_lines != NULL))
|
||||
{
|
||||
kdu_warning w;
|
||||
w << "Not all rows of image components "
|
||||
<< first_comp_idx << " through "
|
||||
<< first_comp_idx+num_components-1
|
||||
<< " were consumed!";
|
||||
}
|
||||
image_line_buf *tmp;
|
||||
while ((tmp=incomplete_lines) != NULL)
|
||||
{
|
||||
incomplete_lines = tmp->next;
|
||||
delete tmp;
|
||||
}
|
||||
while ((tmp=free_lines) != NULL)
|
||||
{
|
||||
free_lines = tmp->next;
|
||||
delete tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool LLKDUMemIn::get(int comp_idx, kdu_line_buf &line, int x_tnum)
|
||||
{
|
||||
int idx = comp_idx - this->first_comp_idx;
|
||||
assert((idx >= 0) && (idx < num_components));
|
||||
x_tnum = x_tnum*num_components+idx;
|
||||
image_line_buf *scan, *prev=NULL;
|
||||
for (scan=incomplete_lines; scan != NULL; prev=scan, scan=scan->next)
|
||||
{
|
||||
assert(scan->next_x_tnum >= x_tnum);
|
||||
if (scan->next_x_tnum == x_tnum)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (scan == NULL)
|
||||
{ // Need to read a new image line.
|
||||
assert(x_tnum == 0); // Must consume in very specific order.
|
||||
if (num_unread_rows == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ((scan = free_lines) == NULL)
|
||||
{
|
||||
scan = new image_line_buf(cols+3,num_components);
|
||||
}
|
||||
free_lines = scan->next;
|
||||
if (prev == NULL)
|
||||
{
|
||||
incomplete_lines = scan;
|
||||
}
|
||||
else
|
||||
{
|
||||
prev->next = scan;
|
||||
}
|
||||
|
||||
// Copy from image buffer into scan.
|
||||
memcpy(scan->buf, mData+mCurPos, cols*num_components);
|
||||
mCurPos += cols*num_components;
|
||||
|
||||
num_unread_rows--;
|
||||
scan->accessed_samples = 0;
|
||||
scan->next_x_tnum = 0;
|
||||
}
|
||||
|
||||
assert((cols-scan->accessed_samples) >= line.get_width());
|
||||
|
||||
int comp_offset = idx;
|
||||
kdu_byte *sp = scan->buf+num_components*scan->accessed_samples + comp_offset;
|
||||
int n=line.get_width();
|
||||
|
||||
if (line.get_buf32() != NULL)
|
||||
{
|
||||
kdu_sample32 *dp = line.get_buf32();
|
||||
if (line.is_absolute())
|
||||
{ // 32-bit absolute integers
|
||||
for (; n > 0; n--, sp+=num_components, dp++)
|
||||
{
|
||||
dp->ival = ((kdu_int32)(*sp)) - 128;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // true 32-bit floats
|
||||
for (; n > 0; n--, sp+=num_components, dp++)
|
||||
{
|
||||
dp->fval = (((float)(*sp)) / 256.0F) - 0.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
kdu_sample16 *dp = line.get_buf16();
|
||||
if (line.is_absolute())
|
||||
{ // 16-bit absolute integers
|
||||
for (; n > 0; n--, sp+=num_components, dp++)
|
||||
{
|
||||
dp->ival = ((kdu_int16)(*sp)) - 128;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // 16-bit normalized representation.
|
||||
for (; n > 0; n--, sp+=num_components, dp++)
|
||||
{
|
||||
dp->ival = (((kdu_int16)(*sp)) - 128) << (KDU_FIX_POINT-8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scan->next_x_tnum++;
|
||||
if (idx == (num_components-1))
|
||||
{
|
||||
scan->accessed_samples += line.get_width();
|
||||
}
|
||||
if (scan->accessed_samples == cols)
|
||||
{ // Send empty line to free list.
|
||||
assert(scan == incomplete_lines);
|
||||
incomplete_lines = scan->next;
|
||||
scan->next = free_lines;
|
||||
free_lines = scan;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
/**
|
||||
* @file llkdumem.h
|
||||
* @brief Helper class for kdu memory management
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLKDUMEM_H
|
||||
#define LL_LLKDUMEM_H
|
||||
|
||||
// Support classes for reading and writing from memory buffers in KDU
|
||||
#include "kdu_image.h"
|
||||
#include "kdu_elementary.h"
|
||||
#include "kdu_messaging.h"
|
||||
#include "kdu_params.h"
|
||||
#include "kdu_compressed.h"
|
||||
#include "kdu_sample_processing.h"
|
||||
#include "image_local.h"
|
||||
#include "stdtypes.h"
|
||||
|
||||
class LLKDUMemSource: public kdu_compressed_source
|
||||
{
|
||||
public: // Member functions
|
||||
LLKDUMemSource(U8 *input_buffer, U32 size)
|
||||
{
|
||||
mData = input_buffer;
|
||||
mSize = size;
|
||||
mCurPos = 0;
|
||||
}
|
||||
|
||||
~LLKDUMemSource()
|
||||
{
|
||||
}
|
||||
|
||||
int read(kdu_byte *buf, int num_bytes)
|
||||
{
|
||||
U32 num_out;
|
||||
num_out = num_bytes;
|
||||
|
||||
if ((mSize - mCurPos) < (U32)num_bytes)
|
||||
{
|
||||
num_out = mSize -mCurPos;
|
||||
}
|
||||
memcpy(buf, mData + mCurPos, num_out);
|
||||
mCurPos += num_out;
|
||||
return num_out;
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
mCurPos = 0;
|
||||
}
|
||||
|
||||
private: // Data
|
||||
U8 *mData;
|
||||
U32 mSize;
|
||||
U32 mCurPos;
|
||||
};
|
||||
|
||||
class LLKDUMemTarget: public kdu_compressed_target
|
||||
{
|
||||
public: // Member functions
|
||||
LLKDUMemTarget(U8 *output_buffer, U32 &output_size, const U32 buffer_size)
|
||||
{
|
||||
mData = output_buffer;
|
||||
mSize = buffer_size;
|
||||
mCurPos = 0;
|
||||
mOutputSize = &output_size;
|
||||
}
|
||||
|
||||
~LLKDUMemTarget()
|
||||
{
|
||||
}
|
||||
|
||||
bool write(const kdu_byte *buf, int num_bytes)
|
||||
{
|
||||
U32 num_out;
|
||||
num_out = num_bytes;
|
||||
|
||||
if ((mSize - mCurPos) < (U32)num_bytes)
|
||||
{
|
||||
num_out = mSize - mCurPos;
|
||||
memcpy(mData + mCurPos, buf, num_out);
|
||||
return false;
|
||||
}
|
||||
memcpy(mData + mCurPos, buf, num_out);
|
||||
mCurPos += num_out;
|
||||
*mOutputSize = mCurPos;
|
||||
return true;
|
||||
}
|
||||
|
||||
private: // Data
|
||||
U8 *mData;
|
||||
U32 mSize;
|
||||
U32 mCurPos;
|
||||
U32 *mOutputSize;
|
||||
};
|
||||
|
||||
class LLKDUMemIn : public kdu_image_in_base
|
||||
{
|
||||
public: // Member functions
|
||||
LLKDUMemIn(const U8 *data,
|
||||
const U32 size,
|
||||
const U16 rows,
|
||||
const U16 cols,
|
||||
U8 in_num_components,
|
||||
siz_params *siz);
|
||||
~LLKDUMemIn();
|
||||
|
||||
bool get(int comp_idx, kdu_line_buf &line, int x_tnum);
|
||||
|
||||
private: // Data
|
||||
const U8 *mData;
|
||||
int first_comp_idx;
|
||||
int num_components;
|
||||
int rows, cols;
|
||||
int alignment_bytes; // Number of 0's at end of each line.
|
||||
int precision[3];
|
||||
image_line_buf *incomplete_lines; // Each "sample" represents a full pixel
|
||||
image_line_buf *free_lines;
|
||||
int num_unread_rows;
|
||||
|
||||
U32 mCurPos;
|
||||
U32 mDataSize;
|
||||
};
|
||||
#endif
|
||||
|
|
@ -0,0 +1,248 @@
|
|||
/**
|
||||
* @file llimagej2ckdu_test.cpp
|
||||
* @author Merov Linden
|
||||
* @date 2010-12-17
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
// Class to test
|
||||
#include "../llimagej2ckdu.h"
|
||||
#include "../llkdumem.h"
|
||||
// Tut header
|
||||
#include "../test/lltut.h"
|
||||
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// Stubbing: Declarations required to link and run the class being tested
|
||||
// Notes:
|
||||
// * Add here stubbed implementation of the few classes and methods used in the class to be tested
|
||||
// * Add as little as possible (let the link errors guide you)
|
||||
// * Do not make any assumption as to how those classes or methods work (i.e. don't copy/paste code)
|
||||
// * A simulator for a class can be implemented here. Please comment and document thoroughly.
|
||||
|
||||
// End Stubbing
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// Stubb the LL Image Classes
|
||||
LLImageRaw::LLImageRaw() { }
|
||||
LLImageRaw::~LLImageRaw() { }
|
||||
U8* LLImageRaw::allocateData(S32 ) { return NULL; }
|
||||
void LLImageRaw::deleteData() { }
|
||||
U8* LLImageRaw::reallocateData(S32 ) { return NULL; }
|
||||
BOOL LLImageRaw::resize(U16, U16, S8) { return TRUE; } // this method always returns TRUE...
|
||||
|
||||
LLImageBase::LLImageBase()
|
||||
: mData(NULL),
|
||||
mDataSize(0),
|
||||
mWidth(0),
|
||||
mHeight(0),
|
||||
mComponents(0),
|
||||
mBadBufferAllocation(false),
|
||||
mAllowOverSize(false),
|
||||
mMemType(LLMemType::MTYPE_IMAGEBASE)
|
||||
{ }
|
||||
LLImageBase::~LLImageBase() { }
|
||||
U8* LLImageBase::allocateData(S32 ) { return NULL; }
|
||||
void LLImageBase::deleteData() { }
|
||||
void LLImageBase::dump() { }
|
||||
const U8* LLImageBase::getData() const { return NULL; }
|
||||
U8* LLImageBase::getData() { return NULL; }
|
||||
U8* LLImageBase::reallocateData(S32 ) { return NULL; }
|
||||
void LLImageBase::sanityCheck() { }
|
||||
void LLImageBase::setSize(S32 , S32 , S32 ) { }
|
||||
|
||||
LLImageJ2CImpl::~LLImageJ2CImpl() { }
|
||||
|
||||
LLImageFormatted::LLImageFormatted(S8 ) { }
|
||||
LLImageFormatted::~LLImageFormatted() { }
|
||||
U8* LLImageFormatted::allocateData(S32 ) { return NULL; }
|
||||
S32 LLImageFormatted::calcDataSize(S32 ) { return 0; }
|
||||
S32 LLImageFormatted::calcDiscardLevelBytes(S32 ) { return 0; }
|
||||
BOOL LLImageFormatted::decodeChannels(LLImageRaw*, F32, S32, S32) { return FALSE; }
|
||||
BOOL LLImageFormatted::copyData(U8 *, S32) { return TRUE; } // this method always returns TRUE...
|
||||
void LLImageFormatted::deleteData() { }
|
||||
void LLImageFormatted::dump() { }
|
||||
U8* LLImageFormatted::reallocateData(S32 ) { return NULL; }
|
||||
void LLImageFormatted::resetLastError() { }
|
||||
void LLImageFormatted::sanityCheck() { }
|
||||
void LLImageFormatted::setLastError(const std::string& , const std::string& ) { }
|
||||
|
||||
LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C) { }
|
||||
LLImageJ2C::~LLImageJ2C() { }
|
||||
S32 LLImageJ2C::calcDataSize(S32 ) { return 0; }
|
||||
S32 LLImageJ2C::calcDiscardLevelBytes(S32 ) { return 0; }
|
||||
S32 LLImageJ2C::calcHeaderSize() { return 0; }
|
||||
BOOL LLImageJ2C::decode(LLImageRaw*, F32) { return FALSE; }
|
||||
BOOL LLImageJ2C::decodeChannels(LLImageRaw*, F32, S32, S32 ) { return FALSE; }
|
||||
void LLImageJ2C::decodeFailed() { }
|
||||
BOOL LLImageJ2C::encode(const LLImageRaw*, F32) { return FALSE; }
|
||||
S8 LLImageJ2C::getRawDiscardLevel() { return 0; }
|
||||
void LLImageJ2C::resetLastError() { }
|
||||
void LLImageJ2C::setLastError(const std::string&, const std::string&) { }
|
||||
BOOL LLImageJ2C::updateData() { return FALSE; }
|
||||
void LLImageJ2C::updateRawDiscardLevel() { }
|
||||
|
||||
LLKDUMemIn::LLKDUMemIn(const U8*, const U32, const U16, const U16, const U8, siz_params*) { }
|
||||
LLKDUMemIn::~LLKDUMemIn() { }
|
||||
bool LLKDUMemIn::get(int, kdu_line_buf&, int) { return false; }
|
||||
|
||||
// Stub Kakadu Library calls
|
||||
kdu_tile_comp kdu_tile::access_component(int ) { kdu_tile_comp a; return a; }
|
||||
void kdu_tile::close(kdu_thread_env* ) { }
|
||||
int kdu_tile::get_num_components() { return 0; }
|
||||
bool kdu_tile::get_ycc() { return false; }
|
||||
void kdu_tile::set_components_of_interest(int , const int* ) { }
|
||||
kdu_resolution kdu_tile_comp::access_resolution() { kdu_resolution a; return a; }
|
||||
int kdu_tile_comp::get_bit_depth(bool ) { return 8; }
|
||||
bool kdu_tile_comp::get_reversible() { return false; }
|
||||
kdu_subband kdu_resolution::access_subband(int ) { kdu_subband a; return a; }
|
||||
void kdu_resolution::get_dims(kdu_dims& ) { }
|
||||
int kdu_resolution::which() { return 0; }
|
||||
kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*) { }
|
||||
kdu_synthesis::kdu_synthesis(kdu_resolution, kdu_sample_allocator*, bool, float, kdu_thread_env*, kdu_thread_queue*) { }
|
||||
kdu_params::kdu_params(const char*, bool, bool, bool, bool, bool) { }
|
||||
kdu_params::~kdu_params() { }
|
||||
void kdu_params::set(const char* , int , int , bool ) { }
|
||||
void kdu_params::set(const char* , int , int , int ) { }
|
||||
void kdu_params::finalize_all(bool ) { }
|
||||
void kdu_params::copy_from(kdu_params*, int, int, int, int, int, bool, bool, bool) { }
|
||||
bool kdu_params::parse_string(const char*) { return false; }
|
||||
bool kdu_params::get(const char*, int, int, bool&, bool, bool, bool) { return false; }
|
||||
bool kdu_params::get(const char*, int, int, float&, bool, bool, bool) { return false; }
|
||||
bool kdu_params::get(const char*, int, int, int&, bool, bool, bool) { return false; }
|
||||
kdu_params* kdu_params::access_relation(int, int, int, bool) { return NULL; }
|
||||
kdu_params* kdu_params::access_cluster(const char*) { return NULL; }
|
||||
void kdu_codestream::set_fast() { }
|
||||
void kdu_codestream::set_fussy() { }
|
||||
void kdu_codestream::get_dims(int, kdu_dims&, bool ) { }
|
||||
void kdu_codestream::change_appearance(bool, bool, bool) { }
|
||||
void kdu_codestream::get_tile_dims(kdu_coords, int, kdu_dims&, bool ) { }
|
||||
void kdu_codestream::destroy() { }
|
||||
void kdu_codestream::collect_timing_stats(int ) { }
|
||||
void kdu_codestream::set_max_bytes(kdu_long, bool, bool ) { }
|
||||
void kdu_codestream::get_valid_tiles(kdu_dims& ) { }
|
||||
void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long ) { }
|
||||
void kdu_codestream::create(kdu_compressed_source*, kdu_thread_env*) { }
|
||||
void kdu_codestream::apply_input_restrictions( int, int, int, int, kdu_dims*, kdu_component_access_mode ) { }
|
||||
void kdu_codestream::get_subsampling(int , kdu_coords&, bool ) { }
|
||||
void kdu_codestream::flush(kdu_long *, int , kdu_uint16 *, bool, bool, double, kdu_thread_env*) { }
|
||||
void kdu_codestream::set_resilient(bool ) { }
|
||||
int kdu_codestream::get_num_components(bool ) { return 0; }
|
||||
siz_params* kdu_codestream::access_siz() { return NULL; }
|
||||
kdu_tile kdu_codestream::open_tile(kdu_coords , kdu_thread_env* ) { kdu_tile a; return a; }
|
||||
kdu_codestream_comment kdu_codestream::add_comment() { kdu_codestream_comment a; return a; }
|
||||
bool kdu_codestream_comment::put_text(const char*) { return false; }
|
||||
void kdu_customize_warnings(kdu_message*) { }
|
||||
void kdu_customize_errors(kdu_message*) { }
|
||||
void kdu_convert_ycc_to_rgb(kdu_line_buf&, kdu_line_buf&, kdu_line_buf&, int) { }
|
||||
kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, bool, kdu_roi_image*, bool, int, kdu_thread_env*, kdu_thread_queue*, bool ) { kdu_long a = 0; return a; }
|
||||
siz_params::siz_params() : kdu_params(NULL, false, false, false, false, false) { }
|
||||
void siz_params::finalize(bool ) { }
|
||||
void siz_params::copy_with_xforms(kdu_params*, int, int, bool, bool, bool) { }
|
||||
int siz_params::write_marker_segment(kdu_output*, kdu_params*, int) { return 0; }
|
||||
bool siz_params::check_marker_segment(kdu_uint16, int, kdu_byte a[], int&) { return false; }
|
||||
bool siz_params::read_marker_segment(kdu_uint16, int, kdu_byte a[], int) { return false; }
|
||||
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// TUT
|
||||
// -------------------------------------------------------------------------------------------
|
||||
|
||||
namespace tut
|
||||
{
|
||||
// Test wrapper declarations
|
||||
struct llimagej2ckdu_test
|
||||
{
|
||||
// Derived test class
|
||||
class LLTestImageJ2CKDU : public LLImageJ2CKDU
|
||||
{
|
||||
public:
|
||||
// Provides public access to some protected methods for testing
|
||||
BOOL callGetMetadata(LLImageJ2C &base) { return getMetadata(base); }
|
||||
BOOL callDecodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count)
|
||||
{
|
||||
return decodeImpl(base, raw_image, decode_time, first_channel, max_channel_count);
|
||||
}
|
||||
BOOL callEncodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text)
|
||||
{
|
||||
return encodeImpl(base, raw_image, comment_text);
|
||||
}
|
||||
};
|
||||
// Instance to be tested
|
||||
LLTestImageJ2CKDU* mImage;
|
||||
|
||||
// Constructor and destructor of the test wrapper
|
||||
llimagej2ckdu_test()
|
||||
{
|
||||
mImage = new LLTestImageJ2CKDU;
|
||||
}
|
||||
~llimagej2ckdu_test()
|
||||
{
|
||||
delete mImage;
|
||||
}
|
||||
};
|
||||
|
||||
// Tut templating thingamagic: test group, object and test instance
|
||||
typedef test_group<llimagej2ckdu_test> llimagej2ckdu_t;
|
||||
typedef llimagej2ckdu_t::object llimagej2ckdu_object_t;
|
||||
tut::llimagej2ckdu_t tut_llimagej2ckdu("LLImageJ2CKDU");
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Test functions
|
||||
// Notes:
|
||||
// * Test as many as you possibly can without requiring a full blown simulation of everything
|
||||
// * The tests are executed in sequence so the test instance state may change between calls
|
||||
// * Remember that you cannot test private methods with tut
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
// Test 1 : test getMetadata()
|
||||
template<> template<>
|
||||
void llimagej2ckdu_object_t::test<1>()
|
||||
{
|
||||
LLImageJ2C* image = new LLImageJ2C();
|
||||
BOOL res = mImage->callGetMetadata(*image);
|
||||
// Trying to set up a data stream with all NIL values and stubbed KDU will "work" and return TRUE
|
||||
// Note that is linking with KDU, that call will throw an exception and fail, returning FALSE
|
||||
ensure("getMetadata() test failed", res == TRUE);
|
||||
}
|
||||
|
||||
// Test 2 : test decodeImpl()
|
||||
template<> template<>
|
||||
void llimagej2ckdu_object_t::test<2>()
|
||||
{
|
||||
LLImageJ2C* image = new LLImageJ2C();
|
||||
LLImageRaw* raw = new LLImageRaw();
|
||||
BOOL res = mImage->callDecodeImpl(*image, *raw, 0.0, 0, 0);
|
||||
// Decoding returns TRUE whenever there's nothing else to do, including if decoding failed, so we'll get TRUE here
|
||||
ensure("decodeImpl() test failed", res == TRUE);
|
||||
}
|
||||
|
||||
// Test 3 : test encodeImpl()
|
||||
template<> template<>
|
||||
void llimagej2ckdu_object_t::test<3>()
|
||||
{
|
||||
LLImageJ2C* image = new LLImageJ2C();
|
||||
LLImageRaw* raw = new LLImageRaw();
|
||||
BOOL res = mImage->callEncodeImpl(*image, *raw, NULL);
|
||||
// Encoding returns TRUE unless an exception was raised, so we'll get TRUE here though nothing really was done
|
||||
ensure("encodeImpl() test failed", res == TRUE);
|
||||
}
|
||||
}
|
||||
|
|
@ -89,6 +89,19 @@ void LLBBox::addBBoxAgent(const LLBBox& b)
|
|||
}
|
||||
}
|
||||
|
||||
LLBBox LLBBox::getAxisAligned() const
|
||||
{
|
||||
// no rotation = axis aligned rotation
|
||||
LLBBox aligned(mPosAgent, LLQuaternion(), LLVector3(), LLVector3());
|
||||
|
||||
// add the center point so that it's not empty
|
||||
aligned.addPointAgent(mPosAgent);
|
||||
|
||||
// add our BBox
|
||||
aligned.addBBoxAgent(*this);
|
||||
|
||||
return aligned;
|
||||
}
|
||||
|
||||
void LLBBox::expand( F32 delta )
|
||||
{
|
||||
|
|
@ -147,6 +160,15 @@ BOOL LLBBox::containsPointAgent(const LLVector3& p) const
|
|||
return containsPointLocal(point_local);
|
||||
}
|
||||
|
||||
LLVector3 LLBBox::getMinAgent() const
|
||||
{
|
||||
return localToAgent(mMinLocal);
|
||||
}
|
||||
|
||||
LLVector3 LLBBox::getMaxAgent() const
|
||||
{
|
||||
return localToAgent(mMaxLocal);
|
||||
}
|
||||
|
||||
/*
|
||||
LLBBox operator*(const LLBBox &a, const LLMatrix4 &b)
|
||||
|
|
|
|||
|
|
@ -51,9 +51,11 @@ public:
|
|||
const LLVector3& getPositionAgent() const { return mPosAgent; }
|
||||
const LLQuaternion& getRotation() const { return mRotation; }
|
||||
|
||||
LLVector3 getMinAgent() const;
|
||||
const LLVector3& getMinLocal() const { return mMinLocal; }
|
||||
void setMinLocal( const LLVector3& min ) { mMinLocal = min; }
|
||||
|
||||
LLVector3 getMaxAgent() const;
|
||||
const LLVector3& getMaxLocal() const { return mMaxLocal; }
|
||||
void setMaxLocal( const LLVector3& max ) { mMaxLocal = max; }
|
||||
|
||||
|
|
@ -80,6 +82,8 @@ public:
|
|||
LLVector3 localToAgentBasis(const LLVector3& v) const;
|
||||
LLVector3 agentToLocalBasis(const LLVector3& v) const;
|
||||
|
||||
// Get the smallest possible axis aligned bbox that contains this bbox
|
||||
LLBBox getAxisAligned() const;
|
||||
|
||||
// friend LLBBox operator*(const LLBBox& a, const LLMatrix4& b);
|
||||
|
||||
|
|
|
|||
|
|
@ -280,7 +280,6 @@ namespace tut
|
|||
llmat_obj.setRows(llvec1, llvec2, llvec3);
|
||||
llmat_obj.orthogonalize();
|
||||
|
||||
skip("Grr, LLMatrix3::orthogonalize test is failing. Has it ever worked?");
|
||||
ensure("LLMatrix3::orthogonalize failed ",
|
||||
is_approx_equal(0.19611613f, llmat_obj.mMatrix[0][0]) &&
|
||||
is_approx_equal(0.78446454f, llmat_obj.mMatrix[0][1]) &&
|
||||
|
|
|
|||
|
|
@ -513,6 +513,10 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
|
|||
|
||||
}
|
||||
|
||||
//
|
||||
// *NOTE: Logic here is replicated in LLViewerAssetStorage::_queueDataRequest.
|
||||
// Changes here may need to be replicated in the viewer's derived class.
|
||||
//
|
||||
void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType atype,
|
||||
LLGetAssetCallback callback,
|
||||
void *user_data, BOOL duplicate,
|
||||
|
|
|
|||
|
|
@ -81,8 +81,11 @@ namespace LLAvatarNameCache
|
|||
// only need per-frame timing resolution
|
||||
LLFrameTimer sRequestTimer;
|
||||
|
||||
// Periodically clean out expired entries from the cache
|
||||
//LLFrameTimer sEraseExpiredTimer;
|
||||
/// Maximum time an unrefreshed cache entry is allowed
|
||||
const F64 MAX_UNREFRESHED_TIME = 20.0 * 60.0;
|
||||
|
||||
/// Time when unrefreshed cached names were checked last
|
||||
static F64 sLastExpireCheck;
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Internal methods
|
||||
|
|
@ -99,8 +102,9 @@ namespace LLAvatarNameCache
|
|||
|
||||
// Legacy name system callback
|
||||
void legacyNameCallback(const LLUUID& agent_id,
|
||||
const std::string& full_name,
|
||||
bool is_group);
|
||||
const std::string& full_name,
|
||||
bool is_group
|
||||
);
|
||||
|
||||
void requestNamesViaLegacy();
|
||||
|
||||
|
|
@ -117,7 +121,7 @@ namespace LLAvatarNameCache
|
|||
bool isRequestPending(const LLUUID& agent_id);
|
||||
|
||||
// Erase expired names from cache
|
||||
void eraseExpired();
|
||||
void eraseUnrefreshed();
|
||||
|
||||
bool expirationFromCacheControl(LLSD headers, F64 *expires);
|
||||
}
|
||||
|
|
@ -187,6 +191,7 @@ public:
|
|||
{
|
||||
// Pull expiration out of headers if available
|
||||
F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(mHeaders);
|
||||
F64 now = LLFrameTimer::getTotalSeconds();
|
||||
|
||||
LLSD agents = content["agents"];
|
||||
LLSD::array_const_iterator it = agents.beginArray();
|
||||
|
|
@ -207,84 +212,91 @@ public:
|
|||
av_name.mDisplayName = av_name.mUsername;
|
||||
}
|
||||
|
||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result for " << agent_id << " "
|
||||
<< "user '" << av_name.mUsername << "' "
|
||||
<< "display '" << av_name.mDisplayName << "' "
|
||||
<< "expires in " << expires - now << " seconds"
|
||||
<< LL_ENDL;
|
||||
|
||||
// cache it and fire signals
|
||||
LLAvatarNameCache::processName(agent_id, av_name, true);
|
||||
}
|
||||
|
||||
// Same logic as error response case
|
||||
LLSD unresolved_agents = content["bad_ids"];
|
||||
if (unresolved_agents.size() > 0)
|
||||
S32 num_unresolved = unresolved_agents.size();
|
||||
if (num_unresolved > 0)
|
||||
{
|
||||
const std::string DUMMY_NAME("\?\?\?");
|
||||
LLAvatarName av_name;
|
||||
av_name.mUsername = DUMMY_NAME;
|
||||
av_name.mDisplayName = DUMMY_NAME;
|
||||
av_name.mIsDisplayNameDefault = false;
|
||||
av_name.mIsDummy = true;
|
||||
av_name.mExpires = expires;
|
||||
|
||||
LL_WARNS("AvNameCache") << "LLAvatarNameResponder::result " << num_unresolved << " unresolved ids; "
|
||||
<< "expires in " << expires - now << " seconds"
|
||||
<< LL_ENDL;
|
||||
it = unresolved_agents.beginArray();
|
||||
for ( ; it != unresolved_agents.endArray(); ++it)
|
||||
{
|
||||
const LLUUID& agent_id = *it;
|
||||
// cache it and fire signals
|
||||
LLAvatarNameCache::processName(agent_id, av_name, true);
|
||||
|
||||
LL_WARNS("AvNameCache") << "LLAvatarNameResponder::result "
|
||||
<< "failed id " << agent_id
|
||||
<< LL_ENDL;
|
||||
|
||||
LLAvatarNameCache::handleAgentError(agent_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result "
|
||||
<< LLAvatarNameCache::sCache.size() << " cached names"
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
/*virtual*/ void error(U32 status, const std::string& reason)
|
||||
{
|
||||
// If there's an error, it might be caused by PeopleApi,
|
||||
// or when loading textures on startup and using a very slow
|
||||
// network, this query may time out. Fallback to the legacy
|
||||
// cache.
|
||||
// network, this query may time out.
|
||||
// What we should do depends on whether or not we have a cached name
|
||||
LL_WARNS("AvNameCache") << "LLAvatarNameResponder::error " << status << " " << reason
|
||||
<< LL_ENDL;
|
||||
|
||||
llwarns << "LLAvatarNameResponder error " << status << " " << reason << llendl;
|
||||
|
||||
// Add dummy records for all agent IDs in this request
|
||||
// Add dummy records for any agent IDs in this request that we do not have cached already
|
||||
std::vector<LLUUID>::const_iterator it = mAgentIDs.begin();
|
||||
for ( ; it != mAgentIDs.end(); ++it)
|
||||
{
|
||||
const LLUUID& agent_id = *it;
|
||||
gCacheName->get(agent_id, false, // legacy compatibility
|
||||
boost::bind(&LLAvatarNameCache::legacyNameCallback,
|
||||
_1, _2, _3));
|
||||
LLAvatarNameCache::handleAgentError(agent_id);
|
||||
}
|
||||
}
|
||||
|
||||
// Return time to retry a request that generated an error, based on
|
||||
// error type and headers. Return value is seconds-since-epoch.
|
||||
F64 errorRetryTimestamp(S32 status)
|
||||
{
|
||||
F64 now = LLFrameTimer::getTotalSeconds();
|
||||
|
||||
// Retry-After takes priority
|
||||
LLSD retry_after = mHeaders["retry-after"];
|
||||
if (retry_after.isDefined())
|
||||
{
|
||||
// We only support the delta-seconds type
|
||||
S32 delta_seconds = retry_after.asInteger();
|
||||
if (delta_seconds > 0)
|
||||
{
|
||||
// ...valid delta-seconds
|
||||
return now + F64(delta_seconds);
|
||||
}
|
||||
}
|
||||
|
||||
// If no Retry-After, look for Cache-Control max-age
|
||||
F64 expires = 0.0;
|
||||
if (LLAvatarNameCache::expirationFromCacheControl(mHeaders, &expires))
|
||||
{
|
||||
return expires;
|
||||
}
|
||||
|
||||
// No information in header, make a guess
|
||||
const F64 DEFAULT_DELAY = 120.0; // 2 mintues
|
||||
return now + DEFAULT_DELAY;
|
||||
}
|
||||
};
|
||||
|
||||
// Provide some fallback for agents that return errors
|
||||
void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id)
|
||||
{
|
||||
std::map<LLUUID,LLAvatarName>::iterator existing = sCache.find(agent_id);
|
||||
if (existing == sCache.end())
|
||||
{
|
||||
// there is no existing cache entry, so make a temporary name from legacy
|
||||
LL_WARNS("AvNameCache") << "LLAvatarNameCache get legacy for agent "
|
||||
<< agent_id << LL_ENDL;
|
||||
gCacheName->get(agent_id, false, // legacy compatibility
|
||||
boost::bind(&LLAvatarNameCache::legacyNameCallback,
|
||||
_1, _2, _3));
|
||||
}
|
||||
else
|
||||
{
|
||||
// we have a chached (but probably expired) entry - since that would have
|
||||
// been returned by the get method, there is no need to signal anyone
|
||||
|
||||
// Clear this agent from the pending list
|
||||
LLAvatarNameCache::sPendingQueue.erase(agent_id);
|
||||
|
||||
const LLAvatarName& av_name = existing->second;
|
||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent "
|
||||
<< agent_id
|
||||
<< "user '" << av_name.mUsername << "' "
|
||||
<< "display '" << av_name.mDisplayName << "' "
|
||||
<< "expires in " << av_name.mExpires - LLFrameTimer::getTotalSeconds() << " seconds"
|
||||
<< LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
void LLAvatarNameCache::processName(const LLUUID& agent_id,
|
||||
const LLAvatarName& av_name,
|
||||
bool add_to_cache)
|
||||
|
|
@ -326,6 +338,7 @@ void LLAvatarNameCache::requestNamesViaCapability()
|
|||
std::vector<LLUUID> agent_ids;
|
||||
agent_ids.reserve(128);
|
||||
|
||||
U32 ids = 0;
|
||||
ask_queue_t::const_iterator it = sAskQueue.begin();
|
||||
for ( ; it != sAskQueue.end(); ++it)
|
||||
{
|
||||
|
|
@ -336,11 +349,13 @@ void LLAvatarNameCache::requestNamesViaCapability()
|
|||
// ...starting new request
|
||||
url += sNameLookupURL;
|
||||
url += "?ids=";
|
||||
ids = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ...continuing existing request
|
||||
url += "&ids=";
|
||||
ids++;
|
||||
}
|
||||
url += agent_id.asString();
|
||||
agent_ids.push_back(agent_id);
|
||||
|
|
@ -350,8 +365,10 @@ void LLAvatarNameCache::requestNamesViaCapability()
|
|||
|
||||
if (url.size() > NAME_URL_SEND_THRESHOLD)
|
||||
{
|
||||
//llinfos << "requestNames " << url << llendl;
|
||||
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));//, LLSD(), 10.0f);
|
||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability first "
|
||||
<< ids << " ids"
|
||||
<< LL_ENDL;
|
||||
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));
|
||||
url.clear();
|
||||
agent_ids.clear();
|
||||
}
|
||||
|
|
@ -359,8 +376,10 @@ void LLAvatarNameCache::requestNamesViaCapability()
|
|||
|
||||
if (!url.empty())
|
||||
{
|
||||
//llinfos << "requestNames " << url << llendl;
|
||||
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));//, LLSD(), 10.0f);
|
||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability all "
|
||||
<< ids << " ids"
|
||||
<< LL_ENDL;
|
||||
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));
|
||||
url.clear();
|
||||
agent_ids.clear();
|
||||
}
|
||||
|
|
@ -376,6 +395,11 @@ void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id,
|
|||
// Construct a dummy record for this name. By convention, SLID is blank
|
||||
// Never expires, but not written to disk, so lasts until end of session.
|
||||
LLAvatarName av_name;
|
||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::legacyNameCallback "
|
||||
<< "agent " << agent_id << " "
|
||||
<< "full name '" << full_name << "'"
|
||||
<< ( is_group ? " [group]" : "" )
|
||||
<< LL_ENDL;
|
||||
buildLegacyName(full_name, &av_name);
|
||||
|
||||
// Don't add to cache, the data already exists in the legacy name system
|
||||
|
|
@ -397,6 +421,8 @@ void LLAvatarNameCache::requestNamesViaLegacy()
|
|||
// invoked below. This should never happen in practice.
|
||||
sPendingQueue[agent_id] = now;
|
||||
|
||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaLegacy agent " << agent_id << LL_ENDL;
|
||||
|
||||
gCacheName->get(agent_id, false, // legacy compatibility
|
||||
boost::bind(&LLAvatarNameCache::legacyNameCallback,
|
||||
_1, _2, _3));
|
||||
|
|
@ -435,21 +461,24 @@ void LLAvatarNameCache::importFile(std::istream& istr)
|
|||
av_name.fromLLSD( it->second );
|
||||
sCache[agent_id] = av_name;
|
||||
}
|
||||
// entries may have expired since we last ran the viewer, just
|
||||
// clean them out now
|
||||
eraseExpired();
|
||||
llinfos << "loaded " << sCache.size() << llendl;
|
||||
LL_INFOS("AvNameCache") << "loaded " << sCache.size() << LL_ENDL;
|
||||
|
||||
// Some entries may have expired since the cache was stored,
|
||||
// but they will be flushed in the first call to eraseUnrefreshed
|
||||
// from LLAvatarNameResponder::idle
|
||||
}
|
||||
|
||||
void LLAvatarNameCache::exportFile(std::ostream& ostr)
|
||||
{
|
||||
LLSD agents;
|
||||
F64 max_unrefreshed = LLFrameTimer::getTotalSeconds() - MAX_UNREFRESHED_TIME;
|
||||
cache_t::const_iterator it = sCache.begin();
|
||||
for ( ; it != sCache.end(); ++it)
|
||||
{
|
||||
const LLUUID& agent_id = it->first;
|
||||
const LLAvatarName& av_name = it->second;
|
||||
if (!av_name.mIsDummy)
|
||||
// Do not write temporary or expired entries to the stored cache
|
||||
if (!av_name.mIsTemporaryName && av_name.mExpires >= max_unrefreshed)
|
||||
{
|
||||
// key must be a string
|
||||
agents[agent_id.asString()] = av_name.asLLSD();
|
||||
|
|
@ -484,62 +513,63 @@ void LLAvatarNameCache::idle()
|
|||
// return;
|
||||
//}
|
||||
|
||||
// Must be large relative to above
|
||||
|
||||
// No longer deleting expired entries, just re-requesting in the get
|
||||
// this way first synchronous get call on an expired entry won't return
|
||||
// legacy name. LF
|
||||
|
||||
//const F32 ERASE_EXPIRED_TIMEOUT = 60.f; // seconds
|
||||
//if (sEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT))
|
||||
//{
|
||||
// eraseExpired();
|
||||
//}
|
||||
|
||||
if (sAskQueue.empty())
|
||||
if (!sAskQueue.empty())
|
||||
{
|
||||
return;
|
||||
if (useDisplayNames())
|
||||
{
|
||||
requestNamesViaCapability();
|
||||
}
|
||||
else
|
||||
{
|
||||
// ...fall back to legacy name cache system
|
||||
requestNamesViaLegacy();
|
||||
}
|
||||
}
|
||||
|
||||
if (useDisplayNames())
|
||||
{
|
||||
requestNamesViaCapability();
|
||||
}
|
||||
else
|
||||
{
|
||||
// ...fall back to legacy name cache system
|
||||
requestNamesViaLegacy();
|
||||
}
|
||||
// erase anything that has not been refreshed for more than MAX_UNREFRESHED_TIME
|
||||
eraseUnrefreshed();
|
||||
}
|
||||
|
||||
bool LLAvatarNameCache::isRequestPending(const LLUUID& agent_id)
|
||||
{
|
||||
bool isPending = false;
|
||||
const F64 PENDING_TIMEOUT_SECS = 5.0 * 60.0;
|
||||
F64 now = LLFrameTimer::getTotalSeconds();
|
||||
F64 expire_time = now - PENDING_TIMEOUT_SECS;
|
||||
|
||||
pending_queue_t::const_iterator it = sPendingQueue.find(agent_id);
|
||||
if (it != sPendingQueue.end())
|
||||
{
|
||||
bool request_expired = (it->second < expire_time);
|
||||
return !request_expired;
|
||||
// in the list of requests in flight, retry if too old
|
||||
F64 expire_time = LLFrameTimer::getTotalSeconds() - PENDING_TIMEOUT_SECS;
|
||||
isPending = (it->second > expire_time);
|
||||
}
|
||||
return false;
|
||||
return isPending;
|
||||
}
|
||||
|
||||
void LLAvatarNameCache::eraseExpired()
|
||||
void LLAvatarNameCache::eraseUnrefreshed()
|
||||
{
|
||||
F64 now = LLFrameTimer::getTotalSeconds();
|
||||
cache_t::iterator it = sCache.begin();
|
||||
while (it != sCache.end())
|
||||
{
|
||||
cache_t::iterator cur = it;
|
||||
++it;
|
||||
const LLAvatarName& av_name = cur->second;
|
||||
if (av_name.mExpires < now)
|
||||
{
|
||||
sCache.erase(cur);
|
||||
}
|
||||
F64 max_unrefreshed = now - MAX_UNREFRESHED_TIME;
|
||||
|
||||
if (!sLastExpireCheck || sLastExpireCheck < max_unrefreshed)
|
||||
{
|
||||
sLastExpireCheck = now;
|
||||
cache_t::iterator it = sCache.begin();
|
||||
while (it != sCache.end())
|
||||
{
|
||||
cache_t::iterator cur = it;
|
||||
++it;
|
||||
const LLAvatarName& av_name = cur->second;
|
||||
if (av_name.mExpires < max_unrefreshed)
|
||||
{
|
||||
const LLUUID& agent_id = it->first;
|
||||
LL_DEBUGS("AvNameCache") << agent_id
|
||||
<< " user '" << av_name.mUsername << "' "
|
||||
<< "expired " << now - av_name.mExpires << " secs ago"
|
||||
<< LL_ENDL;
|
||||
sCache.erase(cur);
|
||||
}
|
||||
}
|
||||
LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -550,8 +580,11 @@ void LLAvatarNameCache::buildLegacyName(const std::string& full_name,
|
|||
av_name->mUsername = "";
|
||||
av_name->mDisplayName = full_name;
|
||||
av_name->mIsDisplayNameDefault = true;
|
||||
av_name->mIsDummy = true;
|
||||
av_name->mExpires = F64_MAX;
|
||||
av_name->mIsTemporaryName = true;
|
||||
av_name->mExpires = F64_MAX; // not used because these are not cached
|
||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::buildLegacyName "
|
||||
<< full_name
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
// fills in av_name if it has it in the cache, even if expired (can check expiry time)
|
||||
|
|
@ -574,6 +607,9 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
|
|||
{
|
||||
if (!isRequestPending(agent_id))
|
||||
{
|
||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
|
||||
<< "refresh agent " << agent_id
|
||||
<< LL_ENDL;
|
||||
sAskQueue.insert(agent_id);
|
||||
}
|
||||
}
|
||||
|
|
@ -595,6 +631,9 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
|
|||
|
||||
if (!isRequestPending(agent_id))
|
||||
{
|
||||
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
|
||||
<< "queue request for agent " << agent_id
|
||||
<< LL_ENDL;
|
||||
sAskQueue.insert(agent_id);
|
||||
}
|
||||
|
||||
|
|
@ -627,7 +666,6 @@ void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot)
|
|||
{
|
||||
// ...name already exists in cache, fire callback now
|
||||
fireSignal(agent_id, slot, av_name);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -723,6 +761,9 @@ F64 LLAvatarNameCache::nameExpirationFromHeaders(LLSD headers)
|
|||
|
||||
bool LLAvatarNameCache::expirationFromCacheControl(LLSD headers, F64 *expires)
|
||||
{
|
||||
bool fromCacheControl = false;
|
||||
F64 now = LLFrameTimer::getTotalSeconds();
|
||||
|
||||
// Allow the header to override the default
|
||||
LLSD cache_control_header = headers["cache-control"];
|
||||
if (cache_control_header.isDefined())
|
||||
|
|
@ -731,12 +772,16 @@ bool LLAvatarNameCache::expirationFromCacheControl(LLSD headers, F64 *expires)
|
|||
std::string cache_control = cache_control_header.asString();
|
||||
if (max_age_from_cache_control(cache_control, &max_age))
|
||||
{
|
||||
F64 now = LLFrameTimer::getTotalSeconds();
|
||||
*expires = now + (F64)max_age;
|
||||
return true;
|
||||
fromCacheControl = true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
LL_DEBUGS("AvNameCache")
|
||||
<< ( fromCacheControl ? "expires based on cache control " : "default expiration " )
|
||||
<< "in " << *expires - now << " seconds"
|
||||
<< LL_ENDL;
|
||||
|
||||
return fromCacheControl;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,9 @@ namespace LLAvatarNameCache
|
|||
|
||||
void erase(const LLUUID& agent_id);
|
||||
|
||||
/// Provide some fallback for agents that return errors
|
||||
void handleAgentError(const LLUUID& agent_id);
|
||||
|
||||
// Force a re-fetch of the most recent data, but keep the current
|
||||
// data in cache
|
||||
void fetch(const LLUUID& agent_id);
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,
|
|||
mPingDelayAveraged((F32)INITIAL_PING_VALUE_MSEC),
|
||||
mUnackedPacketCount(0),
|
||||
mUnackedPacketBytes(0),
|
||||
mLastPacketInTime(0.0),
|
||||
mLocalEndPointID(),
|
||||
mPacketsOut(0),
|
||||
mPacketsIn(0),
|
||||
|
|
@ -667,6 +668,8 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
|
|||
mHighestPacketID = llmax(mHighestPacketID, id);
|
||||
}
|
||||
|
||||
// Save packet arrival time
|
||||
mLastPacketInTime = LLMessageSystem::getMessageTimeSeconds();
|
||||
|
||||
// Have we received anything on this circuit yet?
|
||||
if (0 == mPacketsIn)
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public:
|
|||
U32 getPacketsLost() const;
|
||||
TPACKETID getPacketOutID() const;
|
||||
BOOL getTrusted() const;
|
||||
F32 getAgeInSeconds() const;
|
||||
F32 getAgeInSeconds() const;
|
||||
S32 getUnackedPacketCount() const { return mUnackedPacketCount; }
|
||||
S32 getUnackedPacketBytes() const { return mUnackedPacketBytes; }
|
||||
F64 getNextPingSendTime() const { return mNextPingSendTime; }
|
||||
|
|
@ -130,6 +130,7 @@ public:
|
|||
{ return mOutOfOrderRate.meanValue(scale); }
|
||||
U32 getLastPacketGap() const { return mLastPacketGap; }
|
||||
LLHost getHost() const { return mHost; }
|
||||
F64 getLastPacketInTime() const { return mLastPacketInTime; }
|
||||
|
||||
LLThrottleGroup &getThrottleGroup() { return mThrottles; }
|
||||
|
||||
|
|
@ -248,6 +249,7 @@ protected:
|
|||
S32 mUnackedPacketCount;
|
||||
S32 mUnackedPacketBytes;
|
||||
|
||||
F64 mLastPacketInTime; // Time of last packet arrival
|
||||
|
||||
LLUUID mLocalEndPointID;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,9 +42,6 @@ const U32 REGION_FLAGS_RESET_HOME_ON_TELEPORT = (1 << 3);
|
|||
// Does the sun move?
|
||||
const U32 REGION_FLAGS_SUN_FIXED = (1 << 4);
|
||||
|
||||
// Tax free zone (no taxes on objects, land, etc.)
|
||||
const U32 REGION_FLAGS_TAX_FREE = (1 << 5);
|
||||
|
||||
// Can't change the terrain heightfield, even on owned parcels,
|
||||
// but can plant trees and grass.
|
||||
const U32 REGION_FLAGS_BLOCK_TERRAFORM = (1 << 6);
|
||||
|
|
@ -54,17 +51,12 @@ const U32 REGION_FLAGS_BLOCK_LAND_RESELL = (1 << 7);
|
|||
|
||||
// All content wiped once per night
|
||||
const U32 REGION_FLAGS_SANDBOX = (1 << 8);
|
||||
const U32 REGION_FLAGS_NULL_LAYER = (1 << 9);
|
||||
// const U32 REGION_FLAGS_SKIP_AGENT_ACTION = (1 << 10);
|
||||
const U32 REGION_FLAGS_HARD_ALLOW_LAND_TRANSFER = (1 << 10); // Region allows land reselling
|
||||
// const U32 REGION_FLAGS_SKIP_UPDATE_INTEREST_LIST= (1 << 11);
|
||||
const U32 REGION_FLAGS_HARD_ALLOW_POST_CLASSIFIED = (1 << 11); // Region allows posting of classified ads
|
||||
const U32 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid bodies
|
||||
const U32 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13);
|
||||
const U32 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics
|
||||
const U32 REGION_FLAGS_EXTERNALLY_VISIBLE = (1 << 15);
|
||||
//const U32 REGION_FLAGS_MAINLAND_VISIBLE = (1 << 16);
|
||||
const U32 REGION_FLAGS_PUBLIC_ALLOWED = (1 << 17);
|
||||
const U32 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT = (1 << 16);
|
||||
const U32 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_ESTATE_OBJECT = (1 << 17);
|
||||
const U32 REGION_FLAGS_BLOCK_DWELL = (1 << 18);
|
||||
|
||||
// Is flight allowed?
|
||||
|
|
@ -81,18 +73,13 @@ const U32 REGION_FLAGS_ESTATE_SKIP_SCRIPTS = (1 << 21);
|
|||
const U32 REGION_FLAGS_RESTRICT_PUSHOBJECT = (1 << 22);
|
||||
|
||||
const U32 REGION_FLAGS_DENY_ANONYMOUS = (1 << 23);
|
||||
// const U32 REGION_FLAGS_DENY_IDENTIFIED = (1 << 24);
|
||||
// const U32 REGION_FLAGS_DENY_TRANSACTED = (1 << 25);
|
||||
|
||||
const U32 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1 << 26);
|
||||
|
||||
// const U32 REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER = (1 << 27); // We no longer support ELAR
|
||||
|
||||
const U32 REGION_FLAGS_ALLOW_VOICE = (1 << 28);
|
||||
|
||||
const U32 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1 << 29);
|
||||
const U32 REGION_FLAGS_DENY_AGEUNVERIFIED = (1 << 30);
|
||||
const U32 REGION_FLAGS_SKIP_MONO_SCRIPTS = (1 << 31);
|
||||
|
||||
const U32 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK |
|
||||
REGION_FLAGS_ALLOW_SET_HOME |
|
||||
|
|
@ -105,7 +92,6 @@ const U32 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK
|
|||
| REGION_FLAGS_ALLOW_SET_HOME;
|
||||
|
||||
const U32 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE
|
||||
| REGION_FLAGS_PUBLIC_ALLOWED
|
||||
| REGION_FLAGS_SUN_FIXED
|
||||
| REGION_FLAGS_DENY_ANONYMOUS
|
||||
| REGION_FLAGS_DENY_AGEUNVERIFIED;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ include_directories(
|
|||
${LLRENDER_INCLUDE_DIRS}
|
||||
${LLXML_INCLUDE_DIRS}
|
||||
${LLWINDOW_INCLUDE_DIRS}
|
||||
${LLQTWEBKIT_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(llplugin_SOURCE_FILES
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ void LLPluginClassMedia::idle(void)
|
|||
mPlugin->idle();
|
||||
}
|
||||
|
||||
if((mMediaWidth == -1) || (!mTextureParamsReceived) || (mPlugin == NULL) || (mPlugin->isBlocked()))
|
||||
if((mMediaWidth == -1) || (!mTextureParamsReceived) || (mPlugin == NULL) || (mPlugin->isBlocked()) || (mOwner == NULL))
|
||||
{
|
||||
// Can't process a size change at this time
|
||||
}
|
||||
|
|
@ -522,7 +522,15 @@ bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifie
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
#if LL_DARWIN
|
||||
if(modifiers & MASK_ALT)
|
||||
{
|
||||
// Option-key modified characters should be handled by the unicode input path instead of this one.
|
||||
result = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(result)
|
||||
{
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "key_event");
|
||||
|
|
@ -674,7 +682,21 @@ void LLPluginClassMedia::sendPickFileResponse(const std::string &file)
|
|||
{
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file_response");
|
||||
message.setValue("file", file);
|
||||
if(mPlugin->isBlocked())
|
||||
if(mPlugin && mPlugin->isBlocked())
|
||||
{
|
||||
// If the plugin sent a blocking pick-file request, the response should unblock it.
|
||||
message.setValueBoolean("blocking_response", true);
|
||||
}
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
void LLPluginClassMedia::sendAuthResponse(bool ok, const std::string &username, const std::string &password)
|
||||
{
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "auth_response");
|
||||
message.setValueBoolean("ok", ok);
|
||||
message.setValue("username", username);
|
||||
message.setValue("password", password);
|
||||
if(mPlugin && mPlugin->isBlocked())
|
||||
{
|
||||
// If the plugin sent a blocking pick-file request, the response should unblock it.
|
||||
message.setValueBoolean("blocking_response", true);
|
||||
|
|
@ -947,6 +969,12 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
|
|||
{
|
||||
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PICK_FILE_REQUEST);
|
||||
}
|
||||
else if(message_name == "auth_request")
|
||||
{
|
||||
mAuthURL = message.getValue("url");
|
||||
mAuthRealm = message.getValue("realm");
|
||||
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_AUTH_REQUEST);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
|
||||
|
|
@ -1019,6 +1047,15 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
|
|||
|
||||
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_GEOMETRY_CHANGE);
|
||||
}
|
||||
else if(message_name == "link_hovered")
|
||||
{
|
||||
// text is not currently used -- the tooltip hover text is taken from the "title".
|
||||
mHoverLink = message.getValue("link");
|
||||
mHoverText = message.getValue("title");
|
||||
// message.getValue("text");
|
||||
|
||||
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_LINK_HOVERED);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
|
||||
|
|
@ -1192,6 +1229,20 @@ void LLPluginClassMedia::proxyWindowClosed(const std::string &uuid)
|
|||
sendMessage(message);
|
||||
}
|
||||
|
||||
void LLPluginClassMedia::ignore_ssl_cert_errors(bool ignore)
|
||||
{
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "ignore_ssl_cert_errors");
|
||||
message.setValueBoolean("ignore", ignore);
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
void LLPluginClassMedia::addCertificateFilePath(const std::string& path)
|
||||
{
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "add_certificate_file_path");
|
||||
message.setValue("path", path);
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
void LLPluginClassMedia::crashPlugin()
|
||||
{
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "crash");
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ public:
|
|||
|
||||
void setBackgroundColor(LLColor4 color) { mBackgroundColor = color; };
|
||||
|
||||
void setOwner(LLPluginClassMediaOwner *owner) { mOwner = owner; };
|
||||
|
||||
// Returns true if all of the texture parameters (depth, format, size, and texture size) are set up and consistent.
|
||||
// This will initially be false, and will also be false for some time after setSize while the resize is processed.
|
||||
// Note that if this returns true, it is safe to use all the get() functions above without checking for invalid return values
|
||||
|
|
@ -159,6 +161,8 @@ public:
|
|||
|
||||
void sendPickFileResponse(const std::string &file);
|
||||
|
||||
void sendAuthResponse(bool ok, const std::string &username, const std::string &password);
|
||||
|
||||
// Valid after a MEDIA_EVENT_CURSOR_CHANGED event
|
||||
std::string getCursorName() const { return mCursorName; };
|
||||
|
||||
|
|
@ -198,6 +202,8 @@ public:
|
|||
void setBrowserUserAgent(const std::string& user_agent);
|
||||
void proxyWindowOpened(const std::string &target, const std::string &uuid);
|
||||
void proxyWindowClosed(const std::string &uuid);
|
||||
void ignore_ssl_cert_errors(bool ignore);
|
||||
void addCertificateFilePath(const std::string& path);
|
||||
|
||||
// This is valid after MEDIA_EVENT_NAVIGATE_BEGIN or MEDIA_EVENT_NAVIGATE_COMPLETE
|
||||
std::string getNavigateURI() const { return mNavigateURI; };
|
||||
|
|
@ -231,7 +237,15 @@ public:
|
|||
S32 getGeometryY() const { return mGeometryY; };
|
||||
S32 getGeometryWidth() const { return mGeometryWidth; };
|
||||
S32 getGeometryHeight() const { return mGeometryHeight; };
|
||||
|
||||
// These are valid during MEDIA_EVENT_AUTH_REQUEST
|
||||
std::string getAuthURL() const { return mAuthURL; };
|
||||
std::string getAuthRealm() const { return mAuthRealm; };
|
||||
|
||||
// These are valid during MEDIA_EVENT_LINK_HOVERED
|
||||
std::string getHoverText() const { return mHoverText; };
|
||||
std::string getHoverLink() const { return mHoverLink; };
|
||||
|
||||
std::string getMediaName() const { return mMediaName; };
|
||||
std::string getMediaDescription() const { return mMediaDescription; };
|
||||
|
||||
|
|
@ -369,6 +383,10 @@ protected:
|
|||
S32 mGeometryY;
|
||||
S32 mGeometryWidth;
|
||||
S32 mGeometryHeight;
|
||||
std::string mAuthURL;
|
||||
std::string mAuthRealm;
|
||||
std::string mHoverText;
|
||||
std::string mHoverLink;
|
||||
|
||||
/////////////////////////////////////////
|
||||
// media_time class
|
||||
|
|
|
|||
|
|
@ -59,7 +59,11 @@ public:
|
|||
MEDIA_EVENT_GEOMETRY_CHANGE, // The plugin requested its window geometry be changed (per the javascript window interface)
|
||||
|
||||
MEDIA_EVENT_PLUGIN_FAILED_LAUNCH, // The plugin failed to launch
|
||||
MEDIA_EVENT_PLUGIN_FAILED // The plugin died unexpectedly
|
||||
MEDIA_EVENT_PLUGIN_FAILED, // The plugin died unexpectedly
|
||||
|
||||
MEDIA_EVENT_AUTH_REQUEST, // The plugin wants to display an auth dialog
|
||||
|
||||
MEDIA_EVENT_LINK_HOVERED // Got a "link hovered" event from the plugin
|
||||
|
||||
} EMediaEvent;
|
||||
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ set(llui_SOURCE_FILES
|
|||
llviewmodel.cpp
|
||||
llview.cpp
|
||||
llviewquery.cpp
|
||||
llwindowshade.cpp
|
||||
)
|
||||
|
||||
set(llui_HEADER_FILES
|
||||
|
|
@ -210,6 +211,7 @@ set(llui_HEADER_FILES
|
|||
llviewmodel.h
|
||||
llview.h
|
||||
llviewquery.h
|
||||
llwindowshade.h
|
||||
)
|
||||
|
||||
set_source_files_properties(${llui_HEADER_FILES}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p)
|
|||
mMaxChars(p.max_chars),
|
||||
mPrearrangeCallback(p.prearrange_callback()),
|
||||
mTextEntryCallback(p.text_entry_callback()),
|
||||
mTextChangedCallback(p.text_changed_callback()),
|
||||
mListPosition(p.list_position),
|
||||
mLastSelectedIndex(-1),
|
||||
mLabel(p.label)
|
||||
|
|
@ -834,6 +835,10 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor)
|
|||
mList->deselectAllItems();
|
||||
mLastSelectedIndex = -1;
|
||||
}
|
||||
if (mTextChangedCallback != NULL)
|
||||
{
|
||||
(mTextChangedCallback)(line_editor, LLSD());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -878,6 +883,10 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor)
|
|||
// RN: presumably text entry
|
||||
updateSelection();
|
||||
}
|
||||
if (mTextChangedCallback != NULL)
|
||||
{
|
||||
(mTextChangedCallback)(line_editor, LLSD());
|
||||
}
|
||||
}
|
||||
|
||||
void LLComboBox::updateSelection()
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ public:
|
|||
allow_new_values;
|
||||
Optional<S32> max_chars;
|
||||
Optional<commit_callback_t> prearrange_callback,
|
||||
text_entry_callback;
|
||||
text_entry_callback,
|
||||
text_changed_callback;
|
||||
|
||||
Optional<EPreferredPosition, PreferredPositionValues> list_position;
|
||||
|
||||
|
|
@ -190,6 +191,7 @@ public:
|
|||
|
||||
void setPrearrangeCallback( commit_callback_t cb ) { mPrearrangeCallback = cb; }
|
||||
void setTextEntryCallback( commit_callback_t cb ) { mTextEntryCallback = cb; }
|
||||
void setTextChangedCallback( commit_callback_t cb ) { mTextChangedCallback = cb; }
|
||||
|
||||
void setButtonVisible(BOOL visible);
|
||||
|
||||
|
|
@ -220,6 +222,7 @@ private:
|
|||
BOOL mTextEntryTentative;
|
||||
commit_callback_t mPrearrangeCallback;
|
||||
commit_callback_t mTextEntryCallback;
|
||||
commit_callback_t mTextChangedCallback;
|
||||
commit_callback_t mSelectionCallback;
|
||||
boost::signals2::connection mTopLostSignalConnection;
|
||||
S32 mLastSelectedIndex;
|
||||
|
|
|
|||
|
|
@ -272,9 +272,6 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
|
|||
|
||||
initFromParams(p);
|
||||
|
||||
// chrome floaters don't take focus at all
|
||||
setFocusRoot(!getIsChrome());
|
||||
|
||||
initFloater(p);
|
||||
}
|
||||
|
||||
|
|
@ -2910,7 +2907,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str
|
|||
params.from_xui = true;
|
||||
applyXUILayout(params, parent);
|
||||
initFromParams(params);
|
||||
|
||||
|
||||
initFloater(params);
|
||||
|
||||
LLMultiFloater* last_host = LLFloater::getFloaterHost();
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@
|
|||
static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
|
||||
static LLLayoutStack::LayoutStackRegistry::Register<LLLayoutPanel> register_layout_panel("layout_panel");
|
||||
|
||||
void LLLayoutStack::OrientationNames::declareValues()
|
||||
{
|
||||
declare("horizontal", HORIZONTAL);
|
||||
declare("vertical", VERTICAL);
|
||||
}
|
||||
|
||||
//
|
||||
// LLLayoutPanel
|
||||
//
|
||||
|
|
@ -47,47 +53,47 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)
|
|||
mMaxDim(p.max_dim),
|
||||
mAutoResize(p.auto_resize),
|
||||
mUserResize(p.user_resize),
|
||||
mCollapsed(FALSE),
|
||||
mCollapseAmt(0.f),
|
||||
mVisibleAmt(1.f), // default to fully visible
|
||||
mResizeBar(NULL)
|
||||
{
|
||||
mCollapsed(FALSE),
|
||||
mCollapseAmt(0.f),
|
||||
mVisibleAmt(1.f), // default to fully visible
|
||||
mResizeBar(NULL)
|
||||
{
|
||||
// panels initialized as hidden should not start out partially visible
|
||||
if (!getVisible())
|
||||
{
|
||||
{
|
||||
mVisibleAmt = 0.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLLayoutPanel::initFromParams(const Params& p)
|
||||
{
|
||||
{
|
||||
LLPanel::initFromParams(p);
|
||||
setFollowsNone();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LLLayoutPanel::~LLLayoutPanel()
|
||||
{
|
||||
// probably not necessary, but...
|
||||
delete mResizeBar;
|
||||
mResizeBar = NULL;
|
||||
}
|
||||
{
|
||||
// probably not necessary, but...
|
||||
delete mResizeBar;
|
||||
mResizeBar = NULL;
|
||||
}
|
||||
|
||||
F32 LLLayoutPanel::getCollapseFactor(LLLayoutStack::ELayoutOrientation orientation)
|
||||
{
|
||||
{
|
||||
if (orientation == LLLayoutStack::HORIZONTAL)
|
||||
{
|
||||
F32 collapse_amt =
|
||||
clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinDim / (F32)llmax(1, getRect().getWidth()));
|
||||
return mVisibleAmt * collapse_amt;
|
||||
}
|
||||
else
|
||||
{
|
||||
F32 collapse_amt =
|
||||
clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinDim / (F32)llmax(1, getRect().getWidth()));
|
||||
return mVisibleAmt * collapse_amt;
|
||||
}
|
||||
else
|
||||
{
|
||||
F32 collapse_amt =
|
||||
clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)mMinDim / (F32)llmax(1, getRect().getHeight())));
|
||||
return mVisibleAmt * collapse_amt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// LLLayoutStack
|
||||
|
|
@ -109,7 +115,7 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p)
|
|||
mMinWidth(0),
|
||||
mMinHeight(0),
|
||||
mPanelSpacing(p.border_size),
|
||||
mOrientation((p.orientation() == "vertical") ? VERTICAL : HORIZONTAL),
|
||||
mOrientation(p.orientation),
|
||||
mAnimate(p.animate),
|
||||
mAnimatedThisFrame(false),
|
||||
mClip(p.clip),
|
||||
|
|
|
|||
|
|
@ -37,12 +37,24 @@ class LLLayoutPanel;
|
|||
class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
|
||||
{
|
||||
public:
|
||||
typedef enum e_layout_orientation
|
||||
{
|
||||
HORIZONTAL,
|
||||
VERTICAL
|
||||
} ELayoutOrientation;
|
||||
|
||||
struct OrientationNames
|
||||
: public LLInitParam::TypeValuesHelper<ELayoutOrientation, OrientationNames>
|
||||
{
|
||||
static void declareValues();
|
||||
};
|
||||
|
||||
struct LayoutStackRegistry : public LLChildRegistry<LayoutStackRegistry>
|
||||
{};
|
||||
|
||||
struct Params : public LLInitParam::Block<Params, LLView::Params>
|
||||
{
|
||||
Mandatory<std::string> orientation;
|
||||
Mandatory<ELayoutOrientation, OrientationNames> orientation;
|
||||
Optional<S32> border_size;
|
||||
Optional<bool> animate,
|
||||
clip;
|
||||
|
|
@ -54,12 +66,6 @@ public:
|
|||
|
||||
typedef LayoutStackRegistry child_registry_t;
|
||||
|
||||
typedef enum e_layout_orientation
|
||||
{
|
||||
HORIZONTAL,
|
||||
VERTICAL
|
||||
} ELayoutOrientation;
|
||||
|
||||
virtual ~LLLayoutStack();
|
||||
|
||||
/*virtual*/ void draw();
|
||||
|
|
@ -171,6 +177,9 @@ public:
|
|||
~LLLayoutPanel();
|
||||
|
||||
void initFromParams(const Params& p);
|
||||
void setMinDim(S32 value) { mMinDim = value; }
|
||||
void setMaxDim(S32 value) { mMaxDim = value; }
|
||||
|
||||
protected:
|
||||
LLLayoutPanel(const Params& p) ;
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ LLLineEditor::Params::Params()
|
|||
revert_on_esc("revert_on_esc", true),
|
||||
commit_on_focus_lost("commit_on_focus_lost", true),
|
||||
ignore_tab("ignore_tab", true),
|
||||
is_password("is_password", false),
|
||||
cursor_color("cursor_color"),
|
||||
text_color("text_color"),
|
||||
text_readonly_color("text_readonly_color"),
|
||||
|
|
@ -129,7 +130,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
|
|||
mBorderThickness( 0 ),
|
||||
mIgnoreArrowKeys( FALSE ),
|
||||
mIgnoreTab( p.ignore_tab ),
|
||||
mDrawAsterixes( FALSE ),
|
||||
mDrawAsterixes( p.is_password ),
|
||||
mSelectAllonFocusReceived( p.select_on_focus ),
|
||||
mPassDelete(FALSE),
|
||||
mReadOnly(FALSE),
|
||||
|
|
|
|||
|
|
@ -85,7 +85,8 @@ public:
|
|||
Optional<bool> select_on_focus,
|
||||
revert_on_esc,
|
||||
commit_on_focus_lost,
|
||||
ignore_tab;
|
||||
ignore_tab,
|
||||
is_password;
|
||||
|
||||
// colors
|
||||
Optional<LLUIColor> cursor_color,
|
||||
|
|
|
|||
|
|
@ -1637,6 +1637,10 @@ LLMenuScrollItem::LLMenuScrollItem(const Params& p)
|
|||
}
|
||||
|
||||
LLButton::Params bparams;
|
||||
|
||||
// Disabled the Return key handling by LLMenuScrollItem instead of
|
||||
// passing the key press to the currently selected menu item. See STORM-385.
|
||||
bparams.commit_on_return(false);
|
||||
bparams.mouse_opaque(true);
|
||||
bparams.scale_image(false);
|
||||
bparams.click_callback(p.scroll_callback);
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ LLNotificationForm::FormButton::FormButton()
|
|||
|
||||
LLNotificationForm::FormInput::FormInput()
|
||||
: type("type"),
|
||||
text("text"),
|
||||
max_length_chars("max_length_chars"),
|
||||
width("width", 0),
|
||||
value("value")
|
||||
|
|
@ -421,7 +422,7 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
|
|||
it != end_it;
|
||||
++it)
|
||||
{
|
||||
mUniqueContext.push_back(it->key);
|
||||
mUniqueContext.push_back(it->value);
|
||||
}
|
||||
|
||||
lldebugs << "notification \"" << mName << "\": tag count is " << p.tags.size() << llendl;
|
||||
|
|
@ -792,13 +793,19 @@ bool LLNotification::isEquivalentTo(LLNotificationPtr that) const
|
|||
{
|
||||
const LLSD& these_substitutions = this->getSubstitutions();
|
||||
const LLSD& those_substitutions = that->getSubstitutions();
|
||||
const LLSD& this_payload = this->getPayload();
|
||||
const LLSD& that_payload = that->getPayload();
|
||||
|
||||
// highlander bit sez there can only be one of these
|
||||
for (std::vector<std::string>::const_iterator it = mTemplatep->mUniqueContext.begin(), end_it = mTemplatep->mUniqueContext.end();
|
||||
it != end_it;
|
||||
++it)
|
||||
{
|
||||
if (these_substitutions.get(*it).asString() != those_substitutions.get(*it).asString())
|
||||
// if templates differ in either substitution strings or payload with the given field name
|
||||
// then they are considered inequivalent
|
||||
// use of get() avoids converting the LLSD value to a map as the [] operator would
|
||||
if (these_substitutions.get(*it).asString() != those_substitutions.get(*it).asString()
|
||||
|| this_payload.get(*it).asString() != that_payload.get(*it).asString())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1360,7 +1367,6 @@ LLNotifications::TemplateNames LLNotifications::getTemplateNames() const
|
|||
typedef std::map<std::string, std::string> StringMap;
|
||||
void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements)
|
||||
{
|
||||
//llwarns << "replaceSubstitutionStrings" << llendl;
|
||||
// walk the list of attributes looking for replacements
|
||||
for (LLXMLAttribList::iterator it=node->mAttributes.begin();
|
||||
it != node->mAttributes.end(); ++it)
|
||||
|
|
@ -1374,13 +1380,12 @@ void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements)
|
|||
if (found != replacements.end())
|
||||
{
|
||||
replacement = found->second;
|
||||
//llwarns << "replaceSubstituionStrings: value: " << value << " repl: " << replacement << llendl;
|
||||
|
||||
lldebugs << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << llendl;
|
||||
it->second->setValue(replacement);
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "replaceSubstituionStrings FAILURE: value: " << value << " repl: " << replacement << llendl;
|
||||
llwarns << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,6 +195,7 @@ public:
|
|||
Mandatory<std::string> type;
|
||||
Optional<S32> width;
|
||||
Optional<S32> max_length_chars;
|
||||
Optional<std::string> text;
|
||||
|
||||
Optional<std::string> value;
|
||||
FormInput();
|
||||
|
|
|
|||
|
|
@ -74,11 +74,13 @@ struct LLNotificationTemplate
|
|||
|
||||
struct UniquenessContext : public LLInitParam::Block<UniquenessContext>
|
||||
{
|
||||
Mandatory<std::string> key;
|
||||
Mandatory<std::string> value;
|
||||
|
||||
UniquenessContext()
|
||||
: key("key")
|
||||
{}
|
||||
: value("value")
|
||||
{
|
||||
addSynonym(value, "key");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -88,7 +90,7 @@ struct LLNotificationTemplate
|
|||
// this idiom allows
|
||||
// <notification unique="true">
|
||||
// as well as
|
||||
// <notification> <unique> <context key=""/> </unique>...
|
||||
// <notification> <unique> <context></context> </unique>...
|
||||
Optional<bool> dummy_val;
|
||||
public:
|
||||
Multiple<UniquenessContext> contexts;
|
||||
|
|
@ -243,8 +245,8 @@ struct LLNotificationTemplate
|
|||
// (used for things like progress indications, or repeating warnings
|
||||
// like "the grid is going down in N minutes")
|
||||
bool mUnique;
|
||||
// if we want to be unique only if a certain part of the payload is constant
|
||||
// specify the field names for the payload. The notification will only be
|
||||
// if we want to be unique only if a certain part of the payload or substitutions args
|
||||
// are constant specify the field names for the payload. The notification will only be
|
||||
// combined if all of the fields named in the context are identical in the
|
||||
// new and the old notification; otherwise, the notification will be
|
||||
// duplicated. This is to support suppressing duplicate offers from the same
|
||||
|
|
|
|||
|
|
@ -277,6 +277,8 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
|
|||
mHPad += UI_TEXTEDITOR_LINE_NUMBER_MARGIN;
|
||||
updateRects();
|
||||
}
|
||||
|
||||
mParseOnTheFly = TRUE;
|
||||
}
|
||||
|
||||
void LLTextEditor::initFromParams( const LLTextEditor::Params& p)
|
||||
|
|
@ -324,8 +326,10 @@ void LLTextEditor::setText(const LLStringExplicit &utf8str, const LLStyle::Param
|
|||
|
||||
blockUndo();
|
||||
deselect();
|
||||
|
||||
|
||||
mParseOnTheFly = FALSE;
|
||||
LLTextBase::setText(utf8str, input_params);
|
||||
mParseOnTheFly = TRUE;
|
||||
|
||||
resetDirty();
|
||||
}
|
||||
|
|
@ -1367,6 +1371,7 @@ void LLTextEditor::pastePrimary()
|
|||
// paste from primary (itsprimary==true) or clipboard (itsprimary==false)
|
||||
void LLTextEditor::pasteHelper(bool is_primary)
|
||||
{
|
||||
mParseOnTheFly = FALSE;
|
||||
bool can_paste_it;
|
||||
if (is_primary)
|
||||
{
|
||||
|
|
@ -1450,6 +1455,7 @@ void LLTextEditor::pasteHelper(bool is_primary)
|
|||
deselect();
|
||||
|
||||
onKeyStroke();
|
||||
mParseOnTheFly = TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2385,7 +2391,7 @@ void LLTextEditor::loadKeywords(const std::string& filename,
|
|||
|
||||
void LLTextEditor::updateSegments()
|
||||
{
|
||||
if (mReflowIndex < S32_MAX && mKeywords.isLoaded())
|
||||
if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly)
|
||||
{
|
||||
LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING);
|
||||
// HACK: No non-ascii keywords for now
|
||||
|
|
|
|||
|
|
@ -315,6 +315,7 @@ private:
|
|||
|
||||
BOOL mAllowEmbeddedItems;
|
||||
bool mShowContextMenu;
|
||||
bool mParseOnTheFly;
|
||||
|
||||
LLUUID mSourceID;
|
||||
|
||||
|
|
|
|||
|
|
@ -827,7 +827,7 @@ LLUICtrl* LLUICtrl::findRootMostFocusRoot()
|
|||
{
|
||||
LLUICtrl* focus_root = NULL;
|
||||
LLUICtrl* next_view = this;
|
||||
while(next_view)
|
||||
while(next_view && next_view->hasTabStop())
|
||||
{
|
||||
if (next_view->isFocusRoot())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "llcachename.h"
|
||||
#include "lltrans.h"
|
||||
#include "lluicolortable.h"
|
||||
#include "message.h"
|
||||
|
||||
#define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))"
|
||||
|
||||
|
|
@ -684,8 +685,8 @@ std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCa
|
|||
LLStyle::Params LLUrlEntryGroup::getStyle() const
|
||||
{
|
||||
LLStyle::Params style_params = LLUrlEntryBase::getStyle();
|
||||
style_params.color = LLUIColorTable::instance().getColor("GroupLinkColor");
|
||||
style_params.readonly_color = LLUIColorTable::instance().getColor("GroupLinkColor");
|
||||
style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
return style_params;
|
||||
}
|
||||
|
||||
|
|
@ -740,6 +741,13 @@ std::string LLUrlEntryObjectIM::getLocation(const std::string &url) const
|
|||
return LLUrlEntryBase::getLocation(url);
|
||||
}
|
||||
|
||||
// LLUrlEntryParcel statics.
|
||||
LLUUID LLUrlEntryParcel::sAgentID(LLUUID::null);
|
||||
LLUUID LLUrlEntryParcel::sSessionID(LLUUID::null);
|
||||
LLHost LLUrlEntryParcel::sRegionHost(LLHost::invalid);
|
||||
bool LLUrlEntryParcel::sDisconnected(false);
|
||||
std::set<LLUrlEntryParcel*> LLUrlEntryParcel::sParcelInfoObservers;
|
||||
|
||||
///
|
||||
/// LLUrlEntryParcel Describes a Second Life parcel Url, e.g.,
|
||||
/// secondlife:///app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about
|
||||
|
|
@ -751,13 +759,88 @@ LLUrlEntryParcel::LLUrlEntryParcel()
|
|||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_parcel.xml";
|
||||
mTooltip = LLTrans::getString("TooltipParcelUrl");
|
||||
|
||||
sParcelInfoObservers.insert(this);
|
||||
}
|
||||
|
||||
LLUrlEntryParcel::~LLUrlEntryParcel()
|
||||
{
|
||||
sParcelInfoObservers.erase(this);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
|
||||
{
|
||||
LLSD path_array = LLURI(url).pathArray();
|
||||
S32 path_parts = path_array.size();
|
||||
|
||||
if (path_parts < 3) // no parcel id
|
||||
{
|
||||
llwarns << "Failed to parse url [" << url << "]" << llendl;
|
||||
return url;
|
||||
}
|
||||
|
||||
std::string parcel_id_string = unescapeUrl(path_array[2]); // parcel id
|
||||
|
||||
// Add an observer to call LLUrlLabelCallback when we have parcel name.
|
||||
addObserver(parcel_id_string, url, cb);
|
||||
|
||||
LLUUID parcel_id(parcel_id_string);
|
||||
|
||||
sendParcelInfoRequest(parcel_id);
|
||||
|
||||
return unescapeUrl(url);
|
||||
}
|
||||
|
||||
void LLUrlEntryParcel::sendParcelInfoRequest(const LLUUID& parcel_id)
|
||||
{
|
||||
if (sRegionHost == LLHost::invalid || sDisconnected) return;
|
||||
|
||||
LLMessageSystem *msg = gMessageSystem;
|
||||
msg->newMessage("ParcelInfoRequest");
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, sAgentID );
|
||||
msg->addUUID("SessionID", sSessionID);
|
||||
msg->nextBlock("Data");
|
||||
msg->addUUID("ParcelID", parcel_id);
|
||||
msg->sendReliable(sRegionHost);
|
||||
}
|
||||
|
||||
void LLUrlEntryParcel::onParcelInfoReceived(const std::string &id, const std::string &label)
|
||||
{
|
||||
callObservers(id, label.empty() ? LLTrans::getString("RegionInfoError") : label, mIcon);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data)
|
||||
{
|
||||
std::string label(LLStringUtil::null);
|
||||
if (!parcel_data.name.empty())
|
||||
{
|
||||
label = parcel_data.name;
|
||||
}
|
||||
// If parcel name is empty use Sim_name (x, y, z) for parcel label.
|
||||
else if (!parcel_data.sim_name.empty())
|
||||
{
|
||||
S32 region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS;
|
||||
S32 region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS;
|
||||
S32 region_z = llround(parcel_data.global_z);
|
||||
|
||||
label = llformat("%s (%d, %d, %d)",
|
||||
parcel_data.sim_name.c_str(), region_x, region_y, region_z);
|
||||
}
|
||||
|
||||
for (std::set<LLUrlEntryParcel*>::iterator iter = sParcelInfoObservers.begin();
|
||||
iter != sParcelInfoObservers.end();
|
||||
++iter)
|
||||
{
|
||||
LLUrlEntryParcel* url_entry = *iter;
|
||||
if (url_entry)
|
||||
{
|
||||
url_entry->onParcelInfoReceived(parcel_data.parcel_id.asString(), label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntryPlace Describes secondlife://<location> URLs
|
||||
//
|
||||
|
|
@ -805,6 +888,69 @@ std::string LLUrlEntryPlace::getLocation(const std::string &url) const
|
|||
return ::getStringAfterToken(url, "://");
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntryRegion Describes secondlife:///app/region/REGION_NAME/X/Y/Z URLs, e.g.
|
||||
// secondlife:///app/region/Ahern/128/128/0
|
||||
//
|
||||
LLUrlEntryRegion::LLUrlEntryRegion()
|
||||
{
|
||||
mPattern = boost::regex("secondlife:///app/region/[^/\\s]+(/\\d+)?(/\\d+)?(/\\d+)?/?",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_slurl.xml";
|
||||
mTooltip = LLTrans::getString("TooltipSLURL");
|
||||
}
|
||||
|
||||
std::string LLUrlEntryRegion::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
|
||||
{
|
||||
//
|
||||
// we handle SLURLs in the following formats:
|
||||
// - secondlife:///app/region/Place/X/Y/Z
|
||||
// - secondlife:///app/region/Place/X/Y
|
||||
// - secondlife:///app/region/Place/X
|
||||
// - secondlife:///app/region/Place
|
||||
//
|
||||
|
||||
LLSD path_array = LLURI(url).pathArray();
|
||||
S32 path_parts = path_array.size();
|
||||
|
||||
if (path_parts < 3) // no region name
|
||||
{
|
||||
llwarns << "Failed to parse url [" << url << "]" << llendl;
|
||||
return url;
|
||||
}
|
||||
|
||||
std::string label = unescapeUrl(path_array[2]); // region name
|
||||
|
||||
if (path_parts > 3) // secondlife:///app/region/Place/X
|
||||
{
|
||||
std::string x = path_array[3];
|
||||
label += " (" + x;
|
||||
|
||||
if (path_parts > 4) // secondlife:///app/region/Place/X/Y
|
||||
{
|
||||
std::string y = path_array[4];
|
||||
label += "," + y;
|
||||
|
||||
if (path_parts > 5) // secondlife:///app/region/Place/X/Y/Z
|
||||
{
|
||||
std::string z = path_array[5];
|
||||
label = label + "," + z;
|
||||
}
|
||||
}
|
||||
|
||||
label += ")";
|
||||
}
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
std::string LLUrlEntryRegion::getLocation(const std::string &url) const
|
||||
{
|
||||
LLSD path_array = LLURI(url).pathArray();
|
||||
std::string region_name = unescapeUrl(path_array[2]);
|
||||
return region_name;
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntryTeleport Describes a Second Life teleport Url, e.g.,
|
||||
// secondlife:///app/teleport/Ahern/50/50/50/
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@
|
|||
#include "lluuid.h"
|
||||
#include "lluicolor.h"
|
||||
#include "llstyle.h"
|
||||
|
||||
#include "llhost.h" // for resolving parcel name by parcel id
|
||||
|
||||
#include <boost/signals2.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <string>
|
||||
|
|
@ -285,8 +288,44 @@ private:
|
|||
class LLUrlEntryParcel : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
struct LLParcelData
|
||||
{
|
||||
LLUUID parcel_id;
|
||||
std::string name;
|
||||
std::string sim_name;
|
||||
F32 global_x;
|
||||
F32 global_y;
|
||||
F32 global_z;
|
||||
};
|
||||
|
||||
LLUrlEntryParcel();
|
||||
~LLUrlEntryParcel();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
|
||||
// Sends a parcel info request to sim.
|
||||
void sendParcelInfoRequest(const LLUUID& parcel_id);
|
||||
|
||||
// Calls observers of certain parcel id providing them with parcel label.
|
||||
void onParcelInfoReceived(const std::string &id, const std::string &label);
|
||||
|
||||
// Processes parcel label and triggers notifying observers.
|
||||
static void processParcelInfo(const LLParcelData& parcel_data);
|
||||
|
||||
// Next 4 setters are used to update agent and viewer connection information
|
||||
// upon events like user login, viewer disconnect and user changing region host.
|
||||
// These setters are made public to be accessible from newview and should not be
|
||||
// used in other cases.
|
||||
static void setAgentID(const LLUUID& id) { sAgentID = id; }
|
||||
static void setSessionID(const LLUUID& id) { sSessionID = id; }
|
||||
static void setRegionHost(const LLHost& host) { sRegionHost = host; }
|
||||
static void setDisconnected(bool disconnected) { sDisconnected = disconnected; }
|
||||
|
||||
private:
|
||||
static LLUUID sAgentID;
|
||||
static LLUUID sSessionID;
|
||||
static LLHost sRegionHost;
|
||||
static bool sDisconnected;
|
||||
static std::set<LLUrlEntryParcel*> sParcelInfoObservers;
|
||||
};
|
||||
|
||||
///
|
||||
|
|
@ -301,6 +340,18 @@ public:
|
|||
/*virtual*/ std::string getLocation(const std::string &url) const;
|
||||
};
|
||||
|
||||
///
|
||||
/// LLUrlEntryRegion Describes a Second Life location Url, e.g.,
|
||||
/// secondlife:///app/region/Ahern/128/128/0
|
||||
///
|
||||
class LLUrlEntryRegion : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryRegion();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const;
|
||||
};
|
||||
|
||||
///
|
||||
/// LLUrlEntryTeleport Describes a Second Life teleport Url, e.g.,
|
||||
/// secondlife:///app/teleport/Ahern/50/50/50/
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ LLUrlRegistry::LLUrlRegistry()
|
|||
registerUrl(new LLUrlEntryGroup());
|
||||
registerUrl(new LLUrlEntryParcel());
|
||||
registerUrl(new LLUrlEntryTeleport());
|
||||
registerUrl(new LLUrlEntryRegion());
|
||||
registerUrl(new LLUrlEntryWorldMap());
|
||||
registerUrl(new LLUrlEntryObjectIM());
|
||||
registerUrl(new LLUrlEntryPlace());
|
||||
|
|
|
|||
|
|
@ -413,14 +413,9 @@ public:
|
|||
|
||||
LLControlVariable *findControl(const std::string& name);
|
||||
|
||||
// Moved setValue(), getValue(), setControlValue(), setControlName(),
|
||||
// controlListener() to LLUICtrl because an LLView is NOT assumed to
|
||||
// contain a value. If that's what you want, use LLUICtrl instead.
|
||||
// virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
|
||||
|
||||
const child_list_t* getChildList() const { return &mChildList; }
|
||||
const child_list_const_iter_t beginChild() { return mChildList.begin(); }
|
||||
const child_list_const_iter_t endChild() { return mChildList.end(); }
|
||||
child_list_const_iter_t beginChild() const { return mChildList.begin(); }
|
||||
child_list_const_iter_t endChild() const { return mChildList.end(); }
|
||||
|
||||
// LLMouseHandler functions
|
||||
// Default behavior is to pass events to children
|
||||
|
|
|
|||
|
|
@ -0,0 +1,328 @@
|
|||
/**
|
||||
* @file LLWindowShade.cpp
|
||||
* @brief Notification dialog that slides down and optionally disabled a piece of UI
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "llwindowshade.h"
|
||||
|
||||
#include "lllayoutstack.h"
|
||||
#include "lltextbox.h"
|
||||
#include "lliconctrl.h"
|
||||
#include "llbutton.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
#include "lllineeditor.h"
|
||||
|
||||
const S32 MIN_NOTIFICATION_AREA_HEIGHT = 30;
|
||||
const S32 MAX_NOTIFICATION_AREA_HEIGHT = 100;
|
||||
|
||||
LLWindowShade::Params::Params()
|
||||
: bg_image("bg_image"),
|
||||
modal("modal", false),
|
||||
text_color("text_color"),
|
||||
can_close("can_close", true)
|
||||
{
|
||||
mouse_opaque = false;
|
||||
}
|
||||
|
||||
LLWindowShade::LLWindowShade(const LLWindowShade::Params& params)
|
||||
: LLUICtrl(params),
|
||||
mNotification(params.notification),
|
||||
mModal(params.modal),
|
||||
mFormHeight(0),
|
||||
mTextColor(params.text_color)
|
||||
{
|
||||
setFocusRoot(true);
|
||||
}
|
||||
|
||||
void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
|
||||
{
|
||||
LLUICtrl::initFromParams(params);
|
||||
|
||||
LLLayoutStack::Params layout_p;
|
||||
layout_p.name = "notification_stack";
|
||||
layout_p.rect = params.rect;
|
||||
layout_p.follows.flags = FOLLOWS_ALL;
|
||||
layout_p.mouse_opaque = false;
|
||||
layout_p.orientation = LLLayoutStack::VERTICAL;
|
||||
layout_p.border_size = 0;
|
||||
|
||||
LLLayoutStack* stackp = LLUICtrlFactory::create<LLLayoutStack>(layout_p);
|
||||
addChild(stackp);
|
||||
|
||||
LLLayoutPanel::Params panel_p;
|
||||
panel_p.rect = LLRect(0, 30, 800, 0);
|
||||
panel_p.name = "notification_area";
|
||||
panel_p.visible = false;
|
||||
panel_p.user_resize = false;
|
||||
panel_p.background_visible = true;
|
||||
panel_p.bg_alpha_image = params.bg_image;
|
||||
panel_p.auto_resize = false;
|
||||
LLLayoutPanel* notification_panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
|
||||
stackp->addChild(notification_panel);
|
||||
|
||||
panel_p = LLUICtrlFactory::getDefaultParams<LLLayoutPanel>();
|
||||
panel_p.auto_resize = true;
|
||||
panel_p.user_resize = false;
|
||||
panel_p.rect = params.rect;
|
||||
panel_p.name = "background_area";
|
||||
panel_p.mouse_opaque = false;
|
||||
panel_p.background_visible = false;
|
||||
panel_p.bg_alpha_color = LLColor4(0.f, 0.f, 0.f, 0.2f);
|
||||
LLLayoutPanel* dummy_panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
|
||||
stackp->addChild(dummy_panel);
|
||||
|
||||
layout_p = LLUICtrlFactory::getDefaultParams<LLLayoutStack>();
|
||||
layout_p.rect = LLRect(0, 30, 800, 0);
|
||||
layout_p.follows.flags = FOLLOWS_ALL;
|
||||
layout_p.orientation = LLLayoutStack::HORIZONTAL;
|
||||
stackp = LLUICtrlFactory::create<LLLayoutStack>(layout_p);
|
||||
notification_panel->addChild(stackp);
|
||||
|
||||
panel_p = LLUICtrlFactory::getDefaultParams<LLLayoutPanel>();
|
||||
panel_p.rect.height = 30;
|
||||
LLLayoutPanel* panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
|
||||
stackp->addChild(panel);
|
||||
|
||||
LLIconCtrl::Params icon_p;
|
||||
icon_p.name = "notification_icon";
|
||||
icon_p.rect = LLRect(5, 23, 21, 8);
|
||||
panel->addChild(LLUICtrlFactory::create<LLIconCtrl>(icon_p));
|
||||
|
||||
LLTextBox::Params text_p;
|
||||
text_p.rect = LLRect(31, 20, panel->getRect().getWidth() - 5, 0);
|
||||
text_p.follows.flags = FOLLOWS_ALL;
|
||||
text_p.text_color = mTextColor;
|
||||
text_p.font = LLFontGL::getFontSansSerifSmall();
|
||||
text_p.font.style = "BOLD";
|
||||
text_p.name = "notification_text";
|
||||
text_p.use_ellipses = true;
|
||||
text_p.wrap = true;
|
||||
panel->addChild(LLUICtrlFactory::create<LLTextBox>(text_p));
|
||||
|
||||
panel_p = LLUICtrlFactory::getDefaultParams<LLLayoutPanel>();
|
||||
panel_p.auto_resize = false;
|
||||
panel_p.user_resize = false;
|
||||
panel_p.name="form_elements";
|
||||
panel_p.rect = LLRect(0, 30, 130, 0);
|
||||
LLLayoutPanel* form_elements_panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
|
||||
stackp->addChild(form_elements_panel);
|
||||
|
||||
if (params.can_close)
|
||||
{
|
||||
panel_p = LLUICtrlFactory::getDefaultParams<LLLayoutPanel>();
|
||||
panel_p.auto_resize = false;
|
||||
panel_p.user_resize = false;
|
||||
panel_p.rect = LLRect(0, 30, 25, 0);
|
||||
LLLayoutPanel* close_panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
|
||||
stackp->addChild(close_panel);
|
||||
|
||||
LLButton::Params button_p;
|
||||
button_p.name = "close_notification";
|
||||
button_p.rect = LLRect(5, 23, 21, 7);
|
||||
button_p.image_color.control="DkGray_66";
|
||||
button_p.image_unselected.name="Icon_Close_Foreground";
|
||||
button_p.image_selected.name="Icon_Close_Press";
|
||||
button_p.click_callback.function = boost::bind(&LLWindowShade::onCloseNotification, this);
|
||||
|
||||
close_panel->addChild(LLUICtrlFactory::create<LLButton>(button_p));
|
||||
}
|
||||
|
||||
LLSD payload = mNotification->getPayload();
|
||||
|
||||
LLNotificationFormPtr formp = mNotification->getForm();
|
||||
LLLayoutPanel& notification_area = getChildRef<LLLayoutPanel>("notification_area");
|
||||
notification_area.getChild<LLUICtrl>("notification_icon")->setValue(mNotification->getIcon());
|
||||
notification_area.getChild<LLUICtrl>("notification_text")->setValue(mNotification->getMessage());
|
||||
notification_area.getChild<LLUICtrl>("notification_text")->setToolTip(mNotification->getMessage());
|
||||
|
||||
LLNotificationForm::EIgnoreType ignore_type = formp->getIgnoreType();
|
||||
LLLayoutPanel& form_elements = notification_area.getChildRef<LLLayoutPanel>("form_elements");
|
||||
form_elements.deleteAllChildren();
|
||||
|
||||
const S32 FORM_PADDING_HORIZONTAL = 10;
|
||||
const S32 FORM_PADDING_VERTICAL = 3;
|
||||
const S32 WIDGET_HEIGHT = 24;
|
||||
const S32 LINE_EDITOR_WIDTH = 120;
|
||||
S32 cur_x = FORM_PADDING_HORIZONTAL;
|
||||
S32 cur_y = FORM_PADDING_VERTICAL + WIDGET_HEIGHT;
|
||||
S32 form_width = cur_x;
|
||||
|
||||
if (ignore_type != LLNotificationForm::IGNORE_NO)
|
||||
{
|
||||
LLCheckBoxCtrl::Params checkbox_p;
|
||||
checkbox_p.name = "ignore_check";
|
||||
checkbox_p.rect = LLRect(cur_x, cur_y, cur_x, cur_y - WIDGET_HEIGHT);
|
||||
checkbox_p.label = formp->getIgnoreMessage();
|
||||
checkbox_p.label_text.text_color = LLColor4::black;
|
||||
checkbox_p.commit_callback.function = boost::bind(&LLWindowShade::onClickIgnore, this, _1);
|
||||
checkbox_p.initial_value = formp->getIgnored();
|
||||
|
||||
LLCheckBoxCtrl* check = LLUICtrlFactory::create<LLCheckBoxCtrl>(checkbox_p);
|
||||
check->setRect(check->getBoundingRect());
|
||||
form_elements.addChild(check);
|
||||
cur_x = check->getRect().mRight + FORM_PADDING_HORIZONTAL;
|
||||
form_width = llmax(form_width, cur_x);
|
||||
}
|
||||
|
||||
for (S32 i = 0; i < formp->getNumElements(); i++)
|
||||
{
|
||||
LLSD form_element = formp->getElement(i);
|
||||
std::string type = form_element["type"].asString();
|
||||
if (type == "button")
|
||||
{
|
||||
LLButton::Params button_p;
|
||||
button_p.name = form_element["name"];
|
||||
button_p.label = form_element["text"];
|
||||
button_p.rect = LLRect(cur_x, cur_y, cur_x, cur_y - WIDGET_HEIGHT);
|
||||
button_p.click_callback.function = boost::bind(&LLWindowShade::onClickNotificationButton, this, form_element["name"].asString());
|
||||
button_p.auto_resize = true;
|
||||
|
||||
LLButton* button = LLUICtrlFactory::create<LLButton>(button_p);
|
||||
button->autoResize();
|
||||
form_elements.addChild(button);
|
||||
|
||||
if (form_element["default"].asBoolean())
|
||||
{
|
||||
form_elements.setDefaultBtn(button);
|
||||
}
|
||||
|
||||
cur_x = button->getRect().mRight + FORM_PADDING_HORIZONTAL;
|
||||
form_width = llmax(form_width, cur_x);
|
||||
}
|
||||
else if (type == "text" || type == "password")
|
||||
{
|
||||
// if not at beginning of line...
|
||||
if (cur_x != FORM_PADDING_HORIZONTAL)
|
||||
{
|
||||
// start new line
|
||||
cur_x = FORM_PADDING_HORIZONTAL;
|
||||
cur_y -= WIDGET_HEIGHT + FORM_PADDING_VERTICAL;
|
||||
}
|
||||
LLTextBox::Params label_p;
|
||||
label_p.name = form_element["name"].asString() + "_label";
|
||||
label_p.rect = LLRect(cur_x, cur_y, cur_x + LINE_EDITOR_WIDTH, cur_y - WIDGET_HEIGHT);
|
||||
label_p.initial_value = form_element["text"];
|
||||
label_p.text_color = mTextColor;
|
||||
label_p.font_valign = LLFontGL::VCENTER;
|
||||
label_p.v_pad = 5;
|
||||
LLTextBox* textbox = LLUICtrlFactory::create<LLTextBox>(label_p);
|
||||
textbox->reshapeToFitText();
|
||||
textbox->reshape(textbox->getRect().getWidth(), form_elements.getRect().getHeight() - 2 * FORM_PADDING_VERTICAL);
|
||||
form_elements.addChild(textbox);
|
||||
cur_x = textbox->getRect().mRight + FORM_PADDING_HORIZONTAL;
|
||||
|
||||
LLLineEditor::Params line_p;
|
||||
line_p.name = form_element["name"];
|
||||
line_p.keystroke_callback = boost::bind(&LLWindowShade::onEnterNotificationText, this, _1, form_element["name"].asString());
|
||||
line_p.is_password = type == "password";
|
||||
line_p.rect = LLRect(cur_x, cur_y, cur_x + LINE_EDITOR_WIDTH, cur_y - WIDGET_HEIGHT);
|
||||
|
||||
LLLineEditor* line_editor = LLUICtrlFactory::create<LLLineEditor>(line_p);
|
||||
form_elements.addChild(line_editor);
|
||||
form_width = llmax(form_width, cur_x + LINE_EDITOR_WIDTH + FORM_PADDING_HORIZONTAL);
|
||||
|
||||
// reset to start of next line
|
||||
cur_x = FORM_PADDING_HORIZONTAL;
|
||||
cur_y -= WIDGET_HEIGHT + FORM_PADDING_VERTICAL;
|
||||
}
|
||||
}
|
||||
|
||||
mFormHeight = form_elements.getRect().getHeight() - (cur_y - FORM_PADDING_VERTICAL) + WIDGET_HEIGHT;
|
||||
form_elements.reshape(form_width, mFormHeight);
|
||||
form_elements.setMinDim(form_width);
|
||||
|
||||
// move all form elements back onto form surface
|
||||
S32 delta_y = WIDGET_HEIGHT + FORM_PADDING_VERTICAL - cur_y;
|
||||
for (child_list_const_iter_t it = form_elements.getChildList()->begin(), end_it = form_elements.getChildList()->end();
|
||||
it != end_it;
|
||||
++it)
|
||||
{
|
||||
(*it)->translate(0, delta_y);
|
||||
}
|
||||
}
|
||||
|
||||
void LLWindowShade::show()
|
||||
{
|
||||
getChildRef<LLLayoutPanel>("notification_area").setVisible(true);
|
||||
getChildRef<LLLayoutPanel>("background_area").setBackgroundVisible(mModal);
|
||||
|
||||
setMouseOpaque(mModal);
|
||||
}
|
||||
|
||||
void LLWindowShade::draw()
|
||||
{
|
||||
LLRect message_rect = getChild<LLTextBox>("notification_text")->getTextBoundingRect();
|
||||
|
||||
LLLayoutPanel* notification_area = getChild<LLLayoutPanel>("notification_area");
|
||||
|
||||
notification_area->reshape(notification_area->getRect().getWidth(),
|
||||
llclamp(message_rect.getHeight() + 10,
|
||||
llmin(mFormHeight, MAX_NOTIFICATION_AREA_HEIGHT),
|
||||
MAX_NOTIFICATION_AREA_HEIGHT));
|
||||
|
||||
LLUICtrl::draw();
|
||||
if (mNotification && !mNotification->isActive())
|
||||
{
|
||||
hide();
|
||||
}
|
||||
}
|
||||
|
||||
void LLWindowShade::hide()
|
||||
{
|
||||
getChildRef<LLLayoutPanel>("notification_area").setVisible(false);
|
||||
getChildRef<LLLayoutPanel>("background_area").setBackgroundVisible(false);
|
||||
|
||||
setMouseOpaque(false);
|
||||
}
|
||||
|
||||
void LLWindowShade::onCloseNotification()
|
||||
{
|
||||
LLNotifications::instance().cancel(mNotification);
|
||||
}
|
||||
|
||||
void LLWindowShade::onClickIgnore(LLUICtrl* ctrl)
|
||||
{
|
||||
bool check = ctrl->getValue().asBoolean();
|
||||
if (mNotification && mNotification->getForm()->getIgnoreType() == LLNotificationForm::IGNORE_SHOW_AGAIN)
|
||||
{
|
||||
// question was "show again" so invert value to get "ignore"
|
||||
check = !check;
|
||||
}
|
||||
mNotification->setIgnored(check);
|
||||
}
|
||||
|
||||
void LLWindowShade::onClickNotificationButton(const std::string& name)
|
||||
{
|
||||
if (!mNotification) return;
|
||||
|
||||
mNotificationResponse[name] = true;
|
||||
|
||||
mNotification->respond(mNotificationResponse);
|
||||
}
|
||||
|
||||
void LLWindowShade::onEnterNotificationText(LLUICtrl* ctrl, const std::string& name)
|
||||
{
|
||||
mNotificationResponse[name] = ctrl->getValue().asString();
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/**
|
||||
* @file llwindowshade.h
|
||||
* @brief Notification dialog that slides down and optionally disabled a piece of UI
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLWINDOWSHADE_H
|
||||
#define LL_LLWINDOWSHADE_H
|
||||
|
||||
#include "lluictrl.h"
|
||||
#include "llnotifications.h"
|
||||
|
||||
class LLWindowShade : public LLUICtrl
|
||||
{
|
||||
public:
|
||||
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
|
||||
{
|
||||
Mandatory<LLNotificationPtr> notification;
|
||||
Optional<LLUIImage*> bg_image;
|
||||
Optional<LLUIColor> text_color;
|
||||
Optional<bool> modal,
|
||||
can_close;
|
||||
|
||||
Params();
|
||||
};
|
||||
|
||||
void show();
|
||||
/*virtual*/ void draw();
|
||||
void hide();
|
||||
|
||||
private:
|
||||
friend class LLUICtrlFactory;
|
||||
|
||||
LLWindowShade(const Params& p);
|
||||
void initFromParams(const Params& params);
|
||||
|
||||
void onCloseNotification();
|
||||
void onClickNotificationButton(const std::string& name);
|
||||
void onEnterNotificationText(LLUICtrl* ctrl, const std::string& name);
|
||||
void onClickIgnore(LLUICtrl* ctrl);
|
||||
|
||||
LLNotificationPtr mNotification;
|
||||
LLSD mNotificationResponse;
|
||||
bool mModal;
|
||||
S32 mFormHeight;
|
||||
LLUIColor mTextColor;
|
||||
};
|
||||
|
||||
#endif // LL_LLWINDOWSHADE_H
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
#include "llavatarnamecache.h"
|
||||
#include "llcachename.h"
|
||||
#include "lluuid.h"
|
||||
#include "message.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
|
@ -191,3 +192,20 @@ LLFontGL* LLFontGL::getFontDefault()
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char* _PREHASH_AgentData = "AgentData";
|
||||
char* _PREHASH_AgentID = "AgentID";
|
||||
|
||||
LLHost LLHost::invalid(INVALID_PORT,INVALID_HOST_IP_ADDRESS);
|
||||
|
||||
LLMessageSystem* gMessageSystem = NULL;
|
||||
|
||||
//
|
||||
// Stub implementation for LLMessageSystem
|
||||
//
|
||||
void LLMessageSystem::newMessage(const char *name) { }
|
||||
void LLMessageSystem::nextBlockFast(const char *blockname) { }
|
||||
void LLMessageSystem::nextBlock(const char *blockname) { }
|
||||
void LLMessageSystem::addUUIDFast( const char *varname, const LLUUID& uuid) { }
|
||||
void LLMessageSystem::addUUID( const char *varname, const LLUUID& uuid) { }
|
||||
S32 LLMessageSystem::sendReliable(const LLHost &host) { return 0; }
|
||||
|
|
|
|||
|
|
@ -103,6 +103,45 @@ namespace tut
|
|||
ensure_equals(testname, url, expected);
|
||||
}
|
||||
|
||||
void dummyCallback(const std::string &url, const std::string &label, const std::string& icon)
|
||||
{
|
||||
}
|
||||
|
||||
void testLabel(const std::string &testname, LLUrlEntryBase &entry,
|
||||
const char *text, const std::string &expected)
|
||||
{
|
||||
boost::regex regex = entry.getPattern();
|
||||
std::string label = "";
|
||||
boost::cmatch result;
|
||||
bool found = boost::regex_search(text, result, regex);
|
||||
if (found)
|
||||
{
|
||||
S32 start = static_cast<U32>(result[0].first - text);
|
||||
S32 end = static_cast<U32>(result[0].second - text);
|
||||
std::string url = std::string(text+start, end-start);
|
||||
label = entry.getLabel(url, boost::bind(dummyCallback, _1, _2, _3));
|
||||
}
|
||||
ensure_equals(testname, label, expected);
|
||||
}
|
||||
|
||||
void testLocation(const std::string &testname, LLUrlEntryBase &entry,
|
||||
const char *text, const std::string &expected)
|
||||
{
|
||||
boost::regex regex = entry.getPattern();
|
||||
std::string location = "";
|
||||
boost::cmatch result;
|
||||
bool found = boost::regex_search(text, result, regex);
|
||||
if (found)
|
||||
{
|
||||
S32 start = static_cast<U32>(result[0].first - text);
|
||||
S32 end = static_cast<U32>(result[0].second - text);
|
||||
std::string url = std::string(text+start, end-start);
|
||||
location = entry.getLocation(url);
|
||||
}
|
||||
ensure_equals(testname, location, expected);
|
||||
}
|
||||
|
||||
|
||||
template<> template<>
|
||||
void object::test<1>()
|
||||
{
|
||||
|
|
@ -697,4 +736,114 @@ namespace tut
|
|||
"<nolink>My Object</nolink>",
|
||||
"My Object");
|
||||
}
|
||||
|
||||
template<> template<>
|
||||
void object::test<13>()
|
||||
{
|
||||
//
|
||||
// test LLUrlEntryRegion - secondlife:///app/region/<location> URLs
|
||||
//
|
||||
LLUrlEntryRegion url;
|
||||
|
||||
// Regex tests.
|
||||
testRegex("no valid region", url,
|
||||
"secondlife:///app/region/",
|
||||
"");
|
||||
|
||||
testRegex("invalid coords", url,
|
||||
"secondlife:///app/region/Korea2/a/b/c",
|
||||
"secondlife:///app/region/Korea2/"); // don't count invalid coords
|
||||
|
||||
testRegex("Ahern (50,50,50) [1]", url,
|
||||
"secondlife:///app/region/Ahern/50/50/50/",
|
||||
"secondlife:///app/region/Ahern/50/50/50/");
|
||||
|
||||
testRegex("Ahern (50,50,50) [2]", url,
|
||||
"XXX secondlife:///app/region/Ahern/50/50/50/ XXX",
|
||||
"secondlife:///app/region/Ahern/50/50/50/");
|
||||
|
||||
testRegex("Ahern (50,50,50) [3]", url,
|
||||
"XXX secondlife:///app/region/Ahern/50/50/50 XXX",
|
||||
"secondlife:///app/region/Ahern/50/50/50");
|
||||
|
||||
testRegex("Ahern (50,50,50) multicase", url,
|
||||
"XXX secondlife:///app/region/Ahern/50/50/50/ XXX",
|
||||
"secondlife:///app/region/Ahern/50/50/50/");
|
||||
|
||||
testRegex("Ahern (50,50) [1]", url,
|
||||
"XXX secondlife:///app/region/Ahern/50/50/ XXX",
|
||||
"secondlife:///app/region/Ahern/50/50/");
|
||||
|
||||
testRegex("Ahern (50,50) [2]", url,
|
||||
"XXX secondlife:///app/region/Ahern/50/50 XXX",
|
||||
"secondlife:///app/region/Ahern/50/50");
|
||||
|
||||
// DEV-21577: In-world SLURLs containing "(" or ")" are not treated as a hyperlink in chat
|
||||
testRegex("Region with brackets", url,
|
||||
"XXX secondlife:///app/region/Burning%20Life%20(Hyper)/27/210/30 XXX",
|
||||
"secondlife:///app/region/Burning%20Life%20(Hyper)/27/210/30");
|
||||
|
||||
// DEV-35459: SLURLs and teleport Links not parsed properly
|
||||
testRegex("Region with quote", url,
|
||||
"XXX secondlife:///app/region/A'ksha%20Oasis/41/166/701 XXX",
|
||||
"secondlife:///app/region/A%27ksha%20Oasis/41/166/701");
|
||||
|
||||
// Rendering tests.
|
||||
testLabel("Render /app/region/Ahern/50/50/50/", url,
|
||||
"secondlife:///app/region/Ahern/50/50/50/",
|
||||
"Ahern (50,50,50)");
|
||||
|
||||
testLabel("Render /app/region/Ahern/50/50/50", url,
|
||||
"secondlife:///app/region/Ahern/50/50/50",
|
||||
"Ahern (50,50,50)");
|
||||
|
||||
testLabel("Render /app/region/Ahern/50/50/", url,
|
||||
"secondlife:///app/region/Ahern/50/50/",
|
||||
"Ahern (50,50)");
|
||||
|
||||
testLabel("Render /app/region/Ahern/50/50", url,
|
||||
"secondlife:///app/region/Ahern/50/50",
|
||||
"Ahern (50,50)");
|
||||
|
||||
testLabel("Render /app/region/Ahern/50/", url,
|
||||
"secondlife:///app/region/Ahern/50/",
|
||||
"Ahern (50)");
|
||||
|
||||
testLabel("Render /app/region/Ahern/50", url,
|
||||
"secondlife:///app/region/Ahern/50",
|
||||
"Ahern (50)");
|
||||
|
||||
testLabel("Render /app/region/Ahern/", url,
|
||||
"secondlife:///app/region/Ahern/",
|
||||
"Ahern");
|
||||
|
||||
testLabel("Render /app/region/Ahern/ within context", url,
|
||||
"XXX secondlife:///app/region/Ahern/ XXX",
|
||||
"Ahern");
|
||||
|
||||
testLabel("Render /app/region/Ahern", url,
|
||||
"secondlife:///app/region/Ahern",
|
||||
"Ahern");
|
||||
|
||||
testLabel("Render /app/region/Ahern within context", url,
|
||||
"XXX secondlife:///app/region/Ahern XXX",
|
||||
"Ahern");
|
||||
|
||||
testLabel("Render /app/region/Product%20Engine/", url,
|
||||
"secondlife:///app/region/Product%20Engine/",
|
||||
"Product Engine");
|
||||
|
||||
testLabel("Render /app/region/Product%20Engine", url,
|
||||
"secondlife:///app/region/Product%20Engine",
|
||||
"Product Engine");
|
||||
|
||||
// Location parsing texts.
|
||||
testLocation("Location /app/region/Ahern/50/50/50/", url,
|
||||
"secondlife:///app/region/Ahern/50/50/50/",
|
||||
"Ahern");
|
||||
|
||||
testLocation("Location /app/region/Product%20Engine", url,
|
||||
"secondlife:///app/region/Product%20Engine",
|
||||
"Product Engine");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,12 +59,13 @@ set(viewer_HEADER_FILES
|
|||
|
||||
# Libraries on which this library depends, needed for Linux builds
|
||||
# Sort by high-level to low-level
|
||||
if (NOT LINUX OR VIEWER)
|
||||
if (LINUX AND VIEWER)
|
||||
set(llwindow_LINK_LIBRARIES
|
||||
${UI_LIBRARIES} # for GTK
|
||||
${SDL_LIBRARY}
|
||||
fontconfig # For FCInit and other FC* functions.
|
||||
)
|
||||
endif (NOT LINUX OR VIEWER)
|
||||
endif (LINUX AND VIEWER)
|
||||
|
||||
if (DARWIN)
|
||||
list(APPEND llwindow_SOURCE_FILES
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
project(mac_updater)
|
||||
|
||||
include(00-Common)
|
||||
include(OpenSSL)
|
||||
include(CURL)
|
||||
include(LLCommon)
|
||||
include(LLVFS)
|
||||
|
|
@ -49,6 +50,8 @@ set_target_properties(mac-updater
|
|||
|
||||
target_link_libraries(mac-updater
|
||||
${LLVFS_LIBRARIES}
|
||||
${OPENSSL_LIBRARIES}
|
||||
${CRYPTO_LIBRARIES}
|
||||
${CURL_LIBRARIES}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -6,21 +6,21 @@
|
|||
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
* @endcond
|
||||
|
|
@ -39,48 +39,48 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class MediaPluginExample :
|
||||
public MediaPluginBase
|
||||
public MediaPluginBase
|
||||
{
|
||||
public:
|
||||
MediaPluginExample( LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data );
|
||||
~MediaPluginExample();
|
||||
public:
|
||||
MediaPluginExample( LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data );
|
||||
~MediaPluginExample();
|
||||
|
||||
/*virtual*/ void receiveMessage( const char* message_string );
|
||||
/*virtual*/ void receiveMessage( const char* message_string );
|
||||
|
||||
private:
|
||||
bool init();
|
||||
void update( F64 milliseconds );
|
||||
void write_pixel( int x, int y, unsigned char r, unsigned char g, unsigned char b );
|
||||
bool mFirstTime;
|
||||
private:
|
||||
bool init();
|
||||
void update( F64 milliseconds );
|
||||
void write_pixel( int x, int y, unsigned char r, unsigned char g, unsigned char b );
|
||||
bool mFirstTime;
|
||||
|
||||
time_t mLastUpdateTime;
|
||||
enum Constants { ENumObjects = 10 };
|
||||
unsigned char* mBackgroundPixels;
|
||||
int mColorR[ ENumObjects ];
|
||||
int mColorG[ ENumObjects ];
|
||||
int mColorB[ ENumObjects ];
|
||||
int mXpos[ ENumObjects ];
|
||||
int mYpos[ ENumObjects ];
|
||||
int mXInc[ ENumObjects ];
|
||||
int mYInc[ ENumObjects ];
|
||||
int mBlockSize[ ENumObjects ];
|
||||
bool mMouseButtonDown;
|
||||
bool mStopAction;
|
||||
time_t mLastUpdateTime;
|
||||
enum Constants { ENumObjects = 10 };
|
||||
unsigned char* mBackgroundPixels;
|
||||
int mColorR[ ENumObjects ];
|
||||
int mColorG[ ENumObjects ];
|
||||
int mColorB[ ENumObjects ];
|
||||
int mXpos[ ENumObjects ];
|
||||
int mYpos[ ENumObjects ];
|
||||
int mXInc[ ENumObjects ];
|
||||
int mYInc[ ENumObjects ];
|
||||
int mBlockSize[ ENumObjects ];
|
||||
bool mMouseButtonDown;
|
||||
bool mStopAction;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
MediaPluginExample::MediaPluginExample( LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data ) :
|
||||
MediaPluginBase( host_send_func, host_user_data )
|
||||
MediaPluginBase( host_send_func, host_user_data )
|
||||
{
|
||||
mFirstTime = true;
|
||||
mWidth = 0;
|
||||
mHeight = 0;
|
||||
mDepth = 4;
|
||||
mPixels = 0;
|
||||
mMouseButtonDown = false;
|
||||
mStopAction = false;
|
||||
mLastUpdateTime = 0;
|
||||
mFirstTime = true;
|
||||
mWidth = 0;
|
||||
mHeight = 0;
|
||||
mDepth = 4;
|
||||
mPixels = 0;
|
||||
mMouseButtonDown = false;
|
||||
mStopAction = false;
|
||||
mLastUpdateTime = 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -93,395 +93,320 @@ MediaPluginExample::~MediaPluginExample()
|
|||
//
|
||||
void MediaPluginExample::receiveMessage( const char* message_string )
|
||||
{
|
||||
LLPluginMessage message_in;
|
||||
// std::cerr << "MediaPluginWebKit::receiveMessage: received message: \"" << message_string << "\"" << std::endl;
|
||||
LLPluginMessage message_in;
|
||||
|
||||
if ( message_in.parse( message_string ) >= 0 )
|
||||
{
|
||||
std::string message_class = message_in.getClass();
|
||||
std::string message_name = message_in.getName();
|
||||
if(message_in.parse(message_string) >= 0)
|
||||
{
|
||||
std::string message_class = message_in.getClass();
|
||||
std::string message_name = message_in.getName();
|
||||
if(message_class == LLPLUGIN_MESSAGE_CLASS_BASE)
|
||||
{
|
||||
if(message_name == "init")
|
||||
{
|
||||
LLPluginMessage message("base", "init_response");
|
||||
LLSD versions = LLSD::emptyMap();
|
||||
versions[LLPLUGIN_MESSAGE_CLASS_BASE] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION;
|
||||
versions[LLPLUGIN_MESSAGE_CLASS_MEDIA] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION;
|
||||
versions[LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER] = LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER_VERSION;
|
||||
message.setValueLLSD("versions", versions);
|
||||
|
||||
if ( message_class == LLPLUGIN_MESSAGE_CLASS_BASE )
|
||||
{
|
||||
if ( message_name == "init" )
|
||||
{
|
||||
LLPluginMessage message( "base", "init_response" );
|
||||
LLSD versions = LLSD::emptyMap();
|
||||
versions[ LLPLUGIN_MESSAGE_CLASS_BASE ] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION;
|
||||
versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION;
|
||||
versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER_VERSION;
|
||||
message.setValueLLSD( "versions", versions );
|
||||
std::string plugin_version = "Example plugin 1.0..0";
|
||||
message.setValue("plugin_version", plugin_version);
|
||||
sendMessage(message);
|
||||
}
|
||||
else if(message_name == "idle")
|
||||
{
|
||||
// no response is necessary here.
|
||||
F64 time = message_in.getValueReal("time");
|
||||
|
||||
std::string plugin_version = "Example media plugin, Example Version 1.0.0.0";
|
||||
message.setValue( "plugin_version", plugin_version );
|
||||
sendMessage( message );
|
||||
}
|
||||
else
|
||||
if ( message_name == "idle" )
|
||||
{
|
||||
// no response is necessary here.
|
||||
F64 time = message_in.getValueReal( "time" );
|
||||
// Convert time to milliseconds for update()
|
||||
update((int)(time * 1000.0f));
|
||||
}
|
||||
else if(message_name == "cleanup")
|
||||
{
|
||||
}
|
||||
else if(message_name == "shm_added")
|
||||
{
|
||||
SharedSegmentInfo info;
|
||||
info.mAddress = message_in.getValuePointer("address");
|
||||
info.mSize = (size_t)message_in.getValueS32("size");
|
||||
std::string name = message_in.getValue("name");
|
||||
|
||||
// Convert time to milliseconds for update()
|
||||
update( time );
|
||||
}
|
||||
else
|
||||
if ( message_name == "cleanup" )
|
||||
{
|
||||
// clean up here
|
||||
}
|
||||
else
|
||||
if ( message_name == "shm_added" )
|
||||
{
|
||||
SharedSegmentInfo info;
|
||||
info.mAddress = message_in.getValuePointer( "address" );
|
||||
info.mSize = ( size_t )message_in.getValueS32( "size" );
|
||||
std::string name = message_in.getValue( "name" );
|
||||
mSharedSegments.insert(SharedSegmentMap::value_type(name, info));
|
||||
|
||||
mSharedSegments.insert( SharedSegmentMap::value_type( name, info ) );
|
||||
}
|
||||
else if(message_name == "shm_remove")
|
||||
{
|
||||
std::string name = message_in.getValue("name");
|
||||
|
||||
}
|
||||
else
|
||||
if ( message_name == "shm_remove" )
|
||||
{
|
||||
std::string name = message_in.getValue( "name" );
|
||||
SharedSegmentMap::iterator iter = mSharedSegments.find(name);
|
||||
if(iter != mSharedSegments.end())
|
||||
{
|
||||
if(mPixels == iter->second.mAddress)
|
||||
{
|
||||
// This is the currently active pixel buffer. Make sure we stop drawing to it.
|
||||
mPixels = NULL;
|
||||
mTextureSegmentName.clear();
|
||||
}
|
||||
mSharedSegments.erase(iter);
|
||||
}
|
||||
else
|
||||
{
|
||||
// std::cerr << "MediaPluginWebKit::receiveMessage: unknown shared memory region!" << std::endl;
|
||||
}
|
||||
|
||||
SharedSegmentMap::iterator iter = mSharedSegments.find( name );
|
||||
if( iter != mSharedSegments.end() )
|
||||
{
|
||||
if ( mPixels == iter->second.mAddress )
|
||||
{
|
||||
// This is the currently active pixel buffer.
|
||||
// Make sure we stop drawing to it.
|
||||
mPixels = NULL;
|
||||
mTextureSegmentName.clear();
|
||||
};
|
||||
mSharedSegments.erase( iter );
|
||||
}
|
||||
else
|
||||
{
|
||||
//std::cerr << "MediaPluginExample::receiveMessage: unknown shared memory region!" << std::endl;
|
||||
};
|
||||
// Send the response so it can be cleaned up.
|
||||
LLPluginMessage message("base", "shm_remove_response");
|
||||
message.setValue("name", name);
|
||||
sendMessage(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
// std::cerr << "MediaPluginWebKit::receiveMessage: unknown base message: " << message_name << std::endl;
|
||||
}
|
||||
}
|
||||
else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA)
|
||||
{
|
||||
if(message_name == "init")
|
||||
{
|
||||
// Plugin gets to decide the texture parameters to use.
|
||||
mDepth = 4;
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params");
|
||||
message.setValueS32("default_width", 1024);
|
||||
message.setValueS32("default_height", 1024);
|
||||
message.setValueS32("depth", mDepth);
|
||||
message.setValueU32("internalformat", GL_RGBA);
|
||||
message.setValueU32("format", GL_RGBA);
|
||||
message.setValueU32("type", GL_UNSIGNED_BYTE);
|
||||
message.setValueBoolean("coords_opengl", true);
|
||||
sendMessage(message);
|
||||
}
|
||||
else if(message_name == "size_change")
|
||||
{
|
||||
std::string name = message_in.getValue("name");
|
||||
S32 width = message_in.getValueS32("width");
|
||||
S32 height = message_in.getValueS32("height");
|
||||
S32 texture_width = message_in.getValueS32("texture_width");
|
||||
S32 texture_height = message_in.getValueS32("texture_height");
|
||||
|
||||
// Send the response so it can be cleaned up.
|
||||
LLPluginMessage message( "base", "shm_remove_response" );
|
||||
message.setValue( "name", name );
|
||||
sendMessage( message );
|
||||
}
|
||||
else
|
||||
{
|
||||
//std::cerr << "MediaPluginExample::receiveMessage: unknown base message: " << message_name << std::endl;
|
||||
};
|
||||
}
|
||||
else
|
||||
if ( message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA )
|
||||
{
|
||||
if ( message_name == "init" )
|
||||
{
|
||||
// Plugin gets to decide the texture parameters to use.
|
||||
LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params" );
|
||||
message.setValueS32( "default_width", mWidth );
|
||||
message.setValueS32( "default_height", mHeight );
|
||||
message.setValueS32( "depth", mDepth );
|
||||
message.setValueU32( "internalformat", GL_RGBA );
|
||||
message.setValueU32( "format", GL_RGBA );
|
||||
message.setValueU32( "type", GL_UNSIGNED_BYTE );
|
||||
message.setValueBoolean( "coords_opengl", false );
|
||||
sendMessage( message );
|
||||
}
|
||||
else if ( message_name == "size_change" )
|
||||
{
|
||||
std::string name = message_in.getValue( "name" );
|
||||
S32 width = message_in.getValueS32( "width" );
|
||||
S32 height = message_in.getValueS32( "height" );
|
||||
S32 texture_width = message_in.getValueS32( "texture_width" );
|
||||
S32 texture_height = message_in.getValueS32( "texture_height" );
|
||||
if(!name.empty())
|
||||
{
|
||||
// Find the shared memory region with this name
|
||||
SharedSegmentMap::iterator iter = mSharedSegments.find(name);
|
||||
if(iter != mSharedSegments.end())
|
||||
{
|
||||
mPixels = (unsigned char*)iter->second.mAddress;
|
||||
mWidth = width;
|
||||
mHeight = height;
|
||||
|
||||
if ( ! name.empty() )
|
||||
{
|
||||
// Find the shared memory region with this name
|
||||
SharedSegmentMap::iterator iter = mSharedSegments.find( name );
|
||||
if ( iter != mSharedSegments.end() )
|
||||
{
|
||||
mPixels = ( unsigned char* )iter->second.mAddress;
|
||||
mWidth = width;
|
||||
mHeight = height;
|
||||
mTextureWidth = texture_width;
|
||||
mTextureHeight = texture_height;
|
||||
};
|
||||
};
|
||||
|
||||
mTextureWidth = texture_width;
|
||||
mTextureHeight = texture_height;
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response");
|
||||
message.setValue("name", name);
|
||||
message.setValueS32("width", width);
|
||||
message.setValueS32("height", height);
|
||||
message.setValueS32("texture_width", texture_width);
|
||||
message.setValueS32("texture_height", texture_height);
|
||||
sendMessage(message);
|
||||
|
||||
init();
|
||||
};
|
||||
};
|
||||
}
|
||||
else if(message_name == "load_uri")
|
||||
{
|
||||
}
|
||||
else if(message_name == "mouse_event")
|
||||
{
|
||||
std::string event = message_in.getValue("event");
|
||||
if(event == "down")
|
||||
{
|
||||
|
||||
LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response" );
|
||||
message.setValue( "name", name );
|
||||
message.setValueS32( "width", width );
|
||||
message.setValueS32( "height", height );
|
||||
message.setValueS32( "texture_width", texture_width );
|
||||
message.setValueS32( "texture_height", texture_height );
|
||||
sendMessage( message );
|
||||
}
|
||||
else
|
||||
if ( message_name == "load_uri" )
|
||||
{
|
||||
std::string uri = message_in.getValue( "uri" );
|
||||
if ( ! uri.empty() )
|
||||
{
|
||||
};
|
||||
}
|
||||
else
|
||||
if ( message_name == "mouse_event" )
|
||||
{
|
||||
std::string event = message_in.getValue( "event" );
|
||||
S32 button = message_in.getValueS32( "button" );
|
||||
|
||||
// left mouse button
|
||||
if ( button == 0 )
|
||||
{
|
||||
int mouse_x = message_in.getValueS32( "x" );
|
||||
int mouse_y = message_in.getValueS32( "y" );
|
||||
std::string modifiers = message_in.getValue( "modifiers" );
|
||||
|
||||
if ( event == "move" )
|
||||
{
|
||||
if ( mMouseButtonDown )
|
||||
write_pixel( mouse_x, mouse_y, rand() % 0x80 + 0x80, rand() % 0x80 + 0x80, rand() % 0x80 + 0x80 );
|
||||
}
|
||||
else
|
||||
if ( event == "down" )
|
||||
{
|
||||
mMouseButtonDown = true;
|
||||
}
|
||||
else
|
||||
if ( event == "up" )
|
||||
{
|
||||
mMouseButtonDown = false;
|
||||
}
|
||||
else
|
||||
if ( event == "double_click" )
|
||||
{
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
if ( message_name == "key_event" )
|
||||
{
|
||||
std::string event = message_in.getValue( "event" );
|
||||
S32 key = message_in.getValueS32( "key" );
|
||||
std::string modifiers = message_in.getValue( "modifiers" );
|
||||
|
||||
if ( event == "down" )
|
||||
{
|
||||
if ( key == ' ')
|
||||
{
|
||||
mLastUpdateTime = 0;
|
||||
update( 0.0f );
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
//std::cerr << "MediaPluginExample::receiveMessage: unknown media message: " << message_string << std::endl;
|
||||
};
|
||||
}
|
||||
else
|
||||
if ( message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER )
|
||||
{
|
||||
if ( message_name == "browse_reload" )
|
||||
{
|
||||
mLastUpdateTime = 0;
|
||||
mFirstTime = true;
|
||||
mStopAction = false;
|
||||
update( 0.0f );
|
||||
}
|
||||
else
|
||||
if ( message_name == "browse_stop" )
|
||||
{
|
||||
for( int n = 0; n < ENumObjects; ++n )
|
||||
mXInc[ n ] = mYInc[ n ] = 0;
|
||||
|
||||
mStopAction = true;
|
||||
update( 0.0f );
|
||||
}
|
||||
else
|
||||
{
|
||||
//std::cerr << "MediaPluginExample::receiveMessage: unknown media_browser message: " << message_string << std::endl;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
//std::cerr << "MediaPluginExample::receiveMessage: unknown message class: " << message_class << std::endl;
|
||||
};
|
||||
};
|
||||
}
|
||||
else if(event == "up")
|
||||
{
|
||||
}
|
||||
else if(event == "double_click")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// std::cerr << "MediaPluginWebKit::receiveMessage: unknown message class: " << message_class << std::endl;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void MediaPluginExample::write_pixel( int x, int y, unsigned char r, unsigned char g, unsigned char b )
|
||||
{
|
||||
// make sure we don't write outside the buffer
|
||||
if ( ( x < 0 ) || ( x >= mWidth ) || ( y < 0 ) || ( y >= mHeight ) )
|
||||
return;
|
||||
|
||||
if ( mBackgroundPixels != NULL )
|
||||
{
|
||||
unsigned char *pixel = mBackgroundPixels;
|
||||
pixel += y * mWidth * mDepth;
|
||||
pixel += ( x * mDepth );
|
||||
pixel[ 0 ] = b;
|
||||
pixel[ 1 ] = g;
|
||||
pixel[ 2 ] = r;
|
||||
// make sure we don't write outside the buffer
|
||||
if ( ( x < 0 ) || ( x >= mWidth ) || ( y < 0 ) || ( y >= mHeight ) )
|
||||
return;
|
||||
|
||||
setDirty( x, y, x + 1, y + 1 );
|
||||
};
|
||||
if ( mBackgroundPixels != NULL )
|
||||
{
|
||||
unsigned char *pixel = mBackgroundPixels;
|
||||
pixel += y * mWidth * mDepth;
|
||||
pixel += ( x * mDepth );
|
||||
pixel[ 0 ] = b;
|
||||
pixel[ 1 ] = g;
|
||||
pixel[ 2 ] = r;
|
||||
|
||||
setDirty( x, y, x + 1, y + 1 );
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void MediaPluginExample::update( F64 milliseconds )
|
||||
{
|
||||
if ( mWidth < 1 || mWidth > 2048 || mHeight < 1 || mHeight > 2048 )
|
||||
return;
|
||||
if ( mWidth < 1 || mWidth > 2048 || mHeight < 1 || mHeight > 2048 )
|
||||
return;
|
||||
|
||||
if ( mPixels == 0 )
|
||||
return;
|
||||
if ( mPixels == 0 )
|
||||
return;
|
||||
|
||||
if ( mFirstTime )
|
||||
{
|
||||
for( int n = 0; n < ENumObjects; ++n )
|
||||
{
|
||||
mXpos[ n ] = ( mWidth / 2 ) + rand() % ( mWidth / 16 ) - ( mWidth / 32 );
|
||||
mYpos[ n ] = ( mHeight / 2 ) + rand() % ( mHeight / 16 ) - ( mHeight / 32 );
|
||||
if ( mFirstTime )
|
||||
{
|
||||
for( int n = 0; n < ENumObjects; ++n )
|
||||
{
|
||||
mXpos[ n ] = ( mWidth / 2 ) + rand() % ( mWidth / 16 ) - ( mWidth / 32 );
|
||||
mYpos[ n ] = ( mHeight / 2 ) + rand() % ( mHeight / 16 ) - ( mHeight / 32 );
|
||||
|
||||
mColorR[ n ] = rand() % 0x60 + 0x60;
|
||||
mColorG[ n ] = rand() % 0x60 + 0x60;
|
||||
mColorB[ n ] = rand() % 0x60 + 0x60;
|
||||
mColorR[ n ] = rand() % 0x60 + 0x60;
|
||||
mColorG[ n ] = rand() % 0x60 + 0x60;
|
||||
mColorB[ n ] = rand() % 0x60 + 0x60;
|
||||
|
||||
mXInc[ n ] = 0;
|
||||
while ( mXInc[ n ] == 0 )
|
||||
mXInc[ n ] = rand() % 7 - 3;
|
||||
mXInc[ n ] = 0;
|
||||
while ( mXInc[ n ] == 0 )
|
||||
mXInc[ n ] = rand() % 7 - 3;
|
||||
|
||||
mYInc[ n ] = 0;
|
||||
while ( mYInc[ n ] == 0 )
|
||||
mYInc[ n ] = rand() % 9 - 4;
|
||||
mYInc[ n ] = 0;
|
||||
while ( mYInc[ n ] == 0 )
|
||||
mYInc[ n ] = rand() % 9 - 4;
|
||||
|
||||
mBlockSize[ n ] = rand() % 0x30 + 0x10;
|
||||
};
|
||||
mBlockSize[ n ] = rand() % 0x30 + 0x10;
|
||||
};
|
||||
|
||||
delete [] mBackgroundPixels;
|
||||
|
||||
mBackgroundPixels = new unsigned char[ mWidth * mHeight * mDepth ];
|
||||
delete [] mBackgroundPixels;
|
||||
|
||||
mFirstTime = false;
|
||||
};
|
||||
mBackgroundPixels = new unsigned char[ mWidth * mHeight * mDepth ];
|
||||
|
||||
if ( mStopAction )
|
||||
return;
|
||||
mFirstTime = false;
|
||||
};
|
||||
|
||||
if ( time( NULL ) > mLastUpdateTime + 3 )
|
||||
{
|
||||
const int num_squares = rand() % 20 + 4;
|
||||
int sqr1_r = rand() % 0x80 + 0x20;
|
||||
int sqr1_g = rand() % 0x80 + 0x20;
|
||||
int sqr1_b = rand() % 0x80 + 0x20;
|
||||
int sqr2_r = rand() % 0x80 + 0x20;
|
||||
int sqr2_g = rand() % 0x80 + 0x20;
|
||||
int sqr2_b = rand() % 0x80 + 0x20;
|
||||
if ( mStopAction )
|
||||
return;
|
||||
|
||||
for ( int y1 = 0; y1 < num_squares; ++y1 )
|
||||
{
|
||||
for ( int x1 = 0; x1 < num_squares; ++x1 )
|
||||
{
|
||||
int px_start = mWidth * x1 / num_squares;
|
||||
int px_end = ( mWidth * ( x1 + 1 ) ) / num_squares;
|
||||
int py_start = mHeight * y1 / num_squares;
|
||||
int py_end = ( mHeight * ( y1 + 1 ) ) / num_squares;
|
||||
if ( time( NULL ) > mLastUpdateTime + 3 )
|
||||
{
|
||||
const int num_squares = rand() % 20 + 4;
|
||||
int sqr1_r = rand() % 0x80 + 0x20;
|
||||
int sqr1_g = rand() % 0x80 + 0x20;
|
||||
int sqr1_b = rand() % 0x80 + 0x20;
|
||||
int sqr2_r = rand() % 0x80 + 0x20;
|
||||
int sqr2_g = rand() % 0x80 + 0x20;
|
||||
int sqr2_b = rand() % 0x80 + 0x20;
|
||||
|
||||
for( int y2 = py_start; y2 < py_end; ++y2 )
|
||||
{
|
||||
for( int x2 = px_start; x2 < px_end; ++x2 )
|
||||
{
|
||||
int rowspan = mWidth * mDepth;
|
||||
for ( int y1 = 0; y1 < num_squares; ++y1 )
|
||||
{
|
||||
for ( int x1 = 0; x1 < num_squares; ++x1 )
|
||||
{
|
||||
int px_start = mWidth * x1 / num_squares;
|
||||
int px_end = ( mWidth * ( x1 + 1 ) ) / num_squares;
|
||||
int py_start = mHeight * y1 / num_squares;
|
||||
int py_end = ( mHeight * ( y1 + 1 ) ) / num_squares;
|
||||
|
||||
if ( ( y1 % 2 ) ^ ( x1 % 2 ) )
|
||||
{
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 0 ] = sqr1_r;
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 1 ] = sqr1_g;
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 2 ] = sqr1_b;
|
||||
}
|
||||
else
|
||||
{
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 0 ] = sqr2_r;
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 1 ] = sqr2_g;
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 2 ] = sqr2_b;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
for( int y2 = py_start; y2 < py_end; ++y2 )
|
||||
{
|
||||
for( int x2 = px_start; x2 < px_end; ++x2 )
|
||||
{
|
||||
int rowspan = mWidth * mDepth;
|
||||
|
||||
time( &mLastUpdateTime );
|
||||
};
|
||||
if ( ( y1 % 2 ) ^ ( x1 % 2 ) )
|
||||
{
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 0 ] = sqr1_r;
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 1 ] = sqr1_g;
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 2 ] = sqr1_b;
|
||||
}
|
||||
else
|
||||
{
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 0 ] = sqr2_r;
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 1 ] = sqr2_g;
|
||||
mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 2 ] = sqr2_b;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
memcpy( mPixels, mBackgroundPixels, mWidth * mHeight * mDepth );
|
||||
time( &mLastUpdateTime );
|
||||
};
|
||||
|
||||
for( int n = 0; n < ENumObjects; ++n )
|
||||
{
|
||||
if ( rand() % 50 == 0 )
|
||||
{
|
||||
mXInc[ n ] = 0;
|
||||
while ( mXInc[ n ] == 0 )
|
||||
mXInc[ n ] = rand() % 7 - 3;
|
||||
memcpy( mPixels, mBackgroundPixels, mWidth * mHeight * mDepth );
|
||||
|
||||
mYInc[ n ] = 0;
|
||||
while ( mYInc[ n ] == 0 )
|
||||
mYInc[ n ] = rand() % 9 - 4;
|
||||
};
|
||||
for( int n = 0; n < ENumObjects; ++n )
|
||||
{
|
||||
if ( rand() % 50 == 0 )
|
||||
{
|
||||
mXInc[ n ] = 0;
|
||||
while ( mXInc[ n ] == 0 )
|
||||
mXInc[ n ] = rand() % 7 - 3;
|
||||
|
||||
if ( mXpos[ n ] + mXInc[ n ] < 0 || mXpos[ n ] + mXInc[ n ] >= mWidth - mBlockSize[ n ] )
|
||||
mXInc[ n ] =- mXInc[ n ];
|
||||
mYInc[ n ] = 0;
|
||||
while ( mYInc[ n ] == 0 )
|
||||
mYInc[ n ] = rand() % 9 - 4;
|
||||
};
|
||||
|
||||
if ( mYpos[ n ] + mYInc[ n ] < 0 || mYpos[ n ] + mYInc[ n ] >= mHeight - mBlockSize[ n ] )
|
||||
mYInc[ n ] =- mYInc[ n ];
|
||||
if ( mXpos[ n ] + mXInc[ n ] < 0 || mXpos[ n ] + mXInc[ n ] >= mWidth - mBlockSize[ n ] )
|
||||
mXInc[ n ] =- mXInc[ n ];
|
||||
|
||||
mXpos[ n ] += mXInc[ n ];
|
||||
mYpos[ n ] += mYInc[ n ];
|
||||
if ( mYpos[ n ] + mYInc[ n ] < 0 || mYpos[ n ] + mYInc[ n ] >= mHeight - mBlockSize[ n ] )
|
||||
mYInc[ n ] =- mYInc[ n ];
|
||||
|
||||
for( int y = 0; y < mBlockSize[ n ]; ++y )
|
||||
{
|
||||
for( int x = 0; x < mBlockSize[ n ]; ++x )
|
||||
{
|
||||
mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 0 ] = mColorR[ n ];
|
||||
mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 1 ] = mColorG[ n ];
|
||||
mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 2 ] = mColorB[ n ];
|
||||
};
|
||||
};
|
||||
};
|
||||
mXpos[ n ] += mXInc[ n ];
|
||||
mYpos[ n ] += mYInc[ n ];
|
||||
|
||||
setDirty( 0, 0, mWidth, mHeight );
|
||||
for( int y = 0; y < mBlockSize[ n ]; ++y )
|
||||
{
|
||||
for( int x = 0; x < mBlockSize[ n ]; ++x )
|
||||
{
|
||||
mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 0 ] = mColorR[ n ];
|
||||
mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 1 ] = mColorG[ n ];
|
||||
mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 2 ] = mColorB[ n ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
setDirty( 0, 0, mWidth, mHeight );
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
bool MediaPluginExample::init()
|
||||
{
|
||||
LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text" );
|
||||
message.setValue( "name", "Example Plugin" );
|
||||
sendMessage( message );
|
||||
LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text" );
|
||||
message.setValue( "name", "Example Plugin" );
|
||||
sendMessage( message );
|
||||
|
||||
return true;
|
||||
return true;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
int init_media_plugin( LLPluginInstance::sendMessageFunction host_send_func,
|
||||
void* host_user_data,
|
||||
LLPluginInstance::sendMessageFunction *plugin_send_func,
|
||||
void **plugin_user_data )
|
||||
void* host_user_data,
|
||||
LLPluginInstance::sendMessageFunction *plugin_send_func,
|
||||
void **plugin_user_data )
|
||||
{
|
||||
MediaPluginExample* self = new MediaPluginExample( host_send_func, host_user_data );
|
||||
*plugin_send_func = MediaPluginExample::staticReceiveMessage;
|
||||
*plugin_user_data = ( void* )self;
|
||||
MediaPluginExample* self = new MediaPluginExample( host_send_func, host_user_data );
|
||||
*plugin_send_func = MediaPluginExample::staticReceiveMessage;
|
||||
*plugin_user_data = ( void* )self;
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ include_directories(
|
|||
${LLIMAGE_INCLUDE_DIRS}
|
||||
${LLRENDER_INCLUDE_DIRS}
|
||||
${LLWINDOW_INCLUDE_DIRS}
|
||||
${LLQTWEBKIT_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ private:
|
|||
url << std::setfill('0') << std::setw(2) << std::hex << int(mBackgroundB * 255.0f);
|
||||
url << "%22%3E%3C/body%3E%3C/html%3E";
|
||||
|
||||
lldebugs << "data url is: " << url.str() << llendl;
|
||||
//lldebugs << "data url is: " << url.str() << llendl;
|
||||
|
||||
LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, url.str() );
|
||||
// LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" );
|
||||
|
|
@ -407,6 +407,8 @@ private:
|
|||
{
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin");
|
||||
message.setValue("uri", event.getEventUri());
|
||||
message.setValueBoolean("history_back_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK));
|
||||
message.setValueBoolean("history_forward_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD));
|
||||
sendMessage(message);
|
||||
|
||||
setStatus(STATUS_LOADING);
|
||||
|
|
@ -569,6 +571,57 @@ private:
|
|||
return blockingPickFile();
|
||||
}
|
||||
|
||||
std::string mAuthUsername;
|
||||
std::string mAuthPassword;
|
||||
bool mAuthOK;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// virtual
|
||||
bool onAuthRequest(const std::string &in_url, const std::string &in_realm, std::string &out_username, std::string &out_password)
|
||||
{
|
||||
mAuthOK = false;
|
||||
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "auth_request");
|
||||
message.setValue("url", in_url);
|
||||
message.setValue("realm", in_realm);
|
||||
message.setValueBoolean("blocking_request", true);
|
||||
|
||||
// The "blocking_request" key in the message means this sendMessage call will block until a response is received.
|
||||
sendMessage(message);
|
||||
|
||||
if(mAuthOK)
|
||||
{
|
||||
out_username = mAuthUsername;
|
||||
out_password = mAuthPassword;
|
||||
}
|
||||
|
||||
return mAuthOK;
|
||||
}
|
||||
|
||||
void authResponse(LLPluginMessage &message)
|
||||
{
|
||||
mAuthOK = message.getValueBoolean("ok");
|
||||
if(mAuthOK)
|
||||
{
|
||||
mAuthUsername = message.getValue("username");
|
||||
mAuthPassword = message.getValue("password");
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// virtual
|
||||
void onLinkHovered(const EventType& event)
|
||||
{
|
||||
if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE)
|
||||
{
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "link_hovered");
|
||||
message.setValue("link", event.getEventUri());
|
||||
message.setValue("title", event.getStringValue());
|
||||
message.setValue("text", event.getStringValue2());
|
||||
sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
LLQtWebKit::EKeyboardModifier decodeModifiers(std::string &modifiers)
|
||||
{
|
||||
int result = 0;
|
||||
|
|
@ -1096,6 +1149,10 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
|
|||
{
|
||||
onPickFileResponse(message_in.getValue("file"));
|
||||
}
|
||||
if(message_name == "auth_response")
|
||||
{
|
||||
authResponse(message_in);
|
||||
}
|
||||
else
|
||||
{
|
||||
// std::cerr << "MediaPluginWebKit::receiveMessage: unknown media message: " << message_string << std::endl;
|
||||
|
|
@ -1182,6 +1239,22 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
|
|||
mUserAgent = message_in.getValue("user_agent");
|
||||
LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent );
|
||||
}
|
||||
else if(message_name == "ignore_ssl_cert_errors")
|
||||
{
|
||||
#if LLQTWEBKIT_API_VERSION >= 3
|
||||
LLQtWebKit::getInstance()->setIgnoreSSLCertErrors( message_in.getValueBoolean("ignore") );
|
||||
#else
|
||||
llwarns << "Ignoring ignore_ssl_cert_errors message (llqtwebkit version is too old)." << llendl;
|
||||
#endif
|
||||
}
|
||||
else if(message_name == "add_certificate_file_path")
|
||||
{
|
||||
#if LLQTWEBKIT_API_VERSION >= 6
|
||||
LLQtWebKit::getInstance()->addCAFile( message_in.getValue("path") );
|
||||
#else
|
||||
llwarns << "Ignoring add_certificate_file_path message (llqtwebkit version is too old)." << llendl;
|
||||
#endif
|
||||
}
|
||||
else if(message_name == "init_history")
|
||||
{
|
||||
// Initialize browser history
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ include_directories(
|
|||
${LLCHARACTER_INCLUDE_DIRS}
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LLIMAGE_INCLUDE_DIRS}
|
||||
${LLKDU_INCLUDE_DIRS}
|
||||
${LLINVENTORY_INCLUDE_DIRS}
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLMESSAGE_INCLUDE_DIRS}
|
||||
|
|
@ -222,6 +223,7 @@ set(viewer_SOURCE_FILES
|
|||
llfloaterurlentry.cpp
|
||||
llfloatervoiceeffect.cpp
|
||||
llfloaterwater.cpp
|
||||
llfloaterwebcontent.cpp
|
||||
llfloaterwhitelistentry.cpp
|
||||
llfloaterwindlight.cpp
|
||||
llfloaterwindowsize.cpp
|
||||
|
|
@ -403,6 +405,7 @@ set(viewer_SOURCE_FILES
|
|||
llsecapi.cpp
|
||||
llsechandler_basic.cpp
|
||||
llselectmgr.cpp
|
||||
llshareavatarhandler.cpp
|
||||
llsidepanelappearance.cpp
|
||||
llsidepanelinventory.cpp
|
||||
llsidepanelinventorysubpanel.cpp
|
||||
|
|
@ -481,6 +484,7 @@ set(viewer_SOURCE_FILES
|
|||
llvectorperfoptions.cpp
|
||||
llversioninfo.cpp
|
||||
llviewchildren.cpp
|
||||
llviewerassetstats.cpp
|
||||
llviewerassetstorage.cpp
|
||||
llviewerassettype.cpp
|
||||
llviewerattachmenu.cpp
|
||||
|
|
@ -526,6 +530,7 @@ set(viewer_SOURCE_FILES
|
|||
llviewerregion.cpp
|
||||
llviewershadermgr.cpp
|
||||
llviewerstats.cpp
|
||||
llviewerstatsrecorder.cpp
|
||||
llviewertexteditor.cpp
|
||||
llviewertexture.cpp
|
||||
llviewertextureanim.cpp
|
||||
|
|
@ -543,6 +548,7 @@ set(viewer_SOURCE_FILES
|
|||
llvoclouds.cpp
|
||||
llvograss.cpp
|
||||
llvoground.cpp
|
||||
llvoicecallhandler.cpp
|
||||
llvoicechannel.cpp
|
||||
llvoiceclient.cpp
|
||||
llvoicevisualizer.cpp
|
||||
|
|
@ -757,6 +763,7 @@ set(viewer_HEADER_FILES
|
|||
llfloaterurlentry.h
|
||||
llfloatervoiceeffect.h
|
||||
llfloaterwater.h
|
||||
llfloaterwebcontent.h
|
||||
llfloaterwhitelistentry.h
|
||||
llfloaterwindlight.h
|
||||
llfloaterwindowsize.h
|
||||
|
|
@ -1014,6 +1021,7 @@ set(viewer_HEADER_FILES
|
|||
llvectorperfoptions.h
|
||||
llversioninfo.h
|
||||
llviewchildren.h
|
||||
llviewerassetstats.h
|
||||
llviewerassetstorage.h
|
||||
llviewerassettype.h
|
||||
llviewerattachmenu.h
|
||||
|
|
@ -1056,6 +1064,7 @@ set(viewer_HEADER_FILES
|
|||
llviewerregion.h
|
||||
llviewershadermgr.h
|
||||
llviewerstats.h
|
||||
llviewerstatsrecorder.h
|
||||
llviewertexteditor.h
|
||||
llviewertexture.h
|
||||
llviewertextureanim.h
|
||||
|
|
@ -1453,11 +1462,6 @@ if (WINDOWS)
|
|||
# In the meantime, if you have any ideas on how to easily maintain one list, either here or in viewer_manifest.py
|
||||
# and have the build deps get tracked *please* tell me about it.
|
||||
|
||||
if(LLKDU_LIBRARY)
|
||||
# Configure a var for llkdu which may not exist for all builds.
|
||||
set(LLKDU_DLL_SOURCE ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llkdu.dll)
|
||||
endif(LLKDU_LIBRARY)
|
||||
|
||||
if(USE_GOOGLE_PERFTOOLS)
|
||||
# Configure a var for tcmalloc location, if used.
|
||||
# Note the need to specify multiple names explicitly.
|
||||
|
|
@ -1474,7 +1478,6 @@ if (WINDOWS)
|
|||
#${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libtcmalloc_minimal.dll => None ... Skipping libtcmalloc_minimal.dll
|
||||
${CMAKE_SOURCE_DIR}/../etc/message.xml
|
||||
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
|
||||
${LLKDU_DLL_SOURCE}
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llcommon.dll
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapr-1.dll
|
||||
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libaprutil-1.dll
|
||||
|
|
@ -1660,7 +1663,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
|||
${LLAUDIO_LIBRARIES}
|
||||
${LLCHARACTER_LIBRARIES}
|
||||
${LLIMAGE_LIBRARIES}
|
||||
${LLIMAGEJ2COJ_LIBRARIES}
|
||||
${LLINVENTORY_LIBRARIES}
|
||||
${LLMESSAGE_LIBRARIES}
|
||||
${LLPLUGIN_LIBRARIES}
|
||||
|
|
@ -1696,6 +1698,17 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
|||
${GOOGLE_PERFTOOLS_LIBRARIES}
|
||||
)
|
||||
|
||||
if (USE_KDU)
|
||||
target_link_libraries(${VIEWER_BINARY_NAME}
|
||||
${LLKDU_LIBRARIES}
|
||||
${KDU_LIBRARY}
|
||||
)
|
||||
else (USE_KDU)
|
||||
target_link_libraries(${VIEWER_BINARY_NAME}
|
||||
${LLIMAGEJ2COJ_LIBRARIES}
|
||||
)
|
||||
endif (USE_KDU)
|
||||
|
||||
build_version(viewer)
|
||||
|
||||
set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH
|
||||
|
|
@ -1843,6 +1856,7 @@ if (PACKAGE)
|
|||
set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest)
|
||||
endif (LINUX)
|
||||
|
||||
if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING)
|
||||
if(CMAKE_CFG_INTDIR STREQUAL ".")
|
||||
set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE})
|
||||
else(CMAKE_CFG_INTDIR STREQUAL ".")
|
||||
|
|
@ -1861,11 +1875,12 @@ if (PACKAGE)
|
|||
"${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/bin/dump_syms"
|
||||
"${VIEWER_SYMBOL_FILE}"
|
||||
DEPENDS generate_breakpad_symbols.py
|
||||
VERBATIM
|
||||
)
|
||||
VERBATIM)
|
||||
|
||||
add_custom_target(generate_breakpad_symbols DEPENDS "${VIEWER_SYMBOL_FILE}")
|
||||
add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}")
|
||||
add_dependencies(package generate_breakpad_symbols)
|
||||
endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING)
|
||||
endif (PACKAGE)
|
||||
|
||||
if (LL_TESTS)
|
||||
|
|
@ -1880,6 +1895,8 @@ if (LL_TESTS)
|
|||
llremoteparcelrequest.cpp
|
||||
llviewerhelputil.cpp
|
||||
llversioninfo.cpp
|
||||
llworldmap.cpp
|
||||
llworldmipmap.cpp
|
||||
)
|
||||
|
||||
##################################################
|
||||
|
|
@ -1955,10 +1972,18 @@ if (LL_TESTS)
|
|||
"${test_libs}"
|
||||
)
|
||||
|
||||
LL_ADD_INTEGRATION_TEST(llsimplestat
|
||||
""
|
||||
"${test_libs}"
|
||||
)
|
||||
|
||||
LL_ADD_INTEGRATION_TEST(llviewerassetstats
|
||||
llviewerassetstats.cpp
|
||||
"${test_libs}"
|
||||
)
|
||||
|
||||
#ADD_VIEWER_BUILD_TEST(llmemoryview viewer)
|
||||
#ADD_VIEWER_BUILD_TEST(llagentaccess viewer)
|
||||
#ADD_VIEWER_BUILD_TEST(llworldmap viewer)
|
||||
#ADD_VIEWER_BUILD_TEST(llworldmipmap viewer)
|
||||
#ADD_VIEWER_BUILD_TEST(lltextureinfo viewer)
|
||||
#ADD_VIEWER_BUILD_TEST(lltextureinfodetails viewer)
|
||||
#ADD_VIEWER_BUILD_TEST(lltexturestatsuploader viewer)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIEUDCCA7mgAwIBAgIJAN4ppNGwj6yIMA0GCSqGSIb3DQEBBAUAMIHMMQswCQYD
|
||||
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5j
|
||||
aXNjbzEZMBcGA1UEChMQTGluZGVuIExhYiwgSW5jLjEpMCcGA1UECxMgTGluZGVu
|
||||
IExhYiBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxKTAnBgNVBAMTIExpbmRlbiBMYWIg
|
||||
Q2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYJKoZIhvcNAQkBFhBjYUBsaW5kZW5s
|
||||
YWIuY29tMB4XDTA1MDQyMTAyNDAzMVoXDTI1MDQxNjAyNDAzMVowgcwxCzAJBgNV
|
||||
BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp
|
||||
c2NvMRkwFwYDVQQKExBMaW5kZW4gTGFiLCBJbmMuMSkwJwYDVQQLEyBMaW5kZW4g
|
||||
TGFiIENlcnRpZmljYXRlIEF1dGhvcml0eTEpMCcGA1UEAxMgTGluZGVuIExhYiBD
|
||||
ZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgkqhkiG9w0BCQEWEGNhQGxpbmRlbmxh
|
||||
Yi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKXh1MThucdTbMg9bYBO
|
||||
rAm8yWns32YojB0PRfbq8rUjepEhTm3/13s0u399Uc202v4ejcGhkIDWJZd2NZMF
|
||||
oKrhmRfxGHSKPCuFaXC3jh0lRECj7k8FoPkcmaPjSyodrDFDUUuv+C06oYJoI+rk
|
||||
8REyal9NwgHvqCzOrZtiTXAdAgMBAAGjggE2MIIBMjAdBgNVHQ4EFgQUO1zK2e1f
|
||||
1wO1fHAjq6DTJobKDrcwggEBBgNVHSMEgfkwgfaAFDtcytntX9cDtXxwI6ug0yaG
|
||||
yg63oYHSpIHPMIHMMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEW
|
||||
MBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQTGluZGVuIExhYiwgSW5j
|
||||
LjEpMCcGA1UECxMgTGluZGVuIExhYiBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxKTAn
|
||||
BgNVBAMTIExpbmRlbiBMYWIgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYJKoZI
|
||||
hvcNAQkBFhBjYUBsaW5kZW5sYWIuY29tggkA3imk0bCPrIgwDAYDVR0TBAUwAwEB
|
||||
/zANBgkqhkiG9w0BAQQFAAOBgQA/ZkgfvwHYqk1UIAKZS3kMCxz0HvYuEQtviwnu
|
||||
xA39CIJ65Zozs28Eg1aV9/Y+Of7TnWhW+U3J3/wD/GghaAGiKK6vMn9gJBIdBX/9
|
||||
e6ef37VGyiOEFFjnUIbuk0RWty0orN76q/lI/xjCi15XSA/VSq2j4vmnwfZcPTDu
|
||||
glmQ1A==
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEkDCCA3igAwIBAgICTSUwDQYJKoZIhvcNAQEFBQAwQDELMAkGA1UEBhMCVVMx
|
||||
FzAVBgNVBAoTDkdlb1RydXN0LCBJbmMuMRgwFgYDVQQDEw9HZW9UcnVzdCBTU0wg
|
||||
Q0EwHhcNMTAxMjIwMTkxMTI2WhcNMTIwMjIxMTI1NDAzWjCBnzEpMCcGA1UEBRMg
|
||||
UkMteW9jbXIwdXRmRTdOMVBlaHJHQXdqL0lNc2hJZS0xCzAJBgNVBAYTAlVTMRMw
|
||||
EQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMR0wGwYD
|
||||
VQQKExRMaW5kZW4gUmVzZWFyY2ggSW5jLjEZMBcGA1UEAwwQKi5zZWNvbmRsaWZl
|
||||
LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN/VCCu1SZ5x4vNp
|
||||
XZZ8r3lzqeLwjxVZfMSQCKM4lV5DFbqiZMMBto4Y/ib7i0audzuTDnImCLsfzlTu
|
||||
7iZLoJNy42/43Rq4xtaDZ7joxALFmzXUKEipgHiTTbAbLQNCS4wPXts3tScODVZY
|
||||
/mhlmXdlLuGxJbqoyOEP6NEQbgXWDCKDERnAEG/FJBVHKyBfg3abrrIuQNwYCKCS
|
||||
2OZ5Z5MveGmY4tSKUOOi/c0vV9HsanQn/ymybZjxR5Kmb1CvQr7VVtbpR1MhlGkc
|
||||
sfJz1NFIFxdXkUggIny+XSG1dAAJRFFumyRM+X/eh0NHNmAI14JJ43hB6Zw3dzzl
|
||||
An9BSeECAwEAAaOCATIwggEuMB8GA1UdIwQYMBaAFEJ5VBthzVUrPmPVPEhX9Z/7
|
||||
Rc5KMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUH
|
||||
AwIwKwYDVR0RBCQwIoIQKi5zZWNvbmRsaWZlLmNvbYIOc2Vjb25kbGlmZS5jb20w
|
||||
PQYDVR0fBDYwNDAyoDCgLoYsaHR0cDovL2d0c3NsLWNybC5nZW90cnVzdC5jb20v
|
||||
Y3Jscy9ndHNzbC5jcmwwHQYDVR0OBBYEFK9UTMkc4Fh/Ug4fVs6UVhxP6my0MAwG
|
||||
A1UdEwEB/wQCMAAwQwYIKwYBBQUHAQEENzA1MDMGCCsGAQUFBzAChidodHRwOi8v
|
||||
Z3Rzc2wtYWlhLmdlb3RydXN0LmNvbS9ndHNzbC5jcnQwDQYJKoZIhvcNAQEFBQAD
|
||||
ggEBACIR9yggGHDcZ60AMNdFmZ8XJeahTuv6q2X/It2JxqSQp5BVQUei0NGIYYOt
|
||||
yg0JFBZn5KqXiQ5Zz84K4hdvh/6grCEAn4v37sozSbkeZ92Lec8NOZR42HfYIOCo
|
||||
Hx9q7CNRxdhv6ehV4LekaRBxrtp5etVsIDaWvRZEswCWl46VuLrfjcpauj6DAdOQ
|
||||
FfPVAW+4nPgLr8KapZMnXYnabIwrj9DQLQ88w/D7durenu/SYJEahWW9mb++n9is
|
||||
eMjyuyzYW0PTUBTaDsj+2ZmHJtoR1tBiLqh0Q62UQnmDgsf5SK5PTb8jnta/1SvN
|
||||
3pirsuvjMPV19zuH6b9NpJfXfd0=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDfTCCAuagAwIBAgIDErvmMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT
|
||||
MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0
|
||||
aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDIwNTIxMDQwMDAwWhcNMTgwODIxMDQwMDAw
|
||||
WjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UE
|
||||
AxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
|
||||
CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9m
|
||||
OSm9BXiLnTjoBbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIu
|
||||
T8rxh0PBFpVXLVDviS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6c
|
||||
JmTM386DGXHKTubU1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmR
|
||||
Cw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5asz
|
||||
PeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo4HwMIHtMB8GA1UdIwQYMBaAFEjm
|
||||
aPkr0rKV10fYIyAQTzOYkJ/UMB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrM
|
||||
TjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjA6BgNVHR8EMzAxMC+g
|
||||
LaArhilodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9jcmxzL3NlY3VyZWNhLmNybDBO
|
||||
BgNVHSAERzBFMEMGBFUdIAAwOzA5BggrBgEFBQcCARYtaHR0cHM6Ly93d3cuZ2Vv
|
||||
dHJ1c3QuY29tL3Jlc291cmNlcy9yZXBvc2l0b3J5MA0GCSqGSIb3DQEBBQUAA4GB
|
||||
AHbhEm5OSxYShjAGsoEIz/AIx8dxfmbuwu3UOx//8PDITtZDOLC5MH0Y0FWDomrL
|
||||
NhGc6Ehmo21/uBPUR/6LWlxz/K7ZGzIZOKuXNBSqltLroxwUCEm2u+WR74M26x1W
|
||||
b8ravHNjkOR/ez4iyz0H7V84dJzjA1BOoa+Y7mHyhD8S
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID2TCCAsGgAwIBAgIDAjbQMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT
|
||||
MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
|
||||
YWwgQ0EwHhcNMTAwMjE5MjIzOTI2WhcNMjAwMjE4MjIzOTI2WjBAMQswCQYDVQQG
|
||||
EwJVUzEXMBUGA1UEChMOR2VvVHJ1c3QsIEluYy4xGDAWBgNVBAMTD0dlb1RydXN0
|
||||
IFNTTCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJCzgMHk5Uat
|
||||
cGA9uuUU3Z6KXot1WubKbUGlI+g5hSZ6p1V3mkihkn46HhrxJ6ujTDnMyz1Hr4Gu
|
||||
FmpcN+9FQf37mpc8oEOdxt8XIdGKolbCA0mEEoE+yQpUYGa5jFTk+eb5lPHgX3UR
|
||||
8im55IaisYmtph6DKWOy8FQchQt65+EuDa+kvc3nsVrXjAVaDktzKIt1XTTYdwvh
|
||||
dGLicTBi2LyKBeUxY0pUiWozeKdOVSQdl+8a5BLGDzAYtDRN4dgjOyFbLTAZJQ50
|
||||
96QhS6CkIMlszZhWwPKoXz4mdaAN+DaIiixafWcwqQ/RmXAueOFRJq9VeiS+jDkN
|
||||
d53eAsMMvR8CAwEAAaOB2TCB1jAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFEJ5
|
||||
VBthzVUrPmPVPEhX9Z/7Rc5KMB8GA1UdIwQYMBaAFMB6mGiNifurBWQMEX2qfWW4
|
||||
ysxOMBIGA1UdEwEB/wQIMAYBAf8CAQAwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDov
|
||||
L2NybC5nZW90cnVzdC5jb20vY3Jscy9ndGdsb2JhbC5jcmwwNAYIKwYBBQUHAQEE
|
||||
KDAmMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5nZW90cnVzdC5jb20wDQYJKoZI
|
||||
hvcNAQEFBQADggEBANTvU4ToGr2hiwTAqfVfoRB4RV2yV2pOJMtlTjGXkZrUJPji
|
||||
J2ZwMZzBYlQG55cdOprApClICq8kx6jEmlTBfEx4TCtoLF0XplR4TEbigMMfOHES
|
||||
0tdT41SFULgCy+5jOvhWiU1Vuy7AyBh3hjELC3DwfjWDpCoTZFZnNF0WX3OsewYk
|
||||
2k9QbSqr0E1TQcKOu3EDSSmGGM8hQkx0YlEVxW+o78Qn5Rsz3VqI138S0adhJR/V
|
||||
4NwdzxoQ2KDLX4z6DOW/cf/lXUQdpj6HR/oaToODEj+IZpWYeZqF6wJHzSXj8gYE
|
||||
TpnKXKBuervdo5AaRTPvvz7SBMS24CqFZUE+ENQ=
|
||||
-----END CERTIFICATE-----
|
||||
|
|
@ -686,6 +686,39 @@
|
|||
<key>Value</key>
|
||||
<string>http://www.secondlife.com</string>
|
||||
</map>
|
||||
<key>BrowserIgnoreSSLCertErrors</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>FOR TESTING ONLY: Tell the built-in web browser to ignore SSL cert errors.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>BrowserUseDefaultCAFile</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Tell the built-in web browser to use the CA.pem file shipped with the client.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>BrowserCAFilePath</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Tell the built-in web browser the path to an alternative CA.pem file (only used if BrowserUseDefaultCAFile is false).</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>BlockAvatarAppearanceMessages</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -3844,6 +3877,17 @@
|
|||
<key>Value</key>
|
||||
<string>http://search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD]</string>
|
||||
</map>
|
||||
<key>WebProfileURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>URL for Web Profiles</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>https://my.secondlife.com/[AGENT_NAME]</string>
|
||||
</map>
|
||||
<key>HighResSnapshot</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -4692,6 +4736,17 @@
|
|||
<key>Value</key>
|
||||
<string>http://map.secondlife.com.s3.amazonaws.com/</string>
|
||||
</map>
|
||||
<key>CurrentMapServerURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Current Session World map URL</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>MapShowEvents</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -6506,7 +6561,18 @@
|
|||
<key>MediaBrowserWindowLimit</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Maximum number of media brower windows that can be open at once (0 for no limit)</string>
|
||||
<string>Maximum number of media brower windows that can be open at once in the media browser floater (0 for no limit)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>5</integer>
|
||||
</map>
|
||||
<key>WebContentWindowLimit</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Maximum number of web brower windows that can be open at once in the Web content floater (0 for no limit)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
|
|
@ -9914,6 +9980,17 @@
|
|||
<key>Value</key>
|
||||
<real>500.0</real>
|
||||
</map>
|
||||
<key>UpdaterMaximumBandwidth</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Maximum allowable downstream bandwidth for updater service (kilo bits per second)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>500.0</real>
|
||||
</map>
|
||||
<key>ToolTipDelay</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -11014,16 +11091,16 @@
|
|||
<key>Value</key>
|
||||
<integer>15</integer>
|
||||
</map>
|
||||
<key>UpdaterServiceActive</key>
|
||||
<key>UpdaterServiceSetting</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Enable or disable the updater service.</string>
|
||||
<string>Configure updater service.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
<integer>3</integer>
|
||||
</map>
|
||||
<key>UpdaterServiceCheckPeriod</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -160,6 +160,17 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>ShowFavoritesOnLogin</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Determines whether favorites of last logged in user will be saved on exit from viewer and shown on login screen</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<!-- End of back compatibility settings -->
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ RenderFlexTimeFactor 1 1.0
|
|||
RenderGlowResolutionPow 1 9
|
||||
RenderMaxPartCount 1 4096
|
||||
RenderObjectBump 1 1
|
||||
RenderReflectionDetail 1 2
|
||||
RenderReflectionDetail 1 0
|
||||
RenderTerrainDetail 1 1
|
||||
RenderTerrainLODFactor 1 2.0
|
||||
RenderTransparentWater 1 1
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue