Horizon
tool_paste.hpp
1 #pragma once
2 #include "core.hpp"
3 #include "tool_helper_merge.hpp"
4 #include "tool_helper_move.hpp"
5 #include <gtkmm.h>
6 
7 namespace horizon {
8 
9 class ToolPaste : public ToolHelperMove, public ToolHelperMerge {
10 public:
11  ToolPaste(Core *c, ToolID tid);
12  ToolResponse begin(const ToolArgs &args) override;
13  ToolResponse update(const ToolArgs &args) override;
14  bool can_begin() override
15  {
16  return true;
17  }
18 
19 private:
20  void fix_layer(int &la);
21  void apply_shift(Coordi &c, const Coordi &cursor_pos);
22  Coordi shift;
23  bool shift_set = false;
24  bool data_received = false;
25  ToolResponse begin_paste(const std::string &paste_data, const Coordi &cursor_pos);
26 };
27 } // namespace horizon
Definition: tool_helper_merge.hpp:5
This is what a Tool receives when the user did something.
Definition: core.hpp:27
Definition: tool_helper_move.hpp:5
bool can_begin() override
Definition: tool_paste.hpp:14
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_paste.cpp:305
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_paste.cpp:318
Where Tools and and documents meet.
Definition: core.hpp:232
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: core.hpp:46
Definition: block.cpp:9
Definition: tool_paste.hpp:9