Merge viewer-release and become version 3.7.12

master
simon 2014-07-07 14:49:45 -07:00
commit 3e6698073c
154 changed files with 22941 additions and 1763 deletions

View File

@ -483,3 +483,4 @@ d029faf69f20a23007f32420a1ac6a3b89a6d441 3.7.6-release
bba9b3722eea08949e4ff69591f736bf0f808434 3.7.8-release
a9f2d0cb11f73b06858e6083bb50083becc3f9cd 3.7.9-release
91dae9494b4d147541c7a01902334ba19a7ec05e 3.7.10-release
64799eb298834073a3e9992cd8d27c3cb9d30b10 3.7.11-release

View File

@ -55,21 +55,9 @@ Amazon_viewer_channel_suffix = "Amazon"
Desura_sourceid = "1208_desura"
Desura_viewer_channel_suffix = "Desura"
# Report changes since...
viewer-development.show_changes_since = last_sprint
# Build Settings
viewer-development.build_debug_release_separately = true
# Notifications - to configure email notices, add a setting like this:
# <username>_<reponame>.email = <email-address>
viewer-release.viewer_channel = "Second Life Release"
viewer-release.build_debug_release_separately = true
viewer-release.build_viewer_update_version_manager = true
viewer-release.codeticket_add_context = false
# ========================================
# mesh-development
# ========================================
@ -121,25 +109,6 @@ viewer-mesh.viewer_channel = "Project Viewer - Mesh"
viewer-mesh.viewer_grid = aditi
viewer-mesh.email = shining@lists.lindenlab.com
# ========================================
# viewer-pathfinding
# ========================================
viewer-pathfinding.viewer_channel = "Project Viewer - Pathfinding"
viewer-pathfinding.viewer_grid = agni
viewer-pathfinding.build_debug_release_separately = true
viewer-pathfinding.build_CYGWIN_Debug = false
viewer-pathfinding.build_viewer_update_version_manager = false
# ========================================
# viewer-materials
# ========================================
viewer-materials.viewer_channel = "Second Life Beta Materials"
viewer-materials.build_debug_release_separately = true
viewer-materials.build_CYGWIN_Debug = false
viewer-materials.build_viewer_update_version_manager = false
# =================================================================
# asset delivery 2010 projects
# =================================================================

View File

@ -1251,14 +1251,14 @@
</map>
</map>
</map>
<key>libxml</key>
<key>libxml2</key>
<map>
<key>license</key>
<string>mit</string>
<key>license_file</key>
<string>LICENSES/libxml.txt</string>
<string>LICENSES/libxml2.txt</string>
<key>name</key>
<string>libxml</string>
<string>libxml2</string>
<key>platforms</key>
<map>
<key>linux</key>
@ -1266,9 +1266,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>6414642528f42dac1cd9a012c99cd748</string>
<string>fd34e3e818ad7dd26add1f05e6069c11</string>
<key>url</key>
<string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libxml-2.6.24-linux-20101013.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-libxml/rev/282218/arch/Linux/installer/libxml2-2.7.8-linux-20131009.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@ -2321,7 +2321,7 @@
<string>make</string>
<key>options</key>
<array>
<string>-j 2</string>
<string>-j 7</string>
</array>
</map>
<key>configure</key>
@ -2371,7 +2371,7 @@
<string>make</string>
<key>options</key>
<array>
<string>-j 2</string>
<string>-j 7</string>
</array>
</map>
<key>configure</key>
@ -2419,7 +2419,7 @@
<string>make</string>
<key>options</key>
<array>
<string>-j 2</string>
<string>-j 7</string>
</array>
</map>
<key>configure</key>

View File

@ -180,6 +180,8 @@ Ansariel Hiller
MAINT-2368
STORM-1931
MAINT-2773
STORM-2011
MAINT-3187
BUG-3764
STORM-1984
STORM-1979
@ -313,11 +315,14 @@ Cinder Roxley
BUG-3863
OPEN-185
STORM-1703
STORM-1948
STORM-1948
STORM-1831
STORM-1888
STORM-1958
STORM-1952
STORM-1951
STORM-2035
STORM-2036
Clara Young
Coaldust Numbers
VWR-1095
@ -330,6 +335,9 @@ Cron Stardust
VWR-25120
STORM-1075
STORM-1919
STORM-1920
OPEN-209
STORM-2017
Cypren Christenson
STORM-417
Dante Tucker
@ -519,8 +527,16 @@ Ima Mechanique
STORM-959
STORM-1175
STORM-1708
STORM-1831
STORM-1832
STORM-1855
VWR-10791
VWR-20553
VWR-19213
VWR-22401
VWR-23739
VWR-24766
VWR-28065
Imnotgoing Sideways
Inma Rau
Innula Zenovka
@ -663,6 +679,7 @@ Jonathan Yap
STORM-1809
STORM-1793
STORM-1810
STORM-68
STORM-1838
STORM-1892
STORM-1894
@ -673,12 +690,15 @@ Jonathan Yap
STORM-1858
STORM-1862
STORM-1918
STORM-1915
STORM-1929
STORM-1953
OPEN-161
STORM-1953
STORM-1957
STORM-1993
STORM-2017
STORM-2007
STORM-1980
OPEN-113
STORM-1975
@ -691,6 +711,8 @@ Jonathan Yap
STORM-1987
STORM-1986
STORM-1981
STORM-2015
STORM-2018
Kadah Coba
STORM-1060
STORM-1843
@ -744,6 +766,7 @@ Kunnis Basiat
Lance Corrimal
STORM-1910
VWR-25269
STORM-2008
Latif Khalifa
VWR-5370
leliel Mirihi
@ -960,6 +983,7 @@ Nicky Dasmijn
OPEN-187
STORM-1937
OPEN-187
STORM-2010
Nicky Perian
OPEN-1
STORM-1087
@ -1157,6 +1181,7 @@ snowy Sidran
Sovereign Engineer
MAINT-2334
OPEN-189
STORM-1972
OPEN-195
SpacedOut Frye
VWR-34
@ -1198,6 +1223,7 @@ Takeda Terrawyng
TankMaster Finesmith
OPEN-140
OPEN-142
OPEN-154
STORM-1100
STORM-1258
STORM-1602
@ -1417,7 +1443,3 @@ Zipherius Turas
VWR-77
Zoex Flanagan

View File

@ -174,12 +174,12 @@ if (LINUX)
endif (WORD_SIZE EQUAL 32)
add_definitions(-mfpmath=sse)
#add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
# this stops us requiring a really recent glibc at runtime
add_definitions(-fno-stack-protector)
# linking can be very memory-hungry, especially the final viewer link
set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory")
endif (NOT STANDALONE)
endif (NOT USESYSTEMLIBS)
set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}")
@ -226,14 +226,14 @@ if (LINUX OR DARWIN)
endif (LINUX OR DARWIN)
if (STANDALONE)
add_definitions(-DLL_STANDALONE=1)
if (USESYSTEMLIBS)
add_definitions(-DLL_USESYSTEMLIBS=1)
if (LINUX AND ${ARCH} STREQUAL "i686")
add_definitions(-march=pentiumpro)
endif (LINUX AND ${ARCH} STREQUAL "i686")
else (STANDALONE)
else (USESYSTEMLIBS)
set(${ARCH}_linux_INCLUDES
ELFIO
atk-1.0
@ -242,6 +242,6 @@ else (STANDALONE)
gtk-2.0
pango-1.0
)
endif (STANDALONE)
endif (USESYSTEMLIBS)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@ -8,9 +8,9 @@ set(APR_FIND_REQUIRED ON)
set(APRUTIL_FIND_QUIETLY ON)
set(APRUTIL_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindAPR)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(apr_suite)
if (WINDOWS)
if (LLCOMMON_LINK_SHARED)
@ -52,4 +52,4 @@ else (STANDALONE)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} uuid)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} rt)
endif (LINUX)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -1,13 +1,13 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(OGG REQUIRED ogg)
pkg_check_modules(VORBIS REQUIRED vorbis)
pkg_check_modules(VORBISENC REQUIRED vorbisenc)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(ogg-vorbis)
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
@ -32,7 +32,7 @@ else (STANDALONE)
set(VORBISENC_LIBRARIES vorbisenc)
set(VORBISFILE_LIBRARIES vorbisfile)
endif (WINDOWS)
endif (STANDALONE)
endif (USESYSTEMLIBS)
link_directories(
${VORBIS_LIBRARY_DIRS}

View File

@ -3,9 +3,9 @@
set(DB_FIND_QUIETLY ON)
set(DB_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindBerkeleyDB)
else (STANDALONE)
else (USESYSTEMLIBS)
if (LINUX)
# Need to add dependency pthread explicitely to support ld.gold.
use_prebuilt_binary(db)
@ -14,4 +14,4 @@ else (STANDALONE)
set(DB_LIBRARIES db-4.2)
endif (LINUX)
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -4,7 +4,7 @@ include(Prebuilt)
set(Boost_FIND_QUIETLY ON)
set(Boost_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindBoost)
set(BOOST_CONTEXT_LIBRARY boost_context-mt)
@ -14,7 +14,7 @@ if (STANDALONE)
set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
set(BOOST_THREAD_LIBRARY boost_thread-mt)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(boost)
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(BOOST_VERSION "1.52")
@ -111,4 +111,4 @@ else (STANDALONE)
optimized boost_thread-mt
debug boost_thread-mt-d)
endif (WINDOWS)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -5,9 +5,9 @@ include(Prebuilt)
set(CARES_FIND_QUIETLY ON)
set(CARES_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindCARes)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(ares)
add_definitions("-DCARES_STATICLIB")
if (WINDOWS)
@ -18,4 +18,4 @@ else (STANDALONE)
set(CARES_LIBRARIES cares)
endif (WINDOWS)
set(CARES_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/ares)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(CURL_FIND_QUIETLY ON)
set(CURL_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindCURL)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(curl)
if (WINDOWS)
set(CURL_LIBRARIES
@ -16,4 +16,4 @@ else (STANDALONE)
set(CURL_LIBRARIES libcurl.a)
endif (WINDOWS)
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -374,9 +374,9 @@ copy_if_different(
)
set(third_party_targets ${third_party_targets} ${out_targets})
if(NOT STANDALONE)
if(NOT USESYSTEMLIBS)
add_custom_target(
stage_third_party_libs ALL
DEPENDS ${third_party_targets}
)
endif(NOT STANDALONE)
endif(NOT USESYSTEMLIBS)

View File

@ -1,7 +1,7 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
@ -18,7 +18,7 @@ elseif (LINUX)
gobject-2.0
glib-2.0
)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (DBUSGLIB_FOUND)
set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.")

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(EXPAT_FIND_QUIETLY ON)
set(EXPAT_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindEXPAT)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(expat)
if (WINDOWS)
set(EXPAT_LIBRARIES libexpatMT)
@ -14,4 +14,4 @@ else (STANDALONE)
set(EXPAT_LIBRARIES expat)
endif (WINDOWS)
set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -2,13 +2,13 @@
include(Linking)
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
set(EXAMPLEPLUGIN OFF CACHE BOOL
"EXAMPLEPLUGIN support for the llplugin/llmedia test apps.")
else (STANDALONE)
else (USESYSTEMLIBS)
set(EXAMPLEPLUGIN ON CACHE BOOL
"EXAMPLEPLUGIN support for the llplugin/llmedia test apps.")
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (WINDOWS)
elseif (DARWIN)

View File

@ -4,17 +4,17 @@
# When building using proprietary binaries though (i.e. having access to LL private servers),
# we always build with FMODEX.
# Open source devs should use the -DFMODEX:BOOL=ON then if they want to build with FMOD, whether
# they are using STANDALONE or not.
# they are using USESYSTEMLIBS or not.
if (INSTALL_PROPRIETARY)
set(FMODEX ON CACHE BOOL "Using FMOD Ex sound library.")
endif (INSTALL_PROPRIETARY)
if (FMODEX)
if (STANDALONE)
if (USESYSTEMLIBS)
# In that case, we use the version of the library installed on the system
set(FMODEX_FIND_REQUIRED ON)
include(FindFMODEX)
else (STANDALONE)
else (USESYSTEMLIBS)
if (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
# If the path have been specified in the arguments, use that
set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
@ -41,6 +41,6 @@ if (FMODEX)
set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodex)
endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
endif (STANDALONE)
endif (USESYSTEMLIBS)
endif (FMODEX)

View File

@ -23,10 +23,10 @@ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
# 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)
IF (USESYSTEMLIBS)
# On standalone, assume that the system installed library was compiled with the used compiler.
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so)
ENDIF (STANDALONE)
ENDIF (USESYSTEMLIBS)
FIND_LIBRARY(JSONCPP_LIBRARY
NAMES ${JSONCPP_NAMES}
PATHS /usr/lib /usr/local/lib

View File

@ -1,14 +1,14 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(FREETYPE REQUIRED freetype2)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(freetype)
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(FREETYPE_LIBRARIES freetype)
endif (STANDALONE)
endif (USESYSTEMLIBS)
link_directories(${FREETYPE_LIBRARY_DIRS})

View File

@ -1,8 +1,8 @@
# -*- cmake -*-
include(Prebuilt)
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
use_prebuilt_binary(glext)
use_prebuilt_binary(glh_linear)
set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
endif (NOT STANDALONE)
endif (NOT USESYSTEMLIBS)

View File

@ -4,8 +4,8 @@ include(Prebuilt)
set(GLH_FIND_REQUIRED TRUE)
set(GLH_FIND_QUIETLY TRUE)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindGLH)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(glh_linear)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -1,9 +1,9 @@
# -*- cmake -*-
include(Prebuilt)
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
use_prebuilt_binary(GLOD)
endif (NOT STANDALONE)
endif (NOT USESYSTEMLIBS)
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
set(GLOD_LIBRARIES GLOD)

View File

@ -1,15 +1,15 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(GSTREAMER010 REQUIRED gstreamer-0.10)
pkg_check_modules(GSTREAMER010_PLUGINS_BASE REQUIRED gstreamer-plugins-base-0.10)
elseif (LINUX)
use_prebuilt_binary(gstreamer)
# possible libxml should have its own .cmake file instead
use_prebuilt_binary(libxml)
# possible libxml2 should have its own .cmake file instead
use_prebuilt_binary(libxml2)
set(GSTREAMER010_FOUND ON FORCE BOOL)
set(GSTREAMER010_PLUGINS_BASE_FOUND ON FORCE BOOL)
set(GSTREAMER010_INCLUDE_DIRS
@ -26,7 +26,7 @@ elseif (LINUX)
gthread-2.0
glib-2.0
)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (GSTREAMER010_FOUND AND GSTREAMER010_PLUGINS_BASE_FOUND)
set(GSTREAMER010 ON CACHE BOOL "Build with GStreamer-0.10 streaming media support.")

View File

