From c285f59ce2a05703e3a1232fcaf3ee3aea714b3f Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 18 Feb 2024 12:52:19 +0100 Subject: Replace BOOL with bool in llwindow and dependent classes --- indra/newview/lltoolpipette.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview/lltoolpipette.cpp') diff --git a/indra/newview/lltoolpipette.cpp b/indra/newview/lltoolpipette.cpp index ff3dad2675..4fdd7cf7c9 100644 --- a/indra/newview/lltoolpipette.cpp +++ b/indra/newview/lltoolpipette.cpp @@ -57,41 +57,41 @@ LLToolPipette::~LLToolPipette() { } -BOOL LLToolPipette::handleMouseDown(S32 x, S32 y, MASK mask) +bool LLToolPipette::handleMouseDown(S32 x, S32 y, MASK mask) { mSuccess = TRUE; mTooltipMsg.clear(); setMouseCapture(TRUE); gViewerWindow->pickAsync(x, y, mask, pickCallback); - return TRUE; + return true; } -BOOL LLToolPipette::handleMouseUp(S32 x, S32 y, MASK mask) +bool LLToolPipette::handleMouseUp(S32 x, S32 y, MASK mask) { mSuccess = TRUE; LLSelectMgr::getInstance()->unhighlightAll(); // *NOTE: This assumes the pipette tool is a transient tool. LLToolMgr::getInstance()->clearTransientTool(); setMouseCapture(FALSE); - return TRUE; + return true; } -BOOL LLToolPipette::handleHover(S32 x, S32 y, MASK mask) +bool LLToolPipette::handleHover(S32 x, S32 y, MASK mask) { gViewerWindow->setCursor(mSuccess ? UI_CURSOR_PIPETTE : UI_CURSOR_NO); if (hasMouseCapture()) // mouse button is down { gViewerWindow->pickAsync(x, y, mask, pickCallback); - return TRUE; + return true; } - return FALSE; + return false; } -BOOL LLToolPipette::handleToolTip(S32 x, S32 y, MASK mask) +bool LLToolPipette::handleToolTip(S32 x, S32 y, MASK mask) { if (mTooltipMsg.empty()) { - return FALSE; + return false; } LLRect sticky_rect; @@ -100,7 +100,7 @@ BOOL LLToolPipette::handleToolTip(S32 x, S32 y, MASK mask) .message(mTooltipMsg) .sticky_rect(sticky_rect)); - return TRUE; + return true; } void LLToolPipette::setTextureEntry(const LLTextureEntry* entry) -- cgit v1.2.3 From 60d3dd98a44230c21803c1606552ee098ed9fa7c Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 21 Feb 2024 21:05:14 +0100 Subject: Convert remaining BOOL to bool --- indra/newview/lltoolpipette.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/lltoolpipette.cpp') diff --git a/indra/newview/lltoolpipette.cpp b/indra/newview/lltoolpipette.cpp index 4fdd7cf7c9..36ac20bc59 100644 --- a/indra/newview/lltoolpipette.cpp +++ b/indra/newview/lltoolpipette.cpp @@ -48,7 +48,7 @@ LLToolPipette::LLToolPipette() : LLTool(std::string("Pipette")), - mSuccess(TRUE) + mSuccess(true) { } @@ -59,20 +59,20 @@ LLToolPipette::~LLToolPipette() bool LLToolPipette::handleMouseDown(S32 x, S32 y, MASK mask) { - mSuccess = TRUE; + mSuccess = true; mTooltipMsg.clear(); - setMouseCapture(TRUE); + setMouseCapture(true); gViewerWindow->pickAsync(x, y, mask, pickCallback); return true; } bool LLToolPipette::handleMouseUp(S32 x, S32 y, MASK mask) { - mSuccess = TRUE; + mSuccess = true; LLSelectMgr::getInstance()->unhighlightAll(); // *NOTE: This assumes the pipette tool is a transient tool. LLToolMgr::getInstance()->clearTransientTool(); - setMouseCapture(FALSE); + setMouseCapture(false); return true; } @@ -129,7 +129,7 @@ void LLToolPipette::pickCallback(const LLPickInfo& pick_info) } } -void LLToolPipette::setResult(BOOL success, const std::string& msg) +void LLToolPipette::setResult(bool success, const std::string& msg) { mTooltipMsg = msg; mSuccess = success; -- cgit v1.2.3 From e2e37cced861b98de8c1a7c9c0d3a50d2d90e433 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 22 May 2024 21:25:21 +0200 Subject: Fix line endlings --- indra/newview/lltoolpipette.cpp | 272 ++++++++++++++++++++-------------------- 1 file changed, 136 insertions(+), 136 deletions(-) (limited to 'indra/newview/lltoolpipette.cpp') diff --git a/indra/newview/lltoolpipette.cpp b/indra/newview/lltoolpipette.cpp index dfd0dad7ad..9e3d435688 100644 --- a/indra/newview/lltoolpipette.cpp +++ b/indra/newview/lltoolpipette.cpp @@ -1,136 +1,136 @@ -/** - * @file lltoolpipette.cpp - * @brief LLToolPipette class implementation - * - * $LicenseInfo:firstyear=2006&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$ - */ - -/** - * A tool to pick texture entry infro from objects in world (color/texture) - */ - -#include "llviewerprecompiledheaders.h" - -// File includes -#include "lltoolpipette.h" - -// Library includes -#include "lltooltip.h" - -// Viewer includes -#include "llviewerobjectlist.h" -#include "llviewerwindow.h" -#include "llselectmgr.h" -#include "lltoolmgr.h" - -// -// Member functions -// - -LLToolPipette::LLToolPipette() -: LLTool(std::string("Pipette")), - mSuccess(true) -{ -} - - -LLToolPipette::~LLToolPipette() -{ } - - -bool LLToolPipette::handleMouseDown(S32 x, S32 y, MASK mask) -{ - mSuccess = true; - mTooltipMsg.clear(); - setMouseCapture(true); - gViewerWindow->pickAsync(x, y, mask, pickCallback); - return true; -} - -bool LLToolPipette::handleMouseUp(S32 x, S32 y, MASK mask) -{ - mSuccess = true; - LLSelectMgr::getInstance()->unhighlightAll(); - // *NOTE: This assumes the pipette tool is a transient tool. - LLToolMgr::getInstance()->clearTransientTool(); - setMouseCapture(false); - return true; -} - -bool LLToolPipette::handleHover(S32 x, S32 y, MASK mask) -{ - gViewerWindow->setCursor(mSuccess ? UI_CURSOR_PIPETTE : UI_CURSOR_NO); - if (hasMouseCapture()) // mouse button is down - { - gViewerWindow->pickAsync(x, y, mask, pickCallback); - return true; - } - return false; -} - -bool LLToolPipette::handleToolTip(S32 x, S32 y, MASK mask) -{ - if (mTooltipMsg.empty()) - { - return false; - } - - LLRect sticky_rect; - sticky_rect.setCenterAndSize(x, y, 20, 20); - LLToolTipMgr::instance().show(LLToolTip::Params() - .message(mTooltipMsg) - .sticky_rect(sticky_rect)); - - return true; -} - -void LLToolPipette::setTextureEntry(const LLTextureEntry* entry) -{ - if (entry) - { - mTextureEntry = *entry; - mSignal(mTextureEntry); - } -} - -void LLToolPipette::pickCallback(const LLPickInfo& pick_info) -{ - LLViewerObject* hit_obj = pick_info.getObject(); - LLSelectMgr::getInstance()->unhighlightAll(); - - // if we clicked on a face of a valid prim, save off texture entry data - if (hit_obj && - hit_obj->getPCode() == LL_PCODE_VOLUME && - pick_info.mObjectFace != -1) - { - //TODO: this should highlight the selected face only - LLSelectMgr::getInstance()->highlightObjectOnly(hit_obj); - const LLTextureEntry* entry = hit_obj->getTE(pick_info.mObjectFace); - LLToolPipette::getInstance()->setTextureEntry(entry); - } -} - -void LLToolPipette::setResult(bool success, const std::string& msg) -{ - mTooltipMsg = msg; - mSuccess = success; -} +/** + * @file lltoolpipette.cpp + * @brief LLToolPipette class implementation + * + * $LicenseInfo:firstyear=2006&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$ + */ + +/** + * A tool to pick texture entry infro from objects in world (color/texture) + */ + +#include "llviewerprecompiledheaders.h" + +// File includes +#include "lltoolpipette.h" + +// Library includes +#include "lltooltip.h" + +// Viewer includes +#include "llviewerobjectlist.h" +#include "llviewerwindow.h" +#include "llselectmgr.h" +#include "lltoolmgr.h" + +// +// Member functions +// + +LLToolPipette::LLToolPipette() +: LLTool(std::string("Pipette")), + mSuccess(true) +{ +} + + +LLToolPipette::~LLToolPipette() +{ } + + +bool LLToolPipette::handleMouseDown(S32 x, S32 y, MASK mask) +{ + mSuccess = true; + mTooltipMsg.clear(); + setMouseCapture(true); + gViewerWindow->pickAsync(x, y, mask, pickCallback); + return true; +} + +bool LLToolPipette::handleMouseUp(S32 x, S32 y, MASK mask) +{ + mSuccess = true; + LLSelectMgr::getInstance()->unhighlightAll(); + // *NOTE: This assumes the pipette tool is a transient tool. + LLToolMgr::getInstance()->clearTransientTool(); + setMouseCapture(false); + return true; +} + +bool LLToolPipette::handleHover(S32 x, S32 y, MASK mask) +{ + gViewerWindow->setCursor(mSuccess ? UI_CURSOR_PIPETTE : UI_CURSOR_NO); + if (hasMouseCapture()) // mouse button is down + { + gViewerWindow->pickAsync(x, y, mask, pickCallback); + return true; + } + return false; +} + +bool LLToolPipette::handleToolTip(S32 x, S32 y, MASK mask) +{ + if (mTooltipMsg.empty()) + { + return false; + } + + LLRect sticky_rect; + sticky_rect.setCenterAndSize(x, y, 20, 20); + LLToolTipMgr::instance().show(LLToolTip::Params() + .message(mTooltipMsg) + .sticky_rect(sticky_rect)); + + return true; +} + +void LLToolPipette::setTextureEntry(const LLTextureEntry* entry) +{ + if (entry) + { + mTextureEntry = *entry; + mSignal(mTextureEntry); + } +} + +void LLToolPipette::pickCallback(const LLPickInfo& pick_info) +{ + LLViewerObject* hit_obj = pick_info.getObject(); + LLSelectMgr::getInstance()->unhighlightAll(); + + // if we clicked on a face of a valid prim, save off texture entry data + if (hit_obj && + hit_obj->getPCode() == LL_PCODE_VOLUME && + pick_info.mObjectFace != -1) + { + //TODO: this should highlight the selected face only + LLSelectMgr::getInstance()->highlightObjectOnly(hit_obj); + const LLTextureEntry* entry = hit_obj->getTE(pick_info.mObjectFace); + LLToolPipette::getInstance()->setTextureEntry(entry); + } +} + +void LLToolPipette::setResult(bool success, const std::string& msg) +{ + mTooltipMsg = msg; + mSuccess = success; +} -- cgit v1.2.3