| 80 | }; |
| 81 | |
| 82 | animation_hook(wayfire_view view, |
| 83 | std::unique_ptr<wf::animate::animation_base_t> _animation, |
| 84 | wf::animation_description_t duration, |
| 85 | wf::animate::animation_type type, |
| 86 | std::string name) |
| 87 | { |
| 88 | this->type = type; |
| 89 | this->view = view->shared_from_this(); |
| 90 | this->name = name; |
| 91 | |
| 92 | this->animation = std::move(_animation); |
| 93 | this->animation->init(view, duration, type); |
| 94 | |
| 95 | set_output(view->get_output()); |
| 96 | /* Animation is driven by the output render cycle the view is on. |
| 97 | * Thus, we need to keep in sync with the current output. */ |
| 98 | view->connect(&on_set_output); |
| 99 | wf::scene::set_node_enabled(view->get_root_node(), true); |
| 100 | |
| 101 | if (type == wf::animate::ANIMATION_TYPE_UNMAP) |
| 102 | { |
| 103 | set_unmapped_contents(); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | void stop_hook(bool detached) |
| 108 | { |
nothing calls this directly
no test coverage detected