diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-05-15 16:35:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 16:35:49 +0300 |
commit | e49dcb8d0c9f539997effb640e350d9d0689aae6 (patch) | |
tree | 1bf99eaccce6de17c62f13c6595f7f497548dc5c /indra/newview/llfloatercamera.h | |
parent | 531cd34f670170ade57f8813fe48012b61a1d3c2 (diff) | |
parent | 5f8a7374b9f18e0112d6749a9c845bd077a81acb (diff) |
Merge pull request #1476 from secondlife/marchcat/x-b-merge
Maint X -> Maint B merge
Diffstat (limited to 'indra/newview/llfloatercamera.h')
-rw-r--r-- | indra/newview/llfloatercamera.h | 188 |
1 files changed, 94 insertions, 94 deletions
diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index f31bc5486b..038ce8f173 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -1,25 +1,25 @@ -/** +/** * @file llfloatercamera.h * @brief Container for camera control buttons (zoom, pan, orbit) * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -40,139 +40,139 @@ class LLComboBox; enum ECameraControlMode { - CAMERA_CTRL_MODE_PAN, - CAMERA_CTRL_MODE_FREE_CAMERA, - CAMERA_CTRL_MODE_PRESETS + CAMERA_CTRL_MODE_PAN, + CAMERA_CTRL_MODE_FREE_CAMERA, + CAMERA_CTRL_MODE_PRESETS }; class LLFloaterCamera : public LLFloater { - friend class LLFloaterReg; - + friend class LLFloaterReg; + public: - /* whether in free camera mode */ - static bool inFreeCameraMode(); - /* callback for camera items selection changing */ - static void onClickCameraItem(const LLSD& param); + /* whether in free camera mode */ + static bool inFreeCameraMode(); + /* callback for camera items selection changing */ + static void onClickCameraItem(const LLSD& param); - static void onLeavingMouseLook(); + static void onLeavingMouseLook(); - /** resets current camera mode to orbit mode */ - static void resetCameraMode(); + /** resets current camera mode to orbit mode */ + static void resetCameraMode(); - /** Called when Avatar is entered/exited editing appearance mode */ - static void onAvatarEditingAppearance(bool editing); + /** Called when Avatar is entered/exited editing appearance mode */ + static void onAvatarEditingAppearance(bool editing); - /** Called when opening and when "Advanced | Debug Camera" menu item is toggled */ - static void onDebugCameraToggled(); + /** Called when opening and when "Advanced | Debug Camera" menu item is toggled */ + static void onDebugCameraToggled(); - /* determines actual mode and updates ui */ - void update(); + /* determines actual mode and updates ui */ + void update(); - /*switch to one of the camera presets (front, rear, side)*/ - static void switchToPreset(const std::string& name); + /*switch to one of the camera presets (front, rear, side)*/ + static void switchToPreset(const std::string& name); - virtual void onOpen(const LLSD& key); - virtual void onClose(bool app_quitting); + virtual void onOpen(const LLSD& key); + virtual void onClose(bool app_quitting); - void onSavePreset(); - void onCustomPresetSelected(); + void onSavePreset(); + void onCustomPresetSelected(); - void populatePresetCombo(); + void populatePresetCombo(); - LLJoystickCameraRotate* mRotate { nullptr }; - LLPanelCameraZoom* mZoom { nullptr }; - LLJoystickCameraTrack* mTrack { nullptr }; + LLJoystickCameraRotate* mRotate { nullptr }; + LLPanelCameraZoom* mZoom { nullptr }; + LLJoystickCameraTrack* mTrack { nullptr }; private: - LLFloaterCamera(const LLSD& val); - ~LLFloaterCamera() {}; + LLFloaterCamera(const LLSD& val); + ~LLFloaterCamera() {}; - /* return instance if it exists - created by LLFloaterReg */ - static LLFloaterCamera* findInstance(); + /* return instance if it exists - created by LLFloaterReg */ + static LLFloaterCamera* findInstance(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild(); - F32 getCurrentTransparency(); + F32 getCurrentTransparency(); - void onViewButtonClick(const LLSD& user_data); + void onViewButtonClick(const LLSD& user_data); - ECameraControlMode determineMode(); + ECameraControlMode determineMode(); - /* resets to the previous mode */ - void toPrevMode(); + /* resets to the previous mode */ + void toPrevMode(); - /* sets a new mode and performs related actions */ - void switchMode(ECameraControlMode mode); + /* sets a new mode and performs related actions */ + void switchMode(ECameraControlMode mode); - /* sets a new mode preserving previous one and updates ui*/ - void setMode(ECameraControlMode mode); + /* sets a new mode preserving previous one and updates ui*/ + void setMode(ECameraControlMode mode); - /* updates the state (UI) according to the current mode */ - void updateState(); + /* updates the state (UI) according to the current mode */ + void updateState(); - /* update camera modes items selection and camera preset items selection according to the currently selected preset */ - void updateItemsSelection(); + /* update camera modes items selection and camera preset items selection according to the currently selected preset */ + void updateItemsSelection(); - // fills flatlist with items from given panel - void fillFlatlistFromPanel (LLFlatListView* list, LLPanel* panel); + // fills flatlist with items from given panel + void fillFlatlistFromPanel (LLFlatListView* list, LLPanel* panel); - void handleAvatarEditingAppearance(bool editing); + void handleAvatarEditingAppearance(bool editing); - void showDebugInfo(bool show); + void showDebugInfo(bool show); - // set to true when free camera mode is selected in modes list - // remains true until preset camera mode is chosen, or pan button is clicked, or escape pressed - static bool sFreeCamera; - static bool sAppearanceEditing; - BOOL mClosed; - ECameraControlMode mPrevMode; - ECameraControlMode mCurrMode; - std::map<ECameraControlMode, LLButton*> mMode2Button; + // set to true when free camera mode is selected in modes list + // remains true until preset camera mode is chosen, or pan button is clicked, or escape pressed + static bool sFreeCamera; + static bool sAppearanceEditing; + BOOL mClosed; + ECameraControlMode mPrevMode; + ECameraControlMode mCurrMode; + std::map<ECameraControlMode, LLButton*> mMode2Button; - LLPanel* mControls { nullptr }; - LLPanel* mViewerCameraInfo { nullptr }; - LLPanel* mAgentCameraInfo { nullptr }; - LLComboBox* mPresetCombo { nullptr }; - LLTextBox* mPreciseCtrls { nullptr }; + LLPanel* mControls { nullptr }; + LLPanel* mViewerCameraInfo { nullptr }; + LLPanel* mAgentCameraInfo { nullptr }; + LLComboBox* mPresetCombo { nullptr }; + LLTextBox* mPreciseCtrls { nullptr }; }; /** - * Class used to represent widgets from panel_camera_item.xml- + * Class used to represent widgets from panel_camera_item.xml- * panels that contain pictures and text. Pictures are different * for selected and unselected state (this state is nor stored- icons * are changed in setValue()). This class doesn't implement selection logic- * it's items are used inside of flatlist. */ -class LLPanelCameraItem - : public LLPanel +class LLPanelCameraItem + : public LLPanel { public: - struct Params : public LLInitParam::Block<Params, LLPanel::Params> - { - Optional<LLIconCtrl::Params> icon_over; - Optional<LLIconCtrl::Params> icon_selected; - Optional<LLIconCtrl::Params> picture; - Optional<LLIconCtrl::Params> selected_picture; - - Optional<LLTextBox::Params> text; - Optional<CommitCallbackParam> mousedown_callback; - Params(); - }; - /*virtual*/ BOOL postBuild(); - /** setting on/off background icon to indicate selected state */ - /*virtual*/ void setValue(const LLSD& value); - // sends commit signal - void onAnyMouseClick(); + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + { + Optional<LLIconCtrl::Params> icon_over; + Optional<LLIconCtrl::Params> icon_selected; + Optional<LLIconCtrl::Params> picture; + Optional<LLIconCtrl::Params> selected_picture; + + Optional<LLTextBox::Params> text; + Optional<CommitCallbackParam> mousedown_callback; + Params(); + }; + /*virtual*/ BOOL postBuild(); + /** setting on/off background icon to indicate selected state */ + /*virtual*/ void setValue(const LLSD& value); + // sends commit signal + void onAnyMouseClick(); protected: - friend class LLUICtrlFactory; - LLPanelCameraItem(const Params&); - LLIconCtrl* mIconOver; - LLIconCtrl* mIconSelected; - LLIconCtrl* mPicture; - LLIconCtrl* mPictureSelected; - LLTextBox* mText; + friend class LLUICtrlFactory; + LLPanelCameraItem(const Params&); + LLIconCtrl* mIconOver; + LLIconCtrl* mIconSelected; + LLIconCtrl* mPicture; + LLIconCtrl* mPictureSelected; + LLTextBox* mText; }; #endif |