The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
gui::menu::imgsel_style Class Reference

#include <menu.hpp>

Inheritance diagram for gui::menu::imgsel_style:

Public Member Functions

 imgsel_style (const std::string &img_base, bool has_bg, int normal_rgb, int selected_rgb, double normal_alpha, double selected_alpha)
 
virtual ~imgsel_style ()
 
virtual SDL_Rect item_size (const indented_menu_item &imi) const
 
virtual void draw_row_bg (menu &menu_ref, const std::size_t row_index, const SDL_Rect &rect, ROW_TYPE type)
 
virtual void draw_row (menu &menu_ref, const std::size_t row_index, const SDL_Rect &rect, ROW_TYPE type)
 
virtual void init ()
 
bool load_images ()
 
void unload_images ()
 
- Public Member Functions inherited from gui::menu::style
 style ()
 
virtual ~style ()
 
std::size_t get_font_size () const
 
std::size_t get_cell_padding () const
 
std::size_t get_thickness () const
 

Protected Attributes

const std::string img_base_
 
std::map< std::string, textureimg_map_
 
- Protected Attributes inherited from gui::menu::style
std::size_t font_size_
 
std::size_t cell_padding_
 
std::size_t thickness_
 
int normal_rgb_
 
int selected_rgb_
 
double normal_alpha_
 
double selected_alpha_
 

Private Member Functions

bool load_image (const std::string &img_sub)
 

Private Attributes

bool has_background_
 
bool initialized_
 
bool load_failed_
 
int normal_rgb2_
 
int selected_rgb2_
 
double normal_alpha2_
 
double selected_alpha2_
 

Detailed Description

Definition at line 75 of file menu.hpp.

Constructor & Destructor Documentation

◆ imgsel_style()

gui::menu::imgsel_style::imgsel_style ( const std::string &  img_base,
bool  has_bg,
int  normal_rgb,
int  selected_rgb,
double  normal_alpha,
double  selected_alpha 
)

Definition at line 43 of file menu_style.cpp.

◆ ~imgsel_style()

gui::menu::imgsel_style::~imgsel_style ( )
virtual

Definition at line 50 of file menu_style.cpp.

Member Function Documentation

◆ draw_row()

void gui::menu::imgsel_style::draw_row ( menu menu_ref,
const std::size_t  row_index,
const SDL_Rect &  rect,
ROW_TYPE  type 
)
virtual

◆ draw_row_bg()

void gui::menu::imgsel_style::draw_row_bg ( menu menu_ref,
const std::size_t  row_index,
const SDL_Rect &  rect,
ROW_TYPE  type 
)
virtual

Reimplemented from gui::menu::style.

Definition at line 114 of file menu_style.cpp.

References draw::blit(), gui::menu::style::draw_row_bg(), and gui::menu::SELECTED_ROW.

◆ init()

virtual void gui::menu::imgsel_style::init ( )
inlinevirtual

Reimplemented from gui::menu::style.

Definition at line 87 of file menu.hpp.

References load_images().

◆ item_size()

SDL_Rect gui::menu::imgsel_style::item_size ( const indented_menu_item imi) const
virtual

Reimplemented from gui::menu::style.

Definition at line 213 of file menu_style.cpp.

References gui::menu::style::item_size().

◆ load_image()

bool gui::menu::imgsel_style::load_image ( const std::string &  img_sub)
private

Definition at line 57 of file menu_style.cpp.

References image::get_texture(), and game_config::path.

◆ load_images()

bool gui::menu::imgsel_style::load_images ( )

Definition at line 65 of file menu_style.cpp.

References h, and w.

Referenced by init().

◆ unload_images()

void gui::menu::imgsel_style::unload_images ( )

Definition at line 109 of file menu_style.cpp.

Referenced by video::deinit().

Member Data Documentation

◆ has_background_

bool gui::menu::imgsel_style::has_background_
private

Definition at line 97 of file menu.hpp.

◆ img_base_

const std::string gui::menu::imgsel_style::img_base_
protected

Definition at line 92 of file menu.hpp.

◆ img_map_

std::map<std::string,texture> gui::menu::imgsel_style::img_map_
protected

Definition at line 93 of file menu.hpp.

◆ initialized_

bool gui::menu::imgsel_style::initialized_
private

Definition at line 98 of file menu.hpp.

◆ load_failed_

bool gui::menu::imgsel_style::load_failed_
private

Definition at line 99 of file menu.hpp.

◆ normal_alpha2_

double gui::menu::imgsel_style::normal_alpha2_
private

Definition at line 101 of file menu.hpp.

◆ normal_rgb2_

int gui::menu::imgsel_style::normal_rgb2_
private

Definition at line 100 of file menu.hpp.

◆ selected_alpha2_

double gui::menu::imgsel_style::selected_alpha2_
private

Definition at line 101 of file menu.hpp.

◆ selected_rgb2_

int gui::menu::imgsel_style::selected_rgb2_
private

Definition at line 100 of file menu.hpp.


The documentation for this class was generated from the following files: