diff options
Diffstat (limited to 'linden/indra/llui/llui.h')
-rw-r--r-- | linden/indra/llui/llui.h | 57 |
1 files changed, 44 insertions, 13 deletions
diff --git a/linden/indra/llui/llui.h b/linden/indra/llui/llui.h index 3085bd9..201d88f 100644 --- a/linden/indra/llui/llui.h +++ b/linden/indra/llui/llui.h | |||
@@ -36,6 +36,8 @@ | |||
36 | #include "llrect.h" | 36 | #include "llrect.h" |
37 | #include "llcoord.h" | 37 | #include "llcoord.h" |
38 | #include "llhtmlhelp.h" | 38 | #include "llhtmlhelp.h" |
39 | #include "llgl.h" | ||
40 | #include <stack> | ||
39 | 41 | ||
40 | class LLColor4; | 42 | class LLColor4; |
41 | class LLVector3; | 43 | class LLVector3; |
@@ -143,7 +145,7 @@ extern BOOL gShowTextEditCursor; | |||
143 | extern LLString gLanguage; | 145 | extern LLString gLanguage; |
144 | 146 | ||
145 | class LLImageProviderInterface; | 147 | class LLImageProviderInterface; |
146 | typedef void (*LLUIAudioCallback)(const LLUUID& uuid, F32 volume); | 148 | typedef void (*LLUIAudioCallback)(const LLUUID& uuid); |
147 | 149 | ||
148 | class LLUI | 150 | class LLUI |
149 | { | 151 | { |
@@ -164,8 +166,8 @@ public: | |||
164 | 166 | ||
165 | //helper functions (should probably move free standing rendering helper functions here) | 167 | //helper functions (should probably move free standing rendering helper functions here) |
166 | static LLString locateSkin(const LLString& filename); | 168 | static LLString locateSkin(const LLString& filename); |
167 | static void setScissorRegionScreen(const LLRect& rect); | 169 | static void pushClipRect(const LLRect& rect); |
168 | static void setScissorRegionLocal(const LLRect& rect); // works assuming LLUI::translate has been called | 170 | static void popClipRect(); |
169 | static void setCursorPositionScreen(S32 x, S32 y); | 171 | static void setCursorPositionScreen(S32 x, S32 y); |
170 | static void setCursorPositionLocal(LLView* viewp, S32 x, S32 y); | 172 | static void setCursorPositionLocal(LLView* viewp, S32 x, S32 y); |
171 | static void setScaleFactor(const LLVector2& scale_factor); | 173 | static void setScaleFactor(const LLVector2& scale_factor); |
@@ -173,6 +175,11 @@ public: | |||
173 | static LLUUID findAssetUUIDByName(const LLString& name); | 175 | static LLUUID findAssetUUIDByName(const LLString& name); |
174 | static LLVector2 getWindowSize(); | 176 | static LLVector2 getWindowSize(); |
175 | static void setHtmlHelp(LLHtmlHelp* html_help); | 177 | static void setHtmlHelp(LLHtmlHelp* html_help); |
178 | |||
179 | private: | ||
180 | static void setScissorRegionScreen(const LLRect& rect); | ||
181 | static void setScissorRegionLocal(const LLRect& rect); // works assuming LLUI::translate has been called | ||
182 | |||
176 | public: | 183 | public: |
177 | static LLControlGroup* sConfigGroup; | 184 | static LLControlGroup* sConfigGroup; |
178 | static LLControlGroup* sColorsGroup; | 185 | static LLControlGroup* sColorsGroup; |
@@ -183,6 +190,8 @@ public: | |||
183 | static LLWindow* sWindow; | 190 | static LLWindow* sWindow; |
184 | static BOOL sShowXUINames; | 191 | static BOOL sShowXUINames; |
185 | static LLHtmlHelp* sHtmlHelp; | 192 | static LLHtmlHelp* sHtmlHelp; |
193 | static std::stack<LLRect> sClipRectStack; | ||
194 | |||
186 | }; | 195 | }; |
187 | 196 | ||
188 | // UI widgets | 197 | // UI widgets |
@@ -271,6 +280,7 @@ typedef enum e_widget_type | |||
271 | WIDGET_TYPE_TEXTURE_VIEW, | 280 | WIDGET_TYPE_TEXTURE_VIEW, |
272 | WIDGET_TYPE_MEMORY_VIEW, | 281 | WIDGET_TYPE_MEMORY_VIEW, |
273 | WIDGET_TYPE_FRAME_STAT_VIEW, | 282 | WIDGET_TYPE_FRAME_STAT_VIEW, |
283 | WIDGET_TYPE_LAYOUT_STACK, | ||
274 | WIDGET_TYPE_DONTCARE, | 284 | WIDGET_TYPE_DONTCARE, |
275 | WIDGET_TYPE_COUNT | 285 | WIDGET_TYPE_COUNT |
276 | } EWidgetType; | 286 | } EWidgetType; |
@@ -292,38 +302,38 @@ public: | |||
292 | } | 302 | } |
293 | 303 | ||
294 | // default show and hide methods | 304 | // default show and hide methods |
295 | static T* showInstance(const LLSD& seed) | 305 | static T* showInstance(const LLSD& seed = LLSD()) |
296 | { | 306 | { |
297 | T* instance = INSTANCE_ADAPTOR::getInstance(seed); | 307 | T* instance = INSTANCE_ADAPTOR::getInstance(seed); |
298 | INSTANCE_ADAPTOR::show(instance); | 308 | INSTANCE_ADAPTOR::show(instance); |
299 | return instance; | 309 | return instance; |
300 | } | 310 | } |
301 | 311 | ||
302 | static void hideInstance(const LLSD& seed) | 312 | static void hideInstance(const LLSD& seed = LLSD()) |
303 | { | 313 | { |
304 | T* instance = INSTANCE_ADAPTOR::getInstance(seed); | 314 | T* instance = INSTANCE_ADAPTOR::getInstance(seed); |
305 | INSTANCE_ADAPTOR::hide(instance); | 315 | INSTANCE_ADAPTOR::hide(instance); |
306 | } | 316 | } |
307 | 317 | ||
308 | static void toggleInstance(const LLSD& seed) | 318 | static void toggleInstance(const LLSD& seed = LLSD()) |
309 | { | 319 | { |
310 | if (!INSTANCE_ADAPTOR::instanceVisible(seed)) | 320 | if (INSTANCE_ADAPTOR::instanceVisible(seed)) |
311 | { | 321 | { |
312 | INSTANCE_ADAPTOR::showInstance(seed); | 322 | INSTANCE_ADAPTOR::hideInstance(seed); |
313 | } | 323 | } |
314 | else | 324 | else |
315 | { | 325 | { |
316 | INSTANCE_ADAPTOR::hideInstance(seed); | 326 | INSTANCE_ADAPTOR::showInstance(seed); |
317 | } | 327 | } |
318 | } | 328 | } |
319 | 329 | ||
320 | static BOOL instanceVisible(const LLSD& seed) | 330 | static BOOL instanceVisible(const LLSD& seed = LLSD()) |
321 | { | 331 | { |
322 | T* instance = INSTANCE_ADAPTOR::findInstance(seed); | 332 | T* instance = INSTANCE_ADAPTOR::findInstance(seed); |
323 | return instance != NULL && INSTANCE_ADAPTOR::visible(instance); | 333 | return instance != NULL && INSTANCE_ADAPTOR::visible(instance); |
324 | } | 334 | } |
325 | 335 | ||
326 | static T* getInstance(const LLSD& seed) | 336 | static T* getInstance(const LLSD& seed = LLSD()) |
327 | { | 337 | { |
328 | T* instance = INSTANCE_ADAPTOR::findInstance(seed); | 338 | T* instance = INSTANCE_ADAPTOR::findInstance(seed); |
329 | if (instance == NULL) | 339 | if (instance == NULL) |
@@ -332,6 +342,7 @@ public: | |||
332 | } | 342 | } |
333 | return instance; | 343 | return instance; |
334 | } | 344 | } |
345 | |||
335 | }; | 346 | }; |
336 | 347 | ||
337 | // Creates a UI singleton by ignoring the identifying parameter | 348 | // Creates a UI singleton by ignoring the identifying parameter |
@@ -346,12 +357,12 @@ public: | |||
346 | LLUISingleton() : LLUIInstanceMgr<T, INSTANCE_ADAPTOR>() { sInstance = (T*)this; } | 357 | LLUISingleton() : LLUIInstanceMgr<T, INSTANCE_ADAPTOR>() { sInstance = (T*)this; } |
347 | ~LLUISingleton() { sInstance = NULL; } | 358 | ~LLUISingleton() { sInstance = NULL; } |
348 | 359 | ||
349 | static T* findInstance(const LLSD& seed) | 360 | static T* findInstance(const LLSD& seed = LLSD()) |
350 | { | 361 | { |
351 | return sInstance; | 362 | return sInstance; |
352 | } | 363 | } |
353 | 364 | ||
354 | static T* createInstance(const LLSD& seed) | 365 | static T* createInstance(const LLSD& seed = LLSD()) |
355 | { | 366 | { |
356 | if (sInstance == NULL) | 367 | if (sInstance == NULL) |
357 | { | 368 | { |
@@ -366,4 +377,24 @@ protected: | |||
366 | 377 | ||
367 | template <class T, class U> T* LLUISingleton<T,U>::sInstance = NULL; | 378 | template <class T, class U> T* LLUISingleton<T,U>::sInstance = NULL; |
368 | 379 | ||
380 | class LLClipRect | ||
381 | { | ||
382 | public: | ||
383 | LLClipRect(const LLRect& rect, BOOL enabled = TRUE); | ||
384 | virtual ~LLClipRect(); | ||
385 | protected: | ||
386 | LLGLState mScissorState; | ||
387 | BOOL mEnabled; | ||
388 | }; | ||
389 | |||
390 | class LLLocalClipRect | ||
391 | { | ||
392 | public: | ||
393 | LLLocalClipRect(const LLRect& rect, BOOL enabled = TRUE); | ||
394 | virtual ~LLLocalClipRect(); | ||
395 | protected: | ||
396 | LLGLState mScissorState; | ||
397 | BOOL mEnabled; | ||
398 | }; | ||
399 | |||
369 | #endif | 400 | #endif |