The Battle for Wesnoth  1.15.2+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 (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_
 

Detailed Description

Definition at line 41 of file theme.hpp.

Member Enumeration Documentation

◆ ANCHORING

Enumerator
FIXED 
TOP_ANCHORED 
PROPORTIONAL 
BOTTOM_ANCHORED 

Definition at line 65 of file theme.hpp.

Constructor & Destructor Documentation

◆ object() [1/2]

theme::object::object ( )

Definition at line 278 of file theme.cpp.

◆ object() [2/2]

theme::object::object ( const config cfg)

Definition at line 289 of file theme.cpp.

◆ ~object()

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

Definition at line 46 of file theme.hpp.

Member Function Documentation

◆ get_id()

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

Definition at line 50 of file theme.hpp.

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 49 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 388 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 397 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 374 of file theme.cpp.

Member Data Documentation

◆ id_

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

Definition at line 69 of file theme.hpp.

◆ last_screen_

SDL_Rect theme::object::last_screen_
mutableprivate

Definition at line 72 of file theme.hpp.

◆ loc_

SDL_Rect theme::object::loc_
private

Definition at line 70 of file theme.hpp.

◆ location_modified_

bool theme::object::location_modified_
private

Definition at line 68 of file theme.hpp.

◆ relative_loc_

SDL_Rect theme::object::relative_loc_
mutableprivate

Definition at line 71 of file theme.hpp.

◆ xanchor_

ANCHORING theme::object::xanchor_
private

Definition at line 74 of file theme.hpp.

◆ yanchor_

ANCHORING theme::object::yanchor_
private

Definition at line 74 of file theme.hpp.


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