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/llui/llscrollcontainer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llui/llscrollcontainer.h') diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index dacea2a987..2875f95526 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -107,9 +107,9 @@ public: // LLView functionality virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); virtual BOOL handleKeyHere(KEY key, MASK mask); - virtual BOOL handleUnicodeCharHere(llwchar uni_char); - virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); - virtual BOOL handleScrollHWheel( S32 x, S32 y, S32 clicks ); + virtual bool handleUnicodeCharHere(llwchar uni_char); + virtual bool handleScrollWheel( S32 x, S32 y, S32 clicks ); + virtual bool handleScrollHWheel( S32 x, S32 y, S32 clicks ); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, -- cgit v1.2.3 From a5261a5fa8fad810ecb5c260d92c3e771822bf58 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 20 Feb 2024 23:46:23 +0100 Subject: Convert BOOL to bool in llui --- indra/llui/llscrollcontainer.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/llui/llscrollcontainer.h') diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index 2875f95526..13f69cb83b 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -85,12 +85,12 @@ public: virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); } - void setBorderVisible( BOOL b ); + void setBorderVisible( bool b ); void scrollToShowRect( const LLRect& rect, const LLRect& constraint); void scrollToShowRect( const LLRect& rect) { scrollToShowRect(rect, LLRect(0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0)); } - void setReserveScrollCorner( BOOL b ) { mReserveScrollCorner = b; } + void setReserveScrollCorner( bool b ) { mReserveScrollCorner = b; } LLRect getVisibleContentRect(); LLRect getContentWindowRect(); virtual const LLRect getScrolledViewRect() const { return mScrolledView ? mScrolledView->getRect() : LLRect::null; } @@ -105,12 +105,12 @@ public: S32 getBorderWidth() const; // LLView functionality - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - virtual BOOL handleKeyHere(KEY key, MASK mask); + virtual void reshape(S32 width, S32 height, bool called_from_parent = true); + virtual bool handleKeyHere(KEY key, MASK mask); virtual bool handleUnicodeCharHere(llwchar uni_char); virtual bool handleScrollWheel( S32 x, S32 y, S32 clicks ); virtual bool handleScrollHWheel( S32 x, S32 y, S32 clicks ); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + virtual bool handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, @@ -134,16 +134,16 @@ private: virtual void scrollVertical( S32 new_pos ); void updateScroll(); bool autoScroll(S32 x, S32 y, bool do_scroll); - void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const; + void calcVisibleSize( S32 *visible_width, S32 *visible_height, bool* show_h_scrollbar, bool* show_v_scrollbar ) const; LLScrollbar* mScrollbar[ORIENTATION_COUNT]; S32 mSize; - BOOL mIsOpaque; + bool mIsOpaque; LLUIColor mBackgroundColor; LLRect mInnerRect; LLViewBorder* mBorder; - BOOL mReserveScrollCorner; - BOOL mAutoScrolling; + bool mReserveScrollCorner; + bool mAutoScrolling; F32 mAutoScrollRate; F32 mMinAutoScrollRate; F32 mMaxAutoScrollRate; -- 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/llui/llscrollcontainer.h | 314 ++++++++++++++++++++--------------------- 1 file changed, 157 insertions(+), 157 deletions(-) (limited to 'indra/llui/llscrollcontainer.h') diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index 7e9532822b..859750d71c 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -1,157 +1,157 @@ -/** - * @file llscrollcontainer.h - * @brief LLScrollContainer class header file. - * - * $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$ - */ - -#ifndef LL_LLSCROLLCONTAINER_H -#define LL_LLSCROLLCONTAINER_H - -#include "lluictrl.h" -#ifndef LL_V4COLOR_H -#include "v4color.h" -#endif -#include "llcoord.h" -#include "llscrollbar.h" - - -class LLViewBorder; -class LLUICtrlFactory; - -/***************************************************************************** - * - * A decorator view class meant to encapsulate a clipped region which is - * scrollable. It automatically takes care of pixel perfect scrolling - * and cliipping, as well as turning the scrollbars on or off based on - * the width and height of the view you're scrolling. - * - *****************************************************************************/ - -struct ScrollContainerRegistry : public LLChildRegistry -{ - LLSINGLETON_EMPTY_CTOR(ScrollContainerRegistry); -}; - -class LLScrollContainer : public LLUICtrl -{ -public: - // Note: vertical comes before horizontal because vertical - // scrollbars have priority for mouse and keyboard events. - - struct Params : public LLInitParam::Block - { - Optional is_opaque, - reserve_scroll_corner, - border_visible, - hide_scrollbar, - ignore_arrow_keys; - Optional min_auto_scroll_rate, - max_auto_scroll_rate; - Optional max_auto_scroll_zone; - Optional bg_color; - Optional scroll_callback; - Optional size; - - Params(); - }; - - // my valid children are stored in this registry - typedef ScrollContainerRegistry child_registry_t; - -protected: - LLScrollContainer(const Params&); - friend class LLUICtrlFactory; -public: - virtual ~LLScrollContainer( void ); - - virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); } - - void setBorderVisible( bool b ); - - void scrollToShowRect( const LLRect& rect, const LLRect& constraint); - void scrollToShowRect( const LLRect& rect) { scrollToShowRect(rect, LLRect(0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0)); } - - void setReserveScrollCorner( bool b ) { mReserveScrollCorner = b; } - LLRect getVisibleContentRect(); - LLRect getContentWindowRect(); - virtual const LLRect getScrolledViewRect() const { return mScrolledView ? mScrolledView->getRect() : LLRect::null; } - void pageUp(S32 overlap = 0); - void pageDown(S32 overlap = 0); - void goToTop(); - void goToBottom(); - bool isAtTop() const { return mScrollbar[VERTICAL]->isAtBeginning(); } - bool isAtBottom() const { return mScrollbar[VERTICAL]->isAtEnd(); } - S32 getDocPosVertical() const { return mScrollbar[VERTICAL]->getDocPos(); } - S32 getDocPosHorizontal() const { return mScrollbar[HORIZONTAL]->getDocPos(); } - S32 getBorderWidth() const; - - // LLView functionality - virtual void reshape(S32 width, S32 height, bool called_from_parent = true); - virtual bool handleKeyHere(KEY key, MASK mask); - virtual bool handleUnicodeCharHere(llwchar uni_char); - virtual bool handleScrollWheel( S32 x, S32 y, S32 clicks ); - virtual bool handleScrollHWheel( S32 x, S32 y, S32 clicks ); - virtual bool handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg); - - virtual void draw(); - virtual bool addChild(LLView* view, S32 tab_group = 0); - - bool canAutoScroll(S32 x, S32 y); - bool autoScroll(S32 x, S32 y); - - S32 getSize() const { return mSize; } - void setSize(S32 thickness); - -protected: - LLView* mScrolledView; - -private: - // internal scrollbar handlers - virtual void scrollHorizontal( S32 new_pos ); - virtual void scrollVertical( S32 new_pos ); - void updateScroll(); - bool autoScroll(S32 x, S32 y, bool do_scroll); - void calcVisibleSize( S32 *visible_width, S32 *visible_height, bool* show_h_scrollbar, bool* show_v_scrollbar ) const; - - LLScrollbar* mScrollbar[ORIENTATION_COUNT]; - S32 mSize; - bool mIsOpaque; - LLUIColor mBackgroundColor; - LLRect mInnerRect; - LLViewBorder* mBorder; - bool mReserveScrollCorner; - bool mAutoScrolling; - F32 mAutoScrollRate; - F32 mMinAutoScrollRate; - F32 mMaxAutoScrollRate; - U32 mMaxAutoScrollZone; - bool mHideScrollbar; - bool mIgnoreArrowKeys; -}; - - -#endif // LL_LLSCROLLCONTAINER_H +/** + * @file llscrollcontainer.h + * @brief LLScrollContainer class header file. + * + * $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$ + */ + +#ifndef LL_LLSCROLLCONTAINER_H +#define LL_LLSCROLLCONTAINER_H + +#include "lluictrl.h" +#ifndef LL_V4COLOR_H +#include "v4color.h" +#endif +#include "llcoord.h" +#include "llscrollbar.h" + + +class LLViewBorder; +class LLUICtrlFactory; + +/***************************************************************************** + * + * A decorator view class meant to encapsulate a clipped region which is + * scrollable. It automatically takes care of pixel perfect scrolling + * and cliipping, as well as turning the scrollbars on or off based on + * the width and height of the view you're scrolling. + * + *****************************************************************************/ + +struct ScrollContainerRegistry : public LLChildRegistry +{ + LLSINGLETON_EMPTY_CTOR(ScrollContainerRegistry); +}; + +class LLScrollContainer : public LLUICtrl +{ +public: + // Note: vertical comes before horizontal because vertical + // scrollbars have priority for mouse and keyboard events. + + struct Params : public LLInitParam::Block + { + Optional is_opaque, + reserve_scroll_corner, + border_visible, + hide_scrollbar, + ignore_arrow_keys; + Optional min_auto_scroll_rate, + max_auto_scroll_rate; + Optional max_auto_scroll_zone; + Optional bg_color; + Optional scroll_callback; + Optional size; + + Params(); + }; + + // my valid children are stored in this registry + typedef ScrollContainerRegistry child_registry_t; + +protected: + LLScrollContainer(const Params&); + friend class LLUICtrlFactory; +public: + virtual ~LLScrollContainer( void ); + + virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); } + + void setBorderVisible( bool b ); + + void scrollToShowRect( const LLRect& rect, const LLRect& constraint); + void scrollToShowRect( const LLRect& rect) { scrollToShowRect(rect, LLRect(0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0)); } + + void setReserveScrollCorner( bool b ) { mReserveScrollCorner = b; } + LLRect getVisibleContentRect(); + LLRect getContentWindowRect(); + virtual const LLRect getScrolledViewRect() const { return mScrolledView ? mScrolledView->getRect() : LLRect::null; } + void pageUp(S32 overlap = 0); + void pageDown(S32 overlap = 0); + void goToTop(); + void goToBottom(); + bool isAtTop() const { return mScrollbar[VERTICAL]->isAtBeginning(); } + bool isAtBottom() const { return mScrollbar[VERTICAL]->isAtEnd(); } + S32 getDocPosVertical() const { return mScrollbar[VERTICAL]->getDocPos(); } + S32 getDocPosHorizontal() const { return mScrollbar[HORIZONTAL]->getDocPos(); } + S32 getBorderWidth() const; + + // LLView functionality + virtual void reshape(S32 width, S32 height, bool called_from_parent = true); + virtual bool handleKeyHere(KEY key, MASK mask); + virtual bool handleUnicodeCharHere(llwchar uni_char); + virtual bool handleScrollWheel( S32 x, S32 y, S32 clicks ); + virtual bool handleScrollHWheel( S32 x, S32 y, S32 clicks ); + virtual bool handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); + + virtual void draw(); + virtual bool addChild(LLView* view, S32 tab_group = 0); + + bool canAutoScroll(S32 x, S32 y); + bool autoScroll(S32 x, S32 y); + + S32 getSize() const { return mSize; } + void setSize(S32 thickness); + +protected: + LLView* mScrolledView; + +private: + // internal scrollbar handlers + virtual void scrollHorizontal( S32 new_pos ); + virtual void scrollVertical( S32 new_pos ); + void updateScroll(); + bool autoScroll(S32 x, S32 y, bool do_scroll); + void calcVisibleSize( S32 *visible_width, S32 *visible_height, bool* show_h_scrollbar, bool* show_v_scrollbar ) const; + + LLScrollbar* mScrollbar[ORIENTATION_COUNT]; + S32 mSize; + bool mIsOpaque; + LLUIColor mBackgroundColor; + LLRect mInnerRect; + LLViewBorder* mBorder; + bool mReserveScrollCorner; + bool mAutoScrolling; + F32 mAutoScrollRate; + F32 mMinAutoScrollRate; + F32 mMaxAutoScrollRate; + U32 mMaxAutoScrollZone; + bool mHideScrollbar; + bool mIgnoreArrowKeys; +}; + + +#endif // LL_LLSCROLLCONTAINER_H -- cgit v1.2.3