@ -2,14 +2,14 @@
include(Linking)
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
set(GLUI OFF CACHE BOOL
"GLUI support for the llplugin/llmedia test apps.")
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(glui)
set(GLUI ON CACHE BOOL
"GLUI support for the llplugin/llmedia test apps.")
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (LINUX)
set(GLUI ON CACHE BOOL

View File

@ -1,10 +1,10 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)
include(FindGoogleBreakpad)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(google_breakpad)
if (DARWIN)
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler)
@ -18,5 +18,5 @@ else (STANDALONE)
# yes, this does look dumb, no, it's not incorrect
#
set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/include/google_breakpad/google_breakpad")
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -5,9 +5,9 @@ include(Prebuilt)
# set ON or OFF as desired.
set (USE_TCMALLOC OFF)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindGooglePerfTools)
else (STANDALONE)
else (USESYSTEMLIBS)
if (WINDOWS)
if (USE_TCMALLOC)
use_prebuilt_binary(gperftools)
@ -34,7 +34,7 @@ else (STANDALONE)
${LIBS_PREBUILT_DIR}/include)
set(GOOGLE_PERFTOOLS_FOUND "YES")
endif (LINUX)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (GOOGLE_PERFTOOLS_FOUND)
# XXX Disable temporarily, until we have compilation issues on 64-bit

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(HUNSPELL_FIND_QUIETLY ON)
set(HUNSPELL_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindHUNSPELL)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(libhunspell)
if (WINDOWS)
set(HUNSPELL_LIBRARY libhunspell)
@ -19,4 +19,4 @@ else (STANDALONE)
endif()
set(HUNSPELL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/hunspell)
use_prebuilt_binary(dictionaries)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -5,9 +5,9 @@ include(Linking)
set(JPEG_FIND_QUIETLY ON)
set(JPEG_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindJPEG)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(jpeglib)
if (LINUX)
set(JPEG_LIBRARIES jpeg)
@ -17,4 +17,4 @@ else (STANDALONE)
set(JPEG_LIBRARIES jpeglib)
endif (LINUX)
set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -5,9 +5,9 @@ include(Prebuilt)
set(JSONCPP_FIND_QUIETLY ON)
set(JSONCPP_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindJsonCpp)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(jsoncpp)
if (WINDOWS)
set(JSONCPP_LIBRARIES
@ -19,4 +19,4 @@ else (STANDALONE)
set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
endif (WINDOWS)
set(JSONCPP_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json")
endif (STANDALONE)
endif (USESYSTEMLIBS)

10
indra/cmake/LLAddBuildTest.cmake Executable file → Normal file
View File

@ -202,9 +202,9 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
if(STANDALONE)
if(USESYSTEMLIBS)
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}")
endif(STANDALONE)
endif(USESYSTEMLIBS)
# The following was copied to llcorehttp/CMakeLists.txt's texture_load target.
# Any changes made here should be replicated there.
@ -275,10 +275,10 @@ MACRO(SET_TEST_PATH LISTVAR)
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)
IF (USESYSTEMLIBS)
set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
ELSE (STANDALONE)
ELSE (USESYSTEMLIBS)
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
ENDIF (STANDALONE)
ENDIF (USESYSTEMLIBS)
ENDIF(WINDOWS)
ENDMACRO(SET_TEST_PATH)

View File

@ -6,21 +6,30 @@ include(Boost)
use_prebuilt_binary(colladadom)
use_prebuilt_binary(pcre)
use_prebuilt_binary(libxml)
set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive
)
if (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
set(LLPRIMITIVE_LIBRARIES
debug llprimitive
optimized llprimitive
debug libcollada14dom22-d
optimized libcollada14dom22
${BOOST_SYSTEM_LIBRARIES}
)
elseif (LINUX)
use_prebuilt_binary(libxml2)
set(LLPRIMITIVE_LIBRARIES
llprimitive
collada14dom
minizip
xml2
pcrecpp
pcre
)
else (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
set(LLPRIMITIVE_LIBRARIES
llprimitive
collada14dom
minizip

View File

@ -4,7 +4,7 @@ include(Variables)
include(GLEXT)
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindSDL)
# This should be done by FindSDL. Sigh.
@ -13,14 +13,14 @@ if (STANDALONE)
SDL_INCLUDE_DIR
SDL_LIBRARY
)
else (STANDALONE)
else (USESYSTEMLIBS)
if (LINUX)
use_prebuilt_binary(SDL)
set (SDL_FOUND TRUE)
set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux)
set (SDL_LIBRARY SDL directfb fusion direct)
endif (LINUX)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})

View File

@ -4,10 +4,10 @@ include(Prebuilt)
set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.")
if (NDOF)
if (STANDALONE)
if (USESYSTEMLIBS)
set(NDOF_FIND_REQUIRED ON)
include(FindNDOF)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(ndofdev)
if (WINDOWS)
@ -18,7 +18,7 @@ if (NDOF)
set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)
set(NDOF_FOUND 1)
endif (STANDALONE)
endif (USESYSTEMLIBS)
endif (NDOF)
if (NDOF_FOUND)

View File

@ -10,14 +10,14 @@ endif (LINUX)
if (OPENAL)
set(OPENAL_LIB_INCLUDE_DIRS "${LIBS_PREBUILT_DIR}/include/AL")
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
include(FindOpenAL)
pkg_check_modules(OPENAL_LIB REQUIRED openal)
pkg_check_modules(FREEALUT_LIB REQUIRED freealut)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(openal_soft)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if(WINDOWS)
set(OPENAL_LIBRARIES
OpenAL32

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(OPENJPEG_FIND_QUIETLY ON)
set(OPENJPEG_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindOpenJPEG)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(openjpeg)
if(WINDOWS)
@ -19,4 +19,4 @@ else (STANDALONE)
endif(WINDOWS)
set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(OpenSSL_FIND_QUIETLY ON)
set(OpenSSL_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindOpenSSL)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(openSSL)
if (WINDOWS)
set(OPENSSL_LIBRARIES ssleay32 libeay32)
@ -14,7 +14,7 @@ else (STANDALONE)
set(OPENSSL_LIBRARIES ssl crypto)
endif (WINDOWS)
set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (LINUX)
set(CRYPTO_LIBRARIES crypto)

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(PNG_FIND_QUIETLY ON)
set(PNG_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPNG)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(libpng)
if (WINDOWS)
set(PNG_LIBRARIES libpng15)
@ -18,4 +18,4 @@ else (STANDALONE)
set(PNG_LIBRARIES png15)
set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
endif()
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -17,11 +17,11 @@ endif(INSTALL_PROPRIETARY)
# of previous attempts is serialized in the file
# ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
macro (use_prebuilt_binary _binary)
if (NOT DEFINED STANDALONE_${_binary})
set(STANDALONE_${_binary} ${STANDALONE})
endif (NOT DEFINED STANDALONE_${_binary})
if (NOT DEFINED USESYSTEMLIBS_${_binary})
set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS})
endif (NOT DEFINED USESYSTEMLIBS_${_binary})
if (NOT STANDALONE_${_binary})
if (NOT USESYSTEMLIBS_${_binary})
if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed")
file(READ ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${_binary}_installed")
if(DEBUG_PREBUILT)
@ -52,7 +52,7 @@ macro (use_prebuilt_binary _binary)
"Failed to download or unpack prebuilt '${_binary}'."
" Process returned ${${_binary}_installed}.")
endif (NOT ${_binary}_installed EQUAL 0)
endif (NOT STANDALONE_${_binary})
endif (NOT USESYSTEMLIBS_${_binary})
endmacro (use_prebuilt_binary _binary)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@ -4,7 +4,7 @@ include(Prebuilt)
set(PULSEAUDIO OFF CACHE BOOL "Build with PulseAudio support, if available.")
if (PULSEAUDIO)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(PULSEAUDIO libpulse)
@ -20,7 +20,7 @@ if (PULSEAUDIO)
set(PULSEAUDIO_LIBRARIES
# none needed!
)
endif (STANDALONE)
endif (USESYSTEMLIBS)
endif (PULSEAUDIO)
if (PULSEAUDIO_FOUND)

View File

@ -1,6 +1,6 @@
# -*- cmake -*-
include(Prebuilt)
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
use_prebuilt_binary(tut)
endif(NOT STANDALONE)
endif(NOT USESYSTEMLIBS)

View File

