diff options
Diffstat (limited to 'indra/newview/llfloateruipreview.h')
-rw-r--r-- | indra/newview/llfloateruipreview.h | 106 |
1 files changed, 31 insertions, 75 deletions
diff --git a/indra/newview/llfloateruipreview.h b/indra/newview/llfloateruipreview.h index eca8c0a141..b8c378e2e9 100644 --- a/indra/newview/llfloateruipreview.h +++ b/indra/newview/llfloateruipreview.h @@ -54,57 +54,10 @@ class LLXmlTreeNode; class LLFloaterUIPreview; class LLFadeEventTimer; -// Reset object to ensure that when we change the current language setting for preview purposes, -// it automatically is reset. Constructed on the stack at the start of the method; the reset -// occurs as it falls out of scope at the end of the method. See llfloateruipreview.cpp for usage. -class LLLocalizationResetForcer -{ -public: - LLLocalizationResetForcer(S32 ID); - virtual ~LLLocalizationResetForcer(); - -private: - std::string mSavedLocalization; // the localization before we change it -}; - -// Implementation of live file -// When a floater is being previewed, any saved changes to its corresponding -// file cause the previewed floater to be reloaded -class LLGUIPreviewLiveFile : public LLLiveFile -{ -public: - LLGUIPreviewLiveFile(std::string path, std::string name, LLFloaterUIPreview* parent); - virtual ~LLGUIPreviewLiveFile(); - LLFloaterUIPreview* mParent; - LLFadeEventTimer* mFadeTimer; // timer for fade-to-yellow-and-back effect to warn that file has been reloaded - BOOL mFirstFade; // setting this avoids showing the fade reload warning on first load - std::string mFileName; -protected: - bool loadFile(); -}; - -// Implementation of graphical fade in/out (on timer) for when XUI files are updated -class LLFadeEventTimer : public LLEventTimer -{ -public: - LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent); - BOOL tick(); - LLGUIPreviewLiveFile* mParent; -private: - BOOL mFadingOut; // fades in then out; this is toggled in between - LLColor4 mOriginalColor; // original color; color is reset to this after fade is coimplete -}; - -// Implementation of previewed floater -// Used to override draw and mouse handler -class LLPreviewedFloater : public LLFloater -{ -public: - LLPreviewedFloater() : LLFloater() {} - virtual void draw(); - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - BOOL selectElement(LLView* parent, int x, int y, int depth); // select element to display its overlappers -}; +class LLLocalizationResetForcer; +class LLGUIPreviewLiveFile; +class LLFadeEventTimer; +class LLPreviewedFloater; // Implementation of custom overlapping element display panel class LLOverlapPanel : public LLPanel @@ -123,11 +76,16 @@ public: mOriginalHeight = getRect().getHeight(); } virtual void draw(); + + typedef std::map<LLView*, std::list<LLView*> > OverlapMap; + OverlapMap mOverlapMap; // map, of XUI element to a list of XUI elements it overlaps + // LLView *mClickedElement; LLView *mLastClickedElement; int mOriginalWidth, mOriginalHeight, mSpacing; }; + class LLFloaterUIPreview : public LLFloater { public: @@ -135,15 +93,16 @@ public: LLFloaterUIPreview(const LLSD& key); virtual ~LLFloaterUIPreview(); - static std::string getLocStr(S32 ID); // fetches the localization string based on what is selected in the drop-down menu - static void displayFloater(BOOL click, S32 ID, bool save = false); // needs to be public so live file can call it when it finds an update - static BOOL containerType(LLView* viewp); // check if the element is a container type and tree traverses need to look at its children - static LLFloaterUIPreview* sInstance; // static instance of this (for references in handlers) + std::string getLocStr(S32 ID); // fetches the localization string based on what is selected in the drop-down menu + void displayFloater(BOOL click, S32 ID, bool save = false); // needs to be public so live file can call it when it finds an update BOOL postBuild(); // post-build setup (called by superclass' constructor) void refreshList(); // refresh list (empty it out and fill it up from scratch) void addFloaterEntry(const std::string& path); // add a single file's entry to the list of floaters - + + static BOOL containerType(LLView* viewp); // check if the element is a container type and tree traverses need to look at its children + +public: LLPreviewedFloater* mDisplayedFloater; // the floater which is currently being displayed LLPreviewedFloater* mDisplayedFloater_2; // the floater which is currently being displayed LLGUIPreviewLiveFile* mLiveFile; // live file for checking for updates to the currently-displayed XML file @@ -151,9 +110,6 @@ public: // BOOL mHighlightingDiffs; // bool for whether localization diffs are being highlighted or not BOOL mHighlightingOverlaps; // bool for whether overlapping elements are being highlighted - typedef std::map<LLView*, std::list<LLView*> > OverlapMap; - OverlapMap mOverlapMap; // map, of XUI element to a list of XUI elements it overlaps - // typedef std::map<std::string,std::pair<std::list<std::string>,std::list<std::string> > > DiffMap; // this version copies the lists etc., and thus is bad memory-wise typedef std::list<std::string> StringList; typedef boost::shared_ptr<StringList> StringListPtr; @@ -161,7 +117,7 @@ public: DiffMap mDiffsMap; // map, of filename to pair of list of changed element paths and list of errors protected: - virtual void onClose(bool app_quitting); + void onClose(const LLSD& app_quitting); private: // XUI elements for this floater @@ -174,19 +130,19 @@ private: LLButton* mEditFloaterBtn; // button to edit floater LLButton* mExecutableBrowseButton; // button to browse for executable LLButton* mCloseOtherButton; // button to close primary displayed floater - LLButton* mCloseOtherButton_2; // button to close secondary displayed floater + LLButton* mCloseOtherButton_2; // button to close secondary displayed floater LLButton* mDiffBrowseButton; // button to browse for diff file LLButton* mToggleHighlightButton; // button to toggle highlight of files/elements with diffs LLButton* mToggleOverlapButton; // button to togle overlap panel/highlighting LLComboBox* mLanguageSelection; // combo box for primary language selection LLComboBox* mLanguageSelection_2; // combo box for secondary language selection - LLScrollContainer* mOverlapScrollView; // overlapping elements scroll container + LLScrollContainer* mOverlapScrollView; // overlapping elements scroll container S32 mLastDisplayedX, mLastDisplayedY; // stored position of last floater so the new one opens up in the same place - std::string mDelim; // the OS-specific delimiter character (/ or \) (*TODO: this shouldn't be needed, right?) + std::string mDelim; // the OS-specific delimiter character (/ or \) (*TODO: this shouldn't be needed, right?) - static std::string mSavedEditorPath; // stored editor path so closing this floater doesn't reset it - static std::string mSavedEditorArgs; // stored editor args so closing this floater doesn't reset it - static std::string mSavedDiffPath; // stored diff file path so closing this floater doesn't reset it + std::string mSavedEditorPath; // stored editor path so closing this floater doesn't reset it + std::string mSavedEditorArgs; // stored editor args so closing this floater doesn't reset it + std::string mSavedDiffPath; // stored diff file path so closing this floater doesn't reset it // Internal functionality static void popupAndPrintWarning(std::string& warning); // pop up a warning @@ -202,15 +158,15 @@ private: BOOL elementOverlap(LLView* view1, LLView* view2); // Button/drop-down action listeners (self explanatory) - static void onClickDisplayFloater(void*); - static void onClickSaveFloater(void*); - static void onClickSaveAll(void*); - static void onClickEditFloater(void*); - static void onClickBrowseForEditor(void*); - static void onClickBrowseForDiffs(void*); - static void onClickToggleDiffHighlighting(void*); - static void onClickToggleOverlapping(void*); - static void onClickCloseDisplayedFloater(void*); + void onClickDisplayFloater(S32 id); + void onClickSaveFloater(S32 id); + void onClickSaveAll(S32 id); + void onClickEditFloater(); + void onClickBrowseForEditor(); + void onClickBrowseForDiffs(); + void onClickToggleDiffHighlighting(); + void onClickToggleOverlapping(); + void onClickCloseDisplayedFloater(S32 id); void onLanguageComboSelect(LLUICtrl* ctrl); void onClickExportSchema(); }; |