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

Storyscreen part user interface. More...

#include <render.hpp>

Inheritance diagram for storyscreen::part_ui:
Inheritance graph

Public Types

enum  RESULT { NEXT, BACK, QUIT }
 Storyscreen result. More...
 

Public Member Functions

 part_ui (part &p, CVideo &video, gui::button &next_button, gui::button &back_button, gui::button &play_button)
 Constructor. More...
 
RESULT show ()
 Render and display the storyscreen, process and return user input. More...
 
virtual void handle_event (const SDL_Event &)
 
virtual void handle_window_event (const SDL_Event &event)
 
- Public Member Functions inherited from events::sdl_handler
virtual void process_event ()
 
virtual void draw ()
 
virtual void volatile_draw ()
 
virtual void volatile_undraw ()
 
virtual bool requires_event_focus (const SDL_Event *=nullptr) const
 
virtual void process_help_string (int, int)
 
virtual void process_tooltip_string (int, int)
 
virtual void join ()
 
virtual void join (context &c)
 
virtual void join_same (sdl_handler *parent)
 
virtual void leave ()
 
virtual void join_global ()
 
virtual void leave_global ()
 

Private Member Functions

void prepare_background ()
 Constructor implementation details. More...
 
void prepare_geometry ()
 Constructor implementation details. More...
 
void prepare_floating_images ()
 Constructor implementation details. More...
 
void render_background ()
 
void render_title_box ()
 
void render_story_box ()
 
void render_story_box_borders (SDL_Rect &)
 
bool handle_interface ()
 Returns true if the user did an action. More...
 
bool render_floating_images ()
 Renders all floating images in sequence. More...
 
void wait_for_input ()
 

Private Attributes

partp_
 
CVideovideo_
 
CKey keys_
 
gui::buttonnext_button_
 
gui::buttonback_button_
 
gui::buttonplay_button_
 
bool dirty_
 
RESULT ret_
 
bool skip_
 
bool last_key_
 
double x_scale_factor_
 
double y_scale_factor_
 
SDL_Rect base_rect_
 
surface background_
 
std::vector
< floating_image::render_input
imgs_
 
bool has_background_
 
int text_x_
 
int text_y_
 
int buttons_x_
 
int buttons_y_
 

Additional Inherited Members

- Protected Member Functions inherited from events::sdl_handler
 sdl_handler (const bool auto_join=true)
 
virtual ~sdl_handler ()
 
virtual std::vector
< sdl_handler * > 
handler_members ()
 

Detailed Description

Storyscreen part user interface.

This works on the assumption, like the old one, that the screen cannot be resized while we are at this. More specifically, it is assumed that the screen dimensions remain constant between the constructor call, and the destruction of the objects.

Definition at line 43 of file render.hpp.

Member Enumeration Documentation

Storyscreen result.

Enumerator
NEXT 

The user pressed the go-next button.

BACK 

The user pressed the go-back button.

QUIT 

The user selected quit.

Definition at line 47 of file render.hpp.

Constructor & Destructor Documentation

storyscreen::part_ui::part_ui ( part p,
CVideo video,
gui::button next_button,
gui::button back_button,
gui::button play_button 
)

Constructor.

Parameters
pA storyscreen::part with the required information and parameters.
dispDisplay.
next_buttonNext button. Shouldn't be destroyed before the part_ui object.

Definition at line 88 of file render.cpp.

Member Function Documentation

void storyscreen::part_ui::handle_event ( const SDL_Event &  event)
virtual

Implements events::sdl_handler.

Definition at line 992 of file render.cpp.

References dirty_, events::sdl_handler::draw(), and DRAW_ALL_EVENT.

bool storyscreen::part_ui::handle_interface ( )
private
void storyscreen::part_ui::handle_window_event ( const SDL_Event &  event)
virtual
void storyscreen::part_ui::prepare_background ( )
private
void storyscreen::part_ui::prepare_floating_images ( )
private

Constructor implementation details.

Definition at line 301 of file render.cpp.

References base_rect_, storyscreen::part::get_floating_images(), imgs_, p_, x_scale_factor_, and y_scale_factor_.

Referenced by handle_window_event(), and show().

void storyscreen::part_ui::prepare_geometry ( )
private
void storyscreen::part_ui::render_background ( )
private
bool storyscreen::part_ui::render_floating_images ( )
private
void storyscreen::part_ui::render_story_box ( )
private
void storyscreen::part_ui::render_story_box_borders ( SDL_Rect &  update_area)
private
void storyscreen::part_ui::render_title_box ( )
private
part_ui::RESULT storyscreen::part_ui::show ( )
void storyscreen::part_ui::wait_for_input ( )
private

Definition at line 912 of file render.cpp.

References CVideo::delay(), handle_interface(), last_key_, LOG_NG, and skip_.

Referenced by render_story_box().

Member Data Documentation

gui::button& storyscreen::part_ui::back_button_
private

Definition at line 77 of file render.hpp.

Referenced by handle_interface(), prepare_geometry(), render_story_box(), and render_title_box().

surface storyscreen::part_ui::background_
private

Definition at line 96 of file render.hpp.

Referenced by prepare_background(), and render_background().

SDL_Rect storyscreen::part_ui::base_rect_
private

Definition at line 90 of file render.hpp.

Referenced by prepare_background(), prepare_floating_images(), and render_title_box().

int storyscreen::part_ui::buttons_x_
private

Definition at line 101 of file render.hpp.

Referenced by prepare_geometry(), and render_story_box().

int storyscreen::part_ui::buttons_y_
private

Definition at line 101 of file render.hpp.

Referenced by prepare_geometry().

bool storyscreen::part_ui::dirty_
private

Definition at line 80 of file render.hpp.

Referenced by handle_event(), handle_window_event(), and render_story_box().

bool storyscreen::part_ui::has_background_
private

Definition at line 99 of file render.hpp.

Referenced by prepare_background(), and render_story_box_borders().

std::vector< floating_image::render_input > storyscreen::part_ui::imgs_
private

Definition at line 98 of file render.hpp.

Referenced by prepare_floating_images(), render_floating_images(), and render_story_box().

CKey storyscreen::part_ui::keys_
private

Definition at line 74 of file render.hpp.

Referenced by handle_interface().

bool storyscreen::part_ui::last_key_
private
gui::button& storyscreen::part_ui::next_button_
private

Definition at line 76 of file render.hpp.

Referenced by handle_interface(), prepare_geometry(), render_story_box(), and render_title_box().

part& storyscreen::part_ui::p_
private
gui::button& storyscreen::part_ui::play_button_
private

Definition at line 78 of file render.hpp.

Referenced by handle_interface(), prepare_geometry(), render_story_box(), and render_title_box().

RESULT storyscreen::part_ui::ret_
private

Definition at line 82 of file render.hpp.

Referenced by handle_interface(), and show().

bool storyscreen::part_ui::skip_
private
int storyscreen::part_ui::text_x_
private

Definition at line 101 of file render.hpp.

Referenced by prepare_geometry(), and render_story_box().

int storyscreen::part_ui::text_y_
private

Definition at line 101 of file render.hpp.

Referenced by prepare_geometry(), and render_story_box().

CVideo& storyscreen::part_ui::video_
private
double storyscreen::part_ui::x_scale_factor_
private

Definition at line 85 of file render.hpp.

Referenced by prepare_background(), and prepare_floating_images().

double storyscreen::part_ui::y_scale_factor_
private

Definition at line 86 of file render.hpp.

Referenced by prepare_background(), and prepare_floating_images().


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