16 #define GETTEXT_DOMAIN "wesnoth-lib" 26 :
widget(video, auto_join), scrollbar_(video),
27 old_position_(0), recursive_(false), shown_scrollbar_(false),
28 shown_size_(0), full_size_(0), swipe_dy_(0)
156 if (event.type == SDL_MOUSEWHEEL) {
157 const SDL_MouseWheelEvent &ev =
event.wheel;
163 }
else if (ev.y < 0) {
169 if (event.type == SDL_FINGERUP) {
173 if (event.type == SDL_FINGERDOWN || event.type == SDL_FINGERMOTION) {
175 auto tx =
static_cast<int>(
event.tfinger.x * r.w);
176 auto ty =
static_cast<int>(
event.tfinger.y * r.h);
177 auto dy =
static_cast<int>(
event.tfinger.dy * r.h);
179 if (event.type == SDL_FINGERDOWN) {
185 if (event.type == SDL_FINGERMOTION) {
193 if (scrollbar_step <= 0) {
200 unsigned int pos = std::max(
std::vector< events::sdl_handler * > sdl_handler_vector
SDL_Rect draw_area() const
Returns the size and location of the current drawing area in pixels.
bool point_in_rect(int x, int y, const SDL_Rect &rect)
Tests whether a point is inside a rectangle.
Contains the SDL_Rect helper code.
uint32_t get_mouse_state(int *x, int *y)
A wrapper for SDL_GetMouseState that gives coordinates in draw space.