The Battle for Wesnoth  1.15.5+dev
Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
theme::object Class Reference
Inheritance diagram for theme::object:
Inheritance graph

Public Types

enum  ANCHORING { FIXED, TOP_ANCHORED, PROPORTIONAL, BOTTOM_ANCHORED }
 

Public Member Functions

 object ()
 
 object (std::size_t sw, std::size_t sh, const config &cfg)
 
virtual ~object ()
 
virtual SDL_Rect & location (const SDL_Rect &screen) const
 
const SDL_Rect & get_location () const
 
const std::string & get_id () const
 
void modify_location (const _rect &rect)
 
void modify_location (std::string rect_str, SDL_Rect rect_ref)
 

Static Private Member Functions

static ANCHORING read_anchor (const std::string &str)
 

Private Attributes

bool location_modified_
 
std::string id_
 
SDL_Rect loc_
 
SDL_Rect relative_loc_
 
SDL_Rect last_screen_
 
ANCHORING xanchor_
 
ANCHORING yanchor_
 
std::size_t spec_width_
 
std::size_t spec_height_
 

Detailed Description

Definition at line 43 of file theme.hpp.

Member Enumeration Documentation

◆ ANCHORING

Enumerator
FIXED 
TOP_ANCHORED 
PROPORTIONAL 
BOTTOM_ANCHORED 

Definition at line 67 of file theme.hpp.

Constructor & Destructor Documentation

◆ object() [1/2]

theme::object::object ( )

Definition at line 276 of file theme.cpp.

◆ object() [2/2]

theme::object::object ( std::size_t  sw,
std::size_t  sh,
const config cfg 
)

Definition at line 289 of file theme.cpp.

◆ ~object()

virtual theme::object::~object ( )
inlinevirtual

Definition at line 48 of file theme.hpp.

Member Function Documentation

◆ get_id()

const std::string& theme::object::get_id ( ) const
inline

Definition at line 52 of file theme.hpp.

References mariadb::value::string.

Referenced by draw_panel(), theme::modify(), and theme::set_object_location().

◆ get_location()

const SDL_Rect& theme::object::get_location ( ) const
inline

Definition at line 51 of file theme.hpp.

References loc_.

Referenced by theme::set_object_location().

◆ location()

SDL_Rect & theme::object::location ( const SDL_Rect &  screen) const
virtual

◆ modify_location() [1/2]

void theme::object::modify_location ( const _rect rect)

Definition at line 397 of file theme.cpp.

References loc_, map_location::x, _rect::x1, _rect::x2, map_location::y, _rect::y1, and _rect::y2.

Referenced by theme::set_object_location().

◆ modify_location() [2/2]

void theme::object::modify_location ( std::string  rect_str,
SDL_Rect  rect_ref 
)

Definition at line 406 of file theme.cpp.

References compute(), mp_ui_alerts::items, and utils::split().

◆ read_anchor()

theme::object::ANCHORING theme::object::read_anchor ( const std::string &  str)
staticprivate

Definition at line 383 of file theme.cpp.

References mariadb::value::string.

Member Data Documentation

◆ id_

std::string theme::object::id_
private

Definition at line 71 of file theme.hpp.

◆ last_screen_

SDL_Rect theme::object::last_screen_
mutableprivate

Definition at line 74 of file theme.hpp.

◆ loc_

SDL_Rect theme::object::loc_
private

Definition at line 72 of file theme.hpp.

◆ location_modified_

bool theme::object::location_modified_
private

Definition at line 70 of file theme.hpp.

◆ relative_loc_

SDL_Rect theme::object::relative_loc_
mutableprivate

Definition at line 73 of file theme.hpp.

◆ spec_height_

std::size_t theme::object::spec_height_
private

Definition at line 77 of file theme.hpp.

◆ spec_width_

std::size_t theme::object::spec_width_
private

Definition at line 77 of file theme.hpp.

◆ xanchor_

ANCHORING theme::object::xanchor_
private

Definition at line 76 of file theme.hpp.

◆ yanchor_

ANCHORING theme::object::yanchor_
private

Definition at line 76 of file theme.hpp.


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