From adeee613c60e8d4d2d57ede9685b8388a681c409 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 25 Jul 2019 18:20:17 +0300 Subject: DRTVWR-493 LLRender2D to LLParamSingleton --- indra/llui/llui.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/llui/llui.h') diff --git a/indra/llui/llui.h b/indra/llui/llui.h index d7151dbee9..c6ee11a96e 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -243,13 +243,13 @@ public: LLUIAudioCallback deferred_audio_callback = NULL, const LLVector2 *scale_factor = NULL, const std::string& language = LLStringUtil::null); - static void cleanupClass(); + static void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& ); - static void pushMatrix() { LLRender2D::pushMatrix(); } - static void popMatrix() { LLRender2D::popMatrix(); } - static void loadIdentity() { LLRender2D::loadIdentity(); } - static void translate(F32 x, F32 y, F32 z = 0.0f) { LLRender2D::translate(x, y, z); } + static void pushMatrix() { LLRender2D::getInstance()->pushMatrix(); } + static void popMatrix() { LLRender2D::getInstance()->popMatrix(); } + static void loadIdentity() { LLRender2D::getInstance()->loadIdentity(); } + static void translate(F32 x, F32 y, F32 z = 0.0f) { LLRender2D::getInstance()->translate(x, y, z); } static LLRect sDirtyRect; static BOOL sDirty; @@ -294,13 +294,13 @@ public: static void getMousePositionScreen(S32 *x, S32 *y); static void setMousePositionLocal(const LLView* viewp, S32 x, S32 y); static void getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y); - static LLVector2& getScaleFactor() { return LLRender2D::sGLScaleFactor; } - static void setScaleFactor(const LLVector2& scale_factor) { LLRender2D::setScaleFactor(scale_factor); } - static void setLineWidth(F32 width) { LLRender2D::setLineWidth(width); } + static LLVector2& getScaleFactor() { return LLRender2D::getInstance()->mGLScaleFactor; } + static void setScaleFactor(const LLVector2& scale_factor) { LLRender2D::getInstance()->setScaleFactor(scale_factor); } + static void setLineWidth(F32 width) { LLRender2D::getInstance()->setLineWidth(width); } static LLPointer getUIImageByID(const LLUUID& image_id, S32 priority = 0) - { return LLRender2D::getUIImageByID(image_id, priority); } + { return LLRender2D::getInstance()->getUIImageByID(image_id, priority); } static LLPointer getUIImage(const std::string& name, S32 priority = 0) - { return LLRender2D::getUIImage(name, priority); } + { return LLRender2D::getInstance()->getUIImage(name, priority); } static LLVector2 getWindowSize(); static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); -- cgit v1.2.3 From 34d8200d0f0dde1b8205c802edbb08cc1ff503b2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Sat, 10 Aug 2019 09:01:54 +0300 Subject: DRTVWR-493 LLRender2D init cleanup --- indra/llui/llui.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/llui/llui.h') diff --git a/indra/llui/llui.h b/indra/llui/llui.h index c6ee11a96e..ad32b093aa 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -240,9 +240,7 @@ public: static void initClass(const settings_map_t& settings, LLImageProviderInterface* image_provider, LLUIAudioCallback audio_callback = NULL, - LLUIAudioCallback deferred_audio_callback = NULL, - const LLVector2 *scale_factor = NULL, - const std::string& language = LLStringUtil::null); + LLUIAudioCallback deferred_audio_callback = NULL); static void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& ); -- cgit v1.2.3 From c61d0f42973f1d58e4e6b5b8a4e0911ed0602bb7 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Sat, 10 Aug 2019 15:31:03 +0300 Subject: DRTVWR-493 LLUI to LLParamSingleton --- indra/llui/llui.h | 121 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 63 insertions(+), 58 deletions(-) (limited to 'indra/llui/llui.h') diff --git a/indra/llui/llui.h b/indra/llui/llui.h index ad32b093aa..9decaf92cb 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -109,8 +109,16 @@ class LLImageProviderInterface; typedef void (*LLUIAudioCallback)(const LLUUID& uuid); -class LLUI +class LLUI : public LLParamSingleton { +public: + typedef std::map settings_map_t; + +private: + LLPARAMSINGLETON(LLUI , const settings_map_t &settings, + LLImageProviderInterface* image_provider, + LLUIAudioCallback audio_callback, + LLUIAudioCallback deferred_audio_callback); LOG_CLASS(LLUI); public: // @@ -232,34 +240,24 @@ public: // // Methods // - typedef std::map settings_map_t; typedef boost::function add_popup_t; typedef boost::function remove_popup_t; typedef boost::function clear_popups_t; - static void initClass(const settings_map_t& settings, - LLImageProviderInterface* image_provider, - LLUIAudioCallback audio_callback = NULL, - LLUIAudioCallback deferred_audio_callback = NULL); - - static void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& ); - - static void pushMatrix() { LLRender2D::getInstance()->pushMatrix(); } - static void popMatrix() { LLRender2D::getInstance()->popMatrix(); } - static void loadIdentity() { LLRender2D::getInstance()->loadIdentity(); } - static void translate(F32 x, F32 y, F32 z = 0.0f) { LLRender2D::getInstance()->translate(x, y, z); } + void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& ); - static LLRect sDirtyRect; - static BOOL sDirty; - static void dirtyRect(LLRect rect); + LLRect mDirtyRect; + BOOL mDirty; + void dirtyRect(LLRect rect); // Return the ISO639 language name ("en", "ko", etc.) for the viewer UI. // http://www.loc.gov/standards/iso639-2/php/code_list.php - static std::string getLanguage(); + std::string getUILanguage(); + static std::string getLanguage(); // static for lldateutil_test compatibility //helper functions (should probably move free standing rendering helper functions here) - static LLView* getRootView() { return sRootView; } - static void setRootView(LLView* view) { sRootView = view; } + LLView* getRootView() { return mRootView; } + void setRootView(LLView* view) { mRootView = view; } /** * Walk the LLView tree to resolve a path * Paths can be discovered using Develop > XUI > Show XUI Paths @@ -285,58 +283,65 @@ public: * tree, the first "bar" anywhere under it, and "baz" * as a direct child of that */ - static const LLView* resolvePath(const LLView* context, const std::string& path); - static LLView* resolvePath(LLView* context, const std::string& path); + const LLView* resolvePath(const LLView* context, const std::string& path); + LLView* resolvePath(LLView* context, const std::string& path); static std::string locateSkin(const std::string& filename); - static void setMousePositionScreen(S32 x, S32 y); - static void getMousePositionScreen(S32 *x, S32 *y); - static void setMousePositionLocal(const LLView* viewp, S32 x, S32 y); - static void getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y); - static LLVector2& getScaleFactor() { return LLRender2D::getInstance()->mGLScaleFactor; } - static void setScaleFactor(const LLVector2& scale_factor) { LLRender2D::getInstance()->setScaleFactor(scale_factor); } - static void setLineWidth(F32 width) { LLRender2D::getInstance()->setLineWidth(width); } - static LLPointer getUIImageByID(const LLUUID& image_id, S32 priority = 0) - { return LLRender2D::getInstance()->getUIImageByID(image_id, priority); } - static LLPointer getUIImage(const std::string& name, S32 priority = 0) - { return LLRender2D::getInstance()->getUIImage(name, priority); } - static LLVector2 getWindowSize(); - static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); - static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); - static void screenRectToGL(const LLRect& screen, LLRect *gl); - static void glRectToScreen(const LLRect& gl, LLRect *screen); + void setMousePositionScreen(S32 x, S32 y); + void getMousePositionScreen(S32 *x, S32 *y); + void setMousePositionLocal(const LLView* viewp, S32 x, S32 y); + void getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y); + LLVector2 getWindowSize(); + void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); + void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); + void screenRectToGL(const LLRect& screen, LLRect *gl); + void glRectToScreen(const LLRect& gl, LLRect *screen); // Returns the control group containing the control name, or the default group - static LLControlGroup& getControlControlGroup (const std::string& controlname); - static F32 getMouseIdleTime() { return sMouseIdleTimer.getElapsedTimeF32(); } - static void resetMouseIdleTimer() { sMouseIdleTimer.reset(); } - static LLWindow* getWindow() { return sWindow; } + LLControlGroup& getControlControlGroup (const std::string& controlname); + F32 getMouseIdleTime() { return mMouseIdleTimer.getElapsedTimeF32(); } + void resetMouseIdleTimer() { mMouseIdleTimer.reset(); } + LLWindow* getWindow() { return mWindow; } - static void addPopup(LLView*); - static void removePopup(LLView*); - static void clearPopups(); + void addPopup(LLView*); + void removePopup(LLView*); + void clearPopups(); - static void reportBadKeystroke(); + void reportBadKeystroke(); // Ensures view does not overlap mouse cursor, but is inside // the view's parent rectangle. Used for tooltips, inspectors. // Optionally override the view's default X/Y, which are relative to the // view's parent. - static void positionViewNearMouse(LLView* view, S32 spawn_x = S32_MAX, S32 spawn_y = S32_MAX); + void positionViewNearMouse(LLView* view, S32 spawn_x = S32_MAX, S32 spawn_y = S32_MAX); + + // LLRender2D wrappers + static void pushMatrix() { LLRender2D::getInstance()->pushMatrix(); } + static void popMatrix() { LLRender2D::getInstance()->popMatrix(); } + static void loadIdentity() { LLRender2D::getInstance()->loadIdentity(); } + static void translate(F32 x, F32 y, F32 z = 0.0f) { LLRender2D::getInstance()->translate(x, y, z); } + + static LLVector2& getScaleFactor() { return LLRender2D::getInstance()->mGLScaleFactor; } + static void setScaleFactor(const LLVector2& scale_factor) { LLRender2D::getInstance()->setScaleFactor(scale_factor); } + static void setLineWidth(F32 width) { LLRender2D::getInstance()->setLineWidth(width); } + static LLPointer getUIImageByID(const LLUUID& image_id, S32 priority = 0) + { return LLRender2D::getInstance()->getUIImageByID(image_id, priority); } + static LLPointer getUIImage(const std::string& name, S32 priority = 0) + { return LLRender2D::getInstance()->getUIImage(name, priority); } // // Data // - static settings_map_t sSettingGroups; - static LLUIAudioCallback sAudioCallback; - static LLUIAudioCallback sDeferredAudioCallback; - static LLWindow* sWindow; - static LLView* sRootView; - static LLHelp* sHelpImpl; + settings_map_t mSettingGroups; + LLUIAudioCallback mAudioCallback; + LLUIAudioCallback mDeferredAudioCallback; + LLWindow* mWindow; + LLView* mRootView; + LLHelp* mHelpImpl; private: - static std::vector sXUIPaths; - static LLFrameTimer sMouseIdleTimer; - static add_popup_t sAddPopupFunc; - static remove_popup_t sRemovePopupFunc; - static clear_popups_t sClearPopupsFunc; + std::vector mXUIPaths; + LLFrameTimer mMouseIdleTimer; + add_popup_t mAddPopupFunc; + remove_popup_t mRemovePopupFunc; + clear_popups_t mClearPopupsFunc; }; @@ -361,7 +366,7 @@ public: LLUICachedControl(const std::string& name, const T& default_value, const std::string& comment = "Declared In Code") - : LLCachedControl(LLUI::getControlControlGroup(name), name, default_value, comment) + : LLCachedControl(LLUI::getInstance()->getControlControlGroup(name), name, default_value, comment) {} }; -- cgit v1.2.3