36 #ifndef CONTROLLER_BASE_H_INCLUDED
37 #define CONTROLLER_BASE_H_INCLUDED
52 namespace events {
class mouse_handler_base; }
116 bool handle_scroll(
int mousex,
int mousey,
int mouse_flags,
double joystickx,
double joysticky);
144 virtual void show_menu(
const std::vector<std::string>& items_arg,
int xloc,
int yloc,
bool context_menu,
display& disp);
145 virtual void execute_action(
const std::vector<std::string>& items_arg,
int xloc,
int yloc,
bool context_menu);
static const config & get_theme(const config &game_config, std::string theme_name)
joystick_manager joystick_manager_
virtual plugins_context * get_plugins_context()
Get (optionally) a plugins context a derived class uses.
virtual bool is_browsing() const
void set_scroll_up(bool on)
void set_scroll_down(bool on)
virtual void show_menu(const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu, display &disp)
void handle_window_event(const SDL_Event &)
virtual void process_focus_keydown_event(const SDL_Event &event)
Process keydown (only when the general map display does not have focus).
void play_slice(bool is_delay_enabled=true)
virtual display & get_display()=0
Get a reference to a display member a derived class uses.
GLint GLint GLint GLint GLint GLint y
virtual void process_keydown_event(const SDL_Event &event)
Process keydown (always).
virtual bool have_keyboard_focus()
Derived classes should override this to return false when arrow keys should not scroll the map...
Keyboard shortcuts for game actions.
virtual std::vector< std::string > additional_actions_pressed()
virtual soundsource::manager * get_soundsource_man()
Get (optionally) a soundsources manager a derived class uses.
bool handle_scroll(int mousex, int mousey, int mouse_flags, double joystickx, double joysticky)
Handle scrolling by keyboard, joystick and moving mouse near map edges.
void apply_keyboard_scroll(int x, int y)
virtual ~controller_base()
virtual events::mouse_handler_base & get_mouse_handler_base()=0
Get a reference to a mouse handler member a derived class uses.
virtual void execute_action(const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu)
controller_base(const config &game_config, CVideo &video)
Game configuration data as global variables.
const config & game_config_
void set_scroll_right(bool on)
GLint GLint GLint GLint GLint x
Handling of system events.
virtual hotkey::command_executor * get_hotkey_command_executor()
Get (optionally) a command executor to handle context menu events.
void set_scroll_left(bool on)
virtual void process_keyup_event(const SDL_Event &event)
Process keyup (always).
void handle_event(const SDL_Event &event)
Process mouse- and keypress-events from SDL.
A config object defines a single node in a WML file, with access to child nodes.
Class that keeps track of all the keys on the keyboard.
GLsizei const GLcharARB ** string
virtual bool in_context_menu(hotkey::HOTKEY_COMMAND command) const