From e298c2ded8e25a28127c668cf30a74a25c139041 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 16 Nov 2012 22:36:12 +0200 Subject: CHUI-487, CHUI-488 FIXED (Enable flashing FUI button behavior and Implement Flashing Conversations panel line item behavior): implemented FUI button flashing; clean up code --- indra/llui/llflashtimer.h | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 indra/llui/llflashtimer.h (limited to 'indra/llui/llflashtimer.h') diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h new file mode 100644 index 0000000000..2ef6ebcc8a --- /dev/null +++ b/indra/llui/llflashtimer.h @@ -0,0 +1,67 @@ +/** + * @file llflashtimer.h + * @brief LLFlashTimer class implementation + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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_FLASHTIMER_H +#define LL_FLASHTIMER_H + +#include "lleventtimer.h" + +class LLFlashTimer : public LLEventTimer +{ +public: + + typedef boost::function callback_t; + + /** + * Constructor. + * + * @param count - how many times callback should be called (twice to not change original state) + * @param period - how frequently callback should be called + * @param cb - callback to be called each tick + */ + LLFlashTimer(callback_t cb = NULL, S32 count = 0, F32 period = 0.0); + ~LLFlashTimer() {}; + + /*virtual*/ BOOL tick(); + + void startFlashing(); + void stopFlashing(); + + bool isFlashing() {return mIsFlashing;} + bool isHighlight() {return mIsHighlight;} + +private: + callback_t mCallback; + /** + * How many times parent will blink. + */ + S32 mFlashCount; + S32 mCurrentTickCount; + bool mIsHighlight; + bool mIsFlashing; +}; + +#endif /* LL_FLASHTIMER_H */ -- cgit v1.2.3 From edeeed95416be2679e1ad3d29bab5396dbcccaa2 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 21 Nov 2012 01:41:49 +0200 Subject: CHUI-531 FIXED Poor fps in CHUI viewer --- indra/llui/llflashtimer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui/llflashtimer.h') diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h index 2ef6ebcc8a..538ee0fcca 100644 --- a/indra/llui/llflashtimer.h +++ b/indra/llui/llflashtimer.h @@ -50,8 +50,8 @@ public: void startFlashing(); void stopFlashing(); - bool isFlashing() {return mIsFlashing;} - bool isHighlight() {return mIsHighlight;} + bool isFlashingInProgress() {return mIsFlashingInProgress;} + bool isCurrentlyHighlighted() {return mIsCurrentlyHighlighted;} private: callback_t mCallback; @@ -60,8 +60,8 @@ private: */ S32 mFlashCount; S32 mCurrentTickCount; - bool mIsHighlight; - bool mIsFlashing; + bool mIsCurrentlyHighlighted; + bool mIsFlashingInProgress; }; #endif /* LL_FLASHTIMER_H */ -- cgit v1.2.3 From f37645554ce97026869563aedea8f8c6133d8044 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Fri, 23 Nov 2012 13:39:53 +0200 Subject: CHUI-528, CHUI-536, CHUI-538, CHUI-540 ADD. FIX (Built single processor of different types of notifications): repaired LLFlashTimer --- indra/llui/llflashtimer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/llflashtimer.h') diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h index 538ee0fcca..5c8860b097 100644 --- a/indra/llui/llflashtimer.h +++ b/indra/llui/llflashtimer.h @@ -50,8 +50,8 @@ public: void startFlashing(); void stopFlashing(); - bool isFlashingInProgress() {return mIsFlashingInProgress;} - bool isCurrentlyHighlighted() {return mIsCurrentlyHighlighted;} + bool isFlashingInProgress(); + bool isCurrentlyHighlighted(); private: callback_t mCallback; -- cgit v1.2.3 From 1ce49f764fa00406088f7bcd7623603baedd5fe8 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Mon, 3 Dec 2012 19:20:11 +0200 Subject: CHUI-532 FIXED (Viewer crash when user in conversation is removed from participant list because they logged out or teleported away) delayed destroy of the timer --- indra/llui/llflashtimer.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llui/llflashtimer.h') diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h index 5c8860b097..c60f99a8ea 100644 --- a/indra/llui/llflashtimer.h +++ b/indra/llui/llflashtimer.h @@ -52,6 +52,11 @@ public: bool isFlashingInProgress(); bool isCurrentlyHighlighted(); + /* + * Use this instead of deleting this object. + * The next call to tick() will return true and that will destroy this object. + */ + void unset(); private: callback_t mCallback; @@ -62,6 +67,7 @@ private: S32 mCurrentTickCount; bool mIsCurrentlyHighlighted; bool mIsFlashingInProgress; + bool mUnset; }; #endif /* LL_FLASHTIMER_H */ -- cgit v1.2.3