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))
310 if (event.button == SDL_BUTTON_RIGHT) {
317 if (event.button == SDL_BUTTON_LEFT) {
333 if (!(
hit(event.x, event.y)))
337 if (event.button == SDL_BUTTON_LEFT) {
355 if (event.button == SDL_BUTTON_RIGHT) {
389 switch (event.type) {
390 case SDL_MOUSEBUTTONDOWN:
393 case SDL_MOUSEBUTTONUP:
396 case SDL_MOUSEMOTION:
404 if (start_state !=
state_)
Drawing functions, for drawing things on the screen.
int w() const
The draw-space width of the texture, in pixels.
virtual void select_bg_item(const std::string &item_id)=0
std::vector< color_t > palette(const color_range &cr)
Creates a reference color palette from a color range.
int h() const
The draw-space height of the texture, in pixels.
bool contains(int x, int y) const
Whether the given point lies within the rectangle.
Wrapper class to encapsulate creation and management of an SDL_Texture.
virtual void select_fg_item(const std::string &item_id)=0
void blit(const texture &tex, const SDL_Rect &dst)
Draws a texture, or part of a texture, at the given location.
Contains the SDL_Rect helper code.
void play_UI_sound(const std::string &files)
Standard logging facilities (interface).
texture get_texture(const image::locator &i_locator, TYPE type, bool skip_cache)
Returns an image texture suitable for hardware-accelerated rendering.
const std::string checkbox_release