Public Types | Public Member Functions | Private Member Functions | Private Attributes

storyscreen::part_ui Class Reference

Storyscreen part user interface. More...

#include <render.hpp>

Collaboration diagram for storyscreen::part_ui:
Collaboration graph
[legend]

List of all members.

Public Types

enum  RESULT { NEXT, BACK, QUIT }
 

Storyscreen result.

More...

Public Member Functions

 part_ui (part &p, display &disp, gui::button &next_button, gui::button &back_button, gui::button &play_button)
 Constructor.
RESULT show ()
 Render and display the storyscreen, process and return user input.

Private Member Functions

void prepare_background ()
 Constructor implementation details.
void prepare_geometry ()
 Constructor implementation details.
void prepare_floating_images ()
 Constructor implementation details.
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.
bool render_floating_images ()
 Renders all floating images in sequence.
void wait_for_input ()

Private Attributes

partp_
displaydisp_
CVideovideo_
CKey keys_
gui::buttonnext_button_
gui::buttonback_button_
gui::buttonplay_button_
RESULT ret_
bool skip_
bool last_key_
double 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_

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,
display disp,
gui::button next_button,
gui::button back_button,
gui::button play_button 
)

Constructor.

Parameters:
p A storyscreen::part with the required information and parameters.
disp Display.
next_button Next button. Shouldn't be destroyed before the part_ui object.
skip_button Skip button. Shouldn't be destroyed before the part_ui object.

Definition at line 80 of file render.cpp.

References prepare_background(), prepare_floating_images(), and prepare_geometry().

Here is the call graph for this function:


Member Function Documentation

bool storyscreen::part_ui::handle_interface (  )  [private]

Returns true if the user did an action.

Modifies ret_, skip_, and last_key_ accordingly.

Definition at line 479 of file render.cpp.

References back_button_, disp_, display::flip(), keys_, last_key_, next_button_, play_button_, gui::button::pressed(), events::pump(), events::raise_draw_event(), events::raise_process_event(), gui::button::release(), ret_, and skip_.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void storyscreen::part_ui::prepare_background (  )  [private]

Constructor implementation details.

Definition at line 105 of file render.cpp.

References ASSERT_LOG, surface::assign(), storyscreen::part::background(), background_, create_neutral_surface(), image::get_image(), CVideo::getx(), CVideo::gety(), h, has_background_, surface::null(), p_, storyscreen::part::scale_background(), scale_factor_, scale_surface(), and video_.

Referenced by part_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

void storyscreen::part_ui::prepare_floating_images (  )  [private]

Constructor implementation details.

Definition at line 167 of file render.cpp.

References base_rect_, storyscreen::part::get_floating_images(), storyscreen::floating_image::get_render_input(), imgs_, p_, and scale_factor_.

Referenced by part_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

void storyscreen::part_ui::prepare_geometry (  )  [private]

Constructor implementation details.

Definition at line 126 of file render.cpp.

References back_button_, background_, base_rect_, storyscreen::part::BLOCK_MIDDLE, storyscreen::part::BLOCK_TOP, buttons_x_, buttons_y_, CVideo::getx(), CVideo::gety(), next_button_, p_, play_button_, gui::widget::set_location(), gui::widget::set_volatile(), storyscreen::part::story_text_location(), text_x_, text_y_, video_, and gui::widget::width().

Referenced by part_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

void storyscreen::part_ui::render_background (  )  [private]

Definition at line 175 of file render.cpp.

References background_, base_rect_, draw_solid_tinted_rectangle(), CVideo::getSurface(), CVideo::getx(), CVideo::gety(), sdl_blit(), and video_.

Referenced by show().

Here is the call graph for this function:

Here is the caller graph for this function:

bool storyscreen::part_ui::render_floating_images (  )  [private]

Renders all floating images in sequence.

Returns:
'true' if the user interrupted the operation; 'false' otherwise.

Definition at line 184 of file render.cpp.

References display::delay(), disp_, storyscreen::floating_image::display_delay(), storyscreen::part::get_floating_images(), CVideo::getSurface(), handle_interface(), storyscreen::floating_image::render_input::image, imgs_, last_key_, surface::null(), p_, events::raise_draw_event(), storyscreen::floating_image::render_input::rect, sdl_blit(), skip_, update_rect(), update_whole_screen(), and video_.

Referenced by show().

Here is the call graph for this function:

Here is the caller graph for this function:

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 (  ) 

Render and display the storyscreen, process and return user input.

Definition at line 521 of file render.cpp.

References ERR_NG, imgs_, storyscreen::part::music(), p_, sound::play_music_repeatedly(), sound::play_sound(), render_background(), render_floating_images(), render_story_box(), render_title_box(), ret_, storyscreen::part::show_title(), and storyscreen::part::sound().

Referenced by storyscreen::controller::show().

Here is the call graph for this function:

Here is the caller graph for this function:

void storyscreen::part_ui::wait_for_input (  )  [private]

Definition at line 468 of file render.cpp.

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

Referenced by render_story_box().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 75 of file render.hpp.

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

Definition at line 87 of file render.hpp.

Referenced by prepare_background(), prepare_geometry(), and render_background().

Definition at line 91 of file render.hpp.

Referenced by prepare_geometry(), and render_story_box().

Definition at line 91 of file render.hpp.

Referenced by prepare_geometry().

Definition at line 89 of file render.hpp.

Referenced by prepare_background(), and render_story_box_borders().

Definition at line 88 of file render.hpp.

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

Definition at line 72 of file render.hpp.

Referenced by handle_interface().

Definition at line 74 of file render.hpp.

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

Definition at line 76 of file render.hpp.

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

Definition at line 78 of file render.hpp.

Referenced by handle_interface(), and show().

Definition at line 81 of file render.hpp.

Referenced by prepare_background(), and prepare_floating_images().

Definition at line 91 of file render.hpp.

Referenced by prepare_geometry(), and render_story_box().

Definition at line 91 of file render.hpp.

Referenced by prepare_geometry(), and render_story_box().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:26:05 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs