The Battle for Wesnoth  1.19.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:

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 rectlocation (const SDL_Rect &screen) const
 
const rectget_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_
 
rect loc_
 
rect relative_loc_
 
rect last_screen_
 
ANCHORING xanchor_
 
ANCHORING yanchor_
 
std::size_t spec_width_
 
std::size_t spec_height_
 

Detailed Description

Definition at line 46 of file theme.hpp.

Member Enumeration Documentation

◆ ANCHORING

Enumerator
FIXED 
TOP_ANCHORED 
PROPORTIONAL 
BOTTOM_ANCHORED 

Definition at line 70 of file theme.hpp.

Constructor & Destructor Documentation

◆ object() [1/2]

theme::object::object ( )

Definition at line 274 of file theme.cpp.

◆ object() [2/2]

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

Definition at line 287 of file theme.cpp.

◆ ~object()

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

Definition at line 51 of file theme.hpp.

Member Function Documentation

◆ get_id()

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

Definition at line 55 of file theme.hpp.

References id_.

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

◆ get_location()

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

Definition at line 54 of file theme.hpp.

References loc_.

Referenced by theme::set_object_location().

◆ location()

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 395 of file theme.cpp.

References loc_, map_location::x, and map_location::y.

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 404 of file theme.cpp.

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

◆ read_anchor()

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

Definition at line 381 of file theme.cpp.

Member Data Documentation

◆ id_

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

Definition at line 74 of file theme.hpp.

Referenced by get_id().

◆ last_screen_

rect theme::object::last_screen_
mutableprivate

Definition at line 77 of file theme.hpp.

◆ loc_

rect theme::object::loc_
private

Definition at line 75 of file theme.hpp.

Referenced by get_location().

◆ location_modified_

bool theme::object::location_modified_
private

Definition at line 73 of file theme.hpp.

◆ relative_loc_

rect theme::object::relative_loc_
mutableprivate

Definition at line 76 of file theme.hpp.

◆ spec_height_

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

Definition at line 80 of file theme.hpp.

◆ spec_width_

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

Definition at line 80 of file theme.hpp.

◆ xanchor_

ANCHORING theme::object::xanchor_
private

Definition at line 79 of file theme.hpp.

◆ yanchor_

ANCHORING theme::object::yanchor_
private

Definition at line 79 of file theme.hpp.


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