The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
gui2::tloadscreen Class Reference

#include <loadscreen.hpp>

Inheritance diagram for gui2::tloadscreen:
Inheritance graph

Public Member Functions

 tloadscreen (std::function< void()> f)
 
 ~tloadscreen ()
 
void close ()
 Hides the window. More...
 
- Public Member Functions inherited from gui2::tdialog
 tdialog ()
 
virtual ~tdialog ()
 
bool show (CVideo &video, const unsigned auto_close_time=0)
 Shows the window. More...
 
int get_retval () const
 
void set_always_save_fields (const bool always_save_fields)
 
void set_restore (const bool restore)
 

Static Public Member Functions

static void display (CVideo &video, std::function< void()> f)
 
static bool displaying ()
 
static void progress (const char *stage_name=nullptr)
 

Private Member Functions

twindowbuild_window (CVideo &video) const
 
virtual const std::stringwindow_id () const
 The id of the window to build. More...
 
void timer_callback (twindow &window)
 
void pre_show (twindow &window)
 Inherited from tdialog. More...
 
void post_show (twindow &window)
 Inherited from tdialog. More...
 

Private Attributes

twindowwindow_
 
size_t timer_id_
 
int animation_counter_
 
std::function< void()> work_
 
boost::scoped_ptr< boost::thread > worker_
 
boost::scoped_ptr< cursor::settercursor_setter_
 
tlabelprogress_stage_label_
 
tlabelanimation_label_
 
std::atomic< const char * > current_stage_
 
std::map< std::string, t_stringvisible_stages_
 
std::vector< t_stringanimation_stages_
 
std::map< std::string,
t_string >::const_iterator 
current_visible_stage_
 

Static Private Attributes

static tloadscreencurrent_load = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::tdialog
tfield_boolregister_bool (const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value=std::function< bool()>(), const std::function< void(const bool)> &callback_save_value=std::function< void(const bool)>(), const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>())
 Creates a new boolean field. More...
 
tfield_boolregister_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>())
 Creates a new boolean field. More...
 
tfield_integerregister_integer (const std::string &id, const bool mandatory, const std::function< int()> &callback_load_value=std::function< int()>(), const std::function< void(const int)> &callback_save_value=std::function< void(const int)>())
 Creates a new integer field. More...
 
tfield_integerregister_integer (const std::string &id, const bool mandatory, int &linked_variable)
 Creates a new integer field. More...
 
tfield_textregister_text (const std::string &id, const bool mandatory, const std::function< std::string()> &callback_load_value=std::function< std::string()>(), const std::function< void(const std::string &)> &callback_save_value=std::function< void(const std::string &)>(), const bool capture_focus=false)
 Creates a new text field. More...
 
tfield_textregister_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false)
 Creates a new text field. More...
 
tfield_labelregister_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false)
 Registers a new control as a label. More...
 
tfield_labelregister_image (const std::string &id, const bool mandatory, const std::string &filename)
 Registers a new control as image. More...
 

Detailed Description

Definition at line 40 of file loadscreen.hpp.

Constructor & Destructor Documentation

gui2::tloadscreen::tloadscreen ( std::function< void()>  f)

Definition at line 67 of file loadscreen.cpp.

References i.

Referenced by display().

gui2::tloadscreen::~tloadscreen ( )

Definition at line 175 of file loadscreen.cpp.

References close(), and current_load.

Member Function Documentation

twindow * gui2::tloadscreen::build_window ( CVideo video) const
private

Definition at line 102 of file loadscreen.cpp.

References gui2::build(), and window_id().

void gui2::tloadscreen::close ( )

Hides the window.

The hiding also destroys the window. It is safe to call the function when the window is not shown.

Definition at line 93 of file loadscreen.cpp.

References gui2::twindow::undraw(), and window_.

Referenced by ~tloadscreen().

void gui2::tloadscreen::display ( CVideo video,
std::function< void()>  f 
)
static
static bool gui2::tloadscreen::displaying ( )
inlinestatic

Definition at line 49 of file loadscreen.hpp.

References current_load.

Referenced by mp::ui::handle_event(), and display::handle_event().

void gui2::tloadscreen::post_show ( twindow window)
privatevirtual

Inherited from tdialog.

Reimplemented from gui2::tdialog.

Definition at line 121 of file loadscreen.cpp.

References cursor_setter_, gui2::remove_timer(), timer_id_, and worker_.

void gui2::tloadscreen::pre_show ( twindow window)
privatevirtual

Inherited from tdialog.

Reimplemented from gui2::tdialog.

Definition at line 107 of file loadscreen.cpp.

References gui2::add_timer(), animation_label_, cursor_setter_, progress_stage_label_, timer_callback(), timer_id_, cursor::WAIT, work_, and worker_.

void gui2::tloadscreen::progress ( const char *  stage_name = nullptr)
static
void gui2::tloadscreen::timer_callback ( twindow window)
private
virtual const std::string& gui2::tloadscreen::window_id ( ) const
privatevirtual

The id of the window to build.

Implements gui2::tdialog.

Referenced by build_window().

Member Data Documentation

int gui2::tloadscreen::animation_counter_
private

Definition at line 63 of file loadscreen.hpp.

Referenced by timer_callback().

tlabel* gui2::tloadscreen::animation_label_
private

Definition at line 81 of file loadscreen.hpp.

Referenced by pre_show(), and timer_callback().

std::vector<t_string> gui2::tloadscreen::animation_stages_
private

Definition at line 91 of file loadscreen.hpp.

Referenced by timer_callback().

tloadscreen * gui2::tloadscreen::current_load = nullptr
staticprivate

Definition at line 82 of file loadscreen.hpp.

Referenced by display(), displaying(), progress(), and ~tloadscreen().

std::atomic<const char*> gui2::tloadscreen::current_stage_
private

Definition at line 88 of file loadscreen.hpp.

Referenced by progress(), and timer_callback().

std::map<std::string, t_string>::const_iterator gui2::tloadscreen::current_visible_stage_
private

Definition at line 92 of file loadscreen.hpp.

Referenced by timer_callback().

boost::scoped_ptr<cursor::setter> gui2::tloadscreen::cursor_setter_
private

Definition at line 66 of file loadscreen.hpp.

Referenced by post_show(), and pre_show().

tlabel* gui2::tloadscreen::progress_stage_label_
private

Definition at line 80 of file loadscreen.hpp.

Referenced by pre_show(), and timer_callback().

size_t gui2::tloadscreen::timer_id_
private

Definition at line 62 of file loadscreen.hpp.

Referenced by post_show(), and pre_show().

std::map<std::string, t_string> gui2::tloadscreen::visible_stages_
private

Definition at line 90 of file loadscreen.hpp.

Referenced by timer_callback().

twindow* gui2::tloadscreen::window_
private

Definition at line 61 of file loadscreen.hpp.

Referenced by close().

std::function<void()> gui2::tloadscreen::work_
private

Definition at line 64 of file loadscreen.hpp.

Referenced by pre_show(), and timer_callback().

boost::scoped_ptr<boost::thread> gui2::tloadscreen::worker_
private

Definition at line 65 of file loadscreen.hpp.

Referenced by post_show(), pre_show(), and timer_callback().


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