28 #ifndef YSL_INC_UI_Animation_h_
29 #define YSL_INC_UI_Animation_h_ 1
32 #include YFM_YSLib_UI_YWidget
33 #include YFM_YSLib_Core_Task
50 template<
typename _fCallable>
60 template<
typename _fCallable>
75 template<
typename _fCallable>
84 template<
typename _tCallable = std::function<
bool()>>
103 template<
typename... _tParams>
111 PDefH(
void, Start, ) const
142 : WidgetPtr(p_wgt), Ready(ready)
155 DefaultInvalidate(IWidget&);
163 DefaultInvalidateControl(IWidget&);
167 inline PDefH(
void, ResetState, InvalidationUpdater& updater)
174 template<class _tAnimation, typename _fCallable>
179 ani.Reset(&wgt,
true);
180 ani.GetConnectionRef().Invalidate =
f;
186 template<
class _tAnimation,
typename _fCallable>
195 template<
class _tAnimation,
typename _fCallable,
typename _fCond>
197 Setup(_tAnimation& ani, IWidget&
wgt, _fCond cond, _fCallable
f)
208 template<
class _tAnimation,
typename _fCallable,
typename _tTimer>
214 return timer.Refresh();
Connection YAssertNonnull(conn)
yconstfn const string _tParams && args
YF_API void Invalidate(IWidget &, const Rect &)
无效化:使相对于部件的指定区域在直接和间接的窗口缓冲区中无效。
InvalidationUpdater(IWidget *p_wgt={}, bool ready={})
void AnimateTask(_fCallable update, Messaging::Priority prior=UI::AnimationPriority)
按更新条件和优先级通过消息队列部署动画任务。
void Animate(_fCallable f, Messaging::Priority prior=UI::AnimationPriority)
按指定的可调用对象初始化为连接对象更新动画任务。
yconstexpr Messaging::Priority AnimationPriority(0x20)
默认背景动画任务消息优先级。
typename decay< _type >::type decay_t
PDefH(void, Start,) const ImplExpr(AnimateConnection(conn)) DefGetter(const ynothrow
使用 ADL 调用 AnimateConnection 开始动画。
_fCallable void Restart(_tAnimation &ani, IWidget &wgt, _fCallable f)
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
#define DefGetter(_q, _t, _n,...)
shared_ptr< Connection > ConnectionPtr
DefDeCtor(GAnimationSession)~GAnimationSession()
使用 ADL 调用 ResetState 函数复位连接对象状态以确保安全。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
void Renew(_fCallable update, Priority prior=Messaging::NormalPriority)
按更新条件和优先级通过消息队列部署任务。
#define YAssertNonnull(_expr)
void AnimateConnection(const shared_ptr< _fCallable > &conn, Messaging::Priority prior=UI::AnimationPriority)
按指定的连接对象更新动画任务。
void SetupByTimer(_tAnimation &ani, IWidget &wgt, _tTimer &&timer, _fCallable f)
安装以计时器控制的动画效果。
bool Ready
准备和最后持续状态:更新函数的最后结果。
#define yconstexpr
指定编译时常量表达式。
std::function< bool(IWidget &)> Invalidator
void Setup(_tAnimation &ani, IWidget &wgt, _fCallable f)
安装动画效果。
ystdex::decay_t< YSLib::UI::InvalidationUpdater > Connection
void Reset(_tParams &&...args)