neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_transition_animator.hpp
Go to the documentation of this file.
1// i_transition_animator.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2018, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
23#include <neolib/core/i_jar.hpp>
25
26namespace neogfx
27{
29
30 class i_animator;
31
33 {
34 public:
35 struct cannot_apply : std::logic_error { cannot_apply() : std::logic_error{ "neogfx::i_transition::cannot_apply" } {} };
36 public:
38 public:
39 virtual ~i_transition() = default;
40 public:
41 virtual transition_id id() const = 0;
42 virtual i_animator& animator() const = 0;
43 virtual bool enabled() const = 0;
44 virtual bool disabled() const = 0;
45 virtual bool disable_when_finished() const = 0;
46 virtual void enable(bool aDisableWhenFinished = false) = 0;
47 virtual void disable() = 0;
48 virtual easing easing_function() const = 0;
49 virtual double duration() const = 0;
50 virtual double start_time() const = 0;
51 virtual double mix_value() const = 0;
52 virtual bool animation_finished() const = 0;
53 virtual bool finished() const = 0;
54 public:
55 virtual bool active() const = 0;
56 virtual bool paused() const = 0;
57 virtual void pause() = 0;
58 virtual void resume() = 0;
59 public:
60 virtual void clear() = 0;
61 virtual void sync(bool aIgnorePrevious = false) = 0;
62 virtual void reset(bool aEnable = true, bool aDisableWhenFinished = false, bool aResetStartTime = true) = 0;
63 virtual void reset(easing aNewEasingFunction, bool aEnable = true, bool aDisableWhenFinished = false, bool aResetStartTime = true) = 0;
64 virtual bool can_apply() const = 0;
65 virtual void apply() = 0;
66 };
67
68 class transition;
69
70 class i_animator : public i_service
71 {
72 friend class neogfx::transition;
73 public:
74 virtual i_transition& transition(transition_id aTransitionId) = 0;
75 virtual transition_id add_transition(i_transition& aTransition) = 0;
76 virtual void remove_transition(transition_id aTransitionId) = 0;
77 virtual void stop() = 0;
78 public:
79 virtual double animation_time() const = 0;
80 protected:
82 public:
83 static uuid const& iid() { static uuid const sIid{ 0x182ccd2e, 0xd7dd, 0x4a6c, 0x9ac, { 0x72, 0xfd, 0x81, 0x24, 0x7a, 0xe9 } }; return sIid; }
84 };
85}
virtual void stop()=0
virtual i_transition & transition(transition_id aTransitionId)=0
virtual void remove_transition(transition_id aTransitionId)=0
virtual double animation_time() const =0
virtual transition_id add_transition(i_transition &aTransition)=0
virtual transition_id allocate_id()=0
static uuid const & iid()
virtual void resume()=0
virtual bool paused() const =0
virtual easing easing_function() const =0
virtual bool disabled() const =0
virtual void disable()=0
virtual bool disable_when_finished() const =0
virtual void apply()=0
virtual bool enabled() const =0
virtual bool animation_finished() const =0
virtual transition_id id() const =0
virtual void sync(bool aIgnorePrevious=false)=0
virtual void clear()=0
virtual void enable(bool aDisableWhenFinished=false)=0
virtual void reset(easing aNewEasingFunction, bool aEnable=true, bool aDisableWhenFinished=false, bool aResetStartTime=true)=0
virtual ~i_transition()=default
virtual i_animator & animator() const =0
virtual double start_time() const =0
virtual void pause()=0
virtual bool can_apply() const =0
virtual bool active() const =0
virtual double mix_value() const =0
virtual double duration() const =0
virtual void reset(bool aEnable=true, bool aDisableWhenFinished=false, bool aResetStartTime=true)=0
virtual bool finished() const =0
neolib::cookie transition_id
uint32_t cookie
Definition i_jar.hpp:44