From 86787b58edf59997b68dca6a0927d24b2a24a2b5 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 15 Oct 2009 18:42:30 -0700 Subject: Major refactor of LLViewerMediaFocus and LLPanelMediaHUD. LLViewerMediaFocus now tracks two separate objects: the currently focused media object, and the media object that's currently being hovered over. It no longer stores smart pointers to either the LLViewerObject or the LLViewerMediaImpl -- it now looks up both by UUID every time they're needed, and fails gracefully if either goes away. This will prevent it from keeping objects from being deleted. The poorly-understood "mouseOverFlag" has been expunged. LLViewerMediaFocus no longer uses LLSelectMgr at all. The object to focus on is explicitly passed between LLViewerMediaFocus and LLPanelMediaHUD instead of going indirectly through the selection manager. LLViewerMediaFocus also no longer interacts with the pick from LLToolPie -- the data it needs from the pick (the object and normal vector) is passed explicitly. LLViewerMediaFocus::setCameraZoom and LLViewerMediaFocus::getBBoxAspectRatio now have no dependencies on the LLViewerMediaFocus object -- all the data they need is passed in when they're called by the LLPanelMediaHUD. I made them static member functions, but they could be moved to LLPanelMediaHUD or even made into file-scoped static functions. The only reason I didn't do either of those is that it seems like they belong with the LLViewerMediaFocus code as opposed to the HUD. --- indra/newview/llviewermediafocus.h | 57 +++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 23 deletions(-) (limited to 'indra/newview/llviewermediafocus.h') diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index 2688a8b708..d5e3e6019c 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -50,44 +50,55 @@ public: LLViewerMediaFocus(); ~LLViewerMediaFocus(); - static void cleanupClass(); - - void setFocusFace(BOOL b, LLPointer objectp, S32 face, viewer_media_t media_impl); - void clearFocus() { setFocusFace(false, NULL, 0, NULL); } + // Set/clear the face that has media focus (takes keyboard input and has the full set of controls) + void setFocusFace(LLPointer objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal = LLVector3d::zero); + void clearFocus(); + + // Set/clear the face that has "media hover" (has the mimimal set of controls to zoom in or pop out into a media browser). + // If a media face has focus, the media hover will be ignored. + void setHoverFace(LLPointer objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal = LLVector3d::zero); + void clearHover(); + /*virtual*/ bool getFocus(); - /*virtual*/ // void onNavigateComplete( const EventType& event_in ); - /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); /*virtual*/ BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - LLUUID getSelectedUUID(); - LLObjectSelectionHandle getSelection() { return mFocus; } - void update(); + + static void setCameraZoom(LLViewerObject* object, LLVector3 normal, F32 padding_factor); + static F32 getBBoxAspectRatio(const LLBBox& bbox, const LLVector3& normal, F32* height, F32* width, F32* depth); - void setCameraZoom(F32 padding_factor); - void setMouseOverFlag(bool b, viewer_media_t media_impl = NULL); - bool getMouseOverFlag() { return mMouseOverFlag; } - void setPickInfo(LLPickInfo pick_info) { mPickInfo = pick_info; } - F32 getBBoxAspectRatio(const LLBBox& bbox, const LLVector3& normal, F32* height, F32* width, F32* depth); - - // TODO: figure out why selection mgr hates me bool isFocusedOnFace(LLPointer objectp, S32 face); + bool isHoveringOverFace(LLPointer objectp, S32 face); + + // These look up (by uuid) and return the values that were set with setFocusFace. They will return null if the objects have been destroyed. + LLViewerMediaImpl* getFocusedMediaImpl(); + LLViewerObject* getFocusedObject(); + S32 getFocusedFace() { return mFocusedObjectFace; } + + // These look up (by uuid) and return the values that were set with setHoverFace. They will return null if the objects have been destroyed. + LLViewerMediaImpl* getHoverMediaImpl(); + LLViewerObject* getHoverObject(); + S32 getHoverFace() { return mHoverObjectFace; } protected: /*virtual*/ void onFocusReceived(); /*virtual*/ void onFocusLost(); private: - LLObjectSelectionHandle mFocus; - std::string mLastURL; - bool mMouseOverFlag; - LLPickInfo mPickInfo; + LLHandle mMediaHUD; - LLUUID mObjectID; - S32 mObjectFace; - viewer_media_t mMediaImpl; + + LLUUID mFocusedObjectID; + S32 mFocusedObjectFace; + LLUUID mFocusedImplID; + LLVector3 mFocusedObjectNormal; + + LLUUID mHoverObjectID; + S32 mHoverObjectFace; + LLUUID mHoverImplID; + LLVector3 mHoverObjectNormal; }; -- cgit v1.2.3 From cb1b361b49c9ae6a76eaeeb4476a341a024a71f1 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 16 Oct 2009 10:34:16 -0700 Subject: FIX windows build: no automatic conversoin between LLVector3 and LLVector3d?? --- indra/newview/llviewermediafocus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermediafocus.h') diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index d5e3e6019c..c77533ba5a 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -51,12 +51,12 @@ public: ~LLViewerMediaFocus(); // Set/clear the face that has media focus (takes keyboard input and has the full set of controls) - void setFocusFace(LLPointer objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal = LLVector3d::zero); + void setFocusFace(LLPointer objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal = LLVector3::zero); void clearFocus(); // Set/clear the face that has "media hover" (has the mimimal set of controls to zoom in or pop out into a media browser). // If a media face has focus, the media hover will be ignored. - void setHoverFace(LLPointer objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal = LLVector3d::zero); + void setHoverFace(LLPointer objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal = LLVector3::zero); void clearHover(); /*virtual*/ bool getFocus(); -- cgit v1.2.3 From 2812d0f19c8bac908815e6387a7697c51e66ef7f Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 28 Oct 2009 17:25:39 -0700 Subject: DEV-40210 : restructure media controls UI This change completely restructures the media controls XUI so that it is now more flexible so as to implement mini vs. standard controls. It also now allows for changes based on artwork and design still as unyet delivered from 80/20, as well as any feedback from Brian's user testing. This is also step 1 of renaming the media "hud" to media "controls" --- indra/newview/llviewermediafocus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermediafocus.h') diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index c77533ba5a..959b2381e4 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -40,7 +40,7 @@ #include "llselectmgr.h" class LLViewerMediaImpl; -class LLPanelMediaHUD; +class LLPanelMediaControls; class LLViewerMediaFocus : public LLFocusableElement, @@ -88,7 +88,7 @@ protected: private: - LLHandle mMediaHUD; + LLHandle mMediaHUD; LLUUID mFocusedObjectID; S32 mFocusedObjectFace; -- cgit v1.2.3 From 64c2cb6ba1c089c15df6c8ef5ec5313ed5f1897f Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 28 Oct 2009 19:20:30 -0700 Subject: Completion of rename of llpanelmediahud to llpanelprimmediacontrols --- indra/newview/llviewermediafocus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermediafocus.h') diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index 959b2381e4..c1179de39d 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -40,7 +40,7 @@ #include "llselectmgr.h" class LLViewerMediaImpl; -class LLPanelMediaControls; +class LLPanelPrimMediaControls; class LLViewerMediaFocus : public LLFocusableElement, @@ -88,7 +88,7 @@ protected: private: - LLHandle mMediaHUD; + LLHandle mMediaControls; LLUUID mFocusedObjectID; S32 mFocusedObjectFace; -- cgit v1.2.3 From 9e602de33ae85bc78d6aa3c6bf45e29af7727796 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 30 Oct 2009 17:46:48 -0700 Subject: On a double-click in the nearby media list, try to focus/zoom in on the prim holding the media. --- indra/newview/llviewermediafocus.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llviewermediafocus.h') diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index c1179de39d..07a6f0c47b 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -81,6 +81,9 @@ public: LLViewerMediaImpl* getHoverMediaImpl(); LLViewerObject* getHoverObject(); S32 getHoverFace() { return mHoverObjectFace; } + + // Try to focus/zoom on the specified media (if it's on an object in world). + void focusZoomOnMedia(LLUUID media_id); protected: /*virtual*/ void onFocusReceived(); -- cgit v1.2.3 From 2fadd99877eceb55077957b5bab6353611184c86 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 30 Oct 2009 18:14:20 -0700 Subject: Another experiment: made the selection in the nearby media floater track the media impl the media controls are currently referencing (either focus or hover). --- indra/newview/llviewermediafocus.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llviewermediafocus.h') diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index 07a6f0c47b..e5f36d341c 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -84,6 +84,9 @@ public: // Try to focus/zoom on the specified media (if it's on an object in world). void focusZoomOnMedia(LLUUID media_id); + + // Return the ID of the media instance the controls are currently attached to (either focus or hover). + LLUUID getControlsMediaID(); protected: /*virtual*/ void onFocusReceived(); -- cgit v1.2.3