From d6101558a171dbd2390792ac1e78d09fc2c27711 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 6 Jul 2009 21:58:04 +0000 Subject: Merge xui-army-5 to viewer-2, includes layout, art, and color changes, also UI color refactoring and new FreeType font library on Linux. svn merge -r126038:126164 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/xui-army-5 --- indra/llui/llui.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'indra/llui/llui.h') diff --git a/indra/llui/llui.h b/indra/llui/llui.h index dbd295d4e8..c0873247c0 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -45,6 +45,8 @@ #include "lluiimage.h" // *TODO: break this dependency, need to add #include "lluiimage.h" to all widgets that hold an Optional in their paramblocks #include "llinitparam.h" #include "llregistry.h" +#include "lluicolor.h" +#include "lluicolortable.h" #include #include "lllazyvalue.h" @@ -202,7 +204,6 @@ public: static void screenRectToGL(const LLRect& screen, LLRect *gl); static void glRectToScreen(const LLRect& gl, LLRect *screen); static void setHtmlHelp(LLHtmlHelp* html_help); - static boost::function getCachedColorFunctor(const std::string& color_name); // Returns the control group containing the control name, or the default group static LLControlGroup& getControlControlGroup (const std::string& controlname); @@ -690,8 +691,6 @@ public: {} }; -typedef LLLazyValue LLUIColor; - namespace LLInitParam { template<> @@ -767,11 +766,4 @@ namespace LLInitParam }; } -namespace LLInitParam -{ - template<> - bool ParamCompare >::equals( - const LLLazyValue &a, const LLLazyValue &b); -} - #endif -- cgit v1.2.3 From 52aeaa32841e7d0b37abab0a2a2540c2be2f16b7 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 7 Jul 2009 00:53:05 +0000 Subject: Merge skinning-14 to viewer-2, including refactoring many floaters to register them with LLFloaterReg, support for introspection of ParamBlock based UI widgets to dump XML schema, splitting llfolderview.cpp into three separate files to unravel dependencies and skeleton for for LLListView widget. Resolved conflicts in these files: lldraghandle.h, lluictrl.h, llchiclet.cpp, llfolderview.h/cpp, lliinventorybridge.cpp, llpanelpicks.cpp, llviewermenu.cpp, floater_mute.xml, floater_preferences.xml, notifications.xml, panel_preferences_audio.xml, panel_preferences_graphics1.xml, panel_region_general.xml svn merge -r124961:126284 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-14 --- indra/llui/llui.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llui/llui.h') diff --git a/indra/llui/llui.h b/indra/llui/llui.h index c0873247c0..c4cdbf2c14 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -706,7 +706,7 @@ namespace LLInitParam width, height; - TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func); + TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); LLRect getValueFromBlock() const; }; @@ -729,7 +729,7 @@ namespace LLInitParam Optional alpha; Optional control; - TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func); + TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); LLUIColor getValueFromBlock() const; }; @@ -743,7 +743,7 @@ namespace LLInitParam Optional size; Optional style; - TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL* const value, ParamDescriptor::validation_func_t func); + TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL* const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); const LLFontGL* getValueFromBlock() const; }; -- cgit v1.2.3 From 77f56a3f3db72b2938eadb0868fc7be975dabafa Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 10 Jul 2009 22:02:26 +0000 Subject: merge QAR-1579: texture-cleanup-1. --- indra/llui/llui.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'indra/llui/llui.h') diff --git a/indra/llui/llui.h b/indra/llui/llui.h index c4cdbf2c14..6f0da05535 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -58,7 +58,6 @@ class LLColor4; class LLHtmlHelp; -class LLImageGL; class LLVector3; class LLVector2; class LLUIImage; @@ -99,14 +98,14 @@ void gl_washer_2d(F32 outer_radius, F32 inner_radius, S32 steps, const LLColor4& void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, F32 end_radians, S32 steps, const LLColor4& inner_color, const LLColor4& outer_color); void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LLColor4& inner_color, const LLColor4& outer_color); -void gl_draw_image(S32 x, S32 y, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); -void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); -void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); -void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); -void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLImageGL* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); -void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); +void gl_draw_image(S32 x, S32 y, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); +void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); +void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); +void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); +void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); +void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); // Flip vertical, used for LLFloaterHTML -void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); +void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom); void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase = 0.f ); -- cgit v1.2.3 From 73a97010e6c8c7874fdc1778ab46e492f77d9394 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 21 Jul 2009 00:57:23 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0/indra@1059 https://svn.aws.productengine.com/secondlife/pe/stable-1/indra@1070 -> svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3 --- indra/llui/llui.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llui/llui.h') diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 6f0da05535..9399eff2ab 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -397,7 +397,12 @@ public: delete sInstance; sInstance = NULL; } + + static bool instanceExists() { return NULL != sInstance; } +private: + LLUISingleton(const LLUISingleton&){} + LLUISingleton& operator=(const LLUISingleton&){} private: static T* sInstance; }; -- cgit v1.2.3 From 8f7ec64899c54dcee6caa0307510cc4003ba7bdd Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 27 Jul 2009 17:56:26 +0000 Subject: Merged skinning-17 into viewer-2 for bug fixes. Commented out new IM window for now, not complete. Merging revisions 127913-128319 of svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-17 into D:\viewer-2.0.0-3, respecting ancestry --- indra/llui/llui.h | 137 ++---------------------------------------------------- 1 file changed, 3 insertions(+), 134 deletions(-) (limited to 'indra/llui/llui.h') diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 9399eff2ab..413733a50b 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -39,7 +39,6 @@ #include "llrect.h" #include "llcontrol.h" #include "llcoord.h" -//#include "llhtmlhelp.h" #include "llgl.h" // *TODO: break this dependency #include #include "lluiimage.h" // *TODO: break this dependency, need to add #include "lluiimage.h" to all widgets that hold an Optional in their paramblocks @@ -49,6 +48,8 @@ #include "lluicolortable.h" #include #include "lllazyvalue.h" +#include "llhandle.h" // *TODO: remove this dependency, added as a + // convenience when LLHandle moved to llhandle.h // LLUIFactory #include "llsd.h" @@ -433,139 +434,7 @@ public: LLLocalClipRect(const LLRect& rect, BOOL enabled = TRUE); }; -template -class LLTombStone : public LLRefCount -{ -public: - LLTombStone(T* target = NULL) : mTarget(target) {} - - void setTarget(T* target) { mTarget = target; } - T* getTarget() const { return mTarget; } -private: - T* mTarget; -}; - -// LLHandles are used to refer to objects whose lifetime you do not control or influence. -// Calling get() on a handle will return a pointer to the referenced object or NULL, -// if the object no longer exists. Note that during the lifetime of the returned pointer, -// you are assuming that the object will not be deleted by any action you perform, -// or any other thread, as normal when using pointers, so avoid using that pointer outside of -// the local code block. -// -// https://wiki.lindenlab.com/mediawiki/index.php?title=LLHandle&oldid=79669 - -template -class LLHandle -{ -public: - LLHandle() : mTombStone(sDefaultTombStone) {} - const LLHandle& operator =(const LLHandle& other) - { - mTombStone = other.mTombStone; - return *this; - } - - bool isDead() const - { - return mTombStone->getTarget() == NULL; - } - - void markDead() - { - mTombStone = sDefaultTombStone; - } - - T* get() const - { - return mTombStone->getTarget(); - } - - friend bool operator== (const LLHandle& lhs, const LLHandle& rhs) - { - return lhs.mTombStone == rhs.mTombStone; - } - friend bool operator!= (const LLHandle& lhs, const LLHandle& rhs) - { - return !(lhs == rhs); - } - friend bool operator< (const LLHandle& lhs, const LLHandle& rhs) - { - return lhs.mTombStone < rhs.mTombStone; - } - friend bool operator> (const LLHandle& lhs, const LLHandle& rhs) - { - return lhs.mTombStone > rhs.mTombStone; - } -protected: - -protected: - LLPointer > mTombStone; - -private: - static LLPointer > sDefaultTombStone; -}; - -// initialize static "empty" tombstone pointer -template LLPointer > LLHandle::sDefaultTombStone = new LLTombStone(); - - -template -class LLRootHandle : public LLHandle -{ -public: - LLRootHandle(T* object) { bind(object); } - LLRootHandle() {}; - ~LLRootHandle() { unbind(); } - - // this is redundant, since a LLRootHandle *is* an LLHandle - LLHandle getHandle() { return LLHandle(*this); } - - void bind(T* object) - { - // unbind existing tombstone - if (LLHandle::mTombStone.notNull()) - { - if (LLHandle::mTombStone->getTarget() == object) return; - LLHandle::mTombStone->setTarget(NULL); - } - // tombstone reference counted, so no paired delete - LLHandle::mTombStone = new LLTombStone(object); - } - - void unbind() - { - LLHandle::mTombStone->setTarget(NULL); - } - - //don't allow copying of root handles, since there should only be one -private: - LLRootHandle(const LLRootHandle& other) {}; -}; - -// Use this as a mixin for simple classes that need handles and when you don't -// want handles at multiple points of the inheritance hierarchy -template -class LLHandleProvider -{ -protected: - typedef LLHandle handle_type_t; - LLHandleProvider() - { - // provided here to enforce T deriving from LLHandleProvider - } - - LLHandle getHandle() - { - // perform lazy binding to avoid small tombstone allocations for handle - // providers whose handles are never referenced - mHandle.bind(static_cast(this)); - return mHandle; - } - -private: - LLRootHandle mHandle; -}; - +// Moved all LLHandle-related code to llhandle.h //RN: maybe this needs to moved elsewhere? class LLImageProviderInterface -- cgit v1.2.3 From eb853f55c07ae4a3c3f2aa05fbabcf2e4b4dc115 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 4 Aug 2009 01:12:59 +0000 Subject: svn merge -r 128442:129343 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-18 into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3 --- indra/llui/llui.h | 187 ------------------------------------------------------ 1 file changed, 187 deletions(-) (limited to 'indra/llui/llui.h') diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 413733a50b..b1943a7b02 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -222,193 +222,6 @@ private: static std::vector sXUIPaths; }; -// FactoryPolicy is a static class that controls the creation and lookup of UI elements, -// such as floaters. -// The key parameter is used to provide a unique identifier and/or associated construction -// parameters for a given UI instance -// -// Specialize this traits for different types, or provide a class with an identical interface -// in the place of the traits parameter -// -// For example: -// -// template <> -// class FactoryPolicy /* FactoryPolicy specialized for MyClass */ -// { -// public: -// static MyClass* findInstance(const LLSD& key = LLSD()) -// { -// /* return instance of MyClass associated with key */ -// } -// -// static MyClass* createInstance(const LLSD& key = LLSD()) -// { -// /* create new instance of MyClass using key for construction parameters */ -// } -// } -// -// class MyClass : public LLUIFactory -// { -// /* uses FactoryPolicy by default */ -// } - -template -class FactoryPolicy -{ -public: - // basic factory methods - static T* findInstance(const LLSD& key); // unimplemented, provide specialiation - static T* createInstance(const LLSD& key); // unimplemented, provide specialiation -}; - -// VisibilityPolicy controls the visibility of UI elements, such as floaters. -// The key parameter is used to store the unique identifier of a given UI instance -// -// Specialize this traits for different types, or duplicate this interface for specific instances -// (see above) - -template -class VisibilityPolicy -{ -public: - // visibility methods - static bool visible(T* instance, const LLSD& key); // unimplemented, provide specialiation - static void show(T* instance, const LLSD& key); // unimplemented, provide specialiation - static void hide(T* instance, const LLSD& key); // unimplemented, provide specialiation -}; - -// Manages generation of UI elements by LLSD, such that (generally) there is -// a unique instance per distinct LLSD parameter -// Class T is the instance type being managed, and the FACTORY_POLICY and VISIBILITY_POLICY -// classes provide static methods for creating, accessing, showing and hiding the associated -// element T -template , class VISIBILITY_POLICY = VisibilityPolicy > -class LLUIFactory -{ -public: - // give names to the template parameters so derived classes can refer to them - // except this doesn't work in gcc - typedef FACTORY_POLICY factory_policy_t; - typedef VISIBILITY_POLICY visibility_policy_t; - - LLUIFactory() - { - } - - virtual ~LLUIFactory() - { - } - - // default show and hide methods - static T* showInstance(const LLSD& key = LLSD()) - { - T* instance = getInstance(key); - if (instance != NULL) - { - VISIBILITY_POLICY::show(instance, key); - } - return instance; - } - - static void hideInstance(const LLSD& key = LLSD()) - { - T* instance = getInstance(key); - if (instance != NULL) - { - VISIBILITY_POLICY::hide(instance, key); - } - } - - static void toggleInstance(const LLSD& key = LLSD()) - { - if (instanceVisible(key)) - { - hideInstance(key); - } - else - { - showInstance(key); - } - } - - static bool instanceVisible(const LLSD& key = LLSD()) - { - T* instance = FACTORY_POLICY::findInstance(key); - return instance != NULL && VISIBILITY_POLICY::visible(instance, key); - } - - static T* getInstance(const LLSD& key = LLSD()) - { - T* instance = FACTORY_POLICY::findInstance(key); - if (instance == NULL) - { - instance = FACTORY_POLICY::createInstance(key); - } - return instance; - } - -}; - - -// Creates a UI singleton by ignoring the identifying parameter -// and always generating the same instance via the LLUIFactory interface. -// Note that since UI elements can be destroyed by their hierarchy, this singleton -// pattern uses a static pointer to an instance that will be re-created as needed. -// -// Usage Pattern: -// -// class LLFloaterFoo : public LLFloater, public LLUISingleton -// { -// friend class LLUISingleton; -// private: -// LLFloaterFoo(const LLSD& key); -// }; -// -// Note that LLUISingleton takes an option VisibilityPolicy parameter that defines -// how showInstance(), hideInstance(), etc. work. -// -// https://wiki.lindenlab.com/mediawiki/index.php?title=LLUISingleton&oldid=79352 - -template > -class LLUISingleton: public LLUIFactory, VISIBILITY_POLICY> -{ -protected: - - // T must derive from LLUISingleton - LLUISingleton() { sInstance = static_cast(this); } - ~LLUISingleton() { sInstance = NULL; } - -public: - static T* findInstance(const LLSD& key = LLSD()) - { - return sInstance; - } - - static T* createInstance(const LLSD& key = LLSD()) - { - if (sInstance == NULL) - { - sInstance = new T(key); - } - return sInstance; - } - - static void destroyInstance() - { - delete sInstance; - sInstance = NULL; - } - - static bool instanceExists() { return NULL != sInstance; } - -private: - LLUISingleton(const LLUISingleton&){} - LLUISingleton& operator=(const LLUISingleton&){} -private: - static T* sInstance; -}; - -template T* LLUISingleton::sInstance = NULL; class LLScreenClipRect { -- cgit v1.2.3