Merge viewer-neko

master
Ansariel 2019-12-01 13:55:07 +01:00
commit b0b4f0e9c1
21 changed files with 144 additions and 91 deletions

View File

@ -250,6 +250,64 @@ void _ll_apr_assert_status(apr_status_t status, const char* file, int line)
llassert(! _ll_apr_warn_status(status, file, line));
}
//---------------------------------------------------------------------
//
// Scope based pool access
//
//---------------------------------------------------------------------
class LLAPRFilePoolScope
{
public:
LLAPRFilePoolScope() : pPool(NULL), mInitialized(false) {}
LLAPRFilePoolScope(LLVolatileAPRPool* poolp) : mInitialized(false)
{
setFilePool(poolp);
}
~LLAPRFilePoolScope()
{
reset();
}
apr_pool_t* getVolatileAPRPool(LLVolatileAPRPool* poolp = NULL)
{
if (!pPool)
{
setFilePool(poolp);
}
if (mInitialized)
{
// We need one clear per one get
// At the moment no need to support multiple calls
LL_ERRS() << "LLAPRFilePoolScope is not supposed to be initialized twice" << LL_ENDL;
}
mInitialized = true;
return pPool->getVolatileAPRPool();
}
void reset()
{
if (mInitialized)
{
pPool->clearVolatileAPRPool();
}
}
private:
void setFilePool(LLVolatileAPRPool* poolp = NULL)
{
if (poolp)
{
pPool = poolp;
}
else
{
pPool = LLAPRFile::sAPRFilePoolp;
}
}
LLVolatileAPRPool *pPool;
bool mInitialized;
};
//---------------------------------------------------------------------
//
// LLAPRFile functions
@ -297,9 +355,10 @@ apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, LLV
//check if already open some file
llassert_always(!mFile) ;
llassert_always(!mCurrentFilePoolp) ;
apr_pool_t* apr_pool = pool ? pool->getVolatileAPRPool() : NULL ;
s = apr_file_open(&mFile, filename.c_str(), flags, APR_OS_DEFAULT, getAPRFilePool(apr_pool));
mCurrentFilePoolp = pool ? pool : sAPRFilePoolp;
apr_pool_t* apr_pool = mCurrentFilePoolp->getVolatileAPRPool(); //paired with clear in close()
s = apr_file_open(&mFile, filename.c_str(), flags, APR_OS_DEFAULT, apr_pool);
if (s != APR_SUCCESS || !mFile)
{
@ -324,14 +383,10 @@ apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, LLV
*sizep = file_size;
}
if(!mCurrentFilePoolp)
if (!mFile)
{
mCurrentFilePoolp = pool ;
if(!mFile)
{
close() ;
}
// It will clean pool
close() ;
}
return s ;
@ -358,17 +413,6 @@ apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, BOO
return s;
}
apr_pool_t* LLAPRFile::getAPRFilePool(apr_pool_t* pool)
{
if(!pool)
{
mCurrentFilePoolp = sAPRFilePoolp ;
return mCurrentFilePoolp->getVolatileAPRPool() ;
}
return pool ;
}
// File I/O
S32 LLAPRFile::read(void *buf, S32 nbytes)
{
@ -425,7 +469,7 @@ S32 LLAPRFile::seek(apr_seek_where_t where, S32 offset)
//
//static
apr_status_t LLAPRFile::close(apr_file_t* file_handle, LLVolatileAPRPool* pool)
apr_status_t LLAPRFile::close(apr_file_t* file_handle)
{
apr_status_t ret = APR_SUCCESS ;
if(file_handle)
@ -434,29 +478,23 @@ apr_status_t LLAPRFile::close(apr_file_t* file_handle, LLVolatileAPRPool* pool)
file_handle = NULL ;
}
if(pool)
{
pool->clearVolatileAPRPool() ;
}
return ret ;
}
//static
apr_file_t* LLAPRFile::open(const std::string& filename, LLVolatileAPRPool* pool, apr_int32_t flags)
apr_file_t* LLAPRFile::open(const std::string& filename, apr_pool_t* apr_pool, apr_int32_t flags)
{
apr_status_t s;
apr_file_t* file_handle ;
pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
s = apr_file_open(&file_handle, filename.c_str(), flags, APR_OS_DEFAULT, pool->getVolatileAPRPool());
s = apr_file_open(&file_handle, filename.c_str(), flags, APR_OS_DEFAULT, apr_pool);
if (s != APR_SUCCESS || !file_handle)
{
ll_apr_warn_status(s);
LL_WARNS("APR") << " Attempting to open filename: " << filename << LL_ENDL;
file_handle = NULL ;
close(file_handle, pool) ;
close(file_handle) ;
return NULL;
}
@ -499,8 +537,9 @@ S32 LLAPRFile::seek(apr_file_t* file_handle, apr_seek_where_t where, S32 offset)
S32 LLAPRFile::readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool)
{
//*****************************************
apr_file_t* file_handle = open(filename, pool, APR_READ|APR_BINARY);
//*****************************************
LLAPRFilePoolScope scope(pool);
apr_file_t* file_handle = open(filename, scope.getVolatileAPRPool(), APR_READ|APR_BINARY);
//*****************************************
if (!file_handle)
{
return 0;
@ -533,7 +572,7 @@ S32 LLAPRFile::readEx(const std::string& filename, void *buf, S32 offset, S32 nb
}
//*****************************************
close(file_handle, pool) ;
close(file_handle) ;
//*****************************************
return (S32)bytes_read;
}
@ -547,9 +586,10 @@ S32 LLAPRFile::writeEx(const std::string& filename, void *buf, S32 offset, S32 n
flags |= APR_APPEND;
offset = 0;
}
//*****************************************
apr_file_t* file_handle = open(filename, pool, flags);
LLAPRFilePoolScope scope(pool);
apr_file_t* file_handle = open(filename, scope.getVolatileAPRPool(), flags);
//*****************************************
if (!file_handle)
{
@ -583,7 +623,7 @@ S32 LLAPRFile::writeEx(const std::string& filename, void *buf, S32 offset, S32 n
}
//*****************************************
LLAPRFile::close(file_handle, pool);
LLAPRFile::close(file_handle);
//*****************************************
return (S32)bytes_written;
@ -594,9 +634,8 @@ bool LLAPRFile::remove(const std::string& filename, LLVolatileAPRPool* pool)
{
apr_status_t s;
pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
s = apr_file_remove(filename.c_str(), pool->getVolatileAPRPool());
pool->clearVolatileAPRPool() ;
LLAPRFilePoolScope scope(pool);
s = apr_file_remove(filename.c_str(), scope.getVolatileAPRPool());
if (s != APR_SUCCESS)
{
@ -612,9 +651,8 @@ bool LLAPRFile::rename(const std::string& filename, const std::string& newname,
{
apr_status_t s;
pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
s = apr_file_rename(filename.c_str(), newname.c_str(), pool->getVolatileAPRPool());
pool->clearVolatileAPRPool() ;
LLAPRFilePoolScope scope(pool);
s = apr_file_rename(filename.c_str(), newname.c_str(), scope.getVolatileAPRPool());
if (s != APR_SUCCESS)
{
@ -631,18 +669,16 @@ bool LLAPRFile::isExist(const std::string& filename, LLVolatileAPRPool* pool, ap
apr_file_t* apr_file;
apr_status_t s;
pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
s = apr_file_open(&apr_file, filename.c_str(), flags, APR_OS_DEFAULT, pool->getVolatileAPRPool());
LLAPRFilePoolScope scope(pool);
s = apr_file_open(&apr_file, filename.c_str(), flags, APR_OS_DEFAULT, scope.getVolatileAPRPool());
if (s != APR_SUCCESS || !apr_file)
{
pool->clearVolatileAPRPool() ;
return false;
}
else
{
apr_file_close(apr_file) ;
pool->clearVolatileAPRPool() ;
return true;
}
}
@ -653,14 +689,12 @@ S32 LLAPRFile::size(const std::string& filename, LLVolatileAPRPool* pool)
apr_file_t* apr_file;
apr_finfo_t info;
apr_status_t s;
pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
s = apr_file_open(&apr_file, filename.c_str(), APR_READ, APR_OS_DEFAULT, pool->getVolatileAPRPool());
LLAPRFilePoolScope scope(pool);
s = apr_file_open(&apr_file, filename.c_str(), APR_READ, APR_OS_DEFAULT, scope.getVolatileAPRPool());
if (s != APR_SUCCESS || !apr_file)
{
pool->clearVolatileAPRPool() ;
{
return 0;
}
else
@ -668,7 +702,6 @@ S32 LLAPRFile::size(const std::string& filename, LLVolatileAPRPool* pool)
apr_status_t s = apr_file_info_get(&info, APR_FINFO_SIZE, apr_file);
apr_file_close(apr_file) ;
pool->clearVolatileAPRPool() ;
if (s == APR_SUCCESS)
{
@ -686,9 +719,8 @@ bool LLAPRFile::makeDir(const std::string& dirname, LLVolatileAPRPool* pool)
{
apr_status_t s;
pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
s = apr_dir_make(dirname.c_str(), APR_FPROT_OS_DEFAULT, pool->getVolatileAPRPool());
pool->clearVolatileAPRPool() ;
LLAPRFilePoolScope scope(pool);
s = apr_dir_make(dirname.c_str(), APR_FPROT_OS_DEFAULT, scope.getVolatileAPRPool());
if (s != APR_SUCCESS)
{
@ -704,9 +736,8 @@ bool LLAPRFile::removeDir(const std::string& dirname, LLVolatileAPRPool* pool)
{
apr_status_t s;
pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
s = apr_file_remove(dirname.c_str(), pool->getVolatileAPRPool());
pool->clearVolatileAPRPool() ;
LLAPRFilePoolScope scope(pool);
s = apr_file_remove(dirname.c_str(), scope.getVolatileAPRPool());
if (s != APR_SUCCESS)
{

View File

@ -186,9 +186,6 @@ public:
apr_file_t* getFileHandle() {return mFile;}
void flush(); // <FS:ND/> Forceful file flushing
private:
apr_pool_t* getAPRFilePool(apr_pool_t* pool) ;
//
//*******************************************************************************************************************************
@ -198,8 +195,8 @@ public:
static LLVolatileAPRPool *sAPRFilePoolp ; //a global apr_pool for APRFile, which is used only when local pool does not exist.
private:
static apr_file_t* open(const std::string& filename, LLVolatileAPRPool* pool, apr_int32_t flags);
static apr_status_t close(apr_file_t* file, LLVolatileAPRPool* pool) ;
static apr_file_t* open(const std::string& filename, apr_pool_t* apr_pool, apr_int32_t flags);
static apr_status_t close(apr_file_t* file) ;
static S32 seek(apr_file_t* file, apr_seek_where_t where, S32 offset);
public:
// returns false if failure:

View File

@ -144,7 +144,7 @@ bool LLKeyData::canHandle(const LLKeyData& data) const
{
if (data.mKey == mKey
&& data.mMouse == mMouse
&& ((mIgnoreMasks && (data.mMask & mMask) == data.mMask) || data.mMask == mMask))
&& ((mIgnoreMasks && (data.mMask & mMask) == mMask) || data.mMask == mMask))
{
return true;
}
@ -155,7 +155,7 @@ bool LLKeyData::canHandle(EMouseClickType mouse, KEY key, MASK mask) const
{
if (mouse == mMouse
&& key == mKey
&& ((mIgnoreMasks && (mask & mMask) == mask) || mask == mMask))
&& ((mIgnoreMasks && (mask & mMask) == mMask) || mask == mMask))
{
return true;
}

View File

@ -53,7 +53,7 @@ public:
EMouseClickType mMouse;
KEY mKey;
MASK mMask;
// Either to expect exact match or ignore not expected masks
// Either to expect exact match or to make sure mMask is inclused and ignore not expected masks
bool mIgnoreMasks;
};

View File

@ -160,8 +160,8 @@ public:
LLXMLNodePtr root_node;
if (!LLUICtrlFactory::getLayeredXMLNode(filename, root_node))
{
LL_WARNS() << "Couldn't parse XUI file: " << instance().getCurFileName() << LL_ENDL;
{
LL_WARNS() << "Couldn't parse XUI from path: " << instance().getCurFileName() << ", from filename: " << filename << LL_ENDL;
goto fail;
}

View File

@ -1138,7 +1138,8 @@ LLView* LLChatHistory::getSeparator()
LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args)
{
LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename);
header->setup(chat, style_params, args);
if (header)
header->setup(chat, style_params, args);
return header;
}
@ -1364,6 +1365,12 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
view = getSeparator();
p.top_pad = mTopSeparatorPad;
p.bottom_pad = mBottomSeparatorPad;
if (!view)
{
// Might be wiser to make this LL_ERRS, getSeparator() should work in case of correct instalation.
LL_WARNS() << "Failed to create separator from " << mMessageSeparatorFilename << ": can't append to history" << LL_ENDL;
return;
}
}
else
{
@ -1372,7 +1379,12 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
p.top_pad = 0;
else
p.top_pad = mTopHeaderPad;
p.bottom_pad = mBottomHeaderPad;
p.bottom_pad = mBottomHeaderPad;
if (!view)
{
LL_WARNS() << "Failed to create header from " << mMessageHeaderFilename << ": can't append to history" << LL_ENDL;
return;
}
}
p.view = view;

View File

@ -1058,6 +1058,7 @@ void LLOutfitGallery::updateSnapshotFolderObserver()
void LLOutfitGallery::refreshOutfit(const LLUUID& category_id)
{
LLViewerInventoryCategory* category = gInventory.getCategory(category_id);
if (category)
{
bool photo_loaded = false;
LLInventoryModel::cat_array_t sub_cat_array;
@ -1376,6 +1377,7 @@ void LLOutfitGallery::onSelectPhoto(LLUUID selected_outfit_id)
texture_floaterp->setOnFloaterCommitCallback(boost::bind(&LLOutfitGallery::onTexturePickerCommit, this, _1, _2));
texture_floaterp->setOnUpdateImageStatsCallback(boost::bind(&LLOutfitGallery::onTexturePickerUpdateImageStats, this, _1));
texture_floaterp->setLocalTextureEnabled(FALSE);
texture_floaterp->setCanApply(false, true);
}
floaterp->openFloater();

View File

@ -145,8 +145,9 @@ BOOL LLToolGrabBase::handleMouseDown(S32 x, S32 y, MASK mask)
// call the base class to propogate info to sim
LLTool::handleMouseDown(x, y, mask);
if (!gAgent.leftButtonGrabbed())
// leftButtonGrabbed() checks if controls are reserved by scripts, but does not take masks into account
if (!gAgent.leftButtonGrabbed() || ((mask & DEFAULT_GRAB_MASK) != 0 && !gAgentCamera.cameraMouselook()))
{
// can grab transparent objects (how touch event propagates, scripters rely on this)
gViewerWindow->pickAsync(x, y, mask, pickCallback, /*BOOL pick_transparent*/ TRUE);

View File

@ -44,6 +44,7 @@ class LLPickInfo;
void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset);
void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick);
const MASK DEFAULT_GRAB_MASK = MASK_CONTROL;
/**
* LLToolGrabBase contains most of the semantics of LLToolGrab. It's just that

View File

@ -1701,7 +1701,7 @@ LLTool* LLToolPie::getOverrideTool(MASK mask)
if (enableGrab)
// </FS:Ansariel>
{
if (mask == MASK_CONTROL)
if (mask == DEFAULT_GRAB_MASK)
{
return LLToolGrab::getInstance();
}

View File

@ -7,7 +7,8 @@
Flere teksturer
</text>
<text name="unknown">
Størrelse: [DIMENSIONS]
Størrelse:
[DIMENSIONS]
</text>
<button label="Standard" label_selected="Standard" name="Default"/>
<button label="Ingen" label_selected="Ingen" name="None"/>

View File

@ -21,7 +21,7 @@
<button label="Keine" label_selected="Keine" name="None"/>
<button label="Leer" label_selected="Leer" name="Blank"/>
<button label="Transparent" label_selected="Transparent" name="Transparent" tool_tip="Hinweis: Falls eine transparente Textur oder eine andere Textur mit teilweiser Transparenz gewählt wird, wird kein Licht projiziert."/>
<button label="" label_selected="" top_delta="-15" name="Pipette"/>
<button label="" label_selected="" name="Pipette"/>
<check_box label="Live-Vorschau" name="apply_immediate_check"/>
<text name="preview_disabled">
Vorschau deaktiviert

View File

@ -156,14 +156,15 @@
width="28" />
<text
follows="left|bottom"
height="20"
height="40"
layout="topleft"
left="8"
name="preview_disabled"
top="282"
top="275"
value="Preview Disabled"
word_wrap="true"
visible="false"
width="120" />
width="87" />
<filter_editor
follows="left|top|right"
height="23"

View File

@ -7630,12 +7630,14 @@ You can only claim public land that is in the same region as you.
</notification>
<notification
icon="notify.tga"
icon="alertmodal.tga"
name="RegionTPAccessBlocked"
persist="false"
type="notify">
type="alertmodal">
<tag>fail</tag>
The region you're trying to visit contains content exceeding your current preferences. You can change your preferences using Avatar &gt; Preferences &gt; General.
<usetemplate
name="okbutton"
yestext="OK"/>
</notification>
<notification

View File

@ -8,8 +8,8 @@
<radio_item label="Local" name="local"/>
</radio_group>
<text name="unknown">
Taille :
[DIMENSIONS]
Taille:
[DIMENSIONS]
</text>
<button label="Par défaut" label_selected="Par défaut" name="Default"/>
<button label="Vierge" label_selected="Vierge" name="Blank"/>

View File

@ -14,7 +14,8 @@
<radio_item label="ローカル" name="local" value="1"/>
</radio_group>
<text name="unknown">
サイズ: [DIMENSIONS]
サイズ:
[DIMENSIONS]
</text>
<button label="デフォルト" label_selected="デフォルト" name="Default"/>
<button label="ブランク" label_selected="ブランク" name="Blank"/>

View File

@ -22,7 +22,7 @@
<button label="Pusta" label_selected="Pusta" name="Blank"/>
<button label="Przezrocz." label_selected="Przezrocz." tool_tip="Uwaga: Jeśli wybrano teksturę z częściową lub całkowitą przezroczystością, to światło nie będzie przez nią rzucane." name="Transparent"/>
<button label="Żadna" label_selected="Żadna" name="None"/>
<button top_delta="-15" name="Pipette"/>
<button name="Pipette"/>
<text name="preview_disabled" value="Podgląd wyłączony"/>
<filter_editor label="Filtruj tekstury" name="inventory search editor"/>
<check_box label="Pokaż foldery" name="show_folders_check"/>

View File

@ -14,7 +14,8 @@
<radio_item label="Local" name="local" value="1"/>
</radio_group>
<text name="unknown">
Tamanho: [DIMENSÕES]
Tamanho:
[DIMENSÕES]
</text>
<button label="Padrão" label_selected="Padrão" name="Default"/>
<button label="Branco" label_selected="Branco" name="Blank"/>

View File

@ -14,7 +14,8 @@
<radio_item label="Локально" name="local" value="1"/>
</radio_group>
<text name="unknown">
Размер: [DIMENSIONS]
Размер:
[DIMENSIONS]
</text>
<button label="По умолчанию" label_selected="По умолчанию" name="Default"/>
<button label="Очистить" label_selected="Очистить" name="Blank"/>

View File

@ -14,7 +14,8 @@
<radio_item label="Yerel" name="local" value="1"/>
</radio_group>
<text name="unknown">
Büyüklük: [DIMENSIONS]
Büyüklük:
[DIMENSIONS]
</text>
<button label="Varsayılan" label_selected="Varsayılan" name="Default"/>
<button label="Boş" label_selected="Boş" name="Blank"/>

View File

@ -14,7 +14,8 @@
<radio_item label="本地" name="local" value="1"/>
</radio_group>
<text name="unknown">
尺寸:[DIMENSIONS]
尺寸:
[DIMENSIONS]
</text>
<button label="預設" label_selected="預設" name="Default"/>
<button label="空白" label_selected="空白" name="Blank"/>