aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llui.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/llui.h')
-rw-r--r--linden/indra/llui/llui.h127
1 files changed, 23 insertions, 104 deletions
diff --git a/linden/indra/llui/llui.h b/linden/indra/llui/llui.h
index 9e275a5..0b06913 100644
--- a/linden/indra/llui/llui.h
+++ b/linden/indra/llui/llui.h
@@ -161,7 +161,6 @@ public:
161 // 161 //
162 static void initClass(LLControlGroup* config, 162 static void initClass(LLControlGroup* config,
163 LLControlGroup* colors, 163 LLControlGroup* colors,
164 LLControlGroup* assets,
165 LLImageProviderInterface* image_provider, 164 LLImageProviderInterface* image_provider,
166 LLUIAudioCallback audio_callback = NULL, 165 LLUIAudioCallback audio_callback = NULL,
167 const LLVector2 *scale_factor = NULL, 166 const LLVector2 *scale_factor = NULL,
@@ -179,8 +178,7 @@ public:
179 static void setCursorPositionLocal(const LLView* viewp, S32 x, S32 y); 178 static void setCursorPositionLocal(const LLView* viewp, S32 x, S32 y);
180 static void setScaleFactor(const LLVector2& scale_factor); 179 static void setScaleFactor(const LLVector2& scale_factor);
181 static void setLineWidth(F32 width); 180 static void setLineWidth(F32 width);
182 static LLUUID findAssetUUIDByName(const LLString& name); 181 static LLUIImage* getUIImage(const LLString& name);
183 static LLUIImage* getUIImageByName(const LLString& name);
184 static LLVector2 getWindowSize(); 182 static LLVector2 getWindowSize();
185 static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); 183 static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y);
186 static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); 184 static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y);
@@ -193,7 +191,6 @@ public:
193 // 191 //
194 static LLControlGroup* sConfigGroup; 192 static LLControlGroup* sConfigGroup;
195 static LLControlGroup* sColorsGroup; 193 static LLControlGroup* sColorsGroup;
196 static LLControlGroup* sAssetsGroup;
197 static LLImageProviderInterface* sImageProvider; 194 static LLImageProviderInterface* sImageProvider;
198 static LLUIAudioCallback sAudioCallback; 195 static LLUIAudioCallback sAudioCallback;
199 static LLVector2 sGLScaleFactor; 196 static LLVector2 sGLScaleFactor;
@@ -209,101 +206,6 @@ public:
209 206
210}; 207};
211 208
212// UI widgets
213// This MUST match UICtrlNames in lluictrlfactory.cpp
214typedef enum e_widget_type
215{
216 WIDGET_TYPE_VIEW = 0,
217 WIDGET_TYPE_ROOT_VIEW,
218 WIDGET_TYPE_FLOATER_VIEW,
219 WIDGET_TYPE_BUTTON,
220 WIDGET_TYPE_JOYSTICK_TURN,
221 WIDGET_TYPE_JOYSTICK_SLIDE,
222 WIDGET_TYPE_CHECKBOX,
223 WIDGET_TYPE_COLOR_SWATCH,
224 WIDGET_TYPE_COMBO_BOX,
225 WIDGET_TYPE_LINE_EDITOR,
226 WIDGET_TYPE_SEARCH_EDITOR,
227 WIDGET_TYPE_SCROLL_LIST,
228 WIDGET_TYPE_NAME_LIST,
229 WIDGET_TYPE_WEBBROWSER,
230 WIDGET_TYPE_SLIDER, // actually LLSliderCtrl
231 WIDGET_TYPE_SLIDER_BAR, // actually LLSlider
232 WIDGET_TYPE_VOLUME_SLIDER,//actually LLVolumeSliderCtrl
233 WIDGET_TYPE_MULTI_SLIDER, // actually LLMultiSliderCtrl
234 WIDGET_TYPE_MULTI_SLIDER_BAR, // actually LLMultiSlider
235 WIDGET_TYPE_SPINNER,
236 WIDGET_TYPE_TEXT_EDITOR,
237 WIDGET_TYPE_TEXTURE_PICKER,
238 WIDGET_TYPE_TEXT_BOX,
239 WIDGET_TYPE_PAD, // used in XML for positioning, not a real widget
240 WIDGET_TYPE_RADIO_GROUP,
241 WIDGET_TYPE_ICON,
242 WIDGET_TYPE_LANDMARK_PICKER,
243 WIDGET_TYPE_LOCATE, // used in XML for positioning, not a real widget
244 WIDGET_TYPE_VIEW_BORDER, // decorative border
245 WIDGET_TYPE_PANEL,
246 WIDGET_TYPE_MENU,
247 WIDGET_TYPE_PIE_MENU,
248 WIDGET_TYPE_PIE_MENU_BRANCH,
249 WIDGET_TYPE_MENU_ITEM,
250 WIDGET_TYPE_MENU_ITEM_SEPARATOR,
251 WIDGET_TYPE_MENU_SEPARATOR_VERTICAL,
252 WIDGET_TYPE_MENU_ITEM_CALL,
253 WIDGET_TYPE_MENU_ITEM_CHECK,
254 WIDGET_TYPE_MENU_ITEM_BRANCH,
255 WIDGET_TYPE_MENU_ITEM_BRANCH_DOWN,
256 WIDGET_TYPE_MENU_ITEM_BLANK,
257 WIDGET_TYPE_TEAROFF_MENU,
258 WIDGET_TYPE_MENU_BAR,
259 WIDGET_TYPE_TAB_CONTAINER,
260 WIDGET_TYPE_SCROLL_CONTAINER, // LLScrollableContainerView
261 WIDGET_TYPE_SCROLLBAR,
262 WIDGET_TYPE_INVENTORY_PANEL, // LLInventoryPanel
263 WIDGET_TYPE_FLOATER,
264 WIDGET_TYPE_DRAG_HANDLE_TOP,
265 WIDGET_TYPE_DRAG_HANDLE_LEFT,
266 WIDGET_TYPE_RESIZE_HANDLE,
267 WIDGET_TYPE_RESIZE_BAR,
268 WIDGET_TYPE_NAME_EDITOR,
269 WIDGET_TYPE_MULTI_FLOATER,
270 WIDGET_TYPE_MEDIA_REMOTE,
271 WIDGET_TYPE_FOLDER_VIEW,
272 WIDGET_TYPE_FOLDER_ITEM,
273 WIDGET_TYPE_FOLDER,
274 WIDGET_TYPE_STAT_GRAPH,
275 WIDGET_TYPE_STAT_VIEW,
276 WIDGET_TYPE_STAT_BAR,
277 WIDGET_TYPE_DROP_TARGET,
278 WIDGET_TYPE_TEXTURE_BAR,
279 WIDGET_TYPE_TEX_MEM_BAR,
280 WIDGET_TYPE_SNAPSHOT_LIVE_PREVIEW,
281 WIDGET_TYPE_STATUS_BAR,
282 WIDGET_TYPE_PROGRESS_VIEW,
283 WIDGET_TYPE_TALK_VIEW,
284 WIDGET_TYPE_OVERLAY_BAR,
285 WIDGET_TYPE_HUD_VIEW,
286 WIDGET_TYPE_HOVER_VIEW,
287 WIDGET_TYPE_MORPH_VIEW,
288 WIDGET_TYPE_NET_MAP,
289 WIDGET_TYPE_PERMISSIONS_VIEW,
290 WIDGET_TYPE_MENU_HOLDER,
291 WIDGET_TYPE_DEBUG_VIEW,
292 WIDGET_TYPE_SCROLLING_PANEL_LIST,
293 WIDGET_TYPE_AUDIO_STATUS,
294 WIDGET_TYPE_CONTAINER_VIEW,
295 WIDGET_TYPE_CONSOLE,
296 WIDGET_TYPE_FAST_TIMER_VIEW,
297 WIDGET_TYPE_VELOCITY_BAR,
298 WIDGET_TYPE_TEXTURE_VIEW,
299 WIDGET_TYPE_MEMORY_VIEW,
300 WIDGET_TYPE_FRAME_STAT_VIEW,
301 WIDGET_TYPE_LAYOUT_STACK,
302 WIDGET_TYPE_FLYOUT_BUTTON,
303 WIDGET_TYPE_DONTCARE,
304 WIDGET_TYPE_COUNT
305} EWidgetType;
306
307// FactoryPolicy is a static class that controls the creation and lookup of UI elements, 209// FactoryPolicy is a static class that controls the creation and lookup of UI elements,
308// such as floaters. 210// such as floaters.
309// The key parameter is used to provide a unique identifier and/or associated construction 211// The key parameter is used to provide a unique identifier and/or associated construction
@@ -509,7 +411,7 @@ public:
509class LLUIImage : public LLRefCount 411class LLUIImage : public LLRefCount
510{ 412{
511public: 413public:
512 LLUIImage(LLPointer<LLImageGL> image); 414 LLUIImage(const LLString& name, LLPointer<LLImageGL> image);
513 415
514 void setClipRegion(const LLRectf& region); 416 void setClipRegion(const LLRectf& region);
515 void setScaleRegion(const LLRectf& region); 417 void setScaleRegion(const LLRectf& region);
@@ -517,15 +419,29 @@ public:
517 LLPointer<LLImageGL> getImage() { return mImage; } 419 LLPointer<LLImageGL> getImage() { return mImage; }
518 const LLPointer<LLImageGL>& getImage() const { return mImage; } 420 const LLPointer<LLImageGL>& getImage() const { return mImage; }
519 421
520 void draw(S32 x, S32 y, const LLColor4& color = UI_VERTEX_COLOR) const;
521 void draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color = UI_VERTEX_COLOR) const; 422 void draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color = UI_VERTEX_COLOR) const;
423 void draw(S32 x, S32 y, const LLColor4& color = UI_VERTEX_COLOR) const;
424 void draw(const LLRect& rect, const LLColor4& color = UI_VERTEX_COLOR) const { draw(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color); }
425
522 void drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const; 426 void drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const;
523 void drawSolid(S32 x, S32 y, const LLColor4& color) const; 427 void drawSolid(const LLRect& rect, const LLColor4& color) const { drawSolid(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color); }
428 void drawSolid(S32 x, S32 y, const LLColor4& color) const { drawSolid(x, y, mImage->getWidth(0), mImage->getHeight(0), color); }
429
430 void drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const;
431 void drawBorder(const LLRect& rect, const LLColor4& color, S32 border_width) const { drawBorder(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color, border_width); }
432 void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, mImage->getWidth(0), mImage->getHeight(0), color, border_width); }
433
434 const LLString& getName() const { return mName; }
524 435
525 S32 getWidth() const; 436 S32 getWidth() const;
526 S32 getHeight() const; 437 S32 getHeight() const;
527 438
439 // returns dimensions of underlying textures, which might not be equal to ui image portion
440 S32 getTextureWidth() const;
441 S32 getTextureHeight() const;
442
528protected: 443protected:
444 LLString mName;
529 LLRectf mScaleRegion; 445 LLRectf mScaleRegion;
530 LLRectf mClipRegion; 446 LLRectf mClipRegion;
531 LLPointer<LLImageGL> mImage; 447 LLPointer<LLImageGL> mImage;
@@ -533,6 +449,7 @@ protected:
533 BOOL mNoClip; 449 BOOL mNoClip;
534}; 450};
535 451
452typedef LLPointer<LLUIImage> LLUIImagePtr;
536 453
537template <typename T> 454template <typename T>
538class LLTombStone : public LLRefCount 455class LLTombStone : public LLRefCount
@@ -667,6 +584,7 @@ private:
667 LLRootHandle<T> mHandle; 584 LLRootHandle<T> mHandle;
668}; 585};
669 586
587
670//RN: maybe this needs to moved elsewhere? 588//RN: maybe this needs to moved elsewhere?
671class LLImageProviderInterface 589class LLImageProviderInterface
672{ 590{
@@ -674,8 +592,9 @@ public:
674 LLImageProviderInterface() {}; 592 LLImageProviderInterface() {};
675 virtual ~LLImageProviderInterface() {}; 593 virtual ~LLImageProviderInterface() {};
676 594
677 virtual LLUIImage* getUIImageByID(const LLUUID& id, BOOL clamped = TRUE) = 0; 595 virtual LLUIImagePtr getUIImage(const LLString& name) = 0;
678 virtual LLImageGL* getImageByID(const LLUUID& id, BOOL clamped = TRUE) = 0; 596 virtual LLUIImagePtr getUIImageByID(const LLUUID& id) = 0;
597 virtual void cleanUp() = 0;
679}; 598};
680 599
681#endif 600#endif