Clean up and updates
Cleaned up header bloatyness in linden_common
Moved around things to be in line with Linden Lab
Updated llinitparam and imported its new dependencies
Removed dohexeditor and related files
Removed unused legacy files
/\_..._/\
|/ \_/ \|
| o.-.o |
\ ( O ) /
/'--U--'\
| .:. | /\
| /:;:\ |` /
Drake | |:;:| |-'
Arconis / |'-'| \
`""` `""`
This commit is contained in:
@@ -77,7 +77,6 @@ if (VIEWER)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llxuixml)
|
||||
|
||||
# viewer plugins directory
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}plugins)
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
set(LLXUIXML_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/llxuixml
|
||||
)
|
||||
|
||||
set(LLXUIXML_LIBRARIES llxuixml)
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "lluuid.h"
|
||||
#include "llframetimer.h"
|
||||
#include "llassettype.h"
|
||||
#include "llextendedstatus.h"
|
||||
|
||||
#include "lllistener.h"
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ include_directories(
|
||||
)
|
||||
|
||||
set(llcommon_SOURCE_FILES
|
||||
aiframetimer.cpp
|
||||
imageids.cpp
|
||||
aiframetimer.cpp
|
||||
imageids.cpp
|
||||
indra_constants.cpp
|
||||
llallocator.cpp
|
||||
llallocator_heap_profile.cpp
|
||||
@@ -24,7 +24,7 @@ set(llcommon_SOURCE_FILES
|
||||
llapr.cpp
|
||||
llaprpool.cpp
|
||||
llassettype.cpp
|
||||
llavatarname.cpp
|
||||
llavatarname.cpp
|
||||
llbase32.cpp
|
||||
llbase64.cpp
|
||||
llcommon.cpp
|
||||
@@ -53,6 +53,7 @@ set(llcommon_SOURCE_FILES
|
||||
llformat.cpp
|
||||
llframetimer.cpp
|
||||
llheartbeat.cpp
|
||||
llinitparam.cpp
|
||||
llinstancetracker.cpp
|
||||
llindraconfigfile.cpp
|
||||
llliveappconfig.cpp
|
||||
@@ -171,6 +172,7 @@ set(llcommon_HEADER_FILES
|
||||
llheartbeat.h
|
||||
llhttpstatuscodes.h
|
||||
llindexedqueue.h
|
||||
llinitparam.h
|
||||
llinstancetracker.h
|
||||
llindraconfigfile.h
|
||||
llkeythrottle.h
|
||||
@@ -212,6 +214,7 @@ set(llcommon_HEADER_FILES
|
||||
llsingleton.h
|
||||
llskiplist.h
|
||||
llskipmap.h
|
||||
llsortedvector.h
|
||||
llstack.h
|
||||
llstacktrace.h
|
||||
llstat.h
|
||||
@@ -226,6 +229,7 @@ set(llcommon_HEADER_FILES
|
||||
llthreadsafequeue.h
|
||||
lltimer.h
|
||||
lltreeiterators.h
|
||||
lltypeinfolookup.h
|
||||
lluri.h
|
||||
lluuid.h
|
||||
lluuidhashmap.h
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
#ifndef LL_LINDEN_COMMON_H
|
||||
#define LL_LINDEN_COMMON_H
|
||||
|
||||
// *NOTE: Please keep includes here to a minimum!
|
||||
//
|
||||
// Files included here are included in every library .cpp file and
|
||||
// are not precompiled.
|
||||
|
||||
#include "cwdebug.h"
|
||||
|
||||
#if defined(LL_WINDOWS) && defined(_DEBUG)
|
||||
@@ -55,33 +60,15 @@
|
||||
#include <ctime>
|
||||
#include <iosfwd>
|
||||
|
||||
// Work around Microsoft compiler warnings in STL headers
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning (disable : 4702) // unreachable code
|
||||
#pragma warning (disable : 4244) // conversion from time_t to S32
|
||||
#endif // LL_WINDOWS
|
||||
|
||||
// *TODO: Eliminate these, most library .cpp files don't need them.
|
||||
// Add them to llviewerprecompiledheaders.h if necessary.
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
// Reenable warnings we disabled above
|
||||
#pragma warning (3 : 4702) // unreachable code, we like level 3, not 4
|
||||
// moved msvc warnings to llpreprocessor.h *TODO - delete this comment after merge conflicts are unlikely -brad
|
||||
#endif // LL_WINDOWS
|
||||
|
||||
// Linden only libs in alpha-order other than stdtypes.h
|
||||
// *NOTE: Please keep includes here to a minimum, see above.
|
||||
#include "stdtypes.h"
|
||||
#include "lldefs.h"
|
||||
#include "llerror.h"
|
||||
#include "llextendedstatus.h"
|
||||
// Don't do this, adds 15K lines of header code to every library file.
|
||||
//#include "llfasttimer.h"
|
||||
#include "llfile.h"
|
||||
#include "llformat.h"
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "llerror.h"
|
||||
#include "lltypeinfolookup.h"
|
||||
|
||||
namespace LLInitParam
|
||||
{
|
||||
@@ -205,7 +206,7 @@ namespace LLInitParam
|
||||
mutable std::string mValueName;
|
||||
};
|
||||
|
||||
class Parser
|
||||
class LL_COMMON_API Parser
|
||||
{
|
||||
LOG_CLASS(Parser);
|
||||
|
||||
@@ -227,9 +228,9 @@ namespace LLInitParam
|
||||
typedef bool (*parser_write_func_t)(Parser& parser, const void*, name_stack_t&);
|
||||
typedef boost::function<void (name_stack_t&, S32, S32, const possible_values_t*)> parser_inspect_func_t;
|
||||
|
||||
typedef std::map<const std::type_info*, parser_read_func_t, CompareTypeID> parser_read_func_map_t;
|
||||
typedef std::map<const std::type_info*, parser_write_func_t, CompareTypeID> parser_write_func_map_t;
|
||||
typedef std::map<const std::type_info*, parser_inspect_func_t, CompareTypeID> parser_inspect_func_map_t;
|
||||
typedef LLTypeInfoLookup<parser_read_func_t> parser_read_func_map_t;
|
||||
typedef LLTypeInfoLookup<parser_write_func_t> parser_write_func_map_t;
|
||||
typedef LLTypeInfoLookup<parser_inspect_func_t> parser_inspect_func_map_t;
|
||||
|
||||
Parser(parser_read_func_map_t& read_map, parser_write_func_map_t& write_map, parser_inspect_func_map_t& inspect_map)
|
||||
: mParseSilently(false),
|
||||
@@ -301,7 +302,7 @@ namespace LLInitParam
|
||||
class Param;
|
||||
|
||||
// various callbacks and constraints associated with an individual param
|
||||
struct ParamDescriptor
|
||||
struct LL_COMMON_API ParamDescriptor
|
||||
{
|
||||
struct UserData
|
||||
{
|
||||
@@ -341,7 +342,7 @@ namespace LLInitParam
|
||||
typedef boost::shared_ptr<ParamDescriptor> ParamDescriptorPtr;
|
||||
|
||||
// each derived Block class keeps a static data structure maintaining offsets to various params
|
||||
class BlockDescriptor
|
||||
class LL_COMMON_API BlockDescriptor
|
||||
{
|
||||
public:
|
||||
BlockDescriptor();
|
||||
@@ -369,7 +370,7 @@ namespace LLInitParam
|
||||
class BaseBlock* mCurrentBlockPtr; // pointer to block currently being constructed
|
||||
};
|
||||
|
||||
class BaseBlock
|
||||
class LL_COMMON_API BaseBlock
|
||||
{
|
||||
public:
|
||||
//TODO: implement in terms of owned_ptr
|
||||
@@ -566,7 +567,7 @@ namespace LLInitParam
|
||||
static bool equals(const BaseBlock::Lazy<T>& a, const BaseBlock::Lazy<T>& b) { return !a.empty() || !b.empty(); }
|
||||
};
|
||||
|
||||
class Param
|
||||
class LL_COMMON_API Param
|
||||
{
|
||||
public:
|
||||
void setProvided(bool is_provided = true)
|
||||
@@ -1253,15 +1254,16 @@ namespace LLInitParam
|
||||
return mValues.back();
|
||||
}
|
||||
|
||||
void add(const value_t& item)
|
||||
self_t& add(const value_t& item)
|
||||
{
|
||||
param_value_t param_value;
|
||||
param_value.setValue(item);
|
||||
mValues.push_back(param_value);
|
||||
setProvided();
|
||||
return *this;
|
||||
}
|
||||
|
||||
void add(const typename name_value_lookup_t::name_t& name)
|
||||
self_t& add(const typename name_value_lookup_t::name_t& name)
|
||||
{
|
||||
value_t value;
|
||||
|
||||
@@ -1271,6 +1273,8 @@ namespace LLInitParam
|
||||
add(value);
|
||||
mValues.back().setValueName(name);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// implicit conversion
|
||||
@@ -1441,13 +1445,14 @@ namespace LLInitParam
|
||||
return mValues.back();
|
||||
}
|
||||
|
||||
void add(const value_t& item)
|
||||
self_t& add(const value_t& item)
|
||||
{
|
||||
mValues.push_back(item);
|
||||
setProvided();
|
||||
return *this;
|
||||
}
|
||||
|
||||
void add(const typename name_value_lookup_t::name_t& name)
|
||||
self_t& add(const typename name_value_lookup_t::name_t& name)
|
||||
{
|
||||
value_t value;
|
||||
|
||||
@@ -1457,6 +1462,7 @@ namespace LLInitParam
|
||||
add(value);
|
||||
mValues.back().setValueName(name);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// implicit conversion
|
||||
@@ -2057,8 +2063,8 @@ namespace LLInitParam
|
||||
|
||||
|
||||
// block param interface
|
||||
bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack_range, bool new_name);
|
||||
void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block = NULL) const;
|
||||
LL_COMMON_API bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack_range, bool new_name);
|
||||
LL_COMMON_API void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block = NULL) const;
|
||||
bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const
|
||||
{
|
||||
//TODO: implement LLSD params as schema type Any
|
||||
152
indra/llcommon/llsortedvector.h
Normal file
152
indra/llcommon/llsortedvector.h
Normal file
@@ -0,0 +1,152 @@
|
||||
/**
|
||||
* @file llsortedvector.h
|
||||
* @author Nat Goodspeed
|
||||
* @date 2012-04-08
|
||||
* @brief LLSortedVector class wraps a vector that we maintain in sorted
|
||||
* order so we can perform binary-search lookups.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Copyright (c) 2012, Linden Research, Inc.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#if ! defined(LL_LLSORTEDVECTOR_H)
|
||||
#define LL_LLSORTEDVECTOR_H
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
/**
|
||||
* LLSortedVector contains a std::vector<std::pair> that we keep sorted on the
|
||||
* first of the pair. This makes insertion somewhat more expensive than simple
|
||||
* std::vector::push_back(), but allows us to use binary search for lookups.
|
||||
* It's intended for small aggregates where lookup is far more performance-
|
||||
* critical than insertion; in such cases a binary search on a small, sorted
|
||||
* std::vector can be more performant than a std::map lookup.
|
||||
*/
|
||||
template <typename KEY, typename VALUE>
|
||||
class LLSortedVector
|
||||
{
|
||||
public:
|
||||
typedef LLSortedVector<KEY, VALUE> self;
|
||||
typedef KEY key_type;
|
||||
typedef VALUE mapped_type;
|
||||
typedef std::pair<key_type, mapped_type> value_type;
|
||||
typedef std::vector<value_type> PairVector;
|
||||
typedef typename PairVector::iterator iterator;
|
||||
typedef typename PairVector::const_iterator const_iterator;
|
||||
|
||||
/// Empty
|
||||
LLSortedVector() {}
|
||||
|
||||
/// Fixed initial size
|
||||
LLSortedVector(std::size_t size):
|
||||
mVector(size)
|
||||
{}
|
||||
|
||||
/// Bulk load
|
||||
template <typename ITER>
|
||||
LLSortedVector(ITER begin, ITER end):
|
||||
mVector(begin, end)
|
||||
{
|
||||
// Allow caller to dump in a bunch of (pairs convertible to)
|
||||
// value_type if desired, but make sure we sort afterwards.
|
||||
std::sort(mVector.begin(), mVector.end());
|
||||
}
|
||||
|
||||
/// insert(key, value)
|
||||
std::pair<iterator, bool> insert(const key_type& key, const mapped_type& value)
|
||||
{
|
||||
return insert(value_type(key, value));
|
||||
}
|
||||
|
||||
/// insert(value_type)
|
||||
std::pair<iterator, bool> insert(const value_type& pair)
|
||||
{
|
||||
typedef std::pair<iterator, bool> iterbool;
|
||||
iterator found = std::lower_bound(mVector.begin(), mVector.end(), pair,
|
||||
less<value_type>());
|
||||
// have to check for end() before it's even valid to dereference
|
||||
if (found == mVector.end())
|
||||
{
|
||||
std::size_t index(mVector.size());
|
||||
mVector.push_back(pair);
|
||||
// don't forget that push_back() invalidates 'found'
|
||||
return iterbool(mVector.begin() + index, true);
|
||||
}
|
||||
if (found->first == pair.first)
|
||||
{
|
||||
return iterbool(found, false);
|
||||
}
|
||||
// remember that insert() invalidates 'found' -- save index
|
||||
std::size_t index(found - mVector.begin());
|
||||
mVector.insert(found, pair);
|
||||
// okay, convert from index back to iterator
|
||||
return iterbool(mVector.begin() + index, true);
|
||||
}
|
||||
|
||||
iterator begin() { return mVector.begin(); }
|
||||
iterator end() { return mVector.end(); }
|
||||
const_iterator begin() const { return mVector.begin(); }
|
||||
const_iterator end() const { return mVector.end(); }
|
||||
|
||||
bool empty() const { return mVector.empty(); }
|
||||
std::size_t size() const { return mVector.size(); }
|
||||
|
||||
/// find
|
||||
iterator find(const key_type& key)
|
||||
{
|
||||
iterator found = std::lower_bound(mVector.begin(), mVector.end(),
|
||||
value_type(key, mapped_type()),
|
||||
less<value_type>());
|
||||
if (found == mVector.end() || found->first != key)
|
||||
return mVector.end();
|
||||
return found;
|
||||
}
|
||||
|
||||
const_iterator find(const key_type& key) const
|
||||
{
|
||||
return const_cast<self*>(this)->find(key);
|
||||
}
|
||||
|
||||
private:
|
||||
// Define our own 'less' comparator so we can specialize without messing
|
||||
// with std::less.
|
||||
template <typename T>
|
||||
struct less: public std::less<T> {};
|
||||
|
||||
// Specialize 'less' for an LLSortedVector::value_type involving
|
||||
// std::type_info*. This is one of LLSortedVector's foremost use cases. We
|
||||
// specialize 'less' rather than just defining a specific comparator
|
||||
// because LLSortedVector should be usable for other key_types as well.
|
||||
template <typename T>
|
||||
struct less< std::pair<std::type_info*, T> >:
|
||||
public std::binary_function<std::pair<std::type_info*, T>,
|
||||
std::pair<std::type_info*, T>,
|
||||
bool>
|
||||
{
|
||||
bool operator()(const std::pair<std::type_info*, T>& lhs,
|
||||
const std::pair<std::type_info*, T>& rhs) const
|
||||
{
|
||||
return lhs.first->before(*rhs.first);
|
||||
}
|
||||
};
|
||||
|
||||
// Same as above, but with const std::type_info*.
|
||||
template <typename T>
|
||||
struct less< std::pair<const std::type_info*, T> >:
|
||||
public std::binary_function<std::pair<const std::type_info*, T>,
|
||||
std::pair<const std::type_info*, T>,
|
||||
bool>
|
||||
{
|
||||
bool operator()(const std::pair<const std::type_info*, T>& lhs,
|
||||
const std::pair<const std::type_info*, T>& rhs) const
|
||||
{
|
||||
return lhs.first->before(*rhs.first);
|
||||
}
|
||||
};
|
||||
|
||||
PairVector mVector;
|
||||
};
|
||||
|
||||
#endif /* ! defined(LL_LLSORTEDVECTOR_H) */
|
||||
@@ -42,10 +42,10 @@ template <class Object> class LLStrider
|
||||
U8* mBytep;
|
||||
};
|
||||
U32 mSkip;
|
||||
//U32 mTypeSize;
|
||||
|
||||
public:
|
||||
|
||||
LLStrider() { mObjectp = NULL; /*mTypeSize = */mSkip = sizeof(Object); }
|
||||
LLStrider() { mObjectp = NULL; mSkip = sizeof(Object); }
|
||||
~LLStrider() { }
|
||||
|
||||
const LLStrider<Object>& operator = (Object *first) { mObjectp = first; return *this;}
|
||||
@@ -60,9 +60,6 @@ public:
|
||||
return ret;
|
||||
}
|
||||
|
||||
//void setTypeSize (S32 typeBytes){ mTypeSize = (typeBytes ? typeBytes : sizeof(Object)); }
|
||||
|
||||
//bool isStrided() const { return mTypeSize != mSkip; }
|
||||
void skip(const U32 index) { mBytep += mSkip*index;}
|
||||
U32 getSkip() const { return mSkip; }
|
||||
Object* get() { return mObjectp; }
|
||||
@@ -70,72 +67,9 @@ public:
|
||||
Object& operator *() { return *mObjectp; }
|
||||
Object* operator ++(int) { Object* old = mObjectp; mBytep += mSkip; return old; }
|
||||
Object* operator +=(int i) { mBytep += mSkip*i; return mObjectp; }
|
||||
|
||||
Object& operator[](U32 index) { return *(Object*)(mBytep + (mSkip * index)); }
|
||||
/*void assignArray(U8* __restrict source, const size_t elem_size, const size_t elem_count)
|
||||
{
|
||||
llassert_always(sizeof(Object) <= elem_size);
|
||||
|
||||
U8* __restrict dest = mBytep; //refer to dest instead of mBytep to benefit from __restrict hint
|
||||
const U32 bytes = elem_size * elem_count; //total bytes to copy from source to dest
|
||||
|
||||
//stride == sizeof(element) implies entire buffer is unstrided and thus memcpy-able, provided source buffer elements match in size.
|
||||
//Because LLStrider is often passed an LLVector3 even if the reprensentation is LLVector4 in the vertex buffer, mTypeSize is set to
|
||||
//the TRUE vbo datatype size via VertexBufferStrider::get
|
||||
if(!isStrided() && mTypeSize == elem_size)
|
||||
{
|
||||
if(bytes >= sizeof(LLVector4) * 4) //Should be able to pull at least 3 16byte blocks from this. Smaller isn't really beneficial.
|
||||
{
|
||||
U8* __restrict aligned_source = LL_NEXT_ALIGNED_ADDRESS(source);
|
||||
U8* __restrict aligned_dest = LL_NEXT_ALIGNED_ADDRESS(dest);
|
||||
const U32 source_offset = aligned_source - source; //Offset to first aligned location in source buffer.
|
||||
const U32 dest_offset = aligned_dest - dest; //Offset to first aligned location in dest buffer.
|
||||
llassert_always(source_offset < 16);
|
||||
llassert_always(dest_offset < 16);
|
||||
if(source_offset == dest_offset) //delta to aligned location matches between source and destination! _mm_*_ps should be viable.
|
||||
{
|
||||
const U32 end_offset = (bytes - source_offset) % sizeof(LLVector4); //buffers may not neatly end on a 16byte alignment boundary.
|
||||
const U32 aligned_bytes = bytes - source_offset - end_offset; //how many bytes to copy from aligned start to aligned end.
|
||||
|
||||
llassert_always(aligned_bytes > 0);
|
||||
|
||||
if(source_offset) //memcpy up to the aligned location if needed
|
||||
memcpy(dest,source,source_offset);
|
||||
LLVector4a::memcpyNonAliased16((F32*) aligned_dest, (F32*) aligned_source, aligned_bytes);
|
||||
if(end_offset) //memcpy to the very end if needed.
|
||||
memcpy(aligned_dest+aligned_bytes,aligned_source+aligned_bytes,end_offset);
|
||||
}
|
||||
else //buffers non-uniformly offset from aligned location. Using _mm_*u_ps.
|
||||
{
|
||||
U32 end = bytes/sizeof(LLVector4); //sizeof(LLVector4) = 16 bytes = 128 bits
|
||||
|
||||
llassert_always(end > 0);
|
||||
|
||||
__m128* dst = (__m128*) dest;
|
||||
__m128* src = (__m128*) source;
|
||||
|
||||
for (U32 i = 0; i < end; i++) //copy 128bit chunks
|
||||
{
|
||||
__m128 res = _mm_loadu_ps((F32*)&src[i]);
|
||||
_mm_storeu_ps((F32*)&dst[i], res);
|
||||
}
|
||||
end*=16;//Convert to real byte offset
|
||||
if(end < bytes) //just memcopy the rest
|
||||
memcpy(dest+end,source+end,bytes-end);
|
||||
}
|
||||
}
|
||||
else //Too small. just do a simple memcpy.
|
||||
memcpy(dest,source,bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
for(U32 i=0;i<elem_count;i++)
|
||||
{
|
||||
memcpy(dest,source,sizeof(Object));
|
||||
dest+=mSkip;
|
||||
source+=elem_size;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
};
|
||||
|
||||
#endif // LL_LLSTRIDER_H
|
||||
|
||||
110
indra/llcommon/lltypeinfolookup.h
Normal file
110
indra/llcommon/lltypeinfolookup.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* @file lltypeinfolookup.h
|
||||
* @author Nat Goodspeed
|
||||
* @date 2012-04-08
|
||||
* @brief Template data structure like std::map<std::type_info*, T>
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Copyright (c) 2012, Linden Research, Inc.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#if ! defined(LL_LLTYPEINFOLOOKUP_H)
|
||||
#define LL_LLTYPEINFOLOOKUP_H
|
||||
|
||||
#include "llsortedvector.h"
|
||||
#include <typeinfo>
|
||||
|
||||
/**
|
||||
* LLTypeInfoLookup is specifically designed for use cases for which you might
|
||||
* consider std::map<std::type_info*, VALUE>. We have several such data
|
||||
* structures in the viewer. The trouble with them is that at least on Linux,
|
||||
* you can't rely on always getting the same std::type_info* for a given type:
|
||||
* different load modules will produce different std::type_info*.
|
||||
* LLTypeInfoLookup contains a workaround to address this issue.
|
||||
*
|
||||
* Specifically, when we don't find the passed std::type_info*,
|
||||
* LLTypeInfoLookup performs a linear search over registered entries to
|
||||
* compare name() strings. Presuming that this succeeds, we cache the new
|
||||
* (previously unrecognized) std::type_info* to speed future lookups.
|
||||
*
|
||||
* This worst-case fallback search (linear search with string comparison)
|
||||
* should only happen the first time we look up a given type from a particular
|
||||
* load module other than the one from which we initially registered types.
|
||||
* (However, a lookup which wouldn't succeed anyway will always have
|
||||
* worst-case performance.) This class is probably best used with less than a
|
||||
* few dozen different types.
|
||||
*/
|
||||
template <typename VALUE>
|
||||
class LLTypeInfoLookup
|
||||
{
|
||||
public:
|
||||
typedef LLTypeInfoLookup<VALUE> self;
|
||||
typedef LLSortedVector<const std::type_info*, VALUE> vector_type;
|
||||
typedef typename vector_type::key_type key_type;
|
||||
typedef typename vector_type::mapped_type mapped_type;
|
||||
typedef typename vector_type::value_type value_type;
|
||||
typedef typename vector_type::iterator iterator;
|
||||
typedef typename vector_type::const_iterator const_iterator;
|
||||
|
||||
LLTypeInfoLookup() {}
|
||||
|
||||
iterator begin() { return mVector.begin(); }
|
||||
iterator end() { return mVector.end(); }
|
||||
const_iterator begin() const { return mVector.begin(); }
|
||||
const_iterator end() const { return mVector.end(); }
|
||||
bool empty() const { return mVector.empty(); }
|
||||
std::size_t size() const { return mVector.size(); }
|
||||
|
||||
std::pair<iterator, bool> insert(const std::type_info* key, const VALUE& value)
|
||||
{
|
||||
return insert(value_type(key, value));
|
||||
}
|
||||
|
||||
std::pair<iterator, bool> insert(const value_type& pair)
|
||||
{
|
||||
return mVector.insert(pair);
|
||||
}
|
||||
|
||||
// const find() forwards to non-const find(): this can alter mVector!
|
||||
const_iterator find(const std::type_info* key) const
|
||||
{
|
||||
return const_cast<self*>(this)->find(key);
|
||||
}
|
||||
|
||||
// non-const find() caches previously-unknown type_info* to speed future
|
||||
// lookups.
|
||||
iterator find(const std::type_info* key)
|
||||
{
|
||||
iterator found = mVector.find(key);
|
||||
if (found != mVector.end())
|
||||
{
|
||||
// If LLSortedVector::find() found, great, we're done.
|
||||
return found;
|
||||
}
|
||||
// Here we didn't find the passed type_info*. On Linux, though, even
|
||||
// for the same type, typeid(sametype) produces a different type_info*
|
||||
// when used in different load modules. So the fact that we didn't
|
||||
// find the type_info* we seek doesn't mean this type isn't
|
||||
// registered. Scan for matching name() string.
|
||||
for (typename vector_type::iterator ti(mVector.begin()), tend(mVector.end());
|
||||
ti != tend; ++ti)
|
||||
{
|
||||
if (std::string(ti->first->name()) == key->name())
|
||||
{
|
||||
// This unrecognized 'key' is for the same type as ti->first.
|
||||
// To speed future lookups, insert a new entry that lets us
|
||||
// look up ti->second using this same 'key'.
|
||||
return insert(key, ti->second).first;
|
||||
}
|
||||
}
|
||||
// We simply have never seen a type with this type_info* from any load
|
||||
// module.
|
||||
return mVector.end();
|
||||
}
|
||||
|
||||
private:
|
||||
vector_type mVector;
|
||||
};
|
||||
|
||||
#endif /* ! defined(LL_LLTYPEINFOLOOKUP_H) */
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
#include "lluuid.h"
|
||||
#include "llstring.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llthread.h"
|
||||
#include "llmemtype.h"
|
||||
#include "aithreadsafe.h"
|
||||
|
||||
const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "message.h"
|
||||
#include "lltimer.h"
|
||||
#include "llextendedstatus.h"
|
||||
|
||||
const S32 LL_XFER_LARGE_PAYLOAD = 7680;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ include(LLRender)
|
||||
include(LLWindow)
|
||||
include(LLVFS)
|
||||
include(LLXML)
|
||||
include(LLXUIXML)
|
||||
|
||||
include_directories(
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
@@ -24,7 +23,6 @@ include_directories(
|
||||
${LLWINDOW_INCLUDE_DIRS}
|
||||
${LLVFS_INCLUDE_DIRS}
|
||||
${LLXML_INCLUDE_DIRS}
|
||||
${LLXUIXML_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(llui_SOURCE_FILES
|
||||
@@ -73,6 +71,7 @@ set(llui_SOURCE_FILES
|
||||
lltextparser.cpp
|
||||
lltrans.cpp
|
||||
llui.cpp
|
||||
lluicolor.cpp
|
||||
lluictrl.cpp
|
||||
lluictrlfactory.cpp
|
||||
lluiimage.cpp
|
||||
@@ -142,6 +141,7 @@ set(llui_HEADER_FILES
|
||||
lluictrl.h
|
||||
lluifwd.h
|
||||
llui.h
|
||||
lluicolor.h
|
||||
lluiimage.h
|
||||
lluistring.h
|
||||
lluixmltags.h
|
||||
@@ -165,7 +165,6 @@ target_link_libraries(llui
|
||||
llwindow
|
||||
llimage
|
||||
llvfs # ugh, just for LLDir
|
||||
llxuixml
|
||||
llxml
|
||||
llcommon # must be after llimage, llwindow, llrender
|
||||
llmath
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
project(llxuixml)
|
||||
|
||||
include(00-Common)
|
||||
include(LLCommon)
|
||||
include(LLMath)
|
||||
include(LLXML)
|
||||
|
||||
include_directories(
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLXML_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(llxuixml_SOURCE_FILES
|
||||
llinitparam.cpp
|
||||
lluicolor.cpp
|
||||
)
|
||||
|
||||
set(llxuixml_HEADER_FILES
|
||||
CMakeLists.txt
|
||||
|
||||
llinitparam.h
|
||||
lluicolor.h
|
||||
)
|
||||
|
||||
set_source_files_properties(${llxuixml_HEADER_FILES}
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
|
||||
list(APPEND llxuixml_SOURCE_FILES ${llxuixml_HEADER_FILES})
|
||||
|
||||
add_library (llxuixml ${llxuixml_SOURCE_FILES})
|
||||
# Libraries on which this library depends, needed for Linux builds
|
||||
# Sort by high-level to low-level
|
||||
target_link_libraries(llxuixml
|
||||
llxml
|
||||
llcommon
|
||||
llmath
|
||||
)
|
||||
@@ -37,7 +37,6 @@ include(LLUI)
|
||||
include(LLVFS)
|
||||
include(LLWindow)
|
||||
include(LLXML)
|
||||
include(LLXUIXML)
|
||||
include(LScript)
|
||||
include(Linking)
|
||||
include(NDOF)
|
||||
@@ -72,7 +71,6 @@ include_directories(
|
||||
${LLVFS_INCLUDE_DIRS}
|
||||
${LLWINDOW_INCLUDE_DIRS}
|
||||
${LLXML_INCLUDE_DIRS}
|
||||
${LLXUIXML_INCLUDE_DIRS}
|
||||
${LSCRIPT_INCLUDE_DIRS}
|
||||
${LSCRIPT_INCLUDE_DIRS}/lscript_compile
|
||||
)
|
||||
@@ -98,11 +96,7 @@ set(viewer_SOURCE_FILES
|
||||
ascentprefschat.cpp
|
||||
ascentprefssys.cpp
|
||||
ascentprefsvan.cpp
|
||||
#dhparam.cpp
|
||||
#dsaparam.cpp
|
||||
emeraldboobutils.cpp
|
||||
dofloaterhex.cpp
|
||||
dohexeditor.cpp
|
||||
floatersculptpreview.cpp
|
||||
hbfloatergrouptitles.cpp
|
||||
hgfloatertexteditor.cpp
|
||||
@@ -593,8 +587,6 @@ set(viewer_HEADER_FILES
|
||||
ascentprefssys.h
|
||||
ascentprefsvan.h
|
||||
emeraldboobutils.h
|
||||
dofloaterhex.h
|
||||
dohexeditor.h
|
||||
floatersculptpreview.h
|
||||
hbfloatergrouptitles.h
|
||||
hgfloatertexteditor.h
|
||||
@@ -1548,7 +1540,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
||||
${LLVFS_LIBRARIES}
|
||||
${LLWINDOW_LIBRARIES}
|
||||
${LLXML_LIBRARIES}
|
||||
${LLXUIXML_LIBRARIES}
|
||||
${LSCRIPT_LIBRARIES}
|
||||
${LLMATH_LIBRARIES}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/* Generated using openssl */
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include <openssl/dh.h>
|
||||
|
||||
DH *get_dh2048()
|
||||
{
|
||||
static unsigned char dh2048_p[]={
|
||||
0xAC,0x31,0xAA,0xFD,0x76,0x1B,0x47,0x24,0x99,0x6D,0xF8,0xD5,
|
||||
0x5B,0x4B,0xD1,0x7E,0xF9,0x1A,0x41,0xF6,0x29,0xCC,0xA9,0x02,
|
||||
0x6B,0xED,0xFD,0xC9,0x37,0xCE,0xF6,0x11,0x78,0x6F,0x37,0x38,
|
||||
0x7D,0x49,0x3F,0x78,0x36,0x83,0x0A,0x6F,0xBA,0x6F,0x74,0xD9,
|
||||
0xB1,0xC1,0xC4,0x5A,0x7D,0x84,0x26,0x56,0x8B,0x53,0xF4,0xFE,
|
||||
0xD1,0x34,0xF1,0xE0,0x08,0x65,0xA6,0xFD,0xDB,0x5D,0xAC,0x14,
|
||||
0xCD,0xC9,0x7E,0x79,0xE9,0x3B,0xAF,0x92,0xC7,0x4D,0x91,0x15,
|
||||
0x0B,0x1E,0x2F,0x0A,0x56,0x4E,0x0D,0x3A,0x4D,0x9E,0xB0,0xB5,
|
||||
0xFC,0x0D,0xB1,0x55,0x40,0xC6,0x30,0x99,0xCD,0xE8,0x7E,0x72,
|
||||
0x08,0x93,0x9C,0x7F,0x55,0x23,0x27,0x09,0xF4,0x50,0xF2,0x96,
|
||||
0xB5,0x30,0x35,0x6A,0x99,0x4C,0xD6,0x85,0x72,0x8D,0x9C,0x19,
|
||||
0x70,0x9A,0x77,0x52,0xE8,0x33,0x03,0x7A,0x00,0xDA,0xFE,0xD7,
|
||||
0x98,0xD0,0x7B,0x26,0xBA,0xD7,0xFF,0xD1,0x49,0x61,0x27,0x3E,
|
||||
0xFC,0x12,0x81,0xC9,0xB0,0xAF,0x34,0x14,0x97,0x66,0xFB,0xEF,
|
||||
0xD3,0xFE,0xC9,0x01,0x25,0xEC,0xF4,0xE8,0xA8,0xD8,0x21,0x45,
|
||||
0x20,0x6F,0xFC,0xA8,0xB3,0xCE,0xCF,0x0D,0xA1,0x14,0xCC,0x38,
|
||||
0x81,0x74,0x6A,0x5E,0x36,0x09,0x1D,0xBE,0x4C,0x08,0x52,0x5E,
|
||||
0xC2,0x5F,0xA4,0x48,0x3A,0x71,0x85,0xF2,0x97,0x32,0xEC,0x3B,
|
||||
0xFB,0x1B,0x9A,0x8A,0x4B,0x20,0x32,0xFE,0x6A,0x94,0x4C,0x02,
|
||||
0xB2,0xD7,0xC3,0x1B,0xF8,0x90,0x54,0x76,0x70,0x49,0x81,0x86,
|
||||
0x30,0x12,0xD2,0x91,0xF0,0xFD,0x1B,0x53,0x2E,0x60,0x13,0x78,
|
||||
0x8B,0x3F,0x1B,0x13,
|
||||
};
|
||||
static unsigned char dh2048_g[]={
|
||||
0x05,
|
||||
};
|
||||
DH *dh;
|
||||
|
||||
if ((dh=DH_new()) == NULL) return(NULL);
|
||||
dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL);
|
||||
dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL);
|
||||
if ((dh->p == NULL) || (dh->g == NULL))
|
||||
{ DH_free(dh); return(NULL); }
|
||||
return(dh);
|
||||
}
|
||||
@@ -1,503 +0,0 @@
|
||||
/**
|
||||
* @file dofloaterhex.h
|
||||
* @brief Hex Editor Floater made by Day
|
||||
* @author Day Oh
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=WTFPLV2$
|
||||
*
|
||||
*/
|
||||
|
||||
// <edit>
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "dofloaterhex.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llinventorybackup.h" // for downloading
|
||||
#include "llviewercontrol.h" // gSavedSettings
|
||||
#include "llviewerwindow.h" // alertXML
|
||||
#include "llagent.h" // gAgent getID
|
||||
#include "llviewermenufile.h"
|
||||
#include "llviewerregion.h" // getCapability
|
||||
#include "llassetuploadresponders.h" // LLUpdateAgentInventoryResponder
|
||||
#include "llinventorymodel.h" // gInventory.updateItem
|
||||
#include "llappviewer.h" // System Folders
|
||||
#include "llfloaterperms.h" //get default perms
|
||||
#include "llnotificationsutil.h"
|
||||
|
||||
std::list<DOFloaterHex*> DOFloaterHex::sInstances;
|
||||
S32 DOFloaterHex::sUploadAmount = 10;
|
||||
|
||||
DOFloaterHex::DOFloaterHex(LLUUID item_id, BOOL vfs, LLAssetType::EType asset_type)
|
||||
: LLFloater()
|
||||
{
|
||||
sInstances.push_back(this);
|
||||
|
||||
mVFS = vfs;
|
||||
|
||||
//we are editing an asset directly from the VFS
|
||||
if(vfs)
|
||||
{
|
||||
mAssetId = item_id;
|
||||
mAssetType = asset_type;
|
||||
|
||||
//we are editing an inventory item
|
||||
} else {
|
||||
mItem = (LLInventoryItem*)gInventory.getItem(item_id);
|
||||
mAssetId = mItem->getAssetUUID();
|
||||
mAssetType = mItem->getType();
|
||||
}
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hex.xml");
|
||||
}
|
||||
|
||||
//this bit should be rewritten entirely
|
||||
void DOFloaterHex::show(LLUUID item_id, BOOL vfs, LLAssetType::EType asset_type)
|
||||
{
|
||||
if(!vfs)
|
||||
{
|
||||
LLInventoryItem* item = (LLInventoryItem*)gInventory.getItem(item_id);
|
||||
if(item)
|
||||
{
|
||||
S32 left, top;
|
||||
gFloaterView->getNewFloaterPosition(&left, &top);
|
||||
LLRect rect = gSavedSettings.getRect("FloaterHexRect");
|
||||
rect.translate(left - rect.mLeft, top - rect.mTop);
|
||||
|
||||
DOFloaterHex* floaterp = new DOFloaterHex(item_id);
|
||||
floaterp->setRect(rect);
|
||||
|
||||
gFloaterView->adjustToFitScreen(floaterp, FALSE);
|
||||
}
|
||||
} else if (item_id.notNull() && asset_type != LLAssetType::AT_NONE) {
|
||||
S32 left, top;
|
||||
gFloaterView->getNewFloaterPosition(&left, &top);
|
||||
LLRect rect = gSavedSettings.getRect("FloaterHexRect");
|
||||
rect.translate(left - rect.mLeft, top - rect.mTop);
|
||||
DOFloaterHex* floaterp = new DOFloaterHex(item_id, true, asset_type);
|
||||
floaterp->setRect(rect);
|
||||
|
||||
llinfos << "Asset ID: " << item_id.asString() << llendl;
|
||||
|
||||
gFloaterView->adjustToFitScreen(floaterp, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
DOFloaterHex::~DOFloaterHex()
|
||||
{
|
||||
sInstances.remove(this);
|
||||
}
|
||||
|
||||
void DOFloaterHex::close(bool app_quitting)
|
||||
{
|
||||
LLFloater::close(app_quitting);
|
||||
}
|
||||
|
||||
BOOL DOFloaterHex::postBuild(void)
|
||||
{
|
||||
DOHexEditor* editor = getChild<DOHexEditor>("hex");
|
||||
mEditor = editor;
|
||||
#ifndef COLUMN_SPAN
|
||||
// Set number of columns
|
||||
U8 columns = U8(gSavedSettings.getU32("HexEditorColumns"));
|
||||
editor->setColumns(columns);
|
||||
// Reflect clamped U8ness in settings
|
||||
gSavedSettings.setU32("HexEditorColumns", U32(columns));
|
||||
#endif
|
||||
handleSizing();
|
||||
|
||||
childSetEnabled("upload_btn", false);
|
||||
childSetLabelArg("upload_btn", "[UPLOAD]", std::string("Upload"));
|
||||
childSetAction("upload_btn", onClickUpload, this);
|
||||
childSetEnabled("save_btn", false);
|
||||
childSetAction("save_btn", onClickSave, this);
|
||||
|
||||
if(!mVFS && mItem)
|
||||
{
|
||||
std::string title = "Hex editor: " + mItem->getName();
|
||||
const char* asset_type_name = LLAssetType::lookup(mItem->getType());
|
||||
if(asset_type_name)
|
||||
{
|
||||
title.append(" (" + std::string(asset_type_name) + ")");
|
||||
}
|
||||
setTitle(title);
|
||||
}
|
||||
if(!mVFS)
|
||||
{
|
||||
// Load the asset
|
||||
editor->setVisible(FALSE);
|
||||
childSetText("status_text", std::string("Loading..."));
|
||||
LLInventoryBackup::download(mItem, this, imageCallback, assetCallback);
|
||||
}
|
||||
else if (mVFS) //the asset already exists in the VFS, we don't need to fetch it
|
||||
//and we don't want to associate it with an item
|
||||
{
|
||||
setTitle(mAssetId.asString());
|
||||
readVFile();
|
||||
} else {
|
||||
this->close(false);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// static
|
||||
void DOFloaterHex::imageCallback(BOOL success,
|
||||
LLViewerFetchedTexture *src_vi,
|
||||
LLImageRaw* src,
|
||||
LLImageRaw* aux_src,
|
||||
S32 discard_level,
|
||||
BOOL final,
|
||||
void* userdata)
|
||||
{
|
||||
|
||||
if(final)
|
||||
{
|
||||
LLInventoryBackup::callbackdata* data = static_cast<LLInventoryBackup::callbackdata*>(userdata);
|
||||
DOFloaterHex* floater = (DOFloaterHex*)(data->floater);
|
||||
if(!floater) return;
|
||||
if(std::find(sInstances.begin(), sInstances.end(), floater) == sInstances.end()) return; // no more crash
|
||||
//LLInventoryItem* item = data->item;
|
||||
|
||||
if(!success)
|
||||
{
|
||||
floater->childSetText("status_text", std::string("Unable to download asset."));
|
||||
return;
|
||||
}
|
||||
|
||||
U8* src_data = src->getData();
|
||||
S32 size = src->getDataSize();
|
||||
std::vector<U8> new_data;
|
||||
for(S32 i = 0; i < size; i++)
|
||||
new_data.push_back(src_data[i]);
|
||||
|
||||
floater->mEditor->setValue(new_data);
|
||||
floater->mEditor->setVisible(TRUE);
|
||||
floater->childSetText("status_text", std::string("Note: Image data shown isn't the actual asset data, yet"));
|
||||
|
||||
floater->childSetEnabled("save_btn", false);
|
||||
floater->childSetEnabled("upload_btn", true);
|
||||
floater->childSetLabelArg("upload_btn", "[UPLOAD]", std::string("Upload (L$10)"));
|
||||
}
|
||||
else
|
||||
{
|
||||
src_vi->setBoostLevel(LLViewerTexture::BOOST_UI);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void DOFloaterHex::assetCallback(LLVFS *vfs,
|
||||
const LLUUID& asset_uuid,
|
||||
LLAssetType::EType type,
|
||||
void* user_data, S32 status, LLExtStat ext_status)
|
||||
{
|
||||
|
||||
LLInventoryBackup::callbackdata* data = static_cast<LLInventoryBackup::callbackdata*>(user_data);
|
||||
DOFloaterHex* floater = (DOFloaterHex*)(data->floater);
|
||||
if(!floater) return;
|
||||
if(std::find(sInstances.begin(), sInstances.end(), floater) == sInstances.end()) return; // no more crash
|
||||
LLInventoryItem* item = data->item;
|
||||
|
||||
if(status != 0 && item->getType() != LLAssetType::AT_NOTECARD)
|
||||
{
|
||||
floater->childSetText("status_text", std::string("Unable to download asset."));
|
||||
return;
|
||||
}
|
||||
|
||||
// Todo: this doesn't work for static vfs shit
|
||||
LLVFile file(vfs, asset_uuid, type, LLVFile::READ);
|
||||
S32 size = file.getSize();
|
||||
|
||||
char* buffer = new char[size];
|
||||
if (buffer == NULL)
|
||||
{
|
||||
llerrs << "Memory Allocation Failed" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
file.read((U8*)buffer, size);
|
||||
|
||||
std::vector<U8> new_data;
|
||||
for(S32 i = 0; i < size; i++)
|
||||
new_data.push_back(buffer[i]);
|
||||
|
||||
delete[] buffer;
|
||||
|
||||
floater->mEditor->setValue(new_data);
|
||||
floater->mEditor->setVisible(TRUE);
|
||||
floater->childSetText("status_text", std::string(""));
|
||||
|
||||
floater->childSetEnabled("upload_btn", true);
|
||||
floater->childSetEnabled("save_btn", false);
|
||||
if(item->getPermissions().allowModifyBy(gAgent.getID()))
|
||||
{
|
||||
switch(item->getType())
|
||||
{
|
||||
case LLAssetType::AT_TEXTURE:
|
||||
case LLAssetType::AT_ANIMATION:
|
||||
case LLAssetType::AT_SOUND:
|
||||
floater->childSetLabelArg("upload_btn", "[UPLOAD]", std::string("Upload (L$10)"));
|
||||
break;
|
||||
case LLAssetType::AT_LANDMARK:
|
||||
case LLAssetType::AT_CALLINGCARD:
|
||||
floater->childSetEnabled("upload_btn", false);
|
||||
floater->childSetEnabled("save_btn", false);
|
||||
break;
|
||||
default:
|
||||
floater->childSetEnabled("save_btn", true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(item->getType())
|
||||
{
|
||||
case LLAssetType::AT_TEXTURE:
|
||||
case LLAssetType::AT_ANIMATION:
|
||||
case LLAssetType::AT_SOUND:
|
||||
floater->childSetLabelArg("upload_btn", "[UPLOAD]", std::string("Upload (L$10)"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Never enable save if it's a pretend item
|
||||
if(gInventory.isObjectDescendentOf(item->getUUID(), gSystemFolderRoot))
|
||||
{
|
||||
floater->childSetEnabled("save_btn", false);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void DOFloaterHex::onClickUpload(void* user_data)
|
||||
{
|
||||
|
||||
DOFloaterHex* floater = (DOFloaterHex*)user_data;
|
||||
LLInventoryItem* item = floater->mItem;
|
||||
|
||||
LLTransactionID transaction_id;
|
||||
transaction_id.generate();
|
||||
LLUUID fake_asset_id = transaction_id.makeAssetID(gAgent.getSecureSessionID());
|
||||
|
||||
std::vector<U8> value = floater->mEditor->getValue();
|
||||
int size = value.size();
|
||||
U8* buffer = new U8[size];
|
||||
for(int i = 0; i < size; i++)
|
||||
buffer[i] = value[i];
|
||||
value.clear();
|
||||
|
||||
LLVFile file(gVFS, fake_asset_id, item->getType(), LLVFile::APPEND);
|
||||
file.setMaxSize(size);
|
||||
if (!file.write(buffer, size))
|
||||
{
|
||||
LLSD args;
|
||||
args["ERROR_MESSAGE"] = "Couldn't write data to file";
|
||||
LLNotificationsUtil::add("ErrorMessage", args);
|
||||
return;
|
||||
}
|
||||
delete[] buffer;
|
||||
|
||||
LLAssetStorage::LLStoreAssetCallback callback = NULL;
|
||||
void *fake_user_data = NULL;
|
||||
|
||||
if(item->getType() != LLAssetType::AT_GESTURE && item->getType() != LLAssetType::AT_LSL_TEXT
|
||||
&& item->getType() != LLAssetType::AT_NOTECARD)
|
||||
{
|
||||
upload_new_resource(transaction_id,
|
||||
item->getType(),
|
||||
item->getName(),
|
||||
item->getDescription(),
|
||||
0,
|
||||
LLFolderType::assetTypeToFolderType(item->getType()),
|
||||
item->getInventoryType(),
|
||||
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
|
||||
item->getName(),
|
||||
callback,
|
||||
sUploadAmount,
|
||||
fake_user_data);
|
||||
}
|
||||
else // gestures and scripts, create an item first
|
||||
{ // AND notecards
|
||||
//if(item->getType() == LLAssetType::AT_NOTECARD) gDontOpenNextNotecard = true;
|
||||
create_inventory_item( gAgent.getID(),
|
||||
gAgent.getSessionID(),
|
||||
item->getParentUUID(), //gInventory.findCategoryUUIDForType(item->getType()),
|
||||
LLTransactionID::tnull,
|
||||
item->getName(),
|
||||
fake_asset_id.asString(),
|
||||
item->getType(),
|
||||
item->getInventoryType(),
|
||||
(LLWearableType::EType)item->getFlags(),
|
||||
PERM_ITEM_UNRESTRICTED,
|
||||
new NewResourceItemCallback);
|
||||
}
|
||||
}
|
||||
|
||||
struct LLSaveInfo
|
||||
{
|
||||
LLSaveInfo(DOFloaterHex* floater, LLTransactionID transaction_id)
|
||||
: mFloater(floater), mTransactionID(transaction_id)
|
||||
{
|
||||
}
|
||||
|
||||
DOFloaterHex* mFloater;
|
||||
LLTransactionID mTransactionID;
|
||||
};
|
||||
|
||||
// static
|
||||
void DOFloaterHex::onClickSave(void* user_data)
|
||||
{
|
||||
DOFloaterHex* floater = (DOFloaterHex*)user_data;
|
||||
LLInventoryItem* item = floater->mItem;
|
||||
|
||||
LLTransactionID transaction_id;
|
||||
transaction_id.generate();
|
||||
LLUUID fake_asset_id = transaction_id.makeAssetID(gAgent.getSecureSessionID());
|
||||
|
||||
std::vector<U8> value = floater->mEditor->getValue();
|
||||
int size = value.size();
|
||||
U8* buffer = new U8[size];
|
||||
for(int i = 0; i < size; i++)
|
||||
buffer[i] = value[i];
|
||||
value.clear();
|
||||
|
||||
LLVFile file(gVFS, fake_asset_id, item->getType(), LLVFile::APPEND);
|
||||
file.setMaxSize(size);
|
||||
if (!file.write(buffer, size))
|
||||
{
|
||||
LLSD args;
|
||||
args["ERROR_MESSAGE"] = "Couldn't write data to file";
|
||||
LLNotificationsUtil::add("ErrorMessage", args);
|
||||
return;
|
||||
}
|
||||
delete[] buffer;
|
||||
|
||||
|
||||
bool caps = false;
|
||||
std::string url;
|
||||
LLSD body;
|
||||
body["item_id"] = item->getUUID();
|
||||
|
||||
switch(item->getType())
|
||||
{
|
||||
case LLAssetType::AT_GESTURE:
|
||||
url = gAgent.getRegion()->getCapability("UpdateGestureAgentInventory");
|
||||
caps = true;
|
||||
break;
|
||||
case LLAssetType::AT_LSL_TEXT:
|
||||
url = gAgent.getRegion()->getCapability("UpdateScriptAgent");
|
||||
body["target"] = "mono";
|
||||
caps = true;
|
||||
break;
|
||||
case LLAssetType::AT_NOTECARD:
|
||||
url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory");
|
||||
caps = true;
|
||||
break;
|
||||
default: // wearables & notecards, Oct 12 2009
|
||||
// ONLY WEARABLES, Oct 15 2009
|
||||
floater->childSetText("status_text", std::string("Saving..."));
|
||||
LLSaveInfo* info = new LLSaveInfo(floater, transaction_id);
|
||||
gAssetStorage->storeAssetData(transaction_id, item->getType(), onSaveComplete, info);
|
||||
caps = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if(caps)
|
||||
{
|
||||
LLHTTPClient::post(url, body,
|
||||
new LLUpdateAgentInventoryResponder(body, fake_asset_id, item->getType()));
|
||||
}
|
||||
}
|
||||
|
||||
void DOFloaterHex::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status)
|
||||
{
|
||||
LLSaveInfo* info = (LLSaveInfo*)user_data;
|
||||
DOFloaterHex* floater = info->mFloater;
|
||||
if(std::find(sInstances.begin(), sInstances.end(), floater) == sInstances.end()) return; // no more crash
|
||||
LLInventoryItem* item = floater->mItem;
|
||||
|
||||
floater->childSetText("status_text", std::string(""));
|
||||
|
||||
if(item && (status == 0))
|
||||
{
|
||||
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
|
||||
new_item->setDescription(item->getDescription());
|
||||
new_item->setTransactionID(info->mTransactionID);
|
||||
new_item->setAssetUUID(asset_uuid);
|
||||
new_item->updateServer(FALSE);
|
||||
gInventory.updateItem(new_item);
|
||||
gInventory.notifyObservers();
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSD args;
|
||||
args["ERROR_MESSAGE"] = llformat("Upload failed with status %d, also %d", status, ext_status);
|
||||
LLNotificationsUtil::add("ErrorMessage", args);
|
||||
}
|
||||
}
|
||||
|
||||
void DOFloaterHex::onCommitColumnCount(LLUICtrl *control, void *user_data)
|
||||
{
|
||||
if(control && user_data)
|
||||
{
|
||||
DOFloaterHex *instance = (DOFloaterHex *)user_data;
|
||||
U8 columns = llclamp<U8>((U8)llfloor(control->getValue().asReal()), 0x00, 0xFF);
|
||||
instance->mEditor->setColumns(columns);
|
||||
gSavedSettings.setU32("HexEditorColumns", (U32)instance->mEditor->getColumns());
|
||||
instance->handleSizing();
|
||||
}
|
||||
}
|
||||
|
||||
void DOFloaterHex::handleSizing()
|
||||
{
|
||||
// Reshape a little based on columns
|
||||
S32 min_width = S32(mEditor->getSuggestedWidth(MIN_COLS)) + 20;
|
||||
setResizeLimits(min_width, getMinHeight());
|
||||
if(getRect().getWidth() < min_width)
|
||||
{
|
||||
//LLRect rect = getRect();
|
||||
//rect.setOriginAndSize(rect.mLeft, rect.mBottom, min_width, rect.getHeight());
|
||||
//setRect(rect);
|
||||
|
||||
reshape(min_width, getRect().getHeight(), FALSE);
|
||||
mEditor->reshape(mEditor->getRect().getWidth(), mEditor->getRect().getHeight(), TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void DOFloaterHex::readVFile()
|
||||
{
|
||||
if(!mVFS) return;
|
||||
// quick cut paste job
|
||||
// Todo: this doesn't work for static vfs shit
|
||||
LLVFile file(gVFS, mAssetId, mAssetType, LLVFile::READ);
|
||||
if(file.getVFSThread())
|
||||
{
|
||||
S32 size = file.getSize();
|
||||
|
||||
char* buffer = new char[size];
|
||||
if (buffer == NULL)
|
||||
{
|
||||
llerrs << "Memory Allocation Failed" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
file.read((U8*)buffer, size);
|
||||
|
||||
std::vector<U8> new_data;
|
||||
for(S32 i = 0; i < size; i++)
|
||||
new_data.push_back(buffer[i]);
|
||||
|
||||
delete[] buffer;
|
||||
|
||||
mEditor->setValue(new_data);
|
||||
mEditor->setVisible(TRUE);
|
||||
|
||||
}
|
||||
|
||||
childSetText("status_text", std::string("Editing VFile"));
|
||||
|
||||
childSetEnabled("upload_btn", false);
|
||||
childSetEnabled("save_btn", false);
|
||||
}
|
||||
|
||||
// </edit>
|
||||
@@ -1,51 +0,0 @@
|
||||
// <edit>
|
||||
|
||||
|
||||
#ifndef LL_LLFLOATERHEX_H
|
||||
#define LL_LLFLOATERHEX_H
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "dohexeditor.h"
|
||||
#include "llinventory.h"
|
||||
#include "llviewertexture.h"
|
||||
#include "llassettype.h"
|
||||
|
||||
class DOFloaterHex
|
||||
: public LLFloater
|
||||
{
|
||||
public:
|
||||
DOFloaterHex(LLUUID item_id, BOOL vfs=false, LLAssetType::EType asset_type = LLAssetType::AT_NONE);
|
||||
static void show(LLUUID item_id, BOOL vfs=false, LLAssetType::EType asset_type = LLAssetType::AT_NONE);
|
||||
BOOL postBuild(void);
|
||||
void close(bool app_quitting);
|
||||
static void imageCallback(BOOL success,
|
||||
LLViewerFetchedTexture *src_vi,
|
||||
LLImageRaw* src,
|
||||
LLImageRaw* aux_src,
|
||||
S32 discard_level,
|
||||
BOOL final,
|
||||
void* userdata);
|
||||
static void assetCallback(LLVFS *vfs,
|
||||
const LLUUID& asset_uuid,
|
||||
LLAssetType::EType type,
|
||||
void* user_data, S32 status, LLExtStat ext_status);
|
||||
static void onClickSave(void* user_data);
|
||||
static void onClickUpload(void* user_data);
|
||||
static void onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status);
|
||||
static void onCommitColumnCount(LLUICtrl *control, void *user_data);
|
||||
void handleSizing();
|
||||
void readVFile();
|
||||
LLInventoryItem* mItem;
|
||||
LLUUID mAssetId;
|
||||
LLAssetType::EType mAssetType;
|
||||
BOOL mVFS;
|
||||
DOHexEditor* mEditor;
|
||||
static std::list<DOFloaterHex*> sInstances;
|
||||
private:
|
||||
virtual ~DOFloaterHex();
|
||||
protected:
|
||||
static S32 sUploadAmount;
|
||||
};
|
||||
|
||||
#endif
|
||||
// </edit>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,159 +0,0 @@
|
||||
/**
|
||||
* @file dohexeditor.h
|
||||
* @brief DOHexEditor Widget
|
||||
* @author Day Oh
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=WTFPLV2$
|
||||
*
|
||||
*/
|
||||
|
||||
// <edit>
|
||||
#ifndef DO_DOHEXEDITOR_H
|
||||
#define DO_DOHEXEDITOR_H
|
||||
|
||||
#define MIN_COLS 8
|
||||
#define MAX_COLS 48
|
||||
|
||||
#ifndef COLUMN_SPAN
|
||||
#define COLUMN_SPAN
|
||||
#endif
|
||||
|
||||
#include "lluictrl.h"
|
||||
#include "llscrollbar.h"
|
||||
#include "llviewborder.h"
|
||||
#include "llundo.h"
|
||||
#include "lleditmenuhandler.h"
|
||||
|
||||
class DOHexEditor : public LLUICtrl, public LLEditMenuHandler
|
||||
{
|
||||
public:
|
||||
DOHexEditor(const std::string& name, const LLRect& rect);
|
||||
~DOHexEditor();
|
||||
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory);
|
||||
void setValue(const LLSD& value);
|
||||
LLSD getValue() const;
|
||||
void setColumns(U8 columns);
|
||||
U8 getColumns() { return mColumns; };
|
||||
U32 getLineCount();
|
||||
F32 getSuggestedWidth(U8 cols = -1);
|
||||
U32 getProperSelectionStart();
|
||||
U32 getProperSelectionEnd();
|
||||
void reshape(S32 width, S32 height, BOOL called_from_parent);
|
||||
void setFocus(BOOL b);
|
||||
|
||||
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
|
||||
BOOL handleKeyHere(KEY key, MASK mask);
|
||||
BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
|
||||
BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent);
|
||||
BOOL handleUnicodeCharHere(llwchar uni_char);
|
||||
|
||||
void draw();
|
||||
|
||||
void moveCursor(U32 pos, BOOL second_nibble);
|
||||
|
||||
void insert(U32 pos, std::vector<U8> new_data, BOOL undoable);
|
||||
void overwrite(U32 first_pos, U32 last_pos, std::vector<U8> new_data, BOOL undoable);
|
||||
void del(U32 first_pos, U32 last_pos, BOOL undoable);
|
||||
|
||||
virtual void cut();
|
||||
virtual BOOL canCut() const;
|
||||
|
||||
virtual void copy();
|
||||
virtual BOOL canCopy() const;
|
||||
|
||||
virtual void paste();
|
||||
virtual BOOL canPaste() const;
|
||||
|
||||
virtual void doDelete();
|
||||
virtual BOOL canDoDelete() const;
|
||||
|
||||
virtual void selectAll();
|
||||
virtual BOOL canSelectAll() const;
|
||||
|
||||
virtual void deselect();
|
||||
virtual BOOL canDeselect() const;
|
||||
|
||||
virtual void undo();
|
||||
virtual BOOL canUndo() const;
|
||||
|
||||
virtual void redo();
|
||||
virtual BOOL canRedo() const;
|
||||
|
||||
private:
|
||||
std::vector<U8> mValue;
|
||||
U8 mColumns;
|
||||
|
||||
U32 mCursorPos;
|
||||
BOOL mSecondNibble;
|
||||
BOOL mInData;
|
||||
BOOL mSelecting;
|
||||
BOOL mHasSelection;
|
||||
U32 mSelectionStart;
|
||||
U32 mSelectionEnd;
|
||||
|
||||
LLFontGL* mGLFont;
|
||||
LLRect mTextRect;
|
||||
LLScrollbar* mScrollbar;
|
||||
LLViewBorder* mBorder;
|
||||
|
||||
LLUndoBuffer* mUndoBuffer;
|
||||
|
||||
void changedLength();
|
||||
void getPosAndContext(S32 x, S32 y, BOOL force_context, U32& pos, BOOL& in_data, BOOL& second_nibble);
|
||||
};
|
||||
|
||||
class DOUndoHex : public LLUndoBuffer::LLUndoAction
|
||||
{
|
||||
protected:
|
||||
DOUndoHex() { }
|
||||
DOHexEditor* mHexEditor;
|
||||
U32 mFirstPos;
|
||||
U32 mLastPos;
|
||||
std::vector<U8> mOldData;
|
||||
std::vector<U8> mNewData;
|
||||
public:
|
||||
static LLUndoAction* create() { return new DOUndoHex(); }
|
||||
virtual void set(DOHexEditor* hex_editor,
|
||||
void (*undo_action)(DOUndoHex*),
|
||||
void (*redo_action)(DOUndoHex*),
|
||||
U32 first_pos,
|
||||
U32 last_pos,
|
||||
std::vector<U8> old_data,
|
||||
std::vector<U8> new_data);
|
||||
void (*mUndoAction)(DOUndoHex*);
|
||||
void (*mRedoAction)(DOUndoHex*);
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
static void undoInsert(DOUndoHex* action);
|
||||
static void redoInsert(DOUndoHex* action);
|
||||
static void undoOverwrite(DOUndoHex* action);
|
||||
static void redoOverwrite(DOUndoHex* action);
|
||||
static void undoDel(DOUndoHex* action);
|
||||
static void redoDel(DOUndoHex* action);
|
||||
};
|
||||
|
||||
class DOHexInsert : public DOUndoHex
|
||||
{
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
};
|
||||
|
||||
class DOHexOverwrite : public DOUndoHex
|
||||
{
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
};
|
||||
|
||||
class DOHexDel : public DOUndoHex
|
||||
{
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
};
|
||||
|
||||
#endif
|
||||
// </edit>
|
||||
@@ -1,69 +0,0 @@
|
||||
/* Generated using openssl */
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include <openssl/dsa.h>
|
||||
|
||||
static unsigned char dsa2048_p[]={
|
||||
0xD4,0x63,0x93,0xFA,0x69,0x87,0xDB,0x60,0x68,0xFB,0xCC,0x8F,
|
||||
0x55,0x85,0x7A,0xAC,0xAD,0x1F,0x8E,0xF0,0x2C,0x62,0x2F,0xE6,
|
||||
0xA6,0xA4,0xF3,0x57,0x42,0xDC,0xF0,0xE0,0x0E,0xC6,0x67,0x01,
|
||||
0x95,0x22,0x6F,0x03,0x00,0x2A,0xB4,0xBF,0x62,0x6D,0xA1,0xBD,
|
||||
0xB7,0x10,0x81,0xB4,0x20,0x1C,0x7D,0x41,0x75,0xCE,0x0F,0xCF,
|
||||
0x9D,0x03,0xEC,0xE6,0x7E,0xBC,0x76,0x97,0xBC,0x5C,0x70,0xFE,
|
||||
0xD5,0x64,0x15,0x20,0xD8,0xA8,0x25,0x73,0xD4,0xA2,0x77,0x99,
|
||||
0xC7,0x3B,0xF7,0x4E,0x20,0x40,0x43,0xD7,0x7C,0xFD,0xBC,0x2F,
|
||||
0x75,0xB5,0x18,0xA3,0x8C,0x85,0x79,0x86,0x53,0x62,0x73,0xBA,
|
||||
0x66,0x73,0xE2,0x48,0x15,0xAF,0x04,0x65,0xE2,0x4D,0x15,0x47,
|
||||
0x74,0x33,0x79,0xAE,0xBF,0x90,0xC0,0xF7,0x2F,0x04,0xFB,0xEE,
|
||||
0x29,0xEC,0x42,0xC7,0x36,0x14,0xAC,0xB2,0xBC,0xE1,0x71,0x13,
|
||||
0x65,0xBA,0x0D,0x61,0x11,0x89,0x49,0x41,0x5D,0xCC,0xE2,0x72,
|
||||
0x7B,0x93,0xF2,0x2E,0xD1,0x23,0x37,0xF9,0xFF,0x55,0x59,0xF6,
|
||||
0x41,0x78,0x87,0xC9,0xCD,0x95,0xD2,0xE5,0x1B,0x3A,0x25,0x7A,
|
||||
0xD8,0x16,0x2F,0x58,0xFE,0x3B,0xD5,0xB1,0x59,0x63,0x3C,0x90,
|
||||
0xA0,0xBF,0xA0,0x21,0x54,0xB0,0xB0,0x3F,0x9D,0xC6,0xB5,0x31,
|
||||
0xBA,0x86,0xDC,0x86,0x41,0xB7,0xBA,0xCE,0x58,0x09,0x8B,0xD9,
|
||||
0xD4,0xF1,0xD2,0x3B,0x5F,0x87,0xEE,0x66,0xFD,0x77,0x8C,0x2C,
|
||||
0x66,0x3E,0xC9,0xDA,0x3E,0x2A,0x38,0x03,0x23,0x71,0xC9,0x04,
|
||||
0x3E,0x9D,0x18,0x7F,0xBB,0x82,0x21,0x8E,0x5F,0xF0,0xAF,0xC8,
|
||||
0x08,0x2D,0xA6,0x3F,
|
||||
};
|
||||
static unsigned char dsa2048_q[]={
|
||||
0xAE,0xCA,0x67,0x69,0x21,0x7A,0xE1,0x9B,0x64,0x74,0xED,0x58,
|
||||
0xF0,0x28,0xE0,0x45,0x2B,0x39,0xBC,0x79,
|
||||
};
|
||||
static unsigned char dsa2048_g[]={
|
||||
0x51,0x1D,0xB0,0xF6,0x4E,0x8B,0xAF,0x1C,0x59,0x71,0x62,0x3C,
|
||||
0xC3,0xE2,0x44,0x35,0xCE,0x11,0xB4,0x49,0x04,0x41,0xA1,0x1C,
|
||||
0x22,0x59,0x47,0x8C,0x70,0x1D,0xA1,0x0C,0x51,0xFE,0x86,0x43,
|
||||
0x7B,0x75,0x5C,0xB7,0x68,0xA5,0xBE,0x81,0x9C,0x6F,0x6D,0x32,
|
||||
0x03,0xB0,0x28,0xA4,0x6B,0x5B,0x37,0xC3,0x35,0xCF,0xBD,0x92,
|
||||
0xC3,0x66,0x2E,0xAB,0xB4,0x13,0xEC,0x23,0xA3,0xE3,0x09,0x4E,
|
||||
0x47,0x7D,0xA5,0x90,0x33,0x80,0x5D,0x68,0xD6,0x39,0x54,0xBE,
|
||||
0x35,0xB0,0x61,0x5B,0x96,0x63,0x05,0x67,0xB7,0x3C,0x21,0x17,
|
||||
0x37,0x50,0x17,0x78,0xEA,0xC0,0x10,0x73,0xDF,0xE2,0x70,0x19,
|
||||
0x17,0xF7,0x11,0x82,0x73,0xDB,0xFF,0x3E,0x8D,0x98,0x2F,0x2F,
|
||||
0xA2,0x12,0xC3,0xB4,0x08,0xB2,0x2C,0x5B,0xA3,0x51,0xAA,0x7F,
|
||||
0x3D,0xE0,0x74,0x39,0xE5,0xAF,0x81,0x32,0xF8,0x45,0x75,0x11,
|
||||
0x35,0xD9,0x90,0xA1,0xA3,0x91,0x1A,0xEE,0xE9,0xAC,0x97,0x30,
|
||||
0x4C,0xD5,0x5B,0x38,0x49,0x12,0x3B,0xCC,0x0C,0x84,0xA2,0x59,
|
||||
0x78,0xB4,0xFD,0x46,0xAC,0x49,0x43,0x08,0xDB,0xF4,0x23,0xFF,
|
||||
0x23,0xF8,0x9A,0xFD,0x15,0xAF,0x6B,0x81,0xCE,0x15,0x22,0xEF,
|
||||
0x09,0x64,0x0A,0x1F,0x4D,0x6B,0xF1,0x9F,0x16,0x00,0x3E,0xE8,
|
||||
0xFC,0x9A,0x24,0x58,0x1C,0xB4,0x5F,0x56,0x3E,0x83,0x8C,0x0C,
|
||||
0x51,0x43,0x72,0x25,0xA8,0x1D,0x08,0x30,0x7E,0x17,0xC8,0xD6,
|
||||
0x66,0x57,0x0C,0x59,0x76,0xE4,0xA6,0x0C,0x05,0xA8,0x60,0x1D,
|
||||
0xA4,0x8F,0xBC,0xC4,0x67,0x55,0x0E,0x81,0x8F,0x66,0xED,0x1B,
|
||||
0x84,0xCD,0x02,0x9F,
|
||||
};
|
||||
|
||||
DSA *get_dsa2048()
|
||||
{
|
||||
DSA *dsa;
|
||||
|
||||
if ((dsa=DSA_new()) == NULL) return(NULL);
|
||||
dsa->p=BN_bin2bn(dsa2048_p,sizeof(dsa2048_p),NULL);
|
||||
dsa->q=BN_bin2bn(dsa2048_q,sizeof(dsa2048_q),NULL);
|
||||
dsa->g=BN_bin2bn(dsa2048_g,sizeof(dsa2048_g),NULL);
|
||||
if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))
|
||||
{ DSA_free(dsa); return(NULL); }
|
||||
return(dsa);
|
||||
}
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "lllocalinventory.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llassetconverter.h"
|
||||
#include "dofloaterhex.h"
|
||||
|
||||
LLFloaterVFSExplorer* LLFloaterVFSExplorer::sInstance;
|
||||
std::map<LLVFSFileSpecifier, LLVFSFileBlock*> LLFloaterVFSExplorer::sVFSFileMap;
|
||||
@@ -41,7 +40,6 @@ BOOL LLFloaterVFSExplorer::postBuild()
|
||||
childSetAction("remove_btn", onClickRemove, this);
|
||||
childSetAction("reload_all_btn", onClickReload, this);
|
||||
childSetAction("copy_uuid_btn", onClickCopyUUID, this);
|
||||
childSetAction("edit_data_btn", onClickEditData, this);
|
||||
childSetAction("item_btn", onClickItem, this);
|
||||
refresh();
|
||||
return TRUE;
|
||||
@@ -175,13 +173,6 @@ void LLFloaterVFSExplorer::onClickReload(void* user_data)
|
||||
floaterp->reloadAll();
|
||||
}
|
||||
// static
|
||||
void LLFloaterVFSExplorer::onClickEditData(void* user_data)
|
||||
{
|
||||
LLFloaterVFSExplorer* floaterp = (LLFloaterVFSExplorer*)user_data;
|
||||
LLVFSFileSpecifier file = floaterp->getEditEntry();
|
||||
DOFloaterHex::show(file.mFileID, true, file.mFileType);
|
||||
}
|
||||
// static
|
||||
void LLFloaterVFSExplorer::onClickItem(void* user_data)
|
||||
{
|
||||
LLFloaterVFSExplorer* floaterp = (LLFloaterVFSExplorer*)user_data;
|
||||
|
||||
@@ -113,7 +113,6 @@
|
||||
#include "llfloateranimpreview.h" // for reuploads
|
||||
#include "llfloaterimagepreview.h" // for reuploads
|
||||
//#include "llcheats.h"
|
||||
#include "dofloaterhex.h"
|
||||
#include "hgfloatertexteditor.h"
|
||||
#include "statemachine/aifilepicker.h"
|
||||
// </edit>
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "llpreviewtexture.h"
|
||||
#include "llpreviewgesture.h"
|
||||
#include "llpreviewlandmark.h"
|
||||
#include "dofloaterhex.h"
|
||||
#include "hgfloatertexteditor.h"
|
||||
|
||||
#include "llappviewer.h"
|
||||
@@ -151,8 +150,7 @@ void LLLocalInventory::open(LLUUID item_id)
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Dunno how to open type " << type << ", falling back to hex editor" << llendl;
|
||||
DOFloaterHex::show(item_id);
|
||||
llwarns << "Dunno how to open type " << type << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +245,6 @@
|
||||
#include "lltexlayer.h"
|
||||
|
||||
// <edit>
|
||||
#include "dofloaterhex.h"
|
||||
#include "hgfloatertexteditor.h"
|
||||
#include "llfloatervfs.h"
|
||||
#include "llfloatervfsexplorer.h"
|
||||
@@ -473,7 +472,6 @@ void handle_force_ground_sit(void*);
|
||||
void handle_phantom_avatar(void*);
|
||||
void handle_hide_typing_notification(void*);
|
||||
void handle_close_all_notifications(void*);
|
||||
void handle_reopen_with_hex_editor(void*);
|
||||
//void handle_open_message_log(void*);
|
||||
void handle_edit_ao(void*);
|
||||
void handle_local_assets(void*);
|
||||
@@ -3638,11 +3636,6 @@ void process_grant_godlike_powers(LLMessageSystem* msg, void**)
|
||||
|
||||
// <edit>
|
||||
|
||||
void handle_reopen_with_hex_editor(void*)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*void handle_open_message_log(void*)
|
||||
{
|
||||
LLFloaterMessageLog::show();
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater can_close="true" can_drag_on_left="false" can_minimize="true"
|
||||
can_resize="true" height="200" width="580" min_width="580" min_height="128"
|
||||
name="floater_hex" title="Hex Editor" rect_control="FloaterHexRect">
|
||||
<text name="status_text" follows="left|top" left="120" top="-25" height="20">Loading...</text>
|
||||
<slider can_edit_text="false" top="-25" control_name="column_count"
|
||||
decimal_digits="3" follows="left|top" height="16" increment="1"
|
||||
initial_val="16" label="Columns" left="10" max_val="48" min_val="8"
|
||||
mouse_opaque="true" name="column_count" show_text="false" value="16"
|
||||
width="100" />
|
||||
<button name="upload_btn" follows="right|top" top="-25" right="-120" width="100" bottom="155" label="[UPLOAD]" enabled="false"/>
|
||||
<button name="save_btn" follows="right|top" top="-25" right="-10" width="100" bottom="155" label="Save" enabled="false"/>
|
||||
<hex_editor name="hex" follows="left|top|right|bottom" left="10" top="-50" right="-10" bottom="10" visible="false"/>
|
||||
</floater>
|
||||
@@ -9,7 +9,6 @@ include(LLMessage) # This is needed by LLPlugin.
|
||||
include(LLMath)
|
||||
include(LLVFS)
|
||||
include(LLXML)
|
||||
include(LLXUIXML)
|
||||
include(LLWindow)
|
||||
include(LLUI)
|
||||
include(LLRender)
|
||||
@@ -26,7 +25,6 @@ include_directories(
|
||||
${LLMATH_INCLUDE_DIRS}
|
||||
${LLVFS_INCLUDE_DIRS}
|
||||
${LLXML_INCLUDE_DIRS}
|
||||
${LLXUIXML_INCLUDE_DIRS}
|
||||
${LLWINDOW_INCLUDE_DIRS}
|
||||
${LLUI_INCLUDE_DIRS}
|
||||
${LLRENDER_INCLUDE_DIRS}
|
||||
|
||||
Reference in New Issue
Block a user