The Battle for Wesnoth  1.15.1+dev
Classes | 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:
Inheritance graph

Classes

struct  bg_cache
 

Public Member Functions

 imgsel_style (const std::string &img_base, bool has_bg, int normal_rgb, int selected_rgb, int heading_rgb, double normal_alpha, double selected_alpha, double heading_alpha)
 
virtual ~imgsel_style ()
 
virtual SDL_Rect item_size (const std::string &item) 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 ()
 
- Public Member Functions inherited from gui::menu::style
 style ()
 
virtual ~style ()
 
void scale_images (int max_width, int max_height)
 
surface get_item_image (const image::locator &i_locator) const
 
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, surfaceimg_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_
 
int heading_rgb_
 
double normal_alpha_
 
double selected_alpha_
 
double heading_alpha_
 
int max_img_w_
 
int max_img_h_
 

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_
 
int heading_rgb2_
 
double normal_alpha2_
 
double selected_alpha2_
 
double heading_alpha2_
 
bg_cache bg_cache_
 

Detailed Description

Definition at line 61 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,
int  heading_rgb,
double  normal_alpha,
double  selected_alpha,
double  heading_alpha 
)

Definition at line 46 of file menu_style.cpp.

◆ ~imgsel_style()

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

Definition at line 53 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

◆ init()

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

Reimplemented from gui::menu::style.

Definition at line 73 of file menu.hpp.

◆ item_size()

SDL_Rect gui::menu::imgsel_style::item_size ( const std::string &  item) const
virtual

Reimplemented from gui::menu::style.

Definition at line 232 of file menu_style.cpp.

References gui::menu::style::item_size(), and gui::menu::style::thickness_.

◆ load_image()

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

Definition at line 86 of file menu_style.cpp.

References surface::get(), image::get_image(), img_base_, img_map_, and game_config::path.

Referenced by load_images().

◆ load_images()

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

Member Data Documentation

◆ bg_cache_

bg_cache gui::menu::imgsel_style::bg_cache_
private

Definition at line 96 of file menu.hpp.

Referenced by draw_row_bg().

◆ has_background_

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

Definition at line 82 of file menu.hpp.

Referenced by draw_row_bg(), and load_images().

◆ heading_alpha2_

double gui::menu::imgsel_style::heading_alpha2_
private

Definition at line 86 of file menu.hpp.

Referenced by load_images().

◆ heading_rgb2_

int gui::menu::imgsel_style::heading_rgb2_
private

Definition at line 85 of file menu.hpp.

Referenced by load_images().

◆ img_base_

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

Definition at line 77 of file menu.hpp.

Referenced by load_image().

◆ img_map_

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

Definition at line 78 of file menu.hpp.

Referenced by draw_row(), draw_row_bg(), load_image(), and load_images().

◆ initialized_

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

Definition at line 83 of file menu.hpp.

Referenced by load_images().

◆ load_failed_

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

Definition at line 84 of file menu.hpp.

Referenced by draw_row(), draw_row_bg(), and load_images().

◆ normal_alpha2_

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

Definition at line 86 of file menu.hpp.

Referenced by load_images().

◆ normal_rgb2_

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

Definition at line 85 of file menu.hpp.

Referenced by load_images().

◆ selected_alpha2_

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

Definition at line 86 of file menu.hpp.

Referenced by load_images().

◆ selected_rgb2_

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

Definition at line 85 of file menu.hpp.

Referenced by load_images().


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