| 62 | } |
| 63 | |
| 64 | struct SwitcherView |
| 65 | { |
| 66 | wayfire_toplevel_view view; |
| 67 | SwitcherPaintAttribs attribs; |
| 68 | |
| 69 | int position; |
| 70 | SwitcherView(duration_t& duration) : attribs(duration) |
| 71 | {} |
| 72 | |
| 73 | /* Make animation start values the current progress of duration */ |
| 74 | void refresh_start() |
| 75 | { |
| 76 | for_each([] (timed_transition_t& t) { t.restart_same_end(); }); |
| 77 | } |
| 78 | |
| 79 | void to_end() |
| 80 | { |
| 81 | for_each([] (timed_transition_t& t) { t.set(t.end, t.end); }); |
| 82 | } |
| 83 | |
| 84 | private: |
| 85 | void for_each(std::function<void(timed_transition_t& t)> call) |
| 86 | { |
| 87 | call(attribs.off_x); |
| 88 | call(attribs.off_y); |
| 89 | call(attribs.off_z); |
| 90 | |
| 91 | call(attribs.scale_x); |
| 92 | call(attribs.scale_y); |
| 93 | |
| 94 | call(attribs.alpha); |
| 95 | call(attribs.rotation); |
| 96 | } |
| 97 | }; |
| 98 | |
| 99 | class WayfireSwitcher : public wf::per_output_plugin_instance_t, public wf::keyboard_interaction_t |
| 100 | { |
nothing calls this directly
no outgoing calls
no test coverage detected