The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Macros | Functions | Variables
hotkey_item.cpp File Reference
#include "log.hpp"
#include "hotkey_item.hpp"
#include "hotkey_command.hpp"
#include "config.hpp"
#include "gettext.hpp"
#include "serialization/unicode.hpp"
#include "sdl/utils.hpp"
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include "utils/functional.hpp"
#include "key.hpp"
#include <SDL.h>
Include dependency graph for hotkey_item.cpp:

Go to the source code of this file.

Namespaces

 hotkey
 Keyboard shortcuts for game actions.
 

Macros

#define GETTEXT_DOMAIN   "wesnoth-lib"
 
#define ERR_G   LOG_STREAM(err, lg::general())
 
#define LOG_G   LOG_STREAM(info, lg::general())
 
#define DBG_G   LOG_STREAM(debug, lg::general())
 
#define ERR_CF   LOG_STREAM(err, log_config)
 

Functions

static unsigned int hotkey::sdl_get_mods ()
 
hotkey_ptr hotkey::create_hotkey (const std::string &id, SDL_Event &event)
 Create a new hotkey item for a command from an SDL_Event. More...
 
hotkey_ptr hotkey::load_from_config (const config &cfg)
 Create and instantiate a hotkey from a config element. More...
 
bool hotkey::has_hotkey_item (const std::string &command)
 
void hotkey::del_hotkey (const hotkey_ptr item)
 Remove a hotkey from the list of hotkeys. More...
 
void hotkey::add_hotkey (const hotkey_ptr item)
 Add a hotkey to the list of hotkeys. More...
 
void hotkey::clear_hotkeys (const std::string &command)
 Unset the command bindings for all hotkeys matching the command. More...
 
void hotkey::clear_hotkeys ()
 Unset the bindings for all hotkeys. More...
 
const hotkey_ptr hotkey::get_hotkey (const SDL_Event &event)
 Iterate through the list of hotkeys and return a hotkey that matches the SDL_Event and the current keyboard modifier state. More...
 
void hotkey::load_hotkeys (const config &cfg, bool set_as_default=false)
 Iterates through all hotkeys present in the config struct and creates and adds them to the hotkey list. More...
 
void hotkey::reset_default_hotkeys ()
 Reset all hotkeys to the defaults. More...
 
const hotkey_list & hotkey::get_hotkeys ()
 Returns the list of hotkeys. More...
 
void hotkey::save_hotkeys (config &cfg)
 Save the non-default hotkeys to the config. More...
 
std::string hotkey::get_names (std::string id)
 Returns a comma-separated string of hotkey names. More...
 

Variables

static lg::log_domain log_config ("config")
 
hotkey_list hotkey::hotkeys_
 
config hotkey::default_hotkey_cfg_
 

Macro Definition Documentation

#define DBG_G   LOG_STREAM(debug, lg::general())

Definition at line 40 of file hotkey_item.cpp.

#define ERR_CF   LOG_STREAM(err, log_config)

Definition at line 41 of file hotkey_item.cpp.

#define ERR_G   LOG_STREAM(err, lg::general())
#define GETTEXT_DOMAIN   "wesnoth-lib"

Definition at line 21 of file hotkey_item.cpp.

#define LOG_G   LOG_STREAM(info, lg::general())

Definition at line 39 of file hotkey_item.cpp.

Variable Documentation

lg::log_domain log_config("config")
static