diff options
author | Monroe Williams <monroe@lindenlab.com> | 2007-08-02 01:18:34 +0000 |
---|---|---|
committer | Monroe Williams <monroe@lindenlab.com> | 2007-08-02 01:18:34 +0000 |
commit | 7138fb673ac3df46b9cb5f23d0d74e70fdd2b6b3 (patch) | |
tree | 3c34a3a180b5275bd4166b0056765c5868f56447 /indra/llui/llui.h | |
parent | f6a10b3214d79df4e8f5768acaa68edbd2de5620 (diff) |
Merge down from Branch_1-18-1:
svn merge --ignore-ancestry svn+ssh://svn.lindenlab.com/svn/linden/release@66449 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-18-1@67131
Diffstat (limited to 'indra/llui/llui.h')
-rw-r--r-- | indra/llui/llui.h | 57 |
1 files changed, 44 insertions, 13 deletions
diff --git a/indra/llui/llui.h b/indra/llui/llui.h index dbe79338e5..fefe75f43e 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -16,6 +16,8 @@ #include "llrect.h" #include "llcoord.h" #include "llhtmlhelp.h" +#include "llgl.h" +#include <stack> class LLColor4; class LLVector3; @@ -123,7 +125,7 @@ extern BOOL gShowTextEditCursor; extern LLString gLanguage; class LLImageProviderInterface; -typedef void (*LLUIAudioCallback)(const LLUUID& uuid, F32 volume); +typedef void (*LLUIAudioCallback)(const LLUUID& uuid); class LLUI { @@ -144,8 +146,8 @@ public: //helper functions (should probably move free standing rendering helper functions here) static LLString locateSkin(const LLString& filename); - static void setScissorRegionScreen(const LLRect& rect); - static void setScissorRegionLocal(const LLRect& rect); // works assuming LLUI::translate has been called + static void pushClipRect(const LLRect& rect); + static void popClipRect(); static void setCursorPositionScreen(S32 x, S32 y); static void setCursorPositionLocal(LLView* viewp, S32 x, S32 y); static void setScaleFactor(const LLVector2& scale_factor); @@ -153,6 +155,11 @@ public: static LLUUID findAssetUUIDByName(const LLString& name); static LLVector2 getWindowSize(); static void setHtmlHelp(LLHtmlHelp* html_help); + +private: + static void setScissorRegionScreen(const LLRect& rect); + static void setScissorRegionLocal(const LLRect& rect); // works assuming LLUI::translate has been called + public: static LLControlGroup* sConfigGroup; static LLControlGroup* sColorsGroup; @@ -163,6 +170,8 @@ public: static LLWindow* sWindow; static BOOL sShowXUINames; static LLHtmlHelp* sHtmlHelp; + static std::stack<LLRect> sClipRectStack; + }; // UI widgets @@ -251,6 +260,7 @@ typedef enum e_widget_type WIDGET_TYPE_TEXTURE_VIEW, WIDGET_TYPE_MEMORY_VIEW, WIDGET_TYPE_FRAME_STAT_VIEW, + WIDGET_TYPE_LAYOUT_STACK, WIDGET_TYPE_DONTCARE, WIDGET_TYPE_COUNT } EWidgetType; @@ -272,38 +282,38 @@ public: } // default show and hide methods - static T* showInstance(const LLSD& seed) + static T* showInstance(const LLSD& seed = LLSD()) { T* instance = INSTANCE_ADAPTOR::getInstance(seed); INSTANCE_ADAPTOR::show(instance); return instance; } - static void hideInstance(const LLSD& seed) + static void hideInstance(const LLSD& seed = LLSD()) { T* instance = INSTANCE_ADAPTOR::getInstance(seed); INSTANCE_ADAPTOR::hide(instance); } - static void toggleInstance(const LLSD& seed) + static void toggleInstance(const LLSD& seed = LLSD()) { - if (!INSTANCE_ADAPTOR::instanceVisible(seed)) + if (INSTANCE_ADAPTOR::instanceVisible(seed)) { - INSTANCE_ADAPTOR::showInstance(seed); + INSTANCE_ADAPTOR::hideInstance(seed); } else { - INSTANCE_ADAPTOR::hideInstance(seed); + INSTANCE_ADAPTOR::showInstance(seed); } } - static BOOL instanceVisible(const LLSD& seed) + static BOOL instanceVisible(const LLSD& seed = LLSD()) { T* instance = INSTANCE_ADAPTOR::findInstance(seed); return instance != NULL && INSTANCE_ADAPTOR::visible(instance); } - static T* getInstance(const LLSD& seed) + static T* getInstance(const LLSD& seed = LLSD()) { T* instance = INSTANCE_ADAPTOR::findInstance(seed); if (instance == NULL) @@ -312,6 +322,7 @@ public: } return instance; } + }; // Creates a UI singleton by ignoring the identifying parameter @@ -326,12 +337,12 @@ public: LLUISingleton() : LLUIInstanceMgr<T, INSTANCE_ADAPTOR>() { sInstance = (T*)this; } ~LLUISingleton() { sInstance = NULL; } - static T* findInstance(const LLSD& seed) + static T* findInstance(const LLSD& seed = LLSD()) { return sInstance; } - static T* createInstance(const LLSD& seed) + static T* createInstance(const LLSD& seed = LLSD()) { if (sInstance == NULL) { @@ -346,4 +357,24 @@ protected: template <class T, class U> T* LLUISingleton<T,U>::sInstance = NULL; +class LLClipRect +{ +public: + LLClipRect(const LLRect& rect, BOOL enabled = TRUE); + virtual ~LLClipRect(); +protected: + LLGLState mScissorState; + BOOL mEnabled; +}; + +class LLLocalClipRect +{ +public: + LLLocalClipRect(const LLRect& rect, BOOL enabled = TRUE); + virtual ~LLLocalClipRect(); +protected: + LLGLState mScissorState; + BOOL mEnabled; +}; + #endif |