16 #define GETTEXT_DOMAIN "wesnoth-lib"
26 :
widget(auto_join), scrollbar_(),
27 old_position_(0), recursive_(false), shown_scrollbar_(false),
28 shown_size_(0), full_size_(0), swipe_dy_(0)
154 if (event.type == SDL_MOUSEWHEEL) {
155 const SDL_MouseWheelEvent &ev =
event.wheel;
161 }
else if (ev.y < 0) {
167 if (event.type == SDL_FINGERUP) {
171 if (event.type == SDL_FINGERDOWN || event.type == SDL_FINGERMOTION) {
176 auto tx =
static_cast<int>(
event.tfinger.x * canvas_size.x);
177 auto ty =
static_cast<int>(
event.tfinger.y * canvas_size.y);
178 auto dy =
static_cast<int>(
event.tfinger.dy * canvas_size.y);
180 if (event.type == SDL_FINGERDOWN) {
186 if (event.type == SDL_FINGERMOTION) {
194 if (scrollbar_step <= 0) {
201 unsigned int pos = std::max(
std::vector< events::sdl_handler * > sdl_handler_vector
void rect(const SDL_Rect &rect)
Draw a rectangle.
uint32_t get_mouse_state(int *x, int *y)
A wrapper for SDL_GetMouseState that gives coordinates in draw space.
bool contains(const Container &container, const Value &value)
Returns true iff value is found in container.
point game_canvas_size()
The size of the game canvas, in drawing coordinates / game pixels.
Contains the SDL_Rect helper code.
An abstract description of a rectangle with integer coordinates.
bool contains(int x, int y) const
Whether the given point lies within the rectangle.