16 #define GETTEXT_DOMAIN "wesnoth-lib"
28 #define ERR_DP LOG_STREAM(err, log_display)
34 std::string button_image_name,
45 , pressedBothActiveImage_()
46 , pressedDownActiveImage_()
47 , pressedUpActiveImage_()
61 if (button_image_name.empty()) {
62 button_image_name =
"buttons/button_selectable/button_selectable_38_";
111 switch (new_pressed_state) {
125 if (
state_ != new_state) {
233 SDL_Rect magic{
loc.
x + 1,
loc.
y + 1, 36, 36};
252 if (
hit(event.x, event.y))
307 if (!
hit(event.x, event.y))
311 if (event.button == SDL_BUTTON_RIGHT) {
318 if (event.button == SDL_BUTTON_LEFT) {
334 if (!(
hit(event.x, event.y)))
338 if (event.button == SDL_BUTTON_LEFT) {
356 if (event.button == SDL_BUTTON_RIGHT) {
390 switch (event.type) {
391 case SDL_MOUSEBUTTONDOWN:
394 case SDL_MOUSEBUTTONUP:
397 case SDL_MOUSEMOTION:
405 if (start_state !=
state_)
virtual void select_bg_item(const std::string &item_id)=0
virtual void select_fg_item(const std::string &item_id)=0
Wrapper class to encapsulate creation and management of an SDL_Texture.
int w() const
The draw-space width of the texture, in pixels.
int h() const
The draw-space height of the texture, in pixels.
std::vector< color_t > palette(const color_range &cr)
Creates a reference color palette from a color range.
Drawing functions, for drawing things on the screen.
Standard logging facilities (interface).
void blit(const texture &tex, const SDL_Rect &dst)
Draws a texture, or part of a texture, at the given location.
const std::string checkbox_release
texture get_texture(const image::locator &i_locator, TYPE type, bool skip_cache)
Returns an image texture suitable for hardware-accelerated rendering.
void play_UI_sound(const std::string &files)
Contains the SDL_Rect helper code.
bool contains(int x, int y) const
Whether the given point lies within the rectangle.