The Battle for Wesnoth  1.15.0+dev
Public Member Functions | Protected Attributes | List of all members
editor::mouse_action_paste Class Reference

Paste action. More...

#include <mouse_action.hpp>

Inheritance diagram for editor::mouse_action_paste:
Inheritance graph

Public Member Functions

 mouse_action_paste (const map_fragment &paste, const CKey &key, common_palette &palette)
 
virtual bool has_context_menu () const override
 
std::set< map_locationaffected_hexes (editor_display &disp, const map_location &hex) override
 Show an outline of where the paste will go. More...
 
editor_actionclick_left (editor_display &disp, int x, int y) override
 Return a paste with offset action. More...
 
editor_actionclick_right (editor_display &disp, int x, int y) override
 Right click does nothing for now. More...
 
virtual void set_mouse_overlay (editor_display &disp) override
 Set the mouse overlay for this action. More...
 
- Public Member Functions inherited from editor::mouse_action
 mouse_action (common_palette &palette, const CKey &key)
 
virtual ~mouse_action ()
 
virtual void move (editor_display &disp, const map_location &hex)
 Mouse move (not a drag). More...
 
void update_brush_highlights (editor_display &disp, const map_location &hex)
 Unconditionally update the brush highlights for the current tool when hex is the center location. More...
 
virtual editor_actiondrag_left (editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
 Drag operation. More...
 
virtual editor_actiondrag_right (editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
 Drag operation. More...
 
virtual editor_actiondrag_end_left (editor_display &disp, int x, int y)
 The end of dragging. More...
 
virtual editor_actiondrag_end_right (editor_display &disp, int x, int y)
 
virtual editor_actionup_left (editor_display &disp, int x, int y)
 
virtual editor_actionup_right (editor_display &disp, int x, int y)
 
virtual editor_actionkey_event (editor_display &disp, const SDL_Event &e)
 Function called by the controller on a key event for the current mouse action. More...
 
void set_toolbar_button (const theme::menu *value)
 Helper variable setter - pointer to a toolbar menu/button used for highlighting the current action. More...
 
const theme::menutoolbar_button () const
 Getter for the (possibly nullptr) associated menu/button. More...
 
common_paletteget_palette ()
 Getter for the associated palette. More...
 
virtual bool supports_brushes () const
 Whether we need the brush bar, is used to grey it out. More...
 

Protected Attributes

const map_fragmentpaste_
 Reference to the buffer used for pasting (e.g. More...
 
- Protected Attributes inherited from editor::mouse_action
map_location previous_move_hex_
 The hex previously used in move operations. More...
 
const CKeykey_
 Key presses, used for modifiers (alt, shift) in some operations. More...
 

Additional Inherited Members

- Protected Member Functions inherited from editor::mouse_action
bool has_alt_modifier () const
 
bool has_shift_modifier () const
 
bool has_ctrl_modifier () const
 
void set_terrain_mouse_overlay (editor_display &disp, const t_translation::terrain_code &fg, const t_translation::terrain_code &bg)
 Helper function for derived classes that need a active-terrain mouse overlay. More...
 

Detailed Description

Paste action.

No dragging capabilities.

Definition at line 294 of file mouse_action.hpp.

Constructor & Destructor Documentation

◆ mouse_action_paste()

editor::mouse_action_paste::mouse_action_paste ( const map_fragment paste,
const CKey key,
common_palette palette 
)
inline

Member Function Documentation

◆ affected_hexes()

std::set< map_location > editor::mouse_action_paste::affected_hexes ( editor_display disp,
const map_location hex 
)
overridevirtual

Show an outline of where the paste will go.

Reimplemented from editor::mouse_action.

Definition at line 314 of file mouse_action.cpp.

◆ click_left()

editor_action * editor::mouse_action_paste::click_left ( editor_display disp,
int  x,
int  y 
)
overridevirtual

Return a paste with offset action.

Implements editor::mouse_action.

Definition at line 320 of file mouse_action.cpp.

References a, and display::hex_clicked_on().

◆ click_right()

editor_action * editor::mouse_action_paste::click_right ( editor_display disp,
int  x,
int  y 
)
overridevirtual

Right click does nothing for now.

Implements editor::mouse_action.

Definition at line 327 of file mouse_action.cpp.

◆ has_context_menu()

bool editor::mouse_action_paste::has_context_menu ( ) const
overridevirtual

Reimplemented from editor::mouse_action.

Definition at line 309 of file mouse_action.cpp.

◆ set_mouse_overlay()

void editor::mouse_action_paste::set_mouse_overlay ( editor_display disp)
overridevirtual

Set the mouse overlay for this action.

Defaults to an empty overlay.

Reimplemented from editor::mouse_action.

Definition at line 332 of file mouse_action.cpp.

References adjust_surface_alpha(), image::get_image(), display::get_zoom_factor(), scale_surface(), sdl_blit(), display::set_mouseover_hex_overlay(), and utf8::size().

Member Data Documentation

◆ paste_

const map_fragment& editor::mouse_action_paste::paste_
protected

Reference to the buffer used for pasting (e.g.

the clipboard)

Definition at line 325 of file mouse_action.hpp.


The documentation for this class was generated from the following files: