The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
editor::editor_toolkit Class Reference

#include <editor_toolkit.hpp>

Public Member Functions

 editor_toolkit (editor_display &gui, const CKey &key, const config &game_config, context_manager &c_manager)
 
 ~editor_toolkit ()
 
void adjust_size ()
 
void update_mouse_action_highlights ()
 
void set_mouseover_overlay ()
 
void clear_mouseover_overlay ()
 
void hotkey_set_mouse_action (hotkey::HOTKEY_COMMAND command)
 Set the current mouse action based on a hotkey id. More...
 
bool is_mouse_action_set (hotkey::HOTKEY_COMMAND command) const
 
mouse_actionget_mouse_action ()
 Get the current mouse action. More...
 
void cycle_brush ()
 Cycle to the next brush. More...
 
void set_brush (std::string id)
 TODO. More...
 
bool is_active_brush (std::string id) const
 TODO. More...
 
palette_managerget_palette_manager ()
 

Private Types

typedef std::map
< hotkey::HOTKEY_COMMAND,
mouse_action * > 
mouse_action_map
 The mouse actions. More...
 

Private Member Functions

void init_sidebar (const config &game_config)
 init the sidebar objects More...
 
void init_brushes (const config &game_config)
 init the brushes More...
 
void init_mouse_actions (context_manager &c_manager)
 init the mouse actions (tools) More...
 

Private Attributes

editor_displaygui_
 
const CKeykey_
 
boost::scoped_ptr
< palette_manager
palette_manager_
 
mouse_actionmouse_action_
 The current mouse action. More...
 
mouse_action_map mouse_actions_
 
brushbrush_
 The current brush. More...
 
std::vector< brushbrushes_
 All available brushes. More...
 

Detailed Description

Definition at line 31 of file editor_toolkit.hpp.

Member Typedef Documentation

The mouse actions.

Definition at line 98 of file editor_toolkit.hpp.

Constructor & Destructor Documentation

editor::editor_toolkit::editor_toolkit ( editor_display gui,
const CKey key,
const config game_config,
context_manager c_manager 
)

Definition at line 27 of file editor_toolkit.cpp.

References init_brushes(), init_mouse_actions(), and init_sidebar().

editor::editor_toolkit::~editor_toolkit ( )

Definition at line 42 of file editor_toolkit.cpp.

Member Function Documentation

void editor::editor_toolkit::adjust_size ( )

Definition at line 168 of file editor_toolkit.cpp.

References palette_manager_.

void editor::editor_toolkit::clear_mouseover_overlay ( )

Definition at line 143 of file editor_toolkit.cpp.

References display::clear_mouseover_hex_overlay(), and gui_.

void editor::editor_toolkit::cycle_brush ( )

Cycle to the next brush.

Definition at line 157 of file editor_toolkit.cpp.

References brush_, brushes_, and update_mouse_action_highlights().

mouse_action* editor::editor_toolkit::get_mouse_action ( )
inline

Get the current mouse action.

Definition at line 69 of file editor_toolkit.hpp.

References mouse_action_.

Referenced by update_mouse_action_highlights().

palette_manager* editor::editor_toolkit::get_palette_manager ( )
inline

Definition at line 82 of file editor_toolkit.hpp.

References palette_manager_.

void editor::editor_toolkit::hotkey_set_mouse_action ( hotkey::HOTKEY_COMMAND  command)

Set the current mouse action based on a hotkey id.

Definition at line 105 of file editor_toolkit.cpp.

References ERR_ED, gui_, i, display::invalidate_game_status(), mouse_action_, mouse_actions_, palette_manager_, and set_mouseover_overlay().

void editor::editor_toolkit::init_brushes ( const config game_config)
private

init the brushes

Definition at line 51 of file editor_toolkit.cpp.

References brush_, brushes_, config::child_range(), ERR_ED, and i.

Referenced by editor_toolkit().

void editor::editor_toolkit::init_mouse_actions ( context_manager c_manager)
private
void editor::editor_toolkit::init_sidebar ( const config game_config)
private

init the sidebar objects

Definition at line 64 of file editor_toolkit.cpp.

References gui_, mouse_action_, and palette_manager_.

Referenced by editor_toolkit().

bool editor::editor_toolkit::is_active_brush ( std::string  id) const
inline

TODO.

Definition at line 80 of file editor_toolkit.hpp.

References brush_, and editor::brush::id().

bool editor::editor_toolkit::is_mouse_action_set ( hotkey::HOTKEY_COMMAND  command) const
Returns
true if the mouse action identified by the hotkey is active

Definition at line 123 of file editor_toolkit.cpp.

References i, mouse_action_, and mouse_actions_.

void editor::editor_toolkit::set_brush ( std::string  id)

TODO.

Definition at line 148 of file editor_toolkit.cpp.

References brush_, brushes_, and i.

void editor::editor_toolkit::set_mouseover_overlay ( )
void editor::editor_toolkit::update_mouse_action_highlights ( )

Member Data Documentation

brush* editor::editor_toolkit::brush_
private

The current brush.

Definition at line 104 of file editor_toolkit.hpp.

Referenced by cycle_brush(), init_brushes(), init_mouse_actions(), is_active_brush(), and set_brush().

std::vector<brush> editor::editor_toolkit::brushes_
private

All available brushes.

Definition at line 107 of file editor_toolkit.hpp.

Referenced by cycle_brush(), init_brushes(), and set_brush().

editor_display& editor::editor_toolkit::gui_
private
const CKey& editor::editor_toolkit::key_
private

Definition at line 88 of file editor_toolkit.hpp.

Referenced by init_mouse_actions().

mouse_action* editor::editor_toolkit::mouse_action_
private
mouse_action_map editor::editor_toolkit::mouse_actions_
private
boost::scoped_ptr<palette_manager> editor::editor_toolkit::palette_manager_
private

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