Tweeny 4.1.0
A Tweening library for modern C++
Loading...
Searching...
No Matches
detail/event.h
1/*
2This file is part of the Tweeny library.
3
4Copyright (c) 2016-2026 Leonardo Guilherme Lucena de Freitas
5Copyright (c) 2016 Guilherme R. Costa
6
7Permission is hereby granted, free of charge, to any person obtaining a copy of
8this software and associated documentation files (the "Software"), to deal in
9the Software without restriction, including without limitation the rights to
10use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11the Software, and to permit persons to whom the Software is furnished to do so,
12subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23*/
24
25#ifndef TWEENY_DETAIL_EVENT_H
26#define TWEENY_DETAIL_EVENT_H
27
28#include <cstddef>
29
30namespace tweeny::detail::event {
35 struct step_t {};
36
41 struct seek_t {};
42
47 struct jump_t {};
48
53 struct complete_t {};
54
59 struct keyframeEnter_t {};
60
65 struct keyframeLeave_t {};
66
71 struct update_t {};
72}
73
74namespace tweeny::event {
81 struct keyframeEnter {
82 size_t key_frame;
83 explicit keyframeEnter(const size_t key_frame_input) : key_frame(key_frame_input) {}
84 };
85
92 struct keyframeLeave {
93 size_t key_frame;
94 explicit keyframeLeave(const size_t key_frame_input) : key_frame(key_frame_input) {}
95 };
96
102 enum class response {
108 ok = 0,
109
117 };
118}
119
120#endif // TWEENY_DETAIL_EVENT_H
response
Response codes returned by event callbacks.
Definition detail/event.h:102
@ ok
Continue receiving events.
Definition detail/event.h:108
@ unsubscribe
Unsubscribe after this callback.
Definition detail/event.h:116
constexpr detail::event::keyframeEnter_t keyframeEnter
Event triggered when entering a new keyframe segment.
Definition event.h:210
constexpr detail::event::keyframeLeave_t keyframeLeave
Event triggered when leaving a keyframe segment.
Definition event.h:246
Event types and response codes for tween callbacks.
Definition detail/event.h:74
Tag type for completion events.
Definition detail/event.h:53
Tag type for jump events.
Definition detail/event.h:47
Tag type for keyframeEnter events.
Definition detail/event.h:59
Tag type for keyframeLeave events.
Definition detail/event.h:65
Tag type for seek events.
Definition detail/event.h:41
Tag type for step events.
Definition detail/event.h:35
Tag type for update events.
Definition detail/event.h:71