@ -2,7 +2,7 @@
include(Prebuilt)
include(FreeType)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindPkgConfig)
if (LINUX)
@ -31,7 +31,7 @@ if (STANDALONE)
list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})
add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(gtk-atk-pango-glib)
if (LINUX)
set(UI_LIBRARIES
@ -59,7 +59,7 @@ else (STANDALONE)
foreach(include ${${LL_ARCH}_INCLUDES})
include_directories(${LIBS_PREBUILT_DIR}/include/${include})
endforeach(include)
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (LINUX)
add_definitions(-DLL_GTK=1 -DLL_X11=1)

View File

@ -183,7 +183,7 @@ if (XCODE_VERSION GREATER 4.2)
endif (XCODE_VERSION GREATER 4.2)
set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside")
set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
set(USESYSTEMLIBS OFF CACHE BOOL "Use libraries from your system rather than Linden-supplied prebuilt libraries.")
set(UNATTENDED OFF CACHE BOOL "Should be set to ON for building with VC Express editions.")
set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.")

View File

@ -1,10 +1,10 @@
# -*- cmake -*-
include(Prebuilt)
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
use_prebuilt_binary(libhunspell)
use_prebuilt_binary(libuuid)
use_prebuilt_binary(slvoice)
use_prebuilt_binary(fontconfig)
endif(NOT STANDALONE)
endif(NOT USESYSTEMLIBS)

View File

@ -2,7 +2,7 @@
include(Linking)
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
# 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})
@ -28,11 +28,11 @@ if (STANDALONE)
list(APPEND QT_PLUGIN_LIBRARIES jpeg)
set(WEBKITLIBPLUGIN OFF CACHE BOOL
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(llqtwebkit)
set(WEBKITLIBPLUGIN ON CACHE BOOL
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
endif (STANDALONE)
endif (USESYSTEMLIBS)
if (WINDOWS)
set(WEBKIT_PLUGIN_LIBRARIES

View File

@ -4,9 +4,9 @@ include(Prebuilt)
set(XMLRPCEPI_FIND_QUIETLY ON)
set(XMLRPCEPI_FIND_REQUIRED ON)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindXmlRpcEpi)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(xmlrpc-epi)
if (WINDOWS)
set(XMLRPCEPI_LIBRARIES
@ -17,4 +17,4 @@ else (STANDALONE)
set(XMLRPCEPI_LIBRARIES xmlrpc-epi)
endif (WINDOWS)
set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -5,9 +5,9 @@ set(ZLIB_FIND_REQUIRED ON)
include(Prebuilt)
if (STANDALONE)
if (USESYSTEMLIBS)
include(FindZLIB)
else (STANDALONE)
else (USESYSTEMLIBS)
use_prebuilt_binary(zlib)
if (WINDOWS)
set(ZLIB_LIBRARIES
@ -19,4 +19,4 @@ else (STANDALONE)
if (WINDOWS OR LINUX)
set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/zlib)
endif (WINDOWS OR LINUX)
endif (STANDALONE)
endif (USESYSTEMLIBS)

View File

@ -34,7 +34,7 @@
#include <iostream>
#include "apr_base64.h"
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h" // for davep's dirty little zip functions

View File

@ -35,7 +35,7 @@
extern "C"
{
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <expat.h>
#else
# include "expat/expat.h"

View File

@ -33,7 +33,7 @@
#include "llsys.h"
#include <iostream>
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h"

View File

@ -33,7 +33,7 @@
#include "llwin32headerslean.h"
extern "C" {
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <jpeglib.h>
# include <jerror.h>
#else

View File

@ -1,4 +1,4 @@
/**
/**
* @file llmath.h
* @brief Useful math constants and macros.
*
@ -85,6 +85,9 @@ const F32 OO_LN2 = 1.4426950408889634073599246810019f;
const F32 F_ALMOST_ZERO = 0.0001f;
const F32 F_ALMOST_ONE = 1.0f - F_ALMOST_ZERO;
const F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees
// formula: GIMBAL_THRESHOLD = sin(DEG_TO_RAD * gimbal_threshold_angle);
// BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above?
const F32 FP_MAG_THRESHOLD = 0.0000001f;

View File

@ -1,4 +1,4 @@
/**
/**
* @file llquaternion.cpp
* @brief LLQuaternion class implementation.
*
@ -58,34 +58,40 @@ LLQuaternion::LLQuaternion(const LLMatrix3 &mat)
LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec)
{
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
v.normalize();
F32 c, s;
c = cosf(angle*0.5f);
s = sinf(angle*0.5f);
mQ[VX] = v.mV[VX] * s;
mQ[VY] = v.mV[VY] * s;
mQ[VZ] = v.mV[VZ] * s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
}
LLQuaternion::LLQuaternion(F32 angle, const LLVector3 &vec)
{
LLVector3 v(vec);
v.normalize();
F32 c, s;
c = cosf(angle*0.5f);
s = sinf(angle*0.5f);
mQ[VX] = v.mV[VX] * s;
mQ[VY] = v.mV[VY] * s;
mQ[VZ] = v.mV[VZ] * s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
}
LLQuaternion::LLQuaternion(const LLVector3 &x_axis,
@ -136,57 +142,61 @@ void LLQuaternion::quantize8(F32 lower, F32 upper)
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, F32 x, F32 y, F32 z)
{
LLVector3 vec(x, y, z);
vec.normalize();
angle *= 0.5f;
F32 c, s;
c = cosf(angle);
s = sinf(angle);
mQ[VX] = vec.mV[VX]*s;
mQ[VY] = vec.mV[VY]*s;
mQ[VZ] = vec.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(x * x + y * y + z * z);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = x * s;
mQ[VY] = y * s;
mQ[VZ] = z * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, const LLVector3 &vec)
{
LLVector3 v(vec);
v.normalize();
angle *= 0.5f;
F32 c, s;
c = cosf(angle);
s = sinf(angle);
mQ[VX] = v.mV[VX]*s;
mQ[VY] = v.mV[VY]*s;
mQ[VZ] = v.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, const LLVector4 &vec)
{
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
v.normalize();
F32 c, s;
c = cosf(angle*0.5f);
s = sinf(angle*0.5f);
mQ[VX] = v.mV[VX]*s;
mQ[VY] = v.mV[VY]*s;
mQ[VZ] = v.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
@ -219,68 +229,80 @@ const LLQuaternion& LLQuaternion::set(const LLMatrix4 &mat)
// deprecated
const LLQuaternion& LLQuaternion::setQuat(F32 angle, F32 x, F32 y, F32 z)
{
LLVector3 vec(x, y, z);
vec.normalize();
angle *= 0.5f;
F32 c, s;
c = cosf(angle);
s = sinf(angle);
mQ[VX] = vec.mV[VX]*s;
mQ[VY] = vec.mV[VY]*s;
mQ[VZ] = vec.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(x * x + y * y + z * z);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = x * s;
mQ[VY] = y * s;
mQ[VZ] = z * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
// deprecated
const LLQuaternion& LLQuaternion::setQuat(F32 angle, const LLVector3 &vec)
{
LLVector3 v(vec);
v.normalize();
angle *= 0.5f;
F32 c, s;
c = cosf(angle);
s = sinf(angle);
mQ[VX] = v.mV[VX]*s;
mQ[VY] = v.mV[VY]*s;
mQ[VZ] = v.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
const LLQuaternion& LLQuaternion::setQuat(F32 angle, const LLVector4 &vec)
{
LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
v.normalize();
F32 c, s;
c = cosf(angle*0.5f);
s = sinf(angle*0.5f);
mQ[VX] = v.mV[VX]*s;
mQ[VY] = v.mV[VY]*s;
mQ[VZ] = v.mV[VZ]*s;
mQ[VW] = c;
normalize();
F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
F32 c = cosf(angle);
F32 s = sinf(angle) / mag;
mQ[VX] = vec.mV[VX] * s;
mQ[VY] = vec.mV[VY] * s;
mQ[VZ] = vec.mV[VZ] * s;
mQ[VW] = c;
}
else
{
loadIdentity();
}
return (*this);
}
const LLQuaternion& LLQuaternion::setQuat(F32 roll, F32 pitch, F32 yaw)
{
LLMatrix3 rot_mat(roll, pitch, yaw);
rot_mat.orthogonalize();
*this = rot_mat.quaternion();
normalize();
roll *= 0.5f;
pitch *= 0.5f;
yaw *= 0.5f;
F32 sinX = sinf(roll);
F32 cosX = cosf(roll);
F32 sinY = sinf(pitch);
F32 cosY = cosf(pitch);
F32 sinZ = sinf(yaw);
F32 cosZ = cosf(yaw);
mQ[VW] = cosX * cosY * cosZ - sinX * sinY * sinZ;
mQ[VX] = sinX * cosY * cosZ + cosX * sinY * sinZ;
mQ[VY] = cosX * sinY * cosZ - sinX * cosY * sinZ;
mQ[VZ] = cosX * cosY * sinZ + sinX * sinY * cosZ;
return (*this);
}
@ -425,68 +447,44 @@ LLMatrix4 LLQuaternion::getMatrix4(void) const
// calculate the shortest rotation from a to b
void LLQuaternion::shortestArc(const LLVector3 &a, const LLVector3 &b)
{
// Make a local copy of both vectors.
LLVector3 vec_a = a;
LLVector3 vec_b = b;
// Make sure neither vector is zero length. Also normalize
// the vectors while we are at it.
F32 vec_a_mag = vec_a.normalize();
F32 vec_b_mag = vec_b.normalize();
if (vec_a_mag < F_APPROXIMATELY_ZERO ||
vec_b_mag < F_APPROXIMATELY_ZERO)
F32 ab = a * b; // dotproduct
LLVector3 c = a % b; // crossproduct
F32 cc = c * c; // squared length of the crossproduct
if (ab * ab + cc) // test if the arguments have sufficient magnitude
{
// Can't calculate a rotation from this.
// Just return ZERO_ROTATION instead.
loadIdentity();
return;
}
// Create an axis to rotate around, and the cos of the angle to rotate.
LLVector3 axis = vec_a % vec_b;
F32 cos_theta = vec_a * vec_b;
// Check the angle between the vectors to see if they are parallel or anti-parallel.
if (cos_theta > 1.0 - F_APPROXIMATELY_ZERO)
{
// a and b are parallel. No rotation is necessary.
loadIdentity();
}
else if (cos_theta < -1.0 + F_APPROXIMATELY_ZERO)
{
// a and b are anti-parallel.
// Rotate 180 degrees around some orthogonal axis.
// Find the projection of the x-axis onto a, and try
// using the vector between the projection and the x-axis
// as the orthogonal axis.
LLVector3 proj = vec_a.mV[VX] / (vec_a * vec_a) * vec_a;
LLVector3 ortho_axis(1.f, 0.f, 0.f);
ortho_axis -= proj;
// Turn this into an orthonormal axis.
F32 ortho_length = ortho_axis.normalize();
// If the axis' length is 0, then our guess at an orthogonal axis
// was wrong (a is parallel to the x-axis).
if (ortho_length < F_APPROXIMATELY_ZERO)
if (cc > 0.0f) // test if the arguments are (anti)parallel
{
// Use the z-axis instead.
ortho_axis.setVec(0.f, 0.f, 1.f);
F32 s = sqrtf(ab * ab + cc) + ab; // note: don't try to optimize this line
F32 m = 1.0f / sqrtf(cc + s * s); // the inverted magnitude of the quaternion
mQ[VX] = c.mV[VX] * m;
mQ[VY] = c.mV[VY] * m;
mQ[VZ] = c.mV[VZ] * m;
mQ[VW] = s * m;
return;
}
if (ab < 0.0f) // test if the angle is bigger than PI/2 (anti parallel)
{
c = a - b; // the arguments are anti-parallel, we have to choose an axis
F32 m = sqrtf(c.mV[VX] * c.mV[VX] + c.mV[VY] * c.mV[VY]); // the length projected on the XY-plane
if (m > FP_MAG_THRESHOLD)
{
mQ[VX] = -c.mV[VY] / m; // return the quaternion with the axis in the XY-plane
mQ[VY] = c.mV[VX] / m;
mQ[VZ] = 0.0f;
mQ[VW] = 0.0f;
return;
}
else // the vectors are parallel to the Z-axis
{
mQ[VX] = 1.0f; // rotate around the X-axis
mQ[VY] = 0.0f;
mQ[VZ] = 0.0f;
mQ[VW] = 0.0f;
return;
}
}
// Construct a quaternion from this orthonormal axis.
mQ[VX] = ortho_axis.mV[VX];
mQ[VY] = ortho_axis.mV[VY];
mQ[VZ] = ortho_axis.mV[VZ];
mQ[VW] = 0.f;
}
else
{
// a and b are NOT parallel or anti-parallel.
// Return the rotation between these vectors.
F32 theta = (F32)acos(cos_theta);
setAngleAxis(theta, axis);
}
loadIdentity();
}
// constrains rotation to a cone angle specified in radians
@ -838,79 +836,82 @@ LLQuaternion::Order StringToOrder( const char *str )
void LLQuaternion::getAngleAxis(F32* angle, LLVector3 &vec) const
{
F32 cos_a = mQ[VW];
if (cos_a > 1.0f) cos_a = 1.0f;
if (cos_a < -1.0f) cos_a = -1.0f;
F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a );
if ( fabs( sin_a ) < 0.0005f )
sin_a = 1.0f;
else
sin_a = 1.f/sin_a;
F32 temp_angle = 2.0f * (F32) acos( cos_a );
if (temp_angle > F_PI)
F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component
if (v > FP_MAG_THRESHOLD)
{
// The (angle,axis) pair should never have angles outside [PI, -PI]
// since we want the _shortest_ (angle,axis) solution.
// Since acos is defined for [0, PI], and we multiply by 2.0, we
// can push the angle outside the acceptible range.
// When this happens we set the angle to the other portion of a
// full 2PI rotation, and negate the axis, which reverses the
// direction of the rotation (by the right-hand rule).
*angle = 2.f * F_PI - temp_angle;
vec.mV[VX] = - mQ[VX] * sin_a;
vec.mV[VY] = - mQ[VY] * sin_a;
vec.mV[VZ] = - mQ[VZ] * sin_a;
F32 oomag = 1.0f / v;
F32 w = mQ[VW];
if (mQ[VW] < 0.0f)
{
w = -w; // make VW positive
oomag = -oomag; // invert the axis
}
vec.mV[VX] = mQ[VX] * oomag; // normalize the axis
vec.mV[VY] = mQ[VY] * oomag;
vec.mV[VZ] = mQ[VZ] * oomag;
*angle = 2.0f * atan2f(v, w); // get the angle
}
else
{
*angle = temp_angle;
vec.mV[VX] = mQ[VX] * sin_a;
vec.mV[VY] = mQ[VY] * sin_a;
vec.mV[VZ] = mQ[VZ] * sin_a;
*angle = 0.0f; // no rotation
vec.mV[VX] = 0.0f; // around some dummy axis
vec.mV[VY] = 0.0f;
vec.mV[VZ] = 1.0f;
}
}
// quaternion does not need to be normalized
void LLQuaternion::getEulerAngles(F32 *roll, F32 *pitch, F32 *yaw) const
{
LLMatrix3 rot_mat(*this);
rot_mat.orthogonalize();
rot_mat.getEulerAngles(roll, pitch, yaw);
// // NOTE: LLQuaternion's are actually inverted with respect to
// // the matrices, so this code also assumes inverted quaternions
// // (-x, -y, -z, w). The result is that roll,pitch,yaw are applied
// // in reverse order (yaw,pitch,roll).
// F32 x = -mQ[VX], y = -mQ[VY], z = -mQ[VZ], w = mQ[VW];
// F64 m20 = 2.0*(x*z-y*w);
// if (1.0f - fabsf(m20) < F_APPROXIMATELY_ZERO)
// {
// *roll = 0.0f;
// *pitch = (F32)asin(m20);
// *yaw = (F32)atan2(2.0*(x*y-z*w), 1.0 - 2.0*(x*x+z*z));
// }
// else
// {
// *roll = (F32)atan2(-2.0*(y*z+x*w), 1.0-2.0*(x*x+y*y));
// *pitch = (F32)asin(m20);
// *yaw = (F32)atan2(-2.0*(x*y+z*w), 1.0-2.0*(y*y+z*z));
// }
F32 sx = 2 * (mQ[VX] * mQ[VW] - mQ[VY] * mQ[VZ]); // sine of the roll
F32 sy = 2 * (mQ[VY] * mQ[VW] + mQ[VX] * mQ[VZ]); // sine of the pitch
F32 ys = mQ[VW] * mQ[VW] - mQ[VY] * mQ[VY]; // intermediate cosine 1
F32 xz = mQ[VX] * mQ[VX] - mQ[VZ] * mQ[VZ]; // intermediate cosine 2
F32 cx = ys - xz; // cosine of the roll
F32 cy = sqrtf(sx * sx + cx * cx); // cosine of the pitch
if (cy > GIMBAL_THRESHOLD) // no gimbal lock
{
*roll = atan2f(sx, cx);
*pitch = atan2f(sy, cy);
*yaw = atan2f(2 * (mQ[VZ] * mQ[VW] - mQ[VX] * mQ[VY]), ys + xz);
}
else // gimbal lock
{
if (sy > 0)
{
*pitch = F_PI_BY_TWO;
*yaw = 2 * atan2f(mQ[VZ] + mQ[VX], mQ[VW] + mQ[VY]);
}
else
{
*pitch = -F_PI_BY_TWO;
*yaw = 2 * atan2f(mQ[VZ] - mQ[VX], mQ[VW] - mQ[VY]);
}
*roll = 0;
}
}
// Saves space by using the fact that our quaternions are normalized
LLVector3 LLQuaternion::packToVector3() const
{
F32 x = mQ[VX];
F32 y = mQ[VY];
F32 z = mQ[VZ];
F32 w = mQ[VW];
F32 mag = sqrtf(x * x + y * y + z * z + w * w);
if (mag > FP_MAG_THRESHOLD)
{
x /= mag;
y /= mag;
z /= mag; // no need to normalize w, it's not used
}
if( mQ[VW] >= 0 )
{
return LLVector3( mQ[VX], mQ[VY], mQ[VZ] );
return LLVector3( x, y , z );
}
else
{
return LLVector3( -mQ[VX], -mQ[VY], -mQ[VZ] );
return LLVector3( -x, -y, -z );
}
}

View File

@ -1,4 +1,4 @@
/**
/**
* @file llquaternion.h
* @brief LLQuaternion class header file.
*
@ -304,43 +304,29 @@ inline const LLQuaternion& LLQuaternion::setQuat(const F32 *q)
return (*this);
}
// There may be a cheaper way that avoids the sqrt.
// Does sin_a = VX*VX + VY*VY + VZ*VZ?
// Copied from Matrix and Quaternion FAQ 1.12
inline void LLQuaternion::getAngleAxis(F32* angle, F32* x, F32* y, F32* z) const
{
F32 cos_a = mQ[VW];
if (cos_a > 1.0f) cos_a = 1.0f;
if (cos_a < -1.0f) cos_a = -1.0f;
F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a );
if ( fabs( sin_a ) < 0.0005f )
sin_a = 1.0f;
else
sin_a = 1.f/sin_a;
F32 temp_angle = 2.0f * (F32) acos( cos_a );
if (temp_angle > F_PI)
F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component
if (v > FP_MAG_THRESHOLD)
{
// The (angle,axis) pair should never have angles outside [PI, -PI]
// since we want the _shortest_ (angle,axis) solution.
// Since acos is defined for [0, PI], and we multiply by 2.0, we
// can push the angle outside the acceptible range.
// When this happens we set the angle to the other portion of a
// full 2PI rotation, and negate the axis, which reverses the
// direction of the rotation (by the right-hand rule).
*angle = 2.f * F_PI - temp_angle;
*x = - mQ[VX] * sin_a;
*y = - mQ[VY] * sin_a;
*z = - mQ[VZ] * sin_a;
F32 oomag = 1.0f / v;
F32 w = mQ[VW];
if (w < 0.0f)
{
w = -w; // make VW positive
oomag = -oomag; // invert the axis
}
*x = mQ[VX] * oomag; // normalize the axis
*y = mQ[VY] * oomag;
*z = mQ[VZ] * oomag;
*angle = 2.0f * atan2f(v, w); // get the angle
}
else
{
*angle = temp_angle;
*x = mQ[VX] * sin_a;
*y = mQ[VY] * sin_a;
*z = mQ[VZ] * sin_a;
*angle = 0.0f; // no rotation
*x = 0.0f; // around some dummy axis
*y = 0.0f;
*z = 1.0f;
}
}

View File

@ -72,17 +72,22 @@ class LLVector3d
BOOL clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns TRUE if data changed
BOOL abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed
inline const LLVector3d& clearVec(); // Clears LLVector3d to (0, 0, 0, 1)
inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1)
inline const LLVector3d& clearVec(); // deprecated
inline const LLVector3d& setZero(); // Zero LLVector3d to (0, 0, 0, 0)
inline const LLVector3d& zeroVec(); // deprecated
inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
inline const LLVector3d& setVec(const LLVector3d &vec); // Sets LLVector3d to vec
inline const LLVector3d& setVec(const F64 *vec); // Sets LLVector3d to vec
inline const LLVector3d& setVec(const LLVector3 &vec);
inline const LLVector3d& set(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
inline const LLVector3d& set(const LLVector3d &vec); // Sets LLVector3d to vec
inline const LLVector3d& set(const F64 *vec); // Sets LLVector3d to vec
inline const LLVector3d& set(const LLVector3 &vec);
inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // deprecated
inline const LLVector3d& setVec(const LLVector3d &vec); // deprecated
inline const LLVector3d& setVec(const F64 *vec); // deprecated
inline const LLVector3d& setVec(const LLVector3 &vec); // deprecated
F64 magVec() const; // Returns magnitude of LLVector3d
F64 magVecSquared() const; // Returns magnitude squared of LLVector3d
inline F64 normVec(); // Normalizes and returns the magnitude of LLVector3d
F64 magVec() const; // deprecated
F64 magVecSquared() const; // deprecated
inline F64 normVec(); // deprecated
F64 length() const; // Returns magnitude of LLVector3d
F64 lengthSquared() const; // Returns magnitude squared of LLVector3d
@ -127,7 +132,15 @@ class LLVector3d
typedef LLVector3d LLGlobalVec;
const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
inline const LLVector3d &LLVector3d::set(const LLVector3 &vec)
{
mdV[0] = vec.mV[0];
mdV[1] = vec.mV[1];
mdV[2] = vec.mV[2];
return *this;
}
inline const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
{
mdV[0] = vec.mV[0];
mdV[1] = vec.mV[1];
@ -184,6 +197,14 @@ inline BOOL LLVector3d::isFinite() const
// Clear and Assignment Functions
inline const LLVector3d& LLVector3d::clear(void)
{
mdV[0] = 0.f;
mdV[1] = 0.f;
mdV[2]= 0.f;
return (*this);
}
inline const LLVector3d& LLVector3d::clearVec(void)
{
mdV[0] = 0.f;
@ -208,6 +229,30 @@ inline const LLVector3d& LLVector3d::zeroVec(void)
return (*this);
}
inline const LLVector3d& LLVector3d::set(const F64 x, const F64 y, const F64 z)
{
mdV[VX] = x;
mdV[VY] = y;
mdV[VZ] = z;
return (*this);
}
inline const LLVector3d& LLVector3d::set(const LLVector3d &vec)
{
mdV[0] = vec.mdV[0];
mdV[1] = vec.mdV[1];
mdV[2] = vec.mdV[2];
return (*this);
}
inline const LLVector3d& LLVector3d::set(const F64 *vec)
{
mdV[0] = vec[0];
mdV[1] = vec[1];
mdV[2] = vec[2];
return (*this);
}
inline const LLVector3d& LLVector3d::setVec(const F64 x, const F64 y, const F64 z)
{
mdV[VX] = x;

View File

@ -1,4 +1,4 @@
/**
/**
* @file v3math.h
* @brief LLVector3 class header file.
*
@ -159,9 +159,7 @@ F32 dist_vec(const LLVector3 &a, const LLVector3 &b); // Returns distance betwe
F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b
F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b ignoring Z component
LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b
// Returns a vector in direction of a, such that when projected onto b, gives you the same value as b
// in other words: projected_vec(inverse_projected_vec(a, b), b) == b;
LLVector3 inverse_projected_vec(const LLVector3 &a, const LLVector3 &b);
LLVector3 inverse_projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a scaled such that projected_vec(inverse_projected_vec(a, b), b) == b;
LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b (same as projected_vec)
LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b); // Returns component of vector a not parallel to vector b (same as projected_vec)
LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vector that is a linear interpolation between a and b
@ -493,9 +491,15 @@ inline F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b)
inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b)
{
LLVector3 project_axis = b;
project_axis.normalize();
return project_axis * (a * project_axis);
F32 bb = b * b;
if (bb > FP_MAG_THRESHOLD * FP_MAG_THRESHOLD)
{
return ((a * b) / bb) * b;
}
else
{
return b.zero;
}
}
inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b)
@ -571,15 +575,13 @@ inline void update_min_max(LLVector3& min, LLVector3& max, const F32* pos)
inline F32 angle_between(const LLVector3& a, const LLVector3& b)
{
LLVector3 an = a;
LLVector3 bn = b;
an.normalize();
bn.normalize();
F32 cosine = an * bn;
F32 angle = (cosine >= 1.0f) ? 0.0f :
(cosine <= -1.0f) ? F_PI :
(F32)acos(cosine);
return angle;
F32 ab = a * b; // dotproduct
if (ab == -0.0f)
{
ab = 0.0f; // get rid of negative zero
}
LLVector3 c = a % b; // crossproduct
return atan2f(sqrtf(c * c), ab); // return the angle
}
inline BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon)

View File

@ -39,7 +39,7 @@
# pragma warning(pop)
#endif
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <ares.h>
#else
# include <ares/ares.h>

View File

@ -38,7 +38,7 @@
#include "llvfs.h"
#include "llxfer.h"
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h"

View File

@ -44,7 +44,7 @@
#pragma warning (default : 4264)
#endif
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h"

View File

@ -1,25 +1,25 @@
/**
/**
* @file llkeywords.cpp
* @brief Keyword list for LSL
*
* $LicenseInfo:firstyear=2000&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$
*/
@ -30,49 +30,48 @@
#include <fstream>
#include "llkeywords.h"
#include "llsdserialize.h"
#include "lltexteditor.h"
#include "llstl.h"
#include <boost/tokenizer.hpp>
const U32 KEYWORD_FILE_CURRENT_VERSION = 2;
inline BOOL LLKeywordToken::isHead(const llwchar* s) const
inline bool LLKeywordToken::isHead(const llwchar* s) const
{
// strncmp is much faster than string compare
BOOL res = TRUE;
bool res = true;
const llwchar* t = mToken.c_str();
S32 len = mToken.size();
for (S32 i=0; i<len; i++)
{
if (s[i] != t[i])
{
res = FALSE;
res = false;
break;
}
}
return res;
}
LLKeywords::LLKeywords() : mLoaded(FALSE)
inline bool LLKeywordToken::isTail(const llwchar* s) const
{
}
inline BOOL LLKeywordToken::isTail(const llwchar* s) const
{
BOOL res = TRUE;
bool res = true;
const llwchar* t = mDelimiter.c_str();
S32 len = mDelimiter.size();
for (S32 i=0; i<len; i++)
{
if (s[i] != t[i])
{
res = FALSE;
res = false;
break;
}
}
return res;
}
LLKeywords::LLKeywords()
: mLoaded(false)
{
}
LLKeywords::~LLKeywords()
{
std::for_each(mWordTokenMap.begin(), mWordTokenMap.end(), DeletePairedPointer());
@ -83,173 +82,44 @@ LLKeywords::~LLKeywords()
mDelimiterTokenList.clear();
}
BOOL LLKeywords::loadFromFile( const std::string& filename )
{
mLoaded = FALSE;
////////////////////////////////////////////////////////////
// File header
const S32 BUFFER_SIZE = 1024;
char buffer[BUFFER_SIZE]; /* Flawfinder: ignore */
llifstream file;
file.open(filename); /* Flawfinder: ignore */
if( file.fail() )
{
LL_INFOS() << "LLKeywords::loadFromFile() Unable to open file: " << filename << LL_ENDL;
return mLoaded;
}
// Identifying string
file >> buffer;
if( strcmp( buffer, "llkeywords" ) )
{
LL_INFOS() << filename << " does not appear to be a keyword file" << LL_ENDL;
return mLoaded;
}
// Check file version
file >> buffer;
U32 version_num;
file >> version_num;
if( strcmp(buffer, "version") || version_num != (U32)KEYWORD_FILE_CURRENT_VERSION )
{
LL_INFOS() << filename << " does not appear to be a version " << KEYWORD_FILE_CURRENT_VERSION << " keyword file" << LL_ENDL;
return mLoaded;
}
// start of line (SOL)
std::string SOL_COMMENT("#");
std::string SOL_WORD("[word ");
std::string SOL_LINE("[line ");
std::string SOL_ONE_SIDED_DELIMITER("[one_sided_delimiter ");
std::string SOL_TWO_SIDED_DELIMITER("[two_sided_delimiter ");
std::string SOL_DOUBLE_QUOTATION_MARKS("[double_quotation_marks ");
LLColor3 cur_color( 1, 0, 0 );
LLKeywordToken::TOKEN_TYPE cur_type = LLKeywordToken::WORD;
while (!file.eof())
{
buffer[0] = 0;
file.getline( buffer, BUFFER_SIZE );
std::string line(buffer);
if( line.find(SOL_COMMENT) == 0 )
{
continue;
}
else if( line.find(SOL_WORD) == 0 )
{
cur_color = readColor( line.substr(SOL_WORD.size()) );
cur_type = LLKeywordToken::WORD;
continue;
}
else if( line.find(SOL_LINE) == 0 )
{
cur_color = readColor( line.substr(SOL_LINE.size()) );
cur_type = LLKeywordToken::LINE;
continue;
}
else if( line.find(SOL_TWO_SIDED_DELIMITER) == 0 )
{
cur_color = readColor( line.substr(SOL_TWO_SIDED_DELIMITER.size()) );
cur_type = LLKeywordToken::TWO_SIDED_DELIMITER;
continue;
}
else if( line.find(SOL_DOUBLE_QUOTATION_MARKS) == 0 )
{
cur_color = readColor( line.substr(SOL_DOUBLE_QUOTATION_MARKS.size()) );
cur_type = LLKeywordToken::DOUBLE_QUOTATION_MARKS;
continue;
}
else if( line.find(SOL_ONE_SIDED_DELIMITER) == 0 )
{
cur_color = readColor( line.substr(SOL_ONE_SIDED_DELIMITER.size()) );
cur_type = LLKeywordToken::ONE_SIDED_DELIMITER;
continue;
}
std::string token_buffer( line );
LLStringUtil::trim(token_buffer);
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep_word("", " \t");
tokenizer word_tokens(token_buffer, sep_word);
tokenizer::iterator token_word_iter = word_tokens.begin();
if( !token_buffer.empty() && token_word_iter != word_tokens.end() )
{
// first word is the keyword or a left delimiter
std::string keyword = (*token_word_iter);
LLStringUtil::trim(keyword);
// second word may be a right delimiter
std::string delimiter;
if (cur_type == LLKeywordToken::TWO_SIDED_DELIMITER)
{
while (delimiter.length() == 0 && ++token_word_iter != word_tokens.end())
{
delimiter = *token_word_iter;
LLStringUtil::trim(delimiter);
}
}
else if (cur_type == LLKeywordToken::DOUBLE_QUOTATION_MARKS)
{
// Closing delimiter is identical to the opening one.
delimiter = keyword;
}
// following words are tooltip
std::string tool_tip;
while (++token_word_iter != word_tokens.end())
{
tool_tip += (*token_word_iter);
}
LLStringUtil::trim(tool_tip);
if( !tool_tip.empty() )
{
// Replace : with \n for multi-line tool tips.
LLStringUtil::replaceChar( tool_tip, ':', '\n' );
addToken(cur_type, keyword, cur_color, tool_tip, delimiter );
}
else
{
addToken(cur_type, keyword, cur_color, LLStringUtil::null, delimiter );
}
}
}
file.close();
mLoaded = TRUE;
return mLoaded;
}
// Add the token as described
void LLKeywords::addToken(LLKeywordToken::TOKEN_TYPE type,
void LLKeywords::addToken(LLKeywordToken::ETokenType type,
const std::string& key_in,
const LLColor3& color,
const LLColor4& color,
const std::string& tool_tip_in,
const std::string& delimiter_in)
{
std::string tip_text = tool_tip_in;
LLStringUtil::replaceString(tip_text, "\\n", "\n" );
LLStringUtil::replaceString(tip_text, "\t", " " );
if (tip_text.empty())
{
tip_text = "[no info]";
}
LLWString tool_tip = utf8str_to_wstring(tip_text);
LLWString key = utf8str_to_wstring(key_in);
LLWString tool_tip = utf8str_to_wstring(tool_tip_in);
LLWString delimiter = utf8str_to_wstring(delimiter_in);
switch(type)
{
case LLKeywordToken::WORD:
case LLKeywordToken::TT_CONSTANT:
case LLKeywordToken::TT_CONTROL:
case LLKeywordToken::TT_EVENT:
case LLKeywordToken::TT_FUNCTION:
case LLKeywordToken::TT_LABEL:
case LLKeywordToken::TT_SECTION:
case LLKeywordToken::TT_TYPE:
case LLKeywordToken::TT_WORD:
mWordTokenMap[key] = new LLKeywordToken(type, color, key, tool_tip, LLWStringUtil::null);
break;
case LLKeywordToken::LINE:
case LLKeywordToken::TT_LINE:
mLineTokenList.push_front(new LLKeywordToken(type, color, key, tool_tip, LLWStringUtil::null));
break;
case LLKeywordToken::TWO_SIDED_DELIMITER:
case LLKeywordToken::DOUBLE_QUOTATION_MARKS:
case LLKeywordToken::ONE_SIDED_DELIMITER:
case LLKeywordToken::TT_TWO_SIDED_DELIMITER:
case LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS:
case LLKeywordToken::TT_ONE_SIDED_DELIMITER:
mDelimiterTokenList.push_front(new LLKeywordToken(type, color, key, tool_tip, delimiter));
break;
@ -257,6 +127,262 @@ void LLKeywords::addToken(LLKeywordToken::TOKEN_TYPE type,
llassert(0);
}
}
std::string LLKeywords::getArguments(LLSD& arguments)
{
std::string argString = "";
if (arguments.isArray())
{
U32 argsCount = arguments.size();
LLSD::array_iterator arrayIt = arguments.beginArray();
for ( ; arrayIt != arguments.endArray(); ++arrayIt)
{
LLSD& args = (*arrayIt);
if (args.isMap())
{
LLSD::map_iterator argsIt = args.beginMap();
for ( ; argsIt != args.endMap(); ++argsIt)
{
argString += argsIt->second.get("type").asString() + " " + argsIt->first;
if (argsCount-- > 1)
{
argString += ", ";
}
}
}
else
{
LL_WARNS("SyntaxLSL") << "Argument array comtains a non-map element!" << LL_ENDL;
}
}
}
else if (!arguments.isUndefined())
{
LL_WARNS("SyntaxLSL") << "Not an array! Invalid arguments LLSD passed to function." << arguments << LL_ENDL;
}
return argString;
}
std::string LLKeywords::getAttribute(const std::string& key)
{
attribute_iterator_t it = mAttributes.find(key);
return (it != mAttributes.end()) ? it->second : "";
}
LLColor4 LLKeywords::getColorGroup(const std::string& key_in)
{
std::string color_group = "ScriptText";
if (key_in == "functions")
{
color_group = "SyntaxLslFunction";
}
else if (key_in == "controls")
{
color_group = "SyntaxLslControlFlow";
}
else if (key_in == "events")
{
color_group = "SyntaxLslEvent";
}
else if (key_in == "types")
{
color_group = "SyntaxLslDataType";
}
else if (key_in == "misc-flow-label")
{
color_group = "SyntaxLslControlFlow";
}
else if (key_in =="deprecated")
{
color_group = "SyntaxLslDeprecated";
}
else if (key_in =="god-mode")
{
color_group = "SyntaxLslGodMode";
}
else if (key_in == "constants"
|| key_in == "constants-integer"
|| key_in == "constants-float"
|| key_in == "constants-string"
|| key_in == "constants-key"
|| key_in == "constants-rotation"
|| key_in == "constants-vector")
{
color_group = "SyntaxLslConstant";
}
else
{
LL_WARNS("SyntaxLSL") << "Color key '" << key_in << "' not recognized." << LL_ENDL;
}
return LLUIColorTable::instance().getColor(color_group);
}
void LLKeywords::initialize(LLSD SyntaxXML)
{
mSyntax = SyntaxXML;
mLoaded = true;
}
void LLKeywords::processTokens()
{
if (!mLoaded)
{
return;
}
// Add 'standard' stuff: Quotes, Comments, Strings, Labels, etc. before processing the LLSD
std::string delimiter;
addToken(LLKeywordToken::TT_LABEL, "@", getColorGroup("misc-flow-label"), "Label\nTarget for jump statement", delimiter );
addToken(LLKeywordToken::TT_ONE_SIDED_DELIMITER, "//", LLUIColorTable::instance().getColor("SyntaxLslComment"), "Comment (single-line)\nNon-functional commentary or disabled code", delimiter );
addToken(LLKeywordToken::TT_TWO_SIDED_DELIMITER, "/*", LLUIColorTable::instance().getColor("SyntaxLslComment"), "Comment (multi-line)\nNon-functional commentary or disabled code", "*/" );
addToken(LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS, "\"", LLUIColorTable::instance().getColor("SyntaxLslStringLiteral"), "String literal", "\"" );
LLSD::map_iterator itr = mSyntax.beginMap();
for ( ; itr != mSyntax.endMap(); ++itr)
{
if (itr->first == "llsd-lsl-syntax-version")
{
// Skip over version key.
}
else
{
if (itr->second.isMap())
{
processTokensGroup(itr->second, itr->first);
}
else
{
LL_WARNS("LSL-Tokens-Processing") << "Map for " + itr->first + " entries is missing! Ignoring." << LL_ENDL;
}
}
}
LL_INFOS("SyntaxLSL") << "Finished processing tokens." << LL_ENDL;
}
void LLKeywords::processTokensGroup(const LLSD& tokens, const std::string& group)
{
LLColor4 color;
LLColor4 color_group;
LLColor4 color_deprecated = getColorGroup("deprecated");
LLColor4 color_god_mode = getColorGroup("god-mode");
LLKeywordToken::ETokenType token_type = LLKeywordToken::TT_UNKNOWN;
// If a new token type is added here, it must also be added to the 'addToken' method
if (group == "constants")
{
token_type = LLKeywordToken::TT_CONSTANT;
}
else if (group == "controls")
{
token_type = LLKeywordToken::TT_CONTROL;
}
else if (group == "events")
{
token_type = LLKeywordToken::TT_EVENT;
}
else if (group == "functions")
{
token_type = LLKeywordToken::TT_FUNCTION;
}
else if (group == "label")
{
token_type = LLKeywordToken::TT_LABEL;
}
else if (group == "types")
{
token_type = LLKeywordToken::TT_TYPE;
}
color_group = getColorGroup(group);
LL_INFOS("SyntaxLSL") << "Group: '" << group << "', using color: '" << color_group << "'" << LL_ENDL;
if (tokens.isMap())
{
LLSD::map_const_iterator outer_itr = tokens.beginMap();
for ( ; outer_itr != tokens.endMap(); ++outer_itr )
{
if (outer_itr->second.isMap())
{
mAttributes.clear();
LLSD arguments = LLSD();
LLSD::map_const_iterator inner_itr = outer_itr->second.beginMap();
for ( ; inner_itr != outer_itr->second.endMap(); ++inner_itr )
{
if (inner_itr->first == "arguments")
{
if (inner_itr->second.isArray())
{
arguments = inner_itr->second;
}
}
else if (!inner_itr->second.isMap() && !inner_itr->second.isArray())
{
mAttributes[inner_itr->first] = inner_itr->second.asString();
}
else
{
LL_WARNS("SyntaxLSL") << "Not a valid attribute: " << inner_itr->first << LL_ENDL;
}
}
std::string tooltip = "";
switch (token_type)
{
case LLKeywordToken::TT_CONSTANT:
color_group = getColorGroup(group + "-" + getAttribute("type"));
tooltip = "Type: " + getAttribute("type") + ", Value: " + getAttribute("value");
break;
case LLKeywordToken::TT_EVENT:
tooltip = outer_itr->first + "(" + getArguments(arguments) + ")";
break;
case LLKeywordToken::TT_FUNCTION:
tooltip = getAttribute("return") + " " + outer_itr->first + "(" + getArguments(arguments) + ");";
tooltip.append("\nEnergy: ");
tooltip.append(getAttribute("energy").empty() ? "0.0" : getAttribute("energy"));
if (!getAttribute("sleep").empty())
{
tooltip += ", Sleep: " + getAttribute("sleep");
}
default:
break;
}
if (!getAttribute("tooltip").empty())
{
if (!tooltip.empty())
{
tooltip.append("\n");
}
tooltip.append(getAttribute("tooltip"));
}
color = getAttribute("deprecated") == "true" ? color_deprecated : color_group;
if (getAttribute("god-mode") == "true")
{
color = color_god_mode;
}
addToken(token_type, outer_itr->first, color, tooltip);
}
}
}
else if (tokens.isArray()) // Currently nothing should need this, but it's here for completeness
{
LL_INFOS("SyntaxLSL") << "Curious, shouldn't be an array here; adding all using color " << color << LL_ENDL;
for (S32 count = 0; count < tokens.size(); ++count)
{
addToken(token_type, tokens[count], color, "");
}
}
else
{
LL_WARNS("SyntaxLSL") << "Invalid map/array passed: '" << tokens << "'" << LL_ENDL;
}
}
LLKeywords::WStringMapIndex::WStringMapIndex(const WStringMapIndex& other)
{
if(other.mOwner)
@ -276,15 +402,19 @@ LLKeywords::WStringMapIndex::WStringMapIndex(const LLWString& str)
copyData(str.data(), str.size());
}
LLKeywords::WStringMapIndex::WStringMapIndex(const llwchar *start, size_t length):
mData(start), mLength(length), mOwner(false)
LLKeywords::WStringMapIndex::WStringMapIndex(const llwchar *start, size_t length)
: mData(start)
, mLength(length)
, mOwner(false)
{
}
LLKeywords::WStringMapIndex::~WStringMapIndex()
{
if(mOwner)
if (mOwner)
{
delete[] mData;
}
}
void LLKeywords::WStringMapIndex::copyData(const llwchar *start, size_t length)
@ -301,13 +431,13 @@ bool LLKeywords::WStringMapIndex::operator<(const LLKeywords::WStringMapIndex &o
{
// NOTE: Since this is only used to organize a std::map, it doesn't matter if it uses correct collate order or not.
// The comparison only needs to strictly order all possible strings, and be stable.
bool result = false;
const llwchar* self_iter = mData;
const llwchar* self_end = mData + mLength;
const llwchar* other_iter = other.mData;
const llwchar* other_end = other.mData + other.mLength;
while(true)
{
if(other_iter >= other_end)
@ -322,7 +452,7 @@ bool LLKeywords::WStringMapIndex::operator<(const LLKeywords::WStringMapIndex &o
{
// self is shorter than other.
result = true;
break;
break;
}
else if(*self_iter != *other_iter)
{
@ -334,20 +464,8 @@ bool LLKeywords::WStringMapIndex::operator<(const LLKeywords::WStringMapIndex &o
self_iter++;
other_iter++;
}
return result;
}
LLColor3 LLKeywords::readColor( const std::string& s )
{
F32 r, g, b;
r = g = b = 0.0f;
S32 values_read = sscanf(s.c_str(), "%f, %f, %f]", &r, &g, &b );
if( values_read != 3 )
{
LL_INFOS() << " poorly formed color in keyword file" << LL_ENDL;
}
return LLColor3( r, g, b );
return result;
}
LLTrace::BlockTimerStatHandle FTM_SYNTAX_COLORING("Syntax Coloring");
@ -363,10 +481,10 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
{
return;
}
S32 text_len = wtext.size() + 1;
seg_list->push_back( new LLNormalTextSegment( defaultColor, 0, text_len, editor ) );
seg_list->push_back( new LLNormalTextSegment( defaultColor, 0, text_len, editor ) );
const llwchar* base = wtext.c_str();
const llwchar* cur = base;
@ -396,7 +514,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
continue;
}
// cur is now at the first non-whitespace character of a new line
// cur is now at the first non-whitespace character of a new line
// Line start tokens
{
@ -414,7 +532,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
cur++;
}
S32 seg_end = cur - base;
//create segments from seg_start to seg_end
insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, defaultColor, editor);
line_done = TRUE; // to break out of second loop.
@ -459,14 +577,14 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
seg_start = cur - base;
cur += cur_delimiter->getLengthHead();
LLKeywordToken::TOKEN_TYPE type = cur_delimiter->getType();
if( type == LLKeywordToken::TWO_SIDED_DELIMITER || type == LLKeywordToken::DOUBLE_QUOTATION_MARKS )
LLKeywordToken::ETokenType type = cur_delimiter->getType();
if( type == LLKeywordToken::TT_TWO_SIDED_DELIMITER || type == LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS )
{
while( *cur && !cur_delimiter->isTail(cur))
{
// Check for an escape sequence.
if (type == LLKeywordToken::DOUBLE_QUOTATION_MARKS && *cur == '\\')
if (type == LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS && *cur == '\\')
{
// Count the number of backslashes.
S32 num_backslashes = 0;
@ -513,7 +631,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
}
else
{
llassert( cur_delimiter->getType() == LLKeywordToken::ONE_SIDED_DELIMITER );
llassert( cur_delimiter->getType() == LLKeywordToken::TT_ONE_SIDED_DELIMITER );
// Left side is the delimiter. Right side is eol or eof.
while( *cur && ('\n' != *cur) )
{
@ -555,11 +673,11 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
S32 seg_start = cur - base;
S32 seg_end = seg_start + seg_len;
// LL_INFOS() << "Seg: [" << word.c_str() << "]" << LL_ENDL;
// llinfos << "Seg: [" << word.c_str() << "]" << llendl;
insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, defaultColor, editor);
}
cur += seg_len;
cur += seg_len;
continue;
}
}
@ -575,7 +693,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
void LLKeywords::insertSegments(const LLWString& wtext, std::vector<LLTextSegmentPtr>& seg_list, LLKeywordToken* cur_token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor )
{
std::string::size_type pos = wtext.find('\n',seg_start);
while (pos!=-1 && pos < (std::string::size_type)seg_end)
{
if (pos!=seg_start)
@ -622,10 +740,10 @@ void LLKeywords::insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSe
#ifdef _DEBUG
void LLKeywords::dump()
{
LL_INFOS() << "LLKeywords" << LL_ENDL;
llinfos << "LLKeywords" << llendl;
LL_INFOS() << "LLKeywords::sWordTokenMap" << LL_ENDL;
llinfos << "LLKeywords::sWordTokenMap" << llendl;
word_token_map_t::iterator word_token_iter = mWordTokenMap.begin();
while( word_token_iter != mWordTokenMap.end() )
{
@ -634,7 +752,7 @@ void LLKeywords::dump()
++word_token_iter;
}
LL_INFOS() << "LLKeywords::sLineTokenList" << LL_ENDL;
llinfos << "LLKeywords::sLineTokenList" << llendl;
for (token_list_t::iterator iter = mLineTokenList.begin();
iter != mLineTokenList.end(); ++iter)
{
@ -643,7 +761,7 @@ void LLKeywords::dump()
}
LL_INFOS() << "LLKeywords::sDelimiterTokenList" << LL_ENDL;
llinfos << "LLKeywords::sDelimiterTokenList" << llendl;
for (token_list_t::iterator iter = mDelimiterTokenList.begin();
iter != mDelimiterTokenList.end(); ++iter)
{
@ -654,12 +772,12 @@ void LLKeywords::dump()
void LLKeywordToken::dump()
{
LL_INFOS() << "[" <<
llinfos << "[" <<
mColor.mV[VX] << ", " <<
mColor.mV[VY] << ", " <<
mColor.mV[VZ] << "] [" <<
wstring_to_utf8str(mToken) << "]" <<
LL_ENDL;
llendl;
}
#endif // DEBUG

View File

@ -1,25 +1,25 @@
/**
/**
* @file llkeywords.h
* @brief Keyword list for LSL
*
* $LicenseInfo:firstyear=2001&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$
*/
@ -28,8 +28,10 @@
#define LL_LLKEYWORDS_H
#include "lldir.h"
#include "llstring.h"
#include "v3color.h"
#include "v4color.h"
#include <map>
#include <list>
#include <deque>
@ -41,26 +43,35 @@ typedef LLPointer<LLTextSegment> LLTextSegmentPtr;
class LLKeywordToken
{
public:
/**
/**
* @brief Types of tokens/delimters being parsed.
*
* @desc Tokens/delimiters that need to be identified/highlighted. All are terminated if an EOF is encountered.
* - WORD are keywords in the normal sense, i.e. constants, events, etc.
* - LINE are for entire lines (currently only flow control labels use this).
* - ONE_SIDED_DELIMITER are for open-ended delimiters which are terminated by EOL.
* - TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with.
* - DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close.
* - TT_WORD are keywords in the normal sense, i.e. constants, events, etc.
* - TT_LINE are for entire lines (currently only flow control labels use this).
* - TT_ONE_SIDED_DELIMITER are for open-ended delimiters which are terminated by EOL.
* - TT_TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with.
* - TT_DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close.
*/
enum TOKEN_TYPE
typedef enum e_token_type
{
WORD,
LINE,
TWO_SIDED_DELIMITER,
ONE_SIDED_DELIMITER,
DOUBLE_QUOTATION_MARKS
};
TT_UNKNOWN,
TT_WORD,
TT_LINE,
TT_TWO_SIDED_DELIMITER,
TT_ONE_SIDED_DELIMITER,
TT_DOUBLE_QUOTATION_MARKS,
// Following constants are more specific versions of the preceding ones
TT_CONSTANT, // WORD
TT_CONTROL, // WORD
TT_EVENT, // WORD
TT_FUNCTION, // WORD
TT_LABEL, // LINE
TT_SECTION, // WORD
TT_TYPE // WORD
} ETokenType;
LLKeywordToken( TOKEN_TYPE type, const LLColor3& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
LLKeywordToken( ETokenType type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
:
mType( type ),
mToken( token ),
@ -72,11 +83,11 @@ public:
S32 getLengthHead() const { return mToken.size(); }
S32 getLengthTail() const { return mDelimiter.size(); }
BOOL isHead(const llwchar* s) const;
BOOL isTail(const llwchar* s) const;
bool isHead(const llwchar* s) const;
bool isTail(const llwchar* s) const;
const LLWString& getToken() const { return mToken; }
const LLColor3& getColor() const { return mColor; }
TOKEN_TYPE getType() const { return mType; }
const LLColor4& getColor() const { return mColor; }
ETokenType getType() const { return mType; }
const LLWString& getToolTip() const { return mToolTip; }
const LLWString& getDelimiter() const { return mDelimiter; }
@ -85,9 +96,9 @@ public:
#endif
private:
TOKEN_TYPE mType;
ETokenType mType;
LLWString mToken;
LLColor3 mColor;
LLColor4 mColor;
LLWString mToolTip;
LLWString mDelimiter;
};
@ -98,18 +109,24 @@ public:
LLKeywords();
~LLKeywords();
BOOL loadFromFile(const std::string& filename);
BOOL isLoaded() const { return mLoaded; }
void clearLoaded() { mLoaded = false; }
LLColor4 getColorGroup(const std::string& key_in);
bool isLoaded() const { return mLoaded; }
void findSegments(std::vector<LLTextSegmentPtr> *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor );
void findSegments(std::vector<LLTextSegmentPtr> *seg_list,
const LLWString& text,
const LLColor4 &defaultColor,
class LLTextEditor& editor);
void initialize(LLSD SyntaxXML);
void processTokens();
// Add the token as described
void addToken(LLKeywordToken::TOKEN_TYPE type,
void addToken(LLKeywordToken::ETokenType type,
const std::string& key,
const LLColor3& color,
const LLColor4& color,
const std::string& tool_tip = LLStringUtil::null,
const std::string& delimiter = LLStringUtil::null);
// This class is here as a performance optimization.
// The word token map used to be defined as std::map<LLWString, LLKeywordToken*>.
// This worked, but caused a performance bottleneck due to memory allocation and string copies
@ -133,6 +150,9 @@ public:
const llwchar *mData;
size_t mLength;
bool mOwner;
LLColor4 mColor;
};
typedef std::map<WStringMapIndex, LLKeywordToken*> word_token_map_t;
@ -140,20 +160,43 @@ public:
keyword_iterator_t begin() const { return mWordTokenMap.begin(); }
keyword_iterator_t end() const { return mWordTokenMap.end(); }
typedef std::map<WStringMapIndex, LLColor4> group_color_map_t;
typedef group_color_map_t::const_iterator color_iterator_t;
group_color_map_t mColorGroupMap;
#ifdef _DEBUG
void dump();
#endif
private:
LLColor3 readColor(const std::string& s);
void insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor);
void insertSegments(const LLWString& wtext, std::vector<LLTextSegmentPtr>& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor);
protected:
void processTokensGroup(const LLSD& Tokens, const std::string& Group);
void insertSegment(std::vector<LLTextSegmentPtr>& seg_list,
LLTextSegmentPtr new_segment,
S32 text_len,
const LLColor4 &defaultColor,
class LLTextEditor& editor);
void insertSegments(const LLWString& wtext,
std::vector<LLTextSegmentPtr>& seg_list,
LLKeywordToken* token,
S32 text_len,
S32 seg_start,
S32 seg_end,
const LLColor4 &defaultColor,
LLTextEditor& editor);
BOOL mLoaded;
bool mLoaded;
LLSD mSyntax;
word_token_map_t mWordTokenMap;
typedef std::deque<LLKeywordToken*> token_list_t;
token_list_t mLineTokenList;
token_list_t mDelimiterTokenList;
typedef std::map<std::string, std::string> element_attributes_t;
typedef element_attributes_t::const_iterator attribute_iterator_t;
element_attributes_t mAttributes;
std::string getAttribute(const std::string& key);
std::string getArguments(LLSD& arguments);
};
#endif // LL_LLKEYWORDS_H

View File

@ -1189,6 +1189,7 @@ void LLNotificationChannel::connectToChannel( const std::string& channel_name )
}
else
{
mParents.push_back(channel_name);
LLNotificationChannelPtr p = LLNotifications::instance().getChannel(channel_name);
p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
}

View File

@ -88,6 +88,7 @@
#include <boost/enable_shared_from_this.hpp>
#include <boost/type_traits.hpp>
#include <boost/signals2.hpp>
#include <boost/range.hpp>
#include "llevents.h"
#include "llfunctorregistry.h"
@ -840,6 +841,11 @@ public:
typedef LLNotificationSet::iterator Iterator;
std::string getName() const { return mName; }
typedef std::vector<std::string>::const_iterator parents_iter;
boost::iterator_range<parents_iter> getParents() const
{
return boost::iterator_range<parents_iter>(mParents);
}
void connectToChannel(const std::string& channel_name);
@ -854,7 +860,7 @@ public:
private:
std::string mName;
std::string mParent;
std::vector<std::string> mParents;
};
// An interface class to provide a clean linker seam to the LLNotifications class.

View File

@ -32,6 +32,7 @@
#include "llnotificationtemplate.h"
#include "llsd.h"
#include "llui.h"
#include <boost/foreach.hpp>
LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :
LLEventAPI("LLNotifications",
@ -42,11 +43,10 @@ LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications
"Add a notification with specified [\"name\"], [\"substitutions\"] and [\"payload\"].\n"
"If optional [\"reply\"] specified, arrange to send user response on that LLEventPump.",
&LLNotificationsListener::requestAdd);
/* add("listChannels",
add("listChannels",
"Post to [\"reply\"] a map of info on existing channels",
&LLNotificationsListener::listChannels,
LLSD().with("reply", LLSD()));
*/
add("listChannelNotifications",
"Post to [\"reply\"] an array of info on notifications in channel [\"channel\"]",
&LLNotificationsListener::listChannelNotifications,
@ -117,26 +117,27 @@ void LLNotificationsListener::NotificationResponder(const std::string& reply_pum
reponse_event["response"] = response;
LLEventPumps::getInstance()->obtain(reply_pump).post(reponse_event);
}
/*
void LLNotificationsListener::listChannels(const LLSD& params) const
{
LLReqID reqID(params);
LLSD response(reqID.makeResponse());
for (LLNotifications::
for (LLNotifications::ChannelMap::const_iterator cmi(mNotifications.mChannels.begin()),
cmend(mNotifications.mChannels.end());
for (LLNotificationChannel::instance_iter cmi(LLNotificationChannel::beginInstances()),
cmend(LLNotificationChannel::endInstances());
cmi != cmend; ++cmi)
{
LLSD channelInfo;
channelInfo["parent"] = cmi->second->getParentChannelName();
response[cmi->first] = channelInfo;
LLSD channelInfo, parents;
BOOST_FOREACH(const std::string& parent, cmi->getParents())
{
parents.append(parent);
}
channelInfo["parents"] = parents;
channelInfo["parent"] = parents.size()? parents[0] : "";
response[cmi->getName()] = channelInfo;
}
LLEventPumps::instance().obtain(params["reply"]).post(response);
}
*/
void LLNotificationsListener::listChannelNotifications(const LLSD& params) const
{
LLReqID reqID(params);

View File

@ -70,43 +70,36 @@ bool LLTextBase::compare_segment_end::operator()(const LLTextSegmentPtr& a, cons
// helper functors
struct LLTextBase::compare_bottom
bool LLTextBase::compare_bottom::operator()(const S32& a, const LLTextBase::line_info& b) const
{
bool operator()(const S32& a, const LLTextBase::line_info& b) const
{
return a > b.mRect.mBottom; // bottom of a is higher than bottom of b
}
return a > b.mRect.mBottom; // bottom of a is higher than bottom of b
}
bool operator()(const LLTextBase::line_info& a, const S32& b) const
{
return a.mRect.mBottom > b; // bottom of a is higher than bottom of b
}
bool LLTextBase::compare_bottom::operator()(const LLTextBase::line_info& a, const S32& b) const
{
return a.mRect.mBottom > b; // bottom of a is higher than bottom of b
}
bool operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
{
return a.mRect.mBottom > b.mRect.mBottom; // bottom of a is higher than bottom of b
}
};
bool LLTextBase::compare_bottom::operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
{
return a.mRect.mBottom > b.mRect.mBottom; // bottom of a is higher than bottom of b
}
// helper functors
struct LLTextBase::compare_top
bool LLTextBase::compare_top::operator()(const S32& a, const LLTextBase::line_info& b) const
{
bool operator()(const S32& a, const LLTextBase::line_info& b) const
{
return a > b.mRect.mTop; // top of a is higher than top of b
}
return a > b.mRect.mTop; // top of a is higher than top of b
}
bool operator()(const LLTextBase::line_info& a, const S32& b) const
{
return a.mRect.mTop > b; // top of a is higher than top of b
}
bool LLTextBase::compare_top::operator()(const LLTextBase::line_info& a, const S32& b) const
{
return a.mRect.mTop > b; // top of a is higher than top of b
}
bool operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
{
return a.mRect.mTop > b.mRect.mTop; // top of a is higher than top of b
}
};
bool LLTextBase::compare_top::operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
{
return a.mRect.mTop > b.mRect.mTop; // top of a is higher than top of b
}
struct LLTextBase::line_end_compare
{
@ -573,7 +566,8 @@ void LLTextBase::drawText()
if ( (getSpellCheck()) && (getWText().length() > 2) )
{
// Calculate start and end indices for the spell checking range
S32 start = line_start, end = getLineEnd(last_line);
S32 start = line_start;
S32 end = getLineEnd(last_line);
if ( (mSpellCheckStart != start) || (mSpellCheckEnd != end) )
{

View File

@ -451,9 +451,31 @@ public:
LLScrollContainer* getScrollContainer() const { return mScroller; }
protected:
// protected member variables
// List of offsets and segment index of the start of each line. Always has at least one node (0).
struct line_info
{
line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num);
S32 mDocIndexStart;
S32 mDocIndexEnd;
LLRect mRect;
S32 mLineNum; // actual line count (ignoring soft newlines due to word wrap)
};
typedef std::vector<line_info> line_list_t;
// helper structs
struct compare_bottom;
struct compare_top;
struct compare_bottom
{
bool operator()(const S32& a, const line_info& b) const;
bool operator()(const line_info& a, const S32& b) const;
bool operator()(const line_info& a, const line_info& b) const;
};
struct compare_top
{
bool operator()(const S32& a, const line_info& b) const;
bool operator()(const line_info& a, const S32& b) const;
bool operator()(const line_info& a, const line_info& b) const;
};
struct line_end_compare;
typedef std::vector<LLTextSegmentPtr> segment_vec_t;
@ -501,18 +523,6 @@ protected:
};
typedef std::multiset<LLTextSegmentPtr, compare_segment_end> segment_set_t;
// protected member variables
// List of offsets and segment index of the start of each line. Always has at least one node (0).
struct line_info
{
line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num);
S32 mDocIndexStart;
S32 mDocIndexEnd;
LLRect mRect;
S32 mLineNum; // actual line count (ignoring soft newlines due to word wrap)
};
typedef std::vector<line_info> line_list_t;
// member functions
LLTextBase(const Params &p);
virtual ~LLTextBase();
@ -522,7 +532,7 @@ protected:
virtual bool useLabel() const;
// draw methods
void drawSelectionBackground(); // draws the black box behind the selected text
virtual void drawSelectionBackground(); // draws the black box behind the selected text
void drawCursor();
void drawText();

View File

@ -75,8 +75,6 @@ template class LLTextEditor* LLView::getChild<class LLTextEditor>(
//
// Constants
//
const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 32;
const S32 UI_TEXTEDITOR_LINE_NUMBER_DIGITS = 4;
const S32 SPACES_PER_TAB = 4;
const F32 SPELLCHECK_DELAY = 0.5f; // delay between the last keypress and spell checking the word the cursor is on
@ -236,7 +234,6 @@ LLTextEditor::Params::Params()
prevalidate_callback("prevalidate_callback"),
embedded_items("embedded_items", false),
ignore_tab("ignore_tab", true),
show_line_numbers("show_line_numbers", false),
auto_indent("auto_indent", true),
default_color("default_color"),
commit_on_focus_lost("commit_on_focus_lost", false),
@ -252,8 +249,7 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
mBaseDocIsPristine(TRUE),
mPristineCmd( NULL ),
mLastCmd( NULL ),
mDefaultColor( p.default_color() ),
mShowLineNumbers ( p.show_line_numbers ),
mDefaultColor( p.default_color() ),
mAutoIndent(p.auto_indent),
mCommitOnFocusLost( p.commit_on_focus_lost),
mAllowEmbeddedItems( p.embedded_items ),
@ -278,14 +274,7 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
params.visible = p.border_visible;
mBorder = LLUICtrlFactory::create<LLViewBorder> (params);
addChild( mBorder );
setText(p.default_text());
if (mShowLineNumbers)
{
mHPad += UI_TEXTEDITOR_LINE_NUMBER_MARGIN;
updateRects();
}
mParseOnTheFly = TRUE;
}
@ -2198,69 +2187,6 @@ void LLTextEditor::drawPreeditMarker()
}
}
void LLTextEditor::drawLineNumbers()
{
LLGLSUIDefault gls_ui;
LLRect scrolled_view_rect = getVisibleDocumentRect();
LLRect content_rect = getVisibleTextRect();
LLLocalClipRect clip(content_rect);
S32 first_line = getFirstVisibleLine();
S32 num_lines = getLineCount();
if (first_line >= num_lines)
{
return;
}
S32 cursor_line = mLineInfoList[getLineNumFromDocIndex(mCursorPos)].mLineNum;
if (mShowLineNumbers)
{
S32 left = 0;
S32 top = getRect().getHeight();
S32 bottom = 0;
gl_rect_2d(left, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN, bottom, mReadOnlyBgColor.get() ); // line number area always read-only
gl_rect_2d(UI_TEXTEDITOR_LINE_NUMBER_MARGIN, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN-1, bottom, LLColor4::grey3); // separator
S32 last_line_num = -1;
for (S32 cur_line = first_line; cur_line < num_lines; cur_line++)
{
line_info& line = mLineInfoList[cur_line];
if ((line.mRect.mTop - scrolled_view_rect.mBottom) < mVisibleTextRect.mBottom)
{
break;
}
S32 line_bottom = line.mRect.mBottom - scrolled_view_rect.mBottom + mVisibleTextRect.mBottom;
// draw the line numbers
if(line.mLineNum != last_line_num && line.mRect.mTop <= scrolled_view_rect.mTop)
{
const LLFontGL *num_font = LLFontGL::getFontMonospace();
const LLWString ltext = utf8str_to_wstring(llformat("%d", line.mLineNum ));
BOOL is_cur_line = cursor_line == line.mLineNum;
const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL;
const LLColor4 fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor;
num_font->render(
ltext, // string to draw
0, // begin offset
UI_TEXTEDITOR_LINE_NUMBER_MARGIN - 2, // x
line_bottom, // y
fg_color,
LLFontGL::RIGHT, // horizontal alignment
LLFontGL::BOTTOM, // vertical alignment
style,
LLFontGL::NO_SHADOW,
S32_MAX, // max chars
UI_TEXTEDITOR_LINE_NUMBER_MARGIN - 2); // max pixels
last_line_num = line.mLineNum;
}
}
}
}
void LLTextEditor::draw()
{
{
@ -2272,7 +2198,6 @@ void LLTextEditor::draw()
}
LLTextBase::draw();
drawLineNumbers();
drawPreeditMarker();
@ -2514,53 +2439,6 @@ BOOL LLTextEditor::tryToRevertToPristineState()
return isPristine(); // TRUE => success
}
static LLTrace::BlockTimerStatHandle FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting");
void LLTextEditor::loadKeywords(const std::string& filename,
const std::vector<std::string>& funcs,
const std::vector<std::string>& tooltips,
const LLColor3& color)
{
LL_RECORD_BLOCK_TIME(FTM_SYNTAX_HIGHLIGHTING);
if(mKeywords.loadFromFile(filename))
{
S32 count = llmin(funcs.size(), tooltips.size());
for(S32 i = 0; i < count; i++)
{
std::string name = utf8str_trim(funcs[i]);
mKeywords.addToken(LLKeywordToken::WORD, name, color, tooltips[i] );
}
segment_vec_t segment_list;
mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
mSegments.clear();
segment_set_t::iterator insert_it = mSegments.begin();
for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
{
insert_it = mSegments.insert(insert_it, *list_it);
}
}
}
void LLTextEditor::updateSegments()
{
if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly)
{
LL_RECORD_BLOCK_TIME(FTM_SYNTAX_HIGHLIGHTING);
// HACK: No non-ascii keywords for now
segment_vec_t segment_list;
mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
clearSegments();
for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
{
insertSegment(*list_it);
}
}
LLTextBase::updateSegments();
}
void LLTextEditor::updateLinkSegments()
{
LLWString wtext = getWText();

View File

@ -1,25 +1,25 @@
/**
/**
* @file lltexteditor.h
* @brief LLTextEditor base class
*
* $LicenseInfo:firstyear=2001&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$
*/
@ -30,7 +30,6 @@
#define LL_LLTEXTEDITOR_H
#include "llrect.h"
#include "llkeywords.h"
#include "llframetimer.h"
#include "llstyle.h"
#include "lleditmenuhandler.h"
@ -43,7 +42,6 @@
class LLFontGL;
class LLScrollbar;
class LLKeywordToken;
class TextCmd;
class LLUICtrlFactory;
class LLScrollContainer;
@ -60,7 +58,6 @@ public:
Optional<bool> embedded_items,
ignore_tab,
show_line_numbers,
commit_on_focus_lost,
show_context_menu,
enable_tooltip_paste,
@ -131,7 +128,7 @@ public:
virtual BOOL canCopy() const;
virtual void paste();
virtual BOOL canPaste() const;
virtual void updatePrimary();
virtual void copyPrimary();
virtual void pastePrimary();
@ -149,7 +146,7 @@ public:
void selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE);
BOOL replaceText(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive, BOOL wrap = TRUE);
void replaceTextAll(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive);
// Undo/redo stack
void blockUndo();
@ -186,13 +183,6 @@ public:
void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap );
void loadKeywords(const std::string& filename,
const std::vector<std::string>& funcs,
const std::vector<std::string>& tooltips,
const LLColor3& func_color);
LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); }
LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); }
// Hacky methods to make it into a word-wrapping, potentially scrolling,
// read-only text box.
void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; }
@ -204,7 +194,7 @@ public:
const LLUUID& getSourceID() const { return mSourceID; }
const LLTextSegmentPtr getPreviousSegment() const;
void getSelectedSegments(segment_vec_t& segments) const;
void getSelectedSegments(segment_vec_t& segments) const;
void setShowContextMenu(bool show) { mShowContextMenu = show; }
bool getShowContextMenu() const { return mShowContextMenu; }
@ -216,7 +206,7 @@ protected:
void drawPreeditMarker();
void assignEmbedded(const std::string &s);
void removeCharOrTab();
void indentSelectedLines( S32 spaces );
@ -235,12 +225,12 @@ protected:
S32 nextWordPos(S32 cursorPos) const;
void autoIndent();
void findEmbeddedItemSegments(S32 start, S32 end);
void getSegmentsInRange(segment_vec_t& segments, S32 start, S32 end, bool include_partial) const;
virtual llwchar pasteEmbeddedItem(llwchar ext_char) { return ext_char; }
// Here's the method that takes and applies text commands.
S32 execute(TextCmd* cmd);
@ -254,7 +244,7 @@ protected:
S32 removeChar(S32 pos);
S32 insert(S32 pos, const LLWString &wstr, bool group_with_next_op, LLTextSegmentPtr segment);
S32 remove(S32 pos, S32 length, bool group_with_next_op);
void focusLostHelper();
void updateAllowingLanguageInput();
BOOL hasPreeditString() const;
@ -272,14 +262,14 @@ protected:
//
// Protected data
//
// Probably deserves serious thought to hiding as many of these
// Probably deserves serious thought to hiding as many of these
// as possible behind protected accessor methods.
//
// Use these to determine if a click on an embedded item is a drag or not.
S32 mMouseDownX;
S32 mMouseDownY;
LLWString mPreeditWString;
LLWString mPreeditOverwrittenWString;
std::vector<S32> mPreeditPositions;
@ -288,12 +278,12 @@ protected:
protected:
LLUIColor mDefaultColor;
BOOL mShowLineNumbers;
bool mAutoIndent;
bool mParseOnTheFly;
/*virtual*/ void updateSegments();
void updateLinkSegments();
void keepSelectionOnReturn(bool keep) { mKeepSelectionOnReturn = keep; }
class LLViewBorder* mBorder;
private:
//
@ -303,23 +293,14 @@ private:
void cleanStringForPaste(LLWString & clean_string);
void pasteTextWithLinebreaks(LLWString & clean_string);
void drawLineNumbers();
void onKeyStroke();
//
// Data
//
LLKeywords mKeywords;
// Concrete TextCmd sub-classes used by the LLTextEditor base class
class TextCmdInsert;
class TextCmdAddChar;
class TextCmdOverwriteChar;
class TextCmdRemove;
class LLViewBorder* mBorder;
BOOL mBaseDocIsPristine;
TextCmd* mPristineCmd;
@ -334,7 +315,6 @@ private:
BOOL mAllowEmbeddedItems;
bool mShowContextMenu;
bool mParseOnTheFly;
bool mEnableTooltipPaste;
bool mPassDelete;
bool mKeepSelectionOnReturn; // disabling of removing selected text after pressing of Enter
@ -355,4 +335,4 @@ extern template class LLTextEditor* LLView::getChild<class LLTextEditor>(
const std::string& name, BOOL recurse) const;
#endif
#endif // LL_TEXTEDITOR_
#endif // LL_TEXTEDITOR_H

View File

@ -30,7 +30,7 @@
#include "llxmlnode.h"
#include "llfasttimer.h"
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
#include <expat.h>
#else
#include "expat/expat.h"

View File

@ -105,7 +105,7 @@ BOOL LLVFile::read(U8 *buffer, S32 bytes, BOOL async, F32 priority)
// We can't do a read while there are pending async writes
waitForLock(VFSLOCK_APPEND);
// *FIX: (???)
// *FIX: (?)
if (async)
{
mHandle = sVFSThread->read(mVFS, mFileID, mFileType, buffer, mPosition, bytes, threadPri());

View File

@ -51,9 +51,9 @@ namespace tut
void test_chop_662(void)
{
// Check a selection of bad group names from the crash reports
LLDirIterator iter(".","+bad-group-name]+??-??.*");
LLDirIterator iter1(".","))--@---bad-group-name2((??-??.*\\.txt");
LLDirIterator iter2(".","__^v--x)Cuide d sua vida(x--v^__??-??.*");
LLDirIterator iter(".","+bad-group-name]+?\?-??.*");
LLDirIterator iter1(".","))--@---bad-group-name2((?\?-??.*\\.txt");
LLDirIterator iter2(".","__^v--x)Cuide d sua vida(x--v^__?\?-??.*");
}
template<> template<>

View File

@ -71,7 +71,7 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type)
}
S32 result = 0;
#if LL_MESA_HEADLESS // !!! *FIX: (???)
#if LL_MESA_HEADLESS // !!! *FIX: (?)
LL_WARNS() << "OSMessageBox: " << text << LL_ENDL;
return OSBTN_OK;
#elif LL_WINDOWS
@ -323,7 +323,7 @@ bool LLSplashScreen::isVisible()
// static
LLSplashScreen *LLSplashScreen::create()
{
#if LL_MESA_HEADLESS || LL_SDL // !!! *FIX: (???)
#if LL_MESA_HEADLESS || LL_SDL // !!! *FIX: (?)
return 0;
#elif LL_WINDOWS
return new LLSplashScreenWin32;

View File

@ -39,6 +39,7 @@
#include "indra_constants.h"
#include <OpenGL/OpenGL.h>
#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>
extern BOOL gDebugWindowProc;
@ -1743,16 +1744,34 @@ LLSD LLWindowMacOSX::getNativeKeyData()
return result;
}
BOOL LLWindowMacOSX::dialogColorPicker( F32 *r, F32 *g, F32 *b)
{
// Is this even used anywhere? Do we really need an OS color picker?
BOOL retval = FALSE;
//S32 error = 0;
OSErr error = noErr;
NColorPickerInfo info;
memset(&info, 0, sizeof(info));
info.theColor.color.rgb.red = (UInt16)(*r * 65535.f);
info.theColor.color.rgb.green = (UInt16)(*g * 65535.f);
info.theColor.color.rgb.blue = (UInt16)(*b * 65535.f);
info.placeWhere = kCenterOnMainScreen;
error = NPickColor(&info);
if (error == noErr)
{
retval = info.newColorChosen;
if (info.newColorChosen)
{
*r = ((float) info.theColor.color.rgb.red) / 65535.0;
*g = ((float) info.theColor.color.rgb.green) / 65535.0;
*b = ((float) info.theColor.color.rgb.blue) / 65535.0;
}
}
return (retval);
}
void *LLWindowMacOSX::getPlatformWindow()
{
// NOTE: this will be NULL in fullscreen mode. Plan accordingly.

View File

@ -223,7 +223,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
mOriginalAspectRatio = 1024.0 / 768.0;
if (title.empty())
mWindowTitle = "SDL Window"; // *FIX: (???)
mWindowTitle = "SDL Window"; // *FIX: (?)
else
mWindowTitle = title;
@ -956,7 +956,7 @@ BOOL LLWindowSDL::setPosition(const LLCoordScreen position)
{
if(mWindow)
{
// *FIX: (???)
// *FIX: (?)
//MacMoveWindow(mWindow, position.mX, position.mY, false);
}

View File

@ -30,7 +30,7 @@
#ifndef XML_STATIC
#define XML_STATIC
#endif
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
#include <expat.h>
#else
#include "expat/expat.h"

View File

@ -30,7 +30,7 @@
#ifndef XML_STATIC
#define XML_STATIC
#endif
#ifdef LL_STANDALONE
#ifdef LL_USESYSTEMLIBS
#include <expat.h>
#else
#include "expat/expat.h"

View File

@ -276,6 +276,7 @@ set(viewer_SOURCE_FILES
llfloaterregionrestarting.cpp
llfloatersceneloadstats.cpp
llfloaterscriptdebug.cpp
llfloaterscriptedprefs.cpp
llfloaterscriptlimits.cpp
llfloatersearch.cpp
llfloatersellland.cpp
@ -501,6 +502,7 @@ set(viewer_SOURCE_FILES
llscenemonitor.cpp
llsceneview.cpp
llscreenchannel.cpp
llscripteditor.cpp
llscriptfloater.cpp
llscrollingpanelparam.cpp
llscrollingpanelparambase.cpp
@ -530,6 +532,7 @@ set(viewer_SOURCE_FILES
llstylemap.cpp
llsurface.cpp
llsurfacepatch.cpp
llsyntaxid.cpp
llsyswellitem.cpp
llsyswellwindow.cpp
llteleporthistory.cpp
@ -877,6 +880,7 @@ set(viewer_HEADER_FILES
llfloaterregionrestarting.h
llfloatersceneloadstats.h
llfloaterscriptdebug.h
llfloaterscriptedprefs.h
llfloaterscriptlimits.h
llfloatersearch.h
llfloatersellland.h
@ -1089,6 +1093,7 @@ set(viewer_HEADER_FILES
llscenemonitor.h
llsceneview.h
llscreenchannel.h
llscripteditor.h
llscriptfloater.h
llscrollingpanelparam.h
llscrollingpanelparambase.h
@ -1117,6 +1122,7 @@ set(viewer_HEADER_FILES
llstylemap.h
llsurface.h
llsurfacepatch.h
llsyntaxid.h
llsyswellitem.h
llsyswellwindow.h
lltable.h
@ -1474,9 +1480,9 @@ if (WINDOWS)
SOURCE_GROUP("Resource Files" FILES ${viewer_RESOURCE_FILES})
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES})
endif (NOT STANDALONE)
endif (NOT USESYSTEMLIBS)
find_library(DINPUT_LIBRARY dinput8 ${DIRECTX_LIBRARY_DIR})
find_library(DXGUID_LIBRARY dxguid ${DIRECTX_LIBRARY_DIR})
@ -1551,7 +1557,7 @@ set(viewer_APPSETTINGS_FILES
app_settings/high_graphics.xml
app_settings/ignorable_dialogs.xml
app_settings/keys.xml
app_settings/keywords.ini
app_settings/keywords_lsl_default.xml
app_settings/logcontrol.xml
app_settings/low_graphics.xml
app_settings/mid_graphics.xml
@ -1587,9 +1593,9 @@ source_group("Character File" FILES ${viewer_CHARACTER_FILES})
set_source_files_properties(${viewer_CHARACTER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
if (NOT STANDALONE)
if (NOT USESYSTEMLIBS)
list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES})
endif (NOT STANDALONE)
endif (NOT USESYSTEMLIBS)
if (WINDOWS)
file(GLOB viewer_INSTALLER_FILES installers/windows/*.nsi)
@ -1871,7 +1877,7 @@ elseif (DARWIN)
LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP"
)
else (WINDOWS)
# Linux
# Linux
set_target_properties(${VIEWER_BINARY_NAME}
PROPERTIES
LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Wl,--Map=${VIEWER_BINARY_NAME}.MAP"
@ -2056,7 +2062,7 @@ if (DARWIN)
)
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger)
if (ENABLE_SIGNING)
set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}")
else (ENABLE_SIGNING)

View File

@ -1 +1 @@
3.7.11
3.7.12

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,390 @@
<?xml version="1.0" encoding="UTF-8"?>
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<element name="llsd">
<element name="map">
<group>
<element name="key">
<value>constants</value>
</element>
<element name="map">
<oneOrMore>
<group>
<ref name="keyString"/>
<element name="map">
<ref name="Deprecated" />
<ref name="constantTypeValue" />
<ref name="Tooltip" />
</element>
</group>
</oneOrMore>
</element>
</group>
<group>
<element name="key">
<value>controls</value>
</element>
<element name="map">
<oneOrMore>
<group>
<ref name="keyString"/>
<ref name="mapTooltip"/>
</group>
</oneOrMore>
</element>
</group>
<group>
<element name="key">
<value>events</value>
</element>
<element name="map">
<oneOrMore>
<group>
<ref name="keyString"/>
<element name="map">
<ref name="Deprecated" />
<ref name="Arguments"/>
<ref name="Tooltip"/>
</element>
</group>
</oneOrMore>
</element>
</group>
<group>
<element name="key">
<value>functions</value>
</element>
<element name="map">
<oneOrMore>
<group>
<ref name="keyString"/>
<element name="map">
<ref name="Arguments"/>
<ref name="Deprecated" />
<element name="key">
<value>energy</value>
</element>
<ref name="float"/>
<optional>
<group>
<element name="key">
<value>god-mode</value>
</element>
<element name="boolean">
<data type="boolean"/>
</element>
</group>
</optional>
<ref name="Return"/>
<element name="key">
<value>sleep</value>
</element>
<ref name="float"/>
<ref name="Tooltip"/>
</element>
</group>
</oneOrMore>
</element>
</group>
<group>
<element name="key">
<value>llsd-lsl-syntax-version</value>
</element>
<element name="integer">
<data type="integer" />
</element>
</group>
<group>
<element name="key">
<value>types</value>
</element>
<element name="map">
<oneOrMore>
<group>
<ref name="keyString"/>
<ref name="mapTooltip"/>
</group>
</oneOrMore>
</element>
</group>
</element>
</element>
</start>
<define name="Deprecated">
<optional>
<group>
<element name="key">
<value>deprecated</value>
</element>
<element name="boolean">
<data type="boolean"/>
</element>
</group>
</optional>
</define>
<define name="keyName">
<element name="key"><value>name</value></element>
<element name="string"><data type="string" /></element>
</define>
<define name="keyString">
<element name="key"><data type="string"/></element>
</define>
<define name="keyType">
<element name="key"><value>type</value></element>
</define>
<define name="typeList">
<ref name="keyType" />
<element name="string">
<choice>
<value>float</value>
<value>integer</value>
<value>key</value>
<value>list</value>
<value>rotation</value>
<value>string</value>
<value>vector</value>
</choice>
</element>
</define>
<define name="keyValue">
<element name="key"><value>value</value></element>
</define>
<define name="constantTypeValue">
<choice>
<group>
<ref name="keyType"/>
<element name="string"><value>float</value></element>
<ref name="keyValue"/>
<element name="real"><data type="float"/></element>
</group>
<group>
<ref name="keyType"/>
<element name="string"><value>integer</value></element>
<ref name="keyValue"/>
<choice>
<element name="integer"><data type="integer"/></element>
<element name="integer"><data type="string"><param name="pattern">0x[0-9A-Fa-f]+</param></data></element>
</choice>
</group>
<group>
<ref name="keyType"/>
<element name="string"><value>key</value></element>
<ref name="keyValue"/>
<element name="uuid"><data type="string"><param name="pattern">[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}</param></data></element>
</group>
<group>
<ref name="keyType"/>
<element name="string"><value>rotation</value></element>
<ref name="keyValue"/>
<element name="array">
<element name="map">
<element name="key">
<value>x</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
<element name="map">
<element name="key">
<value>y</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
<element name="map">
<element name="key">
<value>z</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
<element name="map">
<element name="key"><value>w</value></element>
<ref name="realFromMinusOneToOne"/>
</element>
</element>
</group>
<group>
<ref name="keyType"/>
<element name="string"><value>string</value></element>
<ref name="keyValue"/>
<element name="string">
<data type="string"/>
</element>
</group>
<group>
<ref name="keyType"/>
<element name="string">
<value>vector</value>
</element>
<ref name="keyValue"/>
<element name="array">
<ref name="vector"/>
</element>
</group>
</choice>
</define>
<define name="nameType">
<ref name="keyName" />
<ref name="keyType" />
</define>
<define name="realFromMinusOneToOne">
<element name="real">
<data type="float">
<param name="pattern">([\-+]|)(1|0)\.\d+</param>
</data>
</element>
</define>
<define name="float">
<choice>
<element name="real">
<data type="float"/>
</element>
<element name="real">
<empty/>
</element>
</choice>
</define>
<define name="vector">
<element name="map">
<element name="key">
<value>x</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
<element name="map">
<element name="key">
<value>y</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
<element name="map">
<element name="key">
<value>z</value>
</element>
<ref name="realFromMinusOneToOne"/>
</element>
</define>
<define name="mapTooltip">
<element name="map">
<ref name="Tooltip" />
</element>
</define>
<define name="Tooltip">
<element name="key">
<value>tooltip</value>
</element>
<element name="string">
<data type="string" />
</element>
</define>
<define name="Arguments">
<element name="key"><value>arguments</value></element>
<choice>
<element name="array">
<oneOrMore>
<element name="map">
<element name="key"><data type="string"><param name="pattern">[A-Z][A-Za-z0-9_]*|[a-z]</param></data></element>
<element name="map">
<!--ref name="keyName" /-->
<ref name="Tooltip" />
<ref name="typeList" />
</element>
</element>
</oneOrMore>
<!--choice>
<oneOrMore>
<element name="map">
<ref name="Argument"/>
</element>
</oneOrMore>
<element name="undef">
<empty/>
</element>
</choice-->
</element>
<element name="undef"><empty/></element>
</choice>
</define>
<define name="Argument">
<ref name="keyType"/>
<choice>
<element name="string">
<value>float</value>
</element>
<element name="string">
<value>integer</value>
</element>
<element name="string">
<value>key</value>
</element>
<element name="string">
<value>list</value>
</element>
<element name="string">
<value>rotation</value>
</element>
<element name="string">
<value>string</value>
</element>
<element name="string">
<value>vector</value>
</element>
</choice>
<ref name="Tooltip"/>
</define>
<define name="Return">
<element name="key">
<value>return</value>
</element>
<choice>
<element name="string">
<value>float</value>
</element>
<element name="string">
<value>integer</value>
</element>
<element name="string">
<value>key</value>
</element>
<element name="string">
<value>list</value>
</element>
<element name="string">
<value>rotation</value>
</element>
<element name="string">
<value>string</value>
</element>
<element name="string">
<value>vector</value>
</element>
<element name="string">
<value>void</value>
</element>
</choice>
</define>
</grammar>

View File

@ -3554,17 +3554,6 @@
<key>Value</key>
<string>http://events.secondlife.com/viewer/embed/event/</string>
</map>
<key>EveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created objects</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FastCacheFetchEnabled</key>
<map>
<key>Comment</key>
@ -6480,39 +6469,6 @@
<key>Value</key>
<real>2.0</real>
</map>
<key>NextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created objects can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created objects can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created objects can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>NewCacheLocation</key>
<map>
<key>Comment</key>
@ -9005,7 +8961,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>384</real>
<real>368.0</real>
</map>
<key>RenderDeferred</key>
@ -10528,17 +10484,6 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>ShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created objects are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShowAdvancedGraphicsSettings</key>
<map>
<key>Comment</key>
@ -14756,6 +14701,347 @@
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ObjectsNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created objects can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ObjectsNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created objects can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ObjectsNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created objects can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ObjectsEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created object</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ObjectsShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created objects are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>UploadsNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly uploaded items can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>UploadsNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly uploaded items can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>UploadsNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly uploaded items can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>UploadsEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly uploaded item</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>UploadsShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly uploaded items are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ScriptsNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created scripts can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ScriptsNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created scripts can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ScriptsNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created scripts can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ScriptsEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created script</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ScriptsShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created scripts are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NotecardsNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created notecards can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>NotecardsNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created notecards can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>NotecardsNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created notecards can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>NotecardsEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created notecard</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NotecardsShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created notecards are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>GesturesNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created gestures can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>GesturesNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created gestures can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>GesturesNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created gestures can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>GesturesEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created gesture</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>GesturesShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created gestures are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>WearablesNextOwnerCopy</key>
<map>
<key>Comment</key>
<string>Newly created clothing or body part can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>WearablesNextOwnerModify</key>
<map>
<key>Comment</key>
<string>Newly created clothing or body part can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>WearablesNextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>Newly created clothing or body part can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>WearablesEveryoneCopy</key>
<map>
<key>Comment</key>
<string>Everyone can copy the newly created clothing or body part</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>WearablesShareWithGroup</key>
<map>
<key>Comment</key>
<string>Newly created clothing or body part is shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>DefaultUploadPermissionsConverted</key>
<map>
<key>Comment</key>
<string>Default upload permissions have been converted to default creation permissions</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>PathfindingRetrieveNeighboringRegion</key>
<map>
@ -15165,6 +15451,62 @@
<key>Value</key>
<string />
</map>
<key>EveryoneCopy</key>
<map>
<key>Comment</key>
<string>(obsolete) Everyone can copy the newly created objects</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NextOwnerCopy</key>
<map>
<key>Comment</key>
<string>(obsolete) Newly created objects can be copied by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NextOwnerModify</key>
<map>
<key>Comment</key>
<string>(obsolete) Newly created objects can be modified by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>NextOwnerTransfer</key>
<map>
<key>Comment</key>
<string>(obsolete) Newly created objects can be resold or given away by next owner</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ShareWithGroup</key>
<map>
<key>Comment</key>
<string>(obsolete) Newly created objects are shared with the currently active group</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -117,11 +117,14 @@ Var DO_UNINSTALL_V2 ; If non-null, path to a previous Viewer 2 installation
!include "FileFunc.nsh" ; For GetParameters, GetOptions
!insertmacro GetParameters
!insertmacro GetOptions
!include WinVer.nsh ; For OS and SP detection
!include x64.nsh ; For 64bit OS detection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; After install completes, launch app
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function .onInstSuccess
Call CheckWindowsServPack ; Warn if not on the latest SP before asking to launch.
Push $R0 # Option value, unused
StrCmp $SKIP_AUTORUN "true" +2;
# Assumes SetOutPath $INSTDIR
@ -138,26 +141,67 @@ Function dirPre
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Make sure we're not on Windows 98 / ME
; Make sure this computer meets the minimum system requirements.
; Currently: Windows 32bit XP SP3, 64bit XP SP2 and Server 2003 SP2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckWindowsVersion
DetailPrint "Checking Windows version..."
Call GetWindowsVersion
Pop $R0
; Just get first two characters, ignore 4.0 part of "NT 4.0"
StrCpy $R0 $R0 2
; Blacklist certain OS versions
StrCmp $R0 "95" win_ver_bad
StrCmp $R0 "98" win_ver_bad
StrCmp $R0 "ME" win_ver_bad
StrCmp $R0 "NT" win_ver_bad
Return
win_ver_bad:
StrCmp $SKIP_DIALOGS "true" +2 ; If skip_dialogs is set just install
MessageBox MB_YESNO $(CheckWindowsVersionMB) IDNO win_ver_abort
Return
win_ver_abort:
Quit
${If} ${AtMostWin2000}
MessageBox MB_OK $(CheckWindowsVersionMB)
Quit
${EndIf}
${If} ${IsWinXP}
${AndIfNot} ${RunningX64}
${AndIfNot} ${IsServicePack} 3
MessageBox MB_OK $(CheckWindowsVersionMB)
Quit
${EndIf}
${If} ${IsWinXP}
${AndIf} ${RunningX64}
${AndIfNot} ${IsServicePack} 2
MessageBox MB_OK $(CheckWindowsVersionMB)
Quit
${EndIf}
${If} ${IsWin2003}
${AndIfNot} ${IsServicePack} 2
MessageBox MB_OK $(CheckWindowsVersionMB)
Quit
${EndIf}
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Recommend Upgrading Service Pack
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckWindowsServPack
${If} ${IsWinVista}
${AndIfNot} ${IsServicePack} 2
MessageBox MB_OK $(CheckWindowsServPackMB)
DetailPrint $(UseLatestServPackDP)
Return
${EndIf}
${If} ${IsWin2008}
${AndIfNot} ${IsServicePack} 2
MessageBox MB_OK $(CheckWindowsServPackMB)
DetailPrint $(UseLatestServPackDP)
Return
${EndIf}
${If} ${IsWin7}
${AndIfNot} ${IsServicePack} 1
MessageBox MB_OK $(CheckWindowsServPackMB)
DetailPrint $(UseLatestServPackDP)
Return
${EndIf}
${If} ${IsWin2008R2}
${AndIfNot} ${IsServicePack} 1
MessageBox MB_OK $(CheckWindowsServPackMB)
DetailPrint $(UseLatestServPackDP)
Return
${EndIf}
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -208,17 +252,13 @@ FunctionEnd
; Checks for CPU valid (must have SSE2 support)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckCPUFlags
Call GetWindowsVersion
Pop $R0
StrCmp $R0 "2000" OK_SSE ; sse check not available on win2k.
Push $1
System::Call 'kernel32::IsProcessorFeaturePresent(i) i(10) .r1'
IntCmp $1 1 OK_SSE
MessageBox MB_OKCANCEL $(MissingSSE2) /SD IDOK IDOK OK_SSE
IntCmp $1 1 OK_SSE2
MessageBox MB_OKCANCEL $(MissingSSE2) /SD IDOK IDOK OK_SSE2
Quit
OK_SSE:
OK_SSE2:
Pop $1
Return
FunctionEnd
@ -754,103 +794,13 @@ Call un.ProgramFiles
SectionEnd ; end of uninstall section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; (From the NSIS documentation, JC)
; GetWindowsVersion
;
; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
; Updated by Joost Verburg
;
; Returns on top of stack
;
; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
; or
; '' (Unknown Windows Version)
;
; Usage:
; Call GetWindowsVersion
; Pop $R0
; ; at this point $R0 is "NT 4.0" or whatnot
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function GetWindowsVersion
Push $R0
Push $R1
ReadRegStr $R0 HKLM \
"SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
IfErrors 0 lbl_winnt
; we are not NT
ReadRegStr $R0 HKLM \
"SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
StrCpy $R1 $R0 1
StrCmp $R1 '4' 0 lbl_error
StrCpy $R1 $R0 3
StrCmp $R1 '4.0' lbl_win32_95
StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
lbl_win32_95:
StrCpy $R0 '95'
Goto lbl_done
lbl_win32_98:
StrCpy $R0 '98'
Goto lbl_done
lbl_win32_ME:
StrCpy $R0 'ME'
Goto lbl_done
lbl_winnt:
StrCpy $R1 $R0 1
StrCmp $R1 '3' lbl_winnt_x
StrCmp $R1 '4' lbl_winnt_x
StrCpy $R1 $R0 3
StrCmp $R1 '5.0' lbl_winnt_2000
StrCmp $R1 '5.1' lbl_winnt_XP
StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
lbl_winnt_x:
StrCpy $R0 "NT $R0" 6
Goto lbl_done
lbl_winnt_2000:
Strcpy $R0 '2000'
Goto lbl_done
lbl_winnt_XP:
Strcpy $R0 'XP'
Goto lbl_done
lbl_winnt_2003:
Strcpy $R0 '2003'
Goto lbl_done
lbl_error:
Strcpy $R0 ''
lbl_done:
Pop $R1
Exch $R0
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Note: to add new languages, add a language file include to the list
;; at the top of this file, add an entry to the menu and then add an
;; entry to the language ID selector below
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function .onInit
Call CheckWindowsVersion ; Don't install On unsupported systems
Push $0
${GetParameters} $COMMANDLINE ; get our command line
@ -924,13 +874,12 @@ StrCpy $INSTPROG "${INSTNAME}"
StrCpy $INSTEXE "${INSTEXE}"
StrCpy $INSTSHORTCUT "${SHORTCUT}"
Call CheckWindowsVersion ; warn if on Windows 98/ME
Call CheckCPUFlags ; Make sure we have SSE2 support
Call CheckCPUFlags ; Make sure we have SSE2 support
Call CheckIfAdministrator ; Make sure the user can install/uninstall
Call CheckIfAlreadyCurrent ; Make sure that we haven't already installed this version
Call CloseSecondLife ; Make sure we're not running
Call CheckNetworkConnection ; ping secondlife.com
Call CheckWillUninstallV2 ; See if a V2 install exists and will be removed.
Call CheckWillUninstallV2 ; See if a V2 install exists and will be removed.
Call CheckOldExeName ; Clean up a previous version of the exe
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -47,6 +47,7 @@
#include "llfirstuse.h"
#include "llfloatercamera.h"
#include "llfloaterimcontainer.h"
#include "llfloaterperms.h"
#include "llfloaterreg.h"
#include "llfloatertools.h"
#include "llgroupactions.h"

View File

@ -49,6 +49,7 @@
#include "llvoavatarself.h"
#include "llviewerwearable.h"
#include "llwearablelist.h"
#include "llfloaterperms.h"
#include <boost/scoped_ptr.hpp>
@ -65,6 +66,19 @@ void wear_and_edit_cb(const LLUUID& inv_item)
{
if (inv_item.isNull()) return;
LLViewerInventoryItem* item = gInventory.getItem(inv_item);
if (!item) return;
LLPermissions perm = item->getPermissions();
perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables"));
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables"));
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables"));
item->setPermissions(perm);
item->updateServer(FALSE);
gInventory.updateItem(item);
gInventory.notifyObservers();
// Request editing the item after it gets worn.
gAgentWearables.requestEditingWearable(inv_item);
@ -72,6 +86,26 @@ void wear_and_edit_cb(const LLUUID& inv_item)
LLAppearanceMgr::instance().wearItemOnAvatar(inv_item,true);
}
void wear_cb(const LLUUID& inv_item)
{
if (!inv_item.isNull())
{
LLViewerInventoryItem* item = gInventory.getItem(inv_item);
if (item)
{
LLPermissions perm = item->getPermissions();
perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables"));
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables"));
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables"));
item->setPermissions(perm);
item->updateServer(FALSE);
gInventory.updateItem(item);
gInventory.notifyObservers();
}
}
}
///////////////////////////////////////////////////////////////////////////////
// HACK: For EXT-3923: Pants item shows in inventory with skin icon and messes with "current look"
@ -183,7 +217,7 @@ void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar)
*
* Would like to pass the agent in here, but we can't safely
* count on it being around later. Just use gAgent directly.
* @param cb callback to execute on completion (??? unused ???)
* @param cb callback to execute on completion (? unused ?)
* @param type Type for the wearable in the agent
* @param wearable The wearable data.
* @param todo Bitmask of actions to take on completion.
@ -355,6 +389,7 @@ void LLAgentWearables::saveWearableAs(const LLWearableType::EType type,
LLViewerWearable* new_wearable = LLWearableList::instance().createCopy(
old_wearable,
trunc_name);
LLPointer<LLInventoryCallback> cb =
new AddWearableToAgentInventoryCallback(
LLPointer<LLRefCount>(NULL),
@ -1465,7 +1500,16 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con
LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp);
LLAssetType::EType asset_type = wearable->getAssetType();
LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE;
LLPointer<LLInventoryCallback> cb = wear ? new LLBoostFuncInventoryCallback(wear_and_edit_cb) : NULL;
LLPointer<LLInventoryCallback> cb;
if(wear)
{
cb = new LLBoostFuncInventoryCallback(wear_and_edit_cb);
}
else
{
cb = new LLBoostFuncInventoryCallback(wear_cb);
}
LLUUID folder_id;
if (parent_id.notNull())
@ -1478,10 +1522,15 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con
folder_id = gInventory.findCategoryUUIDForType(folder_type);
}
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
folder_id, wearable->getTransactionID(), wearable->getName(),
wearable->getDescription(), asset_type, inv_type, wearable->getType(),
wearable->getPermissions().getMaskNextOwner(),
create_inventory_item(gAgent.getID(),
gAgent.getSessionID(),
folder_id,
wearable->getTransactionID(),
wearable->getName(),
wearable->getDescription(),
asset_type, inv_type,
wearable->getType(),
LLFloaterPerms::getNextOwnerPerms("Wearables"),
cb);
}

View File

@ -1480,6 +1480,18 @@ void LLAppearanceMgr::takeOffOutfit(const LLUUID& cat_id)
uuids_to_remove.push_back(item->getUUID());
}
removeItemsFromAvatar(uuids_to_remove);
// deactivate all gestures in the outfit folder
LLInventoryModel::item_array_t gest_items;
getDescendentsOfAssetType(cat_id, gest_items, LLAssetType::AT_GESTURE);
for(S32 i = 0; i < gest_items.size(); ++i)
{
LLViewerInventoryItem *gest_item = gest_items[i];
if ( LLGestureMgr::instance().isGestureActive( gest_item->getLinkedUUID()) )
{
LLGestureMgr::instance().deactivateGesture( gest_item->getLinkedUUID() );
}
}
}
// Create a copy of src_id + contents as a subfolder of dst_id.

View File

@ -3382,6 +3382,10 @@ LLSD LLAppViewer::getViewerInfo() const
{
info["SERVER_RELEASE_NOTES_URL"] = LLTrans::getString("RetrievingData");
}
else
{
info["SERVER_RELEASE_NOTES_URL"] = LLTrans::getString("NotConnected");
}
}
else if (LLStringUtil::startsWith(mServerReleaseNotesURL, "http")) // it's an URL
{
@ -4837,7 +4841,7 @@ void LLAppViewer::idle()
static LLFrameStatsTimer viewer_stats_timer(SEND_STATS_PERIOD);
// Update session stats every large chunk of time
// *FIX: (???) SAMANTHA
// *FIX: (?) SAMANTHA
if (viewer_stats_timer.getElapsedTimeF32() >= SEND_STATS_PERIOD && !gDisconnected)
{
LL_INFOS() << "Transmitting sessions stats" << LL_ENDL;

View File

@ -143,7 +143,8 @@ BOOL LLFloaterAbout::postBuild()
}
else // not logged in
{
setSupportText(LLStringUtil::null);
LL_DEBUGS("ViewerInfo") << "cannot display region info when not connected" << LL_ENDL;
setSupportText(LLTrans::getString("NotConnected"));
}
support_widget->blockUndo();
@ -262,11 +263,10 @@ void LLFloaterAbout::setSupportText(const std::string& server_release_notes_url)
LLViewerTextEditor *support_widget =
getChild<LLViewerTextEditor>("support_editor", true);
LLUIColor about_color = LLUIColorTable::instance().getColor("TextFgReadOnlyColor");
support_widget->clear();
support_widget->appendText(LLAppViewer::instance()->getViewerInfoString(),
FALSE,
LLStyle::Params()
.color(LLUIColorTable::instance().getColor("TextFgReadOnlyColor")));
FALSE, LLStyle::Params() .color(about_color));
}
///----------------------------------------------------------------------------

View File

@ -1002,7 +1002,7 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)
0,
LLFolderType::FT_NONE,
LLInventoryType::IT_ANIMATION,
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
LLFloaterPerms::getNextOwnerPerms("Uploads"), LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"),
name,
callback, expected_upload_cost, userdata);

View File

@ -48,6 +48,7 @@
#include "llviewermenu.h"
#include "llviewerinventory.h"
#include "llviewercontrol.h"
#include "llfloaterperms.h"
BOOL item_name_precedes( LLInventoryItem* a, LLInventoryItem* b )
{
@ -74,6 +75,17 @@ public:
void fire(const LLUUID &inv_item)
{
LLPreviewGesture::show(inv_item, LLUUID::null);
LLInventoryItem* item = gInventory.getItem(inv_item);
if (item)
{
LLPermissions perm = item->getPermissions();
perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Gestures"));
perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Gestures"));
perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Gestures"));
item->setPermissions(perm);
item->updateServer(FALSE);
}
}
};
@ -449,9 +461,17 @@ void LLFloaterGesture::onClickPlay()
void LLFloaterGesture::onClickNew()
{
LLPointer<LLInventoryCallback> cb = new GestureShowCallback();
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
LLUUID::null, LLTransactionID::tnull, "New Gesture", "", LLAssetType::AT_GESTURE,
LLInventoryType::IT_GESTURE, NOT_WEARABLE, PERM_MOVE | PERM_TRANSFER, cb);
create_inventory_item(gAgent.getID(),
gAgent.getSessionID(),
LLUUID::null,
LLTransactionID::tnull,
"New Gesture",
"",
LLAssetType::AT_GESTURE,
LLInventoryType::IT_GESTURE,
NOT_WEARABLE,
PERM_MOVE | LLFloaterPerms::getNextOwnerPerms("Gestures"),
cb);
}
void LLFloaterGesture::onActivateBtnClick()

View File

@ -30,7 +30,7 @@
#include "llpreviewscript.h"
#include "llfloaterreg.h"
#include "lllineeditor.h"
#include "llviewertexteditor.h"
#include "llscripteditor.h"
#include "llviewerwindow.h"
LLFloaterGotoLine* LLFloaterGotoLine::sInstance = NULL;

Some files were not shown because too many files have changed in this diff Show More