diff options
| author | Loren Shih <seraph@lindenlab.com> | 2009-12-09 14:53:12 -0500 |
|---|---|---|
| committer | Loren Shih <seraph@lindenlab.com> | 2009-12-09 14:53:12 -0500 |
| commit | f7215a5d7cb4f6431bbd63c42617b0a3dd207ac3 (patch) | |
| tree | 0d84524f0269a6b982db3376658df19a9eebf7c1 /indra/llui/lluiimage.cpp | |
| parent | 96d5f52624d68768592893ee0b27a0589b0f6222 (diff) | |
| parent | 2c0cea901712ffad012356278d72e3c3d844e5bc (diff) | |
automated merge viewer2.0->avp
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/llui/lluiimage.cpp')
| -rw-r--r-- | indra/llui/lluiimage.cpp | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index a8683e55c3..f941f391eb 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -39,18 +39,20 @@ #include "lluiimage.h" #include "llui.h" -LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image) : - mName(name), - mImage(image), - mScaleRegion(0.f, 1.f, 1.f, 0.f), - mClipRegion(0.f, 1.f, 1.f, 0.f), - mUniformScaling(TRUE), - mNoClip(TRUE) +LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image) +: mName(name), + mImage(image), + mScaleRegion(0.f, 1.f, 1.f, 0.f), + mClipRegion(0.f, 1.f, 1.f, 0.f), + mUniformScaling(TRUE), + mNoClip(TRUE), + mImageLoaded(NULL) { } LLUIImage::~LLUIImage() { + delete mImageLoaded; } void LLUIImage::setClipRegion(const LLRectf& region) @@ -138,6 +140,25 @@ S32 LLUIImage::getTextureHeight() const return mImage->getHeight(0); } +boost::signals2::connection LLUIImage::addLoadedCallback( const image_loaded_signal_t::slot_type& cb ) +{ + if (!mImageLoaded) + { + mImageLoaded = new image_loaded_signal_t(); + } + return mImageLoaded->connect(cb); +} + + +void LLUIImage::onImageLoaded() +{ + if (mImageLoaded) + { + (*mImageLoaded)(); + } +} + + namespace LLInitParam { LLUIImage* TypedParam<LLUIImage*>::getValueFromBlock() const @@ -170,3 +191,4 @@ namespace LLInitParam return (a == b); } } + |
