merge -r 130399-131510 skinning-21 -> viewer-2.0.0-3
DEV-11254 DEV-11254 DEV-2003: DEV-21567 DEV-37301 EXT-104 EXT-138 EXT-217 EXT-256 EXT-259 EXT-259 EXT-328 EXT-348 EXT-386 EXT-399 EXT-403 EXT-460 EXT-492 EXT-492 EXT-531 EXT-537 EXT-684 improved text editor (handles multiple fonts simultaneously as well as inline widgets)master
parent
c2619694fd
commit
138bf11322
|
|
@ -180,9 +180,11 @@ void LLCharacter::requestStopMotion( LLMotion* motion)
|
|||
//-----------------------------------------------------------------------------
|
||||
// updateMotions()
|
||||
//-----------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation");
|
||||
|
||||
void LLCharacter::updateMotions(e_update_t update_type)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_UPDATE_ANIMATION);
|
||||
LLFastTimer t(FTM_UPDATE_ANIMATION);
|
||||
if (update_type == HIDDEN_UPDATE)
|
||||
{
|
||||
mMotionController.updateMotionsMinimal();
|
||||
|
|
|
|||
|
|
@ -69,13 +69,13 @@ public:
|
|||
std::vector<NamedTimer*>& getChildren();
|
||||
|
||||
void setCollapsed(bool collapsed) { mCollapsed = collapsed; }
|
||||
bool getCollapsed() { return mCollapsed; }
|
||||
bool getCollapsed() const { return mCollapsed; }
|
||||
|
||||
U64 getCountAverage() { return mCountAverage; }
|
||||
U64 getCallAverage() { return mCallAverage; }
|
||||
U64 getCountAverage() const { return mCountAverage; }
|
||||
U64 getCallAverage() const { return mCallAverage; }
|
||||
|
||||
U64 getHistoricalCount(S32 history_index = 0);
|
||||
U64 getHistoricalCalls(S32 history_index = 0);
|
||||
U64 getHistoricalCount(S32 history_index = 0) const;
|
||||
U64 getHistoricalCalls(S32 history_index = 0) const;
|
||||
|
||||
static NamedTimer& getRootNamedTimer();
|
||||
|
||||
|
|
@ -162,117 +162,6 @@ public:
|
|||
NamedTimer& mNamedTimer;
|
||||
};
|
||||
|
||||
static DeclareTimer FTM_ARRANGE;
|
||||
static DeclareTimer FTM_ATTACHMENT_UPDATE;
|
||||
static DeclareTimer FTM_AUDIO_UPDATE;
|
||||
static DeclareTimer FTM_AUTO_SELECT;
|
||||
static DeclareTimer FTM_AVATAR_UPDATE;
|
||||
static DeclareTimer FTM_CLEANUP;
|
||||
static DeclareTimer FTM_CLIENT_COPY;
|
||||
static DeclareTimer FTM_CREATE_OBJECT;
|
||||
static DeclareTimer FTM_CULL;
|
||||
static DeclareTimer FTM_CULL_REBOUND;
|
||||
static DeclareTimer FTM_FILTER;
|
||||
static DeclareTimer FTM_FLEXIBLE_UPDATE;
|
||||
static DeclareTimer FTM_FRAME;
|
||||
static DeclareTimer FTM_FRUSTUM_CULL;
|
||||
static DeclareTimer FTM_GEN_FLEX;
|
||||
static DeclareTimer FTM_GEN_TRIANGLES;
|
||||
static DeclareTimer FTM_GEN_VOLUME;
|
||||
static DeclareTimer FTM_GEO_SKY;
|
||||
static DeclareTimer FTM_GEO_UPDATE;
|
||||
static DeclareTimer FTM_HUD_EFFECTS;
|
||||
static DeclareTimer FTM_HUD_UPDATE;
|
||||
static DeclareTimer FTM_IDLE;
|
||||
static DeclareTimer FTM_IDLE_CB;
|
||||
static DeclareTimer FTM_IDLE_NETWORK;
|
||||
static DeclareTimer FTM_IMAGE_CREATE;
|
||||
static DeclareTimer FTM_IMAGE_MARK_DIRTY;
|
||||
static DeclareTimer FTM_IMAGE_UPDATE;
|
||||
static DeclareTimer FTM_INVENTORY;
|
||||
static DeclareTimer FTM_JOINT_UPDATE;
|
||||
static DeclareTimer FTM_KEYHANDLER;
|
||||
static DeclareTimer FTM_LOAD_AVATAR;
|
||||
static DeclareTimer FTM_LOD_UPDATE;
|
||||
static DeclareTimer FTM_MESSAGES;
|
||||
static DeclareTimer FTM_MOUSEHANDLER;
|
||||
static DeclareTimer FTM_NETWORK;
|
||||
static DeclareTimer FTM_OBJECTLIST_UPDATE;
|
||||
static DeclareTimer FTM_OCCLUSION_READBACK;
|
||||
static DeclareTimer FTM_OCTREE_BALANCE;
|
||||
static DeclareTimer FTM_PICK;
|
||||
static DeclareTimer FTM_PIPELINE;
|
||||
static DeclareTimer FTM_POOLRENDER;
|
||||
static DeclareTimer FTM_POOLS;
|
||||
static DeclareTimer FTM_PROCESS_IMAGES;
|
||||
static DeclareTimer FTM_PROCESS_MESSAGES;
|
||||
static DeclareTimer FTM_PROCESS_OBJECTS;
|
||||
static DeclareTimer FTM_PUMP;
|
||||
static DeclareTimer FTM_REBUILD_GRASS_VB;
|
||||
static DeclareTimer FTM_REBUILD_PARTICLE_VB;
|
||||
static DeclareTimer FTM_REBUILD_TERRAIN_VB;
|
||||
static DeclareTimer FTM_REBUILD_VBO;
|
||||
static DeclareTimer FTM_REBUILD_VOLUME_VB;
|
||||
static DeclareTimer FTM_REFRESH;
|
||||
static DeclareTimer FTM_REGION_UPDATE;
|
||||
static DeclareTimer FTM_RENDER;
|
||||
static DeclareTimer FTM_RENDER_ALPHA;
|
||||
static DeclareTimer FTM_RENDER_BLOOM;
|
||||
static DeclareTimer FTM_RENDER_BLOOM_FBO;
|
||||
static DeclareTimer FTM_RENDER_BUMP;
|
||||
static DeclareTimer FTM_RENDER_CHARACTERS;
|
||||
static DeclareTimer FTM_RENDER_FAKE_VBO_UPDATE;
|
||||
static DeclareTimer FTM_RENDER_FONTS;
|
||||
static DeclareTimer FTM_RENDER_FULLBRIGHT;
|
||||
static DeclareTimer FTM_RENDER_GEOMETRY;
|
||||
static DeclareTimer FTM_RENDER_GLOW;
|
||||
static DeclareTimer FTM_RENDER_GRASS;
|
||||
static DeclareTimer FTM_RENDER_INVISIBLE;
|
||||
static DeclareTimer FTM_RENDER_OCCLUSION;
|
||||
static DeclareTimer FTM_RENDER_SHINY;
|
||||
static DeclareTimer FTM_RENDER_SIMPLE;
|
||||
static DeclareTimer FTM_RENDER_TERRAIN;
|
||||
static DeclareTimer FTM_RENDER_TREES;
|
||||
static DeclareTimer FTM_RENDER_UI;
|
||||
static DeclareTimer FTM_RENDER_WATER;
|
||||
static DeclareTimer FTM_RENDER_WL_SKY;
|
||||
static DeclareTimer FTM_RESET_DRAWORDER;
|
||||
static DeclareTimer FTM_SHADOW_ALPHA;
|
||||
static DeclareTimer FTM_SHADOW_AVATAR;
|
||||
static DeclareTimer FTM_SHADOW_RENDER;
|
||||
static DeclareTimer FTM_SHADOW_SIMPLE;
|
||||
static DeclareTimer FTM_SHADOW_TERRAIN;
|
||||
static DeclareTimer FTM_SHADOW_TREE;
|
||||
static DeclareTimer FTM_SIMULATE_PARTICLES;
|
||||
static DeclareTimer FTM_SLEEP;
|
||||
static DeclareTimer FTM_SORT;
|
||||
static DeclareTimer FTM_STATESORT;
|
||||
static DeclareTimer FTM_STATESORT_DRAWABLE;
|
||||
static DeclareTimer FTM_STATESORT_POSTSORT;
|
||||
static DeclareTimer FTM_SWAP;
|
||||
static DeclareTimer FTM_TEMP1;
|
||||
static DeclareTimer FTM_TEMP2;
|
||||
static DeclareTimer FTM_TEMP3;
|
||||
static DeclareTimer FTM_TEMP4;
|
||||
static DeclareTimer FTM_TEMP5;
|
||||
static DeclareTimer FTM_TEMP6;
|
||||
static DeclareTimer FTM_TEMP7;
|
||||
static DeclareTimer FTM_TEMP8;
|
||||
static DeclareTimer FTM_UPDATE_ANIMATION;
|
||||
static DeclareTimer FTM_UPDATE_AVATAR;
|
||||
static DeclareTimer FTM_UPDATE_CLOUDS;
|
||||
static DeclareTimer FTM_UPDATE_GRASS;
|
||||
static DeclareTimer FTM_UPDATE_MOVE;
|
||||
static DeclareTimer FTM_UPDATE_PARTICLES;
|
||||
static DeclareTimer FTM_UPDATE_PRIMITIVES;
|
||||
static DeclareTimer FTM_UPDATE_SKY;
|
||||
static DeclareTimer FTM_UPDATE_TERRAIN;
|
||||
static DeclareTimer FTM_UPDATE_TEXTURES;
|
||||
static DeclareTimer FTM_UPDATE_TREE;
|
||||
static DeclareTimer FTM_UPDATE_WATER;
|
||||
static DeclareTimer FTM_UPDATE_WLPARAM;
|
||||
static DeclareTimer FTM_VFILE_WAIT;
|
||||
static DeclareTimer FTM_WORLD_UPDATE;
|
||||
|
||||
public:
|
||||
enum RootTimerMarker { ROOT };
|
||||
|
|
@ -287,6 +176,7 @@ public:
|
|||
LLFastTimer(NamedTimer::FrameState& timer)
|
||||
: mFrameState(&timer)
|
||||
{
|
||||
#if FAST_TIMER_ON
|
||||
NamedTimer::FrameState* frame_state = mFrameState;
|
||||
frame_state->mLastStartTime = get_cpu_clock_count();
|
||||
mStartSelfTime = frame_state->mLastStartTime;
|
||||
|
|
@ -298,6 +188,7 @@ public:
|
|||
|
||||
mLastTimer = sCurTimer;
|
||||
sCurTimer = this;
|
||||
#endif
|
||||
}
|
||||
|
||||
~LLFastTimer()
|
||||
|
|
@ -332,6 +223,7 @@ public:
|
|||
static S32 getCurFrameIndex() { return sCurFrameIndex; }
|
||||
|
||||
static void writeLog(std::ostream& os);
|
||||
static const NamedTimer* getTimerByName(const std::string& name);
|
||||
|
||||
public:
|
||||
static bool sPauseHistory;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ void LLMetricsImpl::recordEventDetails(const std::string& location,
|
|||
metrics["location"] = location;
|
||||
metrics["stats"] = stats;
|
||||
|
||||
llinfos << "LLMETRICS: " << LLSDNotationStreamer(metrics) << llendl;
|
||||
llinfos << "LLMETRICS: " << (LLSDNotationStreamer(metrics)) << llendl;
|
||||
}
|
||||
|
||||
// Store this:
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
#ifndef LLREFCOUNT_H
|
||||
#define LLREFCOUNT_H
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// RefCount objects should generally only be accessed by way of LLPointer<>'s
|
||||
// see llthread.h for LLThreadSafeRefCount
|
||||
|
|
@ -40,10 +42,9 @@
|
|||
class LLRefCount
|
||||
{
|
||||
protected:
|
||||
LLRefCount(const LLRefCount&); // not implemented
|
||||
LLRefCount(const LLRefCount& other); // no implementation
|
||||
private:
|
||||
LLRefCount&operator=(const LLRefCount&); // not implemented
|
||||
|
||||
LLRefCount& operator=(const LLRefCount&); // no implementation
|
||||
protected:
|
||||
virtual ~LLRefCount(); // use unref()
|
||||
|
||||
|
|
|
|||
|
|
@ -819,9 +819,15 @@ static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat)
|
|||
{
|
||||
std::ostringstream out;
|
||||
if (useXMLFormat)
|
||||
out << LLSDXMLStreamer(llsd);
|
||||
{
|
||||
LLSDXMLStreamer xml_streamer(llsd);
|
||||
out << xml_streamer;
|
||||
}
|
||||
else
|
||||
out << LLSDNotationStreamer(llsd);
|
||||
{
|
||||
LLSDNotationStreamer notation_streamer(llsd);
|
||||
out << notation_streamer;
|
||||
}
|
||||
out_string = out.str();
|
||||
}
|
||||
int len = out_string.length();
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@
|
|||
#include <winnls.h> // for WideCharToMultiByte
|
||||
#endif
|
||||
|
||||
LLFastTimer::DeclareTimer STRING_LOCALIZATION("String Localization");
|
||||
|
||||
|
||||
std::string ll_safe_string(const char* in)
|
||||
{
|
||||
if(in) return std::string(in);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include <iomanip>
|
||||
#include <boost/regex.hpp>
|
||||
#include "llsd.h"
|
||||
#include "llfasttimer.h"
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
#include <wctype.h>
|
||||
|
|
@ -337,6 +338,9 @@ public:
|
|||
// Copies src into dst at a given offset.
|
||||
static void copyInto(std::basic_string<T>& dst, const std::basic_string<T>& src, size_type offset);
|
||||
|
||||
static bool isPartOfWord(T c) { return (c == (T)'_') || LLStringOps::isAlnum(c); }
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
static void testHarness();
|
||||
#endif
|
||||
|
|
@ -617,10 +621,13 @@ void LLStringUtilBase<T>::getTokens (std::basic_string<T> input, std::vector<std
|
|||
}
|
||||
}
|
||||
|
||||
extern LLFastTimer::DeclareTimer STRING_LOCALIZATION;
|
||||
|
||||
// static
|
||||
template<class T>
|
||||
S32 LLStringUtilBase<T>::format(std::basic_string<T>& s, const format_map_t& substitutions)
|
||||
{
|
||||
LLFastTimer ft(STRING_LOCALIZATION);
|
||||
S32 res = 0;
|
||||
|
||||
std::basic_ostringstream<T> output;
|
||||
|
|
@ -695,6 +702,8 @@ S32 LLStringUtilBase<T>::format(std::basic_string<T>& s, const format_map_t& sub
|
|||
template<class T>
|
||||
S32 LLStringUtilBase<T>::format(std::basic_string<T>& s, const LLSD& substitutions)
|
||||
{
|
||||
LLFastTimer ft(STRING_LOCALIZATION);
|
||||
|
||||
S32 res = 0;
|
||||
|
||||
if (!substitutions.isMap())
|
||||
|
|
|
|||
|
|
@ -141,10 +141,20 @@ public:
|
|||
|
||||
// Note: Does NOT follow GL_QUAD conventions: the top and right edges ARE considered part of the rect
|
||||
// returns TRUE if any part of rect is is inside this LLRect
|
||||
BOOL rectInRect(const LLRectBase* rect) const
|
||||
BOOL overlaps(const LLRectBase& rect) const
|
||||
{
|
||||
return mLeft <= rect->mRight && rect->mLeft <= mRight &&
|
||||
mBottom <= rect->mTop && rect->mBottom <= mTop ;
|
||||
return !(mLeft > rect.mRight
|
||||
|| mRight < rect.mLeft
|
||||
|| mBottom > rect.mTop
|
||||
|| mTop < rect.mBottom);
|
||||
}
|
||||
|
||||
BOOL contains(const LLRectBase& rect) const
|
||||
{
|
||||
return mLeft <= rect.mLeft
|
||||
&& mRight >= rect.mRight
|
||||
&& mBottom <= rect.mBottom
|
||||
&& mTop >= rect.mTop;
|
||||
}
|
||||
|
||||
LLRectBase& set(Type left, Type top, Type right, Type bottom)
|
||||
|
|
@ -223,26 +233,25 @@ public:
|
|||
return mLeft <= mRight && mBottom <= mTop;
|
||||
}
|
||||
|
||||
bool isNull() const
|
||||
bool isEmpty() const
|
||||
{
|
||||
return mLeft == mRight || mBottom == mTop;
|
||||
}
|
||||
|
||||
bool notNull() const
|
||||
bool notEmpty() const
|
||||
{
|
||||
return !isNull();
|
||||
return !isEmpty();
|
||||
}
|
||||
|
||||
LLRectBase& unionWith(const LLRectBase &other)
|
||||
void unionWith(const LLRectBase &other)
|
||||
{
|
||||
mLeft = llmin(mLeft, other.mLeft);
|
||||
mRight = llmax(mRight, other.mRight);
|
||||
mBottom = llmin(mBottom, other.mBottom);
|
||||
mTop = llmax(mTop, other.mTop);
|
||||
return *this;
|
||||
}
|
||||
|
||||
LLRectBase& intersectWith(const LLRectBase &other)
|
||||
void intersectWith(const LLRectBase &other)
|
||||
{
|
||||
mLeft = llmax(mLeft, other.mLeft);
|
||||
mRight = llmin(mRight, other.mRight);
|
||||
|
|
@ -256,7 +265,6 @@ public:
|
|||
{
|
||||
mBottom = mTop;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
friend std::ostream &operator<<(std::ostream &s, const LLRectBase &rect)
|
||||
|
|
|
|||
|
|
@ -444,11 +444,13 @@ void LLPumpIO::pump()
|
|||
pump(DEFAULT_POLL_TIMEOUT);
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_PUMP("Pump");
|
||||
|
||||
//timeout is in microseconds
|
||||
void LLPumpIO::pump(const S32& poll_timeout)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
LLFastTimer t1(LLFastTimer::FTM_PUMP);
|
||||
LLFastTimer t1(FTM_PUMP);
|
||||
//llinfos << "LLPumpIO::pump()" << llendl;
|
||||
|
||||
// Run any pending runners.
|
||||
|
|
|
|||
|
|
@ -531,6 +531,8 @@ void LLTemplateMessageReader::logRanOffEndOfPacket( const LLHost& host, const S3
|
|||
gMessageSystem->callExceptionFunc(MX_RAN_OFF_END_OF_PACKET);
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_PROCESS_MESSAGES("Process Messages");
|
||||
|
||||
// decode a given message
|
||||
BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender )
|
||||
{
|
||||
|
|
@ -714,7 +716,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
|
|||
}
|
||||
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_PROCESS_MESSAGES);
|
||||
LLFastTimer t(FTM_PROCESS_MESSAGES);
|
||||
if( !mCurrentRMessageTemplate->callHandlerFunc(gMessageSystem) )
|
||||
{
|
||||
llwarns << "Message from " << sender << " with no handler function received: " << mCurrentRMessageTemplate->mName << llendl;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "linden_common.h"
|
||||
|
||||
#include "llfontfreetype.h"
|
||||
#include "llfontgl.h"
|
||||
|
||||
// Freetype stuff
|
||||
#include <ft2build.h>
|
||||
|
|
@ -204,6 +205,19 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
|
|||
mName = filename;
|
||||
mPointSize = point_size;
|
||||
|
||||
mStyle = LLFontGL::NORMAL;
|
||||
if(mFTFace->style_flags & FT_STYLE_FLAG_BOLD)
|
||||
{
|
||||
mStyle |= LLFontGL::BOLD;
|
||||
mStyle &= ~LLFontGL::NORMAL;
|
||||
}
|
||||
|
||||
if(mFTFace->style_flags & FT_STYLE_FLAG_ITALIC)
|
||||
{
|
||||
mStyle |= LLFontGL::ITALIC;
|
||||
mStyle &= ~LLFontGL::NORMAL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,12 +89,10 @@ static F32 llfont_round_y(F32 y)
|
|||
|
||||
LLFontGL::LLFontGL()
|
||||
{
|
||||
clearEmbeddedChars();
|
||||
}
|
||||
|
||||
LLFontGL::~LLFontGL()
|
||||
{
|
||||
clearEmbeddedChars();
|
||||
}
|
||||
|
||||
void LLFontGL::reset()
|
||||
|
|
@ -117,8 +115,10 @@ BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dp
|
|||
return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback);
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_RENDER_FONTS("Fonts");
|
||||
|
||||
S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style,
|
||||
ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_embedded, BOOL use_ellipses) const
|
||||
ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_ellipses) const
|
||||
{
|
||||
if(!sDisplayFont) //do not display texts
|
||||
{
|
||||
|
|
@ -159,7 +159,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
|||
F32 pixel_offset_y = llround((F32)sCurOrigin.mY) - (sCurOrigin.mY);
|
||||
gGL.translatef(-pixel_offset_x, -pixel_offset_y, 0.f);
|
||||
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_FONTS);
|
||||
LLFastTimer t(FTM_RENDER_FONTS);
|
||||
|
||||
gGL.color4fv( color.mV );
|
||||
|
||||
|
|
@ -251,135 +251,69 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
|||
{
|
||||
llwchar wch = wstr[i];
|
||||
|
||||
// Handle embedded characters first, if they're enabled.
|
||||
// Embedded characters are a hack for notecards
|
||||
const embedded_data_t* ext_data = use_embedded ? getEmbeddedCharData(wch) : NULL;
|
||||
if (ext_data)
|
||||
if (!mFontFreetype->hasGlyph(wch))
|
||||
{
|
||||
LLImageGL* ext_image = ext_data->mImage;
|
||||
const LLWString& label = ext_data->mLabel;
|
||||
|
||||
F32 ext_height = (F32)ext_image->getHeight() * sScaleY;
|
||||
|
||||
F32 ext_width = (F32)ext_image->getWidth() * sScaleX;
|
||||
F32 ext_advance = (EXT_X_BEARING * sScaleX) + ext_width;
|
||||
|
||||
if (!label.empty())
|
||||
{
|
||||
ext_advance += (EXT_X_BEARING + getFontExtChar()->getWidthF32( label.c_str() )) * sScaleX;
|
||||
}
|
||||
|
||||
if (start_x + scaled_max_pixels < cur_x + ext_advance)
|
||||
{
|
||||
// Not enough room for this character.
|
||||
break;
|
||||
}
|
||||
|
||||
if (last_bound_texture != ext_image)
|
||||
{
|
||||
gGL.getTexUnit(0)->bind(ext_image);
|
||||
last_bound_texture = ext_image;
|
||||
}
|
||||
|
||||
// snap origin to whole screen pixel
|
||||
const F32 ext_x = (F32)llround(cur_render_x + (EXT_X_BEARING * sScaleX));
|
||||
const F32 ext_y = (F32)llround(cur_render_y + (EXT_Y_BEARING * sScaleY + mFontFreetype->getAscenderHeight() - mFontFreetype->getLineHeight()));
|
||||
|
||||
LLRectf uv_rect(0.f, 1.f, 1.f, 0.f);
|
||||
LLRectf screen_rect(ext_x, ext_y + ext_height, ext_x + ext_width, ext_y);
|
||||
drawGlyph(screen_rect, uv_rect, LLColor4::white, style_to_add, shadow, drop_shadow_strength);
|
||||
|
||||
if (!label.empty())
|
||||
{
|
||||
gGL.pushMatrix();
|
||||
//glLoadIdentity();
|
||||
//gGL.translatef(sCurOrigin.mX, sCurOrigin.mY, 0.0f);
|
||||
//glScalef(sScaleX, sScaleY, 1.f);
|
||||
getFontExtChar()->render(label, 0,
|
||||
/*llfloor*/((ext_x + (F32)ext_image->getWidth() + EXT_X_BEARING) / sScaleX),
|
||||
/*llfloor*/(cur_y / sScaleY),
|
||||
color,
|
||||
halign, BASELINE, NORMAL, NO_SHADOW, S32_MAX, S32_MAX, NULL,
|
||||
TRUE );
|
||||
gGL.popMatrix();
|
||||
}
|
||||
|
||||
gGL.color4fv(color.mV);
|
||||
|
||||
chars_drawn++;
|
||||
cur_x += ext_advance;
|
||||
if (((i + 1) < length) && wstr[i+1])
|
||||
{
|
||||
cur_x += EXT_KERNING * sScaleX;
|
||||
}
|
||||
cur_render_x = cur_x;
|
||||
addChar(wch);
|
||||
}
|
||||
else
|
||||
|
||||
const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch);
|
||||
if (!fgi)
|
||||
{
|
||||
if (!mFontFreetype->hasGlyph(wch))
|
||||
{
|
||||
addChar(wch);
|
||||
}
|
||||
|
||||
const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch);
|
||||
if (!fgi)
|
||||
{
|
||||
llerrs << "Missing Glyph Info" << llendl;
|
||||
break;
|
||||
}
|
||||
// Per-glyph bitmap texture.
|
||||
LLImageGL *image_gl = mFontFreetype->getFontBitmapCache()->getImageGL(fgi->mBitmapNum);
|
||||
if (last_bound_texture != image_gl)
|
||||
{
|
||||
gGL.getTexUnit(0)->bind(image_gl);
|
||||
last_bound_texture = image_gl;
|
||||
}
|
||||
|
||||
if ((start_x + scaled_max_pixels) < (cur_x + fgi->mXBearing + fgi->mWidth))
|
||||
{
|
||||
// Not enough room for this character.
|
||||
break;
|
||||
}
|
||||
|
||||
// Draw the text at the appropriate location
|
||||
//Specify vertices and texture coordinates
|
||||
LLRectf uv_rect((fgi->mXBitmapOffset) * inv_width,
|
||||
(fgi->mYBitmapOffset + fgi->mHeight + PAD_UVY) * inv_height,
|
||||
(fgi->mXBitmapOffset + fgi->mWidth) * inv_width,
|
||||
(fgi->mYBitmapOffset - PAD_UVY) * inv_height);
|
||||
// snap glyph origin to whole screen pixel
|
||||
LLRectf screen_rect(llround(cur_render_x + (F32)fgi->mXBearing),
|
||||
llround(cur_render_y + (F32)fgi->mYBearing),
|
||||
llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
|
||||
llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
|
||||
|
||||
drawGlyph(screen_rect, uv_rect, color, style_to_add, shadow, drop_shadow_strength);
|
||||
|
||||
chars_drawn++;
|
||||
cur_x += fgi->mXAdvance;
|
||||
cur_y += fgi->mYAdvance;
|
||||
|
||||
llwchar next_char = wstr[i+1];
|
||||
if (next_char && (next_char < LAST_CHARACTER))
|
||||
{
|
||||
// Kern this puppy.
|
||||
if (!mFontFreetype->hasGlyph(next_char))
|
||||
{
|
||||
addChar(next_char);
|
||||
}
|
||||
cur_x += mFontFreetype->getXKerning(wch, next_char);
|
||||
}
|
||||
|
||||
// Round after kerning.
|
||||
// Must do this to cur_x, not just to cur_render_x, otherwise you
|
||||
// will squish sub-pixel kerned characters too close together.
|
||||
// For example, "CCCCC" looks bad.
|
||||
cur_x = (F32)llfloor(cur_x + 0.5f);
|
||||
//cur_y = (F32)llfloor(cur_y + 0.5f);
|
||||
|
||||
cur_render_x = cur_x;
|
||||
cur_render_y = cur_y;
|
||||
llerrs << "Missing Glyph Info" << llendl;
|
||||
break;
|
||||
}
|
||||
// Per-glyph bitmap texture.
|
||||
LLImageGL *image_gl = mFontFreetype->getFontBitmapCache()->getImageGL(fgi->mBitmapNum);
|
||||
if (last_bound_texture != image_gl)
|
||||
{
|
||||
gGL.getTexUnit(0)->bind(image_gl);
|
||||
last_bound_texture = image_gl;
|
||||
}
|
||||
|
||||
if ((start_x + scaled_max_pixels) < (cur_x + fgi->mXBearing + fgi->mWidth))
|
||||
{
|
||||
// Not enough room for this character.
|
||||
break;
|
||||
}
|
||||
|
||||
// Draw the text at the appropriate location
|
||||
//Specify vertices and texture coordinates
|
||||
LLRectf uv_rect((fgi->mXBitmapOffset) * inv_width,
|
||||
(fgi->mYBitmapOffset + fgi->mHeight + PAD_UVY) * inv_height,
|
||||
(fgi->mXBitmapOffset + fgi->mWidth) * inv_width,
|
||||
(fgi->mYBitmapOffset - PAD_UVY) * inv_height);
|
||||
// snap glyph origin to whole screen pixel
|
||||
LLRectf screen_rect(llround(cur_render_x + (F32)fgi->mXBearing),
|
||||
llround(cur_render_y + (F32)fgi->mYBearing),
|
||||
llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
|
||||
llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
|
||||
|
||||
drawGlyph(screen_rect, uv_rect, color, style_to_add, shadow, drop_shadow_strength);
|
||||
|
||||
chars_drawn++;
|
||||
cur_x += fgi->mXAdvance;
|
||||
cur_y += fgi->mYAdvance;
|
||||
|
||||
llwchar next_char = wstr[i+1];
|
||||
if (next_char && (next_char < LAST_CHARACTER))
|
||||
{
|
||||
// Kern this puppy.
|
||||
if (!mFontFreetype->hasGlyph(next_char))
|
||||
{
|
||||
addChar(next_char);
|
||||
}
|
||||
cur_x += mFontFreetype->getXKerning(wch, next_char);
|
||||
}
|
||||
|
||||
// Round after kerning.
|
||||
// Must do this to cur_x, not just to cur_render_x, otherwise you
|
||||
// will squish sub-pixel kerned characters too close together.
|
||||
// For example, "CCCCC" looks bad.
|
||||
cur_x = (F32)llfloor(cur_x + 0.5f);
|
||||
//cur_y = (F32)llfloor(cur_y + 0.5f);
|
||||
|
||||
cur_render_x = cur_x;
|
||||
cur_render_y = cur_y;
|
||||
}
|
||||
|
||||
if (right_x)
|
||||
|
|
@ -427,12 +361,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
|||
|
||||
S32 LLFontGL::render(const LLWString &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color) const
|
||||
{
|
||||
return render(text, begin_offset, x, y, color, LEFT, BASELINE, NORMAL, NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE, FALSE);
|
||||
return render(text, begin_offset, x, y, color, LEFT, BASELINE, NORMAL, NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE);
|
||||
}
|
||||
|
||||
S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_ellipses) const
|
||||
{
|
||||
return render(utf8str_to_wstring(text), begin_offset, x, y, color, halign, valign, style, shadow, max_chars, max_pixels, right_x, FALSE, use_ellipses);
|
||||
return render(utf8str_to_wstring(text), begin_offset, x, y, color, halign, valign, style, shadow, max_chars, max_pixels, right_x, use_ellipses);
|
||||
}
|
||||
|
||||
S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y, const LLColor4 &color) const
|
||||
|
|
@ -478,9 +412,9 @@ S32 LLFontGL::getWidth(const std::string& utf8text, S32 begin_offset, S32 max_ch
|
|||
return getWidth(wtext.c_str(), begin_offset, max_chars);
|
||||
}
|
||||
|
||||
S32 LLFontGL::getWidth(const llwchar* wchars, S32 begin_offset, S32 max_chars, BOOL use_embedded) const
|
||||
S32 LLFontGL::getWidth(const llwchar* wchars, S32 begin_offset, S32 max_chars) const
|
||||
{
|
||||
F32 width = getWidthF32(wchars, begin_offset, max_chars, use_embedded);
|
||||
F32 width = getWidthF32(wchars, begin_offset, max_chars);
|
||||
return llround(width);
|
||||
}
|
||||
|
||||
|
|
@ -501,7 +435,7 @@ F32 LLFontGL::getWidthF32(const std::string& utf8text, S32 begin_offset, S32 max
|
|||
return getWidthF32(wtext.c_str(), begin_offset, max_chars);
|
||||
}
|
||||
|
||||
F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars, BOOL use_embedded) const
|
||||
F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars) const
|
||||
{
|
||||
const S32 LAST_CHARACTER = LLFontFreetype::LAST_CHAR_FULL;
|
||||
|
||||
|
|
@ -509,34 +443,21 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars
|
|||
const S32 max_index = begin_offset + max_chars;
|
||||
for (S32 i = begin_offset; i < max_index; i++)
|
||||
{
|
||||
const llwchar wch = wchars[i];
|
||||
llwchar wch = wchars[i];
|
||||
if (wch == 0)
|
||||
{
|
||||
break; // done
|
||||
}
|
||||
const embedded_data_t* ext_data = use_embedded ? getEmbeddedCharData(wch) : NULL;
|
||||
if (ext_data)
|
||||
{
|
||||
// Handle crappy embedded hack
|
||||
cur_x += getEmbeddedCharAdvance(ext_data);
|
||||
|
||||
if( ((i+1) < max_chars) && (i+1 < max_index))
|
||||
{
|
||||
cur_x += EXT_KERNING * sScaleX;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cur_x += mFontFreetype->getXAdvance(wch);
|
||||
llwchar next_char = wchars[i+1];
|
||||
cur_x += mFontFreetype->getXAdvance(wch);
|
||||
llwchar next_char = wchars[i+1];
|
||||
|
||||
if (((i + 1) < max_chars)
|
||||
&& next_char
|
||||
&& (next_char < LAST_CHARACTER))
|
||||
{
|
||||
// Kern this puppy.
|
||||
cur_x += mFontFreetype->getXKerning(wch, next_char);
|
||||
}
|
||||
if (((i + 1) < begin_offset + max_chars)
|
||||
&& next_char
|
||||
&& (next_char < LAST_CHARACTER))
|
||||
{
|
||||
// Kern this puppy.
|
||||
cur_x += mFontFreetype->getXKerning(wch, next_char);
|
||||
}
|
||||
// Round after kerning.
|
||||
cur_x = (F32)llfloor(cur_x + 0.5f);
|
||||
|
|
@ -546,7 +467,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars
|
|||
}
|
||||
|
||||
// Returns the max number of complete characters from text (up to max_chars) that can be drawn in max_pixels
|
||||
S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_chars, BOOL end_on_word_boundary, BOOL use_embedded, F32* drawn_pixels) const
|
||||
S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_chars, BOOL end_on_word_boundary) const
|
||||
{
|
||||
if (!wchars || !wchars[0] || max_chars == 0)
|
||||
{
|
||||
|
|
@ -576,83 +497,51 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
|
|||
break;
|
||||
}
|
||||
|
||||
const embedded_data_t* ext_data = use_embedded ? getEmbeddedCharData(wch) : NULL;
|
||||
if (ext_data)
|
||||
if (in_word)
|
||||
{
|
||||
if (in_word)
|
||||
if (iswspace(wch))
|
||||
{
|
||||
in_word = FALSE;
|
||||
if(wch !=(0x00A0))
|
||||
{
|
||||
in_word = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (iswindividual(wch))
|
||||
{
|
||||
start_of_last_word = i;
|
||||
}
|
||||
cur_x += getEmbeddedCharAdvance(ext_data);
|
||||
|
||||
if (scaled_max_pixels < cur_x)
|
||||
{
|
||||
clip = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (((i+1) < max_chars) && wchars[i+1])
|
||||
{
|
||||
cur_x += EXT_KERNING * sScaleX;
|
||||
}
|
||||
|
||||
if( scaled_max_pixels < cur_x )
|
||||
{
|
||||
clip = TRUE;
|
||||
break;
|
||||
if (iswpunct(wchars[i+1]))
|
||||
{
|
||||
in_word=TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
in_word=FALSE;
|
||||
start_of_last_word = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (in_word)
|
||||
start_of_last_word = i;
|
||||
if (!iswspace(wch)||!iswindividual(wch))
|
||||
{
|
||||
if (iswspace(wch))
|
||||
{
|
||||
if(wch !=(0x00A0))
|
||||
{
|
||||
in_word = FALSE;
|
||||
}
|
||||
}
|
||||
if (iswindividual(wch))
|
||||
{
|
||||
if (iswpunct(wchars[i+1]))
|
||||
{
|
||||
in_word=TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
in_word=FALSE;
|
||||
start_of_last_word = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
start_of_last_word = i;
|
||||
if (!iswspace(wch)||!iswindividual(wch))
|
||||
{
|
||||
in_word = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
cur_x += mFontFreetype->getXAdvance(wch);
|
||||
|
||||
if (scaled_max_pixels < cur_x)
|
||||
{
|
||||
clip = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (((i+1) < max_chars) && wchars[i+1])
|
||||
{
|
||||
// Kern this puppy.
|
||||
cur_x += mFontFreetype->getXKerning(wch, wchars[i+1]);
|
||||
in_word = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
cur_x += mFontFreetype->getXAdvance(wch);
|
||||
|
||||
if (scaled_max_pixels < cur_x)
|
||||
{
|
||||
clip = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (((i+1) < max_chars) && wchars[i+1])
|
||||
{
|
||||
// Kern this puppy.
|
||||
cur_x += mFontFreetype->getXKerning(wch, wchars[i+1]);
|
||||
}
|
||||
|
||||
// Round after kerning.
|
||||
cur_x = (F32)llfloor(cur_x + 0.5f);
|
||||
drawn_x = cur_x;
|
||||
|
|
@ -662,10 +551,6 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
|
|||
{
|
||||
i = start_of_last_word;
|
||||
}
|
||||
if (drawn_pixels)
|
||||
{
|
||||
*drawn_pixels = drawn_x;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
|
|
@ -686,8 +571,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
|
|||
{
|
||||
llwchar wch = wchars[i];
|
||||
|
||||
const embedded_data_t* ext_data = getEmbeddedCharData(wch);
|
||||
F32 char_width = ext_data ? getEmbeddedCharAdvance(ext_data) : mFontFreetype->getXAdvance(wch);
|
||||
F32 char_width = mFontFreetype->getXAdvance(wch);
|
||||
|
||||
if( scaled_max_pixels < (total_width + char_width) )
|
||||
{
|
||||
|
|
@ -705,7 +589,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
|
|||
if ( i > 0 )
|
||||
{
|
||||
// kerning
|
||||
total_width += ext_data ? (EXT_KERNING * sScaleX) : mFontFreetype->getXKerning(wchars[i-1], wch);
|
||||
total_width += mFontFreetype->getXKerning(wchars[i-1], wch);
|
||||
}
|
||||
|
||||
// Round after kerning.
|
||||
|
|
@ -715,7 +599,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
|
|||
return start_pos - drawable_chars;
|
||||
}
|
||||
|
||||
S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 target_x, F32 max_pixels, S32 max_chars, BOOL round, BOOL use_embedded) const
|
||||
S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 target_x, F32 max_pixels, S32 max_chars, BOOL round) const
|
||||
{
|
||||
if (!wchars || !wchars[0] || max_chars == 0)
|
||||
{
|
||||
|
|
@ -723,7 +607,6 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t
|
|||
}
|
||||
|
||||
F32 cur_x = 0;
|
||||
S32 pos = 0;
|
||||
|
||||
target_x *= sScaleX;
|
||||
|
||||
|
|
@ -732,113 +615,50 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t
|
|||
|
||||
F32 scaled_max_pixels = max_pixels * sScaleX;
|
||||
|
||||
for (S32 i = begin_offset; (i < max_index); i++)
|
||||
S32 pos;
|
||||
for (pos = begin_offset; pos < max_index; pos++)
|
||||
{
|
||||
llwchar wch = wchars[i];
|
||||
llwchar wch = wchars[pos];
|
||||
if (!wch)
|
||||
{
|
||||
break; // done
|
||||
}
|
||||
const embedded_data_t* ext_data = use_embedded ? getEmbeddedCharData(wch) : NULL;
|
||||
if (ext_data)
|
||||
F32 char_width = mFontFreetype->getXAdvance(wch);
|
||||
|
||||
if (round)
|
||||
{
|
||||
F32 ext_advance = getEmbeddedCharAdvance(ext_data);
|
||||
|
||||
if (round)
|
||||
{
|
||||
// Note: if the mouse is on the left half of the character, the pick is to the character's left
|
||||
// If it's on the right half, the pick is to the right.
|
||||
if (target_x < cur_x + ext_advance/2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (target_x < cur_x + ext_advance)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (scaled_max_pixels < cur_x + ext_advance)
|
||||
// Note: if the mouse is on the left half of the character, the pick is to the character's left
|
||||
// If it's on the right half, the pick is to the right.
|
||||
if (target_x < cur_x + char_width*0.5f)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
pos++;
|
||||
cur_x += ext_advance;
|
||||
|
||||
if (((i + 1) < max_index)
|
||||
&& (wchars[(i + 1)]))
|
||||
{
|
||||
cur_x += EXT_KERNING * sScaleX;
|
||||
}
|
||||
// Round after kerning.
|
||||
cur_x = (F32)llfloor(cur_x + 0.5f);
|
||||
}
|
||||
else
|
||||
else if (target_x < cur_x + char_width)
|
||||
{
|
||||
F32 char_width = mFontFreetype->getXAdvance(wch);
|
||||
|
||||
if (round)
|
||||
{
|
||||
// Note: if the mouse is on the left half of the character, the pick is to the character's left
|
||||
// If it's on the right half, the pick is to the right.
|
||||
if (target_x < cur_x + char_width*0.5f)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (target_x < cur_x + char_width)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (scaled_max_pixels < cur_x + char_width)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
pos++;
|
||||
cur_x += char_width;
|
||||
|
||||
if (((i + 1) < max_index)
|
||||
&& (wchars[(i + 1)]))
|
||||
{
|
||||
llwchar next_char = wchars[i + 1];
|
||||
// Kern this puppy.
|
||||
cur_x += mFontFreetype->getXKerning(wch, next_char);
|
||||
}
|
||||
|
||||
// Round after kerning.
|
||||
cur_x = (F32)llfloor(cur_x + 0.5f);
|
||||
break;
|
||||
}
|
||||
|
||||
if (scaled_max_pixels < cur_x + char_width)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
cur_x += char_width;
|
||||
|
||||
if (((pos + 1) < max_index)
|
||||
&& (wchars[(pos + 1)]))
|
||||
{
|
||||
llwchar next_char = wchars[pos + 1];
|
||||
// Kern this puppy.
|
||||
cur_x += mFontFreetype->getXKerning(wch, next_char);
|
||||
}
|
||||
|
||||
// Round after kerning.
|
||||
cur_x = (F32)llfloor(cur_x + 0.5f);
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
void LLFontGL::addEmbeddedChar( llwchar wc, LLTexture* image, const std::string& label ) const
|
||||
{
|
||||
LLWString wlabel = utf8str_to_wstring(label);
|
||||
addEmbeddedChar(wc, image, wlabel);
|
||||
}
|
||||
|
||||
void LLFontGL::addEmbeddedChar( llwchar wc, LLTexture* image, const LLWString& wlabel ) const
|
||||
{
|
||||
embedded_data_t* ext_data = new embedded_data_t(image->getGLTexture(), wlabel);
|
||||
mEmbeddedChars[wc] = ext_data;
|
||||
}
|
||||
|
||||
void LLFontGL::removeEmbeddedChar(llwchar wc) const
|
||||
{
|
||||
embedded_map_t::iterator iter = mEmbeddedChars.find(wc);
|
||||
if (iter != mEmbeddedChars.end())
|
||||
{
|
||||
delete iter->second;
|
||||
mEmbeddedChars.erase(wc);
|
||||
}
|
||||
return llmin(max_chars, pos - begin_offset);
|
||||
}
|
||||
|
||||
BOOL LLFontGL::addChar(llwchar wch) const
|
||||
|
|
@ -1154,38 +974,6 @@ LLFontGL &LLFontGL::operator=(const LLFontGL &source)
|
|||
return *this;
|
||||
}
|
||||
|
||||
const LLFontGL::embedded_data_t* LLFontGL::getEmbeddedCharData(llwchar wch) const
|
||||
{
|
||||
// Handle crappy embedded hack
|
||||
embedded_map_t::const_iterator iter = mEmbeddedChars.find(wch);
|
||||
if (iter != mEmbeddedChars.end())
|
||||
{
|
||||
return iter->second;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
F32 LLFontGL::getEmbeddedCharAdvance(const embedded_data_t* ext_data) const
|
||||
{
|
||||
const LLWString& label = ext_data->mLabel;
|
||||
LLImageGL* ext_image = ext_data->mImage;
|
||||
|
||||
F32 ext_width = (F32)ext_image->getWidth();
|
||||
if( !label.empty() )
|
||||
{
|
||||
ext_width += (EXT_X_BEARING + getFontExtChar()->getWidthF32(label.c_str())) * sScaleX;
|
||||
}
|
||||
|
||||
return (EXT_X_BEARING * sScaleX) + ext_width;
|
||||
}
|
||||
|
||||
void LLFontGL::clearEmbeddedChars()
|
||||
{
|
||||
for_each(mEmbeddedChars.begin(), mEmbeddedChars.end(), DeletePairedPointer());
|
||||
mEmbeddedChars.clear();
|
||||
}
|
||||
|
||||
|
||||
void LLFontGL::renderQuad(const LLRectf& screen_rect, const LLRectf& uv_rect, F32 slant_amt) const
|
||||
{
|
||||
gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public:
|
|||
BOOL loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback);
|
||||
|
||||
S32 render(const LLWString &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign = LEFT, VAlign valign = BASELINE, U8 style = NORMAL,
|
||||
ShadowType shadow = NO_SHADOW, S32 max_chars = S32_MAX, S32 max_pixels = S32_MAX, F32* right_x=NULL, BOOL use_embedded = FALSE, BOOL use_ellipses = FALSE) const;
|
||||
ShadowType shadow = NO_SHADOW, S32 max_chars = S32_MAX, S32 max_pixels = S32_MAX, F32* right_x=NULL, BOOL use_ellipses = FALSE) const;
|
||||
S32 render(const LLWString &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color) const;
|
||||
|
||||
// renderUTF8 does a conversion, so is slower!
|
||||
|
|
@ -113,28 +113,24 @@ public:
|
|||
S32 getWidth(const std::string& utf8text) const;
|
||||
S32 getWidth(const llwchar* wchars) const;
|
||||
S32 getWidth(const std::string& utf8text, S32 offset, S32 max_chars ) const;
|
||||
S32 getWidth(const llwchar* wchars, S32 offset, S32 max_chars, BOOL use_embedded = FALSE) const;
|
||||
S32 getWidth(const llwchar* wchars, S32 offset, S32 max_chars) const;
|
||||
|
||||
F32 getWidthF32(const std::string& utf8text) const;
|
||||
F32 getWidthF32(const llwchar* wchars) const;
|
||||
F32 getWidthF32(const std::string& text, S32 offset, S32 max_chars ) const;
|
||||
F32 getWidthF32(const llwchar* wchars, S32 offset, S32 max_chars, BOOL use_embedded = FALSE ) const;
|
||||
F32 getWidthF32(const llwchar* wchars, S32 offset, S32 max_chars) const;
|
||||
|
||||
// The following are called often, frequently with large buffers, so do not use a string interface
|
||||
|
||||
// Returns the max number of complete characters from text (up to max_chars) that can be drawn in max_pixels
|
||||
S32 maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_chars = S32_MAX, BOOL end_on_word_boundary = FALSE, BOOL use_embedded = FALSE, F32* drawn_pixels = NULL) const;
|
||||
S32 maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_chars = S32_MAX, BOOL end_on_word_boundary = FALSE) const;
|
||||
|
||||
// Returns the index of the first complete characters from text that can be drawn in max_pixels
|
||||
// given that the character at start_pos should be the last character (or as close to last as possible).
|
||||
S32 firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_len, S32 start_pos=S32_MAX, S32 max_chars = S32_MAX) const;
|
||||
|
||||
// Returns the index of the character closest to pixel position x (ignoring text to the right of max_pixels and max_chars)
|
||||
S32 charFromPixelOffset(const llwchar* wchars, S32 char_offset, F32 x, F32 max_pixels=F32_MAX, S32 max_chars = S32_MAX, BOOL round = TRUE, BOOL use_embedded = FALSE) const;
|
||||
|
||||
void addEmbeddedChar( llwchar wc, LLTexture* image, const std::string& label) const;
|
||||
void addEmbeddedChar( llwchar wc, LLTexture* image, const LLWString& label) const;
|
||||
void removeEmbeddedChar( llwchar wc ) const;
|
||||
S32 charFromPixelOffset(const llwchar* wchars, S32 char_offset, F32 x, F32 max_pixels=F32_MAX, S32 max_chars = S32_MAX, BOOL round = TRUE) const;
|
||||
|
||||
BOOL addChar(const llwchar wch) const;
|
||||
|
||||
|
|
@ -199,19 +195,6 @@ private:
|
|||
LLFontDescriptor mFontDescriptor;
|
||||
LLPointer<LLFontFreetype> mFontFreetype;
|
||||
|
||||
struct embedded_data_t
|
||||
{
|
||||
embedded_data_t(LLImageGL* image, const LLWString& label) : mImage(image), mLabel(label) {}
|
||||
LLPointer<LLImageGL> mImage;
|
||||
LLWString mLabel;
|
||||
};
|
||||
|
||||
typedef std::map<llwchar,embedded_data_t*> embedded_map_t;
|
||||
mutable embedded_map_t mEmbeddedChars;
|
||||
|
||||
const embedded_data_t* getEmbeddedCharData(llwchar wch) const;
|
||||
F32 getEmbeddedCharAdvance(const embedded_data_t* ext_data) const;
|
||||
void clearEmbeddedChars();
|
||||
void renderQuad(const LLRectf& screen_rect, const LLRectf& uv_rect, F32 slant_amt) const;
|
||||
void drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, ShadowType shadow, F32 drop_shadow_fade) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -477,7 +477,6 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
|
|||
|
||||
if (result)
|
||||
{
|
||||
result->mFontFreetype->setStyle(match_desc->getStyle());
|
||||
result->mFontDescriptor = desc;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -516,7 +516,6 @@ void LLImageGL::setImage(const LLImageRaw* imageraw)
|
|||
|
||||
void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
|
||||
{
|
||||
// LLFastTimer t1(LLFastTimer::FTM_TEMP1);
|
||||
llpushcallstacks ;
|
||||
bool is_compressed = false;
|
||||
if (mFormatPrimary >= GL_COMPRESSED_RGBA_S3TC_DXT1_EXT && mFormatPrimary <= GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)
|
||||
|
|
@ -524,12 +523,10 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
|
|||
is_compressed = true;
|
||||
}
|
||||
|
||||
// LLFastTimer t2(LLFastTimer::FTM_TEMP2);
|
||||
gGL.getTexUnit(0)->bind(this);
|
||||
|
||||
if (mUseMipMaps)
|
||||
{
|
||||
// LLFastTimer t2(LLFastTimer::FTM_TEMP3);
|
||||
if (data_hasmips)
|
||||
{
|
||||
// NOTE: data_in points to largest image; smaller images
|
||||
|
|
@ -546,14 +543,13 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
|
|||
}
|
||||
if (is_compressed)
|
||||
{
|
||||
// LLFastTimer t2(LLFastTimer::FTM_TEMP4);
|
||||
S32 tex_size = dataFormatBytes(mFormatPrimary, w, h);
|
||||
glCompressedTexImage2DARB(mTarget, gl_level, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in);
|
||||
stop_glerror();
|
||||
}
|
||||
else
|
||||
{
|
||||
// LLFastTimer t2(LLFastTimer::FTM_TEMP4);
|
||||
// LLFastTimer t2(FTM_TEMP4);
|
||||
|
||||
if(mFormatSwapBytes)
|
||||
{
|
||||
|
|
@ -586,7 +582,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
|
|||
glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_GENERATE_MIPMAP_SGIS, TRUE);
|
||||
stop_glerror();
|
||||
{
|
||||
// LLFastTimer t2(LLFastTimer::FTM_TEMP4);
|
||||
// LLFastTimer t2(FTM_TEMP4);
|
||||
|
||||
if(mFormatSwapBytes)
|
||||
{
|
||||
|
|
@ -646,7 +642,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
|
|||
}
|
||||
llassert(w > 0 && h > 0 && cur_mip_data);
|
||||
{
|
||||
// LLFastTimer t1(LLFastTimer::FTM_TEMP4);
|
||||
// LLFastTimer t1(FTM_TEMP4);
|
||||
if(mFormatSwapBytes)
|
||||
{
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
|
||||
|
|
@ -988,7 +984,6 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
|
|||
LLImageGL::generateTextures(1, &mTexName);
|
||||
stop_glerror();
|
||||
{
|
||||
// LLFastTimer t1(LLFastTimer::FTM_TEMP6);
|
||||
llverify(gGL.getTexUnit(0)->bind(this));
|
||||
glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_TEXTURE_BASE_LEVEL, 0);
|
||||
glTexParameteri(LLTexUnit::getInternalType(mBindTarget), GL_TEXTURE_MAX_LEVEL, mMaxDiscardLevel-discard_level);
|
||||
|
|
|
|||
|
|
@ -419,8 +419,16 @@ BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
|||
{
|
||||
setFocus(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
// if (pointInView(x, y))
|
||||
// {
|
||||
// }
|
||||
}
|
||||
// send the mouse down signal
|
||||
LLUICtrl::handleRightMouseDown(x,y,mask);
|
||||
// *TODO: Return result of LLUICtrl call above? Should defer to base class
|
||||
// but this might change the mouse handling of existing buttons in a bad way
|
||||
// if they are not mouse opaque.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -432,15 +440,20 @@ BOOL LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask)
|
|||
// Always release the mouse
|
||||
gFocusMgr.setMouseCapture( NULL );
|
||||
|
||||
if (pointInView(x, y))
|
||||
{
|
||||
mRightClickSignal(this, x,y,mask);
|
||||
}
|
||||
// if (pointInView(x, y))
|
||||
// {
|
||||
// mRightMouseUpSignal(this, x,y,mask);
|
||||
// }
|
||||
}
|
||||
else
|
||||
{
|
||||
childrenHandleRightMouseUp(x, y, mask);
|
||||
}
|
||||
// send the mouse up signal
|
||||
LLUICtrl::handleRightMouseUp(x,y,mask);
|
||||
// *TODO: Return result of LLUICtrl call above? Should defer to base class
|
||||
// but this might change the mouse handling of existing buttons in a bad way.
|
||||
// if they are not mouse opaque.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -788,7 +801,7 @@ void LLButton::draw()
|
|||
LLFontGL::NORMAL,
|
||||
mDropShadowedText ? LLFontGL::DROP_SHADOW_SOFT : LLFontGL::NO_SHADOW,
|
||||
S32_MAX, text_width,
|
||||
NULL, FALSE, mUseEllipses);
|
||||
NULL, mUseEllipses);
|
||||
}
|
||||
|
||||
LLUICtrl::draw();
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ void LLComboBox::clear()
|
|||
mButton->setLabelSelected(LLStringUtil::null);
|
||||
mButton->setLabelUnselected(LLStringUtil::null);
|
||||
mList->deselectAllItems();
|
||||
mLastSelectedIndex = -1;
|
||||
}
|
||||
|
||||
void LLComboBox::onCommit()
|
||||
|
|
@ -296,6 +297,7 @@ BOOL LLComboBox::setSimple(const LLStringExplicit& name)
|
|||
if (found)
|
||||
{
|
||||
setLabel(name);
|
||||
mLastSelectedIndex = mList->getFirstSelectedIndex();
|
||||
}
|
||||
|
||||
return found;
|
||||
|
|
@ -312,6 +314,7 @@ void LLComboBox::setValue(const LLSD& value)
|
|||
{
|
||||
setLabel( mList->getSelectedItemLabel() );
|
||||
}
|
||||
mLastSelectedIndex = mList->getFirstSelectedIndex();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -359,6 +362,7 @@ void LLComboBox::setLabel(const LLStringExplicit& name)
|
|||
if (mList->selectItemByLabel(name, FALSE))
|
||||
{
|
||||
mTextEntry->setTentative(FALSE);
|
||||
mLastSelectedIndex = mList->getFirstSelectedIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -384,6 +388,7 @@ BOOL LLComboBox::remove(const std::string& name)
|
|||
{
|
||||
mList->deleteSingleItem(mList->getItemIndex(item));
|
||||
}
|
||||
mLastSelectedIndex = mList->getFirstSelectedIndex();
|
||||
}
|
||||
|
||||
return found;
|
||||
|
|
@ -436,6 +441,7 @@ BOOL LLComboBox::setCurrentByIndex( S32 index )
|
|||
if (found)
|
||||
{
|
||||
setLabel(mList->getSelectedItemLabel());
|
||||
mLastSelectedIndex = index;
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
|
@ -607,9 +613,6 @@ void LLComboBox::showList()
|
|||
mList->setVisible(TRUE);
|
||||
|
||||
setUseBoundingRect(TRUE);
|
||||
|
||||
mList->sortItems();
|
||||
mLastSelectedIndex = mList->getFirstSelectedIndex();
|
||||
}
|
||||
|
||||
void LLComboBox::hideList()
|
||||
|
|
@ -819,11 +822,13 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor)
|
|||
if (mList->selectItemByLabel(line_editor->getText(), FALSE))
|
||||
{
|
||||
line_editor->setTentative(FALSE);
|
||||
mLastSelectedIndex = mList->getFirstSelectedIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
line_editor->setTentative(mTextEntryTentative);
|
||||
mList->deselectAllItems();
|
||||
mLastSelectedIndex = -1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -890,6 +895,7 @@ void LLComboBox::updateSelection()
|
|||
if (mList->selectItemByLabel(full_string, FALSE))
|
||||
{
|
||||
mTextEntry->setTentative(FALSE);
|
||||
mLastSelectedIndex = mList->getFirstSelectedIndex();
|
||||
}
|
||||
else if (mList->selectItemByPrefix(left_wstring, FALSE))
|
||||
{
|
||||
|
|
@ -900,6 +906,7 @@ void LLComboBox::updateSelection()
|
|||
mTextEntry->endSelection();
|
||||
mTextEntry->setTentative(FALSE);
|
||||
mHasAutocompletedText = TRUE;
|
||||
mLastSelectedIndex = mList->getFirstSelectedIndex();
|
||||
}
|
||||
else // no matching items found
|
||||
{
|
||||
|
|
@ -907,6 +914,7 @@ void LLComboBox::updateSelection()
|
|||
mTextEntry->setText(wstring_to_utf8str(user_wstring)); // removes text added by autocompletion
|
||||
mTextEntry->setTentative(mTextEntryTentative);
|
||||
mHasAutocompletedText = FALSE;
|
||||
mLastSelectedIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -994,6 +1002,7 @@ BOOL LLComboBox::setCurrentByID(const LLUUID& id)
|
|||
if (found)
|
||||
{
|
||||
setLabel(mList->getSelectedItemLabel());
|
||||
mLastSelectedIndex = mList->getFirstSelectedIndex();
|
||||
}
|
||||
|
||||
return found;
|
||||
|
|
|
|||
|
|
@ -132,35 +132,31 @@ void LLContainerView::draw()
|
|||
|
||||
void LLContainerView::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
{
|
||||
S32 desired_width = width;
|
||||
S32 desired_height = height;
|
||||
LLRect scroller_rect;
|
||||
scroller_rect.setOriginAndSize(0, 0, width, height);
|
||||
|
||||
if (mScrollContainer)
|
||||
{
|
||||
BOOL dum_bool;
|
||||
mScrollContainer->calcVisibleSize(&desired_width, &desired_height, &dum_bool, &dum_bool);
|
||||
scroller_rect = mScrollContainer->getContentWindowRect();
|
||||
}
|
||||
else
|
||||
{
|
||||
// if we're uncontained - make height as small as possible
|
||||
desired_height = 0;
|
||||
scroller_rect.mTop = 0;
|
||||
}
|
||||
|
||||
arrange(desired_width, desired_height, called_from_parent);
|
||||
arrange(scroller_rect.getWidth(), scroller_rect.getHeight(), called_from_parent);
|
||||
|
||||
// sometimes, after layout, our container will change size (scrollbars popping in and out)
|
||||
// if so, attempt another layout
|
||||
if (mScrollContainer)
|
||||
{
|
||||
S32 new_container_width;
|
||||
S32 new_container_height;
|
||||
BOOL dum_bool;
|
||||
mScrollContainer->calcVisibleSize(&new_container_width, &new_container_height, &dum_bool, &dum_bool);
|
||||
LLRect new_container_rect = mScrollContainer->getContentWindowRect();
|
||||
|
||||
if ((new_container_width != desired_width) ||
|
||||
(new_container_height != desired_height)) // the container size has changed, attempt to arrange again
|
||||
if ((new_container_rect.getWidth() != scroller_rect.getWidth()) ||
|
||||
(new_container_rect.getHeight() != scroller_rect.getHeight())) // the container size has changed, attempt to arrange again
|
||||
{
|
||||
arrange(new_container_width, new_container_height, called_from_parent);
|
||||
arrange(new_container_rect.getWidth(), new_container_rect.getHeight(), called_from_parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -711,10 +711,7 @@ void LLFloater::releaseFocus()
|
|||
gFocusMgr.setTopCtrl(NULL);
|
||||
}
|
||||
|
||||
if( gFocusMgr.childHasKeyboardFocus( this ) )
|
||||
{
|
||||
gFocusMgr.setKeyboardFocus(NULL);
|
||||
}
|
||||
setFocus(FALSE);
|
||||
|
||||
if( gFocusMgr.childHasMouseCapture( this ) )
|
||||
{
|
||||
|
|
@ -1074,7 +1071,7 @@ void LLFloater::setFocus( BOOL b )
|
|||
}
|
||||
LLUICtrl* last_focus = gFocusMgr.getLastFocusForGroup(this);
|
||||
// a descendent already has focus
|
||||
BOOL child_had_focus = gFocusMgr.childHasKeyboardFocus(this);
|
||||
BOOL child_had_focus = hasFocus();
|
||||
|
||||
// give focus to first valid descendent
|
||||
LLPanel::setFocus(b);
|
||||
|
|
@ -1948,7 +1945,7 @@ LLRect LLFloaterView::findNeighboringPosition( LLFloater* reference_floater, LLF
|
|||
if (sibling &&
|
||||
sibling != neighbor &&
|
||||
sibling->getVisible() &&
|
||||
expanded_base_rect.rectInRect(&sibling->getRect()))
|
||||
expanded_base_rect.overlaps(sibling->getRect()))
|
||||
{
|
||||
base_rect.unionWith(sibling->getRect());
|
||||
}
|
||||
|
|
@ -2593,6 +2590,8 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
|
|||
initCommitCallback(p.close_callback, mCloseSignal);
|
||||
}
|
||||
|
||||
LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build");
|
||||
|
||||
void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node)
|
||||
{
|
||||
Params params(LLUICtrlFactory::getDefaultParams<LLFloater>());
|
||||
|
|
@ -2626,7 +2625,12 @@ void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o
|
|||
LLFloater::setFloaterHost(last_host);
|
||||
}
|
||||
|
||||
BOOL result = postBuild();
|
||||
BOOL result;
|
||||
{
|
||||
LLFastTimer ft(POST_BUILD);
|
||||
|
||||
result = postBuild();
|
||||
}
|
||||
|
||||
if (!result)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -231,11 +231,13 @@ LLColor3 LLKeywords::readColor( const std::string& s )
|
|||
return LLColor3( r, g, b );
|
||||
}
|
||||
|
||||
LLFastTimer::DeclareTimer FTM_SYNTAX_COLORING("Syntax Coloring");
|
||||
|
||||
// Walk through a string, applying the rules specified by the keyword token list and
|
||||
// create a list of color segments.
|
||||
void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWString& wtext, const LLColor4 &defaultColor)
|
||||
void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLWString& wtext, const LLColor4 &defaultColor, LLTextEditor& editor)
|
||||
{
|
||||
std::for_each(seg_list->begin(), seg_list->end(), DeletePointer());
|
||||
LLFastTimer ft(FTM_SYNTAX_COLORING);
|
||||
seg_list->clear();
|
||||
|
||||
if( wtext.empty() )
|
||||
|
|
@ -245,7 +247,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
|
|||
|
||||
S32 text_len = wtext.size();
|
||||
|
||||
seg_list->push_back( new LLTextSegment( LLColor3(defaultColor), 0, text_len ) );
|
||||
seg_list->push_back( new LLNormalTextSegment( defaultColor, 0, text_len, editor ) );
|
||||
|
||||
const llwchar* base = wtext.c_str();
|
||||
const llwchar* cur = base;
|
||||
|
|
@ -296,9 +298,9 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
|
|||
}
|
||||
S32 seg_end = cur - base;
|
||||
|
||||
LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end );
|
||||
LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_token->getColor(), seg_start, seg_end, editor );
|
||||
text_segment->setToken( cur_token );
|
||||
insertSegment( seg_list, text_segment, text_len, defaultColor);
|
||||
insertSegment( seg_list, text_segment, text_len, defaultColor, editor);
|
||||
line_done = TRUE; // to break out of second loop.
|
||||
break;
|
||||
}
|
||||
|
|
@ -405,9 +407,9 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
|
|||
}
|
||||
|
||||
|
||||
LLTextSegment* text_segment = new LLTextSegment( cur_delimiter->getColor(), seg_start, seg_end );
|
||||
LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_delimiter->getColor(), seg_start, seg_end, editor );
|
||||
text_segment->setToken( cur_delimiter );
|
||||
insertSegment( seg_list, text_segment, text_len, defaultColor);
|
||||
insertSegment( seg_list, text_segment, text_len, defaultColor, editor);
|
||||
|
||||
// Note: we don't increment cur, since the end of one delimited seg may be immediately
|
||||
// followed by the start of another one.
|
||||
|
|
@ -438,9 +440,9 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
|
|||
// llinfos << "Seg: [" << word.c_str() << "]" << llendl;
|
||||
|
||||
|
||||
LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end );
|
||||
LLTextSegmentPtr text_segment = new LLNormalTextSegment( cur_token->getColor(), seg_start, seg_end, editor );
|
||||
text_segment->setToken( cur_token );
|
||||
insertSegment( seg_list, text_segment, text_len, defaultColor);
|
||||
insertSegment( seg_list, text_segment, text_len, defaultColor, editor);
|
||||
}
|
||||
cur += seg_len;
|
||||
continue;
|
||||
|
|
@ -455,25 +457,24 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
|
|||
}
|
||||
}
|
||||
|
||||
void LLKeywords::insertSegment(std::vector<LLTextSegment*>* seg_list, LLTextSegment* new_segment, S32 text_len, const LLColor4 &defaultColor )
|
||||
void LLKeywords::insertSegment(std::vector<LLTextSegmentPtr>* seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, LLTextEditor& editor )
|
||||
{
|
||||
LLTextSegment* last = seg_list->back();
|
||||
LLTextSegmentPtr last = seg_list->back();
|
||||
S32 new_seg_end = new_segment->getEnd();
|
||||
|
||||
if( new_segment->getStart() == last->getStart() )
|
||||
{
|
||||
*last = *new_segment;
|
||||
delete new_segment;
|
||||
seg_list->pop_back();
|
||||
}
|
||||
else
|
||||
{
|
||||
last->setEnd( new_segment->getStart() );
|
||||
seg_list->push_back( new_segment );
|
||||
}
|
||||
seg_list->push_back( new_segment );
|
||||
|
||||
if( new_seg_end < text_len )
|
||||
{
|
||||
seg_list->push_back( new LLTextSegment( defaultColor, new_seg_end, text_len ) );
|
||||
seg_list->push_back( new LLNormalTextSegment( defaultColor, new_seg_end, text_len, editor ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,9 +39,10 @@
|
|||
#include <map>
|
||||
#include <list>
|
||||
#include <deque>
|
||||
#include "llpointer.h"
|
||||
|
||||
class LLTextSegment;
|
||||
|
||||
typedef LLPointer<LLTextSegment> LLTextSegmentPtr;
|
||||
|
||||
class LLKeywordToken
|
||||
{
|
||||
|
|
@ -84,7 +85,7 @@ public:
|
|||
BOOL loadFromFile(const std::string& filename);
|
||||
BOOL isLoaded() const { return mLoaded; }
|
||||
|
||||
void findSegments(std::vector<LLTextSegment *> *seg_list, const LLWString& text, const LLColor4 &defaultColor );
|
||||
void findSegments(std::vector<LLTextSegmentPtr> *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor );
|
||||
|
||||
// Add the token as described
|
||||
void addToken(LLKeywordToken::TOKEN_TYPE type,
|
||||
|
|
@ -103,7 +104,7 @@ public:
|
|||
|
||||
private:
|
||||
LLColor3 readColor(const std::string& s);
|
||||
void insertSegment(std::vector<LLTextSegment *> *seg_list, LLTextSegment* new_segment, S32 text_len, const LLColor4 &defaultColor);
|
||||
void insertSegment(std::vector<LLTextSegmentPtr> *seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor);
|
||||
|
||||
BOOL mLoaded;
|
||||
word_token_map_t mWordTokenMap;
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ void LLLayoutStack::draw()
|
|||
|
||||
LLLocalClipRect clip(clip_rect, mClip);
|
||||
// only force drawing invisible children if visible amount is non-zero
|
||||
drawChild(panelp, 0, 0, !clip_rect.isNull());
|
||||
drawChild(panelp, 0, 0, !clip_rect.isEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -494,19 +494,19 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
|
|||
BOOL doSelectAll = TRUE;
|
||||
|
||||
// Select the word we're on
|
||||
if( LLTextEditor::isPartOfWord( wtext[mCursorPos] ) )
|
||||
if( LLWStringUtil::isPartOfWord( wtext[mCursorPos] ) )
|
||||
{
|
||||
S32 old_selection_start = mLastSelectionStart;
|
||||
S32 old_selection_end = mLastSelectionEnd;
|
||||
|
||||
// Select word the cursor is over
|
||||
while ((mCursorPos > 0) && LLTextEditor::isPartOfWord( wtext[mCursorPos-1] ))
|
||||
while ((mCursorPos > 0) && LLWStringUtil::isPartOfWord( wtext[mCursorPos-1] ))
|
||||
{ // Find the start of the word
|
||||
mCursorPos--;
|
||||
}
|
||||
startSelection();
|
||||
|
||||
while ((mCursorPos < (S32)wtext.length()) && LLTextEditor::isPartOfWord( wtext[mCursorPos] ) )
|
||||
while ((mCursorPos < (S32)wtext.length()) && LLWStringUtil::isPartOfWord( wtext[mCursorPos] ) )
|
||||
{ // Find the end of the word
|
||||
mCursorPos++;
|
||||
}
|
||||
|
|
@ -840,7 +840,7 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const
|
|||
{
|
||||
cursorPos--;
|
||||
}
|
||||
while( (cursorPos > 0) && LLTextEditor::isPartOfWord( wtext[cursorPos-1] ) )
|
||||
while( (cursorPos > 0) && LLWStringUtil::isPartOfWord( wtext[cursorPos-1] ) )
|
||||
{
|
||||
cursorPos--;
|
||||
}
|
||||
|
|
@ -850,7 +850,7 @@ S32 LLLineEditor::prevWordPos(S32 cursorPos) const
|
|||
S32 LLLineEditor::nextWordPos(S32 cursorPos) const
|
||||
{
|
||||
const LLWString& wtext = mText.getWString();
|
||||
while( (cursorPos < getLength()) && LLTextEditor::isPartOfWord( wtext[cursorPos] ) )
|
||||
while( (cursorPos < getLength()) && LLWStringUtil::isPartOfWord( wtext[cursorPos] ) )
|
||||
{
|
||||
cursorPos++;
|
||||
}
|
||||
|
|
@ -1732,11 +1732,11 @@ void LLLineEditor::draw()
|
|||
#endif
|
||||
|
||||
// If we're editing...
|
||||
if( gFocusMgr.getKeyboardFocus() == this)
|
||||
if( hasFocus())
|
||||
{
|
||||
//mBorder->setVisible(TRUE); // ok, programmer art just this once.
|
||||
// (Flash the cursor every half second)
|
||||
if (gShowTextEditCursor && !mReadOnly)
|
||||
if (!mReadOnly && gFocusMgr.getAppHasFocus())
|
||||
{
|
||||
F32 elapsed = mKeystrokeTimer.getElapsedTimeF32();
|
||||
if( (elapsed < CURSOR_FLASH_DELAY ) || (S32(elapsed * 2) & 1) )
|
||||
|
|
|
|||
|
|
@ -184,6 +184,13 @@ LLMenuItemGL::LLMenuItemGL(const LLMenuItemGL::Params& p)
|
|||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLMenuItemGL::setValue(const LLSD& value)
|
||||
{
|
||||
setLabel(value.asString());
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLMenuItemGL::handleAcceleratorKey(KEY key, MASK mask)
|
||||
{
|
||||
if( getEnabled() && (!gKeyboard->getKeyRepeated(key) || mAllowKeyRepeat) && (key == mAcceleratorKey) && (mask == (mAcceleratorMask & MASK_NORMALKEYS)) )
|
||||
|
|
@ -201,6 +208,26 @@ BOOL LLMenuItemGL::handleHover(S32 x, S32 y, MASK mask)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLMenuItemGL::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
return LLUICtrl::handleRightMouseDown(x,y,mask);
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLMenuItemGL::handleRightMouseUp(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
// If this event came from a right-click context menu spawn,
|
||||
// process as a left-click to allow menu items to be hit
|
||||
if (LLMenuHolderGL::sContextMenuSpawnPos.mX != S32_MAX
|
||||
|| LLMenuHolderGL::sContextMenuSpawnPos.mY != S32_MAX)
|
||||
{
|
||||
BOOL handled = handleMouseUp(x, y, mask);
|
||||
return handled;
|
||||
}
|
||||
return LLUICtrl::handleRightMouseUp(x,y,mask);
|
||||
}
|
||||
|
||||
// This function checks to see if the accelerator key is already in use;
|
||||
// if not, it will be added to the list
|
||||
BOOL LLMenuItemGL::addToAcceleratorList(std::list <LLKeyBinding*> *listp)
|
||||
|
|
@ -306,6 +333,17 @@ U32 LLMenuItemGL::getNominalHeight( void ) const
|
|||
return llround(mFont->getLineHeight()) + MENU_ITEM_PADDING;
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLMenuItemGL::setBriefItem(BOOL brief)
|
||||
{
|
||||
mBriefItem = brief;
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLMenuItemGL::isBriefItem() const
|
||||
{
|
||||
return mBriefItem;
|
||||
}
|
||||
|
||||
// Get the parent menu for this item
|
||||
LLMenuGL* LLMenuItemGL::getMenu() const
|
||||
|
|
@ -800,15 +838,8 @@ BOOL LLMenuItemCallGL::handleAcceleratorKey( KEY key, MASK mask )
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL LLMenuItemCallGL::handleRightMouseUp(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (pointInView(x, y))
|
||||
{
|
||||
mRightClickSignal(this,x,y, mask);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
// handleRightMouseUp moved into base class LLMenuItemGL so clicks are
|
||||
// handled for all menu item types
|
||||
|
||||
///============================================================================
|
||||
/// Class LLMenuItemCheckGL
|
||||
|
|
@ -898,24 +929,38 @@ LLMenuItemBranchGL::~LLMenuItemBranchGL()
|
|||
}
|
||||
|
||||
// virtual
|
||||
LLView* LLMenuItemBranchGL::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const
|
||||
LLView* LLMenuItemBranchGL::getChildView(const std::string& name, BOOL recurse) const
|
||||
{
|
||||
LLMenuGL* branch = getBranch();
|
||||
if (!branch)
|
||||
return LLView::getChildView(name, recurse, create_if_missing);
|
||||
if (branch)
|
||||
{
|
||||
if (branch->getName() == name)
|
||||
{
|
||||
return branch;
|
||||
}
|
||||
|
||||
// richard: this is redundant with parent, remove
|
||||
if (branch->getName() == name)
|
||||
{
|
||||
return branch;
|
||||
// Always recurse on branches
|
||||
return branch->getChildView(name, recurse);
|
||||
}
|
||||
// Always recurse on branches
|
||||
LLView* child = branch->getChildView(name, recurse, FALSE);
|
||||
if (!child)
|
||||
|
||||
return LLView::getChildView(name, recurse);
|
||||
}
|
||||
|
||||
LLView* LLMenuItemBranchGL::findChildView(const std::string& name, BOOL recurse) const
|
||||
{
|
||||
LLMenuGL* branch = getBranch();
|
||||
if (branch)
|
||||
{
|
||||
child = LLView::getChildView(name, recurse, create_if_missing);
|
||||
if (branch->getName() == name)
|
||||
{
|
||||
return branch;
|
||||
}
|
||||
|
||||
// Always recurse on branches
|
||||
return branch->findChildView(name, recurse);
|
||||
}
|
||||
return child;
|
||||
|
||||
return LLView::findChildView(name, recurse);
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
@ -1123,6 +1168,18 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask )
|
|||
return LLMenuItemGL::handleKeyHere(key, mask);
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLMenuItemBranchGL::isActive() const
|
||||
{
|
||||
return isOpen() && getBranch() && getBranch()->getHighlightedItem();
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLMenuItemBranchGL::isOpen() const
|
||||
{
|
||||
return getBranch() && getBranch()->isOpen();
|
||||
}
|
||||
|
||||
void LLMenuItemBranchGL::openMenu()
|
||||
{
|
||||
LLMenuGL* branch = getBranch();
|
||||
|
|
@ -1298,6 +1355,9 @@ void LLMenuItemBranchDownGL::setHighlight( BOOL highlight )
|
|||
{
|
||||
if (highlight == getHighlight()) return;
|
||||
|
||||
LLMenuGL* branch = getBranch();
|
||||
if (!branch) return;
|
||||
|
||||
//NOTE: Purposely calling all the way to the base to bypass auto-open.
|
||||
LLMenuItemGL::setHighlight(highlight);
|
||||
if( !highlight)
|
||||
|
|
@ -2803,9 +2863,9 @@ void LLMenuGL::setVisible(BOOL visible)
|
|||
}
|
||||
}
|
||||
|
||||
LLMenuGL* LLMenuGL::getChildMenuByName(const std::string& name, BOOL recurse) const
|
||||
LLMenuGL* LLMenuGL::findChildMenuByName(const std::string& name, BOOL recurse) const
|
||||
{
|
||||
LLView* view = getChildView(name, recurse, FALSE);
|
||||
LLView* view = findChildView(name, recurse);
|
||||
if (view)
|
||||
{
|
||||
LLMenuItemBranchGL* branch = dynamic_cast<LLMenuItemBranchGL*>(view);
|
||||
|
|
@ -2844,9 +2904,19 @@ void hide_top_view( LLView* view )
|
|||
}
|
||||
|
||||
|
||||
// x and y are the desired location for the popup, NOT necessarily the
|
||||
// mouse location
|
||||
// static
|
||||
void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
|
||||
{
|
||||
// Save click point for detecting cursor moves before mouse-up.
|
||||
// Must be in local coords to compare with mouseUp events.
|
||||
// If the mouse doesn't move, the menu will stay open ala the Mac.
|
||||
// See also LLContextMenu::show()
|
||||
S32 mouse_x, mouse_y;
|
||||
LLUI::getCursorPositionLocal(menu->getParent(), &mouse_x, &mouse_y);
|
||||
LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y);
|
||||
|
||||
const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect();
|
||||
|
||||
const S32 HPAD = 2;
|
||||
|
|
@ -2857,9 +2927,6 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
|
|||
spawning_view->localPointToOtherView(left, top, &left, &top, menu->getParent());
|
||||
rect.setLeftTopAndSize( left, top,
|
||||
rect.getWidth(), rect.getHeight() );
|
||||
|
||||
|
||||
//rect.setLeftTopAndSize(x + HPAD, y, rect.getWidth(), rect.getHeight());
|
||||
menu->setRect( rect );
|
||||
|
||||
// Resetting scrolling position
|
||||
|
|
@ -2871,18 +2938,16 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
|
|||
menu->arrangeAndClear(); // Fix menu rect if needed.
|
||||
rect = menu->getRect();
|
||||
|
||||
// Adjust context menu to fit onscreen
|
||||
S32 bottom;
|
||||
left = rect.mLeft;
|
||||
bottom = rect.mBottom;
|
||||
//menu->getParent()->localPointToScreen( rect.mLeft, rect.mBottom,
|
||||
// &left, &bottom );
|
||||
S32 delta_x = 0;
|
||||
S32 delta_y = 0;
|
||||
if( bottom < menu_region_rect.mBottom )
|
||||
{
|
||||
// At this point, we need to move the context menu to the
|
||||
// other side of the mouse.
|
||||
//delta_y = menu_region_rect.mBottom - bottom;
|
||||
delta_y = (rect.getHeight() + 2 * HPAD);
|
||||
}
|
||||
|
||||
|
|
@ -2890,7 +2955,6 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
|
|||
{
|
||||
// At this point, we need to move the context menu to the
|
||||
// other side of the mouse.
|
||||
//delta_x = (window_width - rect.getWidth()) - x;
|
||||
delta_x = -(rect.getWidth() + 2 * HPAD);
|
||||
}
|
||||
menu->translate( delta_x, delta_y );
|
||||
|
|
@ -3633,6 +3697,7 @@ void LLContextMenu::show(S32 x, S32 y)
|
|||
// Save click point for detecting cursor moves before mouse-up.
|
||||
// Must be in local coords to compare with mouseUp events.
|
||||
// If the mouse doesn't move, the menu will stay open ala the Mac.
|
||||
// See also LLMenuGL::showPopup()
|
||||
LLMenuHolderGL::sContextMenuSpawnPos.set(x,y);
|
||||
|
||||
arrangeAndClear();
|
||||
|
|
|
|||
|
|
@ -105,10 +105,15 @@ protected:
|
|||
LLMenuItemGL(const Params&);
|
||||
friend class LLUICtrlFactory;
|
||||
public:
|
||||
virtual void setValue(const LLSD& value) { setLabel(value.asString()); }
|
||||
// LLView overrides
|
||||
/*virtual*/ void handleVisibilityChange(BOOL new_visibility);
|
||||
/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
|
||||
|
||||
// LLUICtrl overrides
|
||||
/*virtual*/ void setValue(const LLSD& value);
|
||||
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleAcceleratorKey(KEY key, MASK mask);
|
||||
|
||||
LLColor4 getHighlightBgColor() { return mHighlightBackground.get(); }
|
||||
|
|
@ -124,8 +129,8 @@ public:
|
|||
virtual U32 getNominalHeight( void ) const;
|
||||
|
||||
// Marks item as not needing space for check marks or accelerator keys
|
||||
virtual void setBriefItem(BOOL brief) { mBriefItem = brief; }
|
||||
virtual BOOL isBriefItem() const { return mBriefItem; }
|
||||
virtual void setBriefItem(BOOL brief);
|
||||
virtual BOOL isBriefItem() const;
|
||||
|
||||
virtual BOOL addToAcceleratorList(std::list<LLKeyBinding*> *listp);
|
||||
void setAllowKeyRepeat(BOOL allow) { mAllowKeyRepeat = allow; }
|
||||
|
|
@ -283,7 +288,6 @@ public:
|
|||
|
||||
virtual BOOL handleAcceleratorKey(KEY key, MASK mask);
|
||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||
virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
|
||||
|
||||
//virtual void draw();
|
||||
|
||||
|
|
@ -427,7 +431,7 @@ public:
|
|||
|
||||
virtual BOOL handleAcceleratorKey(KEY key, MASK mask);
|
||||
|
||||
LLMenuGL* getChildMenuByName(const std::string& name, BOOL recurse) const;
|
||||
LLMenuGL* findChildMenuByName(const std::string& name, BOOL recurse) const;
|
||||
|
||||
BOOL clearHoverItem();
|
||||
|
||||
|
|
@ -610,9 +614,9 @@ public:
|
|||
|
||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||
|
||||
virtual BOOL isActive() const { return isOpen() && getBranch() && getBranch()->getHighlightedItem(); }
|
||||
virtual BOOL isActive() const;
|
||||
|
||||
virtual BOOL isOpen() const { return getBranch() && getBranch()->isOpen(); }
|
||||
virtual BOOL isOpen() const;
|
||||
|
||||
LLMenuGL* getBranch() const { return (LLMenuGL*)mBranchHandle.get(); }
|
||||
|
||||
|
|
@ -627,7 +631,8 @@ public:
|
|||
|
||||
virtual void openMenu();
|
||||
|
||||
virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const;
|
||||
virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE) const;
|
||||
virtual LLView* findChildView(const std::string& name, BOOL recurse = TRUE) const;
|
||||
|
||||
private:
|
||||
LLHandle<LLView> mBranchHandle;
|
||||
|
|
|
|||
|
|
@ -279,10 +279,7 @@ void LLModalDialog::onAppFocusLost()
|
|||
gFocusMgr.setMouseCapture( NULL );
|
||||
}
|
||||
|
||||
if( gFocusMgr.childHasKeyboardFocus( instance ) )
|
||||
{
|
||||
gFocusMgr.setKeyboardFocus( NULL );
|
||||
}
|
||||
instance->setFocus(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -454,14 +454,8 @@ BOOL LLMultiFloater::postBuild()
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
requires<LLTabContainer>("Preview Tabs");
|
||||
if (checkRequirements())
|
||||
{
|
||||
mTabContainer = getChild<LLTabContainer>("Preview Tabs");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
mTabContainer = getChild<LLTabContainer>("Preview Tabs");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLMultiFloater::updateResizeLimits()
|
||||
|
|
|
|||
|
|
@ -192,10 +192,6 @@ void LLPanel::draw()
|
|||
|
||||
void LLPanel::updateDefaultBtn()
|
||||
{
|
||||
// This method does not call LLView::draw() so callers will need
|
||||
// to take care of that themselves at the appropriate place in
|
||||
// their rendering sequence
|
||||
|
||||
if( mDefaultBtn)
|
||||
{
|
||||
if (gFocusMgr.childHasKeyboardFocus( this ) && mDefaultBtn->getEnabled())
|
||||
|
|
@ -254,7 +250,7 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask )
|
|||
// handle user hitting ESC to defocus
|
||||
if (key == KEY_ESCAPE)
|
||||
{
|
||||
gFocusMgr.setKeyboardFocus(NULL);
|
||||
setFocus(FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
else if( (mask == MASK_SHIFT) && (KEY_TAB == key))
|
||||
|
|
@ -315,53 +311,18 @@ void LLPanel::handleVisibilityChange ( BOOL new_visibility )
|
|||
mVisibleSignal(this, LLSD(new_visibility) ); // Pass BOOL as LLSD
|
||||
}
|
||||
|
||||
BOOL LLPanel::checkRequirements()
|
||||
{
|
||||
if (!mRequirementsError.empty())
|
||||
{
|
||||
LLSD args;
|
||||
args["COMPONENTS"] = mRequirementsError;
|
||||
args["FLOATER"] = getName();
|
||||
|
||||
llwarns << getName() << " failed requirements check on: \n"
|
||||
<< mRequirementsError << llendl;
|
||||
|
||||
LLNotifications::instance().add(LLNotification::Params("FailedRequirementsCheck").payload(args));
|
||||
mRequirementsError.clear();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLPanel::setFocus(BOOL b)
|
||||
{
|
||||
if( b )
|
||||
if( b && !hasFocus())
|
||||
{
|
||||
if (!gFocusMgr.childHasKeyboardFocus(this))
|
||||
{
|
||||
// give ourselves focus preemptively, to avoid infinite loop
|
||||
LLUICtrl::setFocus(TRUE);
|
||||
// then try to pass to first valid child
|
||||
focusFirstItem();
|
||||
}
|
||||
// give ourselves focus preemptively, to avoid infinite loop
|
||||
LLUICtrl::setFocus(TRUE);
|
||||
// then try to pass to first valid child
|
||||
focusFirstItem();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( this == gFocusMgr.getKeyboardFocus() )
|
||||
{
|
||||
gFocusMgr.setKeyboardFocus( NULL );
|
||||
}
|
||||
else
|
||||
{
|
||||
//RN: why is this here?
|
||||
LLView::ctrl_list_t ctrls = getCtrlList();
|
||||
for (LLView::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it)
|
||||
{
|
||||
LLUICtrl* ctrl = *ctrl_it;
|
||||
ctrl->setFocus( FALSE );
|
||||
}
|
||||
}
|
||||
LLUICtrl::setFocus(b);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -704,7 +665,6 @@ BOOL LLPanel::childHasFocus(const std::string& id)
|
|||
}
|
||||
else
|
||||
{
|
||||
childNotFound(id);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -881,58 +841,3 @@ void LLPanel::childSetControlName(const std::string& id, const std::string& cont
|
|||
view->setControlName(control_name, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
//virtual
|
||||
LLView* LLPanel::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const
|
||||
{
|
||||
// just get child, don't try to create a dummy one
|
||||
LLView* view = LLUICtrl::getChildView(name, recurse, FALSE);
|
||||
if (!view && !recurse)
|
||||
{
|
||||
childNotFound(name);
|
||||
}
|
||||
if (!view && create_if_missing)
|
||||
{
|
||||
view = getDefaultWidget<LLView>(name);
|
||||
if (!view)
|
||||
{
|
||||
// create LLViews explicitly, as they are not registered widget types
|
||||
view = LLUICtrlFactory::createDefaultWidget<LLView>(name);
|
||||
}
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
void LLPanel::childNotFound(const std::string& id) const
|
||||
{
|
||||
if (mExpectedMembers.find(id) == mExpectedMembers.end())
|
||||
{
|
||||
mNewExpectedMembers.insert(id);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanel::childDisplayNotFound()
|
||||
{
|
||||
if (mNewExpectedMembers.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
std::string msg;
|
||||
expected_members_list_t::iterator itor;
|
||||
for (itor=mNewExpectedMembers.begin(); itor!=mNewExpectedMembers.end(); ++itor)
|
||||
{
|
||||
msg.append(*itor);
|
||||
msg.append("\n");
|
||||
mExpectedMembers.insert(*itor);
|
||||
}
|
||||
mNewExpectedMembers.clear();
|
||||
LLSD args;
|
||||
args["CONTROLS"] = msg;
|
||||
LLNotifications::instance().add("FloaterNotFound", args);
|
||||
}
|
||||
|
||||
void LLPanel::requires(const std::string& name)
|
||||
{
|
||||
requires<LLView>(name);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,9 +115,6 @@ public:
|
|||
/*virtual*/ BOOL handleKeyHere( KEY key, MASK mask );
|
||||
/*virtual*/ void handleVisibilityChange ( BOOL new_visibility );
|
||||
|
||||
// Override to set not found list:
|
||||
/*virtual*/ LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const;
|
||||
|
||||
// From LLFocusableElement
|
||||
/*virtual*/ void setFocus( BOOL b );
|
||||
|
||||
|
|
@ -132,19 +129,6 @@ public:
|
|||
BOOL hasBorder() const { return mBorder != NULL; }
|
||||
void setBorderVisible( BOOL b );
|
||||
|
||||
template <class T> void requires(const std::string& name)
|
||||
{
|
||||
// check for widget with matching type and name
|
||||
if (LLView::getChild<T>(name) == NULL)
|
||||
{
|
||||
mRequirementsError += name + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// requires LLView by default
|
||||
void requires(const std::string& name);
|
||||
BOOL checkRequirements();
|
||||
|
||||
void setBackgroundColor( const LLColor4& color ) { mBgColorOpaque = color; }
|
||||
const LLColor4& getBackgroundColor() const { return mBgColorOpaque; }
|
||||
void setTransparentColor(const LLColor4& color) { mBgColorAlpha = color; }
|
||||
|
|
@ -241,10 +225,6 @@ public:
|
|||
|
||||
void childSetControlName(const std::string& id, const std::string& control_name);
|
||||
|
||||
// Error reporting
|
||||
void childNotFound(const std::string& id) const;
|
||||
void childDisplayNotFound();
|
||||
|
||||
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL);
|
||||
|
||||
//call onOpen to let panel know when it's about to be shown or activated
|
||||
|
|
@ -279,8 +259,6 @@ private:
|
|||
typedef std::map<std::string, std::string> ui_string_map_t;
|
||||
ui_string_map_t mUIStrings;
|
||||
|
||||
std::string mRequirementsError;
|
||||
|
||||
// for setting the xml filename when building panel in context dependent cases
|
||||
std::string mXMLFilename;
|
||||
|
||||
|
|
|
|||
|
|
@ -90,18 +90,6 @@ BOOL LLRadioGroup::postBuild()
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLRadioGroup::setEnabled(BOOL enabled)
|
||||
{
|
||||
for (child_list_const_iter_t child_iter = getChildList()->begin();
|
||||
child_iter != getChildList()->end(); ++child_iter)
|
||||
{
|
||||
LLView *child = *child_iter;
|
||||
child->setEnabled(enabled);
|
||||
}
|
||||
LLView::setEnabled(enabled);
|
||||
}
|
||||
|
||||
void LLRadioGroup::setIndexEnabled(S32 index, BOOL enabled)
|
||||
{
|
||||
S32 count = 0;
|
||||
|
|
|
|||
|
|
@ -106,9 +106,7 @@ public:
|
|||
|
||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||
|
||||
virtual void setEnabled(BOOL enabled);
|
||||
void setIndexEnabled(S32 index, BOOL enabled);
|
||||
|
||||
// return the index value of the selected item
|
||||
S32 getSelectedIndex() const { return mSelectedIndex; }
|
||||
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ private:
|
|||
const ECorner mCorner;
|
||||
};
|
||||
|
||||
const S32 RESIZE_HANDLE_HEIGHT = 16;
|
||||
const S32 RESIZE_HANDLE_WIDTH = 16;
|
||||
const S32 RESIZE_HANDLE_HEIGHT = 11;
|
||||
const S32 RESIZE_HANDLE_WIDTH = 11;
|
||||
|
||||
#endif // LL_RESIZEHANDLE_H
|
||||
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask)
|
|||
}
|
||||
else
|
||||
{
|
||||
handled = childrenHandleMouseUp( x, y, mask ) != NULL;
|
||||
handled = childrenHandleHover( x, y, mask ) != NULL;
|
||||
}
|
||||
|
||||
// Opaque
|
||||
|
|
|
|||
|
|
@ -127,11 +127,6 @@ public:
|
|||
void onLineUpBtnPressed(const LLSD& data);
|
||||
void onLineDownBtnPressed(const LLSD& data);
|
||||
|
||||
void setTrackColor( const LLColor4& color ) { mTrackColor = color; }
|
||||
void setThumbColor( const LLColor4& color ) { mThumbColor = color; }
|
||||
|
||||
void setOnScrollEndCallback(void (*callback)(void*), void* userdata) { mOnScrollEndCallback = callback; mOnScrollEndData = userdata;}
|
||||
|
||||
private:
|
||||
void updateThumbRect();
|
||||
void changeLine(S32 delta, BOOL update_thumb );
|
||||
|
|
|
|||
|
|
@ -55,8 +55,6 @@
|
|||
|
||||
static const S32 HORIZONTAL_MULTIPLE = 8;
|
||||
static const S32 VERTICAL_MULTIPLE = 16;
|
||||
static const F32 MIN_AUTO_SCROLL_RATE = 120.f;
|
||||
static const F32 MAX_AUTO_SCROLL_RATE = 500.f;
|
||||
static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f;
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
|
|
@ -75,6 +73,9 @@ static ScrollContainerRegistry::Register<LLPanel> r3("panel", &LLPanel::fromXML)
|
|||
LLScrollContainer::Params::Params()
|
||||
: is_opaque("opaque"),
|
||||
bg_color("color"),
|
||||
border_visible("border_visible"),
|
||||
min_auto_scroll_rate("min_auto_scroll_rate", 100),
|
||||
max_auto_scroll_rate("max_auto_scroll_rate", 1000),
|
||||
reserve_scroll_corner("reserve_scroll_corner", false)
|
||||
{
|
||||
name = "scroll_container";
|
||||
|
|
@ -91,6 +92,8 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p)
|
|||
mBackgroundColor(p.bg_color()),
|
||||
mIsOpaque(p.is_opaque),
|
||||
mReserveScrollCorner(p.reserve_scroll_corner),
|
||||
mMinAutoScrollRate(p.min_auto_scroll_rate),
|
||||
mMaxAutoScrollRate(p.max_auto_scroll_rate),
|
||||
mScrolledView(NULL)
|
||||
{
|
||||
static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0);
|
||||
|
|
@ -98,6 +101,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p)
|
|||
LLViewBorder::Params params;
|
||||
params.name("scroll border");
|
||||
params.rect(border_rect);
|
||||
params.visible(p.border_visible);
|
||||
params.bevel_style(LLViewBorder::BEVEL_IN);
|
||||
mBorder = LLUICtrlFactory::create<LLViewBorder> (params);
|
||||
LLView::addChild( mBorder );
|
||||
|
|
@ -115,12 +119,11 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p)
|
|||
sbparams.doc_pos(0);
|
||||
sbparams.page_size(mInnerRect.getHeight());
|
||||
sbparams.step_size(VERTICAL_MULTIPLE);
|
||||
sbparams.follows.flags(FOLLOWS_RIGHT | FOLLOWS_TOP | FOLLOWS_BOTTOM);
|
||||
sbparams.visible(false);
|
||||
sbparams.change_callback(p.scroll_callback);
|
||||
mScrollbar[VERTICAL] = LLUICtrlFactory::create<LLScrollbar> (sbparams);
|
||||
LLView::addChild( mScrollbar[VERTICAL] );
|
||||
mScrollbar[VERTICAL]->setVisible( FALSE );
|
||||
mScrollbar[VERTICAL]->setFollowsRight();
|
||||
mScrollbar[VERTICAL]->setFollowsTop();
|
||||
mScrollbar[VERTICAL]->setFollowsBottom();
|
||||
|
||||
LLRect horizontal_scroll_rect = mInnerRect;
|
||||
horizontal_scroll_rect.mTop = horizontal_scroll_rect.mBottom + scrollbar_size;
|
||||
|
|
@ -131,11 +134,11 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p)
|
|||
sbparams.doc_pos(0);
|
||||
sbparams.page_size(mInnerRect.getWidth());
|
||||
sbparams.step_size(VERTICAL_MULTIPLE);
|
||||
sbparams.visible(false);
|
||||
sbparams.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT);
|
||||
sbparams.change_callback(p.scroll_callback);
|
||||
mScrollbar[HORIZONTAL] = LLUICtrlFactory::create<LLScrollbar> (sbparams);
|
||||
LLView::addChild( mScrollbar[HORIZONTAL] );
|
||||
mScrollbar[HORIZONTAL]->setVisible( FALSE );
|
||||
mScrollbar[HORIZONTAL]->setFollowsLeft();
|
||||
mScrollbar[HORIZONTAL]->setFollowsRight();
|
||||
}
|
||||
|
||||
// Destroys the object
|
||||
|
|
@ -181,7 +184,7 @@ void LLScrollContainer::reshape(S32 width, S32 height,
|
|||
{
|
||||
LLUICtrl::reshape( width, height, called_from_parent );
|
||||
|
||||
mInnerRect.set( 0, getRect().getHeight(), getRect().getWidth(), 0 );
|
||||
mInnerRect = getLocalRect();
|
||||
mInnerRect.stretch( -mBorder->getBorderWidth() );
|
||||
|
||||
if (mScrolledView)
|
||||
|
|
@ -192,13 +195,14 @@ void LLScrollContainer::reshape(S32 width, S32 height,
|
|||
S32 visible_height = 0;
|
||||
BOOL show_v_scrollbar = FALSE;
|
||||
BOOL show_h_scrollbar = FALSE;
|
||||
calcVisibleSize( scrolled_rect, &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
|
||||
calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
|
||||
|
||||
mScrollbar[VERTICAL]->setDocSize( scrolled_rect.getHeight() );
|
||||
mScrollbar[VERTICAL]->setPageSize( visible_height );
|
||||
|
||||
mScrollbar[HORIZONTAL]->setDocSize( scrolled_rect.getWidth() );
|
||||
mScrollbar[HORIZONTAL]->setPageSize( visible_width );
|
||||
updateScroll();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -217,6 +221,7 @@ BOOL LLScrollContainer::handleKeyHere(KEY key, MASK mask)
|
|||
{
|
||||
if( mScrollbar[i]->handleKeyHere(key, mask) )
|
||||
{
|
||||
updateScroll();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -233,6 +238,7 @@ BOOL LLScrollContainer::handleScrollWheel( S32 x, S32 y, S32 clicks )
|
|||
// Pretend the mouse is over the scrollbar
|
||||
if( mScrollbar[i]->handleScrollWheel( 0, 0, clicks ) )
|
||||
{
|
||||
updateScroll();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -241,28 +247,6 @@ BOOL LLScrollContainer::handleScrollWheel( S32 x, S32 y, S32 clicks )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LLScrollContainer::needsToScroll(S32 x, S32 y, LLScrollContainer::SCROLL_ORIENTATION axis) const
|
||||
{
|
||||
if(mScrollbar[axis]->getVisible())
|
||||
{
|
||||
LLRect inner_rect_local( 0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0 );
|
||||
const S32 AUTOSCROLL_SIZE = 10;
|
||||
if(mScrollbar[axis]->getVisible())
|
||||
{
|
||||
static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0);
|
||||
inner_rect_local.mRight -= scrollbar_size;
|
||||
inner_rect_local.mTop += AUTOSCROLL_SIZE;
|
||||
inner_rect_local.mBottom = inner_rect_local.mTop - AUTOSCROLL_SIZE;
|
||||
}
|
||||
if( inner_rect_local.pointInRect( x, y ) && (mScrollbar[axis]->getDocPos() > 0) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL LLScrollContainer::handleDragAndDrop(S32 x, S32 y, MASK mask,
|
||||
BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
|
|
@ -273,63 +257,7 @@ BOOL LLScrollContainer::handleDragAndDrop(S32 x, S32 y, MASK mask,
|
|||
static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0);
|
||||
// Scroll folder view if needed. Never accepts a drag or drop.
|
||||
*accept = ACCEPT_NO;
|
||||
BOOL handled = FALSE;
|
||||
if( mScrollbar[HORIZONTAL]->getVisible() || mScrollbar[VERTICAL]->getVisible() )
|
||||
{
|
||||
const S32 AUTOSCROLL_SIZE = 10;
|
||||
S32 auto_scroll_speed = llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
|
||||
|
||||
LLRect inner_rect_local( 0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0 );
|
||||
if( mScrollbar[HORIZONTAL]->getVisible() )
|
||||
{
|
||||
inner_rect_local.mBottom += scrollbar_size;
|
||||
}
|
||||
if( mScrollbar[VERTICAL]->getVisible() )
|
||||
{
|
||||
inner_rect_local.mRight -= scrollbar_size;
|
||||
}
|
||||
|
||||
if( mScrollbar[HORIZONTAL]->getVisible() )
|
||||
{
|
||||
LLRect left_scroll_rect = inner_rect_local;
|
||||
left_scroll_rect.mRight = AUTOSCROLL_SIZE;
|
||||
if( left_scroll_rect.pointInRect( x, y ) && (mScrollbar[HORIZONTAL]->getDocPos() > 0) )
|
||||
{
|
||||
mScrollbar[HORIZONTAL]->setDocPos( mScrollbar[HORIZONTAL]->getDocPos() - auto_scroll_speed );
|
||||
mAutoScrolling = TRUE;
|
||||
handled = TRUE;
|
||||
}
|
||||
|
||||
LLRect right_scroll_rect = inner_rect_local;
|
||||
right_scroll_rect.mLeft = inner_rect_local.mRight - AUTOSCROLL_SIZE;
|
||||
if( right_scroll_rect.pointInRect( x, y ) && (mScrollbar[HORIZONTAL]->getDocPos() < mScrollbar[HORIZONTAL]->getDocPosMax()) )
|
||||
{
|
||||
mScrollbar[HORIZONTAL]->setDocPos( mScrollbar[HORIZONTAL]->getDocPos() + auto_scroll_speed );
|
||||
mAutoScrolling = TRUE;
|
||||
handled = TRUE;
|
||||
}
|
||||
}
|
||||
if( mScrollbar[VERTICAL]->getVisible() )
|
||||
{
|
||||
LLRect bottom_scroll_rect = inner_rect_local;
|
||||
bottom_scroll_rect.mTop = AUTOSCROLL_SIZE + bottom_scroll_rect.mBottom;
|
||||
if( bottom_scroll_rect.pointInRect( x, y ) && (mScrollbar[VERTICAL]->getDocPos() < mScrollbar[VERTICAL]->getDocPosMax()) )
|
||||
{
|
||||
mScrollbar[VERTICAL]->setDocPos( mScrollbar[VERTICAL]->getDocPos() + auto_scroll_speed );
|
||||
mAutoScrolling = TRUE;
|
||||
handled = TRUE;
|
||||
}
|
||||
|
||||
LLRect top_scroll_rect = inner_rect_local;
|
||||
top_scroll_rect.mBottom = inner_rect_local.mTop - AUTOSCROLL_SIZE;
|
||||
if( top_scroll_rect.pointInRect( x, y ) && (mScrollbar[VERTICAL]->getDocPos() > 0) )
|
||||
{
|
||||
mScrollbar[VERTICAL]->setDocPos( mScrollbar[VERTICAL]->getDocPos() - auto_scroll_speed );
|
||||
mAutoScrolling = TRUE;
|
||||
handled = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
BOOL handled = autoScroll(x, y);
|
||||
|
||||
if( !handled )
|
||||
{
|
||||
|
|
@ -340,14 +268,81 @@ BOOL LLScrollContainer::handleDragAndDrop(S32 x, S32 y, MASK mask,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const
|
||||
bool LLScrollContainer::autoScroll(S32 x, S32 y)
|
||||
{
|
||||
const LLRect& rect = getScrolledViewRect();
|
||||
calcVisibleSize(rect, visible_width, visible_height, show_h_scrollbar, show_v_scrollbar);
|
||||
static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0);
|
||||
|
||||
bool scrolling = false;
|
||||
if( mScrollbar[HORIZONTAL]->getVisible() || mScrollbar[VERTICAL]->getVisible() )
|
||||
{
|
||||
LLRect screen_local_extents;
|
||||
screenRectToLocal(getRootView()->getLocalRect(), &screen_local_extents);
|
||||
|
||||
LLRect inner_rect_local( 0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0 );
|
||||
if( mScrollbar[HORIZONTAL]->getVisible() )
|
||||
{
|
||||
inner_rect_local.mBottom += scrollbar_size;
|
||||
}
|
||||
if( mScrollbar[VERTICAL]->getVisible() )
|
||||
{
|
||||
inner_rect_local.mRight -= scrollbar_size;
|
||||
}
|
||||
|
||||
// clip rect against root view
|
||||
inner_rect_local.intersectWith(screen_local_extents);
|
||||
|
||||
S32 auto_scroll_speed = llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
|
||||
// autoscroll region should take up no more than one third of visible scroller area
|
||||
S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, 10);
|
||||
S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, 10);
|
||||
|
||||
if( mScrollbar[HORIZONTAL]->getVisible() )
|
||||
{
|
||||
LLRect left_scroll_rect = screen_local_extents;
|
||||
left_scroll_rect.mRight = inner_rect_local.mLeft + auto_scroll_region_width;
|
||||
if( left_scroll_rect.pointInRect( x, y ) && (mScrollbar[HORIZONTAL]->getDocPos() > 0) )
|
||||
{
|
||||
mScrollbar[HORIZONTAL]->setDocPos( mScrollbar[HORIZONTAL]->getDocPos() - auto_scroll_speed );
|
||||
mAutoScrolling = TRUE;
|
||||
scrolling = true;
|
||||
}
|
||||
|
||||
LLRect right_scroll_rect = screen_local_extents;
|
||||
right_scroll_rect.mLeft = inner_rect_local.mRight - auto_scroll_region_width;
|
||||
if( right_scroll_rect.pointInRect( x, y ) && (mScrollbar[HORIZONTAL]->getDocPos() < mScrollbar[HORIZONTAL]->getDocPosMax()) )
|
||||
{
|
||||
mScrollbar[HORIZONTAL]->setDocPos( mScrollbar[HORIZONTAL]->getDocPos() + auto_scroll_speed );
|
||||
mAutoScrolling = TRUE;
|
||||
scrolling = true;
|
||||
}
|
||||
}
|
||||
if( mScrollbar[VERTICAL]->getVisible() )
|
||||
{
|
||||
LLRect bottom_scroll_rect = screen_local_extents;
|
||||
bottom_scroll_rect.mTop = inner_rect_local.mBottom + auto_scroll_region_height;
|
||||
if( bottom_scroll_rect.pointInRect( x, y ) && (mScrollbar[VERTICAL]->getDocPos() < mScrollbar[VERTICAL]->getDocPosMax()) )
|
||||
{
|
||||
mScrollbar[VERTICAL]->setDocPos( mScrollbar[VERTICAL]->getDocPos() + auto_scroll_speed );
|
||||
mAutoScrolling = TRUE;
|
||||
scrolling = true;
|
||||
}
|
||||
|
||||
LLRect top_scroll_rect = screen_local_extents;
|
||||
top_scroll_rect.mBottom = inner_rect_local.mTop - auto_scroll_region_height;
|
||||
if( top_scroll_rect.pointInRect( x, y ) && (mScrollbar[VERTICAL]->getDocPos() > 0) )
|
||||
{
|
||||
mScrollbar[VERTICAL]->setDocPos( mScrollbar[VERTICAL]->getDocPos() - auto_scroll_speed );
|
||||
mAutoScrolling = TRUE;
|
||||
scrolling = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return scrolling;
|
||||
}
|
||||
|
||||
void LLScrollContainer::calcVisibleSize( const LLRect& doc_rect, S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const
|
||||
void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const
|
||||
{
|
||||
const LLRect& doc_rect = getScrolledViewRect();
|
||||
static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0);
|
||||
S32 doc_width = doc_rect.getWidth();
|
||||
S32 doc_height = doc_rect.getHeight();
|
||||
|
|
@ -384,20 +379,20 @@ void LLScrollContainer::draw()
|
|||
if (mAutoScrolling)
|
||||
{
|
||||
// add acceleration to autoscroll
|
||||
mAutoScrollRate = llmin(mAutoScrollRate + (LLFrameTimer::getFrameDeltaTimeF32() * AUTO_SCROLL_RATE_ACCEL), MAX_AUTO_SCROLL_RATE);
|
||||
mAutoScrollRate = llmin(mAutoScrollRate + (LLFrameTimer::getFrameDeltaTimeF32() * AUTO_SCROLL_RATE_ACCEL), mMaxAutoScrollRate);
|
||||
}
|
||||
else
|
||||
{
|
||||
// reset to minimum
|
||||
mAutoScrollRate = MIN_AUTO_SCROLL_RATE;
|
||||
// reset to minimum for next time
|
||||
mAutoScrollRate = mMinAutoScrollRate;
|
||||
}
|
||||
// clear this flag to be set on next call to handleDragAndDrop
|
||||
// clear this flag to be set on next call to autoScroll
|
||||
mAutoScrolling = FALSE;
|
||||
|
||||
// auto-focus when scrollbar active
|
||||
// this allows us to capture user intent (i.e. stop automatically scrolling the view/etc)
|
||||
if (!gFocusMgr.childHasKeyboardFocus(this) &&
|
||||
(mScrollbar[VERTICAL]->hasMouseCapture() || mScrollbar[HORIZONTAL]->hasMouseCapture()))
|
||||
if (!hasFocus()
|
||||
&& (mScrollbar[VERTICAL]->hasMouseCapture() || mScrollbar[HORIZONTAL]->hasMouseCapture()))
|
||||
{
|
||||
focusFirstItem();
|
||||
}
|
||||
|
|
@ -424,7 +419,7 @@ void LLScrollContainer::draw()
|
|||
S32 visible_height = 0;
|
||||
BOOL show_v_scrollbar = FALSE;
|
||||
BOOL show_h_scrollbar = FALSE;
|
||||
calcVisibleSize( mScrolledView->getRect(), &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
|
||||
calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
|
||||
|
||||
LLLocalClipRect clip(LLRect(mInnerRect.mLeft,
|
||||
mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0) + visible_height,
|
||||
|
|
@ -506,7 +501,7 @@ void LLScrollContainer::updateScroll()
|
|||
S32 visible_height = 0;
|
||||
BOOL show_v_scrollbar = FALSE;
|
||||
BOOL show_h_scrollbar = FALSE;
|
||||
calcVisibleSize( doc_rect, &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
|
||||
calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
|
||||
|
||||
S32 border_width = mBorder->getBorderWidth();
|
||||
if( show_v_scrollbar )
|
||||
|
|
@ -584,8 +579,33 @@ void LLScrollContainer::setBorderVisible(BOOL b)
|
|||
mBorder->setVisible( b );
|
||||
}
|
||||
|
||||
// Scroll so that as much of rect as possible is showing (where rect is defined in the space of scroller view, not scrolled)
|
||||
void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLCoordGL& desired_offset)
|
||||
LLRect LLScrollContainer::getVisibleContentRect()
|
||||
{
|
||||
updateScroll();
|
||||
LLRect visible_rect = getContentWindowRect();
|
||||
LLRect contents_rect = mScrolledView->getRect();
|
||||
visible_rect.translate(-contents_rect.mLeft, -contents_rect.mBottom);
|
||||
return visible_rect;
|
||||
}
|
||||
|
||||
LLRect LLScrollContainer::getContentWindowRect() const
|
||||
{
|
||||
LLRect scroller_view_rect;
|
||||
S32 visible_width = 0;
|
||||
S32 visible_height = 0;
|
||||
BOOL show_h_scrollbar = FALSE;
|
||||
BOOL show_v_scrollbar = FALSE;
|
||||
calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
|
||||
S32 border_width = mBorder->getBorderWidth();
|
||||
scroller_view_rect.setOriginAndSize(border_width,
|
||||
show_h_scrollbar ? mScrollbar[HORIZONTAL]->getRect().mTop : border_width,
|
||||
visible_width,
|
||||
visible_height);
|
||||
return scroller_view_rect;
|
||||
}
|
||||
|
||||
// rect is in document coordinates, constraint is in display coordinates relative to content window rect
|
||||
void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLRect& constraint)
|
||||
{
|
||||
if (!mScrolledView)
|
||||
{
|
||||
|
|
@ -593,62 +613,39 @@ void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLCoordGL& de
|
|||
return;
|
||||
}
|
||||
|
||||
S32 visible_width = 0;
|
||||
S32 visible_height = 0;
|
||||
BOOL show_v_scrollbar = FALSE;
|
||||
BOOL show_h_scrollbar = FALSE;
|
||||
const LLRect& scrolled_rect = mScrolledView->getRect();
|
||||
calcVisibleSize( scrolled_rect, &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar );
|
||||
LLRect content_window_rect = getContentWindowRect();
|
||||
// get document rect
|
||||
LLRect scrolled_rect = mScrolledView->getRect();
|
||||
|
||||
// can't be so far left that right side of rect goes off screen, or so far right that left side does
|
||||
S32 horiz_offset = llclamp(desired_offset.mX, llmin(0, -visible_width + rect.getWidth()), 0);
|
||||
// can't be so high that bottom of rect goes off screen, or so low that top does
|
||||
S32 vert_offset = llclamp(desired_offset.mY, 0, llmax(0, visible_height - rect.getHeight()));
|
||||
// shrink target rect to fit within constraint region, biasing towards top left
|
||||
LLRect rect_to_constrain = rect;
|
||||
rect_to_constrain.mBottom = llmax(rect_to_constrain.mBottom, rect_to_constrain.mTop - constraint.getHeight());
|
||||
rect_to_constrain.mRight = llmin(rect_to_constrain.mRight, rect_to_constrain.mLeft + constraint.getWidth());
|
||||
|
||||
// Vertical
|
||||
// 1. First make sure the top is visible
|
||||
// 2. Then, if possible without hiding the top, make the bottom visible.
|
||||
S32 vert_pos = mScrollbar[VERTICAL]->getDocPos();
|
||||
// calculate allowable positions for scroller window in document coordinates
|
||||
LLRect allowable_scroll_rect(rect_to_constrain.mRight - constraint.mRight,
|
||||
rect_to_constrain.mBottom - constraint.mBottom,
|
||||
rect_to_constrain.mLeft - constraint.mLeft,
|
||||
rect_to_constrain.mTop - constraint.mTop);
|
||||
|
||||
// find scrollbar position to get top of rect on screen (scrolling up)
|
||||
S32 top_offset = scrolled_rect.mTop - rect.mTop - vert_offset;
|
||||
// find scrollbar position to get bottom of rect on screen (scrolling down)
|
||||
S32 bottom_offset = vert_offset == 0 ? scrolled_rect.mTop - rect.mBottom - visible_height : top_offset;
|
||||
// scroll up far enough to see top or scroll down just enough if item is bigger than visual area
|
||||
if( vert_pos >= top_offset || visible_height < rect.getHeight())
|
||||
{
|
||||
vert_pos = top_offset;
|
||||
}
|
||||
// else scroll down far enough to see bottom
|
||||
else
|
||||
if( vert_pos <= bottom_offset )
|
||||
{
|
||||
vert_pos = bottom_offset;
|
||||
}
|
||||
// translate from allowable region for lower left corner to upper left corner
|
||||
allowable_scroll_rect.translate(0, content_window_rect.getHeight());
|
||||
|
||||
S32 vert_pos = llclamp(mScrollbar[VERTICAL]->getDocPos(),
|
||||
mScrollbar[VERTICAL]->getDocSize() - allowable_scroll_rect.mTop, // min vertical scroll
|
||||
mScrollbar[VERTICAL]->getDocSize() - allowable_scroll_rect.mBottom); // max vertical scroll
|
||||
|
||||
mScrollbar[VERTICAL]->setDocSize( scrolled_rect.getHeight() );
|
||||
mScrollbar[VERTICAL]->setPageSize( visible_height );
|
||||
mScrollbar[VERTICAL]->setPageSize( content_window_rect.getHeight() );
|
||||
mScrollbar[VERTICAL]->setDocPos( vert_pos );
|
||||
|
||||
// Horizontal
|
||||
// 1. First make sure left side is visible
|
||||
// 2. Then, if possible without hiding the left side, make the right side visible.
|
||||
S32 horiz_pos = mScrollbar[HORIZONTAL]->getDocPos();
|
||||
S32 left_offset = rect.mLeft - scrolled_rect.mLeft + horiz_offset;
|
||||
S32 right_offset = horiz_offset == 0 ? rect.mRight - scrolled_rect.mLeft - visible_width : left_offset;
|
||||
S32 horizontal_pos = llclamp(mScrollbar[HORIZONTAL]->getDocPos(),
|
||||
allowable_scroll_rect.mLeft,
|
||||
allowable_scroll_rect.mRight);
|
||||
|
||||
if( horiz_pos >= left_offset || visible_width < rect.getWidth() )
|
||||
{
|
||||
horiz_pos = left_offset;
|
||||
}
|
||||
else if( horiz_pos <= right_offset )
|
||||
{
|
||||
horiz_pos = right_offset;
|
||||
}
|
||||
|
||||
mScrollbar[HORIZONTAL]->setDocSize( scrolled_rect.getWidth() );
|
||||
mScrollbar[HORIZONTAL]->setPageSize( visible_width );
|
||||
mScrollbar[HORIZONTAL]->setDocPos( horiz_pos );
|
||||
mScrollbar[HORIZONTAL]->setPageSize( content_window_rect.getWidth() );
|
||||
mScrollbar[HORIZONTAL]->setDocPos( horizontal_pos );
|
||||
|
||||
// propagate scroll to document
|
||||
updateScroll();
|
||||
|
|
@ -657,21 +654,25 @@ void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLCoordGL& de
|
|||
void LLScrollContainer::pageUp(S32 overlap)
|
||||
{
|
||||
mScrollbar[VERTICAL]->pageUp(overlap);
|
||||
updateScroll();
|
||||
}
|
||||
|
||||
void LLScrollContainer::pageDown(S32 overlap)
|
||||
{
|
||||
mScrollbar[VERTICAL]->pageDown(overlap);
|
||||
updateScroll();
|
||||
}
|
||||
|
||||
void LLScrollContainer::goToTop()
|
||||
{
|
||||
mScrollbar[VERTICAL]->setDocPos(0);
|
||||
updateScroll();
|
||||
}
|
||||
|
||||
void LLScrollContainer::goToBottom()
|
||||
{
|
||||
mScrollbar[VERTICAL]->setDocPos(mScrollbar[VERTICAL]->getDocSize());
|
||||
updateScroll();
|
||||
}
|
||||
|
||||
S32 LLScrollContainer::getBorderWidth() const
|
||||
|
|
|
|||
|
|
@ -66,9 +66,13 @@ public:
|
|||
|
||||
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
|
||||
{
|
||||
Optional<bool> is_opaque;
|
||||
Optional<bool> is_opaque,
|
||||
reserve_scroll_corner,
|
||||
border_visible;
|
||||
Optional<F32> min_auto_scroll_rate,
|
||||
max_auto_scroll_rate;
|
||||
Optional<LLUIColor> bg_color;
|
||||
Optional<bool> reserve_scroll_corner;
|
||||
Optional<LLScrollbar::callback_t> scroll_callback;
|
||||
|
||||
Params();
|
||||
};
|
||||
|
|
@ -84,21 +88,23 @@ public:
|
|||
|
||||
virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); }
|
||||
|
||||
void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const;
|
||||
void calcVisibleSize( const LLRect& doc_rect, S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const;
|
||||
void setBorderVisible( BOOL b );
|
||||
|
||||
void scrollToShowRect( const LLRect& rect, const LLCoordGL& desired_offset );
|
||||
void scrollToShowRect( const LLRect& rect, const LLRect& constraint);
|
||||
void scrollToShowRect( const LLRect& rect) { scrollToShowRect(rect, LLRect(0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0)); }
|
||||
|
||||
void setReserveScrollCorner( BOOL b ) { mReserveScrollCorner = b; }
|
||||
LLRect getVisibleContentRect();
|
||||
LLRect getContentWindowRect() const;
|
||||
const LLRect& getScrolledViewRect() const { return mScrolledView ? mScrolledView->getRect() : LLRect::null; }
|
||||
void pageUp(S32 overlap = 0);
|
||||
void pageDown(S32 overlap = 0);
|
||||
void goToTop();
|
||||
void goToBottom();
|
||||
bool isAtTop() { return mScrollbar[VERTICAL]->isAtBeginning(); }
|
||||
bool isAtBottom() { return mScrollbar[VERTICAL]->isAtEnd(); }
|
||||
S32 getBorderWidth() const;
|
||||
|
||||
BOOL needsToScroll(S32 x, S32 y, SCROLL_ORIENTATION axis) const;
|
||||
|
||||
// LLView functionality
|
||||
virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
|
||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||
|
|
@ -111,12 +117,15 @@ public:
|
|||
|
||||
virtual void draw();
|
||||
virtual bool addChild(LLView* view, S32 tab_group = 0);
|
||||
|
||||
bool autoScroll(S32 x, S32 y);
|
||||
|
||||
private:
|
||||
// internal scrollbar handlers
|
||||
virtual void scrollHorizontal( S32 new_pos );
|
||||
virtual void scrollVertical( S32 new_pos );
|
||||
void updateScroll();
|
||||
void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const;
|
||||
|
||||
LLScrollbar* mScrollbar[SCROLLBAR_COUNT];
|
||||
LLView* mScrolledView;
|
||||
|
|
@ -128,6 +137,8 @@ private:
|
|||
BOOL mReserveScrollCorner;
|
||||
BOOL mAutoScrolling;
|
||||
F32 mAutoScrollRate;
|
||||
F32 mMinAutoScrollRate;
|
||||
F32 mMaxAutoScrollRate;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -310,17 +310,16 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col
|
|||
break;
|
||||
}
|
||||
mFont->render(mText.getWString(), 0,
|
||||
start_x, 2.f,
|
||||
display_color,
|
||||
mFontAlignment,
|
||||
LLFontGL::BOTTOM,
|
||||
0,
|
||||
LLFontGL::NO_SHADOW,
|
||||
string_chars,
|
||||
getWidth(),
|
||||
&right_x,
|
||||
FALSE,
|
||||
TRUE);
|
||||
start_x, 2.f,
|
||||
display_color,
|
||||
mFontAlignment,
|
||||
LLFontGL::BOTTOM,
|
||||
0,
|
||||
LLFontGL::NO_SHADOW,
|
||||
string_chars,
|
||||
getWidth(),
|
||||
&right_x,
|
||||
TRUE);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
|
|||
mNumDynamicWidthColumns(0),
|
||||
mTotalStaticColumnWidth(0),
|
||||
mTotalColumnPadding(0),
|
||||
mSorted(FALSE),
|
||||
mSorted(false),
|
||||
mDirty(FALSE),
|
||||
mOriginalSelection(-1),
|
||||
mLastSelected(NULL),
|
||||
|
|
@ -374,6 +374,10 @@ std::vector<LLScrollListItem*> LLScrollListCtrl::getAllSelected() const
|
|||
S32 LLScrollListCtrl::getFirstSelectedIndex() const
|
||||
{
|
||||
S32 CurSelectedIndex = 0;
|
||||
|
||||
// make sure sort is up to date before returning an index
|
||||
updateSort();
|
||||
|
||||
item_list::const_iterator iter;
|
||||
for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
|
||||
{
|
||||
|
|
@ -507,7 +511,7 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r
|
|||
{
|
||||
case ADD_TOP:
|
||||
mItemList.push_front(item);
|
||||
setSorted(FALSE);
|
||||
setNeedsSort();
|
||||
break;
|
||||
|
||||
case ADD_SORTED:
|
||||
|
|
@ -524,18 +528,18 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r
|
|||
|
||||
// ADD_SORTED just sorts by first column...
|
||||
// this might not match user sort criteria, so flag list as being in unsorted state
|
||||
setSorted(FALSE);
|
||||
setNeedsSort();
|
||||
break;
|
||||
}
|
||||
case ADD_BOTTOM:
|
||||
mItemList.push_back(item);
|
||||
setSorted(FALSE);
|
||||
setNeedsSort();
|
||||
break;
|
||||
|
||||
default:
|
||||
llassert(0);
|
||||
mItemList.push_back(item);
|
||||
setSorted(FALSE);
|
||||
setNeedsSort();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -759,6 +763,9 @@ BOOL LLScrollListCtrl::selectItemRange( S32 first_index, S32 last_index )
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// make sure sort is up to date
|
||||
updateSort();
|
||||
|
||||
S32 listlen = (S32)mItemList.size();
|
||||
first_index = llclamp(first_index, 0, listlen-1);
|
||||
|
||||
|
|
@ -812,6 +819,7 @@ void LLScrollListCtrl::swapWithNext(S32 index)
|
|||
// At end of list, doesn't do anything
|
||||
return;
|
||||
}
|
||||
updateSort();
|
||||
LLScrollListItem *cur_itemp = mItemList[index];
|
||||
mItemList[index] = mItemList[index + 1];
|
||||
mItemList[index + 1] = cur_itemp;
|
||||
|
|
@ -825,6 +833,7 @@ void LLScrollListCtrl::swapWithPrevious(S32 index)
|
|||
// At beginning of list, don't do anything
|
||||
}
|
||||
|
||||
updateSort();
|
||||
LLScrollListItem *cur_itemp = mItemList[index];
|
||||
mItemList[index] = mItemList[index - 1];
|
||||
mItemList[index - 1] = cur_itemp;
|
||||
|
|
@ -838,6 +847,8 @@ void LLScrollListCtrl::deleteSingleItem(S32 target_index)
|
|||
return;
|
||||
}
|
||||
|
||||
updateSort();
|
||||
|
||||
LLScrollListItem *itemp;
|
||||
itemp = mItemList[target_index];
|
||||
if (itemp == mLastSelected)
|
||||
|
|
@ -939,6 +950,8 @@ S32 LLScrollListCtrl::selectMultiple( std::vector<LLUUID> ids )
|
|||
|
||||
S32 LLScrollListCtrl::getItemIndex( LLScrollListItem* target_item ) const
|
||||
{
|
||||
updateSort();
|
||||
|
||||
S32 index = 0;
|
||||
item_list::const_iterator iter;
|
||||
for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
|
||||
|
|
@ -955,6 +968,8 @@ S32 LLScrollListCtrl::getItemIndex( LLScrollListItem* target_item ) const
|
|||
|
||||
S32 LLScrollListCtrl::getItemIndex( const LLUUID& target_id ) const
|
||||
{
|
||||
updateSort();
|
||||
|
||||
S32 index = 0;
|
||||
item_list::const_iterator iter;
|
||||
for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
|
||||
|
|
@ -980,6 +995,8 @@ void LLScrollListCtrl::selectPrevItem( BOOL extend_selection)
|
|||
}
|
||||
else
|
||||
{
|
||||
updateSort();
|
||||
|
||||
item_list::iterator iter;
|
||||
for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
|
||||
{
|
||||
|
|
@ -1022,6 +1039,8 @@ void LLScrollListCtrl::selectNextItem( BOOL extend_selection)
|
|||
}
|
||||
else
|
||||
{
|
||||
updateSort();
|
||||
|
||||
item_list::reverse_iterator iter;
|
||||
for (iter = mItemList.rbegin(); iter != mItemList.rend(); iter++)
|
||||
{
|
||||
|
|
@ -1436,7 +1455,7 @@ void LLScrollListCtrl::draw()
|
|||
LLLocalClipRect clip(getLocalRect());
|
||||
|
||||
// if user specifies sort, make sure it is maintained
|
||||
sortItems();
|
||||
updateSort();
|
||||
|
||||
if (mNeedsScroll)
|
||||
{
|
||||
|
|
@ -1463,7 +1482,7 @@ void LLScrollListCtrl::draw()
|
|||
|
||||
if (mBorder)
|
||||
{
|
||||
mBorder->setKeyboardFocusHighlight(gFocusMgr.getKeyboardFocus() == this);
|
||||
mBorder->setKeyboardFocusHighlight(hasFocus());
|
||||
}
|
||||
|
||||
LLUICtrl::draw();
|
||||
|
|
@ -1754,6 +1773,8 @@ LLScrollListItem* LLScrollListCtrl::hitItem( S32 x, S32 y )
|
|||
// Excludes disabled items.
|
||||
LLScrollListItem* hit_item = NULL;
|
||||
|
||||
updateSort();
|
||||
|
||||
LLRect item_rect;
|
||||
item_rect.setLeftTopAndSize(
|
||||
mItemListRect.mLeft,
|
||||
|
|
@ -2199,7 +2220,7 @@ BOOL LLScrollListCtrl::setSort(S32 column_idx, BOOL ascending)
|
|||
|
||||
sort_column_t new_sort_column(column_idx, ascending);
|
||||
|
||||
setSorted(FALSE);
|
||||
setNeedsSort();
|
||||
|
||||
if (mSortColumns.empty())
|
||||
{
|
||||
|
|
@ -2241,10 +2262,10 @@ void LLScrollListCtrl::sortByColumn(const std::string& name, BOOL ascending)
|
|||
void LLScrollListCtrl::sortByColumnIndex(U32 column, BOOL ascending)
|
||||
{
|
||||
setSort(column, ascending);
|
||||
sortItems();
|
||||
updateSort();
|
||||
}
|
||||
|
||||
void LLScrollListCtrl::sortItems()
|
||||
void LLScrollListCtrl::updateSort() const
|
||||
{
|
||||
if (hasSortOrder() && !isSorted())
|
||||
{
|
||||
|
|
@ -2254,7 +2275,7 @@ void LLScrollListCtrl::sortItems()
|
|||
mItemList.end(),
|
||||
SortScrollListItem(mSortColumns));
|
||||
|
||||
setSorted(TRUE);
|
||||
mSorted = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2311,7 +2332,7 @@ void LLScrollListCtrl::scrollToShowSelected()
|
|||
return;
|
||||
}
|
||||
|
||||
sortItems();
|
||||
updateSort();
|
||||
|
||||
S32 index = getFirstSelectedIndex();
|
||||
if (index < 0)
|
||||
|
|
@ -2552,7 +2573,7 @@ std::string LLScrollListCtrl::getSortColumnName()
|
|||
else return "";
|
||||
}
|
||||
|
||||
BOOL LLScrollListCtrl::hasSortOrder()
|
||||
BOOL LLScrollListCtrl::hasSortOrder() const
|
||||
{
|
||||
return !mSortColumns.empty();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,15 +329,16 @@ public:
|
|||
|
||||
std::string getSortColumnName();
|
||||
BOOL getSortAscending() { return mSortColumns.empty() ? TRUE : mSortColumns.back().second; }
|
||||
BOOL hasSortOrder();
|
||||
BOOL hasSortOrder() const;
|
||||
|
||||
S32 selectMultiple( std::vector<LLUUID> ids );
|
||||
void sortItems();
|
||||
// conceptually const, but mutates mItemList
|
||||
void updateSort() const;
|
||||
// sorts a list without affecting the permanent sort order (so further list insertions can be unsorted, for example)
|
||||
void sortOnce(S32 column, BOOL ascending);
|
||||
|
||||
// manually call this whenever editing list items in place to flag need for resorting
|
||||
void setSorted(BOOL sorted) { mSorted = sorted; }
|
||||
void setNeedsSort() { mSorted = false; }
|
||||
void dirtyColumns(); // some operation has potentially affected column layout or ordering
|
||||
|
||||
protected:
|
||||
|
|
@ -390,7 +391,7 @@ private:
|
|||
const BOOL mDisplayColumnHeaders;
|
||||
BOOL mColumnsDirty;
|
||||
|
||||
item_list mItemList;
|
||||
mutable item_list mItemList;
|
||||
|
||||
LLScrollListItem *mLastSelected;
|
||||
|
||||
|
|
@ -429,7 +430,7 @@ private:
|
|||
S32 mTotalStaticColumnWidth;
|
||||
S32 mTotalColumnPadding;
|
||||
|
||||
BOOL mSorted;
|
||||
mutable bool mSorted;
|
||||
|
||||
typedef std::map<std::string, LLScrollListColumn> column_map_t;
|
||||
column_map_t mColumns;
|
||||
|
|
|
|||
|
|
@ -38,119 +38,34 @@
|
|||
#include "llstring.h"
|
||||
#include "llui.h"
|
||||
|
||||
LLStyle::Params::Params()
|
||||
: visible("visible", true),
|
||||
drop_shadow("drop_shadow", false),
|
||||
color("color", LLColor4::black),
|
||||
font("font", LLFontGL::getFontMonospace()),
|
||||
image("image"),
|
||||
link_href("href")
|
||||
{}
|
||||
|
||||
LLStyle::LLStyle()
|
||||
{
|
||||
init(TRUE, LLColor4(0,0,0,1),LLStringUtil::null);
|
||||
}
|
||||
|
||||
LLStyle::LLStyle(const LLStyle &style)
|
||||
{
|
||||
if (this != &style)
|
||||
{
|
||||
init(style.isVisible(),style.getColor(),style.getFontString());
|
||||
if (style.isLink())
|
||||
{
|
||||
setLinkHREF(style.getLinkHREF());
|
||||
}
|
||||
mItalic = style.mItalic;
|
||||
mBold = style.mBold;
|
||||
mUnderline = style.mUnderline;
|
||||
mDropShadow = style.mDropShadow;
|
||||
mImageHeight = style.mImageHeight;
|
||||
mImageWidth = style.mImageWidth;
|
||||
mImagep = style.mImagep;
|
||||
mIsEmbeddedItem = style.mIsEmbeddedItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
init(TRUE, LLColor4(0,0,0,1),LLStringUtil::null);
|
||||
}
|
||||
}
|
||||
LLStyle::LLStyle(const LLStyle::Params& p)
|
||||
: mVisible(p.visible),
|
||||
mColor(p.color()),
|
||||
mFont(p.font()),
|
||||
mLink(p.link_href),
|
||||
mDropShadow(p.drop_shadow),
|
||||
mImageHeight(0),
|
||||
mImageWidth(0),
|
||||
mImagep(p.image())
|
||||
{}
|
||||
|
||||
LLStyle::LLStyle(BOOL is_visible, const LLColor4 &color, const std::string& font_name)
|
||||
void LLStyle::setFont(const LLFontGL* font)
|
||||
{
|
||||
init(is_visible, color, font_name);
|
||||
}
|
||||
|
||||
void LLStyle::init(BOOL is_visible, const LLColor4 &color, const std::string& font_name)
|
||||
{
|
||||
mVisible = is_visible;
|
||||
mColor = color;
|
||||
setFontName(font_name);
|
||||
setLinkHREF(LLStringUtil::null);
|
||||
mItalic = FALSE;
|
||||
mBold = FALSE;
|
||||
mUnderline = FALSE;
|
||||
mDropShadow = FALSE;
|
||||
mImageHeight = 0;
|
||||
mImageWidth = 0;
|
||||
mIsEmbeddedItem = FALSE;
|
||||
mFont = font;
|
||||
}
|
||||
|
||||
|
||||
// Copy assignment
|
||||
LLStyle &LLStyle::operator=(const LLStyle &rhs)
|
||||
{
|
||||
if (this != &rhs)
|
||||
{
|
||||
setVisible(rhs.isVisible());
|
||||
setColor(rhs.getColor());
|
||||
this->mFontName = rhs.getFontString();
|
||||
this->mLink = rhs.getLinkHREF();
|
||||
mImagep = rhs.mImagep;
|
||||
mImageHeight = rhs.mImageHeight;
|
||||
mImageWidth = rhs.mImageWidth;
|
||||
mItalic = rhs.mItalic;
|
||||
mBold = rhs.mBold;
|
||||
mUnderline = rhs.mUnderline;
|
||||
mDropShadow = rhs.mDropShadow;
|
||||
mIsEmbeddedItem = rhs.mIsEmbeddedItem;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//virtual
|
||||
const std::string& LLStyle::getFontString() const
|
||||
{
|
||||
return mFontName;
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLStyle::setFontName(const std::string& fontname)
|
||||
{
|
||||
mFontName = fontname;
|
||||
|
||||
std::string fontname_lc = fontname;
|
||||
LLStringUtil::toLower(fontname_lc);
|
||||
|
||||
// cache the font pointer for speed when rendering text
|
||||
if ((fontname_lc == "sansserif") || (fontname_lc == "sans-serif"))
|
||||
{
|
||||
mFont = LLFontGL::getFontSansSerif();
|
||||
}
|
||||
else if ((fontname_lc == "serif"))
|
||||
{
|
||||
// *TODO: Do we have a real serif font?
|
||||
mFont = LLFontGL::getFontMonospace();
|
||||
}
|
||||
else if ((fontname_lc == "sansserifbig"))
|
||||
{
|
||||
mFont = LLFontGL::getFontSansSerifBig();
|
||||
}
|
||||
else if (fontname_lc == "small")
|
||||
{
|
||||
mFont = LLFontGL::getFontSansSerifSmall();
|
||||
}
|
||||
else
|
||||
{
|
||||
mFont = LLFontGL::getFontMonospace();
|
||||
}
|
||||
}
|
||||
|
||||
//virtual
|
||||
LLFontGL* LLStyle::getFont() const
|
||||
const LLFontGL* LLStyle::getFont() const
|
||||
{
|
||||
return mFont;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,59 +35,59 @@
|
|||
|
||||
#include "v4color.h"
|
||||
#include "llui.h"
|
||||
#include "llinitparam.h"
|
||||
|
||||
class LLFontGL;
|
||||
|
||||
class LLStyle : public LLRefCount
|
||||
{
|
||||
public:
|
||||
LLStyle();
|
||||
LLStyle(const LLStyle &style);
|
||||
LLStyle(BOOL is_visible, const LLColor4 &color, const std::string& font_name);
|
||||
struct Params : public LLInitParam::Block<Params>
|
||||
{
|
||||
Optional<bool> visible,
|
||||
drop_shadow;
|
||||
Optional<LLUIColor> color;
|
||||
Optional<const LLFontGL*> font;
|
||||
Optional<LLUIImage*> image;
|
||||
Optional<std::string> link_href;
|
||||
Params();
|
||||
};
|
||||
LLStyle(const Params& p = Params());
|
||||
public:
|
||||
const LLColor4& getColor() const { return mColor; }
|
||||
void setColor(const LLColor4 &color) { mColor = color; }
|
||||
|
||||
LLStyle &operator=(const LLStyle &rhs);
|
||||
BOOL isVisible() const;
|
||||
void setVisible(BOOL is_visible);
|
||||
|
||||
virtual void init (BOOL is_visible, const LLColor4 &color, const std::string& font_name);
|
||||
void setFont(const LLFontGL* font);
|
||||
const LLFontGL* getFont() const;
|
||||
|
||||
virtual const LLColor4& getColor() const { return mColor; }
|
||||
virtual void setColor(const LLColor4 &color) { mColor = color; }
|
||||
const std::string& getLinkHREF() const { return mLink; }
|
||||
void setLinkHREF(const std::string& href);
|
||||
BOOL isLink() const;
|
||||
|
||||
virtual BOOL isVisible() const;
|
||||
virtual void setVisible(BOOL is_visible);
|
||||
LLUIImagePtr getImage() const;
|
||||
void setImage(const LLUUID& src);
|
||||
|
||||
virtual const std::string& getFontString() const;
|
||||
virtual void setFontName(const std::string& fontname);
|
||||
virtual LLFontGL* getFont() const;
|
||||
|
||||
virtual const std::string& getLinkHREF() const { return mLink; }
|
||||
virtual void setLinkHREF(const std::string& href);
|
||||
virtual BOOL isLink() const;
|
||||
|
||||
virtual LLUIImagePtr getImage() const;
|
||||
virtual void setImage(const LLUUID& src);
|
||||
|
||||
virtual BOOL isImage() const { return ((mImageWidth != 0) && (mImageHeight != 0)); }
|
||||
virtual void setImageSize(S32 width, S32 height);
|
||||
|
||||
BOOL getIsEmbeddedItem() const { return mIsEmbeddedItem; }
|
||||
void setIsEmbeddedItem( BOOL b ) { mIsEmbeddedItem = b; }
|
||||
BOOL isImage() const { return ((mImageWidth != 0) && (mImageHeight != 0)); }
|
||||
void setImageSize(S32 width, S32 height);
|
||||
|
||||
// inlined here to make it easier to compare to member data below. -MG
|
||||
bool operator==(const LLStyle &rhs) const
|
||||
{
|
||||
return
|
||||
mVisible == rhs.isVisible()
|
||||
&& mColor == rhs.getColor()
|
||||
&& mFontName == rhs.getFontString()
|
||||
&& mLink == rhs.getLinkHREF()
|
||||
mVisible == rhs.mVisible
|
||||
&& mColor == rhs.mColor
|
||||
&& mFont == rhs.mFont
|
||||
&& mLink == rhs.mLink
|
||||
&& mImagep == rhs.mImagep
|
||||
&& mImageHeight == rhs.mImageHeight
|
||||
&& mImageWidth == rhs.mImageWidth
|
||||
&& mItalic == rhs.mItalic
|
||||
&& mBold == rhs.mBold
|
||||
&& mUnderline == rhs.mUnderline
|
||||
&& mDropShadow == rhs.mDropShadow
|
||||
&& mIsEmbeddedItem == rhs.mIsEmbeddedItem;
|
||||
&& mDropShadow == rhs.mDropShadow;
|
||||
}
|
||||
|
||||
bool operator!=(const LLStyle& rhs) const { return !(*this == rhs); }
|
||||
|
|
@ -101,16 +101,15 @@ public:
|
|||
S32 mImageHeight;
|
||||
|
||||
protected:
|
||||
virtual ~LLStyle() { }
|
||||
~LLStyle() { }
|
||||
|
||||
private:
|
||||
BOOL mVisible;
|
||||
LLUIColor mColor;
|
||||
std::string mFontName;
|
||||
LLFontGL* mFont; // cached for performance
|
||||
const LLFontGL* mFont; // cached for performance
|
||||
std::string mLink;
|
||||
LLUIImagePtr mImagep;
|
||||
BOOL mIsEmbeddedItem;
|
||||
};
|
||||
|
||||
typedef LLPointer<LLStyle> LLStyleSP;
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ void LLTabContainer::reshape(S32 width, S32 height, BOOL called_from_parent)
|
|||
}
|
||||
|
||||
//virtual
|
||||
LLView* LLTabContainer::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const
|
||||
LLView* LLTabContainer::getChildView(const std::string& name, BOOL recurse) const
|
||||
{
|
||||
tuple_list_t::const_iterator itor;
|
||||
for (itor = mTabList.begin(); itor != mTabList.end(); ++itor)
|
||||
|
|
@ -207,14 +207,42 @@ LLView* LLTabContainer::getChildView(const std::string& name, BOOL recurse, BOOL
|
|||
for (itor = mTabList.begin(); itor != mTabList.end(); ++itor)
|
||||
{
|
||||
LLPanel *panel = (*itor)->mTabPanel;
|
||||
LLView *child = panel->getChildView(name, recurse, FALSE);
|
||||
LLView *child = panel->getChildView(name, recurse);
|
||||
if (child)
|
||||
{
|
||||
return child;
|
||||
}
|
||||
}
|
||||
}
|
||||
return LLView::getChildView(name, recurse, create_if_missing);
|
||||
return LLView::getChildView(name, recurse);
|
||||
}
|
||||
|
||||
//virtual
|
||||
LLView* LLTabContainer::findChildView(const std::string& name, BOOL recurse) const
|
||||
{
|
||||
tuple_list_t::const_iterator itor;
|
||||
for (itor = mTabList.begin(); itor != mTabList.end(); ++itor)
|
||||
{
|
||||
LLPanel *panel = (*itor)->mTabPanel;
|
||||
if (panel->getName() == name)
|
||||
{
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
|
||||
if (recurse)
|
||||
{
|
||||
for (itor = mTabList.begin(); itor != mTabList.end(); ++itor)
|
||||
{
|
||||
LLPanel *panel = (*itor)->mTabPanel;
|
||||
LLView *child = panel->findChildView(name, recurse);
|
||||
if (child)
|
||||
{
|
||||
return child;
|
||||
}
|
||||
}
|
||||
}
|
||||
return LLView::findChildView(name, recurse);
|
||||
}
|
||||
|
||||
bool LLTabContainer::addChild(LLView* view, S32 tab_group)
|
||||
|
|
@ -457,7 +485,7 @@ BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask )
|
|||
index = llclamp(index, 0, tab_count-1);
|
||||
LLButton* tab_button = getTab(index)->mButton;
|
||||
gFocusMgr.setMouseCapture(this);
|
||||
gFocusMgr.setKeyboardFocus(tab_button);
|
||||
tab_button->setFocus(TRUE);
|
||||
}
|
||||
}
|
||||
return handled;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@ public:
|
|||
/*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
EDragAndDropType type, void* cargo_data,
|
||||
EAcceptance* accept, std::string& tooltip);
|
||||
/*virtual*/ LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const;
|
||||
/*virtual*/ LLView* getChildView(const std::string& name, BOOL recurse = TRUE) const;
|
||||
/*virtual*/ LLView* findChildView(const std::string& name, BOOL recurse = TRUE) const;
|
||||
/*virtual*/ void initFromParams(const LLPanel::Params& p);
|
||||
/*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ void LLTextBox::drawText( S32 x, S32 y, const LLColor4& color )
|
|||
mHAlign, mVAlign,
|
||||
0,
|
||||
mShadowType,
|
||||
S32_MAX, getRect().getWidth(), NULL, TRUE, mUseEllipses);
|
||||
S32_MAX, getRect().getWidth(), NULL, mUseEllipses);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -402,7 +402,7 @@ void LLTextBox::drawText( S32 x, S32 y, const LLColor4& color )
|
|||
mHAlign, mVAlign,
|
||||
0,
|
||||
mShadowType,
|
||||
line_length, getRect().getWidth(), NULL, TRUE, mUseEllipses );
|
||||
line_length, getRect().getWidth(), NULL, mUseEllipses );
|
||||
cur_pos += line_length + 1;
|
||||
y -= llfloor(mFontGL->getLineHeight()) + mLineSpacing;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -53,6 +53,101 @@ class LLScrollbar;
|
|||
class LLKeywordToken;
|
||||
class LLTextCmd;
|
||||
class LLUICtrlFactory;
|
||||
class LLScrollContainer;
|
||||
|
||||
class LLTextSegment : public LLRefCount
|
||||
{
|
||||
public:
|
||||
LLTextSegment(S32 start, S32 end) : mStart(start), mEnd(end){};
|
||||
virtual ~LLTextSegment();
|
||||
|
||||
virtual S32 getWidth(S32 first_char, S32 num_chars) const;
|
||||
virtual S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const;
|
||||
virtual S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const;
|
||||
virtual void updateLayout(const class LLTextEditor& editor);
|
||||
virtual F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect);
|
||||
virtual S32 getMaxHeight() const;
|
||||
virtual bool canEdit() const;
|
||||
virtual void unlinkFromDocument(class LLTextEditor* editor);
|
||||
virtual void linkToDocument(class LLTextEditor* editor);
|
||||
|
||||
virtual void setHasMouseHover(bool hover);
|
||||
virtual const LLColor4& getColor() const;
|
||||
virtual void setColor(const LLColor4 &color);
|
||||
virtual const LLStyleSP getStyle() const;
|
||||
virtual void setStyle(const LLStyleSP &style);
|
||||
virtual void setToken( LLKeywordToken* token );
|
||||
virtual LLKeywordToken* getToken() const;
|
||||
virtual BOOL getToolTip( std::string& msg ) const;
|
||||
virtual void dump() const;
|
||||
|
||||
S32 getStart() const { return mStart; }
|
||||
void setStart(S32 start) { mStart = start; }
|
||||
S32 getEnd() const { return mEnd; }
|
||||
void setEnd( S32 end ) { mEnd = end; }
|
||||
|
||||
protected:
|
||||
S32 mStart;
|
||||
S32 mEnd;
|
||||
};
|
||||
|
||||
class LLNormalTextSegment : public LLTextSegment
|
||||
{
|
||||
public:
|
||||
LLNormalTextSegment( const LLStyleSP& style, S32 start, S32 end, LLTextEditor& editor );
|
||||
LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextEditor& editor, BOOL is_visible = TRUE);
|
||||
|
||||
/*virtual*/ S32 getWidth(S32 first_char, S32 num_chars) const;
|
||||
/*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const;
|
||||
/*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const;
|
||||
/*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect);
|
||||
/*virtual*/ S32 getMaxHeight() const;
|
||||
/*virtual*/ bool canEdit() const { return true; }
|
||||
/*virtual*/ void setHasMouseHover(bool hover) { mHasMouseHover = hover; }
|
||||
/*virtual*/ const LLColor4& getColor() const { return mStyle->getColor(); }
|
||||
/*virtual*/ void setColor(const LLColor4 &color) { mStyle->setColor(color); }
|
||||
/*virtual*/ const LLStyleSP getStyle() const { return mStyle; }
|
||||
/*virtual*/ void setStyle(const LLStyleSP &style) { mStyle = style; }
|
||||
/*virtual*/ void setToken( LLKeywordToken* token ) { mToken = token; }
|
||||
/*virtual*/ LLKeywordToken* getToken() const { return mToken; }
|
||||
/*virtual*/ BOOL getToolTip( std::string& msg ) const;
|
||||
/*virtual*/ void dump() const;
|
||||
|
||||
protected:
|
||||
F32 drawClippedSegment(S32 seg_start, S32 seg_end, S32 selection_start, S32 selection_end, F32 x, F32 y);
|
||||
|
||||
class LLTextEditor& mEditor;
|
||||
LLStyleSP mStyle;
|
||||
S32 mMaxHeight;
|
||||
LLKeywordToken* mToken;
|
||||
bool mHasMouseHover;
|
||||
};
|
||||
|
||||
typedef LLPointer<LLTextSegment> LLTextSegmentPtr;
|
||||
|
||||
class LLInlineViewSegment : public LLTextSegment
|
||||
{
|
||||
public:
|
||||
LLInlineViewSegment(LLView* widget, S32 start, S32 end);
|
||||
~LLInlineViewSegment();
|
||||
/*virtual*/ S32 getWidth(S32 first_char, S32 num_chars) const;
|
||||
/*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const;
|
||||
/*virtual*/ void updateLayout(const class LLTextEditor& editor);
|
||||
/*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect);
|
||||
/*virtuaL*/ S32 getMaxHeight() const;
|
||||
/*virtual*/ bool canEdit() const { return false; }
|
||||
/*virtual*/ void unlinkFromDocument(class LLTextEditor* editor);
|
||||
/*virtual*/ void linkToDocument(class LLTextEditor* editor);
|
||||
|
||||
private:
|
||||
LLView* mView;
|
||||
};
|
||||
|
||||
class LLIndexSegment : public LLTextSegment
|
||||
{
|
||||
public:
|
||||
LLIndexSegment(S32 pos) : LLTextSegment(pos, pos) {}
|
||||
};
|
||||
|
||||
class LLTextEditor : public LLUICtrl, LLEditMenuHandler, protected LLPreeditor
|
||||
{
|
||||
|
|
@ -64,12 +159,13 @@ public:
|
|||
|
||||
Optional<bool> read_only,
|
||||
embedded_items,
|
||||
hide_scrollbar,
|
||||
word_wrap,
|
||||
ignore_tab,
|
||||
hide_border,
|
||||
track_bottom,
|
||||
takes_non_scroll_clicks;
|
||||
handle_edit_keys_directly,
|
||||
show_line_numbers,
|
||||
commit_on_focus_lost;
|
||||
|
||||
//colors
|
||||
Optional<LLUIColor> cursor_color,
|
||||
|
|
@ -78,13 +174,15 @@ public:
|
|||
text_readonly_color,
|
||||
bg_readonly_color,
|
||||
bg_writeable_color,
|
||||
bg_focus_color;
|
||||
bg_focus_color,
|
||||
link_color;
|
||||
|
||||
Optional<LLViewBorder::Params> border;
|
||||
|
||||
Ignored type,
|
||||
length,
|
||||
is_unicode;
|
||||
is_unicode,
|
||||
hide_scrollbar;
|
||||
|
||||
Params();
|
||||
};
|
||||
|
|
@ -101,6 +199,17 @@ public:
|
|||
static const llwchar LAST_EMBEDDED_CHAR = 0x10ffff;
|
||||
static const S32 MAX_EMBEDDED_ITEMS = LAST_EMBEDDED_CHAR - FIRST_EMBEDDED_CHAR + 1;
|
||||
|
||||
|
||||
struct compare_segment_end
|
||||
{
|
||||
bool operator()(const LLTextSegmentPtr& a, const LLTextSegmentPtr& b) const
|
||||
{
|
||||
return a->getEnd() < b->getEnd();
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::multiset<LLTextSegmentPtr, compare_segment_end> segment_set_t;
|
||||
|
||||
virtual ~LLTextEditor();
|
||||
|
||||
void setParseHTML(BOOL parsing) {mParseHTML=parsing;}
|
||||
|
|
@ -110,7 +219,6 @@ 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 BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask );
|
||||
virtual BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask);
|
||||
|
||||
|
|
@ -128,14 +236,15 @@ public:
|
|||
virtual void draw();
|
||||
virtual void onFocusReceived();
|
||||
virtual void onFocusLost();
|
||||
virtual void onCommit();
|
||||
virtual void setEnabled(BOOL enabled);
|
||||
|
||||
// uictrl overrides
|
||||
virtual void onTabInto();
|
||||
virtual void clear();
|
||||
virtual void setFocus( BOOL b );
|
||||
virtual BOOL acceptsTextInput() const;
|
||||
virtual BOOL isDirty() const { return( mLastCmd != NULL || (mPristineCmd && (mPristineCmd != mLastCmd)) ); }
|
||||
virtual BOOL isDirty() const { return isPristine(); }
|
||||
virtual void setValue(const LLSD& value);
|
||||
|
||||
// LLEditMenuHandler interface
|
||||
virtual void undo();
|
||||
|
|
@ -162,9 +271,12 @@ public:
|
|||
virtual void deselect();
|
||||
virtual BOOL canDeselect() const;
|
||||
|
||||
virtual void onValueChange(S32 start, S32 end);
|
||||
|
||||
void selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE);
|
||||
BOOL replaceText(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive, BOOL wrap = TRUE);
|
||||
void replaceTextAll(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive);
|
||||
BOOL hasSelection() const { return (mSelectionStart !=mSelectionEnd); }
|
||||
|
||||
// Undo/redo stack
|
||||
void blockUndo();
|
||||
|
|
@ -173,12 +285,20 @@ public:
|
|||
virtual void makePristine();
|
||||
BOOL isPristine() const;
|
||||
BOOL allowsEmbeddedItems() const { return mAllowEmbeddedItems; }
|
||||
BOOL getWordWrap() { return mWordWrap; }
|
||||
S32 getLength() const { return getWText().length(); }
|
||||
void setReadOnly(bool read_only) { mReadOnly = read_only; }
|
||||
bool getReadOnly() { return mReadOnly; }
|
||||
|
||||
//
|
||||
// Text manipulation
|
||||
//
|
||||
|
||||
// inserts text at cursor
|
||||
void insertText(const std::string &text);
|
||||
// appends text at end
|
||||
void appendText(const std::string &wtext, bool allow_undo, bool prepend_newline,
|
||||
const LLStyleSP stylep = NULL);
|
||||
const LLStyle::Params& style = LLStyle::Params());
|
||||
|
||||
void appendColoredText(const std::string &wtext, bool allow_undo,
|
||||
bool prepend_newline,
|
||||
|
|
@ -187,19 +307,24 @@ public:
|
|||
// 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);
|
||||
const LLStyle::Params& style);
|
||||
void appendHighlightedText(const std::string &new_text, bool allow_undo,
|
||||
bool prepend_newline, S32 highlight_part,
|
||||
LLStyleSP stylep);
|
||||
|
||||
const LLStyle::Params& style);
|
||||
void appendWidget(LLView* widget, const std::string &widget_text, bool allow_undo, bool prepend_newline);
|
||||
// Non-undoable
|
||||
void setText(const LLStringExplicit &utf8str);
|
||||
void setWText(const LLWString &wtext);
|
||||
|
||||
|
||||
// Removes text from the end of document
|
||||
// Does not change highlight or cursor position.
|
||||
void removeTextFromEnd(S32 num_chars);
|
||||
|
||||
BOOL tryToRevertToPristineState();
|
||||
|
||||
void setCursor(S32 row, S32 column);
|
||||
void setCursorPos(S32 offset);
|
||||
bool setCursor(S32 row, S32 column);
|
||||
bool setCursorPos(S32 offset, bool keep_cursor_offset = false);
|
||||
void setCursorAndScrollToEnd();
|
||||
|
||||
void getLineAndColumnForPosition( S32 position, S32* line, S32* col, BOOL include_wordwrap );
|
||||
|
|
@ -214,90 +339,57 @@ public:
|
|||
LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); }
|
||||
LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); }
|
||||
|
||||
// Color support
|
||||
void setCursorColor(const LLColor4& c) { mCursorColor = c; }
|
||||
void setFgColor( const LLColor4& c ) { mFgColor = c; }
|
||||
void setTextDefaultColor( const LLColor4& c ) { mDefaultColor = c; }
|
||||
void setReadOnlyFgColor( const LLColor4& c ) { mReadOnlyFgColor = c; }
|
||||
void setWriteableBgColor( const LLColor4& c ) { mWriteableBgColor = c; }
|
||||
void setReadOnlyBgColor( const LLColor4& c ) { mReadOnlyBgColor = c; }
|
||||
void setTrackColor( const LLColor4& color );
|
||||
void setThumbColor( const LLColor4& color );
|
||||
|
||||
// Hacky methods to make it into a word-wrapping, potentially scrolling,
|
||||
// read-only text box.
|
||||
void setBorderVisible(BOOL b);
|
||||
BOOL isBorderVisible() const;
|
||||
void setTakesNonScrollClicks(BOOL b) { mTakesNonScrollClicks = b; }
|
||||
void setHideScrollbarForShortDocs(BOOL b);
|
||||
|
||||
void setWordWrap( BOOL b );
|
||||
void setTabsToNextField(BOOL b) { mTabsToNextField = b; }
|
||||
BOOL tabsToNextField() const { return mTabsToNextField; }
|
||||
void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; }
|
||||
|
||||
// Hack to handle Notecards
|
||||
virtual BOOL importBuffer(const char* buffer, S32 length );
|
||||
virtual BOOL exportBuffer(std::string& buffer );
|
||||
|
||||
// If takes focus, will take keyboard focus on click.
|
||||
void setTakesFocus(BOOL b) { mTakesFocus = b; }
|
||||
const class DocumentPanel* getDocumentPanel() const { return mDocumentPanel; }
|
||||
|
||||
void setSourceID(const LLUUID& id) { mSourceID = id; }
|
||||
const LLUUID& getSourceID() const { return mSourceID; }
|
||||
|
||||
void setHandleEditKeysDirectly( BOOL b ) { mHandleEditKeysDirectly = b; }
|
||||
|
||||
// Callbacks
|
||||
static void setLinkColor(LLColor4 color) { mLinkColor = color; }
|
||||
static void setURLCallbacks(void (*callback1) (const std::string& url),
|
||||
bool (*callback2) (const std::string& url),
|
||||
bool (*callback3) (const std::string& url) )
|
||||
{ mURLcallback = callback1; mSecondlifeURLcallback = callback2; mSecondlifeURLcallbackRightClick = callback3;}
|
||||
|
||||
void setOnScrollEndCallback(void (*callback)(void*), void* userdata);
|
||||
|
||||
// new methods
|
||||
void setValue(const LLSD& value);
|
||||
{ sURLcallback = callback1; sSecondlifeURLcallback = callback2; sSecondlifeURLcallbackRightClick = callback3;}
|
||||
|
||||
std::string getText() const;
|
||||
|
||||
// Non-undoable
|
||||
void setText(const LLStringExplicit &utf8str);
|
||||
void setWText(const LLWString &wtext);
|
||||
|
||||
// Returns byte length limit
|
||||
S32 getMaxLength() const { return mMaxTextByteLength; }
|
||||
|
||||
// Change cursor
|
||||
void startOfLine();
|
||||
void endOfLine();
|
||||
void endOfDoc();
|
||||
|
||||
BOOL isScrolledToTop();
|
||||
BOOL isScrolledToBottom();
|
||||
|
||||
// Getters
|
||||
LLWString getWText() const;
|
||||
llwchar getWChar(S32 pos) const { return getWText()[pos]; }
|
||||
LLWString getWSubString(S32 pos, S32 len) const { return getWText().substr(pos, len); }
|
||||
|
||||
const LLTextSegment* getCurrentSegment() const { return getSegmentAtOffset(mCursorPos); }
|
||||
const LLTextSegment* getPreviousSegment() const;
|
||||
void getSelectedSegments(std::vector<const LLTextSegment*>& segments) const;
|
||||
typedef std::vector<LLTextSegmentPtr> segment_vec_t;
|
||||
|
||||
static bool isPartOfWord(llwchar c) { return (c == '_') || LLStringOps::isAlnum((char)c); }
|
||||
const LLTextSegmentPtr getPreviousSegment() const;
|
||||
void getSelectedSegments(segment_vec_t& segments) const;
|
||||
|
||||
void getSegmentsInRange(segment_vec_t& segments, S32 start, S32 end, bool include_partial) const;
|
||||
LLRect getLocalRectFromDocIndex(S32 index) const;
|
||||
|
||||
void addDocumentChild(LLView* view);
|
||||
void removeDocumentChild(LLView* view);
|
||||
|
||||
protected:
|
||||
//
|
||||
// Methods
|
||||
//
|
||||
// Change cursor
|
||||
void startOfLine();
|
||||
void endOfLine();
|
||||
void startOfDoc();
|
||||
void endOfDoc();
|
||||
|
||||
S32 getLength() const { return getWText().length(); }
|
||||
void getSegmentAndOffset( S32 startpos, S32* segidxp, S32* offsetp ) const;
|
||||
void getSegmentAndOffset( S32 startpos, segment_set_t::const_iterator* seg_iter, S32* offsetp ) const;
|
||||
void getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg_iter, S32* offsetp ) ;
|
||||
void drawPreeditMarker();
|
||||
|
||||
void updateLineStartList(S32 startpos = 0);
|
||||
void needsReflow() { mReflowNeeded = TRUE; }
|
||||
void needsScroll() { mScrollNeeded = TRUE; }
|
||||
void updateCursorXPos();
|
||||
|
||||
void updateScrollFromCursor();
|
||||
void updateTextRect();
|
||||
const LLRect& getTextRect() const { return mTextRect; }
|
||||
|
|
@ -306,16 +398,16 @@ protected:
|
|||
BOOL truncate(); // Returns true if truncation occurs
|
||||
|
||||
void removeCharOrTab();
|
||||
void setCursorAtLocalPos(S32 x, S32 y, BOOL round);
|
||||
S32 getCursorPosFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const;
|
||||
void setCursorAtLocalPos(S32 x, S32 y, bool round, bool keep_cursor_offset = false);
|
||||
S32 getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const;
|
||||
|
||||
void indentSelectedLines( S32 spaces );
|
||||
S32 indentLine( S32 pos, S32 spaces );
|
||||
void unindentLineBeforeCloseBrace();
|
||||
|
||||
S32 getSegmentIdxAtOffset(S32 offset) const;
|
||||
const LLTextSegment* getSegmentAtLocalPos(S32 x, S32 y) const;
|
||||
const LLTextSegment* getSegmentAtOffset(S32 offset) const;
|
||||
LLTextSegmentPtr getSegmentAtLocalPos(S32 x, S32 y);
|
||||
segment_set_t::iterator getSegIterContaining(S32 index);
|
||||
segment_set_t::const_iterator getSegIterContaining(S32 index) const;
|
||||
|
||||
void reportBadKeystroke() { make_ui_sound("UISndBadKeystroke"); }
|
||||
|
||||
|
|
@ -325,7 +417,6 @@ protected:
|
|||
BOOL handleControlKey(const KEY key, const MASK mask);
|
||||
BOOL handleEditKey(const KEY key, const MASK mask);
|
||||
|
||||
BOOL hasSelection() const { return (mSelectionStart !=mSelectionEnd); }
|
||||
BOOL selectionContainsLineBreaks();
|
||||
void startSelection();
|
||||
void endSelection();
|
||||
|
|
@ -334,9 +425,10 @@ protected:
|
|||
S32 prevWordPos(S32 cursorPos) const;
|
||||
S32 nextWordPos(S32 cursorPos) const;
|
||||
|
||||
S32 getLineCount() const { return mLineStartList.size(); }
|
||||
S32 getLineCount() const { return mLineInfoList.size(); }
|
||||
S32 getLineStart( S32 line ) const;
|
||||
void getLineAndOffset(S32 pos, S32* linep, S32* offsetp) const;
|
||||
S32 getLineHeight( S32 line ) const;
|
||||
void getLineAndOffset(S32 pos, S32* linep, S32* offsetp, bool include_wordwrap = true) const;
|
||||
S32 getPos(S32 line, S32 offset);
|
||||
|
||||
void changePage(S32 delta);
|
||||
|
|
@ -344,13 +436,13 @@ protected:
|
|||
|
||||
void autoIndent();
|
||||
|
||||
void findEmbeddedItemSegments();
|
||||
void findEmbeddedItemSegments(S32 start, S32 end);
|
||||
void insertSegment(LLTextSegmentPtr segment_to_insert);
|
||||
|
||||
|
||||
virtual BOOL handleMouseUpOverSegment(S32 x, S32 y, MASK mask);
|
||||
|
||||
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;
|
||||
|
|
@ -361,7 +453,15 @@ protected:
|
|||
class LLTextCmd
|
||||
{
|
||||
public:
|
||||
LLTextCmd( S32 pos, BOOL group_with_next ) : mPos(pos), mGroupWithNext(group_with_next) {}
|
||||
LLTextCmd( S32 pos, BOOL group_with_next, LLTextSegmentPtr segment = LLTextSegmentPtr() )
|
||||
: mPos(pos),
|
||||
mGroupWithNext(group_with_next)
|
||||
{
|
||||
if (segment.notNull())
|
||||
{
|
||||
mSegments.push_back(segment);
|
||||
}
|
||||
}
|
||||
virtual ~LLTextCmd() {}
|
||||
virtual BOOL execute(LLTextEditor* editor, S32* delta) = 0;
|
||||
virtual S32 undo(LLTextEditor* editor) = 0;
|
||||
|
|
@ -372,16 +472,17 @@ protected:
|
|||
virtual BOOL hasExtCharValue( llwchar value ) const { return FALSE; }
|
||||
|
||||
// Defined here so they can access protected LLTextEditor editing methods
|
||||
S32 insert(LLTextEditor* editor, S32 pos, const LLWString &wstr) { return editor->insertStringNoUndo( pos, wstr ); }
|
||||
S32 insert(LLTextEditor* editor, S32 pos, const LLWString &wstr) { return editor->insertStringNoUndo( pos, wstr, &mSegments ); }
|
||||
S32 remove(LLTextEditor* editor, S32 pos, S32 length) { return editor->removeStringNoUndo( pos, length ); }
|
||||
S32 overwrite(LLTextEditor* editor, S32 pos, llwchar wc) { return editor->overwriteCharNoUndo(pos, wc); }
|
||||
|
||||
S32 getPosition() const { return mPos; }
|
||||
BOOL groupWithNext() const { return mGroupWithNext; }
|
||||
|
||||
private:
|
||||
const S32 mPos;
|
||||
BOOL mGroupWithNext;
|
||||
protected:
|
||||
const S32 mPos;
|
||||
BOOL mGroupWithNext;
|
||||
segment_vec_t mSegments;
|
||||
};
|
||||
// Here's the method that takes and applies text commands.
|
||||
S32 execute(LLTextCmd* cmd);
|
||||
|
|
@ -392,12 +493,12 @@ protected:
|
|||
S32 overwriteChar(S32 pos, llwchar wc);
|
||||
void removeChar();
|
||||
S32 removeChar(S32 pos);
|
||||
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);
|
||||
S32 insert(S32 pos, const LLWString &wstr, bool group_with_next_op, LLTextSegmentPtr segment);
|
||||
S32 remove(S32 pos, S32 length, bool group_with_next_op);
|
||||
S32 append(const LLWString &wstr, bool group_with_next_op, LLTextSegmentPtr segment);
|
||||
|
||||
// Direct operations
|
||||
S32 insertStringNoUndo(S32 pos, const LLWString &wstr); // returns num of chars actually inserted
|
||||
S32 insertStringNoUndo(S32 pos, const LLWString &wstr, segment_vec_t* segments = NULL); // returns num of chars actually inserted
|
||||
S32 removeStringNoUndo(S32 pos, S32 length);
|
||||
S32 overwriteCharNoUndo(S32 pos, llwchar wc);
|
||||
|
||||
|
|
@ -441,22 +542,38 @@ protected:
|
|||
BOOL mParseHighlights;
|
||||
std::string mHTML;
|
||||
|
||||
typedef std::vector<LLTextSegment *> segment_list_t;
|
||||
segment_list_t mSegments;
|
||||
const LLTextSegment* mHoverSegment;
|
||||
segment_set_t mSegments;
|
||||
LLTextSegmentPtr mHoverSegment;
|
||||
|
||||
// Scrollbar data
|
||||
class LLScrollbar* mScrollbar;
|
||||
BOOL mHideScrollbarForShortDocs;
|
||||
BOOL mTakesNonScrollClicks;
|
||||
void (*mOnScrollEndCallback)(void*);
|
||||
class DocumentPanel* mDocumentPanel;
|
||||
LLScrollContainer* mScroller;
|
||||
|
||||
void *mOnScrollEndData;
|
||||
|
||||
LLWString mPreeditWString;
|
||||
LLWString mPreeditOverwrittenWString;
|
||||
std::vector<S32> mPreeditPositions;
|
||||
std::vector<BOOL> mPreeditStandouts;
|
||||
|
||||
|
||||
S32 mScrollIndex; // index into document that controls default scroll position
|
||||
|
||||
protected:
|
||||
LLUIColor mCursorColor;
|
||||
LLUIColor mFgColor;
|
||||
LLUIColor mDefaultColor;
|
||||
LLUIColor mReadOnlyFgColor;
|
||||
LLUIColor mWriteableBgColor;
|
||||
LLUIColor mReadOnlyBgColor;
|
||||
LLUIColor mFocusBgColor;
|
||||
LLUIColor mLinkColor;
|
||||
|
||||
BOOL mReadOnly;
|
||||
BOOL mWordWrap;
|
||||
BOOL mShowLineNumbers;
|
||||
|
||||
void updateSegments();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
|
|
@ -465,32 +582,28 @@ private:
|
|||
void pasteHelper(bool is_primary);
|
||||
|
||||
virtual LLTextViewModel* getViewModel() const;
|
||||
|
||||
void updateSegments();
|
||||
void pruneSegments();
|
||||
void reflow(S32 startpos = 0);
|
||||
|
||||
void clearSegments();
|
||||
void createDefaultSegment();
|
||||
LLStyleSP getDefaultStyle();
|
||||
S32 getEditableIndex(S32 index, bool increasing_direction);
|
||||
|
||||
void drawBackground();
|
||||
void drawSelectionBackground();
|
||||
void drawCursor();
|
||||
void drawText();
|
||||
void drawClippedSegment(const LLWString &wtext, S32 seg_start, S32 seg_end, F32 x, F32 y, S32 selection_left, S32 selection_right, const LLStyleSP& color, F32* right_x);
|
||||
void drawLineNumbers();
|
||||
|
||||
void needsReflow()
|
||||
{
|
||||
mReflowNeeded = TRUE;
|
||||
// cursor might have moved, need to scroll
|
||||
mScrollNeeded = TRUE;
|
||||
}
|
||||
void needsScroll() { mScrollNeeded = TRUE; }
|
||||
S32 getFirstVisibleLine() const;
|
||||
|
||||
//
|
||||
// Data
|
||||
//
|
||||
LLKeywords mKeywords;
|
||||
static LLUIColor mLinkColor;
|
||||
static void (*mURLcallback) (const std::string& url);
|
||||
static bool (*mSecondlifeURLcallback) (const std::string& url);
|
||||
static bool (*mSecondlifeURLcallbackRightClick) (const std::string& url);
|
||||
static void (*sURLcallback) (const std::string& url);
|
||||
static bool (*sSecondlifeURLcallback) (const std::string& url);
|
||||
static bool (*sSecondlifeURLcallbackRightClick) (const std::string& url);
|
||||
|
||||
// Concrete LLTextCmd sub-classes used by the LLTextEditor base class
|
||||
class LLTextCmdInsert;
|
||||
|
|
@ -500,7 +613,7 @@ private:
|
|||
|
||||
S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes
|
||||
|
||||
const LLFontGL* mGLFont;
|
||||
const LLFontGL* mDefaultFont;
|
||||
|
||||
class LLViewBorder* mBorder;
|
||||
|
||||
|
|
@ -515,49 +628,35 @@ private:
|
|||
S32 mDesiredXPixel; // X pixel position where the user wants the cursor to be
|
||||
LLRect mTextRect; // The rect in which text is drawn. Excludes borders.
|
||||
// List of offsets and segment index of the start of each line. Always has at least one node (0).
|
||||
struct pred;
|
||||
struct line_info
|
||||
{
|
||||
line_info(S32 segment, S32 offset) : mSegment(segment), mOffset(offset) {}
|
||||
S32 mSegment;
|
||||
S32 mOffset;
|
||||
};
|
||||
struct line_info_compare
|
||||
{
|
||||
bool operator()(const line_info& a, const line_info& b) const
|
||||
{
|
||||
if (a.mSegment < b.mSegment)
|
||||
return true;
|
||||
else if (a.mSegment > b.mSegment)
|
||||
return false;
|
||||
else
|
||||
return a.mOffset < b.mOffset;
|
||||
}
|
||||
line_info(S32 index_start, S32 index_end, S32 top, S32 bottom, S32 line_num)
|
||||
: mDocIndexStart(index_start),
|
||||
mDocIndexEnd(index_end),
|
||||
mTop(top),
|
||||
mBottom(bottom),
|
||||
mLineNum(line_num)
|
||||
{}
|
||||
S32 mDocIndexStart;
|
||||
S32 mDocIndexEnd;
|
||||
S32 mTop;
|
||||
S32 mBottom;
|
||||
S32 mLineNum; // actual line count (ignoring soft newlines due to word wrap)
|
||||
};
|
||||
struct compare_bottom;
|
||||
struct compare_top;
|
||||
struct line_end_compare;
|
||||
typedef std::vector<line_info> line_list_t;
|
||||
line_list_t mLineStartList;
|
||||
line_list_t mLineInfoList;
|
||||
BOOL mReflowNeeded;
|
||||
BOOL mScrollNeeded;
|
||||
|
||||
LLFrameTimer mKeystrokeTimer;
|
||||
|
||||
LLUIColor mCursorColor;
|
||||
LLUIColor mFgColor;
|
||||
LLUIColor mDefaultColor;
|
||||
LLUIColor mReadOnlyFgColor;
|
||||
LLUIColor mWriteableBgColor;
|
||||
LLUIColor mReadOnlyBgColor;
|
||||
LLUIColor mFocusBgColor;
|
||||
|
||||
BOOL mReadOnly;
|
||||
BOOL mWordWrap;
|
||||
BOOL mShowLineNumbers;
|
||||
|
||||
BOOL mTabsToNextField; // if true, tab moves focus to next field, else inserts spaces
|
||||
BOOL mCommitOnFocusLost;
|
||||
BOOL mTakesFocus;
|
||||
BOOL mTrackBottom; // if true, keeps scroll position at bottom during resize
|
||||
BOOL mScrolledToBottom;
|
||||
|
||||
BOOL mAllowEmbeddedItems;
|
||||
|
||||
|
|
@ -571,47 +670,4 @@ private:
|
|||
}; // end class LLTextEditor
|
||||
|
||||
|
||||
|
||||
class LLTextSegment
|
||||
{
|
||||
public:
|
||||
// for creating a compare value
|
||||
LLTextSegment(S32 start);
|
||||
LLTextSegment( const LLStyleSP& style, S32 start, S32 end );
|
||||
LLTextSegment( const LLColor4& color, S32 start, S32 end, BOOL is_visible);
|
||||
LLTextSegment( const LLColor4& color, S32 start, S32 end );
|
||||
LLTextSegment( const LLColor3& color, S32 start, S32 end );
|
||||
|
||||
S32 getStart() const { return mStart; }
|
||||
S32 getEnd() const { return mEnd; }
|
||||
void setEnd( S32 end ) { mEnd = end; }
|
||||
const LLColor4& getColor() const { return mStyle->getColor(); }
|
||||
void setColor(const LLColor4 &color) { mStyle->setColor(color); }
|
||||
const LLStyleSP& getStyle() const { return mStyle; }
|
||||
void setStyle(const LLStyleSP &style) { mStyle = style; }
|
||||
void setIsDefault(BOOL b) { mIsDefault = b; }
|
||||
BOOL getIsDefault() const { return mIsDefault; }
|
||||
void setToken( LLKeywordToken* token ) { mToken = token; }
|
||||
LLKeywordToken* getToken() const { return mToken; }
|
||||
BOOL getToolTip( std::string& msg ) const;
|
||||
|
||||
void dump() const;
|
||||
|
||||
struct compare
|
||||
{
|
||||
bool operator()(const LLTextSegment* a, const LLTextSegment* b) const
|
||||
{
|
||||
return a->mStart < b->mStart;
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
LLStyleSP mStyle;
|
||||
S32 mStart;
|
||||
S32 mEnd;
|
||||
LLKeywordToken* mToken;
|
||||
BOOL mIsDefault;
|
||||
};
|
||||
|
||||
|
||||
#endif // LL_TEXTEDITOR_
|
||||
|
|
|
|||
|
|
@ -71,9 +71,6 @@
|
|||
//
|
||||
const LLColor4 UI_VERTEX_COLOR(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
// Used to hide the flashing text cursor when window doesn't have focus.
|
||||
BOOL gShowTextEditCursor = TRUE;
|
||||
|
||||
// Language for UI construction
|
||||
std::map<std::string, std::string> gTranslation;
|
||||
std::list<std::string> gUntranslated;
|
||||
|
|
@ -1898,6 +1895,12 @@ void LLScreenClipRect::pushClipRect(const LLRect& rect)
|
|||
{
|
||||
LLRect top = sClipRectStack.top();
|
||||
combined_clip_rect.intersectWith(top);
|
||||
|
||||
if(combined_clip_rect.isEmpty())
|
||||
{
|
||||
// avoid artifacts where zero area rects show up as lines
|
||||
combined_clip_rect = LLRect::null;
|
||||
}
|
||||
}
|
||||
sClipRectStack.push(combined_clip_rect);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,9 +151,6 @@ inline void gl_rect_2d_offset_local( const LLRect& rect, S32 pixel_offset, BOOL
|
|||
gl_rect_2d_offset_local( rect.mLeft, rect.mTop, rect.mRight, rect.mBottom, pixel_offset, filled );
|
||||
}
|
||||
|
||||
// Used to hide the flashing text cursor when window doesn't have focus.
|
||||
extern BOOL gShowTextEditCursor;
|
||||
|
||||
class LLImageProviderInterface;
|
||||
|
||||
typedef void (*LLUIAudioCallback)(const LLUUID& uuid);
|
||||
|
|
|
|||
|
|
@ -278,24 +278,46 @@ void LLUICtrl::onMouseLeave(S32 x, S32 y, MASK mask)
|
|||
{
|
||||
mMouseLeaveSignal(this, getValue());
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask){
|
||||
BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
BOOL handled = LLView::handleMouseDown(x,y,mask);
|
||||
mMouseDownSignal(this,x,y,mask);
|
||||
return handled;
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLUICtrl::handleMouseUp(S32 x, S32 y, MASK mask){
|
||||
BOOL LLUICtrl::handleMouseUp(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
BOOL handled = LLView::handleMouseUp(x,y,mask);
|
||||
mMouseUpSignal(this,x,y,mask);
|
||||
return handled;
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLUICtrl::handleRightMouseUp(S32 x, S32 y, MASK mask){
|
||||
BOOL handled = LLView::handleRightMouseUp(x,y,mask);
|
||||
mRightClickSignal(this,x,y,mask);
|
||||
BOOL LLUICtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
BOOL handled = LLView::handleRightMouseDown(x,y,mask);
|
||||
mRightMouseDownSignal(this,x,y,mask);
|
||||
return handled;
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLUICtrl::handleRightMouseUp(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
BOOL handled = LLView::handleRightMouseUp(x,y,mask);
|
||||
mRightMouseUpSignal(this,x,y,mask);
|
||||
return handled;
|
||||
}
|
||||
|
||||
// can't tab to children of a non-tab-stop widget
|
||||
BOOL LLUICtrl::canFocusChildren() const
|
||||
{
|
||||
return hasTabStop();
|
||||
}
|
||||
|
||||
|
||||
void LLUICtrl::onCommit()
|
||||
{
|
||||
mCommitSignal(this, getValue());
|
||||
|
|
|
|||
|
|
@ -186,8 +186,10 @@ public:
|
|||
/*virtual*/ BOOL getTentative() 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);
|
||||
|
||||
// From LLFocusableElement
|
||||
|
|
@ -258,7 +260,8 @@ public:
|
|||
|
||||
boost::signals2::connection setMouseDownCallback( const mouse_signal_t::slot_type& cb ) { return mMouseDownSignal.connect(cb); }
|
||||
boost::signals2::connection setMouseUpCallback( const mouse_signal_t::slot_type& cb ) { return mMouseUpSignal.connect(cb); }
|
||||
boost::signals2::connection setRightClickedCallback( const mouse_signal_t::slot_type& cb ) { return mRightClickSignal.connect(cb); }
|
||||
boost::signals2::connection setRightMouseDownCallback( const mouse_signal_t::slot_type& cb ) { return mRightMouseDownSignal.connect(cb); }
|
||||
boost::signals2::connection setRightMouseUpCallback( const mouse_signal_t::slot_type& cb ) { return mRightMouseUpSignal.connect(cb); }
|
||||
|
||||
// *TODO: Deprecate; for backwards compatability only:
|
||||
boost::signals2::connection setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data);
|
||||
|
|
@ -292,7 +295,8 @@ protected:
|
|||
|
||||
mouse_signal_t mMouseDownSignal;
|
||||
mouse_signal_t mMouseUpSignal;
|
||||
mouse_signal_t mRightClickSignal;
|
||||
mouse_signal_t mRightMouseDownSignal;
|
||||
mouse_signal_t mRightMouseUpSignal;
|
||||
|
||||
LLViewModelPtr mViewModel;
|
||||
|
||||
|
|
|
|||
|
|
@ -45,31 +45,7 @@
|
|||
#include "llquaternion.h"
|
||||
|
||||
// this library includes
|
||||
#include "llbutton.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
//#include "llcolorswatch.h"
|
||||
#include "llcombobox.h"
|
||||
#include "llcontrol.h"
|
||||
#include "lldir.h"
|
||||
#include "llevent.h"
|
||||
#include "llfloater.h"
|
||||
#include "lliconctrl.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "llmenugl.h"
|
||||
#include "llradiogroup.h"
|
||||
#include "llscrollcontainer.h"
|
||||
#include "llscrollingpanellist.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "llslider.h"
|
||||
#include "llsliderctrl.h"
|
||||
#include "llmultislider.h"
|
||||
#include "llmultisliderctrl.h"
|
||||
#include "llspinctrl.h"
|
||||
#include "lltabcontainer.h"
|
||||
#include "lltextbox.h"
|
||||
#include "lltexteditor.h"
|
||||
#include "llui.h"
|
||||
#include "llviewborder.h"
|
||||
|
||||
LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction");
|
||||
LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams");
|
||||
|
|
@ -149,7 +125,7 @@ void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const wid
|
|||
|
||||
}
|
||||
|
||||
LLFastTimer::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing");
|
||||
static LLFastTimer::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing");
|
||||
//-----------------------------------------------------------------------------
|
||||
// getLayeredXMLNode()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -177,14 +153,14 @@ bool LLUICtrlFactory::getLocalizedXMLNode(const std::string &xui_filename, LLXML
|
|||
}
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer BUILD_FLOATERS("Build Floaters");
|
||||
static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters");
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// buildFloater()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filename, LLXMLNodePtr output_node)
|
||||
{
|
||||
LLFastTimer timer(BUILD_FLOATERS);
|
||||
LLFastTimer timer(FTM_BUILD_FLOATERS);
|
||||
LLXMLNodePtr root;
|
||||
|
||||
//if exporting, only load the language being exported,
|
||||
|
|
@ -248,14 +224,14 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer BUILD_PANELS("Build Panels");
|
||||
static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels");
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// buildPanel()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, LLXMLNodePtr output_node)
|
||||
{
|
||||
LLFastTimer timer(BUILD_PANELS);
|
||||
LLFastTimer timer(FTM_BUILD_PANELS);
|
||||
BOOL didPost = FALSE;
|
||||
LLXMLNodePtr root;
|
||||
|
||||
|
|
@ -317,7 +293,7 @@ BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, L
|
|||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
LLFastTimer::DeclareTimer FTM_CREATE_FROM_XML("Create child widget");
|
||||
static LLFastTimer::DeclareTimer FTM_CREATE_FROM_XML("Create child widget");
|
||||
|
||||
LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t& registry, LLXMLNodePtr output_node)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1300,6 +1300,11 @@ LLView* LLView::childrenHandleMiddleMouseUp(S32 x, S32 y, MASK mask)
|
|||
}
|
||||
|
||||
void LLView::draw()
|
||||
{
|
||||
drawChildren();
|
||||
}
|
||||
|
||||
void LLView::drawChildren()
|
||||
{
|
||||
if (sDebugRects)
|
||||
{
|
||||
|
|
@ -1329,7 +1334,7 @@ void LLView::draw()
|
|||
{
|
||||
// Only draw views that are within the root view
|
||||
localRectToScreen(viewp->getRect(),&screenRect);
|
||||
if ( rootRect.rectInRect(&screenRect) )
|
||||
if ( rootRect.overlaps(screenRect) )
|
||||
{
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
LLUI::pushMatrix();
|
||||
|
|
@ -1540,7 +1545,7 @@ void LLView::updateBoundingRect()
|
|||
|
||||
LLRect child_bounding_rect = childp->getBoundingRect();
|
||||
|
||||
if (local_bounding_rect.isNull())
|
||||
if (local_bounding_rect.isEmpty())
|
||||
{
|
||||
// start out with bounding rect equal to first visible child's bounding rect
|
||||
local_bounding_rect = child_bounding_rect;
|
||||
|
|
@ -1548,7 +1553,7 @@ void LLView::updateBoundingRect()
|
|||
else
|
||||
{
|
||||
// accumulate non-null children rectangles
|
||||
if (!child_bounding_rect.isNull())
|
||||
if (!child_bounding_rect.isEmpty())
|
||||
{
|
||||
local_bounding_rect.unionWith(child_bounding_rect);
|
||||
}
|
||||
|
|
@ -1639,7 +1644,7 @@ BOOL LLView::hasAncestor(const LLView* parentp) const
|
|||
|
||||
BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const
|
||||
{
|
||||
LLView *child = getChildView(childname, TRUE, FALSE);
|
||||
LLView *child = findChildView(childname, TRUE);
|
||||
if (child)
|
||||
{
|
||||
return gFocusMgr.childHasKeyboardFocus(child);
|
||||
|
|
@ -1654,13 +1659,27 @@ BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const
|
|||
|
||||
BOOL LLView::hasChild(const std::string& childname, BOOL recurse) const
|
||||
{
|
||||
return getChildView(childname, recurse, FALSE) != NULL;
|
||||
return findChildView(childname, recurse) != NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// getChildView()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLView* LLView::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const
|
||||
LLView* LLView::getChildView(const std::string& name, BOOL recurse) const
|
||||
{
|
||||
LLView* child = findChildView(name, recurse);
|
||||
if (!child)
|
||||
{
|
||||
child = getDefaultWidget<LLView>(name);
|
||||
if (!child)
|
||||
{
|
||||
child = LLUICtrlFactory::createDefaultWidget<LLView>(name);
|
||||
}
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
||||
LLView* LLView::findChildView(const std::string& name, BOOL recurse) const
|
||||
{
|
||||
//richard: should we allow empty names?
|
||||
//if(name.empty())
|
||||
|
|
@ -1681,23 +1700,13 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse, BOOL create_
|
|||
for ( child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it)
|
||||
{
|
||||
LLView* childp = *child_it;
|
||||
LLView* viewp = childp->getChildView(name, recurse, FALSE);
|
||||
LLView* viewp = childp->findChildView(name, recurse);
|
||||
if ( viewp )
|
||||
{
|
||||
return viewp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (create_if_missing)
|
||||
{
|
||||
LLView* view = getDefaultWidget<LLView>(name);
|
||||
if (!view)
|
||||
{
|
||||
view = LLUICtrlFactory::createDefaultWidget<LLView>(name);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -213,6 +213,9 @@ protected:
|
|||
LLView(const LLView::Params&);
|
||||
friend class LLUICtrlFactory;
|
||||
|
||||
private:
|
||||
// widgets in general are not copyable
|
||||
LLView(const LLView& other) {};
|
||||
public:
|
||||
#if LL_DEBUG
|
||||
static BOOL sIsDrawing;
|
||||
|
|
@ -421,6 +424,7 @@ public:
|
|||
virtual std::string getShowNamesToolTip();
|
||||
|
||||
virtual void draw();
|
||||
void drawChildren();
|
||||
|
||||
void parseFollowsFlags(const LLView::Params& params);
|
||||
|
||||
|
|
@ -484,19 +488,20 @@ public:
|
|||
|
||||
template <class T> T* findChild(const std::string& name, BOOL recurse = TRUE) const
|
||||
{
|
||||
LLView* child = getChildView(name, recurse, FALSE);
|
||||
LLView* child = findChildView(name, recurse);
|
||||
T* result = dynamic_cast<T*>(child);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class T> T* getChild(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const;
|
||||
template <class T> T* getChild(const std::string& name, BOOL recurse = TRUE) const;
|
||||
|
||||
template <class T> T& getChildRef(const std::string& name, BOOL recurse = TRUE) const
|
||||
{
|
||||
return *getChild<T>(name, recurse, TRUE);
|
||||
return *getChild<T>(name, recurse);
|
||||
}
|
||||
|
||||
virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const;
|
||||
virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE) const;
|
||||
virtual LLView* findChildView(const std::string& name, BOOL recurse = TRUE) const;
|
||||
|
||||
template <class T> T* getDefaultWidget(const std::string& name) const
|
||||
{
|
||||
|
|
@ -636,9 +641,9 @@ private:
|
|||
LLView::child_tab_order_t mTabOrder;
|
||||
};
|
||||
|
||||
template <class T> T* LLView::getChild(const std::string& name, BOOL recurse, BOOL create_if_missing) const
|
||||
template <class T> T* LLView::getChild(const std::string& name, BOOL recurse) const
|
||||
{
|
||||
LLView* child = getChildView(name, recurse, FALSE);
|
||||
LLView* child = findChildView(name, recurse);
|
||||
T* result = dynamic_cast<T*>(child);
|
||||
if (!result)
|
||||
{
|
||||
|
|
@ -647,28 +652,25 @@ template <class T> T* LLView::getChild(const std::string& name, BOOL recurse, BO
|
|||
{
|
||||
llwarns << "Found child named " << name << " but of wrong type " << typeid(child).name() << ", expecting " << typeid(T*).name() << llendl;
|
||||
}
|
||||
if (create_if_missing)
|
||||
result = getDefaultWidget<T>(name);
|
||||
if (!result)
|
||||
{
|
||||
result = getDefaultWidget<T>(name);
|
||||
if (!result)
|
||||
result = LLUICtrlFactory::getDefaultWidget<T>(name);
|
||||
|
||||
if (result)
|
||||
{
|
||||
result = LLUICtrlFactory::getDefaultWidget<T>(name);
|
||||
|
||||
if (result)
|
||||
{
|
||||
// *NOTE: You cannot call mFoo = getChild<LLFoo>("bar")
|
||||
// in a floater or panel constructor. The widgets will not
|
||||
// be ready. Instead, put it in postBuild().
|
||||
llwarns << "Making dummy " << typeid(T).name() << " named \"" << name << "\" in " << getName() << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Failed to create dummy " << typeid(T).name() << llendl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
getDefaultWidgetMap()[name] = result;
|
||||
// *NOTE: You cannot call mFoo = getChild<LLFoo>("bar")
|
||||
// in a floater or panel constructor. The widgets will not
|
||||
// be ready. Instead, put it in postBuild().
|
||||
llwarns << "Making dummy " << typeid(T).name() << " named \"" << name << "\" in " << getName() << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Failed to create dummy " << typeid(T).name() << llendl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
getDefaultWidgetMap()[name] = result;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -134,9 +134,7 @@ void LLViewBorder::draw()
|
|||
}
|
||||
}
|
||||
|
||||
// draw the children
|
||||
LLView::draw();
|
||||
|
||||
drawChildren();
|
||||
}
|
||||
|
||||
void LLViewBorder::drawOnePixelLines()
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ const S32 LLVFile::WRITE = 0x00000002;
|
|||
const S32 LLVFile::READ_WRITE = 0x00000003; // LLVFile::READ & LLVFile::WRITE
|
||||
const S32 LLVFile::APPEND = 0x00000006; // 0x00000004 & LLVFile::WRITE
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_VFILE_WAIT("VFile Wait");
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
LLVFSThread* LLVFile::sVFSThread = NULL;
|
||||
BOOL LLVFile::sAllocdVFSThread = FALSE;
|
||||
|
|
@ -318,7 +320,7 @@ BOOL LLVFile::setMaxSize(S32 size)
|
|||
|
||||
if (!mVFS->checkAvailable(size))
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_VFILE_WAIT);
|
||||
LLFastTimer t(FTM_VFILE_WAIT);
|
||||
S32 count = 0;
|
||||
while (sVFSThread->getPending() > 1000)
|
||||
{
|
||||
|
|
@ -426,7 +428,7 @@ bool LLVFile::isLocked(EVFSLock lock)
|
|||
|
||||
void LLVFile::waitForLock(EVFSLock lock)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_VFILE_WAIT);
|
||||
LLFastTimer t(FTM_VFILE_WAIT);
|
||||
// spin until the lock clears
|
||||
while (isLocked(lock))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1645,6 +1645,9 @@ void LLWindowWin32::gatherInput()
|
|||
mMousePositionModified = FALSE;
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_KEYHANDLER("Handle Keyboard");
|
||||
static LLFastTimer::DeclareTimer FTM_MOUSEHANDLER("Handle Mouse");
|
||||
|
||||
LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_param, LPARAM l_param)
|
||||
{
|
||||
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(h_wnd, GWL_USERDATA);
|
||||
|
|
@ -1878,7 +1881,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
case WM_KEYUP:
|
||||
{
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KEYUP");
|
||||
LLFastTimer t2(LLFastTimer::FTM_KEYHANDLER);
|
||||
LLFastTimer t2(FTM_KEYHANDLER);
|
||||
|
||||
if (gDebugWindowProc)
|
||||
{
|
||||
|
|
@ -1987,7 +1990,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
case WM_LBUTTONDOWN:
|
||||
{
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONDOWN");
|
||||
LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
|
||||
LLFastTimer t2(FTM_MOUSEHANDLER);
|
||||
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
|
||||
{
|
||||
window_imp->interruptLanguageTextInput();
|
||||
|
|
@ -2051,7 +2054,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
case WM_LBUTTONUP:
|
||||
{
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONUP");
|
||||
LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
|
||||
LLFastTimer t2(FTM_MOUSEHANDLER);
|
||||
//if (gDebugClicks)
|
||||
//{
|
||||
// LL_INFOS("Window") << "WndProc left button up" << LL_ENDL;
|
||||
|
|
@ -2085,7 +2088,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
case WM_RBUTTONDOWN:
|
||||
{
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_RBUTTONDOWN");
|
||||
LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
|
||||
LLFastTimer t2(FTM_MOUSEHANDLER);
|
||||
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
|
||||
{
|
||||
window_imp->interruptLanguageTextInput();
|
||||
|
|
@ -2119,7 +2122,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
case WM_RBUTTONUP:
|
||||
{
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_RBUTTONUP");
|
||||
LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
|
||||
LLFastTimer t2(FTM_MOUSEHANDLER);
|
||||
// Because we move the cursor position in the app, we need to query
|
||||
// to find out where the cursor at the time the event is handled.
|
||||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
|
|
@ -2149,7 +2152,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
// case WM_MBUTTONDBLCLK:
|
||||
{
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONDOWN");
|
||||
LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
|
||||
LLFastTimer t2(FTM_MOUSEHANDLER);
|
||||
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
|
||||
{
|
||||
window_imp->interruptLanguageTextInput();
|
||||
|
|
@ -2183,7 +2186,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
case WM_MBUTTONUP:
|
||||
{
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONUP");
|
||||
LLFastTimer t2(LLFastTimer::FTM_MOUSEHANDLER);
|
||||
LLFastTimer t2(FTM_MOUSEHANDLER);
|
||||
// Because we move the cursor position in tllviewerhe app, we need to query
|
||||
// to find out where the cursor at the time the event is handled.
|
||||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ typedef enum e_control_type
|
|||
TYPE_COUNT
|
||||
} eControlType;
|
||||
|
||||
class LLControlVariable : public LLRefCount, boost::noncopyable
|
||||
class LLControlVariable : public LLRefCount
|
||||
{
|
||||
friend class LLControlGroup;
|
||||
|
||||
|
|
|
|||
|
|
@ -430,6 +430,7 @@ namespace LLInitParam
|
|||
|
||||
const Param* getLastChangedParam() const { return mLastChangedParam ? getParamFromHandle(mLastChangedParam) : NULL; }
|
||||
S32 getLastChangeVersion() const { return mChangeVersion; }
|
||||
bool isDefault() const { return mChangeVersion == 0; }
|
||||
|
||||
bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack);
|
||||
bool serializeBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), const BaseBlock* diff_block = NULL) const;
|
||||
|
|
|
|||
|
|
@ -169,3 +169,28 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::
|
|||
}
|
||||
}
|
||||
|
||||
//static
|
||||
bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args)
|
||||
{
|
||||
LLFastTimer timer(FTM_GET_TRANS);
|
||||
|
||||
template_map_t::iterator iter = sStringTemplates.find(xml_desc);
|
||||
if (iter != sStringTemplates.end())
|
||||
{
|
||||
std::string text = iter->second.mText;
|
||||
LLStringUtil::format_map_t args = sDefaultArgs;
|
||||
args.insert(msg_args.begin(), msg_args.end());
|
||||
LLStringUtil::format(text, args);
|
||||
result = text;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSD args;
|
||||
args["STRING_NAME"] = xml_desc;
|
||||
LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL;
|
||||
//LLNotifications::instance().add("MissingString", args);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ public:
|
|||
* @returns Translated string
|
||||
*/
|
||||
static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args);
|
||||
static bool findString(std::string &result, const std::string &xml_desc, const LLStringUtil::format_map_t& args);
|
||||
|
||||
/**
|
||||
* @brief Returns a translated string
|
||||
|
|
@ -89,7 +90,14 @@ public:
|
|||
LLStringUtil::format_map_t empty;
|
||||
return getString(xml_desc, empty);
|
||||
}
|
||||
|
||||
|
||||
static bool findString(std::string &result, const std::string &xml_desc)
|
||||
{
|
||||
LLStringUtil::format_map_t empty;
|
||||
return findString(result, xml_desc, empty);
|
||||
}
|
||||
|
||||
|
||||
// get the default args
|
||||
static const LLStringUtil::format_map_t& getDefaultArgs()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -399,11 +399,11 @@ LLXUIParser::LLXUIParser()
|
|||
boost::bind(&LLXUIParser::writeSDValue, this, _1, _2));
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer PARSE_XUI("XUI Parsing");
|
||||
static LLFastTimer::DeclareTimer FTM_PARSE_XUI("XUI Parsing");
|
||||
|
||||
void LLXUIParser::readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, bool silent)
|
||||
{
|
||||
LLFastTimer timer(PARSE_XUI);
|
||||
LLFastTimer timer(FTM_PARSE_XUI);
|
||||
mNameStack.clear();
|
||||
mCurReadDepth = 0;
|
||||
setParseSilently(silent);
|
||||
|
|
|
|||
|
|
@ -4280,7 +4280,6 @@ BOOL run_calllib(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
|
|||
}
|
||||
|
||||
{
|
||||
// LLFastTimer time_in_libraries1(LLFastTimer::FTM_TEMP7);
|
||||
gScriptLibrary.mFunctions[arg]->mExecFunc(returnvalue, arguments, id);
|
||||
}
|
||||
add_register_fp(buffer, LREG_ESR, -gScriptLibrary.mFunctions[arg]->mEnergyUse);
|
||||
|
|
@ -4351,7 +4350,6 @@ BOOL run_calllib_two_byte(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &i
|
|||
}
|
||||
|
||||
{
|
||||
// LLFastTimer time_in_libraries2(LLFastTimer::FTM_TEMP8);
|
||||
gScriptLibrary.mFunctions[arg]->mExecFunc(returnvalue, arguments, id);
|
||||
}
|
||||
add_register_fp(buffer, LREG_ESR, -gScriptLibrary.mFunctions[arg]->mEnergyUse);
|
||||
|
|
|
|||
|
|
@ -290,9 +290,9 @@ static std::set<std::string> default_trans_args;
|
|||
void init_default_trans_args()
|
||||
{
|
||||
default_trans_args.insert("SECOND_LIFE"); // World
|
||||
default_trans_args.insert("SECOND_LIFE_VIEWER");
|
||||
default_trans_args.insert("APP_NAME");
|
||||
default_trans_args.insert("SECOND_LIFE_GRID");
|
||||
default_trans_args.insert("SECOND_LIFE_SUPPORT");
|
||||
default_trans_args.insert("SUPPORT_SITE");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
@ -863,6 +863,11 @@ bool LLAppViewer::init()
|
|||
return true;
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_MESSAGES("System Messages");
|
||||
static LLFastTimer::DeclareTimer FTM_SLEEP("Sleep");
|
||||
static LLFastTimer::DeclareTimer FTM_IDLE("Idle");
|
||||
static LLFastTimer::DeclareTimer FTM_PUMP("Pump");
|
||||
|
||||
bool LLAppViewer::mainLoop()
|
||||
{
|
||||
LLMemType mt1(LLMemType::MTYPE_MAIN);
|
||||
|
|
@ -905,7 +910,7 @@ bool LLAppViewer::mainLoop()
|
|||
|
||||
if (gViewerWindow)
|
||||
{
|
||||
LLFastTimer t2(LLFastTimer::FTM_MESSAGES);
|
||||
LLFastTimer t2(FTM_MESSAGES);
|
||||
gViewerWindow->mWindow->processMiscNativeEvents();
|
||||
}
|
||||
|
||||
|
|
@ -913,7 +918,7 @@ bool LLAppViewer::mainLoop()
|
|||
|
||||
if (gViewerWindow)
|
||||
{
|
||||
LLFastTimer t2(LLFastTimer::FTM_MESSAGES);
|
||||
LLFastTimer t2(FTM_MESSAGES);
|
||||
if (!restoreErrorTrap())
|
||||
{
|
||||
llwarns << " Someone took over my signal/exception handler (post messagehandling)!" << llendl;
|
||||
|
|
@ -963,14 +968,14 @@ bool LLAppViewer::mainLoop()
|
|||
{
|
||||
pauseMainloopTimeout(); // *TODO: Remove. Messages shouldn't be stalling for 20+ seconds!
|
||||
|
||||
LLFastTimer t3(LLFastTimer::FTM_IDLE);
|
||||
LLFastTimer t3(FTM_IDLE);
|
||||
idle();
|
||||
|
||||
if (gAres != NULL && gAres->isInitialized())
|
||||
{
|
||||
LLMemType mt_ip(LLMemType::MTYPE_IDLE_PUMP);
|
||||
pingMainloopTimeout("Main:ServicePump");
|
||||
LLFastTimer t4(LLFastTimer::FTM_PUMP);
|
||||
LLFastTimer t4(FTM_PUMP);
|
||||
gAres->process();
|
||||
// this pump is necessary to make the login screen show up
|
||||
gServicePump->pump();
|
||||
|
|
@ -1007,7 +1012,7 @@ bool LLAppViewer::mainLoop()
|
|||
// Sleep and run background threads
|
||||
{
|
||||
LLMemType mt_sleep(LLMemType::MTYPE_SLEEP);
|
||||
LLFastTimer t2(LLFastTimer::FTM_SLEEP);
|
||||
LLFastTimer t2(FTM_SLEEP);
|
||||
bool run_multiple_threads = gSavedSettings.getBOOL("RunMultipleThreads");
|
||||
|
||||
// yield some time to the os based on command line option
|
||||
|
|
@ -2025,7 +2030,7 @@ bool LLAppViewer::initConfiguration()
|
|||
|
||||
#if LL_DARWIN
|
||||
// Initialize apple menubar and various callbacks
|
||||
init_apple_menu(LLTrans::getString("SECOND_LIFE_VIEWER").c_str());
|
||||
init_apple_menu(LLTrans::getString("APP_NAME").c_str());
|
||||
|
||||
#if __ppc__
|
||||
// If the CPU doesn't have Altivec (i.e. it's not at least a G4), don't go any further.
|
||||
|
|
@ -2064,7 +2069,7 @@ bool LLAppViewer::initConfiguration()
|
|||
//
|
||||
// Set the name of the window
|
||||
//
|
||||
gWindowTitle = LLTrans::getString("SECOND_LIFE_VIEWER");
|
||||
gWindowTitle = LLTrans::getString("APP_NAME");
|
||||
#if LL_DEBUG
|
||||
gWindowTitle += std::string(" [DEBUG] ") + gArgs;
|
||||
#else
|
||||
|
|
@ -2181,7 +2186,7 @@ void LLAppViewer::checkForCrash(void)
|
|||
{
|
||||
std::ostringstream msg;
|
||||
msg << LLTrans::getString("MBFrozenCrashed");
|
||||
std::string alert = LLTrans::getString("SECOND_LIFE_VIEWER") + " " + LLTrans::getString("MBAlert");
|
||||
std::string alert = LLTrans::getString("APP_NAME") + " " + LLTrans::getString("MBAlert");
|
||||
choice = OSMessageBox(msg.str(),
|
||||
alert,
|
||||
OSMB_YESNO);
|
||||
|
|
@ -2391,7 +2396,7 @@ void LLAppViewer::writeSystemInfo()
|
|||
gDebugInfo["CrashNotHandled"] = (LLSD::Boolean)true;
|
||||
|
||||
// Dump some debugging info
|
||||
LL_INFOS("SystemInfo") << LLTrans::getString("SECOND_LIFE_VIEWER")
|
||||
LL_INFOS("SystemInfo") << LLTrans::getString("APP_NAME")
|
||||
<< " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH
|
||||
<< LL_ENDL;
|
||||
|
||||
|
|
@ -3069,7 +3074,7 @@ void LLAppViewer::purgeCache()
|
|||
|
||||
std::string LLAppViewer::getSecondLifeTitle() const
|
||||
{
|
||||
return LLTrans::getString("SECOND_LIFE_VIEWER");
|
||||
return LLTrans::getString("APP_NAME");
|
||||
}
|
||||
|
||||
std::string LLAppViewer::getWindowTitle() const
|
||||
|
|
@ -3234,6 +3239,15 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_AUDIO_UPDATE("Update Audio");
|
||||
static LLFastTimer::DeclareTimer FTM_CLEANUP("Cleanup");
|
||||
static LLFastTimer::DeclareTimer FTM_IDLE_CB("Idle Callbacks");
|
||||
static LLFastTimer::DeclareTimer FTM_LOD_UPDATE("Update LOD");
|
||||
static LLFastTimer::DeclareTimer FTM_OBJECTLIST_UPDATE("Update Objectlist");
|
||||
static LLFastTimer::DeclareTimer FTM_REGION_UPDATE("Update Region");
|
||||
static LLFastTimer::DeclareTimer FTM_WORLD_UPDATE("Update World");
|
||||
static LLFastTimer::DeclareTimer FTM_NETWORK("Network");
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
// idle()
|
||||
//
|
||||
|
|
@ -3300,7 +3314,7 @@ void LLAppViewer::idle()
|
|||
|
||||
if (!gDisconnected)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_NETWORK);
|
||||
LLFastTimer t(FTM_NETWORK);
|
||||
// Update spaceserver timeinfo
|
||||
LLWorld::getInstance()->setSpaceTimeUSec(LLWorld::getInstance()->getSpaceTimeUSec() + (U32)(dt_raw * SEC_TO_MICROSEC));
|
||||
|
||||
|
|
@ -3381,7 +3395,7 @@ void LLAppViewer::idle()
|
|||
|
||||
if (!gDisconnected)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_NETWORK);
|
||||
LLFastTimer t(FTM_NETWORK);
|
||||
|
||||
////////////////////////////////////////////////
|
||||
//
|
||||
|
|
@ -3410,7 +3424,7 @@ void LLAppViewer::idle()
|
|||
//
|
||||
|
||||
{
|
||||
// LLFastTimer t(LLFastTimer::FTM_IDLE_CB);
|
||||
// LLFastTimer t(FTM_IDLE_CB);
|
||||
|
||||
// Do event notifications if necessary. Yes, we may want to move this elsewhere.
|
||||
gEventNotifier.update();
|
||||
|
|
@ -3445,7 +3459,7 @@ void LLAppViewer::idle()
|
|||
}
|
||||
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_OBJECTLIST_UPDATE); // Actually "object update"
|
||||
LLFastTimer t(FTM_OBJECTLIST_UPDATE); // Actually "object update"
|
||||
|
||||
if (!(logoutRequestSent() && hasSavedFinalSnapshot()))
|
||||
{
|
||||
|
|
@ -3460,7 +3474,7 @@ void LLAppViewer::idle()
|
|||
//
|
||||
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_CLEANUP);
|
||||
LLFastTimer t(FTM_CLEANUP);
|
||||
gObjectList.cleanDeadObjects();
|
||||
LLDrawable::cleanupDeadDrawables();
|
||||
}
|
||||
|
|
@ -3492,7 +3506,7 @@ void LLAppViewer::idle()
|
|||
//
|
||||
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_NETWORK);
|
||||
LLFastTimer t(FTM_NETWORK);
|
||||
gVLManager.unpackData();
|
||||
}
|
||||
|
||||
|
|
@ -3504,7 +3518,7 @@ void LLAppViewer::idle()
|
|||
LLWorld::getInstance()->updateVisibilities();
|
||||
{
|
||||
const F32 max_region_update_time = .001f; // 1ms
|
||||
LLFastTimer t(LLFastTimer::FTM_REGION_UPDATE);
|
||||
LLFastTimer t(FTM_REGION_UPDATE);
|
||||
LLWorld::getInstance()->updateRegions(max_region_update_time);
|
||||
}
|
||||
|
||||
|
|
@ -3551,7 +3565,7 @@ void LLAppViewer::idle()
|
|||
|
||||
if (!gNoRender)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_WORLD_UPDATE);
|
||||
LLFastTimer t(FTM_WORLD_UPDATE);
|
||||
gPipeline.updateMove();
|
||||
|
||||
LLWorld::getInstance()->updateParticles();
|
||||
|
|
@ -3574,12 +3588,12 @@ void LLAppViewer::idle()
|
|||
|
||||
// objects and camera should be in sync, do LOD calculations now
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_LOD_UPDATE);
|
||||
LLFastTimer t(FTM_LOD_UPDATE);
|
||||
gObjectList.updateApparentAngles(gAgent);
|
||||
}
|
||||
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_AUDIO_UPDATE);
|
||||
LLFastTimer t(FTM_AUDIO_UPDATE);
|
||||
|
||||
if (gAudiop)
|
||||
{
|
||||
|
|
@ -3719,6 +3733,8 @@ void LLAppViewer::sendLogoutRequest()
|
|||
static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME;
|
||||
#endif
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_IDLE_NETWORK("Network");
|
||||
|
||||
void LLAppViewer::idleNetwork()
|
||||
{
|
||||
LLMemType mt_in(LLMemType::MTYPE_IDLE_NETWORK);
|
||||
|
|
@ -3731,7 +3747,7 @@ void LLAppViewer::idleNetwork()
|
|||
|
||||
if (!gSavedSettings.getBOOL("SpeedTest"))
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_IDLE_NETWORK); // decode
|
||||
LLFastTimer t(FTM_IDLE_NETWORK); // decode
|
||||
|
||||
// deal with any queued name requests and replies.
|
||||
gCacheName->processPending();
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ BOOL LLAvatarList::update(const std::vector<LLUUID>& all_buddies, const std::str
|
|||
// Changed item in place, need to request sort and update columns
|
||||
// because we might have changed data in a column on which the user
|
||||
// has already sorted. JC
|
||||
sortItems();
|
||||
updateSort();
|
||||
|
||||
// re-select items
|
||||
selectMultiple(selected_ids);
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ void LLBottomTray::setVisible(BOOL visible)
|
|||
{
|
||||
LLPanel::setVisible(visible);
|
||||
|
||||
// *NOTE: we must check mToolbarStack against NULL because sewtVisible is called from the
|
||||
// *NOTE: we must check mToolbarStack against NULL because setVisible is called from the
|
||||
// LLPanel::initFromParams BEFORE postBuild is called and child controls are not exist yet
|
||||
if (NULL != mToolbarStack)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -103,10 +103,6 @@ LLChatBar::LLChatBar()
|
|||
mObserver(NULL)
|
||||
{
|
||||
setIsChrome(TRUE);
|
||||
|
||||
#if !LL_RELEASE_FOR_DOWNLOAD
|
||||
childDisplayNotFound();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -125,7 +121,7 @@ BOOL LLChatBar::postBuild()
|
|||
// * NOTE: mantipov: getChild with default parameters returns dummy widget.
|
||||
// Seems this class will be completle removed
|
||||
// attempt to bind to an existing combo box named gesture
|
||||
setGestureCombo(getChild<LLComboBox>( "Gesture", TRUE, FALSE));
|
||||
setGestureCombo(findChild<LLComboBox>( "Gesture"));
|
||||
|
||||
mInputEditor = getChild<LLLineEditor>("Chat Editor");
|
||||
mInputEditor->setKeystrokeCallback(&onInputEditorKeystroke, this);
|
||||
|
|
|
|||
|
|
@ -93,13 +93,11 @@ void LLChatItemCtrl::reshape (S32 width, S32 height, BOOL called_from_parent )
|
|||
caption->reshape( width - 4, caption_rect.getHeight(), 1);
|
||||
caption->setRect(caption_rect);
|
||||
|
||||
|
||||
LLRect msg_text_rect = msg_text->getRect();
|
||||
msg_text_rect.setLeftTopAndSize( msg_left_offset, height - caption_rect.getHeight() , width - msg_left_offset - msg_right_offset, height - caption_rect.getHeight());
|
||||
msg_text->reshape( width - msg_left_offset - msg_right_offset, height - caption_rect.getHeight(), 1);
|
||||
msg_text->setRect(msg_text_rect);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BOOL LLChatItemCtrl::postBuild()
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ void LLChatMsgBox::drawText( S32 x, S32 y, const LLColor4& color )
|
|||
mHAlign, mVAlign,
|
||||
mFontStyle,
|
||||
mShadowType,
|
||||
line_length, getRect().getWidth(), NULL, TRUE, mUseEllipses );
|
||||
line_length, getRect().getWidth(), NULL, mUseEllipses );
|
||||
cur_pos += line_length + 1;
|
||||
y -= llfloor(mFontGL->getLineHeight()) + mLineSpacing;
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ const F32 MAX_INTERPOLATE_DISTANCE_SQUARED = 10.f * 10.f;
|
|||
const F32 OBJECT_DAMPING_TIME_CONSTANT = 0.06f;
|
||||
const F32 MIN_SHADOW_CASTER_RADIUS = 2.0f;
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound");
|
||||
|
||||
|
||||
////////////////////////
|
||||
//
|
||||
// Inline implementations.
|
||||
|
|
@ -188,7 +191,7 @@ BOOL LLDrawable::isLight() const
|
|||
|
||||
void LLDrawable::cleanupReferences()
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_PIPELINE);
|
||||
LLFastTimer t(FTM_PIPELINE);
|
||||
|
||||
std::for_each(mFaces.begin(), mFaces.end(), DeletePointer());
|
||||
mFaces.clear();
|
||||
|
|
@ -1033,7 +1036,7 @@ void LLSpatialBridge::updateSpatialExtents()
|
|||
LLSpatialGroup* root = (LLSpatialGroup*) mOctree->getListener(0);
|
||||
|
||||
{
|
||||
LLFastTimer ftm(LLFastTimer::FTM_CULL_REBOUND);
|
||||
LLFastTimer ftm(FTM_CULL_REBOUND);
|
||||
root->rebound();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ class LLViewerTexture;
|
|||
// Can have multiple silhouettes for each object
|
||||
const U32 SILHOUETTE_HIGHLIGHT = 0;
|
||||
|
||||
|
||||
// All data for new renderer goes into this class.
|
||||
class LLDrawable : public LLRefCount
|
||||
{
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ void LLDrawPoolAlpha::endDeferredPass(S32 pass)
|
|||
{
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.4f);
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_GRASS);
|
||||
LLFastTimer t(FTM_RENDER_GRASS);
|
||||
gDeferredTreeProgram.bind();
|
||||
LLGLEnable test(GL_ALPHA_TEST);
|
||||
//render alpha masked objects
|
||||
|
|
@ -112,7 +112,7 @@ S32 LLDrawPoolAlpha::getNumPostDeferredPasses()
|
|||
|
||||
void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_ALPHA);
|
||||
LLFastTimer t(FTM_RENDER_ALPHA);
|
||||
|
||||
simple_shader = &gDeferredAlphaProgram;
|
||||
fullbright_shader = &gDeferredFullbrightProgram;
|
||||
|
|
@ -139,7 +139,7 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass)
|
|||
|
||||
void LLDrawPoolAlpha::beginRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_ALPHA);
|
||||
LLFastTimer t(FTM_RENDER_ALPHA);
|
||||
|
||||
if (LLPipeline::sUnderWaterRender)
|
||||
{
|
||||
|
|
@ -163,7 +163,7 @@ void LLDrawPoolAlpha::beginRenderPass(S32 pass)
|
|||
|
||||
void LLDrawPoolAlpha::endRenderPass( S32 pass )
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_ALPHA);
|
||||
LLFastTimer t(FTM_RENDER_ALPHA);
|
||||
LLRenderPass::endRenderPass(pass);
|
||||
|
||||
if(gPipeline.canUseWindLightShaders())
|
||||
|
|
@ -174,7 +174,7 @@ void LLDrawPoolAlpha::endRenderPass( S32 pass )
|
|||
|
||||
void LLDrawPoolAlpha::render(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_ALPHA);
|
||||
LLFastTimer t(FTM_RENDER_ALPHA);
|
||||
|
||||
LLGLSPipelineAlpha gls_pipeline_alpha;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,12 +89,13 @@ S32 AVATAR_OFFSET_TEX0 = 32;
|
|||
S32 AVATAR_OFFSET_TEX1 = 40;
|
||||
S32 AVATAR_VERTEX_BYTES = 48;
|
||||
|
||||
|
||||
BOOL gAvatarEmbossBumpMap = FALSE;
|
||||
static BOOL sRenderingSkinned = FALSE;
|
||||
S32 normal_channel = -1;
|
||||
S32 specular_channel = -1;
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_SHADOW_AVATAR("Avatar Shadow");
|
||||
|
||||
LLDrawPoolAvatar::LLDrawPoolAvatar() :
|
||||
LLFacePool(POOL_AVATAR)
|
||||
{
|
||||
|
|
@ -154,7 +155,7 @@ S32 LLDrawPoolAvatar::getNumDeferredPasses()
|
|||
|
||||
void LLDrawPoolAvatar::beginDeferredPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_CHARACTERS);
|
||||
LLFastTimer t(FTM_RENDER_CHARACTERS);
|
||||
|
||||
if (LLPipeline::sImpostorRender)
|
||||
{
|
||||
|
|
@ -178,7 +179,7 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass)
|
|||
|
||||
void LLDrawPoolAvatar::endDeferredPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_CHARACTERS);
|
||||
LLFastTimer t(FTM_RENDER_CHARACTERS);
|
||||
|
||||
if (LLPipeline::sImpostorRender)
|
||||
{
|
||||
|
|
@ -248,7 +249,7 @@ S32 LLDrawPoolAvatar::getNumShadowPasses()
|
|||
|
||||
void LLDrawPoolAvatar::beginShadowPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_SHADOW_AVATAR);
|
||||
LLFastTimer t(FTM_SHADOW_AVATAR);
|
||||
|
||||
sVertexProgram = &gDeferredAvatarShadowProgram;
|
||||
if (sShaderLevel > 0)
|
||||
|
|
@ -270,7 +271,7 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass)
|
|||
|
||||
void LLDrawPoolAvatar::endShadowPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_SHADOW_AVATAR);
|
||||
LLFastTimer t(FTM_SHADOW_AVATAR);
|
||||
|
||||
if (sShaderLevel > 0)
|
||||
{
|
||||
|
|
@ -284,7 +285,7 @@ void LLDrawPoolAvatar::endShadowPass(S32 pass)
|
|||
|
||||
void LLDrawPoolAvatar::renderShadow(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_SHADOW_AVATAR);
|
||||
LLFastTimer t(FTM_SHADOW_AVATAR);
|
||||
|
||||
if (mDrawFace.empty())
|
||||
{
|
||||
|
|
@ -320,7 +321,7 @@ S32 LLDrawPoolAvatar::getNumPasses()
|
|||
|
||||
void LLDrawPoolAvatar::render(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_CHARACTERS);
|
||||
LLFastTimer t(FTM_RENDER_CHARACTERS);
|
||||
if (LLPipeline::sImpostorRender)
|
||||
{
|
||||
renderAvatars(NULL, 2);
|
||||
|
|
@ -332,7 +333,7 @@ void LLDrawPoolAvatar::render(S32 pass)
|
|||
|
||||
void LLDrawPoolAvatar::beginRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_CHARACTERS);
|
||||
LLFastTimer t(FTM_RENDER_CHARACTERS);
|
||||
//reset vertex buffer mappings
|
||||
LLVertexBuffer::unbind();
|
||||
|
||||
|
|
@ -358,7 +359,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass)
|
|||
|
||||
void LLDrawPoolAvatar::endRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_CHARACTERS);
|
||||
LLFastTimer t(FTM_RENDER_CHARACTERS);
|
||||
|
||||
if (LLPipeline::sImpostorRender)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ const U32 VERTEX_MASK_BUMP = LLVertexBuffer::MAP_VERTEX |LLVertexBuffer::MAP_TEX
|
|||
|
||||
U32 LLDrawPoolBump::sVertexMask = VERTEX_MASK_SHINY;
|
||||
|
||||
|
||||
static LLGLSLShader* shader = NULL;
|
||||
static S32 cube_channel = -1;
|
||||
static S32 diffuse_channel = -1;
|
||||
|
|
@ -220,7 +221,7 @@ S32 LLDrawPoolBump::getNumPasses()
|
|||
|
||||
void LLDrawPoolBump::beginRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP);
|
||||
LLFastTimer t(FTM_RENDER_BUMP);
|
||||
switch( pass )
|
||||
{
|
||||
case 0:
|
||||
|
|
@ -247,7 +248,7 @@ void LLDrawPoolBump::beginRenderPass(S32 pass)
|
|||
|
||||
void LLDrawPoolBump::render(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP);
|
||||
LLFastTimer t(FTM_RENDER_BUMP);
|
||||
|
||||
if (!gPipeline.hasRenderType(LLDrawPool::POOL_SIMPLE))
|
||||
{
|
||||
|
|
@ -280,7 +281,7 @@ void LLDrawPoolBump::render(S32 pass)
|
|||
|
||||
void LLDrawPoolBump::endRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP);
|
||||
LLFastTimer t(FTM_RENDER_BUMP);
|
||||
switch( pass )
|
||||
{
|
||||
case 0:
|
||||
|
|
@ -308,7 +309,7 @@ void LLDrawPoolBump::endRenderPass(S32 pass)
|
|||
//static
|
||||
void LLDrawPoolBump::beginShiny(bool invisible)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SHINY);
|
||||
LLFastTimer t(FTM_RENDER_SHINY);
|
||||
if (!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY)||
|
||||
invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY))
|
||||
{
|
||||
|
|
@ -383,7 +384,7 @@ void LLDrawPoolBump::beginShiny(bool invisible)
|
|||
|
||||
void LLDrawPoolBump::renderShiny(bool invisible)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SHINY);
|
||||
LLFastTimer t(FTM_RENDER_SHINY);
|
||||
if (!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY)||
|
||||
invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY))
|
||||
{
|
||||
|
|
@ -410,7 +411,7 @@ void LLDrawPoolBump::renderShiny(bool invisible)
|
|||
|
||||
void LLDrawPoolBump::endShiny(bool invisible)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SHINY);
|
||||
LLFastTimer t(FTM_RENDER_SHINY);
|
||||
if (!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY)||
|
||||
invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY))
|
||||
{
|
||||
|
|
@ -450,7 +451,7 @@ void LLDrawPoolBump::endShiny(bool invisible)
|
|||
|
||||
void LLDrawPoolBump::beginFullbrightShiny()
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SHINY);
|
||||
LLFastTimer t(FTM_RENDER_SHINY);
|
||||
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY))
|
||||
{
|
||||
return;
|
||||
|
|
@ -499,7 +500,7 @@ void LLDrawPoolBump::beginFullbrightShiny()
|
|||
|
||||
void LLDrawPoolBump::renderFullbrightShiny()
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SHINY);
|
||||
LLFastTimer t(FTM_RENDER_SHINY);
|
||||
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY))
|
||||
{
|
||||
return;
|
||||
|
|
@ -514,7 +515,7 @@ void LLDrawPoolBump::renderFullbrightShiny()
|
|||
|
||||
void LLDrawPoolBump::endFullbrightShiny()
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SHINY);
|
||||
LLFastTimer t(FTM_RENDER_SHINY);
|
||||
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY))
|
||||
{
|
||||
return;
|
||||
|
|
@ -624,7 +625,7 @@ void LLDrawPoolBump::beginBump()
|
|||
}
|
||||
|
||||
sVertexMask = VERTEX_MASK_BUMP;
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP);
|
||||
LLFastTimer t(FTM_RENDER_BUMP);
|
||||
// Optional second pass: emboss bump map
|
||||
stop_glerror();
|
||||
|
||||
|
|
@ -668,7 +669,7 @@ void LLDrawPoolBump::renderBump()
|
|||
return;
|
||||
}
|
||||
|
||||
LLFastTimer ftm(LLFastTimer::FTM_RENDER_BUMP);
|
||||
LLFastTimer ftm(FTM_RENDER_BUMP);
|
||||
LLGLDisable fog(GL_FOG);
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_LEQUAL);
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
|
|
@ -705,7 +706,7 @@ void LLDrawPoolBump::beginDeferredPass(S32 pass)
|
|||
{
|
||||
return;
|
||||
}
|
||||
LLFastTimer ftm(LLFastTimer::FTM_RENDER_BUMP);
|
||||
LLFastTimer ftm(FTM_RENDER_BUMP);
|
||||
mShiny = TRUE;
|
||||
gDeferredBumpProgram.bind();
|
||||
diffuse_channel = gDeferredBumpProgram.enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
|
||||
|
|
@ -720,7 +721,7 @@ void LLDrawPoolBump::endDeferredPass(S32 pass)
|
|||
{
|
||||
return;
|
||||
}
|
||||
LLFastTimer ftm(LLFastTimer::FTM_RENDER_BUMP);
|
||||
LLFastTimer ftm(FTM_RENDER_BUMP);
|
||||
mShiny = FALSE;
|
||||
gDeferredBumpProgram.disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
|
||||
gDeferredBumpProgram.disableTexture(LLViewerShaderMgr::BUMP_MAP);
|
||||
|
|
@ -734,7 +735,7 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
|
|||
{
|
||||
return;
|
||||
}
|
||||
LLFastTimer ftm(LLFastTimer::FTM_RENDER_BUMP);
|
||||
LLFastTimer ftm(FTM_RENDER_BUMP);
|
||||
|
||||
U32 type = LLRenderPass::PASS_BUMP;
|
||||
LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type);
|
||||
|
|
@ -1250,7 +1251,7 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
|
|||
|
||||
void LLDrawPoolInvisible::render(S32 pass)
|
||||
{ //render invisiprims
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_INVISIBLE);
|
||||
LLFastTimer t(FTM_RENDER_INVISIBLE);
|
||||
|
||||
U32 invisi_mask = LLVertexBuffer::MAP_VERTEX;
|
||||
glStencilMask(0);
|
||||
|
|
@ -1279,7 +1280,7 @@ void LLDrawPoolInvisible::endDeferredPass( S32 pass )
|
|||
|
||||
void LLDrawPoolInvisible::renderDeferred( S32 pass )
|
||||
{ //render invisiprims; this doesn't work becaue it also blocks all the post-deferred stuff
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_INVISIBLE);
|
||||
LLFastTimer t(FTM_RENDER_INVISIBLE);
|
||||
|
||||
U32 invisi_mask = LLVertexBuffer::MAP_VERTEX;
|
||||
glStencilMask(0);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static LLGLSLShader* fullbright_shader = NULL;
|
|||
|
||||
void LLDrawPoolGlow::render(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_GLOW);
|
||||
LLFastTimer t(FTM_RENDER_GLOW);
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
LLGLDisable test(GL_ALPHA_TEST);
|
||||
gGL.setSceneBlendType(LLRender::BT_ADD);
|
||||
|
|
@ -98,7 +98,7 @@ void LLDrawPoolSimple::prerender()
|
|||
|
||||
void LLDrawPoolSimple::beginRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
|
||||
LLFastTimer t(FTM_RENDER_SIMPLE);
|
||||
|
||||
if (LLPipeline::sUnderWaterRender)
|
||||
{
|
||||
|
|
@ -125,7 +125,7 @@ void LLDrawPoolSimple::beginRenderPass(S32 pass)
|
|||
|
||||
void LLDrawPoolSimple::endRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
|
||||
LLFastTimer t(FTM_RENDER_SIMPLE);
|
||||
LLRenderPass::endRenderPass(pass);
|
||||
|
||||
if (mVertexShaderLevel > 0){
|
||||
|
|
@ -140,7 +140,7 @@ void LLDrawPoolSimple::render(S32 pass)
|
|||
LLGLDisable alpha_test(GL_ALPHA_TEST);
|
||||
|
||||
{ //render simple
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
|
||||
LLFastTimer t(FTM_RENDER_SIMPLE);
|
||||
gPipeline.enableLightsDynamic();
|
||||
renderTexture(LLRenderPass::PASS_SIMPLE, getVertexDataMask());
|
||||
|
||||
|
|
@ -157,13 +157,13 @@ void LLDrawPoolSimple::render(S32 pass)
|
|||
|
||||
void LLDrawPoolSimple::beginDeferredPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
|
||||
LLFastTimer t(FTM_RENDER_SIMPLE);
|
||||
gDeferredDiffuseProgram.bind();
|
||||
}
|
||||
|
||||
void LLDrawPoolSimple::endDeferredPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
|
||||
LLFastTimer t(FTM_RENDER_SIMPLE);
|
||||
LLRenderPass::endRenderPass(pass);
|
||||
|
||||
gDeferredDiffuseProgram.unbind();
|
||||
|
|
@ -175,7 +175,7 @@ void LLDrawPoolSimple::renderDeferred(S32 pass)
|
|||
LLGLDisable alpha_test(GL_ALPHA_TEST);
|
||||
|
||||
{ //render simple
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
|
||||
LLFastTimer t(FTM_RENDER_SIMPLE);
|
||||
renderTexture(LLRenderPass::PASS_SIMPLE, getVertexDataMask());
|
||||
}
|
||||
}
|
||||
|
|
@ -195,7 +195,7 @@ void LLDrawPoolGrass::prerender()
|
|||
|
||||
void LLDrawPoolGrass::beginRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_GRASS);
|
||||
LLFastTimer t(FTM_RENDER_GRASS);
|
||||
|
||||
if (LLPipeline::sUnderWaterRender)
|
||||
{
|
||||
|
|
@ -222,7 +222,7 @@ void LLDrawPoolGrass::beginRenderPass(S32 pass)
|
|||
|
||||
void LLDrawPoolGrass::endRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_GRASS);
|
||||
LLFastTimer t(FTM_RENDER_GRASS);
|
||||
LLRenderPass::endRenderPass(pass);
|
||||
|
||||
if (mVertexShaderLevel > 0)
|
||||
|
|
@ -237,7 +237,7 @@ void LLDrawPoolGrass::render(S32 pass)
|
|||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_GRASS);
|
||||
LLFastTimer t(FTM_RENDER_GRASS);
|
||||
LLGLEnable test(GL_ALPHA_TEST);
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
//render grass
|
||||
|
|
@ -262,7 +262,7 @@ void LLDrawPoolGrass::renderDeferred(S32 pass)
|
|||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_GRASS);
|
||||
LLFastTimer t(FTM_RENDER_GRASS);
|
||||
gDeferredTreeProgram.bind();
|
||||
LLGLEnable test(GL_ALPHA_TEST);
|
||||
//render grass
|
||||
|
|
@ -286,7 +286,7 @@ void LLDrawPoolFullbright::prerender()
|
|||
|
||||
void LLDrawPoolFullbright::beginRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT);
|
||||
LLFastTimer t(FTM_RENDER_FULLBRIGHT);
|
||||
|
||||
if (LLPipeline::sUnderWaterRender)
|
||||
{
|
||||
|
|
@ -300,7 +300,7 @@ void LLDrawPoolFullbright::beginRenderPass(S32 pass)
|
|||
|
||||
void LLDrawPoolFullbright::endRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT);
|
||||
LLFastTimer t(FTM_RENDER_FULLBRIGHT);
|
||||
LLRenderPass::endRenderPass(pass);
|
||||
|
||||
if (mVertexShaderLevel > 0)
|
||||
|
|
@ -311,7 +311,7 @@ void LLDrawPoolFullbright::endRenderPass(S32 pass)
|
|||
|
||||
void LLDrawPoolFullbright::render(S32 pass)
|
||||
{ //render fullbright
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT);
|
||||
LLFastTimer t(FTM_RENDER_FULLBRIGHT);
|
||||
if (mVertexShaderLevel > 0)
|
||||
{
|
||||
fullbright_shader->bind();
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ int DebugDetailMap = 0;
|
|||
S32 LLDrawPoolTerrain::sDetailMode = 1;
|
||||
F32 LLDrawPoolTerrain::sDetailScale = DETAIL_SCALE;
|
||||
static LLGLSLShader* sShader = NULL;
|
||||
static LLFastTimer::DeclareTimer FTM_SHADOW_TERRAIN("Terrain Shadow");
|
||||
|
||||
|
||||
LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
|
||||
LLFacePool(POOL_TERRAIN),
|
||||
|
|
@ -131,7 +133,7 @@ void LLDrawPoolTerrain::prerender()
|
|||
|
||||
void LLDrawPoolTerrain::beginRenderPass( S32 pass )
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_TERRAIN);
|
||||
LLFastTimer t(FTM_RENDER_TERRAIN);
|
||||
LLFacePool::beginRenderPass(pass);
|
||||
|
||||
sShader = LLPipeline::sUnderWaterRender ?
|
||||
|
|
@ -146,7 +148,7 @@ void LLDrawPoolTerrain::beginRenderPass( S32 pass )
|
|||
|
||||
void LLDrawPoolTerrain::endRenderPass( S32 pass )
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_TERRAIN);
|
||||
LLFastTimer t(FTM_RENDER_TERRAIN);
|
||||
LLFacePool::endRenderPass(pass);
|
||||
|
||||
if (mVertexShaderLevel > 1 && sShader->mShaderLevel > 0) {
|
||||
|
|
@ -162,7 +164,7 @@ S32 LLDrawPoolTerrain::getDetailMode()
|
|||
|
||||
void LLDrawPoolTerrain::render(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_TERRAIN);
|
||||
LLFastTimer t(FTM_RENDER_TERRAIN);
|
||||
|
||||
if (mDrawFace.empty())
|
||||
{
|
||||
|
|
@ -235,7 +237,7 @@ void LLDrawPoolTerrain::render(S32 pass)
|
|||
|
||||
void LLDrawPoolTerrain::beginDeferredPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_TERRAIN);
|
||||
LLFastTimer t(FTM_RENDER_TERRAIN);
|
||||
LLFacePool::beginRenderPass(pass);
|
||||
|
||||
sShader = &gDeferredTerrainProgram;
|
||||
|
|
@ -245,14 +247,14 @@ void LLDrawPoolTerrain::beginDeferredPass(S32 pass)
|
|||
|
||||
void LLDrawPoolTerrain::endDeferredPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_TERRAIN);
|
||||
LLFastTimer t(FTM_RENDER_TERRAIN);
|
||||
LLFacePool::endRenderPass(pass);
|
||||
sShader->unbind();
|
||||
}
|
||||
|
||||
void LLDrawPoolTerrain::renderDeferred(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_TERRAIN);
|
||||
LLFastTimer t(FTM_RENDER_TERRAIN);
|
||||
if (mDrawFace.empty())
|
||||
{
|
||||
return;
|
||||
|
|
@ -262,7 +264,7 @@ void LLDrawPoolTerrain::renderDeferred(S32 pass)
|
|||
|
||||
void LLDrawPoolTerrain::beginShadowPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_SHADOW_TERRAIN);
|
||||
LLFastTimer t(FTM_SHADOW_TERRAIN);
|
||||
LLFacePool::beginRenderPass(pass);
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gDeferredShadowProgram.bind();
|
||||
|
|
@ -270,14 +272,14 @@ void LLDrawPoolTerrain::beginShadowPass(S32 pass)
|
|||
|
||||
void LLDrawPoolTerrain::endShadowPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_SHADOW_TERRAIN);
|
||||
LLFastTimer t(FTM_SHADOW_TERRAIN);
|
||||
LLFacePool::endRenderPass(pass);
|
||||
gDeferredShadowProgram.unbind();
|
||||
}
|
||||
|
||||
void LLDrawPoolTerrain::renderShadow(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_SHADOW_TERRAIN);
|
||||
LLFastTimer t(FTM_SHADOW_TERRAIN);
|
||||
if (mDrawFace.empty())
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
|
||||
S32 LLDrawPoolTree::sDiffTex = 0;
|
||||
static LLGLSLShader* shader = NULL;
|
||||
static LLFastTimer::DeclareTimer FTM_SHADOW_TREE("Tree Shadow");
|
||||
|
||||
LLDrawPoolTree::LLDrawPoolTree(LLViewerTexture *texturep) :
|
||||
LLFacePool(POOL_TREE),
|
||||
|
|
@ -67,7 +68,7 @@ void LLDrawPoolTree::prerender()
|
|||
|
||||
void LLDrawPoolTree::beginRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_TREES);
|
||||
LLFastTimer t(FTM_RENDER_TREES);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
|
||||
if (LLPipeline::sUnderWaterRender)
|
||||
|
|
@ -91,7 +92,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass)
|
|||
|
||||
void LLDrawPoolTree::render(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLPipeline::sShadowRender ? LLFastTimer::FTM_SHADOW_TREE : LLFastTimer::FTM_RENDER_TREES);
|
||||
LLFastTimer t(LLPipeline::sShadowRender ? FTM_SHADOW_TREE : FTM_RENDER_TREES);
|
||||
|
||||
if (mDrawFace.empty())
|
||||
{
|
||||
|
|
@ -122,7 +123,7 @@ void LLDrawPoolTree::render(S32 pass)
|
|||
|
||||
void LLDrawPoolTree::endRenderPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_TREES);
|
||||
LLFastTimer t(FTM_RENDER_TREES);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
|
||||
if (gPipeline.canUseWindLightShadersOnObjects())
|
||||
|
|
@ -136,7 +137,7 @@ void LLDrawPoolTree::endRenderPass(S32 pass)
|
|||
//============================================
|
||||
void LLDrawPoolTree::beginDeferredPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_TREES);
|
||||
LLFastTimer t(FTM_RENDER_TREES);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
|
||||
shader = &gDeferredTreeProgram;
|
||||
|
|
@ -150,7 +151,7 @@ void LLDrawPoolTree::renderDeferred(S32 pass)
|
|||
|
||||
void LLDrawPoolTree::endDeferredPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_RENDER_TREES);
|
||||
LLFastTimer t(FTM_RENDER_TREES);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
|
||||
shader->unbind();
|
||||
|
|
@ -161,7 +162,7 @@ void LLDrawPoolTree::endDeferredPass(S32 pass)
|
|||
//============================================
|
||||
void LLDrawPoolTree::beginShadowPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_SHADOW_TREE);
|
||||
LLFastTimer t(FTM_SHADOW_TREE);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
|
||||
gDeferredShadowProgram.bind();
|
||||
}
|
||||
|
|
@ -173,7 +174,7 @@ void LLDrawPoolTree::renderShadow(S32 pass)
|
|||
|
||||
void LLDrawPoolTree::endShadowPass(S32 pass)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_SHADOW_TREE);
|
||||
LLFastTimer t(FTM_SHADOW_TREE);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
gDeferredShadowProgram.unbind();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ void LLDrawPoolWater::endPostDeferredPass(S32 pass)
|
|||
|
||||
void LLDrawPoolWater::render(S32 pass)
|
||||
{
|
||||
LLFastTimer ftm(LLFastTimer::FTM_RENDER_WATER);
|
||||
LLFastTimer ftm(FTM_RENDER_WATER);
|
||||
if (mDrawFace.empty() || LLDrawable::getCurrentFrame() <= 1)
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ void LLDrawPoolWLSky::render(S32 pass)
|
|||
{
|
||||
return;
|
||||
}
|
||||
LLFastTimer ftm(LLFastTimer::FTM_RENDER_WL_SKY);
|
||||
LLFastTimer ftm(FTM_RENDER_WL_SKY);
|
||||
|
||||
const F32 camHeightLocal = LLWLParamManager::instance()->getDomeOffset() * LLWLParamManager::instance()->getDomeRadius();
|
||||
|
||||
|
|
|
|||
|
|
@ -195,7 +195,8 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)
|
|||
|
||||
if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y))
|
||||
{
|
||||
mHoverBarIndex = llmin(LLFastTimer::getCurFrameIndex() - 1, MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight()));
|
||||
mHoverBarIndex = llmin(LLFastTimer::getCurFrameIndex() - 1,
|
||||
MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight()));
|
||||
if (mHoverBarIndex == 0)
|
||||
{
|
||||
return TRUE;
|
||||
|
|
@ -217,9 +218,9 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)
|
|||
mHoverID = (*it);
|
||||
mHoverTimer = (*it);
|
||||
mToolTipRect.set(mBarStart[mHoverBarIndex][i],
|
||||
mBarRect.mBottom + llround(((F32)mHoverBarIndex + 1.f) * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f))),
|
||||
mBarRect.mBottom + llround(((F32)(MAX_VISIBLE_HISTORY - mHoverBarIndex + 1)) * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f))),
|
||||
mBarEnd[mHoverBarIndex][i],
|
||||
mBarRect.mBottom + llround((F32)mHoverBarIndex * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f))));
|
||||
mBarRect.mBottom + llround((F32)(MAX_VISIBLE_HISTORY - mHoverBarIndex) * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f))));
|
||||
}
|
||||
|
||||
if ((*it)->getCollapsed())
|
||||
|
|
@ -248,6 +249,7 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* stic
|
|||
// tooltips for timer bars
|
||||
if (mHoverTimer)
|
||||
{
|
||||
localRectToScreen(mToolTipRect, sticky_rect_screen);
|
||||
msg = mHoverTimer->getToolTip(LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -960,9 +962,14 @@ void LLFastTimerView::draw()
|
|||
LLView::draw();
|
||||
}
|
||||
|
||||
F64 LLFastTimerView::getTime(LLFastTimer::NamedTimer::FrameState& id)
|
||||
F64 LLFastTimerView::getTime(const std::string& name)
|
||||
{
|
||||
return (F64)id.mTimer->getCountAverage() / (F64)LLFastTimer::countsPerSecond();
|
||||
const LLFastTimer::NamedTimer* timerp = LLFastTimer::getTimerByName(name);
|
||||
if (timerp)
|
||||
{
|
||||
return (F64)timerp->getCountAverage() / (F64)LLFastTimer::countsPerSecond();
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public:
|
|||
virtual void draw();
|
||||
|
||||
LLFastTimer::NamedTimer* getLegendID(S32 y);
|
||||
F64 getTime(LLFastTimer::NamedTimer::FrameState& id);
|
||||
F64 getTime(const std::string& name);
|
||||
|
||||
private:
|
||||
typedef std::vector<std::vector<S32> > bar_positions_t;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "llbutton.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfocusmgr.h"
|
||||
#include "llinventory.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llmenugl.h"
|
||||
|
|
@ -292,7 +293,7 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width)
|
|||
if (mFirstDropDownItem != count)
|
||||
{
|
||||
// Chevron button should stay right aligned
|
||||
LLView *chevron_button = getChildView(std::string(">>"), FALSE, FALSE);
|
||||
LLView *chevron_button = findChildView(std::string(">>"), FALSE);
|
||||
if (chevron_button)
|
||||
{
|
||||
LLRect rect;
|
||||
|
|
@ -335,7 +336,7 @@ void LLFavoritesBarCtrl::updateButtons(U32 bar_width)
|
|||
else
|
||||
{
|
||||
// Hide chevron button if all items are visible on bar
|
||||
LLView *chevron_button = getChildView(std::string(">>"), FALSE, FALSE);
|
||||
LLView *chevron_button = findChildView(std::string(">>"), FALSE);
|
||||
if (chevron_button)
|
||||
{
|
||||
chevron_button->setVisible(FALSE);
|
||||
|
|
@ -366,7 +367,7 @@ void LLFavoritesBarCtrl::createButtons(const LLInventoryModel::item_array_t &ite
|
|||
fav_btn->setLabel(item->getName());
|
||||
fav_btn->setToolTip(item->getName());
|
||||
fav_btn->setCommitCallback(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID()));
|
||||
fav_btn->setRightClickedCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3,_4 ));
|
||||
fav_btn->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3,_4 ));
|
||||
sendChildToBack(fav_btn);
|
||||
|
||||
curr_x += buttonWidth + buttonHGap;
|
||||
|
|
@ -486,7 +487,7 @@ void LLFavoritesBarCtrl::showDropDownMenu()
|
|||
|
||||
item_params.on_click.function(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID()));
|
||||
LLMenuItemCallGL *menu_item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params);
|
||||
menu_item->setRightClickedCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this,item->getUUID(),_1,_2,_3,_4));
|
||||
menu_item->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this,item->getUUID(),_1,_2,_3,_4));
|
||||
// Check whether item name wider than menu
|
||||
if ((S32) menu_item->getNominalWidth() > bar_width)
|
||||
{
|
||||
|
|
@ -545,6 +546,10 @@ void LLFavoritesBarCtrl::onButtonRightClick( LLUUID item_id,LLView* fav_button,S
|
|||
return;
|
||||
}
|
||||
|
||||
// Release mouse capture so hover events go to the popup menu
|
||||
// because this is happening during a mouse down.
|
||||
gFocusMgr.setMouseCapture(NULL);
|
||||
|
||||
menu->updateParent(LLMenuGL::sMenuContainer);
|
||||
LLMenuGL::showPopup(fav_button, menu, x, y);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,6 +261,7 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons
|
|||
// updated every time step. In the future, perhaps there could be an
|
||||
// optimization similar to what Havok does for objects that are stationary.
|
||||
//---------------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_FLEXIBLE_UPDATE("Update Flexies");
|
||||
BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
|
||||
{
|
||||
if (mVO->mDrawable.isNull())
|
||||
|
|
@ -279,7 +280,7 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
|
|||
parent->mDrawable->mQuietCount = 0;
|
||||
}
|
||||
|
||||
LLFastTimer ftm(LLFastTimer::FTM_FLEXIBLE_UPDATE);
|
||||
LLFastTimer ftm(FTM_FLEXIBLE_UPDATE);
|
||||
|
||||
S32 new_res = mAttributes->getSimulateLOD();
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@
|
|||
#include "llmediamanager.h"
|
||||
#include "llwindow.h"
|
||||
|
||||
#include "llbutton.h"
|
||||
|
||||
#if LL_WINDOWS
|
||||
#include "lldxhardware.h"
|
||||
#endif
|
||||
|
|
@ -102,20 +104,18 @@ BOOL LLFloaterAbout::postBuild()
|
|||
support_widget->setParseHTML(TRUE);
|
||||
|
||||
// Text styles for release notes hyperlinks
|
||||
LLStyleSP viewer_link_style(new LLStyle);
|
||||
viewer_link_style->setVisible(true);
|
||||
viewer_link_style->setFontName(LLStringUtil::null);
|
||||
viewer_link_style->setLinkHREF(get_viewer_release_notes_url());
|
||||
viewer_link_style->setColor(LLUIColorTable::instance().getColor("HTMLLinkColor"));
|
||||
LLStyle::Params link_style_params;
|
||||
link_style_params.color.control = "HTMLLinkColor";
|
||||
link_style_params.link_href = get_viewer_release_notes_url();
|
||||
|
||||
// Version string
|
||||
std::string version = LLTrans::getString("SECOND_LIFE_VIEWER")
|
||||
std::string version = LLTrans::getString("APP_NAME")
|
||||
+ llformat(" %d.%d.%d (%d) %s %s (%s)\n",
|
||||
LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD,
|
||||
__DATE__, __TIME__,
|
||||
gSavedSettings.getString("VersionChannelName").c_str());
|
||||
support_widget->appendColoredText(version, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor"));
|
||||
support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style);
|
||||
support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, link_style_params);
|
||||
|
||||
std::string support;
|
||||
support.append("\n\n");
|
||||
|
|
@ -132,11 +132,9 @@ BOOL LLFloaterAbout::postBuild()
|
|||
LLViewerRegion* region = gAgent.getRegion();
|
||||
if (region)
|
||||
{
|
||||
LLStyleSP server_link_style(new LLStyle);
|
||||
server_link_style->setVisible(true);
|
||||
server_link_style->setFontName(LLStringUtil::null);
|
||||
server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes"));
|
||||
server_link_style->setColor(LLUIColorTable::instance().getColor("HTMLLinkColor"));
|
||||
LLStyle::Params server_link_style_params;
|
||||
server_link_style_params.color.control = "HTMLLinkColor";
|
||||
server_link_style_params.link_href = region->getCapability("ServerReleaseNotes");
|
||||
|
||||
const LLVector3d &pos = gAgent.getPositionGlobal();
|
||||
LLUIString pos_text = getString("you_are_at");
|
||||
|
|
@ -159,7 +157,7 @@ BOOL LLFloaterAbout::postBuild()
|
|||
support.append("\n");
|
||||
|
||||
support_widget->appendColoredText(support, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor"));
|
||||
support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style);
|
||||
support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style_params);
|
||||
|
||||
support = "\n\n";
|
||||
}
|
||||
|
|
@ -251,13 +249,9 @@ BOOL LLFloaterAbout::postBuild()
|
|||
// Fix views
|
||||
support_widget->setCursorPos(0);
|
||||
support_widget->setEnabled(FALSE);
|
||||
support_widget->setTakesFocus(TRUE);
|
||||
support_widget->setHandleEditKeysDirectly(TRUE);
|
||||
|
||||
credits_widget->setCursorPos(0);
|
||||
credits_widget->setEnabled(FALSE);
|
||||
credits_widget->setTakesFocus(TRUE);
|
||||
credits_widget->setHandleEditKeysDirectly(TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -566,32 +566,25 @@ void LLFloaterBuyLandUI::onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data)
|
|||
void LLFloaterBuyLandUI::updateFloaterCovenantText(const std::string &string, const LLUUID& asset_id)
|
||||
{
|
||||
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("covenant_editor");
|
||||
if (editor)
|
||||
editor->setText(string);
|
||||
|
||||
LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
|
||||
LLTextBox* box = getChild<LLTextBox>("covenant_text");
|
||||
if (asset_id.isNull())
|
||||
{
|
||||
editor->setHandleEditKeysDirectly(FALSE);
|
||||
editor->setText(string);
|
||||
check->set(true);
|
||||
check->setEnabled(false);
|
||||
refreshUI();
|
||||
|
||||
LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
|
||||
LLTextBox* box = getChild<LLTextBox>("covenant_text");
|
||||
if(check && box)
|
||||
{
|
||||
if (asset_id.isNull())
|
||||
{
|
||||
check->set(true);
|
||||
check->setEnabled(false);
|
||||
refreshUI();
|
||||
// remove the line stating that you must agree
|
||||
box->setVisible(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
check->setEnabled(true);
|
||||
|
||||
// remove the line stating that you must agree
|
||||
box->setVisible(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
check->setEnabled(true);
|
||||
|
||||
// remove the line stating that you must agree
|
||||
box->setVisible(TRUE);
|
||||
}
|
||||
}
|
||||
// remove the line stating that you must agree
|
||||
box->setVisible(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
|
||||
class LLFloater;
|
||||
class LLViewerRegion;
|
||||
class LLViewerTextEditor;
|
||||
class LLParcelSelection;
|
||||
|
||||
class LLFloaterBuyLand
|
||||
|
|
|
|||
|
|
@ -172,8 +172,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&
|
|||
{
|
||||
std::string start_line = line.substr(0, chat.mFromName.length() + 1);
|
||||
line = line.substr(chat.mFromName.length() + 1);
|
||||
const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL);
|
||||
edit->appendStyledText(start_line, false, prepend_newline, sourceStyle);
|
||||
edit->appendStyledText(start_line, false, prepend_newline, LLStyleMap::instance().lookup(chat.mFromID,chat.mURL));
|
||||
prepend_newline = false;
|
||||
}
|
||||
edit->appendColoredText(line, false, prepend_newline, color);
|
||||
|
|
|
|||
|
|
@ -42,14 +42,8 @@
|
|||
#include "lllogchat.h"
|
||||
|
||||
class LLChat;
|
||||
class LLViewerTextEditor;
|
||||
class LLMessageSystem;
|
||||
class LLUUID;
|
||||
class LLCheckBoxCtrl;
|
||||
class LLPanelActiveSpeakers;
|
||||
class LLLogChat;
|
||||
class LLVector3d;
|
||||
class LLWindow;
|
||||
|
||||
enum ELogOptions
|
||||
{
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ void LLPanelFriends::refreshNames(U32 changed_mask)
|
|||
// Changed item in place, need to request sort and update columns
|
||||
// because we might have changed data in a column on which the user
|
||||
// has already sorted. JC
|
||||
mFriendsList->sortItems();
|
||||
mFriendsList->updateSort();
|
||||
|
||||
// re-select items
|
||||
mFriendsList->selectMultiple(selected_ids);
|
||||
|
|
|
|||
|
|
@ -1000,7 +1000,7 @@ BOOL LLFloaterInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
|||
{
|
||||
// Check to see if we are auto scrolling from the last frame
|
||||
LLInventoryPanel* panel = (LLInventoryPanel*)this->getActivePanel();
|
||||
BOOL needsToScroll = panel->getScrollableContainer()->needsToScroll(x, y, LLScrollContainer::VERTICAL);
|
||||
BOOL needsToScroll = panel->getScrollableContainer()->autoScroll(x, y);
|
||||
if(mFilterTabs)
|
||||
{
|
||||
if(needsToScroll)
|
||||
|
|
@ -1320,9 +1320,11 @@ LLInventoryFilter::EFolderShow LLInventoryPanel::getShowFolderState()
|
|||
return mFolders->getFilter()->getShowFolderState();
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_REFRESH("Inventory Refresh");
|
||||
|
||||
void LLInventoryPanel::modelChanged(U32 mask)
|
||||
{
|
||||
LLFastTimer t2(LLFastTimer::FTM_REFRESH);
|
||||
LLFastTimer t2(FTM_REFRESH);
|
||||
|
||||
bool handled = false;
|
||||
if(mask & LLInventoryObserver::LABEL)
|
||||
|
|
|
|||
|
|
@ -2847,11 +2847,7 @@ void LLPanelLandCovenant::updateCovenantText(const std::string &string)
|
|||
if (self)
|
||||
{
|
||||
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("covenant_editor");
|
||||
if (editor)
|
||||
{
|
||||
editor->setHandleEditKeysDirectly(TRUE);
|
||||
editor->setText(string);
|
||||
}
|
||||
editor->setText(string);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ class LLTextBox;
|
|||
class LLTextEditor;
|
||||
class LLTextureCtrl;
|
||||
class LLUIImage;
|
||||
class LLViewerTextEditor;
|
||||
class LLParcelSelection;
|
||||
|
||||
class LLPanelLandGeneral;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
#include "llscrolllistitem.h"
|
||||
#include "llpanel.h"
|
||||
#include "llcombobox.h"
|
||||
#include "llviewertexteditor.h"
|
||||
|
||||
const S32 NOTIFICATION_PANEL_HEADER_HEIGHT = 20;
|
||||
const S32 HEADER_PADDING = 38;
|
||||
|
|
@ -250,7 +249,7 @@ LLFloaterNotification::LLFloaterNotification(LLNotification* note)
|
|||
BOOL LLFloaterNotification::postBuild()
|
||||
{
|
||||
setTitle(mNote->getName());
|
||||
getChild<LLViewerTextEditor>("payload")->setText(mNote->getMessage());
|
||||
getChild<LLUICtrl>("payload")->setValue(mNote->getMessage());
|
||||
|
||||
LLComboBox* responses_combo = getChild<LLComboBox>("response");
|
||||
LLCtrlListInterface* response_list = responses_combo->getListInterface();
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@
|
|||
#include "llagent.h"
|
||||
#include "llui.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "llviewertexteditor.h"
|
||||
#include "llbutton.h"
|
||||
#include "lltexteditor.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewernetwork.h"
|
||||
|
|
@ -104,14 +104,8 @@ BOOL LLFloaterPostcard::postBuild()
|
|||
gAgent.buildFullname(name_string);
|
||||
childSetValue("name_form", LLSD(name_string));
|
||||
|
||||
LLTextEditor* MsgField = getChild<LLTextEditor>("msg_form");
|
||||
if (MsgField)
|
||||
{
|
||||
MsgField->setWordWrap(TRUE);
|
||||
|
||||
// For the first time a user focusess to .the msg box, all text will be selected.
|
||||
MsgField->setFocusChangedCallback(onMsgFormFocusRecieved, this);
|
||||
}
|
||||
// For the first time a user focusess to .the msg box, all text will be selected.
|
||||
getChild<LLUICtrl>("msg_form")->setFocusChangedCallback(onMsgFormFocusRecieved, this);
|
||||
|
||||
childSetFocus("to_form", TRUE);
|
||||
|
||||
|
|
|
|||
|
|
@ -62,13 +62,11 @@
|
|||
#include "llpanellogin.h"
|
||||
#include "llradiogroup.h"
|
||||
#include "llsky.h"
|
||||
#include "llstylemap.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "llscrolllistitem.h"
|
||||
#include "llsliderctrl.h"
|
||||
#include "lltabcontainer.h"
|
||||
#include "lltrans.h"
|
||||
#include "lltexteditor.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewercamera.h"
|
||||
#include "llviewerwindow.h"
|
||||
|
|
@ -169,7 +167,6 @@ void LLVoiceSetKeyDialog::onCancel(void* user_data)
|
|||
// a static member and update all our static callbacks
|
||||
|
||||
void free_web_media(LLMediaBase *media_source);
|
||||
void handleHTMLLinkColorChanged(const LLSD& newvalue);
|
||||
void handleNameTagOptionChanged(const LLSD& newvalue);
|
||||
LLMediaBase *get_web_media();
|
||||
bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response);
|
||||
|
|
@ -239,12 +236,6 @@ bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response
|
|||
return false;
|
||||
}
|
||||
|
||||
void handleHTMLLinkColorChanged(const LLSD& newvalue)
|
||||
{
|
||||
LLTextEditor::setLinkColor(LLColor4(newvalue));
|
||||
LLStyleMap::instance().update();
|
||||
|
||||
}
|
||||
void handleNameTagOptionChanged(const LLSD& newvalue)
|
||||
{
|
||||
S32 name_tag_option = S32(newvalue);
|
||||
|
|
@ -458,14 +449,12 @@ void LLFloaterPreference::apply()
|
|||
}
|
||||
free_web_media(media_source);
|
||||
|
||||
LLTextEditor* busy = getChild<LLTextEditor>("busy_response");
|
||||
LLWString busy_response;
|
||||
if (busy) busy_response = busy->getWText();
|
||||
LLWStringUtil::replaceTabsWithSpaces(busy_response, 4);
|
||||
// LLWString busy_response = utf8str_to_wstring(getChild<LLUICtrl>("busy_response")->getValue().asString());
|
||||
// LLWStringUtil::replaceTabsWithSpaces(busy_response, 4);
|
||||
|
||||
if(mGotPersonalInfo)
|
||||
{
|
||||
gSavedPerAccountSettings.setString("BusyModeResponse2", std::string(wstring_to_utf8str(busy_response)));
|
||||
// gSavedSettings.setString("BusyModeResponse2", std::string(wstring_to_utf8str(busy_response)));
|
||||
bool new_im_via_email = childGetValue("send_im_to_email").asBoolean();
|
||||
bool new_hide_online = childGetValue("online_visibility").asBoolean();
|
||||
|
||||
|
|
@ -1172,13 +1161,13 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im
|
|||
childSetValue("send_im_to_email", im_via_email);
|
||||
childEnable("log_instant_messages");
|
||||
// childEnable("log_chat");
|
||||
childEnable("busy_response");
|
||||
// childEnable("busy_response");
|
||||
// childEnable("log_instant_messages_timestamp");
|
||||
// childEnable("log_chat_timestamp");
|
||||
childEnable("log_chat_IM");
|
||||
childEnable("log_date_timestamp");
|
||||
|
||||
childSetText("busy_response", gSavedPerAccountSettings.getString("BusyModeResponse2"));
|
||||
// childSetText("busy_response", gSavedSettings.getString("BusyModeResponse2"));
|
||||
|
||||
enableHistory();
|
||||
std::string display_email(email);
|
||||
|
|
@ -1349,8 +1338,7 @@ static LLRegisterPanelClassWrapper<LLPanelPreference> t_places("panel_preference
|
|||
LLPanelPreference::LLPanelPreference()
|
||||
: LLPanel()
|
||||
{
|
||||
//
|
||||
mCommitCallbackRegistrar.add("setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2));
|
||||
mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2));
|
||||
}
|
||||
|
||||
static void applyUIColor(const std::string& color_name, LLUICtrl* ctrl, const LLSD& param)
|
||||
|
|
@ -1422,23 +1410,17 @@ BOOL LLPanelPreference::postBuild()
|
|||
//////
|
||||
if(hasChild("online_visibility") && hasChild("send_im_to_email"))
|
||||
{
|
||||
requires("online_visibility");
|
||||
requires("send_im_to_email");
|
||||
if (!checkRequirements())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
childSetText("email_address",getString("log_in_to_change") );
|
||||
childSetText("busy_response", getString("log_in_to_change"));
|
||||
// childSetText("busy_response", getString("log_in_to_change"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(hasChild("fullscreen combo"))
|
||||
if(hasChild("aspect_ratio"))
|
||||
{
|
||||
//============================================================================
|
||||
// Resolution
|
||||
|
||||
/*
|
||||
S32 num_resolutions = 0;
|
||||
LLWindow::LLWindowResolution* supported_resolutions = gViewerWindow->getWindow()->getSupportedResolutions(num_resolutions);
|
||||
|
||||
|
|
@ -1481,7 +1463,7 @@ BOOL LLPanelPreference::postBuild()
|
|||
ctrl_full_screen->setCurrentByIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
LLFloaterPreference::initWindowSizeControls(this);
|
||||
|
||||
if (gSavedSettings.getBOOL("FullScreenAutoDetectAspectRatio"))
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
#include "llavataractions.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "llspinctrl.h"
|
||||
#include "llradiogroup.h"
|
||||
#include "llresmgr.h"
|
||||
#include "roles_constants.h"
|
||||
|
|
@ -151,7 +152,7 @@ BOOL LLFloaterProperties::postBuild()
|
|||
getChild<LLUICtrl>("CheckPurchase")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this));
|
||||
getChild<LLUICtrl>("RadioSaleType")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleType, this));
|
||||
// "Price" label for edit
|
||||
getChild<LLUICtrl>("EditPrice")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this));
|
||||
getChild<LLUICtrl>("Edit Cost")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this));
|
||||
// The UI has been built, now fill in all the values
|
||||
refresh();
|
||||
|
||||
|
|
@ -195,7 +196,7 @@ void LLFloaterProperties::refresh()
|
|||
"CheckNextOwnerTransfer",
|
||||
"CheckPurchase",
|
||||
"RadioSaleType",
|
||||
"EditPrice"
|
||||
"Edit Cost"
|
||||
};
|
||||
for(size_t t=0; t<LL_ARRAY_SIZE(enableNames); ++t)
|
||||
{
|
||||
|
|
@ -499,7 +500,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
|
|||
|
||||
childSetEnabled("RadioSaleType",is_complete && is_for_sale);
|
||||
childSetEnabled("TextPrice",is_complete && is_for_sale);
|
||||
childSetEnabled("EditPrice",is_complete && is_for_sale);
|
||||
childSetEnabled("Edit Cost",is_complete && is_for_sale);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -513,11 +514,13 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
|
|||
|
||||
childSetEnabled("RadioSaleType",FALSE);
|
||||
childSetEnabled("TextPrice",FALSE);
|
||||
childSetEnabled("EditPrice",FALSE);
|
||||
childSetEnabled("Edit Cost",FALSE);
|
||||
}
|
||||
|
||||
// Set values.
|
||||
childSetValue("CheckPurchase", is_for_sale);
|
||||
childSetEnabled("combobox sale copy", is_for_sale);
|
||||
childSetEnabled("Edit Cost", is_for_sale);
|
||||
childSetValue("CheckNextOwnerModify",LLSD(BOOL(next_owner_mask & PERM_MODIFY)));
|
||||
childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY)));
|
||||
childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER)));
|
||||
|
|
@ -528,12 +531,12 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
|
|||
radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1);
|
||||
S32 numerical_price;
|
||||
numerical_price = sale_info.getSalePrice();
|
||||
childSetText("EditPrice",llformat("%d",numerical_price));
|
||||
childSetText("Edit Cost",llformat("%d",numerical_price));
|
||||
}
|
||||
else
|
||||
{
|
||||
radioSaleType->setSelectedIndex(-1);
|
||||
childSetText("EditPrice",llformat("%d",0));
|
||||
childSetText("Edit Cost",llformat("%d",0));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -790,12 +793,13 @@ void LLFloaterProperties::updateSaleInfo()
|
|||
sale_type = LLSaleInfo::FS_ORIGINAL;
|
||||
}
|
||||
|
||||
LLLineEditor* EditPrice = getChild<LLLineEditor>("EditPrice");
|
||||
// LLLineEditor* EditPrice = getChild<LLLineEditor>("EditPrice");
|
||||
LLSpinCtrl *EditPrice = getChild<LLSpinCtrl>("Edit Cost");
|
||||
|
||||
S32 price = -1;
|
||||
if(EditPrice)
|
||||
{
|
||||
price = atoi(EditPrice->getText().c_str());
|
||||
price = EditPrice->getValue().asInteger();;
|
||||
}
|
||||
// Invalid data - turn off the sale
|
||||
if (price < 0)
|
||||
|
|
|
|||
|
|
@ -2746,7 +2746,6 @@ BOOL LLPanelEstateCovenant::postBuild()
|
|||
mEstateOwnerText = getChild<LLTextBox>("estate_owner_text");
|
||||
mLastModifiedText = getChild<LLTextBox>("covenant_timestamp_text");
|
||||
mEditor = getChild<LLViewerTextEditor>("covenant_editor");
|
||||
if (mEditor) mEditor->setHandleEditKeysDirectly(TRUE);
|
||||
LLButton* reset_button = getChild<LLButton>("reset_covenant");
|
||||
reset_button->setEnabled(gAgent.canManageEstate());
|
||||
reset_button->setClickedCallback(LLPanelEstateCovenant::resetCovenantID, NULL);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
#include "llversionviewer.h"
|
||||
#include "message.h"
|
||||
#include "v3math.h"
|
||||
#include "lltexteditor.h"
|
||||
|
||||
// viewer project includes
|
||||
#include "llagent.h"
|
||||
|
|
@ -61,7 +62,6 @@
|
|||
#include "llimview.h"
|
||||
#include "lltextbox.h"
|
||||
#include "lldispatcher.h"
|
||||
#include "llviewertexteditor.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llcombobox.h"
|
||||
|
|
|
|||
|
|
@ -80,9 +80,6 @@ BOOL LLFloaterScriptDebug::postBuild()
|
|||
|
||||
if (mTabContainer)
|
||||
{
|
||||
// *FIX: apparantly fails for tab containers?
|
||||
// mTabContainer->requires<LLFloater>("all_scripts");
|
||||
// mTabContainer->checkRequirements();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "llspinctrl.h"
|
||||
#include "llcolorswatch.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "lltexteditor.h"
|
||||
|
||||
|
||||
LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
|
||||
#include "llcontrol.h"
|
||||
#include "llfloater.h"
|
||||
#include "lltexteditor.h"
|
||||
|
||||
class LLFloaterSettingsDebug
|
||||
: public LLFloater
|
||||
|
|
@ -60,7 +59,7 @@ private:
|
|||
virtual ~LLFloaterSettingsDebug();
|
||||
|
||||
protected:
|
||||
LLTextEditor* mComment;
|
||||
class LLTextEditor* mComment;
|
||||
};
|
||||
|
||||
#endif //LLFLOATERDEBUGSETTINGS_H
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue