Merge remote-tracking branch 'liru/animesh' into animesh
This commit is contained in:
@@ -19,6 +19,9 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
include(Variables)
|
||||
include(BuildVersion)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
|
||||
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
|
||||
@@ -58,5 +61,8 @@ add_subdirectory(${LIBS_OPEN_PREFIX}plugins)
|
||||
|
||||
add_subdirectory(${VIEWER_PREFIX}newview/statemachine)
|
||||
add_subdirectory(${VIEWER_PREFIX}newview)
|
||||
add_dependencies(viewer singularity-bin)
|
||||
add_dependencies(viewer ${VIEWER_BRANDING_ID}-bin)
|
||||
|
||||
if (WINDOWS)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${VIEWER_BRANDING_ID}-bin)
|
||||
endif (WINDOWS)
|
||||
|
||||
@@ -7,7 +7,6 @@ set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
|
||||
|
||||
include(Variables)
|
||||
|
||||
|
||||
# Portable compilation flags.
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1")
|
||||
@@ -31,14 +30,11 @@ if(NON_RELEASE_CRASH_REPORTING)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1")
|
||||
endif()
|
||||
|
||||
|
||||
# Don't bother with a MinSizeRel build.
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
|
||||
"Supported build types." FORCE)
|
||||
|
||||
# Platform-specific compilation flags.
|
||||
|
||||
if (WINDOWS)
|
||||
# Don't build DLLs.
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
@@ -88,6 +84,7 @@ if (WINDOWS)
|
||||
/DNOMINMAX
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
/DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE
|
||||
/GS
|
||||
/TP
|
||||
/W3
|
||||
@@ -111,7 +108,7 @@ if (WINDOWS)
|
||||
endif (USE_LTO)
|
||||
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
add_compile_options(/arch:SSE2)
|
||||
add_compile_options(/arch:SSE3)
|
||||
endif (WORD_SIZE EQUAL 32)
|
||||
|
||||
if (NOT DISABLE_FATAL_WARNINGS)
|
||||
@@ -128,21 +125,24 @@ set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math")
|
||||
if (LINUX)
|
||||
set(CMAKE_SKIP_RPATH TRUE)
|
||||
|
||||
add_compile_options(
|
||||
-fvisibility=hidden
|
||||
-fexceptions
|
||||
-fno-math-errno
|
||||
-fno-strict-aliasing
|
||||
-fsigned-char
|
||||
-g
|
||||
-pthread
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
-DLL_LINUX=1
|
||||
-DAPPID=secondlife
|
||||
-D_REENTRANT
|
||||
-fexceptions
|
||||
-fno-math-errno
|
||||
-fno-strict-aliasing
|
||||
-fsigned-char
|
||||
-fvisibility=hidden
|
||||
-g
|
||||
-pthread
|
||||
)
|
||||
-DLL_LINUX=1
|
||||
-DAPPID=secondlife
|
||||
-D_REENTRANT
|
||||
)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2")
|
||||
|
||||
@@ -213,23 +213,23 @@ if (LINUX)
|
||||
if (NOT STANDALONE)
|
||||
set(MARCH_FLAG " -march=pentium4")
|
||||
endif (NOT STANDALONE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
endif (${ARCH} STREQUAL "x86_64")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse2")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse2")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse3")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse3")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse3")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||
if (NOT STANDALONE)
|
||||
set(MARCH_FLAG " -axsse4.1 -msse2")
|
||||
set(MARCH_FLAG " -axsse4.1 -msse3")
|
||||
endif (NOT STANDALONE)
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline-functions")
|
||||
|
||||
@@ -36,10 +36,10 @@ set(cmake_SOURCE_FILES
|
||||
FindGoogleBreakpad.cmake
|
||||
FindGooglePerfTools.cmake
|
||||
FindHunSpell.cmake
|
||||
FindJsonCpp.cmake
|
||||
FindNDOF.cmake
|
||||
FindOpenJPEG.cmake
|
||||
FindTut.cmake
|
||||
FindURIPARSER.cmake
|
||||
FindXmlRpcEpi.cmake
|
||||
FreeType.cmake
|
||||
GLOD.cmake
|
||||
@@ -50,7 +50,7 @@ set(cmake_SOURCE_FILES
|
||||
GooglePerfTools.cmake
|
||||
Hunspell.cmake
|
||||
JPEG.cmake
|
||||
JsonCpp.cmake
|
||||
Json.cmake
|
||||
LLAddBuildTest.cmake
|
||||
LLAppearance.cmake
|
||||
LLAudio.cmake
|
||||
@@ -65,7 +65,6 @@ set(cmake_SOURCE_FILES
|
||||
LLPlugin.cmake
|
||||
LLPrimitive.cmake
|
||||
LLPhysicsExtensions.cmake
|
||||
LLSharedLibs.cmake
|
||||
LLRender.cmake
|
||||
LLSharedLibs.cmake
|
||||
LLUI.cmake
|
||||
@@ -93,6 +92,7 @@ set(cmake_SOURCE_FILES
|
||||
Tut.cmake
|
||||
UI.cmake
|
||||
UnixInstall.cmake
|
||||
URIPARSER.cmake
|
||||
Variables.cmake
|
||||
ViewerMiscLibs.cmake
|
||||
WinManifest.cmake
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# - Find JSONCpp
|
||||
# Find the JSONCpp includes and library
|
||||
# This module defines
|
||||
# JSONCPP_FOUND, System has libjsoncpp.
|
||||
# JSONCPP_INCLUDE_DIRS - The libjsoncpp include directories.
|
||||
# JSONCPP_LIBRARIES - The libraries needed to use libjsoncpp.
|
||||
# JSONCPP_DEFINITIONS - Compiler switches required for using libjsoncpp.
|
||||
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
PKG_CHECK_MODULES(PC_JSONCPP jsoncpp)
|
||||
SET(JSONCPP_DEFINITIONS ${PC_JSONCPP_CFLAGS_OTHER})
|
||||
|
||||
FIND_PATH(JSONCPP_INCLUDE_DIR json/reader.h
|
||||
HINTS ${PC_JSONCPP_INCLUDE_DIR} ${PC_JSONCPP_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES jsoncpp)
|
||||
|
||||
# Get the GCC compiler version
|
||||
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
|
||||
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
||||
OUTPUT_VARIABLE _gcc_COMPILER_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Try to find a library that was compiled with the same compiler version as we currently use.
|
||||
FIND_LIBRARY(JSONCPP_LIBRARY
|
||||
NAMES libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so libjsoncpp.so
|
||||
HINTS ${PC_JSONCPP_LIBDIR} ${PC_JSONCPP_LIBRARY_DIRS}
|
||||
PATHS /usr/lib /usr/local/lib)
|
||||
|
||||
SET(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
|
||||
SET(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JSONCPP DEFAULT_MSG
|
||||
JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED(JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR)
|
||||
46
indra/cmake/FindURIPARSER.cmake
Normal file
46
indra/cmake/FindURIPARSER.cmake
Normal file
@@ -0,0 +1,46 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# - Find uriparser
|
||||
# Find the URIPARSER includes and library
|
||||
# This module defines
|
||||
# URIPARSER_INCLUDE_DIRS, where to find uriparser.h, etc.
|
||||
# URIPARSER_LIBRARY, the libraries needed to use uriparser.
|
||||
# URIPARSER_FOUND, If false, do not try to use uriparser.
|
||||
#
|
||||
# This FindURIPARSER is about 43 times as fast the one provided with cmake (2.8.x),
|
||||
# because it doesn't look up the version of uriparser, resulting in a dramatic
|
||||
# speed up for configure (from 4 minutes 22 seconds to 6 seconds).
|
||||
#
|
||||
# Note: Since this file is only used for standalone, the windows
|
||||
# specific parts were left out.
|
||||
|
||||
FIND_PATH(URIPARSER_INCLUDE_DIR uriparser/Uri.h
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY(URIPARSER_LIBRARY uriparser)
|
||||
|
||||
if (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
|
||||
SET(URIPARSER_INCLUDE_DIRS ${URIPARSER_INCLUDE_DIR})
|
||||
SET(URIPARSER_LIBRARY ${URIPARSER_LIBRARY})
|
||||
SET(URIPARSER_FOUND "YES")
|
||||
else (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
|
||||
SET(URIPARSER_FOUND "NO")
|
||||
endif (URIPARSER_LIBRARY AND URIPARSER_INCLUDE_DIR)
|
||||
|
||||
if (URIPARSER_FOUND)
|
||||
if (NOT URIPARSER_FIND_QUIETLY)
|
||||
message(STATUS "Found URIPARSER: ${URIPARSER_LIBRARY}")
|
||||
SET(URIPARSER_FIND_QUIETLY TRUE)
|
||||
endif (NOT URIPARSER_FIND_QUIETLY)
|
||||
else (URIPARSER_FOUND)
|
||||
if (URIPARSER_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find URIPARSER library")
|
||||
endif (URIPARSER_FIND_REQUIRED)
|
||||
endif (URIPARSER_FOUND)
|
||||
|
||||
mark_as_advanced(
|
||||
URIPARSER_LIBRARY
|
||||
URIPARSER_INCLUDE_DIR
|
||||
)
|
||||
|
||||
6
indra/cmake/Json.cmake
Normal file
6
indra/cmake/Json.cmake
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(Prebuilt)
|
||||
|
||||
use_prebuilt_binary(modernjson)
|
||||
set(JSON_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include")
|
||||
@@ -1,22 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
include(Prebuilt)
|
||||
|
||||
set(JSONCPP_FIND_QUIETLY OFF)
|
||||
set(JSONCPP_FIND_REQUIRED ON)
|
||||
|
||||
if (STANDALONE)
|
||||
include(FindJsonCpp)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(jsoncpp)
|
||||
if (WINDOWS)
|
||||
set(JSONCPP_LIBRARIES
|
||||
debug jsoncppd.lib
|
||||
optimized jsoncpp.lib)
|
||||
elseif (DARWIN)
|
||||
set(JSONCPP_LIBRARIES json_linux-gcc-4.0.1_libmt)
|
||||
elseif (LINUX)
|
||||
set(JSONCPP_LIBRARIES jsoncpp)
|
||||
endif (WINDOWS)
|
||||
set(JSONCPP_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/)
|
||||
endif (STANDALONE)
|
||||
20
indra/cmake/URIPARSER.cmake
Normal file
20
indra/cmake/URIPARSER.cmake
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
set(URIPARSER_FIND_QUIETLY ON)
|
||||
set(URIPARSER_FIND_REQUIRED ON)
|
||||
|
||||
include(Prebuilt)
|
||||
|
||||
if (USESYSTEMLIBS)
|
||||
include(FindURIPARSER)
|
||||
else (USESYSTEMLIBS)
|
||||
use_prebuilt_binary(uriparser)
|
||||
if (WINDOWS)
|
||||
set(URIPARSER_LIBRARY
|
||||
debug uriparserd
|
||||
optimized uriparser)
|
||||
elseif (DARWIN OR LINUX)
|
||||
set(URIPARSER_LIBRARY uriparser)
|
||||
endif (WINDOWS)
|
||||
set(URIPARSER_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/uriparser)
|
||||
endif (USESYSTEMLIBS)
|
||||
@@ -10,21 +10,23 @@ include(Linking)
|
||||
include(Boost)
|
||||
include(OpenSSL)
|
||||
include(LLSharedLibs)
|
||||
include(Json)
|
||||
include(GoogleBreakpad)
|
||||
include(Copy3rdPartyLibs)
|
||||
include(ZLIB)
|
||||
include(URIPARSER)
|
||||
|
||||
include_directories(
|
||||
${EXPAT_INCLUDE_DIRS}
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${OPENSSL_INCLUDE_DIRS}
|
||||
${JSON_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
${BREAKPAD_INCLUDE_DIRECTORIES}
|
||||
)
|
||||
|
||||
set(llcommon_SOURCE_FILES
|
||||
aialert.cpp
|
||||
aifile.cpp
|
||||
aiframetimer.cpp
|
||||
aisyncclient.cpp
|
||||
aithreadid.cpp
|
||||
@@ -85,6 +87,7 @@ set(llcommon_SOURCE_FILES
|
||||
llrun.cpp
|
||||
llscopedvolatileaprpool.h
|
||||
llsd.cpp
|
||||
llsdjson.cpp
|
||||
llsdparam.cpp
|
||||
llsdserialize.cpp
|
||||
llsdserialize_xml.cpp
|
||||
@@ -101,6 +104,7 @@ set(llcommon_SOURCE_FILES
|
||||
llthreadsafequeue.cpp
|
||||
lltimer.cpp
|
||||
lluri.cpp
|
||||
lluriparser.cpp
|
||||
lluuid.cpp
|
||||
llworkerthread.cpp
|
||||
metaclass.cpp
|
||||
@@ -114,7 +118,6 @@ set(llcommon_HEADER_FILES
|
||||
CMakeLists.txt
|
||||
|
||||
aialert.h
|
||||
aifile.h
|
||||
aiframetimer.h
|
||||
airecursive.h
|
||||
aisyncclient.h
|
||||
@@ -210,6 +213,7 @@ set(llcommon_HEADER_FILES
|
||||
llrun.h
|
||||
llsafehandle.h
|
||||
llsd.h
|
||||
llsdjson.h
|
||||
llsdparam.h
|
||||
llsdserialize.h
|
||||
llsdserialize_xml.h
|
||||
@@ -238,6 +242,7 @@ set(llcommon_HEADER_FILES
|
||||
llunittype.h
|
||||
lltypeinfolookup.h
|
||||
lluri.h
|
||||
lluriparser.h
|
||||
lluuid.h
|
||||
llwin32headers.h
|
||||
llwin32headerslean.h
|
||||
@@ -296,6 +301,7 @@ target_link_libraries(
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${CORESERVICES_LIBRARY}
|
||||
${URIPARSER_LIBRARY}
|
||||
)
|
||||
|
||||
if (DARWIN)
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/**
|
||||
* @file aifile.cpp
|
||||
* @brief POSIX file operations that throw on error.
|
||||
*
|
||||
* Copyright (c) 2013, Aleric Inglewood.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution.
|
||||
*
|
||||
* CHANGELOG
|
||||
* and additional copyright holders.
|
||||
*
|
||||
* 03/11/2013
|
||||
* Initial version, written by Aleric Inglewood @ SL
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "aifile.h"
|
||||
#include "aialert.h"
|
||||
|
||||
#if LL_WINDOWS
|
||||
#include <windows.h>
|
||||
#include <stdlib.h> // Windows errno
|
||||
#else
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
AIFile::AIFile(std::string const& filename, char const* accessmode)
|
||||
{
|
||||
mFp = AIFile::fopen(filename, accessmode);
|
||||
}
|
||||
|
||||
AIFile::~AIFile()
|
||||
{
|
||||
AIFile::close(mFp);
|
||||
}
|
||||
|
||||
// Like THROW_MALERTE but appends "LLFile::strerr(errn) << " (" << errn << ')'" as argument to replace [ERROR].
|
||||
#define THROW_ERROR(...) \
|
||||
do { \
|
||||
int errn = errno; \
|
||||
std::ostringstream error; \
|
||||
error << LLFile::strerr(errn) << " (" << errn << ')'; \
|
||||
THROW_MALERT_CLASS(AIAlert::ErrorCode, errn, __VA_ARGS__ ("[ERROR]", error.str())); \
|
||||
} while(0)
|
||||
|
||||
//static
|
||||
void AIFile::mkdir(std::string const& dirname, int perms)
|
||||
{
|
||||
int rc = LLFile::mkdir_nowarn(dirname, perms);
|
||||
if (rc < 0 && errno != EEXIST)
|
||||
{
|
||||
THROW_ERROR("AIFile_mkdir_Failed_to_create_DIRNAME", AIArgs("[DIRNAME]", dirname));
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void AIFile::rmdir(std::string const& dirname)
|
||||
{
|
||||
int rc = LLFile::rmdir_nowarn(dirname);
|
||||
if (rc < 0 && errno != ENOENT)
|
||||
{
|
||||
THROW_ERROR("AIFile_rmdir_Failed_to_remove_DIRNAME", AIArgs("[DIRNAME]", dirname));
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
LLFILE* AIFile::fopen(std::string const& filename, const char* mode)
|
||||
{
|
||||
LLFILE* fp = LLFile::fopen(filename, mode);
|
||||
if (!fp)
|
||||
{
|
||||
THROW_ERROR("AIFile_fopen_Failed_to_open_FILENAME", AIArgs("[FILENAME]", filename));
|
||||
}
|
||||
return fp;
|
||||
}
|
||||
|
||||
//static
|
||||
void AIFile::close(LLFILE* file)
|
||||
{
|
||||
if (LLFile::close(file) < 0)
|
||||
{
|
||||
THROW_ERROR("AIFile_close_Failed_to_close_file", AIArgs);
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void AIFile::remove(std::string const& filename)
|
||||
{
|
||||
int rc = LLFile::remove_nowarn(filename);
|
||||
if (rc < 0 && errno != ENOENT)
|
||||
{
|
||||
THROW_ERROR("AIFile_remove_Failed_to_remove_FILENAME", AIArgs("[FILENAME]", filename));
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void AIFile::rename(std::string const& filename, std::string const& newname)
|
||||
{
|
||||
if (LLFile::rename_nowarn(filename, newname) < 0)
|
||||
{
|
||||
THROW_ERROR("AIFile_rename_Failed_to_rename_FILE_to_NEWFILE", AIArgs("[FILE]", filename)("[NEWFILE]", newname));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
/**
|
||||
* @file aifile.h
|
||||
* @brief Declaration of AIFile.
|
||||
*
|
||||
* Copyright (c) 2013, Aleric Inglewood.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution.
|
||||
*
|
||||
* CHANGELOG
|
||||
* and additional copyright holders.
|
||||
*
|
||||
* 02/11/2013
|
||||
* Initial version, written by Aleric Inglewood @ SL
|
||||
*/
|
||||
|
||||
#ifndef AIFILE_H
|
||||
#define AIFILE_H
|
||||
|
||||
#include "llfile.h"
|
||||
|
||||
// As LLFile, but throws AIAlert instead of printing a warning.
|
||||
class LL_COMMON_API AIFile
|
||||
{
|
||||
private:
|
||||
LLFILE* mFp;
|
||||
|
||||
public:
|
||||
// Scoped file (exception safe). Throws AIAlertCode with errno on failure.
|
||||
AIFile(std::string const& filename, char const* accessmode);
|
||||
~AIFile();
|
||||
|
||||
operator LLFILE* () const { return mFp; }
|
||||
|
||||
// All these functions take UTF8 path/filenames.
|
||||
static LLFILE* fopen(std::string const& filename, char const* accessmode);
|
||||
static void close(LLFILE* file);
|
||||
|
||||
static void mkdir(std::string const& dirname, int perms = 0700); // Does NOT throw when dirname already exists.
|
||||
static void rmdir(std::string const& dirname); // Does NOT throw when dirname does not exist.
|
||||
static void remove(std::string const& filename); // Does NOT throw when filename does not exist.
|
||||
static void rename(std::string const& filename, std::string const& newname);
|
||||
};
|
||||
|
||||
#endif // AIFILE_H
|
||||
@@ -131,19 +131,6 @@ const U32 DEFAULT_CGI_SERVICES_PORT = 12045;
|
||||
// on a single host for map tile generation. JC
|
||||
const U32 DEFAULT_MAPSERVER_PORT = 12124;
|
||||
|
||||
const char LAND_LAYER_CODE = 'L';
|
||||
const char WATER_LAYER_CODE = 'W';
|
||||
const char WIND_LAYER_CODE = '7';
|
||||
const char CLOUD_LAYER_CODE = '8';
|
||||
|
||||
// <FS:CR> Aurora Sim
|
||||
// Extended land layer for Aurora Sim
|
||||
const char AURORA_LAND_LAYER_CODE = 'M';
|
||||
const char AURORA_WATER_LAYER_CODE = 'X';
|
||||
const char AURORA_WIND_LAYER_CODE = '9';
|
||||
const char AURORA_CLOUD_LAYER_CODE = ':';
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
enum ETerrainBrushType
|
||||
{
|
||||
// the valid brush numbers cannot be reordered, because they
|
||||
|
||||
@@ -101,6 +101,9 @@ LLAssetDictionary::LLAssetDictionary()
|
||||
addEntry(LLAssetType::AT_OUTFIT, new AssetEntry("OUTFIT", "outfit", "outfit", false, false, false));
|
||||
addEntry(LLAssetType::AT_MY_OUTFITS, new AssetEntry("MY_OUTFITS", "my_otfts", "my outfits", false, false, false));
|
||||
addEntry(LLAssetType::AT_MESH, new AssetEntry("MESH", "mesh", "mesh", false, true, true));
|
||||
addEntry(LLAssetType::AT_SETTINGS, new AssetEntry("SETTINGS", "settings", "settings blob", true, true, true));
|
||||
|
||||
addEntry(LLAssetType::AT_UNKNOWN, new AssetEntry("UNKNOWN", "invalid", NULL, false, false, false));
|
||||
addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, false, false, false));
|
||||
};
|
||||
|
||||
|
||||
@@ -122,6 +122,9 @@ public:
|
||||
|
||||
AT_LINK_FOLDER = 25,
|
||||
// Inventory folder link
|
||||
|
||||
AT_MARKETPLACE_FOLDER = 26,
|
||||
// Marketplace folder. Same as an AT_CATEGORY but different display methods.
|
||||
|
||||
AT_CURRENT_OUTFIT = 46,
|
||||
|
||||
@@ -132,7 +135,16 @@ public:
|
||||
AT_MESH = 49,
|
||||
// Mesh data in our proprietary SLM format
|
||||
|
||||
AT_COUNT = 50,
|
||||
AT_RESERVED_1 = 50,
|
||||
AT_RESERVED_2 = 51,
|
||||
AT_RESERVED_3 = 52,
|
||||
AT_RESERVED_4 = 53,
|
||||
AT_RESERVED_5 = 54,
|
||||
AT_RESERVED_6 = 55,
|
||||
|
||||
AT_SETTINGS = 56, // Collection of settings
|
||||
|
||||
AT_COUNT = 57,
|
||||
|
||||
// +*********************************************************+
|
||||
// | TO ADD AN ELEMENT TO THIS ENUM: |
|
||||
@@ -143,7 +155,7 @@ public:
|
||||
// | 4. ADD TO LLViewerAssetType.cpp |
|
||||
// | 5. ADD TO DEFAULT_ASSET_FOR_INV in LLInventoryType.cpp |
|
||||
// +*********************************************************+
|
||||
|
||||
AT_UNKNOWN = 255,
|
||||
AT_NONE = -1
|
||||
};
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ namespace {
|
||||
LL_INFOS() << "Error setting log file to " << filename << LL_ENDL;
|
||||
}
|
||||
mWantsTime = true;
|
||||
mWantsTags = true;
|
||||
}
|
||||
|
||||
~RecordToFile()
|
||||
@@ -252,23 +253,13 @@ namespace
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
// GCC: type_info::name() returns a mangled class name,st demangle
|
||||
|
||||
static size_t abi_name_len = 100;
|
||||
static char* abi_name_buf = (char*)malloc(abi_name_len);
|
||||
// warning: above is voodoo inferred from the GCC manual,
|
||||
// do NOT change
|
||||
|
||||
int status;
|
||||
// We don't use status, and shouldn't have to pass apointer to it
|
||||
// but gcc 3.3 libstc++'s implementation of demangling is broken
|
||||
// and fails without.
|
||||
|
||||
char* name = abi::__cxa_demangle(type.name(),
|
||||
abi_name_buf, &abi_name_len, &status);
|
||||
// this call can realloc the abi_name_buf pointer (!)
|
||||
|
||||
return name ? name : type.name();
|
||||
|
||||
// passing nullptr, 0 forces allocation of a unique buffer we can free
|
||||
// fixing MAINT-8724 on OSX 10.14
|
||||
int status = -1;
|
||||
char* name = abi::__cxa_demangle(type.name(), nullptr, 0, &status);
|
||||
std::string result(name ? name : type.name());
|
||||
free(name);
|
||||
return result;
|
||||
#elif LL_WINDOWS
|
||||
// DevStudio: type_info::name() includes the text "class " at the start
|
||||
|
||||
@@ -600,7 +591,7 @@ namespace LLError
|
||||
mFunctionString += std::string(mFunction) + ":";
|
||||
for (size_t i = 0; i < mTagCount; i++)
|
||||
{
|
||||
mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : " ");
|
||||
mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : ",");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -983,13 +974,19 @@ namespace
|
||||
}
|
||||
|
||||
if (show_level && r->wantsLevel())
|
||||
{
|
||||
message_stream << site.mLevelString << " ";
|
||||
}
|
||||
{
|
||||
message_stream << site.mLevelString;
|
||||
}
|
||||
|
||||
if (show_tags && r->wantsTags())
|
||||
{
|
||||
message_stream << site.mTagString << " ";
|
||||
message_stream << site.mTagString;
|
||||
}
|
||||
|
||||
if ((show_level && r->wantsLevel())||
|
||||
(show_tags && r->wantsTags()))
|
||||
{
|
||||
message_stream << " ";
|
||||
}
|
||||
|
||||
if (show_function && r->wantsFunctionName())
|
||||
|
||||
@@ -36,18 +36,38 @@
|
||||
#include "llformat.h"
|
||||
|
||||
#include <cstdarg>
|
||||
#include <boost/align/aligned_allocator.hpp>
|
||||
|
||||
// common used function with va_list argument
|
||||
// wrapper for vsnprintf to be called from llformatXXX functions.
|
||||
static void va_format(std::string& out, const char *fmt, va_list va)
|
||||
static void va_format(std::string& out, const char *fmt, va_list& va)
|
||||
{
|
||||
char tstr[1024]; /* Flawfinder: ignore */
|
||||
#if LL_WINDOWS
|
||||
_vsnprintf(tstr, 1024, fmt, va);
|
||||
if (!fmt || !fmt[0]) return; // Don't bother if null or empty c_str
|
||||
|
||||
typedef typename std::vector<char, boost::alignment::aligned_allocator<char, 1>> vec_t;
|
||||
static thread_local vec_t charvector(1024); // Evolves into charveleon
|
||||
#define vsnprintf(va) std::vsnprintf(charvector.data(), charvector.capacity(), fmt, va)
|
||||
#ifdef LL_WINDOWS // We don't have to copy on windows
|
||||
#define va2 va
|
||||
#else
|
||||
vsnprintf(tstr, 1024, fmt, va); /* Flawfinder: ignore */
|
||||
va_list va2;
|
||||
va_copy(va2, va);
|
||||
#endif
|
||||
out.assign(tstr);
|
||||
const auto smallsize(charvector.capacity());
|
||||
const auto size = vsnprintf(va);
|
||||
if (size < 0)
|
||||
{
|
||||
LL_ERRS() << "Encoding failed, code " << size << ". String hint: " << out << '/' << fmt << LL_ENDL;
|
||||
}
|
||||
else if (static_cast<vec_t::size_type>(size) >= smallsize) // Resize if we need more space
|
||||
{
|
||||
charvector.resize(1+size); // Use the String Stone
|
||||
vsnprintf(va2);
|
||||
}
|
||||
#ifndef LL_WINDOWS
|
||||
va_end(va2);
|
||||
#endif
|
||||
out.assign(charvector.data());
|
||||
}
|
||||
|
||||
std::string llformat(const char *fmt, ...)
|
||||
|
||||
126
indra/llcommon/llsdjson.cpp
Normal file
126
indra/llcommon/llsdjson.cpp
Normal file
@@ -0,0 +1,126 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
/**
|
||||
* @file llsdjson.cpp
|
||||
* @brief LLSD flexible data system
|
||||
*
|
||||
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2015, 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$
|
||||
*/
|
||||
|
||||
// Must turn on conditional declarations in header file so definitions end up
|
||||
// with proper linkage.
|
||||
#define LLSD_DEBUG_INFO
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llsdjson.h"
|
||||
|
||||
#include "llerror.h"
|
||||
|
||||
|
||||
//=========================================================================
|
||||
LLSD LlsdFromJson(const nlohmann::json &val)
|
||||
{
|
||||
LLSD result;
|
||||
|
||||
switch (val.type())
|
||||
{
|
||||
default:
|
||||
case nlohmann::json::value_t::null:
|
||||
break;
|
||||
case nlohmann::json::value_t::number_integer:
|
||||
result = LLSD(val.get<LLSD::Integer>());
|
||||
break;
|
||||
case nlohmann::json::value_t::number_unsigned:
|
||||
result = LLSD(val.get<LLSD::Integer>());
|
||||
break;
|
||||
case nlohmann::json::value_t::number_float:
|
||||
result = LLSD(val.get<LLSD::Real>());
|
||||
break;
|
||||
case nlohmann::json::value_t::string:
|
||||
result = LLSD(val.get<LLSD::String>());
|
||||
break;
|
||||
case nlohmann::json::value_t::boolean:
|
||||
result = LLSD(val.get<LLSD::Boolean>());
|
||||
break;
|
||||
case nlohmann::json::value_t::array:
|
||||
result = LLSD::emptyArray();
|
||||
for (const auto &element : val)
|
||||
{
|
||||
result.append(LlsdFromJson(element));
|
||||
}
|
||||
break;
|
||||
case nlohmann::json::value_t::object:
|
||||
result = LLSD::emptyMap();
|
||||
for (auto it = val.cbegin(); it != val.cend(); ++it)
|
||||
{
|
||||
result[it.key()] = LlsdFromJson(it.value());
|
||||
}
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
nlohmann::json LlsdToJson(const LLSD &val)
|
||||
{
|
||||
nlohmann::json result;
|
||||
|
||||
switch (val.type())
|
||||
{
|
||||
case LLSD::TypeUndefined:
|
||||
result = nullptr;
|
||||
break;
|
||||
case LLSD::TypeBoolean:
|
||||
result = val.asBoolean();
|
||||
break;
|
||||
case LLSD::TypeInteger:
|
||||
result = val.asInteger();
|
||||
break;
|
||||
case LLSD::TypeReal:
|
||||
result = val.asReal();
|
||||
break;
|
||||
case LLSD::TypeURI:
|
||||
case LLSD::TypeDate:
|
||||
case LLSD::TypeUUID:
|
||||
case LLSD::TypeString:
|
||||
result = val.asString();
|
||||
break;
|
||||
case LLSD::TypeMap:
|
||||
for (LLSD::map_const_iterator it = val.beginMap(); it != val.endMap(); ++it)
|
||||
{
|
||||
result[it->first] = LlsdToJson(it->second);
|
||||
}
|
||||
break;
|
||||
case LLSD::TypeArray:
|
||||
for (LLSD::array_const_iterator it = val.beginArray(); it != val.endArray(); ++it)
|
||||
{
|
||||
result.push_back(LlsdToJson(*it));
|
||||
}
|
||||
break;
|
||||
case LLSD::TypeBinary:
|
||||
default:
|
||||
LL_ERRS("LlsdToJson") << "Unsupported conversion to JSON from LLSD type (" << val.type() << ")." << LL_ENDL;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
77
indra/llcommon/llsdjson.h
Normal file
77
indra/llcommon/llsdjson.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* @file llsdjson.cpp
|
||||
* @brief LLSD flexible data system
|
||||
*
|
||||
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2015, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLSDJSON_H
|
||||
#define LL_LLSDJSON_H
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "stdtypes.h"
|
||||
|
||||
#include "llsd.h"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
/// Convert a parsed JSON structure into LLSD maintaining member names and
|
||||
/// array indexes.
|
||||
/// JSON/JavaScript types are converted as follows:
|
||||
///
|
||||
/// JSON Type | LLSD Type
|
||||
/// --------------+--------------
|
||||
/// null | undefined
|
||||
/// integer | LLSD::Integer
|
||||
/// unsigned | LLSD::Integer
|
||||
/// real/numeric | LLSD::Real
|
||||
/// string | LLSD::String
|
||||
/// boolean | LLSD::Boolean
|
||||
/// array | LLSD::Array
|
||||
/// object | LLSD::Map
|
||||
///
|
||||
/// For maps and arrays child entries will be converted and added to the structure.
|
||||
/// Order is preserved for an array but not for objects.
|
||||
LLSD LlsdFromJson(const nlohmann::json &val);
|
||||
|
||||
/// Convert an LLSD object into Parsed JSON object maintaining member names and
|
||||
/// array indexs.
|
||||
///
|
||||
/// Types are converted as follows:
|
||||
/// LLSD Type | JSON Type
|
||||
/// --------------+----------------
|
||||
/// TypeUndefined | null
|
||||
/// TypeBoolean | boolean
|
||||
/// TypeInteger | integer
|
||||
/// TypeReal | real/numeric
|
||||
/// TypeString | string
|
||||
/// TypeURI | string
|
||||
/// TypeDate | string
|
||||
/// TypeUUID | string
|
||||
/// TypeMap | object
|
||||
/// TypeArray | array
|
||||
/// TypeBinary | unsupported
|
||||
nlohmann::json LlsdToJson(const LLSD &val);
|
||||
|
||||
#endif // LL_LLSDJSON_H
|
||||
@@ -1,3 +1,5 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
/**
|
||||
* @file llstring.cpp
|
||||
* @brief String utility functions and the std::string class.
|
||||
@@ -28,12 +30,17 @@
|
||||
|
||||
#include "llstring.h"
|
||||
#include "llerror.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "llsd.h"
|
||||
|
||||
#if LL_WINDOWS
|
||||
#include "llwin32headerslean.h"
|
||||
#include <winnls.h> // for WideCharToMultiByte
|
||||
#endif
|
||||
|
||||
LLTrace::BlockTimerStatHandle FT_STRING_FORMAT("String Format");
|
||||
|
||||
|
||||
std::string ll_safe_string(const char* in)
|
||||
{
|
||||
if(in) return std::string(in);
|
||||
@@ -47,6 +54,23 @@ std::string ll_safe_string(const char* in, S32 maxlen)
|
||||
return std::string();
|
||||
}
|
||||
|
||||
bool is_char_hex(char hex)
|
||||
{
|
||||
if((hex >= '0') && (hex <= '9'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if((hex >= 'a') && (hex <='f'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if((hex >= 'A') && (hex <='F'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false; // uh - oh, not hex any more...
|
||||
}
|
||||
|
||||
U8 hex_as_nybble(char hex)
|
||||
{
|
||||
if((hex >= '0') && (hex <= '9'))
|
||||
@@ -85,7 +109,7 @@ bool iswindividual(llwchar elem)
|
||||
|
||||
bool _read_file_into_string(std::string& str, const std::string& filename)
|
||||
{
|
||||
llifstream ifs(filename, llifstream::binary);
|
||||
llifstream ifs(filename.c_str(), llifstream::binary);
|
||||
if (!ifs.is_open())
|
||||
{
|
||||
LL_INFOS() << "Unable to open file " << filename << LL_ENDL;
|
||||
@@ -552,6 +576,33 @@ std::string utf8str_truncate(const std::string& utf8str, const S32 max_len)
|
||||
}
|
||||
}
|
||||
|
||||
std::string utf8str_symbol_truncate(const std::string& utf8str, const S32 symbol_len)
|
||||
{
|
||||
if (0 == symbol_len)
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
if ((S32)utf8str.length() <= symbol_len)
|
||||
{
|
||||
return utf8str;
|
||||
}
|
||||
else
|
||||
{
|
||||
int len = 0, byteIndex = 0;
|
||||
const char* aStr = utf8str.c_str();
|
||||
size_t origSize = utf8str.size();
|
||||
|
||||
for (byteIndex = 0; len < symbol_len && byteIndex < origSize; byteIndex++)
|
||||
{
|
||||
if ((aStr[byteIndex] & 0xc0) != 0x80)
|
||||
{
|
||||
len += 1;
|
||||
}
|
||||
}
|
||||
return utf8str.substr(0, byteIndex);
|
||||
}
|
||||
}
|
||||
|
||||
std::string utf8str_substChar(
|
||||
const std::string& utf8str,
|
||||
const llwchar target_char,
|
||||
@@ -628,10 +679,10 @@ std::string ll_convert_wide_to_string(const wchar_t* in, unsigned int code_page)
|
||||
0,
|
||||
in,
|
||||
len_in,
|
||||
NULL,
|
||||
nullptr,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
nullptr,
|
||||
nullptr);
|
||||
// We will need two more bytes for the double NULL ending
|
||||
// created in WideCharToMultiByte().
|
||||
char* pout = new char [len_out + 2];
|
||||
@@ -645,8 +696,8 @@ std::string ll_convert_wide_to_string(const wchar_t* in, unsigned int code_page)
|
||||
len_in,
|
||||
pout,
|
||||
len_out,
|
||||
0,
|
||||
0);
|
||||
nullptr,
|
||||
nullptr);
|
||||
out.assign(pout);
|
||||
delete[] pout;
|
||||
}
|
||||
@@ -667,8 +718,8 @@ wchar_t* ll_convert_string_to_wide(const std::string& in, unsigned int code_page
|
||||
// reserve place to NULL terminator
|
||||
int output_str_len = in.length();
|
||||
wchar_t* w_out = new wchar_t[output_str_len + 1];
|
||||
|
||||
memset(w_out, 0, output_str_len + 1);
|
||||
|
||||
int real_output_str_len = MultiByteToWideChar (code_page, 0, in.c_str(), in.length(), w_out, output_str_len);
|
||||
|
||||
//looks like MultiByteToWideChar didn't add null terminator to converted string, see EXT-4858.
|
||||
@@ -689,7 +740,7 @@ std::string ll_convert_string_to_utf8_string(const std::string& in)
|
||||
|
||||
long LLStringOps::sPacificTimeOffset = 0;
|
||||
long LLStringOps::sLocalTimeOffset = 0;
|
||||
bool LLStringOps::sPacificDaylightTime = 0;
|
||||
bool LLStringOps::sPacificDaylightTime = false;
|
||||
std::map<std::string, std::string> LLStringOps::datetimeToCodes;
|
||||
|
||||
std::vector<std::string> LLStringOps::sWeekDayList;
|
||||
@@ -708,7 +759,7 @@ S32 LLStringOps::collate(const llwchar* a, const llwchar* b)
|
||||
#if LL_WINDOWS
|
||||
// in Windows, wide string functions operator on 16-bit strings,
|
||||
// not the proper 32 bit wide string
|
||||
return strcmp(wstring_to_utf8str(LLWString(a)).c_str(), wstring_to_utf8str(LLWString(b)).c_str());
|
||||
return strcoll(wstring_to_utf8str(LLWString(a)).c_str(), wstring_to_utf8str(LLWString(b)).c_str());
|
||||
#else
|
||||
return wcscoll(a, b);
|
||||
#endif
|
||||
@@ -719,7 +770,7 @@ void LLStringOps::setupDatetimeInfo (bool daylight)
|
||||
time_t nowT, localT, gmtT;
|
||||
struct tm * tmpT;
|
||||
|
||||
nowT = time (NULL);
|
||||
nowT = time (nullptr);
|
||||
|
||||
tmpT = gmtime (&nowT);
|
||||
gmtT = mktime (tmpT);
|
||||
@@ -799,7 +850,7 @@ void LLStringOps::setupDayFormat(const std::string& data)
|
||||
}
|
||||
|
||||
|
||||
std::string LLStringOps::getDatetimeCode (std::string key)
|
||||
std::string LLStringOps::getDatetimeCode(const std::string& key)
|
||||
{
|
||||
std::map<std::string, std::string>::iterator iter;
|
||||
|
||||
@@ -1187,6 +1238,7 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
|
||||
template<>
|
||||
S32 LLStringUtil::format(std::string& s, const format_map_t& substitutions)
|
||||
{
|
||||
LL_RECORD_BLOCK_TIME(FT_STRING_FORMAT);
|
||||
S32 res = 0;
|
||||
|
||||
std::string output;
|
||||
@@ -1259,6 +1311,7 @@ S32 LLStringUtil::format(std::string& s, const format_map_t& substitutions)
|
||||
template<>
|
||||
S32 LLStringUtil::format(std::string& s, const LLSD& substitutions)
|
||||
{
|
||||
LL_RECORD_BLOCK_TIME(FT_STRING_FORMAT);
|
||||
S32 res = 0;
|
||||
|
||||
if (!substitutions.isMap())
|
||||
@@ -1387,7 +1440,7 @@ void LLStringUtilBase<T>::testHarness()
|
||||
|
||||
s2.erase( 4, 1 );
|
||||
llassert( s2 == "hell");
|
||||
s2.insert( 0, 1, 'y' );
|
||||
s2.insert( s2.begin(), 'y' );
|
||||
llassert( s2 == "yhell");
|
||||
s2.erase( 1, 3 );
|
||||
llassert( s2 == "yl");
|
||||
|
||||
@@ -29,8 +29,11 @@
|
||||
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <locale>
|
||||
//#include <locale>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "llsd.h"
|
||||
#include "llfasttimer.h"
|
||||
|
||||
@@ -49,6 +52,7 @@
|
||||
#endif
|
||||
|
||||
const char LL_UNKNOWN_CHAR = '?';
|
||||
class LLSD;
|
||||
|
||||
#if LL_DARWIN || LL_LINUX || LL_SOLARIS
|
||||
// Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already)
|
||||
@@ -209,7 +213,7 @@ public:
|
||||
// currently in daylight savings time?
|
||||
static bool getPacificDaylightTime(void) { return sPacificDaylightTime;}
|
||||
|
||||
static std::string getDatetimeCode (std::string key);
|
||||
static std::string getDatetimeCode (const std::string& key);
|
||||
|
||||
// Express a value like 1234567 as "1.23M"
|
||||
static std::string getReadableNumber(F64 num);
|
||||
@@ -301,7 +305,7 @@ public:
|
||||
|
||||
static bool isValidIndex(const string_type& string, size_type i)
|
||||
{
|
||||
return !string.empty() && (0 <= i) && (i <= string.size());
|
||||
return !string.empty() && (i <= string.size());
|
||||
}
|
||||
|
||||
static bool contains(const string_type& string, T c, size_type i=0)
|
||||
@@ -311,6 +315,7 @@ public:
|
||||
|
||||
static void trimHead(string_type& string);
|
||||
static void trimTail(string_type& string);
|
||||
static void trimTail(string_type& string, const string_type& tokens);
|
||||
static void trim(string_type& string) { trimHead(string); trimTail(string); }
|
||||
static void truncate(string_type& string, size_type count);
|
||||
|
||||
@@ -340,6 +345,7 @@ public:
|
||||
|
||||
static void addCRLF(string_type& string);
|
||||
static void removeCRLF(string_type& string);
|
||||
static void removeWindowsCR(string_type& string);
|
||||
|
||||
static void replaceTabsWithSpaces( string_type& string, size_type spaces_per_tab );
|
||||
static void replaceNonstandardASCII( string_type& string, T replacement );
|
||||
@@ -448,7 +454,7 @@ public:
|
||||
struct LLDictionaryLess
|
||||
{
|
||||
public:
|
||||
bool operator()(const std::string& a, const std::string& b)
|
||||
bool operator()(const std::string& a, const std::string& b) const
|
||||
{
|
||||
return (LLStringUtil::precedesDict(a, b) ? true : false);
|
||||
}
|
||||
@@ -478,6 +484,7 @@ inline std::string chop_tail_copy(
|
||||
* @brief This translates a nybble stored as a hex value from 0-f back
|
||||
* to a nybble in the low order bits of the return byte.
|
||||
*/
|
||||
LL_COMMON_API bool is_char_hex(char hex);
|
||||
LL_COMMON_API U8 hex_as_nybble(char hex);
|
||||
|
||||
/**
|
||||
@@ -532,10 +539,13 @@ LL_COMMON_API S32 wchar_to_utf8chars(llwchar inchar, char* outchars);
|
||||
|
||||
LL_COMMON_API std::string wstring_to_utf8str(const LLWString &utf32str, S32 len);
|
||||
LL_COMMON_API std::string wstring_to_utf8str(const LLWString &utf32str);
|
||||
|
||||
LL_COMMON_API std::string utf16str_to_utf8str(const llutf16string &utf16str, S32 len);
|
||||
LL_COMMON_API std::string utf16str_to_utf8str(const llutf16string &utf16str);
|
||||
|
||||
#if LL_WINDOWS
|
||||
inline std::string wstring_to_utf8str(const llutf16string &utf16str) { return utf16str_to_utf8str(utf16str);}
|
||||
#endif
|
||||
|
||||
// Length of this UTF32 string in bytes when transformed to UTF8
|
||||
LL_COMMON_API S32 wstring_utf8_length(const LLWString& wstr);
|
||||
|
||||
@@ -551,7 +561,7 @@ LL_COMMON_API S32 utf16str_wstring_length(const llutf16string &utf16str, S32 len
|
||||
LL_COMMON_API S32 wstring_utf16_length(const LLWString & wstr, S32 woffset, S32 wlen);
|
||||
|
||||
// Length in wstring (i.e., llwchar count) of a part of a wstring specified by utf16 length (i.e., utf16 units.)
|
||||
LL_COMMON_API S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, S32 woffset, S32 utf16_length, BOOL *unaligned = NULL);
|
||||
LL_COMMON_API S32 wstring_wstring_length_from_utf16_length(const LLWString & wstr, S32 woffset, S32 utf16_length, BOOL *unaligned = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Properly truncate a utf8 string to a maximum byte count.
|
||||
@@ -571,6 +581,17 @@ LL_COMMON_API S32 utf8str_compare_insensitive(
|
||||
const std::string& lhs,
|
||||
const std::string& rhs);
|
||||
|
||||
/**
|
||||
* @brief Properly truncate a utf8 string to a maximum character count.
|
||||
*
|
||||
* If symbol_len is longer than the string passed in, the return
|
||||
* value == utf8str.
|
||||
* @param utf8str A valid utf8 string to truncate.
|
||||
* @param symbol_len The maximum number of symbols in the return value.
|
||||
* @return Returns a valid utf8 string with symbol count <= max_len.
|
||||
*/
|
||||
LL_COMMON_API std::string utf8str_symbol_truncate(const std::string& utf8str, const S32 symbol_len);
|
||||
|
||||
/**
|
||||
* @brief Replace all occurences of target_char with replace_char
|
||||
*
|
||||
@@ -813,8 +834,9 @@ public:
|
||||
}
|
||||
|
||||
/// This implementation uses the answer cached by setiter().
|
||||
virtual bool escaped() const { return mIsEsc; }
|
||||
virtual T next()
|
||||
bool escaped() const override { return mIsEsc; }
|
||||
|
||||
T next() override
|
||||
{
|
||||
// If we're looking at the escape character of an escape sequence,
|
||||
// skip that character. This is the one time we can modify 'mIter'
|
||||
@@ -830,21 +852,21 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual bool is(T ch) const
|
||||
bool is(T ch) const override
|
||||
{
|
||||
// Like base-class is(), except that an escaped character matches
|
||||
// nothing.
|
||||
return (! done()) && (! mIsEsc) && *mIter == ch;
|
||||
}
|
||||
|
||||
virtual bool oneof(const string_type& delims) const
|
||||
bool oneof(const string_type& delims) const override
|
||||
{
|
||||
// Like base-class oneof(), except that an escaped character matches
|
||||
// nothing.
|
||||
return (! done()) && (! mIsEsc) && LLStringUtilBase<T>::contains(delims, *mIter);
|
||||
}
|
||||
|
||||
virtual bool collect_until(string_type& into, const_iterator from, T delim)
|
||||
bool collect_until(string_type& into, const_iterator from, T delim) override
|
||||
{
|
||||
// Deal with escapes in the characters we collect; that is, an escaped
|
||||
// character must become just that character without the preceding
|
||||
@@ -1158,7 +1180,7 @@ BOOL LLStringUtilBase<T>::precedesDict( const string_type& a, const string_type&
|
||||
{
|
||||
if( a.size() && b.size() )
|
||||
{
|
||||
return (LLStringUtilBase<T>::compareDict(a.c_str(), b.c_str()) < 0);
|
||||
return (LLStringUtilBase<T>::compareDict(a, b) < 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1213,7 +1235,7 @@ void LLStringUtilBase<T>::trimHead(string_type& string)
|
||||
template<class T>
|
||||
void LLStringUtilBase<T>::trimTail(string_type& string)
|
||||
{
|
||||
if( string.size() )
|
||||
if(!string.empty())
|
||||
{
|
||||
size_type len = string.length();
|
||||
size_type i = len;
|
||||
@@ -1226,12 +1248,31 @@ void LLStringUtilBase<T>::trimTail(string_type& string)
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void LLStringUtilBase<T>::trimTail(string_type& string, const string_type& tokens)
|
||||
{
|
||||
if(!string.empty())
|
||||
{
|
||||
size_type len = string.length();
|
||||
size_type i = len;
|
||||
while( i > 0 && (tokens.find_first_of(string[i-1]) != string_type::npos) )
|
||||
{
|
||||
i--;
|
||||
}
|
||||
|
||||
string.erase( i, len - i );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Replace line feeds with carriage return-line feed pairs.
|
||||
//static
|
||||
template<class T>
|
||||
void LLStringUtilBase<T>::addCRLF(string_type& string)
|
||||
{
|
||||
if (string.empty())
|
||||
return;
|
||||
|
||||
const T LF = 10;
|
||||
const T CR = 13;
|
||||
|
||||
@@ -1274,6 +1315,9 @@ void LLStringUtilBase<T>::addCRLF(string_type& string)
|
||||
template<class T>
|
||||
void LLStringUtilBase<T>::removeCRLF(string_type& string)
|
||||
{
|
||||
if (string.empty())
|
||||
return;
|
||||
|
||||
const T CR = 13;
|
||||
|
||||
size_type cr_count = 0;
|
||||
@@ -1293,6 +1337,32 @@ void LLStringUtilBase<T>::removeCRLF(string_type& string)
|
||||
|
||||
//static
|
||||
template<class T>
|
||||
void LLStringUtilBase<T>::removeWindowsCR(string_type& string)
|
||||
{
|
||||
if (string.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
const T LF = 10;
|
||||
const T CR = 13;
|
||||
|
||||
size_type cr_count = 0;
|
||||
size_type len = string.size();
|
||||
size_type i;
|
||||
for( i = 0; i < len - cr_count - 1; i++ )
|
||||
{
|
||||
if( string[i+cr_count] == CR && string[i+cr_count+1] == LF)
|
||||
{
|
||||
cr_count++;
|
||||
}
|
||||
|
||||
string[i] = string[i+cr_count];
|
||||
}
|
||||
string.erase(i, cr_count);
|
||||
}
|
||||
|
||||
//static
|
||||
template<class T>
|
||||
void LLStringUtilBase<T>::replaceChar( string_type& string, T target, T replacement )
|
||||
{
|
||||
size_type found_pos = 0;
|
||||
@@ -1376,6 +1446,7 @@ BOOL LLStringUtilBase<T>::containsNonprintable(const string_type& string)
|
||||
return rv;
|
||||
}
|
||||
|
||||
// *TODO: reimplement in terms of algorithm
|
||||
//static
|
||||
template<class T>
|
||||
void LLStringUtilBase<T>::stripNonprintable(string_type& string)
|
||||
@@ -1386,33 +1457,23 @@ void LLStringUtilBase<T>::stripNonprintable(string_type& string)
|
||||
{
|
||||
return;
|
||||
}
|
||||
size_t src_size = string.size();
|
||||
char* c_string = nullptr;
|
||||
try
|
||||
{
|
||||
c_string = new char[src_size + 1];
|
||||
}
|
||||
catch (const std::bad_alloc&)
|
||||
{
|
||||
return;
|
||||
}
|
||||
copy(c_string, string.c_str(), src_size+1);
|
||||
char* write_head = &c_string[0];
|
||||
const size_t src_size = string.size();
|
||||
auto c_string = std::make_unique<char[]>(src_size + 1);
|
||||
|
||||
copy(c_string.get(), string.c_str(), src_size+1);
|
||||
for (size_type i = 0; i < src_size; i++)
|
||||
{
|
||||
char* read_head = &string[i];
|
||||
write_head = &c_string[j];
|
||||
if(!(*read_head < MIN))
|
||||
if(string[i] >= MIN)
|
||||
{
|
||||
*write_head = *read_head;
|
||||
c_string[j] = string[i];
|
||||
++j;
|
||||
}
|
||||
}
|
||||
c_string[j]= '\0';
|
||||
string = c_string;
|
||||
delete []c_string;
|
||||
string.assign(c_string.get());
|
||||
}
|
||||
|
||||
// *TODO: reimplement in terms of algorithm
|
||||
template<class T>
|
||||
std::basic_string<T> LLStringUtilBase<T>::quote(const string_type& str,
|
||||
const string_type& triggers,
|
||||
@@ -1434,7 +1495,9 @@ std::basic_string<T> LLStringUtilBase<T>::quote(const string_type& str,
|
||||
}
|
||||
|
||||
// For whatever reason, we must quote this string.
|
||||
auto needed_escapes = std::count(str.begin(), str.end(), '"');
|
||||
string_type result;
|
||||
result.reserve(len + (needed_escapes * escape.length()));
|
||||
result.push_back('"');
|
||||
for (typename string_type::const_iterator ci(str.begin()), cend(str.end()); ci != cend; ++ci)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
/**
|
||||
* @file lluri.cpp
|
||||
* @author Phoenix
|
||||
@@ -40,7 +42,8 @@
|
||||
#include <boost/algorithm/string/find_iterator.hpp>
|
||||
#include <boost/algorithm/string/finder.hpp>
|
||||
|
||||
void encode_character(std::ostream& ostr, std::string::value_type val)
|
||||
// static
|
||||
void LLURI::encodeCharacter(std::ostream& ostr, std::string::value_type val)
|
||||
{
|
||||
ostr << "%"
|
||||
|
||||
@@ -95,7 +98,7 @@ std::string LLURI::escape(
|
||||
}
|
||||
else
|
||||
{
|
||||
encode_character(ostr, c);
|
||||
encodeCharacter(ostr, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,7 +109,7 @@ std::string LLURI::escape(
|
||||
c = *it;
|
||||
if(allowed.find(c) == std::string::npos)
|
||||
{
|
||||
encode_character(ostr, c);
|
||||
encodeCharacter(ostr, c);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -129,11 +132,30 @@ std::string LLURI::unescape(const std::string& str)
|
||||
{
|
||||
++it;
|
||||
if(it == end) break;
|
||||
U8 c = hex_as_nybble(*it++);
|
||||
c = c << 4;
|
||||
if (it == end) break;
|
||||
c |= hex_as_nybble(*it);
|
||||
ostr.put((char)c);
|
||||
|
||||
if(is_char_hex(*it))
|
||||
{
|
||||
U8 c = hex_as_nybble(*it++);
|
||||
|
||||
c = c << 4;
|
||||
if (it == end) break;
|
||||
|
||||
if(is_char_hex(*it))
|
||||
{
|
||||
c |= hex_as_nybble(*it);
|
||||
ostr.put((char)c);
|
||||
}
|
||||
else
|
||||
{
|
||||
ostr.put((char)c);
|
||||
ostr.put(*it);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ostr.put('%');
|
||||
ostr.put(*it);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -169,11 +191,10 @@ namespace
|
||||
{ return LLURI::escape(s, unreserved() + ":@!$'()*+,="); } // sub_delims - "&;" + ":@"
|
||||
}
|
||||
|
||||
// *TODO: Consider using curl. After http textures gets merged everywhere.
|
||||
// static
|
||||
std::string LLURI::escape(const std::string& str)
|
||||
{
|
||||
static std::string default_allowed(unreserved() + ":@!$'()*+,=/?&#;");
|
||||
static std::string default_allowed = unreserved();
|
||||
static bool initialized = false;
|
||||
if(!initialized)
|
||||
{
|
||||
@@ -228,7 +249,8 @@ void LLURI::parseAuthorityAndPathUsingOpaque()
|
||||
{
|
||||
if (mScheme == "http" || mScheme == "https" ||
|
||||
mScheme == "ftp" || mScheme == "secondlife" ||
|
||||
mScheme == "x-grid-location-info")
|
||||
mScheme == "x-grid-info" ||
|
||||
mScheme == "x-grid-location-info") // legacy
|
||||
{
|
||||
if (mEscapedOpaque.substr(0,2) != "//")
|
||||
{
|
||||
@@ -401,6 +423,15 @@ LLURI LLURI::buildHTTP(const std::string& prefix,
|
||||
return uri;
|
||||
}
|
||||
|
||||
// static
|
||||
LLURI LLURI::buildHTTP(const std::string& scheme,
|
||||
const std::string& prefix,
|
||||
const LLSD& path,
|
||||
const LLSD& query)
|
||||
{
|
||||
return buildHTTP(llformat("%s://%s", scheme.c_str(), prefix.c_str()), path, query);
|
||||
}
|
||||
|
||||
// static
|
||||
LLURI LLURI::buildHTTP(const std::string& host,
|
||||
const U32& port,
|
||||
@@ -485,6 +516,14 @@ std::string LLURI::hostName() const
|
||||
return unescape(host);
|
||||
}
|
||||
|
||||
std::string LLURI::hostNameAndPort() const
|
||||
{
|
||||
std::string user, host, port;
|
||||
findAuthorityParts(mEscapedAuthority, user, host, port);
|
||||
return port.empty() ? unescape(host) : unescape(host + ":" + port);
|
||||
}
|
||||
|
||||
|
||||
std::string LLURI::userName() const
|
||||
{
|
||||
std::string user, userPass, host, port;
|
||||
|
||||
@@ -4,31 +4,25 @@
|
||||
* @date 2006-02-05
|
||||
* @brief Declaration of the URI class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2006-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -72,6 +66,13 @@ public:
|
||||
const std::string& prefix,
|
||||
const LLSD& path,
|
||||
const LLSD& query);
|
||||
|
||||
static LLURI buildHTTP(
|
||||
const std::string& scheme,
|
||||
const std::string& prefix,
|
||||
const LLSD& path,
|
||||
const LLSD& query);
|
||||
|
||||
///< prefix is either a full URL prefix of the form
|
||||
/// "http://example.com:8080", or it can be simply a host and
|
||||
/// optional port like "example.com" or "example.com:8080", in
|
||||
@@ -99,20 +100,21 @@ public:
|
||||
std::string scheme() const; ///< ex.: "http", note lack of colon
|
||||
std::string opaque() const; ///< everything after the colon
|
||||
|
||||
// for schemes that follow path like syntax (http, https, ftp)
|
||||
std::string authority() const; // ex.: "host.com:80"
|
||||
std::string hostName() const; // ex.: "host.com"
|
||||
std::string userName() const;
|
||||
std::string password() const;
|
||||
U16 hostPort() const; // ex.: 80, will include implicit port
|
||||
BOOL defaultPort() const; // true if port is default for scheme
|
||||
const std::string& escapedPath() const { return mEscapedPath; }
|
||||
std::string path() const; // ex.: "/abc/def", includes leading slash
|
||||
LLSD pathArray() const; // above decoded into an array of strings
|
||||
std::string query() const; // ex.: "x=34", section after "?"
|
||||
const std::string& escapedQuery() const { return mEscapedQuery; }
|
||||
LLSD queryMap() const; // above decoded into a map
|
||||
static LLSD queryMap(std::string escaped_query_string);
|
||||
// for schemes that follow path like syntax (http, https, ftp)
|
||||
std::string authority() const; // ex.: "user:pass@host.com:80"
|
||||
std::string hostName() const; // ex.: "host.com"
|
||||
std::string hostNameAndPort() const; // ex.: "host.com:80"
|
||||
std::string userName() const;
|
||||
std::string password() const;
|
||||
U16 hostPort() const; // ex.: 80, will include implicit port
|
||||
BOOL defaultPort() const; // true if port is default for scheme
|
||||
const std::string& escapedPath() const { return mEscapedPath; }
|
||||
std::string path() const; // ex.: "/abc/def", includes leading slash
|
||||
LLSD pathArray() const; // above decoded into an array of strings
|
||||
std::string query() const; // ex.: "x=34", section after "?"
|
||||
const std::string& escapedQuery() const { return mEscapedQuery; }
|
||||
LLSD queryMap() const; // above decoded into a map
|
||||
static LLSD queryMap(std::string escaped_query_string);
|
||||
|
||||
/**
|
||||
* @brief given a name value map, return a serialized query string.
|
||||
@@ -127,27 +129,24 @@ public:
|
||||
/** @name Escaping Utilities */
|
||||
//@{
|
||||
/**
|
||||
* @brief Escape a raw url with a reasonable set of allowed characters.
|
||||
* @brief 'Escape' symbol into stream
|
||||
*
|
||||
* The default set was chosen to match HTTP urls and general
|
||||
* guidelines for naming resources. Passing in a raw url does not
|
||||
* produce well defined results because you really need to know
|
||||
* which segments are path parts because path parts are supposed
|
||||
* to be escaped individually. The default set chosen is:
|
||||
* @param ostr Output stream.
|
||||
* @param val Symbol to encode.
|
||||
*/
|
||||
static void encodeCharacter(std::ostream& ostr, std::string::value_type val);
|
||||
|
||||
/**
|
||||
* @brief Escape the string passed except for unreserved
|
||||
*
|
||||
* ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
* 0123456789
|
||||
* -._~
|
||||
* :@!$'()*+,=/?&#;
|
||||
*
|
||||
* *NOTE: This API is basically broken because it does not
|
||||
* allow you to specify significant path characters. For example,
|
||||
* if the filename actually contained a /, then you cannot use
|
||||
* this function to generate the serialized url for that
|
||||
* resource.
|
||||
* @see http://www.ietf.org/rfc/rfc1738.txt
|
||||
*
|
||||
* @param str The raw URI to escape.
|
||||
* @return Returns the escaped uri or an empty string.
|
||||
* @return Returns the rfc 1738 escaped uri or an empty string.
|
||||
*/
|
||||
static std::string escape(const std::string& str);
|
||||
|
||||
|
||||
266
indra/llcommon/lluriparser.cpp
Normal file
266
indra/llcommon/lluriparser.cpp
Normal file
@@ -0,0 +1,266 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
/**
|
||||
* @file lluriparser.cpp
|
||||
* @author Protey
|
||||
* @date 2014-10-07
|
||||
* @brief Implementation of the LLUriParser class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2014&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2014, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "lluriparser.h"
|
||||
|
||||
LLUriParser::LLUriParser(const std::string& u)
|
||||
: mRes(0)
|
||||
, mTmpScheme(false)
|
||||
, mNormalizedTmp(false)
|
||||
{
|
||||
mState.uri = &mUri;
|
||||
|
||||
if (u.find("://") == std::string::npos)
|
||||
{
|
||||
mNormalizedUri = "http://";
|
||||
mTmpScheme = true;
|
||||
}
|
||||
|
||||
mNormalizedUri += u;
|
||||
|
||||
mRes = parse();
|
||||
}
|
||||
|
||||
LLUriParser::~LLUriParser()
|
||||
{
|
||||
uriFreeUriMembersA(&mUri);
|
||||
}
|
||||
|
||||
S32 LLUriParser::parse()
|
||||
{
|
||||
mRes = uriParseUriA(&mState, mNormalizedUri.c_str());
|
||||
return mRes;
|
||||
}
|
||||
|
||||
const char * LLUriParser::scheme() const
|
||||
{
|
||||
return mScheme.c_str();
|
||||
}
|
||||
|
||||
void LLUriParser::scheme(const std::string& s)
|
||||
{
|
||||
mTmpScheme = !s.size();
|
||||
mScheme = s;
|
||||
}
|
||||
|
||||
const char * LLUriParser::port() const
|
||||
{
|
||||
return mPort.c_str();
|
||||
}
|
||||
|
||||
void LLUriParser::port(const std::string& s)
|
||||
{
|
||||
mPort = s;
|
||||
}
|
||||
|
||||
const char * LLUriParser::host() const
|
||||
{
|
||||
return mHost.c_str();
|
||||
}
|
||||
|
||||
void LLUriParser::host(const std::string& s)
|
||||
{
|
||||
mHost = s;
|
||||
}
|
||||
|
||||
const char * LLUriParser::path() const
|
||||
{
|
||||
return mPath.c_str();
|
||||
}
|
||||
|
||||
void LLUriParser::path(const std::string& s)
|
||||
{
|
||||
mPath = s;
|
||||
}
|
||||
|
||||
const char * LLUriParser::query() const
|
||||
{
|
||||
return mQuery.c_str();
|
||||
}
|
||||
|
||||
void LLUriParser::query(const std::string& s)
|
||||
{
|
||||
mQuery = s;
|
||||
}
|
||||
|
||||
const char * LLUriParser::fragment() const
|
||||
{
|
||||
return mFragment.c_str();
|
||||
}
|
||||
|
||||
void LLUriParser::fragment(const std::string& s)
|
||||
{
|
||||
mFragment = s;
|
||||
}
|
||||
|
||||
void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str)
|
||||
{
|
||||
if (textRange.first != nullptr && textRange.afterLast != nullptr && textRange.first < textRange.afterLast)
|
||||
{
|
||||
const ptrdiff_t len = textRange.afterLast - textRange.first;
|
||||
str.assign(textRange.first, static_cast<std::string::size_type>(len));
|
||||
}
|
||||
else
|
||||
{
|
||||
str = LLStringUtil::null;
|
||||
}
|
||||
}
|
||||
|
||||
void LLUriParser::extractParts()
|
||||
{
|
||||
if (mTmpScheme || mNormalizedTmp)
|
||||
{
|
||||
mScheme.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
textRangeToString(mUri.scheme, mScheme);
|
||||
}
|
||||
|
||||
textRangeToString(mUri.hostText, mHost);
|
||||
textRangeToString(mUri.portText, mPort);
|
||||
textRangeToString(mUri.query, mQuery);
|
||||
textRangeToString(mUri.fragment, mFragment);
|
||||
|
||||
UriPathSegmentA * pathHead = mUri.pathHead;
|
||||
while (pathHead)
|
||||
{
|
||||
std::string partOfPath;
|
||||
textRangeToString(pathHead->text, partOfPath);
|
||||
|
||||
mPath += '/';
|
||||
mPath += partOfPath;
|
||||
|
||||
pathHead = pathHead->next;
|
||||
}
|
||||
}
|
||||
|
||||
S32 LLUriParser::normalize()
|
||||
{
|
||||
mNormalizedTmp = mTmpScheme;
|
||||
if (!mRes)
|
||||
{
|
||||
mRes = uriNormalizeSyntaxExA(&mUri, URI_NORMALIZE_SCHEME | URI_NORMALIZE_HOST);
|
||||
|
||||
if (!mRes)
|
||||
{
|
||||
S32 chars_required;
|
||||
mRes = uriToStringCharsRequiredA(&mUri, &chars_required);
|
||||
|
||||
if (!mRes)
|
||||
{
|
||||
chars_required++;
|
||||
std::vector<char> label_buf(chars_required);
|
||||
mRes = uriToStringA(&label_buf[0], &mUri, chars_required, nullptr);
|
||||
|
||||
if (!mRes)
|
||||
{
|
||||
mNormalizedUri = &label_buf[mTmpScheme ? 7 : 0];
|
||||
mTmpScheme = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(mTmpScheme)
|
||||
{
|
||||
mNormalizedUri = mNormalizedUri.substr(7);
|
||||
mTmpScheme = false;
|
||||
}
|
||||
|
||||
return mRes;
|
||||
}
|
||||
|
||||
void LLUriParser::glue(std::string& uri) const
|
||||
{
|
||||
std::string first_part;
|
||||
glueFirst(first_part);
|
||||
|
||||
std::string second_part;
|
||||
glueSecond(second_part);
|
||||
|
||||
uri = first_part + second_part;
|
||||
}
|
||||
|
||||
void LLUriParser::glueFirst(std::string& uri, bool use_scheme) const
|
||||
{
|
||||
if (use_scheme && mScheme.size())
|
||||
{
|
||||
uri = mScheme;
|
||||
uri += "://";
|
||||
}
|
||||
else
|
||||
{
|
||||
uri.clear();
|
||||
}
|
||||
|
||||
uri += mHost;
|
||||
}
|
||||
|
||||
void LLUriParser::glueSecond(std::string& uri) const
|
||||
{
|
||||
if (mPort.size())
|
||||
{
|
||||
uri = ':';
|
||||
uri += mPort;
|
||||
}
|
||||
else
|
||||
{
|
||||
uri.clear();
|
||||
}
|
||||
|
||||
uri += mPath;
|
||||
|
||||
if (mQuery.size())
|
||||
{
|
||||
uri += '?';
|
||||
uri += mQuery;
|
||||
}
|
||||
|
||||
if (mFragment.size())
|
||||
{
|
||||
uri += '#';
|
||||
uri += mFragment;
|
||||
}
|
||||
}
|
||||
|
||||
bool LLUriParser::test() const
|
||||
{
|
||||
std::string uri;
|
||||
glue(uri);
|
||||
|
||||
return uri == mNormalizedUri;
|
||||
}
|
||||
|
||||
const char * LLUriParser::normalizedUri() const
|
||||
{
|
||||
return mNormalizedUri.c_str();
|
||||
}
|
||||
87
indra/llcommon/lluriparser.h
Normal file
87
indra/llcommon/lluriparser.h
Normal file
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* @file lluriparser.h
|
||||
* @author Protey
|
||||
* @date 20146-10-07
|
||||
* @brief Declaration of the UriParser class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2014&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2014, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLURIPARSER_H
|
||||
#define LL_LLURIPARSER_H
|
||||
|
||||
#include <string>
|
||||
#include <uriparser/Uri.h>
|
||||
|
||||
class LL_COMMON_API LLUriParser
|
||||
{
|
||||
public:
|
||||
LLUriParser(const std::string& u);
|
||||
~LLUriParser();
|
||||
|
||||
const char * scheme() const;
|
||||
void scheme (const std::string& s);
|
||||
|
||||
const char * port() const;
|
||||
void port (const std::string& s);
|
||||
|
||||
const char * host() const;
|
||||
void host (const std::string& s);
|
||||
|
||||
const char * path() const;
|
||||
void path (const std::string& s);
|
||||
|
||||
const char * query() const;
|
||||
void query (const std::string& s);
|
||||
|
||||
const char * fragment() const;
|
||||
void fragment (const std::string& s);
|
||||
|
||||
const char * normalizedUri() const;
|
||||
|
||||
void extractParts();
|
||||
void glue(std::string& uri) const;
|
||||
void glueFirst(std::string& uri, bool use_scheme = true) const;
|
||||
void glueSecond(std::string& uri) const;
|
||||
bool test() const;
|
||||
S32 normalize();
|
||||
|
||||
private:
|
||||
S32 parse();
|
||||
void textRangeToString(UriTextRangeA& textRange, std::string& str);
|
||||
std::string mScheme;
|
||||
std::string mHost;
|
||||
std::string mPort;
|
||||
std::string mPath;
|
||||
std::string mQuery;
|
||||
std::string mFragment;
|
||||
std::string mNormalizedUri;
|
||||
|
||||
UriParserStateA mState;
|
||||
UriUriA mUri;
|
||||
|
||||
S32 mRes;
|
||||
bool mTmpScheme;
|
||||
bool mNormalizedTmp;
|
||||
};
|
||||
|
||||
#endif // LL_LLURIPARSER_H
|
||||
@@ -103,6 +103,9 @@ LLFolderDictionary::LLFolderDictionary()
|
||||
addEntry(LLFolderType::FT_OUTBOX, new FolderEntry("outbox", TRUE));
|
||||
addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_rt", TRUE));
|
||||
|
||||
addEntry(LLFolderType::FT_MARKETPLACE_LISTINGS, new FolderEntry("merchant", FALSE));
|
||||
addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new FolderEntry("stock", FALSE));
|
||||
addEntry(LLFolderType::FT_MARKETPLACE_VERSION, new FolderEntry("version", FALSE));
|
||||
addEntry(LLFolderType::FT_SUITCASE, new FolderEntry("suitcase", TRUE));
|
||||
|
||||
addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE));
|
||||
|
||||
@@ -94,6 +94,9 @@ public:
|
||||
|
||||
FT_BASIC_ROOT = 52,
|
||||
|
||||
FT_MARKETPLACE_LISTINGS = 53,
|
||||
FT_MARKETPLACE_STOCK = 54,
|
||||
FT_MARKETPLACE_VERSION = 55, // Note: We actually *never* create folders with that type. This is used for icon override only.
|
||||
FT_SUITCASE = 100,
|
||||
|
||||
FT_COUNT,
|
||||
|
||||
@@ -85,6 +85,7 @@ LLInventoryDictionary::LLInventoryDictionary()
|
||||
addEntry(LLInventoryType::IT_ANIMATION, new InventoryEntry("animation", "animation", 1, LLAssetType::AT_ANIMATION));
|
||||
addEntry(LLInventoryType::IT_GESTURE, new InventoryEntry("gesture", "gesture", 1, LLAssetType::AT_GESTURE));
|
||||
addEntry(LLInventoryType::IT_MESH, new InventoryEntry("mesh", "mesh", 1, LLAssetType::AT_MESH));
|
||||
addEntry(LLInventoryType::IT_SETTINGS, new InventoryEntry("settings", "settings", 1, LLAssetType::AT_SETTINGS));
|
||||
}
|
||||
|
||||
|
||||
@@ -145,6 +146,15 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] =
|
||||
LLInventoryType::IT_NONE, // 47 AT_NONE
|
||||
LLInventoryType::IT_NONE, // 48 AT_NONE
|
||||
LLInventoryType::IT_MESH, // 49 AT_MESH
|
||||
|
||||
LLInventoryType::IT_NONE, // 50 AT_RESERVED_1
|
||||
LLInventoryType::IT_NONE, // 52 AT_RESERVED_2
|
||||
LLInventoryType::IT_NONE, // 53 AT_RESERVED_3
|
||||
LLInventoryType::IT_NONE, // 54 AT_RESERVED_4
|
||||
LLInventoryType::IT_NONE, // 55 AT_RESERVED_5
|
||||
LLInventoryType::IT_NONE, // 56 AT_RESERVED_6
|
||||
|
||||
LLInventoryType::IT_SETTINGS, // 57 AT_SETTINGS
|
||||
};
|
||||
|
||||
// static
|
||||
|
||||
@@ -62,8 +62,10 @@ public:
|
||||
IT_ANIMATION = 19,
|
||||
IT_GESTURE = 20,
|
||||
IT_MESH = 22,
|
||||
IT_COUNT = 23,
|
||||
IT_SETTINGS = 25,
|
||||
IT_COUNT = 26,
|
||||
|
||||
IT_UNKNOWN = 255,
|
||||
IT_NONE = -1
|
||||
};
|
||||
|
||||
@@ -108,8 +110,14 @@ public:
|
||||
ICONNAME_LINKFOLDER,
|
||||
ICONNAME_MESH,
|
||||
|
||||
ICONNAME_SETTINGS,
|
||||
ICONNAME_SETTINGS_SKY,
|
||||
ICONNAME_SETTINGS_WATER,
|
||||
ICONNAME_SETTINGS_DAY,
|
||||
|
||||
ICONNAME_CLOTHING_UNKNOWN,
|
||||
ICONNAME_INVALID,
|
||||
ICONNAME_UNKNOWN,
|
||||
ICONNAME_COUNT,
|
||||
ICONNAME_NONE = -1
|
||||
};
|
||||
|
||||
@@ -68,7 +68,7 @@ const U32 PF_ALLOW_ALL_OBJECT_ENTRY = 1 << 27; // Allow all objects to enter a
|
||||
const U32 PF_ALLOW_GROUP_OBJECT_ENTRY = 1 << 28; // Only allow group (and owner) objects to enter the parcel
|
||||
const U32 PF_ALLOW_VOICE_CHAT = 1 << 29; // Allow residents to use voice chat on this parcel
|
||||
const U32 PF_USE_ESTATE_VOICE_CHAN = 1 << 30;
|
||||
const U32 PF_DENY_AGEUNVERIFIED = 1 << 31; // Prevent residents who aren't age-verified
|
||||
const U32 PF_DENY_AGEUNVERIFIED = 1U << 31; // Prevent residents who aren't age-verified
|
||||
// NOTE: At one point we have used all of the bits.
|
||||
// We have deprecated two of them in 1.19.0 which *could* be reused,
|
||||
// but only after we are certain there are no simstates using those bits.
|
||||
|
||||
@@ -395,7 +395,7 @@ inline U32 get_lower_power_two(U32 val, U32 max_power_two)
|
||||
{
|
||||
if(!max_power_two)
|
||||
{
|
||||
max_power_two = 1 << 31 ;
|
||||
max_power_two = 1U << 31 ;
|
||||
}
|
||||
if(max_power_two & (max_power_two - 1))
|
||||
{
|
||||
@@ -417,7 +417,7 @@ inline U32 get_next_power_two(U32 val, U32 max_power_two)
|
||||
{
|
||||
if(!max_power_two)
|
||||
{
|
||||
max_power_two = 1 << 31 ;
|
||||
max_power_two = 1U << 31 ;
|
||||
}
|
||||
|
||||
if(val >= max_power_two)
|
||||
|
||||
@@ -2291,12 +2291,13 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size
|
||||
}
|
||||
else
|
||||
{
|
||||
reason = "Unexpected HTTP status.";
|
||||
//reason = "Unexpected HTTP status.";
|
||||
LL_WARNS() << "Received unexpected status value from server (" << status << "): \"" << header << "\"" << LL_ENDL;
|
||||
}
|
||||
// Singu TODO: WHAT THE HELL WAS THIS?! LYING? WHY WERE WE LYING???? Responders USE These Codes!!!!!
|
||||
// Either way, this status value is not understood (or taken into account).
|
||||
// Set it to internal error so that the rest of code treats it as an error.
|
||||
status = HTTP_INTERNAL_ERROR_OTHER;
|
||||
if (!status) status = HTTP_INTERNAL_ERROR_OTHER;
|
||||
}
|
||||
self_w->received_HTTP_header();
|
||||
self_w->setStatusAndReason(status, reason);
|
||||
|
||||
@@ -69,6 +69,7 @@ const U32 FLAGS_TEMPORARY = (1U << 30);
|
||||
//const U32 FLAGS_UNUSED_007 = (1U << 31); // was FLAGS_ZLIB_COMPRESSED
|
||||
|
||||
const U32 FLAGS_LOCAL = FLAGS_ANIM_SOURCE | FLAGS_CAMERA_SOURCE;
|
||||
const U32 FLAGS_WORLD = FLAGS_USE_PHYSICS | FLAGS_PHANTOM | FLAGS_TEMPORARY_ON_REZ;
|
||||
|
||||
typedef enum e_havok_joint_type
|
||||
{
|
||||
|
||||
@@ -584,7 +584,7 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve
|
||||
// Check if dimensions are a power of two!
|
||||
if (!checkSize(width,height))
|
||||
{
|
||||
LL_WARNS() << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on Aurora-Sim, beware." << LL_ENDL;
|
||||
LL_WARNS() << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on WhiteCore, beware." << LL_ENDL;
|
||||
}
|
||||
|
||||
if (mTexName)
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "llpostprocess.h"
|
||||
|
||||
#include "lldir.h"
|
||||
#include "llcontrol.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "llgl.h"
|
||||
#include "llglslshader.h"
|
||||
@@ -286,7 +287,7 @@ public:
|
||||
LLVector2 screen_rect = LLPostProcess::getInstance()->getDimensions();
|
||||
|
||||
mPassLoc = getShader().getUniformLocation(sHorizontalPass);
|
||||
LLVector4 vec[] = { LLVector4(1.3846153846, 3.2307692308, 0, 0) / screen_rect.mV[VX], LLVector4( 0,0, 1.3846153846, 3.2307692308 ) / screen_rect.mV[VY] };
|
||||
LLVector4 vec[] = { LLVector4(1.3846153846f, 3.2307692308f, 0.f, 0.f) / screen_rect.mV[VX], LLVector4( 0.f,0.f, 1.3846153846f, 3.2307692308f ) / screen_rect.mV[VY] };
|
||||
getShader().uniform4fv(sKern, LL_ARRAY_SIZE(vec), (GLfloat*)vec);
|
||||
return QUAD_NORMAL;
|
||||
}
|
||||
@@ -355,42 +356,44 @@ LLPostProcess::LLPostProcess(void) :
|
||||
mShaders.push_back(new LLPosterizeShader());
|
||||
|
||||
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.*/
|
||||
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
|
||||
LL_DEBUGS("AppInit", "Shaders") << "Loading PostProcess Effects settings from " << pathName << LL_ENDL;
|
||||
|
||||
llifstream effectsXML(pathName);
|
||||
|
||||
if (effectsXML)
|
||||
auto load_effects = [&](const std::string& pathName)
|
||||
{
|
||||
LLPointer<LLSDParser> parser = new LLSDXMLParser();
|
||||
LL_DEBUGS("AppInit", "Shaders") << "Loading PostProcess Effects settings from " << pathName << LL_ENDL;
|
||||
llifstream effectsXML(pathName);
|
||||
|
||||
parser->parse(effectsXML, mAllEffectInfo, LLSDSerialize::SIZE_UNLIMITED);
|
||||
}
|
||||
if (effectsXML)
|
||||
{
|
||||
LLPointer<LLSDParser> parser = new LLSDXMLParser();
|
||||
parser->parse(effectsXML, mAllEffectInfo, LLSDSerialize::SIZE_UNLIMITED);
|
||||
}
|
||||
};
|
||||
load_effects(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
|
||||
load_effects(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "windlight", XML_FILENAME));
|
||||
|
||||
// Singu TODO: Make this configurable via settings
|
||||
if (!mAllEffectInfo.has("default"))
|
||||
mAllEffectInfo["default"] = LLSD::emptyMap();
|
||||
auto setting = gSavedSettings.getControl("SinguPostProcessDefault");
|
||||
setting->getSignal()->connect(std::bind(&LLPostProcess::setSelectedEffect, this, std::bind(&LLSD::asStringRef, std::placeholders::_2)));
|
||||
const auto& str = setting->get().asStringRef();
|
||||
if (!mAllEffectInfo.has(str))
|
||||
mAllEffectInfo[str] = LLSD::emptyMap();
|
||||
|
||||
LLSD& defaults = mAllEffectInfo["default"];
|
||||
LLSD& defaults = mAllEffectInfo[str];
|
||||
|
||||
for(std::list<LLPointer<LLPostProcessShader> >::iterator it=mShaders.begin();it!=mShaders.end();++it)
|
||||
// Add defaults for all missing effects
|
||||
for(auto& shader : mShaders)
|
||||
{
|
||||
LLSD shader_defaults = (*it)->getDefaults();
|
||||
const LLSD shader_defaults = shader->getDefaults();
|
||||
for (LLSD::map_const_iterator it2 = defaults.beginMap();it2 != defaults.endMap();++it2)
|
||||
{
|
||||
if(!defaults.has(it2->first))
|
||||
defaults[it2->first]=it2->second;
|
||||
}
|
||||
}
|
||||
for(std::list<LLPointer<LLPostProcessShader> >::iterator it=mShaders.begin();it!=mShaders.end();++it)
|
||||
{
|
||||
(*it)->loadSettings(defaults);
|
||||
}
|
||||
setSelectedEffect("default");
|
||||
setSelectedEffect(str);
|
||||
}
|
||||
|
||||
LLPostProcess::~LLPostProcess(void)
|
||||
{
|
||||
gSavedSettings.setString("SinguPostProcessDefault", mSelectedEffectName);
|
||||
destroyGL() ;
|
||||
}
|
||||
|
||||
@@ -663,10 +666,11 @@ void LLPostProcess::setSelectedEffect(std::string const & effectName)
|
||||
{
|
||||
mSelectedEffectName = effectName;
|
||||
mSelectedEffectInfo = mAllEffectInfo[effectName];
|
||||
for(std::list<LLPointer<LLPostProcessShader> >::iterator it=mShaders.begin();it!=mShaders.end();++it)
|
||||
for(auto shader : mShaders)
|
||||
{
|
||||
(*it)->loadSettings(mSelectedEffectInfo);
|
||||
shader->loadSettings(mSelectedEffectInfo);
|
||||
}
|
||||
mSelectedEffectChanged(mSelectedEffectName);
|
||||
}
|
||||
|
||||
void LLPostProcess::setSelectedEffectValue(std::string const & setting, LLSD value)
|
||||
@@ -702,8 +706,9 @@ void LLPostProcess::resetSelectedEffect()
|
||||
void LLPostProcess::saveEffectAs(std::string const & effectName)
|
||||
{
|
||||
mAllEffectInfo[effectName] = mSelectedEffectInfo;
|
||||
mSelectedEffectChanged(mSelectedEffectName); // Might've changed, either way update the lists
|
||||
|
||||
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
|
||||
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "windlight", XML_FILENAME));
|
||||
//LL_INFOS() << "Saving PostProcess Effects settings to " << pathName << LL_ENDL;
|
||||
|
||||
llofstream effectsXML(pathName);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#define LL_POSTPROCESS_H
|
||||
|
||||
#include <map>
|
||||
#include <boost/signals2.hpp>
|
||||
#include "llsd.h"
|
||||
#include "llrendertarget.h"
|
||||
|
||||
@@ -103,6 +104,9 @@ private:
|
||||
// The map of all availible effects
|
||||
LLSD mAllEffectInfo;
|
||||
|
||||
typedef boost::signals2::signal<void(const std::string&)> selected_effect_changed_signal;
|
||||
selected_effect_changed_signal mSelectedEffectChanged;
|
||||
|
||||
public:
|
||||
LLPostProcess(void);
|
||||
~LLPostProcess(void);
|
||||
@@ -144,6 +148,7 @@ public:
|
||||
// Setters
|
||||
void setSelectedEffect(std::string const & effectName);
|
||||
void setSelectedEffectValue(std::string const & setting, LLSD value);
|
||||
auto setSelectedEffectChangeCallback(const selected_effect_changed_signal::slot_type& func) { return mSelectedEffectChanged.connect(func); }
|
||||
void resetSelectedEffect();
|
||||
void saveEffectAs(std::string const & effectName);
|
||||
};
|
||||
|
||||
@@ -985,7 +985,7 @@ void LLShaderMgr::cleanupShaderSources()
|
||||
for (GLsizei i = 0; i < count; ++i)
|
||||
{
|
||||
std::multimap<std::string, LLShaderMgr::CachedObjectInfo>::iterator it = mShaderObjects.begin();
|
||||
for (; it != LLShaderMgr::instance()->mShaderObjects.end(); it++)
|
||||
for (; it != mShaderObjects.end(); it++)
|
||||
{
|
||||
if ((*it).second.mHandle == shaders[i])
|
||||
{
|
||||
|
||||
@@ -44,6 +44,7 @@ set(llui_SOURCE_FILES
|
||||
llkeywords.cpp
|
||||
lllayoutstack.cpp
|
||||
lllineeditor.cpp
|
||||
llloadingindicator.cpp
|
||||
lllocalcliprect.cpp
|
||||
llmenugl.cpp
|
||||
llmodaldialog.cpp
|
||||
@@ -122,6 +123,7 @@ set(llui_HEADER_FILES
|
||||
llkeywords.h
|
||||
lllayoutstack.h
|
||||
lllineeditor.h
|
||||
llloadingindicator.h
|
||||
lllocalcliprect.h
|
||||
llmemberlistener.h
|
||||
llmenugl.h
|
||||
|
||||
@@ -61,66 +61,92 @@ S32 BTN_HEIGHT = 0;
|
||||
S32 BTN_GRID = 12;
|
||||
S32 BORDER_SIZE = 1;
|
||||
|
||||
|
||||
LLButton::Params::Params()
|
||||
: label_selected("label_selected"), // requires is_toggle true
|
||||
label_shadow("label_shadow", true),
|
||||
auto_resize("auto_resize", false),
|
||||
use_ellipses("use_ellipses", false),
|
||||
image_unselected("image_unselected", LLUI::getUIImage("button_enabled_32x128.tga")),
|
||||
image_selected("image_selected", LLUI::getUIImage("button_enabled_selected_32x128.tga")),
|
||||
image_hover_selected("image_hover_selected"),
|
||||
image_hover_unselected("image_hover_unselected"),
|
||||
image_disabled_selected("image_disabled_selected", LLUI::getUIImage("button_disabled_32x128.tga")),
|
||||
image_disabled("image_disabled", LLUI::getUIImage("button_disabled_32x128.tga")),
|
||||
image_pressed("image_pressed", LLUI::getUIImage("button_enabled_selected_32x128.tga")),
|
||||
image_pressed_selected("image_pressed_selected", LLUI::getUIImage("button_enabled_32x128.tga")),
|
||||
image_overlay("image_overlay"),
|
||||
image_overlay_selected("image_overlay_selected"),
|
||||
image_overlay_alignment("image_overlay_alignment", std::string("center")),
|
||||
image_overlay_enable("image_overlay_enable", true),
|
||||
label_color("label_color", LLUI::sColorsGroup->getColor("ButtonLabelColor")),
|
||||
label_color_selected("label_color_selected", LLUI::sColorsGroup->getColor("ButtonLabelSelectedColor")),
|
||||
label_color_disabled("label_color_disabled", LLUI::sColorsGroup->getColor("ButtonLabelDisabledColor")),
|
||||
label_color_disabled_selected("label_color_disabled_selected", LLUI::sColorsGroup->getColor("ButtonLabelSelectedDisabledColor")),
|
||||
image_color("image_color", LLUI::sColorsGroup->getColor("ButtonImageColor")), // requires is_toggle true
|
||||
image_color_disabled("image_color_disabled", LLUI::sColorsGroup->getColor("ButtonImageColor")),
|
||||
image_overlay_color("image_overlay_color", LLColor4::white),
|
||||
image_overlay_selected_color("image_overlay_selected_color", LLColor4::white),
|
||||
image_overlay_disabled_color("image_overlay_disabled_color", LLColor4(1.f, 1.f, 1.f, .5f)),
|
||||
flash_color("flash_color", LLUI::sColorsGroup->getColor("ButtonFlashBgColor")),
|
||||
pad_right("pad_right", LLUI::sConfigGroup->getS32("ButtonHPad")),
|
||||
pad_left("pad_left", LLUI::sConfigGroup->getS32("ButtonHPad")),
|
||||
pad_bottom("pad_bottom", LLUI::sConfigGroup->getS32("ButtonVPad")),
|
||||
image_top_pad("image_top_pad"),
|
||||
image_bottom_pad("image_bottom_pad"),
|
||||
imgoverlay_label_space("imgoverlay_label_space", 1),
|
||||
click_callback("click_callback"),
|
||||
mouse_down_callback("mouse_down_callback"),
|
||||
mouse_up_callback("mouse_up_callback"),
|
||||
mouse_held_callback("mouse_held_callback"),
|
||||
is_toggle("is_toggle", false),
|
||||
scale_image("scale_image", true),
|
||||
commit_on_return("commit_on_return", true),
|
||||
display_pressed_state("display_pressed_state", true),
|
||||
hover_glow_amount("hover_glow_amount", 0.25f),
|
||||
//held_down_delay("held_down_delay"),
|
||||
use_draw_context_alpha("use_draw_context_alpha", true),
|
||||
//badge("badge"),
|
||||
handle_right_mouse("handle_right_mouse", false),
|
||||
button_flash_enable("button_flash_enable", false),
|
||||
button_flash_count("button_flash_count", LLUI::sConfigGroup->getS32("ButtonFlashCount")),
|
||||
button_flash_rate("button_flash_rate", LLUI::sConfigGroup->getF32("ButtonFlashRate")),
|
||||
fade_when_disabled("fade_when_disabled", false),
|
||||
help_url("help_url")
|
||||
{
|
||||
addSynonym(is_toggle, "toggle");
|
||||
changeDefault(initial_value, LLSD(false));
|
||||
changeDefault(font_halign, LLFontGL::HCENTER);
|
||||
}
|
||||
|
||||
LLButton::LLButton( const std::string& name, const LLRect& rect, const std::string& control_name, commit_callback_t commit_callback)
|
||||
: LLUICtrl(name, rect, TRUE, commit_callback),
|
||||
|
||||
mMouseDownFrame( 0 ),
|
||||
mMouseDownFrame(0),
|
||||
mMouseHeldDownCount(0),
|
||||
mBorderEnabled( FALSE ),
|
||||
mFlashing( FALSE ),
|
||||
mBorderEnabled(FALSE),
|
||||
mFlashing(FALSE),
|
||||
mCurGlowStrength(0.f),
|
||||
mNeedsHighlight(FALSE),
|
||||
mUnselectedLabel(name),
|
||||
mSelectedLabel(name),
|
||||
mGLFont( LLFontGL::getFontSansSerif() ),
|
||||
mHeldDownDelay( 0.5f ), // seconds until held-down callback is called
|
||||
mHeldDownFrameDelay( 0 ),
|
||||
mImageUnselected(LLUI::getUIImage("button_enabled_32x128.tga")),
|
||||
mImageSelected(LLUI::getUIImage("button_enabled_selected_32x128.tga")),
|
||||
mImageDisabled(LLUI::getUIImage("button_disabled_32x128.tga")),
|
||||
mImageDisabledSelected(LLUI::getUIImage("button_disabled_32x128.tga")),
|
||||
mImagePressed(LLUI::getUIImage("button_enabled_selected_32x128.tga")),
|
||||
mImagePressedSelected(LLUI::getUIImage("button_enabled_32x128.tga")),
|
||||
mHeldDownDelay(0.5f), // seconds until held-down callback is called
|
||||
mHeldDownFrameDelay(0),
|
||||
mImageFlash(NULL),
|
||||
mImageHoverSelected( NULL ),
|
||||
mImageHoverUnselected( NULL ),
|
||||
mUnselectedLabelColor(LLUI::sColorsGroup->getColor("ButtonLabelColor" )),
|
||||
mSelectedLabelColor(LLUI::sColorsGroup->getColor("ButtonLabelSelectedColor")),
|
||||
mDisabledLabelColor(LLUI::sColorsGroup->getColor("ButtonLabelDisabledColor")),
|
||||
mDisabledSelectedLabelColor(LLUI::sColorsGroup->getColor("ButtonLabelSelectedDisabledColor")),
|
||||
mImageColor(LLUI::sColorsGroup->getColor("ButtonImageColor")),
|
||||
mFlashBgColor(LLUI::sColorsGroup->getColor("ButtonFlashBgColor")),
|
||||
mDisabledImageColor(LLUI::sColorsGroup->getColor("ButtonImageColor")),
|
||||
mImageOverlay(NULL),
|
||||
mImageOverlayColor(LLColor4::white),
|
||||
mImageOverlayDisabledColor(LLColor4(1.f,1.f,1.f,.5f)),
|
||||
mImageOverlaySelectedColor(LLColor4::white),
|
||||
mImageOverlayAlignment(LLFontGL::HCENTER),
|
||||
mImageOverlayTopPad(0),
|
||||
mImageOverlayBottomPad(0),
|
||||
mImgOverlayLabelSpace(1),
|
||||
mIsToggle( FALSE ),
|
||||
mScaleImage( TRUE ),
|
||||
mDropShadowedText( TRUE ),
|
||||
mAutoResize( FALSE ),
|
||||
mHAlign( LLFontGL::HCENTER ),
|
||||
mLeftHPad( LLBUTTON_H_PAD ),
|
||||
mRightHPad( LLBUTTON_H_PAD ),
|
||||
mBottomVPad( LLBUTTON_V_PAD ),
|
||||
mHoverGlowStrength(0.25f),
|
||||
mCommitOnReturn(TRUE),
|
||||
mFadeWhenDisabled(FALSE),
|
||||
mDropShadowedText(TRUE),
|
||||
mForcePressedState(false),
|
||||
mDisplayPressedState(TRUE),
|
||||
mMouseDownSignal(NULL),
|
||||
mMouseUpSignal(NULL),
|
||||
mHeldDownSignal(NULL),
|
||||
mHandleRightMouse(false),
|
||||
mButtonFlashCount(LLUI::sConfigGroup->getS32("ButtonFlashCount")),
|
||||
mButtonFlashRate(LLUI::sConfigGroup->getF32("ButtonFlashRate")),
|
||||
mAlpha(1.f)
|
||||
mAlpha(1.f),
|
||||
mMouseDownSignal(nullptr),
|
||||
mMouseUpSignal(nullptr),
|
||||
mHeldDownSignal(nullptr)
|
||||
{
|
||||
init(control_name);
|
||||
Params params;
|
||||
params.label_selected(name)
|
||||
.label(name)
|
||||
.control_name(control_name)
|
||||
.name(name)
|
||||
.rect(rect);
|
||||
initFromParams(params);
|
||||
}
|
||||
|
||||
|
||||
@@ -133,92 +159,133 @@ LLButton::LLButton(const std::string& name, const LLRect& rect,
|
||||
const std::string& unselected_label,
|
||||
const std::string& selected_label )
|
||||
: LLUICtrl(name, rect, TRUE, commit_callback),
|
||||
mMouseDownFrame( 0 ),
|
||||
mMouseDownFrame(0),
|
||||
mMouseHeldDownCount(0),
|
||||
mBorderEnabled( FALSE ),
|
||||
mFlashing( FALSE ),
|
||||
mBorderEnabled(FALSE),
|
||||
mFlashing(FALSE),
|
||||
mCurGlowStrength(0.f),
|
||||
mNeedsHighlight(FALSE),
|
||||
mUnselectedLabel(unselected_label),
|
||||
mSelectedLabel(selected_label),
|
||||
mGLFont( font ? font : LLFontGL::getFontSansSerif() ),
|
||||
mHeldDownDelay( 0.5f ), // seconds until held-down callback is called
|
||||
mHeldDownFrameDelay( 0 ),
|
||||
mImageUnselected(LLUI::getUIImage("button_enabled_32x128.tga")),
|
||||
mImageSelected(LLUI::getUIImage("button_enabled_selected_32x128.tga")),
|
||||
mImageDisabled(LLUI::getUIImage("button_disabled_32x128.tga")),
|
||||
mImageDisabledSelected(LLUI::getUIImage("button_disabled_32x128.tga")),
|
||||
mImagePressed(LLUI::getUIImage("button_enabled_selected_32x128.tga")),
|
||||
mImagePressedSelected(LLUI::getUIImage("button_enabled_32x128.tga")),
|
||||
mHeldDownDelay(0.5f), // seconds until held-down callback is called
|
||||
mHeldDownFrameDelay(0),
|
||||
mImageFlash(NULL),
|
||||
mImageHoverSelected( NULL ),
|
||||
mImageHoverUnselected( NULL ),
|
||||
mUnselectedLabelColor(LLUI::sColorsGroup->getColor("ButtonLabelColor" )),
|
||||
mSelectedLabelColor(LLUI::sColorsGroup->getColor("ButtonLabelSelectedColor")),
|
||||
mDisabledLabelColor(LLUI::sColorsGroup->getColor("ButtonLabelDisabledColor")),
|
||||
mDisabledSelectedLabelColor(LLUI::sColorsGroup->getColor("ButtonLabelSelectedDisabledColor")),
|
||||
mImageColor(LLUI::sColorsGroup->getColor("ButtonImageColor")),
|
||||
mFlashBgColor(LLUI::sColorsGroup->getColor("ButtonFlashBgColor")),
|
||||
mDisabledImageColor(LLUI::sColorsGroup->getColor("ButtonImageColor")),
|
||||
mImageOverlay(NULL),
|
||||
mImageOverlayColor(LLColor4::white),
|
||||
mImageOverlayDisabledColor(LLColor4(1.f,1.f,1.f,.5f)),
|
||||
mImageOverlaySelectedColor(LLColor4::white),
|
||||
mImageOverlayAlignment(LLFontGL::HCENTER),
|
||||
mImageOverlayTopPad(0),
|
||||
mImageOverlayBottomPad(0),
|
||||
mImgOverlayLabelSpace(1),
|
||||
mIsToggle( FALSE ),
|
||||
mScaleImage( TRUE ),
|
||||
mDropShadowedText( TRUE ),
|
||||
mAutoResize( FALSE ),
|
||||
mHAlign( LLFontGL::HCENTER ),
|
||||
mLeftHPad( LLBUTTON_H_PAD ),
|
||||
mRightHPad( LLBUTTON_H_PAD ),
|
||||
mBottomVPad( LLBUTTON_V_PAD ),
|
||||
mHoverGlowStrength(0.25f),
|
||||
mCommitOnReturn(TRUE),
|
||||
mFadeWhenDisabled(FALSE),
|
||||
mDropShadowedText(TRUE),
|
||||
mForcePressedState(false),
|
||||
mDisplayPressedState(TRUE),
|
||||
mMouseDownSignal(NULL),
|
||||
mMouseUpSignal(NULL),
|
||||
mHeldDownSignal(NULL),
|
||||
mHandleRightMouse(false),
|
||||
mButtonFlashCount(LLUI::sConfigGroup->getS32("ButtonFlashCount")),
|
||||
mButtonFlashRate(LLUI::sConfigGroup->getF32("ButtonFlashRate")),
|
||||
mAlpha(1.f)
|
||||
mAlpha(1.f),
|
||||
mMouseDownSignal(nullptr),
|
||||
mMouseUpSignal(nullptr),
|
||||
mHeldDownSignal(nullptr)
|
||||
{
|
||||
Params params;
|
||||
params.label_selected(selected_label)
|
||||
.label(unselected_label)
|
||||
.font(font)
|
||||
.control_name(control_name)
|
||||
.name(name)
|
||||
.rect(rect);
|
||||
|
||||
if( unselected_image_name != "" )
|
||||
if (!unselected_image_name.empty())
|
||||
{
|
||||
// user-specified image - don't use fixed borders unless requested
|
||||
mImageUnselected = LLUI::getUIImage(unselected_image_name);
|
||||
mImageDisabled = mImageUnselected;
|
||||
auto image = LLUI::getUIImage(unselected_image_name);
|
||||
params.image_unselected(image)
|
||||
.image_disabled(image)
|
||||
.image_pressed_selected(image)
|
||||
|
||||
mFadeWhenDisabled = TRUE;
|
||||
//mScaleImage = FALSE;
|
||||
|
||||
mImagePressedSelected = mImageUnselected;
|
||||
.fade_when_disabled(true);
|
||||
//params.scale_image(false);
|
||||
}
|
||||
|
||||
if( selected_image_name != "" )
|
||||
if (!selected_image_name.empty())
|
||||
{
|
||||
// user-specified image - don't use fixed borders unless requested
|
||||
mImageSelected = LLUI::getUIImage(selected_image_name);
|
||||
mImageDisabledSelected = mImageSelected;
|
||||
auto image = LLUI::getUIImage(selected_image_name);
|
||||
params.image_selected(image)
|
||||
.image_disabled_selected(image)
|
||||
.image_pressed(image)
|
||||
|
||||
mFadeWhenDisabled = TRUE;
|
||||
//mScaleImage = FALSE;
|
||||
|
||||
mImagePressed = mImageSelected;
|
||||
.fade_when_disabled(true);
|
||||
//params.scale_image(false);
|
||||
}
|
||||
|
||||
init(control_name);
|
||||
initFromParams(params);
|
||||
}
|
||||
|
||||
void LLButton::init(const std::string& control_name)
|
||||
LLButton::LLButton(const Params& params)
|
||||
: LLUICtrl(params),
|
||||
mMouseDownFrame(0),
|
||||
mMouseHeldDownCount(0),
|
||||
mBorderEnabled(FALSE),
|
||||
mFlashing(FALSE),
|
||||
mCurGlowStrength(0.f),
|
||||
mNeedsHighlight(FALSE),
|
||||
mHeldDownDelay(0.5f), // seconds until held-down callback is called
|
||||
mHeldDownFrameDelay(0),
|
||||
mImageFlash(NULL),
|
||||
mImageOverlayTopPad(0),
|
||||
mImageOverlayBottomPad(0),
|
||||
mImgOverlayLabelSpace(1),
|
||||
mDropShadowedText(TRUE),
|
||||
mForcePressedState(false),
|
||||
mAlpha(1.f),
|
||||
mMouseDownSignal(nullptr),
|
||||
mMouseUpSignal(nullptr),
|
||||
mHeldDownSignal(nullptr)
|
||||
{
|
||||
initFromParams(params);
|
||||
}
|
||||
|
||||
void LLButton::initFromParams(const Params& params)
|
||||
{
|
||||
LLUICtrl::initFromParams(params);
|
||||
mUnselectedLabel = params.label;
|
||||
mSelectedLabel = params.label_selected;
|
||||
auto font = params.font();
|
||||
mGLFont = font ? font : LLFontGL::getFontSansSerif();
|
||||
mHAlign = params.font_halign;
|
||||
mImageUnselected = params.image_unselected;
|
||||
mImageSelected = params.image_selected;
|
||||
mImageDisabled = params.image_disabled;
|
||||
mImageDisabledSelected = params.image_disabled_selected;
|
||||
mImagePressed = params.image_pressed;
|
||||
mImagePressedSelected = params.image_pressed_selected;
|
||||
mImageHoverSelected = params.image_hover_selected;
|
||||
mImageHoverUnselected = params.image_hover_unselected;
|
||||
mUnselectedLabelColor = params.label_color;
|
||||
mSelectedLabelColor = params.label_color_selected;
|
||||
mDisabledLabelColor = params.label_color_disabled;
|
||||
mDisabledSelectedLabelColor = params.label_color_disabled_selected;
|
||||
mImageColor = params.image_color;
|
||||
mFlashBgColor = params.flash_color;
|
||||
mDisabledImageColor = params.image_color_disabled;
|
||||
mImageOverlay = params.image_overlay;
|
||||
mImageOverlaySelected = params.image_overlay_selected;
|
||||
mImageOverlayColor = params.image_overlay_color;
|
||||
mImageOverlayDisabledColor = params.image_overlay_disabled_color;
|
||||
mImageOverlaySelectedColor = params.image_overlay_selected_color;
|
||||
mImageOverlayAlignment = LLFontGL::hAlignFromName(params.image_overlay_alignment);
|
||||
mIsToggle = params.is_toggle;
|
||||
mScaleImage = params.scale_image;
|
||||
mAutoResize = params.auto_resize;
|
||||
mLeftHPad = params.pad_left;
|
||||
mRightHPad = params.pad_right;
|
||||
mBottomVPad = params.pad_bottom;
|
||||
mHoverGlowStrength = params.hover_glow_amount;
|
||||
mCommitOnReturn = params.commit_on_return;
|
||||
mFadeWhenDisabled = params.fade_when_disabled;
|
||||
mDisplayPressedState = params.display_pressed_state;
|
||||
if (params.mouse_down_callback.isProvided())
|
||||
setMouseDownCallback(params.mouse_down_callback);
|
||||
if (params.mouse_up_callback.isProvided())
|
||||
setMouseUpCallback(params.mouse_up_callback);
|
||||
if (params.mouse_held_callback.isProvided())
|
||||
setHeldDownCallback(params.mouse_held_callback);
|
||||
mHandleRightMouse = params.handle_right_mouse;
|
||||
mButtonFlashCount = params.button_flash_count;
|
||||
mButtonFlashRate = params.button_flash_rate;
|
||||
|
||||
// Hack to make sure there is space for at least one character
|
||||
if (getRect().getWidth() - (mRightHPad + mLeftHPad) < mGLFont->getWidth(std::string(" ")))
|
||||
{
|
||||
@@ -229,9 +296,16 @@ void LLButton::init(const std::string& control_name)
|
||||
|
||||
mMouseDownTimer.stop();
|
||||
|
||||
setControlName(control_name, NULL);
|
||||
setControlName(params.control_name, NULL);
|
||||
}
|
||||
|
||||
//static
|
||||
const LLButton::Params& LLButton::getDefaultParams()
|
||||
{
|
||||
// Singu Note: We diverge here, not using LLUICtrlFactory::getDefaultParams
|
||||
static const Params p;
|
||||
return p;
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLButton::~LLButton()
|
||||
@@ -783,12 +857,13 @@ void LLButton::draw()
|
||||
}
|
||||
overlay_color.mV[VALPHA] *= alpha;
|
||||
|
||||
auto& overlay = (mIsToggle && mImageOverlaySelected && getToggleState()) ? mImageOverlaySelected : mImageOverlay;
|
||||
switch(mImageOverlayAlignment)
|
||||
{
|
||||
case LLFontGL::LEFT:
|
||||
text_left += overlay_width + mImgOverlayLabelSpace;
|
||||
text_width -= overlay_width + mImgOverlayLabelSpace;
|
||||
mImageOverlay->draw(
|
||||
overlay->draw(
|
||||
mLeftHPad,
|
||||
center_y - (overlay_height / 2),
|
||||
overlay_width,
|
||||
@@ -796,7 +871,7 @@ void LLButton::draw()
|
||||
overlay_color);
|
||||
break;
|
||||
case LLFontGL::HCENTER:
|
||||
mImageOverlay->draw(
|
||||
overlay->draw(
|
||||
center_x - (overlay_width / 2),
|
||||
center_y - (overlay_height / 2),
|
||||
overlay_width,
|
||||
@@ -806,7 +881,7 @@ void LLButton::draw()
|
||||
case LLFontGL::RIGHT:
|
||||
text_right -= overlay_width + mImgOverlayLabelSpace;
|
||||
text_width -= overlay_width + mImgOverlayLabelSpace;
|
||||
mImageOverlay->draw(
|
||||
overlay->draw(
|
||||
getRect().getWidth() - mRightHPad - overlay_width,
|
||||
center_y - (overlay_height / 2),
|
||||
overlay_width,
|
||||
@@ -1199,6 +1274,9 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa
|
||||
std::string image_overlay;
|
||||
node->getAttributeString("image_overlay", image_overlay);
|
||||
|
||||
std::string image_overlay_selected;
|
||||
node->getAttributeString("image_overlay_selected", image_overlay_selected);
|
||||
|
||||
LLFontGL::HAlign image_overlay_alignment = LLFontGL::HCENTER;
|
||||
std::string image_overlay_alignment_string;
|
||||
if (node->hasAttribute("image_overlay_alignment"))
|
||||
@@ -1234,6 +1312,7 @@ LLView* LLButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *fa
|
||||
if(image_disabled != LLStringUtil::null) button->setImageDisabled(LLUI::getUIImage(image_disabled));
|
||||
|
||||
if(image_overlay != LLStringUtil::null) button->setImageOverlay(image_overlay, image_overlay_alignment);
|
||||
if (!image_overlay_selected.empty()) button->mImageOverlaySelected = LLUI::getUIImage(image_overlay_selected);
|
||||
|
||||
if (node->hasAttribute("halign"))
|
||||
{
|
||||
|
||||
@@ -74,6 +74,87 @@ class LLButton
|
||||
: public LLUICtrl
|
||||
{
|
||||
public:
|
||||
struct Params
|
||||
: public LLInitParam::Block<Params, LLUICtrl::Params>
|
||||
{
|
||||
// text label
|
||||
Optional<std::string> label_selected;
|
||||
Optional<bool> label_shadow;
|
||||
Optional<bool> auto_resize;
|
||||
Optional<bool> use_ellipses;
|
||||
|
||||
// images
|
||||
Optional<LLUIImage*> image_unselected,
|
||||
image_selected,
|
||||
image_hover_selected,
|
||||
image_hover_unselected,
|
||||
image_disabled_selected,
|
||||
image_disabled,
|
||||
image_flash,
|
||||
image_pressed,
|
||||
image_pressed_selected,
|
||||
image_overlay,
|
||||
image_overlay_selected;
|
||||
|
||||
Optional<std::string> image_overlay_alignment;
|
||||
Optional<bool> image_overlay_enable;
|
||||
|
||||
// colors
|
||||
Optional<LLUIColor> label_color,
|
||||
label_color_selected,
|
||||
label_color_disabled,
|
||||
label_color_disabled_selected,
|
||||
image_color,
|
||||
image_color_disabled,
|
||||
image_overlay_color,
|
||||
image_overlay_selected_color,
|
||||
image_overlay_disabled_color,
|
||||
flash_color;
|
||||
|
||||
// layout
|
||||
Optional<S32> pad_right;
|
||||
Optional<S32> pad_left;
|
||||
Optional<S32> pad_bottom; // under text label
|
||||
|
||||
//image overlay paddings
|
||||
Optional<S32> image_top_pad;
|
||||
Optional<S32> image_bottom_pad;
|
||||
|
||||
/**
|
||||
* Space between image_overlay and label
|
||||
*/
|
||||
Optional<S32> imgoverlay_label_space;
|
||||
|
||||
// callbacks
|
||||
Optional<CommitCallbackParam> click_callback, // alias -> commit_callback
|
||||
mouse_down_callback,
|
||||
mouse_up_callback,
|
||||
mouse_held_callback;
|
||||
|
||||
// misc
|
||||
Optional<bool> is_toggle,
|
||||
scale_image,
|
||||
commit_on_return,
|
||||
display_pressed_state;
|
||||
|
||||
Optional<F32> hover_glow_amount;
|
||||
//Optional<TimeIntervalParam> held_down_delay;
|
||||
|
||||
Optional<bool> use_draw_context_alpha;
|
||||
|
||||
//Optional<LLBadge::Params> badge;
|
||||
|
||||
Optional<bool> handle_right_mouse;
|
||||
|
||||
Optional<bool> button_flash_enable;
|
||||
Optional<S32> button_flash_count;
|
||||
Optional<F32> button_flash_rate;
|
||||
Optional<bool> fade_when_disabled;
|
||||
Optional<std::string> help_url;
|
||||
|
||||
Params();
|
||||
};
|
||||
|
||||
// simple button with text label
|
||||
LLButton(const std::string& name, const LLRect &rect = LLRect(), const std::string& control_name = std::string(),
|
||||
commit_callback_t commit_callback = NULL);
|
||||
@@ -86,6 +167,11 @@ public:
|
||||
const LLFontGL* mGLFont = NULL,
|
||||
const std::string& unselected_label = LLStringUtil::null,
|
||||
const std::string& selected_label = LLStringUtil::null );
|
||||
|
||||
void initFromParams(const Params& p);
|
||||
static const LLButton::Params& getDefaultParams();
|
||||
LLButton(const Params& p = getDefaultParams());
|
||||
|
||||
public:
|
||||
|
||||
~LLButton();
|
||||
@@ -93,7 +179,6 @@ public:
|
||||
typedef boost::function<void(void*)> button_callback_t;
|
||||
|
||||
void addImageAttributeToXML(LLXMLNodePtr node, const LLPointer<LLUIImage>, const std::string& xmlTagName) const;
|
||||
void init(const std::string& control_name);
|
||||
virtual LLXMLNodePtr getXML(bool save_children = true) const;
|
||||
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
|
||||
|
||||
@@ -161,7 +246,6 @@ public:
|
||||
const std::string getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); }
|
||||
const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); }
|
||||
|
||||
void setImageColor(const std::string& color_control);
|
||||
void setImageColor(const LLColor4& c);
|
||||
/*virtual*/ void setColor(const LLColor4& c);
|
||||
|
||||
@@ -205,9 +289,7 @@ public:
|
||||
void setImageDisabled(LLPointer<LLUIImage> image);
|
||||
void setImageDisabledSelected(LLPointer<LLUIImage> image);
|
||||
void setImageFlash(LLPointer<LLUIImage> image);
|
||||
void setImagePressed(LLPointer<LLUIImage> image);
|
||||
|
||||
static void onHeldDown(void *userdata); // to be called by gIdleCallbacks
|
||||
|
||||
void setHelpURLCallback(const std::string &help_url);
|
||||
const std::string& getHelpURL() const { return mHelpURL; }
|
||||
|
||||
@@ -243,6 +325,7 @@ protected:
|
||||
S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called
|
||||
|
||||
LLPointer<LLUIImage> mImageOverlay;
|
||||
LLPointer<LLUIImage> mImageOverlaySelected;
|
||||
LLFontGL::HAlign mImageOverlayAlignment;
|
||||
LLUIColor mImageOverlayColor;
|
||||
LLUIColor mImageOverlaySelectedColor;
|
||||
|
||||
@@ -436,6 +436,7 @@ void LLComboBox::setLabel(const LLStringExplicit& name)
|
||||
{
|
||||
if (!mSuppressTentative) mTextEntry->setTentative(mTextEntryTentative);
|
||||
}
|
||||
mTextEntry->setCursor(0); // Be scrolled to the beginning!
|
||||
}
|
||||
|
||||
if (!mAllowTextEntry)
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llmultifloater.h"
|
||||
|
||||
#include "llfocusmgr.h"
|
||||
|
||||
#include "lluictrlfactory.h"
|
||||
@@ -56,10 +54,13 @@
|
||||
#include "llcontrol.h"
|
||||
#include "lltabcontainer.h"
|
||||
#include "v2math.h"
|
||||
#include "lltrans.h"
|
||||
#include "llmultifloater.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "airecursive.h"
|
||||
#include "llnotifications.h"
|
||||
|
||||
|
||||
const S32 MINIMIZED_WIDTH = 160;
|
||||
const S32 CLOSE_BOX_FROM_TOP = 1;
|
||||
// use this to control "jumping" behavior when Ctrl-Tabbing
|
||||
@@ -104,14 +105,14 @@ std::string LLFloater::sButtonNames[BUTTON_COUNT] =
|
||||
std::string LLFloater::sButtonToolTips[BUTTON_COUNT] =
|
||||
{
|
||||
#ifdef LL_DARWIN
|
||||
"Close (Cmd-W)", //BUTTON_CLOSE
|
||||
"BUTTON_CLOSE_DARWIN", //"Close (Cmd-W)", //BUTTON_CLOSE
|
||||
#else
|
||||
"Close (Ctrl-W)", //BUTTON_CLOSE
|
||||
"BUTTON_CLOSE_WIN", //"Close (Ctrl-W)", //BUTTON_CLOSE
|
||||
#endif
|
||||
"Restore", //BUTTON_RESTORE
|
||||
"Minimize", //BUTTON_MINIMIZE
|
||||
"Tear Off", //BUTTON_TEAR_OFF
|
||||
"Edit", //BUTTON_EDIT
|
||||
"BUTTON_RESTORE", //"Restore", //BUTTON_RESTORE
|
||||
"BUTTON_MINIMIZE", //"Minimize", //BUTTON_MINIMIZE
|
||||
"BUTTON_TEAR_OFF", //"Tear Off", //BUTTON_TEAR_OFF
|
||||
"BUTTON_EDIT", //"Edit", //BUTTON_EDIT
|
||||
};
|
||||
|
||||
|
||||
@@ -130,6 +131,31 @@ LLFloater::handle_map_t LLFloater::sFloaterMap;
|
||||
|
||||
LLFloaterView* gFloaterView = NULL;
|
||||
|
||||
//static
|
||||
void LLFloater::initClass()
|
||||
{
|
||||
// translate tooltips for floater buttons
|
||||
for (S32 i = 0; i < BUTTON_COUNT; i++)
|
||||
{
|
||||
sButtonToolTips[i] = LLTrans::getString( sButtonToolTips[i] );
|
||||
}
|
||||
|
||||
LLControlVariable* ctrl = LLUI::sConfigGroup->getControl("ActiveFloaterTransparency");
|
||||
if (ctrl)
|
||||
{
|
||||
ctrl->getSignal()->connect(boost::bind(&LLFloater::updateActiveFloaterTransparency));
|
||||
updateActiveFloaterTransparency();
|
||||
}
|
||||
|
||||
ctrl = LLUI::sConfigGroup->getControl("InactiveFloaterTransparency");
|
||||
if (ctrl)
|
||||
{
|
||||
ctrl->getSignal()->connect(boost::bind(&LLFloater::updateInactiveFloaterTransparency));
|
||||
updateInactiveFloaterTransparency();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
LLFloater::LLFloater() :
|
||||
//FIXME: we should initialize *all* member variables here
|
||||
LLPanel(), mAutoFocus(TRUE),
|
||||
@@ -355,6 +381,18 @@ void LLFloater::initFloater(const std::string& title,
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloater::updateActiveFloaterTransparency()
|
||||
{
|
||||
sActiveControlTransparency = LLUI::sConfigGroup->getF32("ActiveFloaterTransparency");
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloater::updateInactiveFloaterTransparency()
|
||||
{
|
||||
sInactiveControlTransparency = LLUI::sConfigGroup->getF32("InactiveFloaterTransparency");
|
||||
}
|
||||
|
||||
void LLFloater::addResizeCtrls()
|
||||
{
|
||||
// Resize bars (sides)
|
||||
@@ -720,11 +758,6 @@ void LLFloater::applyRectControl()
|
||||
|
||||
void LLFloater::applyTitle()
|
||||
{
|
||||
if (gNoRender)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mDragHandle)
|
||||
{
|
||||
return;
|
||||
@@ -753,7 +786,7 @@ void LLFloater::setTitle( const std::string& title )
|
||||
applyTitle();
|
||||
}
|
||||
|
||||
std::string LLFloater::getTitle()
|
||||
std::string LLFloater::getTitle() const
|
||||
{
|
||||
if (mTitle.empty())
|
||||
{
|
||||
@@ -771,7 +804,7 @@ void LLFloater::setShortTitle( const std::string& short_title )
|
||||
applyTitle();
|
||||
}
|
||||
|
||||
std::string LLFloater::getShortTitle()
|
||||
std::string LLFloater::getShortTitle() const
|
||||
{
|
||||
if (mShortTitle.empty())
|
||||
{
|
||||
@@ -783,8 +816,6 @@ std::string LLFloater::getShortTitle()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOL LLFloater::canSnapTo(const LLView* other_view)
|
||||
{
|
||||
if (NULL == other_view)
|
||||
@@ -1023,7 +1054,8 @@ void LLFloater::setFocus( BOOL b )
|
||||
if (b)
|
||||
{
|
||||
// only push focused floaters to front of stack if not in midst of ctrl-tab cycle
|
||||
if (!getHost() && !((LLFloaterView*)getParent())->getCycleMode())
|
||||
LLFloaterView * parent = dynamic_cast<LLFloaterView *>(getParent());
|
||||
if (!getHost() && parent && !parent->getCycleMode())
|
||||
{
|
||||
if (!isFrontmost())
|
||||
{
|
||||
@@ -1040,6 +1072,7 @@ void LLFloater::setFocus( BOOL b )
|
||||
last_focus->setFocus(TRUE);
|
||||
}
|
||||
}
|
||||
updateTransparency(b ? TT_ACTIVE : TT_INACTIVE);
|
||||
}
|
||||
|
||||
// virtual
|
||||
@@ -1081,8 +1114,9 @@ void LLFloater::setForeground(BOOL front)
|
||||
releaseFocus();
|
||||
}
|
||||
|
||||
if (front || !LLUI::sConfigGroup->getBOOL("FloaterUnfocusedBackgroundOpaque")) // Singu Note: This can be removed when InactiveFloaterTransparency is added
|
||||
setBackgroundOpaque( front );
|
||||
setBackgroundOpaque( front );
|
||||
// Singu Note: Upstream isn't doing this, I can't see where they were actually going inactive. Maybe setFocus(false) isn't being called, but we have parity there..
|
||||
updateTransparency(front || getIsChrome() ? TT_ACTIVE : TT_INACTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1191,7 +1225,7 @@ void LLFloater::removeDependentFloater(LLFloater* floaterp)
|
||||
floaterp->mDependeeHandle = LLHandle<LLFloater>();
|
||||
}
|
||||
|
||||
BOOL LLFloater::offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButtons index)
|
||||
BOOL LLFloater::offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButton index)
|
||||
{
|
||||
if( mButtonsEnabled[index] )
|
||||
{
|
||||
@@ -1297,7 +1331,14 @@ void LLFloater::setFrontmost(BOOL take_focus)
|
||||
{
|
||||
// there are more than one floater view
|
||||
// so we need to query our parent directly
|
||||
((LLFloaterView*)getParent())->bringToFront(this, take_focus);
|
||||
LLFloaterView * parent = dynamic_cast<LLFloaterView*>( getParent() );
|
||||
if (parent)
|
||||
{
|
||||
parent->bringToFront(this, take_focus);
|
||||
}
|
||||
|
||||
// Make sure to set the appropriate transparency type (STORM-732).
|
||||
updateTransparency(hasFocus() || getIsChrome() ? TT_ACTIVE : TT_INACTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1432,42 +1473,45 @@ void LLFloater::onClickClose()
|
||||
// virtual
|
||||
void LLFloater::draw()
|
||||
{
|
||||
const F32 alpha = getCurrentTransparency();
|
||||
|
||||
// draw background
|
||||
if( isBackgroundVisible() )
|
||||
{
|
||||
drawShadow(this);
|
||||
|
||||
S32 left = LLPANEL_BORDER_WIDTH;
|
||||
S32 top = getRect().getHeight() - LLPANEL_BORDER_WIDTH;
|
||||
S32 right = getRect().getWidth() - LLPANEL_BORDER_WIDTH;
|
||||
S32 bottom = LLPANEL_BORDER_WIDTH;
|
||||
|
||||
static LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow");
|
||||
static F32 shadow_offset = (F32)LLUI::sConfigGroup->getS32("DropShadowFloater");
|
||||
if (!isBackgroundOpaque())
|
||||
{
|
||||
shadow_offset *= 0.2f;
|
||||
shadow_color.mV[VALPHA] *= 0.5f;
|
||||
}
|
||||
gl_drop_shadow(left, top, right, bottom,
|
||||
shadow_color,
|
||||
ll_round(shadow_offset));
|
||||
|
||||
// No transparent windows in simple UI
|
||||
LLColor4 color;
|
||||
if (isBackgroundOpaque())
|
||||
{
|
||||
gl_rect_2d( left, top, right, bottom, getBackgroundColor() );
|
||||
color = getBackgroundColor();
|
||||
}
|
||||
else
|
||||
{
|
||||
gl_rect_2d( left, top, right, bottom, getTransparentColor() );
|
||||
color = getTransparentColor();
|
||||
}
|
||||
|
||||
if(gFocusMgr.childHasKeyboardFocus(this) && !getIsChrome() && !getCurrentTitle().empty())
|
||||
{
|
||||
// We're not using images, use old-school flat colors
|
||||
gl_rect_2d( left, top, right, bottom, color % alpha );
|
||||
|
||||
// draw highlight on title bar to indicate focus. RDW
|
||||
const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF );
|
||||
LLRect r = getRect();
|
||||
gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1,
|
||||
LLUI::sColorsGroup->getColor("TitleBarFocusColor"), 0, TRUE);
|
||||
if(gFocusMgr.childHasKeyboardFocus(this)
|
||||
&& !getIsChrome()
|
||||
&& !getCurrentTitle().empty())
|
||||
{
|
||||
static auto titlebar_focus_color = LLUI::sColorsGroup->getColor("TitleBarFocusColor");
|
||||
|
||||
const LLFontGL* font = LLFontGL::getFontSansSerif();
|
||||
LLRect r = getRect();
|
||||
gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1,
|
||||
titlebar_focus_color % alpha, 0, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1524,6 +1568,49 @@ void LLFloater::draw()
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloater::drawShadow(LLPanel* panel)
|
||||
{
|
||||
S32 left = LLPANEL_BORDER_WIDTH;
|
||||
S32 top = panel->getRect().getHeight() - LLPANEL_BORDER_WIDTH;
|
||||
S32 right = panel->getRect().getWidth() - LLPANEL_BORDER_WIDTH;
|
||||
S32 bottom = LLPANEL_BORDER_WIDTH;
|
||||
|
||||
static LLUICachedControl<S32> shadow_offset_S32 ("DropShadowFloater", 0);
|
||||
static LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow");
|
||||
F32 shadow_offset = (F32)shadow_offset_S32;
|
||||
|
||||
if (!panel->isBackgroundOpaque())
|
||||
{
|
||||
shadow_offset *= 0.2f;
|
||||
shadow_color.mV[VALPHA] *= 0.5f;
|
||||
}
|
||||
gl_drop_shadow(left, top, right, bottom,
|
||||
shadow_color % getCurrentTransparency(),
|
||||
ll_round(shadow_offset));
|
||||
}
|
||||
|
||||
void LLFloater::updateTransparency(LLView* view, ETypeTransparency transparency_type)
|
||||
{
|
||||
if (view)
|
||||
{
|
||||
if (view->isCtrl())
|
||||
{
|
||||
static_cast<LLUICtrl*>(view)->setTransparencyType(transparency_type);
|
||||
}
|
||||
|
||||
for (LLView* pChild : *view->getChildList())
|
||||
{
|
||||
if ((pChild->getChildCount()) || (pChild->isCtrl()))
|
||||
updateTransparency(pChild, transparency_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloater::updateTransparency(ETypeTransparency transparency_type)
|
||||
{
|
||||
updateTransparency(this, transparency_type);
|
||||
}
|
||||
|
||||
void LLFloater::setCanMinimize(BOOL can_minimize)
|
||||
{
|
||||
// if removing minimize/restore button programmatically,
|
||||
@@ -2319,7 +2406,7 @@ LLRect LLFloaterView::getSnapRect() const
|
||||
return snap_rect;
|
||||
}
|
||||
|
||||
LLFloater *LLFloaterView::getFocusedFloater()
|
||||
LLFloater *LLFloaterView::getFocusedFloater() const
|
||||
{
|
||||
for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
|
||||
{
|
||||
@@ -2332,7 +2419,7 @@ LLFloater *LLFloaterView::getFocusedFloater()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LLFloater *LLFloaterView::getFrontmost()
|
||||
LLFloater *LLFloaterView::getFrontmost() const
|
||||
{
|
||||
for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
|
||||
{
|
||||
@@ -2345,7 +2432,7 @@ LLFloater *LLFloaterView::getFrontmost()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LLFloater *LLFloaterView::getBackmost()
|
||||
LLFloater *LLFloaterView::getBackmost() const
|
||||
{
|
||||
LLFloater* back_most = NULL;
|
||||
for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
|
||||
@@ -2380,7 +2467,7 @@ void LLFloaterView::syncFloaterTabOrder()
|
||||
}
|
||||
}
|
||||
|
||||
LLFloater* LLFloaterView::getParentFloater(LLView* viewp)
|
||||
LLFloater* LLFloaterView::getParentFloater(LLView* viewp) const
|
||||
{
|
||||
LLView* parentp = viewp->getParent();
|
||||
|
||||
|
||||
@@ -94,16 +94,19 @@ class LLFloater : public LLPanel
|
||||
friend class LLFloaterView;
|
||||
friend class LLMultiFloater;
|
||||
public:
|
||||
enum EFloaterButtons
|
||||
enum EFloaterButton
|
||||
{
|
||||
BUTTON_CLOSE,
|
||||
BUTTON_CLOSE = 0,
|
||||
BUTTON_RESTORE,
|
||||
BUTTON_MINIMIZE,
|
||||
BUTTON_TEAR_OFF,
|
||||
BUTTON_EDIT,
|
||||
BUTTON_COUNT
|
||||
};
|
||||
|
||||
|
||||
// Load translations for tooltips for standard buttons
|
||||
static void initClass();
|
||||
|
||||
LLFloater();
|
||||
LLFloater(const std::string& name); //simple constructor for data-driven initialization
|
||||
LLFloater( const std::string& name, const LLRect& rect, const std::string& title,
|
||||
@@ -164,9 +167,9 @@ public:
|
||||
void applyTitle();
|
||||
const std::string& getCurrentTitle() const;
|
||||
void setTitle( const std::string& title);
|
||||
std::string getTitle();
|
||||
std::string getTitle() const;
|
||||
void setShortTitle( const std::string& short_title );
|
||||
std::string getShortTitle();
|
||||
std::string getShortTitle() const;
|
||||
void setTitleVisible(bool visible);
|
||||
virtual void setMinimized(BOOL b);
|
||||
void moveResizeHandlesToFront();
|
||||
@@ -174,8 +177,8 @@ public:
|
||||
void addDependentFloater(LLHandle<LLFloater> dependent_handle, BOOL reposition = TRUE);
|
||||
LLFloater* getDependee() { return (LLFloater*)mDependeeHandle.get(); }
|
||||
void removeDependentFloater(LLFloater* dependent);
|
||||
BOOL isMinimized() { return mMinimized; }
|
||||
BOOL isFrontmost();
|
||||
BOOL isMinimized() const { return mMinimized; }
|
||||
virtual BOOL isFrontmost();
|
||||
BOOL isDependent() { return !mDependeeHandle.isDead(); }
|
||||
void setCanMinimize(BOOL can_minimize);
|
||||
void setCanClose(BOOL can_close);
|
||||
@@ -199,6 +202,7 @@ public:
|
||||
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask);
|
||||
virtual void draw();
|
||||
virtual void drawShadow(LLPanel* panel);
|
||||
|
||||
virtual void onOpen() {}
|
||||
|
||||
@@ -244,6 +248,8 @@ public:
|
||||
static BOOL getEditModeEnabled() { return sEditModeEnabled; }
|
||||
static LLMultiFloater* getFloaterHost() {return sHostp; }
|
||||
|
||||
void updateTransparency(ETypeTransparency transparency_type);
|
||||
|
||||
void enableResizeCtrls(bool enable, bool width = true, bool height = true);
|
||||
protected:
|
||||
|
||||
@@ -259,21 +265,29 @@ protected:
|
||||
void destroy() { die(); } // Don't call this directly. You probably want to call close(). JC
|
||||
|
||||
private:
|
||||
|
||||
void setForeground(BOOL b); // called only by floaterview
|
||||
void cleanupHandles(); // remove handles to dead floaters
|
||||
void createMinimizeButton();
|
||||
void updateButtons();
|
||||
void buildButtons();
|
||||
BOOL offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButtons index);
|
||||
BOOL offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButton index);
|
||||
void addResizeCtrls();
|
||||
void layoutResizeCtrls();
|
||||
|
||||
static void updateActiveFloaterTransparency();
|
||||
static void updateInactiveFloaterTransparency();
|
||||
void updateTransparency(LLView* view, ETypeTransparency transparency_type);
|
||||
|
||||
LLRect mExpandedRect;
|
||||
|
||||
protected:
|
||||
LLDragHandle* mDragHandle;
|
||||
LLResizeBar* mResizeBar[4];
|
||||
LLResizeHandle* mResizeHandle[4];
|
||||
LLButton *mMinimizeButton;
|
||||
|
||||
LLButton* mButtons[BUTTON_COUNT];
|
||||
private:
|
||||
BOOL mCanTearOff;
|
||||
BOOL mMinimized;
|
||||
BOOL mForeground;
|
||||
@@ -294,10 +308,7 @@ private:
|
||||
handle_set_t mDependents;
|
||||
bool mDragOnLeft;
|
||||
|
||||
BOOL mButtonsEnabled[BUTTON_COUNT];
|
||||
protected:
|
||||
LLButton* mButtons[BUTTON_COUNT];
|
||||
private:
|
||||
bool mButtonsEnabled[BUTTON_COUNT];
|
||||
F32 mButtonScale;
|
||||
BOOL mAutoFocus;
|
||||
LLHandle<LLFloater> mSnappedTo;
|
||||
@@ -344,7 +355,7 @@ public:
|
||||
|
||||
/*virtual*/ void draw();
|
||||
/*virtual*/ LLRect getSnapRect() const;
|
||||
void refresh();
|
||||
/*virtual*/ void refresh();
|
||||
|
||||
void getNewFloaterPosition( S32* left, S32* top );
|
||||
void resetStartingFloaterPosition();
|
||||
@@ -373,10 +384,10 @@ public:
|
||||
void minimizeAllChildren();
|
||||
// </edit>
|
||||
|
||||
LLFloater* getFrontmost();
|
||||
LLFloater* getBackmost();
|
||||
LLFloater* getParentFloater(LLView* viewp);
|
||||
LLFloater* getFocusedFloater();
|
||||
LLFloater* getFrontmost() const;
|
||||
LLFloater* getBackmost() const;
|
||||
LLFloater* getParentFloater(LLView* viewp) const;
|
||||
LLFloater* getFocusedFloater() const;
|
||||
void syncFloaterTabOrder();
|
||||
|
||||
// Returns z order of child provided. 0 is closest, larger numbers
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
const F32 FOCUS_FADE_TIME = 0.3f;
|
||||
|
||||
LLFocusableElement::LLFocusableElement()
|
||||
: mFocusLostCallback(NULL),
|
||||
mFocusReceivedCallback(NULL),
|
||||
mFocusChangedCallback(NULL),
|
||||
mTopLostCallback(NULL)
|
||||
: mFocusLostCallback(nullptr),
|
||||
mFocusReceivedCallback(nullptr),
|
||||
mFocusChangedCallback(nullptr),
|
||||
mTopLostCallback(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -146,14 +146,14 @@ struct LLFocusMgr::Impl
|
||||
LLFocusMgr gFocusMgr;
|
||||
|
||||
LLFocusMgr::LLFocusMgr()
|
||||
: mLockedView( NULL ),
|
||||
mMouseCaptor( NULL ),
|
||||
mKeyboardFocus( NULL ),
|
||||
mLastKeyboardFocus( NULL ),
|
||||
mDefaultKeyboardFocus( NULL ),
|
||||
mLastDefaultKeyboardFocus( NULL ),
|
||||
: mLockedView(nullptr ),
|
||||
mMouseCaptor(nullptr ),
|
||||
mKeyboardFocus(nullptr ),
|
||||
mLastKeyboardFocus(nullptr ),
|
||||
mDefaultKeyboardFocus(nullptr ),
|
||||
mLastDefaultKeyboardFocus(nullptr ),
|
||||
mKeystrokesOnly(FALSE),
|
||||
mTopCtrl( NULL ),
|
||||
mTopCtrl(nullptr ),
|
||||
mAppHasFocus(TRUE), // Macs don't seem to notify us that we've gotten focus, so default to true
|
||||
mImpl(new LLFocusMgr::Impl)
|
||||
{
|
||||
@@ -163,22 +163,22 @@ LLFocusMgr::~LLFocusMgr()
|
||||
{
|
||||
mImpl->mFocusHistory.clear();
|
||||
delete mImpl;
|
||||
mImpl = NULL;
|
||||
mImpl = nullptr;
|
||||
}
|
||||
|
||||
void LLFocusMgr::releaseFocusIfNeeded( const LLView* view )
|
||||
{
|
||||
if( childHasMouseCapture( view ) )
|
||||
{
|
||||
setMouseCapture( NULL );
|
||||
setMouseCapture(nullptr );
|
||||
}
|
||||
|
||||
if( childHasKeyboardFocus( view ))
|
||||
{
|
||||
if (view == mLockedView)
|
||||
{
|
||||
mLockedView = NULL;
|
||||
setKeyboardFocus( NULL );
|
||||
mLockedView = nullptr;
|
||||
setKeyboardFocus(nullptr );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -188,7 +188,7 @@ void LLFocusMgr::releaseFocusIfNeeded( const LLView* view )
|
||||
|
||||
if( childIsTopCtrl( view ) )
|
||||
{
|
||||
setTopCtrl( NULL );
|
||||
setTopCtrl(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ void LLFocusMgr::restoreDefaultKeyboardFocus(LLFocusableElement* current_default
|
||||
if (current_default_focus && mDefaultKeyboardFocus == current_default_focus)
|
||||
{
|
||||
setDefaultKeyboardFocus(mLastDefaultKeyboardFocus);
|
||||
mLastDefaultKeyboardFocus = NULL;
|
||||
mLastDefaultKeyboardFocus = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ void LLFocusMgr::restoreKeyboardFocus(LLFocusableElement* current_focus)
|
||||
if (current_focus && mKeyboardFocus == current_focus)
|
||||
{
|
||||
setKeyboardFocus(mLastKeyboardFocus);
|
||||
mLastKeyboardFocus = NULL;
|
||||
mLastKeyboardFocus = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, BOOL lock, BOOL
|
||||
focus_dirty = false;
|
||||
|
||||
if (mLockedView &&
|
||||
(new_focus == NULL ||
|
||||
(new_focus == nullptr ||
|
||||
(new_focus != mLockedView
|
||||
&& dynamic_cast<LLView*>(new_focus)
|
||||
&& !dynamic_cast<LLView*>(new_focus)->hasAncestor(mLockedView))))
|
||||
@@ -291,7 +291,7 @@ void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, BOOL lock, BOOL
|
||||
|
||||
// If we've got a default keyboard focus, and the caller is
|
||||
// releasing keyboard focus, move to the default.
|
||||
if (mDefaultKeyboardFocus != NULL && mKeyboardFocus == NULL)
|
||||
if (mDefaultKeyboardFocus != nullptr && mKeyboardFocus == nullptr)
|
||||
{
|
||||
mDefaultKeyboardFocus->setFocus(TRUE);
|
||||
}
|
||||
@@ -343,7 +343,7 @@ BOOL LLFocusMgr::childHasKeyboardFocus(const LLView* parent ) const
|
||||
// Returns TRUE is parent or any descedent of parent is the mouse captor.
|
||||
BOOL LLFocusMgr::childHasMouseCapture( const LLView* parent ) const
|
||||
{
|
||||
if( mMouseCaptor && dynamic_cast<LLView*>(mMouseCaptor) != NULL )
|
||||
if( mMouseCaptor && dynamic_cast<LLView*>(mMouseCaptor) != nullptr )
|
||||
{
|
||||
LLView* captor_view = (LLView*)mMouseCaptor;
|
||||
while( captor_view )
|
||||
@@ -364,23 +364,24 @@ void LLFocusMgr::removeKeyboardFocusWithoutCallback( const LLFocusableElement* f
|
||||
// in order to unlock it
|
||||
if (focus == mLockedView)
|
||||
{
|
||||
mLockedView = NULL;
|
||||
mLockedView = nullptr;
|
||||
}
|
||||
|
||||
if (mKeyboardFocus == focus)
|
||||
{
|
||||
mKeyboardFocus = NULL;
|
||||
mKeyboardFocus = nullptr;
|
||||
}
|
||||
if (mLastKeyboardFocus == focus)
|
||||
{
|
||||
mLastKeyboardFocus = NULL;
|
||||
mLastKeyboardFocus = nullptr;
|
||||
}
|
||||
if (mDefaultKeyboardFocus == focus)
|
||||
{
|
||||
mDefaultKeyboardFocus = NULL;
|
||||
mDefaultKeyboardFocus = nullptr;
|
||||
}
|
||||
if (mLastDefaultKeyboardFocus == focus)
|
||||
{
|
||||
mLastDefaultKeyboardFocus = NULL;
|
||||
mLastDefaultKeyboardFocus = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,7 +431,7 @@ void LLFocusMgr::removeMouseCaptureWithoutCallback( const LLMouseHandler* captor
|
||||
{
|
||||
if( mMouseCaptor == captor )
|
||||
{
|
||||
mMouseCaptor = NULL;
|
||||
mMouseCaptor = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,7 +471,7 @@ void LLFocusMgr::removeTopCtrlWithoutCallback( const LLUICtrl* top_view )
|
||||
{
|
||||
if( mTopCtrl == top_view )
|
||||
{
|
||||
mTopCtrl = NULL;
|
||||
mTopCtrl = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +482,7 @@ void LLFocusMgr::lockFocus()
|
||||
|
||||
void LLFocusMgr::unlockFocus()
|
||||
{
|
||||
mLockedView = NULL;
|
||||
mLockedView = nullptr;
|
||||
}
|
||||
|
||||
F32 LLFocusMgr::getFocusFlashAmt() const
|
||||
@@ -516,7 +517,7 @@ void LLFocusMgr::setAppHasFocus(BOOL focus)
|
||||
// release focus from "top ctrl"s, which generally hides them
|
||||
if (!focus && mTopCtrl)
|
||||
{
|
||||
setTopCtrl(NULL);
|
||||
setTopCtrl(nullptr);
|
||||
}
|
||||
mAppHasFocus = focus;
|
||||
}
|
||||
@@ -532,7 +533,7 @@ LLUICtrl* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const
|
||||
return static_cast<LLUICtrl*>(found_it->second.get());
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void LLFocusMgr::clearLastFocusForGroup(LLView* subtree_root)
|
||||
|
||||
@@ -1497,8 +1497,9 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
|
||||
break;
|
||||
|
||||
case KEY_RETURN:
|
||||
if (getCommitOnReturn()) onCommit();
|
||||
// store sent line in history
|
||||
updateHistory();
|
||||
else updateHistory();
|
||||
break;
|
||||
|
||||
case KEY_ESCAPE:
|
||||
|
||||
104
indra/llui/llloadingindicator.cpp
Normal file
104
indra/llui/llloadingindicator.cpp
Normal file
@@ -0,0 +1,104 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
/**
|
||||
* @file llloadingindicator.cpp
|
||||
* @brief Perpetual loading indicator
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llloadingindicator.h"
|
||||
|
||||
// Linden library includes
|
||||
#include "llsingleton.h"
|
||||
|
||||
// Project includes
|
||||
#include "lluictrlfactory.h"
|
||||
#include "lluiimage.h"
|
||||
|
||||
static LLRegisterWidget<LLLoadingIndicator> r("loading_indicator");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// LLLoadingIndicator class
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LLLoadingIndicator::LLLoadingIndicator(const Params& p)
|
||||
: LLUICtrl(p),
|
||||
mImagesPerSec(p.images_per_sec > 0 ? p.images_per_sec : 1.0f),
|
||||
mCurImageIdx(0)
|
||||
{
|
||||
}
|
||||
|
||||
void LLLoadingIndicator::initFromParams(const Params& p)
|
||||
{
|
||||
for (LLUIImage* image : p.images().image)
|
||||
{
|
||||
mImages.push_back(image);
|
||||
}
|
||||
|
||||
if (mImages.empty()) // Singu Note: We don't have default widgets yet, so let's just handle this here
|
||||
for (int i = 1; i <= 12; ++i)
|
||||
mImages.push_back(LLUI::getUIImage(llformat("Progress_%d", i)));
|
||||
|
||||
// Start timer for switching images.
|
||||
start();
|
||||
}
|
||||
|
||||
void LLLoadingIndicator::draw()
|
||||
{
|
||||
// Time to switch to the next image?
|
||||
if (mImageSwitchTimer.getStarted() && mImageSwitchTimer.hasExpired())
|
||||
{
|
||||
// Switch to the next image.
|
||||
if (!mImages.empty())
|
||||
{
|
||||
mCurImageIdx = (mCurImageIdx + 1) % mImages.size();
|
||||
}
|
||||
|
||||
// Restart timer.
|
||||
start();
|
||||
}
|
||||
|
||||
LLUIImagePtr cur_image = mImages.empty() ? LLUIImagePtr(NULL) : mImages[mCurImageIdx];
|
||||
|
||||
// Draw current image.
|
||||
if( cur_image.notNull() )
|
||||
{
|
||||
cur_image->draw(getLocalRect(), LLColor4::white % getDrawContext().mAlpha);
|
||||
}
|
||||
|
||||
LLUICtrl::draw();
|
||||
}
|
||||
|
||||
void LLLoadingIndicator::stop()
|
||||
{
|
||||
mImageSwitchTimer.stop();
|
||||
}
|
||||
|
||||
void LLLoadingIndicator::start()
|
||||
{
|
||||
mImageSwitchTimer.start();
|
||||
F32 period = 1.0f / (mImages.size() * mImagesPerSec);
|
||||
mImageSwitchTimer.setTimerExpirySec(period);
|
||||
}
|
||||
104
indra/llui/llloadingindicator.h
Normal file
104
indra/llui/llloadingindicator.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
* @file llloadingindicator.h
|
||||
* @brief Perpetual loading indicator
|
||||
*
|
||||
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLLOADINGINDICATOR_H
|
||||
#define LL_LLLOADINGINDICATOR_H
|
||||
|
||||
#include "lluictrl.h"
|
||||
#include "lluiimage.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// class LLLoadingIndicator
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Perpetual loading indicator (a la MacOSX or YouTube)
|
||||
*
|
||||
* Number of rotations per second can be overridden
|
||||
* with the "images_per_sec" parameter.
|
||||
*
|
||||
* Can start/stop spinning.
|
||||
*
|
||||
* @see start()
|
||||
* @see stop()
|
||||
*/
|
||||
class LLLoadingIndicator
|
||||
: public LLUICtrl
|
||||
{
|
||||
LOG_CLASS(LLLoadingIndicator);
|
||||
public:
|
||||
|
||||
struct Images : public LLInitParam::Block<Images>
|
||||
{
|
||||
Multiple<LLUIImage*> image;
|
||||
|
||||
Images()
|
||||
: image("image")
|
||||
{}
|
||||
};
|
||||
|
||||
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
|
||||
{
|
||||
Optional<F32> images_per_sec;
|
||||
Optional<Atomic<Images> > images;
|
||||
|
||||
Params()
|
||||
: images_per_sec("images_per_sec", 1.0f),
|
||||
images("images")
|
||||
{}
|
||||
};
|
||||
|
||||
virtual ~LLLoadingIndicator() {}
|
||||
|
||||
// llview overrides
|
||||
void draw() override;
|
||||
|
||||
/**
|
||||
* Stop spinning.
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* Start spinning.
|
||||
*/
|
||||
void start();
|
||||
|
||||
void reset() { mCurImageIdx = 0; }
|
||||
|
||||
private:
|
||||
LLLoadingIndicator(const Params&);
|
||||
void initFromParams(const Params&);
|
||||
|
||||
friend class LLUICtrlFactory;
|
||||
|
||||
F32 mImagesPerSec;
|
||||
S8 mCurImageIdx;
|
||||
LLFrameTimer mImageSwitchTimer;
|
||||
|
||||
std::vector<LLUIImagePtr> mImages;
|
||||
};
|
||||
|
||||
#endif // LL_LLLOADINGINDICATOR_H
|
||||
@@ -70,7 +70,7 @@
|
||||
using namespace LLOldEvents;
|
||||
|
||||
// static
|
||||
LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL;
|
||||
LLMenuHolderGL *LLMenuGL::sMenuContainer = nullptr;
|
||||
|
||||
S32 MENU_BAR_HEIGHT = 0;
|
||||
S32 MENU_BAR_WIDTH = 0;
|
||||
@@ -258,7 +258,7 @@ BOOL LLMenuItemGL::handleRightMouseUp(S32 x, S32 y, MASK mask)
|
||||
// if not, it will be added to the list
|
||||
BOOL LLMenuItemGL::addToAcceleratorList(std::list <LLKeyBinding*> *listp)
|
||||
{
|
||||
LLKeyBinding *accelerator = NULL;
|
||||
LLKeyBinding *accelerator = nullptr;
|
||||
|
||||
if (mAcceleratorKey != KEY_NONE)
|
||||
{
|
||||
@@ -268,19 +268,37 @@ BOOL LLMenuItemGL::addToAcceleratorList(std::list <LLKeyBinding*> *listp)
|
||||
accelerator = *list_it;
|
||||
if ((accelerator->mKey == mAcceleratorKey) && (accelerator->mMask == (mAcceleratorMask & MASK_NORMALKEYS)))
|
||||
{
|
||||
|
||||
// *NOTE: get calling code to throw up warning or route
|
||||
// warning messages back to app-provided output
|
||||
// std::string warning;
|
||||
// warning.append("Duplicate key binding <");
|
||||
// appendAcceleratorString( warning );
|
||||
// warning.append("> for menu items:\n ");
|
||||
// warning.append(accelerator->mName);
|
||||
// warning.append("\n ");
|
||||
// warning.append(mLabel);
|
||||
|
||||
// LL_WARNS() << warning << LL_ENDL;
|
||||
// LLAlertDialog::modalAlert(warning);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (!accelerator)
|
||||
{
|
||||
accelerator = new LLKeyBinding;
|
||||
if (accelerator)
|
||||
try
|
||||
{
|
||||
accelerator = new LLKeyBinding;
|
||||
accelerator->mKey = mAcceleratorKey;
|
||||
accelerator->mMask = (mAcceleratorMask & MASK_NORMALKEYS);
|
||||
// accelerator->mName = mLabel;
|
||||
listp->push_back(accelerator);//addData(accelerator);
|
||||
}
|
||||
catch (const std::bad_alloc& e)
|
||||
{
|
||||
LL_WARNS() << "Failed to allocate memory for keybinding with exception: " << e.what() << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
listp->push_back(accelerator);//addData(accelerator);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
@@ -681,7 +699,7 @@ class LLMenuItemVerticalSeparatorGL
|
||||
public:
|
||||
LLMenuItemVerticalSeparatorGL( void );
|
||||
|
||||
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; }
|
||||
BOOL handleMouseDown(S32 x, S32 y, MASK mask) override { return FALSE; }
|
||||
};
|
||||
|
||||
LLMenuItemVerticalSeparatorGL::LLMenuItemVerticalSeparatorGL( void )
|
||||
@@ -733,7 +751,7 @@ LLFloater* LLMenuItemTearOffGL::getParentFloater()
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void LLMenuItemTearOffGL::onCommit()
|
||||
@@ -4873,7 +4891,7 @@ void LLContextMenu::hide()
|
||||
{
|
||||
mHoverItem->setHighlight( FALSE );
|
||||
}
|
||||
mHoverItem = NULL;
|
||||
mHoverItem = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -4983,7 +5001,11 @@ bool LLContextMenu::addChild(LLView* view, S32 tab_group)
|
||||
if (LLContextMenu* context = dynamic_cast<LLContextMenu*>(view))
|
||||
return appendContextSubMenu(context);
|
||||
if (LLMenuItemGL* item = dynamic_cast<LLMenuItemGL*>(view))
|
||||
{
|
||||
if (!mItems.empty() && mItems.back()->getType() == "separator" && item->getType() == "separator") // Singu TODO: Profile this? Does it matter?
|
||||
item->setVisible(false);
|
||||
return append(item);
|
||||
}
|
||||
if (LLMenuGL* menu = dynamic_cast<LLMenuGL*>(view))
|
||||
return appendMenu(menu);
|
||||
return false;
|
||||
@@ -5024,7 +5046,7 @@ LLPieMenu::LLPieMenu(const std::string& name, const std::string& label)
|
||||
// Separators on pie menus are invisible
|
||||
bool LLPieMenu::addChild(LLView* view, S32 tab_group)
|
||||
{
|
||||
if (LLContextMenu::addChild(view, tab_group))
|
||||
if (LLContextMenu::addChild(view, tab_group) && view->getVisible())
|
||||
{
|
||||
LLMenuItemSeparatorGL* sep = dynamic_cast<LLMenuItemSeparatorGL*>(view);
|
||||
if(sep)
|
||||
|
||||
@@ -580,6 +580,7 @@ public:
|
||||
void resetScrollPositionOnShow(bool reset_scroll_pos) { mResetScrollPositionOnShow = reset_scroll_pos; }
|
||||
bool isScrollPositionOnShowReset() { return mResetScrollPositionOnShow; }
|
||||
protected:
|
||||
friend class LLTextEditor;
|
||||
void createSpilloverBranch();
|
||||
void cleanupSpilloverBranch();
|
||||
// Add the menu item to this menu.
|
||||
|
||||
@@ -284,7 +284,8 @@ LLNotificationForm::LLNotificationForm(const LLSD& sd)
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Invalid form data " << sd << LL_ENDL;
|
||||
if (!sd.isUndefined())
|
||||
LL_WARNS() << "Invalid form data " << sd << LL_ENDL;
|
||||
mFormData = LLSD::emptyArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,14 +196,16 @@ void LLPanel::draw()
|
||||
// draw background
|
||||
if( mBgVisible )
|
||||
{
|
||||
LLRect local_rect = getLocalRect();
|
||||
F32 alpha = getCurrentTransparency();
|
||||
|
||||
LLRect&& local_rect = getLocalRect();
|
||||
if (mBgOpaque )
|
||||
{
|
||||
gl_rect_2d( local_rect, mBgColorOpaque );
|
||||
gl_rect_2d( local_rect, mBgColorOpaque % alpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl_rect_2d( local_rect, mBgColorAlpha );
|
||||
gl_rect_2d( local_rect, mBgColorAlpha % alpha);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,8 +441,31 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *fac
|
||||
std::string name("panel");
|
||||
node->getAttributeString("name", name);
|
||||
|
||||
LLPanel* panelp = factory->createFactoryPanel(name);
|
||||
std::string class_attr;
|
||||
node->getAttributeString("class", class_attr);
|
||||
|
||||
LLPanel* panelp = NULL;
|
||||
|
||||
{
|
||||
if(!class_attr.empty())
|
||||
{
|
||||
panelp = LLRegisterPanelClass::instance().createPanelClass(class_attr);
|
||||
}
|
||||
|
||||
if (!panelp)
|
||||
{
|
||||
panelp = factory->createFactoryPanel(name);
|
||||
/* Singu TODO: Future?
|
||||
llassert(panelp);
|
||||
|
||||
if (!panelp)
|
||||
{
|
||||
return NULL; // :(
|
||||
}*/
|
||||
}
|
||||
}
|
||||
LL_RECORD_BLOCK_TIME(FTM_PANEL_CONSTRUCTION);
|
||||
|
||||
// Fall back on a default panel, if there was no special factory.
|
||||
if (!panelp)
|
||||
{
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
#include "lluictrl.h"
|
||||
#include "llbutton.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "lluiimage.h"
|
||||
#include "llviewborder.h"
|
||||
#include "lluiimage.h"
|
||||
#include "lluistring.h"
|
||||
#include "v4color.h"
|
||||
#include <list>
|
||||
@@ -142,6 +142,7 @@ public:
|
||||
|
||||
CommitCallbackRegistry::ScopedRegistrar& getCommitCallbackRegistrar() { return mCommitCallbackRegistrar; }
|
||||
EnableCallbackRegistry::ScopedRegistrar& getEnableCallbackRegistrar() { return mEnableCallbackRegistrar; }
|
||||
|
||||
virtual BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
|
||||
void initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory);
|
||||
void setPanelParameters(LLXMLNodePtr node, LLView *parentp);
|
||||
@@ -151,6 +152,7 @@ public:
|
||||
std::string getString(const std::string& name) const;
|
||||
|
||||
// ** Wrappers for setting child properties by name ** -TomY
|
||||
// WARNING: These are deprecated, please use getChild<T>("name")->doStuff() idiom instead
|
||||
|
||||
// LLView
|
||||
void childSetVisible(const std::string& name, bool visible);
|
||||
@@ -196,7 +198,7 @@ public:
|
||||
BOOL childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
|
||||
BOOL childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
|
||||
BOOL childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
|
||||
|
||||
|
||||
// LLSlider / LLMultiSlider / LLSpinCtrl
|
||||
void childSetMinValue(const std::string& id, LLSD min_value);
|
||||
void childSetMaxValue(const std::string& id, LLSD max_value);
|
||||
@@ -228,6 +230,7 @@ public:
|
||||
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
|
||||
|
||||
boost::signals2::connection setVisibleCallback( const commit_signal_t::slot_type& cb );
|
||||
|
||||
protected:
|
||||
// Override to set not found list
|
||||
LLButton* getDefaultButton() { return mDefaultBtn; }
|
||||
@@ -262,4 +265,56 @@ private:
|
||||
|
||||
}; // end class LLPanel
|
||||
|
||||
typedef boost::function<LLPanel* (void)> LLPanelClassCreatorFunc;
|
||||
|
||||
// local static instance for registering a particular panel class
|
||||
|
||||
class LLRegisterPanelClass
|
||||
: public LLSingleton< LLRegisterPanelClass >
|
||||
{
|
||||
public:
|
||||
// reigister with either the provided builder, or the generic templated builder
|
||||
void addPanelClass(const std::string& tag,LLPanelClassCreatorFunc func)
|
||||
{
|
||||
mPanelClassesNames[tag] = func;
|
||||
}
|
||||
|
||||
LLPanel* createPanelClass(const std::string& tag)
|
||||
{
|
||||
param_name_map_t::iterator iT = mPanelClassesNames.find(tag);
|
||||
if(iT == mPanelClassesNames.end())
|
||||
return 0;
|
||||
return iT->second();
|
||||
}
|
||||
template<typename T>
|
||||
static T* defaultPanelClassBuilder()
|
||||
{
|
||||
T* pT = new T();
|
||||
return pT;
|
||||
}
|
||||
|
||||
private:
|
||||
typedef std::map< std::string, LLPanelClassCreatorFunc> param_name_map_t;
|
||||
|
||||
param_name_map_t mPanelClassesNames;
|
||||
};
|
||||
|
||||
|
||||
// local static instance for registering a particular panel class
|
||||
template<typename T>
|
||||
class LLPanelInjector
|
||||
{
|
||||
public:
|
||||
// register with either the provided builder, or the generic templated builder
|
||||
LLPanelInjector(const std::string& tag);
|
||||
};
|
||||
|
||||
|
||||
template<typename T>
|
||||
LLPanelInjector<T>::LLPanelInjector(const std::string& tag)
|
||||
{
|
||||
LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder<T>);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,6 @@ LLSlider::LLSlider(
|
||||
F32 min_value,
|
||||
F32 max_value,
|
||||
F32 increment,
|
||||
BOOL volume,
|
||||
const std::string& control_name)
|
||||
:
|
||||
LLUICtrl( name, rect, TRUE, commit_callback,
|
||||
@@ -64,7 +63,6 @@ LLSlider::LLSlider(
|
||||
mMinValue( min_value ),
|
||||
mMaxValue( max_value ),
|
||||
mIncrement( increment ),
|
||||
mVolumeSlider( volume ),
|
||||
mMouseOffset( 0 ),
|
||||
mTrackColor( LLUI::sColorsGroup->getColor( "SliderTrackColor" ) ),
|
||||
mThumbOutlineColor( LLUI::sColorsGroup->getColor( "SliderThumbOutlineColor" ) ),
|
||||
@@ -172,7 +170,7 @@ BOOL LLSlider::handleMouseUp(S32 x, S32 y, MASK mask)
|
||||
|
||||
if( hasMouseCapture() )
|
||||
{
|
||||
gFocusMgr.setMouseCapture( NULL );
|
||||
gFocusMgr.setMouseCapture(nullptr );
|
||||
|
||||
if (mMouseUpSignal)
|
||||
(*mMouseUpSignal)( this, getValueF32() );
|
||||
@@ -229,15 +227,12 @@ BOOL LLSlider::handleKeyHere(KEY key, MASK mask)
|
||||
BOOL handled = FALSE;
|
||||
switch(key)
|
||||
{
|
||||
case KEY_UP:
|
||||
case KEY_DOWN:
|
||||
// eat up and down keys to be consistent
|
||||
handled = TRUE;
|
||||
break;
|
||||
case KEY_LEFT:
|
||||
setValueAndCommit(getValueF32() - getIncrement());
|
||||
handled = TRUE;
|
||||
break;
|
||||
case KEY_UP:
|
||||
case KEY_RIGHT:
|
||||
setValueAndCommit(getValueF32() + getIncrement());
|
||||
handled = TRUE;
|
||||
@@ -248,6 +243,16 @@ BOOL LLSlider::handleKeyHere(KEY key, MASK mask)
|
||||
return handled;
|
||||
}
|
||||
|
||||
BOOL LLSlider::handleScrollWheel(S32 x, S32 y, S32 clicks)
|
||||
{
|
||||
F32 old_val = getValueF32();
|
||||
F32 new_val = old_val - clicks * getIncrement();
|
||||
setValueAndCommit(new_val);
|
||||
// Singu Note: We have to tell the viewer we're done dragging if it cares
|
||||
if (mMouseUpSignal && old_val != new_val) (*mMouseUpSignal)(this, new_val);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLSlider::draw()
|
||||
{
|
||||
F32 alpha = getDrawContext().mAlpha;
|
||||
@@ -276,7 +281,7 @@ void LLSlider::draw()
|
||||
mThumbImage->drawBorder(mThumbRect, gFocusMgr.getFocusColor() % alpha, gFocusMgr.getFocusFlashWidth());
|
||||
}
|
||||
|
||||
if( hasMouseCapture() )
|
||||
if( hasMouseCapture() ) // currently clicking on slider
|
||||
{
|
||||
// Show ghost where thumb was before dragging began.
|
||||
if (mThumbImage.notNull())
|
||||
@@ -310,20 +315,11 @@ LLXMLNodePtr LLSlider::getXML(bool save_children) const
|
||||
{
|
||||
LLXMLNodePtr node = LLUICtrl::getXML();
|
||||
|
||||
if (mVolumeSlider)
|
||||
{
|
||||
node->setName(LL_VOLUME_SLIDER_CTRL_TAG);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->setName(LL_SLIDER_TAG);
|
||||
}
|
||||
|
||||
node->setName(LL_SLIDER_TAG);
|
||||
node->createChild("initial_val", TRUE)->setFloatValue(getInitialValue());
|
||||
node->createChild("min_val", TRUE)->setFloatValue(getMinValue());
|
||||
node->createChild("max_val", TRUE)->setFloatValue(getMaxValue());
|
||||
node->createChild("increment", TRUE)->setFloatValue(getIncrement());
|
||||
node->createChild("volume", TRUE)->setBoolValue(mVolumeSlider);
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -358,17 +354,13 @@ LLView* LLSlider::fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFacto
|
||||
F32 increment = 0.1f;
|
||||
node->getAttributeF32("increment", increment);
|
||||
|
||||
BOOL volume = node->hasName("volume_slider") ? TRUE : FALSE;
|
||||
node->getAttributeBOOL("volume", volume);
|
||||
|
||||
LLSlider* slider = new LLSlider("slider_bar",
|
||||
rect,
|
||||
NULL,
|
||||
initial_value,
|
||||
min_value,
|
||||
max_value,
|
||||
increment,
|
||||
volume);
|
||||
increment);
|
||||
|
||||
slider->initFromXML(node, parent);
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ public:
|
||||
F32 min_value,
|
||||
F32 max_value,
|
||||
F32 increment,
|
||||
BOOL volume, //TODO: create a "volume" slider sub-class or just use image art, no? -MG
|
||||
const std::string& control_name = LLStringUtil::null );
|
||||
|
||||
virtual LLXMLNodePtr getXML(bool save_children = true) const;
|
||||
@@ -75,12 +74,12 @@ public:
|
||||
boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb );
|
||||
boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb );
|
||||
|
||||
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||
virtual void draw();
|
||||
BOOL handleHover(S32 x, S32 y, MASK mask) override;
|
||||
BOOL handleMouseUp(S32 x, S32 y, MASK mask) override;
|
||||
BOOL handleMouseDown(S32 x, S32 y, MASK mask) override;
|
||||
BOOL handleKeyHere(KEY key, MASK mask) override;
|
||||
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override;
|
||||
void draw() override;
|
||||
|
||||
private:
|
||||
void setValueAndCommit(F32 value);
|
||||
@@ -92,7 +91,6 @@ private:
|
||||
F32 mMaxValue;
|
||||
F32 mIncrement;
|
||||
|
||||
BOOL mVolumeSlider;
|
||||
S32 mMouseOffset;
|
||||
LLRect mDragStartThumbRect;
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect,
|
||||
S32 text_left,
|
||||
BOOL show_text,
|
||||
BOOL can_edit_text,
|
||||
BOOL volume,
|
||||
commit_callback_t commit_callback,
|
||||
F32 initial_value, F32 min_value, F32 max_value, F32 increment,
|
||||
const std::string& control_which)
|
||||
@@ -67,7 +66,6 @@ LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect,
|
||||
mFont(font),
|
||||
mShowText( show_text ),
|
||||
mCanEditText( can_edit_text ),
|
||||
mVolumeSlider( volume ),
|
||||
mPrecision( 3 ),
|
||||
mLabelBox( NULL ),
|
||||
mLabelWidth( label_width ),
|
||||
@@ -105,7 +103,7 @@ LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect,
|
||||
mSlider = new LLSlider(std::string("slider"),
|
||||
slider_rect,
|
||||
boost::bind(&LLSliderCtrl::onSliderCommit,_1,_2),
|
||||
initial_value, min_value, max_value, increment, volume,
|
||||
initial_value, min_value, max_value, increment,
|
||||
control_which );
|
||||
addChild( mSlider );
|
||||
|
||||
@@ -387,8 +385,6 @@ LLXMLNodePtr LLSliderCtrl::getXML(bool save_children) const
|
||||
node->createChild("show_text", TRUE)->setBoolValue(mShowText);
|
||||
|
||||
node->createChild("can_edit_text", TRUE)->setBoolValue(mCanEditText);
|
||||
|
||||
node->createChild("volume", TRUE)->setBoolValue(mVolumeSlider);
|
||||
|
||||
node->createChild("decimal_digits", TRUE)->setIntValue(mPrecision);
|
||||
|
||||
@@ -438,9 +434,6 @@ LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
|
||||
BOOL can_edit_text = FALSE;
|
||||
node->getAttributeBOOL("can_edit_text", can_edit_text);
|
||||
|
||||
BOOL volume = FALSE;
|
||||
node->getAttributeBOOL("volume", volume);
|
||||
|
||||
F32 initial_value = 0.f;
|
||||
node->getAttributeF32("initial_val", initial_value);
|
||||
|
||||
@@ -497,7 +490,6 @@ LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
|
||||
rect.getWidth() - text_left,
|
||||
show_text,
|
||||
can_edit_text,
|
||||
volume,
|
||||
NULL,
|
||||
initial_value,
|
||||
min_value,
|
||||
|
||||
@@ -57,7 +57,6 @@ public:
|
||||
S32 text_left,
|
||||
BOOL show_text,
|
||||
BOOL can_edit_text,
|
||||
BOOL volume, //TODO: create a "volume" slider sub-class or just use image art, no? -MG
|
||||
commit_callback_t commit_callback,
|
||||
F32 initial_value, F32 min_value, F32 max_value, F32 increment,
|
||||
const std::string& control_which = LLStringUtil::null );
|
||||
@@ -125,8 +124,7 @@ private:
|
||||
const LLFontGL* mFont;
|
||||
BOOL mShowText;
|
||||
BOOL mCanEditText;
|
||||
BOOL mVolumeSlider;
|
||||
|
||||
|
||||
S32 mPrecision;
|
||||
LLTextBox* mLabelBox;
|
||||
S32 mLabelWidth;
|
||||
|
||||
@@ -175,17 +175,15 @@ void LLStatBar::draw()
|
||||
LLFontGL::getFontMonospace()->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f),
|
||||
LLFontGL::LEFT, LLFontGL::TOP);
|
||||
|
||||
std::string value_format;
|
||||
|
||||
std::string value_str;
|
||||
if (!mUnitLabel.empty())
|
||||
{
|
||||
value_format = llformat( "%%.%df%%s", mPrecision);
|
||||
value_str = llformat( value_format.c_str(), mValue, mUnitLabel.c_str());
|
||||
value_str = llformat( "%.*f%s", mPrecision, mValue, mUnitLabel.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
value_format = llformat( "%%.%df", mPrecision);
|
||||
value_str = llformat( value_format.c_str(), mValue);
|
||||
value_str = llformat("%.*f", mPrecision, mValue);
|
||||
}
|
||||
|
||||
// Draw the value.
|
||||
@@ -193,11 +191,8 @@ void LLStatBar::draw()
|
||||
LLColor4(1.f, 1.f, 1.f, 0.5f),
|
||||
LLFontGL::RIGHT, LLFontGL::TOP);
|
||||
|
||||
value_format = llformat( "%%.%df", mPrecision);
|
||||
if (mDisplayBar)
|
||||
{
|
||||
std::string tick_label;
|
||||
|
||||
// Draw the tick marks.
|
||||
F32 tick_value;
|
||||
top = bar_top;
|
||||
@@ -220,9 +215,8 @@ void LLStatBar::draw()
|
||||
right = left + tick_width;
|
||||
gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f));
|
||||
|
||||
tick_label = llformat( value_format.c_str(), tick_value);
|
||||
// draw labels for the tick marks
|
||||
LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, left - 1, bar_top - bar_height - tick_height,
|
||||
LLFontGL::getFontMonospace()->renderUTF8(llformat("%.*f", mPrecision, tick_value), 0, left - 1, bar_top - bar_height - tick_height,
|
||||
LLColor4(1.f, 1.f, 1.f, 0.5f),
|
||||
LLFontGL::LEFT, LLFontGL::TOP);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -65,14 +65,22 @@ public:
|
||||
LLTextEditor(const std::string& name,
|
||||
const LLRect& rect,
|
||||
S32 max_length,
|
||||
const std::string &default_text,
|
||||
const std::string &default_text,
|
||||
const LLFontGL* glfont = NULL,
|
||||
BOOL allow_embedded_items = FALSE);
|
||||
BOOL allow_embedded_items = FALSE,
|
||||
bool parse_html = false);
|
||||
|
||||
virtual ~LLTextEditor();
|
||||
|
||||
typedef boost::signals2::signal<void (LLTextEditor* caller)> keystroke_signal_t;
|
||||
const std::string& getMenuSegmentUrl() const;
|
||||
|
||||
typedef boost::signals2::signal<void (LLTextEditor* caller)> keystroke_signal_t;
|
||||
typedef boost::signals2::signal<bool(const LLUUID& user_id)> is_friend_signal_t;
|
||||
typedef boost::signals2::signal<bool(const LLUUID& blocked_id, const std::string from)> is_blocked_signal_t;
|
||||
|
||||
static boost::signals2::connection setIsFriendCallback(const is_friend_signal_t::slot_type& cb);
|
||||
static boost::signals2::connection setIsObjectBlockedCallback(const is_blocked_signal_t::slot_type& cb);
|
||||
static void addMenuListeners();
|
||||
void setKeystrokeCallback(const keystroke_signal_t::slot_type& callback);
|
||||
|
||||
virtual LLXMLNodePtr getXML(bool save_children = true) const;
|
||||
@@ -84,6 +92,7 @@ public:
|
||||
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
virtual void onMouseLeave(S32 x, S32 y, MASK mask) override;
|
||||
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
|
||||
@@ -131,7 +140,9 @@ public:
|
||||
virtual BOOL canRedo() const;
|
||||
virtual void cut();
|
||||
virtual BOOL canCut() const;
|
||||
virtual void copy();
|
||||
void copy(bool raw);
|
||||
void copyRaw() { copy(true); }
|
||||
virtual void copy() { copy(false); }
|
||||
virtual BOOL canCopy() const;
|
||||
virtual void paste();
|
||||
virtual BOOL canPaste() const;
|
||||
@@ -149,12 +160,6 @@ public:
|
||||
virtual BOOL canSelectAll() const;
|
||||
virtual void deselect();
|
||||
virtual BOOL canDeselect() const;
|
||||
static void context_cut(void* data);
|
||||
|
||||
static void context_copy(void* data);
|
||||
static void context_paste(void* data);
|
||||
static void context_delete(void* data);
|
||||
static void context_selectall(void* data);
|
||||
static void spell_correct(void* data);
|
||||
static void spell_add(void* data);
|
||||
static void spell_show(void* data);
|
||||
@@ -176,20 +181,24 @@ public:
|
||||
void insertText(const std::string &text, BOOL deleteSelection = TRUE);
|
||||
// appends text at end
|
||||
void appendText(const std::string &wtext, bool allow_undo, bool prepend_newline,
|
||||
const LLStyleSP stylep = NULL);
|
||||
const LLStyleSP stylep = NULL, bool force_replace_links = true);
|
||||
void appendTextImpl(const std::string& new_text, const LLStyleSP style, bool force_replace_links = true);
|
||||
|
||||
void setLastSegmentToolTip(const std::string& tooltip);
|
||||
|
||||
void appendLineBreakSegment();
|
||||
|
||||
void appendAndHighlightText(const std::string& new_text, S32 highlight_part, const LLStyleSP stylep, bool underline_on_hover = false);
|
||||
|
||||
void replaceUrl(const std::string& url, const std::string& label, const std::string& icon);
|
||||
|
||||
void appendColoredText(const std::string &wtext, bool allow_undo,
|
||||
bool prepend_newline,
|
||||
const LLColor4 &color,
|
||||
const std::string& font_name = LLStringUtil::null);
|
||||
// if styled text starts a line, you need to prepend a newline.
|
||||
void appendStyledText(const std::string &new_text, bool allow_undo,
|
||||
bool prepend_newline,
|
||||
LLStyleSP stylep = NULL);
|
||||
void appendHighlightedText(const std::string &new_text, bool allow_undo,
|
||||
bool prepend_newline, S32 highlight_part,
|
||||
LLStyleSP stylep);
|
||||
|
||||
void appendAndHighlightTextImpl(const std::string& new_text, S32 highlight_part, const LLStyleSP stylep, bool underline_on_hover = false);
|
||||
|
||||
// Removes text from the end of document
|
||||
// Does not change highlight or cursor position.
|
||||
void removeTextFromEnd(S32 num_chars);
|
||||
@@ -253,8 +262,8 @@ public:
|
||||
|
||||
void setHandleEditKeysDirectly( BOOL b ) { mHandleEditKeysDirectly = b; }
|
||||
|
||||
// Callbacks
|
||||
static void setLinkColor(LLColor4 color) { mLinkColor = color; }
|
||||
// Use for when the link color needs to be changed to avoid looking awful
|
||||
void setLinkColor(LLColor4* color) { if (mLinkColor) delete mLinkColor; mLinkColor = color; }
|
||||
|
||||
void setOnScrollEndCallback(void (*callback)(void*), void* userdata);
|
||||
|
||||
@@ -263,7 +272,9 @@ public:
|
||||
LLSD getValue() const;
|
||||
|
||||
const std::string& getText() const;
|
||||
|
||||
|
||||
LLMenuGL* createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url
|
||||
|
||||
// Non-undoable
|
||||
void setText(const LLStringExplicit &utf8str);
|
||||
void setWText(const LLWString &wtext);
|
||||
@@ -284,6 +295,7 @@ public:
|
||||
llwchar getWChar(S32 pos) const { return mWText[pos]; }
|
||||
LLWString getWSubString(S32 pos, S32 len) const { return mWText.substr(pos, len); }
|
||||
|
||||
const LLTextSegment* getLastSegment() const { return mSegments.empty() ? nullptr : mSegments.back(); }
|
||||
const LLTextSegment* getCurrentSegment() const { return getSegmentAtOffset(mCursorPos); }
|
||||
const LLTextSegment* getPreviousSegment() const;
|
||||
void getSelectedSegments(std::vector<LLTextSegmentPtr>& segments) const;
|
||||
@@ -308,7 +320,6 @@ protected:
|
||||
void updateTextRect();
|
||||
const LLRect& getTextRect() const { return mTextRect; }
|
||||
|
||||
void assignEmbedded(const std::string &s);
|
||||
BOOL truncate(); // Returns true if truncation occurs
|
||||
|
||||
void removeCharOrTab();
|
||||
@@ -364,9 +375,6 @@ protected:
|
||||
virtual llwchar pasteEmbeddedItem(llwchar ext_char) { return ext_char; }
|
||||
virtual void bindEmbeddedChars(const LLFontGL* font) const {}
|
||||
virtual void unbindEmbeddedChars(const LLFontGL* font) const {}
|
||||
|
||||
S32 findHTMLToken(const std::string &line, S32 pos, BOOL reverse) const;
|
||||
BOOL findHTML(const std::string &line, S32 *begin, S32 *end) const;
|
||||
|
||||
// Abstract inner base class representing an undoable editor command.
|
||||
// Concrete sub-classes can be defined for operations such as insert, remove, etc.
|
||||
@@ -408,7 +416,6 @@ protected:
|
||||
void removeWord(bool prev);
|
||||
S32 insert(const S32 pos, const LLWString &wstr, const BOOL group_with_next_op);
|
||||
S32 remove(const S32 pos, const S32 length, const BOOL group_with_next_op);
|
||||
S32 append(const LLWString &wstr, const BOOL group_with_next_op);
|
||||
|
||||
// Direct operations
|
||||
S32 insertStringNoUndo(S32 pos, const LLWString &wstr); // returns num of chars actually inserted
|
||||
@@ -454,7 +461,6 @@ protected:
|
||||
|
||||
BOOL mParseHTML;
|
||||
BOOL mParseHighlights;
|
||||
std::string mHTML;
|
||||
|
||||
typedef std::vector<LLTextSegmentPtr> segment_list_t;
|
||||
segment_list_t mSegments;
|
||||
@@ -467,6 +473,10 @@ protected:
|
||||
void (*mOnScrollEndCallback)(void*);
|
||||
void *mOnScrollEndData;
|
||||
|
||||
// Used to check if user with given ID is avatar's friend
|
||||
static is_friend_signal_t* mIsFriendSignal;
|
||||
static is_blocked_signal_t* mIsObjectBlockedSignal;
|
||||
|
||||
LLWString mPreeditWString;
|
||||
LLWString mPreeditOverwrittenWString;
|
||||
std::vector<S32> mPreeditPositions;
|
||||
@@ -480,6 +490,8 @@ private:
|
||||
void pasteHelper(bool is_primary);
|
||||
void onKeyStroke();
|
||||
|
||||
void createDefaultSegment();
|
||||
void clearSegments();
|
||||
void updateSegments();
|
||||
void pruneSegments();
|
||||
|
||||
@@ -502,7 +514,7 @@ private:
|
||||
// Data
|
||||
//
|
||||
LLKeywords mKeywords;
|
||||
static LLColor4 mLinkColor;
|
||||
LLColor4* mLinkColor;
|
||||
|
||||
// Concrete LLTextCmd sub-classes used by the LLTextEditor base class
|
||||
class LLTextCmdInsert;
|
||||
@@ -615,6 +627,7 @@ public:
|
||||
LLTextSegment( const LLColor3& color, S32 start, S32 end );
|
||||
|
||||
S32 getStart() const { return mStart; }
|
||||
void setStart(S32 start) { mStart = start; }
|
||||
S32 getEnd() const { return mEnd; }
|
||||
void setEnd( S32 end ) { mEnd = end; }
|
||||
const LLColor4& getColor() const { return mStyle->getColor(); }
|
||||
@@ -623,9 +636,12 @@ public:
|
||||
void setStyle(const LLStyleSP &style) { mStyle = style; }
|
||||
void setIsDefault(BOOL b) { mIsDefault = b; }
|
||||
BOOL getIsDefault() const { return mIsDefault; }
|
||||
void setUnderlineOnHover(bool b) { mUnderlineOnHover = b; }
|
||||
void underlineOnHover(bool hover) { if (mUnderlineOnHover) mStyle->mUnderline = hover; }
|
||||
void setToken( LLKeywordToken* token ) { mToken = token; }
|
||||
LLKeywordToken* getToken() const { return mToken; }
|
||||
BOOL getToolTip( std::string& msg ) const;
|
||||
void setToolTip(const std::string& tooltip);
|
||||
|
||||
void dump() const;
|
||||
|
||||
@@ -643,6 +659,8 @@ private:
|
||||
S32 mEnd;
|
||||
LLKeywordToken* mToken;
|
||||
BOOL mIsDefault;
|
||||
bool mUnderlineOnHover = false;
|
||||
std::string mTooltip;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
|
||||
static LLRegisterWidget<LLUICtrl> r("ui_ctrl");
|
||||
|
||||
F32 LLUICtrl::sActiveControlTransparency = 1.0f;
|
||||
F32 LLUICtrl::sInactiveControlTransparency = 1.0f;
|
||||
|
||||
LLUICtrl::CallbackParam::CallbackParam()
|
||||
: name("name"),
|
||||
function_name("function"),
|
||||
@@ -94,25 +97,26 @@ const LLUICtrl::Params& LLUICtrl::getDefaultParams()
|
||||
|
||||
LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel)
|
||||
: LLView(p),
|
||||
mCommitSignal(nullptr),
|
||||
mValidateSignal(nullptr),
|
||||
mMouseEnterSignal(nullptr),
|
||||
mMouseLeaveSignal(nullptr),
|
||||
mMouseDownSignal(nullptr),
|
||||
mMouseUpSignal(nullptr),
|
||||
mRightMouseDownSignal(nullptr),
|
||||
mRightMouseUpSignal(nullptr),
|
||||
mDoubleClickSignal(nullptr),
|
||||
mViewModel(viewmodel),
|
||||
mEnabledControlVariable(nullptr),
|
||||
mDisabledControlVariable(nullptr),
|
||||
mMakeVisibleControlVariable(nullptr),
|
||||
mMakeInvisibleControlVariable(nullptr),
|
||||
mIsChrome(FALSE),
|
||||
mRequestsFront(p.requests_front),
|
||||
mTabStop(TRUE),
|
||||
mTentative(FALSE),
|
||||
mViewModel(viewmodel),
|
||||
mEnabledControlVariable(NULL),
|
||||
mDisabledControlVariable(NULL),
|
||||
mMakeVisibleControlVariable(NULL),
|
||||
mMakeInvisibleControlVariable(NULL),
|
||||
mCommitSignal(NULL),
|
||||
mValidateSignal(NULL),
|
||||
mMouseEnterSignal(NULL),
|
||||
mMouseLeaveSignal(NULL),
|
||||
mMouseDownSignal(NULL),
|
||||
mMouseUpSignal(NULL),
|
||||
mRightMouseDownSignal(NULL),
|
||||
mRightMouseUpSignal(NULL),
|
||||
mDoubleClickSignal(NULL),
|
||||
mCommitOnReturn(FALSE)
|
||||
mCommitOnReturn(FALSE),
|
||||
mTransparencyType(TT_DEFAULT)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -210,20 +214,21 @@ LLUICtrl::LLUICtrl(const std::string& name, const LLRect rect, BOOL mouse_opaque
|
||||
mTabStop( TRUE ),
|
||||
mTentative( FALSE ),
|
||||
mViewModel(LLViewModelPtr(new LLViewModel)),
|
||||
mEnabledControlVariable(NULL),
|
||||
mDisabledControlVariable(NULL),
|
||||
mMakeVisibleControlVariable(NULL),
|
||||
mMakeInvisibleControlVariable(NULL),
|
||||
mCommitSignal(NULL),
|
||||
mValidateSignal(NULL),
|
||||
mMouseEnterSignal(NULL),
|
||||
mMouseLeaveSignal(NULL),
|
||||
mMouseDownSignal(NULL),
|
||||
mMouseUpSignal(NULL),
|
||||
mRightMouseDownSignal(NULL),
|
||||
mRightMouseUpSignal(NULL),
|
||||
mDoubleClickSignal(NULL),
|
||||
mCommitOnReturn(FALSE)
|
||||
mEnabledControlVariable(nullptr),
|
||||
mDisabledControlVariable(nullptr),
|
||||
mMakeVisibleControlVariable(nullptr),
|
||||
mMakeInvisibleControlVariable(nullptr),
|
||||
mCommitSignal(nullptr),
|
||||
mValidateSignal(nullptr),
|
||||
mMouseEnterSignal(nullptr),
|
||||
mMouseLeaveSignal(nullptr),
|
||||
mMouseDownSignal(nullptr),
|
||||
mMouseUpSignal(nullptr),
|
||||
mRightMouseDownSignal(nullptr),
|
||||
mRightMouseUpSignal(nullptr),
|
||||
mDoubleClickSignal(nullptr),
|
||||
mCommitOnReturn(FALSE),
|
||||
mTransparencyType(TT_DEFAULT)
|
||||
{
|
||||
if(commit_callback)
|
||||
setCommitCallback(commit_callback);
|
||||
@@ -338,6 +343,8 @@ BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
(*mMouseDownSignal)(this,x,y,mask);
|
||||
}
|
||||
LL_DEBUGS() << "LLUICtrl::handleMousedown - handled is returning as: " << handled << " " << LL_ENDL;
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
||||
@@ -349,6 +356,7 @@ BOOL LLUICtrl::handleMouseUp(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
(*mMouseUpSignal)(this,x,y,mask);
|
||||
}
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
||||
@@ -466,7 +474,7 @@ void LLUICtrl::setEnabledControlVariable(LLControlVariable* control)
|
||||
if (mEnabledControlVariable)
|
||||
{
|
||||
mEnabledControlConnection.disconnect(); // disconnect current signal
|
||||
mEnabledControlVariable = NULL;
|
||||
mEnabledControlVariable = nullptr;
|
||||
}
|
||||
if (control)
|
||||
{
|
||||
@@ -481,7 +489,7 @@ void LLUICtrl::setDisabledControlVariable(LLControlVariable* control)
|
||||
if (mDisabledControlVariable)
|
||||
{
|
||||
mDisabledControlConnection.disconnect(); // disconnect current signal
|
||||
mDisabledControlVariable = NULL;
|
||||
mDisabledControlVariable = nullptr;
|
||||
}
|
||||
if (control)
|
||||
{
|
||||
@@ -496,7 +504,7 @@ void LLUICtrl::setMakeVisibleControlVariable(LLControlVariable* control)
|
||||
if (mMakeVisibleControlVariable)
|
||||
{
|
||||
mMakeVisibleControlConnection.disconnect(); // disconnect current signal
|
||||
mMakeVisibleControlVariable = NULL;
|
||||
mMakeVisibleControlVariable = nullptr;
|
||||
}
|
||||
if (control)
|
||||
{
|
||||
@@ -511,7 +519,7 @@ void LLUICtrl::setMakeInvisibleControlVariable(LLControlVariable* control)
|
||||
if (mMakeInvisibleControlVariable)
|
||||
{
|
||||
mMakeInvisibleControlConnection.disconnect(); // disconnect current signal
|
||||
mMakeInvisibleControlVariable = NULL;
|
||||
mMakeInvisibleControlVariable = nullptr;
|
||||
}
|
||||
if (control)
|
||||
{
|
||||
@@ -526,7 +534,12 @@ bool LLUICtrl::controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle,
|
||||
LLUICtrl* ctrl = handle.get();
|
||||
if (ctrl)
|
||||
{
|
||||
if (type == "enabled")
|
||||
if (type == "value")
|
||||
{
|
||||
ctrl->setValue(newvalue);
|
||||
return true;
|
||||
}
|
||||
else if (type == "enabled")
|
||||
{
|
||||
ctrl->setEnabled(newvalue.asBoolean());
|
||||
return true;
|
||||
@@ -565,19 +578,19 @@ BOOL LLUICtrl::setLabelArg( const std::string& key, const LLStringExplicit& text
|
||||
// virtual
|
||||
LLCtrlSelectionInterface* LLUICtrl::getSelectionInterface()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLCtrlListInterface* LLUICtrl::getListInterface()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLCtrlScrollInterface* LLUICtrl::getScrollInterface()
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BOOL LLUICtrl::hasFocus() const
|
||||
@@ -603,7 +616,7 @@ void LLUICtrl::setFocus(BOOL b)
|
||||
{
|
||||
if( gFocusMgr.childHasKeyboardFocus(this))
|
||||
{
|
||||
gFocusMgr.setKeyboardFocus( NULL );
|
||||
gFocusMgr.setKeyboardFocus(nullptr );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1008,11 +1021,11 @@ LLUICtrl* LLUICtrl::getParentUICtrl() const
|
||||
}
|
||||
|
||||
// *TODO: Deprecate; for backwards compatability only:
|
||||
boost::signals2::connection LLUICtrl::setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data)
|
||||
boost::signals2::connection LLUICtrl::setCommitCallback( std::function<void (LLUICtrl*,void*)> cb, void* data)
|
||||
{
|
||||
return setCommitCallback( boost::bind(cb, _1, data));
|
||||
}
|
||||
boost::signals2::connection LLUICtrl::setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb )
|
||||
boost::signals2::connection LLUICtrl::setValidateBeforeCommit( std::function<bool (const LLSD& data)> cb )
|
||||
{
|
||||
if (!mValidateSignal) mValidateSignal = new enable_signal_t();
|
||||
return mValidateSignal->connect(boost::bind(cb, _2));
|
||||
@@ -1030,7 +1043,6 @@ BOOL LLUICtrl::getTentative() const
|
||||
return mTentative;
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
void LLUICtrl::setColor(const LLColor4& color)
|
||||
{ }
|
||||
@@ -1047,6 +1059,37 @@ void LLUICtrl::setMinValue(LLSD min_value)
|
||||
void LLUICtrl::setMaxValue(LLSD max_value)
|
||||
{ }
|
||||
|
||||
F32 LLUICtrl::getCurrentTransparency()
|
||||
{
|
||||
F32 alpha = 0;
|
||||
|
||||
switch(mTransparencyType)
|
||||
{
|
||||
case TT_DEFAULT:
|
||||
alpha = getDrawContext().mAlpha;
|
||||
break;
|
||||
|
||||
case TT_ACTIVE:
|
||||
alpha = sActiveControlTransparency;
|
||||
break;
|
||||
|
||||
case TT_INACTIVE:
|
||||
alpha = sInactiveControlTransparency;
|
||||
break;
|
||||
|
||||
case TT_FADING:
|
||||
alpha = sInactiveControlTransparency / 2.f;
|
||||
break;
|
||||
}
|
||||
|
||||
return alpha;
|
||||
}
|
||||
|
||||
void LLUICtrl::setTransparencyType(ETypeTransparency type)
|
||||
{
|
||||
mTransparencyType = type;
|
||||
}
|
||||
|
||||
boost::signals2::connection LLUICtrl::setCommitCallback(const CommitCallbackParam& cb)
|
||||
{
|
||||
return setCommitCallback(initCommitCallback(cb));
|
||||
|
||||
@@ -34,16 +34,11 @@
|
||||
#ifndef LL_LLUICTRL_H
|
||||
#define LL_LLUICTRL_H
|
||||
|
||||
//#include "llboost.h"
|
||||
#include "llrect.h"
|
||||
#include "llsd.h"
|
||||
#include "llregistry.h"
|
||||
|
||||
#ifndef BOOST_FUNCTION_HPP_INCLUDED
|
||||
#include <boost/function.hpp>
|
||||
#define BOOST_FUNCTION_HPP_INCLUDED
|
||||
#endif
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
#include "llinitparam.h"
|
||||
#include "llview.h"
|
||||
#include "llviewmodel.h" // *TODO move dependency to .cpp file
|
||||
@@ -128,6 +123,13 @@ public:
|
||||
Params();
|
||||
};
|
||||
|
||||
enum ETypeTransparency
|
||||
{
|
||||
TT_DEFAULT,
|
||||
TT_ACTIVE, // focused floater
|
||||
TT_INACTIVE, // other floaters
|
||||
TT_FADING, // fading toast
|
||||
};
|
||||
/*virtual*/ ~LLUICtrl();
|
||||
|
||||
void initFromParams(const Params& p);
|
||||
@@ -147,26 +149,26 @@ public:
|
||||
// We shouldn't ever need to set this directly
|
||||
//virtual void setViewModel(const LLViewModelPtr&);
|
||||
|
||||
virtual BOOL postBuild();
|
||||
BOOL postBuild() override;
|
||||
|
||||
public:
|
||||
// LLView interface
|
||||
/*virtual*/ void initFromXML(LLXMLNodePtr node, LLView* parent);
|
||||
/*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const;
|
||||
/*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text );
|
||||
/*virtual*/ BOOL isCtrl() const;
|
||||
/*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL canFocusChildren() const;
|
||||
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ) override;
|
||||
/*virtual*/ BOOL isCtrl() const override;
|
||||
/*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask) override;
|
||||
/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override;
|
||||
/*virtual*/ BOOL canFocusChildren() const override;
|
||||
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override;
|
||||
/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override;
|
||||
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override;
|
||||
/*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override;
|
||||
/*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override;
|
||||
|
||||
// From LLFocusableElement
|
||||
/*virtual*/ void setFocus( BOOL b );
|
||||
/*virtual*/ BOOL hasFocus() const;
|
||||
/*virtual*/ void setFocus( BOOL b ) override;
|
||||
/*virtual*/ BOOL hasFocus() const override;
|
||||
|
||||
// New virtuals
|
||||
|
||||
@@ -207,11 +209,17 @@ public:
|
||||
// Clear any user-provided input (text in a text editor, checked checkbox,
|
||||
// selected radio button, etc.). Defaults to no-op.
|
||||
virtual void clear();
|
||||
|
||||
virtual void setColor(const LLColor4& color);
|
||||
virtual void setAlpha(F32 alpha);
|
||||
virtual void setMinValue(LLSD min_value);
|
||||
virtual void setMaxValue(LLSD max_value);
|
||||
|
||||
F32 getCurrentTransparency();
|
||||
|
||||
void setTransparencyType(ETypeTransparency type);
|
||||
ETypeTransparency getTransparencyType() const {return mTransparencyType;}
|
||||
|
||||
BOOL focusNextItem(BOOL text_entry_only);
|
||||
BOOL focusPrevItem(BOOL text_entry_only);
|
||||
virtual // Singu Note: focusFirstItem is overridden for our old chat ui to prevent focusing on topmost uictrls.
|
||||
@@ -248,8 +256,8 @@ public:
|
||||
boost::signals2::connection setDoubleClickCallback( const mouse_signal_t::slot_type& cb );
|
||||
|
||||
// *TODO: Deprecate; for backwards compatability only:
|
||||
boost::signals2::connection setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data);
|
||||
boost::signals2::connection setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb );
|
||||
boost::signals2::connection setCommitCallback( std::function<void (LLUICtrl*,void*)> cb, void* data);
|
||||
boost::signals2::connection setValidateBeforeCommit( std::function<bool (const LLSD& data)> cb );
|
||||
|
||||
static LLView* fromXML(LLXMLNodePtr node, LLView* parent, class LLUICtrlFactory* factory);
|
||||
|
||||
@@ -266,9 +274,13 @@ public:
|
||||
template <typename F, typename DERIVED> class CallbackRegistry : public LLRegistrySingleton<std::string, F, DERIVED >
|
||||
{};
|
||||
|
||||
class CommitCallbackRegistry : public CallbackRegistry<commit_callback_t, CommitCallbackRegistry>{};
|
||||
class CommitCallbackRegistry : public CallbackRegistry<commit_callback_t, CommitCallbackRegistry>
|
||||
{
|
||||
};
|
||||
// the enable callback registry is also used for visiblity callbacks
|
||||
class EnableCallbackRegistry : public CallbackRegistry<enable_callback_t, EnableCallbackRegistry>{};
|
||||
class EnableCallbackRegistry : public CallbackRegistry<enable_callback_t, EnableCallbackRegistry>
|
||||
{
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
@@ -297,6 +309,10 @@ protected:
|
||||
boost::signals2::connection mMakeVisibleControlConnection;
|
||||
LLControlVariable* mMakeInvisibleControlVariable;
|
||||
boost::signals2::connection mMakeInvisibleControlConnection;
|
||||
|
||||
static F32 sActiveControlTransparency;
|
||||
static F32 sInactiveControlTransparency;
|
||||
|
||||
private:
|
||||
|
||||
BOOL mIsChrome;
|
||||
@@ -304,6 +320,8 @@ private:
|
||||
BOOL mTabStop;
|
||||
BOOL mTentative;
|
||||
|
||||
ETypeTransparency mTransparencyType;
|
||||
|
||||
bool mCommitOnReturn;
|
||||
|
||||
class DefaultTabGroupFirstSorter;
|
||||
|
||||
@@ -412,13 +412,13 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const std::string &filename, LLView* parent
|
||||
}
|
||||
|
||||
// root must be called panel
|
||||
if( !root->hasName( "menu_bar" ) && !root->hasName( "menu" ))
|
||||
if( !root->hasName( "menu_bar" ) && !root->hasName( "menu" ) && !root->hasName("context_menu"))
|
||||
{
|
||||
LL_WARNS() << "Root node should be named menu bar or menu in : " << filename << LL_ENDL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (root->hasName("menu"))
|
||||
if (root->hasName("menu") || root->hasName("context_menu"))
|
||||
{
|
||||
menu = (LLMenuGL*)LLMenuGL::fromXML(root, parentp, this);
|
||||
}
|
||||
@@ -496,7 +496,7 @@ void LLUICtrlFactory::rebuild()
|
||||
panelp->setFocus(FALSE);
|
||||
panelp->deleteAllChildren();
|
||||
|
||||
buildPanel(panelp, filename.c_str(), &panelp->getFactoryMap());
|
||||
buildPanel(panelp, filename, &panelp->getFactoryMap());
|
||||
panelp->setVisible(visible);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
/**
|
||||
* @file llurlaction.cpp
|
||||
* @author Martin Reddy
|
||||
@@ -24,7 +26,6 @@
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llurlaction.h"
|
||||
@@ -32,6 +33,7 @@
|
||||
#include "llwindow.h"
|
||||
#include "llurlregistry.h"
|
||||
|
||||
|
||||
// global state for the callback functions
|
||||
LLUrlAction::url_callback_t LLUrlAction::sOpenURLCallback;
|
||||
LLUrlAction::url_callback_t LLUrlAction::sOpenURLInternalCallback;
|
||||
@@ -83,18 +85,19 @@ void LLUrlAction::openURLExternal(std::string url)
|
||||
}
|
||||
}
|
||||
|
||||
void LLUrlAction::executeSLURL(std::string url)
|
||||
bool LLUrlAction::executeSLURL(std::string url, bool trusted_content)
|
||||
{
|
||||
if (sExecuteSLURLCallback)
|
||||
{
|
||||
sExecuteSLURLCallback(url);
|
||||
return sExecuteSLURLCallback(url, trusted_content);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLUrlAction::clickAction(std::string url)
|
||||
void LLUrlAction::clickAction(std::string url, bool trusted_content)
|
||||
{
|
||||
// Try to handle as SLURL first, then http Url
|
||||
if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url) )
|
||||
if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url, trusted_content) )
|
||||
{
|
||||
if (sOpenURLCallback)
|
||||
{
|
||||
@@ -157,3 +160,86 @@ void LLUrlAction::showProfile(std::string url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string LLUrlAction::getUserID(std::string url)
|
||||
{
|
||||
LLURI uri(url);
|
||||
LLSD path_array = uri.pathArray();
|
||||
std::string id_str;
|
||||
if (path_array.size() == 4)
|
||||
{
|
||||
id_str = path_array.get(2).asString();
|
||||
}
|
||||
return id_str;
|
||||
}
|
||||
|
||||
std::string LLUrlAction::getObjectId(std::string url)
|
||||
{
|
||||
LLURI uri(url);
|
||||
LLSD path_array = uri.pathArray();
|
||||
std::string id_str;
|
||||
if (path_array.size() >= 3)
|
||||
{
|
||||
id_str = path_array.get(2).asString();
|
||||
}
|
||||
return id_str;
|
||||
}
|
||||
|
||||
std::string LLUrlAction::getObjectName(std::string url)
|
||||
{
|
||||
LLURI uri(url);
|
||||
LLSD query_map = uri.queryMap();
|
||||
std::string name;
|
||||
if (query_map.has("name"))
|
||||
{
|
||||
name = query_map["name"].asString();
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
void LLUrlAction::sendIM(std::string url)
|
||||
{
|
||||
std::string id_str = getUserID(url);
|
||||
if (LLUUID::validate(id_str))
|
||||
{
|
||||
executeSLURL("secondlife:///app/agent/" + id_str + "/im");
|
||||
}
|
||||
}
|
||||
|
||||
void LLUrlAction::addFriend(std::string url)
|
||||
{
|
||||
std::string id_str = getUserID(url);
|
||||
if (LLUUID::validate(id_str))
|
||||
{
|
||||
executeSLURL("secondlife:///app/agent/" + id_str + "/requestfriend");
|
||||
}
|
||||
}
|
||||
|
||||
void LLUrlAction::removeFriend(std::string url)
|
||||
{
|
||||
std::string id_str = getUserID(url);
|
||||
if (LLUUID::validate(id_str))
|
||||
{
|
||||
executeSLURL("secondlife:///app/agent/" + id_str + "/removefriend");
|
||||
}
|
||||
}
|
||||
|
||||
void LLUrlAction::blockObject(std::string url)
|
||||
{
|
||||
std::string object_id = getObjectId(url);
|
||||
std::string object_name = getObjectName(url);
|
||||
if (LLUUID::validate(object_id))
|
||||
{
|
||||
executeSLURL("secondlife:///app/agent/" + object_id + "/block/" + LLURI::escape(object_name));
|
||||
}
|
||||
}
|
||||
|
||||
void LLUrlAction::unblockObject(std::string url)
|
||||
{
|
||||
std::string object_id = getObjectId(url);
|
||||
std::string object_name = getObjectName(url);
|
||||
if (LLUUID::validate(object_id))
|
||||
{
|
||||
executeSLURL("secondlife:///app/agent/" + object_id + "/unblock/" + object_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,11 +28,7 @@
|
||||
#ifndef LL_LLURLACTION_H
|
||||
#define LL_LLURLACTION_H
|
||||
|
||||
#include <string>
|
||||
#ifndef BOOST_FUNCTION_HPP_INCLUDED
|
||||
#include <boost/function.hpp>
|
||||
#define BOOST_FUNCTION_HPP_INCLUDED
|
||||
#endif
|
||||
#include <functional>
|
||||
|
||||
///
|
||||
/// The LLUrlAction class provides a number of static functions that
|
||||
@@ -60,7 +56,7 @@ public:
|
||||
static void openURLExternal(std::string url);
|
||||
|
||||
/// execute the given secondlife: SLURL
|
||||
static void executeSLURL(std::string url);
|
||||
static bool executeSLURL(std::string url, bool trusted_content = true);
|
||||
|
||||
/// if the Url specifies an SL location, teleport there
|
||||
static void teleportToLocation(std::string url);
|
||||
@@ -69,7 +65,7 @@ public:
|
||||
static void showLocationOnMap(std::string url);
|
||||
|
||||
/// perform the appropriate action for left-clicking on a Url
|
||||
static void clickAction(std::string url);
|
||||
static void clickAction(std::string url, bool trusted_content);
|
||||
|
||||
/// copy the label for a Url to the clipboard
|
||||
static void copyLabelToClipboard(std::string url);
|
||||
@@ -79,10 +75,18 @@ public:
|
||||
|
||||
/// if the Url specifies an SL command in the form like 'app/{cmd}/{id}/*', show its profile
|
||||
static void showProfile(std::string url);
|
||||
static std::string getUserID(std::string url);
|
||||
static std::string getObjectName(std::string url);
|
||||
static std::string getObjectId(std::string url);
|
||||
static void sendIM(std::string url);
|
||||
static void addFriend(std::string url);
|
||||
static void removeFriend(std::string url);
|
||||
static void blockObject(std::string url);
|
||||
static void unblockObject(std::string url);
|
||||
|
||||
/// specify the callbacks to enable this class's functionality
|
||||
typedef boost::function<void (const std::string&)> url_callback_t;
|
||||
typedef boost::function<bool(const std::string& url)> execute_url_callback_t;
|
||||
typedef std::function<void (const std::string&)> url_callback_t;
|
||||
typedef std::function<bool(const std::string& url, bool trusted_content)> execute_url_callback_t;
|
||||
|
||||
static void setOpenURLCallback(url_callback_t cb);
|
||||
static void setOpenURLInternalCallback(url_callback_t cb);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
/**
|
||||
* @file llurlentry.cpp
|
||||
* @author Martin Reddy
|
||||
@@ -31,6 +33,7 @@
|
||||
#include "lluri.h"
|
||||
#include "llurlmatch.h"
|
||||
#include "llurlregistry.h"
|
||||
#include "lluriparser.h"
|
||||
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llcachename.h"
|
||||
@@ -38,14 +41,18 @@
|
||||
//#include "lluicolortable.h"
|
||||
#include "message.h"
|
||||
|
||||
#define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))"
|
||||
#include <boost/format.hpp> // <alchemy/>
|
||||
|
||||
#define APP_HEADER_REGEX "((((x-grid-info://)|(x-grid-location-info://))[-\\w\\.]+(:\\d+)?/app)|(secondlife:///app))"
|
||||
#define X_GRID_OR_SECONDLIFE_HEADER_REGEX "((((x-grid-info://)|(x-grid-location-info://))[-\\w\\.]+(:\\d+)?/)|(secondlife://))"
|
||||
|
||||
// Utility functions
|
||||
std::string localize_slapp_label(const std::string& url, const std::string& full_name);
|
||||
|
||||
|
||||
LLUrlEntryBase::LLUrlEntryBase()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
LLUrlEntryBase::~LLUrlEntryBase()
|
||||
{
|
||||
@@ -62,14 +69,13 @@ std::string LLUrlEntryBase::getIcon(const std::string &url)
|
||||
return mIcon;
|
||||
}
|
||||
|
||||
/*LLStyle::Params LLUrlEntryBase::getStyle() const
|
||||
LLStyleSP LLUrlEntryBase::getStyle() const
|
||||
{
|
||||
LLStyle::Params style_params;
|
||||
style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
style_params.font.style = "UNDERLINE";
|
||||
static LLUICachedControl<LLColor4> color("HTMLLinkColor");
|
||||
LLStyleSP style_params(new LLStyle(true, color, LLStringUtil::null));
|
||||
//style_params->mUnderline = true; // Singu Note: We're not gonna bother here, underlining on hover
|
||||
return style_params;
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
std::string LLUrlEntryBase::getIDStringFromUrl(const std::string &url) const
|
||||
@@ -111,7 +117,7 @@ std::string LLUrlEntryBase::getLabelFromWikiLink(const std::string &url) const
|
||||
{
|
||||
// return the label part from [http://www.example.org Label]
|
||||
const char *text = url.c_str();
|
||||
S32 start = 0;
|
||||
size_t start = 0;
|
||||
while (! isspace(text[start]))
|
||||
{
|
||||
start++;
|
||||
@@ -127,7 +133,7 @@ std::string LLUrlEntryBase::getUrlFromWikiLink(const std::string &string) const
|
||||
{
|
||||
// return the url part from [http://www.example.org Label]
|
||||
const char *text = string.c_str();
|
||||
S32 end = 0;
|
||||
size_t end = 0;
|
||||
while (! isspace(text[end]))
|
||||
{
|
||||
end++;
|
||||
@@ -142,11 +148,14 @@ void LLUrlEntryBase::addObserver(const std::string &id,
|
||||
// add a callback to be notified when we have a label for the uuid
|
||||
LLUrlEntryObserver observer;
|
||||
observer.url = url;
|
||||
observer.signal = new LLUrlLabelSignal();
|
||||
if (observer.signal)
|
||||
try
|
||||
{
|
||||
observer.signal = new LLUrlLabelSignal();
|
||||
observer.signal->connect(cb);
|
||||
mObservers.insert(std::pair<std::string, LLUrlEntryObserver>(id, observer));
|
||||
mObservers.emplace(id, observer);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,12 +187,49 @@ bool LLUrlEntryBase::isLinkDisabled() const
|
||||
return globally_disabled;
|
||||
}
|
||||
|
||||
static std::string getStringAfterToken(const std::string str, const std::string token)
|
||||
bool LLUrlEntryBase::isWikiLinkCorrect(const std::string& url)
|
||||
{
|
||||
LLWString label = utf8str_to_wstring(getLabelFromWikiLink(url));
|
||||
label.erase(std::remove(label.begin(), label.end(), L'\u200B'), label.end());
|
||||
return (LLUrlRegistry::instance().hasUrl(wstring_to_utf8str(label))) ? false : true;
|
||||
}
|
||||
|
||||
std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const
|
||||
{
|
||||
LLUriParser up(unescapeUrl(url));
|
||||
up.normalize();
|
||||
|
||||
std::string label;
|
||||
up.extractParts();
|
||||
up.glueFirst(label);
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const
|
||||
{
|
||||
LLUriParser up(unescapeUrl(url));
|
||||
|
||||
std::string label;
|
||||
up.extractParts();
|
||||
up.glueFirst(label, false);
|
||||
|
||||
size_t pos = url.find(label);
|
||||
if (pos == std::string::npos)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
pos += label.size();
|
||||
return url.substr(pos);
|
||||
}
|
||||
|
||||
|
||||
static std::string getStringAfterToken(const std::string& str, const std::string& token)
|
||||
{
|
||||
size_t pos = str.find(token);
|
||||
if (pos == std::string::npos)
|
||||
{
|
||||
return "";
|
||||
return std::string();
|
||||
}
|
||||
|
||||
pos += token.size();
|
||||
@@ -194,8 +240,9 @@ static std::string getStringAfterToken(const std::string str, const std::string
|
||||
// LLUrlEntryHTTP Describes generic http: and https: Urls
|
||||
//
|
||||
LLUrlEntryHTTP::LLUrlEntryHTTP()
|
||||
: LLUrlEntryBase()
|
||||
{
|
||||
mPattern = boost::regex("https?://([-\\w\\.]+)+(:\\d+)?(:\\w+)?(@\\d+)?(@\\w+)?/?\\S*",
|
||||
mPattern = boost::regex("https?://([^\\s/?\\.#]+\\.?)+\\.\\w+(:\\d+)?(/\\S*)?",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_http.xml";
|
||||
mTooltip = LLTrans::getString("TooltipHttpUrl");
|
||||
@@ -206,6 +253,20 @@ std::string LLUrlEntryHTTP::getLabel(const std::string &url, const LLUrlLabelCal
|
||||
return unescapeUrl(url);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryHTTP::getUrl(const std::string &string) const
|
||||
{
|
||||
if (string.find("://") == std::string::npos)
|
||||
{
|
||||
return "http://" + escapeUrl(string);
|
||||
}
|
||||
return escapeUrl(string);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryHTTP::getTooltip(const std::string &url) const
|
||||
{
|
||||
return mTooltip;;
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntryHTTP Describes generic http: and https: Urls with custom label
|
||||
// We use the wikipedia syntax of [http://www.example.org Text]
|
||||
@@ -238,20 +299,22 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string) const
|
||||
// LLUrlEntryHTTPNoProtocol Describes generic Urls like www.google.com
|
||||
//
|
||||
LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol()
|
||||
: LLUrlEntryBase()
|
||||
{
|
||||
mPattern = boost::regex("("
|
||||
"\\bwww\\.\\S+\\.\\S+" // i.e. www.FOO.BAR
|
||||
"|" // or
|
||||
"(?<!@)\\b[^[:space:]:@/>]+\\.(?:com|net|edu|org)([/:][^[:space:]<]*)?\\b" // i.e. FOO.net
|
||||
")",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mPattern = boost::regex("\\bwww\\.\\S+\\.([^\\s<]*)?\\b", // i.e. www.FOO.BAR
|
||||
boost::regex::perl | boost::regex::icase);
|
||||
mMenuName = "menu_url_http.xml";
|
||||
mTooltip = LLTrans::getString("TooltipHttpUrl");
|
||||
}
|
||||
|
||||
std::string LLUrlEntryHTTPNoProtocol::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
|
||||
{
|
||||
return unescapeUrl(url);
|
||||
return urlToLabelWithGreyQuery(url);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryHTTPNoProtocol::getQuery(const std::string &url) const
|
||||
{
|
||||
return urlToGreyQuery(url);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryHTTPNoProtocol::getUrl(const std::string &string) const
|
||||
@@ -263,6 +326,95 @@ std::string LLUrlEntryHTTPNoProtocol::getUrl(const std::string &string) const
|
||||
return escapeUrl(string);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryHTTPNoProtocol::getTooltip(const std::string &url) const
|
||||
{
|
||||
return unescapeUrl(url);
|
||||
}
|
||||
|
||||
LLUrlEntryInvalidSLURL::LLUrlEntryInvalidSLURL()
|
||||
: LLUrlEntryBase()
|
||||
{
|
||||
mPattern = boost::regex("(http://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_http.xml";
|
||||
mTooltip = LLTrans::getString("TooltipHttpUrl");
|
||||
}
|
||||
|
||||
std::string LLUrlEntryInvalidSLURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
|
||||
{
|
||||
|
||||
return escapeUrl(url);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryInvalidSLURL::getUrl(const std::string &string) const
|
||||
{
|
||||
return escapeUrl(string);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryInvalidSLURL::getTooltip(const std::string &url) const
|
||||
{
|
||||
return unescapeUrl(url);
|
||||
}
|
||||
|
||||
bool LLUrlEntryInvalidSLURL::isSLURLvalid(const std::string &url) const
|
||||
{
|
||||
S32 actual_parts;
|
||||
|
||||
if(url.find(".com/secondlife/") != std::string::npos)
|
||||
{
|
||||
actual_parts = 5;
|
||||
}
|
||||
else if(url.find("/app/") != std::string::npos)
|
||||
{
|
||||
actual_parts = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
actual_parts = 3;
|
||||
}
|
||||
|
||||
LLURI uri(url);
|
||||
LLSD path_array = uri.pathArray();
|
||||
S32 path_parts = path_array.size();
|
||||
S32 x,y,z;
|
||||
|
||||
if (path_parts == actual_parts)
|
||||
{
|
||||
// handle slurl with (X,Y,Z) coordinates
|
||||
LLStringUtil::convertToS32(path_array[path_parts-3],x);
|
||||
LLStringUtil::convertToS32(path_array[path_parts-2],y);
|
||||
LLStringUtil::convertToS32(path_array[path_parts-1],z);
|
||||
|
||||
if((x>= 0 && x<= 256) && (y>= 0 && y<= 256) && (z>= 0))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (path_parts == (actual_parts-1))
|
||||
{
|
||||
// handle slurl with (X,Y) coordinates
|
||||
|
||||
LLStringUtil::convertToS32(path_array[path_parts-2],x);
|
||||
LLStringUtil::convertToS32(path_array[path_parts-1],y);
|
||||
;
|
||||
if((x>= 0 && x<= 256) && (y>= 0 && y<= 256))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else if (path_parts == (actual_parts-2))
|
||||
{
|
||||
// handle slurl with (X) coordinate
|
||||
LLStringUtil::convertToS32(path_array[path_parts-1],x);
|
||||
if(x>= 0 && x<= 256)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntrySLURL Describes generic http: and https: Urls
|
||||
//
|
||||
@@ -284,6 +436,7 @@ std::string LLUrlEntrySLURL::getLabel(const std::string &url, const LLUrlLabelCa
|
||||
// - http://slurl.com/secondlife/Place/X
|
||||
// - http://slurl.com/secondlife/Place
|
||||
//
|
||||
|
||||
LLURI uri(url);
|
||||
LLSD path_array = uri.pathArray();
|
||||
S32 path_parts = path_array.size();
|
||||
@@ -335,13 +488,62 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
|
||||
return url.substr(pos, url.size() - pos);
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntrySeconlifeURL Describes *secondlife.com/ and *lindenlab.com/ urls to substitute icon 'hand.png' before link
|
||||
//
|
||||
LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL()
|
||||
{
|
||||
mPattern = boost::regex("\\b(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?(/\\S*)?",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
|
||||
mIcon = "Hand";
|
||||
mMenuName = "menu_url_http.xml";
|
||||
mTooltip = LLTrans::getString("TooltipHttpUrl");
|
||||
}
|
||||
|
||||
/// Return the url from a string that matched the regex
|
||||
std::string LLUrlEntrySecondlifeURL::getUrl(const std::string &string) const
|
||||
{
|
||||
if (string.find("://") == std::string::npos)
|
||||
{
|
||||
return "https://" + escapeUrl(string);
|
||||
}
|
||||
return escapeUrl(string);
|
||||
}
|
||||
|
||||
std::string LLUrlEntrySecondlifeURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
|
||||
{
|
||||
return urlToLabelWithGreyQuery(url);
|
||||
}
|
||||
|
||||
std::string LLUrlEntrySecondlifeURL::getQuery(const std::string &url) const
|
||||
{
|
||||
return urlToGreyQuery(url);
|
||||
}
|
||||
|
||||
std::string LLUrlEntrySecondlifeURL::getTooltip(const std::string &url) const
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntrySimpleSecondlifeURL Describes *secondlife.com and *lindenlab.com urls to substitute icon 'hand.png' before link
|
||||
//
|
||||
LLUrlEntrySimpleSecondlifeURL::LLUrlEntrySimpleSecondlifeURL()
|
||||
{
|
||||
mPattern = boost::regex("(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(?!\\S)",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
|
||||
mIcon = "Hand";
|
||||
mMenuName = "menu_url_http.xml";
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntryAgent Describes a Second Life agent Url, e.g.,
|
||||
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
|
||||
// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
|
||||
// x-grid-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
|
||||
//
|
||||
LLUrlEntryAgent::LLUrlEntryAgent() :
|
||||
mAvatarNameCacheConnection()
|
||||
LLUrlEntryAgent::LLUrlEntryAgent()
|
||||
{
|
||||
mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/\\w+",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
@@ -372,7 +574,15 @@ void LLUrlEntryAgent::callObservers(const std::string &id,
|
||||
void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id,
|
||||
const LLAvatarName& av_name)
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
auto range = mAvatarNameCacheConnections.equal_range(id);
|
||||
for (auto it = range.first; it != range.second; ++it)
|
||||
{
|
||||
if (it->second.connected())
|
||||
{
|
||||
it->second.disconnect();
|
||||
}
|
||||
}
|
||||
mAvatarNameCacheConnections.erase(range.first, range.second);
|
||||
|
||||
std::string label = av_name.getCompleteName();
|
||||
|
||||
@@ -459,23 +669,19 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mAvatarNameCacheConnection.connected())
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
}
|
||||
mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgent::onAvatarNameCache, this, _1, _2));
|
||||
auto connection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgent::onAvatarNameCache, this, _1, _2));
|
||||
mAvatarNameCacheConnections.emplace(agent_id, connection);
|
||||
addObserver(agent_id_string, url, cb);
|
||||
return LLTrans::getString("LoadingData");
|
||||
}
|
||||
}
|
||||
|
||||
/*LLStyle::Params LLUrlEntryAgent::getStyle() const
|
||||
LLStyleSP LLUrlEntryAgent::getStyle() const
|
||||
{
|
||||
LLStyle::Params style_params = LLUrlEntryBase::getStyle();
|
||||
style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
static LLUICachedControl<LLColor4> color("HTMLAgentColor");
|
||||
LLStyleSP style_params(new LLStyle(true, color, LLStringUtil::null));
|
||||
return style_params;
|
||||
}*/
|
||||
}
|
||||
|
||||
std::string localize_slapp_label(const std::string& url, const std::string& full_name)
|
||||
{
|
||||
@@ -522,16 +728,25 @@ std::string LLUrlEntryAgent::getIcon(const std::string &url)
|
||||
//
|
||||
// LLUrlEntryAgentName describes a Second Life agent name Url, e.g.,
|
||||
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username)
|
||||
// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username)
|
||||
// x-grid-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username)
|
||||
//
|
||||
LLUrlEntryAgentName::LLUrlEntryAgentName() :
|
||||
mAvatarNameCacheConnection()
|
||||
{}
|
||||
LLUrlEntryAgentName::LLUrlEntryAgentName()
|
||||
{
|
||||
mMenuName = "menu_url_agent.xml";
|
||||
}
|
||||
|
||||
void LLUrlEntryAgentName::onAvatarNameCache(const LLUUID& id,
|
||||
const LLAvatarName& av_name)
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
auto range = mAvatarNameCacheConnections.equal_range(id);
|
||||
for (auto it = range.first; it != range.second; ++it)
|
||||
{
|
||||
if (it->second.connected())
|
||||
{
|
||||
it->second.disconnect();
|
||||
}
|
||||
}
|
||||
mAvatarNameCacheConnections.erase(range.first, range.second);
|
||||
|
||||
std::string label = getName(av_name);
|
||||
// received the agent name from the server - tell our observers
|
||||
@@ -566,26 +781,24 @@ std::string LLUrlEntryAgentName::getLabel(const std::string &url, const LLUrlLab
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mAvatarNameCacheConnection.connected())
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
}
|
||||
mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgentName::onAvatarNameCache, this, _1, _2));
|
||||
auto connection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgentName::onAvatarNameCache, this, _1, _2));
|
||||
mAvatarNameCacheConnections.emplace(agent_id, connection);
|
||||
addObserver(agent_id_string, url, cb);
|
||||
return LLTrans::getString("LoadingData");
|
||||
}
|
||||
}
|
||||
|
||||
/*LLStyle::Params LLUrlEntryAgentName::getStyle() const
|
||||
LLStyleSP LLUrlEntryAgentName::getStyle() const
|
||||
{
|
||||
// don't override default colors
|
||||
return LLStyle::Params().is_link(false);
|
||||
}*/
|
||||
static LLUICachedControl<LLColor4> color("HTMLAgentColor");
|
||||
LLStyleSP style_params(new LLStyle(true, color, LLStringUtil::null));
|
||||
return style_params;
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntryAgentCompleteName describes a Second Life agent complete name Url, e.g.,
|
||||
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename
|
||||
// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename
|
||||
// x-grid-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename
|
||||
//
|
||||
LLUrlEntryAgentCompleteName::LLUrlEntryAgentCompleteName()
|
||||
{
|
||||
@@ -598,10 +811,26 @@ std::string LLUrlEntryAgentCompleteName::getName(const LLAvatarName& avatar_name
|
||||
return avatar_name.getCompleteName();
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntryAgentLegacyName describes a Second Life agent legacy name Url, e.g.,
|
||||
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/legacyname
|
||||
// x-grid-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/legacyname
|
||||
//
|
||||
LLUrlEntryAgentLegacyName::LLUrlEntryAgentLegacyName()
|
||||
{
|
||||
mPattern = boost::regex(APP_HEADER_REGEX "/agent/[\\da-f-]+/legacyname",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryAgentLegacyName::getName(const LLAvatarName& avatar_name)
|
||||
{
|
||||
return avatar_name.getLegacyName();
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntryAgentDisplayName describes a Second Life agent display name Url, e.g.,
|
||||
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname
|
||||
// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname
|
||||
// x-grid-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname
|
||||
//
|
||||
LLUrlEntryAgentDisplayName::LLUrlEntryAgentDisplayName()
|
||||
{
|
||||
@@ -617,7 +846,7 @@ std::string LLUrlEntryAgentDisplayName::getName(const LLAvatarName& avatar_name)
|
||||
//
|
||||
// LLUrlEntryAgentUserName describes a Second Life agent user name Url, e.g.,
|
||||
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username
|
||||
// x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username
|
||||
// x-grid-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username
|
||||
//
|
||||
LLUrlEntryAgentUserName::LLUrlEntryAgentUserName()
|
||||
{
|
||||
@@ -634,7 +863,7 @@ std::string LLUrlEntryAgentUserName::getName(const LLAvatarName& avatar_name)
|
||||
// LLUrlEntryGroup Describes a Second Life group Url, e.g.,
|
||||
// secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about
|
||||
// secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/inspect
|
||||
// x-grid-location-info://lincoln.lindenlab.com/app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/inspect
|
||||
// x-grid-info://lincoln.lindenlab.com/app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/inspect
|
||||
//
|
||||
LLUrlEntryGroup::LLUrlEntryGroup()
|
||||
{
|
||||
@@ -696,13 +925,12 @@ std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCa
|
||||
}
|
||||
}
|
||||
|
||||
/*LLStyle::Params LLUrlEntryGroup::getStyle() const
|
||||
LLStyleSP LLUrlEntryGroup::getStyle() const
|
||||
{
|
||||
LLStyle::Params style_params = LLUrlEntryBase::getStyle();
|
||||
style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
|
||||
LLStyleSP style_params = LLUrlEntryBase::getStyle();
|
||||
//style_params->mUnderline = false; // Singu Note: We're not gonna bother here, underlining on hover
|
||||
return style_params;
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
@@ -714,7 +942,7 @@ LLUrlEntryInventory::LLUrlEntryInventory()
|
||||
//*TODO: add supporting of inventory item names with whitespaces
|
||||
//this pattern cann't parse for example
|
||||
//secondlife:///app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select?name=name with spaces¶m2=value
|
||||
//x-grid-location-info://lincoln.lindenlab.com/app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select?name=name with spaces¶m2=value
|
||||
//x-grid-info://lincoln.lindenlab.com/app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select?name=name with spaces¶m2=value
|
||||
mPattern = boost::regex(APP_HEADER_REGEX "/inventory/[\\da-f-]+/\\w+\\S*",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_inventory.xml";
|
||||
@@ -732,7 +960,7 @@ std::string LLUrlEntryInventory::getLabel(const std::string &url, const LLUrlLab
|
||||
//
|
||||
LLUrlEntryObjectIM::LLUrlEntryObjectIM()
|
||||
{
|
||||
mPattern = boost::regex("secondlife:///app/objectim/[\\da-f-]+\?.*",
|
||||
mPattern = boost::regex(APP_HEADER_REGEX "/objectim/[\\da-f-]+\?\\S*\\w",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_objectim.xml";
|
||||
}
|
||||
@@ -765,7 +993,7 @@ std::set<LLUrlEntryParcel*> LLUrlEntryParcel::sParcelInfoObservers;
|
||||
///
|
||||
/// LLUrlEntryParcel Describes a Second Life parcel Url, e.g.,
|
||||
/// secondlife:///app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about
|
||||
/// x-grid-location-info://lincoln.lindenlab.com/app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about
|
||||
/// x-grid-info://lincoln.lindenlab.com/app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about
|
||||
///
|
||||
LLUrlEntryParcel::LLUrlEntryParcel()
|
||||
{
|
||||
@@ -860,7 +1088,7 @@ void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data)
|
||||
//
|
||||
LLUrlEntryPlace::LLUrlEntryPlace()
|
||||
{
|
||||
mPattern = boost::regex("((x-grid-location-info://[-\\w\\.]+/region/)|(secondlife://))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?",
|
||||
mPattern = boost::regex("((((x-grid-info://)|(x-grid-location-info://))[-\\w\\.]+(:\\d+)?/region/)|(secondlife://))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_slurl.xml";
|
||||
mTooltip = LLTrans::getString("TooltipSLURL");
|
||||
@@ -968,7 +1196,7 @@ std::string LLUrlEntryRegion::getLocation(const std::string &url) const
|
||||
//
|
||||
// LLUrlEntryTeleport Describes a Second Life teleport Url, e.g.,
|
||||
// secondlife:///app/teleport/Ahern/50/50/50/
|
||||
// x-grid-location-info://lincoln.lindenlab.com/app/teleport/Ahern/50/50/50/
|
||||
// x-grid-info://lincoln.lindenlab.com/app/teleport/Ahern/50/50/50/
|
||||
//
|
||||
LLUrlEntryTeleport::LLUrlEntryTeleport()
|
||||
{
|
||||
@@ -1042,7 +1270,7 @@ std::string LLUrlEntryTeleport::getLocation(const std::string &url) const
|
||||
//
|
||||
LLUrlEntrySL::LLUrlEntrySL()
|
||||
{
|
||||
mPattern = boost::regex("secondlife://(\\w+)?(:\\d+)?/\\S+",
|
||||
mPattern = boost::regex(X_GRID_OR_SECONDLIFE_HEADER_REGEX "(\\w+)?(:\\d+)?/\\S+",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_slapp.xml";
|
||||
mTooltip = LLTrans::getString("TooltipSLAPP");
|
||||
@@ -1059,7 +1287,7 @@ std::string LLUrlEntrySL::getLabel(const std::string &url, const LLUrlLabelCallb
|
||||
//
|
||||
LLUrlEntrySLLabel::LLUrlEntrySLLabel()
|
||||
{
|
||||
mPattern = boost::regex("\\[secondlife://\\S+[ \t]+[^\\]]+\\]",
|
||||
mPattern = boost::regex("\\[" X_GRID_OR_SECONDLIFE_HEADER_REGEX "\\S+[ \t]+[^\\]]+\\]",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_slapp.xml";
|
||||
mTooltip = LLTrans::getString("TooltipSLAPP");
|
||||
@@ -1164,11 +1392,12 @@ std::string LLUrlEntryNoLink::getLabel(const std::string &url, const LLUrlLabelC
|
||||
return getUrl(url);
|
||||
}
|
||||
|
||||
/*LLStyle::Params LLUrlEntryNoLink::getStyle() const
|
||||
LLStyleSP LLUrlEntryNoLink::getStyle() const
|
||||
{
|
||||
// Don't render as URL (i.e. no context menu or hand cursor).
|
||||
return LLStyle::Params().is_link(false);
|
||||
}*/
|
||||
// Singu Note: What the heck? No, that's misleading!!
|
||||
return LLUrlEntryBase::getStyle();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
@@ -1201,3 +1430,75 @@ std::string LLUrlEntryIcon::getIcon(const std::string &url)
|
||||
LLStringUtil::trim(mIcon);
|
||||
return mIcon;
|
||||
}
|
||||
|
||||
//
|
||||
// LLUrlEntryEmail Describes a generic mailto: Urls
|
||||
//
|
||||
LLUrlEntryEmail::LLUrlEntryEmail()
|
||||
: LLUrlEntryBase()
|
||||
{
|
||||
mPattern = boost::regex("(mailto:)?[\\w\\.\\-]+@[\\w\\.\\-]+\\.[a-z]{2,63}",
|
||||
boost::regex::perl | boost::regex::icase);
|
||||
mMenuName = "menu_url_email.xml";
|
||||
mTooltip = LLTrans::getString("TooltipEmail");
|
||||
}
|
||||
|
||||
std::string LLUrlEntryEmail::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
|
||||
{
|
||||
size_t pos = url.find("mailto:");
|
||||
|
||||
if (pos == std::string::npos)
|
||||
{
|
||||
return escapeUrl(url);
|
||||
}
|
||||
|
||||
std::string ret = escapeUrl(url.substr(pos + 7, url.length() - pos + 8));
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string LLUrlEntryEmail::getUrl(const std::string &string) const
|
||||
{
|
||||
if (string.find("mailto:") == std::string::npos)
|
||||
{
|
||||
return "mailto:" + escapeUrl(string);
|
||||
}
|
||||
return escapeUrl(string);
|
||||
}
|
||||
|
||||
// <alchemy>
|
||||
//
|
||||
// LLUrlEntryJIRA describes a Jira Issue Tracker entry
|
||||
//
|
||||
LLUrlEntryJira::LLUrlEntryJira()
|
||||
{
|
||||
mPattern = boost::regex("((?:ALCH|SV|BUG|CHOP|FIRE|MAINT|OPEN|SCR|STORM|SVC|VWR|WEB)-\\d+)",
|
||||
boost::regex::perl);
|
||||
mMenuName = "menu_url_http.xml";
|
||||
mTooltip = LLTrans::getString("TooltipHttpUrl");
|
||||
}
|
||||
|
||||
std::string LLUrlEntryJira::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
|
||||
{
|
||||
return unescapeUrl(url);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryJira::getTooltip(const std::string &string) const
|
||||
{
|
||||
return getUrl(string);
|
||||
}
|
||||
|
||||
std::string LLUrlEntryJira::getUrl(const std::string &url) const
|
||||
{
|
||||
return (boost::format(
|
||||
(url.find("ALCH") != std::string::npos) ?
|
||||
"http://alchemy.atlassian.net/browse/%1%" :
|
||||
(url.find("SV") != std::string::npos) ?
|
||||
"https://singularityviewer.atlassian.net/browse/%1%" :
|
||||
(url.find("FIRE") != std::string::npos) ?
|
||||
"http://jira.phoenixviewer.com/browse/%1%" :
|
||||
"http://jira.secondlife.com/browse/%1%"
|
||||
) % url).str();
|
||||
}
|
||||
// </alchemy>
|
||||
|
||||
|
||||
|
||||
@@ -35,10 +35,7 @@
|
||||
#include "llavatarname.h"
|
||||
#include "llhost.h" // for resolving parcel name by parcel id
|
||||
|
||||
#include <boost/signals2.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
class LLAvatarName;
|
||||
|
||||
@@ -78,11 +75,14 @@ public:
|
||||
/// Given a matched Url, return a label for the Url
|
||||
virtual std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) { return url; }
|
||||
|
||||
/// Return port, query and fragment parts for the Url
|
||||
virtual std::string getQuery(const std::string &url) const { return ""; }
|
||||
|
||||
/// Return an icon that can be displayed next to Urls of this type
|
||||
virtual std::string getIcon(const std::string &url);
|
||||
|
||||
/// Return the style to render the displayed text
|
||||
//virtual LLStyle::Params getStyle() const;
|
||||
virtual LLStyleSP getStyle() const;
|
||||
|
||||
/// Given a matched Url, return a tooltip string for the hyperlink
|
||||
virtual std::string getTooltip(const std::string &string) const { return mTooltip; }
|
||||
@@ -96,10 +96,16 @@ public:
|
||||
/// Should this link text be underlined only when mouse is hovered over it?
|
||||
virtual bool underlineOnHoverOnly(const std::string &string) const { return true; } // <alchemy/>
|
||||
|
||||
virtual bool isTrusted() const { return false; }
|
||||
|
||||
virtual LLUUID getID(const std::string &string) const { return LLUUID::null; }
|
||||
|
||||
bool isLinkDisabled() const;
|
||||
|
||||
bool isWikiLinkCorrect(const std::string& url);
|
||||
|
||||
virtual bool isSLURLvalid(const std::string &url) const { return TRUE; };
|
||||
|
||||
protected:
|
||||
std::string getIDStringFromUrl(const std::string &url) const;
|
||||
std::string escapeUrl(const std::string &url) const;
|
||||
@@ -107,6 +113,8 @@ protected:
|
||||
std::string getLabelFromWikiLink(const std::string &url) const;
|
||||
std::string getUrlFromWikiLink(const std::string &string) const;
|
||||
void addObserver(const std::string &id, const std::string &url, const LLUrlLabelCallback &cb);
|
||||
std::string urlToLabelWithGreyQuery(const std::string &url) const;
|
||||
std::string urlToGreyQuery(const std::string &url) const;
|
||||
virtual void callObservers(const std::string &id, const std::string &label, const std::string& icon);
|
||||
|
||||
typedef struct {
|
||||
@@ -128,7 +136,9 @@ class LLUrlEntryHTTP : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryHTTP();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const override;
|
||||
/*virtual*/ std::string getTooltip(const std::string &url) const override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -138,9 +148,9 @@ class LLUrlEntryHTTPLabel : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryHTTPLabel();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getTooltip(const std::string &string) const;
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getTooltip(const std::string &string) const override;
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -150,8 +160,21 @@ class LLUrlEntryHTTPNoProtocol : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryHTTPNoProtocol();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const;
|
||||
std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
std::string getQuery(const std::string &url) const override;
|
||||
std::string getUrl(const std::string &string) const override;
|
||||
std::string getTooltip(const std::string &url) const override;
|
||||
};
|
||||
|
||||
class LLUrlEntryInvalidSLURL : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryInvalidSLURL();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const override;
|
||||
/*virtual*/ std::string getTooltip(const std::string &url) const override;
|
||||
|
||||
bool isSLURLvalid(const std::string &url) const override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -161,8 +184,31 @@ class LLUrlEntrySLURL : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntrySLURL();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const override;
|
||||
};
|
||||
|
||||
///
|
||||
/// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com Urls
|
||||
///
|
||||
class LLUrlEntrySecondlifeURL : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntrySecondlifeURL();
|
||||
/*virtual*/ bool isTrusted() const override { return true; }
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const override;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getQuery(const std::string &url) const override;
|
||||
/*virtual*/ std::string getTooltip(const std::string &url) const override;
|
||||
};
|
||||
|
||||
///
|
||||
/// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com Urls
|
||||
///
|
||||
class LLUrlEntrySimpleSecondlifeURL : public LLUrlEntrySecondlifeURL
|
||||
{
|
||||
public:
|
||||
LLUrlEntrySimpleSecondlifeURL();
|
||||
};
|
||||
|
||||
///
|
||||
@@ -174,22 +220,27 @@ public:
|
||||
LLUrlEntryAgent();
|
||||
~LLUrlEntryAgent()
|
||||
{
|
||||
if (mAvatarNameCacheConnection.connected())
|
||||
for(const auto& conn_pair : mAvatarNameCacheConnections)
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
if (conn_pair.second.connected())
|
||||
{
|
||||
conn_pair.second.disconnect();
|
||||
}
|
||||
}
|
||||
mAvatarNameCacheConnections.clear();
|
||||
}
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getIcon(const std::string &url);
|
||||
/*virtual*/ std::string getTooltip(const std::string &string) const;
|
||||
//*virtual*/ LLStyle::Params getStyle() const;
|
||||
/*virtual*/ LLUUID getID(const std::string &string) const;
|
||||
/*virtual*/ bool underlineOnHoverOnly(const std::string &string) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getIcon(const std::string &url) override;
|
||||
/*virtual*/ std::string getTooltip(const std::string &string) const override;
|
||||
/*virtual*/ LLStyleSP getStyle() const override;
|
||||
/*virtual*/ LLUUID getID(const std::string &string) const override;
|
||||
/*virtual*/ bool underlineOnHoverOnly(const std::string &string) const override;
|
||||
protected:
|
||||
/*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon);
|
||||
/*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon) override;
|
||||
private:
|
||||
void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name);
|
||||
boost::signals2::connection mAvatarNameCacheConnection;
|
||||
using avatar_name_cache_connection_map_t = std::multimap<LLUUID, boost::signals2::connection>;
|
||||
avatar_name_cache_connection_map_t mAvatarNameCacheConnections;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -203,19 +254,25 @@ public:
|
||||
LLUrlEntryAgentName();
|
||||
~LLUrlEntryAgentName()
|
||||
{
|
||||
if (mAvatarNameCacheConnection.connected())
|
||||
for (const auto& conn_pair : mAvatarNameCacheConnections)
|
||||
{
|
||||
mAvatarNameCacheConnection.disconnect();
|
||||
if (conn_pair.second.connected())
|
||||
{
|
||||
conn_pair.second.disconnect();
|
||||
}
|
||||
}
|
||||
mAvatarNameCacheConnections.clear();
|
||||
|
||||
}
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
//*virtual*/ LLStyle::Params getStyle() const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ LLStyleSP getStyle() const override;
|
||||
protected:
|
||||
// override this to pull out relevant name fields
|
||||
virtual std::string getName(const LLAvatarName& avatar_name) = 0;
|
||||
private:
|
||||
void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name);
|
||||
boost::signals2::connection mAvatarNameCacheConnection;
|
||||
using avatar_name_cache_connection_map_t = std::multimap<LLUUID, boost::signals2::connection>;
|
||||
avatar_name_cache_connection_map_t mAvatarNameCacheConnections;
|
||||
};
|
||||
|
||||
|
||||
@@ -229,7 +286,15 @@ class LLUrlEntryAgentCompleteName : public LLUrlEntryAgentName
|
||||
public:
|
||||
LLUrlEntryAgentCompleteName();
|
||||
private:
|
||||
/*virtual*/ std::string getName(const LLAvatarName& avatar_name);
|
||||
/*virtual*/ std::string getName(const LLAvatarName& avatar_name) override;
|
||||
};
|
||||
|
||||
class LLUrlEntryAgentLegacyName : public LLUrlEntryAgentName
|
||||
{
|
||||
public:
|
||||
LLUrlEntryAgentLegacyName();
|
||||
private:
|
||||
/*virtual*/ std::string getName(const LLAvatarName& avatar_name) override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -242,7 +307,7 @@ class LLUrlEntryAgentDisplayName : public LLUrlEntryAgentName
|
||||
public:
|
||||
LLUrlEntryAgentDisplayName();
|
||||
private:
|
||||
/*virtual*/ std::string getName(const LLAvatarName& avatar_name);
|
||||
/*virtual*/ std::string getName(const LLAvatarName& avatar_name) override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -255,7 +320,7 @@ class LLUrlEntryAgentUserName : public LLUrlEntryAgentName
|
||||
public:
|
||||
LLUrlEntryAgentUserName();
|
||||
private:
|
||||
/*virtual*/ std::string getName(const LLAvatarName& avatar_name);
|
||||
/*virtual*/ std::string getName(const LLAvatarName& avatar_name) override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -266,9 +331,9 @@ class LLUrlEntryGroup : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryGroup();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
//*virtual*/ LLStyle::Params getStyle() const;
|
||||
/*virtual*/ LLUUID getID(const std::string &string) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ LLStyleSP getStyle() const override;
|
||||
/*virtual*/ LLUUID getID(const std::string &string) const override;
|
||||
private:
|
||||
void onGroupNameReceived(const LLUUID& id, const std::string& name, bool is_group);
|
||||
};
|
||||
@@ -281,7 +346,7 @@ class LLUrlEntryInventory : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryInventory();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -293,8 +358,8 @@ class LLUrlEntryObjectIM : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryObjectIM();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const override;
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -317,7 +382,7 @@ public:
|
||||
|
||||
LLUrlEntryParcel();
|
||||
~LLUrlEntryParcel();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
|
||||
// Sends a parcel info request to sim.
|
||||
void sendParcelInfoRequest(const LLUUID& parcel_id);
|
||||
@@ -353,8 +418,8 @@ class LLUrlEntryPlace : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryPlace();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -365,8 +430,8 @@ class LLUrlEntryRegion : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryRegion();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -377,8 +442,8 @@ class LLUrlEntryTeleport : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryTeleport();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -389,7 +454,7 @@ class LLUrlEntrySL : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntrySL();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -400,10 +465,10 @@ class LLUrlEntrySLLabel : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntrySLLabel();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const;
|
||||
/*virtual*/ std::string getTooltip(const std::string &string) const;
|
||||
/*virtual*/ bool underlineOnHoverOnly(const std::string &string) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const override;
|
||||
/*virtual*/ std::string getTooltip(const std::string &string) const override;
|
||||
/*virtual*/ bool underlineOnHoverOnly(const std::string &string) const override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -414,8 +479,8 @@ class LLUrlEntryWorldMap : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryWorldMap();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getLocation(const std::string &url) const override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -425,9 +490,9 @@ class LLUrlEntryNoLink : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryNoLink();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const;
|
||||
//*virtual*/ LLStyle::Params getStyle() const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const override;
|
||||
/*virtual*/ LLStyleSP getStyle() const override;
|
||||
};
|
||||
|
||||
///
|
||||
@@ -437,10 +502,35 @@ class LLUrlEntryIcon : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryIcon();
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getIcon(const std::string &url);
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const override;
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getIcon(const std::string &url) override;
|
||||
};
|
||||
|
||||
///
|
||||
/// LLUrlEntryEmail Describes a generic mailto: Urls
|
||||
///
|
||||
class LLUrlEntryEmail : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryEmail();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const override;
|
||||
};
|
||||
|
||||
// <alchemy>
|
||||
///
|
||||
/// LLUrlEntryJira describes a Jira Issue
|
||||
///
|
||||
class LLUrlEntryJira : public LLUrlEntryBase
|
||||
{
|
||||
public:
|
||||
LLUrlEntryJira();
|
||||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
|
||||
/*virtual*/ std::string getTooltip(const std::string &string) const override;
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const override;
|
||||
|
||||
};
|
||||
// </alchemy>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
/**
|
||||
* @file llurlmatch.cpp
|
||||
* @author Martin Reddy
|
||||
@@ -37,26 +39,29 @@ LLUrlMatch::LLUrlMatch() :
|
||||
mIcon(""),
|
||||
mMenuName(""),
|
||||
mLocation(""),
|
||||
mUnderlineOnHoverOnly(false)
|
||||
mUnderlineOnHoverOnly(false),
|
||||
mTrusted(false)
|
||||
{
|
||||
}
|
||||
|
||||
void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url,
|
||||
const std::string &label, const std::string &tooltip,
|
||||
const std::string &icon, /*const LLStyle::Params& style,*/
|
||||
void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std::string &label,
|
||||
const std::string& query, const std::string &tooltip,
|
||||
const std::string &icon, const LLStyleSP& style,
|
||||
const std::string &menu, const std::string &location,
|
||||
const LLUUID& id, bool underline_on_hover_only)
|
||||
const LLUUID& id, bool underline_on_hover_only, bool trusted)
|
||||
{
|
||||
mStart = start;
|
||||
mEnd = end;
|
||||
mUrl = url;
|
||||
mLabel = label;
|
||||
mQuery = query;
|
||||
mTooltip = tooltip;
|
||||
mIcon = icon;
|
||||
//mStyle = style;
|
||||
//mStyle.link_href = url;
|
||||
mStyle = style;
|
||||
mStyle->setLinkHREF(url);
|
||||
mMenuName = menu;
|
||||
mLocation = location;
|
||||
mID = id;
|
||||
mUnderlineOnHoverOnly = underline_on_hover_only;
|
||||
mTrusted = trusted;
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
|
||||
//#include "linden_common.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "llstyle.h"
|
||||
|
||||
///
|
||||
@@ -62,6 +60,9 @@ public:
|
||||
/// return a label that can be used for the display of this Url
|
||||
std::string getLabel() const { return mLabel; }
|
||||
|
||||
/// return a right part of url which should be drawn in grey
|
||||
std::string getQuery() const { return mQuery; }
|
||||
|
||||
/// return a message that could be displayed in a tooltip or status bar
|
||||
std::string getTooltip() const { return mTooltip; }
|
||||
|
||||
@@ -69,7 +70,7 @@ public:
|
||||
std::string getIcon() const { return mIcon; }
|
||||
|
||||
/// Return the color to render the displayed text
|
||||
//LLStyle::Params getStyle() const { return mStyle; }
|
||||
LLStyleSP getStyle() const { return mStyle; }
|
||||
|
||||
/// Return the name of a XUI file containing the context menu items
|
||||
std::string getMenuName() const { return mMenuName; }
|
||||
@@ -80,12 +81,15 @@ public:
|
||||
/// Should this link text be underlined only when mouse is hovered over it?
|
||||
bool underlineOnHoverOnly() const { return mUnderlineOnHoverOnly; }
|
||||
|
||||
/// Return true if Url is trusted.
|
||||
bool isTrusted() const { return mTrusted; }
|
||||
|
||||
/// Change the contents of this match object (used by LLUrlRegistry)
|
||||
void setValues(U32 start, U32 end, const std::string &url, const std::string &label,
|
||||
const std::string &tooltip, const std::string &icon,
|
||||
/*const LLStyle::Params& style, */const std::string &menu,
|
||||
const std::string& query, const std::string &tooltip, const std::string &icon,
|
||||
const LLStyleSP& style, const std::string &menu,
|
||||
const std::string &location, const LLUUID& id,
|
||||
bool underline_on_hover_only = false );
|
||||
bool underline_on_hover_only = false, bool trusted = false);
|
||||
|
||||
const LLUUID& getID() const { return mID; }
|
||||
private:
|
||||
@@ -93,13 +97,15 @@ private:
|
||||
U32 mEnd;
|
||||
std::string mUrl;
|
||||
std::string mLabel;
|
||||
std::string mQuery;
|
||||
std::string mTooltip;
|
||||
std::string mIcon;
|
||||
std::string mMenuName;
|
||||
std::string mLocation;
|
||||
LLUUID mID;
|
||||
//LLStyle::Params mStyle;
|
||||
LLStyleSP mStyle;
|
||||
bool mUnderlineOnHoverOnly;
|
||||
bool mTrusted;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
/**
|
||||
* @file llurlregistry.cpp
|
||||
* @author Martin Reddy
|
||||
@@ -27,6 +29,7 @@
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "llurlregistry.h"
|
||||
#include "lluriparser.h"
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
@@ -37,15 +40,26 @@ void LLUrlRegistryNullCallback(const std::string &url, const std::string &label,
|
||||
|
||||
LLUrlRegistry::LLUrlRegistry()
|
||||
{
|
||||
mUrlEntry.reserve(20);
|
||||
mUrlEntry.reserve(23); // <alchemy/>
|
||||
|
||||
// Urls are matched in the order that they were registered
|
||||
registerUrl(new LLUrlEntryNoLink());
|
||||
registerUrl(new LLUrlEntryIcon());
|
||||
mUrlEntryIcon = new LLUrlEntryIcon();
|
||||
registerUrl(mUrlEntryIcon);
|
||||
mLLUrlEntryInvalidSLURL = new LLUrlEntryInvalidSLURL();
|
||||
registerUrl(mLLUrlEntryInvalidSLURL);
|
||||
registerUrl(new LLUrlEntrySLURL());
|
||||
|
||||
// decorated links for host names like: secondlife.com and lindenlab.com
|
||||
mUrlEntryTrusted = new LLUrlEntrySecondlifeURL();
|
||||
registerUrl(mUrlEntryTrusted);
|
||||
registerUrl(new LLUrlEntrySimpleSecondlifeURL());
|
||||
|
||||
registerUrl(new LLUrlEntryHTTP());
|
||||
registerUrl(new LLUrlEntryHTTPLabel());
|
||||
mUrlEntryHTTPLabel = new LLUrlEntryHTTPLabel();
|
||||
registerUrl(mUrlEntryHTTPLabel);
|
||||
registerUrl(new LLUrlEntryAgentCompleteName());
|
||||
registerUrl(new LLUrlEntryAgentLegacyName());
|
||||
registerUrl(new LLUrlEntryAgentDisplayName());
|
||||
registerUrl(new LLUrlEntryAgentUserName());
|
||||
// LLUrlEntryAgent*Name must appear before LLUrlEntryAgent since
|
||||
@@ -59,14 +73,17 @@ LLUrlRegistry::LLUrlRegistry()
|
||||
registerUrl(new LLUrlEntryObjectIM());
|
||||
registerUrl(new LLUrlEntryPlace());
|
||||
registerUrl(new LLUrlEntryInventory());
|
||||
registerUrl(new LLUrlEntryObjectIM());
|
||||
//LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern,
|
||||
//so it should be registered in the end of list
|
||||
registerUrl(new LLUrlEntrySL());
|
||||
registerUrl(new LLUrlEntrySLLabel());
|
||||
// most common pattern is a URL without any protocol,
|
||||
// e.g., "secondlife.com"
|
||||
registerUrl(new LLUrlEntryHTTPNoProtocol());
|
||||
mUrlEntrySLLabel = new LLUrlEntrySLLabel();
|
||||
registerUrl(mUrlEntrySLLabel);
|
||||
registerUrl(new LLUrlEntryEmail());
|
||||
// Parse teh jiras!
|
||||
registerUrl(new LLUrlEntryJira()); // <alchemy/>
|
||||
// most common pattern is a URL without any protocol starting with "www",
|
||||
// e.g., "www.secondlife.com"
|
||||
registerUrl(new LLUrlEntryHTTPNoProtocol());
|
||||
}
|
||||
|
||||
LLUrlRegistry::~LLUrlRegistry()
|
||||
@@ -90,7 +107,7 @@ void LLUrlRegistry::registerUrl(LLUrlEntryBase *url, bool force_front)
|
||||
}
|
||||
}
|
||||
|
||||
static bool matchRegex(const char *text, boost::regex regex, U32 &start, U32 &end)
|
||||
static bool matchRegex(const char *text, const boost::regex& regex, U32 &start, U32 &end)
|
||||
{
|
||||
boost::cmatch result;
|
||||
bool found;
|
||||
@@ -100,7 +117,7 @@ static bool matchRegex(const char *text, boost::regex regex, U32 &start, U32 &en
|
||||
{
|
||||
found = boost::regex_search(text, result, regex);
|
||||
}
|
||||
catch (std::runtime_error &)
|
||||
catch (const std::runtime_error &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -127,6 +144,11 @@ static bool matchRegex(const char *text, boost::regex regex, U32 &start, U32 &en
|
||||
end--;
|
||||
}
|
||||
|
||||
else if (text[end] == ']' && std::string(text+start, end-start).find('[') == std::string::npos)
|
||||
{
|
||||
end--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -142,32 +164,77 @@ static bool stringHasUrl(const std::string &text)
|
||||
text.find(".edu") != std::string::npos ||
|
||||
text.find(".org") != std::string::npos ||
|
||||
text.find("<nolink>") != std::string::npos ||
|
||||
text.find("<icon") != std::string::npos);
|
||||
text.find("<icon") != std::string::npos ||
|
||||
text.find('@') != std::string::npos);
|
||||
}
|
||||
|
||||
bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb)
|
||||
// <alchemy>
|
||||
static bool stringHasJira(const std::string &text)
|
||||
{
|
||||
// fast heuristic test for a URL in a string. This is used
|
||||
// to avoid lots of costly regex calls, BUT it needs to be
|
||||
// kept in sync with the LLUrlEntry regexes we support.
|
||||
return (text.find("ALCH") != std::string::npos ||
|
||||
text.find("SV") != std::string::npos ||
|
||||
text.find("BUG") != std::string::npos ||
|
||||
text.find("CHOP") != std::string::npos ||
|
||||
text.find("FIRE") != std::string::npos ||
|
||||
text.find("MAINT") != std::string::npos ||
|
||||
text.find("OPEN") != std::string::npos ||
|
||||
text.find("SCR") != std::string::npos ||
|
||||
text.find("STORM") != std::string::npos ||
|
||||
text.find("SVC") != std::string::npos ||
|
||||
text.find("VWR") != std::string::npos ||
|
||||
text.find("WEB") != std::string::npos);
|
||||
}
|
||||
// </alchemy>
|
||||
|
||||
bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb, bool is_content_trusted)
|
||||
{
|
||||
// avoid costly regexes if there is clearly no URL in the text
|
||||
if (! stringHasUrl(text))
|
||||
if (!(stringHasUrl(text) || stringHasJira(text))) // <alchemy/>
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// find the first matching regex from all url entries in the registry
|
||||
U32 match_start = 0, match_end = 0;
|
||||
LLUrlEntryBase *match_entry = NULL;
|
||||
LLUrlEntryBase *match_entry = nullptr;
|
||||
|
||||
std::vector<LLUrlEntryBase *>::iterator it;
|
||||
for (it = mUrlEntry.begin(); it != mUrlEntry.end(); ++it)
|
||||
{
|
||||
//Skip for url entry icon if content is not trusted
|
||||
if(!is_content_trusted && (mUrlEntryIcon == *it))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
LLUrlEntryBase *url_entry = *it;
|
||||
|
||||
U32 start = 0, end = 0;
|
||||
if (matchRegex(text.c_str(), url_entry->getPattern(), start, end))
|
||||
{
|
||||
// does this match occur in the string before any other match
|
||||
if (start < match_start || match_entry == NULL)
|
||||
if (start < match_start || match_entry == nullptr)
|
||||
{
|
||||
|
||||
if (mLLUrlEntryInvalidSLURL == *it)
|
||||
{
|
||||
if(url_entry && url_entry->isSLURLvalid(text.substr(start, end - start + 1)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if((mUrlEntryHTTPLabel == *it) || (mUrlEntrySLLabel == *it))
|
||||
{
|
||||
if(url_entry && !url_entry->isWikiLinkCorrect(text.substr(start, end - start + 1)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
match_start = start;
|
||||
match_end = end;
|
||||
match_entry = url_entry;
|
||||
@@ -178,18 +245,32 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
|
||||
// did we find a match? if so, return its details in the match object
|
||||
if (match_entry)
|
||||
{
|
||||
// Skip if link is an email with an empty username (starting with @). See MAINT-5371.
|
||||
if (match_start > 0 && text.substr(match_start - 1, 1) == "@")
|
||||
return false;
|
||||
|
||||
// fill in the LLUrlMatch object and return it
|
||||
std::string url = text.substr(match_start, match_end - match_start + 1);
|
||||
|
||||
if (match_entry == mUrlEntryTrusted)
|
||||
{
|
||||
LLUriParser up(url);
|
||||
up.normalize();
|
||||
url = up.normalizedUri();
|
||||
}
|
||||
|
||||
match.setValues(match_start, match_end,
|
||||
match_entry->getUrl(url),
|
||||
match_entry->getLabel(url, cb),
|
||||
match_entry->getQuery(url),
|
||||
match_entry->getTooltip(url),
|
||||
match_entry->getIcon(url),
|
||||
//match_entry->getStyle(),
|
||||
match_entry->getStyle(),
|
||||
match_entry->getMenuName(),
|
||||
match_entry->getLocation(url),
|
||||
match_entry->getID(url),
|
||||
match_entry->underlineOnHoverOnly(url));
|
||||
match_entry->underlineOnHoverOnly(url),
|
||||
match_entry->isTrusted());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -209,7 +290,7 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr
|
||||
// character encoding, so we need to update the start
|
||||
// and end values to be correct for the wide string.
|
||||
LLWString wurl = utf8str_to_wstring(match.getUrl());
|
||||
S32 start = text.find(wurl);
|
||||
size_t start = text.find(wurl);
|
||||
if (start == std::string::npos)
|
||||
{
|
||||
return false;
|
||||
@@ -218,9 +299,10 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr
|
||||
|
||||
match.setValues(start, end, match.getUrl(),
|
||||
match.getLabel(),
|
||||
match.getQuery(),
|
||||
match.getTooltip(),
|
||||
match.getIcon(),
|
||||
//match.getStyle(),
|
||||
match.getStyle(),
|
||||
match.getMenuName(),
|
||||
match.getLocation(),
|
||||
match.getID(),
|
||||
|
||||
@@ -33,9 +33,6 @@
|
||||
#include "llsingleton.h"
|
||||
#include "llstring.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
/// This default callback for findUrl() simply ignores any label updates
|
||||
void LLUrlRegistryNullCallback(const std::string &url,
|
||||
const std::string &label,
|
||||
@@ -73,7 +70,8 @@ public:
|
||||
/// get the next Url in an input string, starting at a given character offset
|
||||
/// your callback is invoked if the matched Url's label changes in the future
|
||||
bool findUrl(const std::string &text, LLUrlMatch &match,
|
||||
const LLUrlLabelCallback &cb = &LLUrlRegistryNullCallback);
|
||||
const LLUrlLabelCallback &cb = &LLUrlRegistryNullCallback,
|
||||
bool is_content_trusted = false);
|
||||
|
||||
/// a slightly less efficient version of findUrl for wide strings
|
||||
bool findUrl(const LLWString &text, LLUrlMatch &match,
|
||||
@@ -92,6 +90,11 @@ private:
|
||||
friend class LLSingleton<LLUrlRegistry>;
|
||||
|
||||
std::vector<LLUrlEntryBase *> mUrlEntry;
|
||||
LLUrlEntryBase* mUrlEntryTrusted;
|
||||
LLUrlEntryBase* mUrlEntryIcon;
|
||||
LLUrlEntryBase* mLLUrlEntryInvalidSLURL;
|
||||
LLUrlEntryBase* mUrlEntryHTTPLabel;
|
||||
LLUrlEntryBase* mUrlEntrySLLabel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -102,7 +102,7 @@ LLDir_Linux::LLDir_Linux()
|
||||
LL_INFOS() << "Running in dev checkout with mSkinBaseDir "
|
||||
<< mSkinBaseDir << LL_ENDL;
|
||||
else
|
||||
mSkinBaseDir = "";
|
||||
mSkinBaseDir.clear();
|
||||
}
|
||||
if (mSkinBaseDir.empty())
|
||||
{
|
||||
|
||||
@@ -140,7 +140,18 @@ LLDir_Win32::LLDir_Win32()
|
||||
|
||||
// LL_INFOS() << "mAppRODataDir = " << mAppRODataDir << LL_ENDL;
|
||||
|
||||
mSkinBaseDir = mAppRODataDir + mDirDelimiter + "skins";
|
||||
auto build_dir_pos = mExecutableDir.rfind("build-");
|
||||
if (build_dir_pos != std::string::npos)
|
||||
{
|
||||
// ...we're in a dev checkout
|
||||
mSkinBaseDir = mExecutableDir.substr(0, build_dir_pos) + "indra" + mDirDelimiter + "newview" + mDirDelimiter + "skins";
|
||||
if (LLFile::isdir(mSkinBaseDir))
|
||||
LL_INFOS() << "Running in dev checkout with mSkinBaseDir " << mSkinBaseDir << LL_ENDL;
|
||||
else mSkinBaseDir.clear();
|
||||
}
|
||||
|
||||
if (mSkinBaseDir.empty()) // ...normal installation running
|
||||
mSkinBaseDir = mAppRODataDir + mDirDelimiter + "skins";
|
||||
|
||||
// Build the default cache directory
|
||||
mDefaultCacheDir = buildSLOSCacheDir();
|
||||
|
||||
@@ -49,8 +49,8 @@ LLSplashScreen *gSplashScreenp = NULL;
|
||||
BOOL gDebugClicks = FALSE;
|
||||
BOOL gDebugWindowProc = FALSE;
|
||||
|
||||
const S32 gURLProtocolWhitelistCount = 4;
|
||||
const std::string gURLProtocolWhitelist[] = { "secondlife:", "http:", "https:", "data:"/*, "file:"*/ };
|
||||
const S32 gURLProtocolWhitelistCount = 5;
|
||||
const std::string gURLProtocolWhitelist[] = { "secondlife:", "http:", "https:", "data:", "mailto:" };
|
||||
|
||||
// CP: added a handler list - this is what's used to open the protocol and is based on registry entry
|
||||
// only meaningful difference currently is that file: protocols are opened using http:
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
};
|
||||
public:
|
||||
virtual void postInitialized() {}
|
||||
virtual void show() = 0;
|
||||
virtual void show(bool focus = true) = 0;
|
||||
virtual void hide() = 0;
|
||||
virtual void close() = 0;
|
||||
virtual BOOL getVisible() = 0;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
class LLWindowHeadless : public LLWindow
|
||||
{
|
||||
public:
|
||||
/*virtual*/ void show() {};
|
||||
/*virtual*/ void show(bool) {};
|
||||
/*virtual*/ void hide() {};
|
||||
/*virtual*/ void close() {};
|
||||
/*virtual*/ BOOL getVisible() {return FALSE;};
|
||||
|
||||
@@ -80,7 +80,7 @@ BOOL check_for_card(const char* RENDERER, const char* bad_card)
|
||||
"You can try to run Second Life, but it will probably crash or run\n"
|
||||
"very slowly. Try anyway?",
|
||||
bad_card);
|
||||
S32 button = OSMessageBox(buffer.c_str(), "Unsupported video card", OSMB_YESNO);
|
||||
S32 button = OSMessageBox(buffer, "Unsupported video card", OSMB_YESNO);
|
||||
if (OSBTN_YES == button)
|
||||
{
|
||||
return FALSE;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
class LLWindowMesaHeadless : public LLWindow
|
||||
{
|
||||
public:
|
||||
/*virtual*/ void show() {};
|
||||
/*virtual*/ void show(bool) {};
|
||||
/*virtual*/ void hide() {};
|
||||
/*virtual*/ void close() {};
|
||||
/*virtual*/ BOOL getVisible() {return FALSE;};
|
||||
|
||||
@@ -790,7 +790,7 @@ LLWindowSDL::~LLWindowSDL()
|
||||
}
|
||||
|
||||
|
||||
void LLWindowSDL::show()
|
||||
void LLWindowSDL::show(bool focus)
|
||||
{
|
||||
// *FIX: What to do with SDL?
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
class LLWindowSDL : public LLWindow
|
||||
{
|
||||
public:
|
||||
/*virtual*/ void show();
|
||||
/*virtual*/ void show(bool focus);
|
||||
/*virtual*/ void hide();
|
||||
/*virtual*/ void close();
|
||||
/*virtual*/ BOOL getVisible();
|
||||
|
||||
@@ -717,9 +717,10 @@ void LLWindowWin32::postInitialized()
|
||||
mCallbacks->handleDPIScaleChange(this, xDPIScale, yDPIScale);
|
||||
}
|
||||
|
||||
void LLWindowWin32::show()
|
||||
void LLWindowWin32::show(bool take_focus)
|
||||
{
|
||||
ShowWindow(mWindowHandle, SW_SHOW);
|
||||
if (!take_focus) return;
|
||||
SetForegroundWindow(mWindowHandle);
|
||||
SetFocus(mWindowHandle);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class LLWindowWin32 : public LLWindow
|
||||
{
|
||||
public:
|
||||
/*virtual*/ void postInitialized();
|
||||
/*virtual*/ void show();
|
||||
/*virtual*/ void show(bool focus = true);
|
||||
/*virtual*/ void hide();
|
||||
/*virtual*/ void close();
|
||||
/*virtual*/ BOOL getVisible();
|
||||
|
||||
@@ -13,7 +13,7 @@ include_directories(
|
||||
)
|
||||
|
||||
set(llxml_SOURCE_FILES
|
||||
#aixml.cpp
|
||||
aixml.cpp
|
||||
llcontrol.cpp
|
||||
llxmlnode.cpp
|
||||
llxmlparser.cpp
|
||||
@@ -23,7 +23,7 @@ set(llxml_SOURCE_FILES
|
||||
set(llxml_HEADER_FILES
|
||||
CMakeLists.txt
|
||||
|
||||
#aixml.h
|
||||
aixml.h
|
||||
llcontrol.h
|
||||
llcontrolgroupreader.h
|
||||
llxmlnode.h
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "aixml.h"
|
||||
#include "llmd5.h"
|
||||
#include <boost/tokenizer.hpp>
|
||||
#include "aifile.h"
|
||||
|
||||
//=============================================================================
|
||||
// Overview
|
||||
@@ -311,11 +310,10 @@ void AIXMLElement::child(LLDate const& element)
|
||||
//-----------------------------------------------------------------------------
|
||||
// AIXMLStream
|
||||
|
||||
AIXMLStream::AIXMLStream(LLFILE* fp, bool standalone) : mOfs(fp)
|
||||
AIXMLStream::AIXMLStream(const std::string& filename, bool standalone) : mOfs(filename)
|
||||
{
|
||||
char const* sp = standalone ? " standalone=\"yes\"" : "";
|
||||
int rc = fprintf(fp, "<?xml version=\"1.0\" encoding=\"utf-8\"%s ?>\n", sp);
|
||||
if (rc < 0 || ferror(fp))
|
||||
mOfs << "<?xml version=\"1.0\" encoding=\"utf-8\"" << (standalone ? " standalone=\"yes\"" : LLStringUtil::null) << "?>\n";
|
||||
if (!mOfs)
|
||||
{
|
||||
// I don't think that errno is set to anything else but EBADF here,
|
||||
// so there is not really any informative message to add here.
|
||||
@@ -342,7 +340,6 @@ AIXMLParser::AIXMLParser(std::string const& filename, char const* file_desc, std
|
||||
AIArgs args;
|
||||
if (!mXmlTree.parseFile(filename, TRUE))
|
||||
{
|
||||
AIFile dummy(filename, "rb"); // Check if the file can be opened at all (throws with a more descriptive error if not).
|
||||
error = "AIXMLParser_Cannot_parse_FILEDESC_FILENAME";
|
||||
}
|
||||
else
|
||||
|
||||
@@ -151,7 +151,7 @@ void AIXMLElement::child(FWD_ITERATOR i1, FWD_ITERATOR const& i2)
|
||||
class AIXMLStream {
|
||||
protected:
|
||||
llofstream mOfs;
|
||||
AIXMLStream(LLFILE* fp, bool standalone);
|
||||
AIXMLStream(const std::string& filename, bool standalone);
|
||||
~AIXMLStream();
|
||||
};
|
||||
|
||||
@@ -159,7 +159,7 @@ class AIXMLStream {
|
||||
class AIXMLRootElement : public AIXMLStream, public AIXMLElement
|
||||
{
|
||||
public:
|
||||
AIXMLRootElement(LLFILE* fp, char const* name, bool standalone = true) : AIXMLStream(fp, standalone), AIXMLElement(mOfs, name, 0) { }
|
||||
AIXMLRootElement(const std::string& filename, char const* name, bool standalone = true) : AIXMLStream(filename, standalone), AIXMLElement(mOfs, name, 0) { }
|
||||
};
|
||||
|
||||
class AIXMLElementParser
|
||||
|
||||
@@ -13,7 +13,7 @@ include(FMODSTUDIO)
|
||||
include(GLOD)
|
||||
include(FindOpenGL)
|
||||
include(Hunspell)
|
||||
include(JsonCpp)
|
||||
include(Json)
|
||||
include(LLAddBuildTest)
|
||||
include(LLAppearance)
|
||||
include(LLAudio)
|
||||
@@ -43,6 +43,7 @@ include(UI)
|
||||
include(ViewerMiscLibs)
|
||||
include(WinManifest)
|
||||
include(ZLIB)
|
||||
include(URIPARSER)
|
||||
|
||||
if (MSVC)
|
||||
use_prebuilt_binary(vcredist)
|
||||
@@ -52,7 +53,7 @@ include_directories(
|
||||
${STATEMACHINE_INCLUDE_DIRS}
|
||||
${DBUSGLIB_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
${JSONCPP_INCLUDE_DIR}
|
||||
${JSON_INCLUDE_DIR}
|
||||
${GLOD_INCLUDE_DIR}
|
||||
${LLAUDIO_INCLUDE_DIRS}
|
||||
${LLCHARACTER_INCLUDE_DIRS}
|
||||
@@ -77,7 +78,7 @@ include_directories(
|
||||
set(viewer_SOURCE_FILES
|
||||
NACLantispam.cpp
|
||||
aihttpview.cpp
|
||||
#aixmllindengenepool.cpp
|
||||
aixmllindengenepool.cpp
|
||||
alfloaterregiontracker.cpp
|
||||
aoremotectrl.cpp
|
||||
ascentfloatercontactgroups.cpp
|
||||
@@ -174,6 +175,7 @@ set(viewer_SOURCE_FILES
|
||||
llexternaleditor.cpp
|
||||
llface.cpp
|
||||
llfasttimerview.cpp
|
||||
llfavoritesbar.cpp
|
||||
llfeaturemanager.cpp
|
||||
llfirstuse.cpp
|
||||
llflexibleobject.cpp
|
||||
@@ -231,6 +233,7 @@ set(viewer_SOURCE_FILES
|
||||
llfloaterlandholdings.cpp
|
||||
llfloaterlandmark.cpp
|
||||
llfloatermap.cpp
|
||||
llfloatermarketplacelistings.cpp
|
||||
llfloatermediafilter.cpp
|
||||
llfloatermediasettings.cpp
|
||||
llfloatermemleak.cpp
|
||||
@@ -243,7 +246,6 @@ set(viewer_SOURCE_FILES
|
||||
llfloaterobjectiminfo.cpp
|
||||
llfloaterobjectweights.cpp
|
||||
llfloateropenobject.cpp
|
||||
llfloateroutbox.cpp
|
||||
llfloaterparcel.cpp
|
||||
llfloaterpathfindingcharacters.cpp
|
||||
llfloaterpathfindinglinksets.cpp
|
||||
@@ -320,6 +322,7 @@ set(viewer_SOURCE_FILES
|
||||
llinventoryobserver.cpp
|
||||
llinventorypanel.cpp
|
||||
lljoystickbutton.cpp
|
||||
lllandmarkactions.cpp
|
||||
lllandmarklist.cpp
|
||||
lllogchat.cpp
|
||||
llloginhandler.cpp
|
||||
@@ -387,7 +390,6 @@ set(viewer_SOURCE_FILES
|
||||
llpanellandoptions.cpp
|
||||
llpanellogin.cpp
|
||||
llpanelmaininventory.cpp
|
||||
llpanelmarketplaceoutboxinventory.cpp
|
||||
llpanelmediasettingsgeneral.cpp
|
||||
llpanelmediasettingspermissions.cpp
|
||||
llpanelmediasettingssecurity.cpp
|
||||
@@ -613,7 +615,7 @@ set(viewer_HEADER_FILES
|
||||
|
||||
NACLantispam.h
|
||||
aihttpview.h
|
||||
#aixmllindengenepool.h
|
||||
aixmllindengenepool.h
|
||||
alfloaterregiontracker.h
|
||||
aoremotectrl.h
|
||||
ascentfloatercontactgroups.h
|
||||
@@ -710,6 +712,7 @@ set(viewer_HEADER_FILES
|
||||
llexternaleditor.h
|
||||
llface.h
|
||||
llfasttimerview.h
|
||||
llfavoritesbar.h
|
||||
llfeaturemanager.h
|
||||
llfirstuse.h
|
||||
llflexibleobject.h
|
||||
@@ -767,6 +770,7 @@ set(viewer_HEADER_FILES
|
||||
llfloaterlandholdings.h
|
||||
llfloaterlandmark.h
|
||||
llfloatermap.h
|
||||
llfloatermarketplacelistings.h
|
||||
llfloatermediafilter.h
|
||||
llfloatermediasettings.h
|
||||
llfloatermemleak.h
|
||||
@@ -779,7 +783,6 @@ set(viewer_HEADER_FILES
|
||||
llfloaterobjectiminfo.h
|
||||
llfloaterobjectweights.h
|
||||
llfloateropenobject.h
|
||||
llfloateroutbox.h
|
||||
llfloaterparcel.h
|
||||
llfloaterpathfindingcharacters.h
|
||||
llfloaterpathfindinglinksets.h
|
||||
@@ -855,6 +858,7 @@ set(viewer_HEADER_FILES
|
||||
llinventoryobserver.h
|
||||
llinventorypanel.h
|
||||
lljoystickbutton.h
|
||||
lllandmarkactions.h
|
||||
lllandmarklist.h
|
||||
lllightconstants.h
|
||||
lllogchat.h
|
||||
@@ -924,7 +928,6 @@ set(viewer_HEADER_FILES
|
||||
llpanellandoptions.h
|
||||
llpanellogin.h
|
||||
llpanelmaininventory.h
|
||||
llpanelmarketplaceoutboxinventory.h
|
||||
llpanelmediasettingsgeneral.h
|
||||
llpanelmediasettingspermissions.h
|
||||
llpanelmediasettingssecurity.h
|
||||
@@ -1642,6 +1645,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
${NDOF_LIBRARY}
|
||||
${NVAPI_LIBRARY}
|
||||
${URIPARSER_LIBRARY}
|
||||
${viewer_LIBRARIES}
|
||||
${Boost_CONTEXT_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
@@ -1655,7 +1659,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
||||
${GLOD_LIBRARIES}
|
||||
${APRUTIL_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${JSONCPP_LIBRARIES}
|
||||
${SDL_LIBRARY}
|
||||
${SMARTHEAP_LIBRARY}
|
||||
${UI_LIBRARIES}
|
||||
|
||||
@@ -49,12 +49,11 @@
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include "aixmllindengenepool.h"
|
||||
#include "hippogridmanager.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llvisualparam.h"
|
||||
#include "llviewerwearable.h"
|
||||
#include "llquantize.h"
|
||||
|
||||
extern void append_path_short(LLUUID const& id, std::string& path);
|
||||
|
||||
void AIXMLLindenGenepool::MetaData::toXML(std::ostream& os, int indentation) const
|
||||
{
|
||||
AIXMLElement tag(os, "meta", indentation);
|
||||
@@ -68,7 +67,7 @@ AIXMLLindenGenepool::MetaData::MetaData(AIXMLElementParser const& parser)
|
||||
parser.attribute(DEFAULT_LLDATE_NAME, mDate);
|
||||
}
|
||||
|
||||
AIXMLLindenGenepool::AIXMLLindenGenepool(LLFILE* fp) : AIXMLRootElement(fp, "linden_genepool")
|
||||
AIXMLLindenGenepool::AIXMLLindenGenepool(const std::string& filename) : AIXMLRootElement(filename, "linden_genepool")
|
||||
{
|
||||
attribute("version", "1.0");
|
||||
attribute("metaversion", "1.0");
|
||||
@@ -145,7 +144,20 @@ AIArchetype::MetaData::MetaData(AIXMLElementParser const& parser)
|
||||
|
||||
AIArchetype::MetaData::MetaData(LLViewerWearable const* wearable) : mName(wearable->getName()), mDescription(wearable->getDescription())
|
||||
{
|
||||
append_path_short(wearable->getItemID(), mPath);
|
||||
// Path should already end on '/' if it is not empty.
|
||||
const LLUUID& root_id = gInventory.getRootFolderID();
|
||||
LLUUID id = wearable->getItemID();
|
||||
for(const LLInventoryObject* obj = gInventory.getObject(id); obj && id != root_id; obj = gInventory.getCategory(id))
|
||||
{
|
||||
std::string temp(mPath);
|
||||
mPath = obj->getName();
|
||||
if (!temp.empty())
|
||||
{
|
||||
mPath.append(1, '/');
|
||||
mPath.append(temp);
|
||||
}
|
||||
id = obj->getParentUUID();
|
||||
}
|
||||
}
|
||||
|
||||
AIArchetype::AIArchetype(void) : mType(LLWearableType::WT_NONE)
|
||||
|
||||
@@ -53,7 +53,7 @@ class AIXMLLindenGenepool : public AIXMLRootElement
|
||||
MetaData(AIXMLElementParser const& parser);
|
||||
};
|
||||
|
||||
AIXMLLindenGenepool(LLFILE* fp);
|
||||
AIXMLLindenGenepool(const std::string& filename);
|
||||
};
|
||||
|
||||
class AIVisualParamIDValuePair
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "aoremotectrl.h"
|
||||
|
||||
#include "floaterao.h"
|
||||
#include "llbutton.h"
|
||||
#include "lloverlaybar.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llviewercontrol.h"
|
||||
@@ -46,80 +45,23 @@ AORemoteCtrl::AORemoteCtrl()
|
||||
setFocusRoot(TRUE);
|
||||
}
|
||||
|
||||
AORemoteCtrl::~AORemoteCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
void AORemoteCtrl::draw()
|
||||
{
|
||||
LLButton* expand_button = getChild<LLButton>("popup_btn");
|
||||
if (expand_button)
|
||||
{
|
||||
if (expand_button->getToggleState())
|
||||
{
|
||||
expand_button->setImageOverlay("arrow_down.tga");
|
||||
}
|
||||
else
|
||||
{
|
||||
expand_button->setImageOverlay("arrow_up.tga");
|
||||
}
|
||||
}
|
||||
|
||||
LLPanel::draw();
|
||||
}
|
||||
|
||||
void AORemoteCtrl::build()
|
||||
{
|
||||
if (gSavedSettings.getBOOL("ShowAOSitPopup"))
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_ao_remote_expanded.xml");
|
||||
}
|
||||
else
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_ao_remote.xml");
|
||||
}
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, gSavedSettings.getBOOL("ShowAOSitPopup") ? "panel_ao_remote_expanded.xml" : "panel_ao_remote.xml");
|
||||
}
|
||||
|
||||
BOOL AORemoteCtrl::postBuild()
|
||||
{
|
||||
|
||||
childSetAction("ao_btn", onClickToggleAO, this);
|
||||
if (gSavedSettings.getBOOL("ShowAOSitPopup"))
|
||||
{
|
||||
childSetAction("ao_sit_btn", onClickToggleAOSit, this);
|
||||
//childSetAction("ao_show_btn", onClickShowAO, this);
|
||||
}
|
||||
childSetAction("popup_btn", onClickPopupBtn, this);
|
||||
/*if (LLUICtrl* ctrl = findChild<LLUICtrl>("ao_show_btn"))
|
||||
ctrl->setCommitCallback(boost::bind(&LLFloaterAO::showInstance, LLSD()));*/
|
||||
getChild<LLUICtrl>("popup_btn")->setCommitCallback(boost::bind(&AORemoteCtrl::onClickPopupBtn, this));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// static
|
||||
void AORemoteCtrl::onClickToggleAO(void* data)
|
||||
void AORemoteCtrl::onClickPopupBtn()
|
||||
{
|
||||
BOOL ao_enable = gSavedSettings.getBOOL("AOEnabled");
|
||||
gSavedSettings.setBOOL("AOEnabled", !ao_enable);
|
||||
}
|
||||
|
||||
//static
|
||||
void AORemoteCtrl::onClickToggleAOSit(void* data)
|
||||
{
|
||||
BOOL sit_enable = gSavedSettings.getBOOL("AOSitsEnabled");
|
||||
gSavedSettings.setBOOL("AOSitsEnabled", !sit_enable);
|
||||
}
|
||||
|
||||
//static
|
||||
void AORemoteCtrl::onClickShowAO(void* data)
|
||||
{
|
||||
LLFloaterAO::show(NULL);
|
||||
}
|
||||
|
||||
//static
|
||||
void AORemoteCtrl::onClickPopupBtn(void* data)
|
||||
{
|
||||
AORemoteCtrl* remotep = (AORemoteCtrl*)data;
|
||||
|
||||
remotep->deleteAllChildren();
|
||||
remotep->build();
|
||||
deleteAllChildren();
|
||||
build();
|
||||
gOverlayBar->layoutButtons();
|
||||
}
|
||||
|
||||
@@ -37,18 +37,12 @@ class AORemoteCtrl : public LLPanel
|
||||
{
|
||||
public:
|
||||
AORemoteCtrl();
|
||||
virtual ~AORemoteCtrl();
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void draw();
|
||||
BOOL postBuild() override;
|
||||
|
||||
private:
|
||||
|
||||
void build();
|
||||
|
||||
static void onClickToggleAO(void* data);
|
||||
static void onClickToggleAOSit(void* data);
|
||||
static void onClickShowAO(void* data);
|
||||
static void onClickPopupBtn(void* data);
|
||||
void onClickPopupBtn();
|
||||
};
|
||||
|
||||
#endif // AOREMOTECTRL_H
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
[ Running ]
|
||||
[ Turning Right ]
|
||||
[ Turning Left ]
|
||||
[ Typing ]
|
||||
[ Floating ]
|
||||
[ Swimming Forward ]
|
||||
[ Swimming Up ]
|
||||
|
||||
@@ -16,6 +16,301 @@
|
||||
## Conversion done with mk-ca-bundle.pl version 1.27.
|
||||
## SHA256: a3ac15b98179dd2f3c5de076d10b1d53048754372f7207c2f327510cdd78fbd8
|
||||
##
|
||||
LetsEncrypt Root CA2
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number:
|
||||
03:74:f1:c1:0b:b8:be:e9:c5:30:d3:e4:43:db:f8:ff:05:0d
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
Issuer: C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
|
||||
Validity
|
||||
Not Before: Mar 10 21:26:03 2019 GMT
|
||||
Not After : Jun 8 21:26:03 2019 GMT
|
||||
Subject: CN = login.virtual-nexus.xyz
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
RSA Public-Key: (4096 bit)
|
||||
Modulus:
|
||||
00:aa:ea:b2:94:3e:9e:bf:08:c7:9a:3b:93:9d:4a:
|
||||
a4:8e:18:f1:60:a1:26:d1:78:c1:72:11:8e:da:3e:
|
||||
fa:16:3a:f4:a4:b2:de:ee:ec:eb:86:f1:88:2e:78:
|
||||
1a:04:90:44:e4:c2:72:c3:85:cf:8e:3b:9a:cd:f6:
|
||||
2c:4e:cb:39:06:18:2a:b9:70:dd:a5:d0:d6:71:01:
|
||||
e8:e6:cc:f4:86:dd:88:2b:d5:de:28:a4:6c:a2:c9:
|
||||
ab:dd:8b:0f:12:2a:1d:67:0f:fe:02:f9:33:1e:0c:
|
||||
84:be:16:d2:f2:b0:4d:b3:54:3d:db:df:83:8d:9a:
|
||||
1e:16:46:0b:f5:42:fb:91:4b:6a:95:7e:6b:48:e3:
|
||||
86:d8:60:5d:4d:9a:4e:a6:82:e7:05:02:83:78:72:
|
||||
b4:62:8b:27:30:3a:20:8f:72:95:58:56:45:43:db:
|
||||
4e:e3:4a:87:0a:c9:58:f9:ec:63:65:d4:eb:f7:1d:
|
||||
cc:2b:5c:8d:7d:61:54:0f:83:78:9a:b3:bf:db:87:
|
||||
45:b9:99:9b:54:75:e8:1c:52:29:f8:37:ad:24:5a:
|
||||
ca:2b:1a:b2:11:8e:d4:34:bb:00:a8:e2:ae:ed:34:
|
||||
14:30:13:e1:06:c5:ee:d4:b2:9b:94:8d:f5:dc:2b:
|
||||
a0:d3:ab:35:32:8b:e5:cf:d5:44:68:69:5d:3f:22:
|
||||
86:c9:2d:14:b6:b1:82:0c:fe:87:4d:a0:0a:76:1d:
|
||||
c3:be:b9:ff:6e:c4:9e:f7:2d:d2:f5:ad:4d:aa:7f:
|
||||
4e:44:d6:7b:b4:6a:d0:71:52:48:2c:30:bf:11:b5:
|
||||
df:70:40:30:cc:1a:e4:c0:a0:90:86:56:bf:36:92:
|
||||
2a:00:a5:0d:3b:2d:42:29:c1:4c:d6:9f:47:83:ff:
|
||||
c1:c4:cc:04:08:9f:8b:2c:ca:4c:f5:d4:a5:38:81:
|
||||
6a:d0:4d:68:d9:fb:fa:1e:de:a1:c2:47:ea:d4:a8:
|
||||
a3:b2:ba:47:50:b4:0e:15:a7:a7:ac:e2:a4:21:7c:
|
||||
20:c3:6b:ef:4f:3d:57:d0:91:ce:19:b2:da:4d:cd:
|
||||
7f:2d:2e:12:9d:e8:55:fc:02:ad:ea:57:68:d6:f9:
|
||||
96:9f:85:98:56:10:a2:bb:b6:7b:24:34:ab:9d:d7:
|
||||
c9:56:47:40:b5:b1:22:80:b1:ae:37:73:6c:94:93:
|
||||
6c:db:97:47:b1:86:3c:87:5d:ad:52:2a:44:16:ce:
|
||||
0c:5c:94:1d:c2:cd:17:76:89:9a:ec:80:78:b9:a9:
|
||||
c7:90:d2:c6:de:22:bb:95:1e:f6:ad:04:a0:46:c9:
|
||||
4b:12:2e:8d:ff:89:6c:c8:69:91:78:a0:f3:cf:f2:
|
||||
22:7d:68:4e:ee:32:0f:61:17:09:ba:94:bd:88:6d:
|
||||
a8:65:cd
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Key Usage: critical
|
||||
Digital Signature, Key Encipherment
|
||||
X509v3 Extended Key Usage:
|
||||
TLS Web Server Authentication, TLS Web Client Authentication
|
||||
X509v3 Basic Constraints: critical
|
||||
CA:FALSE
|
||||
X509v3 Subject Key Identifier:
|
||||
2D:36:69:83:B8:E4:7D:38:D1:8F:8B:92:9E:A8:FD:6B:E9:25:29:97
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:A8:4A:6A:63:04:7D:DD:BA:E6:D1:39:B7:A6:45:65:EF:F3:A8:EC:A1
|
||||
|
||||
Authority Information Access:
|
||||
OCSP - URI:http://ocsp.int-x3.letsencrypt.org
|
||||
CA Issuers - URI:http://cert.int-x3.letsencrypt.org/
|
||||
|
||||
X509v3 Subject Alternative Name:
|
||||
DNS:login.virtual-nexus.xyz
|
||||
X509v3 Certificate Policies:
|
||||
Policy: 2.23.140.1.2.1
|
||||
Policy: 1.3.6.1.4.1.44947.1.1.1
|
||||
CPS: http://cps.letsencrypt.org
|
||||
|
||||
CT Precertificate SCTs:
|
||||
Signed Certificate Timestamp:
|
||||
Version : v1 (0x0)
|
||||
Log ID : 74:7E:DA:83:31:AD:33:10:91:21:9C:CE:25:4F:42:70:
|
||||
C2:BF:FD:5E:42:20:08:C6:37:35:79:E6:10:7B:CC:56
|
||||
Timestamp : Mar 10 22:26:03.415 2019 GMT
|
||||
Extensions: none
|
||||
Signature : ecdsa-with-SHA256
|
||||
30:45:02:21:00:98:49:3F:B0:C4:66:2D:CF:CE:91:36:
|
||||
15:AF:75:94:5B:FD:C2:CB:8F:F1:E2:8D:FA:C0:61:8E:
|
||||
E6:F3:7B:A8:05:02:20:62:39:0F:66:B2:79:48:A8:49:
|
||||
41:2A:D4:59:86:C3:FA:AC:C1:5D:26:02:AC:E3:D8:C8:
|
||||
0F:40:34:64:F1:D1:36
|
||||
Signed Certificate Timestamp:
|
||||
Version : v1 (0x0)
|
||||
Log ID : 29:3C:51:96:54:C8:39:65:BA:AA:50:FC:58:07:D4:B7:
|
||||
6F:BF:58:7A:29:72:DC:A4:C3:0C:F4:E5:45:47:F4:78
|
||||
Timestamp : Mar 10 22:26:03.442 2019 GMT
|
||||
Extensions: none
|
||||
Signature : ecdsa-with-SHA256
|
||||
30:46:02:21:00:C7:09:49:5A:96:E5:B5:15:2A:F1:EA:
|
||||
03:A4:7D:10:89:23:9A:C2:C9:9F:35:85:AD:87:11:58:
|
||||
A8:95:5C:0A:C6:02:21:00:88:14:C8:48:C7:6B:96:DB:
|
||||
A2:AB:91:BD:F7:3D:AD:FA:37:F6:AD:BF:D7:24:DC:F0:
|
||||
11:CF:0C:D4:42:E0:72:A5
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
42:55:9f:ea:ae:79:1d:9d:e9:06:23:a1:d0:a9:0f:d2:bc:08:
|
||||
92:b6:05:30:29:c2:00:fc:96:6e:b1:ff:9b:00:d7:c3:7b:34:
|
||||
47:02:81:2a:44:46:85:6c:7a:f5:c3:09:e2:9c:fd:1d:d3:2c:
|
||||
a4:e9:a5:99:ec:47:bd:fe:39:d2:c9:d6:ac:dd:48:40:0b:9a:
|
||||
24:f1:0b:4e:02:62:aa:63:e4:dd:8f:ad:9a:6c:5a:0a:de:d0:
|
||||
a2:67:b2:ea:fa:68:ff:18:ea:e1:73:35:89:45:dd:b7:ac:2d:
|
||||
58:8a:a3:6d:eb:41:f6:fa:60:8f:39:38:33:a0:d5:fd:56:5d:
|
||||
02:08:80:40:f6:f0:c1:68:e1:15:c8:fc:c3:64:a5:43:85:18:
|
||||
ed:44:5d:f8:b9:20:43:9f:3d:8b:20:e0:55:cd:78:89:d4:db:
|
||||
80:23:88:0e:6f:f5:ef:66:52:a9:c6:b1:f1:5e:6c:d6:8e:18:
|
||||
7a:93:14:65:4b:1b:a7:55:7d:9d:a5:d2:15:a8:7d:a1:aa:dd:
|
||||
ef:93:94:d5:3e:2f:ce:4b:bf:ac:e5:61:da:66:61:bd:42:08:
|
||||
53:58:73:a7:80:64:78:17:60:11:71:7f:75:17:bc:24:2f:57:
|
||||
8c:61:37:87:4e:0a:41:82:74:b0:69:14:5c:89:58:55:32:1f:
|
||||
06:1b:e2:24
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFjTCCA3WgAwIBAgIRANOxciY0IzLc9AUoUSrsnGowDQYJKoZIhvcNAQELBQAw
|
||||
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
|
||||
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTYxMDA2MTU0MzU1
|
||||
WhcNMjExMDA2MTU0MzU1WjBKMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
|
||||
RW5jcnlwdDEjMCEGA1UEAxMaTGV0J3MgRW5jcnlwdCBBdXRob3JpdHkgWDMwggEi
|
||||
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCc0wzwWuUuR7dyXTeDs2hjMOrX
|
||||
NSYZJeG9vjXxcJIvt7hLQQWrqZ41CFjssSrEaIcLo+N15Obzp2JxunmBYB/XkZqf
|
||||
89B4Z3HIaQ6Vkc/+5pnpYDxIzH7KTXcSJJ1HG1rrueweNwAcnKx7pwXqzkrrvUHl
|
||||
Npi5y/1tPJZo3yMqQpAMhnRnyH+lmrhSYRQTP2XpgofL2/oOVvaGifOFP5eGr7Dc
|
||||
Gu9rDZUWfcQroGWymQQ2dYBrrErzG5BJeC+ilk8qICUpBMZ0wNAxzY8xOJUWuqgz
|
||||
uEPxsR/DMH+ieTETPS02+OP88jNquTkxxa/EjQ0dZBYzqvqEKbbUC8DYfcOTAgMB
|
||||
AAGjggFnMIIBYzAOBgNVHQ8BAf8EBAMCAYYwEgYDVR0TAQH/BAgwBgEB/wIBADBU
|
||||
BgNVHSAETTBLMAgGBmeBDAECATA/BgsrBgEEAYLfEwEBATAwMC4GCCsGAQUFBwIB
|
||||
FiJodHRwOi8vY3BzLnJvb3QteDEubGV0c2VuY3J5cHQub3JnMB0GA1UdDgQWBBSo
|
||||
SmpjBH3duubRObemRWXv86jsoTAzBgNVHR8ELDAqMCigJqAkhiJodHRwOi8vY3Js
|
||||
LnJvb3QteDEubGV0c2VuY3J5cHQub3JnMHIGCCsGAQUFBwEBBGYwZDAwBggrBgEF
|
||||
BQcwAYYkaHR0cDovL29jc3Aucm9vdC14MS5sZXRzZW5jcnlwdC5vcmcvMDAGCCsG
|
||||
AQUFBzAChiRodHRwOi8vY2VydC5yb290LXgxLmxldHNlbmNyeXB0Lm9yZy8wHwYD
|
||||
VR0jBBgwFoAUebRZ5nu25eQBc4AIiMgaWPbpm24wDQYJKoZIhvcNAQELBQADggIB
|
||||
ABnPdSA0LTqmRf/Q1eaM2jLonG4bQdEnqOJQ8nCqxOeTRrToEKtwT++36gTSlBGx
|
||||
A/5dut82jJQ2jxN8RI8L9QFXrWi4xXnA2EqA10yjHiR6H9cj6MFiOnb5In1eWsRM
|
||||
UM2v3e9tNsCAgBukPHAg1lQh07rvFKm/Bz9BCjaxorALINUfZ9DD64j2igLIxle2
|
||||
DPxW8dI/F2loHMjXZjqG8RkqZUdoxtID5+90FgsGIfkMpqgRS05f4zPbCEHqCXl1
|
||||
eO5HyELTgcVlLXXQDgAWnRzut1hFJeczY1tjQQno6f6s+nMydLN26WuU4s3UYvOu
|
||||
OsUxRlJu7TSRHqDC3lSE5XggVkzdaPkuKGQbGpny+01/47hfXXNB7HntWNZ6N2Vw
|
||||
p7G6OfY+YQrZwIaQmhrIqJZuigsrbe3W+gdn5ykE9+Ky0VgVUsfxo52mwFYs1JKY
|
||||
2PGDuWx8M6DlS6qQkvHaRUo0FMd8TsSlbF0/v965qGFKhSDeQoMpYnwcmQilRh/0
|
||||
ayLThlHLN81gSkJjVrPI0Y8xCVPB4twb1PFUd2fPM3sA1tJ83sZ5v8vgFv2yofKR
|
||||
PB0t6JzUA81mSqM3kxl5e+IZwhYAyO0OTg3/fs8HqGTNKd9BqoUwSRBzp06JMg5b
|
||||
rUCGwbCUDI0mxadJ3Bz4WxR6fyNpBK2yAinWEsikxqEt
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
LetsEncrypt Root CA
|
||||
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number:
|
||||
03:74:f1:c1:0b:b8:be:e9:c5:30:d3:e4:43:db:f8:ff:05:0d
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
Issuer: C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
|
||||
Validity
|
||||
Not Before: Mar 10 21:26:03 2019 GMT
|
||||
Not After : Jun 8 21:26:03 2019 GMT
|
||||
Subject: CN = login.virtual-nexus.xyz
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
RSA Public-Key: (4096 bit)
|
||||
Modulus:
|
||||
00:aa:ea:b2:94:3e:9e:bf:08:c7:9a:3b:93:9d:4a:
|
||||
a4:8e:18:f1:60:a1:26:d1:78:c1:72:11:8e:da:3e:
|
||||
fa:16:3a:f4:a4:b2:de:ee:ec:eb:86:f1:88:2e:78:
|
||||
1a:04:90:44:e4:c2:72:c3:85:cf:8e:3b:9a:cd:f6:
|
||||
2c:4e:cb:39:06:18:2a:b9:70:dd:a5:d0:d6:71:01:
|
||||
e8:e6:cc:f4:86:dd:88:2b:d5:de:28:a4:6c:a2:c9:
|
||||
ab:dd:8b:0f:12:2a:1d:67:0f:fe:02:f9:33:1e:0c:
|
||||
84:be:16:d2:f2:b0:4d:b3:54:3d:db:df:83:8d:9a:
|
||||
1e:16:46:0b:f5:42:fb:91:4b:6a:95:7e:6b:48:e3:
|
||||
86:d8:60:5d:4d:9a:4e:a6:82:e7:05:02:83:78:72:
|
||||
b4:62:8b:27:30:3a:20:8f:72:95:58:56:45:43:db:
|
||||
4e:e3:4a:87:0a:c9:58:f9:ec:63:65:d4:eb:f7:1d:
|
||||
cc:2b:5c:8d:7d:61:54:0f:83:78:9a:b3:bf:db:87:
|
||||
45:b9:99:9b:54:75:e8:1c:52:29:f8:37:ad:24:5a:
|
||||
ca:2b:1a:b2:11:8e:d4:34:bb:00:a8:e2:ae:ed:34:
|
||||
14:30:13:e1:06:c5:ee:d4:b2:9b:94:8d:f5:dc:2b:
|
||||
a0:d3:ab:35:32:8b:e5:cf:d5:44:68:69:5d:3f:22:
|
||||
86:c9:2d:14:b6:b1:82:0c:fe:87:4d:a0:0a:76:1d:
|
||||
c3:be:b9:ff:6e:c4:9e:f7:2d:d2:f5:ad:4d:aa:7f:
|
||||
4e:44:d6:7b:b4:6a:d0:71:52:48:2c:30:bf:11:b5:
|
||||
df:70:40:30:cc:1a:e4:c0:a0:90:86:56:bf:36:92:
|
||||
2a:00:a5:0d:3b:2d:42:29:c1:4c:d6:9f:47:83:ff:
|
||||
c1:c4:cc:04:08:9f:8b:2c:ca:4c:f5:d4:a5:38:81:
|
||||
6a:d0:4d:68:d9:fb:fa:1e:de:a1:c2:47:ea:d4:a8:
|
||||
a3:b2:ba:47:50:b4:0e:15:a7:a7:ac:e2:a4:21:7c:
|
||||
20:c3:6b:ef:4f:3d:57:d0:91:ce:19:b2:da:4d:cd:
|
||||
7f:2d:2e:12:9d:e8:55:fc:02:ad:ea:57:68:d6:f9:
|
||||
96:9f:85:98:56:10:a2:bb:b6:7b:24:34:ab:9d:d7:
|
||||
c9:56:47:40:b5:b1:22:80:b1:ae:37:73:6c:94:93:
|
||||
6c:db:97:47:b1:86:3c:87:5d:ad:52:2a:44:16:ce:
|
||||
0c:5c:94:1d:c2:cd:17:76:89:9a:ec:80:78:b9:a9:
|
||||
c7:90:d2:c6:de:22:bb:95:1e:f6:ad:04:a0:46:c9:
|
||||
4b:12:2e:8d:ff:89:6c:c8:69:91:78:a0:f3:cf:f2:
|
||||
22:7d:68:4e:ee:32:0f:61:17:09:ba:94:bd:88:6d:
|
||||
a8:65:cd
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Key Usage: critical
|
||||
Digital Signature, Key Encipherment
|
||||
X509v3 Extended Key Usage:
|
||||
TLS Web Server Authentication, TLS Web Client Authentication
|
||||
X509v3 Basic Constraints: critical
|
||||
CA:FALSE
|
||||
X509v3 Subject Key Identifier:
|
||||
2D:36:69:83:B8:E4:7D:38:D1:8F:8B:92:9E:A8:FD:6B:E9:25:29:97
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:A8:4A:6A:63:04:7D:DD:BA:E6:D1:39:B7:A6:45:65:EF:F3:A8:EC:A1
|
||||
|
||||
Authority Information Access:
|
||||
OCSP - URI:http://ocsp.int-x3.letsencrypt.org
|
||||
CA Issuers - URI:http://cert.int-x3.letsencrypt.org/
|
||||
|
||||
X509v3 Subject Alternative Name:
|
||||
DNS:login.virtual-nexus.xyz
|
||||
X509v3 Certificate Policies:
|
||||
Policy: 2.23.140.1.2.1
|
||||
Policy: 1.3.6.1.4.1.44947.1.1.1
|
||||
CPS: http://cps.letsencrypt.org
|
||||
|
||||
CT Precertificate SCTs:
|
||||
Signed Certificate Timestamp:
|
||||
Version : v1 (0x0)
|
||||
Log ID : 74:7E:DA:83:31:AD:33:10:91:21:9C:CE:25:4F:42:70:
|
||||
C2:BF:FD:5E:42:20:08:C6:37:35:79:E6:10:7B:CC:56
|
||||
Timestamp : Mar 10 22:26:03.415 2019 GMT
|
||||
Extensions: none
|
||||
Signature : ecdsa-with-SHA256
|
||||
30:45:02:21:00:98:49:3F:B0:C4:66:2D:CF:CE:91:36:
|
||||
15:AF:75:94:5B:FD:C2:CB:8F:F1:E2:8D:FA:C0:61:8E:
|
||||
E6:F3:7B:A8:05:02:20:62:39:0F:66:B2:79:48:A8:49:
|
||||
41:2A:D4:59:86:C3:FA:AC:C1:5D:26:02:AC:E3:D8:C8:
|
||||
0F:40:34:64:F1:D1:36
|
||||
Signed Certificate Timestamp:
|
||||
Version : v1 (0x0)
|
||||
Log ID : 29:3C:51:96:54:C8:39:65:BA:AA:50:FC:58:07:D4:B7:
|
||||
6F:BF:58:7A:29:72:DC:A4:C3:0C:F4:E5:45:47:F4:78
|
||||
Timestamp : Mar 10 22:26:03.442 2019 GMT
|
||||
Extensions: none
|
||||
Signature : ecdsa-with-SHA256
|
||||
30:46:02:21:00:C7:09:49:5A:96:E5:B5:15:2A:F1:EA:
|
||||
03:A4:7D:10:89:23:9A:C2:C9:9F:35:85:AD:87:11:58:
|
||||
A8:95:5C:0A:C6:02:21:00:88:14:C8:48:C7:6B:96:DB:
|
||||
A2:AB:91:BD:F7:3D:AD:FA:37:F6:AD:BF:D7:24:DC:F0:
|
||||
11:CF:0C:D4:42:E0:72:A5
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
42:55:9f:ea:ae:79:1d:9d:e9:06:23:a1:d0:a9:0f:d2:bc:08:
|
||||
92:b6:05:30:29:c2:00:fc:96:6e:b1:ff:9b:00:d7:c3:7b:34:
|
||||
47:02:81:2a:44:46:85:6c:7a:f5:c3:09:e2:9c:fd:1d:d3:2c:
|
||||
a4:e9:a5:99:ec:47:bd:fe:39:d2:c9:d6:ac:dd:48:40:0b:9a:
|
||||
24:f1:0b:4e:02:62:aa:63:e4:dd:8f:ad:9a:6c:5a:0a:de:d0:
|
||||
a2:67:b2:ea:fa:68:ff:18:ea:e1:73:35:89:45:dd:b7:ac:2d:
|
||||
58:8a:a3:6d:eb:41:f6:fa:60:8f:39:38:33:a0:d5:fd:56:5d:
|
||||
02:08:80:40:f6:f0:c1:68:e1:15:c8:fc:c3:64:a5:43:85:18:
|
||||
ed:44:5d:f8:b9:20:43:9f:3d:8b:20:e0:55:cd:78:89:d4:db:
|
||||
80:23:88:0e:6f:f5:ef:66:52:a9:c6:b1:f1:5e:6c:d6:8e:18:
|
||||
7a:93:14:65:4b:1b:a7:55:7d:9d:a5:d2:15:a8:7d:a1:aa:dd:
|
||||
ef:93:94:d5:3e:2f:ce:4b:bf:ac:e5:61:da:66:61:bd:42:08:
|
||||
53:58:73:a7:80:64:78:17:60:11:71:7f:75:17:bc:24:2f:57:
|
||||
8c:61:37:87:4e:0a:41:82:74:b0:69:14:5c:89:58:55:32:1f:
|
||||
06:1b:e2:24
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
|
||||
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
|
||||
DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow
|
||||
SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT
|
||||
GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC
|
||||
AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF
|
||||
q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8
|
||||
SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0
|
||||
Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA
|
||||
a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj
|
||||
/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T
|
||||
AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG
|
||||
CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv
|
||||
bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k
|
||||
c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw
|
||||
VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC
|
||||
ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz
|
||||
MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu
|
||||
Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF
|
||||
AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo
|
||||
uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/
|
||||
wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu
|
||||
X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG
|
||||
PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6
|
||||
KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
|
||||
|
||||
|
||||
GlobalSign Root CA
|
||||
@@ -2943,106 +3238,6 @@ JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo
|
||||
Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
DST ACES CA X6
|
||||
# Issuer: CN=DST ACES CA X6,OU=DST ACES,O=Digital Signature Trust,C=US
|
||||
# Serial Number:0d:5e:99:0a:d6:9d:b7:78:ec:d8:07:56:3b:86:15:d9
|
||||
# Subject: CN=DST ACES CA X6,OU=DST ACES,O=Digital Signature Trust,C=US
|
||||
# Not Valid Before: Thu Nov 20 21:19:58 2003
|
||||
# Not Valid After : Mon Nov 20 21:19:58 2017
|
||||
# Fingerprint (MD5): 21:D8:4C:82:2B:99:09:33:A2:EB:14:24:8D:8E:5F:E8
|
||||
# Fingerprint (SHA1): 40:54:DA:6F:1C:3F:40:74:AC:ED:0F:EC:CD:DB:79:D1:53:FB:90:1D
|
||||
TRUSTED_DELEGATOR: SERVER_AUTH
|
||||
MUST_VERIFY_TRUST: EMAIL_PROTECTION, CODE_SIGNING
|
||||
=================================================
|
||||
MD5 Fingerprint=21:D8:4C:82:2B:99:09:33:A2:EB:14:24:8D:8E:5F:E8
|
||||
Certificate:
|
||||
Data:
|
||||
Version: 3 (0x2)
|
||||
Serial Number:
|
||||
0d:5e:99:0a:d6:9d:b7:78:ec:d8:07:56:3b:86:15:d9
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
Issuer: C=US, O=Digital Signature Trust, OU=DST ACES, CN=DST ACES CA X6
|
||||
Validity
|
||||
Not Before: Nov 20 21:19:58 2003 GMT
|
||||
Not After : Nov 20 21:19:58 2017 GMT
|
||||
Subject: C=US, O=Digital Signature Trust, OU=DST ACES, CN=DST ACES CA X6
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
Public-Key: (2048 bit)
|
||||
Modulus:
|
||||
00:b9:3d:f5:2c:c9:94:dc:75:8a:95:5d:63:e8:84:
|
||||
77:76:66:b9:59:91:5c:46:dd:92:3e:9f:f9:0e:03:
|
||||
b4:3d:61:92:bd:23:26:b5:63:ee:92:d2:9e:d6:3c:
|
||||
c8:0d:90:5f:64:81:b1:a8:08:0d:4c:d8:f9:d3:05:
|
||||
28:52:b4:01:25:c5:95:1c:0c:7e:3e:10:84:75:cf:
|
||||
c1:19:91:63:cf:e8:a8:91:88:b9:43:52:bb:80:b1:
|
||||
55:89:8b:31:fa:d0:b7:76:be:41:3d:30:9a:a4:22:
|
||||
25:17:73:e8:1e:e2:d3:ac:2a:bd:5b:38:21:d5:2a:
|
||||
4b:d7:55:7d:e3:3a:55:bd:d7:6d:6b:02:57:6b:e6:
|
||||
47:7c:08:c8:82:ba:de:a7:87:3d:a1:6d:b8:30:56:
|
||||
c2:b3:02:81:5f:2d:f5:e2:9a:30:18:28:b8:66:d3:
|
||||
cb:01:96:6f:ea:8a:45:55:d6:e0:9d:ff:67:2b:17:
|
||||
02:a6:4e:1a:6a:11:0b:7e:b7:7b:e7:98:d6:8c:76:
|
||||
6f:c1:3b:db:50:93:7e:e5:d0:8e:1f:37:b8:bd:ba:
|
||||
c6:9f:6c:e9:7c:33:f2:32:3c:26:47:fa:27:24:02:
|
||||
c9:7e:1d:5b:88:42:13:6a:35:7c:7d:35:e9:2e:66:
|
||||
91:72:93:d5:32:26:c4:74:f5:53:a3:b3:5d:9a:f6:
|
||||
09:cb
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Basic Constraints: critical
|
||||
CA:TRUE
|
||||
X509v3 Key Usage: critical
|
||||
Digital Signature, Non Repudiation, Certificate Sign, CRL Sign
|
||||
X509v3 Subject Alternative Name:
|
||||
email:pki-ops@trustdst.com
|
||||
X509v3 Certificate Policies:
|
||||
Policy: 2.16.840.1.101.3.2.1.1.1
|
||||
CPS: http://www.trustdst.com/certificates/policy/ACES-index.html
|
||||
|
||||
X509v3 Subject Key Identifier:
|
||||
09:72:06:4E:18:43:0F:E5:D6:CC:C3:6A:8B:31:7B:78:8F:A8:83:B8
|
||||
Signature Algorithm: sha1WithRSAEncryption
|
||||
a3:d8:8e:d6:b2:db:ce:05:e7:32:cd:01:d3:04:03:e5:76:e4:
|
||||
56:2b:9c:99:90:e8:08:30:6c:df:7d:3d:ee:e5:bf:b5:24:40:
|
||||
84:49:e1:d1:28:ae:c4:c2:3a:53:30:88:f1:f5:77:6e:51:ca:
|
||||
fa:ff:99:af:24:5f:1b:a0:fd:f2:ac:84:ca:df:a9:f0:5f:04:
|
||||
2e:ad:16:bf:21:97:10:81:3d:e3:ff:87:8d:32:dc:94:e5:47:
|
||||
8a:5e:6a:13:c9:94:95:3d:d2:ee:c8:34:95:d0:80:d4:ad:32:
|
||||
08:80:54:3c:e0:bd:52:53:d7:52:7c:b2:69:3f:7f:7a:cf:6a:
|
||||
74:ca:fa:04:2a:9c:4c:5a:06:a5:e9:20:ad:45:66:0f:69:f1:
|
||||
dd:bf:e9:e3:32:8b:fa:e0:c1:86:4d:72:3c:2e:d8:93:78:0a:
|
||||
2a:f8:d8:d2:27:3d:19:89:5f:5a:7b:8a:3b:cc:0c:da:51:ae:
|
||||
c7:0b:f7:2b:b0:37:05:ec:bc:57:23:e2:38:d2:9b:68:f3:56:
|
||||
12:88:4f:42:7c:b8:31:c4:b5:db:e4:c8:21:34:e9:48:11:35:
|
||||
ee:fa:c7:92:57:c5:9f:34:e4:c7:f6:f7:0e:0b:4c:9c:68:78:
|
||||
7b:71:31:c7:eb:1e:e0:67:41:f3:b7:a0:a7:cd:e5:7a:33:36:
|
||||
6a:fa:9a:2b
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBb
|
||||
MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3Qx
|
||||
ETAPBgNVBAsTCERTVCBBQ0VTMRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0w
|
||||
MzExMjAyMTE5NThaFw0xNzExMjAyMTE5NThaMFsxCzAJBgNVBAYTAlVTMSAwHgYD
|
||||
VQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UECxMIRFNUIEFDRVMx
|
||||
FzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
|
||||
MIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPu
|
||||
ktKe1jzIDZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7
|
||||
gLFViYsx+tC3dr5BPTCapCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZH
|
||||
fAjIgrrep4c9oW24MFbCswKBXy314powGCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4a
|
||||
ahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPyMjwmR/onJALJfh1biEIT
|
||||
ajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1UdEwEB/wQF
|
||||
MAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rk
|
||||
c3QuY29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjto
|
||||
dHRwOi8vd3d3LnRydXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMt
|
||||
aW5kZXguaHRtbDAdBgNVHQ4EFgQUCXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZI
|
||||
hvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V25FYrnJmQ6AgwbN99Pe7lv7Uk
|
||||
QIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6tFr8hlxCBPeP/
|
||||
h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq
|
||||
nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpR
|
||||
rscL9yuwNwXsvFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf2
|
||||
9w4LTJxoeHtxMcfrHuBnQfO3oKfN5XozNmr6mis=
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
SwissSign Gold CA - G2
|
||||
# Issuer: CN=SwissSign Gold CA - G2,O=SwissSign AG,C=CH
|
||||
# Serial Number:00:bb:40:1c:43:f5:5e:4f:b0
|
||||
|
||||
@@ -211,12 +211,6 @@
|
||||
<string>NoHardwareProbe</string>
|
||||
</map>
|
||||
|
||||
<key>noquicktime</key>
|
||||
<map>
|
||||
<key>map-to</key>
|
||||
<string>NoQuickTime</string>
|
||||
</map>
|
||||
|
||||
<key>nosound</key>
|
||||
<map>
|
||||
<key>map-to</key>
|
||||
|
||||
@@ -454,6 +454,8 @@
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
<key>IsCOA</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>AOAdvanced</key>
|
||||
<map>
|
||||
@@ -476,6 +478,21 @@
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
<key>IsCOA</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>AOSwimEnabled</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Overrides fly animations with swims when underwater.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
<key>IsCOA</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>AONoStandsInMouselook</key>
|
||||
<map>
|
||||
@@ -827,7 +844,7 @@
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>LiruMiniBuildFloater</key>
|
||||
<map>
|
||||
@@ -1159,17 +1176,6 @@ Found in Advanced->Rendering->Info Displays</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FloaterUnfocusedBackgroundOpaque</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Disables floaters going transparent when not in focus, may conflict with some skins, though.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSSynchronizeTextureMaps</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -1190,7 +1196,7 @@ Found in Advanced->Rendering->Info Displays</string>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>InstantMessageLogPathAnyAccount</key>
|
||||
<map>
|
||||
@@ -1532,15 +1538,6 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>InventorySortOrder</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Specifies sort key for inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)</string>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>3</integer>
|
||||
</map>
|
||||
<key>Blacklist.Settings</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -2560,6 +2557,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<real>300.0</real>
|
||||
</map>
|
||||
<key>ActiveFloaterTransparency</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Transparency of active floaters (floaters that have focus)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>AdvanceSnapshot</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -5468,6 +5476,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>DebugHideEmptySystemFolders</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Hide empty system folders when on</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>DebugInventoryFilters</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -7683,6 +7702,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>24</integer>
|
||||
</map>
|
||||
<key>RadarColumnNotesWidth</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Width for radar's notes column</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>24</integer>
|
||||
</map>
|
||||
<key>RadarColumnAgeWidth</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -7771,6 +7801,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>RadarColumnNotesHidden</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Hide radar's notes column</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>RadarColumnAgeHidden</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -7839,6 +7880,28 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>RadarAlertFlood</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Show the flood of people arriving and (if RadarAlertFloodLeaving) leaving when you login and when you open/close the Radar with RadarKeepOpen off.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>RadarAlertFloodLeaving</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>When activated along with RadarAlertFlood shows the flood of people leaving when you close the Radar with RadarKeepOpen off.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>RadarAlertShowDist</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -8109,10 +8172,26 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<integer>0</integer>
|
||||
</array>
|
||||
</map>
|
||||
<key>FloaterOutboxRect</key>
|
||||
<key>FloaterMarketplaceListingsRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Rectangle for merchant outbox window</string>
|
||||
<string>Rectangle for Marketplace Listings window</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Rect</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<integer>0</integer>
|
||||
<integer>342</integer>
|
||||
<integer>310</integer>
|
||||
<integer>52</integer>
|
||||
</array>
|
||||
</map>
|
||||
<key>FloaterMarketplaceValidationRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Rectangle for Marketplace Validation window</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
@@ -9099,6 +9178,22 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>400</integer>
|
||||
</map>
|
||||
<key>HTMLAgentColor</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Color of hyperlinked user/object names</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Color4</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<real>0.600000023842</real>
|
||||
<real>0.600000023842</real>
|
||||
<real>1.0</real>
|
||||
<real>1.0</real>
|
||||
</array>
|
||||
</map>
|
||||
<key>HTMLLinkColor</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -9339,6 +9434,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>InactiveFloaterTransparency</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Transparency of inactive floaters (floaters that have no focus)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>InBandwidth</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -9416,12 +9522,12 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>InventoryDisplayOutbox</key>
|
||||
<key>InventoryOutboxDisplayBoth</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Override merchant inventory outbox display</string>
|
||||
<string>Show the legacy Merchant Outbox UI as well as the Marketplace Listings UI</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
@@ -9438,6 +9544,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>InventoryOutboxMakeVisible</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Enable making the Merchant Outbox and Inbox visible in the inventory for debug purposes.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>InventoryOutboxMaxFolderCount</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -9447,7 +9564,7 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>21</integer>
|
||||
<integer>20</integer>
|
||||
</map>
|
||||
<key>InventoryOutboxMaxFolderDepth</key>
|
||||
<map>
|
||||
@@ -9471,6 +9588,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>200</integer>
|
||||
</map>
|
||||
<key>InventoryOutboxMaxStockItemCount</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Maximum number of items allowed in a stock folder.</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>200</integer>
|
||||
</map>
|
||||
<key>InventorySortOrder</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -9482,6 +9610,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>7</integer>
|
||||
</map>
|
||||
<key>MarketplaceListingsSortOrder</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Specifies sort for marketplace listings</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>2</integer>
|
||||
</map>
|
||||
<key>InvertMouse</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -10323,6 +10462,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<string/>
|
||||
</map>
|
||||
<key>MarketplaceListingsLogging</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Enable debug output associated with the Marketplace Listings (SLM) API.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>MaxDragDistance</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -13838,7 +13988,7 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>RenderHideGroupTitle</key>
|
||||
<map>
|
||||
|
||||
@@ -818,6 +818,17 @@
|
||||
<key>Value</key>
|
||||
<string>/regionsay</string>
|
||||
</map>
|
||||
<key>SinguCmdLineSetting</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Set or toggle debug settings from the chatbar.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>/setdebug</string>
|
||||
</map>
|
||||
<key>SinguCmdLineURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -862,17 +873,6 @@
|
||||
<key>Value</key>
|
||||
<real>0</real>
|
||||
</map>
|
||||
<key>SinguMotionResetsCamera</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Allow camera to reset when moving.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>SinguLastKnownReleaseBuild</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -895,6 +895,54 @@
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>SinguMotionResetsCamera</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Allow camera to reset when moving.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>SinguMotionResetsCameraReset</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Disable for the behavior Liru intended SinguMotionResetsCamera to have, wherein it doesn't reset every time you press escape, teleport, or whatever else! So you can walk around and your camera won't reset at all like it was meant to be.
|
||||
RIP Latif Khalifa.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>SinguPostProcessDefault</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Default post process preset, changing this will change your active preset</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<boolean>Default</boolean>
|
||||
</map>
|
||||
<key>SinguReplaceLinks</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Whether or not to visually replace special links like SLURLs with labels where applicable.
|
||||
While having this on allows people to mislead you with links that look like other links, it also allows you to use SLURLs that appear as people's names and increasingly more scripts use this to run faster.
|
||||
You can always select the text, right click and select Copy Raw to copy the hidden contents of the link.
|
||||
Changing this setting only affects new text.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>WarnRecommendedUpdate</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -1006,6 +1054,28 @@
|
||||
<key>Value</key>
|
||||
<real>3.5</real>
|
||||
</map>
|
||||
<key>EmergencyTeleportSeconds</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>The remaining time left in seconds when to execute an emergency teleport out of a restarting region.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>20</integer>
|
||||
</map>
|
||||
<key>LiruEnableWIPUI</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Whether or not to enable UI components that probably don't work yet.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>LiruFlashWhenMinimized</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -1713,6 +1783,17 @@
|
||||
<key>IsCOA</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>ToolbarVisibleMarketplaceListings</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Whether or not the button for marketplace listings is on the toolbar</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>ToolbarVisibleMeanEvents</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -1843,10 +1924,10 @@
|
||||
<key>IsCOA</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>ToolbarVisibleOutbox</key>
|
||||
<key>ToolbarVisibleMarketplaceListings</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Whether or not the button for outbox is on the toolbar</string>
|
||||
<string>Whether or not the button for Marketplace Listings is on the toolbar</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
@@ -1869,19 +1950,6 @@
|
||||
<key>IsCOA</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>ToolbarVisibleOutbox</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Whether or not the button for the merchant outbox is on the toolbar</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
<key>IsCOA</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>ToolbarVisibleOutfit</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -186,6 +186,61 @@
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>AODefaultTyping</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Default typing anim</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>AODefaultFloat</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Default float anim</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>AODefaultSwim</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Default swim anim</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>AODefaultSwimUp</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Default swimup anim</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>AODefaultSwimDown</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Default swimdown anim</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string></string>
|
||||
</map>
|
||||
<key>AODefaultStandUp</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -715,6 +770,17 @@
|
||||
<key>Value</key>
|
||||
<string>-%Y-%m</string>
|
||||
</map>
|
||||
<key>ShowFavoritesOnLogin</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Determines whether favorites of last logged in user will be saved on exit from viewer and shown on login screen</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
|
||||
<key>KeywordsChangeColor</key>
|
||||
<map>
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<real>4.5799999237060547</real>
|
||||
<key>bloom_width</key>
|
||||
<real>12.539999961853027</real>
|
||||
<key>gamma</key>
|
||||
<real>1.0</real>
|
||||
<key>brightness</key>
|
||||
<real>0.89999997615814209</real>
|
||||
<key>brightness_multiplier</key>
|
||||
@@ -42,6 +44,8 @@
|
||||
<real>1.5</real>
|
||||
<key>bloom_width</key>
|
||||
<real>2.25</real>
|
||||
<key>gamma</key>
|
||||
<real>1.0</real>
|
||||
<key>brightness</key>
|
||||
<real>1</real>
|
||||
<key>brightness_multiplier</key>
|
||||
@@ -144,7 +148,7 @@
|
||||
<key>saturation</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>default</key>
|
||||
<key>Default</key>
|
||||
<map>
|
||||
<key>bloom_strength</key>
|
||||
<real>1.5</real>
|
||||
@@ -173,12 +177,12 @@
|
||||
<boolean>0</boolean>
|
||||
<key>enable_gauss_blur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_posterize</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_motionblur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_vignette</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_posterize</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_motionblur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_vignette</key>
|
||||
<boolean>0</boolean>
|
||||
<key>gauss_blur_passes</key>
|
||||
<integer>2</integer>
|
||||
<key>extract_high</key>
|
||||
@@ -191,82 +195,20 @@
|
||||
<real>0.40000000000000002</real>
|
||||
<key>saturation</key>
|
||||
<real>1</real>
|
||||
<key>posterize_layers</key>
|
||||
<real>10</real>
|
||||
<key>blur_strength</key>
|
||||
<real>10</real>
|
||||
<key>vignette_strength</key>
|
||||
<real>0.85</real>
|
||||
<key>vignette_radius</key>
|
||||
<real>0.7</real>
|
||||
<key>vignette_darkness</key>
|
||||
<real>1.0</real>
|
||||
<key>vignette_desaturation</key>
|
||||
<real>1.0</real>
|
||||
<key>vignette_chromatic_aberration</key>
|
||||
<real>0.01</real>
|
||||
</map>
|
||||
<key>PyFx None</key>
|
||||
<map>
|
||||
<key>bloom_strength</key>
|
||||
<real>1.5</real>
|
||||
<key>bloom_width</key>
|
||||
<real>2.25</real>
|
||||
<key>blur_strength</key>
|
||||
<real>10</real>
|
||||
<key>brightness</key>
|
||||
<real>1</real>
|
||||
<key>brightness_multiplier</key>
|
||||
<real>3</real>
|
||||
<key>contrast</key>
|
||||
<real>1</real>
|
||||
<key>contrast_base</key>
|
||||
<array>
|
||||
<real>1</real>
|
||||
<real>1</real>
|
||||
<real>1</real>
|
||||
<real>0.5</real>
|
||||
</array>
|
||||
<key>enable_bloom</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_color_filter</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_gauss_blur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_motionblur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_night_vision</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_posterize</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_vignette</key>
|
||||
<boolean>0</boolean>
|
||||
<key>extract_high</key>
|
||||
<real>1</real>
|
||||
<key>extract_low</key>
|
||||
<real>0.949999999999999955591079</real>
|
||||
<key>gamma</key>
|
||||
<real>1</real>
|
||||
<key>gauss_blur_passes</key>
|
||||
<integer>2</integer>
|
||||
<key>noise_size</key>
|
||||
<real>25</real>
|
||||
<key>noise_strength</key>
|
||||
<real>0.4000000000000000222044605</real>
|
||||
<key>posterize_layers</key>
|
||||
<real>10</real>
|
||||
<key>saturation</key>
|
||||
<real>1</real>
|
||||
<key>vignette_chromatic_aberration</key>
|
||||
<real>0.01000000000000000020816682</real>
|
||||
<key>vignette_darkness</key>
|
||||
<real>1</real>
|
||||
<key>vignette_desaturation</key>
|
||||
<real>1</real>
|
||||
<key>vignette_radius</key>
|
||||
<real>0.699999999999999955591079</real>
|
||||
<key>blur_strength</key>
|
||||
<real>10</real>
|
||||
<key>vignette_strength</key>
|
||||
<real>0.8499999999999999777955395</real>
|
||||
<real>0.85</real>
|
||||
<key>vignette_radius</key>
|
||||
<real>0.7</real>
|
||||
<key>vignette_darkness</key>
|
||||
<real>1.0</real>
|
||||
<key>vignette_desaturation</key>
|
||||
<real>1.0</real>
|
||||
<key>vignette_chromatic_aberration</key>
|
||||
<real>0.01</real>
|
||||
</map>
|
||||
<key>PyFX CatVision v1</key>
|
||||
<map>
|
||||
@@ -826,7 +768,7 @@
|
||||
<key>vignette_strength</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>PyFX v1</key>
|
||||
<key>PyFX Twilight v1 Cold</key>
|
||||
<map>
|
||||
<key>bloom_strength</key>
|
||||
<real>1.5</real>
|
||||
@@ -835,15 +777,77 @@
|
||||
<key>blur_strength</key>
|
||||
<real>30</real>
|
||||
<key>brightness</key>
|
||||
<real>1.19999992847442626953125</real>
|
||||
<real>1.25</real>
|
||||
<key>brightness_multiplier</key>
|
||||
<real>3</real>
|
||||
<key>contrast</key>
|
||||
<real>1.25</real>
|
||||
<real>1.0299999713897705078125</real>
|
||||
<key>contrast_base</key>
|
||||
<array>
|
||||
<real>0.7999999523162841796875</real>
|
||||
<real>0.89999997615814208984375</real>
|
||||
<real>1</real>
|
||||
<real>0.329999983310699462890625</real>
|
||||
<real>0</real>
|
||||
<real>1</real>
|
||||
</array>
|
||||
<key>enable_bloom</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_color_filter</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_gauss_blur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_motionblur</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_night_vision</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_posterize</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_vignette</key>
|
||||
<integer>1</integer>
|
||||
<key>extract_high</key>
|
||||
<real>1</real>
|
||||
<key>extract_low</key>
|
||||
<real>0.949999999999999955591079</real>
|
||||
<key>gamma</key>
|
||||
<real>1.5</real>
|
||||
<key>gauss_blur_passes</key>
|
||||
<integer>2</integer>
|
||||
<key>noise_size</key>
|
||||
<real>25</real>
|
||||
<key>noise_strength</key>
|
||||
<real>0.4000000000000000222044605</real>
|
||||
<key>posterize_layers</key>
|
||||
<real>10</real>
|
||||
<key>saturation</key>
|
||||
<real>0.5</real>
|
||||
<key>vignette_chromatic_aberration</key>
|
||||
<real>0.005000000353902578353881836</real>
|
||||
<key>vignette_darkness</key>
|
||||
<real>1</real>
|
||||
<key>vignette_desaturation</key>
|
||||
<real>0.4000000059604644775390625</real>
|
||||
<key>vignette_radius</key>
|
||||
<real>5</real>
|
||||
<key>vignette_strength</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>PyFX Twilight v1 Warm</key>
|
||||
<map>
|
||||
<key>bloom_strength</key>
|
||||
<real>1.5</real>
|
||||
<key>bloom_width</key>
|
||||
<real>2.25</real>
|
||||
<key>blur_strength</key>
|
||||
<real>30</real>
|
||||
<key>brightness</key>
|
||||
<real>1.25</real>
|
||||
<key>brightness_multiplier</key>
|
||||
<real>3</real>
|
||||
<key>contrast</key>
|
||||
<real>1.0299999713897705078125</real>
|
||||
<key>contrast_base</key>
|
||||
<array>
|
||||
<real>0</real>
|
||||
<real>0.66999995708465576171875</real>
|
||||
<real>1</real>
|
||||
<real>1</real>
|
||||
</array>
|
||||
@@ -866,7 +870,7 @@
|
||||
<key>extract_low</key>
|
||||
<real>0.949999999999999955591079</real>
|
||||
<key>gamma</key>
|
||||
<real>2</real>
|
||||
<real>1.5</real>
|
||||
<key>gauss_blur_passes</key>
|
||||
<integer>2</integer>
|
||||
<key>noise_size</key>
|
||||
@@ -876,15 +880,15 @@
|
||||
<key>posterize_layers</key>
|
||||
<real>10</real>
|
||||
<key>saturation</key>
|
||||
<real>0.7999999523162841796875</real>
|
||||
<real>0.5</real>
|
||||
<key>vignette_chromatic_aberration</key>
|
||||
<real>0.004500000271946191787719727</real>
|
||||
<real>0.005000000353902578353881836</real>
|
||||
<key>vignette_darkness</key>
|
||||
<real>1</real>
|
||||
<key>vignette_desaturation</key>
|
||||
<real>0</real>
|
||||
<real>0.4000000059604644775390625</real>
|
||||
<key>vignette_radius</key>
|
||||
<real>1.5</real>
|
||||
<real>5</real>
|
||||
<key>vignette_strength</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
@@ -950,7 +954,69 @@
|
||||
<key>vignette_strength</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>PyFx default</key>
|
||||
<key>PyFX Vivid v1 Cold</key>
|
||||
<map>
|
||||
<key>bloom_strength</key>
|
||||
<real>1.5</real>
|
||||
<key>bloom_width</key>
|
||||
<real>2.25</real>
|
||||
<key>blur_strength</key>
|
||||
<real>30</real>
|
||||
<key>brightness</key>
|
||||
<real>1.19999992847442626953125</real>
|
||||
<key>brightness_multiplier</key>
|
||||
<real>3</real>
|
||||
<key>contrast</key>
|
||||
<real>1.25</real>
|
||||
<key>contrast_base</key>
|
||||
<array>
|
||||
<real>1</real>
|
||||
<real>0.89999997615814208984375</real>
|
||||
<real>0.7999999523162841796875</real>
|
||||
<real>1</real>
|
||||
</array>
|
||||
<key>enable_bloom</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_color_filter</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_gauss_blur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_motionblur</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_night_vision</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_posterize</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_vignette</key>
|
||||
<integer>1</integer>
|
||||
<key>extract_high</key>
|
||||
<real>1</real>
|
||||
<key>extract_low</key>
|
||||
<real>0.949999999999999955591079</real>
|
||||
<key>gamma</key>
|
||||
<real>2</real>
|
||||
<key>gauss_blur_passes</key>
|
||||
<integer>2</integer>
|
||||
<key>noise_size</key>
|
||||
<real>25</real>
|
||||
<key>noise_strength</key>
|
||||
<real>0.4000000000000000222044605</real>
|
||||
<key>posterize_layers</key>
|
||||
<real>10</real>
|
||||
<key>saturation</key>
|
||||
<real>1.19999980926513671875</real>
|
||||
<key>vignette_chromatic_aberration</key>
|
||||
<real>0.004500000271946191787719727</real>
|
||||
<key>vignette_darkness</key>
|
||||
<real>1</real>
|
||||
<key>vignette_desaturation</key>
|
||||
<real>0</real>
|
||||
<key>vignette_radius</key>
|
||||
<real>2.9999997615814208984375</real>
|
||||
<key>vignette_strength</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>PyFX v1</key>
|
||||
<map>
|
||||
<key>bloom_strength</key>
|
||||
<real>1.5</real>
|
||||
@@ -972,7 +1038,7 @@
|
||||
<real>1</real>
|
||||
</array>
|
||||
<key>enable_bloom</key>
|
||||
<boolean>1</boolean>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_color_filter</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_gauss_blur</key>
|
||||
@@ -1012,5 +1078,191 @@
|
||||
<key>vignette_strength</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>PyFX v2</key>
|
||||
<map>
|
||||
<key>bloom_strength</key>
|
||||
<real>1.5</real>
|
||||
<key>bloom_width</key>
|
||||
<real>2.25</real>
|
||||
<key>blur_strength</key>
|
||||
<real>30</real>
|
||||
<key>brightness</key>
|
||||
<real>1</real>
|
||||
<key>brightness_multiplier</key>
|
||||
<real>3</real>
|
||||
<key>contrast</key>
|
||||
<real>2</real>
|
||||
<key>contrast_base</key>
|
||||
<array>
|
||||
<real>0.949999988079071044921875</real>
|
||||
<real>0.969999969005584716796875</real>
|
||||
<real>1</real>
|
||||
<real>1</real>
|
||||
</array>
|
||||
<key>enable_bloom</key>
|
||||
<boolean>1</boolean>
|
||||
<key>enable_color_filter</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_gauss_blur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_motionblur</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_night_vision</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_posterize</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_vignette</key>
|
||||
<integer>1</integer>
|
||||
<key>extract_high</key>
|
||||
<real>1</real>
|
||||
<key>extract_low</key>
|
||||
<real>0.949999999999999955591079</real>
|
||||
<key>gamma</key>
|
||||
<real>5</real>
|
||||
<key>gauss_blur_passes</key>
|
||||
<integer>2</integer>
|
||||
<key>noise_size</key>
|
||||
<real>25</real>
|
||||
<key>noise_strength</key>
|
||||
<real>0.4000000000000000222044605</real>
|
||||
<key>posterize_layers</key>
|
||||
<real>10</real>
|
||||
<key>saturation</key>
|
||||
<real>1</real>
|
||||
<key>vignette_chromatic_aberration</key>
|
||||
<real>0.004500000271946191787719727</real>
|
||||
<key>vignette_darkness</key>
|
||||
<real>1</real>
|
||||
<key>vignette_desaturation</key>
|
||||
<real>0</real>
|
||||
<key>vignette_radius</key>
|
||||
<real>1.5</real>
|
||||
<key>vignette_strength</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>PyFX v3</key>
|
||||
<map>
|
||||
<key>bloom_strength</key>
|
||||
<real>1.5</real>
|
||||
<key>bloom_width</key>
|
||||
<real>2.25</real>
|
||||
<key>blur_strength</key>
|
||||
<real>30</real>
|
||||
<key>brightness</key>
|
||||
<real>1</real>
|
||||
<key>brightness_multiplier</key>
|
||||
<real>3</real>
|
||||
<key>contrast</key>
|
||||
<real>1.75</real>
|
||||
<key>contrast_base</key>
|
||||
<array>
|
||||
<real>0.949999988079071044921875</real>
|
||||
<real>0.969999969005584716796875</real>
|
||||
<real>1</real>
|
||||
<real>1</real>
|
||||
</array>
|
||||
<key>enable_bloom</key>
|
||||
<boolean>1</boolean>
|
||||
<key>enable_color_filter</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_gauss_blur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_motionblur</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_night_vision</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_posterize</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_vignette</key>
|
||||
<integer>1</integer>
|
||||
<key>extract_high</key>
|
||||
<real>1</real>
|
||||
<key>extract_low</key>
|
||||
<real>0.949999999999999955591079</real>
|
||||
<key>gamma</key>
|
||||
<real>4</real>
|
||||
<key>gauss_blur_passes</key>
|
||||
<integer>2</integer>
|
||||
<key>noise_size</key>
|
||||
<real>25</real>
|
||||
<key>noise_strength</key>
|
||||
<real>0.4000000000000000222044605</real>
|
||||
<key>posterize_layers</key>
|
||||
<real>10</real>
|
||||
<key>saturation</key>
|
||||
<real>1.099999904632568359375</real>
|
||||
<key>vignette_chromatic_aberration</key>
|
||||
<real>0.004500000271946191787719727</real>
|
||||
<key>vignette_darkness</key>
|
||||
<real>0.66999995708465576171875</real>
|
||||
<key>vignette_desaturation</key>
|
||||
<real>0</real>
|
||||
<key>vignette_radius</key>
|
||||
<real>2.9999997615814208984375</real>
|
||||
<key>vignette_strength</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
<key>PyFX Default</key>
|
||||
<map>
|
||||
<key>bloom_strength</key>
|
||||
<real>1.5</real>
|
||||
<key>bloom_width</key>
|
||||
<real>2.25</real>
|
||||
<key>blur_strength</key>
|
||||
<real>30</real>
|
||||
<key>brightness</key>
|
||||
<real>1</real>
|
||||
<key>brightness_multiplier</key>
|
||||
<real>3</real>
|
||||
<key>contrast</key>
|
||||
<real>1.75</real>
|
||||
<key>contrast_base</key>
|
||||
<array>
|
||||
<real>0.949999988079071044921875</real>
|
||||
<real>0.969999969005584716796875</real>
|
||||
<real>1</real>
|
||||
<real>1</real>
|
||||
</array>
|
||||
<key>enable_bloom</key>
|
||||
<boolean>1</boolean>
|
||||
<key>enable_color_filter</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_gauss_blur</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_motionblur</key>
|
||||
<integer>1</integer>
|
||||
<key>enable_night_vision</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_posterize</key>
|
||||
<boolean>0</boolean>
|
||||
<key>enable_vignette</key>
|
||||
<integer>1</integer>
|
||||
<key>extract_high</key>
|
||||
<real>1</real>
|
||||
<key>extract_low</key>
|
||||
<real>0.949999999999999955591079</real>
|
||||
<key>gamma</key>
|
||||
<real>4</real>
|
||||
<key>gauss_blur_passes</key>
|
||||
<integer>2</integer>
|
||||
<key>noise_size</key>
|
||||
<real>25</real>
|
||||
<key>noise_strength</key>
|
||||
<real>0.4000000000000000222044605</real>
|
||||
<key>posterize_layers</key>
|
||||
<real>10</real>
|
||||
<key>saturation</key>
|
||||
<real>1.099999904632568359375</real>
|
||||
<key>vignette_chromatic_aberration</key>
|
||||
<real>0.004500000271946191787719727</real>
|
||||
<key>vignette_darkness</key>
|
||||
<real>0.66999995708465576171875</real>
|
||||
<key>vignette_desaturation</key>
|
||||
<real>0</real>
|
||||
<key>vignette_radius</key>
|
||||
<real>2.9999997615814208984375</real>
|
||||
<key>vignette_strength</key>
|
||||
<real>1</real>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user