diff options
Diffstat (limited to 'indra/llui/llfloater.h')
-rw-r--r-- | indra/llui/llfloater.h | 78 |
1 files changed, 59 insertions, 19 deletions
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 5b7b020881..73e9c9e831 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -35,6 +35,7 @@ #include "lluuid.h" //#include "llnotificationsutil.h" #include <set> +#include <boost/signals2.hpp> class LLDragHandle; class LLResizeHandle; @@ -59,11 +60,35 @@ const BOOL CLOSE_NO = FALSE; const BOOL ADJUST_VERTICAL_YES = TRUE; const BOOL ADJUST_VERTICAL_NO = FALSE; +namespace LLFloaterEnums +{ + enum EOpenPositioning + { + OPEN_POSITIONING_NONE, + OPEN_POSITIONING_CASCADING, + OPEN_POSITIONING_CASCADE_GROUP, + OPEN_POSITIONING_CENTERED, + OPEN_POSITIONING_SPECIFIED, + OPEN_POSITIONING_COUNT + }; +} + +namespace LLInitParam +{ + template<> + struct TypeValues<LLFloaterEnums::EOpenPositioning> : public TypeValuesHelper<LLFloaterEnums::EOpenPositioning> + { + static void declareValues(); + }; +} + + class LLFloater : public LLPanel { -friend class LLFloaterView; -friend class LLFloaterReg; -friend class LLMultiFloater; + friend class LLFloaterView; + friend class LLFloaterReg; + friend class LLMultiFloater; + public: struct KeyCompare { @@ -95,7 +120,7 @@ public: short_title; Optional<bool> single_instance, - auto_tile, + reuse_instance, can_resize, can_minimize, can_close, @@ -105,7 +130,13 @@ public: save_visibility, save_dock_state, can_dock, - open_centered; + show_title; + + Optional<LLFloaterEnums::EOpenPositioning> open_positioning; + Optional<S32> specified_left; + Optional<S32> specified_bottom; + + Optional<S32> header_height, legacy_header_height; // HACK see initFromXML() @@ -144,6 +175,7 @@ public: bool buildFromFile(const std::string &filename, LLXMLNodePtr output_node = NULL); boost::signals2::connection setMinimizeCallback( const commit_signal_t::slot_type& cb ); + boost::signals2::connection setOpenCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setCloseCallback( const commit_signal_t::slot_type& cb ); void initFromParams(const LLFloater::Params& p); @@ -179,7 +211,6 @@ public: std::string getTitle() const; void setShortTitle( const std::string& short_title ); std::string getShortTitle() const; - void setTitleVisible(bool visible); virtual void setMinimized(BOOL b); void moveResizeHandlesToFront(); void addDependentFloater(LLFloater* dependent, BOOL reposition = TRUE); @@ -253,7 +284,7 @@ public: LLHandle<LLFloater> getHandle() const { return mHandle; } const LLSD& getKey() { return mKey; } - BOOL matchesKey(const LLSD& key) { return mSingleInstance || KeyCompare::equate(key, mKey); } + virtual bool matchesKey(const LLSD& key) { return mSingleInstance || KeyCompare::equate(key, mKey); } const std::string& getInstanceName() { return mInstanceName; } @@ -288,14 +319,17 @@ public: void updateTransparency(ETypeTransparency transparency_type); -protected: + void enableResizeCtrls(bool enable, bool width = true, bool height = true); - void setRectControl(const std::string& rectname) { mRectControl = rectname; }; + bool isPositioning(LLFloaterEnums::EOpenPositioning p) const { return (p == mOpenPositioning); } +protected: + void applyControlsAndPosition(LLFloater* other); - virtual void applySavedVariables(); + void stackWith(LLFloater& other); - void applyRectControl(); - void applyDockState(); + virtual bool applyRectControl(); + bool applyDockState(); + void applyPositioning(LLFloater* other); void storeRectControl(); void storeVisibilityControl(); void storeDockStateControl(); @@ -340,7 +374,6 @@ private: BOOL offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButton index); void addResizeCtrls(); void layoutResizeCtrls(); - void enableResizeCtrls(bool enable); void addDragHandle(); void layoutDragHandle(); // repair layout @@ -377,15 +410,18 @@ private: LLUIString mShortTitle; BOOL mSingleInstance; // TRUE if there is only ever one instance of the floater + bool mReuseInstance; // true if we want to hide the floater when we close it instead of destroying it std::string mInstanceName; // Store the instance name so we can remove ourselves from the list - BOOL mAutoTile; // TRUE if placement of new instances tiles BOOL mCanTearOff; BOOL mCanMinimize; BOOL mCanClose; BOOL mDragOnLeft; BOOL mResizable; - bool mOpenCentered; + + LLFloaterEnums::EOpenPositioning mOpenPositioning; + S32 mSpecifiedLeft; + S32 mSpecifiedBottom; S32 mMinWidth; S32 mMinHeight; @@ -428,8 +464,6 @@ private: typedef std::map<LLHandle<LLFloater>, LLFloater*>::iterator handle_map_iter_t; static handle_map_t sFloaterMap; - std::vector<LLHandle<LLView> > mMinimizedHiddenChildren; - BOOL mHasBeenDraggedWhileMinimized; S32 mPreviousMinimizedBottom; S32 mPreviousMinimizedLeft; @@ -455,8 +489,6 @@ protected: public: /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - void reshapeFloater(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical); - /*virtual*/ void draw(); /*virtual*/ LLRect getSnapRect() const; /*virtual*/ void refresh(); @@ -485,6 +517,10 @@ public: BOOL allChildrenClosed(); void shiftFloaters(S32 x_offset, S32 y_offset); + void hideAllFloaters(); + void showHiddenFloaters(); + + LLFloater* getFrontmost() const; LLFloater* getBackmost() const; LLFloater* getParentFloater(LLView* viewp) const; @@ -499,11 +535,15 @@ public: void setFloaterSnapView(LLHandle<LLView> snap_view) {mSnapView = snap_view; } private: + void hiddenFloaterClosed(LLFloater* floater); + LLHandle<LLView> mSnapView; BOOL mFocusCycleMode; S32 mSnapOffsetBottom; S32 mSnapOffsetRight; S32 mMinimizePositionVOffset; + typedef std::vector<std::pair<LLHandle<LLFloater>, boost::signals2::connection> > hidden_floaters_t; + hidden_floaters_t mHiddenFloaters; }; // |